You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
25 KiB

1 month ago
  1. {"ast":null,"code":"import { defineComponent, provide, unref, createVNode, isVNode, mergeProps } from 'vue';\nimport { useTable } from './use-table.mjs';\nimport { TableV2InjectionKey } from './tokens.mjs';\nimport { tableV2Props } from './table.mjs';\nimport MainTable from './renderers/main-table.mjs';\nimport LeftTable from './renderers/left-table.mjs';\nimport RightTable from './renderers/right-table.mjs';\nimport Row from './renderers/row.mjs';\nimport Cell from './renderers/cell.mjs';\nimport Header from './renderers/header.mjs';\nimport HeaderCell from './renderers/header-cell.mjs';\nimport Footer from './renderers/footer.mjs';\nimport Empty from './renderers/empty.mjs';\nimport Overlay from './renderers/overlay.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nfunction _isSlot(s) {\n return typeof s === \"function\" || Object.prototype.toString.call(s) === \"[object Object]\" && !isVNode(s);\n}\nconst COMPONENT_NAME = \"ElTableV2\";\nconst TableV2 = defineComponent({\n name: COMPONENT_NAME,\n props: tableV2Props,\n setup(props, {\n slots,\n expose\n }) {\n const ns = useNamespace(\"table-v2\");\n const {\n columnsStyles,\n fixedColumnsOnLeft,\n fixedColumnsOnRight,\n mainColumns,\n mainTableHeight,\n fixedTableHeight,\n leftTableWidth,\n rightTableWidth,\n data,\n depthMap,\n expandedRowKeys,\n hasFixedColumns,\n mainTableRef,\n leftTableRef,\n rightTableRef,\n isDynamic,\n isResetting,\n isScrolling,\n bodyWidth,\n emptyStyle,\n rootStyle,\n headerWidth,\n footerHeight,\n showEmpty,\n scrollTo,\n scrollToLeft,\n scrollToTop,\n scrollToRow,\n getRowHeight,\n onColumnSorted,\n onRowHeightChange,\n onRowHovered,\n onRowExpanded,\n onRowsRendered,\n onScroll,\n onVerticalScroll\n } = useTable(props);\n expose({\n scrollTo,\n scrollToLeft,\n scrollToTop,\n scrollToRow\n });\n provide(TableV2InjectionKey, {\n ns,\n isResetting,\n isScrolling\n });\n return () => {\n const {\n cache,\n cellProps,\n estimatedRowHeight,\n expandColumnKey,\n fixedData,\n headerHeight,\n headerClass,\n headerProps,\n headerCellProps,\n sortBy,\n sortState,\n rowHeight,\n rowClass,\n rowEventHandlers,\n rowKey,\n rowProps,\n scrollbarAlwaysOn,\n indentSize,\n iconSize,\n useIsScrolling,\n vScrollbarSize,\n width\n } = props;\n const _data = unref(data);\n const mainTableProps = {\n cache,\n class: ns.e(\"main\"),\n columns: unref(mainColumns),\n data: _data,\n fixedData,\n estimatedRowHeight,\n bodyWidth: unref(bodyWidth) + vScrollbarSize,\n headerHeight,\n headerWidth: unref(headerWidth),\n height: unref(mainTableHeight),\n mainTableRef,\n rowKey,\n rowHeight,\n scrollbarAlwaysOn,\n scrollbarStartGap: 2,\n scrollbarEndGap: vScrollbarSize,\n useIsScrolling,\n width,\n getRowHeight,\n onRowsRendered,\n onScroll\n };\n const leftColumnsWidth = unref(leftTableWidth);\n const _fixedTableHeight = unref(fixedTableHeight);\n const leftTableProps = {\n cache,\n class: ns.e(\"left\"),\n columns: unref(fixedColumnsOnLeft),\n data: _data,\n estimatedRowHeight,\n leftTableRef,\n rowHeight,\n bodyWidth: leftColumnsWidth,\n headerWidth: leftColumnsWidth,\n headerHeight,\n height: _fixedTableHeight,\n rowKey,\n scrollbarAlwaysOn,\n scrollbarStartGap: 2,\n scrollbarEndGap: vScrollbarSize,\n useIsScrolling,\n width: leftColumnsWidth,\n getRowHeight,\n onScroll: onVerticalScroll\n };\n const rightColumnsWidth