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

'use strict';

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

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var vue = require('vue');
var pick = require('lodash/pick');
var hooks_useVirtualScrollNew = require('../hooks/useVirtualScrollNew.js');
var loading_index = require('../loading/index.js');
var hooks_tnode = require('../hooks/tnode.js');
var configProvider_useConfig = require('../config-provider/useConfig.js');
var affix_index = require('../affix/index.js');
var _common_js_utils_helper = require('../_common/js/utils/helper.js');
var table_baseTableProps = require('./base-table-props.js');
var table_hooks_useTableHeader = require('./hooks/useTableHeader.js');
var table_hooks_useColumnResize = require('./hooks/useColumnResize.js');
var table_hooks_useFixed = require('./hooks/useFixed.js');
var table_hooks_usePagination = require('./hooks/usePagination.js');
var table_hooks_useAffix = require('./hooks/useAffix.js');
var table_tbody = require('./tbody.js');
var table_hooks_useStyle = require('./hooks/useStyle.js');
var table_hooks_useClassName = require('./hooks/useClassName.js');
var table_tr = require('./tr.js');
var table_thead = require('./thead.js');
var table_tfoot = require('./tfoot.js');
var table_utils = require('./utils.js');
require('@babel/runtime/helpers/toConsumableArray');
require('@babel/runtime/helpers/slicedToArray');
require('../hooks/useResizeObserver.js');
require('../utils/withInstall.js');
require('../loading/directive.js');
require('../loading/plugin.js');
require('../utils/dom.js');
require('../_chunks/dep-7f0559c3.js');
require('lodash/isString');
require('lodash/isFunction');
require('lodash/isArray');
require('../utils/easing.js');
require('../hooks/useConfig.js');
require('../loading/loading.js');
require('../utils/render-tnode.js');
require('lodash/isEmpty');
require('lodash/isObject');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../hooks/useTeleport.js');
require('../loading/props.js');
require('../loading/icon/gradient.js');
require('../_common/js/loading/circle-adapter.js');
require('../_common/js/utils/set-style.js');
require('lodash/cloneDeep');
require('../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('dayjs');
require('@babel/runtime/helpers/objectWithoutProperties');
require('lodash/isNull');
require('lodash/isUndefined');
require('lodash/isNumber');
require('../affix/affix.js');
require('@babel/runtime/helpers/asyncToGenerator');
require('@babel/runtime/regenerator');
require('../affix/props.js');
require('./ellipsis.js');
require('lodash/debounce');
require('../tooltip/index.js');
require('../tooltip/tooltip.js');
require('lodash/omit');
require('../popup/props.js');
require('../popup/index.js');
require('../popup/popup.js');
require('@popperjs/core');
require('../hooks/useVModel.js');
require('../popup/container.js');
require('../tooltip/util.js');
require('../tooltip/props.js');
require('./hooks/useMultiHeader.js');
require('lodash/get');
require('../_common/js/log/log.js');
require('../_common/js/utils/getScrollbarWidth.js');
require('../pagination/index.js');
require('../pagination/pagination.js');
require('lodash/isNaN');
require('@ldesign/icons-vue-next');
require('../hooks/useGlobalIcon.js');
require('../input-number/index.js');
require('../input-number/input-number.js');
require('../button/index.js');
require('../button/button.js');
require('../hooks/useRipple.js');
require('../utils/set-style.js');
require('../hooks/useKeepAnimation.js');
require('../form/hooks.js');
require('../button/props.js');
require('../input/index.js');
require('../input/input.js');
require('../input/props.js');
require('../input/useInput.js');
require('../form/const.js');
require('../input/useLengthLimit.js');
require('../input/useInputEventHandler.js');
require('../input/useInputWidth.js');
require('../input/input-group.js');
require('../input/input-group-props.js');
require('../input-number/props.js');
require('../input-number/useInputNumber.js');
require('../hooks/useCommonClassName.js');
require('../_common/js/input-number/number.js');
require('lodash/isNil');
require('../_common/js/input-number/large-number.js');
require('../select/index.js');
require('../select/select.js');
require('lodash/intersection');
require('../common-components/fake-arrow.js');
require('../select-input/index.js');
require('../select-input/select-input.js');
require('../select-input/props.js');
require('../select-input/useSingle.js');
require('../hooks/useDefaultValue.js');
require('../select-input/useMultiple.js');
require('../tag-input/index.js');
require('../tag-input/tag-input.js');
require('../tag-input/props.js');
require('../tag-input/hooks/useTagScroll.js');
require('../tag-input/useTagList.js');
require('../tag/index.js');
require('../tag/tag.js');
require('../tag/props.js');
require('../tag/check-tag.js');
require('../tag/check-tag-props.js');
require('../tag-input/hooks/useHover.js');
require('../tag-input/hooks/useDragSorter.js');
require('../select-input/useOverlayInnerStyle.js');
require('../select/props.js');
require('../select/select-panel.js');
require('../select/option.js');
require('../checkbox/index.js');
require('../checkbox/checkbox.js');
require('../checkbox/props.js');
require('../checkbox/constants.js');
require('../checkbox/group.js');
require('../hooks/slot.js');
require('../checkbox/checkbox-group-props.js');
require('../select/option-props.js');
require('../select/helper.js');
require('../select/optionGroup.js');
require('../select/option-group-props.js');
require('../select/hooks/usePanelVirtualScroll.js');
require('../hooks/useVirtualScroll.js');
require('../select/hooks/useSelectOptions.js');
require('../input-adornment/index.js');
require('../input-adornment/input-adornment.js');
require('../input-adornment/props.js');
require('../pagination/props.js');
require('../pagination/usePaginationClasses.js');
require('../pagination/useMoreAction.js');
require('../pagination/pagination-mini.js');
require('../pagination/pagination-mini-props.js');
require('./hooks/useRowspanAndColspan.js');
require('lodash/upperFirst');
require('./hooks/useLazyLoad.js');
require('../_common/js/utils/observe.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var pick__default = /*#__PURE__*/_interopDefaultLegacy(pick);

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__default["default"](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]' && !vue.isVNode(s);
}
var BASE_TABLE_EVENTS = ["page-change", "cell-click", "scroll", "scrollX", "scrollY"];
var BASE_TABLE_ALL_EVENTS = table_tr.ROW_LISTENERS.map(function (t) {
  return "row-".concat(t);
}).concat(BASE_TABLE_EVENTS);
var _BaseTable = vue.defineComponent({
  name: "TBaseTable",
  props: _objectSpread(_objectSpread({}, table_baseTableProps["default"]), {}, {
    renderExpandedRow: Function,
    onLeafColumnsChange: Function,
    thDraggable: Boolean
  }),
  setup: function setup(props2, context) {
    var renderTNode = hooks_tnode.useTNodeJSX();
    var tableRef = vue.ref();
    var tableElmRef = vue.ref();
    var tableBodyRef = vue.ref();
    var bottomContentRef = vue.ref();
    var tableFootHeight = vue.ref(0);
    var _useClassName = table_hooks_useClassName["default"](),
      classPrefix = _useClassName.classPrefix,
      virtualScrollClasses = _useClassName.virtualScrollClasses,
      tableLayoutClasses = _useClassName.tableLayoutClasses,
      tableBaseClass = _useClassName.tableBaseClass,
      tableColFixedClasses = _useClassName.tableColFixedClasses;
    var _useStyle = table_hooks_useStyle["default"](props2),
      tableClasses = _useStyle.tableClasses,
      sizeClassNames = _useStyle.sizeClassNames,
      tableContentStyles = _useStyle.tableContentStyles,
      tableElementStyles = _useStyle.tableElementStyles;
    var _useConfig = configProvider_useConfig.useConfig("table"),
      globalConfig = _useConfig.globalConfig;
    var _useTableHeader = table_hooks_useTableHeader["default"](props2),
      isMultipleHeader = _useTableHeader.isMultipleHeader,
      spansAndLeafNodes = _useTableHeader.spansAndLeafNodes,
      thList = _useTableHeader.thList;
    var finalColumns = vue.computed(function () {
      var _spansAndLeafNodes$va;
      return ((_spansAndLeafNodes$va = spansAndLeafNodes.value) === null || _spansAndLeafNodes$va === void 0 ? void 0 : _spansAndLeafNodes$va.leafColumns) || props2.columns;
    });
    var paginationAffixRef = vue.ref();
    var horizontalScrollAffixRef = vue.ref();
    var headerTopAffixRef = vue.ref();
    var footerBottomAffixRef = vue.ref();
    var _useFixed = table_hooks_useFixed["default"](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 = table_hooks_useAffix["default"](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 = table_hooks_usePagination["default"](props2, context),
      dataSource = _usePagination.dataSource,
      innerPagination = _usePagination.innerPagination,
      isPaginateData = _usePagination.isPaginateData,
      renderPagination = _usePagination.renderPagination;
    var columnResizeParams = table_hooks_useColumnResize["default"]({
      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 = vue.computed(function () {
      var _ref;
      return [tableClasses.value, (_ref = {}, _defineProperty__default["default"](_ref, tableBaseClass.headerFixed, isFixedHeader.value), _defineProperty__default["default"](_ref, tableBaseClass.columnFixed, isFixedColumn.value), _defineProperty__default["default"](_ref, tableBaseClass.widthOverflow, isWidthOverflow.value), _defineProperty__default["default"](_ref, tableBaseClass.multipleHeader, isMultipleHeader.value), _defineProperty__default["default"](_ref, tableColFixedClasses.leftShadow, showColumnShadow.left), _defineProperty__default["default"](_ref, tableColFixedClasses.rightShadow, showColumnShadow.right), _defineProperty__default["default"](_ref, tableBaseClass.columnResizableTable, props2.resizable), _ref)];
    });
    var tableElmClasses = vue.computed(function () {
      return [[tableLayoutClasses[props2.tableLayout]]];
    });
    var showRightDivider = vue.computed(function () {
      return props2.bordered && isFixedHeader.value && (isMultipleHeader.value && isWidthOverflow.value || !isMultipleHeader.value);
    });
    var dividerBottom = vue.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);
    });
    vue.watch(tableElmRef, function () {
      setUseFixedTableElmRef(tableElmRef.value);
    });
    vue.watch(function () {
      return [props2.data, dataSource];
    }, function () {
      setData(isPaginateData.value ? dataSource.value : props2.data);
    });
    vue.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() {
      vue.nextTick(function () {
        onHorizontalScroll();
        updateAffixHeaderOrFooter();
      });
    };
    var virtualScrollParams = vue.computed(function () {
      return {
        data: props2.data,
        scroll: props2.scroll
      };
    });
    var virtualConfig = hooks_useVirtualScrollNew["default"](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;
    };
    var scrollColumnIntoView = function scrollColumnIntoView(colKey) {
      if (!tableContentRef.value) return;
      var thDom = tableContentRef.value.querySelector("th[data-colkey=\"".concat(colKey, "\"]"));
      var fixedThDom = tableContentRef.value.querySelectorAll("th.t-table__cell--fixed-left");
      var totalWidth = 0;
      for (var i = 0, len = fixedThDom.length; i < len; i++) totalWidth += fixedThDom[i].getBoundingClientRect().width;
      var domRect = thDom.getBoundingClientRect();
      var contentRect = tableContentRef.value.getBoundingClientRect();
      var distance = domRect.left - contentRect.left - totalWidth;
      tableContentRef.value.scrollTo({
        left: distance,
        behavior: "smooth"
      });
    };
    vue.watch(tableContentRef, function () {
      setTableContentRef(tableContentRef.value);
    });
    vue.watch(tableElmRef, getTFootHeight);
    vue.watch(tableRef, function (tableRef2) {
      addTableResizeObserver(tableRef2);
    });
    vue.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,
      scrollColumnIntoView: scrollColumnIntoView,
      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 = vue.computed(function () {
      var _props$allowResizeCol;
      return (_props$allowResizeCol = table_baseTableProps["default"].allowResizeColumnWidth) !== null && _props$allowResizeCol !== void 0 ? _props$allowResizeCol : table_baseTableProps["default"].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 vue.createVNode("colgroup", null, [columns.map(function (col) {
        var style = {
          width: table_hooks_useStyle.formatCSSUnit((isAffixHeader || columnResizable ? _this.thWidthList[col.colKey] : void 0) || col.width) || defaultColWidth
        };
        if (col.minWidth) style.minWidth = table_hooks_useStyle.formatCSSUnit(col.minWidth);
        if (!style.width && !col.minWidth && _this.tableLayout === "fixed") style.minWidth = "80px";
        return vue.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 ? vue.createVNode(affix_index.Affix, vue.mergeProps({
        "offsetTop": 0
      }, table_utils.getAffixProps(_this.headerAffixedTop), {
        "onFixedChange": _this.onFixedChange,
        "ref": "headerTopAffixRef"
      }), _isSlot(affixHeaderWithWrap) ? affixHeaderWithWrap : {
        "default": function _default() {
          return [affixHeaderWithWrap];
        }
      }) : _this.isFixedHeader && affixHeaderWithWrap);
    };
    var renderAffixedHorizontalScrollbar = function renderAffixedHorizontalScrollbar() {
      return vue.createVNode(affix_index.Affix, vue.mergeProps({
        "offsetBottom": 0
      }, table_utils.getAffixProps(_this.horizontalScrollAffixedBottom), {
        "style": {
          marginTop: "-".concat(_this.scrollbarWidth * 2, "px")
        },
        "horizontalScrollAffixedBottom": true,
        "ref": "horizontalScrollAffixRef"
      }), {
        "default": function _default() {
          return [vue.createVNode("div", {
            "ref": "horizontalScrollbarRef",
            "class": ["scrollbar", _this.tableBaseClass.obviousScrollbar],
            "style": {
              width: "".concat(_this.tableWidth, "px"),
              overflow: "auto",
              opacity: Number(_this.showAffixFooter)
            }
          }, [vue.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 = _common_js_utils_helper.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 = table_baseTableProps["default"].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) && vue.createVNode("div", {
      "ref": "affixHeaderRef",
      "style": {
        width: "".concat(this.tableWidth - affixedLeftBorder, "px"),
        opacity: Number(this.showAffixHeader)
      },
      "class": ["scrollbar", _defineProperty__default["default"]({}, this.tableBaseClass.affixedHeaderElm, this.headerAffixedTop || this.virtualConfig.isVirtualScroll.value)]
    }, [vue.createVNode("table", {
      "class": this.tableElmClasses,
      "style": _objectSpread(_objectSpread({}, this.tableElementStyles), {}, {
        width: "".concat(this.tableElmWidth, "px")
      })
    }, [renderColGroup(true), vue.createVNode(table_thead["default"], headProps, this.$slots)])]);
    var affixHeaderWithWrap = vue.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) && vue.createVNode(affix_index.Affix, vue.mergeProps({
      "class": this.tableBaseClass.affixedFooterWrap,
      "onFixedChange": this.onFixedChange,
      "offsetBottom": marginScrollbarWidth || 0
    }, table_utils.getAffixProps(this.footerAffixedBottom), {
      "style": {
        marginTop: "".concat(-1 * (this.tableFootHeight + marginScrollbarWidth), "px")
      },
      "ref": "footerBottomAffixRef"
    }), {
      "default": function _default() {
        return [vue.createVNode("div", {
          "ref": "affixFooterRef",
          "style": {
            width: "".concat(_this.tableWidth - affixedLeftBorder, "px"),
            opacity: Number(_this.showAffixFooter)
          },
          "class": ["scrollbar", _defineProperty__default["default"]({}, _this.tableBaseClass.affixedFooterElm, _this.footerAffixedBottom || _this.isVirtual)]
        }, [vue.createVNode("table", {
          "class": _this.tableElmClasses,
          "style": _objectSpread(_objectSpread({}, _this.tableElementStyles), {}, {
            width: "".concat(_this.tableElmWidth, "px")
          })
        }, [renderColGroup(true), vue.createVNode(table_tfoot["default"], {
          "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__default["default"](this.$props, table_tbody.extendTableProps)), {}, {
      pagination: this.innerPagination,
      attach: this.attach
    });
    var tableContent = vue.createVNode("div", {
      "ref": "tableContentRef",
      "class": this.tableBaseClass.content,
      "style": this.tableContentStyles,
      "onScroll": this.onInnerVirtualScroll
    }, [this.virtualConfig.isVirtualScroll.value && vue.createVNode("div", {
      "class": this.virtualScrollClasses.cursor,
      "style": virtualStyle
    }, null), vue.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 && vue.createVNode(table_thead["default"], _objectSpread(_objectSpread({}, headProps), {}, {
      thWidthList: columnResizable.value ? this.thWidthList : {}
    }), this.$slots), vue.createVNode(table_tbody["default"], tableBodyProps, this.$slots), vue.createVNode(table_tfoot["default"], {
      "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 && vue.createVNode(loading_index.Loading, vue.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 = vue.createVNode("div", {
      "ref": "paginationRef",
      "class": this.tableBaseClass.paginationWrap,
      "style": {
        opacity: Number(this.showAffixPagination)
      }
    }, [this.renderPagination()]);
    var bottom = !!bottomContent && vue.createVNode("div", {
      "ref": "bottomContentRef",
      "class": this.tableBaseClass.bottomContent
    }, [bottomContent]);
    return vue.createVNode("div", {
      "ref": "tableRef",
      "class": this.dynamicBaseTableClasses,
      "style": "position: relative"
    }, [!!topContent && vue.createVNode("div", {
      "class": this.tableBaseClass.topContent
    }, [topContent]), renderAffixedHeader(), tableContent, affixedFooter, loadingContent, bottom, this.showRightDivider && vue.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 ? vue.createVNode(affix_index.Affix, vue.mergeProps({
      "offsetBottom": 0
    }, table_utils.getAffixProps(this.paginationAffixedBottom), {
      "ref": "paginationAffixRef"
    }), _isSlot(pagination) ? pagination : {
      "default": function _default() {
        return [pagination];
      }
    }) : pagination, vue.createVNode("div", {
      "ref": "resizeLineRef",
      "class": this.tableBaseClass.resizeLine,
      "style": this.resizeLineStyle
    }, null)]);
  }
});

exports.BASE_TABLE_ALL_EVENTS = BASE_TABLE_ALL_EVENTS;
exports.BASE_TABLE_EVENTS = BASE_TABLE_EVENTS;
exports["default"] = _BaseTable;
//# sourceMappingURL=base-table.js.map
