@vtable-guild/vtable-guild 2.9.0-alpha.2 → 2.9.0-alpha.4
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/style.css +14 -0
- package/css/tailwind3-utilities.css +14 -0
- package/dist/css/style.css +14 -0
- package/dist/css/tailwind3-utilities.css +14 -0
- package/dist/index.full.mjs +2967 -2871
- package/dist/index.mjs +139 -125
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +488 -466
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +277 -263
- package/dist/table/src/components/VTableDynamicSlots.test.d.ts +2 -0
- package/dist/table/src/components/VTableDynamicSlots.test.d.ts.map +1 -0
- package/dist/table/src/components/VTableHeaderAlignment.test.d.ts +2 -0
- package/dist/table/src/components/VTableHeaderAlignment.test.d.ts.map +1 -0
- package/dist/table/src/composables/useHeaderTitleBalance.d.ts +7 -0
- package/dist/table/src/composables/useHeaderTitleBalance.d.ts.map +1 -0
- package/dist/table/src/composables/useHeaderTitleBalance.mjs +50 -0
- package/dist/table/src/composables/useHeaderTitleBalance.test.d.ts +2 -0
- package/dist/table/src/composables/useHeaderTitleBalance.test.d.ts.map +1 -0
- package/dist/table/src/context.d.ts +2 -2
- package/dist/table/src/preset-config.d.ts +2 -0
- package/dist/table/src/preset-config.d.ts.map +1 -1
- package/dist/table/src/preset-config.mjs +12 -10
- package/dist/theme/src/presets/antdv/table.d.ts +3 -3
- package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
- package/dist/theme/src/presets/antdv/table.mjs +6 -3
- package/dist/theme/src/presets/element-plus/table.d.ts +3 -3
- package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
- package/dist/theme/src/presets/element-plus/table.mjs +6 -3
- package/dist/vtable-guild/src/index.d.ts +1 -0
- package/dist/vtable-guild/src/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isManual as
|
|
1
|
+
import { defineComponent as sl, ref as D, watch as L, onBeforeUnmount as he, computed as n, inject as cl, provide as Xe, onMounted as qe, shallowReactive as fl, onBeforeUpdate as ml, createVNode as r, Fragment as pl, nextTick as Je, isVNode as vl } from "vue";
|
|
2
|
+
import { isManual as we } from "../utils/manual.mjs";
|
|
3
3
|
import "../../../core/src/utils/tv.mjs";
|
|
4
|
-
import { prefixThemeConfig as
|
|
5
|
-
import { devWarn as
|
|
6
|
-
import { mergeThemeConfigs as
|
|
7
|
-
import { mergeDeep as
|
|
8
|
-
import
|
|
9
|
-
import { VTABLE_GUILD_INJECTION_KEY as
|
|
10
|
-
import { paginationZhCN as
|
|
11
|
-
import { resolveTooltipThemePreset as
|
|
12
|
-
import { antdvTableCompatClasses as
|
|
13
|
-
import { usePagination as
|
|
14
|
-
import
|
|
15
|
-
import { filterVisibleColumns as
|
|
16
|
-
import { getEllipsisConfig as
|
|
17
|
-
import { getRootCompatClass as
|
|
18
|
-
import { resolveRowKey as
|
|
19
|
-
import { useScroll as
|
|
20
|
-
import { useAutoHeight as
|
|
21
|
-
import { useColumnMetrics as
|
|
22
|
-
import { useColumnLayout as
|
|
23
|
-
import { resolveFixedColumnRanges as
|
|
24
|
-
import { useExpand as
|
|
25
|
-
import { useResize as
|
|
26
|
-
import { useVirtual as
|
|
27
|
-
import { useTreeData as
|
|
28
|
-
import { useLazyTreeData as
|
|
29
|
-
import { useHoverState as
|
|
30
|
-
import { useRowDragSort as
|
|
31
|
-
import { TABLE_CONTEXT_KEY as
|
|
32
|
-
import { EXPAND_COLUMN as
|
|
33
|
-
import { resolveTablePresetConfig as
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import { antdvTableTheme as
|
|
41
|
-
import { useColumns as
|
|
42
|
-
import { useSorter as
|
|
43
|
-
import { useFilter as
|
|
44
|
-
import { useSelection as
|
|
45
|
-
import { cn as
|
|
46
|
-
function
|
|
47
|
-
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !
|
|
4
|
+
import { prefixThemeConfig as gl, prefixVtgClassNames as Z } from "../../../core/src/utils/classPrefix.mjs";
|
|
5
|
+
import { devWarn as yl } from "../../../core/src/utils/devWarn.mjs";
|
|
6
|
+
import { mergeThemeConfigs as A, useTheme as hl } from "../../../core/src/composables/useTheme.mjs";
|
|
7
|
+
import { mergeDeep as Q } from "../../../core/src/utils/mergeDeep.mjs";
|
|
8
|
+
import Ze from "../../../core/src/components/Scrollbar.mjs";
|
|
9
|
+
import { VTABLE_GUILD_INJECTION_KEY as Qe } from "../../../core/src/plugin/index.mjs";
|
|
10
|
+
import { paginationZhCN as wl } from "../../../theme/src/pagination.mjs";
|
|
11
|
+
import { resolveTooltipThemePreset as Cl, resolveScrollbarThemePreset as xl, resolveRadioThemePreset as bl, resolveInputThemePreset as Sl, resolveCheckboxThemePreset as Dl, resolveButtonThemePreset as Tl, resolveTableThemePreset as El, resolveTableLocalePreset as Rl, resolveBuiltInTableLocale as Il, resolveBuiltInLocale as Ll } from "../../../theme/src/presets/index.mjs";
|
|
12
|
+
import { antdvTableCompatClasses as Hl } from "../../../theme/src/compat/antdv-table.mjs";
|
|
13
|
+
import { usePagination as Bl } from "../composables/usePagination.mjs";
|
|
14
|
+
import Fl from "./TablePagination.mjs";
|
|
15
|
+
import { filterVisibleColumns as Nl, applyColumnOrder as Pl } from "../composables/useColumnDisplay.mjs";
|
|
16
|
+
import { getEllipsisConfig as Ol } from "../utils/cell.mjs";
|
|
17
|
+
import { getRootCompatClass as _l } from "../utils/compat.mjs";
|
|
18
|
+
import { resolveRowKey as kl } from "../utils/rowKey.mjs";
|
|
19
|
+
import { useScroll as Al } from "../composables/useScroll.mjs";
|
|
20
|
+
import { useAutoHeight as Wl } from "../composables/useAutoHeight.mjs";
|
|
21
|
+
import { useColumnMetrics as zl } from "../composables/useColumnMetrics.mjs";
|
|
22
|
+
import { useColumnLayout as Kl } from "../composables/useColumnLayout.mjs";
|
|
23
|
+
import { resolveFixedColumnRanges as Ml } from "../composables/useColumnWindow.mjs";
|
|
24
|
+
import { useExpand as jl } from "../composables/useExpand.mjs";
|
|
25
|
+
import { useResize as Vl } from "../composables/useResize.mjs";
|
|
26
|
+
import { useVirtual as Yl, INVALID_SCROLL_Y_FALLBACK as $l } from "../composables/useVirtual.mjs";
|
|
27
|
+
import { useTreeData as Ul } from "../composables/useTreeData.mjs";
|
|
28
|
+
import { useLazyTreeData as Gl } from "../composables/useLazyTreeData.mjs";
|
|
29
|
+
import { useHoverState as Xl } from "../composables/useHoverState.mjs";
|
|
30
|
+
import { useRowDragSort as ql } from "../composables/useRowDragSort.mjs";
|
|
31
|
+
import { TABLE_CONTEXT_KEY as Jl } from "../context.mjs";
|
|
32
|
+
import { EXPAND_COLUMN as Zl, SELECTION_COLUMN as Ql } from "../constants.mjs";
|
|
33
|
+
import { resolveTablePresetConfig as ea } from "../preset-config.mjs";
|
|
34
|
+
import et from "./TableHeader.mjs";
|
|
35
|
+
import tt from "./TableBody.mjs";
|
|
36
|
+
import ta from "./VirtualTableBody.mjs";
|
|
37
|
+
import lt from "./TableLoading.mjs";
|
|
38
|
+
import ee from "./ColGroup.mjs";
|
|
39
|
+
import te from "./ColumnWidthRow.mjs";
|
|
40
|
+
import { antdvTableTheme as la } from "../../../theme/src/presets/antdv/table.mjs";
|
|
41
|
+
import { useColumns as at } from "../composables/useColumns.mjs";
|
|
42
|
+
import { useSorter as aa } from "../composables/useSorter.mjs";
|
|
43
|
+
import { useFilter as oa } from "../composables/useFilter.mjs";
|
|
44
|
+
import { useSelection as na } from "../composables/useSelection.mjs";
|
|
45
|
+
import { cn as H } from "tailwind-variants";
|
|
46
|
+
function ot(l) {
|
|
47
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !vl(l);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
49
|
+
const ra = [["xxxl", 2e3], ["xxl", 1600], ["xl", 1200], ["lg", 992], ["md", 768], ["sm", 576], ["xs", 0]];
|
|
50
|
+
function nt() {
|
|
51
51
|
if (typeof window > "u")
|
|
52
52
|
return /* @__PURE__ */ new Set(["md", "sm", "xs"]);
|
|
53
|
-
const l = window.innerWidth,
|
|
54
|
-
return
|
|
53
|
+
const l = window.innerWidth, i = /* @__PURE__ */ new Set();
|
|
54
|
+
return ra.forEach(([u, c]) => {
|
|
55
55
|
if (u === "xs") {
|
|
56
|
-
l < 576 &&
|
|
56
|
+
l < 576 && i.add("xs");
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
l >= c &&
|
|
60
|
-
}),
|
|
59
|
+
l >= c && i.add(u);
|
|
60
|
+
}), i;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function rt(l, i) {
|
|
63
63
|
return l.reduce((u, c) => {
|
|
64
64
|
if (typeof c == "symbol")
|
|
65
65
|
return u.push(c), u;
|
|
66
|
-
if (c.responsive?.length && !c.responsive.some((
|
|
66
|
+
if (c.responsive?.length && !c.responsive.some((T) => i.has(T)))
|
|
67
67
|
return u;
|
|
68
|
-
const
|
|
68
|
+
const b = c.fixed === !0 ? "left" : c.fixed;
|
|
69
69
|
if ("children" in c && Array.isArray(c.children)) {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
70
|
+
const T = rt(c.children, i);
|
|
71
|
+
return T.length === 0 || u.push({
|
|
72
72
|
...c,
|
|
73
|
-
fixed:
|
|
74
|
-
children:
|
|
73
|
+
fixed: b,
|
|
74
|
+
children: T
|
|
75
75
|
}), u;
|
|
76
76
|
}
|
|
77
|
-
return u.push(
|
|
77
|
+
return u.push(b === c.fixed ? c : {
|
|
78
78
|
...c,
|
|
79
|
-
fixed:
|
|
79
|
+
fixed: b
|
|
80
80
|
}), u;
|
|
81
81
|
}, []);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const Qa = /* @__PURE__ */ sl({
|
|
84
84
|
name: "VTable",
|
|
85
85
|
props: {
|
|
86
86
|
pagination: {
|
|
@@ -299,52 +299,52 @@ const qa = /* @__PURE__ */ ul({
|
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
301
|
emits: {
|
|
302
|
-
change: (l,
|
|
303
|
-
resizeColumn: (l,
|
|
304
|
-
rowDragEnd: (l,
|
|
302
|
+
change: (l, i, u) => !0,
|
|
303
|
+
resizeColumn: (l, i) => !0,
|
|
304
|
+
rowDragEnd: (l, i) => !0
|
|
305
305
|
},
|
|
306
306
|
slots: Object,
|
|
307
307
|
setup(l, {
|
|
308
|
-
slots:
|
|
308
|
+
slots: i,
|
|
309
309
|
emit: u,
|
|
310
310
|
expose: c
|
|
311
311
|
}) {
|
|
312
|
-
const
|
|
313
|
-
let
|
|
314
|
-
|
|
312
|
+
const b = D(!1);
|
|
313
|
+
let T;
|
|
314
|
+
L(() => {
|
|
315
315
|
const e = l.loading;
|
|
316
316
|
return [e === !0 || typeof e == "object" && e !== null && e.spinning !== !1, typeof e == "object" && e !== null ? e.delay : 0];
|
|
317
317
|
}, ([e, a]) => {
|
|
318
|
-
clearTimeout(
|
|
319
|
-
|
|
320
|
-
}, a)) :
|
|
318
|
+
clearTimeout(T), e ? !a || !Number.isFinite(a) || a < 0 ? b.value = !0 : b.value || (T = setTimeout(() => {
|
|
319
|
+
b.value = !0;
|
|
320
|
+
}, a)) : b.value = !1;
|
|
321
321
|
}, {
|
|
322
322
|
immediate: !0
|
|
323
|
-
}),
|
|
324
|
-
const
|
|
325
|
-
const e = h?.theme ?? {}, a =
|
|
323
|
+
}), he(() => clearTimeout(T));
|
|
324
|
+
const Ce = n(() => typeof l.loading == "object" ? l.loading?.wrapperClassName : void 0), h = cl(Qe, null), E = n(() => h?.themePreset ?? "antdv"), B = n(() => h?.cssMode ?? "prebuilt"), F = n(() => h?.classPrefix ?? "vtg"), it = n(() => {
|
|
325
|
+
const e = h?.theme ?? {}, a = E.value, o = (d) => gl(d, B.value, F.value);
|
|
326
326
|
return {
|
|
327
327
|
...e,
|
|
328
|
-
button:
|
|
329
|
-
checkbox:
|
|
330
|
-
input:
|
|
331
|
-
radio:
|
|
332
|
-
scrollbar:
|
|
333
|
-
tooltip:
|
|
328
|
+
button: A(o(Tl(a)), e.button),
|
|
329
|
+
checkbox: A(o(Dl(a)), e.checkbox),
|
|
330
|
+
input: A(o(Sl(a)), e.input),
|
|
331
|
+
radio: A(o(bl(a)), e.radio),
|
|
332
|
+
scrollbar: A(o(xl(a)), e.scrollbar),
|
|
333
|
+
tooltip: A(o(Cl(a)), e.tooltip)
|
|
334
334
|
};
|
|
335
335
|
});
|
|
336
|
-
|
|
336
|
+
Xe(Qe, {
|
|
337
337
|
get themePreset() {
|
|
338
|
-
return
|
|
338
|
+
return E.value;
|
|
339
339
|
},
|
|
340
340
|
get cssMode() {
|
|
341
|
-
return
|
|
341
|
+
return B.value;
|
|
342
342
|
},
|
|
343
343
|
get classPrefix() {
|
|
344
|
-
return
|
|
344
|
+
return F.value;
|
|
345
345
|
},
|
|
346
346
|
get theme() {
|
|
347
|
-
return
|
|
347
|
+
return it.value;
|
|
348
348
|
},
|
|
349
349
|
get locale() {
|
|
350
350
|
return h?.locale ?? "zh-CN";
|
|
@@ -359,140 +359,140 @@ const qa = /* @__PURE__ */ ul({
|
|
|
359
359
|
return h?.compatClass;
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
|
-
const
|
|
362
|
+
const dt = n(() => El(E.value) ?? la), {
|
|
363
363
|
slots: t
|
|
364
|
-
} =
|
|
365
|
-
compatClasses:
|
|
366
|
-
}),
|
|
364
|
+
} = hl("table", dt, l, {
|
|
365
|
+
compatClasses: Hl
|
|
366
|
+
}), W = h?.compatClass === !0 ? (e) => `ant-table-${e}` : void 0, z = n(() => l.locale ?? h?.locale ?? "zh-CN"), xe = n(() => ({
|
|
367
367
|
...h?.locales ?? {},
|
|
368
368
|
...l.locales ?? {}
|
|
369
|
-
})),
|
|
370
|
-
const e =
|
|
371
|
-
return
|
|
372
|
-
}),
|
|
373
|
-
function
|
|
374
|
-
|
|
369
|
+
})), ut = n(() => {
|
|
370
|
+
const e = Rl(E.value), a = Il(E.value, z.value), o = xe.value[z.value]?.table, d = Q(Q(e, a), o);
|
|
371
|
+
return Q(d, Q(h?.localeOverrides?.table ?? {}, l.localeOverrides));
|
|
372
|
+
}), le = D(nt());
|
|
373
|
+
function ae() {
|
|
374
|
+
le.value = nt();
|
|
375
375
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}),
|
|
379
|
-
window.removeEventListener("resize",
|
|
376
|
+
qe(() => {
|
|
377
|
+
ae(), window.addEventListener("resize", ae);
|
|
378
|
+
}), he(() => {
|
|
379
|
+
window.removeEventListener("resize", ae);
|
|
380
380
|
});
|
|
381
|
-
const
|
|
382
|
-
leafColumns:
|
|
383
|
-
} =
|
|
384
|
-
getSortOrder:
|
|
385
|
-
toggleSortOrder:
|
|
386
|
-
sortData:
|
|
387
|
-
sorterState:
|
|
388
|
-
sorterResult:
|
|
389
|
-
sortColumns:
|
|
390
|
-
} =
|
|
391
|
-
columns: () =>
|
|
381
|
+
const be = n(() => rt(l.columns, le.value)), P = n(() => l.sticky === !0 ? {} : typeof l.sticky == "object" ? l.sticky : void 0), {
|
|
382
|
+
leafColumns: j
|
|
383
|
+
} = at(() => be.value), {
|
|
384
|
+
getSortOrder: oe,
|
|
385
|
+
toggleSortOrder: st,
|
|
386
|
+
sortData: ct,
|
|
387
|
+
sorterState: ft,
|
|
388
|
+
sorterResult: ne,
|
|
389
|
+
sortColumns: mt
|
|
390
|
+
} = aa({
|
|
391
|
+
columns: () => j.value,
|
|
392
392
|
tableSortDirections: () => l.sortDirections,
|
|
393
393
|
onSorterChange(e) {
|
|
394
|
-
const a =
|
|
395
|
-
u("change",
|
|
394
|
+
const a = re();
|
|
395
|
+
u("change", V(), e, {
|
|
396
396
|
action: "sort",
|
|
397
397
|
currentDataSource: a,
|
|
398
|
-
...
|
|
399
|
-
}),
|
|
398
|
+
...ie()
|
|
399
|
+
}), ue();
|
|
400
400
|
}
|
|
401
401
|
}), {
|
|
402
|
-
getFilteredValue:
|
|
402
|
+
getFilteredValue: pt,
|
|
403
403
|
confirmFilter: vt,
|
|
404
|
-
resetFilter:
|
|
405
|
-
getAllFilters:
|
|
406
|
-
filterData:
|
|
407
|
-
} =
|
|
408
|
-
columns: () =>
|
|
404
|
+
resetFilter: gt,
|
|
405
|
+
getAllFilters: V,
|
|
406
|
+
filterData: yt
|
|
407
|
+
} = oa({
|
|
408
|
+
columns: () => j.value,
|
|
409
409
|
onFilterChange(e) {
|
|
410
|
-
const a =
|
|
411
|
-
u("change", e,
|
|
410
|
+
const a = re(), o = f.resetForFilter();
|
|
411
|
+
u("change", e, ne.value, {
|
|
412
412
|
action: "filter",
|
|
413
413
|
currentDataSource: a,
|
|
414
|
-
...
|
|
415
|
-
}),
|
|
414
|
+
...ie(o)
|
|
415
|
+
}), ue();
|
|
416
416
|
}
|
|
417
|
-
}), C =
|
|
417
|
+
}), C = Gl({
|
|
418
418
|
data: () => l.dataSource,
|
|
419
419
|
loadData: () => l.loadData,
|
|
420
420
|
isLeaf: () => l.isLeaf,
|
|
421
421
|
childrenColumnName: () => l.childrenColumnName,
|
|
422
|
-
getRowKey:
|
|
422
|
+
getRowKey: S,
|
|
423
423
|
onLoadError: (e, a) => l.onTreeLoadError?.(e, a)
|
|
424
424
|
});
|
|
425
|
-
function
|
|
425
|
+
function re() {
|
|
426
426
|
let e = C.data.value;
|
|
427
|
-
return
|
|
427
|
+
return we(l.manual, "filter") || (e = yt(e)), we(l.manual, "sort") || (e = ct(e)), e;
|
|
428
428
|
}
|
|
429
|
-
const
|
|
430
|
-
manual: () =>
|
|
429
|
+
const K = n(() => re()), f = Bl({
|
|
430
|
+
manual: () => we(l.manual, "pagination"),
|
|
431
431
|
pagination: () => l.pagination,
|
|
432
|
-
data: () =>
|
|
432
|
+
data: () => K.value,
|
|
433
433
|
onChange(e) {
|
|
434
|
-
u("change",
|
|
434
|
+
u("change", V(), ne.value, {
|
|
435
435
|
action: "paginate",
|
|
436
|
-
currentDataSource:
|
|
436
|
+
currentDataSource: K.value,
|
|
437
437
|
pagination: e
|
|
438
|
-
}),
|
|
438
|
+
}), ue();
|
|
439
439
|
}
|
|
440
440
|
});
|
|
441
|
-
function
|
|
441
|
+
function ie(e) {
|
|
442
442
|
return f.enabled.value ? {
|
|
443
443
|
pagination: e ?? f.state.value
|
|
444
444
|
} : {};
|
|
445
445
|
}
|
|
446
|
-
const
|
|
447
|
-
...
|
|
448
|
-
...
|
|
449
|
-
...
|
|
446
|
+
const ht = n(() => ({
|
|
447
|
+
...wl,
|
|
448
|
+
...Ll(E.value, z.value)?.pagination,
|
|
449
|
+
...xe.value[z.value]?.pagination,
|
|
450
450
|
...h?.localeOverrides?.pagination,
|
|
451
451
|
...f.config.value.locale
|
|
452
|
-
})),
|
|
453
|
-
function
|
|
454
|
-
(l.scroll?.scrollToFirstRowOnChange ?? f.enabled.value) &&
|
|
455
|
-
|
|
452
|
+
})), de = D(null);
|
|
453
|
+
function ue() {
|
|
454
|
+
(l.scroll?.scrollToFirstRowOnChange ?? f.enabled.value) && Je(() => {
|
|
455
|
+
I.value ? de.value?.scrollToTop() : N.value && (N.value.scrollTop = 0);
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function Y(e) {
|
|
459
459
|
if (!f.enabled.value || f.state.value.total === 0) return null;
|
|
460
460
|
const o = (f.config.value.position ?? ["bottomRight"]).find((s) => s !== "none" && s.startsWith(e));
|
|
461
461
|
if (!o) return null;
|
|
462
|
-
const
|
|
463
|
-
return r(
|
|
462
|
+
const d = o.slice(e.length).toLowerCase();
|
|
463
|
+
return r(Fl, {
|
|
464
464
|
key: e,
|
|
465
465
|
config: f.config.value,
|
|
466
466
|
state: f.state.value,
|
|
467
|
-
locale:
|
|
468
|
-
align:
|
|
467
|
+
locale: ht.value,
|
|
468
|
+
align: d,
|
|
469
469
|
position: o,
|
|
470
470
|
tableSize: l.size,
|
|
471
|
-
narrow:
|
|
471
|
+
narrow: le.value.has("xs"),
|
|
472
472
|
getPopupContainer: l.getPopupContainer,
|
|
473
473
|
onChange: f.change
|
|
474
|
-
},
|
|
475
|
-
paginationItem:
|
|
474
|
+
}, i.paginationItem ? {
|
|
475
|
+
paginationItem: i.paginationItem
|
|
476
476
|
} : void 0);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
479
|
-
const o =
|
|
478
|
+
function S(e, a) {
|
|
479
|
+
const o = kl(e, a, l.rowKey);
|
|
480
480
|
return l.rowKey === void 0 || typeof l.rowKey == "string" && l.rowKey in e, o;
|
|
481
481
|
}
|
|
482
482
|
const {
|
|
483
|
-
flattenData:
|
|
484
|
-
rowMetaMap:
|
|
485
|
-
isTreeData:
|
|
486
|
-
toggleTreeExpand:
|
|
487
|
-
isTreeExpanded:
|
|
488
|
-
indentSize:
|
|
489
|
-
} =
|
|
490
|
-
data: () =>
|
|
483
|
+
flattenData: se,
|
|
484
|
+
rowMetaMap: Se,
|
|
485
|
+
isTreeData: ce,
|
|
486
|
+
toggleTreeExpand: wt,
|
|
487
|
+
isTreeExpanded: Ct,
|
|
488
|
+
indentSize: xt
|
|
489
|
+
} = Ul({
|
|
490
|
+
data: () => K.value,
|
|
491
491
|
pageData: () => f.pageData.value,
|
|
492
492
|
preserveStateOnDataChange: () => f.enabled.value || !!l.loadData,
|
|
493
493
|
childrenColumnName: () => l.childrenColumnName,
|
|
494
494
|
indentSize: () => l.indentSize,
|
|
495
|
-
getRowKey:
|
|
495
|
+
getRowKey: S,
|
|
496
496
|
hasChildren: C.hasChildren,
|
|
497
497
|
defaultExpandedRowKeys: () => l.defaultExpandedRowKeys,
|
|
498
498
|
expandedRowKeys: () => l.expandedRowKeys,
|
|
@@ -500,179 +500,179 @@ const qa = /* @__PURE__ */ ul({
|
|
|
500
500
|
onExpand: (e, a) => l.onExpand?.(e, a),
|
|
501
501
|
onExpandedRowsChange: (e) => l.onExpandedRowsChange?.(e)
|
|
502
502
|
});
|
|
503
|
-
function
|
|
504
|
-
const o =
|
|
503
|
+
function bt(e, a) {
|
|
504
|
+
const o = S(e, a);
|
|
505
505
|
if (C.getError(o)) {
|
|
506
506
|
C.load(e, a);
|
|
507
507
|
return;
|
|
508
508
|
}
|
|
509
|
-
|
|
509
|
+
wt(e, a);
|
|
510
510
|
}
|
|
511
|
-
|
|
511
|
+
L(() => l.loadData ? se.value : void 0, (e) => {
|
|
512
512
|
e?.forEach((a, o) => {
|
|
513
|
-
a.expanded && !C.getError(
|
|
513
|
+
a.expanded && !C.getError(S(a.record, o)) && C.load(a.record, o);
|
|
514
514
|
});
|
|
515
515
|
}, {
|
|
516
516
|
immediate: !0
|
|
517
517
|
});
|
|
518
518
|
const {
|
|
519
|
-
hoverRange:
|
|
520
|
-
setHoverRange:
|
|
521
|
-
clearHoverRange:
|
|
522
|
-
} =
|
|
519
|
+
hoverRange: St,
|
|
520
|
+
setHoverRange: Dt,
|
|
521
|
+
clearHoverRange: Tt
|
|
522
|
+
} = Xl(100), $ = ql({
|
|
523
523
|
enabled: () => l.rowDraggable === !0,
|
|
524
|
-
getRowKey:
|
|
524
|
+
getRowKey: S,
|
|
525
525
|
dataSource: () => l.dataSource,
|
|
526
526
|
childrenColumnName: () => l.childrenColumnName,
|
|
527
527
|
onDrop(e, a) {
|
|
528
528
|
u("rowDragEnd", e, a);
|
|
529
529
|
}
|
|
530
|
-
}), g = n(() =>
|
|
531
|
-
isSelected:
|
|
532
|
-
isDisabled:
|
|
533
|
-
getSelectionState:
|
|
534
|
-
toggleRow:
|
|
535
|
-
toggleAll:
|
|
536
|
-
allCheckedState:
|
|
537
|
-
invertSelection:
|
|
530
|
+
}), g = n(() => ce.value ? se.value.map((e) => e.record) : f.pageData.value), {
|
|
531
|
+
isSelected: Et,
|
|
532
|
+
isDisabled: Rt,
|
|
533
|
+
getSelectionState: It,
|
|
534
|
+
toggleRow: Lt,
|
|
535
|
+
toggleAll: Ht,
|
|
536
|
+
allCheckedState: Bt,
|
|
537
|
+
invertSelection: Ft,
|
|
538
538
|
clearSelection: Nt,
|
|
539
|
-
getChangeableRowKeys:
|
|
540
|
-
} =
|
|
539
|
+
getChangeableRowKeys: Pt
|
|
540
|
+
} = na({
|
|
541
541
|
rowSelection: () => l.rowSelection,
|
|
542
|
-
getRowKey:
|
|
543
|
-
data: () =>
|
|
542
|
+
getRowKey: S,
|
|
543
|
+
data: () => K.value,
|
|
544
544
|
visibleData: () => g.value,
|
|
545
545
|
paginate: () => f.enabled.value,
|
|
546
546
|
childrenColumnName: () => l.childrenColumnName,
|
|
547
547
|
onSelectionChange() {
|
|
548
|
-
u("change",
|
|
548
|
+
u("change", V(), ne.value, {
|
|
549
549
|
action: "select",
|
|
550
550
|
currentDataSource: g.value,
|
|
551
|
-
...
|
|
551
|
+
...ie()
|
|
552
552
|
});
|
|
553
553
|
}
|
|
554
554
|
}), {
|
|
555
|
-
isExpanded:
|
|
556
|
-
toggleExpand:
|
|
557
|
-
} =
|
|
555
|
+
isExpanded: Ot,
|
|
556
|
+
toggleExpand: _t
|
|
557
|
+
} = jl({
|
|
558
558
|
expandable: () => l.expandable,
|
|
559
|
-
getRowKey:
|
|
560
|
-
data: () => f.enabled.value ?
|
|
559
|
+
getRowKey: S,
|
|
560
|
+
data: () => f.enabled.value ? K.value : g.value,
|
|
561
561
|
childrenColumnName: () => l.childrenColumnName,
|
|
562
562
|
initializeNewRows: () => f.enabled.value
|
|
563
|
-
}),
|
|
563
|
+
}), De = (e) => {
|
|
564
564
|
const a = l.expandable;
|
|
565
565
|
return a ? a.rowExpandable ? a.rowExpandable(e) : !!a.expandedRowRender : !1;
|
|
566
|
-
},
|
|
567
|
-
|
|
568
|
-
},
|
|
566
|
+
}, kt = (e, a) => {
|
|
567
|
+
De(e) && _t(e, a);
|
|
568
|
+
}, Te = "__vtg_selection__", Ee = "__vtg_expand__", At = n(() => {
|
|
569
569
|
const e = l.expandable, a = l.rowSelection, o = e && e.showExpandColumn !== !1 ? {
|
|
570
|
-
key:
|
|
571
|
-
title: () =>
|
|
570
|
+
key: Ee,
|
|
571
|
+
title: () => i.expandColumnTitle?.() ?? e.columnTitle ?? "",
|
|
572
572
|
width: e.columnWidth ?? 48,
|
|
573
573
|
align: "center",
|
|
574
574
|
fixed: e.fixed === !0 ? "left" : e.fixed
|
|
575
|
-
} : null,
|
|
576
|
-
key:
|
|
575
|
+
} : null, d = a ? {
|
|
576
|
+
key: Te,
|
|
577
577
|
title: "",
|
|
578
578
|
width: a.columnWidth ?? 48,
|
|
579
579
|
align: "center",
|
|
580
580
|
fixed: a.fixed === !0 ? "left" : a.fixed || void 0
|
|
581
|
-
} : null, s =
|
|
582
|
-
let
|
|
581
|
+
} : null, s = Nl(be.value), m = [];
|
|
582
|
+
let v = !1, y = !1;
|
|
583
583
|
for (const w of s) {
|
|
584
|
-
if (w ===
|
|
585
|
-
o && !
|
|
584
|
+
if (w === Zl) {
|
|
585
|
+
o && !v && (m.push(o), v = !0);
|
|
586
586
|
continue;
|
|
587
587
|
}
|
|
588
|
-
if (w ===
|
|
589
|
-
|
|
588
|
+
if (w === Ql) {
|
|
589
|
+
d && !y && (m.push(d), y = !0);
|
|
590
590
|
continue;
|
|
591
591
|
}
|
|
592
592
|
m.push(w);
|
|
593
593
|
}
|
|
594
|
-
if (
|
|
594
|
+
if (d && !y && m.unshift(d), o && !v) {
|
|
595
595
|
const w = e?.expandIconColumnIndex;
|
|
596
|
-
m.splice(typeof w == "number" && Number.isFinite(w) ? Math.min(m.length, Math.max(0, Math.floor(w)) + (
|
|
596
|
+
m.splice(typeof w == "number" && Number.isFinite(w) ? Math.min(m.length, Math.max(0, Math.floor(w)) + (d ? 1 : 0)) : d ? 1 : 0, 0, o);
|
|
597
597
|
}
|
|
598
|
-
return
|
|
598
|
+
return Pl(m, l.columnOrder, [Te, Ee]);
|
|
599
599
|
}), {
|
|
600
|
-
leafColumns:
|
|
601
|
-
headerRows:
|
|
602
|
-
} =
|
|
603
|
-
columnWidths:
|
|
604
|
-
startResize:
|
|
605
|
-
isResizing:
|
|
606
|
-
} =
|
|
607
|
-
columns: () =>
|
|
600
|
+
leafColumns: p,
|
|
601
|
+
headerRows: fe
|
|
602
|
+
} = at(() => At.value), Wt = n(() => fe.value.length > 1), {
|
|
603
|
+
columnWidths: U,
|
|
604
|
+
startResize: zt,
|
|
605
|
+
isResizing: Kt
|
|
606
|
+
} = Vl({
|
|
607
|
+
columns: () => p.value,
|
|
608
608
|
onResizeColumn(e, a) {
|
|
609
609
|
u("resizeColumn", e, a);
|
|
610
610
|
}
|
|
611
611
|
}), {
|
|
612
|
-
headerWrapRef:
|
|
612
|
+
headerWrapRef: G,
|
|
613
613
|
bodyWrapRef: N,
|
|
614
|
-
scrollState:
|
|
615
|
-
handleBodyScroll:
|
|
616
|
-
fixedOffsets:
|
|
617
|
-
syncHorizontalScroll:
|
|
618
|
-
updateScrollState:
|
|
619
|
-
} =
|
|
620
|
-
displayColumns: () =>
|
|
621
|
-
columnWidths:
|
|
622
|
-
layoutWidths: () =>
|
|
623
|
-
syncElements: () =>
|
|
624
|
-
}),
|
|
625
|
-
compatClass:
|
|
626
|
-
fixedOffsets:
|
|
627
|
-
scrollState:
|
|
614
|
+
scrollState: Re,
|
|
615
|
+
handleBodyScroll: Ie,
|
|
616
|
+
fixedOffsets: Le,
|
|
617
|
+
syncHorizontalScroll: Mt,
|
|
618
|
+
updateScrollState: He
|
|
619
|
+
} = Al({
|
|
620
|
+
displayColumns: () => p.value,
|
|
621
|
+
columnWidths: U,
|
|
622
|
+
layoutWidths: () => R.metrics.value?.widths,
|
|
623
|
+
syncElements: () => J.value ? [J.value] : []
|
|
624
|
+
}), Be = n(() => _l({
|
|
625
|
+
compatClass: W,
|
|
626
|
+
fixedOffsets: Le,
|
|
627
|
+
scrollState: Re,
|
|
628
628
|
empty: g.value.length === 0,
|
|
629
629
|
fixedHeader: l.scroll?.y !== void 0,
|
|
630
|
-
fixedColumn:
|
|
631
|
-
horizontalScroll:
|
|
632
|
-
layoutFixed:
|
|
633
|
-
})),
|
|
634
|
-
if (
|
|
630
|
+
fixedColumn: Pe.value && Ne.value,
|
|
631
|
+
horizontalScroll: Pe.value,
|
|
632
|
+
layoutFixed: q.value === "fixed"
|
|
633
|
+
})), X = n(() => l.scroll?.y === "auto"), Fe = n(() => !!l.scroll?.y || l.showHeader !== !1 && !!l.sticky), Ne = n(() => p.value.some((e) => e.fixed === "left" || e.fixed === "right")), Pe = n(() => l.scroll?.x !== void 0 || R.overflow.value || !!l.expandable?.fixed), jt = n(() => j.value.some((e) => Ol(e).enabled)), q = n(() => l.tableLayout ? l.tableLayout : l.scroll?.y || l.scroll?.x || Ne.value || jt.value ? "fixed" : "auto"), Vt = n(() => {
|
|
634
|
+
if (P.value)
|
|
635
635
|
return {
|
|
636
636
|
position: "sticky",
|
|
637
|
-
top: `${
|
|
637
|
+
top: `${P.value.offsetHeader ?? 0}px`,
|
|
638
638
|
zIndex: "4"
|
|
639
639
|
};
|
|
640
|
-
}),
|
|
641
|
-
columns: () =>
|
|
642
|
-
columnWidths:
|
|
643
|
-
layout: () =>
|
|
644
|
-
split: () =>
|
|
645
|
-
root: () =>
|
|
646
|
-
viewport: () =>
|
|
640
|
+
}), Oe = D(null), J = D(null), O = D(null), R = Kl({
|
|
641
|
+
columns: () => p.value,
|
|
642
|
+
columnWidths: U,
|
|
643
|
+
layout: () => q.value,
|
|
644
|
+
split: () => Fe.value,
|
|
645
|
+
root: () => O.value,
|
|
646
|
+
viewport: () => O.value?.contains(N.value) ? N.value : G.value ?? O.value,
|
|
647
647
|
scrollX: () => l.scroll?.x,
|
|
648
648
|
onMeasure: () => {
|
|
649
|
-
|
|
649
|
+
I.value || He();
|
|
650
650
|
}
|
|
651
651
|
}), {
|
|
652
|
-
bodyHeight:
|
|
653
|
-
} =
|
|
654
|
-
enabled: () =>
|
|
655
|
-
wrapperEl: () =>
|
|
656
|
-
headerEl: () =>
|
|
657
|
-
summaryEl: () =>
|
|
652
|
+
bodyHeight: _e
|
|
653
|
+
} = Wl({
|
|
654
|
+
enabled: () => X.value,
|
|
655
|
+
wrapperEl: () => Oe.value,
|
|
656
|
+
headerEl: () => G.value,
|
|
657
|
+
summaryEl: () => J.value,
|
|
658
658
|
hasData: () => g.value.length > 0
|
|
659
|
-
}),
|
|
659
|
+
}), Yt = n(() => {
|
|
660
660
|
const e = l.scroll?.y;
|
|
661
661
|
if (e !== void 0)
|
|
662
|
-
return
|
|
662
|
+
return X.value ? _e.value : typeof e == "number" ? Number.isFinite(e) && e > 0 ? e : void 0 : e;
|
|
663
663
|
}), {
|
|
664
|
-
enabled:
|
|
665
|
-
itemHeight:
|
|
666
|
-
listHeight:
|
|
667
|
-
fixedHeight:
|
|
668
|
-
resolvedScrollY:
|
|
669
|
-
} =
|
|
664
|
+
enabled: I,
|
|
665
|
+
itemHeight: $t,
|
|
666
|
+
listHeight: Ut,
|
|
667
|
+
fixedHeight: Gt,
|
|
668
|
+
resolvedScrollY: Xt
|
|
669
|
+
} = Yl({
|
|
670
670
|
virtual: () => l.virtual,
|
|
671
671
|
scrollY: () => l.scroll?.y,
|
|
672
672
|
size: () => l.size,
|
|
673
673
|
rowHeight: () => l.rowHeight,
|
|
674
|
-
measuredHeight: () =>
|
|
675
|
-
}),
|
|
674
|
+
measuredHeight: () => _e.value
|
|
675
|
+
}), ke = n(() => j.value.some((e) => !!e.customCell || !!e.customRender)), me = n(() => !Wt.value || l.bordered ? {
|
|
676
676
|
table: "",
|
|
677
677
|
th: "",
|
|
678
678
|
td: ""
|
|
@@ -680,44 +680,44 @@ const qa = /* @__PURE__ */ ul({
|
|
|
680
680
|
table: t.groupedHeaderTable(),
|
|
681
681
|
th: t.groupedHeaderTh(),
|
|
682
682
|
td: t.groupedHeaderTd()
|
|
683
|
-
}),
|
|
684
|
-
|
|
683
|
+
}), M = n(() => H(t.table(), me.value.table) ?? ""), Ae = n(() => R.enabled.value ? t.widthLayoutCell() : void 0), We = n(() => H(t.th(), me.value.th, Ae.value) ?? ""), pe = n(() => H(t.td(), me.value.td, Ae.value) ?? "");
|
|
684
|
+
L([I, ke], ([e, a]) => {
|
|
685
685
|
}, {
|
|
686
686
|
immediate: !0
|
|
687
|
-
}),
|
|
687
|
+
}), L([() => l.virtual, Xt], ([e, a]) => {
|
|
688
688
|
if (!e) return;
|
|
689
689
|
const o = String(l.scroll?.y);
|
|
690
|
-
a.kind === "compat-px" ?
|
|
690
|
+
a.kind === "compat-px" ? yl("vtable-scroll-y-compat-px", `[VTable] virtual 模式下字符串 scroll.y(${o})按 ${a.value}px 解析,这是兼容行为;请改用数字或 'auto'。`) : a.kind === "invalid-string" || a.kind === "invalid-number" && l.scroll?.y && `${$l}`;
|
|
691
691
|
}, {
|
|
692
692
|
immediate: !0
|
|
693
693
|
});
|
|
694
|
-
const
|
|
695
|
-
|
|
694
|
+
const ze = D(null), Ke = D(null);
|
|
695
|
+
L(() => ze.value?.wrapRef, (e) => {
|
|
696
696
|
e && (N.value = e);
|
|
697
|
-
}),
|
|
697
|
+
}), L(() => Ke.value?.wrapRef, (e) => {
|
|
698
698
|
e && (N.value = e);
|
|
699
699
|
});
|
|
700
700
|
let ve = !1;
|
|
701
|
-
|
|
701
|
+
qe(() => {
|
|
702
702
|
ve = !0;
|
|
703
|
-
}),
|
|
703
|
+
}), he(() => {
|
|
704
704
|
ve = !1;
|
|
705
705
|
});
|
|
706
|
-
async function
|
|
706
|
+
async function qt(e) {
|
|
707
707
|
if (!e || typeof e != "object") return !1;
|
|
708
708
|
for (const s of [e.top, e.left, e.offset])
|
|
709
709
|
if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s)))
|
|
710
710
|
return !1;
|
|
711
|
-
if (e.align !== void 0 && !["top", "bottom", "auto"].includes(e.align) || (await
|
|
711
|
+
if (e.align !== void 0 && !["top", "bottom", "auto"].includes(e.align) || (await Je(), !ve)) return !1;
|
|
712
712
|
let a;
|
|
713
713
|
if (e.key !== void 0) {
|
|
714
|
-
if (a = g.value.findIndex((s, m) =>
|
|
714
|
+
if (a = g.value.findIndex((s, m) => S(s, m) === e.key), a < 0) return !1;
|
|
715
715
|
} else if (e.index !== void 0) {
|
|
716
716
|
if (!Number.isSafeInteger(e.index) || e.index < 0 || (a = e.index, a >= g.value.length)) return !1;
|
|
717
717
|
} else if (e.top === void 0 && e.left === void 0)
|
|
718
718
|
return !1;
|
|
719
|
-
if (
|
|
720
|
-
return await
|
|
719
|
+
if (I.value)
|
|
720
|
+
return await de.value?.scrollTo({
|
|
721
721
|
index: a,
|
|
722
722
|
top: a === void 0 ? e.top : void 0,
|
|
723
723
|
left: e.left,
|
|
@@ -725,70 +725,70 @@ const qa = /* @__PURE__ */ ul({
|
|
|
725
725
|
offset: e.offset
|
|
726
726
|
}) ?? !1;
|
|
727
727
|
const o = N.value;
|
|
728
|
-
if (!o || !
|
|
729
|
-
let
|
|
728
|
+
if (!o || !O.value?.contains(o)) return !1;
|
|
729
|
+
let d = e.top;
|
|
730
730
|
if (a !== void 0) {
|
|
731
731
|
const s = o.querySelector(`[data-vtg-row-index="${a}"]`);
|
|
732
732
|
if (!s) return !1;
|
|
733
|
-
const m = s.getBoundingClientRect(),
|
|
734
|
-
|
|
733
|
+
const m = s.getBoundingClientRect(), v = o.getBoundingClientRect(), y = m.top - v.top + o.scrollTop - o.clientTop, w = y + m.height, _ = e.offset ?? 0, k = e.align ?? "top";
|
|
734
|
+
k === "top" || k === "auto" && y < o.scrollTop + _ ? d = y - _ : k === "bottom" || k === "auto" && w > o.scrollTop + o.clientHeight - _ ? d = w - o.clientHeight + _ : d = void 0;
|
|
735
735
|
}
|
|
736
|
-
return
|
|
736
|
+
return d !== void 0 && (o.scrollTop = Math.max(0, Math.min(d, o.scrollHeight - o.clientHeight))), e.left !== void 0 && (o.scrollLeft = Math.max(0, Math.min(e.left, o.scrollWidth - o.clientWidth))), He(), !0;
|
|
737
737
|
}
|
|
738
738
|
c({
|
|
739
|
-
scrollTo:
|
|
739
|
+
scrollTo: qt,
|
|
740
740
|
retryTreeLoad: C.retry,
|
|
741
741
|
getTreeLoadError: C.getError
|
|
742
742
|
});
|
|
743
|
-
const
|
|
744
|
-
|
|
743
|
+
const Jt = n(() => Ml(p.value)), Me = n(() => l.virtualColumn ? I.value ? ke.value ? "列上有 customCell / customRender,可能返回 colSpan / rowSpan;单元格合并会让某个 td 缺席,进而破坏列宽不变量(虚拟模式本就不支持合并)" : Jt.value.contiguous ? null : "固定列必须分列两端:左固定连成前缀、右固定连成后缀,中间夹着的固定列会被窗口跳过" : "它只作用于虚拟表体,需要同时开启 virtual 与 scroll.y" : null), ge = n(() => l.virtualColumn && Me.value === null);
|
|
744
|
+
L(Me, (e) => {
|
|
745
745
|
}, {
|
|
746
746
|
immediate: !0
|
|
747
747
|
});
|
|
748
748
|
const {
|
|
749
|
-
metrics:
|
|
750
|
-
} =
|
|
751
|
-
enabled: () =>
|
|
752
|
-
headerEl: () =>
|
|
753
|
-
columns: () =>
|
|
754
|
-
columnWidths:
|
|
749
|
+
metrics: Zt
|
|
750
|
+
} = zl({
|
|
751
|
+
enabled: () => ge.value && !R.enabled.value,
|
|
752
|
+
headerEl: () => G.value,
|
|
753
|
+
columns: () => p.value,
|
|
754
|
+
columnWidths: U,
|
|
755
755
|
hasHeader: () => l.showHeader !== !1
|
|
756
|
-
}),
|
|
757
|
-
|
|
758
|
-
!e || a || l.showHeader !== !1 ||
|
|
756
|
+
}), je = n(() => R.metrics.value ?? Zt.value);
|
|
757
|
+
L([ge, je], ([e, a]) => {
|
|
758
|
+
!e || a || l.showHeader !== !1 || R.enabled.value;
|
|
759
759
|
}, {
|
|
760
760
|
immediate: !0
|
|
761
761
|
});
|
|
762
|
-
function
|
|
763
|
-
return
|
|
764
|
-
}
|
|
765
|
-
function Qt(e, a) {
|
|
766
|
-
return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(e, a, Zt(e)) : l.rowClassName : "";
|
|
762
|
+
function Qt(e) {
|
|
763
|
+
return ce.value ? Se.value.get(e)?.level ?? 0 : 0;
|
|
767
764
|
}
|
|
768
765
|
function el(e, a) {
|
|
769
|
-
return l.
|
|
766
|
+
return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(e, a, Qt(e)) : l.rowClassName : "";
|
|
770
767
|
}
|
|
771
768
|
function tl(e, a) {
|
|
769
|
+
return l.customRow?.(e, a);
|
|
770
|
+
}
|
|
771
|
+
function ll(e, a) {
|
|
772
772
|
return l.customHeaderRow?.(e, a);
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function al(e) {
|
|
775
775
|
if (typeof e.title != "function")
|
|
776
776
|
return e.title ?? "";
|
|
777
|
-
const a = e, o =
|
|
777
|
+
const a = e, o = mt.value.filter((d) => !!d.column);
|
|
778
778
|
return e.title({
|
|
779
|
-
sortOrder: a.sorter ?
|
|
780
|
-
sortColumn:
|
|
779
|
+
sortOrder: a.sorter ? oe(a) ?? void 0 : void 0,
|
|
780
|
+
sortColumn: ft.value.column,
|
|
781
781
|
sortColumns: o.length > 0 ? o : void 0,
|
|
782
|
-
filters:
|
|
782
|
+
filters: V()
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return !!(e.sorter &&
|
|
785
|
+
function ol(e) {
|
|
786
|
+
return !!(e.sorter && oe(e));
|
|
787
787
|
}
|
|
788
|
-
const
|
|
788
|
+
const Ve = {
|
|
789
789
|
width: "100%",
|
|
790
790
|
minWidth: "100%"
|
|
791
|
-
},
|
|
791
|
+
}, nl = {
|
|
792
792
|
widthConstraintCell: t.widthConstraintCell,
|
|
793
793
|
widthConstraintInner: t.widthConstraintInner,
|
|
794
794
|
widthLayoutCell: t.widthLayoutCell,
|
|
@@ -882,253 +882,275 @@ const qa = /* @__PURE__ */ ul({
|
|
|
882
882
|
trDragging: t.trDragging,
|
|
883
883
|
trDropAbove: t.trDropAbove,
|
|
884
884
|
trDropBelow: t.trDropBelow
|
|
885
|
-
},
|
|
886
|
-
|
|
885
|
+
}, Ye = n(() => ea(E.value)), $e = D(!1), x = fl({
|
|
886
|
+
bodyCell: i.bodyCell,
|
|
887
|
+
headerCell: i.headerCell,
|
|
888
|
+
empty: i.empty,
|
|
889
|
+
customFilterDropdown: i.customFilterDropdown,
|
|
890
|
+
customFilterIcon: i.customFilterIcon
|
|
891
|
+
});
|
|
892
|
+
return ml(() => {
|
|
893
|
+
x.bodyCell = i.bodyCell, x.headerCell = i.headerCell, x.empty = i.empty, x.customFilterDropdown = i.customFilterDropdown, x.customFilterIcon = i.customFilterIcon;
|
|
894
|
+
}), Xe(Jl, {
|
|
887
895
|
renderers: n(() => l.renderers),
|
|
888
896
|
isTreeLoading: C.isLoading,
|
|
889
897
|
getTreeLoadError: C.getError,
|
|
890
|
-
columnLayout:
|
|
891
|
-
bodyCell
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
+
columnLayout: R,
|
|
899
|
+
get bodyCell() {
|
|
900
|
+
return x.bodyCell;
|
|
901
|
+
},
|
|
902
|
+
get headerCell() {
|
|
903
|
+
return x.headerCell;
|
|
904
|
+
},
|
|
905
|
+
get empty() {
|
|
906
|
+
return x.empty;
|
|
907
|
+
},
|
|
908
|
+
getSortOrder: oe,
|
|
909
|
+
toggleSortOrder: st,
|
|
910
|
+
isColumnSorted: ol,
|
|
911
|
+
getFilteredValue: pt,
|
|
898
912
|
confirmFilter: vt,
|
|
899
|
-
resetFilter:
|
|
900
|
-
customFilterDropdown
|
|
901
|
-
|
|
902
|
-
|
|
913
|
+
resetFilter: gt,
|
|
914
|
+
get customFilterDropdown() {
|
|
915
|
+
return x.customFilterDropdown;
|
|
916
|
+
},
|
|
917
|
+
get customFilterIcon() {
|
|
918
|
+
return x.customFilterIcon;
|
|
919
|
+
},
|
|
920
|
+
showSorterTooltip: n(() => l.showSorterTooltip ?? Ye.value.showSorterTooltip),
|
|
903
921
|
headerEllipsis: n(() => l.headerEllipsis),
|
|
904
|
-
subThemeSlots:
|
|
905
|
-
presetConfig:
|
|
906
|
-
themePreset:
|
|
907
|
-
cssMode:
|
|
908
|
-
classPrefix:
|
|
909
|
-
vtgClass: (e) =>
|
|
910
|
-
compatClass:
|
|
911
|
-
localeName:
|
|
912
|
-
locale:
|
|
922
|
+
subThemeSlots: nl,
|
|
923
|
+
presetConfig: Ye,
|
|
924
|
+
themePreset: E,
|
|
925
|
+
cssMode: B,
|
|
926
|
+
classPrefix: F,
|
|
927
|
+
vtgClass: (e) => Z(e, B.value, F.value),
|
|
928
|
+
compatClass: W,
|
|
929
|
+
localeName: z,
|
|
930
|
+
locale: ut,
|
|
913
931
|
rowSelection: () => l.rowSelection,
|
|
914
|
-
isSelected:
|
|
915
|
-
isDisabledRow:
|
|
916
|
-
getSelectionState:
|
|
917
|
-
toggleRow:
|
|
918
|
-
toggleAll:
|
|
919
|
-
allCheckedState: () =>
|
|
920
|
-
getRowKey:
|
|
921
|
-
invertSelection:
|
|
932
|
+
isSelected: Et,
|
|
933
|
+
isDisabledRow: Rt,
|
|
934
|
+
getSelectionState: It,
|
|
935
|
+
toggleRow: Lt,
|
|
936
|
+
toggleAll: Ht,
|
|
937
|
+
allCheckedState: () => Bt.value,
|
|
938
|
+
getRowKey: S,
|
|
939
|
+
invertSelection: Ft,
|
|
922
940
|
clearSelection: Nt,
|
|
923
|
-
getChangeableRowKeys:
|
|
924
|
-
fixedOffsets:
|
|
925
|
-
scrollState:
|
|
926
|
-
leafColumnCount: n(() =>
|
|
941
|
+
getChangeableRowKeys: Pt,
|
|
942
|
+
fixedOffsets: Le,
|
|
943
|
+
scrollState: Re,
|
|
944
|
+
leafColumnCount: n(() => p.value.length),
|
|
927
945
|
bordered: n(() => l.bordered),
|
|
928
|
-
tableLayout:
|
|
946
|
+
tableLayout: q,
|
|
929
947
|
sticky: n(() => l.sticky),
|
|
930
|
-
getRowProps:
|
|
931
|
-
getRowClassName:
|
|
932
|
-
getHeaderRowProps:
|
|
933
|
-
getColumnTitle:
|
|
934
|
-
getPopupContainer
|
|
935
|
-
|
|
948
|
+
getRowProps: tl,
|
|
949
|
+
getRowClassName: el,
|
|
950
|
+
getHeaderRowProps: ll,
|
|
951
|
+
getColumnTitle: al,
|
|
952
|
+
get getPopupContainer() {
|
|
953
|
+
return l.getPopupContainer;
|
|
954
|
+
},
|
|
955
|
+
get transformCellText() {
|
|
956
|
+
return l.transformCellText;
|
|
957
|
+
},
|
|
936
958
|
columnEmptyText: n(() => l.columnEmptyText),
|
|
937
959
|
expandable: () => l.expandable,
|
|
938
|
-
isExpanded:
|
|
939
|
-
toggleExpand:
|
|
940
|
-
isRowExpandable:
|
|
941
|
-
columnWidths:
|
|
942
|
-
startResize:
|
|
943
|
-
isResizing: () =>
|
|
944
|
-
displayColumns: n(() =>
|
|
960
|
+
isExpanded: Ot,
|
|
961
|
+
toggleExpand: kt,
|
|
962
|
+
isRowExpandable: De,
|
|
963
|
+
columnWidths: U,
|
|
964
|
+
startResize: zt,
|
|
965
|
+
isResizing: () => Kt.value,
|
|
966
|
+
displayColumns: n(() => p.value),
|
|
945
967
|
registerSummaryFixed: (e) => {
|
|
946
|
-
|
|
968
|
+
$e.value = e;
|
|
947
969
|
},
|
|
948
|
-
isTreeData:
|
|
970
|
+
isTreeData: ce,
|
|
949
971
|
treeIndentColumnIndex: n(() => {
|
|
950
|
-
const e =
|
|
972
|
+
const e = p.value.map((o, d) => ({
|
|
951
973
|
column: o,
|
|
952
|
-
index:
|
|
974
|
+
index: d
|
|
953
975
|
})).filter(({
|
|
954
976
|
column: o
|
|
955
977
|
}) => o.key !== "__vtg_selection__" && o.key !== "__vtg_expand__"), a = l.expandable?.expandIconColumnIndex ?? 0;
|
|
956
978
|
return e[Math.max(0, Math.min(e.length - 1, Math.floor(Number.isFinite(a) ? a : 0)))]?.index ?? -1;
|
|
957
979
|
}),
|
|
958
|
-
treeFlattenData:
|
|
959
|
-
getFlattenRow: (e) =>
|
|
960
|
-
toggleTreeExpand:
|
|
961
|
-
isTreeExpanded:
|
|
962
|
-
treeIndentSize:
|
|
963
|
-
hoverRange:
|
|
964
|
-
setHoverRange:
|
|
965
|
-
clearHoverRange:
|
|
980
|
+
treeFlattenData: se,
|
|
981
|
+
getFlattenRow: (e) => Se.value.get(e),
|
|
982
|
+
toggleTreeExpand: bt,
|
|
983
|
+
isTreeExpanded: Ct,
|
|
984
|
+
treeIndentSize: xt,
|
|
985
|
+
hoverRange: St,
|
|
986
|
+
setHoverRange: Dt,
|
|
987
|
+
clearHoverRange: Tt,
|
|
966
988
|
// 拖拽期间抑制 hover 高亮,避免干扰拖放指示线
|
|
967
|
-
hoverable: n(() => l.hoverable !== !1 &&
|
|
989
|
+
hoverable: n(() => l.hoverable !== !1 && $.draggingKey.value === null),
|
|
968
990
|
rowDrag: {
|
|
969
991
|
enabled: n(() => l.rowDraggable === !0),
|
|
970
|
-
draggingKey:
|
|
971
|
-
dropTarget:
|
|
972
|
-
getBindings: (e, a, o) =>
|
|
992
|
+
draggingKey: $.draggingKey,
|
|
993
|
+
dropTarget: $.dropTarget,
|
|
994
|
+
getBindings: (e, a, o) => $.getBindings(e, a, o)
|
|
973
995
|
}
|
|
974
996
|
}), () => {
|
|
975
997
|
let e;
|
|
976
|
-
const a = l.title ? l.title(g.value) :
|
|
998
|
+
const a = l.title ? l.title(g.value) : i.title ? i.title({
|
|
977
999
|
data: g.value
|
|
978
|
-
}) : null, o = l.footer ? l.footer(g.value) :
|
|
1000
|
+
}) : null, o = l.footer ? l.footer(g.value) : i.footer ? i.footer({
|
|
979
1001
|
data: g.value
|
|
980
|
-
}) : null,
|
|
981
|
-
tableLayout:
|
|
1002
|
+
}) : null, d = i.summary ? i.summary() : null, s = $e.value !== !1, m = l.scroll, v = {
|
|
1003
|
+
tableLayout: q.value
|
|
982
1004
|
};
|
|
983
|
-
m?.x ? (
|
|
984
|
-
const y = l.loading, w =
|
|
1005
|
+
m?.x ? (v.width = typeof m.x == "number" ? `${m.x}px` : m.x, v.minWidth = "100%") : v.width = "100%", Object.assign(v, R.tableStyle.value);
|
|
1006
|
+
const y = l.loading, w = b.value, _ = typeof y == "object" && y !== null ? y.indicator : void 0, k = typeof y == "object" && y !== null ? y.tip : void 0, Ue = w && (i.loading ? r(lt, {
|
|
985
1007
|
loadingClass: t.loading()
|
|
986
|
-
},
|
|
1008
|
+
}, ot(e = i.loading()) ? e : {
|
|
987
1009
|
default: () => [e]
|
|
988
|
-
}) : r(
|
|
1010
|
+
}) : r(lt, {
|
|
989
1011
|
loadingClass: t.loading(),
|
|
990
|
-
indicator:
|
|
991
|
-
tip:
|
|
1012
|
+
indicator: _,
|
|
1013
|
+
tip: k
|
|
992
1014
|
}, null));
|
|
993
|
-
if (
|
|
994
|
-
const
|
|
995
|
-
ref:
|
|
996
|
-
class:
|
|
997
|
-
style:
|
|
1015
|
+
if (Fe.value) {
|
|
1016
|
+
const rl = l.showHeader !== !1 ? r("div", {
|
|
1017
|
+
ref: G,
|
|
1018
|
+
class: H(t.headerWrapper(), P.value && W?.("sticky-holder")),
|
|
1019
|
+
style: Vt.value
|
|
998
1020
|
}, [r("div", {
|
|
999
|
-
class:
|
|
1021
|
+
class: Z("block w-full min-w-full", B.value, F.value)
|
|
1000
1022
|
}, [r("table", {
|
|
1001
1023
|
"data-vtg-table": "",
|
|
1002
|
-
class:
|
|
1003
|
-
style:
|
|
1004
|
-
}, [r(
|
|
1005
|
-
columns:
|
|
1006
|
-
}, null), r(
|
|
1007
|
-
rows:
|
|
1024
|
+
class: M.value,
|
|
1025
|
+
style: v
|
|
1026
|
+
}, [r(ee, {
|
|
1027
|
+
columns: p.value
|
|
1028
|
+
}, null), r(te, null, null), r(et, {
|
|
1029
|
+
rows: fe.value,
|
|
1008
1030
|
theadClass: t.thead(),
|
|
1009
1031
|
rowClass: t.tr(),
|
|
1010
|
-
thClass:
|
|
1032
|
+
thClass: We.value,
|
|
1011
1033
|
headerCellInnerClass: t.headerCellInner()
|
|
1012
|
-
}, null)])])]) : null,
|
|
1013
|
-
ref:
|
|
1034
|
+
}, null)])])]) : null, il = I.value ? r(ta, {
|
|
1035
|
+
ref: de,
|
|
1014
1036
|
dataSource: g.value,
|
|
1015
|
-
columns:
|
|
1037
|
+
columns: p.value,
|
|
1016
1038
|
tbodyClass: t.tbody(),
|
|
1017
1039
|
rowClass: t.tr(),
|
|
1018
|
-
tdClass:
|
|
1040
|
+
tdClass: pe.value,
|
|
1019
1041
|
emptyClass: t.empty(),
|
|
1020
1042
|
bodyCellEllipsisClass: t.bodyCellEllipsis(),
|
|
1021
|
-
tableClass:
|
|
1022
|
-
tableStyle:
|
|
1043
|
+
tableClass: M.value,
|
|
1044
|
+
tableStyle: v,
|
|
1023
1045
|
rowKey: l.rowKey,
|
|
1024
|
-
height:
|
|
1025
|
-
itemHeight:
|
|
1026
|
-
fixedHeight:
|
|
1027
|
-
virtualColumn:
|
|
1028
|
-
columnMetrics:
|
|
1046
|
+
height: Ut.value,
|
|
1047
|
+
itemHeight: $t.value,
|
|
1048
|
+
fixedHeight: Gt.value,
|
|
1049
|
+
virtualColumn: ge.value,
|
|
1050
|
+
columnMetrics: je.value,
|
|
1029
1051
|
showScrollBar: "hover",
|
|
1030
|
-
onVirtualScroll: (
|
|
1031
|
-
|
|
1052
|
+
onVirtualScroll: (Ge) => {
|
|
1053
|
+
Mt(Ge.x, Ge.maxX);
|
|
1032
1054
|
}
|
|
1033
|
-
}, null) : null,
|
|
1034
|
-
ref:
|
|
1035
|
-
maxHeight:
|
|
1055
|
+
}, null) : null, dl = I.value ? null : r(Ze, {
|
|
1056
|
+
ref: ze,
|
|
1057
|
+
maxHeight: Yt.value,
|
|
1036
1058
|
wrapClass: t.bodyWrapper(),
|
|
1037
|
-
viewStyle:
|
|
1038
|
-
onScroll:
|
|
1059
|
+
viewStyle: Ve,
|
|
1060
|
+
onScroll: Ie
|
|
1039
1061
|
}, {
|
|
1040
1062
|
default: () => [r("table", {
|
|
1041
1063
|
"data-vtg-table": "",
|
|
1042
|
-
class:
|
|
1043
|
-
style:
|
|
1044
|
-
}, [r(
|
|
1045
|
-
columns:
|
|
1046
|
-
}, null), r(
|
|
1064
|
+
class: M.value,
|
|
1065
|
+
style: v
|
|
1066
|
+
}, [r(ee, {
|
|
1067
|
+
columns: p.value
|
|
1068
|
+
}, null), r(te, null, null), r(tt, {
|
|
1047
1069
|
dataSource: g.value,
|
|
1048
|
-
columns:
|
|
1070
|
+
columns: p.value,
|
|
1049
1071
|
tbodyClass: t.tbody(),
|
|
1050
1072
|
rowClass: t.tr(),
|
|
1051
|
-
tdClass:
|
|
1073
|
+
tdClass: pe.value,
|
|
1052
1074
|
emptyClass: t.empty(),
|
|
1053
1075
|
bodyCellEllipsisClass: t.bodyCellEllipsis(),
|
|
1054
1076
|
rowKey: l.rowKey
|
|
1055
|
-
}, null),
|
|
1077
|
+
}, null), d && !s && r("tfoot", {
|
|
1056
1078
|
class: t.summary()
|
|
1057
|
-
}, [
|
|
1058
|
-
}),
|
|
1059
|
-
ref:
|
|
1060
|
-
class:
|
|
1079
|
+
}, [d])])]
|
|
1080
|
+
}), ul = d && (s || I.value) ? r("div", {
|
|
1081
|
+
ref: J,
|
|
1082
|
+
class: H(t.headerWrapper(), W?.("summary"), P.value && s && W?.("sticky-holder")),
|
|
1061
1083
|
style: s ? {
|
|
1062
1084
|
position: "sticky",
|
|
1063
|
-
bottom: `${
|
|
1085
|
+
bottom: `${P.value?.offsetSummary ?? 0}px`,
|
|
1064
1086
|
zIndex: "4",
|
|
1065
1087
|
overflow: "hidden"
|
|
1066
1088
|
} : void 0
|
|
1067
1089
|
}, [r("div", {
|
|
1068
|
-
class:
|
|
1090
|
+
class: Z("block w-full min-w-full", B.value, F.value)
|
|
1069
1091
|
}, [r("table", {
|
|
1070
1092
|
"data-vtg-table": "",
|
|
1071
|
-
class:
|
|
1072
|
-
style:
|
|
1073
|
-
}, [r(
|
|
1074
|
-
columns:
|
|
1075
|
-
}, null), r(
|
|
1093
|
+
class: M.value,
|
|
1094
|
+
style: v
|
|
1095
|
+
}, [r(ee, {
|
|
1096
|
+
columns: p.value
|
|
1097
|
+
}, null), r(te, null, null), r("tfoot", {
|
|
1076
1098
|
class: t.summary()
|
|
1077
|
-
}, [
|
|
1099
|
+
}, [d])])])]) : null;
|
|
1078
1100
|
return r("div", {
|
|
1079
|
-
ref:
|
|
1080
|
-
class:
|
|
1081
|
-
}, [
|
|
1101
|
+
ref: O,
|
|
1102
|
+
class: H(t.root(), X.value && t.rootAutoHeight(), Be.value, Ce.value)
|
|
1103
|
+
}, [Y("top"), a && r("div", {
|
|
1082
1104
|
class: t.title()
|
|
1083
1105
|
}, [a]), r("div", {
|
|
1084
|
-
ref:
|
|
1085
|
-
class:
|
|
1086
|
-
}, [
|
|
1106
|
+
ref: Oe,
|
|
1107
|
+
class: H(t.wrapper(), X.value && t.wrapperAutoHeight(), P.value && Z("overflow-clip", B.value, F.value))
|
|
1108
|
+
}, [rl, il, dl, ul, Ue]), o && r("div", {
|
|
1087
1109
|
class: t.footer()
|
|
1088
|
-
}, [o]),
|
|
1110
|
+
}, [o]), Y("bottom")]);
|
|
1089
1111
|
}
|
|
1090
|
-
const
|
|
1112
|
+
const ye = r(pl, null, [r("table", {
|
|
1091
1113
|
"data-vtg-table": "",
|
|
1092
|
-
class:
|
|
1093
|
-
style:
|
|
1094
|
-
}, [r(
|
|
1095
|
-
columns:
|
|
1096
|
-
}, null), r(
|
|
1097
|
-
rows:
|
|
1114
|
+
class: M.value,
|
|
1115
|
+
style: v
|
|
1116
|
+
}, [r(ee, {
|
|
1117
|
+
columns: p.value
|
|
1118
|
+
}, null), r(te, null, null), l.showHeader !== !1 && r(et, {
|
|
1119
|
+
rows: fe.value,
|
|
1098
1120
|
theadClass: t.thead(),
|
|
1099
1121
|
rowClass: t.tr(),
|
|
1100
|
-
thClass:
|
|
1122
|
+
thClass: We.value,
|
|
1101
1123
|
headerCellInnerClass: t.headerCellInner()
|
|
1102
|
-
}, null), r(
|
|
1124
|
+
}, null), r(tt, {
|
|
1103
1125
|
dataSource: g.value,
|
|
1104
|
-
columns:
|
|
1126
|
+
columns: p.value,
|
|
1105
1127
|
tbodyClass: t.tbody(),
|
|
1106
1128
|
rowClass: t.tr(),
|
|
1107
|
-
tdClass:
|
|
1129
|
+
tdClass: pe.value,
|
|
1108
1130
|
emptyClass: t.empty(),
|
|
1109
1131
|
bodyCellEllipsisClass: t.bodyCellEllipsis(),
|
|
1110
1132
|
rowKey: l.rowKey
|
|
1111
|
-
}, null),
|
|
1133
|
+
}, null), d && r("tfoot", {
|
|
1112
1134
|
class: t.summary()
|
|
1113
|
-
}, [
|
|
1135
|
+
}, [d])]), Ue]);
|
|
1114
1136
|
return r("div", {
|
|
1115
|
-
ref:
|
|
1116
|
-
class:
|
|
1117
|
-
}, [
|
|
1137
|
+
ref: O,
|
|
1138
|
+
class: H(t.root(), Be.value, Ce.value)
|
|
1139
|
+
}, [Y("top"), a && r("div", {
|
|
1118
1140
|
class: t.title()
|
|
1119
|
-
}, [a]), r(
|
|
1120
|
-
ref:
|
|
1141
|
+
}, [a]), r(Ze, {
|
|
1142
|
+
ref: Ke,
|
|
1121
1143
|
wrapClass: t.wrapper(),
|
|
1122
|
-
viewStyle:
|
|
1123
|
-
onScroll:
|
|
1124
|
-
},
|
|
1125
|
-
default: () => [
|
|
1144
|
+
viewStyle: Ve,
|
|
1145
|
+
onScroll: Ie
|
|
1146
|
+
}, ot(ye) ? ye : {
|
|
1147
|
+
default: () => [ye]
|
|
1126
1148
|
}), o && r("div", {
|
|
1127
1149
|
class: t.footer()
|
|
1128
|
-
}, [o]),
|
|
1150
|
+
}, [o]), Y("bottom")]);
|
|
1129
1151
|
};
|
|
1130
1152
|
}
|
|
1131
1153
|
});
|
|
1132
1154
|
export {
|
|
1133
|
-
|
|
1155
|
+
Qa as default
|
|
1134
1156
|
};
|