/**
 * tdesign v0.46.4
 * (c) 2022 tdesign
 * @license MIT
 */

'use strict';

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

var helper = require('../_chunks/dep-d7a1e02c.js');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var VueCompositionAPI = require('@vue/composition-api');
var pick = require('lodash/pick');
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 hooks_useVirtualScroll = require('../hooks/useVirtualScroll.js');
var table_hooks_useAffix = require('./hooks/useAffix.js');
var loading_index = require('../loading/index.js');
var table_tbody = require('./tbody.js');
var hooks_tnode = require('../hooks/tnode.js');
var table_hooks_useStyle = require('./hooks/useStyle.js');
var table_hooks_useClassName = require('./hooks/useClassName.js');
var configProvider_useConfig = require('../config-provider/useConfig.js');
var affix_index = require('../affix/index.js');
var table_tr = require('./tr.js');
var table_thead = require('./thead.js');
var table_tfoot = require('./tfoot.js');
var _common_js_log_log = require('../_common/js/log/log.js');
var _common_js_utils_helper = require('../_common/js/utils/helper.js');
var table_utils = require('./utils.js');
require('@babel/runtime/helpers/typeof');
require('@babel/runtime/helpers/slicedToArray');
require('lodash/isString');
require('lodash/isFunction');
require('./hooks/useMultiHeader.js');
require('./ellipsis.js');
require('lodash/debounce');
require('../utils/render-tnode.js');
require('vue');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../utils/dom.js');
require('raf');
require('../utils/easing.js');
require('../tooltip/index.js');
require('../tooltip/tooltip.js');
require('../tooltip/props.js');
require('../popup/props.js');
require('../popup/popup.js');
require('@popperjs/core');
require('../utils/helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('../_common/js/utils/set-style.js');
require('../popup/container.js');
require('../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../config-provider/context.js');
require('lodash/merge');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('../utils/mixins.js');
require('../utils/map-props.js');
require('../utils/withInstall.js');
require('lodash/capitalize');
require('lodash/isNumber');
require('../_common/js/table/set-column-width-by-drag.js');
require('../_common/js/table/utils.js');
require('../_common/js/table/recalculate-column-width.js');
require('lodash/get');
require('../_common/js/utils/getScrollbarWidth.js');
require('../pagination/index.js');
require('../pagination/pagination.js');
require('tdesign-icons-vue');
require('../input-number/index.js');
require('../input-number/input-number.js');
require('../button/index.js');
require('../button/button.js');
require('../button/props.js');
require('../utils/ripple.js');
require('../config.js');
require('../loading/loading.js');
require('../loading/icon/gradient.js');
require('../_common/js/loading/circle-adapter.js');
require('../utils/transfer-dom.js');
require('../loading/props.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../loading/plugin.js');
require('../input/index.js');
require('../input/input.js');
require('../utils/event.js');
require('../input/props.js');
require('../input/input-group.js');
require('../input-number/props.js');
require('../input-number/useInputNumber.js');
require('../hooks/useCommonClassName.js');
require('../hooks/useVModel.js');
require('../_common/js/input-number/number.js');
require('../_common/js/input-number/large-number.js');
require('../hooks/useFormDisabled.js');
require('../hooks/useGlobalIcon.js');
require('../select/index.js');
require('../select/select.js');
require('lodash/cloneDeep');
require('lodash/isArray');
require('../hooks/useDefaultValue.js');
require('../select/props.js');
require('../popup/index.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('../select-input/index.js');
require('../select-input/select-input.js');
require('../select-input/props.js');
require('../select-input/useSingle.js');
require('lodash/isObject');
require('../hooks/useConfig.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-input/hooks/useHover.js');
require('../tag-input/hooks/useDragSorter.js');
require('lodash/isEmpty');
require('../hooks/render-tnode.js');
require('../select-input/useOverlayInnerStyle.js');
require('../common-components/fake-arrow.js');
require('../select/option.js');
require('../select/option-props.js');
require('../checkbox/index.js');
require('../checkbox/group.js');
require('lodash/intersection');
require('../checkbox/checkbox.js');
require('../checkbox/props.js');
require('../checkbox/checkbox-group-props.js');
require('../hooks/useLazyLoad.js');
require('../_common/js/utils/observe.js');
require('../select/util.js');
require('../select/select-panel.js');
require('../select/hooks/useSelectOptions.js');
require('../select/optionGroup.js');
require('../select/option-group-props.js');
require('../input-adornment/index.js');
require('../input-adornment/input-adornment.js');
require('../input-adornment/props.js');
require('../pagination/props.js');
require('./hooks/useRowspanAndColspan.js');
require('../affix/affix.js');
require('../affix/props.js');
require('lodash/upperFirst');

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; }
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 = VueCompositionAPI.defineComponent({
  name: "TBaseTable",
  props: _objectSpread(_objectSpread({}, table_baseTableProps["default"]), {}, {
    renderExpandedRow: Function,
    onLeafColumnsChange: Function
  }),
  setup: function setup(props2, context) {
    var _props2$scroll3;

    var renderTNode = hooks_tnode.useTNodeJSX();
    var tableRef = VueCompositionAPI.ref();
    var tableElmRef = VueCompositionAPI.ref();
    var tableBodyRef = VueCompositionAPI.ref();
    var tableFootHeight = VueCompositionAPI.ref(0);

    var _useClassName = table_hooks_useClassName["default"](),
        virtualScrollClasses = _useClassName.virtualScrollClasses,
        tableLayoutClasses = _useClassName.tableLayoutClasses,
        tableBaseClass = _useClassName.tableBaseClass,
        tableColFixedClasses = _useClassName.tableColFixedClasses;

    var _useStyle = table_hooks_useStyle["default"](props2),
        tableClasses = _useStyle.tableClasses,
        tableContentStyles = _useStyle.tableContentStyles,
        tableElementStyles = _useStyle.tableElementStyles;

    var _useConfig = configProvider_useConfig.useConfig("table"),
        global = _useConfig.global;

    var _useTableHeader = table_hooks_useTableHeader["default"](props2),
        isMultipleHeader = _useTableHeader.isMultipleHeader,
        spansAndLeafNodes = _useTableHeader.spansAndLeafNodes,
        thList = _useTableHeader.thList;

    var finalColumns = VueCompositionAPI.computed(function () {
      var _spansAndLeafNodes$va;

      return ((_spansAndLeafNodes$va = spansAndLeafNodes.value) === null || _spansAndLeafNodes$va === void 0 ? void 0 : _spansAndLeafNodes$va.leafColumns) || props2.columns;
    });

    var _useFixed = table_hooks_useFixed["default"](props2, context, finalColumns),
        scrollbarWidth = _useFixed.scrollbarWidth,
        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,
        emitScrollEvent = _useFixed.emitScrollEvent,
        setUseFixedTableElmRef = _useFixed.setUseFixedTableElmRef,
        updateColumnFixedShadow = _useFixed.updateColumnFixedShadow,
        getThWidthList = _useFixed.getThWidthList,
        updateThWidthList = _useFixed.updateThWidthList,
        setRecalculateColWidthFuncRef = _useFixed.setRecalculateColWidthFuncRef,
        addTableResizeObserver = _useFixed.addTableResizeObserver;

    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,
        updateAffixHeaderOrFooter = _useAffix.updateAffixHeaderOrFooter,
        setTableContentRef = _useAffix.setTableContentRef;

    var _usePagination = table_hooks_usePagination["default"](props2, context),
        dataSource = _usePagination.dataSource,
        isPaginateData = _usePagination.isPaginateData,
        renderPagination = _usePagination.renderPagination;

    var columnResizeParams = table_hooks_useColumnResize["default"](tableContentRef, refreshTable, getThWidthList, updateThWidthList);
    var resizeLineRef = columnResizeParams.resizeLineRef,
        resizeLineStyle = columnResizeParams.resizeLineStyle,
        recalculateColWidth = columnResizeParams.recalculateColWidth,
        setEffectColMap = columnResizeParams.setEffectColMap;
    setRecalculateColWidthFuncRef(recalculateColWidth);
    var dynamicBaseTableClasses = VueCompositionAPI.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 = VueCompositionAPI.computed(function () {
      return [[tableLayoutClasses[props2.tableLayout]], _defineProperty__default["default"]({}, tableBaseClass.fullHeight, props2.height)];
    });
    var isVirtual = VueCompositionAPI.computed(function () {
      var _props2$scroll, _props2$data, _props2$scroll2;

      return ((_props2$scroll = props2.scroll) === null || _props2$scroll === void 0 ? void 0 : _props2$scroll.type) === "virtual" && ((_props2$data = props2.data) === null || _props2$data === void 0 ? void 0 : _props2$data.length) > (((_props2$scroll2 = props2.scroll) === null || _props2$scroll2 === void 0 ? void 0 : _props2$scroll2.threshold) || 100);
    });
    var showRightDivider = VueCompositionAPI.computed(function () {
      return props2.bordered && isFixedHeader.value && (isMultipleHeader.value && isWidthOverflow.value || !isMultipleHeader.value);
    });
    VueCompositionAPI.watch(tableElmRef, function () {
      setUseFixedTableElmRef(tableElmRef.value);
    });
    VueCompositionAPI.watch(function () {
      return [props2.data, dataSource, isPaginateData];
    }, function () {
      setData(isPaginateData.value ? dataSource.value : props2.data);
    });
    VueCompositionAPI.watch(spansAndLeafNodes, function () {
      var _props2$onLeafColumns;

      (_props2$onLeafColumns = props2.onLeafColumnsChange) === null || _props2$onLeafColumns === void 0 ? void 0 : _props2$onLeafColumns.call(props2, spansAndLeafNodes.value.leafColumns);
      context.emit("LeafColumnsChange", spansAndLeafNodes.value.leafColumns);
    }, {
      immediate: true
    });
    VueCompositionAPI.watch(thList, function () {
      setEffectColMap(thList.value[0], null);
    }, {
      immediate: true
    });

    var onFixedChange = function onFixedChange() {
      VueCompositionAPI.nextTick(function () {
        onHorizontalScroll();
        updateAffixHeaderOrFooter();
      });
    };

    var getListener = function getListener() {
      var listener = {};
      BASE_TABLE_ALL_EVENTS.forEach(function (key) {
        listener[key] = function () {
          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }

          context.emit.apply(context, [key].concat(args));
        };
      });
      return listener;
    };

    var _ref3 = props2.scroll || {},
        type = _ref3.type,
        rowHeight = _ref3.rowHeight,
        _ref3$bufferSize = _ref3.bufferSize,
        bufferSize = _ref3$bufferSize === void 0 ? 20 : _ref3$bufferSize,
        _ref3$isFixedRowHeigh = _ref3.isFixedRowHeight,
        isFixedRowHeight = _ref3$isFixedRowHeigh === void 0 ? false : _ref3$isFixedRowHeigh;

    var _toRefs = VueCompositionAPI.toRefs(props2),
        data = _toRefs.data;

    var _ref4 = type === "virtual" ? hooks_useVirtualScroll["default"]({
      container: tableContentRef,
      data: data,
      fixedHeight: isFixedRowHeight,
      lineHeight: rowHeight,
      bufferSize: bufferSize,
      threshold: (_props2$scroll3 = props2.scroll) === null || _props2$scroll3 === void 0 ? void 0 : _props2$scroll3.threshold
    }) : {},
        _ref4$trs = _ref4.trs,
        trs = _ref4$trs === void 0 ? null : _ref4$trs,
        _ref4$scrollHeight = _ref4.scrollHeight,
        scrollHeight = _ref4$scrollHeight === void 0 ? null : _ref4$scrollHeight,
        _ref4$visibleData = _ref4.visibleData,
        visibleData = _ref4$visibleData === void 0 ? null : _ref4$visibleData,
        _ref4$translateY = _ref4.translateY,
        translateY = _ref4$translateY === void 0 ? null : _ref4$translateY,
        _ref4$handleScroll = _ref4.handleScroll,
        handleVirtualScroll = _ref4$handleScroll === void 0 ? null : _ref4$handleScroll,
        _ref4$handleRowMounte = _ref4.handleRowMounted,
        handleRowMounted = _ref4$handleRowMounte === void 0 ? null : _ref4$handleRowMounte;

    VueCompositionAPI.provide("tableContentRef", tableContentRef);
    VueCompositionAPI.provide("rowHeightRef", VueCompositionAPI.ref(rowHeight));
    var lastScrollY = 0;

    var onInnerVirtualScroll = function onInnerVirtualScroll(e) {
      var target = e.target || e.srcElement;
      var top = target.scrollTop;

      if (lastScrollY !== top) {
        isVirtual.value && handleVirtualScroll();
      } else {
        lastScrollY = 0;
        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;
    };

    VueCompositionAPI.watch(tableContentRef, function () {
      setTableContentRef(tableContentRef.value);
    });
    VueCompositionAPI.watch(tableElmRef, getTFootHeight);
    VueCompositionAPI.watch(tableRef, function (tableRef2) {
      addTableResizeObserver(tableRef2);
    });
    VueCompositionAPI.onMounted(function () {
      getTFootHeight();
      setTableContentRef(tableContentRef.value);
      addTableResizeObserver(tableRef.value);
    });
    return {
      thList: thList,
      isVirtual: isVirtual,
      global: global,
      tableFootHeight: tableFootHeight,
      tableWidth: tableWidth,
      tableElmWidth: tableElmWidth,
      tableRef: tableRef,
      tableElmRef: tableElmRef,
      tableBaseClass: tableBaseClass,
      spansAndLeafNodes: spansAndLeafNodes,
      dynamicBaseTableClasses: dynamicBaseTableClasses,
      tableContentStyles: tableContentStyles,
      tableElementStyles: tableElementStyles,
      virtualScrollClasses: virtualScrollClasses,
      tableLayoutClasses: tableLayoutClasses,
      tableElmClasses: tableElmClasses,
      tableContentRef: tableContentRef,
      isFixedHeader: isFixedHeader,
      isWidthOverflow: isWidthOverflow,
      isFixedColumn: isFixedColumn,
      rowAndColFixedPosition: rowAndColFixedPosition,
      showColumnShadow: showColumnShadow,
      thWidthList: thWidthList,
      isPaginateData: isPaginateData,
      dataSource: dataSource,
      scrollType: type,
      rowHeight: rowHeight,
      trs: trs,
      bufferSize: bufferSize,
      scrollHeight: scrollHeight,
      visibleData: visibleData,
      translateY: translateY,
      affixHeaderRef: affixHeaderRef,
      affixFooterRef: affixFooterRef,
      paginationRef: paginationRef,
      showAffixHeader: showAffixHeader,
      showAffixFooter: showAffixFooter,
      scrollbarWidth: scrollbarWidth,
      isMultipleHeader: isMultipleHeader,
      showRightDivider: showRightDivider,
      resizeLineRef: resizeLineRef,
      resizeLineStyle: resizeLineStyle,
      columnResizeParams: columnResizeParams,
      horizontalScrollbarRef: horizontalScrollbarRef,
      tableBodyRef: tableBodyRef,
      showAffixPagination: showAffixPagination,
      getListener: getListener,
      renderPagination: renderPagination,
      renderTNode: renderTNode,
      handleRowMounted: handleRowMounted,
      onFixedChange: onFixedChange,
      onHorizontalScroll: onHorizontalScroll,
      updateAffixHeaderOrFooter: updateAffixHeaderOrFooter,
      refreshTable: refreshTable,
      onInnerVirtualScroll: onInnerVirtualScroll
    };
  },
  render: function render(h) {
    var _this$spansAndLeafNod,
        _this = this,
        _navigator,
        _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;

    if (this.allowResizeColumnWidth) {
      _common_js_log_log["default"].warn("Table", "allowResizeColumnWidth is going to be deprecated, please use resizable instead.");
    }

    var columnResizable = this.allowResizeColumnWidth === void 0 ? this.resizable : this.allowResizeColumnWidth;

    if (columnResizable && this.tableLayout === "auto") {
      _common_js_log_log["default"].warn("Table", "table-layout can not be `auto` for resizable column table, set `table-layout: fixed` please.");
    }

    var defaultColWidth = this.tableLayout === "fixed" && this.isWidthOverflow ? "100px" : void 0;
    var colgroup = h("colgroup", [columns.map(function (col) {
      var style = {
        width: table_hooks_useStyle.formatCSSUnit(_this.thWidthList[col.colKey] || col.width) || defaultColWidth
      };

      if (col.minWidth) {
        style.minWidth = table_hooks_useStyle.formatCSSUnit(col.minWidth);
      }

      return h("col", {
        "key": col.colKey,
        "style": style
      });
    })]);
    var onlyVirtualScrollBordered = !!(this.isVirtual && !this.headerAffixedTop && this.bordered) && /Chrome/.test((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.userAgent);
    var borderWidth = this.bordered && onlyVirtualScrollBordered ? 1 : 0;
    var barWidth = this.isWidthOverflow ? this.scrollbarWidth : 0;
    var IEHeaderWrap = _common_js_utils_helper.getIEVersion() <= 11 ? 4 : 0;
    var affixHeaderHeight = (((_this$affixHeaderRef = this.affixHeaderRef) === null || _this$affixHeaderRef === void 0 ? void 0 : _this$affixHeaderRef.getBoundingClientRect().height) || 0) - IEHeaderWrap;
    var affixHeaderWrapHeight = affixHeaderHeight - barWidth - borderWidth;
    var headerOpacity = this.headerAffixedTop ? Number(this.showAffixHeader) : 1;
    var affixHeaderWrapHeightStyle = {
      width: "".concat(this.tableWidth, "px"),
      height: "".concat(affixHeaderWrapHeight, "px"),
      opacity: headerOpacity,
      marginTop: onlyVirtualScrollBordered ? "".concat(borderWidth, "px") : 0
    };
    var affixedLeftBorder = this.bordered ? 1 : 0;
    var affixedHeader = Boolean((this.headerAffixedTop || this.isVirtual) && this.tableWidth) && h("div", {
      "ref": "affixHeaderRef",
      "style": {
        width: "".concat(this.tableWidth - affixedLeftBorder, "px"),
        opacity: headerOpacity
      },
      "class": ["scrollbar", _defineProperty__default["default"]({}, this.tableBaseClass.affixedHeaderElm, this.headerAffixedTop || this.isVirtual)]
    }, [h("table", {
      "class": this.tableElmClasses,
      "style": _objectSpread(_objectSpread({}, this.tableElementStyles), {}, {
        width: "".concat(this.tableElmWidth, "px")
      })
    }, [colgroup, h(table_thead["default"], {
      "scopedSlots": this.$scopedSlots,
      "attrs": {
        "isFixedHeader": this.isFixedHeader,
        "rowAndColFixedPosition": this.rowAndColFixedPosition,
        "isMultipleHeader": this.isMultipleHeader,
        "bordered": this.bordered,
        "spansAndLeafNodes": this.spansAndLeafNodes,
        "thList": this.thList,
        "thWidthList": this.thWidthList,
        "resizable": columnResizable,
        "columnResizeParams": this.columnResizeParams
      }
    })])]);
    var affixHeaderWithWrap = h("div", {
      "class": this.tableBaseClass.affixedHeaderWrap,
      "style": affixHeaderWrapHeightStyle
    }, [affixedHeader]);
    var marginScrollbarWidth = barWidth;

    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) && h(affix_index.Affix, helper.helper([{
      "class": this.tableBaseClass.affixedFooterWrap,
      "on": {
        "fixedChange": this.onFixedChange
      },
      "attrs": {
        "offsetBottom": marginScrollbarWidth || 0
      }
    }, {
      "props": table_utils.getAffixProps(this.footerAffixedBottom, this.footerAffixProps)
    }, {
      "style": {
        marginTop: "".concat(-1 * (this.tableFootHeight + marginScrollbarWidth), "px")
      }
    }]), [h("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)]
    }, [h("table", {
      "class": this.tableElmClasses,
      "style": _objectSpread(_objectSpread({}, this.tableElementStyles), {}, {
        width: "".concat(this.tableElmWidth, "px")
      })
    }, [colgroup, h(table_tfoot["default"], {
      "attrs": {
        "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
      },
      "scopedSlots": this.$scopedSlots
    })])])]);
    var translate = "translate(0, ".concat(this.scrollHeight, "px)");
    var virtualStyle = {
      transform: translate,
      "-ms-transform": translate,
      "-moz-transform": translate,
      "-webkit-transform": translate
    };

    var tableBodyProps = _objectSpread({
      rowAndColFixedPosition: rowAndColFixedPosition,
      showColumnShadow: this.showColumnShadow,
      data: this.isVirtual ? this.visibleData : data,
      columns: columns,
      tableElm: this.tableRef,
      tableContentElm: this.tableContentRef,
      tableWidth: this.tableWidth,
      isWidthOverflow: this.isWidthOverflow,
      isVirtual: this.isVirtual,
      translateY: this.translateY,
      scrollType: this.scrollType,
      rowHeight: this.rowHeight,
      trs: this.trs,
      bufferSize: this.bufferSize,
      scroll: this.scroll,
      cellEmptyContent: this.cellEmptyContent,
      handleRowMounted: this.handleRowMounted,
      renderExpandedRow: this.renderExpandedRow
    }, pick__default["default"](this.$props, table_tbody.extendTableProps));

    var tBodyListener = this.getListener();
    var tableContent = h("div", helper.helper([{
      "ref": "tableContentRef",
      "class": this.tableBaseClass.content,
      "style": this.tableContentStyles
    }, {
      "on": {
        scroll: this.onInnerVirtualScroll
      }
    }]), [this.isVirtual && h("div", {
      "class": this.virtualScrollClasses.cursor,
      "style": virtualStyle
    }), h("table", {
      "ref": "tableElmRef",
      "class": this.tableElmClasses,
      "style": this.tableElementStyles
    }, [colgroup, h(table_thead["default"], {
      "scopedSlots": this.$scopedSlots,
      "attrs": {
        "isFixedHeader": this.isFixedHeader,
        "rowAndColFixedPosition": this.rowAndColFixedPosition,
        "isMultipleHeader": this.isMultipleHeader,
        "bordered": this.bordered,
        "spansAndLeafNodes": this.spansAndLeafNodes,
        "thList": this.thList,
        "thWidthList": this.thWidthList,
        "resizable": columnResizable,
        "columnResizeParams": this.columnResizeParams
      }
    }), h(table_tbody["default"], helper.helper([{
      "ref": "tableBodyRef",
      "scopedSlots": this.$scopedSlots
    }, {
      "props": tableBodyProps
    }, {}, {
      "on": tBodyListener
    }])), h(table_tfoot["default"], {
      "attrs": {
        "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
      },
      "scopedSlots": this.$scopedSlots
    })])]);
    var customLoadingText = this.renderTNode("loading");
    var loadingContent = this.loading !== void 0 && h(loading_index.Loading, helper.helper([{
      "attrs": {
        "loading": !!this.loading,
        "text": customLoadingText ? function () {
          return customLoadingText;
        } : void 0,
        "attach": this.tableRef ? function () {
          return _this.tableRef;
        } : void 0,
        "showOverlay": true
      }
    }, {
      "props": _objectSpread({
        size: "small"
      }, this.loadingProps)
    }]));
    var topContent = this.renderTNode("topContent");
    var bottomContent = this.renderTNode("bottomContent");
    var pagination = h("div", {
      "ref": "paginationRef",
      "class": this.tableBaseClass.paginationWrap,
      "style": {
        opacity: Number(this.showAffixPagination)
      }
    }, [this.renderPagination(h)]);
    var bottom = !!bottomContent && h("div", {
      "class": this.tableBaseClass.bottomContent
    }, [bottomContent]);
    return h("div", {
      "ref": "tableRef",
      "class": this.dynamicBaseTableClasses,
      "style": "position: relative"
    }, [!!topContent && h("div", {
      "class": this.tableBaseClass.topContent
    }, [topContent]), !!(this.isVirtual || this.headerAffixedTop) && (this.headerAffixedTop ? h(affix_index.Affix, helper.helper([{
      "attrs": {
        "offsetTop": 0
      }
    }, {
      "props": table_utils.getAffixProps(this.headerAffixedTop, this.headerAffixProps)
    }, {
      "on": {
        "fixedChange": this.onFixedChange
      }
    }]), [affixHeaderWithWrap]) : this.isFixedHeader && affixHeaderWithWrap), tableContent, affixedFooter, loadingContent, this.showRightDivider && h("div", {
      "class": this.tableBaseClass.scrollbarDivider,
      "style": {
        right: "".concat(this.scrollbarWidth, "px"),
        height: "".concat((_this$tableContentRef = this.tableContentRef) === null || _this$tableContentRef === void 0 ? void 0 : _this$tableContentRef.getBoundingClientRect().height, "px")
      }
    }), bottom, this.horizontalScrollAffixedBottom && h(affix_index.Affix, helper.helper([{
      "attrs": {
        "offsetBottom": 0
      }
    }, {
      "props": table_utils.getAffixProps(this.horizontalScrollAffixedBottom)
    }, {
      "style": {
        marginTop: "-".concat(this.scrollbarWidth * 2, "px")
      }
    }]), [h("div", {
      "ref": "horizontalScrollbarRef",
      "class": ["scrollbar", this.tableBaseClass.obviousScrollbar],
      "style": {
        width: "".concat(this.tableWidth, "px"),
        overflow: "auto",
        opacity: Number(this.showAffixFooter)
      }
    }, [h("div", {
      "style": {
        width: "".concat(this.tableElmWidth, "px"),
        height: "5px"
      }
    })])]), this.paginationAffixedBottom ? h(affix_index.Affix, helper.helper([{
      "attrs": {
        "offsetBottom": 0
      }
    }, {
      "props": table_utils.getAffixProps(this.paginationAffixedBottom)
    }]), [pagination]) : pagination, h("div", {
      "ref": "resizeLineRef",
      "class": this.tableBaseClass.resizeLine,
      "style": this.resizeLineStyle
    })]);
  }
});

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