@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.
Files changed (43) hide show
  1. package/css/style.css +3 -0
  2. package/css/tailwind3-utilities.css +3 -0
  3. package/dist/core/src/components/VTableGuildConfigProvider.d.ts.map +1 -1
  4. package/dist/core/src/components/VTableGuildConfigProvider.mjs +17 -12
  5. package/dist/core/src/composables/useTheme.d.ts +9 -1
  6. package/dist/core/src/composables/useTheme.d.ts.map +1 -1
  7. package/dist/core/src/composables/useTheme.mjs +83 -60
  8. package/dist/core/src/index.d.ts +4 -0
  9. package/dist/core/src/index.d.ts.map +1 -1
  10. package/dist/core/src/plugin/index.d.ts.map +1 -1
  11. package/dist/core/src/plugin/index.mjs +4 -3
  12. package/dist/core/src/utils/types.d.ts +3 -0
  13. package/dist/core/src/utils/types.d.ts.map +1 -1
  14. package/dist/css/style.css +3 -0
  15. package/dist/css/tailwind3-utilities.css +3 -0
  16. package/dist/index.full.mjs +3142 -3020
  17. package/dist/index.mjs +39 -37
  18. package/dist/table/src/components/Table.d.ts +6 -6
  19. package/dist/table/src/components/Table.d.ts.map +1 -1
  20. package/dist/table/src/components/Table.mjs +264 -255
  21. package/dist/table/src/components/TableBody.d.ts.map +1 -1
  22. package/dist/table/src/components/TableBody.mjs +44 -43
  23. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  24. package/dist/table/src/components/TableCell.mjs +69 -55
  25. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  26. package/dist/table/src/components/TableHeaderCell.mjs +12 -12
  27. package/dist/table/src/components/VTableCompatClass.test.d.ts +2 -0
  28. package/dist/table/src/components/VTableCompatClass.test.d.ts.map +1 -0
  29. package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
  30. package/dist/table/src/components/VirtualTableBody.mjs +31 -30
  31. package/dist/table/src/composables/useFixedColumnStyle.d.ts.map +1 -1
  32. package/dist/table/src/composables/useFixedColumnStyle.mjs +12 -11
  33. package/dist/table/src/context.d.ts +7 -0
  34. package/dist/table/src/context.d.ts.map +1 -1
  35. package/dist/table/src/utils/compat.d.ts +9 -0
  36. package/dist/table/src/utils/compat.d.ts.map +1 -0
  37. package/dist/table/src/utils/compat.mjs +28 -0
  38. package/dist/theme/src/compat/antdv-table.d.ts +4 -0
  39. package/dist/theme/src/compat/antdv-table.d.ts.map +1 -0
  40. package/dist/theme/src/compat/antdv-table.mjs +51 -0
  41. package/dist/theme/src/index.d.ts +2 -0
  42. package/dist/theme/src/index.d.ts.map +1 -1
  43. package/package.json +1 -1
