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

import { h as helper } from '../../../chunks/helper.js';
import { defineComponent, ref, computed, watch, nextTick, toRefs, provide, onMounted } from '@vue/composition-api';
import pick from 'lodash/pick';
import '../../../chunks/index.js';
import { g as getIEVersion } from '../../../chunks/helper2.js';
import useVirtualScroll from '../../../hooks/use-virtual-scroll.js';
import { Loading } from '../../loading/index.js';
import { useLNodeJSX } from '../../../hooks/lnode.js';
import { useConfig } from '../../config-provider/useConfig.js';
import { Affix } from '../../affix/index.js';
import { BaseTableProps } from '../props.js';
import useTableHeader from '../hooks/useTableHeader.js';
import useColumnResize from '../hooks/useColumnResize.js';
import useFixed from '../hooks/useFixed.js';
import usePagination from '../hooks/usePagination.js';
import useAffix from '../hooks/useAffix.js';
import useStyle, { formatCSSUnit } from '../hooks/useStyle.js';
import useClassName from '../hooks/useClassName.js';
import { getAffixProps } from '../utils.js';
import TBody, { extendTableProps } from './tbody.js';
import { ROW_LISTENERS } from './tr.js';
import THead from './thead.js';
import TFoot from './tfoot.js';
import { l as log } from '../../../chunks/log.js';
import '../../../chunks/_commonjsHelpers.js';
import '../../../chunks/_commonjsHelpers-2e6815bd.js';
import '../../../chunks/defineProperty-838e4192.js';
import '../../../utils/with-install.js';
import 'vue';
import 'lodash';
import '../../../config.js';
import '../../loading/loading.js';
import '../../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../../utils/easing.js';
import '../../../utils/render-node.js';
import '../../../utils/transfer-dom.js';
import '../../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import '../../config-provider/context.js';
import '../../../chunks/zh_CN.js';
import '../../config-provider/type.js';
import '../../../utils/mixins.js';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../../chunks/set-style.js';
import '../../loading/style';
import '../../loading/type.js';
import '../../loading/plugin.js';
import 'lodash/isEmpty';
import 'lodash/isFunction';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../../hooks/render-lnode.js';
import '../../affix/affix.js';
import '../../affix/props.js';
import '../../affix/style';
import '../../affix/type.js';
import './ellipsis.js';
import 'lodash/debounce';
import '../../tooltip/index.js';
import '../../../utils/map-props.js';
import '../../tooltip/tooltip.js';
import '../../popup/props.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../../utils/helper.js';
import '../../popup/container.js';
import '../../tooltip/props.js';
import '../../tooltip/style';
import '../../tooltip/type.js';
import '../hooks/useMultiHeader.js';
import 'lodash/isNumber';
import '../../../chunks/utils3.js';
import '../../../chunks/isFunction-91acade7.js';
import '../../../chunks/isObjectLike-c22c7e3b.js';
import '../../../chunks/isNumber-c4eb560e.js';
import 'lodash/get';
import '../../pagination/index.js';
import '../../pagination/pagination.js';
import '@ldesign/icons-vue';
import '../../input-number/index.js';
import '../../input-number/input-number.js';
import '../../button/index.js';
import '../../button/button.js';
import '../../../utils/ripple.js';
import '../../button/props.js';
import '../../button/style';
import '../../button/type.js';
import '../../input/index.js';
import '../../input/input.js';
import '../../../utils/event.js';
import '../../input/props.js';
import '../../input/group.js';
import '../../input/style';
import '../../input/type.js';
import '../../../hooks/use-global-icon.js';
import '../../../hooks/use-config.js';
import '../../input-number/props.js';
import '../../input-number/hooks/use-input-number.js';
import '../../../chunks/isArray-cd7357b9.js';
import '../../../hooks/use-common-classname.js';
import '../../../hooks/use-vmodel.js';
import '../../../hooks/use-form-disabled.js';
import '../../input-number/style';
import '../../input-number/type.js';
import '../../select/index.js';
import '../../select/select.js';
import 'lodash/cloneDeep';
import 'lodash/isArray';
import 'lodash/isObject';
import '../../../hooks/use-default-value.js';
import '../../popup/index.js';
import '../../popup/style';
import '../../popup/type.js';
import '../../tag/index.js';
import '../../tag/tag.js';
import '../../tag/props.js';
import '../../tag/check-tag.js';
import '../../tag/style';
import '../../tag/type.js';
import '../../select-input/index.js';
import '../../select-input/select-input.js';
import '../../select-input/props.js';
import '../../select-input/hooks/use-single.js';
import '../../select-input/hooks/use-multiple.js';
import '../../tag-input/index.js';
import '../../tag-input/tag-input.js';
import '../../tag-input/props.js';
import '../../tag-input/hooks/use-tag-scroll.js';
import '../../tag-input/hooks/use-tag-list.js';
import '../../tag-input/hooks/use-hover.js';
import '../../tag-input/hooks/use-drag-sorter.js';
import '../../tag-input/style';
import '../../tag-input/type.js';
import '../../select-input/hooks/use-overlay-innerstyle.js';
import '../../select-input/style';
import '../../select-input/type.js';
import '../../common/fake-arrow.js';
import '../../select/option.js';
import '../../checkbox/index.js';
import '../../checkbox/group.js';
import 'lodash/intersection';
import '../../checkbox/checkbox.js';
import '../../checkbox/props.js';
import '../../checkbox/style';
import '../../checkbox/type.js';
import '../../../hooks/use-lazy-load.js';
import '../../../chunks/observe.js';
import '../../select/utils.js';
import '../../select/props.js';
import '../../select/select-panel.js';
import '../../select/hooks/use-select-options.js';
import '../../select/option-group.js';
import '../../select/style';
import '../../select/type.js';
import '../../input-adornment/index.js';
import '../../input-adornment/input-adornment.js';
import '../../input-adornment/props.js';
import '../../input-adornment/style';
import '../../input-adornment/type.js';
import '../../pagination/props.js';
import '../../pagination/style';
import '../../pagination/type.js';
import '../hooks/useRowspanAndColspan.js';
import 'lodash/upperFirst';

