@vtable-guild/vtable-guild 2.5.0 → 2.6.1

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 (52) 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 +3018 -2865
  17. package/dist/index.mjs +39 -37
  18. package/dist/table/src/components/ColGroup.d.ts.map +1 -1
  19. package/dist/table/src/components/ColGroup.mjs +11 -10
  20. package/dist/table/src/components/FilterIcon.d.ts.map +1 -1
  21. package/dist/table/src/components/FilterIcon.mjs +10 -10
  22. package/dist/table/src/components/ResizeHandle.d.ts.map +1 -1
  23. package/dist/table/src/components/ResizeHandle.mjs +14 -11
  24. package/dist/table/src/components/SortButton.d.ts.map +1 -1
  25. package/dist/table/src/components/SortButton.mjs +18 -13
  26. package/dist/table/src/components/Table.d.ts +6 -6
  27. package/dist/table/src/components/Table.d.ts.map +1 -1
  28. package/dist/table/src/components/Table.mjs +288 -274
  29. package/dist/table/src/components/TableBody.d.ts.map +1 -1
  30. package/dist/table/src/components/TableBody.mjs +53 -50
  31. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  32. package/dist/table/src/components/TableCell.mjs +107 -91
  33. package/dist/table/src/components/TableEmpty.mjs +10 -8
  34. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  35. package/dist/table/src/components/TableHeaderCell.mjs +93 -93
  36. package/dist/table/src/components/VTableCompatClass.test.d.ts +2 -0
  37. package/dist/table/src/components/VTableCompatClass.test.d.ts.map +1 -0
  38. package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
  39. package/dist/table/src/components/VirtualTableBody.mjs +63 -60
  40. package/dist/table/src/composables/useFixedColumnStyle.d.ts.map +1 -1
  41. package/dist/table/src/composables/useFixedColumnStyle.mjs +12 -11
  42. package/dist/table/src/context.d.ts +7 -0
  43. package/dist/table/src/context.d.ts.map +1 -1
  44. package/dist/table/src/utils/compat.d.ts +17 -0
  45. package/dist/table/src/utils/compat.d.ts.map +1 -0
  46. package/dist/table/src/utils/compat.mjs +32 -0
  47. package/dist/theme/src/compat/antdv-table.d.ts +4 -0
  48. package/dist/theme/src/compat/antdv-table.d.ts.map +1 -0
  49. package/dist/theme/src/compat/antdv-table.mjs +57 -0
  50. package/dist/theme/src/index.d.ts +2 -0
  51. package/dist/theme/src/index.d.ts.map +1 -1
  52. package/package.json +1 -1
@@ -16,7 +16,7 @@ import ol from "./SelectionCheckbox.mjs";
16
16
  import nl from "./SelectionDropdown.mjs";
17
17
  import rl from "./ResizeHandle.mjs";
18
18
  import { TABLE_ALIGN_CLASSES as sl } from "../../../theme/src/presets/antdv/table.mjs";
19
- import { cn as g } from "tailwind-variants";
19
+ import { cn as C } from "tailwind-variants";
20
20
  function al(t) {
21
21
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Be(t);
22
22
  }
@@ -45,25 +45,25 @@ const Il = /* @__PURE__ */ Re({
45
45
  }
46
46
  },
