/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import Vue from 'vue';
import { renderContent } from '../../utils/render-node.js';
import { updateElement } from '../../hooks/use-destroy-onclose.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import { TabsPanelProps } from './props.js';
import 'lodash';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import '../../_chunks/dep-def4c2ce.js';

const classPrefixMixins = getClassPrefixMixins("tab-panel");
var _TabPanel = mixins(Vue, classPrefixMixins).extend({
  name: "LTabPanel",
  props: {
    ...TabsPanelProps
  },
  inject: {
    parent: {
      default: null
    }
  },
  computed: {
    active() {
      const {
        value
      } = this.parent || {};
      return this.value === value;
    }
  },
  updated() {
    var _this$parent, _this$parent$updatePa;
    (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : (_this$parent$updatePa = _this$parent.updatePanels) === null || _this$parent$updatePa === void 0 ? void 0 : _this$parent$updatePa.call(_this$parent, {
      force: true
    });
    if (!this.destroyOnHide) {
      const timer = setTimeout(() => {
        updateElement(this);
        clearTimeout(timer);
      }, 0);
    }
  },
  render() {
    const h = arguments[0];
    const {
      destroyOnHide,
      active
    } = this;
    if (destroyOnHide && !active) return null;
    return h("div", {
      "class": this.componentName,
      "directives": [{
        name: "show",
        value: active
      }]
    }, [renderContent(this, "default", "panel")]);
  }
});

export { _TabPanel as default };
//# sourceMappingURL=tab-panel.js.map
