@vtable-guild/vtable-guild 2.9.0-alpha.2 → 2.9.0-alpha.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,QAAQ,EACd,MAAM,KAAK,CAAA;AAOZ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;;;cAwBzC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;cAAjD,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;AAJvE,wBAuzBE"}
1
+ {"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,QAAQ,EACd,MAAM,KAAK,CAAA;AAOZ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;;;cAwBzC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;cAAjD,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;AAJvE,wBAozBE"}
@@ -1,31 +1,31 @@
1
- import { defineComponent as qe, inject as ze, computed as i, ref as d, watch as Se, nextTick as Ue, onBeforeUnmount as be, createVNode as n, mergeProps as E, Teleport as Ge, isVNode as Xe } from "vue";
1
+ import { defineComponent as We, inject as qe, computed as i, ref as v, watch as Se, onBeforeUnmount as ze, createVNode as r, mergeProps as E, Teleport as Ue, isVNode as Ge } from "vue";
2
2
  import "../../../core/src/utils/tv.mjs";
3
- import we from "../../../core/src/components/Tooltip.mjs";
4
- import Ye from "../../../icons/src/DownOutlinedIcon.mjs";
5
- import { SELECTION_ALL as $e, SELECTION_INVERT as Je, SELECTION_NONE as Qe } from "../constants.mjs";
6
- import { TABLE_CONTEXT_KEY as Ze } from "../context.mjs";
7
- import { getColumnKey as Z } from "../composables/useColumns.mjs";
8
- import { useFixedColumnStyle as el } from "../composables/useFixedColumnStyle.mjs";
9
- import { getCellSpan as ll, omitCellProps as tl, getEllipsisConfig as ol } from "../utils/cell.mjs";
10
- import { resolvePopupContainer as ee, getPopupPositionStyle as nl } from "../utils/popupPosition.mjs";
11
- import { ensureValidVNode as rl } from "../utils/vnode.mjs";
12
- import sl from "./SortButton.mjs";
13
- import al from "./FilterIcon.mjs";
14
- import il from "./FilterDropdown.mjs";
15
- import ul from "./SelectionCheckbox.mjs";
16
- import cl from "./SelectionDropdown.mjs";
17
- import { getColumnFilters as le } from "../utils/valueEnum.mjs";
18
- import fl from "./ResizeHandle.mjs";
19
- import { TABLE_ALIGN_CLASSES as dl } from "../../../theme/src/presets/antdv/table.mjs";
3
+ import be from "../../../core/src/components/Tooltip.mjs";
4
+ import Xe from "../../../icons/src/DownOutlinedIcon.mjs";
5
+ import { SELECTION_ALL as Ye, SELECTION_INVERT as $e, SELECTION_NONE as Je } from "../constants.mjs";
6
+ import { TABLE_CONTEXT_KEY as Qe } from "../context.mjs";
7
+ import { getColumnKey as Q } from "../composables/useColumns.mjs";
8
+ import { useFixedColumnStyle as Ze } from "../composables/useFixedColumnStyle.mjs";
9
+ import { getCellSpan as el, omitCellProps as ll, getEllipsisConfig as tl } from "../utils/cell.mjs";
10
+ import { resolvePopupContainer as Z, getPopupPositionStyle as ol } from "../utils/popupPosition.mjs";
11
+ import { ensureValidVNode as nl } from "../utils/vnode.mjs";
12
+ import rl from "./SortButton.mjs";
13
+ import sl from "./FilterIcon.mjs";
14
+ import al from "./FilterDropdown.mjs";
15
+ import il from "./SelectionCheckbox.mjs";
16
+ import ul from "./SelectionDropdown.mjs";
17
+ import { getColumnFilters as ee } from "../utils/valueEnum.mjs";
18
+ import cl from "./ResizeHandle.mjs";
19
+ import { TABLE_ALIGN_CLASSES as fl } from "../../../theme/src/presets/antdv/table.mjs";
20
20
  import { cn as C } from "tailwind-variants";
