/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

import { _ as _defineProperty } from '../_chunks/dep-2db7b3ec.mjs';
import { isVNode, defineComponent, ref, computed, watch, nextTick, onMounted, createVNode, mergeProps } from 'vue';
import { p as pick_1 } from '../_chunks/dep-8932db97.mjs';
import useVirtualScroll from '../hooks/useVirtualScrollNew.mjs';
import { Loading } from '../loading/index.mjs';
import { useTNodeJSX } from '../hooks/tnode.mjs';
import '../hooks/useConfig.mjs';
import { Affix } from '../affix/index.mjs';
import { getIEVersion } from '../_common/js/utils/helper.mjs';
import baseTableProps from './base-table-props.mjs';
import useTableHeader from './hooks/useTableHeader.mjs';
import useColumnResize from './hooks/useColumnResize.mjs';
import useFixed from './hooks/useFixed.mjs';
import usePagination from './hooks/usePagination.mjs';
import useAffix from './hooks/useAffix.mjs';
import TBody, { extendTableProps } from './tbody.mjs';
import useStyle, { formatCSSUnit } from './hooks/useStyle.mjs';
import useClassName from './hooks/useClassName.mjs';
import { ROW_LISTENERS } from './tr.mjs';
import THead from './thead.mjs';
import TFoot from './tfoot.mjs';
import { getAffixProps } from './utils.mjs';
import { useConfig } from '../config-provider/useConfig.mjs';
import '../_chunks/dep-255303ba.mjs';
import '../_chunks/dep-eba0ea6e.mjs';
import '../_chunks/dep-0d3dd4b5.mjs';
import '../_chunks/dep-b57180d0.mjs';
import '../_chunks/dep-c8d7b6b4.mjs';
import '../_chunks/dep-2bc37d52.mjs';
import '../_chunks/dep-469b4ae0.mjs';
import '../_chunks/dep-3da99438.mjs';
import '../_chunks/dep-bc1d737a.mjs';
import '../_chunks/dep-4d7a675b.mjs';
import '../_chunks/dep-5717e263.mjs';
import '../_chunks/dep-a8bcacea.mjs';
import '../_chunks/dep-2e7f59b1.mjs';
import '../_chunks/dep-855db8bc.mjs';
import '../_chunks/dep-42cc3015.mjs';
import '../_chunks/dep-550c24c1.mjs';
import '../_chunks/dep-a87f3e4c.mjs';
import '../_chunks/dep-1e566bb5.mjs';
import '../_chunks/dep-42a19209.mjs';
import '../_chunks/dep-1434aa15.mjs';
import '../_chunks/dep-9fe2ef12.mjs';
import '../_chunks/dep-6884627f.mjs';
import '../_chunks/dep-8d3e9aa3.mjs';
import '../_chunks/dep-0fc02184.mjs';
import '../_chunks/dep-bf1e33c8.mjs';
import '../_chunks/dep-b8d7992c.mjs';
import '../_chunks/dep-84acf3c2.mjs';
import '../hooks/useResizeObserver.mjs';
import '../utils/withInstall.mjs';
import '../loading/directive.mjs';
import '../loading/plugin.mjs';
import '../utils/dom.mjs';
import '../_chunks/dep-876fb3ec.mjs';
import '../utils/easing.mjs';
import '../loading/loading.mjs';
import '../utils/render-tnode.mjs';
import '../_chunks/dep-888e80c4.mjs';
import '../_chunks/dep-334a4f6b.mjs';
import '../_chunks/dep-e5eb9f23.mjs';
import '../_chunks/dep-672e7d1a.mjs';
import '../_chunks/dep-9262ee2f.mjs';
import '../_chunks/dep-406cd044.mjs';
import '../_chunks/dep-327559e8.mjs';
import '../_chunks/dep-b2235f26.mjs';
import '../_chunks/dep-8b989474.mjs';
import '../_chunks/dep-1372b2d3.mjs';
import '../_chunks/dep-9a85dac1.mjs';
import '../hooks/useTeleport.mjs';
import '../loading/props.mjs';
import '../loading/icon/gradient.mjs';
import '../_common/js/loading/circle-adapter.mjs';
import '../_common/js/utils/set-style.mjs';
import '../_chunks/dep-095107f7.mjs';
import '../_chunks/dep-c989dff3.mjs';
import '../_chunks/dep-9cf86cf1.mjs';
import '../_chunks/dep-40d69a9c.mjs';
import '../_chunks/dep-dcc83161.mjs';
import '../_chunks/dep-f1994936.mjs';
import '../_chunks/dep-345e1be3.mjs';
import '../_common/js/global-config/default-config.mjs';
import '../_common/js/global-config/locale/zh_CN.mjs';
import '../_chunks/dep-9888611c.mjs';
import '../_chunks/dep-697a1365.mjs';
import '../config-provider/type.mjs';
import '../_chunks/dep-60fae668.mjs';
import '../_chunks/dep-ed5ebb35.mjs';
import '../_chunks/dep-78847b2e.mjs';
import '../_chunks/dep-3f21269a.mjs';
import '../loading/style/css.mjs';
import '../loading/type.mjs';
import '../affix/affix.mjs';
import '../_chunks/dep-38ee6a8f.mjs';
import '../affix/props.mjs';
import '../affix/style/css.mjs';
import '../affix/type.mjs';
import './ellipsis.mjs';
import '../_chunks/dep-9b6cf76d.mjs';
import '../_chunks/dep-f709f709.mjs';
import '../tooltip/index.mjs';
import '../tooltip/tooltip.mjs';
import '../_chunks/dep-350764bc.mjs';
import '../popup/props.mjs';
import '../popup/index.mjs';
import '../popup/popup.mjs';
import '@popperjs/core';
import '../hooks/useVModel.mjs';
import '../popup/container.mjs';
import '../popup/style/css.mjs';
import '../popup/type.mjs';
import '../tooltip/util.mjs';
import '../tooltip/props.mjs';
import '../tooltip/style/css.mjs';
import '../tooltip/type.mjs';
import './hooks/useMultiHeader.mjs';
import '../_chunks/dep-c81c0ee4.mjs';
import '../_common/js/log/index.mjs';
import '../_common/js/log/log.mjs';
import '../_common/js/utils/getScrollbarWidth.mjs';
import '../pagination/index.mjs';
import '../pagination/pagination.mjs';
import '@ldesign/icons-vue-next';
import '../hooks/useGlobalIcon.mjs';
import '../input-number/index.mjs';
import '../input-number/input-number.mjs';
import '../button/index.mjs';
import '../button/button.mjs';
import '../hooks/useRipple.mjs';
import '../utils/set-style.mjs';
import '../hooks/useKeepAnimation.mjs';
import '../form/hooks.mjs';
import '../button/props.mjs';
import '../button/style/css.mjs';
import '../button/type.mjs';
import '../input/index.mjs';
import '../input/input.mjs';
import '../input/props.mjs';
import '../input/useInput.mjs';
import '../form/const.mjs';
import '../hooks/index.mjs';
import '../hooks/icon.mjs';
import '../hooks/slot.mjs';
import '../hooks/useCommonClassName.mjs';
import '../hooks/useDefaultValue.mjs';
import '../hooks/useDestroyOnClose.mjs';
import '../hooks/useVirtualScroll.mjs';
import '../input/useLengthLimit.mjs';
import '../input/useInputEventHandler.mjs';
import '../input/useInputWidth.mjs';
import '../input/input-group.mjs';
import '../input/input-group-props.mjs';
import '../input/style/css.mjs';
import '../input/type.mjs';
import '../input-number/props.mjs';
import '../input-number/useInputNumber.mjs';
import '../_common/js/input-number/number.mjs';
import '../_chunks/dep-01e3f446.mjs';
import '../_common/js/input-number/large-number.mjs';
import '../input-number/style/css.mjs';
import '../input-number/type.mjs';
import '../select/index.mjs';
import '../select/select.mjs';
import '../_chunks/dep-85ed244c.mjs';
import '../_chunks/dep-c42916c7.mjs';
import '../common-components/fake-arrow.mjs';
import '../select-input/index.mjs';
import '../select-input/select-input.mjs';
import '../select-input/props.mjs';
import '../select-input/useSingle.mjs';
import '../select-input/useMultiple.mjs';
import '../tag-input/index.mjs';
import '../tag-input/tag-input.mjs';
import '../tag-input/props.mjs';
import '../tag-input/hooks/useTagScroll.mjs';
import '../tag-input/useTagList.mjs';
import '../tag/index.mjs';
import '../tag/tag.mjs';
import '../tag/props.mjs';
import '../tag/check-tag.mjs';
import '../tag/check-tag-props.mjs';
import '../tag/style/css.mjs';
import '../tag/type.mjs';
import '../tag-input/hooks/useHover.mjs';
import '../tag-input/hooks/useDragSorter.mjs';
import '../tag-input/style/css.mjs';
import '../tag-input/type.mjs';
import '../select-input/useOverlayInnerStyle.mjs';
import '../select-input/style/css.mjs';
import '../select-input/type.mjs';
import '../select/props.mjs';
import '../select/select-panel.mjs';
import '../select/option.mjs';
import '../checkbox/index.mjs';
import '../checkbox/checkbox.mjs';
import '../checkbox/props.mjs';
import '../checkbox/constants.mjs';
import '../checkbox/group.mjs';
import '../checkbox/checkbox-group-props.mjs';
import '../checkbox/style/css.mjs';
import '../checkbox/type.mjs';
import '../select/option-props.mjs';
import '../select/helper.mjs';
import '../select/optionGroup.mjs';
import '../select/option-group-props.mjs';
import '../select/hooks/usePanelVirtualScroll.mjs';
import '../select/hooks/useSelectOptions.mjs';
import '../select/style/css.mjs';
import '../select/type.mjs';
import '../input-adornment/index.mjs';
import '../input-adornment/input-adornment.mjs';
import '../input-adornment/props.mjs';
import '../input-adornment/style/css.mjs';
import '../input-adornment/type.mjs';
import '../pagination/props.mjs';
import '../pagination/usePaginationClasses.mjs';
import '../pagination/useMoreAction.mjs';
import '../pagination/pagination-mini.mjs';
import '../pagination/pagination-mini-props.mjs';
import '../pagination/style/css.mjs';
import '../pagination/type.mjs';
import './hooks/useRowspanAndColspan.mjs';
import './hooks/useLazyLoad.mjs';
import '../_common/js/utils/observe.mjs';

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _isSlot(s) {
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
}
var BASE_TABLE_EVENTS = ["page-change", "cell-click", "scroll", "scrollX", "scrollY"];
var BASE_TABLE_ALL_EVENTS = ROW_LISTENERS.map(function (t) {
  return "row-".concat(t);
}).concat(BASE_TABLE_EVENTS);
var _BaseTable = defineComponent({
  name: "TBaseTable",
  props: _objectSpread(_objectSpread({}, baseTableProps), {}, {
    renderExpandedRow: Function,
    onLeafColumnsChange: Function,
    thDraggable: Boolean
  }),
  setup: function setup(props2, context) {
    var renderTNode = useTNodeJSX();
    var tableRef = ref();
    var tableElmRef = ref();
    var tableBodyRef = ref();
    var bottomContentRef = ref();
    var tableFootHeight = ref(0);
    var _useClassName = useClassName(),
      classPrefix = _useClassName.classPrefix,
      virtualScrollClasses = _useClassName.virtualScrollClasses,
      tableLayoutClasses = _useClassName.tableLayoutClasses,
      tableBaseClass = _useClassName.tableBaseClass,
      tableColFixedClasses = _useClassName.tableColFixedClasses;
    var _useStyle = useStyle(props2),
      tableClasses = _useStyle.tableClasses,
      sizeClassNames = _useStyle.sizeClassNames,
      tableContentStyles = _useStyle.tableContentStyles,
      tableElementStyles = _useStyle.tableElementStyles;
    var _useConfig = useConfig("table"),
      globalConfig = _useConfig.globalConfig;
    var _useTableHeader = useTableHeader(props2),
      isMultipleHeader = _useTableHeader.isMultipleHeader,
      spansAndLeafNodes = _useTableHeader.spansAndLeafNodes,
      thList = _useTableHeader.thList;
    var finalColumns = computed(function () {
      var _spansAndLeafNodes$va;
      return ((_spansAndLeafNodes$va = spansAndLeafNodes.value) === null || _spansAndLeafNodes$va === void 0 ? void 0 : _spansAndLeafNodes$va.leafColumns) || props2.columns;
    });
    var paginationAffixRef = ref();
    var horizontalScrollAffixRef = ref();
    var headerTopAffixRef = ref();
    var footerBottomAffixRef = ref();
    var _useFixed = useFixed(props2, context, finalColumns, {
        paginationAffixRef: paginationAffixRef,
        horizontalScrollAffixRef: horizontalScrollAffixRef,
        headerTopAffixRef: headerTopAffixRef,
        footerBottomAffixRef: footerBottomAffixRef
      }),
      scrollbarWidth = _useFixed.scrollbarWidth,
      virtualScrollHeaderPos = _useFixed.virtualScrollHeaderPos,
      tableWidth = _useFixed.tableWidth,
      tableElmWidth = _useFixed.tableElmWidth,
      tableContentRef = _useFixed.tableContentRef,
      isFixedHeader = _useFixed.isFixedHeader,
      isWidthOverflow = _useFixed.isWidthOverflow,
      isFixedColumn = _useFixed.isFixedColumn,
      thWidthList = _useFixed.thWidthList,
      showColumnShadow = _useFixed.showColumnShadow,
      rowAndColFixedPosition = _useFixed.rowAndColFixedPosition,
      setData = _useFixed.setData,
      refreshTable = _useFixed.refreshTable,
      setTableElmWidth = _useFixed.setTableElmWidth,
      emitScrollEvent = _useFixed.emitScrollEvent,
      setUseFixedTableElmRef = _useFixed.setUseFixedTableElmRef,
      updateColumnFixedShadow = _useFixed.updateColumnFixedShadow,
      getThWidthList = _useFixed.getThWidthList,
      updateThWidthList = _useFixed.updateThWidthList,
      addTableResizeObserver = _useFixed.addTableResizeObserver,
      updateTableAfterColumnResize = _useFixed.updateTableAfterColumnResize;
    var _useAffix = useAffix(props2),
      affixHeaderRef = _useAffix.affixHeaderRef,
      affixFooterRef = _useAffix.affixFooterRef,
      horizontalScrollbarRef = _useAffix.horizontalScrollbarRef,
      paginationRef = _useAffix.paginationRef,
      showAffixHeader = _useAffix.showAffixHeader,
      showAffixFooter = _useAffix.showAffixFooter,
      showAffixPagination = _useAffix.showAffixPagination,
      onHorizontalScroll = _useAffix.onHorizontalScroll,
      setTableContentRef = _useAffix.setTableContentRef,
      updateAffixHeaderOrFooter = _useAffix.updateAffixHeaderOrFooter;
    var _usePagination = usePagination(props2, context),
      dataSource = _usePagination.dataSource,
      innerPagination = _usePagination.innerPagination,
      isPaginateData = _usePagination.isPaginateData,
      renderPagination = _usePagination.renderPagination;
    var columnResizeParams = useColumnResize({
      isWidthOverflow: isWidthOverflow,
      tableContentRef: tableContentRef,
      showColumnShadow: showColumnShadow,
      getThWidthList: getThWidthList,
      updateThWidthList: updateThWidthList,
      setTableElmWidth: setTableElmWidth,
      updateTableAfterColumnResize: updateTableAfterColumnResize
    });
    var resizeLineRef = columnResizeParams.resizeLineRef,
      resizeLineStyle = columnResizeParams.resizeLineStyle,
      setEffectColMap = columnResizeParams.setEffectColMap;
    var dynamicBaseTableClasses = computed(function () {
      var _ref;
      return [tableClasses.value, (_ref = {}, _defineProperty(_ref, tableBaseClass.headerFixed, isFixedHeader.value), _defineProperty(_ref, tableBaseClass.columnFixed, isFixedColumn.value), _defineProperty(_ref, tableBaseClass.widthOverflow, isWidthOverflow.value), _defineProperty(_ref, tableBaseClass.multipleHeader, isMultipleHeader.value), _defineProperty(_ref, tableColFixedClasses.leftShadow, showColumnShadow.left), _defineProperty(_ref, tableColFixedClasses.rightShadow, showColumnShadow.right), _defineProperty(_ref, tableBaseClass.columnResizableTable, props2.resizable), _ref)];
    });
    var tableElmClasses = computed(function () {
      return [[tableLayoutClasses[props2.tableLayout]]];
    });
    var showRightDivider = computed(function () {
      return props2.bordered && isFixedHeader.value && (isMultipleHeader.value && isWidthOverflow.value || !isMultipleHeader.value);
    });
    var dividerBottom = computed(function () {
      var _bottomContentRef$val, _paginationRef$value;
      if (!props2.bordered) return 0;
      var bottomRect = (_bottomContentRef$val = bottomContentRef.value) === null || _bottomContentRef$val === void 0 ? void 0 : _bottomContentRef$val.getBoundingClientRect();
      var paginationRect = (_paginationRef$value = paginationRef.value) === null || _paginationRef$value === void 0 ? void 0 : _paginationRef$value.getBoundingClientRect();
      return ((bottomRect === null || bottomRect === void 0 ? void 0 : bottomRect.height) || 0) + ((paginationRect === null || paginationRect === void 0 ? void 0 : paginationRect.height) || 0);
    });
    watch(tableElmRef, function () {
      setUseFixedTableElmRef(tableElmRef.value);
    });
    watch(function () {
      return [props2.data, dataSource];
    }, function () {
      setData(isPaginateData.value ? dataSource.value : props2.data);
    });
    watch(spansAndLeafNodes, function () {
      var _props2$onLeafColumns;
      (_props2$onLeafColumns = props2.onLeafColumnsChange) === null || _props2$onLeafColumns === void 0 ? void 0 : _props2$onLeafColumns.call(props2, spansAndLeafNodes.value.leafColumns);
      setEffectColMap(spansAndLeafNodes.value.leafColumns, null);
    }, {
      immediate: true
    });
    var onFixedChange = function onFixedChange() {
      nextTick(function () {
        onHorizontalScroll();
        updateAffixHeaderOrFooter();
      });
    };
    var virtualScrollParams = computed(function () {
      return {
        data: props2.data,
        scroll: props2.scroll
      };
    });
    var virtualConfig = useVirtualScroll(tableContentRef, virtualScrollParams);
    var lastScrollY = -1;
    var onInnerVirtualScroll = function onInnerVirtualScroll(e) {
      var target = e.target || e.srcElement;
      var top = target.scrollTop;
      if (lastScrollY !== top) {
        virtualConfig.isVirtualScroll.value && virtualConfig.handleScroll();
      } else {
        lastScrollY = -1;
        updateColumnFixedShadow(target);
      }
      lastScrollY = top;
      emitScrollEvent(e);
    };
    var getTFootHeight = function getTFootHeight() {
      var _tableElmRef$value$qu;
      if (!tableElmRef.value) return;
      tableFootHeight.value = (_tableElmRef$value$qu = tableElmRef.value.querySelector("tfoot")) === null || _tableElmRef$value$qu === void 0 ? void 0 : _tableElmRef$value$qu.getBoundingClientRect().height;
    };
    watch(tableContentRef, function () {
      setTableContentRef(tableContentRef.value);
    });
    watch(tableElmRef, getTFootHeight);
    watch(tableRef, function (tableRef2) {
      addTableResizeObserver(tableRef2);
    });
    onMounted(function () {
      getTFootHeight();
      setTableContentRef(tableContentRef.value);
      addTableResizeObserver(tableRef.value);
    });
    return {
      thList: thList,
      classPrefix: classPrefix,
      innerPagination: innerPagination,
      globalConfig: globalConfig,
      tableFootHeight: tableFootHeight,
      virtualScrollHeaderPos: virtualScrollHeaderPos,
      tableWidth: tableWidth,
      tableElmWidth: tableElmWidth,
      tableRef: tableRef,
      tableElmRef: tableElmRef,
      sizeClassNames: sizeClassNames,
      tableBaseClass: tableBaseClass,
      spansAndLeafNodes: spansAndLeafNodes,
      dynamicBaseTableClasses: dynamicBaseTableClasses,
      tableContentStyles: tableContentStyles,
      tableElementStyles: tableElementStyles,
      dividerBottom: dividerBottom,
      virtualScrollClasses: virtualScrollClasses,
      tableLayoutClasses: tableLayoutClasses,
      tableElmClasses: tableElmClasses,
      tableContentRef: tableContentRef,
      isFixedHeader: isFixedHeader,
      isWidthOverflow: isWidthOverflow,
      isFixedColumn: isFixedColumn,
      rowAndColFixedPosition: rowAndColFixedPosition,
      showColumnShadow: showColumnShadow,
      thWidthList: thWidthList,
      isPaginateData: isPaginateData,
      dataSource: dataSource,
      affixHeaderRef: affixHeaderRef,
      affixFooterRef: affixFooterRef,
      bottomContentRef: bottomContentRef,
      paginationRef: paginationRef,
      showAffixHeader: showAffixHeader,
      showAffixFooter: showAffixFooter,
      scrollbarWidth: scrollbarWidth,
      isMultipleHeader: isMultipleHeader,
      showRightDivider: showRightDivider,
      resizeLineRef: resizeLineRef,
      resizeLineStyle: resizeLineStyle,
      columnResizeParams: columnResizeParams,
      horizontalScrollbarRef: horizontalScrollbarRef,
      tableBodyRef: tableBodyRef,
      virtualConfig: virtualConfig,
      showAffixPagination: showAffixPagination,
      scrollToElement: virtualConfig.scrollToElement,
      renderPagination: renderPagination,
      renderTNode: renderTNode,
      onFixedChange: onFixedChange,
      onHorizontalScroll: onHorizontalScroll,
      updateAffixHeaderOrFooter: updateAffixHeaderOrFooter,
      onInnerVirtualScroll: onInnerVirtualScroll,
      refreshTable: refreshTable,
      paginationAffixRef: paginationAffixRef,
      horizontalScrollAffixRef: horizontalScrollAffixRef,
      headerTopAffixRef: headerTopAffixRef,
      footerBottomAffixRef: footerBottomAffixRef
    };
  },
  render: function render() {
    var _this$spansAndLeafNod,
      _this = this,
      _this$affixHeaderRef,
      _this$footData,
      _this$tableContentRef;
    var rowAndColFixedPosition = this.rowAndColFixedPosition;
    var data = this.isPaginateData ? this.dataSource : this.data;
    var columns = ((_this$spansAndLeafNod = this.spansAndLeafNodes) === null || _this$spansAndLeafNod === void 0 ? void 0 : _this$spansAndLeafNod.leafColumns) || this.columns;
    var columnResizable = computed(function () {
      var _props$allowResizeCol;
      return (_props$allowResizeCol = baseTableProps.allowResizeColumnWidth) !== null && _props$allowResizeCol !== void 0 ? _props$allowResizeCol : baseTableProps.resizable;
    });
    var defaultColWidth = this.tableLayout === "fixed" && this.isWidthOverflow ? "100px" : void 0;
    var renderColGroup = function renderColGroup() {
      var isAffixHeader = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
      return createVNode("colgroup", null, [columns.map(function (col) {
        var style = {
          width: formatCSSUnit((isAffixHeader || columnResizable ? _this.thWidthList[col.colKey] : void 0) || col.width) || defaultColWidth
        };
        if (col.minWidth) style.minWidth = formatCSSUnit(col.minWidth);
        if (!style.width && !col.minWidth && _this.tableLayout === "fixed") style.minWidth = "80px";
        return createVNode("col", {
          "key": col.colKey,
          "style": style
        }, null);
      })]);
    };
    var renderAffixedHeader = function renderAffixedHeader() {
      if (_this.showHeader === false) return null;
      return !!(_this.virtualConfig.isVirtualScroll.value || _this.headerAffixedTop) && (_this.headerAffixedTop ? createVNode(Affix, mergeProps({
        "offsetTop": 0
      }, getAffixProps(_this.headerAffixedTop), {
        "onFixedChange": _this.onFixedChange,
        "ref": "headerTopAffixRef"
      }), _isSlot(affixHeaderWithWrap) ? affixHeaderWithWrap : {
        "default": function _default() {
          return [affixHeaderWithWrap];
        }
      }) : _this.isFixedHeader && affixHeaderWithWrap);
    };
    var renderAffixedHorizontalScrollbar = function renderAffixedHorizontalScrollbar() {
      return createVNode(Affix, mergeProps({
        "offsetBottom": 0
      }, getAffixProps(_this.horizontalScrollAffixedBottom), {
        "style": {
          marginTop: "-".concat(_this.scrollbarWidth * 2, "px")
        },
        "horizontalScrollAffixedBottom": true,
        "ref": "horizontalScrollAffixRef"
      }), {
        "default": function _default() {
          return [createVNode("div", {
            "ref": "horizontalScrollbarRef",
            "class": ["scrollbar", _this.tableBaseClass.obviousScrollbar],
            "style": {
              width: "".concat(_this.tableWidth, "px"),
              overflow: "auto",
              opacity: Number(_this.showAffixFooter)
            }
          }, [createVNode("div", {
            "style": {
              width: "".concat(_this.tableElmWidth, "px"),
              height: "5px"
            }
          }, null)])];
        }
      });
    };
    var headProps = {
      isFixedHeader: this.isFixedHeader,
      rowAndColFixedPosition: this.rowAndColFixedPosition,
      isMultipleHeader: this.isMultipleHeader,
      bordered: this.bordered,
      maxHeight: this.maxHeight,
      height: this.height,
      spansAndLeafNodes: this.spansAndLeafNodes,
      thList: this.thList,
      thWidthList: this.thWidthList,
      resizable: this.resizable,
      columnResizeParams: this.columnResizeParams,
      classPrefix: this.classPrefix,
      ellipsisOverlayClassName: this.size !== "medium" ? this.sizeClassNames[this.size] : "",
      attach: this.attach,
      showColumnShadow: this.showColumnShadow,
      thDraggable: this.thDraggable
    };
    var IEHeaderWrap = getIEVersion() <= 11 ? 4 : 0;
    var barWidth = this.isWidthOverflow ? this.scrollbarWidth : 0;
    var affixHeaderHeight = (((_this$affixHeaderRef = this.affixHeaderRef) === null || _this$affixHeaderRef === void 0 ? void 0 : _this$affixHeaderRef.getBoundingClientRect().height) || 0) - IEHeaderWrap;
    var affixHeaderWrapHeight = affixHeaderHeight - barWidth;
    var headerOpacity = baseTableProps.headerAffixedTop ? Number(this.showAffixHeader) : 1;
    var affixHeaderWrapHeightStyle = {
      width: "".concat(this.tableWidth, "px"),
      height: "".concat(affixHeaderWrapHeight, "px"),
      opacity: headerOpacity
    };
    var affixedLeftBorder = this.bordered ? 1 : 0;
    var affixedHeader = Boolean((this.headerAffixedTop || this.virtualConfig.isVirtualScroll.value) && this.tableWidth) && createVNode("div", {
      "ref": "affixHeaderRef",
      "style": {
        width: "".concat(this.tableWidth - affixedLeftBorder, "px"),
        opacity: Number(this.showAffixHeader)
      },
      "class": ["scrollbar", _defineProperty({}, this.tableBaseClass.affixedHeaderElm, this.headerAffixedTop || this.virtualConfig.isVirtualScroll.value)]
    }, [createVNode("table", {
      "class": this.tableElmClasses,
      "style": _objectSpread(_objectSpread({}, this.tableElementStyles), {}, {
        width: "".concat(this.tableElmWidth, "px")
      })
    }, [renderColGroup(true), createVNode(THead, headProps, this.$slots)])]);
    var affixHeaderWithWrap = createVNode("div", {
      "class": this.tableBaseClass.affixedHeaderWrap,
      "style": affixHeaderWrapHeightStyle
    }, [affixedHeader]);
    var marginScrollbarWidth = this.isWidthOverflow ? this.scrollbarWidth : 0;
    if (this.bordered) marginScrollbarWidth += 1;
    var affixedFooter = Boolean(this.footerAffixedBottom && ((_this$footData = this.footData) === null || _this$footData === void 0 ? void 0 : _this$footData.length) && this.tableWidth) && createVNode(Affix, mergeProps({
      "class": this.tableBaseClass.affixedFooterWrap,
      "onFixedChange": this.onFixedChange,
      "offsetBottom": marginScrollbarWidth || 0
    }, getAffixProps(this.footerAffixedBottom), {
      "style": {
        marginTop: "".concat(-1 * (this.tableFootHeight + marginScrollbarWidth), "px")
      },
      "ref": "footerBottomAffixRef"
    }), {
      "default": function _default() {
        return [createVNode("div", {
          "ref": "affixFooterRef",
          "style": {
            width: "".concat(_this.tableWidth - affixedLeftBorder, "px"),
            opacity: Number(_this.showAffixFooter)
          },
          "class": ["scrollbar", _defineProperty({}, _this.tableBaseClass.affixedFooterElm, _this.footerAffixedBottom || _this.isVirtual)]
        }, [createVNode("table", {
          "class": _this.tableElmClasses,
          "style": _objectSpread(_objectSpread({}, _this.tableElementStyles), {}, {
            width: "".concat(_this.tableElmWidth, "px")
          })
        }, [renderColGroup(true), createVNode(TFoot, {
          "rowKey": _this.rowKey,
          "isFixedHeader": _this.isFixedHeader,
          "rowAndColFixedPosition": rowAndColFixedPosition,
          "footData": _this.footData,
          "columns": columns,
          "rowAttributes": _this.rowAttributes,
          "rowClassName": _this.rowClassName,
          "thWidthList": _this.thWidthList,
          "footerSummary": _this.footerSummary,
          "rowspanAndColspanInFooter": _this.rowspanAndColspanInFooter
        }, _this.$slots)])])];
      }
    });
    var translate = "translate(0, ".concat(this.virtualConfig.scrollHeight.value, "px)");
    var virtualStyle = {
      "transform": translate,
      "-ms-transform": translate,
      "-moz-transform": translate,
      "-webkit-transform": translate
    };
    var virtualConfig = this.virtualConfig;
    var tableBodyProps = _objectSpread(_objectSpread({
      classPrefix: this.classPrefix,
      ellipsisOverlayClassName: this.size !== "medium" ? this.sizeClassNames[this.size] : "",
      rowAndColFixedPosition: rowAndColFixedPosition,
      showColumnShadow: this.showColumnShadow,
      data: virtualConfig.isVirtualScroll.value ? virtualConfig.visibleData.value : data,
      virtualConfig: this.virtualConfig,
      columns: this.spansAndLeafNodes.leafColumns,
      tableElm: this.tableRef,
      tableWidth: this.tableWidth,
      isWidthOverflow: this.isWidthOverflow,
      scroll: this.scroll,
      cellEmptyContent: this.cellEmptyContent,
      tableContentElm: this.tableContentRef,
      handleRowMounted: this.virtualConfig.handleRowMounted,
      renderExpandedRow: this.renderExpandedRow
    }, pick_1(this.$props, extendTableProps)), {}, {
      pagination: this.innerPagination,
      attach: this.attach
    });
    var tableContent = createVNode("div", {
      "ref": "tableContentRef",
      "class": this.tableBaseClass.content,
      "style": this.tableContentStyles,
      "onScroll": this.onInnerVirtualScroll
    }, [this.virtualConfig.isVirtualScroll.value && createVNode("div", {
      "class": this.virtualScrollClasses.cursor,
      "style": virtualStyle
    }, null), createVNode("table", {
      "ref": "tableElmRef",
      "class": this.tableElmClasses,
      "style": _objectSpread(_objectSpread({}, this.tableElementStyles), {}, {
        width: this.resizable && this.isWidthOverflow && this.tableElmWidth ? "".concat(this.tableElmWidth, "px") : this.tableElementStyles.width
      })
    }, [renderColGroup(false), this.showHeader && createVNode(THead, _objectSpread(_objectSpread({}, headProps), {}, {
      thWidthList: columnResizable.value ? this.thWidthList : {}
    }), this.$slots), createVNode(TBody, tableBodyProps, this.$slots), createVNode(TFoot, {
      "rowKey": this.rowKey,
      "isFixedHeader": this.isFixedHeader,
      "rowAndColFixedPosition": rowAndColFixedPosition,
      "footData": this.footData,
      "columns": columns,
      "rowAttributes": this.rowAttributes,
      "rowClassName": this.rowClassName,
      "footerSummary": this.footerSummary,
      "rowspanAndColspanInFooter": this.rowspanAndColspanInFooter
    }, this.$slots)])]);
    var customLoadingText = this.renderTNode("loading");
    var loadingContent = this.loading !== void 0 && createVNode(Loading, mergeProps({
      "loading": !!this.loading,
      "text": customLoadingText ? function () {
        return customLoadingText;
      } : void 0,
      "attach": this.tableRef ? function () {
        return _this.tableRef;
      } : void 0,
      "showOverlay": true,
      "size": "small"
    }, this.loadingProps), null);
    var topContent = this.renderTNode("topContent");
    var bottomContent = this.renderTNode("bottomContent");
    var pagination = createVNode("div", {
      "ref": "paginationRef",
      "class": this.tableBaseClass.paginationWrap,
      "style": {
        opacity: Number(this.showAffixPagination)
      }
    }, [this.renderPagination()]);
    var bottom = !!bottomContent && createVNode("div", {
      "ref": "bottomContentRef",
      "class": this.tableBaseClass.bottomContent
    }, [bottomContent]);
    return createVNode("div", {
      "ref": "tableRef",
      "class": this.dynamicBaseTableClasses,
      "style": "position: relative"
    }, [!!topContent && createVNode("div", {
      "class": this.tableBaseClass.topContent
    }, [topContent]), renderAffixedHeader(), tableContent, affixedFooter, loadingContent, bottom, this.showRightDivider && createVNode("div", {
      "class": this.tableBaseClass.scrollbarDivider,
      "style": {
        right: "".concat(this.scrollbarWidth, "px"),
        bottom: this.dividerBottom ? "".concat(this.dividerBottom, "px") : void 0,
        height: "".concat((_this$tableContentRef = this.tableContentRef) === null || _this$tableContentRef === void 0 ? void 0 : _this$tableContentRef.getBoundingClientRect().height, "px")
      }
    }, null), this.horizontalScrollAffixedBottom && renderAffixedHorizontalScrollbar(), this.paginationAffixedBottom ? createVNode(Affix, mergeProps({
      "offsetBottom": 0
    }, getAffixProps(this.paginationAffixedBottom), {
      "ref": "paginationAffixRef"
    }), _isSlot(pagination) ? pagination : {
      "default": function _default() {
        return [pagination];
      }
    }) : pagination, createVNode("div", {
      "ref": "resizeLineRef",
      "class": this.tableBaseClass.resizeLine,
      "style": this.resizeLineStyle
    }, null)]);
  }
});

export { BASE_TABLE_ALL_EVENTS, BASE_TABLE_EVENTS, _BaseTable as default };
//# sourceMappingURL=base-table.mjs.map