47
47
  setup(t) {
48
- const e = Pe(Ge, {}), o = a(() => t.cell.isLeaf ? t.cell.column : null), E = a(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), d = a(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), k = a(() => Ye(d.value, "colSpan") ?? t.cell.colSpan), O = a(() => t.cell.rowSpan), w = a(() => {
48
+ const e = Pe(Ge, {}), o = a(() => t.cell.isLeaf ? t.cell.column : null), O = a(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), d = a(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), N = a(() => Ye(d.value, "colSpan") ?? t.cell.colSpan), R = a(() => t.cell.rowSpan), _ = a(() => {
49
49
  const {
50
50
  onClick: l,
51
51
  ...r
52
52
  } = $e(d.value);
53
53
  return r;
54
- }), _ = a(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), I = a(() => !!o.value?.sorter), F = a(() => !o.value || !I.value ? !1 : o.value.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), N = a(() => {
54
+ }), y = a(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), F = a(() => !!o.value?.sorter), L = a(() => !o.value || !F.value ? !1 : o.value.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), M = a(() => {
55
55
  const l = o.value;
56
56
  return l ? (l.filters?.length ?? 0) > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
57
- }), R = a(() => !o.value || !N.value ? [] : e.getFilteredValue?.(o.value) ?? []), P = a(() => {
57
+ }), P = a(() => !o.value || !M.value ? [] : e.getFilteredValue?.(o.value) ?? []), h = a(() => {
58
58
  const l = o.value;
59
- return l ? l.filtered !== void 0 ? l.filtered : R.value.length > 0 : !1;
60
- }), Z = a(() => o.value?.filterDropdownOpen !== void 0), ee = f(!1), y = a(() => Z.value ? o.value?.filterDropdownOpen ?? !1 : ee.value);
59
+ return l ? l.filtered !== void 0 ? l.filtered : P.value.length > 0 : !1;
60
+ }), Z = a(() => o.value?.filterDropdownOpen !== void 0), ee = f(!1), T = a(() => Z.value ? o.value?.filterDropdownOpen ?? !1 : ee.value);
61
61
  function v(l) {
62
62
  Z.value || (ee.value = l), o.value?.onFilterDropdownOpenChange?.(l);
63
63
  }
64
64
  const m = f(null), H = f(null);
65
65
  function V() {
66
- v(!y.value);
66
+ v(!T.value);
67
67
  }
68
68
  function K(l) {
69
69
  H.value && !H.value.contains(l.target) && !m.value?.contains(l.target) && v(!1);
@@ -72,7 +72,7 @@ const Il = /* @__PURE__ */ Re({
72
72
  const l = o.value;
73
73
  return l ? !!l.filterDropdown || !!l.customFilterDropdown && !!e.customFilterDropdown : !1;
74
74
  });
75
- ve(y, (l) => {
75
+ ve(T, (l) => {
76
76
  l && me.value ? He(() => {
77
77
  document.addEventListener("mousedown", K);
78
78
  }) : document.removeEventListener("mousedown", K);
@@ -87,9 +87,9 @@ const Il = /* @__PURE__ */ Re({
87
87
  bottom: 0
88
88
  };
89
89
  }
90
- const T = f([]), te = f(null);
91
- ve(() => R.value, (l) => {
92
- T.value = [...l];
90
+ const x = f([]), te = f(null);
91
+ ve(() => P.value, (l) => {
92
+ x.value = [...l];
93
93
  }, {
94
94
  immediate: !0
95
95
  });
@@ -99,25 +99,25 @@ const Il = /* @__PURE__ */ Re({
99
99
  function pe() {
100
100
  o.value && (e.resetFilter?.(o.value), v(!1));
101
101
  }
102
- function ge() {
102
+ function Ce() {
103
103
  v(!1);
104
104
  }
105
- const Ce = a(() => {
105
+ const ge = a(() => {
106
106
  const l = t.cell.leafColumns;
107
107
  if (!l.length) return null;
108
- const r = l[0], u = l[l.length - 1], C = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd, x = e.fixedOffsets?.value?.get(C), D = e.fixedOffsets?.value?.get(s);
109
- return l.every((p) => p.fixed === "left") && x?.left !== void 0 ? {
110
- left: x.left,
111
- isLastLeft: D?.isLastLeft
112
- } : l.every((p) => p.fixed === "right") && D?.right !== void 0 ? {
113
- right: D.right,
114
- isFirstRight: x?.isFirstRight
108
+ const r = l[0], u = l[l.length - 1], g = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd, D = e.fixedOffsets?.value?.get(g), A = e.fixedOffsets?.value?.get(s);
109
+ return l.every((p) => p.fixed === "left") && D?.left !== void 0 ? {
110
+ left: D.left,
111
+ isLastLeft: A?.isLastLeft
112
+ } : l.every((p) => p.fixed === "right") && A?.right !== void 0 ? {
113
+ right: A.right,
114
+ isFirstRight: D?.isFirstRight
115
115
  } : null;
116
116
  }), {
117
117
  fixedStyle: he,
118
118
  fixedClass: oe
119
119
  } = Xe({
120
- fixedInfo: () => Ce.value
120
+ fixedInfo: () => ge.value
121
121
  }), Se = a(() => {
122
122
  const l = e.themePreset?.value === "antdv", r = e.bordered?.value ?? !1;
123
123
  return !l || r || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
@@ -140,8 +140,8 @@ const Il = /* @__PURE__ */ Re({
140
140
  }
141
141
  return ne.value;
142
142
  }), ye = a(() => {
143
- const l = t.cell.column.align ? sl[t.cell.column.align] : "", r = I.value ? e.subThemeSlots?.thSortable() : "", u = _.value ? e.subThemeSlots?.thSorted() : "", C = o.value?.key === "__vtg_expand__";
144
- return g(t.thClass, l, r, u, Se.value, t.cell.column.className, C ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, oe.value, be.value);
143
+ const l = t.cell.column.align ? sl[t.cell.column.align] : "", r = F.value ? e.subThemeSlots?.thSortable() : "", u = y.value ? e.subThemeSlots?.thSorted() : "", g = o.value?.key === "__vtg_expand__";
144
+ return C(t.thClass, l, r, u, Se.value, t.cell.column.className, g ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, oe.value, be.value, g ? e.compatClass?.("row-expand-icon-cell") : "");
145
145
  }), re = a(() => {
146
146
  const l = {};
147
147
  if (o.value) {
@@ -154,9 +154,9 @@ const Il = /* @__PURE__ */ Re({
154
154
  ...u ?? {},
155
155
  ...r ?? {}
156
156
  };
157
- }), L = f(!1), M = f(null);
157
+ }), E = f(!1), k = f(null);
158
158
  function Te() {
159
- return M.value ? M.value.getBoundingClientRect() : {
159
+ return k.value ? k.value.getBoundingClientRect() : {
160
160
  top: 0,
161
161
  left: 0,
162
162
  right: 0,
@@ -165,27 +165,27 @@ const Il = /* @__PURE__ */ Re({
165
165
  }
166
166
  let c = null;
167
167
  function xe() {
168
- c && clearTimeout(c), L.value = !0;
168
+ c && clearTimeout(c), E.value = !0;
169
169
  }
170
170
  function se() {
171
171
  c && clearTimeout(c), c = setTimeout(() => {
172
- L.value = !1;
172
+ E.value = !1;
173
173
  }, 100);
174
174
  }
175
175
  function De() {
176
176
  c && clearTimeout(c);
177
177
  }
178
178
  function Ae() {
179
- c && clearTimeout(c), L.value = !1;
179
+ c && clearTimeout(c), E.value = !1;
180
180
  }
181
- const W = f(!1), j = f(!1), Ie = a(() => F.value && W.value && !j.value);
181
+ const W = f(!1), j = f(!1), Ie = a(() => L.value && W.value && !j.value);
182
182
  function Fe(l) {
183
- const r = w.value.onMouseenter;
184
- typeof r == "function" && r(l), F.value && (W.value = !0);
183
+ const r = _.value.onMouseenter;
184
+ typeof r == "function" && r(l), L.value && (W.value = !0);
185
185
  }
186
186
  function Le(l) {
187
- const r = w.value.onMouseleave;
188
- typeof r == "function" && r(l), F.value && (W.value = !1);
187
+ const r = _.value.onMouseleave;
188
+ typeof r == "function" && r(l), L.value && (W.value = !1);
189
189
  }
190
190
  function q() {
191
191
  j.value = !0;
@@ -195,67 +195,67 @@ const Il = /* @__PURE__ */ Re({
195
195
  }
196
196
  function U(l) {
197
197
  const r = d.value?.onClick;
198
- typeof r == "function" && r(l), o.value && I.value && e.toggleSortOrder?.(o.value);
198
+ typeof r == "function" && r(l), o.value && F.value && e.toggleSortOrder?.(o.value);
199
199
  }
200
200
  return () => {
201
- if (k.value === 0 || O.value === 0)
201
+ if (N.value === 0 || R.value === 0)
202
202
  return null;
203
- const l = k.value !== 1 ? k.value : void 0, r = O.value !== 1 ? O.value : void 0;
203
+ const l = N.value !== 1 ? N.value : void 0, r = R.value !== 1 ? R.value : void 0;
204
204
  if (o.value?.key === "__vtg_selection__") {
205
- const n = e.rowSelection?.(), h = n?.type === "radio", ue = n?.hideSelectAll === !0, X = n?.selections !== void 0 && n.selections !== !1, S = e.locale?.value, A = n?.columnTitle, Oe = A !== void 0, ce = g(t.thClass, e.vtgClass?.(Oe ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, d.value?.class, d.value?.className, oe.value), fe = re.value;
205
+ const n = e.rowSelection?.(), S = n?.type === "radio", ue = n?.hideSelectAll === !0, X = n?.selections !== void 0 && n.selections !== !1, b = e.locale?.value, I = n?.columnTitle, Oe = I !== void 0, ce = C(t.thClass, e.vtgClass?.(Oe ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, d.value?.class, d.value?.className, oe.value, e.compatClass?.("selection-column")), fe = re.value;
206
206
  let Y = [];
207
207
  if (X && (n?.selections === !0 ? Y = [{
208
208
  key: "__vtg_select_all__",
209
- text: S?.selection?.selectAll ?? "全选当页",
209
+ text: b?.selection?.selectAll ?? "全选当页",
210
210
  onSelect: () => e.toggleAll?.(!0)
211
211
  }, {
212
212
  key: "__vtg_select_invert__",
213
- text: S?.selection?.selectInvert ?? "反选当页",
213
+ text: b?.selection?.selectInvert ?? "反选当页",
214
214
  onSelect: () => e.invertSelection?.()
215
215
  }, {
216
216
  key: "__vtg_select_none__",
217
- text: S?.selection?.selectNone ?? "清空所有",
217
+ text: b?.selection?.selectNone ?? "清空所有",
218
218
  onSelect: () => e.clearSelection?.()
219
- }] : Array.isArray(n?.selections) && (Y = n.selections.map((b) => b === qe ? {
219
+ }] : Array.isArray(n?.selections) && (Y = n.selections.map((w) => w === qe ? {
220
220
  key: "__vtg_select_all__",
221
- text: S?.selection?.selectAll ?? "全选当页",
221
+ text: b?.selection?.selectAll ?? "全选当页",
222
222
  onSelect: () => e.toggleAll?.(!0)
223
- } : b === ze ? {
223
+ } : w === ze ? {
224
224
  key: "__vtg_select_invert__",
225
- text: S?.selection?.selectInvert ?? "反选当页",
225
+ text: b?.selection?.selectInvert ?? "反选当页",
226
226
  onSelect: () => e.invertSelection?.()
227
- } : b === Ue ? {
227
+ } : w === Ue ? {
228
228
  key: "__vtg_select_none__",
229
- text: S?.selection?.selectNone ?? "清空所有",
229
+ text: b?.selection?.selectNone ?? "清空所有",
230
230
  onSelect: () => e.clearSelection?.()
231
- } : b))), h)
232
- return i("th", $(w.value, {
231
+ } : w))), S)
232
+ return i("th", $(_.value, {
233
233
  class: ce,
234
234
  style: fe,
235
235
  colspan: l,
236
236
  rowspan: r,
237
- "data-vtg-leaf-col": E.value,
237
+ "data-vtg-leaf-col": O.value,
238
238
  onClick: U
239
- }), [A]);
240
- const de = e.allCheckedState?.() ?? "none", Ne = A ? i("span", {
239
+ }), [I]);
240
+ const de = e.allCheckedState?.() ?? "none", Ne = I ? i("span", {
241
241
  class: e.vtgClass?.("ml-2")
242
- }, [A]) : null;
243
- return i("th", $(w.value, {
242
+ }, [I]) : null;
243
+ return i("th", $(_.value, {
244
244
  class: ce,
245
245
  style: fe,
246
246
  colspan: l,
247
247
  rowspan: r,
248
- "data-vtg-leaf-col": E.value,
248
+ "data-vtg-leaf-col": O.value,
249
249
  onClick: U
250
- }), [ue ? A : i("span", {
251
- class: e.vtgClass?.("inline-flex items-center justify-center relative")
250
+ }), [ue ? I : i("span", {
251
+ class: C(e.vtgClass?.("inline-flex items-center justify-center relative"), e.compatClass?.("selection"))
252
252
  }, [i(ol, {
253
253
  checked: de === "all",
254
254
  indeterminate: de === "partial",
255
- onChange: (b) => e.toggleAll?.(b)
255
+ onChange: (w) => e.toggleAll?.(w)
256
256
  }, null), Ne, X && i("span", {
257
- ref: M,
258
- class: g(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
257
+ ref: k,
258
+ class: C(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
259
259
  onMouseenter: xe,
260
260
  onMouseleave: se,
261
261
  role: "button",
@@ -263,24 +263,24 @@ const Il = /* @__PURE__ */ Re({
263
263
  }, [i(je, null, null)])]), !ue && X && i(nl, {
264
264
  items: Y,
265
265
  anchorRect: Te(),
266
- popupContainer: Q(e, M.value),
267
- visible: L.value,
266
+ popupContainer: Q(e, k.value),
267
+ visible: E.value,
268
268
  onClose: Ae,
269
269
  onMouseenter: De,
270
270
  onMouseleave: se
271
271
  }, null)]);
272
272
  }
273
- const u = e.locale?.value, C = _.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : _.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value, x = e.subThemeSlots?.sortAreaWrapper(), D = e.subThemeSlots?.sortAreaTitle(), p = i("span", {
274
- class: x
273
+ const u = e.locale?.value, g = y.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : y.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value, D = e.subThemeSlots?.sortAreaWrapper(), A = e.subThemeSlots?.sortAreaTitle(), p = i("span", {
274
+ class: D
275
275
  }, [i("span", {
276
- class: g(D, we.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
277
- }, [_e.value]), I.value && i(el, {
278
- sortOrder: _.value
279
- }, null)]), ae = e.subThemeSlots?.sortAreaOuter(), Me = F.value ? i("span", {
276
+ class: C(A, we.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
277
+ }, [_e.value]), F.value && i(el, {
278
+ sortOrder: y.value
279
+ }, null)]), ae = e.subThemeSlots?.sortAreaOuter(), Me = L.value ? i("span", {
280
280
  class: ae
281
281
  }, [i(We, {
282
282
  block: !0,
283
- title: C,
283
+ title: g,
284
284
  placement: "top",
285
285
  open: Ie.value
286
286
  }, al(p) ? p : {
@@ -288,7 +288,7 @@ const Il = /* @__PURE__ */ Re({
288
288
  })]) : i("span", {
289
289
  class: ae
290
290
  }, [p]), Ee = s && (s.filterIcon ? i("span", {
291
- class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
291
+ class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), h.value && e.compatClass && "active"),
292
292
  ref: m,
293
293
  onMouseenter: q,
294
294
  onMouseleave: z,
@@ -299,9 +299,9 @@ const Il = /* @__PURE__ */ Re({
299
299
  role: "button",
300
300
  "aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
301
301
  }, [s.filterIcon({
302
- filtered: P.value
302
+ filtered: h.value
303
303
  })]) : e.customFilterIcon ? i("span", {
304
- class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
304
+ class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), h.value && e.compatClass && "active"),
305
305
  ref: m,
306
306
  onMouseenter: q,
307
307
  onMouseleave: z,
@@ -313,76 +313,76 @@ const Il = /* @__PURE__ */ Re({
313
313
  "aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
314
314
  }, [e.customFilterIcon({
315
315
  column: s,
316
- filtered: P.value
316
+ filtered: h.value
317
317
  })]) : i("span", {
318
318
  ref: m,
319
- class: e.subThemeSlots?.filterIconWrapper(),
319
+ class: [e.subThemeSlots?.filterIconWrapper(), h.value && e.compatClass && "active"],
320
320
  onMouseenter: q,
321
321
  onMouseleave: z,
322
322
  onMousedown: (n) => n.stopPropagation()
323
323
  }, [i(ll, {
324
- active: P.value,
324
+ active: h.value,
325
325
  onClick: () => V()
326
326
  }, null)])), G = s && {
327
327
  column: s,
328
- selectedKeys: T.value,
328
+ selectedKeys: x.value,
329
329
  setSelectedKeys: (n) => {
330
- T.value = [...n];
330
+ x.value = [...n];
331
331
  },
332
332
  confirm: (n) => {
333
- B(T.value), n?.closeDropdown === !1 && v(!0);
333
+ B(x.value), n?.closeDropdown === !1 && v(!0);
334
334
  },
335
335
  clearFilters: (n) => {
336
- e.resetFilter?.(s), T.value = [], n?.confirm && B([]), n?.closeDropdown !== !1 && v(!1);
336
+ e.resetFilter?.(s), x.value = [], n?.confirm && B([]), n?.closeDropdown !== !1 && v(!1);
337
337
  },
338
338
  filters: s.filters ?? [],
339
- visible: y.value,
339
+ visible: T.value,
340
340
  close: () => v(!1)
341
341
  }, ie = s?.customFilterDropdown ? e.customFilterDropdown : void 0, ke = s && G && (() => {
342
342
  const n = typeof s.filterDropdown == "function" ? s.filterDropdown(G) : s.filterDropdown ?? (ie ? ie(G) : null);
343
343
  if (n) {
344
- const h = Q(e, m.value);
344
+ const S = Q(e, m.value);
345
345
  return i(Ke, {
346
- to: h
346
+ to: S
347
347
  }, {
348
- default: () => [y.value && i("div", {
348
+ default: () => [T.value && i("div", {
349
349
  ref: H,
350
350
  class: e.subThemeSlots?.filterDropdown(),
351
- style: Qe(le(), h, 150)
351
+ style: Qe(le(), S, 150)
352
352
  }, [n])]
353
353
  });
354
354
  }
355
355
  return i(tl, {
356
356
  filters: s.filters ?? [],
357
- selectedKeys: R.value,
357
+ selectedKeys: P.value,
358
358
  multiple: s.filterMultiple !== !1,
359
359
  anchorRect: le(),
360
360
  popupContainer: Q(e, m.value),
361
361
  filterSearch: s.filterSearch ?? !1,
362
362
  filterMode: s.filterMode ?? "menu",
363
363
  expandedKeys: te.value,
364
- visible: y.value,
364
+ visible: T.value,
365
365
  onConfirm: B,
366
366
  onReset: pe,
367
- onClose: ge,
368
- "onUpdate:expandedKeys": (h) => {
369
- te.value = h;
367
+ onClose: Ce,
368
+ "onUpdate:expandedKeys": (S) => {
369
+ te.value = S;
370
370
  }
371
371
  }, null);
372
372
  })();
373
- return i("th", $(w.value, {
373
+ return i("th", $(_.value, {
374
374
  class: ye.value,
375
375
  style: re.value,
376
376
  colspan: l,
377
377
  rowspan: r,
378
- "data-vtg-leaf-col": E.value,
378
+ "data-vtg-leaf-col": O.value,
379
379
  onClick: U,
380
380
  onMouseenter: Fe,
381
381
  onMouseleave: Le,
382
- "aria-sort": o.value ? il(_.value) : void 0
382
+ "aria-sort": o.value ? il(y.value) : void 0
383
383
  }), [i("span", {
384
- class: g(e.vtgClass?.("flex items-center"), t.headerCellInnerClass)
385
- }, [Me, N.value && Ee]), N.value && ke, o.value?.resizable && i(rl, {
384
+ class: C(e.vtgClass?.("flex items-center"), t.headerCellInnerClass, M.value && e.compatClass?.("filter-column"))
385
+ }, [Me, M.value && Ee]), M.value && ke, o.value?.resizable && i(rl, {
386
386
  column: o.value,
387
387
  colIndex: t.cell.colStart
388
388
  }, null)]);
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=VTableCompatClass.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTableCompatClass.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableCompatClass.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualTableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VirtualTableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,KAAK,CAAA;AAElD,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAMpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,sBAAsB,GAAG,iBAAiB,GAAG;IAChD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;;;cAQgC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;;cAEhC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,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IAK3F,wCAAwC;;;;;IAExC;;;OAGG;;;;;IAEH,qCAAqC;;cACJ,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;;;IAC/D,gEAAgE;;cAE5C,QAAQ,CAAC,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;;;;cAIvC,QAAQ,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;;;;;4BAJjC,sBAAsB,KAAK,IAAI;+BAhBT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG;;;;;;AAb7F,wBA+YE"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as z, inject as $, ref as g, computed as c, onBeforeUnmount as D, watch as G, createVNode as r, isVNode as U } from "vue";
1
+ import { defineComponent as X, inject as $, ref as g, computed as c, onBeforeUnmount as D, watch as G, createVNode as r, isVNode as U } from "vue";
2
2
  import "../../../core/src/utils/tv.mjs";
3
3
  import Y from "./TableRow.mjs";
4
4
  import J from "./TableCell.mjs";
@@ -6,12 +6,13 @@ import Q from "./TableEmpty.mjs";
6
6
  import Z from "./ColGroup.mjs";
7
7
  import { TABLE_CONTEXT_KEY as ee } from "../context.mjs";
8
8
  import { resolveFixedColumnRanges as te, useColumnWindow as le } from "../composables/useColumnWindow.mjs";
9
- import ne from "../../../core/src/components/VirtualList/VirtualList.mjs";
10
- import { cn as C } from "tailwind-variants";
11
- function oe(e) {
9
+ import { getRowCompatClass as ne, getExpandedRowCompatClass as oe } from "../utils/compat.mjs";
10
+ import ae from "../../../core/src/components/VirtualList/VirtualList.mjs";
11
+ import { cn as x } from "tailwind-variants";
12
+ function re(e) {
12
13
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !U(e);
13
14
  }
14
- const he = /* @__PURE__ */ z({
15
+ const xe = /* @__PURE__ */ X({
15
16
  name: "VirtualTableBody",
16
17
  props: {
17
18
  dataSource: {
@@ -91,14 +92,14 @@ const he = /* @__PURE__ */ z({
91
92
  }
92
93
  },
93
94
  setup(e) {
94
- const a = $(ee, {}), w = g(), x = g(0), f = g(0);
95
- function b(t) {
96
- x.value = t.x, e.onVirtualScroll?.({
95
+ const a = $(ee, {}), w = g(), b = g(0), f = g(0);
96
+ function S(t) {
97
+ b.value = t.x, e.onVirtualScroll?.({
97
98
  ...t,
98
99
  maxX: w.value?.getHorizontalRange() ?? 0
99
100
  });
100
101
  }
101
- function N(t, l) {
102
+ function O(t, l) {
102
103
  return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] : l;
103
104
  }
104
105
  function T(t) {
@@ -114,55 +115,55 @@ const he = /* @__PURE__ */ z({
114
115
  }), k = c(() => {
115
116
  const t = e.virtualColumn ? e.columnMetrics?.total : void 0;
116
117
  return t && t > 0 ? t : V.value;
117
- }), m = c(() => te(e.columns)), S = c(() => {
118
+ }), m = c(() => te(e.columns)), R = c(() => {
118
119
  if (!e.virtualColumn || f.value <= 0) return null;
119
120
  const t = e.columnMetrics;
120
121
  return !t || t.widths.length !== e.columns.length ? null : t.widths;
121
122
  }), {
122
- active: R,
123
+ active: p,
123
124
  start: q,
124
- end: O,
125
- leftSpacer: p,
126
- rightSpacer: E
125
+ end: W,
126
+ leftSpacer: E,
127
+ rightSpacer: K
127
128
  } = le({
128
- widths: () => S.value,
129
+ widths: () => R.value,
129
130
  leftFixedCount: () => m.value.leftFixedCount,
130
131
  rightFixedStart: () => m.value.rightFixedStart,
131
- offsetX: () => x.value,
132
+ offsetX: () => b.value,
132
133
  viewportWidth: () => f.value
133
- }), W = c(() => {
134
+ }), H = c(() => {
134
135
  const t = e.columns.length;
135
- if (!R.value)
136
+ if (!p.value)
136
137
  return Array.from({
137
138
  length: t
138
- }, (n, i) => ({
139
+ }, (o, i) => ({
139
140
  index: i
140
141
  }));
141
142
  const {
142
143
  leftFixedCount: l,
143
144
  rightFixedStart: d
144
- } = m.value, o = [];
145
- for (let n = 0; n < l; n += 1) o.push({
146
- index: n
145
+ } = m.value, n = [];
146
+ for (let o = 0; o < l; o += 1) n.push({
147
+ index: o
147
148
  });
148
- p.value > 0 && o.push({
149
- spacer: p.value
149
+ E.value > 0 && n.push({
150
+ spacer: E.value
150
151
  });
151
- for (let n = q.value; n <= O.value; n += 1) o.push({
152
- index: n
152
+ for (let o = q.value; o <= W.value; o += 1) n.push({
153
+ index: o
153
154
  });
154
- E.value > 0 && o.push({
155
- spacer: E.value
155
+ K.value > 0 && n.push({
156
+ spacer: K.value
156
157
  });
157
- for (let n = d; n < t; n += 1) o.push({
158
- index: n
158
+ for (let o = d; o < t; o += 1) n.push({
159
+ index: o
159
160
  });
160
- return o;
161
+ return n;
161
162
  });
162
- function re(t) {
163
+ function ie(t) {
163
164
  }
164
165
  let u = null, s = null;
165
- function K(t) {
166
+ function B(t) {
166
167
  const l = t ?? null;
167
168
  l !== s && (u && s && u.unobserve(s), s = l, l && (f.value = l.clientWidth, !u && typeof ResizeObserver < "u" && (u = new ResizeObserver(() => {
168
169
  s && (f.value = s.clientWidth);
@@ -173,9 +174,9 @@ const he = /* @__PURE__ */ z({
173
174
  }), G(() => w.value, (t) => {
174
175
  if (t) {
175
176
  const l = t.getScrollInfo();
176
- b(l), t.nativeElement, K(t.nativeElement);
177
+ S(l), t.nativeElement, B(t.nativeElement);
177
178
  } else
178
- K(null);
179
+ B(null);
179
180
  }), () => e.dataSource.length === 0 ? r("table", {
180
181
  class: e.tableClass,
181
182
  style: e.tableStyle
@@ -187,7 +188,7 @@ const he = /* @__PURE__ */ z({
187
188
  colSpan: e.columns.length || 1,
188
189
  emptyClass: e.emptyClass,
189
190
  tdClass: e.tdClass
190
- }, null)])]) : r(ne, {
191
+ }, null)])]) : r(ae, {
191
192
  ref: w,
192
193
  data: e.dataSource,
193
194
  height: e.height,
@@ -196,7 +197,7 @@ const he = /* @__PURE__ */ z({
196
197
  scrollWidth: k.value || void 0,
197
198
  disableHeightMeasure: e.fixedHeight,
198
199
  fullHeight: !1,
199
- onVirtualScroll: b,
200
+ onVirtualScroll: S,
200
201
  showScrollBar: e.showScrollBar,
201
202
  style: {
202
203
  overflow: "hidden"
@@ -207,9 +208,9 @@ const he = /* @__PURE__ */ z({
207
208
  index: l
208
209
  }) => {
209
210
  let d;
210
- const o = l, n = N(t, o), i = a.expandable?.(), H = a.isExpanded?.(n) ?? !1, _ = i?.expandRowByClick ?? !1, I = a.isRowExpandable?.(t) ?? !1, B = a.getRowClassName?.(t, o), j = a.getRowProps?.(t, o), A = (a.isTreeData?.value ? a.getFlattenRow?.(t) : void 0)?.level ?? 0, L = typeof i?.expandedRowClassName == "function" ? i.expandedRowClassName(t, o, A) : i?.expandedRowClassName, M = _ ? () => {
211
- I && a.toggleExpand?.(t, o);
212
- } : void 0, F = W.value, P = R.value ? S.value : null;
211
+ const n = l, o = O(t, n), i = a.expandable?.(), _ = a.isExpanded?.(o) ?? !1, I = i?.expandRowByClick ?? !1, j = a.isRowExpandable?.(t) ?? !1, F = a.getRowClassName?.(t, n), A = a.getRowProps?.(t, n), v = (a.isTreeData?.value ? a.getFlattenRow?.(t) : void 0)?.level ?? 0, z = typeof i?.expandedRowClassName == "function" ? i.expandedRowClassName(t, n, v) : i?.expandedRowClassName, L = I ? () => {
212
+ j && a.toggleExpand?.(t, n);
213
+ } : void 0, N = H.value, M = p.value ? R.value : null;
213
214
  return r("table", {
214
215
  class: e.tableClass,
215
216
  style: {
@@ -219,44 +220,46 @@ const he = /* @__PURE__ */ z({
219
220
  }, [r("tbody", {
220
221
  class: e.tbodyClass
221
222
  }, [r(Y, {
222
- key: n,
223
- rowClass: C(e.rowClass, B) ?? "",
224
- rowProps: j,
225
- onClick: M
226
- }, oe(d = F.map((v, X) => {
227
- if (v.spacer !== void 0)
223
+ key: o,
224
+ rowClass: x(e.rowClass, F, ne(a, t, n, v)) ?? "",
225
+ rowProps: A,
226
+ onClick: L
227
+ }, re(d = N.map((h, P) => {
228
+ if (h.spacer !== void 0)
228
229
  return r("td", {
229
- key: `__vtg_spacer_${X}`,
230
+ key: `__vtg_spacer_${P}`,
230
231
  style: {
231
- width: `${v.spacer}px`,
232
+ width: `${h.spacer}px`,
232
233
  padding: "0"
233
234
  },
234
235
  "aria-hidden": "true"
235
236
  }, null);
236
- const y = v.index, h = e.columns[y];
237
+ const y = h.index, C = e.columns[y];
237
238
  return r(J, {
238
- key: h.key ?? String(h.dataIndex ?? y),
239
+ key: C.key ?? String(C.dataIndex ?? y),
239
240
  record: t,
240
- rowIndex: o,
241
- column: h,
241
+ rowIndex: n,
242
+ column: C,
242
243
  colIndex: y,
243
- widthOverride: P?.[y],
244
+ widthOverride: M?.[y],
244
245
  tdClass: e.tdClass,
245
246
  bodyCellEllipsisClass: e.bodyCellEllipsisClass
246
247
  }, null);
247
248
  })) ? d : {
248
249
  default: () => [d]
249
- }), H && i?.expandedRowRender && r("tr", {
250
- key: `${n}-expanded`,
251
- class: C(e.rowClass, B, a.subThemeSlots?.expandedRow(), L)
250
+ }), _ && i?.expandedRowRender && r("tr", {
251
+ key: `${o}-expanded`,
252
+ class: x(e.rowClass, F, a.subThemeSlots?.expandedRow(), oe(a, v), z)
252
253
  }, [r("td", {
253
- colspan: F.length,
254
- class: C(e.tdClass, a.subThemeSlots?.expandedRowCell())
255
- }, [i.expandedRowRender(t, o, 0, !0)])])])]);
254
+ colspan: N.length,
255
+ class: x(e.tdClass, a.subThemeSlots?.expandedRowCell())
256
+ }, [a.compatClass && (a.fixedOffsets?.value?.size ?? 0) > 0 ? r("div", {
257
+ class: a.compatClass("expanded-row-fixed")
258
+ }, [i.expandedRowRender(t, n, 0, !0)]) : i.expandedRowRender(t, n, 0, !0)])])])]);
256
259
  }
257
260
  });
258
261
  }
259
262
  });
260
263
  export {
261
- he as default
264
+ xe as default
262
265
  };