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.

1 line
34 KiB

{"ast":null,"code":"import { defineComponent, getCurrentInstance, provide, computed, onBeforeUnmount, resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, withDirectives, createVNode, createCommentVNode, withCtx, createBlock, createTextVNode, toDisplayString, vShow } from 'vue';\nimport { debounce } from 'lodash-unified';\nimport '../../../directives/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { ElScrollbar } from '../../scrollbar/index.mjs';\nimport { createStore } from './store/helper.mjs';\nimport TableLayout from './table-layout.mjs';\nimport TableHeader from './table-header/index.mjs';\nimport TableBody from './table-body/index.mjs';\nimport TableFooter from './table-footer/index.mjs';\nimport useUtils from './table/utils-helper.mjs';\nimport { convertToRows } from './table-header/utils-helper.mjs';\nimport useStyle from './table/style-helper.mjs';\nimport useKeyRender from './table/key-render-helper.mjs';\nimport defaultProps from './table/defaults.mjs';\nimport { TABLE_INJECTION_KEY } from './tokens.mjs';\nimport { hColgroup } from './h-helper.mjs';\nimport { useScrollbar } from './composables/use-scrollbar.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport Mousewheel from '../../../directives/mousewheel/index.mjs';\nimport { useLocale } from '../../../hooks/use-locale/index.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nlet tableIdSeed = 1;\nconst _sfc_main = defineComponent({\n name: \"ElTable\",\n directives: {\n Mousewheel\n },\n components: {\n TableHeader,\n TableBody,\n TableFooter,\n ElScrollbar,\n hColgroup\n },\n props: defaultProps,\n emits: [\"select\", \"select-all\", \"selection-change\", \"cell-mouse-enter\", \"cell-mouse-leave\", \"cell-contextmenu\", \"cell-click\", \"cell-dblclick\", \"row-click\", \"row-contextmenu\", \"row-dblclick\", \"header-click\", \"header-contextmenu\", \"sort-change\", \"filter-change\", \"current-change\", \"header-dragend\", \"expand-change\"],\n setup(props) {\n const {\n t\n } = useLocale();\n const ns = useNamespace(\"table\");\n const table = getCurrentInstance();\n provide(TABLE_INJECTION_KEY, table);\n const store = createStore(table, props);\n table.store = store;\n const layout = new TableLayout({\n store: table.store,\n table,\n fit: props.fit,\n showHeader: props.showHeader\n });\n table.layout = layout;\n const isEmpty = computed(() => (store.states.data.value || []).length === 0);\n const {\n setCurrentRow,\n getSelectionRows,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n updateKeyChildren\n } = useUtils(store);\n const {\n isHidden,\n renderExpanded,\n setDragVisible,\n isGroup,\n handleMouseLeave,\n handleHeaderFooterMousewheel,\n tableSize,\n emptyBlockStyle,\n handleFixedMousewheel,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\n tableInnerStyle,\n scrollbarStyle\n } = useStyle(props, layout, store, table);\n const {\n scrollBarRef,\n scrollTo,\n setScrollLeft,\n setScrollTop\n } = useScrollbar();\n const debouncedUpdateLayout = debounce(doLayout, 50);\n const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`;\n table.tableId = tableId;\n table.state = {\n isGroup,\n resizeState,\n doLayout,\n debouncedUpdateLayout\n };\n const computedSumText = computed(() => {\n var _a;\n return (_a = props.sumText) != null ? _a : t(\"el.table.sumText\");\n });\n const computedEmptyText = computed(() => {\n var _a;\n return (_a = props.emptyText) != null ? _a : t(\"el.table.emptyText\");\n });\n const columns = computed(() => {\n return convertToRows(store.states.originColumns.value)[0];\n });\n useKeyRender(table);\n onBeforeUnmount(() => {\n debouncedUpdateLayout.cancel();\n });\n return {\n ns,\n layout,\n store,\n columns,\n handleHeaderFooterMousewheel,\n handleMouseLeave,\n tableId,\n tableSize,\n isHidden,\n isEmpty,\n renderExpanded,\n resizeProxyVisible,\n resizeState,\n isGroup,\n bodyWidth,\n tableBodyStyles,\n emptyBlockStyle,\n debouncedUpdateLayout,\n handleFixedMousewheel,\n setCurrentRow,\n getSelectionRows,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n doLayout,\n sort,\n updateKeyChildren,\n t,\n setDragVisible,\n context: table,\n computedSumText,\n computedEmptyText,\n tableLayout,\n scrollbarViewStyle,\n tableInnerStyle,\n scrollbarStyle,\n scrollBarRef,\n scrollTo,\n setScrollLeft,\n setScrollTop\n };\n }\n});\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_hColgroup = resolveComponent(\"hColgroup\");\n const _component_table_header = resolveComponent(\"table-header\");\n const _component_table_body = resolveComponent(\"table-body\");\n const _component_table_footer = resolveComponent(\"table-footer\");\n const _component_el_scrollbar = resolveComponent(\"el-scrollbar\");\n const _directive_mousewheel = resolveDirective(\"mousewheel\");\n return openBlock(), createElementBlock(\"div\", {\n ref: \"tableWrapper\",\n class: normalizeClass([{\n [_ctx.ns.m(\"fit\")]: _ctx.fit,\n [_ctx.ns.m(\"striped\")]: _ctx.stripe,\n [_ctx.ns.m(\"border\")]: _ctx.border || _ctx.isGroup,\n [_ctx.ns.m(\"hidden\")]: _ctx.isHidden,\n [_ctx.ns.m(\"group\")]: _ctx.isGroup,\n [_ctx.ns.m(\"fluid-height\")]: _ctx.maxHeight,\n [_ctx.ns.m(\"scrollable-x\")]: _ctx.layout.scrollX.value,\n [_ctx.ns.m(\"scrollable-y\")]: _ctx.layout.scrollY.value,\n [_ctx.ns.m(\"enable-row-hover\")]: !_ctx.store.states.isComplex.value,\n [_ctx.ns.m(\"enable-row-transition\")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,\n \"has-footer\": _ctx.showSummary\n }, _ctx.ns.m(_ctx.tableSize), _ctx.className, _ctx.ns.b(), _ctx.ns.m(`layout-${_ctx.tableLayout}`)]),\n style: normalizeStyle(_ctx.style),\n \"data-prefix\": _ctx.ns.namespace.value,\n onMouseleave: _ctx.handleMouseLeave\n }, [createElementVNode(\"div\", {\n class: normalizeClass(_ctx.ns.e(\"inner-wrapper\")),\n style: normalizeStyle(_ctx.tableInnerStyle)\n }, [createElementVNode(\"div\", {\n ref: \"hiddenColumns\",\n class: \"hidden-columns\"\n }, [renderSlot(_ctx.$slots, \"default\")], 512), _ctx.showHeader && _ctx.tableLayout === \"fixed\" ? withDirectives((openBlock(), createElementBlock(\"div\", {\n key: 0,\n ref: \"headerWrapper\",\n class: normalizeClass(_ctx.ns.e(\"header-wrapper\"))\n }, [createElementVNode(\"table\", {\n ref: \"tableHeader\",\n class: normalizeClass(_ctx.ns.e(\"header\")),\n style: normalizeStyle(_ctx.tableBodyStyles),\n border: \"0\",\n cellpadding: \"0\",\n cellspacing: \"0\"\n }, [createVNode(_component_hColgroup, {\n columns: _ctx.store.states.columns.value,\n \"table-layout\": _ctx.tableLayout\n }, null, 8, [\"columns\", \"table-layout\"]), createVNode(_component_table_header, {\n ref: \"tableHeaderRef\",\n border: _ctx.border,\n \"default-sort\": _ctx.defaultSort,\n store: _ctx.store,\n \"append-filter-panel-to\": _ctx.appendFilterPanelTo,\n onSetDragVisible: _ctx.setDragVisible\n }, null, 8, [\"border\", \"default-sort\", \"store\", \"append-filter-panel-to\", \"onSetDragVisible\"])], 6)], 2)), [[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode(\"v-if\", true), createElementVNode(\"div\", {\n ref: \"bodyWrapper\",\n class: normalizeClass(_ctx.ns.e(\"body-wrapper\"))\n }, [createVNode(_component_el_scrollbar, {\n ref: \"scrollBarRef\",\n \"view-style\": _ctx.scrollbarViewStyle,\n \"wrap-style\": _ctx.scrollbarStyle,\n always: _ctx.scrollbarAlwaysOn,\n tabindex: _ctx.scrollbarTabindex\n }, {\n default: withCtx(() => [createElementVNode(\"table\", {\n ref: \"tableBody\",\n class: normalizeClass(_ctx.ns.e(\"body\")),\n cellspacing: \"0\",\n cellpadding: \"0\",\n border: \"0\",\n style: normalizeStyle({\n width: _ctx.bodyWidth,\n tableLayout: _ctx.tableLayout\n })\n }, [createVNode(_component_hColgroup, {\n columns: _ctx.store.states.columns.value,\n \"table-layout\": _ctx.tableLayout\n }, null, 8, [\"columns\", \"table-layout\"]), _ctx.showHeader && _ctx.tableLayout === \"auto\" ? (openBlock(), createBlock(_component_table_header, {\n key: 0,\n ref: \"tableHeaderRef\",\n class: normalizeClass(_ctx.ns.e(\"body-header\")),\n border: _ctx.border,\n \"default-sort\": _ctx.defaultSort,\n store: _ctx.store,\n \"append-filter-panel-to\": _ctx.appendFilterPanelTo,\n onSetDragVisible: _ctx.setDragVisible\n }, null, 8, [\"class\", \"border\", \"default-sort\", \"store\", \"append-filter-panel-to\", \"onSetDragVisible\"])) : createCommentVNode(\"v-if\", true), createVNode(_component_table_body, {\n context: _ctx.context,\n highlight: _ctx.highlightCurrentRow,\n \"row-class-name\": _ctx.rowClassName,\n \"tooltip-effect\": _ctx.tooltipEffect,\n \"tooltip-options\": _ctx.tooltipOptions,\n \"row-style\": _ctx.rowStyle,\n store: _ctx.store,\n stripe: _ctx.stripe\n }, null, 8, [\"context\", \"highlight\", \"row-class-name\", \"tooltip-effect\", \"tooltip-options\", \"row-style\", \"store\", \"stripe\"]), _ctx.showSummary && _ctx.tableLayout === \"auto\" ? (openBlock(), createBlock(_component_table_footer, {\n key: 1,\n class: normalizeClass(_ctx.ns.e(\"body-footer\")),\n border: _ctx.border,\n \"default-sort\": _ctx.defaultSort,\n store: _ctx.store,\n \"sum-text\": _ctx.computedSumText,\n \"summary-method\": _ctx.summaryMethod\n }, null, 8, [\"class\", \"border\", \"default-sort\", \"store\", \"sum-text\", \"summary-method\"])) : createCommentVNode(\"v-if\", true)], 6), _ctx.isEmpty ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n ref: \"emptyBlock\",\n style: normalizeStyle(_ctx.emptyBlockStyle),\n class: normalizeClass(_ctx.ns.e(\"empty-block\"))\n }, [createElementVNode(\"span\", {\n class: normalizeClass(_ctx.ns.e(\"empty-text\"))\n }, [renderSlot(_ctx.$slots, \"empty\", {}, () => [createTextVNode(toDisplayString(_ctx.computedEmptyText), 1)])], 2)], 6)) : createCommentVNode(\"v-if\", true), _ctx.$slots.append ? (openBlock(), createElementBlock(\"div\", {\n key: 1,\n ref: \"appendWrapper\",\n class: normalizeClass(_ctx.ns.e(\"append-wrapper\"))\n }, [renderSlot(_ctx.$slots, \"append\")], 2)) : createCommentVNode(\"v-if\", true)]),\n _: 3\n }, 8, [\"view-style\", \"wrap-style\", \"always\", \"tabindex\"])], 2), _ctx.showSummary && _ctx.tableLayout === \"fixed\" ? withDirectives((openBlock(), createElementBlock(\"div\", {\n key: 1,\n ref: \"footerWrapper\",\n class: normalizeClass(_ctx.ns.e(\"footer-wrapper\"))\n }, [createElementVNode(\"table\", {\n class: normalizeClass(_ctx.ns.e(\"footer\")),\n cellspacing: \"0\",\n cellpadding: \"0\",\n border: \"0\",\n style: normalizeStyle(_ctx.tableBodyStyles)\n }, [createVNode(_component_hColgroup, {\n columns: _ctx.store.states.columns.value,\n \"table-layout\": _ctx.tableLayout\n }, null, 8, [\"columns\", \"table-layout\"]), createVNode(_component_table_footer, {\n border: _ctx.border,\n \"default-sort\": _ctx.defaultSort,\n store: _ctx.store,\n \"sum-text\": _ctx.computedSumText,\n \"summary-method\": _ctx.summaryMethod\n }, null, 8, [\"border\", \"default-sort\", \"store\", \"sum-text\", \"summary-method\"])], 6)], 2)), [[vShow, !_ctx.isEmpty], [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode(\"v-if\", true), _ctx.border || _ctx.isGroup ? (openBlock(), createElementBlock(\"div\", {\n key: 2,\n class: normalizeClass(_ctx.ns.e(\"border-left-patch\"))\n }, null, 2)) : createCommentVNode(\"v-if\", true)], 6), withDirectives(createElementVNode(\"div\", {\n ref: \"resizeProxy\",\n class: normalizeClass(_ctx.ns.e(\"column-resize-proxy\"))\n }, null, 2), [[vShow, _ctx.resizeProxyVisible]])], 46, [\"data-prefix\", \"onMouseleave\"]);\n}\nvar Table = /* @__PURE__ */_export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__file\", \"table.vue\"]]);\nexport { Table as default };","map":{"version":3,"names":["tableIdSeed","_sfc_main","defineComponent","name","directives","Mousewheel","components","TableHeader","TableBody","TableFooter","ElScrollbar","hColgroup","props","defaultProps","emits","setup","t","useLocale","ns","useNamespace","table","getCurrentInstance","provide","TABLE_INJECTION_KEY","store","createStore","layout","TableLayout","fit","showHeader","isEmpty","computed","states","data","value","length","setCurrentRow","getSelectionRows","toggleRowSelection","clearSelection","clearFilter","toggleAllSelection","toggleRowExpansion","clearSort","sort","updateKeyChildren","useUtils","isHidden","renderExpanded","setDragVisible","isGroup","handleMouseLeave","handleHeaderFooterMousewheel","tableSize","emptyBlockStyle","handleFixedMousewheel","resizeProxyVisible","bodyWidth","resizeState","doLayout","tableBodyStyles","tableLayout","scrollbarViewStyle","tableInnerStyle","scrollbarStyle","useStyle","scrollBarRef","scrollTo","setScrollLeft","setScrollTop","useScrollbar","debouncedUpdateLayout","debounce","tableId","namespace","state","computedSumText","_a","sumText","computedEmptyText","emptyText","columns","convertToRows","originColumns","useKeyRender","onBeforeUnmount","cancel","context","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_component_hColgroup","resolveComponent","_component_table_header","_component_table_body","_component_table_footer","_component_el_scrollbar","_directive_mousewheel","resolveDirective","openBlock","createElementBlock","ref","class","normalizeClass","m","stripe","border","maxHeight","scrollX","scrollY","isComplex","showSummary","className","b","style","normalizeStyle","onMouseleave","createElementVNode","e","cellpadding","cellspacing","createVNode","defaultSort","appendFilterPanelTo","onSetDragVisible","createCommentVNode","always","scrollbarAlwaysOn","tabindex","scrollbarTabindex","default","withCtx","key","highlight","highlightCurrentRow","rowClassName","tooltipEffect","tooltipOptions","rowStyle","createBlock","renderSlot","$slots","append","_","withDirectives","summaryMethod","vShow"],"sources":["../../../../../../packages/components/table/src/table.vue"],"sourcesContent":["<template>\n <div\n ref=\"tableWrapper\"\n :class=\"[\n {\n [ns.m('fit')]: fit,\n [ns.m('striped')]: stripe,\n [ns.m('border')]: border || isGroup,\n [ns.m('hidden')]: isHidden,\n [ns.m('group')]: isGroup,\n [ns.m('fluid-height')]: maxHeight,\n [ns.m('scrollable-x')]: layout.scrollX.value,\n [ns.m('scrollable-y')]: layout.scrollY.value,\n [ns.m('enable-row-hover')]: !store.states.isComplex.value,\n [ns.m('enable-row-transition')]:\n (store.states.data.value || []).length !== 0 &&\n (store.states.data.value || []).length < 100,\n 'has-footer': showSummary,\n },\n ns.m(tableSize),\n className,\n ns.b(),\n ns.m(`layout-${tableLayout}`),\n ]\"\n :style=\"style\"\n :data-prefix=\"ns.namespace.value\"\n @mouseleave=\"handleMouseLeave\"\n >\n <div :class=\"ns.e('inner-wrapper')\" :style=\"tableInnerStyle\">\n <div ref=\"hiddenColumns\" class=\"hidden-columns\">\n <slot />\n </div>\n <div\n v-if=\"showHeader && tableLayout === 'fixed'\"\n ref=\"headerWrapper\"\n v-mousewheel=\"handleHeaderFooterMousewheel\"\n :class=\"ns.e('header-wrapper')\"\n >\n <table\n ref=\"tableHeader\"\n :class=\"ns.e('header')\"\n :style=\"tableBodyStyles\"\n border=\"0\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n >\n <hColgroup\n :columns=\"store.states.columns.value\"\n :table-layout=\"tableLayout\"\n />\n <table-header\n ref=\"tableHeaderRef\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :append-filter-panel-to=\"appendFilterPanelTo\"\n @set-drag-visible=\"setDragVisible\"\n />\n </table>\n </div>\n <div ref=\"bodyWrapper\" :class=\"ns.e('body-wrapper')\">\n <el-scrollbar\n ref=\"scrollBarRef\"\n :view-style=\"scrollbarViewStyle\"\n :wrap-style=\"scrollbarStyle\"\n :always=\"scrollbarAlwaysOn\"\n :tabindex=\"scrollbarTabindex\"\n >\n <table\n ref=\"tableBody\"\n :class=\"ns.e('body')\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n border=\"0\"\n :style=\"{\n width: bodyWidth,\n tableLayout,\n }\"\n >\n <hColgroup\n :columns=\"store.states.columns.value\"\n :table-layout=\"tableLayout\"\n />\n <table-header\n v-if=\"showHeader && tableLayout === 'auto'\"\n ref=\"tableHeaderRef\"\n :class=\"ns.e('body-header')\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :append-filter-panel-to=\"appendFilterPanelTo\"\n @set-drag-visible=\"setDragVisible\"\n />\n <table-body\n :context=\"context\"\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :tooltip-options=\"tooltipOptions\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n />\n <table-footer\n v-if=\"showSummary && tableLayout === 'auto'\"\n :class=\"ns.e('body-footer')\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :sum-text=\"computedSumText\"\n :summary-method=\"summaryMethod\"\n />\n </table>\n <div\n v-if=\"isEmpty\"\n ref=\"emptyBlock\"\n :style=\"emptyBlockStyle\"\n :class=\"ns.e('empty-block')\"\n >\n <span :class=\"ns.e('empty-text')\">\n <slot name=\"empty\">{{ computedEmptyText }}</slot>\n </span>\n </div>\n <div\n v-if=\"$slots.append\"\n ref=\"appendWrapper\"\n :class=\"ns.e('append-wrapper')\"\n >\n <slot name=\"append\" />\n </div>\n </el-scrollbar>\n </div>\n <div\n v-if=\"showSummary && tableLayout === 'fixed'\"\n v-show=\"!isEmpty\"\n ref=\"footerWrapper\"\n v-mousewheel=\"handleHeaderFooterMousewheel\"\n :class=\"ns.e('footer-wrapper')\"\n >\n <table\n :class=\"ns.e('footer')\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n border=\"0\"\n :style=\"tableBodyStyles\"\n >\n <hColgroup\n :columns=\"store.states.columns.value\"\n :table-layout=\"tableLayout\"\n />\n <table-footer\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :sum-text=\"computedSumText\"\n :summary-method=\"summaryMethod\"\n />\n </table>\n </div>\n <div v-if=\"border || isGroup\" :class=\"ns.e('border-left-patch')\" />\n </div>\n <div\n v-show=\"resizeProxyVisible\"\n ref=\"resizeProxy\"\n :class=\"ns.e('column-resize-proxy')\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n provide,\n} from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { Mousewheel } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport { createStore } from './store/helper'\nimport TableLayout from './table-layout'\nimport TableHeader from './table-header'\nimport TableBody from './table-body'\nimport TableFooter from './table-footer'\nimport useUtils from './table/utils-helper'\nimport { convertToRows } from './table-header/utils-helper'\nimport useStyle from './table/style-helper'\nimport useKeyRender from './table/key-render-helper'\nimport defaultProps from './table/defaults'\nimport { TABLE_INJECTION_KEY } from './tokens'\nimport { hColgroup } from './h-helper'\nimport { useScrollbar } from './composables/use-scrollbar'\n\nimport type { Table } from './table/defaults'\n\nlet tableIdSeed = 1\nexport default defineComponent({\n name: 'ElTable',\n directives: {\n Mousewheel,\n },\n components: {\n TableHeader,\n TableBody,\n TableFooter,\n ElScrollbar,\n hColgroup,\n },\n props: defaultProps,\n emits: [\n 'select',\n 'select-all',\n 'selection-change',\n 'cell-mouse-enter',\n 'cell-mouse-leave',\n 'cell-contextmenu',\n 'cell-click',\n 'cell-dblclick',\n 'row-click',\n 'row-contextmenu',\n 'row-dblclick',\n 'header-click',\n 'header-contextmenu',\n 'sort-change',\n 'filter-change',\n 'current-change',\n 'header-dragend',\n 'expand-change',\n ],\n setup(props) {\n type Row = typeof props.data[number]\n const { t } = useLocale()\n const ns = useNamespace('table')\n const table = getCurrentInstance() as Table<Row>\n provide(TABLE_INJECTION_KEY, table)\n const store = createStore<Row>(table, props)\n table.store = store\n const layout = new TableLayout<Row>({\n store: table.store,\n table,\n fit: props.fit,\n showHeader: props.showHeader,\n })\n table.layout = layout\n\n const isEmpty = computed(() => (store.states.data.value || []).length === 0)\n\n /**\n * open functions\n */\n const {\n setCurrentRow,\n getSelectionRows,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n updateKeyChildren,\n } = useUtils<Row>(store)\n const {\n isHidden,\n renderExpanded,\n setDragVisible,\n isGroup,\n handleMouseLeave,\n handleHeaderFooterMousewheel,\n tableSize,\n emptyBlockStyle,\n handleFixedMousewheel,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\n tableInnerStyle,\n scrollbarStyle,\n } = useStyle<Row>(props, layout, store, table)\n\n const { scrollBarRef, scrollTo, setScrollLeft, setScrollTop } =\n useScrollbar()\n\n const debouncedUpdateLayout = debounce(doLayout, 50)\n\n const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`\n table.tableId = tableId\n table.state = {\n isGroup,\n resizeState,\n doLayout,\n debouncedUpdateLayout,\n }\n const computedSumText = computed(\n () => props.sumText ?? t('el.table.sumText')\n )\n\n const computedEmptyText = computed(() => {\n return props.emptyText ?? t('el.table.emptyText')\n })\n\n const columns = computed(() => {\n return convertToRows(store.states.originColumns.value)[0]\n })\n\n useKeyRender(table)\n\n onBeforeUnmount(() => {\n debouncedUpdateLayout.cancel()\n })\n\n return {\n ns,\n layout,\n store,\n columns,\n handleHeaderFooterMousewheel,\n handleMouseLeave,\n tableId,\n tableSize,\n isHidden,\n isEmpty,\n renderExpanded,\n resizeProxyVisible,\n resizeState,\n isGroup,\n bodyWidth,\n tableBodyStyles,\n emptyBlockStyle,\n debouncedUpdateLayout,\n handleFixedMousewheel,\n /**\n * @description used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection\n */\n setCurrentRow,\n /**\n * @description returns the currently selected rows\n */\n getSelectionRows,\n /**\n * @description used in multiple selection Table, toggle if a certain row is selected. With the second parameter, you can directly set if this row is selected\n */\n toggleRowSelection,\n /**\n * @description used in multiple selection Table, clear user selection\n */\n clearSelection,\n /**\n * @description clear filters of the columns whose `columnKey` are passed in. If no params, clear all filters\n */\n clearFilter,\n /**\n * @description used in multiple selection Table, toggle select all and deselect all\n */\n toggleAllSelection,\n /**\n * @description used in expandable Table or tree Table, toggle if a certain row is expanded. With the second parameter, you can directly set if this row is expanded or collapsed\n */\n toggleRowExpansion,\n /**\n * @description clear sorting, restore data to the original order\n */\n clearSort,\n /**\n * @description refresh the layout of Table. When the visibility of Table changes, you may need to call this method to get a correct layout\n */\n doLayout,\n /**\n * @description sort Table manually. Property `prop` is used to set sort column, property `order` is used to set sort order\n */\n sort,\n /**\n * @description used in lazy Table, must set `rowKey`, update key children\n */\n updateKeyChildren,\n t,\n setDragVisible,\n context: table,\n computedSumText,\n computedEmptyText,\n tableLayout,\n scrollbarViewStyle,\n tableInnerStyle,\n scrollbarStyle,\n scrollBarRef,\n /**\n * @description scrolls to a particular set of coordinates\n */\n scrollTo,\n /**\n * @description set horizontal scroll position\n */\n setScrollLeft,\n /**\n * @description set vertical scroll position\n */\n setScrollTop,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsMA,IAAIA,WAAc;AAClB,MAAKC,SAAA,GAAaC,eAAa;EAC7BC,IAAM;EACNC,UAAY;IACVC;EAAA,CACF;EACAC,UAAY;IACVC,WAAA;IACAC,SAAA;IACAC,WAAA;IACAC,WAAA;IACAC;EAAA,CACF;EACAC,KAAO,EAAAC,YAAA;EACPC,KAAO,GACL,UACA,cACA,oBACA,oBACA,oBACA,oBACA,cACA,iBACA,aACA,mBACA,gBACA,gBACA,sBACA,eACA,iBACA,kBACA,kBACA,gBACF;EACAC,MAAMH,KAAO;IAEL;MAAEI;IAAE,IAAIC,SAAU;IAClB,MAAAC,EAAA,GAAKC,YAAA,CAAa,OAAO;IAC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