@vtable-guild/vtable-guild 2.7.1 → 2.8.0

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