@vtable-guild/vtable-guild 2.6.0 → 2.6.2
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/dist/core/src/components/VirtualList/hooks/useChildren.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +8 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +38 -34
- package/dist/index.full.mjs +2361 -2319
- package/dist/table/src/components/ColGroup.d.ts.map +1 -1
- package/dist/table/src/components/ColGroup.mjs +11 -10
- package/dist/table/src/components/FilterIcon.d.ts.map +1 -1
- package/dist/table/src/components/FilterIcon.mjs +10 -10
- package/dist/table/src/components/ResizeHandle.d.ts.map +1 -1
- package/dist/table/src/components/ResizeHandle.mjs +14 -11
- package/dist/table/src/components/SortButton.d.ts.map +1 -1
- package/dist/table/src/components/SortButton.mjs +18 -13
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +271 -266
- package/dist/table/src/components/TableBody.d.ts.map +1 -1
- package/dist/table/src/components/TableBody.mjs +44 -42
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +85 -83
- package/dist/table/src/components/TableEmpty.mjs +10 -8
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +89 -89
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +64 -62
- package/dist/table/src/composables/useVirtual.d.ts.map +1 -1
- package/dist/table/src/composables/useVirtual.mjs +10 -10
- package/dist/table/src/utils/compat.d.ts +9 -1
- package/dist/table/src/utils/compat.d.ts.map +1 -1
- package/dist/table/src/utils/compat.mjs +24 -20
- package/dist/theme/src/compat/antdv-table.d.ts.map +1 -1
- package/dist/theme/src/compat/antdv-table.mjs +14 -8
- package/package.json +1 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Ft, inject as zt, computed as n, provide as he, ref as H, onMounted as Ot, onBeforeUnmount as Pt, watch as D, createVNode as a, Fragment as kt, isVNode as At } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
|
-
import { prefixVtgClassNames as
|
|
4
|
-
import { mergeThemeConfigs as
|
|
5
|
-
import { mergeDeep as
|
|
6
|
-
import
|
|
3
|
+
import { prefixVtgClassNames as L } from "../../../core/src/utils/classPrefix.mjs";
|
|
4
|
+
import { mergeThemeConfigs as S, useTheme as Kt } from "../../../core/src/composables/useTheme.mjs";
|
|
5
|
+
import { mergeDeep as B } from "../../../core/src/utils/mergeDeep.mjs";
|
|
6
|
+
import xe from "../../../core/src/components/Scrollbar.mjs";
|
|
7
7
|
import { VTABLE_GUILD_INJECTION_KEY as Ce } from "../../../core/src/plugin/index.mjs";
|
|
8
|
-
import { resolveTooltipThemePreset as Wt, resolveScrollbarThemePreset as
|
|
9
|
-
import { antdvTableCompatClasses as
|
|
10
|
-
import { getEllipsisConfig as
|
|
11
|
-
import { getRootCompatClass as
|
|
12
|
-
import { useScroll as
|
|
13
|
-
import { useColumnMetrics as
|
|
14
|
-
import { resolveFixedColumnRanges as
|
|
15
|
-
import { useExpand as
|
|
16
|
-
import { useResize as
|
|
17
|
-
import { useVirtual as
|
|
18
|
-
import { useTreeData as
|
|
19
|
-
import { useHoverState as
|
|
20
|
-
import { TABLE_CONTEXT_KEY as
|
|
21
|
-
import { EXPAND_COLUMN as
|
|
22
|
-
import { resolveTablePresetConfig as
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { antdvTableTheme as
|
|
29
|
-
import { useColumns as
|
|
30
|
-
import { useSorter as
|
|
31
|
-
import { useFilter as
|
|
32
|
-
import { useSelection as
|
|
33
|
-
import { cn as
|
|
34
|
-
function
|
|
8
|
+
import { resolveTooltipThemePreset as Wt, resolveScrollbarThemePreset as _t, resolveRadioThemePreset as Mt, resolveInputThemePreset as jt, resolveCheckboxThemePreset as Vt, resolveButtonThemePreset as Ut, resolveTableThemePreset as Gt, resolveTableLocalePreset as Yt, resolveBuiltInTableLocale as Xt } from "../../../theme/src/presets/index.mjs";
|
|
9
|
+
import { antdvTableCompatClasses as $t } from "../../../theme/src/compat/antdv-table.mjs";
|
|
10
|
+
import { getEllipsisConfig as Jt } from "../utils/cell.mjs";
|
|
11
|
+
import { getRootCompatClass as qt } from "../utils/compat.mjs";
|
|
12
|
+
import { useScroll as Qt } from "../composables/useScroll.mjs";
|
|
13
|
+
import { useColumnMetrics as Zt } from "../composables/useColumnMetrics.mjs";
|
|
14
|
+
import { resolveFixedColumnRanges as el } from "../composables/useColumnWindow.mjs";
|
|
15
|
+
import { useExpand as tl } from "../composables/useExpand.mjs";
|
|
16
|
+
import { useResize as ll } from "../composables/useResize.mjs";
|
|
17
|
+
import { useVirtual as ol } from "../composables/useVirtual.mjs";
|
|
18
|
+
import { useTreeData as nl } from "../composables/useTreeData.mjs";
|
|
19
|
+
import { useHoverState as al } from "../composables/useHoverState.mjs";
|
|
20
|
+
import { TABLE_CONTEXT_KEY as rl } from "../context.mjs";
|
|
21
|
+
import { EXPAND_COLUMN as dl, SELECTION_COLUMN as il } from "../constants.mjs";
|
|
22
|
+
import { resolveTablePresetConfig as sl } from "../preset-config.mjs";
|
|
23
|
+
import ge from "./TableHeader.mjs";
|
|
24
|
+
import Se from "./TableBody.mjs";
|
|
25
|
+
import ul from "./VirtualTableBody.mjs";
|
|
26
|
+
import be from "./TableLoading.mjs";
|
|
27
|
+
import N from "./ColGroup.mjs";
|
|
28
|
+
import { antdvTableTheme as cl } from "../../../theme/src/presets/antdv/table.mjs";
|
|
29
|
+
import { useColumns as Re } from "../composables/useColumns.mjs";
|
|
30
|
+
import { useSorter as fl } from "../composables/useSorter.mjs";
|
|
31
|
+
import { useFilter as ml } from "../composables/useFilter.mjs";
|
|
32
|
+
import { useSelection as pl } from "../composables/useSelection.mjs";
|
|
33
|
+
import { cn as x } from "tailwind-variants";
|
|
34
|
+
function De(l) {
|
|
35
35
|
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !At(l);
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
function
|
|
37
|
+
const vl = [["xxxl", 2e3], ["xxl", 1600], ["xl", 1200], ["lg", 992], ["md", 768], ["sm", 576], ["xs", 0]];
|
|
38
|
+
function Ee() {
|
|
39
39
|
if (typeof window > "u")
|
|
40
40
|
return /* @__PURE__ */ new Set(["md", "sm", "xs"]);
|
|
41
41
|
const l = window.innerWidth, d = /* @__PURE__ */ new Set();
|
|
42
|
-
return
|
|
42
|
+
return vl.forEach(([i, r]) => {
|
|
43
43
|
if (i === "xs") {
|
|
44
44
|
l < 576 && d.add("xs");
|
|
45
45
|
return;
|
|
@@ -47,7 +47,7 @@ function De() {
|
|
|
47
47
|
l >= r && d.add(i);
|
|
48
48
|
}), d;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Ie(l, d) {
|
|
51
51
|
return l.reduce((i, r) => {
|
|
52
52
|
if (typeof r == "symbol")
|
|
53
53
|
return i.push(r), i;
|
|
@@ -55,7 +55,7 @@ function Ee(l, d) {
|
|
|
55
55
|
return i;
|
|
56
56
|
const v = r.fixed === !0 ? "left" : r.fixed;
|
|
57
57
|
if ("children" in r && Array.isArray(r.children)) {
|
|
58
|
-
const w =
|
|
58
|
+
const w = Ie(r.children, d);
|
|
59
59
|
return w.length === 0 || i.push({
|
|
60
60
|
...r,
|
|
61
61
|
fixed: v,
|
|
@@ -68,7 +68,7 @@ function Ee(l, d) {
|
|
|
68
68
|
}), i;
|
|
69
69
|
}, []);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const Jl = /* @__PURE__ */ Ft({
|
|
72
72
|
name: "VTable",
|
|
73
73
|
props: {
|
|
74
74
|
dataSource: {
|
|
@@ -259,19 +259,19 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
259
259
|
slots: d,
|
|
260
260
|
emit: i
|
|
261
261
|
}) {
|
|
262
|
-
const r =
|
|
262
|
+
const r = zt(Ce, null), v = n(() => r?.themePreset ?? "antdv"), w = n(() => r?.cssMode ?? "prebuilt"), C = n(() => r?.classPrefix ?? "vtg"), Te = n(() => {
|
|
263
263
|
const t = r?.theme ?? {}, o = v.value;
|
|
264
264
|
return {
|
|
265
265
|
...t,
|
|
266
|
-
button:
|
|
267
|
-
checkbox:
|
|
268
|
-
input:
|
|
269
|
-
radio:
|
|
270
|
-
scrollbar:
|
|
271
|
-
tooltip:
|
|
266
|
+
button: S(Ut(o), t.button),
|
|
267
|
+
checkbox: S(Vt(o), t.checkbox),
|
|
268
|
+
input: S(jt(o), t.input),
|
|
269
|
+
radio: S(Mt(o), t.radio),
|
|
270
|
+
scrollbar: S(_t(o), t.scrollbar),
|
|
271
|
+
tooltip: S(Wt(o), t.tooltip)
|
|
272
272
|
};
|
|
273
273
|
});
|
|
274
|
-
|
|
274
|
+
he(Ce, {
|
|
275
275
|
get themePreset() {
|
|
276
276
|
return v.value;
|
|
277
277
|
},
|
|
@@ -282,7 +282,7 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
282
282
|
return C.value;
|
|
283
283
|
},
|
|
284
284
|
get theme() {
|
|
285
|
-
return
|
|
285
|
+
return Te.value;
|
|
286
286
|
},
|
|
287
287
|
get locale() {
|
|
288
288
|
return r?.locale ?? "zh-CN";
|
|
@@ -294,39 +294,39 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
294
294
|
return r?.localeOverrides ?? {};
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
|
-
const
|
|
297
|
+
const He = n(() => Gt(v.value) ?? cl), {
|
|
298
298
|
slots: e
|
|
299
|
-
} = Kt("table",
|
|
300
|
-
compatClasses:
|
|
301
|
-
}),
|
|
299
|
+
} = Kt("table", He, l, {
|
|
300
|
+
compatClasses: $t
|
|
301
|
+
}), b = r?.compatClass === !0 ? (t) => `ant-table-${t}` : void 0, F = n(() => l.locale ?? r?.locale ?? "zh-CN"), Le = n(() => ({
|
|
302
302
|
...r?.locales ?? {},
|
|
303
303
|
...l.locales ?? {}
|
|
304
|
-
})),
|
|
305
|
-
const t =
|
|
306
|
-
return
|
|
307
|
-
}),
|
|
308
|
-
function
|
|
309
|
-
|
|
304
|
+
})), Be = n(() => {
|
|
305
|
+
const t = Yt(v.value), o = Xt(v.value, F.value), u = Le.value[F.value]?.table, s = B(B(t, o), u);
|
|
306
|
+
return B(s, B(r?.localeOverrides?.table ?? {}, l.localeOverrides));
|
|
307
|
+
}), Y = H(Ee());
|
|
308
|
+
function z() {
|
|
309
|
+
Y.value = Ee();
|
|
310
310
|
}
|
|
311
311
|
Ot(() => {
|
|
312
|
-
|
|
312
|
+
z(), window.addEventListener("resize", z);
|
|
313
313
|
}), Pt(() => {
|
|
314
|
-
window.removeEventListener("resize",
|
|
314
|
+
window.removeEventListener("resize", z);
|
|
315
315
|
});
|
|
316
|
-
const
|
|
317
|
-
leafColumns:
|
|
318
|
-
} =
|
|
316
|
+
const X = n(() => Ie(l.columns, Y.value)), g = n(() => l.sticky === !0 ? {} : typeof l.sticky == "object" ? l.sticky : void 0), {
|
|
317
|
+
leafColumns: E
|
|
318
|
+
} = Re(() => X.value), {
|
|
319
319
|
getSortOrder: O,
|
|
320
|
-
toggleSortOrder:
|
|
321
|
-
sortData:
|
|
322
|
-
sorterState:
|
|
323
|
-
sorterResult:
|
|
320
|
+
toggleSortOrder: Ne,
|
|
321
|
+
sortData: Fe,
|
|
322
|
+
sorterState: ze,
|
|
323
|
+
sorterResult: $,
|
|
324
324
|
sortColumns: Oe
|
|
325
|
-
} =
|
|
326
|
-
columns: () =>
|
|
325
|
+
} = fl({
|
|
326
|
+
columns: () => E.value,
|
|
327
327
|
tableSortDirections: () => l.sortDirections,
|
|
328
328
|
onSorterChange(t) {
|
|
329
|
-
const o =
|
|
329
|
+
const o = k();
|
|
330
330
|
i("change", P(), t, {
|
|
331
331
|
action: "sort",
|
|
332
332
|
currentDataSource: o
|
|
@@ -334,104 +334,104 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
334
334
|
}
|
|
335
335
|
}), {
|
|
336
336
|
getFilteredValue: Pe,
|
|
337
|
-
confirmFilter:
|
|
337
|
+
confirmFilter: ke,
|
|
338
338
|
resetFilter: Ae,
|
|
339
339
|
getAllFilters: P,
|
|
340
340
|
filterData: Ke
|
|
341
|
-
} =
|
|
342
|
-
columns: () =>
|
|
341
|
+
} = ml({
|
|
342
|
+
columns: () => E.value,
|
|
343
343
|
onFilterChange(t) {
|
|
344
|
-
const o =
|
|
345
|
-
i("change", t,
|
|
344
|
+
const o = k();
|
|
345
|
+
i("change", t, $.value, {
|
|
346
346
|
action: "filter",
|
|
347
347
|
currentDataSource: o
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
|
-
function
|
|
351
|
+
function k() {
|
|
352
352
|
let t = l.dataSource;
|
|
353
|
-
return t = Ke(t), t =
|
|
353
|
+
return t = Ke(t), t = Fe(t), t;
|
|
354
354
|
}
|
|
355
|
-
const A = n(() =>
|
|
356
|
-
function
|
|
355
|
+
const A = n(() => k());
|
|
356
|
+
function I(t, o) {
|
|
357
357
|
return typeof l.rowKey == "function" ? l.rowKey(t) : typeof l.rowKey == "string" && l.rowKey in t ? t[l.rowKey] : o;
|
|
358
358
|
}
|
|
359
359
|
const {
|
|
360
|
-
flattenData:
|
|
361
|
-
rowMetaMap:
|
|
360
|
+
flattenData: J,
|
|
361
|
+
rowMetaMap: q,
|
|
362
362
|
isTreeData: K,
|
|
363
363
|
toggleTreeExpand: We,
|
|
364
|
-
isTreeExpanded:
|
|
365
|
-
indentSize:
|
|
366
|
-
} =
|
|
364
|
+
isTreeExpanded: _e,
|
|
365
|
+
indentSize: Me
|
|
366
|
+
} = nl({
|
|
367
367
|
data: () => A.value,
|
|
368
368
|
childrenColumnName: () => l.childrenColumnName,
|
|
369
369
|
indentSize: () => l.indentSize,
|
|
370
|
-
getRowKey:
|
|
370
|
+
getRowKey: I,
|
|
371
371
|
defaultExpandedRowKeys: () => l.defaultExpandedRowKeys,
|
|
372
372
|
expandedRowKeys: () => l.expandedRowKeys,
|
|
373
373
|
defaultExpandAllRows: () => l.defaultExpandAllRows,
|
|
374
374
|
onExpand: l.onExpand,
|
|
375
375
|
onExpandedRowsChange: l.onExpandedRowsChange
|
|
376
376
|
}), {
|
|
377
|
-
hoverRange:
|
|
378
|
-
setHoverRange:
|
|
379
|
-
clearHoverRange:
|
|
380
|
-
} =
|
|
381
|
-
isSelected:
|
|
382
|
-
isDisabled:
|
|
383
|
-
getSelectionState:
|
|
384
|
-
toggleRow:
|
|
385
|
-
toggleAll:
|
|
386
|
-
allCheckedState:
|
|
387
|
-
invertSelection:
|
|
388
|
-
clearSelection:
|
|
389
|
-
getChangeableRowKeys:
|
|
390
|
-
} =
|
|
377
|
+
hoverRange: je,
|
|
378
|
+
setHoverRange: Ve,
|
|
379
|
+
clearHoverRange: Ue
|
|
380
|
+
} = al(100), y = n(() => K.value ? J.value.map((t) => t.record) : A.value), {
|
|
381
|
+
isSelected: Ge,
|
|
382
|
+
isDisabled: Ye,
|
|
383
|
+
getSelectionState: Xe,
|
|
384
|
+
toggleRow: $e,
|
|
385
|
+
toggleAll: Je,
|
|
386
|
+
allCheckedState: qe,
|
|
387
|
+
invertSelection: Qe,
|
|
388
|
+
clearSelection: Ze,
|
|
389
|
+
getChangeableRowKeys: et
|
|
390
|
+
} = pl({
|
|
391
391
|
rowSelection: () => l.rowSelection,
|
|
392
|
-
getRowKey:
|
|
392
|
+
getRowKey: I,
|
|
393
393
|
data: () => A.value,
|
|
394
394
|
visibleData: () => y.value,
|
|
395
395
|
childrenColumnName: () => l.childrenColumnName,
|
|
396
396
|
onSelectionChange() {
|
|
397
|
-
i("change", P(),
|
|
397
|
+
i("change", P(), $.value, {
|
|
398
398
|
action: "select",
|
|
399
399
|
currentDataSource: y.value
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}), {
|
|
403
|
-
isExpanded:
|
|
404
|
-
toggleExpand:
|
|
405
|
-
} =
|
|
403
|
+
isExpanded: tt,
|
|
404
|
+
toggleExpand: lt
|
|
405
|
+
} = tl({
|
|
406
406
|
expandable: () => l.expandable,
|
|
407
|
-
getRowKey:
|
|
407
|
+
getRowKey: I,
|
|
408
408
|
data: () => y.value
|
|
409
|
-
}),
|
|
409
|
+
}), Q = (t) => {
|
|
410
410
|
const o = l.expandable;
|
|
411
411
|
return o ? o.rowExpandable ? o.rowExpandable(t) : !!o.expandedRowRender : !1;
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
},
|
|
412
|
+
}, ot = (t, o) => {
|
|
413
|
+
Q(t) && lt(t, o);
|
|
414
|
+
}, nt = "__vtg_selection__", at = "__vtg_expand__", rt = n(() => {
|
|
415
415
|
const t = l.expandable, o = l.rowSelection, u = t && t.showExpandColumn !== !1 ? {
|
|
416
|
-
key:
|
|
416
|
+
key: at,
|
|
417
417
|
title: "",
|
|
418
418
|
width: t.columnWidth ?? 48,
|
|
419
419
|
align: "center",
|
|
420
420
|
fixed: t.fixed === !0 ? "left" : t.fixed
|
|
421
421
|
} : null, s = o ? {
|
|
422
|
-
key:
|
|
422
|
+
key: nt,
|
|
423
423
|
title: "",
|
|
424
424
|
width: o.columnWidth ?? 48,
|
|
425
425
|
align: "center",
|
|
426
426
|
fixed: o.fixed === !0 ? "left" : o.fixed || void 0
|
|
427
427
|
} : null, h = [];
|
|
428
428
|
let m = !1, p = !1;
|
|
429
|
-
for (const c of
|
|
430
|
-
if (c ===
|
|
429
|
+
for (const c of X.value) {
|
|
430
|
+
if (c === dl) {
|
|
431
431
|
u && !m && (h.push(u), m = !0);
|
|
432
432
|
continue;
|
|
433
433
|
}
|
|
434
|
-
if (c ===
|
|
434
|
+
if (c === il) {
|
|
435
435
|
s && !p && (h.push(s), p = !0);
|
|
436
436
|
continue;
|
|
437
437
|
}
|
|
@@ -441,37 +441,42 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
441
441
|
}), {
|
|
442
442
|
leafColumns: f,
|
|
443
443
|
headerRows: W
|
|
444
|
-
} =
|
|
445
|
-
headerWrapRef:
|
|
446
|
-
bodyWrapRef:
|
|
447
|
-
scrollState:
|
|
448
|
-
handleBodyScroll:
|
|
449
|
-
fixedOffsets:
|
|
450
|
-
syncHorizontalScroll:
|
|
451
|
-
} =
|
|
444
|
+
} = Re(() => rt.value), dt = n(() => W.value.length > 1), {
|
|
445
|
+
headerWrapRef: Z,
|
|
446
|
+
bodyWrapRef: ee,
|
|
447
|
+
scrollState: te,
|
|
448
|
+
handleBodyScroll: le,
|
|
449
|
+
fixedOffsets: oe,
|
|
450
|
+
syncHorizontalScroll: it
|
|
451
|
+
} = Qt({
|
|
452
452
|
displayColumns: () => f.value
|
|
453
|
-
}),
|
|
454
|
-
compatClass:
|
|
455
|
-
fixedOffsets:
|
|
456
|
-
scrollState:
|
|
457
|
-
|
|
458
|
-
|
|
453
|
+
}), ne = n(() => qt({
|
|
454
|
+
compatClass: b,
|
|
455
|
+
fixedOffsets: oe,
|
|
456
|
+
scrollState: te,
|
|
457
|
+
empty: y.value.length === 0,
|
|
458
|
+
fixedHeader: l.scroll?.y !== void 0,
|
|
459
|
+
fixedColumn: ae.value && _.value,
|
|
460
|
+
horizontalScroll: ae.value,
|
|
461
|
+
layoutFixed: M.value === "fixed"
|
|
462
|
+
})), st = n(() => l.showHeader !== !1 && (!!l.scroll?.y || !!l.sticky)), _ = n(() => f.value.some((t) => t.fixed === "left" || t.fixed === "right")), ae = n(() => l.scroll?.x !== void 0 || !!l.expandable?.fixed), ut = n(() => E.value.some((t) => Jt(t).enabled)), ct = n(() => l.scroll?.x !== void 0 || _.value), M = n(() => l.tableLayout ? l.tableLayout : l.scroll?.y || l.scroll?.x || _.value || ut.value ? "fixed" : "auto"), ft = n(() => {
|
|
463
|
+
if (g.value)
|
|
459
464
|
return {
|
|
460
465
|
position: "sticky",
|
|
461
|
-
top: `${
|
|
466
|
+
top: `${g.value.offsetHeader ?? 0}px`,
|
|
462
467
|
zIndex: "4"
|
|
463
468
|
};
|
|
464
469
|
}), {
|
|
465
|
-
enabled:
|
|
466
|
-
itemHeight:
|
|
467
|
-
listHeight:
|
|
468
|
-
fixedHeight:
|
|
469
|
-
} =
|
|
470
|
+
enabled: T,
|
|
471
|
+
itemHeight: mt,
|
|
472
|
+
listHeight: pt,
|
|
473
|
+
fixedHeight: vt
|
|
474
|
+
} = ol({
|
|
470
475
|
virtual: () => l.virtual,
|
|
471
476
|
scrollY: () => l.scroll?.y,
|
|
472
477
|
size: () => l.size,
|
|
473
478
|
rowHeight: () => l.rowHeight
|
|
474
|
-
}),
|
|
479
|
+
}), re = n(() => E.value.some((t) => !!t.customCell || !!t.customRender)), j = n(() => !dt.value || l.bordered ? {
|
|
475
480
|
table: "",
|
|
476
481
|
th: "",
|
|
477
482
|
td: ""
|
|
@@ -479,74 +484,74 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
479
484
|
table: e.groupedHeaderTable(),
|
|
480
485
|
th: e.groupedHeaderTh(),
|
|
481
486
|
td: e.groupedHeaderTd()
|
|
482
|
-
}),
|
|
483
|
-
|
|
487
|
+
}), R = n(() => x(e.table(), j.value.table) ?? ""), de = n(() => x(e.th(), j.value.th) ?? ""), V = n(() => x(e.td(), j.value.td) ?? "");
|
|
488
|
+
D([T, re], ([t, o]) => {
|
|
484
489
|
}, {
|
|
485
490
|
immediate: !0
|
|
486
491
|
});
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
t && (
|
|
490
|
-
}),
|
|
491
|
-
t && (
|
|
492
|
+
const ie = H(null), se = H(null);
|
|
493
|
+
D(() => ie.value?.wrapRef, (t) => {
|
|
494
|
+
t && (ee.value = t);
|
|
495
|
+
}), D(() => se.value?.wrapRef, (t) => {
|
|
496
|
+
t && (ee.value = t);
|
|
492
497
|
});
|
|
493
498
|
const {
|
|
494
|
-
columnWidths:
|
|
495
|
-
startResize:
|
|
496
|
-
isResizing:
|
|
497
|
-
} =
|
|
499
|
+
columnWidths: ue,
|
|
500
|
+
startResize: wt,
|
|
501
|
+
isResizing: yt
|
|
502
|
+
} = ll({
|
|
498
503
|
onResizeColumn(t, o) {
|
|
499
504
|
i("resizeColumn", t, o);
|
|
500
505
|
}
|
|
501
|
-
}),
|
|
502
|
-
|
|
506
|
+
}), ht = n(() => el(f.value)), ce = n(() => l.virtualColumn ? T.value ? re.value ? "列上有 customCell / customRender,可能返回 colSpan / rowSpan;单元格合并会让某个 td 缺席,进而破坏列宽不变量(虚拟模式本就不支持合并)" : ht.value.contiguous ? null : "固定列必须分列两端:左固定连成前缀、右固定连成后缀,中间夹着的固定列会被窗口跳过" : "它只作用于虚拟表体,需要同时开启 virtual 与 scroll.y" : null), U = n(() => l.virtualColumn && ce.value === null);
|
|
507
|
+
D(ce, (t) => {
|
|
503
508
|
}, {
|
|
504
509
|
immediate: !0
|
|
505
510
|
});
|
|
506
511
|
const {
|
|
507
|
-
metrics:
|
|
508
|
-
} =
|
|
509
|
-
enabled: () =>
|
|
510
|
-
headerEl: () =>
|
|
512
|
+
metrics: fe
|
|
513
|
+
} = Zt({
|
|
514
|
+
enabled: () => U.value,
|
|
515
|
+
headerEl: () => Z.value,
|
|
511
516
|
columns: () => f.value,
|
|
512
|
-
columnWidths:
|
|
517
|
+
columnWidths: ue,
|
|
513
518
|
hasHeader: () => l.showHeader !== !1
|
|
514
519
|
});
|
|
515
|
-
|
|
520
|
+
D([U, fe], ([t, o]) => {
|
|
516
521
|
!t || o || l.showHeader;
|
|
517
522
|
}, {
|
|
518
523
|
immediate: !0
|
|
519
524
|
});
|
|
520
|
-
function
|
|
521
|
-
return K.value ?
|
|
525
|
+
function xt(t) {
|
|
526
|
+
return K.value ? q.value.get(t)?.level ?? 0 : 0;
|
|
522
527
|
}
|
|
523
528
|
function Ct(t, o) {
|
|
524
|
-
return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(t, o,
|
|
529
|
+
return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(t, o, xt(t)) : l.rowClassName : "";
|
|
525
530
|
}
|
|
526
|
-
function
|
|
531
|
+
function gt(t, o) {
|
|
527
532
|
return l.customRow?.(t, o);
|
|
528
533
|
}
|
|
529
|
-
function
|
|
534
|
+
function St(t, o) {
|
|
530
535
|
return l.customHeaderRow?.(t, o);
|
|
531
536
|
}
|
|
532
|
-
function
|
|
537
|
+
function bt(t) {
|
|
533
538
|
if (typeof t.title != "function")
|
|
534
539
|
return t.title ?? "";
|
|
535
540
|
const o = t, u = Oe.value.filter((s) => !!s.column);
|
|
536
541
|
return t.title({
|
|
537
542
|
sortOrder: o.sorter ? O(o) ?? void 0 : void 0,
|
|
538
|
-
sortColumn:
|
|
543
|
+
sortColumn: ze.value.column,
|
|
539
544
|
sortColumns: u.length > 0 ? u : void 0,
|
|
540
545
|
filters: P()
|
|
541
546
|
});
|
|
542
547
|
}
|
|
543
|
-
function
|
|
548
|
+
function Rt(t) {
|
|
544
549
|
return !!(t.sorter && O(t));
|
|
545
550
|
}
|
|
546
|
-
const
|
|
551
|
+
const me = {
|
|
547
552
|
width: "100%",
|
|
548
553
|
minWidth: "100%"
|
|
549
|
-
},
|
|
554
|
+
}, Dt = {
|
|
550
555
|
thSortable: e.thSortable,
|
|
551
556
|
thSorted: e.thSorted,
|
|
552
557
|
tdSorted: e.tdSorted,
|
|
@@ -623,73 +628,73 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
623
628
|
resizeHandle: e.resizeHandle,
|
|
624
629
|
tdRowHover: e.tdRowHover,
|
|
625
630
|
tdRowSelectedHover: e.tdRowSelectedHover
|
|
626
|
-
},
|
|
627
|
-
return
|
|
631
|
+
}, pe = n(() => sl(v.value)), ve = H(!1);
|
|
632
|
+
return he(rl, {
|
|
628
633
|
bodyCell: d.bodyCell,
|
|
629
634
|
headerCell: d.headerCell,
|
|
630
635
|
empty: d.empty,
|
|
631
636
|
getSortOrder: O,
|
|
632
|
-
toggleSortOrder:
|
|
633
|
-
isColumnSorted:
|
|
637
|
+
toggleSortOrder: Ne,
|
|
638
|
+
isColumnSorted: Rt,
|
|
634
639
|
getFilteredValue: Pe,
|
|
635
|
-
confirmFilter:
|
|
640
|
+
confirmFilter: ke,
|
|
636
641
|
resetFilter: Ae,
|
|
637
642
|
customFilterDropdown: d.customFilterDropdown,
|
|
638
643
|
customFilterIcon: d.customFilterIcon,
|
|
639
|
-
showSorterTooltip: n(() => l.showSorterTooltip ??
|
|
644
|
+
showSorterTooltip: n(() => l.showSorterTooltip ?? pe.value.showSorterTooltip),
|
|
640
645
|
headerEllipsis: n(() => l.headerEllipsis),
|
|
641
|
-
subThemeSlots:
|
|
642
|
-
presetConfig:
|
|
646
|
+
subThemeSlots: Dt,
|
|
647
|
+
presetConfig: pe,
|
|
643
648
|
themePreset: v,
|
|
644
649
|
cssMode: w,
|
|
645
650
|
classPrefix: C,
|
|
646
|
-
vtgClass: (t) =>
|
|
647
|
-
compatClass:
|
|
648
|
-
localeName:
|
|
649
|
-
locale:
|
|
651
|
+
vtgClass: (t) => L(t, w.value, C.value),
|
|
652
|
+
compatClass: b,
|
|
653
|
+
localeName: F,
|
|
654
|
+
locale: Be,
|
|
650
655
|
rowSelection: () => l.rowSelection,
|
|
651
|
-
isSelected:
|
|
652
|
-
isDisabledRow:
|
|
653
|
-
getSelectionState:
|
|
654
|
-
toggleRow:
|
|
655
|
-
toggleAll:
|
|
656
|
-
allCheckedState: () =>
|
|
657
|
-
getRowKey:
|
|
658
|
-
invertSelection:
|
|
659
|
-
clearSelection:
|
|
660
|
-
getChangeableRowKeys:
|
|
661
|
-
fixedOffsets:
|
|
662
|
-
scrollState:
|
|
656
|
+
isSelected: Ge,
|
|
657
|
+
isDisabledRow: Ye,
|
|
658
|
+
getSelectionState: Xe,
|
|
659
|
+
toggleRow: $e,
|
|
660
|
+
toggleAll: Je,
|
|
661
|
+
allCheckedState: () => qe.value,
|
|
662
|
+
getRowKey: I,
|
|
663
|
+
invertSelection: Qe,
|
|
664
|
+
clearSelection: Ze,
|
|
665
|
+
getChangeableRowKeys: et,
|
|
666
|
+
fixedOffsets: oe,
|
|
667
|
+
scrollState: te,
|
|
663
668
|
leafColumnCount: n(() => f.value.length),
|
|
664
669
|
bordered: n(() => l.bordered),
|
|
665
|
-
tableLayout:
|
|
670
|
+
tableLayout: M,
|
|
666
671
|
sticky: n(() => l.sticky),
|
|
667
|
-
getRowProps:
|
|
672
|
+
getRowProps: gt,
|
|
668
673
|
getRowClassName: Ct,
|
|
669
|
-
getHeaderRowProps:
|
|
670
|
-
getColumnTitle:
|
|
674
|
+
getHeaderRowProps: St,
|
|
675
|
+
getColumnTitle: bt,
|
|
671
676
|
getPopupContainer: l.getPopupContainer,
|
|
672
677
|
transformCellText: l.transformCellText,
|
|
673
678
|
expandable: () => l.expandable,
|
|
674
|
-
isExpanded:
|
|
675
|
-
toggleExpand:
|
|
676
|
-
isRowExpandable:
|
|
677
|
-
columnWidths:
|
|
678
|
-
startResize:
|
|
679
|
-
isResizing: () =>
|
|
679
|
+
isExpanded: tt,
|
|
680
|
+
toggleExpand: ot,
|
|
681
|
+
isRowExpandable: Q,
|
|
682
|
+
columnWidths: ue,
|
|
683
|
+
startResize: wt,
|
|
684
|
+
isResizing: () => yt.value,
|
|
680
685
|
displayColumns: n(() => f.value),
|
|
681
686
|
registerSummaryFixed: (t) => {
|
|
682
|
-
|
|
687
|
+
ve.value = t;
|
|
683
688
|
},
|
|
684
689
|
isTreeData: K,
|
|
685
|
-
treeFlattenData:
|
|
686
|
-
getFlattenRow: (t) =>
|
|
690
|
+
treeFlattenData: J,
|
|
691
|
+
getFlattenRow: (t) => q.value.get(t),
|
|
687
692
|
toggleTreeExpand: We,
|
|
688
|
-
isTreeExpanded:
|
|
689
|
-
treeIndentSize:
|
|
690
|
-
hoverRange:
|
|
691
|
-
setHoverRange:
|
|
692
|
-
clearHoverRange:
|
|
693
|
+
isTreeExpanded: _e,
|
|
694
|
+
treeIndentSize: Me,
|
|
695
|
+
hoverRange: je,
|
|
696
|
+
setHoverRange: Ve,
|
|
697
|
+
clearHoverRange: Ue,
|
|
693
698
|
hoverable: n(() => l.hoverable !== !1)
|
|
694
699
|
}), () => {
|
|
695
700
|
let t;
|
|
@@ -697,143 +702,143 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
697
702
|
data: y.value
|
|
698
703
|
}) : null, u = l.footer ? l.footer(y.value) : d.footer ? d.footer({
|
|
699
704
|
data: y.value
|
|
700
|
-
}) : null, s = d.summary ? d.summary() : null, h =
|
|
701
|
-
tableLayout:
|
|
705
|
+
}) : null, s = d.summary ? d.summary() : null, h = ve.value !== !1, m = l.scroll, p = {
|
|
706
|
+
tableLayout: M.value
|
|
702
707
|
};
|
|
703
|
-
m?.x ? (p.width = typeof m.x == "number" ? `${m.x}px` : m.x, p.minWidth = "100%") : p.width =
|
|
704
|
-
const c = l.loading,
|
|
708
|
+
m?.x ? (p.width = typeof m.x == "number" ? `${m.x}px` : m.x, p.minWidth = "100%") : p.width = ct.value ? "max-content" : "100%";
|
|
709
|
+
const c = l.loading, Et = c === !0 || typeof c == "object" && c !== null && c.spinning !== !1, It = typeof c == "object" && c !== null ? c.indicator : void 0, Tt = typeof c == "object" && c !== null ? c.tip : void 0, we = Et && (d.loading ? a(be, {
|
|
705
710
|
loadingClass: e.loading()
|
|
706
|
-
},
|
|
711
|
+
}, De(t = d.loading()) ? t : {
|
|
707
712
|
default: () => [t]
|
|
708
|
-
}) : a(
|
|
713
|
+
}) : a(be, {
|
|
709
714
|
loadingClass: e.loading(),
|
|
710
|
-
indicator:
|
|
711
|
-
tip:
|
|
715
|
+
indicator: It,
|
|
716
|
+
tip: Tt
|
|
712
717
|
}, null));
|
|
713
|
-
if (
|
|
714
|
-
const
|
|
715
|
-
ref:
|
|
716
|
-
class: e.headerWrapper(),
|
|
717
|
-
style:
|
|
718
|
+
if (st.value) {
|
|
719
|
+
const Ht = l.showHeader !== !1 ? a("div", {
|
|
720
|
+
ref: Z,
|
|
721
|
+
class: x(e.headerWrapper(), g.value && b?.("sticky-holder")),
|
|
722
|
+
style: ft.value
|
|
718
723
|
}, [a("div", {
|
|
719
|
-
class:
|
|
724
|
+
class: L("block w-full min-w-full", w.value, C.value)
|
|
720
725
|
}, [a("table", {
|
|
721
|
-
class:
|
|
726
|
+
class: R.value,
|
|
722
727
|
style: p
|
|
723
|
-
}, [a(
|
|
728
|
+
}, [a(N, {
|
|
724
729
|
columns: f.value
|
|
725
|
-
}, null), a(
|
|
730
|
+
}, null), a(ge, {
|
|
726
731
|
rows: W.value,
|
|
727
732
|
theadClass: e.thead(),
|
|
728
733
|
rowClass: e.tr(),
|
|
729
|
-
thClass:
|
|
734
|
+
thClass: de.value,
|
|
730
735
|
headerCellInnerClass: e.headerCellInner()
|
|
731
|
-
}, null)])])]) : null,
|
|
736
|
+
}, null)])])]) : null, Lt = T.value ? a(ul, {
|
|
732
737
|
dataSource: y.value,
|
|
733
738
|
columns: f.value,
|
|
734
739
|
tbodyClass: e.tbody(),
|
|
735
740
|
rowClass: e.tr(),
|
|
736
|
-
tdClass:
|
|
741
|
+
tdClass: V.value,
|
|
737
742
|
emptyClass: e.empty(),
|
|
738
743
|
bodyCellEllipsisClass: e.bodyCellEllipsis(),
|
|
739
|
-
tableClass:
|
|
744
|
+
tableClass: R.value,
|
|
740
745
|
tableStyle: p,
|
|
741
746
|
rowKey: l.rowKey,
|
|
742
|
-
height:
|
|
743
|
-
itemHeight:
|
|
744
|
-
fixedHeight:
|
|
745
|
-
virtualColumn:
|
|
746
|
-
columnMetrics:
|
|
747
|
+
height: pt.value,
|
|
748
|
+
itemHeight: mt.value,
|
|
749
|
+
fixedHeight: vt.value,
|
|
750
|
+
virtualColumn: U.value,
|
|
751
|
+
columnMetrics: fe.value,
|
|
747
752
|
showScrollBar: "hover",
|
|
748
|
-
onVirtualScroll: (
|
|
749
|
-
|
|
753
|
+
onVirtualScroll: (ye) => {
|
|
754
|
+
it(ye.x, ye.maxX);
|
|
750
755
|
}
|
|
751
|
-
}, null) : null,
|
|
752
|
-
ref:
|
|
756
|
+
}, null) : null, Bt = T.value ? null : a(xe, {
|
|
757
|
+
ref: ie,
|
|
753
758
|
maxHeight: m?.y !== void 0 ? typeof m.y == "number" ? m.y : String(m.y) : void 0,
|
|
754
759
|
wrapClass: e.bodyWrapper(),
|
|
755
|
-
viewStyle:
|
|
756
|
-
onScroll:
|
|
760
|
+
viewStyle: me,
|
|
761
|
+
onScroll: le
|
|
757
762
|
}, {
|
|
758
763
|
default: () => [a("table", {
|
|
759
|
-
class:
|
|
764
|
+
class: R.value,
|
|
760
765
|
style: p
|
|
761
|
-
}, [a(
|
|
766
|
+
}, [a(N, {
|
|
762
767
|
columns: f.value
|
|
763
|
-
}, null), a(
|
|
768
|
+
}, null), a(Se, {
|
|
764
769
|
dataSource: y.value,
|
|
765
770
|
columns: f.value,
|
|
766
771
|
tbodyClass: e.tbody(),
|
|
767
772
|
rowClass: e.tr(),
|
|
768
|
-
tdClass:
|
|
773
|
+
tdClass: V.value,
|
|
769
774
|
emptyClass: e.empty(),
|
|
770
775
|
bodyCellEllipsisClass: e.bodyCellEllipsis(),
|
|
771
776
|
rowKey: l.rowKey
|
|
772
777
|
}, null), s && !h && a("tfoot", {
|
|
773
778
|
class: e.summary()
|
|
774
779
|
}, [s])])]
|
|
775
|
-
}),
|
|
776
|
-
class: e.headerWrapper(),
|
|
780
|
+
}), Nt = s && h ? a("div", {
|
|
781
|
+
class: x(e.headerWrapper(), b?.("summary"), g.value && b?.("sticky-holder")),
|
|
777
782
|
style: {
|
|
778
783
|
position: "sticky",
|
|
779
|
-
bottom: `${
|
|
784
|
+
bottom: `${g.value?.offsetSummary ?? 0}px`,
|
|
780
785
|
zIndex: "4",
|
|
781
786
|
overflow: "hidden"
|
|
782
787
|
}
|
|
783
788
|
}, [a("div", {
|
|
784
|
-
class:
|
|
789
|
+
class: L("block w-full min-w-full", w.value, C.value)
|
|
785
790
|
}, [a("table", {
|
|
786
|
-
class:
|
|
791
|
+
class: R.value,
|
|
787
792
|
style: p
|
|
788
|
-
}, [a(
|
|
793
|
+
}, [a(N, {
|
|
789
794
|
columns: f.value
|
|
790
795
|
}, null), a("tfoot", {
|
|
791
796
|
class: e.summary()
|
|
792
797
|
}, [s])])])]) : null;
|
|
793
798
|
return a("div", {
|
|
794
|
-
class:
|
|
799
|
+
class: x(e.root(), ne.value)
|
|
795
800
|
}, [o && a("div", {
|
|
796
801
|
class: e.title()
|
|
797
802
|
}, [o]), a("div", {
|
|
798
|
-
class:
|
|
799
|
-
}, [
|
|
803
|
+
class: x(e.wrapper(), g.value && L("overflow-clip", w.value, C.value))
|
|
804
|
+
}, [Ht, Lt, Bt, Nt, we]), u && a("div", {
|
|
800
805
|
class: e.footer()
|
|
801
806
|
}, [u])]);
|
|
802
807
|
}
|
|
803
|
-
const
|
|
804
|
-
class:
|
|
808
|
+
const G = a(kt, null, [a("table", {
|
|
809
|
+
class: R.value,
|
|
805
810
|
style: p
|
|
806
|
-
}, [a(
|
|
811
|
+
}, [a(N, {
|
|
807
812
|
columns: f.value
|
|
808
|
-
}, null), l.showHeader !== !1 && a(
|
|
813
|
+
}, null), l.showHeader !== !1 && a(ge, {
|
|
809
814
|
rows: W.value,
|
|
810
815
|
theadClass: e.thead(),
|
|
811
816
|
rowClass: e.tr(),
|
|
812
|
-
thClass:
|
|
817
|
+
thClass: de.value,
|
|
813
818
|
headerCellInnerClass: e.headerCellInner()
|
|
814
|
-
}, null), a(
|
|
819
|
+
}, null), a(Se, {
|
|
815
820
|
dataSource: y.value,
|
|
816
821
|
columns: f.value,
|
|
817
822
|
tbodyClass: e.tbody(),
|
|
818
823
|
rowClass: e.tr(),
|
|
819
|
-
tdClass:
|
|
824
|
+
tdClass: V.value,
|
|
820
825
|
emptyClass: e.empty(),
|
|
821
826
|
bodyCellEllipsisClass: e.bodyCellEllipsis(),
|
|
822
827
|
rowKey: l.rowKey
|
|
823
828
|
}, null), s && a("tfoot", {
|
|
824
829
|
class: e.summary()
|
|
825
|
-
}, [s])]),
|
|
830
|
+
}, [s])]), we]);
|
|
826
831
|
return a("div", {
|
|
827
|
-
class:
|
|
832
|
+
class: x(e.root(), ne.value)
|
|
828
833
|
}, [o && a("div", {
|
|
829
834
|
class: e.title()
|
|
830
|
-
}, [o]), a(
|
|
831
|
-
ref:
|
|
835
|
+
}, [o]), a(xe, {
|
|
836
|
+
ref: se,
|
|
832
837
|
wrapClass: e.wrapper(),
|
|
833
|
-
viewStyle:
|
|
834
|
-
onScroll:
|
|
835
|
-
},
|
|
836
|
-
default: () => [
|
|
838
|
+
viewStyle: me,
|
|
839
|
+
onScroll: le
|
|
840
|
+
}, De(G) ? G : {
|
|
841
|
+
default: () => [G]
|
|
837
842
|
}), u && a("div", {
|
|
838
843
|
class: e.footer()
|
|
839
844
|
}, [u])]);
|
|
@@ -841,5 +846,5 @@ const $l = /* @__PURE__ */ Nt({
|
|
|
841
846
|
}
|
|
842
847
|
});
|
|
843
848
|
export {
|
|
844
|
-
|
|
849
|
+
Jl as default
|
|
845
850
|
};
|