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