@vtable-guild/vtable-guild 2.7.1 → 2.8.0
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/css/presets/antdv.css +36 -0
- package/css/presets/element-plus.css +38 -0
- package/css/style.css +436 -0
- package/css/tailwind3-utilities.css +337 -0
- package/css/tailwind3.css +99 -0
- package/css/tailwind4.css +99 -0
- package/css/transitions.css +25 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts +3 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/VirtualList.mjs +28 -27
- package/dist/core/src/components/VirtualList/VirtualScrollBar.d.ts +1 -1
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/utils/types.d.ts +18 -0
- package/dist/core/src/utils/types.d.ts.map +1 -1
- package/dist/css/presets/antdv.css +36 -0
- package/dist/css/presets/element-plus.css +38 -0
- package/dist/css/style.css +436 -0
- package/dist/css/tailwind3-utilities.css +337 -0
- package/dist/css/tailwind3.css +99 -0
- package/dist/css/tailwind4.css +99 -0
- package/dist/css/transitions.css +25 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.full.mjs +5229 -3895
- package/dist/index.mjs +85 -75
- package/dist/table/src/components/ColGroup.d.ts.map +1 -1
- package/dist/table/src/components/ColGroup.mjs +10 -10
- package/dist/table/src/components/ColumnWidthRow.d.ts +4 -0
- package/dist/table/src/components/ColumnWidthRow.d.ts.map +1 -0
- package/dist/table/src/components/ColumnWidthRow.mjs +23 -0
- package/dist/table/src/components/PaginationSizeSelect.d.ts +57 -0
- package/dist/table/src/components/PaginationSizeSelect.d.ts.map +1 -0
- package/dist/table/src/components/PaginationSizeSelect.mjs +138 -0
- package/dist/table/src/components/SelectionDropdown.d.ts +9 -0
- package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
- package/dist/table/src/components/SelectionDropdown.mjs +32 -26
- package/dist/table/src/components/Table.d.ts +13 -2
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +497 -403
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +80 -74
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +85 -83
- package/dist/table/src/components/TablePagination.d.ts +74 -0
- package/dist/table/src/components/TablePagination.d.ts.map +1 -0
- package/dist/table/src/components/TablePagination.mjs +350 -0
- package/dist/table/src/components/TablePagination.test.d.ts +2 -0
- package/dist/table/src/components/TablePagination.test.d.ts.map +1 -0
- package/dist/table/src/components/TablePaginationCompatClass.test.d.ts +2 -0
- package/dist/table/src/components/TablePaginationCompatClass.test.d.ts.map +1 -0
- package/dist/table/src/components/TablePaginationLayout.test.d.ts +2 -0
- package/dist/table/src/components/TablePaginationLayout.test.d.ts.map +1 -0
- package/dist/table/src/components/VTable.vue.d.ts.map +1 -1
- package/dist/table/src/components/VTable.vue.mjs +34 -26
- package/dist/table/src/components/VTableMinWidth.test.d.ts +2 -0
- package/dist/table/src/components/VTableMinWidth.test.d.ts.map +1 -0
- package/dist/table/src/components/VTableSummaryCell.d.ts.map +1 -1
- package/dist/table/src/components/VTableSummaryCell.mjs +26 -24
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +106 -93
- package/dist/table/src/composables/useColumnLayout.d.ts +28 -0
- package/dist/table/src/composables/useColumnLayout.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnLayout.mjs +259 -0
- package/dist/table/src/composables/useColumnLayout.test.d.ts +2 -0
- package/dist/table/src/composables/useColumnLayout.test.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnMetrics.d.ts +5 -3
- package/dist/table/src/composables/useColumnMetrics.d.ts.map +1 -1
- package/dist/table/src/composables/useColumnMetrics.mjs +64 -55
- package/dist/table/src/composables/useExpand.d.ts +2 -0
- package/dist/table/src/composables/useExpand.d.ts.map +1 -1
- package/dist/table/src/composables/useExpand.mjs +44 -20
- package/dist/table/src/composables/usePagination.d.ts +15 -0
- package/dist/table/src/composables/usePagination.d.ts.map +1 -0
- package/dist/table/src/composables/usePagination.mjs +65 -0
- package/dist/table/src/composables/usePagination.test.d.ts +2 -0
- package/dist/table/src/composables/usePagination.test.d.ts.map +1 -0
- package/dist/table/src/composables/useResize.d.ts +1 -0
- package/dist/table/src/composables/useResize.d.ts.map +1 -1
- package/dist/table/src/composables/useResize.mjs +67 -39
- package/dist/table/src/composables/useScroll.d.ts +3 -0
- package/dist/table/src/composables/useScroll.d.ts.map +1 -1
- package/dist/table/src/composables/useScroll.mjs +43 -41
- package/dist/table/src/composables/useSelection.d.ts +2 -1
- package/dist/table/src/composables/useSelection.d.ts.map +1 -1
- package/dist/table/src/composables/useSelection.mjs +210 -171
- package/dist/table/src/composables/useTreeData.d.ts +4 -0
- package/dist/table/src/composables/useTreeData.d.ts.map +1 -1
- package/dist/table/src/composables/useTreeData.mjs +48 -43
- package/dist/table/src/context.d.ts +6 -1
- package/dist/table/src/context.d.ts.map +1 -1
- package/dist/table/src/index.d.ts +3 -1
- package/dist/table/src/index.d.ts.map +1 -1
- package/dist/table/src/types/column.d.ts +8 -2
- package/dist/table/src/types/column.d.ts.map +1 -1
- package/dist/table/src/types/index.d.ts +1 -0
- package/dist/table/src/types/index.d.ts.map +1 -1
- package/dist/table/src/types/pagination.d.ts +66 -0
- package/dist/table/src/types/pagination.d.ts.map +1 -0
- package/dist/table/src/types/pagination.typecheck.d.ts +25 -0
- package/dist/table/src/types/pagination.typecheck.d.ts.map +1 -0
- package/dist/table/src/types/table.d.ts +8 -1
- package/dist/table/src/types/table.d.ts.map +1 -1
- package/dist/table/src/utils/columnWidth.d.ts +55 -7
- package/dist/table/src/utils/columnWidth.d.ts.map +1 -1
- package/dist/table/src/utils/columnWidth.mjs +91 -21
- package/dist/table/src/utils/paginationLayout.d.ts +13 -0
- package/dist/table/src/utils/paginationLayout.d.ts.map +1 -0
- package/dist/table/src/utils/paginationLayout.mjs +55 -0
- package/dist/table/src/utils/paginationLayout.test.d.ts +2 -0
- package/dist/table/src/utils/paginationLayout.test.d.ts.map +1 -0
- package/dist/table/src/utils/popupPosition.d.ts +4 -1
- package/dist/table/src/utils/popupPosition.d.ts.map +1 -1
- package/dist/table/src/utils/popupPosition.mjs +34 -15
- package/dist/theme/src/augment.d.ts +2 -0
- package/dist/theme/src/augment.d.ts.map +1 -1
- package/dist/theme/src/compat/antdv-pagination.d.ts +4 -0
- package/dist/theme/src/compat/antdv-pagination.d.ts.map +1 -0
- package/dist/theme/src/compat/antdv-pagination.mjs +29 -0
- package/dist/theme/src/index.d.ts +5 -0
- package/dist/theme/src/index.d.ts.map +1 -1
- package/dist/theme/src/pagination.d.ts +153 -0
- package/dist/theme/src/pagination.d.ts.map +1 -0
- package/dist/theme/src/pagination.mjs +144 -0
- package/dist/theme/src/presets/antdv/table-locale.d.ts +2 -2
- package/dist/theme/src/presets/antdv/table-locale.mjs +2 -2
- package/dist/theme/src/presets/antdv/table.d.ts +3 -0
- package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
- package/dist/theme/src/presets/antdv/table.mjs +3 -0
- package/dist/theme/src/presets/element-plus/table-locale.d.ts +2 -2
- package/dist/theme/src/presets/element-plus/table-locale.mjs +2 -2
- package/dist/theme/src/presets/element-plus/table.d.ts +3 -0
- package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
- package/dist/theme/src/presets/element-plus/table.mjs +3 -0
- package/dist/theme/src/presets/index.d.ts.map +1 -1
- package/dist/theme/src/presets/index.mjs +60 -57
- package/dist/theme/src/presets/types.d.ts +1 -0
- package/dist/theme/src/presets/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,81 +1,91 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Jt, inject as Zt, computed as a, provide as We, ref as b, onMounted as Qt, onBeforeUnmount as el, watch as I, createVNode as n, Fragment as tl, isVNode as ll, nextTick as ol } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
|
-
import { prefixThemeConfig as
|
|
4
|
-
import { devWarn as
|
|
5
|
-
import { mergeThemeConfigs as
|
|
6
|
-
import { mergeDeep as
|
|
7
|
-
import
|
|
8
|
-
import { VTABLE_GUILD_INJECTION_KEY as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
|
|
40
|
-
|
|
3
|
+
import { prefixThemeConfig as al, prefixVtgClassNames as Y } from "../../../core/src/utils/classPrefix.mjs";
|
|
4
|
+
import { devWarn as nl } from "../../../core/src/utils/devWarn.mjs";
|
|
5
|
+
import { mergeThemeConfigs as T, useTheme as rl } from "../../../core/src/composables/useTheme.mjs";
|
|
6
|
+
import { mergeDeep as $ } from "../../../core/src/utils/mergeDeep.mjs";
|
|
7
|
+
import ke from "../../../core/src/components/Scrollbar.mjs";
|
|
8
|
+
import { VTABLE_GUILD_INJECTION_KEY as ze } from "../../../core/src/plugin/index.mjs";
|
|
9
|
+
import { paginationZhCN as il } from "../../../theme/src/pagination.mjs";
|
|
10
|
+
import { resolveTooltipThemePreset as dl, resolveScrollbarThemePreset as sl, resolveRadioThemePreset as ul, resolveInputThemePreset as cl, resolveCheckboxThemePreset as fl, resolveButtonThemePreset as ml, resolveTableThemePreset as pl, resolveTableLocalePreset as vl, resolveBuiltInTableLocale as gl, resolveBuiltInLocale as wl } from "../../../theme/src/presets/index.mjs";
|
|
11
|
+
import { antdvTableCompatClasses as hl } from "../../../theme/src/compat/antdv-table.mjs";
|
|
12
|
+
import { usePagination as yl } from "../composables/usePagination.mjs";
|
|
13
|
+
import Cl from "./TablePagination.mjs";
|
|
14
|
+
import { filterVisibleColumns as bl, applyColumnOrder as xl } from "../composables/useColumnDisplay.mjs";
|
|
15
|
+
import { getEllipsisConfig as Sl } from "../utils/cell.mjs";
|
|
16
|
+
import { getRootCompatClass as Dl } from "../utils/compat.mjs";
|
|
17
|
+
import { resolveRowKey as Rl } from "../utils/rowKey.mjs";
|
|
18
|
+
import { normalizeMinWidth as El } from "../utils/columnWidth.mjs";
|
|
19
|
+
import { useScroll as Il } from "../composables/useScroll.mjs";
|
|
20
|
+
import { useAutoHeight as Tl } from "../composables/useAutoHeight.mjs";
|
|
21
|
+
import { useColumnMetrics as Hl } from "../composables/useColumnMetrics.mjs";
|
|
22
|
+
import { useColumnLayout as Ll } from "../composables/useColumnLayout.mjs";
|
|
23
|
+
import { resolveFixedColumnRanges as Bl } from "../composables/useColumnWindow.mjs";
|
|
24
|
+
import { useExpand as Nl } from "../composables/useExpand.mjs";
|
|
25
|
+
import { useResize as Fl } from "../composables/useResize.mjs";
|
|
26
|
+
import { useVirtual as Ol, INVALID_SCROLL_Y_FALLBACK as Al } from "../composables/useVirtual.mjs";
|
|
27
|
+
import { useTreeData as Pl } from "../composables/useTreeData.mjs";
|
|
28
|
+
import { useHoverState as Wl } from "../composables/useHoverState.mjs";
|
|
29
|
+
import { useRowDragSort as kl } from "../composables/useRowDragSort.mjs";
|
|
30
|
+
import { TABLE_CONTEXT_KEY as zl } from "../context.mjs";
|
|
31
|
+
import { EXPAND_COLUMN as Kl, SELECTION_COLUMN as _l } from "../constants.mjs";
|
|
32
|
+
import { resolveTablePresetConfig as Ml } from "../preset-config.mjs";
|
|
33
|
+
import Ke from "./TableHeader.mjs";
|
|
34
|
+
import _e from "./TableBody.mjs";
|
|
35
|
+
import jl from "./VirtualTableBody.mjs";
|
|
36
|
+
import Me from "./TableLoading.mjs";
|
|
37
|
+
import U from "./ColGroup.mjs";
|
|
38
|
+
import G from "./ColumnWidthRow.mjs";
|
|
39
|
+
import { antdvTableTheme as Vl } from "../../../theme/src/presets/antdv/table.mjs";
|
|
40
|
+
import { useColumns as je } from "../composables/useColumns.mjs";
|
|
41
|
+
import { useSorter as Yl } from "../composables/useSorter.mjs";
|
|
42
|
+
import { useFilter as $l } from "../composables/useFilter.mjs";
|
|
43
|
+
import { useSelection as Ul } from "../composables/useSelection.mjs";
|
|
44
|
+
import { cn as x } from "tailwind-variants";
|
|
45
|
+
function Ve(l) {
|
|
46
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !ll(l);
|
|
41
47
|
}
|
|
42
|
-
const
|
|
43
|
-
function
|
|
48
|
+
const Gl = [["xxxl", 2e3], ["xxl", 1600], ["xl", 1200], ["lg", 992], ["md", 768], ["sm", 576], ["xs", 0]];
|
|
49
|
+
function Ye() {
|
|
44
50
|
if (typeof window > "u")
|
|
45
51
|
return /* @__PURE__ */ new Set(["md", "sm", "xs"]);
|
|
46
|
-
const l = window.innerWidth,
|
|
47
|
-
return
|
|
52
|
+
const l = window.innerWidth, d = /* @__PURE__ */ new Set();
|
|
53
|
+
return Gl.forEach(([s, i]) => {
|
|
48
54
|
if (s === "xs") {
|
|
49
|
-
l < 576 &&
|
|
55
|
+
l < 576 && d.add("xs");
|
|
50
56
|
return;
|
|
51
57
|
}
|
|
52
|
-
l >=
|
|
53
|
-
}),
|
|
58
|
+
l >= i && d.add(s);
|
|
59
|
+
}), d;
|
|
54
60
|
}
|
|
55
|
-
function
|
|
56
|
-
return l.reduce((s,
|
|
57
|
-
if (typeof
|
|
58
|
-
return s.push(
|
|
59
|
-
if (
|
|
61
|
+
function $e(l, d) {
|
|
62
|
+
return l.reduce((s, i) => {
|
|
63
|
+
if (typeof i == "symbol")
|
|
64
|
+
return s.push(i), s;
|
|
65
|
+
if (i.responsive?.length && !i.responsive.some((g) => d.has(g)))
|
|
60
66
|
return s;
|
|
61
|
-
const
|
|
62
|
-
if ("children" in
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
...
|
|
66
|
-
fixed:
|
|
67
|
-
children:
|
|
67
|
+
const v = i.fixed === !0 ? "left" : i.fixed;
|
|
68
|
+
if ("children" in i && Array.isArray(i.children)) {
|
|
69
|
+
const g = $e(i.children, d);
|
|
70
|
+
return g.length === 0 || s.push({
|
|
71
|
+
...i,
|
|
72
|
+
fixed: v,
|
|
73
|
+
children: g
|
|
68
74
|
}), s;
|
|
69
75
|
}
|
|
70
|
-
return s.push(
|
|
71
|
-
...
|
|
72
|
-
fixed:
|
|
76
|
+
return s.push(v === i.fixed ? i : {
|
|
77
|
+
...i,
|
|
78
|
+
fixed: v
|
|
73
79
|
}), s;
|
|
74
80
|
}, []);
|
|
75
81
|
}
|
|
76
|
-
const
|
|
82
|
+
const _o = /* @__PURE__ */ Jt({
|
|
77
83
|
name: "VTable",
|
|
78
84
|
props: {
|
|
85
|
+
pagination: {
|
|
86
|
+
type: [Boolean, Object],
|
|
87
|
+
default: !1
|
|
88
|
+
},
|
|
79
89
|
dataSource: {
|
|
80
90
|
type: Array,
|
|
81
91
|
default: () => []
|
|
@@ -264,265 +274,338 @@ const wo = /* @__PURE__ */ zt({
|
|
|
264
274
|
}
|
|
265
275
|
},
|
|
266
276
|
emits: {
|
|
267
|
-
change: (l,
|
|
268
|
-
resizeColumn: (l,
|
|
269
|
-
rowDragEnd: (l,
|
|
277
|
+
change: (l, d, s) => !0,
|
|
278
|
+
resizeColumn: (l, d) => !0,
|
|
279
|
+
rowDragEnd: (l, d) => !0
|
|
270
280
|
},
|
|
271
281
|
slots: Object,
|
|
272
282
|
setup(l, {
|
|
273
|
-
slots:
|
|
283
|
+
slots: d,
|
|
274
284
|
emit: s
|
|
275
285
|
}) {
|
|
276
|
-
const
|
|
277
|
-
const t =
|
|
286
|
+
const i = Zt(ze, null), v = a(() => i?.themePreset ?? "antdv"), g = a(() => i?.cssMode ?? "prebuilt"), S = a(() => i?.classPrefix ?? "vtg"), Ue = a(() => {
|
|
287
|
+
const t = i?.theme ?? {}, o = v.value, r = (u) => al(u, g.value, S.value);
|
|
278
288
|
return {
|
|
279
289
|
...t,
|
|
280
|
-
button:
|
|
281
|
-
checkbox:
|
|
282
|
-
input:
|
|
283
|
-
radio:
|
|
284
|
-
scrollbar:
|
|
285
|
-
tooltip:
|
|
290
|
+
button: T(r(ml(o)), t.button),
|
|
291
|
+
checkbox: T(r(fl(o)), t.checkbox),
|
|
292
|
+
input: T(r(cl(o)), t.input),
|
|
293
|
+
radio: T(r(ul(o)), t.radio),
|
|
294
|
+
scrollbar: T(r(sl(o)), t.scrollbar),
|
|
295
|
+
tooltip: T(r(dl(o)), t.tooltip)
|
|
286
296
|
};
|
|
287
297
|
});
|
|
288
|
-
|
|
298
|
+
We(ze, {
|
|
289
299
|
get themePreset() {
|
|
290
|
-
return
|
|
300
|
+
return v.value;
|
|
291
301
|
},
|
|
292
302
|
get cssMode() {
|
|
293
|
-
return
|
|
303
|
+
return g.value;
|
|
294
304
|
},
|
|
295
305
|
get classPrefix() {
|
|
296
|
-
return
|
|
306
|
+
return S.value;
|
|
297
307
|
},
|
|
298
308
|
get theme() {
|
|
299
|
-
return
|
|
309
|
+
return Ue.value;
|
|
300
310
|
},
|
|
301
311
|
get locale() {
|
|
302
|
-
return
|
|
312
|
+
return i?.locale ?? "zh-CN";
|
|
303
313
|
},
|
|
304
314
|
get locales() {
|
|
305
|
-
return
|
|
315
|
+
return i?.locales ?? {};
|
|
306
316
|
},
|
|
307
317
|
get localeOverrides() {
|
|
308
|
-
return
|
|
318
|
+
return i?.localeOverrides ?? {};
|
|
319
|
+
},
|
|
320
|
+
get compatClass() {
|
|
321
|
+
return i?.compatClass;
|
|
309
322
|
}
|
|
310
323
|
});
|
|
311
|
-
const
|
|
324
|
+
const Ge = a(() => pl(v.value) ?? Vl), {
|
|
312
325
|
slots: e
|
|
313
|
-
} =
|
|
314
|
-
compatClasses:
|
|
315
|
-
}),
|
|
316
|
-
...
|
|
326
|
+
} = rl("table", Ge, l, {
|
|
327
|
+
compatClasses: hl
|
|
328
|
+
}), H = i?.compatClass === !0 ? (t) => `ant-table-${t}` : void 0, L = a(() => l.locale ?? i?.locale ?? "zh-CN"), de = a(() => ({
|
|
329
|
+
...i?.locales ?? {},
|
|
317
330
|
...l.locales ?? {}
|
|
318
|
-
})),
|
|
319
|
-
const t =
|
|
320
|
-
return
|
|
321
|
-
}),
|
|
322
|
-
function
|
|
323
|
-
|
|
331
|
+
})), Xe = a(() => {
|
|
332
|
+
const t = vl(v.value), o = gl(v.value, L.value), r = de.value[L.value]?.table, u = $($(t, o), r);
|
|
333
|
+
return $(u, $(i?.localeOverrides?.table ?? {}, l.localeOverrides));
|
|
334
|
+
}), X = b(Ye());
|
|
335
|
+
function q() {
|
|
336
|
+
X.value = Ye();
|
|
324
337
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}),
|
|
328
|
-
window.removeEventListener("resize",
|
|
338
|
+
Qt(() => {
|
|
339
|
+
q(), window.addEventListener("resize", q);
|
|
340
|
+
}), el(() => {
|
|
341
|
+
window.removeEventListener("resize", q);
|
|
329
342
|
});
|
|
330
|
-
const
|
|
331
|
-
leafColumns:
|
|
332
|
-
} =
|
|
333
|
-
getSortOrder:
|
|
334
|
-
toggleSortOrder:
|
|
335
|
-
sortData:
|
|
336
|
-
sorterState:
|
|
343
|
+
const se = a(() => $e(l.columns, X.value)), R = a(() => l.sticky === !0 ? {} : typeof l.sticky == "object" ? l.sticky : void 0), {
|
|
344
|
+
leafColumns: W
|
|
345
|
+
} = je(() => se.value), {
|
|
346
|
+
getSortOrder: J,
|
|
347
|
+
toggleSortOrder: qe,
|
|
348
|
+
sortData: Je,
|
|
349
|
+
sorterState: Ze,
|
|
337
350
|
sorterResult: Z,
|
|
338
|
-
sortColumns:
|
|
339
|
-
} =
|
|
340
|
-
columns: () =>
|
|
351
|
+
sortColumns: Qe
|
|
352
|
+
} = Yl({
|
|
353
|
+
columns: () => W.value,
|
|
341
354
|
tableSortDirections: () => l.sortDirections,
|
|
342
355
|
onSorterChange(t) {
|
|
343
|
-
const o =
|
|
344
|
-
s("change",
|
|
356
|
+
const o = Q();
|
|
357
|
+
s("change", k(), t, {
|
|
345
358
|
action: "sort",
|
|
346
|
-
currentDataSource: o
|
|
347
|
-
|
|
359
|
+
currentDataSource: o,
|
|
360
|
+
...ee()
|
|
361
|
+
}), te();
|
|
348
362
|
}
|
|
349
363
|
}), {
|
|
350
|
-
getFilteredValue:
|
|
351
|
-
confirmFilter:
|
|
352
|
-
resetFilter:
|
|
353
|
-
getAllFilters:
|
|
354
|
-
filterData:
|
|
355
|
-
} =
|
|
356
|
-
columns: () =>
|
|
364
|
+
getFilteredValue: et,
|
|
365
|
+
confirmFilter: tt,
|
|
366
|
+
resetFilter: lt,
|
|
367
|
+
getAllFilters: k,
|
|
368
|
+
filterData: ot
|
|
369
|
+
} = $l({
|
|
370
|
+
columns: () => W.value,
|
|
357
371
|
onFilterChange(t) {
|
|
358
|
-
const o =
|
|
372
|
+
const o = Q(), r = c.resetForFilter();
|
|
359
373
|
s("change", t, Z.value, {
|
|
360
374
|
action: "filter",
|
|
361
|
-
currentDataSource: o
|
|
362
|
-
|
|
375
|
+
currentDataSource: o,
|
|
376
|
+
...ee(r)
|
|
377
|
+
}), te();
|
|
363
378
|
}
|
|
364
379
|
});
|
|
365
|
-
function
|
|
380
|
+
function Q() {
|
|
366
381
|
let t = l.dataSource;
|
|
367
|
-
return t =
|
|
382
|
+
return t = ot(t), t = Je(t), t;
|
|
383
|
+
}
|
|
384
|
+
const B = a(() => Q()), c = yl({
|
|
385
|
+
pagination: () => l.pagination,
|
|
386
|
+
data: () => B.value,
|
|
387
|
+
onChange(t) {
|
|
388
|
+
s("change", k(), Z.value, {
|
|
389
|
+
action: "paginate",
|
|
390
|
+
currentDataSource: B.value,
|
|
391
|
+
pagination: t
|
|
392
|
+
}), te();
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
function ee(t) {
|
|
396
|
+
return c.enabled.value ? {
|
|
397
|
+
pagination: t ?? c.state.value
|
|
398
|
+
} : {};
|
|
368
399
|
}
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
400
|
+
const at = a(() => ({
|
|
401
|
+
...il,
|
|
402
|
+
...wl(v.value, L.value)?.pagination,
|
|
403
|
+
...de.value[L.value]?.pagination,
|
|
404
|
+
...i?.localeOverrides?.pagination,
|
|
405
|
+
...c.config.value.locale
|
|
406
|
+
})), ue = b(null);
|
|
407
|
+
function te() {
|
|
408
|
+
(l.scroll?.scrollToFirstRowOnChange ?? c.enabled.value) && ol(() => {
|
|
409
|
+
D.value ? ue.value?.scrollToTop() : E.value && (E.value.scrollTop = 0);
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
function z(t) {
|
|
413
|
+
if (!c.enabled.value || c.state.value.total === 0) return null;
|
|
414
|
+
const r = (c.config.value.position ?? ["bottomRight"]).find((y) => y !== "none" && y.startsWith(t));
|
|
415
|
+
if (!r) return null;
|
|
416
|
+
const u = r.slice(t.length).toLowerCase();
|
|
417
|
+
return n(Cl, {
|
|
418
|
+
key: t,
|
|
419
|
+
config: c.config.value,
|
|
420
|
+
state: c.state.value,
|
|
421
|
+
locale: at.value,
|
|
422
|
+
align: u,
|
|
423
|
+
position: r,
|
|
424
|
+
tableSize: l.size,
|
|
425
|
+
narrow: X.value.has("xs"),
|
|
426
|
+
getPopupContainer: l.getPopupContainer,
|
|
427
|
+
onChange: c.change
|
|
428
|
+
}, d.paginationItem ? {
|
|
429
|
+
paginationItem: d.paginationItem
|
|
430
|
+
} : void 0);
|
|
431
|
+
}
|
|
432
|
+
function N(t, o) {
|
|
433
|
+
const r = Rl(t, o, l.rowKey);
|
|
434
|
+
return l.rowKey === void 0 || typeof l.rowKey == "string" && l.rowKey in t, r;
|
|
373
435
|
}
|
|
374
436
|
const {
|
|
375
|
-
flattenData:
|
|
376
|
-
rowMetaMap:
|
|
377
|
-
isTreeData:
|
|
378
|
-
toggleTreeExpand:
|
|
379
|
-
isTreeExpanded:
|
|
380
|
-
indentSize:
|
|
381
|
-
} =
|
|
382
|
-
data: () =>
|
|
437
|
+
flattenData: ce,
|
|
438
|
+
rowMetaMap: fe,
|
|
439
|
+
isTreeData: le,
|
|
440
|
+
toggleTreeExpand: nt,
|
|
441
|
+
isTreeExpanded: rt,
|
|
442
|
+
indentSize: it
|
|
443
|
+
} = Pl({
|
|
444
|
+
data: () => B.value,
|
|
445
|
+
pageData: () => c.pageData.value,
|
|
446
|
+
preserveStateOnDataChange: () => c.enabled.value,
|
|
383
447
|
childrenColumnName: () => l.childrenColumnName,
|
|
384
448
|
indentSize: () => l.indentSize,
|
|
385
|
-
getRowKey:
|
|
449
|
+
getRowKey: N,
|
|
386
450
|
defaultExpandedRowKeys: () => l.defaultExpandedRowKeys,
|
|
387
451
|
expandedRowKeys: () => l.expandedRowKeys,
|
|
388
452
|
defaultExpandAllRows: () => l.defaultExpandAllRows,
|
|
389
453
|
onExpand: l.onExpand,
|
|
390
454
|
onExpandedRowsChange: l.onExpandedRowsChange
|
|
391
455
|
}), {
|
|
392
|
-
hoverRange:
|
|
393
|
-
setHoverRange:
|
|
394
|
-
clearHoverRange:
|
|
395
|
-
} =
|
|
456
|
+
hoverRange: dt,
|
|
457
|
+
setHoverRange: st,
|
|
458
|
+
clearHoverRange: ut
|
|
459
|
+
} = Wl(100), K = kl({
|
|
396
460
|
enabled: () => l.rowDraggable === !0,
|
|
397
|
-
getRowKey:
|
|
461
|
+
getRowKey: N,
|
|
398
462
|
dataSource: () => l.dataSource,
|
|
399
463
|
childrenColumnName: () => l.childrenColumnName,
|
|
400
464
|
onDrop(t, o) {
|
|
401
465
|
s("rowDragEnd", t, o);
|
|
402
466
|
}
|
|
403
|
-
}),
|
|
404
|
-
isSelected:
|
|
405
|
-
isDisabled:
|
|
406
|
-
getSelectionState:
|
|
407
|
-
toggleRow:
|
|
408
|
-
toggleAll:
|
|
409
|
-
allCheckedState:
|
|
410
|
-
invertSelection:
|
|
411
|
-
clearSelection:
|
|
412
|
-
getChangeableRowKeys:
|
|
413
|
-
} =
|
|
467
|
+
}), w = a(() => le.value ? ce.value.map((t) => t.record) : c.pageData.value), {
|
|
468
|
+
isSelected: ct,
|
|
469
|
+
isDisabled: ft,
|
|
470
|
+
getSelectionState: mt,
|
|
471
|
+
toggleRow: pt,
|
|
472
|
+
toggleAll: vt,
|
|
473
|
+
allCheckedState: gt,
|
|
474
|
+
invertSelection: wt,
|
|
475
|
+
clearSelection: ht,
|
|
476
|
+
getChangeableRowKeys: yt
|
|
477
|
+
} = Ul({
|
|
414
478
|
rowSelection: () => l.rowSelection,
|
|
415
|
-
getRowKey:
|
|
416
|
-
data: () =>
|
|
417
|
-
visibleData: () =>
|
|
479
|
+
getRowKey: N,
|
|
480
|
+
data: () => B.value,
|
|
481
|
+
visibleData: () => w.value,
|
|
482
|
+
paginate: () => c.enabled.value,
|
|
418
483
|
childrenColumnName: () => l.childrenColumnName,
|
|
419
484
|
onSelectionChange() {
|
|
420
|
-
s("change",
|
|
485
|
+
s("change", k(), Z.value, {
|
|
421
486
|
action: "select",
|
|
422
|
-
currentDataSource:
|
|
487
|
+
currentDataSource: w.value,
|
|
488
|
+
...ee()
|
|
423
489
|
});
|
|
424
490
|
}
|
|
425
491
|
}), {
|
|
426
|
-
isExpanded:
|
|
427
|
-
toggleExpand:
|
|
428
|
-
} =
|
|
492
|
+
isExpanded: Ct,
|
|
493
|
+
toggleExpand: bt
|
|
494
|
+
} = Nl({
|
|
429
495
|
expandable: () => l.expandable,
|
|
430
|
-
getRowKey:
|
|
431
|
-
data: () =>
|
|
432
|
-
|
|
496
|
+
getRowKey: N,
|
|
497
|
+
data: () => c.enabled.value ? B.value : w.value,
|
|
498
|
+
childrenColumnName: () => l.childrenColumnName,
|
|
499
|
+
initializeNewRows: () => c.enabled.value
|
|
500
|
+
}), me = (t) => {
|
|
433
501
|
const o = l.expandable;
|
|
434
502
|
return o ? o.rowExpandable ? o.rowExpandable(t) : !!o.expandedRowRender : !1;
|
|
435
|
-
},
|
|
436
|
-
|
|
437
|
-
},
|
|
438
|
-
const t = l.expandable, o = l.rowSelection,
|
|
439
|
-
key:
|
|
503
|
+
}, xt = (t, o) => {
|
|
504
|
+
me(t) && bt(t, o);
|
|
505
|
+
}, pe = "__vtg_selection__", ve = "__vtg_expand__", St = a(() => {
|
|
506
|
+
const t = l.expandable, o = l.rowSelection, r = t && t.showExpandColumn !== !1 ? {
|
|
507
|
+
key: ve,
|
|
440
508
|
title: "",
|
|
441
509
|
width: t.columnWidth ?? 48,
|
|
442
510
|
align: "center",
|
|
443
511
|
fixed: t.fixed === !0 ? "left" : t.fixed
|
|
444
512
|
} : null, u = o ? {
|
|
445
|
-
key:
|
|
513
|
+
key: pe,
|
|
446
514
|
title: "",
|
|
447
515
|
width: o.columnWidth ?? 48,
|
|
448
516
|
align: "center",
|
|
449
517
|
fixed: o.fixed === !0 ? "left" : o.fixed || void 0
|
|
450
|
-
} : null,
|
|
451
|
-
let
|
|
452
|
-
for (const
|
|
453
|
-
if (
|
|
454
|
-
|
|
518
|
+
} : null, y = bl(se.value), h = [];
|
|
519
|
+
let p = !1, m = !1;
|
|
520
|
+
for (const P of y) {
|
|
521
|
+
if (P === Kl) {
|
|
522
|
+
r && !p && (h.push(r), p = !0);
|
|
455
523
|
continue;
|
|
456
524
|
}
|
|
457
|
-
if (
|
|
458
|
-
u && !
|
|
525
|
+
if (P === _l) {
|
|
526
|
+
u && !m && (h.push(u), m = !0);
|
|
459
527
|
continue;
|
|
460
528
|
}
|
|
461
|
-
|
|
529
|
+
h.push(P);
|
|
462
530
|
}
|
|
463
|
-
return
|
|
531
|
+
return r && !p && h.unshift(r), u && !m && h.unshift(u), xl(h, l.columnOrder, [pe, ve]);
|
|
464
532
|
}), {
|
|
465
533
|
leafColumns: f,
|
|
466
|
-
headerRows:
|
|
467
|
-
} =
|
|
468
|
-
columnWidths:
|
|
469
|
-
startResize:
|
|
470
|
-
isResizing:
|
|
471
|
-
} =
|
|
534
|
+
headerRows: oe
|
|
535
|
+
} = je(() => St.value), Dt = a(() => oe.value.length > 1), {
|
|
536
|
+
columnWidths: _,
|
|
537
|
+
startResize: Rt,
|
|
538
|
+
isResizing: Et
|
|
539
|
+
} = Fl({
|
|
540
|
+
columns: () => f.value,
|
|
472
541
|
onResizeColumn(t, o) {
|
|
473
542
|
s("resizeColumn", t, o);
|
|
474
543
|
}
|
|
475
544
|
}), {
|
|
476
|
-
headerWrapRef:
|
|
477
|
-
bodyWrapRef:
|
|
478
|
-
scrollState:
|
|
479
|
-
handleBodyScroll:
|
|
480
|
-
fixedOffsets:
|
|
481
|
-
syncHorizontalScroll:
|
|
482
|
-
|
|
545
|
+
headerWrapRef: M,
|
|
546
|
+
bodyWrapRef: E,
|
|
547
|
+
scrollState: ge,
|
|
548
|
+
handleBodyScroll: we,
|
|
549
|
+
fixedOffsets: he,
|
|
550
|
+
syncHorizontalScroll: It,
|
|
551
|
+
updateScrollState: Tt
|
|
552
|
+
} = Il({
|
|
483
553
|
displayColumns: () => f.value,
|
|
484
|
-
columnWidths:
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
554
|
+
columnWidths: _,
|
|
555
|
+
layoutWidths: () => C.metrics.value?.widths,
|
|
556
|
+
syncElements: () => V.value ? [V.value] : []
|
|
557
|
+
}), ye = a(() => Dl({
|
|
558
|
+
compatClass: H,
|
|
559
|
+
fixedOffsets: he,
|
|
560
|
+
scrollState: ge,
|
|
561
|
+
empty: w.value.length === 0,
|
|
490
562
|
fixedHeader: l.scroll?.y !== void 0,
|
|
491
|
-
fixedColumn:
|
|
492
|
-
horizontalScroll:
|
|
493
|
-
layoutFixed:
|
|
494
|
-
})),
|
|
495
|
-
if (
|
|
563
|
+
fixedColumn: xe.value && be.value,
|
|
564
|
+
horizontalScroll: xe.value,
|
|
565
|
+
layoutFixed: j.value === "fixed"
|
|
566
|
+
})), F = a(() => l.scroll?.y === "auto"), Ce = a(() => F.value || (l.showHeader !== !1 || f.value.some((t) => El(t.minWidth) !== void 0)) && !!l.scroll?.y || l.showHeader !== !1 && !!l.sticky), be = a(() => f.value.some((t) => t.fixed === "left" || t.fixed === "right")), xe = a(() => l.scroll?.x !== void 0 || C.overflow.value || !!l.expandable?.fixed), Ht = a(() => W.value.some((t) => Sl(t).enabled)), j = a(() => l.tableLayout ? l.tableLayout : l.scroll?.y || l.scroll?.x || be.value || Ht.value ? "fixed" : "auto"), Lt = a(() => {
|
|
567
|
+
if (R.value)
|
|
496
568
|
return {
|
|
497
569
|
position: "sticky",
|
|
498
|
-
top: `${
|
|
570
|
+
top: `${R.value.offsetHeader ?? 0}px`,
|
|
499
571
|
zIndex: "4"
|
|
500
572
|
};
|
|
501
|
-
}),
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
573
|
+
}), Se = b(null), V = b(null), O = b(null), C = Ll({
|
|
574
|
+
columns: () => f.value,
|
|
575
|
+
columnWidths: _,
|
|
576
|
+
layout: () => j.value,
|
|
577
|
+
split: () => Ce.value,
|
|
578
|
+
root: () => O.value,
|
|
579
|
+
viewport: () => O.value?.contains(E.value) ? E.value : M.value ?? O.value,
|
|
580
|
+
scrollX: () => l.scroll?.x,
|
|
581
|
+
onMeasure: () => {
|
|
582
|
+
D.value || Tt();
|
|
583
|
+
}
|
|
584
|
+
}), {
|
|
585
|
+
bodyHeight: De
|
|
586
|
+
} = Tl({
|
|
587
|
+
enabled: () => F.value,
|
|
588
|
+
wrapperEl: () => Se.value,
|
|
589
|
+
headerEl: () => M.value,
|
|
590
|
+
summaryEl: () => V.value,
|
|
591
|
+
hasData: () => w.value.length > 0
|
|
592
|
+
}), Bt = a(() => {
|
|
510
593
|
const t = l.scroll?.y;
|
|
511
594
|
if (t !== void 0)
|
|
512
|
-
return
|
|
595
|
+
return F.value ? De.value : typeof t == "number" ? Number.isFinite(t) && t > 0 ? t : void 0 : t;
|
|
513
596
|
}), {
|
|
514
|
-
enabled:
|
|
515
|
-
itemHeight:
|
|
516
|
-
listHeight:
|
|
517
|
-
fixedHeight:
|
|
518
|
-
resolvedScrollY:
|
|
519
|
-
} =
|
|
597
|
+
enabled: D,
|
|
598
|
+
itemHeight: Nt,
|
|
599
|
+
listHeight: Ft,
|
|
600
|
+
fixedHeight: Ot,
|
|
601
|
+
resolvedScrollY: At
|
|
602
|
+
} = Ol({
|
|
520
603
|
virtual: () => l.virtual,
|
|
521
604
|
scrollY: () => l.scroll?.y,
|
|
522
605
|
size: () => l.size,
|
|
523
606
|
rowHeight: () => l.rowHeight,
|
|
524
|
-
measuredHeight: () =>
|
|
525
|
-
}),
|
|
607
|
+
measuredHeight: () => De.value
|
|
608
|
+
}), Re = a(() => W.value.some((t) => !!t.customCell || !!t.customRender)), ae = a(() => !Dt.value || l.bordered ? {
|
|
526
609
|
table: "",
|
|
527
610
|
th: "",
|
|
528
611
|
td: ""
|
|
@@ -530,72 +613,75 @@ const wo = /* @__PURE__ */ zt({
|
|
|
530
613
|
table: e.groupedHeaderTable(),
|
|
531
614
|
th: e.groupedHeaderTh(),
|
|
532
615
|
td: e.groupedHeaderTd()
|
|
533
|
-
}),
|
|
534
|
-
|
|
616
|
+
}), A = a(() => x(e.table(), ae.value.table) ?? ""), Ee = a(() => C.enabled.value ? e.widthLayoutCell() : void 0), Ie = a(() => x(e.th(), ae.value.th, Ee.value) ?? ""), ne = a(() => x(e.td(), ae.value.td, Ee.value) ?? "");
|
|
617
|
+
I([D, Re], ([t, o]) => {
|
|
535
618
|
}, {
|
|
536
619
|
immediate: !0
|
|
537
|
-
}),
|
|
620
|
+
}), I([() => l.virtual, At], ([t, o]) => {
|
|
538
621
|
if (!t) return;
|
|
539
|
-
const
|
|
540
|
-
o.kind === "compat-px" ?
|
|
622
|
+
const r = String(l.scroll?.y);
|
|
623
|
+
o.kind === "compat-px" ? nl("vtable-scroll-y-compat-px", `[VTable] virtual 模式下字符串 scroll.y(${r})按 ${o.value}px 解析,这是兼容行为;请改用数字或 'auto'。`) : o.kind === "invalid-string" || o.kind === "invalid-number" && l.scroll?.y && `${Al}`;
|
|
541
624
|
}, {
|
|
542
625
|
immediate: !0
|
|
543
626
|
});
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
t && (
|
|
547
|
-
}),
|
|
548
|
-
t && (
|
|
627
|
+
const Te = b(null), He = b(null);
|
|
628
|
+
I(() => Te.value?.wrapRef, (t) => {
|
|
629
|
+
t && (E.value = t);
|
|
630
|
+
}), I(() => He.value?.wrapRef, (t) => {
|
|
631
|
+
t && (E.value = t);
|
|
549
632
|
});
|
|
550
|
-
const
|
|
551
|
-
|
|
633
|
+
const Pt = a(() => Bl(f.value)), Le = a(() => l.virtualColumn ? D.value ? Re.value ? "列上有 customCell / customRender,可能返回 colSpan / rowSpan;单元格合并会让某个 td 缺席,进而破坏列宽不变量(虚拟模式本就不支持合并)" : Pt.value.contiguous ? null : "固定列必须分列两端:左固定连成前缀、右固定连成后缀,中间夹着的固定列会被窗口跳过" : "它只作用于虚拟表体,需要同时开启 virtual 与 scroll.y" : null), re = a(() => l.virtualColumn && Le.value === null);
|
|
634
|
+
I(Le, (t) => {
|
|
552
635
|
}, {
|
|
553
636
|
immediate: !0
|
|
554
637
|
});
|
|
555
638
|
const {
|
|
556
|
-
metrics:
|
|
557
|
-
} =
|
|
558
|
-
enabled: () =>
|
|
559
|
-
headerEl: () =>
|
|
639
|
+
metrics: Wt
|
|
640
|
+
} = Hl({
|
|
641
|
+
enabled: () => re.value && !C.enabled.value,
|
|
642
|
+
headerEl: () => M.value,
|
|
560
643
|
columns: () => f.value,
|
|
561
|
-
columnWidths:
|
|
644
|
+
columnWidths: _,
|
|
562
645
|
hasHeader: () => l.showHeader !== !1
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
!t || o || l.showHeader;
|
|
646
|
+
}), Be = a(() => C.metrics.value ?? Wt.value);
|
|
647
|
+
I([re, Be], ([t, o]) => {
|
|
648
|
+
!t || o || l.showHeader !== !1 || C.enabled.value;
|
|
566
649
|
}, {
|
|
567
650
|
immediate: !0
|
|
568
651
|
});
|
|
569
|
-
function
|
|
570
|
-
return
|
|
652
|
+
function kt(t) {
|
|
653
|
+
return le.value ? fe.value.get(t)?.level ?? 0 : 0;
|
|
571
654
|
}
|
|
572
|
-
function
|
|
573
|
-
return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(t, o,
|
|
655
|
+
function zt(t, o) {
|
|
656
|
+
return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(t, o, kt(t)) : l.rowClassName : "";
|
|
574
657
|
}
|
|
575
|
-
function
|
|
658
|
+
function Kt(t, o) {
|
|
576
659
|
return l.customRow?.(t, o);
|
|
577
660
|
}
|
|
578
|
-
function
|
|
661
|
+
function _t(t, o) {
|
|
579
662
|
return l.customHeaderRow?.(t, o);
|
|
580
663
|
}
|
|
581
|
-
function
|
|
664
|
+
function Mt(t) {
|
|
582
665
|
if (typeof t.title != "function")
|
|
583
666
|
return t.title ?? "";
|
|
584
|
-
const o = t,
|
|
667
|
+
const o = t, r = Qe.value.filter((u) => !!u.column);
|
|
585
668
|
return t.title({
|
|
586
|
-
sortOrder: o.sorter ?
|
|
587
|
-
sortColumn:
|
|
588
|
-
sortColumns:
|
|
589
|
-
filters:
|
|
669
|
+
sortOrder: o.sorter ? J(o) ?? void 0 : void 0,
|
|
670
|
+
sortColumn: Ze.value.column,
|
|
671
|
+
sortColumns: r.length > 0 ? r : void 0,
|
|
672
|
+
filters: k()
|
|
590
673
|
});
|
|
591
674
|
}
|
|
592
|
-
function
|
|
593
|
-
return !!(t.sorter &&
|
|
675
|
+
function jt(t) {
|
|
676
|
+
return !!(t.sorter && J(t));
|
|
594
677
|
}
|
|
595
|
-
const
|
|
678
|
+
const Ne = {
|
|
596
679
|
width: "100%",
|
|
597
680
|
minWidth: "100%"
|
|
598
|
-
},
|
|
681
|
+
}, Vt = {
|
|
682
|
+
widthConstraintCell: e.widthConstraintCell,
|
|
683
|
+
widthConstraintInner: e.widthConstraintInner,
|
|
684
|
+
widthLayoutCell: e.widthLayoutCell,
|
|
599
685
|
thSortable: e.thSortable,
|
|
600
686
|
thSorted: e.thSorted,
|
|
601
687
|
tdSorted: e.tdSorted,
|
|
@@ -675,232 +761,240 @@ const wo = /* @__PURE__ */ zt({
|
|
|
675
761
|
trDragging: e.trDragging,
|
|
676
762
|
trDropAbove: e.trDropAbove,
|
|
677
763
|
trDropBelow: e.trDropBelow
|
|
678
|
-
},
|
|
679
|
-
return
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
764
|
+
}, Fe = a(() => Ml(v.value)), Oe = b(!1);
|
|
765
|
+
return We(zl, {
|
|
766
|
+
columnLayout: C,
|
|
767
|
+
bodyCell: d.bodyCell,
|
|
768
|
+
headerCell: d.headerCell,
|
|
769
|
+
empty: d.empty,
|
|
770
|
+
getSortOrder: J,
|
|
771
|
+
toggleSortOrder: qe,
|
|
772
|
+
isColumnSorted: jt,
|
|
773
|
+
getFilteredValue: et,
|
|
774
|
+
confirmFilter: tt,
|
|
775
|
+
resetFilter: lt,
|
|
776
|
+
customFilterDropdown: d.customFilterDropdown,
|
|
777
|
+
customFilterIcon: d.customFilterIcon,
|
|
778
|
+
showSorterTooltip: a(() => l.showSorterTooltip ?? Fe.value.showSorterTooltip),
|
|
692
779
|
headerEllipsis: a(() => l.headerEllipsis),
|
|
693
|
-
subThemeSlots:
|
|
694
|
-
presetConfig:
|
|
695
|
-
themePreset:
|
|
696
|
-
cssMode:
|
|
697
|
-
classPrefix:
|
|
698
|
-
vtgClass: (t) =>
|
|
699
|
-
compatClass:
|
|
700
|
-
localeName:
|
|
701
|
-
locale:
|
|
780
|
+
subThemeSlots: Vt,
|
|
781
|
+
presetConfig: Fe,
|
|
782
|
+
themePreset: v,
|
|
783
|
+
cssMode: g,
|
|
784
|
+
classPrefix: S,
|
|
785
|
+
vtgClass: (t) => Y(t, g.value, S.value),
|
|
786
|
+
compatClass: H,
|
|
787
|
+
localeName: L,
|
|
788
|
+
locale: Xe,
|
|
702
789
|
rowSelection: () => l.rowSelection,
|
|
703
|
-
isSelected:
|
|
704
|
-
isDisabledRow:
|
|
705
|
-
getSelectionState:
|
|
706
|
-
toggleRow:
|
|
707
|
-
toggleAll:
|
|
708
|
-
allCheckedState: () =>
|
|
709
|
-
getRowKey:
|
|
710
|
-
invertSelection:
|
|
711
|
-
clearSelection:
|
|
712
|
-
getChangeableRowKeys:
|
|
713
|
-
fixedOffsets:
|
|
714
|
-
scrollState:
|
|
790
|
+
isSelected: ct,
|
|
791
|
+
isDisabledRow: ft,
|
|
792
|
+
getSelectionState: mt,
|
|
793
|
+
toggleRow: pt,
|
|
794
|
+
toggleAll: vt,
|
|
795
|
+
allCheckedState: () => gt.value,
|
|
796
|
+
getRowKey: N,
|
|
797
|
+
invertSelection: wt,
|
|
798
|
+
clearSelection: ht,
|
|
799
|
+
getChangeableRowKeys: yt,
|
|
800
|
+
fixedOffsets: he,
|
|
801
|
+
scrollState: ge,
|
|
715
802
|
leafColumnCount: a(() => f.value.length),
|
|
716
803
|
bordered: a(() => l.bordered),
|
|
717
|
-
tableLayout:
|
|
804
|
+
tableLayout: j,
|
|
718
805
|
sticky: a(() => l.sticky),
|
|
719
|
-
getRowProps:
|
|
720
|
-
getRowClassName:
|
|
721
|
-
getHeaderRowProps:
|
|
722
|
-
getColumnTitle:
|
|
806
|
+
getRowProps: Kt,
|
|
807
|
+
getRowClassName: zt,
|
|
808
|
+
getHeaderRowProps: _t,
|
|
809
|
+
getColumnTitle: Mt,
|
|
723
810
|
getPopupContainer: l.getPopupContainer,
|
|
724
811
|
transformCellText: l.transformCellText,
|
|
725
812
|
expandable: () => l.expandable,
|
|
726
|
-
isExpanded:
|
|
727
|
-
toggleExpand:
|
|
728
|
-
isRowExpandable:
|
|
729
|
-
columnWidths:
|
|
730
|
-
startResize:
|
|
731
|
-
isResizing: () =>
|
|
813
|
+
isExpanded: Ct,
|
|
814
|
+
toggleExpand: xt,
|
|
815
|
+
isRowExpandable: me,
|
|
816
|
+
columnWidths: _,
|
|
817
|
+
startResize: Rt,
|
|
818
|
+
isResizing: () => Et.value,
|
|
732
819
|
displayColumns: a(() => f.value),
|
|
733
820
|
registerSummaryFixed: (t) => {
|
|
734
|
-
|
|
821
|
+
Oe.value = t;
|
|
735
822
|
},
|
|
736
|
-
isTreeData:
|
|
737
|
-
treeFlattenData:
|
|
738
|
-
getFlattenRow: (t) =>
|
|
739
|
-
toggleTreeExpand:
|
|
740
|
-
isTreeExpanded:
|
|
741
|
-
treeIndentSize:
|
|
742
|
-
hoverRange:
|
|
743
|
-
setHoverRange:
|
|
744
|
-
clearHoverRange:
|
|
823
|
+
isTreeData: le,
|
|
824
|
+
treeFlattenData: ce,
|
|
825
|
+
getFlattenRow: (t) => fe.value.get(t),
|
|
826
|
+
toggleTreeExpand: nt,
|
|
827
|
+
isTreeExpanded: rt,
|
|
828
|
+
treeIndentSize: it,
|
|
829
|
+
hoverRange: dt,
|
|
830
|
+
setHoverRange: st,
|
|
831
|
+
clearHoverRange: ut,
|
|
745
832
|
// 拖拽期间抑制 hover 高亮,避免干扰拖放指示线
|
|
746
|
-
hoverable: a(() => l.hoverable !== !1 &&
|
|
833
|
+
hoverable: a(() => l.hoverable !== !1 && K.draggingKey.value === null),
|
|
747
834
|
rowDrag: {
|
|
748
835
|
enabled: a(() => l.rowDraggable === !0),
|
|
749
|
-
draggingKey:
|
|
750
|
-
dropTarget:
|
|
751
|
-
getBindings: (t, o,
|
|
836
|
+
draggingKey: K.draggingKey,
|
|
837
|
+
dropTarget: K.dropTarget,
|
|
838
|
+
getBindings: (t, o, r) => K.getBindings(t, o, r)
|
|
752
839
|
}
|
|
753
840
|
}), () => {
|
|
754
841
|
let t;
|
|
755
|
-
const o = l.title ? l.title(
|
|
756
|
-
data:
|
|
757
|
-
}) : null,
|
|
758
|
-
data:
|
|
759
|
-
}) : null, u =
|
|
760
|
-
tableLayout:
|
|
842
|
+
const o = l.title ? l.title(w.value) : d.title ? d.title({
|
|
843
|
+
data: w.value
|
|
844
|
+
}) : null, r = l.footer ? l.footer(w.value) : d.footer ? d.footer({
|
|
845
|
+
data: w.value
|
|
846
|
+
}) : null, u = d.summary ? d.summary() : null, y = Oe.value !== !1, h = l.scroll, p = {
|
|
847
|
+
tableLayout: j.value
|
|
761
848
|
};
|
|
762
|
-
|
|
763
|
-
const
|
|
849
|
+
h?.x ? (p.width = typeof h.x == "number" ? `${h.x}px` : h.x, p.minWidth = "100%") : p.width = "100%", Object.assign(p, C.tableStyle.value);
|
|
850
|
+
const m = l.loading, P = m === !0 || typeof m == "object" && m !== null && m.spinning !== !1, Yt = typeof m == "object" && m !== null ? m.indicator : void 0, $t = typeof m == "object" && m !== null ? m.tip : void 0, Ae = P && (d.loading ? n(Me, {
|
|
764
851
|
loadingClass: e.loading()
|
|
765
|
-
},
|
|
852
|
+
}, Ve(t = d.loading()) ? t : {
|
|
766
853
|
default: () => [t]
|
|
767
|
-
}) : n(
|
|
854
|
+
}) : n(Me, {
|
|
768
855
|
loadingClass: e.loading(),
|
|
769
|
-
indicator:
|
|
770
|
-
tip:
|
|
856
|
+
indicator: Yt,
|
|
857
|
+
tip: $t
|
|
771
858
|
}, null));
|
|
772
|
-
if (
|
|
773
|
-
const
|
|
774
|
-
ref:
|
|
775
|
-
class:
|
|
776
|
-
style:
|
|
859
|
+
if (Ce.value) {
|
|
860
|
+
const Ut = l.showHeader !== !1 ? n("div", {
|
|
861
|
+
ref: M,
|
|
862
|
+
class: x(e.headerWrapper(), R.value && H?.("sticky-holder")),
|
|
863
|
+
style: Lt.value
|
|
777
864
|
}, [n("div", {
|
|
778
|
-
class:
|
|
865
|
+
class: Y("block w-full min-w-full", g.value, S.value)
|
|
779
866
|
}, [n("table", {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
867
|
+
"data-vtg-table": "",
|
|
868
|
+
class: A.value,
|
|
869
|
+
style: p
|
|
870
|
+
}, [n(U, {
|
|
783
871
|
columns: f.value
|
|
784
|
-
}, null), n(
|
|
785
|
-
rows:
|
|
872
|
+
}, null), n(G, null, null), n(Ke, {
|
|
873
|
+
rows: oe.value,
|
|
786
874
|
theadClass: e.thead(),
|
|
787
875
|
rowClass: e.tr(),
|
|
788
|
-
thClass:
|
|
876
|
+
thClass: Ie.value,
|
|
789
877
|
headerCellInnerClass: e.headerCellInner()
|
|
790
|
-
}, null)])])]) : null,
|
|
791
|
-
|
|
878
|
+
}, null)])])]) : null, Gt = D.value ? n(jl, {
|
|
879
|
+
ref: ue,
|
|
880
|
+
dataSource: w.value,
|
|
792
881
|
columns: f.value,
|
|
793
882
|
tbodyClass: e.tbody(),
|
|
794
883
|
rowClass: e.tr(),
|
|
795
|
-
tdClass:
|
|
884
|
+
tdClass: ne.value,
|
|
796
885
|
emptyClass: e.empty(),
|
|
797
886
|
bodyCellEllipsisClass: e.bodyCellEllipsis(),
|
|
798
|
-
tableClass:
|
|
799
|
-
tableStyle:
|
|
887
|
+
tableClass: A.value,
|
|
888
|
+
tableStyle: p,
|
|
800
889
|
rowKey: l.rowKey,
|
|
801
|
-
height:
|
|
802
|
-
itemHeight:
|
|
803
|
-
fixedHeight:
|
|
804
|
-
virtualColumn:
|
|
805
|
-
columnMetrics:
|
|
890
|
+
height: Ft.value,
|
|
891
|
+
itemHeight: Nt.value,
|
|
892
|
+
fixedHeight: Ot.value,
|
|
893
|
+
virtualColumn: re.value,
|
|
894
|
+
columnMetrics: Be.value,
|
|
806
895
|
showScrollBar: "hover",
|
|
807
|
-
onVirtualScroll: (
|
|
808
|
-
|
|
896
|
+
onVirtualScroll: (Pe) => {
|
|
897
|
+
It(Pe.x, Pe.maxX);
|
|
809
898
|
}
|
|
810
|
-
}, null) : null,
|
|
811
|
-
ref:
|
|
812
|
-
maxHeight:
|
|
899
|
+
}, null) : null, Xt = D.value ? null : n(ke, {
|
|
900
|
+
ref: Te,
|
|
901
|
+
maxHeight: Bt.value,
|
|
813
902
|
wrapClass: e.bodyWrapper(),
|
|
814
|
-
viewStyle:
|
|
815
|
-
onScroll:
|
|
903
|
+
viewStyle: Ne,
|
|
904
|
+
onScroll: we
|
|
816
905
|
}, {
|
|
817
906
|
default: () => [n("table", {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
907
|
+
"data-vtg-table": "",
|
|
908
|
+
class: A.value,
|
|
909
|
+
style: p
|
|
910
|
+
}, [n(U, {
|
|
821
911
|
columns: f.value
|
|
822
|
-
}, null), n(
|
|
823
|
-
dataSource:
|
|
912
|
+
}, null), n(G, null, null), n(_e, {
|
|
913
|
+
dataSource: w.value,
|
|
824
914
|
columns: f.value,
|
|
825
915
|
tbodyClass: e.tbody(),
|
|
826
916
|
rowClass: e.tr(),
|
|
827
|
-
tdClass:
|
|
917
|
+
tdClass: ne.value,
|
|
828
918
|
emptyClass: e.empty(),
|
|
829
919
|
bodyCellEllipsisClass: e.bodyCellEllipsis(),
|
|
830
920
|
rowKey: l.rowKey
|
|
831
|
-
}, null), u && !
|
|
921
|
+
}, null), u && !y && n("tfoot", {
|
|
832
922
|
class: e.summary()
|
|
833
923
|
}, [u])])]
|
|
834
|
-
}),
|
|
835
|
-
ref:
|
|
836
|
-
class:
|
|
837
|
-
style:
|
|
924
|
+
}), qt = u && (y || D.value) ? n("div", {
|
|
925
|
+
ref: V,
|
|
926
|
+
class: x(e.headerWrapper(), H?.("summary"), R.value && y && H?.("sticky-holder")),
|
|
927
|
+
style: y ? {
|
|
838
928
|
position: "sticky",
|
|
839
|
-
bottom: `${
|
|
929
|
+
bottom: `${R.value?.offsetSummary ?? 0}px`,
|
|
840
930
|
zIndex: "4",
|
|
841
931
|
overflow: "hidden"
|
|
842
932
|
} : void 0
|
|
843
933
|
}, [n("div", {
|
|
844
|
-
class:
|
|
934
|
+
class: Y("block w-full min-w-full", g.value, S.value)
|
|
845
935
|
}, [n("table", {
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
936
|
+
"data-vtg-table": "",
|
|
937
|
+
class: A.value,
|
|
938
|
+
style: p
|
|
939
|
+
}, [n(U, {
|
|
849
940
|
columns: f.value
|
|
850
|
-
}, null), n("tfoot", {
|
|
941
|
+
}, null), n(G, null, null), n("tfoot", {
|
|
851
942
|
class: e.summary()
|
|
852
943
|
}, [u])])])]) : null;
|
|
853
944
|
return n("div", {
|
|
854
|
-
|
|
855
|
-
|
|
945
|
+
ref: O,
|
|
946
|
+
class: x(e.root(), F.value && e.rootAutoHeight(), ye.value)
|
|
947
|
+
}, [z("top"), o && n("div", {
|
|
856
948
|
class: e.title()
|
|
857
949
|
}, [o]), n("div", {
|
|
858
|
-
ref:
|
|
859
|
-
class:
|
|
860
|
-
}, [
|
|
950
|
+
ref: Se,
|
|
951
|
+
class: x(e.wrapper(), F.value && e.wrapperAutoHeight(), R.value && Y("overflow-clip", g.value, S.value))
|
|
952
|
+
}, [Ut, Gt, Xt, qt, Ae]), r && n("div", {
|
|
861
953
|
class: e.footer()
|
|
862
|
-
}, [
|
|
954
|
+
}, [r]), z("bottom")]);
|
|
863
955
|
}
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
956
|
+
const ie = n(tl, null, [n("table", {
|
|
957
|
+
"data-vtg-table": "",
|
|
958
|
+
class: A.value,
|
|
959
|
+
style: p
|
|
960
|
+
}, [n(U, {
|
|
868
961
|
columns: f.value
|
|
869
|
-
}, null), l.showHeader !== !1 && n(
|
|
870
|
-
rows:
|
|
962
|
+
}, null), n(G, null, null), l.showHeader !== !1 && n(Ke, {
|
|
963
|
+
rows: oe.value,
|
|
871
964
|
theadClass: e.thead(),
|
|
872
965
|
rowClass: e.tr(),
|
|
873
|
-
thClass:
|
|
966
|
+
thClass: Ie.value,
|
|
874
967
|
headerCellInnerClass: e.headerCellInner()
|
|
875
|
-
}, null), n(
|
|
876
|
-
dataSource:
|
|
968
|
+
}, null), n(_e, {
|
|
969
|
+
dataSource: w.value,
|
|
877
970
|
columns: f.value,
|
|
878
971
|
tbodyClass: e.tbody(),
|
|
879
972
|
rowClass: e.tr(),
|
|
880
|
-
tdClass:
|
|
973
|
+
tdClass: ne.value,
|
|
881
974
|
emptyClass: e.empty(),
|
|
882
975
|
bodyCellEllipsisClass: e.bodyCellEllipsis(),
|
|
883
976
|
rowKey: l.rowKey
|
|
884
977
|
}, null), u && n("tfoot", {
|
|
885
978
|
class: e.summary()
|
|
886
|
-
}, [u])]),
|
|
979
|
+
}, [u])]), Ae]);
|
|
887
980
|
return n("div", {
|
|
888
|
-
|
|
889
|
-
|
|
981
|
+
ref: O,
|
|
982
|
+
class: x(e.root(), ye.value)
|
|
983
|
+
}, [z("top"), o && n("div", {
|
|
890
984
|
class: e.title()
|
|
891
|
-
}, [o]), n(
|
|
892
|
-
ref:
|
|
985
|
+
}, [o]), n(ke, {
|
|
986
|
+
ref: He,
|
|
893
987
|
wrapClass: e.wrapper(),
|
|
894
|
-
viewStyle:
|
|
895
|
-
onScroll:
|
|
896
|
-
},
|
|
897
|
-
default: () => [
|
|
898
|
-
}),
|
|
988
|
+
viewStyle: Ne,
|
|
989
|
+
onScroll: we
|
|
990
|
+
}, Ve(ie) ? ie : {
|
|
991
|
+
default: () => [ie]
|
|
992
|
+
}), r && n("div", {
|
|
899
993
|
class: e.footer()
|
|
900
|
-
}, [
|
|
994
|
+
}, [r]), z("bottom")]);
|
|
901
995
|
};
|
|
902
996
|
}
|
|
903
997
|
});
|
|
904
998
|
export {
|
|
905
|
-
|
|
999
|
+
_o as default
|
|
906
1000
|
};
|