const BASE_TABLE_EVENTS = ["page-change", "cell-click", "scroll", "scrollX", "scrollY"];
const BASE_TABLE_ALL_EVENTS = ROW_LISTENERS.map(t => `row-${t}`).concat(BASE_TABLE_EVENTS);
var _BaseTable = defineComponent({
  name: "LBaseTable",
  props: {
    ...BaseTableProps,
    renderExpandedRow: Function,
    onLeafColumnsChange: Function
  },
  setup(props2, context) {
    var _props2$scroll3;
    const renderLNode = useLNodeJSX();
    const tableRef = ref();
    const tableElmRef = ref();
    const tableBodyRef = ref();
    const tableFootHeight = ref(0);
    const {
      classPrefix,
      virtualScrollClasses,
      tableLayoutClasses,
      tableBaseClass,
      tableColFixedClasses
    } = useClassName();
    const {
      tableClasses,
      sizeClassNames,
      tableContentStyles,
      tableElementStyles
    } = useStyle(props2);
    const {
      global
    } = useConfig("table");
    const {
      isMultipleHeader,
      spansAndLeafNodes,
      thList
    } = useTableHeader(props2);
    const finalColumns = computed(() => {
      var _spansAndLeafNodes$va;
      return ((_spansAndLeafNodes$va = spansAndLeafNodes.value) === null || _spansAndLeafNodes$va === void 0 ? void 0 : _spansAndLeafNodes$va.leafColumns) || props2.columns;
    });
    const paginationAffixRef = ref();
    const horizontalScrollAffixRef = ref();
    const headerTopAffixRef = ref();
    const footerBottomAffixRef = ref();
    const {
      scrollbarWidth,
      tableWidth,
      tableElmWidth,
      tableContentRef,
      isFixedHeader,
      isWidthOverflow,
      isFixedColumn,
      thWidthList,
      showColumnShadow,
      rowAndColFixedPosition,
      setData,
      refreshTable,
      emitScrollEvent,
      setUseFixedTableElmRef,
      updateColumnFixedShadow,
      getThWidthList,
      updateThWidthList,
      setRecalculateColWidthFuncRef,
      addTableResizeObserver
    } = useFixed(props2, context, finalColumns, {
      paginationAffixRef,
      horizontalScrollAffixRef,
      headerTopAffixRef,
      footerBottomAffixRef
    });
    const {
      affixHeaderRef,
      affixFooterRef,
      horizontalScrollbarRef,
      paginationRef,
      showAffixHeader,
      showAffixFooter,
      showAffixPagination,
      onHorizontalScroll,
      updateAffixHeaderOrFooter,
      setTableContentRef
    } = useAffix(props2);
    const {
      dataSource,
      isPaginateData,
      renderPagination
    } = usePagination(props2, context);
    const columnResizeParams = useColumnResize(tableContentRef, refreshTable, getThWidthList, updateThWidthList);
    const {
      resizeLineRef,
      resizeLineStyle,
      recalculateColWidth,
      setEffectColMap
    } = columnResizeParams;
    setRecalculateColWidthFuncRef(recalculateColWidth);
    const dynamicBaseTableClasses = computed(() => [tableClasses.value, {
      [tableBaseClass.headerFixed]: isFixedHeader.value,
      [tableBaseClass.columnFixed]: isFixedColumn.value,
      [tableBaseClass.widthOverflow]: isWidthOverflow.value,
      [tableBaseClass.multipleHeader]: isMultipleHeader.value,
      [tableColFixedClasses.leftShadow]: showColumnShadow.left,
      [tableColFixedClasses.rightShadow]: showColumnShadow.right,
      [tableBaseClass.columnResizableTable]: props2.resizable
    }]);
    const tableElmClasses = computed(() => [[tableLayoutClasses[props2.tableLayout]], {
      [tableBaseClass.fullHeight]: props2.height
    }]);
    const isVirtual = computed(() => {
      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);
    });
    const showRightDivider = computed(() => props2.bordered && isFixedHeader.value && (isMultipleHeader.value && isWidthOverflow.value || !isMultipleHeader.value));
    const columnResizable = computed(() => props2.allowResizeColumnWidth === void 0 ? props2.resizable : props2.allowResizeColumnWidth);
    watch(tableElmRef, () => {
      setUseFixedTableElmRef(tableElmRef.value);
    });
    watch(() => [props2.data, dataSource, isPaginateData], () => {
      setData(isPaginateData.value ? dataSource.value : props2.data);
    });
    watch(spansAndLeafNodes, () => {
      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
    });
    watch(thList, () => {
      setEffectColMap(thList.value[0], null);
    }, {
      immediate: true
    });
    const onFixedChange = () => {
      nextTick(() => {
        onHorizontalScroll();
        updateAffixHeaderOrFooter();
      });
    };
    const getListener = () => {
      const listener = {};
      BASE_TABLE_ALL_EVENTS.forEach(key => {
        listener[key] = function () {
          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          context.emit(key, ...args);
        };
      });
      return listener;
    };
    const {
      type,
      rowHeight,
      bufferSize = 20,
      isFixedRowHeight = false
    } = props2.scroll || {};
    const {
      data
    } = toRefs(props2);
    const {
      trs = null,
      scrollHeight = null,
      visibleData = null,
      translateY = null,
      handleScroll: handleVirtualScroll = null,
      handleRowMounted = null
    } = type === "virtual" ? useVirtualScroll({
      container: tableContentRef,
      data,
      fixedHeight: isFixedRowHeight,
      lineHeight: rowHeight,
      bufferSize,
      threshold: (_props2$scroll3 = props2.scroll) === null || _props2$scroll3 === void 0 ? void 0 : _props2$scroll3.threshold
    }) : {};
    provide("tableContentRef", tableContentRef);
    provide("rowHeightRef", ref(rowHeight));
    let lastScrollY = 0;
    const onInnerVirtualScroll = e => {
      const target = e.target || e.srcElement;
      const top = target.scrollTop;
      if (lastScrollY !== top) {
        isVirtual.value && handleVirtualScroll();
      } else {
        lastScrollY = 0;
        updateColumnFixedShadow(target);
      }
      lastScrollY = top;
      emitScrollEvent(e);
    };
    const 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, () => {
      setTableContentRef(tableContentRef.value);
    });
    watch(tableElmRef, getTFootHeight);
    watch(tableRef, tableRef2 => {
      addTableResizeObserver(tableRef2);
    });
    onMounted(() => {
      getTFootHeight();
      setTableContentRef(tableContentRef.value);
      addTableResizeObserver(tableRef.value);
    });
    return {
      columnResizable,
      thList,
      classPrefix,
      isVirtual,
      global,
      tableFootHeight,
      tableWidth,
      tableElmWidth,
      tableRef,
      tableElmRef,
      sizeClassNames,
      tableBaseClass,
      spansAndLeafNodes,
      dynamicBaseTableClasses,
      tableContentStyles,
      tableElementStyles,
      virtualScrollClasses,
      tableLayoutClasses,
      tableElmClasses,
      tableContentRef,
      isFixedHeader,
      isWidthOverflow,
      isFixedColumn,
      rowAndColFixedPosition,
      showColumnShadow,
      thWidthList,
      isPaginateData,
      dataSource,
      scrollType: type,
      rowHeight,
      trs,
      bufferSize,
      scrollHeight,
      visibleData,
      translateY,
      affixHeaderRef,
      affixFooterRef,
      paginationRef,
      showAffixHeader,
      showAffixFooter,
      scrollbarWidth,
      isMultipleHeader,
      showRightDivider,
      resizeLineRef,
      resizeLineStyle,
      columnResizeParams,
      horizontalScrollbarRef,
      tableBodyRef,
      showAffixPagination,
      getListener,
      renderPagination,
      renderLNode,
      handleRowMounted,
      onFixedChange,
      onHorizontalScroll,
      updateAffixHeaderOrFooter,
      refreshTable,
      onInnerVirtualScroll,
      paginationAffixRef,
      horizontalScrollAffixRef,
      headerTopAffixRef,
      footerBottomAffixRef
    };
  },
  methods: {
    renderColGroup(columns) {
      const h = this.$createElement;
      const defaultColWidth = this.tableLayout === "fixed" && this.isWidthOverflow ? "100px" : void 0;
      return h("colgroup", [columns.map(col => {
        const style = {
          width: formatCSSUnit(this.thWidthList[col.colKey] || col.width) || defaultColWidth
        };
        if (col.minWidth) style.minWidth = formatCSSUnit(col.minWidth);
        return h("col", {
          "key": col.colKey,
          "style": style
        });
      })]);
    },
    getHeadProps() {
      const headProps = {
        isFixedHeader: this.isFixedHeader,
        rowAndColFixedPosition: this.rowAndColFixedPosition,
        isMultipleHeader: this.isMultipleHeader,
        bordered: this.bordered,
        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] : ""
      };
      return headProps;
    },
    renderFixedHeader(columns) {
      var _navigator, _this$affixHeaderRef;
      const h = this.$createElement;
      if (!this.showHeader) return null;
      const onlyVirtualScrollBordered = !!(this.isVirtual && !this.headerAffixedTop && this.bordered) && /Chrome/.test((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.userAgent);
      const borderWidth = this.bordered && onlyVirtualScrollBordered ? 1 : 0;
      const barWidth = this.isWidthOverflow ? this.scrollbarWidth : 0;
      const IEHeaderWrap = getIEVersion() <= 11 ? 4 : 0;
      const affixHeaderHeight = (((_this$affixHeaderRef = this.affixHeaderRef) === null || _this$affixHeaderRef === void 0 ? void 0 : _this$affixHeaderRef.getBoundingClientRect().height) || 0) - IEHeaderWrap;
      const affixHeaderWrapHeight = affixHeaderHeight - barWidth - borderWidth;
      const headerOpacity = this.headerAffixedTop ? Number(this.showAffixHeader) : 1;
      const affixHeaderWrapHeightStyle = {
        width: `${this.tableWidth}px`,
        height: `${affixHeaderWrapHeight}px`,
        opacity: headerOpacity,
        marginTop: onlyVirtualScrollBordered ? `${borderWidth}px` : 0
      };
      const colgroup = this.renderColGroup(columns);
      const affixedLeftBorder = this.bordered ? 1 : 0;
      const affixedHeader = Boolean((this.headerAffixedTop || this.isVirtual) && this.tableWidth) && h("div", {
        "ref": "affixHeaderRef",
        "style": {
          width: `${this.tableWidth - affixedLeftBorder}px`,
          opacity: headerOpacity
        },
        "class": ["scrollbar", {
          [this.tableBaseClass.affixedHeaderElm]: this.headerAffixedTop || this.isVirtual
        }]
      }, [h("table", {
        "class": this.tableElmClasses,
        "style": {
          ...this.tableElementStyles,
          width: `${this.tableElmWidth}px`
        }
      }, [colgroup, h(THead, helper([{
        "scopedSlots": this.$scopedSlots
      }, {
        "props": this.getHeadProps()
      }]))])]);
      const affixHeaderWithWrap = h("div", {
        "class": this.tableBaseClass.affixedHeaderWrap,
        "style": affixHeaderWrapHeightStyle
      }, [affixedHeader]);
      return affixHeaderWithWrap;
    },
    renderAffixedFooter(columns) {
      var _this$footData;
      const h = this.$createElement;
      const barWidth = this.isWidthOverflow ? this.scrollbarWidth : 0;
      const affixedLeftBorder = this.bordered ? 1 : 0;
      let marginScrollbarWidth = barWidth;
      if (this.bordered) marginScrollbarWidth += 1;
      const affixedFooter = Boolean(this.footerAffixedBottom && ((_this$footData = this.footData) === null || _this$footData === void 0 ? void 0 : _this$footData.length) && this.tableWidth) && h(Affix, helper([{
        "class": this.tableBaseClass.affixedFooterWrap,
        "on": {
          "fixedChange": this.onFixedChange
        },
        "attrs": {
          "offsetBottom": marginScrollbarWidth || 0
        }
      }, {
        "props": getAffixProps(this.footerAffixedBottom, this.footerAffixProps)
      }, {
        "style": {
          marginTop: `${-1 * (this.tableFootHeight + marginScrollbarWidth)}px`
        },
        "ref": "footerBottomAffixRef"
      }]), [h("div", {
        "ref": "affixFooterRef",
        "style": {
          width: `${this.tableWidth - affixedLeftBorder}px`,
          opacity: Number(this.showAffixFooter)
        },
        "class": ["scrollbar", {
          [this.tableBaseClass.affixedFooterElm]: this.footerAffixedBottom || this.isVirtual
        }]
      }, [h("table", {
        "class": this.tableElmClasses,
        "style": {
          ...this.tableElementStyles,
          width: `${this.tableElmWidth}px`
        }
      }, [this.renderColGroup(columns), h(TFoot, {
        "attrs": {
          "rowKey": this.rowKey,
          "isFixedHeader": this.isFixedHeader,
          "rowAndColFixedPosition": this.rowAndColFixedPosition,
          "footData": this.footData,
          "columns": columns,
          "rowAttributes": this.rowAttributes,
          "rowClassName": this.rowClassName,
          "thWidthList": this.thWidthList,
          "footerSummary": this.footerSummary,
          "rowspanAndColspanInFooter": this.rowspanAndColspanInFooter
        },
        "scopedSlots": this.$scopedSlots
      })])])]);
      return affixedFooter;
    },
    renderAffixedHeader(columns) {
      const h = this.$createElement;
      if (!BaseTableProps.showHeader) return null;
      return !!(this.isVirtual || this.headerAffixedTop) && (this.headerAffixedTop ? h(Affix, helper([{
        "attrs": {
          "offsetTop": 0
        }
      }, {
        "props": getAffixProps(this.headerAffixedTop, this.headerAffixProps)
      }, {
        "on": {
          "fixedChange": this.onFixedChange
        },
        "ref": "headerTopAffixRef"
      }]), [this.renderFixedHeader(columns)]) : this.isFixedHeader && this.renderFixedHeader(columns));
    }
  },
  render(h) {
    var _this$spansAndLeafNod, _this$tableContentRef;
    const {
      rowAndColFixedPosition
    } = this;
    const data = this.isPaginateData ? this.dataSource : this.data;
    const columns = ((_this$spansAndLeafNod = this.spansAndLeafNodes) === null || _this$spansAndLeafNod === void 0 ? void 0 : _this$spansAndLeafNod.leafColumns) || this.columns;
    if (this.allowResizeColumnWidth) log.warn("Table", "allowResizeColumnWidth is going to be deprecated, please use resizable instead.");
    if (this.columnResizable && this.tableLayout === "auto") log.warn("Table", "table-layout can not be `auto` for resizable column table, set `table-layout: fixed` please.");
    const translate = `translate(0, ${this.scrollHeight}px)`;
    const virtualStyle = {
      "transform": translate,
      "-ms-transform": translate,
      "-moz-transform": translate,
      "-webkit-transform": translate
    };
    const tableBodyProps = {
      rowAndColFixedPosition,
      showColumnShadow: this.showColumnShadow,
      data: this.isVirtual ? this.visibleData : data,
      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,
      classPrefix: this.classPrefix,
      cellEmptyContent: this.cellEmptyContent,
      handleRowMounted: this.handleRowMounted,
      renderExpandedRow: this.renderExpandedRow,
      ...pick(this.$props, extendTableProps)
    };
    const tBodyListener = this.getListener();
    const tableContent = h("div", 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
    }, [this.renderColGroup(columns), this.showHeader && h(THead, helper([{
      "scopedSlots": this.$scopedSlots
    }, {
      "props": this.getHeadProps()
    }])), h(TBody, helper([{
      "ref": "tableBodyRef",
      "scopedSlots": this.$scopedSlots
    }, {
      "props": tableBodyProps
    }, {}, {
      "on": tBodyListener
    }])), h(TFoot, {
      "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
    })])]);
    const customLoadingText = this.renderLNode("loading");
    const loadingContent = this.loading !== void 0 && h(Loading, helper([{
      "attrs": {
        "loading": !!this.loading,
        "text": customLoadingText ? () => customLoadingText : void 0,
        "attach": this.tableRef ? () => this.tableRef : void 0,
        "showOverlay": true
      }
    }, {
      "props": {
        size: "small",
        ...this.loadingProps
      }
    }]));
    const topContent = this.renderLNode("topContent");
    const bottomContent = this.renderLNode("bottomContent");
    const pagination = h("div", {
      "ref": "paginationRef",
      "class": this.tableBaseClass.paginationWrap,
      "style": {
        opacity: Number(this.showAffixPagination)
      }
    }, [this.renderPagination(h)]);
    const 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.renderAffixedHeader(columns), tableContent, this.renderAffixedFooter(columns), loadingContent, this.showRightDivider && h("div", {
      "class": this.tableBaseClass.scrollbarDivider,
      "style": {
        right: `${this.scrollbarWidth}px`,
        height: `${(_this$tableContentRef = this.tableContentRef) === null || _this$tableContentRef === void 0 ? void 0 : _this$tableContentRef.getBoundingClientRect().height}px`
      }
    }), bottom, this.horizontalScrollAffixedBottom && h(Affix, helper([{
      "attrs": {
        "offsetBottom": 0
      }
    }, {
      "props": getAffixProps(this.horizontalScrollAffixedBottom)
    }, {
      "style": this.showAffixFooter ? {
        marginTop: `-${this.scrollbarWidth * 2}px`
      } : {
        float: "right",
        visibility: "hidden"
      },
      "ref": "horizontalScrollAffixRef"
    }]), [h("div", {
      "ref": "horizontalScrollbarRef",
      "class": ["scrollbar", this.tableBaseClass.obviousScrollbar],
      "style": {
        width: `${this.tableWidth}px`,
        overflow: "auto",
        opacity: Number(this.showAffixFooter)
      }
    }, [h("div", {
      "style": {
        width: `${this.tableElmWidth}px`,
        height: "5px"
      }
    })])]), this.paginationAffixedBottom ? h(Affix, helper([{
      "attrs": {
        "offsetBottom": 0
      }
    }, {
      "props": getAffixProps(this.paginationAffixedBottom)
    }, {
      "ref": "paginationAffixRef"
    }]), [pagination]) : pagination, h("div", {
      "ref": "resizeLineRef",
      "class": this.tableBaseClass.resizeLine,
      "style": this.resizeLineStyle
    })]);
  }
});

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