@@ -1,43 +1,45 @@
1
- import { defineComponent as Lt, inject as Bt, computed as n, provide as me, ref as I, onMounted as Nt, onBeforeUnmount as Ft, watch as S, createVNode as a, Fragment as Ot, isVNode as Pt } from "vue";
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 T } from "../../../core/src/utils/classPrefix.mjs";
4
- import { mergeThemeConfigs as C, useTheme as zt } from "../../../core/src/composables/useTheme.mjs";
5
- import { mergeDeep as H } from "../../../core/src/utils/mergeDeep.mjs";
6
- import pe from "../../../core/src/components/Scrollbar.mjs";
7
- import { VTABLE_GUILD_INJECTION_KEY as ve } from "../../../core/src/plugin/index.mjs";
8
- import { resolveTooltipThemePreset as At, resolveScrollbarThemePreset as Kt, resolveRadioThemePreset as Wt, resolveInputThemePreset as kt, resolveCheckboxThemePreset as _t, resolveButtonThemePreset as Mt, resolveTableThemePreset as jt, resolveTableLocalePreset as Vt, resolveBuiltInTableLocale as Ut } from "../../../theme/src/presets/index.mjs";
9
- import { getEllipsisConfig as Gt } from "../utils/cell.mjs";
10
- import { useScroll as Yt } from "../composables/useScroll.mjs";
11
- import { useColumnMetrics as Xt } from "../composables/useColumnMetrics.mjs";
12
- import { resolveFixedColumnRanges as $t } from "../composables/useColumnWindow.mjs";
13
- import { useExpand as Jt } from "../composables/useExpand.mjs";
14
- import { useResize as qt } from "../composables/useResize.mjs";
15
- import { useVirtual as Qt } from "../composables/useVirtual.mjs";
16
- import { useTreeData as Zt } from "../composables/useTreeData.mjs";
17
- import { useHoverState as el } from "../composables/useHoverState.mjs";
18
- import { TABLE_CONTEXT_KEY as tl } from "../context.mjs";
19
- import { EXPAND_COLUMN as ll, SELECTION_COLUMN as ol } from "../constants.mjs";
20
- import { resolveTablePresetConfig as nl } from "../preset-config.mjs";
21
- import we from "./TableHeader.mjs";
22
- import ye from "./TableBody.mjs";
23
- import al from "./VirtualTableBody.mjs";
24
- import he from "./TableLoading.mjs";
25
- import L from "./ColGroup.mjs";
26
- import { antdvTableTheme as rl } from "../../../theme/src/presets/antdv/table.mjs";
27
- import { useColumns as xe } from "../composables/useColumns.mjs";
28
- import { useSorter as dl } from "../composables/useSorter.mjs";
29
- import { useFilter as il } from "../composables/useFilter.mjs";
30
- import { useSelection as sl } from "../composables/useSelection.mjs";
31
- import { cn as B } from "tailwind-variants";
32
- function Ce(l) {
33
- return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !Pt(l);
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 ul = [["xxxl", 2e3], ["xxl", 1600], ["xl", 1200], ["lg", 992], ["md", 768], ["sm", 576], ["xs", 0]];
36
- function ge() {
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 ul.forEach(([i, r]) => {
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 Se(l, d) {
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 = Se(r.children, d);
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 Ml = /* @__PURE__ */ Lt({
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 = Bt(ve, null), v = n(() => r?.themePreset ?? "antdv"), w = n(() => r?.cssMode ?? "prebuilt"), x = n(() => r?.classPrefix ?? "vtg"), be = n(() => {
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: C(Mt(o), t.button),
265
- checkbox: C(_t(o), t.checkbox),
266
- input: C(kt(o), t.input),
267
- radio: C(Wt(o), t.radio),
268
- scrollbar: C(Kt(o), t.scrollbar),
269
- tooltip: C(At(o), t.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
- me(ve, {
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 x.value;
282
+ return C.value;
281
283
  },
282
284
  get theme() {
283
- return be.value;
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 De = n(() => jt(v.value) ?? rl), {
297
+ const Te = n(() => Ut(v.value) ?? ul), {
296
298
  slots: e
297
- } = zt("table", De, l), N = n(() => l.locale ?? r?.locale ?? "zh-CN"), Re = n(() => ({
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
- })), Ee = n(() => {
301
- const t = Vt(v.value), o = Ut(v.value, N.value), u = Re.value[N.value]?.table, s = H(H(t, o), u);
302
- return H(s, H(r?.localeOverrides?.table ?? {}, l.localeOverrides));
303
- }), V = I(ge());
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
- V.value = ge();
309
+ U.value = De();
306
310
  }
307
- Nt(() => {
311
+ Ot(() => {
308
312
  F(), window.addEventListener("resize", F);
309
- }), Ft(() => {
313
+ }), Pt(() => {
310
314
  window.removeEventListener("resize", F);
311
315
  });
312
- const U = n(() => Se(l.columns, V.value)), b = n(() => l.sticky === !0 ? {} : typeof l.sticky == "object" ? l.sticky : void 0), {
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
- } = xe(() => U.value), {
318
+ } = be(() => G.value), {
315
319
  getSortOrder: O,
316
- toggleSortOrder: Ie,
317
- sortData: Te,
318
- sorterState: He,
319
- sorterResult: G,
320
- sortColumns: Le
321
- } = dl({
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: Be,
333
- confirmFilter: Ne,
334
- resetFilter: Fe,
336
+ getFilteredValue: Pe,
337
+ confirmFilter: ze,
338
+ resetFilter: Ae,
335
339
  getAllFilters: P,
336
- filterData: Oe
337
- } = il({
340
+ filterData: Ke
341
+ } = fl({
338
342
  columns: () => D.value,
339
343
  onFilterChange(t) {
340
344
  const o = z();
341
- i("change", t, G.value, {
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 = Oe(t), t = Te(t), t;
353
+ return t = Ke(t), t = Ne(t), t;
350
354
  }
351
355
  const A = n(() => z());
352
- function R(t, o) {
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: Y,
357
- rowMetaMap: X,
360
+ flattenData: X,
361
+ rowMetaMap: $,
358
362
  isTreeData: K,
359
- toggleTreeExpand: Pe,
360
- isTreeExpanded: ze,
361
- indentSize: Ae
362
- } = Zt({
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: R,
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: Ke,
374
- setHoverRange: We,
375
- clearHoverRange: ke
376
- } = el(100), y = n(() => K.value ? Y.value.map((t) => t.record) : A.value), {
377
- isSelected: _e,
378
- isDisabled: Me,
379
- getSelectionState: je,
380
- toggleRow: Ve,
381
- toggleAll: Ue,
382
- allCheckedState: Ge,
383
- invertSelection: Ye,
384
- clearSelection: Xe,
385
- getChangeableRowKeys: $e
386
- } = sl({
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: R,
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(), G.value, {
397
+ i("change", P(), Y.value, {
394
398
  action: "select",
395
399
  currentDataSource: y.value
396
400
  });
397
401
  }
398
402
  }), {
399
- isExpanded: Je,
400
- toggleExpand: qe
401
- } = Jt({
403
+ isExpanded: et,
404
+ toggleExpand: tt
405
+ } = el({
402
406
  expandable: () => l.expandable,
403
- getRowKey: R,
407
+ getRowKey: E,
404
408
  data: () => y.value
405
- }), $ = (t) => {
409
+ }), J = (t) => {
406
410
  const o = l.expandable;
407
411
  return o ? o.rowExpandable ? o.rowExpandable(t) : !!o.expandedRowRender : !1;
408
- }, Qe = (t, o) => {
409
- $(t) && qe(t, o);
410
- }, Ze = "__vtg_selection__", et = "__vtg_expand__", tt = n(() => {
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: et,
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: Ze,
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 U.value) {
426
- if (c === ll) {
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 === ol) {
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
- } = xe(() => tt.value), lt = n(() => W.value.length > 1), {
441
- headerWrapRef: J,
442
- bodyWrapRef: q,
443
- scrollState: ot,
444
- handleBodyScroll: Q,
445
- fixedOffsets: nt,
446
- syncHorizontalScroll: at
447
- } = Yt({
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
- }), rt = n(() => l.showHeader !== !1 && (!!l.scroll?.y || !!l.sticky)), Z = n(() => f.value.some((t) => t.fixed === "left" || t.fixed === "right")), dt = n(() => D.value.some((t) => Gt(t).enabled)), it = n(() => l.scroll?.x !== void 0 || Z.value), ee = n(() => l.tableLayout ? l.tableLayout : l.scroll?.y || l.scroll?.x || Z.value || dt.value ? "fixed" : "auto"), st = n(() => {
450
- if (b.value)
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: `${b.value.offsetHeader ?? 0}px`,
461
+ top: `${R.value.offsetHeader ?? 0}px`,
454
462
  zIndex: "4"
455
463
  };
456
464
  }), {
457
- enabled: E,
458
- itemHeight: ut,
459
- listHeight: ct,
460
- fixedHeight: ft
461
- } = Qt({
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
- }), te = n(() => D.value.some((t) => !!t.customCell || !!t.customRender)), k = n(() => !lt.value || l.bordered ? {
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
- }), g = n(() => B(e.table(), k.value.table) ?? ""), le = n(() => B(e.th(), k.value.th) ?? ""), _ = n(() => B(e.td(), k.value.td) ?? "");
475
- S([E, te], ([t, o]) => {
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 oe = I(null), ne = I(null);
480
- S(() => oe.value?.wrapRef, (t) => {
481
- t && (q.value = t);
482
- }), S(() => ne.value?.wrapRef, (t) => {
483
- t && (q.value = 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: ae,
487
- startResize: mt,
488
- isResizing: pt
489
- } = qt({
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
- }), vt = n(() => $t(f.value)), re = n(() => l.virtualColumn ? E.value ? te.value ? "列上有 customCell / customRender,可能返回 colSpan / rowSpan;单元格合并会让某个 td 缺席,进而破坏列宽不变量(虚拟模式本就不支持合并)" : vt.value.contiguous ? null : "固定列必须分列两端:左固定连成前缀、右固定连成后缀,中间夹着的固定列会被窗口跳过" : "它只作用于虚拟表体,需要同时开启 virtual 与 scroll.y" : null), M = n(() => l.virtualColumn && re.value === null);
494
- S(re, (t) => {
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: de
500
- } = Xt({
507
+ metrics: ce
508
+ } = Qt({
501
509
  enabled: () => M.value,
502
- headerEl: () => J.value,
510
+ headerEl: () => q.value,
503
511
  columns: () => f.value,
504
- columnWidths: ae,
512
+ columnWidths: se,
505
513
  hasHeader: () => l.showHeader !== !1
506
514
  });
507
- S([M, de], ([t, o]) => {
515
+ b([M, ce], ([t, o]) => {
508
516
  !t || o || l.showHeader;
509
517
  }, {
510
518
  immediate: !0
511
519
  });
512
- function wt(t) {
513
- return K.value ? X.value.get(t)?.level ?? 0 : 0;
520
+ function ht(t) {
521
+ return K.value ? $.value.get(t)?.level ?? 0 : 0;
514
522
  }
515
- function yt(t, o) {
516
- return l.rowClassName ? typeof l.rowClassName == "function" ? l.rowClassName(t, o, wt(t)) : l.rowClassName : "";
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 ht(t, o) {
526
+ function xt(t, o) {
519
527
  return l.customRow?.(t, o);
520
528
  }
521
- function xt(t, o) {
529
+ function gt(t, o) {
522
530
  return l.customHeaderRow?.(t, o);
523
531
  }
524
- function Ct(t) {
532
+ function St(t) {
525
533
  if (typeof t.title != "function")
526
534
  return t.title ?? "";
527
- const o = t, u = Le.value.filter((s) => !!s.column);
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: He.value.column,
538
+ sortColumn: Fe.value.column,
531
539
  sortColumns: u.length > 0 ? u : void 0,
532
540
  filters: P()
533
541
  });
534
542
  }
535
- function gt(t) {
543
+ function bt(t) {
536
544
  return !!(t.sorter && O(t));
537
545
  }
538
- const ie = {
546
+ const fe = {
539
547
  width: "100%",
540
548
  minWidth: "100%"
541
- }, St = {
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
- }, se = n(() => nl(v.value)), ue = I(!1);
619
- return me(tl, {
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: Ie,
625
- isColumnSorted: gt,
626
- getFilteredValue: Be,
627
- confirmFilter: Ne,
628
- resetFilter: Fe,
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 ?? se.value.showSorterTooltip),
639
+ showSorterTooltip: n(() => l.showSorterTooltip ?? me.value.showSorterTooltip),
632
640
  headerEllipsis: n(() => l.headerEllipsis),
633
- subThemeSlots: St,
634
- presetConfig: se,
641
+ subThemeSlots: Rt,
642
+ presetConfig: me,
635
643
  themePreset: v,
636
644
  cssMode: w,
637
- classPrefix: x,
638
- vtgClass: (t) => T(t, w.value, x.value),
645
+ classPrefix: C,
646
+ vtgClass: (t) => H(t, w.value, C.value),
647
+ compatClass: V,
639
648
  localeName: N,
640
- locale: Ee,
649
+ locale: Le,
641
650
  rowSelection: () => l.rowSelection,
642
- isSelected: _e,
643
- isDisabledRow: Me,
644
- getSelectionState: je,
645
- toggleRow: Ve,
646
- toggleAll: Ue,
647
- allCheckedState: () => Ge.value,
648
- getRowKey: R,
649
- invertSelection: Ye,
650
- clearSelection: Xe,
651
- getChangeableRowKeys: $e,
652
- fixedOffsets: nt,
653
- scrollState: ot,
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: ee,
665
+ tableLayout: ne,
657
666
  sticky: n(() => l.sticky),
658
- getRowProps: ht,
659
- getRowClassName: yt,
660
- getHeaderRowProps: xt,
661
- getColumnTitle: Ct,
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: Je,
666
- toggleExpand: Qe,
667
- isRowExpandable: $,
668
- columnWidths: ae,
669
- startResize: mt,
670
- isResizing: () => pt.value,
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
- ue.value = t;
682
+ pe.value = t;
674
683
  },
675
684
  isTreeData: K,
676
- treeFlattenData: Y,
677
- getFlattenRow: (t) => X.value.get(t),
678
- toggleTreeExpand: Pe,
679
- isTreeExpanded: ze,
680
- treeIndentSize: Ae,
681
- hoverRange: Ke,
682
- setHoverRange: We,
683
- clearHoverRange: ke,
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 = ue.value !== !1, m = l.scroll, p = {
692
- tableLayout: ee.value
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 = it.value ? "max-content" : "100%";
695
- const c = l.loading, bt = c === !0 || typeof c == "object" && c !== null && c.spinning !== !1, Dt = typeof c == "object" && c !== null ? c.indicator : void 0, Rt = typeof c == "object" && c !== null ? c.tip : void 0, ce = bt && (d.loading ? a(he, {
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
- }, Ce(t = d.loading()) ? t : {
706
+ }, Re(t = d.loading()) ? t : {
698
707
  default: () => [t]
699
- }) : a(he, {
708
+ }) : a(Se, {
700
709
  loadingClass: e.loading(),
701
- indicator: Dt,
702
- tip: Rt
710
+ indicator: Et,
711
+ tip: It
703
712
  }, null));
704
- if (rt.value) {
705
- const Et = l.showHeader !== !1 ? a("div", {
706
- ref: J,
713
+ if (it.value) {
714
+ const Tt = l.showHeader !== !1 ? a("div", {
715
+ ref: q,
707
716
  class: e.headerWrapper(),
708
- style: st.value
717
+ style: ct.value
709
718
  }, [a("div", {
710
- class: T("block w-full min-w-full", w.value, x.value)
719
+ class: H("block w-full min-w-full", w.value, C.value)
711
720
  }, [a("table", {
712
- class: g.value,
721
+ class: S.value,
713
722
  style: p
714
- }, [a(L, {
723
+ }, [a(B, {
715
724
  columns: f.value
716
- }, null), a(we, {
725
+ }, null), a(xe, {
717
726
  rows: W.value,
718
727
  theadClass: e.thead(),
719
728
  rowClass: e.tr(),
720
- thClass: le.value,
729
+ thClass: re.value,
721
730
  headerCellInnerClass: e.headerCellInner()
722
- }, null)])])]) : null, It = E.value ? a(al, {
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: g.value,
739
+ tableClass: S.value,
731
740
  tableStyle: p,
732
741
  rowKey: l.rowKey,
733
- height: ct.value,
734
- itemHeight: ut.value,
735
- fixedHeight: ft.value,
742
+ height: mt.value,
743
+ itemHeight: ft.value,
744
+ fixedHeight: pt.value,
736
745
  virtualColumn: M.value,
737
- columnMetrics: de.value,
746
+ columnMetrics: ce.value,
738
747
  showScrollBar: "hover",
739
- onVirtualScroll: (fe) => {
740
- at(fe.x, fe.maxX);
748
+ onVirtualScroll: (we) => {
749
+ dt(we.x, we.maxX);
741
750
  }
742
- }, null) : null, Tt = E.value ? null : a(pe, {
743
- ref: oe,
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: ie,
747
- onScroll: Q
755
+ viewStyle: fe,
756
+ onScroll: ee
748
757
  }, {
749
758
  default: () => [a("table", {
750
- class: g.value,
759
+ class: S.value,
751
760
  style: p
752
- }, [a(L, {
761
+ }, [a(B, {
753
762
  columns: f.value
754
- }, null), a(ye, {
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
- }), Ht = s && h ? a("div", {
775
+ }), Bt = s && h ? a("div", {
767
776
  class: e.headerWrapper(),
768
777
  style: {
769
778
  position: "sticky",
770
- bottom: `${b.value?.offsetSummary ?? 0}px`,
779
+ bottom: `${R.value?.offsetSummary ?? 0}px`,
771
780
  zIndex: "4",
772
781
  overflow: "hidden"
773
782
  }
774
783
  }, [a("div", {
775
- class: T("block w-full min-w-full", w.value, x.value)
784
+ class: H("block w-full min-w-full", w.value, C.value)
776
785
  }, [a("table", {
777
- class: g.value,
786
+ class: S.value,
778
787
  style: p
779
- }, [a(L, {
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: B(e.wrapper(), b.value && T("overflow-clip", w.value, x.value))
790
- }, [Et, It, Tt, Ht, ce]), u && a("div", {
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(Ot, null, [a("table", {
795
- class: g.value,
803
+ const j = a(zt, null, [a("table", {
804
+ class: S.value,
796
805
  style: p
797
- }, [a(L, {
806
+ }, [a(B, {
798
807
  columns: f.value
799
- }, null), l.showHeader !== !1 && a(we, {
808
+ }, null), l.showHeader !== !1 && a(xe, {
800
809
  rows: W.value,
801
810
  theadClass: e.thead(),
802
811
  rowClass: e.tr(),
803
- thClass: le.value,
812
+ thClass: re.value,
804
813
  headerCellInnerClass: e.headerCellInner()
805
- }, null), a(ye, {
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])]), ce]);
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(pe, {
822
- ref: ne,
830
+ }, [o]), a(he, {
831
+ ref: ie,
823
832
  wrapClass: e.wrapper(),
824
- viewStyle: ie,
825
- onScroll: Q
826
- }, Ce(j) ? j : {
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
- Ml as default
844
+ $l as default
836
845
  };