@element-plus/nightly 0.0.20260209 → 0.0.20260211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.full.js +55 -10
- package/dist/index.full.min.js +19 -19
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +20 -20
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +55 -10
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +1 -1
- package/es/components/config-provider/src/config-provider-props.d.ts +7 -0
- package/es/components/config-provider/src/config-provider-props.mjs +6 -0
- package/es/components/config-provider/src/config-provider-props.mjs.map +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +12 -0
- package/es/components/descriptions/src/description-item.d.ts +1 -1
- package/es/components/input/src/utils.mjs +7 -3
- package/es/components/input/src/utils.mjs.map +1 -1
- package/es/components/pagination/src/pagination.d.ts +1 -1
- package/es/components/select/src/select.vue.d.ts +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +2 -2
- package/es/components/table/index.d.ts +1 -1
- package/es/components/table/index.mjs.map +1 -1
- package/es/components/table/src/table/defaults.d.ts +11 -2
- package/es/components/table/src/table/defaults.mjs +4 -1
- package/es/components/table/src/table/defaults.mjs.map +1 -1
- package/es/components/table/src/table-body/td-wrapper.vue.d.ts +1 -1
- package/es/components/table/src/table-column/index.d.ts +1 -1
- package/es/components/table/src/table-column/index.mjs +5 -2
- package/es/components/table/src/table-column/index.mjs.map +1 -1
- package/es/components/table/src/table-column/watcher-helper.mjs +16 -0
- package/es/components/table/src/table-column/watcher-helper.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +15 -6
- package/es/components/table/src/table.vue.mjs +2 -2
- package/es/components/table/src/table.vue.mjs.map +1 -1
- package/es/components/table/src/table.vue2.mjs +16 -0
- package/es/components/table/src/table.vue2.mjs.map +1 -1
- package/es/components/table-v2/src/components/header.d.ts +1 -1
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +3 -3
- package/es/components/table-v2/src/table-v2.d.ts +4 -4
- package/es/components/tree/src/tree.vue.d.ts +2 -2
- package/es/components/tree-select/src/tree-select.vue.d.ts +4 -4
- package/es/components/tree-v2/src/composables/useTree.d.ts +1 -1
- package/es/components/tree-v2/src/tree.vue.d.ts +2 -2
- package/es/components/virtual-list/src/builders/build-grid.d.ts +1 -1
- package/es/components/virtual-list/src/builders/build-list.d.ts +1 -1
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
- package/es/components/watermark/src/watermark.d.ts +1 -1
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider-props.d.ts +7 -0
- package/lib/components/config-provider/src/config-provider-props.js +6 -0
- package/lib/components/config-provider/src/config-provider-props.js.map +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +12 -0
- package/lib/components/descriptions/src/description-item.d.ts +1 -1
- package/lib/components/input/src/utils.js +7 -3
- package/lib/components/input/src/utils.js.map +1 -1
- package/lib/components/pagination/src/pagination.d.ts +1 -1
- package/lib/components/select/src/select.vue.d.ts +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +2 -2
- package/lib/components/table/index.d.ts +1 -1
- package/lib/components/table/index.js.map +1 -1
- package/lib/components/table/src/table/defaults.d.ts +11 -2
- package/lib/components/table/src/table/defaults.js +4 -1
- package/lib/components/table/src/table/defaults.js.map +1 -1
- package/lib/components/table/src/table-body/td-wrapper.vue.d.ts +1 -1
- package/lib/components/table/src/table-column/index.d.ts +1 -1
- package/lib/components/table/src/table-column/index.js +5 -2
- package/lib/components/table/src/table-column/index.js.map +1 -1
- package/lib/components/table/src/table-column/watcher-helper.js +16 -0
- package/lib/components/table/src/table-column/watcher-helper.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +15 -6
- package/lib/components/table/src/table.vue.js +2 -2
- package/lib/components/table/src/table.vue.js.map +1 -1
- package/lib/components/table/src/table.vue2.js +16 -0
- package/lib/components/table/src/table.vue2.js.map +1 -1
- package/lib/components/table-v2/src/components/header.d.ts +1 -1
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +3 -3
- package/lib/components/table-v2/src/table-v2.d.ts +4 -4
- package/lib/components/tree/src/tree.vue.d.ts +2 -2
- package/lib/components/tree-select/src/tree-select.vue.d.ts +4 -4
- package/lib/components/tree-v2/src/composables/useTree.d.ts +1 -1
- package/lib/components/tree-v2/src/tree.vue.d.ts +2 -2
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/builders/build-list.d.ts +1 -1
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
- package/lib/components/watermark/src/watermark.d.ts +1 -1
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.mjs","sources":["../../../../../../../packages/components/table/src/table/defaults.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\n\nimport type {\n CSSProperties,\n ComponentInternalInstance,\n PropType,\n Ref,\n StyleValue,\n VNode,\n} from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { Nullable } from '@element-plus/utils'\nimport type { Store } from '../store'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type TableLayout from '../table-layout'\nimport type {\n TableOverflowTooltipFormatter,\n TableOverflowTooltipOptions,\n} from '../util'\n\ntype DefaultRow = Record<PropertyKey, any>\n\ninterface TableRefs {\n tableWrapper: HTMLElement\n headerWrapper: HTMLElement\n footerWrapper: HTMLElement\n fixedBodyWrapper: HTMLElement\n rightFixedBodyWrapper: HTMLElement\n bodyWrapper: HTMLElement\n appendWrapper: HTMLElement\n [key: string]: any\n}\n\ninterface TableState {\n isGroup: Ref<boolean>\n resizeState: Ref<{\n width: any\n height: any\n }>\n doLayout: () => void\n debouncedUpdateLayout: () => void\n}\n\ninterface TreeProps {\n hasChildren?: string\n children?: string\n checkStrictly?: boolean\n}\n\ntype HoverState<T extends DefaultRow> = Nullable<{\n cell: HTMLElement\n column: TableColumnCtx<T>\n row: T\n}>\n\ntype RIS<T extends DefaultRow> = {\n row: T\n $index: number\n store: Store<T>\n expanded: boolean\n}\n\ntype RenderExpanded<T extends DefaultRow> = ({\n row,\n $index,\n store,\n expanded,\n}: RIS<T>) => VNode[] | undefined\n\ntype SummaryMethod<T extends DefaultRow> = (data: {\n columns: TableColumnCtx<T>[]\n data: T[]\n}) => (string | VNode)[]\n\ninterface Table<T extends DefaultRow = any> extends ComponentInternalInstance {\n $ready: boolean\n hoverState?: HoverState<T> | null\n renderExpanded: RenderExpanded<T>\n store: Store<T>\n layout: TableLayout<T>\n refs: TableRefs\n tableId: string\n state: TableState\n}\n\ntype ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string)\ntype ColumnStyle<T> =\n | CSSProperties\n | ((data: { row: T; rowIndex: number }) => CSSProperties)\ntype CellCls<T extends DefaultRow> =\n | string\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => string)\ntype CellStyle<T extends DefaultRow> =\n | CSSProperties\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => CSSProperties)\ntype Layout = 'fixed' | 'auto'\ninterface TableProps<T extends DefaultRow> {\n data: T[]\n size?: ComponentSize\n width?: string | number\n height?: string | number\n maxHeight?: string | number\n fit?: boolean\n stripe?: boolean\n border?: boolean\n rowKey?: string | ((row: T) => string)\n context?: Table<T>\n showHeader?: boolean\n showSummary?: boolean\n sumText?: string\n summaryMethod?: SummaryMethod<T>\n rowClassName?: ColumnCls<T>\n rowStyle?: ColumnStyle<T>\n cellClassName?: CellCls<T>\n cellStyle?: CellStyle<T>\n headerRowClassName?: ColumnCls<T>\n headerRowStyle?: ColumnStyle<T>\n headerCellClassName?: CellCls<T>\n headerCellStyle?: CellStyle<T>\n highlightCurrentRow?: boolean\n currentRowKey?: string | number\n emptyText?: string\n expandRowKeys?: Array<string>\n defaultExpandAll?: boolean\n rowExpandable?: (row: T, index: number) => boolean\n defaultSort?: Sort\n tooltipEffect?: string\n tooltipOptions?: TableOverflowTooltipOptions\n spanMethod?: (data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) =>\n | number[]\n | {\n rowspan: number\n colspan: number\n }\n | undefined\n selectOnIndeterminate?: boolean\n indent?: number\n treeProps?: TreeProps\n lazy?: boolean\n load?: (row: T, treeNode: TreeNode, resolve: (data: T[]) => void) => void\n className?: string\n style?: StyleValue\n tableLayout?: Layout\n scrollbarAlwaysOn?: boolean\n flexible?: boolean\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n tooltipFormatter?: TableOverflowTooltipFormatter<T>\n appendFilterPanelTo?: string\n scrollbarTabindex?: number | string\n nativeScrollbar?: boolean\n}\n\ntype TableTooltipData<T extends DefaultRow> = Parameters<\n TableOverflowTooltipFormatter<T>\n>[0]\ntype TableSortOrder = 'ascending' | 'descending'\n\ninterface Sort {\n prop: string\n order: TableSortOrder\n init?: any\n silent?: any\n}\n\ninterface Filter<T extends DefaultRow> {\n column: TableColumnCtx<T>\n values: string[]\n silent: any\n}\n\ninterface TreeNode {\n expanded?: boolean\n loading?: boolean\n noLazyChildren?: boolean\n indent?: number\n level?: number\n display?: boolean\n}\n\ninterface RenderRowData<T extends DefaultRow> {\n store: Store<T>\n _self: Table<T>\n column: TableColumnCtx<T>\n row: T\n $index: number\n cellIndex: number\n treeNode?: TreeNode\n expanded: boolean\n}\n\nexport default {\n /**\n * @description table data\n */\n data: {\n type: Array as PropType<any[]>,\n default: () => [],\n },\n /**\n * @description size of Table\n */\n size: useSizeProp,\n width: [String, Number],\n /**\n * @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles\n */\n height: [String, Number],\n /**\n * @description table's max-height. The legal value is a number or the height in px\n */\n maxHeight: [String, Number],\n /**\n * @description whether width of column automatically fits its container\n */\n fit: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether Table is striped\n */\n stripe: Boolean,\n /**\n * @description whether Table has vertical border\n */\n border: Boolean,\n /**\n * @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used\n */\n rowKey: [String, Function] as PropType<TableProps<any>['rowKey']>,\n /**\n * @description whether Table header is visible\n */\n showHeader: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to display a summary row\n */\n showSummary: Boolean,\n /**\n * @description displayed text for the first column of summary row\n */\n sumText: String,\n /**\n * @description custom summary method\n */\n summaryMethod: Function as PropType<TableProps<any>['summaryMethod']>,\n /**\n * @description function that returns custom class names for a row, or a string assigning class names for every row\n */\n rowClassName: [String, Function] as PropType<TableProps<any>['rowClassName']>,\n /**\n * @description function that returns custom style for a row, or an object assigning custom style for every row\n */\n rowStyle: [Object, Function] as PropType<TableProps<any>['rowStyle']>,\n /**\n * @description function that returns custom class names for a cell, or a string assigning class names for every cell\n */\n cellClassName: [String, Function] as PropType<\n TableProps<any>['cellClassName']\n >,\n /**\n * @description function that returns custom style for a cell, or an object assigning custom style for every cell\n */\n cellStyle: [Object, Function] as PropType<TableProps<any>['cellStyle']>,\n /**\n * @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header\n */\n headerRowClassName: [String, Function] as PropType<\n TableProps<any>['headerRowClassName']\n >,\n /**\n * @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header\n */\n headerRowStyle: [Object, Function] as PropType<\n TableProps<any>['headerRowStyle']\n >,\n /**\n * @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header\n */\n headerCellClassName: [String, Function] as PropType<\n TableProps<any>['headerCellClassName']\n >,\n /**\n * @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header\n */\n headerCellStyle: [Object, Function] as PropType<\n TableProps<any>['headerCellStyle']\n >,\n /**\n * @description whether current row is highlighted\n */\n highlightCurrentRow: Boolean,\n /**\n * @description key of current row, a set only prop\n */\n currentRowKey: [String, Number],\n /**\n * @description displayed text when data is empty. You can customize this area with `#empty`\n */\n emptyText: String,\n /**\n * @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop\n */\n expandRowKeys: Array as PropType<TableProps<any>['expandRowKeys']>,\n /**\n * @description whether expand all rows by default, works when the table has a column type=\"expand\" or contains tree structure data\n */\n defaultExpandAll: Boolean,\n /**\n * @description enable expandable rows, works when the table has a column type=\"expand\"\n */\n rowExpandable: {\n type: Function as PropType<TableProps<any>['rowExpandable']>,\n },\n /**\n * @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order\n */\n defaultSort: Object as PropType<TableProps<any>['defaultSort']>,\n /**\n * @description the `effect` of the overflow tooltip\n */\n tooltipEffect: String,\n /**\n * @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)\n */\n tooltipOptions: Object as PropType<TableProps<any>['tooltipOptions']>,\n /**\n * @description method that returns rowspan and colspan\n */\n spanMethod: Function as PropType<TableProps<any>['spanMethod']>,\n /**\n * @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected\n */\n selectOnIndeterminate: {\n type: Boolean,\n default: true,\n },\n /**\n * @description horizontal indentation of tree data\n */\n indent: {\n type: Number,\n default: 16,\n },\n /**\n * @description configuration for rendering nested data\n */\n treeProps: {\n type: Object as PropType<TableProps<any>['treeProps']>,\n default: () => {\n return {\n hasChildren: 'hasChildren',\n children: 'children',\n checkStrictly: false,\n }\n },\n },\n /**\n * @description whether to lazy loading data\n */\n lazy: Boolean,\n /**\n * @description method for loading child row data, only works when `lazy` is true\n */\n load: Function as PropType<TableProps<any>['load']>,\n style: {\n type: [String, Object, Array] as PropType<TableProps<any>['style']>,\n default: () => ({}),\n },\n className: {\n type: String,\n default: '',\n },\n /**\n * @description sets the algorithm used to lay out table cells, rows, and columns\n */\n tableLayout: {\n type: String as PropType<Layout>,\n default: 'fixed',\n },\n /**\n * @description always show scrollbar\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description ensure main axis minimum-size doesn't follow the content\n */\n flexible: Boolean,\n /**\n * @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns\n */\n showOverflowTooltip: [Boolean, Object] as PropType<\n TableProps<any>['showOverflowTooltip']\n >,\n /**\n * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`\n */\n tooltipFormatter: Function as PropType<TableProps<any>['tooltipFormatter']>,\n appendFilterPanelTo: String,\n scrollbarTabindex: {\n type: [Number, String],\n default: undefined,\n },\n /**\n * @description whether to allow drag the last column\n */\n allowDragLastColumn: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to preserve expanded row content in DOM when collapsed\n */\n preserveExpandedContent: Boolean,\n /**\n * @description whether to use native scrollbars\n */\n nativeScrollbar: Boolean,\n}\nexport type {\n SummaryMethod,\n Table,\n TableProps,\n TableRefs,\n ColumnCls,\n ColumnStyle,\n CellCls,\n CellStyle,\n DefaultRow,\n TreeNode,\n RenderRowData,\n Sort,\n Filter,\n TableColumnCtx,\n TreeProps,\n TableTooltipData,\n TableSortOrder,\n RenderExpanded,\n}\n"],"names":[],"mappings":";;AA6MA,mBAAe;AAAA;AAAA;AAAA;AAAA,EAIb,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM,WAAA;AAAA,EACN,KAAA,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA;AAAA;AAAA;AAAA,EAItB,MAAA,EAAQ,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA;AAAA;AAAA;AAAA,EAIvB,SAAA,EAAW,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA;AAAA;AAAA;AAAA,EAI1B,GAAA,EAAK;AAAA,IACH,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAI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B,OAAA;AAAA;AAAA;AAAA;AAAA,EAInB,QAAA,EAAU,OAAA;AAAA;AAAA;AAAA;AAAA,EAIV,mBAAA,EAAqB,CAAC,OAAA,EAAS,MAAM,CAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,gBAAA,EAAkB,QAAA;AAAA,EAClB,mBAAA,EAAqB,MAAA;AAAA,EACrB,iBAAA,EAAmB;AAAA,IACjB,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,mBAAA,EAAqB;AAAA,IACnB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,uBAAA,EAAyB,OAAA;AAAA;AAAA;AAAA;AAAA,EAIzB,eAAA,EAAiB;AACnB,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"defaults.mjs","sources":["../../../../../../../packages/components/table/src/table/defaults.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\n\nimport type {\n CSSProperties,\n ComponentInternalInstance,\n PropType,\n Ref,\n StyleValue,\n VNode,\n} from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { Nullable } from '@element-plus/utils'\nimport type { Store } from '../store'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type TableLayout from '../table-layout'\nimport type {\n TableOverflowTooltipFormatter,\n TableOverflowTooltipOptions,\n} from '../util'\n\ntype DefaultRow = Record<PropertyKey, any>\n\ninterface TableRefs {\n tableWrapper: HTMLElement\n headerWrapper: HTMLElement\n footerWrapper: HTMLElement\n fixedBodyWrapper: HTMLElement\n rightFixedBodyWrapper: HTMLElement\n bodyWrapper: HTMLElement\n appendWrapper: HTMLElement\n [key: string]: any\n}\n\ninterface TableState {\n isGroup: Ref<boolean>\n resizeState: Ref<{\n width: any\n height: any\n }>\n doLayout: () => void\n debouncedUpdateLayout: () => void\n}\n\ninterface TreeProps {\n hasChildren?: string\n children?: string\n checkStrictly?: boolean\n}\n\ntype HoverState<T extends DefaultRow> = Nullable<{\n cell: HTMLElement\n column: TableColumnCtx<T>\n row: T\n}>\n\ntype RIS<T extends DefaultRow> = {\n row: T\n $index: number\n store: Store<T>\n expanded: boolean\n}\n\ntype RenderExpanded<T extends DefaultRow> = ({\n row,\n $index,\n store,\n expanded,\n}: RIS<T>) => VNode[] | undefined\n\ntype SummaryMethod<T extends DefaultRow> = (data: {\n columns: TableColumnCtx<T>[]\n data: T[]\n}) => (string | VNode)[]\n\ninterface Table<T extends DefaultRow = any> extends ComponentInternalInstance {\n $ready: boolean\n hoverState?: HoverState<T> | null\n renderExpanded: RenderExpanded<T>\n store: Store<T>\n layout: TableLayout<T>\n refs: TableRefs\n tableId: string\n state: TableState\n}\n\ntype ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string)\ntype ColumnStyle<T> =\n | CSSProperties\n | ((data: { row: T; rowIndex: number }) => CSSProperties)\ntype CellCls<T extends DefaultRow> =\n | string\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => string)\ntype CellStyle<T extends DefaultRow> =\n | CSSProperties\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => CSSProperties)\ntype Layout = 'fixed' | 'auto'\ninterface TableProps<T extends DefaultRow> {\n data: T[]\n size?: ComponentSize\n width?: string | number\n height?: string | number\n maxHeight?: string | number\n fit?: boolean\n stripe?: boolean\n border?: boolean\n rowKey?: string | ((row: T) => string)\n context?: Table<T>\n showHeader?: boolean\n showSummary?: boolean\n sumText?: string\n summaryMethod?: SummaryMethod<T>\n rowClassName?: ColumnCls<T>\n rowStyle?: ColumnStyle<T>\n cellClassName?: CellCls<T>\n cellStyle?: CellStyle<T>\n headerRowClassName?: ColumnCls<T>\n headerRowStyle?: ColumnStyle<T>\n headerCellClassName?: CellCls<T>\n headerCellStyle?: CellStyle<T>\n highlightCurrentRow?: boolean\n currentRowKey?: string | number\n emptyText?: string\n expandRowKeys?: Array<string>\n defaultExpandAll?: boolean\n rowExpandable?: (row: T, index: number) => boolean\n defaultSort?: Sort\n tooltipEffect?: string\n tooltipOptions?: TableOverflowTooltipOptions\n spanMethod?: (data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) =>\n | number[]\n | {\n rowspan: number\n colspan: number\n }\n | undefined\n selectOnIndeterminate?: boolean\n indent?: number\n treeProps?: TreeProps\n lazy?: boolean\n load?: (row: T, treeNode: TreeNode, resolve: (data: T[]) => void) => void\n className?: string\n style?: StyleValue\n tableLayout?: Layout\n scrollbarAlwaysOn?: boolean\n flexible?: boolean\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n tooltipFormatter?: TableOverflowTooltipFormatter<T>\n appendFilterPanelTo?: string\n scrollbarTabindex?: number | string\n nativeScrollbar?: boolean\n}\n\ntype TableTooltipData<T extends DefaultRow> = Parameters<\n TableOverflowTooltipFormatter<T>\n>[0]\ntype TableSortOrder = 'ascending' | 'descending'\n\ninterface Sort {\n prop: string\n order: TableSortOrder\n init?: any\n silent?: any\n}\n\ninterface Filter<T extends DefaultRow> {\n column: TableColumnCtx<T>\n values: string[]\n silent: any\n}\n\ninterface TreeNode {\n expanded?: boolean\n loading?: boolean\n noLazyChildren?: boolean\n indent?: number\n level?: number\n display?: boolean\n}\n\ninterface RenderRowData<T extends DefaultRow> {\n store: Store<T>\n _self: Table<T>\n column: TableColumnCtx<T>\n row: T\n $index: number\n cellIndex: number\n treeNode?: TreeNode\n expanded: boolean\n}\n\ninterface TableConfigContext {\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n tooltipEffect?: string\n tooltipOptions?: TableOverflowTooltipOptions\n tooltipFormatter?: TableOverflowTooltipFormatter<any>\n}\n\nexport default {\n /**\n * @description table data\n */\n data: {\n type: Array as PropType<any[]>,\n default: () => [],\n },\n /**\n * @description size of Table\n */\n size: useSizeProp,\n width: [String, Number],\n /**\n * @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles\n */\n height: [String, Number],\n /**\n * @description table's max-height. The legal value is a number or the height in px\n */\n maxHeight: [String, Number],\n /**\n * @description whether width of column automatically fits its container\n */\n fit: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether Table is striped\n */\n stripe: Boolean,\n /**\n * @description whether Table has vertical border\n */\n border: Boolean,\n /**\n * @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used\n */\n rowKey: [String, Function] as PropType<TableProps<any>['rowKey']>,\n /**\n * @description whether Table header is visible\n */\n showHeader: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to display a summary row\n */\n showSummary: Boolean,\n /**\n * @description displayed text for the first column of summary row\n */\n sumText: String,\n /**\n * @description custom summary method\n */\n summaryMethod: Function as PropType<TableProps<any>['summaryMethod']>,\n /**\n * @description function that returns custom class names for a row, or a string assigning class names for every row\n */\n rowClassName: [String, Function] as PropType<TableProps<any>['rowClassName']>,\n /**\n * @description function that returns custom style for a row, or an object assigning custom style for every row\n */\n rowStyle: [Object, Function] as PropType<TableProps<any>['rowStyle']>,\n /**\n * @description function that returns custom class names for a cell, or a string assigning class names for every cell\n */\n cellClassName: [String, Function] as PropType<\n TableProps<any>['cellClassName']\n >,\n /**\n * @description function that returns custom style for a cell, or an object assigning custom style for every cell\n */\n cellStyle: [Object, Function] as PropType<TableProps<any>['cellStyle']>,\n /**\n * @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header\n */\n headerRowClassName: [String, Function] as PropType<\n TableProps<any>['headerRowClassName']\n >,\n /**\n * @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header\n */\n headerRowStyle: [Object, Function] as PropType<\n TableProps<any>['headerRowStyle']\n >,\n /**\n * @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header\n */\n headerCellClassName: [String, Function] as PropType<\n TableProps<any>['headerCellClassName']\n >,\n /**\n * @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header\n */\n headerCellStyle: [Object, Function] as PropType<\n TableProps<any>['headerCellStyle']\n >,\n /**\n * @description whether current row is highlighted\n */\n highlightCurrentRow: Boolean,\n /**\n * @description key of current row, a set only prop\n */\n currentRowKey: [String, Number],\n /**\n * @description displayed text when data is empty. You can customize this area with `#empty`\n */\n emptyText: String,\n /**\n * @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop\n */\n expandRowKeys: Array as PropType<TableProps<any>['expandRowKeys']>,\n /**\n * @description whether expand all rows by default, works when the table has a column type=\"expand\" or contains tree structure data\n */\n defaultExpandAll: Boolean,\n /**\n * @description enable expandable rows, works when the table has a column type=\"expand\"\n */\n rowExpandable: {\n type: Function as PropType<TableProps<any>['rowExpandable']>,\n },\n /**\n * @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order\n */\n defaultSort: Object as PropType<TableProps<any>['defaultSort']>,\n /**\n * @description the `effect` of the overflow tooltip\n */\n tooltipEffect: String,\n /**\n * @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)\n */\n tooltipOptions: Object as PropType<TableProps<any>['tooltipOptions']>,\n /**\n * @description method that returns rowspan and colspan\n */\n spanMethod: Function as PropType<TableProps<any>['spanMethod']>,\n /**\n * @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected\n */\n selectOnIndeterminate: {\n type: Boolean,\n default: true,\n },\n /**\n * @description horizontal indentation of tree data\n */\n indent: {\n type: Number,\n default: 16,\n },\n /**\n * @description configuration for rendering nested data\n */\n treeProps: {\n type: Object as PropType<TableProps<any>['treeProps']>,\n default: () => {\n return {\n hasChildren: 'hasChildren',\n children: 'children',\n checkStrictly: false,\n }\n },\n },\n /**\n * @description whether to lazy loading data\n */\n lazy: Boolean,\n /**\n * @description method for loading child row data, only works when `lazy` is true\n */\n load: Function as PropType<TableProps<any>['load']>,\n style: {\n type: [String, Object, Array] as PropType<TableProps<any>['style']>,\n default: () => ({}),\n },\n className: {\n type: String,\n default: '',\n },\n /**\n * @description sets the algorithm used to lay out table cells, rows, and columns\n */\n tableLayout: {\n type: String as PropType<Layout>,\n default: 'fixed',\n },\n /**\n * @description always show scrollbar\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description ensure main axis minimum-size doesn't follow the content\n */\n flexible: Boolean,\n /**\n * @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns\n */\n showOverflowTooltip: {\n type: [Boolean, Object] as PropType<TableProps<any>['showOverflowTooltip']>,\n default: undefined,\n },\n /**\n * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`\n */\n tooltipFormatter: Function as PropType<TableProps<any>['tooltipFormatter']>,\n appendFilterPanelTo: String,\n scrollbarTabindex: {\n type: [Number, String],\n default: undefined,\n },\n /**\n * @description whether to allow drag the last column\n */\n allowDragLastColumn: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to preserve expanded row content in DOM when collapsed\n */\n preserveExpandedContent: Boolean,\n /**\n * @description whether to use native scrollbars\n */\n nativeScrollbar: Boolean,\n}\nexport type {\n SummaryMethod,\n Table,\n TableProps,\n TableRefs,\n ColumnCls,\n ColumnStyle,\n CellCls,\n CellStyle,\n DefaultRow,\n TreeNode,\n RenderRowData,\n Sort,\n Filter,\n TableColumnCtx,\n TreeProps,\n TableTooltipData,\n TableSortOrder,\n RenderExpanded,\n TableConfigContext,\n}\n"],"names":[],"mappings":";;AAoNA,mBAAe;AAAA;AAAA;AAAA;AAAA,EAIb,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM,WAAA;AAAA,EACN,KAAA,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA;AAAA;AAAA;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A,EAAS,OAAO,EAAC;AAAA,GACnB;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,iBAAA,EAAmB,OAAA;AAAA;AAAA;AAAA;AAAA,EAInB,QAAA,EAAU,OAAA;AAAA;AAAA;AAAA;AAAA,EAIV,mBAAA,EAAqB;AAAA,IACnB,IAAA,EAAM,CAAC,OAAA,EAAS,MAAM,CAAA;AAAA,IACtB,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,gBAAA,EAAkB,QAAA;AAAA,EAClB,mBAAA,EAAqB,MAAA;AAAA,EACrB,iBAAA,EAAmB;AAAA,IACjB,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,mBAAA,EAAqB;AAAA,IACnB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,uBAAA,EAAyB,OAAA;AAAA;AAAA;AAAA;AAAA,EAIzB,eAAA,EAAiB;AACnB,CAAA;;;;"}
|
|
@@ -21,8 +21,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
21
21
|
default: number;
|
|
22
22
|
};
|
|
23
23
|
}>>, {
|
|
24
|
-
rowspan: number;
|
|
25
24
|
colspan: number;
|
|
25
|
+
rowspan: number;
|
|
26
26
|
}, {}>;
|
|
27
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
@@ -115,10 +115,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
115
|
width: string | number;
|
|
116
116
|
minWidth: string | number;
|
|
117
117
|
type: string;
|
|
118
|
-
resizable: boolean;
|
|
119
118
|
showOverflowTooltip: boolean | Partial<Pick<import("element-plus").UseTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "appendTo" | "popperOptions" | "enterable" | "popperClass" | "showArrow">> | undefined;
|
|
120
119
|
sortOrders: (import("../table/defaults").TableSortOrder | null)[];
|
|
121
120
|
sortable: string | boolean;
|
|
121
|
+
resizable: boolean;
|
|
122
122
|
reserveSelection: boolean;
|
|
123
123
|
filterMultiple: boolean;
|
|
124
124
|
}, {}>;
|
|
@@ -6,6 +6,7 @@ import useWatcher from './watcher-helper.mjs';
|
|
|
6
6
|
import useRender from './render-helper.mjs';
|
|
7
7
|
import defaultProps from './defaults.mjs';
|
|
8
8
|
import { isArray, isString } from '@vue/shared';
|
|
9
|
+
import { useGlobalConfig } from '../../../config-provider/src/hooks/use-global-config.mjs';
|
|
9
10
|
import { isUndefined } from '../../../../utils/types.mjs';
|
|
10
11
|
|
|
11
12
|
let columnIdSeed = 1;
|
|
@@ -17,6 +18,7 @@ var ElTableColumn = defineComponent({
|
|
|
17
18
|
props: defaultProps,
|
|
18
19
|
setup(props, { slots }) {
|
|
19
20
|
const instance = getCurrentInstance();
|
|
21
|
+
const globalConfig = useGlobalConfig("table");
|
|
20
22
|
const columnConfig = ref({});
|
|
21
23
|
const owner = computed(() => {
|
|
22
24
|
let parent2 = instance.parent;
|
|
@@ -45,11 +47,12 @@ var ElTableColumn = defineComponent({
|
|
|
45
47
|
const parent = columnOrTableParent.value;
|
|
46
48
|
columnId.value = `${"tableId" in parent && parent.tableId || "columnId" in parent && parent.columnId}_column_${columnIdSeed++}`;
|
|
47
49
|
onBeforeMount(() => {
|
|
50
|
+
var _a, _b, _c, _d;
|
|
48
51
|
isSubColumn.value = owner.value !== parent;
|
|
49
52
|
const type = props.type || "default";
|
|
50
53
|
const sortable = props.sortable === "" ? true : props.sortable;
|
|
51
|
-
const showOverflowTooltip = type === "selection" ? false : isUndefined(props.showOverflowTooltip) ? parent.props.showOverflowTooltip : props.showOverflowTooltip;
|
|
52
|
-
const tooltipFormatter = isUndefined(props.tooltipFormatter) ? parent.props.tooltipFormatter : props.tooltipFormatter;
|
|
54
|
+
const showOverflowTooltip = type === "selection" ? false : isUndefined(props.showOverflowTooltip) ? (_b = parent.props.showOverflowTooltip) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.showOverflowTooltip : props.showOverflowTooltip;
|
|
55
|
+
const tooltipFormatter = isUndefined(props.tooltipFormatter) ? (_d = parent.props.tooltipFormatter) != null ? _d : (_c = globalConfig.value) == null ? void 0 : _c.tooltipFormatter : props.tooltipFormatter;
|
|
53
56
|
const defaults = {
|
|
54
57
|
...cellStarts[type],
|
|
55
58
|
id: columnId.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/table/src/table-column/index.ts"],"sourcesContent":["import {\n Fragment,\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n ref,\n} from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { isArray, isString, isUndefined } from '@element-plus/utils'\nimport { cellStarts } from '../config'\nimport { compose, mergeOptions } from '../util'\nimport useWatcher from './watcher-helper'\nimport useRender from './render-helper'\nimport defaultProps from './defaults'\n\nimport type { VNode } from 'vue'\nimport type { TableColumn, TableColumnCtx } from './defaults'\nimport type { DefaultRow } from '../table/defaults'\n\nlet columnIdSeed = 1\n\n//TODO: when vue 3.3 we can set this component a generic: https://github.com/vuejs/core/pull/7963\nexport default defineComponent({\n name: 'ElTableColumn',\n components: {\n ElCheckbox,\n },\n props: defaultProps,\n setup(props, { slots }) {\n const instance = getCurrentInstance() as TableColumn<DefaultRow>\n const columnConfig = ref<Partial<TableColumnCtx<DefaultRow>>>({})\n const owner = computed(() => {\n let parent = instance.parent as any\n while (parent && !parent.tableId) {\n parent = parent.parent\n }\n return parent\n })\n\n const { registerNormalWatchers, registerComplexWatchers } = useWatcher(\n owner,\n props\n )\n const {\n columnId,\n isSubColumn,\n realHeaderAlign,\n columnOrTableParent,\n setColumnWidth,\n setColumnForcedProps,\n setColumnRenders,\n getPropsData,\n getColumnElIndex,\n realAlign,\n updateColumnOrder,\n } = useRender(props as unknown as TableColumnCtx<DefaultRow>, slots, owner)\n\n const parent = columnOrTableParent.value\n columnId.value = `${\n ('tableId' in parent && parent.tableId) ||\n ('columnId' in parent && parent.columnId)\n }_column_${columnIdSeed++}`\n onBeforeMount(() => {\n isSubColumn.value = owner.value !== parent\n\n const type = (props.type as keyof typeof cellStarts) || 'default'\n const sortable = props.sortable === '' ? true : props.sortable\n //The selection column should not be affected by `showOverflowTooltip`.\n const showOverflowTooltip =\n type === 'selection'\n ? false\n : isUndefined(props.showOverflowTooltip)\n ? parent.props.showOverflowTooltip\n : props.showOverflowTooltip\n const tooltipFormatter = isUndefined(props.tooltipFormatter)\n ? parent.props.tooltipFormatter\n : props.tooltipFormatter\n const defaults = {\n ...cellStarts[type],\n id: columnId.value,\n type,\n property: props.prop || props.property,\n align: realAlign,\n headerAlign: realHeaderAlign,\n showOverflowTooltip,\n tooltipFormatter,\n // filter 相关属性\n filterable: props.filters || props.filterMethod,\n filteredValue: [],\n filterPlacement: '',\n filterClassName: '',\n isColumnGroup: false,\n isSubColumn: false,\n filterOpened: false,\n // sort 相关属性\n sortable,\n // index 列\n index: props.index,\n // <el-table-column key=\"xxx\" />\n rawColumnKey: instance.vnode.key,\n }\n\n const basicProps = [\n 'columnKey',\n 'label',\n 'className',\n 'labelClassName',\n 'type',\n 'renderHeader',\n 'formatter',\n 'fixed',\n 'resizable',\n ]\n const sortProps = ['sortMethod', 'sortBy', 'sortOrders']\n const selectProps = ['selectable', 'reserveSelection']\n const filterProps = [\n 'filterMethod',\n 'filters',\n 'filterMultiple',\n 'filterOpened',\n 'filteredValue',\n 'filterPlacement',\n 'filterClassName',\n ]\n\n let column = getPropsData(basicProps, sortProps, selectProps, filterProps)\n\n column = mergeOptions(defaults, column)\n // 注意 compose 中函数执行的顺序是从右到左\n const chains = compose(\n setColumnRenders,\n setColumnWidth,\n setColumnForcedProps\n )\n column = chains(column) as unknown as TableColumnCtx<DefaultRow>\n columnConfig.value = column\n\n // 注册 watcher\n registerNormalWatchers()\n registerComplexWatchers()\n })\n onMounted(() => {\n const parent = columnOrTableParent.value\n const children = isSubColumn.value\n ? parent.vnode.el?.children\n : parent.refs.hiddenColumns?.children\n const getColumnIndex = () =>\n getColumnElIndex(children || [], instance.vnode.el)\n columnConfig.value.getColumnIndex = getColumnIndex\n const columnIndex = getColumnIndex()\n columnIndex > -1 &&\n owner.value.store.commit(\n 'insertColumn',\n columnConfig.value,\n isSubColumn.value\n ? 'columnConfig' in parent && parent.columnConfig.value\n : null,\n updateColumnOrder\n )\n })\n onBeforeUnmount(() => {\n const getColumnIndex = columnConfig.value.getColumnIndex\n const columnIndex = getColumnIndex ? getColumnIndex() : -1\n columnIndex > -1 &&\n owner.value.store.commit(\n 'removeColumn',\n columnConfig.value,\n isSubColumn.value\n ? 'columnConfig' in parent && parent.columnConfig.value\n : null,\n updateColumnOrder\n )\n })\n instance.columnId = columnId.value\n\n instance.columnConfig = columnConfig as any\n return\n },\n render() {\n try {\n const renderDefault = this.$slots.default?.({\n row: {},\n column: {},\n $index: -1,\n })\n const children = []\n if (isArray(renderDefault)) {\n for (const childNode of renderDefault) {\n if (\n (childNode.type as any)?.name === 'ElTableColumn' ||\n childNode.shapeFlag & 2\n ) {\n children.push(childNode)\n } else if (\n childNode.type === Fragment &&\n isArray(childNode.children)\n ) {\n childNode.children.forEach((vnode) => {\n // No rendering when vnode is dynamic slot or text\n if (\n (vnode as VNode)?.patchFlag !== 1024 &&\n !isString((vnode as VNode)?.children)\n ) {\n children.push(vnode)\n }\n })\n }\n }\n }\n const vnode = h('div', children)\n return vnode\n } catch {\n return h('div', [])\n }\n },\n})\n"],"names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T,MAAA,EAAQ,CAAA;AAAA,OACV,CAAA;AACA,MAAA,MAAM,WAAW,EAAC;AAClB,MAAA,IAAI,OAAA,CAAQ,aAAa,CAAA,EAAG;AAC1B,QAAA,KAAA,MAAW,aAAa,aAAA,EAAe;AACrC,UAAA,IAAA,CAAA,CACG,eAAU,IAAA,KAAV,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAwB,UAAS,eAAA,IAClC,SAAA,CAAU,YAAY,CAAA,EACtB;AACA,YAAA,QAAA,CAAS,KAAK,SAAS,CAAA;AAAA,UACzB,WACE,SAAA,CAAU,IAAA,KAAS,YACnB,OAAA,CAAQ,SAAA,CAAU,QAAQ,CAAA,EAC1B;AACA,YAAA,SAAA,CAAU,QAAA,CAAS,OAAA,CAAQ,CAACC,MAAAA,KAAU;AAEpC,cAAA,IAAA,CACGA,MAAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,MAAAA,CAAiB,SAAA,MAAc,IAAA,IAChC,CAAC,QAAA,CAAUA,MAAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,MAAAA,CAAiB,QAAQ,CAAA,EACpC;AACA,gBAAA,QAAA,CAAS,KAAKA,MAAK,CAAA;AAAA,cACrB;AAAA,YACF,CAAC,CAAA;AAAA,UACH;AAAA,QACF;AAAA,MACF;AACA,MAAA,MAAM,KAAA,GAAQ,CAAA,CAAE,KAAA,EAAO,QAAQ,CAAA;AAC/B,MAAA,OAAO,KAAA;AAAA,IACT,CAAA,CAAA,OAAQ,CAAA,EAAA;AACN,MAAA,OAAO,CAAA,CAAE,KAAA,EAAO,EAAE,CAAA;AAAA,IACpB;AAAA,EACF;AACF,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/table/src/table-column/index.ts"],"sourcesContent":["import {\n Fragment,\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n ref,\n} from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\nimport { isArray, isString, isUndefined } from '@element-plus/utils'\nimport { cellStarts } from '../config'\nimport { compose, mergeOptions } from '../util'\nimport useWatcher from './watcher-helper'\nimport useRender from './render-helper'\nimport defaultProps from './defaults'\n\nimport type { VNode } from 'vue'\nimport type { TableColumn, TableColumnCtx } from './defaults'\nimport type { DefaultRow } from '../table/defaults'\n\nlet columnIdSeed = 1\n\n//TODO: when vue 3.3 we can set this component a generic: https://github.com/vuejs/core/pull/7963\nexport default defineComponent({\n name: 'ElTableColumn',\n components: {\n ElCheckbox,\n },\n props: defaultProps,\n setup(props, { slots }) {\n const instance = getCurrentInstance() as TableColumn<DefaultRow>\n const globalConfig = useGlobalConfig('table')\n const columnConfig = ref<Partial<TableColumnCtx<DefaultRow>>>({})\n const owner = computed(() => {\n let parent = instance.parent as any\n while (parent && !parent.tableId) {\n parent = parent.parent\n }\n return parent\n })\n\n const { registerNormalWatchers, registerComplexWatchers } = useWatcher(\n owner,\n props\n )\n const {\n columnId,\n isSubColumn,\n realHeaderAlign,\n columnOrTableParent,\n setColumnWidth,\n setColumnForcedProps,\n setColumnRenders,\n getPropsData,\n getColumnElIndex,\n realAlign,\n updateColumnOrder,\n } = useRender(props as unknown as TableColumnCtx<DefaultRow>, slots, owner)\n\n const parent = columnOrTableParent.value\n columnId.value = `${\n ('tableId' in parent && parent.tableId) ||\n ('columnId' in parent && parent.columnId)\n }_column_${columnIdSeed++}`\n onBeforeMount(() => {\n isSubColumn.value = owner.value !== parent\n\n const type = (props.type as keyof typeof cellStarts) || 'default'\n const sortable = props.sortable === '' ? true : props.sortable\n //The selection column should not be affected by `showOverflowTooltip`.\n const showOverflowTooltip =\n type === 'selection'\n ? false\n : isUndefined(props.showOverflowTooltip)\n ? (parent.props.showOverflowTooltip ??\n globalConfig.value?.showOverflowTooltip)\n : props.showOverflowTooltip\n const tooltipFormatter = isUndefined(props.tooltipFormatter)\n ? (parent.props.tooltipFormatter ??\n globalConfig.value?.tooltipFormatter)\n : props.tooltipFormatter\n const defaults = {\n ...cellStarts[type],\n id: columnId.value,\n type,\n property: props.prop || props.property,\n align: realAlign,\n headerAlign: realHeaderAlign,\n showOverflowTooltip,\n tooltipFormatter,\n // filter 相关属性\n filterable: props.filters || props.filterMethod,\n filteredValue: [],\n filterPlacement: '',\n filterClassName: '',\n isColumnGroup: false,\n isSubColumn: false,\n filterOpened: false,\n // sort 相关属性\n sortable,\n // index 列\n index: props.index,\n // <el-table-column key=\"xxx\" />\n rawColumnKey: instance.vnode.key,\n }\n\n const basicProps = [\n 'columnKey',\n 'label',\n 'className',\n 'labelClassName',\n 'type',\n 'renderHeader',\n 'formatter',\n 'fixed',\n 'resizable',\n ]\n const sortProps = ['sortMethod', 'sortBy', 'sortOrders']\n const selectProps = ['selectable', 'reserveSelection']\n const filterProps = [\n 'filterMethod',\n 'filters',\n 'filterMultiple',\n 'filterOpened',\n 'filteredValue',\n 'filterPlacement',\n 'filterClassName',\n ]\n\n let column = getPropsData(basicProps, sortProps, selectProps, filterProps)\n\n column = mergeOptions(defaults, column)\n // 注意 compose 中函数执行的顺序是从右到左\n const chains = compose(\n setColumnRenders,\n setColumnWidth,\n setColumnForcedProps\n )\n column = chains(column) as unknown as TableColumnCtx<DefaultRow>\n columnConfig.value = column\n\n // 注册 watcher\n registerNormalWatchers()\n registerComplexWatchers()\n })\n onMounted(() => {\n const parent = columnOrTableParent.value\n const children = isSubColumn.value\n ? parent.vnode.el?.children\n : parent.refs.hiddenColumns?.children\n const getColumnIndex = () =>\n getColumnElIndex(children || [], instance.vnode.el)\n columnConfig.value.getColumnIndex = getColumnIndex\n const columnIndex = getColumnIndex()\n columnIndex > -1 &&\n owner.value.store.commit(\n 'insertColumn',\n columnConfig.value,\n isSubColumn.value\n ? 'columnConfig' in parent && parent.columnConfig.value\n : null,\n updateColumnOrder\n )\n })\n onBeforeUnmount(() => {\n const getColumnIndex = columnConfig.value.getColumnIndex\n const columnIndex = getColumnIndex ? getColumnIndex() : -1\n columnIndex > -1 &&\n owner.value.store.commit(\n 'removeColumn',\n columnConfig.value,\n isSubColumn.value\n ? 'columnConfig' in parent && parent.columnConfig.value\n : null,\n updateColumnOrder\n )\n })\n instance.columnId = columnId.value\n\n instance.columnConfig = columnConfig as any\n return\n },\n render() {\n try {\n const renderDefault = this.$slots.default?.({\n row: {},\n column: {},\n $index: -1,\n })\n const children = []\n if (isArray(renderDefault)) {\n for (const childNode of renderDefault) {\n if (\n (childNode.type as any)?.name === 'ElTableColumn' ||\n childNode.shapeFlag & 2\n ) {\n children.push(childNode)\n } else if (\n childNode.type === Fragment &&\n isArray(childNode.children)\n ) {\n childNode.children.forEach((vnode) => {\n // No rendering when vnode is dynamic slot or text\n if (\n (vnode as VNode)?.patchFlag !== 1024 &&\n !isString((vnode as VNode)?.children)\n ) {\n children.push(vnode)\n }\n })\n }\n }\n }\n const vnode = h('div', children)\n return vnode\n } catch {\n return h('div', [])\n }\n },\n})\n"],"names":["parent","vnode"],"mappings":";;;;;;;;;;;AAwBA,IAAI,YAAA,GAAe,CAAA;AAGnB,oBAAe,eAAA,CAAgB;AAAA,EAC7B,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV;AAAA,GACF;AAAA,EACA,KAAA,EAAO,YAAA;AAAA,EACP,KAAA,CAAM,KAAA,EAAO,EAAE,KAAA,EAAM,EAAG;AACtB,IAAA,MAAM,WAAW,kBAAA,EAAmB;AACpC,IAAA,MAAM,YAAA,GAAe,gBAAgB,OAAO,CAAA;AAC5C,IAAA,MAAM,YAAA,GAAe,GAAA,CAAyC,EAAE,CAAA;AAChE,IAAA,MAAM,KAAA,GAAQ,SAAS,MAAM;AAC3B,MAAA,IAAIA,UAAS,QAAA,CAAS,MAAA;AACtB,MAAA,OAAOA,OAAAA,IAAU,CAACA,OAAAA,CAAO,OAAA,EAAS;AAChC,QAAAA,UAASA,OAAAA,CAAO,MAAA;AAAA,MAClB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,GAAA,EAAA,CAAwB,UAAS,eAAA,IAClC,SAAA,CAAU,YAAY,CAAA,EACtB;AACA,YAAA,QAAA,CAAS,KAAK,SAAS,CAAA;AAAA,UACzB,WACE,SAAA,CAAU,IAAA,KAAS,YACnB,OAAA,CAAQ,SAAA,CAAU,QAAQ,CAAA,EAC1B;AACA,YAAA,SAAA,CAAU,QAAA,CAAS,OAAA,CAAQ,CAACC,MAAAA,KAAU;AAEpC,cAAA,IAAA,CACGA,MAAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,MAAAA,CAAiB,SAAA,MAAc,IAAA,IAChC,CAAC,QAAA,CAAUA,MAAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,MAAAA,CAAiB,QAAQ,CAAA,EACpC;AACA,gBAAA,QAAA,CAAS,KAAKA,MAAK,CAAA;AAAA,cACrB;AAAA,YACF,CAAC,CAAA;AAAA,UACH;AAAA,QACF;AAAA,MACF;AACA,MAAA,MAAM,KAAA,GAAQ,CAAA,CAAE,KAAA,EAAO,QAAQ,CAAA;AAC/B,MAAA,OAAO,KAAA;AAAA,IACT,CAAA,CAAA,OAAQ,CAAA,EAAA;AACN,MAAA,OAAO,CAAA,CAAE,KAAA,EAAO,EAAE,CAAA;AAAA,IACpB;AAAA,EACF;AACF,CAAC,CAAA;;;;"}
|
|
@@ -2,6 +2,7 @@ import { getCurrentInstance, watch } from 'vue';
|
|
|
2
2
|
import { parseWidth, parseMinWidth } from '../util.mjs';
|
|
3
3
|
import { hasOwn } from '@vue/shared';
|
|
4
4
|
import { isUndefined } from '../../../../utils/types.mjs';
|
|
5
|
+
import { useGlobalConfig } from '../../../config-provider/src/hooks/use-global-config.mjs';
|
|
5
6
|
|
|
6
7
|
function getAllAliases(props, aliases) {
|
|
7
8
|
return props.reduce((prev, cur) => {
|
|
@@ -89,6 +90,21 @@ function useWatcher(owner, props_) {
|
|
|
89
90
|
);
|
|
90
91
|
}
|
|
91
92
|
});
|
|
93
|
+
const globalConfig = useGlobalConfig("table");
|
|
94
|
+
if (globalConfig.value && hasOwn(globalConfig.value, "showOverflowTooltip")) {
|
|
95
|
+
watch(
|
|
96
|
+
() => {
|
|
97
|
+
var _a;
|
|
98
|
+
return (_a = globalConfig.value) == null ? void 0 : _a.showOverflowTooltip;
|
|
99
|
+
},
|
|
100
|
+
(newVal) => {
|
|
101
|
+
if (instance.columnConfig.value.type === "selection") return;
|
|
102
|
+
if (!isUndefined(props_.showOverflowTooltip) || !isUndefined(owner.value.props.showOverflowTooltip))
|
|
103
|
+
return;
|
|
104
|
+
instance.columnConfig.value.showOverflowTooltip = newVal;
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
92
108
|
};
|
|
93
109
|
return {
|
|
94
110
|
registerComplexWatchers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher-helper.mjs","sources":["../../../../../../../packages/components/table/src/table-column/watcher-helper.ts"],"sourcesContent":["import { getCurrentInstance, watch } from 'vue'\nimport { hasOwn, isUndefined } from '@element-plus/utils'\nimport { parseMinWidth, parseWidth } from '../util'\n\nimport type { ComputedRef } from 'vue'\nimport type { DefaultRow } from '../table/defaults'\nimport type { TableColumn, TableColumnCtx, ValueOf } from './defaults'\n\nfunction getAllAliases(props: string[], aliases: Record<string, string>) {\n return props.reduce((prev, cur) => {\n prev[cur as keyof typeof prev] = cur\n return prev\n }, aliases)\n}\nfunction useWatcher<T extends DefaultRow>(\n owner: ComputedRef<any>,\n props_: Partial<TableColumnCtx<T>>\n) {\n const instance = getCurrentInstance() as TableColumn<T>\n const registerComplexWatchers = () => {\n const props = ['fixed']\n const aliases: Record<string, string> = {\n realWidth: 'width',\n realMinWidth: 'minWidth',\n }\n const allAliases = getAllAliases(props, aliases)\n Object.keys(allAliases).forEach((key) => {\n const columnKey = aliases[key]\n if (hasOwn(props_, columnKey)) {\n watch(\n () => props_[columnKey],\n (newVal) => {\n let value: ValueOf<TableColumnCtx<T>> = newVal\n if (columnKey === 'width' && key === 'realWidth') {\n value = parseWidth(newVal)\n }\n if (columnKey === 'minWidth' && key === 'realMinWidth') {\n value = parseMinWidth(newVal)\n }\n instance.columnConfig.value[columnKey as never] = value as never\n instance.columnConfig.value[key as never] = value as never\n const updateColumns = columnKey === 'fixed'\n owner.value.store.scheduleLayout(updateColumns)\n }\n )\n }\n })\n }\n const registerNormalWatchers = () => {\n const props = [\n 'label',\n 'filters',\n 'filterMultiple',\n 'filteredValue',\n 'sortable',\n 'index',\n 'formatter',\n 'className',\n 'labelClassName',\n 'filterClassName',\n 'showOverflowTooltip',\n 'tooltipFormatter',\n 'resizable',\n ]\n const parentProps = ['showOverflowTooltip']\n const aliases: Record<string, string> = {\n property: 'prop',\n align: 'realAlign',\n headerAlign: 'realHeaderAlign',\n }\n const allAliases = getAllAliases(props, aliases)\n Object.keys(allAliases).forEach((key) => {\n const columnKey = aliases[key]\n if (hasOwn(props_, columnKey)) {\n watch(\n () => props_[columnKey],\n (newVal) => {\n instance.columnConfig.value[key as never] = newVal\n if (key === 'filters' || key === 'filterMethod') {\n instance.columnConfig.value['filterable'] = !!(\n instance.columnConfig.value['filters'] ||\n instance.columnConfig.value['filterMethod']\n )\n }\n }\n )\n }\n })\n parentProps.forEach((key) => {\n if (hasOwn(owner.value.props, key)) {\n watch(\n () => owner.value.props[key],\n (newVal) => {\n if (instance.columnConfig.value.type === 'selection') return\n if (!isUndefined(props_[key])) return\n instance.columnConfig.value[key] = newVal as never\n }\n )\n }\n })\n }\n\n return {\n registerComplexWatchers,\n registerNormalWatchers,\n }\n}\n\nexport default useWatcher\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watcher-helper.mjs","sources":["../../../../../../../packages/components/table/src/table-column/watcher-helper.ts"],"sourcesContent":["import { getCurrentInstance, watch } from 'vue'\nimport { hasOwn, isUndefined } from '@element-plus/utils'\nimport { parseMinWidth, parseWidth } from '../util'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\n\nimport type { ComputedRef } from 'vue'\nimport type { DefaultRow } from '../table/defaults'\nimport type { TableColumn, TableColumnCtx, ValueOf } from './defaults'\n\nfunction getAllAliases(props: string[], aliases: Record<string, string>) {\n return props.reduce((prev, cur) => {\n prev[cur as keyof typeof prev] = cur\n return prev\n }, aliases)\n}\nfunction useWatcher<T extends DefaultRow>(\n owner: ComputedRef<any>,\n props_: Partial<TableColumnCtx<T>>\n) {\n const instance = getCurrentInstance() as TableColumn<T>\n const registerComplexWatchers = () => {\n const props = ['fixed']\n const aliases: Record<string, string> = {\n realWidth: 'width',\n realMinWidth: 'minWidth',\n }\n const allAliases = getAllAliases(props, aliases)\n Object.keys(allAliases).forEach((key) => {\n const columnKey = aliases[key]\n if (hasOwn(props_, columnKey)) {\n watch(\n () => props_[columnKey],\n (newVal) => {\n let value: ValueOf<TableColumnCtx<T>> = newVal\n if (columnKey === 'width' && key === 'realWidth') {\n value = parseWidth(newVal)\n }\n if (columnKey === 'minWidth' && key === 'realMinWidth') {\n value = parseMinWidth(newVal)\n }\n instance.columnConfig.value[columnKey as never] = value as never\n instance.columnConfig.value[key as never] = value as never\n const updateColumns = columnKey === 'fixed'\n owner.value.store.scheduleLayout(updateColumns)\n }\n )\n }\n })\n }\n const registerNormalWatchers = () => {\n const props = [\n 'label',\n 'filters',\n 'filterMultiple',\n 'filteredValue',\n 'sortable',\n 'index',\n 'formatter',\n 'className',\n 'labelClassName',\n 'filterClassName',\n 'showOverflowTooltip',\n 'tooltipFormatter',\n 'resizable',\n ]\n const parentProps = ['showOverflowTooltip']\n const aliases: Record<string, string> = {\n property: 'prop',\n align: 'realAlign',\n headerAlign: 'realHeaderAlign',\n }\n const allAliases = getAllAliases(props, aliases)\n Object.keys(allAliases).forEach((key) => {\n const columnKey = aliases[key]\n if (hasOwn(props_, columnKey)) {\n watch(\n () => props_[columnKey],\n (newVal) => {\n instance.columnConfig.value[key as never] = newVal\n if (key === 'filters' || key === 'filterMethod') {\n instance.columnConfig.value['filterable'] = !!(\n instance.columnConfig.value['filters'] ||\n instance.columnConfig.value['filterMethod']\n )\n }\n }\n )\n }\n })\n parentProps.forEach((key) => {\n if (hasOwn(owner.value.props, key)) {\n watch(\n () => owner.value.props[key],\n (newVal) => {\n if (instance.columnConfig.value.type === 'selection') return\n if (!isUndefined(props_[key])) return\n instance.columnConfig.value[key] = newVal as never\n }\n )\n }\n })\n\n const globalConfig = useGlobalConfig('table')\n if (\n globalConfig.value &&\n hasOwn(globalConfig.value, 'showOverflowTooltip')\n ) {\n watch(\n () => globalConfig.value?.showOverflowTooltip,\n (newVal) => {\n if (instance.columnConfig.value.type === 'selection') return\n if (\n !isUndefined(props_.showOverflowTooltip) ||\n !isUndefined(owner.value.props.showOverflowTooltip)\n )\n return\n instance.columnConfig.value.showOverflowTooltip = newVal as never\n }\n )\n }\n }\n\n return {\n registerComplexWatchers,\n registerNormalWatchers,\n }\n}\n\nexport default useWatcher\n"],"names":[],"mappings":";;;;;;AASA,SAAS,aAAA,CAAc,OAAiB,OAAA,EAAiC;AACvE,EAAA,OAAO,KAAA,CAAM,MAAA,CAAO,CAAC,IAAA,EAAM,GAAA,KAAQ;AACjC,IAAA,IAAA,CAAK,GAAwB,CAAA,GAAI,GAAA;AACjC,IAAA,OAAO,IAAA;AAAA,EACT,GAAG,OAAO,CAAA;AACZ;AACA,SAAS,UAAA,CACP,OACA,MAAA,EACA;AACA,EAAA,MAAM,WAAW,kBAAA,EAAmB;AACpC,EAAA,MAAM,0BAA0B,MAAM;AACpC,IAAA,MAAM,KAAA,GAAQ,CAAC,OAAO,CAAA;AACtB,IAAA,MAAM,OAAA,GAAkC;AAAA,MACtC,SAAA,EAAW,OAAA;AAAA,MACX,YAAA,EAAc;AAAA,KAChB;AACA,IAAA,MAAM,UAAA,GAAa,aAAA,CAAc,KAAA,EAAO,OAAO,CAAA;AAC/C,IAAA,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACvC,MAAA,MAAM,SAAA,G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A,GAAI,MAAA;AAAA,UACrC;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAC,CAAA;AAED,IAAA,MAAM,YAAA,GAAe,gBAAgB,OAAO,CAAA;AAC5C,IAAA,IACE,aAAa,KAAA,IACb,MAAA,CAAO,YAAA,CAAa,KAAA,EAAO,qBAAqB,CAAA,EAChD;AACA,MAAA,KAAA;AAAA,QACE,MAAG;AA5GX,UAAA,IAAA,EAAA;AA4Gc,UAAA,OAAA,CAAA,EAAA,GAAA,YAAA,CAAa,UAAb,IAAA,GAAA,MAAA,GAAA,EAAA,CAAoB,mBAAA;AAAA,QAAA,CAAA;AAAA,QAC1B,CAAC,MAAA,KAAW;AACV,UAAA,IAAI,QAAA,CAAS,YAAA,CAAa,KAAA,CAAM,IAAA,KAAS,WAAA,EAAa;AACtD,UAAA,IACE,CAAC,WAAA,CAAY,MAAA,CAAO,mBAAmB,CAAA,IACvC,CAAC,WAAA,CAAY,KAAA,CAAM,KAAA,CAAM,KAAA,CAAM,mBAAmB,CAAA;AAElD,YAAA;AACF,UAAA,QAAA,CAAS,YAAA,CAAa,MAAM,mBAAA,GAAsB,MAAA;AAAA,QACpD;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,uBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -80,7 +80,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
80
80
|
};
|
|
81
81
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
82
82
|
flexible: BooleanConstructor;
|
|
83
|
-
showOverflowTooltip:
|
|
83
|
+
showOverflowTooltip: {
|
|
84
|
+
type: import("vue").PropType<import("./table/defaults").TableProps<any>["showOverflowTooltip"]>;
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
84
87
|
tooltipFormatter: import("vue").PropType<import("./table/defaults").TableProps<any>["tooltipFormatter"]>;
|
|
85
88
|
appendFilterPanelTo: StringConstructor;
|
|
86
89
|
scrollbarTabindex: {
|
|
@@ -716,6 +719,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
716
719
|
context: Table<any>;
|
|
717
720
|
computedSumText: import("vue").ComputedRef<string>;
|
|
718
721
|
computedEmptyText: import("vue").ComputedRef<string>;
|
|
722
|
+
computedTooltipEffect: import("vue").ComputedRef<string | undefined>;
|
|
723
|
+
computedTooltipOptions: import("vue").ComputedRef<Partial<Pick<import("element-plus").UseTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "appendTo" | "popperOptions" | "enterable" | "popperClass" | "showArrow">> | undefined>;
|
|
719
724
|
tableLayout: import("vue").ComputedRef<"fixed" | "auto">;
|
|
720
725
|
scrollbarViewStyle: {
|
|
721
726
|
display: string;
|
|
@@ -748,7 +753,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
748
753
|
* @description whether to allow drag the last column
|
|
749
754
|
*/
|
|
750
755
|
allowDragLastColumn: boolean;
|
|
751
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "scroll" | "select-all" | "
|
|
756
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "scroll" | "select-all" | "header-click" | "header-contextmenu" | "header-dragend" | "expand-change" | "current-change" | "selection-change" | "sort-change" | "filter-change" | "cell-mouse-enter" | "cell-mouse-leave" | "cell-contextmenu" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick")[], "select" | "scroll" | "select-all" | "header-click" | "header-contextmenu" | "header-dragend" | "expand-change" | "current-change" | "selection-change" | "sort-change" | "filter-change" | "cell-mouse-enter" | "cell-mouse-leave" | "cell-contextmenu" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
752
757
|
data: {
|
|
753
758
|
type: import("vue").PropType<any[]>;
|
|
754
759
|
default: () => never[];
|
|
@@ -828,7 +833,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
828
833
|
};
|
|
829
834
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
830
835
|
flexible: BooleanConstructor;
|
|
831
|
-
showOverflowTooltip:
|
|
836
|
+
showOverflowTooltip: {
|
|
837
|
+
type: import("vue").PropType<import("./table/defaults").TableProps<any>["showOverflowTooltip"]>;
|
|
838
|
+
default: undefined;
|
|
839
|
+
};
|
|
832
840
|
tooltipFormatter: import("vue").PropType<import("./table/defaults").TableProps<any>["tooltipFormatter"]>;
|
|
833
841
|
appendFilterPanelTo: StringConstructor;
|
|
834
842
|
scrollbarTabindex: {
|
|
@@ -844,12 +852,12 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
844
852
|
}>> & {
|
|
845
853
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
846
854
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
847
|
-
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
848
|
-
"onCurrent-change"?: ((...args: any[]) => any) | undefined;
|
|
849
855
|
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
850
856
|
"onHeader-click"?: ((...args: any[]) => any) | undefined;
|
|
851
857
|
"onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
852
858
|
"onHeader-dragend"?: ((...args: any[]) => any) | undefined;
|
|
859
|
+
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
860
|
+
"onCurrent-change"?: ((...args: any[]) => any) | undefined;
|
|
853
861
|
"onSelection-change"?: ((...args: any[]) => any) | undefined;
|
|
854
862
|
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
855
863
|
"onFilter-change"?: ((...args: any[]) => any) | undefined;
|
|
@@ -869,7 +877,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
869
877
|
className: string;
|
|
870
878
|
lazy: boolean;
|
|
871
879
|
fit: boolean;
|
|
872
|
-
|
|
880
|
+
showOverflowTooltip: boolean | Partial<Pick<import("element-plus").UseTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "appendTo" | "popperOptions" | "enterable" | "popperClass" | "showArrow">> | undefined;
|
|
873
881
|
allowDragLastColumn: boolean;
|
|
874
882
|
treeProps: import("./table/defaults").TreeProps | undefined;
|
|
875
883
|
defaultExpandAll: boolean;
|
|
@@ -879,6 +887,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
879
887
|
showHeader: boolean;
|
|
880
888
|
showSummary: boolean;
|
|
881
889
|
highlightCurrentRow: boolean;
|
|
890
|
+
scrollbarAlwaysOn: boolean;
|
|
882
891
|
flexible: boolean;
|
|
883
892
|
scrollbarTabindex: string | number;
|
|
884
893
|
nativeScrollbar: boolean;
|
|
@@ -146,8 +146,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
146
146
|
context: _ctx.context,
|
|
147
147
|
highlight: _ctx.highlightCurrentRow,
|
|
148
148
|
"row-class-name": _ctx.rowClassName,
|
|
149
|
-
"tooltip-effect": _ctx.
|
|
150
|
-
"tooltip-options": _ctx.
|
|
149
|
+
"tooltip-effect": _ctx.computedTooltipEffect,
|
|
150
|
+
"tooltip-options": _ctx.computedTooltipOptions,
|
|
151
151
|
"row-style": _ctx.rowStyle,
|
|
152
152
|
store: _ctx.store,
|
|
153
153
|
stripe: _ctx.stripe
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.vue.mjs","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 ref=\"tableInnerWrapper\" :class=\"ns.e('inner-wrapper')\">\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 :allow-drag-last-column=\"allowDragLastColumn\"\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 :native=\"nativeScrollbar\"\n @scroll=\"$emit('scroll', $event)\"\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\">\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 'scroll',\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 resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\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 /**\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 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 * @description whether to allow drag the last column\n */\n allowDragLastColumn: props.allowDragLastColumn,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_renderSlot","_withDirectives","_openBlock","_createVNode","_createCommentVNode","_createBlock","_createTextVNode"],"mappings":";;;;;;EA6BW,GAAA,EAAI,eAAA;AAAA,EAAgB,KAAA,EAAM;;;;;;;;;sBA5BnCA,kBAAA,CAwKM,KAAA,EAAA;AAAA,IAvKJ,GAAA,EAAI,cAAA;AAAA,IACH,OAAKC,cAAA,CAAA;AAAA,MAAA;AAAA,QAAqB,CAAA,IAAA,CAAA,EAAA,CAAG,EAAC,KAAA,CAAA,GAAU,IAAA,CAAA,GAAA;AAAA,QAAA,CAAc,IAAA,CAAA,EAAA,CAAG,EAAC,SAAA,CAAA,GAAc,IAAA,CAAA,MAAA;AAAA,QAAA,CAAiB,KAAA,EAAA,CAAG,CAAA,CAAC,QAAA,CAAA,GAAa,IAAA,CAAA,MAAA,IAAU,IAAA,CAAA,OAAA;AAAA,QAAA,CAAkB,IAAA,CAAA,EAAA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}
|
|
1
|
+
{"version":3,"file":"table.vue.mjs","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 ref=\"tableInnerWrapper\" :class=\"ns.e('inner-wrapper')\">\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 :allow-drag-last-column=\"allowDragLastColumn\"\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 :native=\"nativeScrollbar\"\n @scroll=\"$emit('scroll', $event)\"\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=\"computedTooltipEffect\"\n :tooltip-options=\"computedTooltipOptions\"\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\">\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 { useGlobalConfig } from '@element-plus/components/config-provider'\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 'scroll',\n ],\n setup(props) {\n type Row = (typeof props.data)[number]\n const { t } = useLocale()\n const ns = useNamespace('table')\n const globalConfig = useGlobalConfig('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 resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\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 computedTooltipEffect = computed(\n () => props.tooltipEffect ?? globalConfig.value?.tooltipEffect\n )\n\n const computedTooltipOptions = computed(\n () => props.tooltipOptions ?? globalConfig.value?.tooltipOptions\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 /**\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 computedTooltipEffect,\n computedTooltipOptions,\n tableLayout,\n scrollbarViewStyle,\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 * @description whether to allow drag the last column\n */\n allowDragLastColumn: props.allowDragLastColumn,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_ren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CAAA,4BAA4B;AAAA,SAAA,CAAA,GAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,QAuBjC,IAAA,CAAA,MAAA,IAAU,IAAA,CAAA,OAAA,IAAAF,WAAA,EAArBN,kBAAA;AAAA,UAAmE,KAAA;AAAA,UAAA;AAAA,YAAA,GAAA,EAAA,CAAA;AAAA,YAApC,OAAKC,cAAA,CAAE,IAAA,IAAG,CAAA,CAAC,mBAAA,CAAA;AAAA,WAAA;AAAA;;;;;;;;IAE5CI,cAAA,CAAAF,kBAAA;AAAA,MAIE,KAAA;AAAA,MAAA;AAAA,QAFA,GAAA,EAAI,aAAA;AAAA,QACH,OAAKF,cAAA,CAAE,IAAA,CAAA,EAAA,CAAG,CAAA,CAAC,qBAAA,CAAA;AAAA,OAAA;AAAA;;;;cAFJ,IAAA,CAAA,kBAAkB;AAAA,KAAA;AAAA;;;;;;"}
|
|
@@ -17,6 +17,7 @@ import { useScrollbar } from './composables/use-scrollbar.mjs';
|
|
|
17
17
|
import Mousewheel from '../../../directives/mousewheel/index.mjs';
|
|
18
18
|
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
19
19
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
20
|
+
import { useGlobalConfig } from '../../config-provider/src/hooks/use-global-config.mjs';
|
|
20
21
|
|
|
21
22
|
let tableIdSeed = 1;
|
|
22
23
|
var _sfc_main = defineComponent({
|
|
@@ -56,6 +57,7 @@ var _sfc_main = defineComponent({
|
|
|
56
57
|
setup(props) {
|
|
57
58
|
const { t } = useLocale();
|
|
58
59
|
const ns = useNamespace("table");
|
|
60
|
+
const globalConfig = useGlobalConfig("table");
|
|
59
61
|
const table = getCurrentInstance();
|
|
60
62
|
provide(TABLE_INJECTION_KEY, table);
|
|
61
63
|
const store = createStore(table, props);
|
|
@@ -118,6 +120,18 @@ var _sfc_main = defineComponent({
|
|
|
118
120
|
var _a;
|
|
119
121
|
return (_a = props.emptyText) != null ? _a : t("el.table.emptyText");
|
|
120
122
|
});
|
|
123
|
+
const computedTooltipEffect = computed(
|
|
124
|
+
() => {
|
|
125
|
+
var _a, _b;
|
|
126
|
+
return (_b = props.tooltipEffect) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.tooltipEffect;
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
const computedTooltipOptions = computed(
|
|
130
|
+
() => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
return (_b = props.tooltipOptions) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.tooltipOptions;
|
|
133
|
+
}
|
|
134
|
+
);
|
|
121
135
|
const columns = computed(() => {
|
|
122
136
|
return convertToRows(store.states.originColumns.value)[0];
|
|
123
137
|
});
|
|
@@ -193,6 +207,8 @@ var _sfc_main = defineComponent({
|
|
|
193
207
|
context: table,
|
|
194
208
|
computedSumText,
|
|
195
209
|
computedEmptyText,
|
|
210
|
+
computedTooltipEffect,
|
|
211
|
+
computedTooltipOptions,
|
|
196
212
|
tableLayout,
|
|
197
213
|
scrollbarViewStyle,
|
|
198
214
|
scrollbarStyle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.vue2.mjs","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 ref=\"tableInnerWrapper\" :class=\"ns.e('inner-wrapper')\">\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 :allow-drag-last-column=\"allowDragLastColumn\"\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 :native=\"nativeScrollbar\"\n @scroll=\"$emit('scroll', $event)\"\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\">\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 'scroll',\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 resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\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 /**\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 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 * @description whether to allow drag the last column\n */\n allowDragLastColumn: props.allowDragLastColumn,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAwMA,IAAI,WAAA,GAAc,CAAA;AAClB,gBAAe,eAAA,CAAgB;AAAA,EAC7B,IAAA,EAAM,SAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV;AAAA,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,WAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,KAAA,EAAO,YAAA;AAAA,EACP,KAAA,EAAO;AAAA,IACL,QAAA;AAAA,IACA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA;AAAA,IACA,YAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA,oBAAA;AAAA,IACA,aAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,gBAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,MAAM,KAAA,EAAO;AAEX,IAAA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AACxB,IAAA,MAAM,EAAA,GAAK,aAAa,OAAO,CA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A,MACA,SAAA;AAAA,MACA,eAAA;AAAA,MACA,eAAA;AAAA,MACA,qBAAA;AAAA;AAAA;AAAA;AAAA,MAIA,aAAA;AAAA;AAAA;AAAA;AAAA,MAIA,gBAAA;AAAA;AAAA;AAAA;AAAA,MAIA,kBAAA;AAAA;AAAA;AAAA;AAAA,MAIA,cAAA;AAAA;AAAA;AAAA;AAAA,MAIA,WAAA;AAAA;AAAA;AAAA;AAAA,MAIA,kBAAA;AAAA;AAAA;AAAA;AAAA,MAIA,kBAAA;AAAA;AAAA;AAAA;AAAA,MAIA,SAAA;AAAA;AAAA;AAAA;AAAA,MAIA,QAAA;AAAA;AAAA;AAAA;AAAA,MAIA,IAAA;AAAA;AAAA;AAAA;AAAA,MAIA,iBAAA;AAAA,MACA,CAAA;AAAA,MACA,cAAA;AAAA,MACA,OAAA,EAAS,KAAA;AAAA,MACT,eAAA;AAAA,MACA,iBAAA;AAAA,MACA,WAAA;AAAA,MACA,kBAAA;AAAA,MACA,cAAA;AAAA,MACA,YAAA;AAAA;AAAA;AAAA;AAAA,MAIA,QAAA;AAAA;AAAA;AAAA;AAAA,MAIA,aAAA;AAAA;AAAA;AAAA;AAAA,MAIA,YAAA;AAAA;AAAA;AAAA;AAAA,MAIA,qBAAqB,KAAA,CAAM;AAAA,KAC7B;AAAA,EACF;AACF,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"table.vue2.mjs","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 ref=\"tableInnerWrapper\" :class=\"ns.e('inner-wrapper')\">\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 :allow-drag-last-column=\"allowDragLastColumn\"\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 :native=\"nativeScrollbar\"\n @scroll=\"$emit('scroll', $event)\"\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=\"computedTooltipEffect\"\n :tooltip-options=\"computedTooltipOptions\"\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\">\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 { useGlobalConfig } from '@element-plus/components/config-provider'\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 'scroll',\n ],\n setup(props) {\n type Row = (typeof props.data)[number]\n const { t } = useLocale()\n const ns = useNamespace('table')\n const globalConfig = useGlobalConfig('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 resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\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 computedTooltipEffect = computed(\n () => props.tooltipEffect ?? globalConfig.value?.tooltipEffect\n )\n\n const computedTooltipOptions = computed(\n () => props.tooltipOptions ?? globalConfig.value?.tooltipOptions\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 /**\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 computedTooltipEffect,\n computedTooltipOptions,\n tableLayout,\n scrollbarViewStyle,\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 * @description whether to allow drag the last column\n */\n allowDragLastColumn: props.allowDragLastColumn,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyMA,IAAI,WAAA,GAAc,CAAA;AAClB,gBAAe,eAAA,CAAgB;AAAA,EAC7B,IAAA,EAAM,SAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV;AAAA,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,WAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,KAAA,EAAO,YAAA;AAAA,EACP,KAAA,EAAO;AAAA,IACL,QAAA;AAAA,IACA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA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