/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

import Vue from 'vue';
import { renderContent } from '../../utils/render-node.js';
import { updateElement } from '../../hooks/useDestroyOnClose.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 'lodash/merge';
import '../../_chunks/dep-b4fd1955.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() {
    this.parent?.updatePanels?.({
      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
