'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var props = require('../props.cjs');

var ATabPane = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ATabPane",
  inheritAttrs: false,
  __ANT_TAB_PANE: true,
  props: props.tabPaneProps(),
  slots: Object,
  setup(props, {
    attrs,
    slots
  }) {
    const visited = vue.ref(props.forceRender);
    vue.watch([() => props.active, () => props.destroyInactiveTabPane], () => {
      if (props.active)
        visited.value = true;
      else if (props.destroyInactiveTabPane)
        visited.value = false;
    }, {
      immediate: true
    });
    const mergedStyle = vue.computed(() => {
      if (!props.active) {
        if (props.animated) {
          return {
            visibility: "hidden",
            height: 0,
            overflowY: "hidden"
          };
        } else {
          return {
            display: "none"
          };
        }
      }
      return {};
    });
    return () => {
      var _a;
      const {
        prefixCls,
        forceRender,
        id,
        active,
        tabKey
      } = props;
      return vue.createVNode("div", {
        "id": id && `${id}-panel-${tabKey}`,
        "role": "tabpanel",
        "tabindex": active ? 0 : -1,
        "aria-labelledby": id && `${id}-tab-${tabKey}`,
        "aria-hidden": !active,
        "style": [mergedStyle.value, attrs.style],
        "class": [`${prefixCls}-tabpane`, active && `${prefixCls}-tabpane-active`, attrs.class]
      }, [(active || visited.value || forceRender) && ((_a = slots.default) == null ? void 0 : _a.call(slots))]);
    };
  }
});

exports.default = ATabPane;
//# sourceMappingURL=TabPane.cjs.map