21
- function vl(t) {
22
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Xe(t);
21
+ function dl(t) {
22
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Ge(t);
23
23
  }
24
- function ml(t) {
24
+ function vl(t) {
25
25
  if (t === "ascend") return "ascending";
26
26
  if (t === "descend") return "descending";
27
27
  }
28
- const Nl = /* @__PURE__ */ qe({
28
+ const Ol = /* @__PURE__ */ We({
29
29
  name: "TableHeaderCell",
30
30
  props: {
31
31
  cell: {
@@ -46,67 +46,66 @@ const Nl = /* @__PURE__ */ qe({
46
46
  }
47
47
  },
48
48
  setup(t) {
49
- const e = ze(Ze, {}), o = i(() => t.cell.isLeaf ? t.cell.column : null), V = i(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), v = i(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), k = i(() => ll(v.value, "colSpan") ?? t.cell.colSpan), B = i(() => t.cell.rowSpan), T = i(() => {
49
+ const e = qe(Qe, {}), o = i(() => t.cell.isLeaf ? t.cell.column : null), V = i(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), m = i(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), k = i(() => el(m.value, "colSpan") ?? t.cell.colSpan), B = i(() => t.cell.rowSpan), T = i(() => {
50
50
  const {
51
51
  onClick: l,
52
- ...r
53
- } = tl(v.value);
54
- return r;
52
+ ...n
53
+ } = ll(m.value);
54
+ return n;
55
55
  }), x = i(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), O = i(() => !!o.value?.sorter), b = i(() => o.value?.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), N = i(() => !o.value || !O.value ? !1 : b.value !== !1), R = i(() => {
56
56
  const l = o.value;
57
- return l ? le(l).length > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
57
+ return l ? ee(l).length > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
58
58
  }), K = i(() => !o.value || !R.value ? [] : e.getFilteredValue?.(o.value) ?? []), w = i(() => {
59
59
  const l = o.value;
60
60
  return l ? l.filtered !== void 0 ? l.filtered : K.value.length > 0 : !1;
61
- }), te = i(() => o.value?.filterDropdownOpen !== void 0), oe = d(!1), D = i(() => te.value ? o.value?.filterDropdownOpen ?? !1 : oe.value);
61
+ }), le = i(() => o.value?.filterDropdownOpen !== void 0), te = v(!1), D = i(() => le.value ? o.value?.filterDropdownOpen ?? !1 : te.value);
62
62
  function g(l) {
63
- te.value || (oe.value = l), o.value?.onFilterDropdownOpenChange?.(l);
63
+ le.value || (te.value = l), o.value?.onFilterDropdownOpenChange?.(l);
64
64
  }
65
- const m = d(null), j = d(null);
65
+ const p = v(null), j = v(null);
66
66
  function W() {
67
67
  g(!D.value);
68
68
  }
69
- function q(l) {
70
- j.value && !j.value.contains(l.target) && !m.value?.contains(l.target) && g(!1);
69
+ function oe(l) {
70
+ j.value && !j.value.contains(l.target) && !p.value?.contains(l.target) && g(!1);
71
71
  }
72
- const ye = i(() => {
72
+ const we = i(() => {
73
73
  const l = o.value;
74
74
  return l ? !!l.filterDropdown || !!l.customFilterDropdown && !!e.customFilterDropdown : !1;
75
75
  });
76
- Se(D, (l) => {
77
- l && ye.value ? Ue(() => {
78
- document.addEventListener("mousedown", q);
79
- }) : document.removeEventListener("mousedown", q);
80
- }), be(() => {
81
- document.removeEventListener("mousedown", q);
76
+ Se([D, we], ([l, n], u, c) => {
77
+ !l || !n || (document.addEventListener("mousedown", oe), c(() => document.removeEventListener("mousedown", oe)));
78
+ }, {
79
+ flush: "post",
80
+ immediate: !0
82
81
  });
83
82
  function ne() {
84
- return m.value ? m.value.getBoundingClientRect() : {
83
+ return p.value ? p.value.getBoundingClientRect() : {
85
84
  top: 0,
86
85
  left: 0,
87
86
  right: 0,
88
87
  bottom: 0
89
88
  };
90
89
  }
91
- const I = d([]), re = d(null);
90
+ const I = v([]), re = v(null);
92
91
  Se(() => K.value, (l) => {
93
92
  I.value = [...l];
94
93
  }, {
95
94
  immediate: !0
96
95
  });
97
- function se(l, r = !0) {
98
- o.value && (e.confirmFilter?.(o.value, l), r && g(!1));
96
+ function se(l, n = !0) {
97
+ o.value && (e.confirmFilter?.(o.value, l), n && g(!1));
99
98
  }
100
- function _e() {
99
+ function ye() {
101
100
  o.value && (e.resetFilter?.(o.value), g(!1));
102
101
  }
103
- function Te() {
102
+ function _e() {
104
103
  g(!1);
105
104
  }
106
- const xe = i(() => {
105
+ const Te = i(() => {
107
106
  const l = t.cell.leafColumns;
108
107
  if (!l.length) return null;
109
- const r = l[0], u = l[l.length - 1], p = Z(r) ?? t.cell.colStart, a = Z(u) ?? t.cell.colEnd, h = e.fixedOffsets?.value?.get(p), S = e.fixedOffsets?.value?.get(a);
108
+ const n = l[0], u = l[l.length - 1], c = Q(n) ?? t.cell.colStart, a = Q(u) ?? t.cell.colEnd, h = e.fixedOffsets?.value?.get(c), S = e.fixedOffsets?.value?.get(a);
110
109
  return l.every((M) => M.fixed === "left") && h?.left !== void 0 ? {
111
110
  left: h.left,
112
111
  isLastLeft: S?.isLastLeft
@@ -115,49 +114,49 @@ const Nl = /* @__PURE__ */ qe({
115
114
  isFirstRight: h?.isFirstRight
116
115
  } : null;
117
116
  }), {
118
- fixedStyle: De,
117
+ fixedStyle: xe,
119
118
  fixedClass: ae
120
- } = el({
121
- fixedInfo: () => xe.value
119
+ } = Ze({
120
+ fixedInfo: () => Te.value
121
+ }), De = i(() => {
122
+ const l = e.themePreset?.value === "antdv", n = e.bordered?.value ?? !1;
123
+ return !l || n || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
122
124
  }), Ie = i(() => {
123
- const l = e.themePreset?.value === "antdv", r = e.bordered?.value ?? !1;
124
- return !l || r || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
125
- }), Ae = i(() => {
126
125
  const l = e.leafColumnCount?.value ?? 0;
127
126
  return l > 0 && t.cell.colEnd < l - 1 ? e.bordered?.value ?? !1 ? e.vtgClass?.("last:border-r last:border-[color:var(--vtg-table-border-color)]") ?? "" : e.vtgClass?.("last:before:bg-[color:var(--vtg-table-header-split-color)]") ?? "" : "";
128
127
  }), ie = i(() => e.getColumnTitle?.(t.cell.column) ?? t.cell.column.title ?? ""), ue = i(() => {
129
128
  if (!t.cell.isLeaf) return !1;
130
129
  const l = o.value;
131
- return !l || !ol(l).enabled ? !1 : e.headerEllipsis?.value === !0;
132
- }), Fe = i(() => {
130
+ return !l || !tl(l).enabled ? !1 : e.headerEllipsis?.value === !0;
131
+ }), Ae = i(() => {
133
132
  if (e.headerCell) {
134
133
  const l = e.headerCell({
135
134
  title: ie.value,
136
135
  column: t.cell.column,
137
136
  index: t.index
138
137
  });
139
- if (rl(l) !== null)
138
+ if (nl(l) !== null)
140
139
  return l;
141
140
  }
142
141
  return ie.value;
143
- }), Me = i(() => {
144
- const l = t.cell.column.align ? e.vtgClass?.(dl[t.cell.column.align]) ?? "" : "", r = O.value ? e.subThemeSlots?.thSortable() : "", u = x.value ? e.subThemeSlots?.thSorted() : "", p = o.value?.key === "__vtg_expand__";
145
- return C(t.thClass, l, r, u, Ie.value, t.cell.column.className, p ? e.vtgClass?.("before:hidden") : "", v.value?.class, v.value?.className, ae.value, Ae.value, p ? e.compatClass?.("row-expand-icon-cell") : "", ue.value ? e.compatClass?.("cell-ellipsis") : "");
142
+ }), Fe = i(() => {
143
+ const l = t.cell.column.align ? e.vtgClass?.(fl[t.cell.column.align]) ?? "" : "", n = O.value ? e.subThemeSlots?.thSortable() : "", u = x.value ? e.subThemeSlots?.thSorted() : "", c = o.value?.key === "__vtg_expand__";
144
+ return C(t.thClass, l, n, u, De.value, t.cell.column.className, c ? e.vtgClass?.("before:hidden") : "", m.value?.class, m.value?.className, ae.value, Ie.value, c ? e.compatClass?.("row-expand-icon-cell") : "", ue.value ? e.compatClass?.("cell-ellipsis") : "");
146
145
  }), ce = i(() => {
147
146
  const l = {};
148
147
  if (o.value) {
149
- const a = e.columnWidths?.[String(Z(o.value) ?? t.cell.leafIndex)] ?? o.value.width;
148
+ const a = e.columnWidths?.[String(Q(o.value) ?? t.cell.leafIndex)] ?? o.value.width;
150
149
  a && (l.width = typeof a == "number" ? `${a}px` : a);
151
150
  }
152
- const r = v.value?.style, u = De.value;
151
+ const n = m.value?.style, u = xe.value;
153
152
  return {
154
153
  ...l,
155
154
  ...u ?? {},
156
- ...r ?? {},
155
+ ...n ?? {},
157
156
  ...o.value ? e.columnLayout?.columnStyle(t.cell.leafIndex, k.value) : {}
158
157
  };
159
- }), H = d(!1), A = d(null);
160
- function Le() {
158
+ }), H = v(!1), A = v(null);
159
+ function Me() {
161
160
  return A.value ? A.value.getBoundingClientRect() : {
162
161
  top: 0,
163
162
  left: 0,
@@ -165,58 +164,58 @@ const Nl = /* @__PURE__ */ qe({
165
164
  bottom: 0
166
165
  };
167
166
  }
168
- let c = null;
169
- function Ee() {
170
- c && clearTimeout(c), H.value = !0;
167
+ let f = null;
168
+ function Le() {
169
+ f && clearTimeout(f), H.value = !0;
171
170
  }
172
171
  function fe() {
173
- c && clearTimeout(c), c = setTimeout(() => {
172
+ f && clearTimeout(f), f = setTimeout(() => {
174
173
  H.value = !1;
175
174
  }, 100);
176
175
  }
177
- function ke() {
178
- c && clearTimeout(c);
176
+ function Ee() {
177
+ f && clearTimeout(f);
179
178
  }
180
- function Oe() {
181
- c && clearTimeout(c), H.value = !1;
179
+ function ke() {
180
+ f && clearTimeout(f), H.value = !1;
182
181
  }
183
- const z = d(!1);
184
- let U;
185
- be(() => clearTimeout(U));
182
+ const q = v(!1);
183
+ let z;
184
+ ze(() => clearTimeout(z));
186
185
  function de(l) {
187
- clearTimeout(U);
188
- const r = b.value, u = typeof r == "object" ? l ? r.mouseEnterDelay : r.mouseLeaveDelay : 0;
189
- u && u > 0 ? U = setTimeout(() => {
190
- z.value = l;
191
- }, u * 1e3) : z.value = l;
186
+ clearTimeout(z);
187
+ const n = b.value, u = typeof n == "object" ? l ? n.mouseEnterDelay : n.mouseLeaveDelay : 0;
188
+ u && u > 0 ? z = setTimeout(() => {
189
+ q.value = l;
190
+ }, u * 1e3) : q.value = l;
192
191
  }
193
- const F = d(!1), Ne = i(() => N.value && z.value && !F.value);
194
- function Re(l) {
195
- const r = T.value.onMouseenter;
196
- typeof r == "function" && r(l), N.value && de(!0);
192
+ const F = v(!1), Oe = i(() => N.value && q.value && !F.value);
193
+ function Ne(l) {
194
+ const n = T.value.onMouseenter;
195
+ typeof n == "function" && n(l), N.value && de(!0);
197
196
  }
198
- function He(l) {
199
- const r = T.value.onMouseleave;
200
- typeof r == "function" && r(l), N.value && de(!1);
197
+ function Re(l) {
198
+ const n = T.value.onMouseleave;
199
+ typeof n == "function" && n(l), N.value && de(!1);
201
200
  }
202
- function G() {
201
+ function U() {
203
202
  F.value = !0;
204
203
  }
205
- function X() {
204
+ function G() {
206
205
  F.value = !1;
207
206
  }
208
- function Y(l) {
209
- const r = v.value?.onClick;
210
- typeof r == "function" && r(l), o.value && O.value && e.toggleSortOrder?.(o.value);
207
+ function X(l) {
208
+ const n = m.value?.onClick;
209
+ typeof n == "function" && n(l), o.value && O.value && e.toggleSortOrder?.(o.value);
211
210
  }
212
211
  return () => {
213
212
  if (k.value === 0 || B.value === 0)
214
213
  return null;
215
- const l = k.value !== 1 ? k.value : void 0, r = B.value !== 1 ? B.value : void 0;
214
+ const l = k.value !== 1 ? k.value : void 0, n = B.value !== 1 ? B.value : void 0;
216
215
  if (o.value?.key === "__vtg_selection__") {
217
- const s = e.rowSelection?.(), f = s?.type === "radio", pe = s?.hideSelectAll === !0, J = s?.selections !== void 0 && s.selections !== !1, y = e.locale?.value, L = s?.columnTitle, je = L !== void 0, Ce = C(t.thClass, e.vtgClass?.(je ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, v.value?.class, v.value?.className, ae.value, e.compatClass?.("selection-column")), ge = ce.value;
218
- let Q = [];
219
- if (J && (s?.selections === !0 ? Q = [{
216
+ const s = e.rowSelection?.(), d = s?.type === "radio", pe = s?.hideSelectAll === !0, $ = s?.selections !== void 0 && s.selections !== !1, y = e.locale?.value, L = s?.columnTitle, Ke = L !== void 0, Ce = C(t.thClass, e.vtgClass?.(Ke ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, m.value?.class, m.value?.className, ae.value, e.compatClass?.("selection-column")), ge = ce.value;
217
+ let J = [];
218
+ if ($ && (s?.selections === !0 ? J = [{
220
219
  key: "__vtg_select_all__",
221
220
  text: y?.selection?.selectAll ?? "全选所有",
222
221
  onSelect: () => e.toggleAll?.(!0, !0)
@@ -228,68 +227,68 @@ const Nl = /* @__PURE__ */ qe({
228
227
  key: "__vtg_select_none__",
229
228
  text: y?.selection?.selectNone ?? "清空所有",
230
229
  onSelect: () => e.clearSelection?.()
231
- }] : Array.isArray(s?.selections) && (Q = s.selections.map((_) => _ === $e ? {
230
+ }] : Array.isArray(s?.selections) && (J = s.selections.map((_) => _ === Ye ? {
232
231
  key: "__vtg_select_all__",
233
232
  text: y?.selection?.selectAll ?? "全选所有",
234
233
  onSelect: () => e.toggleAll?.(!0, !0)
235
- } : _ === Je ? {
234
+ } : _ === $e ? {
236
235
  key: "__vtg_select_invert__",
237
236
  text: y?.selection?.selectInvert ?? "反选当页",
238
237
  onSelect: () => e.invertSelection?.()
239
- } : _ === Qe ? {
238
+ } : _ === Je ? {
240
239
  key: "__vtg_select_none__",
241
240
  text: y?.selection?.selectNone ?? "清空所有",
242
241
  onSelect: () => e.clearSelection?.()
243
- } : _))), f)
244
- return n("th", E(T.value, {
242
+ } : _))), d)
243
+ return r("th", E(T.value, {
245
244
  class: Ce,
246
245
  style: ge,
247
246
  colspan: l,
248
- rowspan: r,
247
+ rowspan: n,
249
248
  "data-vtg-leaf-col": V.value,
250
- onClick: Y
249
+ onClick: X
251
250
  }), [L]);
252
- const he = e.allCheckedState?.() ?? "none", We = L ? n("span", {
251
+ const he = e.allCheckedState?.() ?? "none", je = L ? r("span", {
253
252
  class: e.vtgClass?.("ml-2")
254
253
  }, [L]) : null;
255
- return n("th", E(T.value, {
254
+ return r("th", E(T.value, {
256
255
  class: Ce,
257
256
  style: ge,
258
257
  colspan: l,
259
- rowspan: r,
258
+ rowspan: n,
260
259
  "data-vtg-leaf-col": V.value,
261
- onClick: Y
262
- }), [pe ? L : n("span", {
260
+ onClick: X
261
+ }), [pe ? L : r("span", {
263
262
  class: C(e.vtgClass?.("inline-flex items-center justify-center relative"), e.compatClass?.("selection"))
264
- }, [n(ul, {
263
+ }, [r(il, {
265
264
  checked: he === "all",
266
265
  indeterminate: he === "partial",
267
266
  onChange: (_) => e.toggleAll?.(_)
268
- }, null), We, J && n("span", {
267
+ }, null), je, $ && r("span", {
269
268
  ref: A,
270
269
  class: C(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
271
- onMouseenter: Ee,
270
+ onMouseenter: Le,
272
271
  onMouseleave: fe,
273
272
  role: "button",
274
273
  "aria-label": "Selection options"
275
- }, [n(Ye, null, null)])]), !pe && J && n(cl, {
276
- items: Q,
274
+ }, [r(Xe, null, null)])]), !pe && $ && r(ul, {
275
+ items: J,
277
276
  anchorElement: A.value,
278
- anchorRect: Le(),
279
- popupContainer: ee(e, A.value),
277
+ anchorRect: Me(),
278
+ popupContainer: Z(e, A.value),
280
279
  visible: H.value,
281
- onClose: Oe,
282
- onMouseenter: ke,
280
+ onClose: ke,
281
+ onMouseenter: Ee,
283
282
  onMouseleave: fe
284
283
  }, null)]);
285
284
  }
286
- const u = e.locale?.value, p = x.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : x.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", a = o.value, h = t.cell.column.tooltip, S = typeof h == "string" ? {
285
+ const u = e.locale?.value, c = x.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : x.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", a = o.value, h = t.cell.column.tooltip, S = typeof h == "string" ? {
287
286
  title: h
288
- } : h, M = e.subThemeSlots?.sortAreaWrapper(), Pe = e.subThemeSlots?.sortAreaTitle(), P = n("span", {
287
+ } : h, M = e.subThemeSlots?.sortAreaWrapper(), He = e.subThemeSlots?.sortAreaTitle(), P = r("span", {
289
288
  class: M
290
- }, [n("span", {
291
- class: C(Pe, ue.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
292
- }, [Fe.value, S && n("span", {
289
+ }, [r("span", {
290
+ class: C(He, ue.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
291
+ }, [Ae.value, S && r("span", {
293
292
  class: e.subThemeSlots?.headerHelp(),
294
293
  onClick: (s) => s.stopPropagation(),
295
294
  onMouseenter: () => {
@@ -298,44 +297,44 @@ const Nl = /* @__PURE__ */ qe({
298
297
  onMouseleave: () => {
299
298
  F.value = !1;
300
299
  }
301
- }, [n(we, E(S, {
300
+ }, [r(be, E(S, {
302
301
  title: S.title
303
302
  }), {
304
- default: () => [n("span", null, [n("svg", {
303
+ default: () => [r("span", null, [r("svg", {
305
304
  width: "1em",
306
305
  height: "1em",
307
306
  viewBox: "0 0 16 16",
308
307
  fill: "none",
309
308
  stroke: "currentColor",
310
309
  "aria-hidden": "true"
311
- }, [n("circle", {
310
+ }, [r("circle", {
312
311
  cx: "8",
313
312
  cy: "8",
314
313
  r: "6"
315
- }, null), n("path", {
314
+ }, null), r("path", {
316
315
  d: "M6.2 5.7a1.8 1.8 0 1 1 3 1.3C8.4 7.6 8 8 8 9"
317
- }, null), n("path", {
316
+ }, null), r("path", {
318
317
  d: "M8 11h.01"
319
318
  }, null)])])]
320
- })])]), O.value && n(sl, {
319
+ })])]), O.value && r(rl, {
321
320
  sortOrder: x.value
322
- }, null)]), ve = e.subThemeSlots?.sortAreaOuter(), Ve = N.value ? n("span", {
321
+ }, null)]), ve = e.subThemeSlots?.sortAreaOuter(), Pe = N.value ? r("span", {
323
322
  class: ve
324
- }, [n(we, E({
323
+ }, [r(be, E({
325
324
  block: !0,
326
325
  placement: "top"
327
326
  }, typeof b.value == "object" ? b.value : {}, {
328
- title: typeof b.value == "object" ? b.value.title ?? p : p,
329
- open: !!Ne.value
330
- }), vl(P) ? P : {
327
+ title: typeof b.value == "object" ? b.value.title ?? c : c,
328
+ open: !!Oe.value
329
+ }), dl(P) ? P : {
331
330
  default: () => [P]
332
- })]) : n("span", {
331
+ })]) : r("span", {
333
332
  class: ve
334
- }, [P]), Be = a && (a.filterIcon ? n("span", {
333
+ }, [P]), Ve = a && (a.filterIcon ? r("span", {
335
334
  class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), w.value && e.compatClass && "active"),
336
- ref: m,
337
- onMouseenter: G,
338
- onMouseleave: X,
335
+ ref: p,
336
+ onMouseenter: U,
337
+ onMouseleave: G,
339
338
  onMousedown: (s) => s.stopPropagation(),
340
339
  onClick: (s) => {
341
340
  s.stopPropagation(), W();
@@ -344,11 +343,11 @@ const Nl = /* @__PURE__ */ qe({
344
343
  "aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
345
344
  }, [a.filterIcon({
346
345
  filtered: w.value
347
- })]) : e.customFilterIcon ? n("span", {
346
+ })]) : e.customFilterIcon ? r("span", {
348
347
  class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), w.value && e.compatClass && "active"),
349
- ref: m,
350
- onMouseenter: G,
351
- onMouseleave: X,
348
+ ref: p,
349
+ onMouseenter: U,
350
+ onMouseleave: G,
352
351
  onMousedown: (s) => s.stopPropagation(),
353
352
  onClick: (s) => {
354
353
  s.stopPropagation(), W();
@@ -358,16 +357,16 @@ const Nl = /* @__PURE__ */ qe({
358
357
  }, [e.customFilterIcon({
359
358
  column: a,
360
359
  filtered: w.value
361
- })]) : n("span", {
362
- ref: m,
360
+ })]) : r("span", {
361
+ ref: p,
363
362
  class: [e.subThemeSlots?.filterIconWrapper(), w.value && e.compatClass && "active"],
364
- onMouseenter: G,
365
- onMouseleave: X,
363
+ onMouseenter: U,
364
+ onMouseleave: G,
366
365
  onMousedown: (s) => s.stopPropagation()
367
- }, [n(al, {
366
+ }, [r(sl, {
368
367
  active: w.value,
369
368
  onClick: () => W()
370
- }, null)])), $ = a && {
369
+ }, null)])), Y = a && {
371
370
  column: a,
372
371
  selectedKeys: I.value,
373
372
  setSelectedKeys: (s) => {
@@ -377,57 +376,57 @@ const Nl = /* @__PURE__ */ qe({
377
376
  se(I.value, s?.closeDropdown !== !1);
378
377
  },
379
378
  clearFilters: (s) => {
380
- const f = a.filterResetToDefaultFilteredValue ? [...a.defaultFilteredValue ?? []] : [];
381
- I.value = f, s?.confirm !== !1 && e.confirmFilter?.(a, f), s?.closeDropdown !== !1 && g(!1);
379
+ const d = a.filterResetToDefaultFilteredValue ? [...a.defaultFilteredValue ?? []] : [];
380
+ I.value = d, s?.confirm !== !1 && e.confirmFilter?.(a, d), s?.closeDropdown !== !1 && g(!1);
382
381
  },
383
- filters: le(a),
382
+ filters: ee(a),
384
383
  visible: D.value,
385
384
  close: () => g(!1)
386
- }, me = a?.customFilterDropdown ? e.customFilterDropdown : void 0, Ke = a && $ && (() => {
387
- const s = typeof a.filterDropdown == "function" ? a.filterDropdown($) : a.filterDropdown ?? (me ? me($) : null);
385
+ }, me = a?.customFilterDropdown ? e.customFilterDropdown : void 0, Be = a && Y && (() => {
386
+ const s = typeof a.filterDropdown == "function" ? a.filterDropdown(Y) : a.filterDropdown ?? (me ? me(Y) : null);
388
387
  if (s) {
389
- const f = ee(e, m.value);
390
- return n(Ge, {
391
- to: f
388
+ const d = Z(e, p.value);
389
+ return r(Ue, {
390
+ to: d
392
391
  }, {
393
- default: () => [D.value && n("div", {
392
+ default: () => [D.value && r("div", {
394
393
  ref: j,
395
394
  class: e.subThemeSlots?.filterDropdown(),
396
- style: nl(ne(), f, 150)
395
+ style: ol(ne(), d, 150)
397
396
  }, [s])]
398
397
  });
399
398
  }
400
- return n(il, {
401
- filters: le(a),
399
+ return r(al, {
400
+ filters: ee(a),
402
401
  selectedKeys: K.value,
403
402
  multiple: a.filterMultiple !== !1,
404
403
  anchorRect: ne(),
405
- popupContainer: ee(e, m.value),
404
+ popupContainer: Z(e, p.value),
406
405
  filterSearch: a.filterSearch ?? !1,
407
406
  filterMode: a.filterMode ?? "menu",
408
407
  expandedKeys: re.value,
409
408
  visible: D.value,
410
409
  onConfirm: se,
411
- onReset: _e,
412
- onClose: Te,
413
- "onUpdate:expandedKeys": (f) => {
414
- re.value = f;
410
+ onReset: ye,
411
+ onClose: _e,
412
+ "onUpdate:expandedKeys": (d) => {
413
+ re.value = d;
415
414
  }
416
415
  }, null);
417
416
  })();
418
- return n("th", E(T.value, {
419
- class: Me.value,
417
+ return r("th", E(T.value, {
418
+ class: Fe.value,
420
419
  style: ce.value,
421
420
  colspan: l,
422
- rowspan: r,
421
+ rowspan: n,
423
422
  "data-vtg-leaf-col": V.value,
424
- onClick: Y,
425
- onMouseenter: Re,
426
- onMouseleave: He,
427
- "aria-sort": o.value ? ml(x.value) : void 0
428
- }), [n("span", {
423
+ onClick: X,
424
+ onMouseenter: Ne,
425
+ onMouseleave: Re,
426
+ "aria-sort": o.value ? vl(x.value) : void 0
427
+ }), [r("span", {
429
428
  class: C(e.vtgClass?.("flex items-center"), t.headerCellInnerClass, R.value && e.compatClass?.("filter-column"))
430
- }, [Ve, R.value && Be]), R.value && Ke, o.value?.resizable && n(fl, {
429
+ }, [Pe, R.value && Ve]), R.value && Be, o.value?.resizable && r(cl, {
431
430
  column: o.value,
432
431
  colIndex: t.cell.leafIndex
433
432
  }, null)]);
@@ -435,5 +434,5 @@ const Nl = /* @__PURE__ */ qe({
435
434
  }
436
435
  });
437
436
  export {
438
- Nl as default
437
+ Ol as default
439
438
  };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=VTableDynamicSlots.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTableDynamicSlots.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableDynamicSlots.test.ts"],"names":[],"mappings":""}
@@ -129,12 +129,12 @@ export interface TableContext {
129
129
  columnLayout?: ColumnLayout;
130
130
  /**
131
131
  * 用户定义的 bodyCell slot 函数。
132
- * 来自 Table.vue 的 useSlots().bodyCell。
132
+ * 通过响应式快照同步当前插槽,支持运行时添加、替换与移除。
133
133
  */
134
134
  bodyCell?: Slots['bodyCell'];
135
135
  /**
136
136
  * 用户定义的 headerCell slot 函数。
137
- * 来自 Table.vue 的 useSlots().headerCell。
137
+ * 通过响应式快照同步当前插槽,支持运行时添加、替换与移除。
138
138
  */
139
139
  headerCell?: Slots['headerCell'];
140
140
  /**
@@ -1,5 +1,6 @@
1
1
  export * from '../../core/src/index.ts';
2
2
  export * from '../../theme/src/index.ts';
3
3
  export * from '../../table/src/index.ts';
4
+ export { SettingOutlinedIcon, ColumnHeightOutlinedIcon, ReloadOutlinedIcon, FullscreenOutlinedIcon, FullscreenExitOutlinedIcon, CheckCircleFilledIcon, CloseCircleFilledIcon, } from '../../icons/src/index.ts';
4
5
  export * from './augment';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AAEnC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,qBAAqB,CAAA;AAG5B,cAAc,WAAW,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtable-guild/vtable-guild",
3
- "version": "2.9.0-alpha.2",
3
+ "version": "2.9.0-alpha.3",
4
4
  "description": "Vue 3 table component with built-in virtual scrolling and switchable ant-design-vue / element-plus theme presets, powered by tailwind-variants",
5
5
  "type": "module",
6
6
  "files": [