"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_tabPanel_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_common_relation_parentMap = require("../common/relation/parent-map.js");
const uni_modules_tdesignUniapp_components_common_relation_relation = require("../common/relation/relation.js");
const common_vendor = require("../../../../common/vendor.js");
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-tab-panel`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
  name,
  options: {
    styleIsolation: "shared",
    virtualHost: true
  },
  externalClasses: [`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`],
  mixins: [uni_modules_tdesignUniapp_components_common_relation_relation.ChildrenMixin(uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.TabPanel)],
  props: {
    ...uni_modules_tdesignUniapp_components_tabPanel_props.props
  },
  data() {
    return {
      prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
      classPrefix: name,
      active: false,
      hide: true,
      id: "",
      hasActivated: false,
      tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
    };
  },
  watch: {
    label: "update",
    badgeProps: {
      handler() {
        this.update();
      },
      deep: true
    },
    disabled: "update",
    icon: "update",
    panel: "update",
    value: "update",
    lazy: "update"
  },
  methods: {
    setParent(parent) {
      this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.TabPanel] = parent;
      if (!parent.children.includes(this)) {
        parent.children.push(this);
      }
      parent.innerAfterLinked(this);
    },
    setId(id) {
      this.id = id;
    },
    getComputedName() {
      if (this.value != null) {
        return `${this.value}`;
      }
      return `${this.dataIndex}`;
    },
    update() {
      var _a;
      (_a = this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.TabPanel]) == null ? void 0 : _a.updateTabs();
    },
    render(active, parent) {
      this.initialized = this.initialized || active;
      if (active && !this.hasActivated) {
        this.hasActivated = true;
      }
      this.active = active;
      this.hide = !parent.animation && !active;
    }
  }
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: !_ctx.lazy || _ctx.hasActivated
  }, !_ctx.lazy || _ctx.hasActivated ? common_vendor.e({
    b: _ctx.panel
  }, _ctx.panel ? {
    c: common_vendor.t(_ctx.panel)
  } : {}, {
    d: _ctx.id,
    e: common_vendor.n(_ctx.tClass + " " + _ctx.classPrefix + " " + (_ctx.active ? _ctx.classPrefix + "--active" : _ctx.classPrefix + "--inactive")),
    f: common_vendor.s(_ctx.tools._style([_ctx.customStyle, _ctx.hide ? "display: none" : ""]))
  }) : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-435266d8"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.js.map
