@vtable-guild/vtable-guild 2.6.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.
@@ -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], g = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd, x = e.fixedOffsets?.value?.get(g), 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,7 +140,7 @@ 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() : "", g = o.value?.key === "__vtg_expand__";
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
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 = {};
@@ -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,66 +195,66 @@ 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 = 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;
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,
257
+ ref: k,
258
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,
@@ -263,20 +263,20 @@ 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, g = _.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: C(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,
@@ -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: C(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: C(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: C(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)]);
@@ -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;AAG/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,KAAK,GAAG,CAAC,CAAC;;;;;;;;;;;IAK3F,wCAAwC;;;;;IAExC;;;OAGG;;;;;IAEH,qCAAqC;;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,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 C, 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,13 +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 { getRowCompatClass as ne } from "../utils/compat.mjs";
10
- import oe from "../../../core/src/components/VirtualList/VirtualList.mjs";
11
- import { cn as g } from "tailwind-variants";
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
12
  function re(e) {
13
13
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !U(e);
14
14
  }
15
- const ge = /* @__PURE__ */ z({
15
+ const xe = /* @__PURE__ */ X({
16
16
  name: "VirtualTableBody",
17
17
  props: {
18
18
  dataSource: {
@@ -92,78 +92,78 @@ const ge = /* @__PURE__ */ z({
92
92
  }
93
93
  },
94
94
  setup(e) {
95
- const a = $(ee, {}), w = C(), x = C(0), f = C(0);
96
- function b(t) {
97
- 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?.({
98
98
  ...t,
99
99
  maxX: w.value?.getHorizontalRange() ?? 0
100
100
  });
101
101
  }
102
- function T(t, l) {
102
+ function O(t, l) {
103
103
  return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] : l;
104
104
  }
105
- function V(t) {
105
+ function T(t) {
106
106
  return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] : e.dataSource.indexOf(t);
107
107
  }
108
- const k = c(() => {
108
+ const V = c(() => {
109
109
  let t = 0;
110
110
  for (const l of e.columns) {
111
111
  const d = typeof l.width == "number" ? l.width : parseInt(String(l.width || "0"), 10);
112
112
  t += d || 0;
113
113
  }
114
114
  return t;
115
- }), q = c(() => {
115
+ }), k = c(() => {
116
116
  const t = e.virtualColumn ? e.columnMetrics?.total : void 0;
117
- return t && t > 0 ? t : k.value;
118
- }), m = c(() => te(e.columns)), S = c(() => {
117
+ return t && t > 0 ? t : V.value;
118
+ }), m = c(() => te(e.columns)), R = c(() => {
119
119
  if (!e.virtualColumn || f.value <= 0) return null;
120
120
  const t = e.columnMetrics;
121
121
  return !t || t.widths.length !== e.columns.length ? null : t.widths;
122
122
  }), {
123
- active: R,
124
- start: O,
123
+ active: p,
124
+ start: q,
125
125
  end: W,
126
- leftSpacer: p,
127
- rightSpacer: E
126
+ leftSpacer: E,
127
+ rightSpacer: K
128
128
  } = le({
129
- widths: () => S.value,
129
+ widths: () => R.value,
130
130
  leftFixedCount: () => m.value.leftFixedCount,
131
131
  rightFixedStart: () => m.value.rightFixedStart,
132
- offsetX: () => x.value,
132
+ offsetX: () => b.value,
133
133
  viewportWidth: () => f.value
134
134
  }), H = c(() => {
135
135
  const t = e.columns.length;
136
- if (!R.value)
136
+ if (!p.value)
137
137
  return Array.from({
138
138
  length: t
139
- }, (n, i) => ({
139
+ }, (o, i) => ({
140
140
  index: i
141
141
  }));
142
142
  const {
143
143
  leftFixedCount: l,
144
144
  rightFixedStart: d
145
- } = m.value, o = [];
146
- for (let n = 0; n < l; n += 1) o.push({
147
- index: n
145
+ } = m.value, n = [];
146
+ for (let o = 0; o < l; o += 1) n.push({
147
+ index: o
148
148
  });
149
- p.value > 0 && o.push({
150
- spacer: p.value
149
+ E.value > 0 && n.push({
150
+ spacer: E.value
151
151
  });
152
- for (let n = O.value; n <= W.value; n += 1) o.push({
153
- index: n
152
+ for (let o = q.value; o <= W.value; o += 1) n.push({
153
+ index: o
154
154
  });
155
- E.value > 0 && o.push({
156
- spacer: E.value
155
+ K.value > 0 && n.push({
156
+ spacer: K.value
157
157
  });
158
- for (let n = d; n < t; n += 1) o.push({
159
- index: n
158
+ for (let o = d; o < t; o += 1) n.push({
159
+ index: o
160
160
  });
161
- return o;
161
+ return n;
162
162
  });
163
- function ae(t) {
163
+ function ie(t) {
164
164
  }
165
165
  let u = null, s = null;
166
- function K(t) {
166
+ function B(t) {
167
167
  const l = t ?? null;
168
168
  l !== s && (u && s && u.unobserve(s), s = l, l && (f.value = l.clientWidth, !u && typeof ResizeObserver < "u" && (u = new ResizeObserver(() => {
169
169
  s && (f.value = s.clientWidth);
@@ -174,9 +174,9 @@ const ge = /* @__PURE__ */ z({
174
174
  }), G(() => w.value, (t) => {
175
175
  if (t) {
176
176
  const l = t.getScrollInfo();
177
- b(l), t.nativeElement, K(t.nativeElement);
177
+ S(l), t.nativeElement, B(t.nativeElement);
178
178
  } else
179
- K(null);
179
+ B(null);
180
180
  }), () => e.dataSource.length === 0 ? r("table", {
181
181
  class: e.tableClass,
182
182
  style: e.tableStyle
@@ -188,16 +188,16 @@ const ge = /* @__PURE__ */ z({
188
188
  colSpan: e.columns.length || 1,
189
189
  emptyClass: e.emptyClass,
190
190
  tdClass: e.tdClass
191
- }, null)])]) : r(oe, {
191
+ }, null)])]) : r(ae, {
192
192
  ref: w,
193
193
  data: e.dataSource,
194
194
  height: e.height,
195
195
  itemHeight: e.itemHeight,
196
- itemKey: V,
197
- scrollWidth: q.value || void 0,
196
+ itemKey: T,
197
+ scrollWidth: k.value || void 0,
198
198
  disableHeightMeasure: e.fixedHeight,
199
199
  fullHeight: !1,
200
- onVirtualScroll: b,
200
+ onVirtualScroll: S,
201
201
  showScrollBar: e.showScrollBar,
202
202
  style: {
203
203
  overflow: "hidden"
@@ -208,9 +208,9 @@ const ge = /* @__PURE__ */ z({
208
208
  index: l
209
209
  }) => {
210
210
  let d;
211
- const o = l, n = T(t, o), i = a.expandable?.(), _ = a.isExpanded?.(n) ?? !1, I = i?.expandRowByClick ?? !1, j = a.isRowExpandable?.(t) ?? !1, B = a.getRowClassName?.(t, o), A = a.getRowProps?.(t, o), F = (a.isTreeData?.value ? a.getFlattenRow?.(t) : void 0)?.level ?? 0, L = typeof i?.expandedRowClassName == "function" ? i.expandedRowClassName(t, o, F) : i?.expandedRowClassName, M = I ? () => {
212
- j && a.toggleExpand?.(t, o);
213
- } : void 0, N = H.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;
214
214
  return r("table", {
215
215
  class: e.tableClass,
216
216
  style: {
@@ -220,44 +220,46 @@ const ge = /* @__PURE__ */ z({
220
220
  }, [r("tbody", {
221
221
  class: e.tbodyClass
222
222
  }, [r(Y, {
223
- key: n,
224
- rowClass: g(e.rowClass, B, ne(a, t, o, F)) ?? "",
223
+ key: o,
224
+ rowClass: x(e.rowClass, F, ne(a, t, n, v)) ?? "",
225
225
  rowProps: A,
226
- onClick: M
227
- }, re(d = N.map((v, X) => {
228
- if (v.spacer !== void 0)
226
+ onClick: L
227
+ }, re(d = N.map((h, P) => {
228
+ if (h.spacer !== void 0)
229
229
  return r("td", {
230
- key: `__vtg_spacer_${X}`,
230
+ key: `__vtg_spacer_${P}`,
231
231
  style: {
232
- width: `${v.spacer}px`,
232
+ width: `${h.spacer}px`,
233
233
  padding: "0"
234
234
  },
235
235
  "aria-hidden": "true"
236
236
  }, null);
237
- const y = v.index, h = e.columns[y];
237
+ const y = h.index, C = e.columns[y];
238
238
  return r(J, {
239
- key: h.key ?? String(h.dataIndex ?? y),
239
+ key: C.key ?? String(C.dataIndex ?? y),
240
240
  record: t,
241
- rowIndex: o,
242
- column: h,
241
+ rowIndex: n,
242
+ column: C,
243
243
  colIndex: y,
244
- widthOverride: P?.[y],
244
+ widthOverride: M?.[y],
245
245
  tdClass: e.tdClass,
246
246
  bodyCellEllipsisClass: e.bodyCellEllipsisClass
247
247
  }, null);
248
248
  })) ? d : {
249
249
  default: () => [d]
250
250
  }), _ && i?.expandedRowRender && r("tr", {
251
- key: `${n}-expanded`,
252
- class: g(e.rowClass, B, a.subThemeSlots?.expandedRow(), L)
251
+ key: `${o}-expanded`,
252
+ class: x(e.rowClass, F, a.subThemeSlots?.expandedRow(), oe(a, v), z)
253
253
  }, [r("td", {
254
254
  colspan: N.length,
255
- class: g(e.tdClass, a.subThemeSlots?.expandedRowCell())
256
- }, [i.expandedRowRender(t, o, 0, !0)])])])]);
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)])])])]);
257
259
  }
258
260
  });
259
261
  }
260
262
  });
261
263
  export {
262
- ge as default
264
+ xe as default
263
265
  };