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

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 (61) hide show
  1. package/css/index.css +17 -0
  2. package/css/presets/antdv.css +10 -5
  3. package/css/presets/element-plus.css +9 -4
  4. package/css/style.css +83 -84
  5. package/css/tailwind3-utilities.css +35 -44
  6. package/css/tailwind3.css +48 -40
  7. package/css/tailwind4.css +48 -40
  8. package/css/transitions.css +12 -31
  9. package/dist/css/index.css +17 -0
  10. package/dist/css/presets/antdv.css +10 -5
  11. package/dist/css/presets/element-plus.css +9 -4
  12. package/dist/css/style.css +83 -84
  13. package/dist/css/tailwind3-utilities.css +35 -44
  14. package/dist/css/tailwind3.css +48 -40
  15. package/dist/css/tailwind4.css +48 -40
  16. package/dist/css/transitions.css +12 -31
  17. package/dist/index.full.mjs +5297 -5255
  18. package/dist/table/src/components/FilterDropdown.d.ts +23 -23
  19. package/dist/table/src/components/FilterDropdown.d.ts.map +1 -1
  20. package/dist/table/src/components/FilterDropdown.mjs +163 -175
  21. package/dist/table/src/components/PaginationSizeSelect.d.ts.map +1 -1
  22. package/dist/table/src/components/PaginationSizeSelect.mjs +85 -95
  23. package/dist/table/src/components/SelectionDropdown.d.ts +0 -27
  24. package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
  25. package/dist/table/src/components/SelectionDropdown.mjs +31 -56
  26. package/dist/table/src/components/Table.d.ts +1 -1
  27. package/dist/table/src/components/TableColumnSettings.d.ts.map +1 -1
  28. package/dist/table/src/components/TableColumnSettings.mjs +212 -236
  29. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  30. package/dist/table/src/components/TableHeaderCell.mjs +272 -278
  31. package/dist/table/src/components/TablePopup.d.ts +77 -0
  32. package/dist/table/src/components/TablePopup.d.ts.map +1 -0
  33. package/dist/table/src/components/TablePopup.mjs +104 -0
  34. package/dist/table/src/components/TablePopup.test.d.ts +2 -0
  35. package/dist/table/src/components/TablePopup.test.d.ts.map +1 -0
  36. package/dist/table/src/components/VTableHeaderAlignment.test.d.ts +2 -0
  37. package/dist/table/src/components/VTableHeaderAlignment.test.d.ts.map +1 -0
  38. package/dist/table/src/composables/useHeaderTitleBalance.d.ts +7 -0
  39. package/dist/table/src/composables/useHeaderTitleBalance.d.ts.map +1 -0
  40. package/dist/table/src/composables/useHeaderTitleBalance.mjs +50 -0
  41. package/dist/table/src/composables/useHeaderTitleBalance.test.d.ts +2 -0
  42. package/dist/table/src/composables/useHeaderTitleBalance.test.d.ts.map +1 -0
  43. package/dist/table/src/preset-config.d.ts +2 -0
  44. package/dist/table/src/preset-config.d.ts.map +1 -1
  45. package/dist/table/src/preset-config.mjs +12 -10
  46. package/dist/table/src/utils/popupPosition.d.ts +1 -6
  47. package/dist/table/src/utils/popupPosition.d.ts.map +1 -1
  48. package/dist/table/src/utils/popupPosition.mjs +22 -26
  49. package/dist/theme/src/column-settings.d.ts +8 -8
  50. package/dist/theme/src/column-settings.d.ts.map +1 -1
  51. package/dist/theme/src/column-settings.mjs +16 -18
  52. package/dist/theme/src/pagination.d.ts +2 -2
  53. package/dist/theme/src/pagination.d.ts.map +1 -1
  54. package/dist/theme/src/pagination.mjs +7 -8
  55. package/dist/theme/src/presets/antdv/table.d.ts +6 -6
  56. package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
  57. package/dist/theme/src/presets/antdv/table.mjs +9 -19
  58. package/dist/theme/src/presets/element-plus/table.d.ts +6 -6
  59. package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
  60. package/dist/theme/src/presets/element-plus/table.mjs +9 -20
  61. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- import { defineComponent as te, inject as ne, computed as k, useId as le, ref as b, watch as C, onBeforeUnmount as ie, createVNode as n, Teleport as ae, Fragment as _, nextTick as oe, createTextVNode as ue } from "vue";
2
- import { useTheme as se } from "../../../core/src/composables/useTheme.mjs";
3
- import F from "../../../core/src/components/Tooltip.mjs";
4
- import { VTABLE_GUILD_INJECTION_KEY as re } from "../../../core/src/plugin/index.mjs";
5
- import ce from "../../../icons/src/SettingOutlinedIcon.mjs";
6
- import de from "../../../icons/src/ColumnHeightOutlinedIcon.mjs";
7
- import { resolveColumnSettingsThemePreset as fe, columnSettingsZhCN as me } from "../../../theme/src/column-settings.mjs";
8
- import { resolveTableThemePreset as ve, resolveBuiltInLocale as ge } from "../../../theme/src/presets/index.mjs";
9
- import { configurableEntries as he, isColumnSettingDisabled as T, isVisibilityLocked as P, setColumnVisibility as K, columnFixedRegion as S, canSetColumnFixed as H, moveSettingColumn as be, setColumnFixed as pe } from "../utils/columnSettings.mjs";
10
- import { getPopupPositionStyle as ye } from "../utils/popupPosition.mjs";
11
- const Pe = /* @__PURE__ */ te({
1
+ import { defineComponent as Q, inject as W, computed as y, useId as X, ref as h, watch as w, createVNode as n, Fragment as j, createTextVNode as ee } from "vue";
2
+ import { useTheme as le } from "../../../core/src/composables/useTheme.mjs";
3
+ import M from "../../../core/src/components/Tooltip.mjs";
4
+ import { VTABLE_GUILD_INJECTION_KEY as te } from "../../../core/src/plugin/index.mjs";
5
+ import ne from "../../../icons/src/SettingOutlinedIcon.mjs";
6
+ import ae from "../../../icons/src/ColumnHeightOutlinedIcon.mjs";
7
+ import { resolveColumnSettingsThemePreset as ie, columnSettingsZhCN as ue } from "../../../theme/src/column-settings.mjs";
8
+ import { resolveTableThemePreset as oe, resolveBuiltInLocale as se } from "../../../theme/src/presets/index.mjs";
9
+ import { configurableEntries as ce, isColumnSettingDisabled as x, isVisibilityLocked as S, setColumnVisibility as P, columnFixedRegion as C, canSetColumnFixed as N, moveSettingColumn as re, setColumnFixed as de } from "../utils/columnSettings.mjs";
10
+ import fe from "./TablePopup.mjs";
11
+ const Te = /* @__PURE__ */ Q({
12
12
  name: "TableColumnSettings",
13
13
  props: {
14
14
  columns: {
@@ -24,202 +24,173 @@ const Pe = /* @__PURE__ */ te({
24
24
  getPopupContainer: Function
25
25
  },
26
26
  emits: {
27
- "update:columns": (l) => !0,
28
- "update:size": (l) => !0,
27
+ "update:columns": (t) => !0,
28
+ "update:size": (t) => !0,
29
29
  reset: () => !0
30
30
  },
31
31
  slots: Object,
32
- setup(l, {
32
+ setup(t, {
33
33
  emit: g,
34
- slots: U
34
+ slots: _
35
35
  }) {
36
- const p = ne(re, null), E = k(() => p?.themePreset ?? "antdv"), G = k(() => fe(E.value)), {
37
- slots: i
38
- } = se("columnSettings", G, l), A = k(() => {
39
- if (l.size) return l.size;
40
- const e = p?.theme.table?.defaultVariants?.size;
41
- return e === "large" || e === "middle" || e === "small" ? e : ve(E.value).defaultVariants.size;
42
- }), r = k(() => ({
43
- ...me,
44
- ...ge(E.value, p?.locale)?.columnSettings,
45
- ...p?.locales[p.locale]?.columnSettings,
46
- ...p?.localeOverrides.columnSettings,
47
- ...l.locale
48
- })), M = le(), I = b(null), O = b(null), f = b(null), u = b(null), D = b({}), z = b("body"), m = k(() => he(l.columns)), x = b(null), B = /* @__PURE__ */ new Map(), y = k(() => {
36
+ const b = W(te, null), T = y(() => b?.themePreset ?? "antdv"), R = y(() => ie(T.value)), {
37
+ slots: a
38
+ } = le("columnSettings", R, t), D = y(() => {
39
+ if (t.size) return t.size;
40
+ const e = b?.theme.table?.defaultVariants?.size;
41
+ return e === "large" || e === "middle" || e === "small" ? e : oe(T.value).defaultVariants.size;
42
+ }), s = y(() => ({
43
+ ...ue,
44
+ ...se(T.value, b?.locale)?.columnSettings,
45
+ ...b?.locales[b.locale]?.columnSettings,
46
+ ...b?.localeOverrides.columnSettings,
47
+ ...t.locale
48
+ })), A = X(), B = h(null), F = h(null), V = h(null), z = h(null), r = h(null), f = h("columns"), m = y(() => ce(t.columns)), k = h(null), I = /* @__PURE__ */ new Map(), p = y(() => {
49
49
  const e = [];
50
- function t(a, o = !0) {
51
- for (const s of a) {
52
- if (T(s.column, "checkbox")) continue;
53
- const d = o && s.column.visible !== !1;
54
- P(s) || e.push(d), t(s.children, d);
50
+ function l(o, i = !0) {
51
+ for (const u of o) {
52
+ if (x(u.column, "checkbox")) continue;
53
+ const d = i && u.column.visible !== !1;
54
+ S(u) || e.push(d), l(u.children, d);
55
55
  }
56
56
  }
57
- return t(m.value), {
57
+ return l(m.value), {
58
58
  all: e.length > 0 && e.every(Boolean),
59
59
  partial: e.some(Boolean) && !e.every(Boolean)
60
60
  };
61
61
  });
62
- function j(e) {
63
- for (const t of e)
64
- B.has(t.id) || B.set(t.id, t.column.visible), j(t.children);
62
+ function K(e) {
63
+ for (const l of e)
64
+ I.has(l.id) || I.set(l.id, l.column.visible), K(l.children);
65
65
  }
66
- C(m, j, {
66
+ w(m, K, {
67
67
  immediate: !0,
68
68
  flush: "sync"
69
69
  });
70
- function J(e, t) {
71
- if (l.disabled || P(e)) return;
72
- const a = t.target;
73
- g("update:columns", K(l.columns, /* @__PURE__ */ new Map([[e.id, a.checked]]))), a.checked = e.column.visible !== !1;
70
+ function q(e, l) {
71
+ if (t.disabled || S(e)) return;
72
+ const o = l.target;
73
+ g("update:columns", P(t.columns, /* @__PURE__ */ new Map([[e.id, o.checked]]))), o.checked = e.column.visible !== !1;
74
74
  }
75
- function W() {
76
- l.disabled || (g("update:columns", K(l.columns, B)), g("reset"));
75
+ function H() {
76
+ t.disabled || (g("update:columns", P(t.columns, I)), g("reset"));
77
77
  }
78
- function Y(e) {
79
- if (l.disabled || !m.value.length) return;
80
- const t = e.target, a = /* @__PURE__ */ new Map();
81
- function o(s) {
82
- for (const d of s)
83
- T(d.column, "checkbox") || (P(d) || a.set(d.id, t.checked), o(d.children));
78
+ function G(e) {
79
+ if (t.disabled || !m.value.length) return;
80
+ const l = e.target, o = /* @__PURE__ */ new Map();
81
+ function i(u) {
82
+ for (const d of u)
83
+ x(d.column, "checkbox") || (S(d) || o.set(d.id, l.checked), i(d.children));
84
84
  }
85
- o(m.value), g("update:columns", K(l.columns, a)), t.checked = y.value.all, t.indeterminate = y.value.partial;
85
+ i(m.value), g("update:columns", P(t.columns, o)), l.checked = p.value.all, l.indeterminate = p.value.partial;
86
86
  }
87
- function V(e = u.value) {
88
- return e === "density" ? O.value : I.value;
87
+ function O(e = r.value) {
88
+ return e === "density" ? F.value : B.value;
89
89
  }
90
- let w;
91
90
  function v(e = !1) {
92
- const t = V();
93
- u.value = null, e && t?.focus();
94
- }
95
- function h() {
96
- const e = V();
97
- if (!u.value || !e) return;
98
- const t = e.getBoundingClientRect(), a = f.value?.getBoundingClientRect().width ?? 0, o = {
99
- top: t.top,
100
- right: t.right,
101
- bottom: t.bottom,
102
- left: t.right - a
103
- };
104
- D.value = {
105
- ...ye(o, z.value, a, f.value?.scrollHeight),
106
- zIndex: "var(--vtg-column-settings-z)"
107
- }, z.value === document.body && (D.value.left = `${Math.max(8, Math.min(o.left, window.innerWidth - a - 8))}px`, delete D.value.right);
91
+ const l = O();
92
+ r.value = null, e && l?.focus();
108
93
  }
109
94
  function L(e) {
110
- const t = e.target;
111
- !I.value?.contains(t) && !O.value?.contains(t) && !f.value?.contains(t) && v();
112
- }
113
- async function q(e) {
114
- const t = V(e);
115
- if (l.disabled || !t) return;
116
- if (u.value === e) return v();
117
- if (R(), z.value = l.getPopupContainer?.(t) ?? document.body, u.value = e, h(), await oe(), u.value !== e) return;
118
- h();
119
- const a = e === "density" ? '[aria-checked="true"]' : "input:not(:disabled), button:not(:disabled)";
120
- (f.value?.querySelector(a) ?? f.value?.querySelector("button:not(:disabled)"))?.focus(), typeof ResizeObserver < "u" && (w = new ResizeObserver(h), w.observe(t), f.value && w.observe(f.value));
95
+ const l = O(e);
96
+ if (!(t.disabled || !l)) {
97
+ if (r.value === e) return v();
98
+ f.value = e, r.value = e;
99
+ }
121
100
  }
122
- function Z(e) {
123
- if (u.value === "density" && ["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) {
124
- const t = Array.from(f.value?.querySelectorAll('[role="menuitemradio"]') ?? []);
125
- if (!t.length) return;
101
+ function U(e) {
102
+ if (r.value === "density" && ["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) {
103
+ const l = Array.from(z.value?.querySelectorAll('[role="menuitemradio"]') ?? []);
104
+ if (!l.length) return;
126
105
  e.preventDefault();
127
- const a = t.indexOf(e.target), o = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (a + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length;
128
- t[o]?.focus();
129
- } else if (e.key === "Escape")
130
- e.preventDefault(), e.stopPropagation(), v(!0);
131
- else if (e.key === "Tab") {
132
- if (u.value === "density") {
106
+ const o = l.indexOf(e.target), i = e.key === "Home" ? 0 : e.key === "End" ? l.length - 1 : (o + (e.key === "ArrowDown" ? 1 : -1) + l.length) % l.length;
107
+ l[i]?.focus();
108
+ } else if (e.key === "Tab") {
109
+ if (r.value === "density") {
133
110
  v(!0), e.shiftKey && e.preventDefault();
134
111
  return;
135
112
  }
136
- const t = f.value?.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled)");
137
- if (!t?.length) return;
138
- (e.shiftKey && e.target === t[0] || !e.shiftKey && e.target === t[t.length - 1]) && (v(!0), e.shiftKey && e.preventDefault());
113
+ const l = z.value?.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled)");
114
+ if (!l?.length) return;
115
+ (e.shiftKey && e.target === l[0] || !e.shiftKey && e.target === l[l.length - 1]) && (v(!0), e.shiftKey && e.preventDefault());
139
116
  }
140
117
  }
141
- function R() {
142
- w?.disconnect(), w = void 0, !(typeof document > "u") && (document.removeEventListener("pointerdown", L), document.removeEventListener("focusin", L), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0));
143
- }
144
- C(u, (e) => {
145
- if (!e) return R();
146
- document.addEventListener("pointerdown", L), document.addEventListener("focusin", L), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
147
- }), C(() => l.disabled, (e) => {
118
+ w(() => t.disabled, (e) => {
148
119
  e && v();
149
- }), C(() => l.getPopupContainer, () => v()), C(() => [l.options?.density, l.options?.setting], () => {
150
- (u.value === "density" && l.options?.density === !1 || u.value === "columns" && l.options?.setting === !1) && v();
151
- }), ie(R);
152
- function Q(e, t) {
153
- if (l.disabled || !H(e) || S(e.column) === t) return;
154
- const a = pe(l.columns, e.id, t);
155
- a !== l.columns && g("update:columns", a);
120
+ }), w(() => t.getPopupContainer, () => v()), w(() => [t.options?.density, t.options?.setting], () => {
121
+ (r.value === "density" && t.options?.density === !1 || r.value === "columns" && t.options?.setting === !1) && v();
122
+ });
123
+ function J(e, l) {
124
+ if (t.disabled || !N(e) || C(e.column) === l) return;
125
+ const o = de(t.columns, e.id, l);
126
+ o !== t.columns && g("update:columns", o);
156
127
  }
157
- function X(e, t) {
158
- t.preventDefault(), t.stopPropagation();
159
- const a = x.value;
160
- if (x.value = null, !a || l.disabled || l.options?.draggable === !1) return;
161
- const o = be(l.columns, a, e.id);
162
- o !== l.columns && g("update:columns", o);
128
+ function Y(e, l) {
129
+ l.preventDefault(), l.stopPropagation();
130
+ const o = k.value;
131
+ if (k.value = null, !o || t.disabled || t.options?.draggable === !1) return;
132
+ const i = re(t.columns, o, e.id);
133
+ i !== t.columns && g("update:columns", i);
163
134
  }
164
- function $(e, t = !1, a = !1) {
165
- return e.map((o) => {
166
- const s = o.column, d = U.columnLabel?.({
167
- column: s
168
- }) ?? (typeof s.title == "function" ? void 0 : s.title) ?? String(s.key ?? ("dataIndex" in s ? s.dataIndex ?? "" : ""));
135
+ function E(e, l = !1, o = !1) {
136
+ return e.map((i) => {
137
+ const u = i.column, d = _.columnLabel?.({
138
+ column: u
139
+ }) ?? (typeof u.title == "function" ? void 0 : u.title) ?? String(u.key ?? ("dataIndex" in u ? u.dataIndex ?? "" : ""));
169
140
  return n("li", {
170
- key: o.id,
171
- class: i.item(),
172
- "data-column-setting": o.id,
141
+ key: i.id,
142
+ class: a.item(),
143
+ "data-column-setting": i.id,
173
144
  onDragover: (c) => {
174
- x.value && !a && c.preventDefault();
145
+ k.value && !o && c.preventDefault();
175
146
  },
176
- onDrop: a ? void 0 : (c) => X(o, c)
147
+ onDrop: o ? void 0 : (c) => Y(i, c)
177
148
  }, [n("div", {
178
- class: i.row()
179
- }, [!a && l.options?.draggable !== !1 && n("span", {
180
- class: i.dragHandle(),
181
- draggable: !l.disabled && !T(s, "order") && S(s) !== "mixed",
182
- title: r.value.move,
149
+ class: a.row()
150
+ }, [!o && t.options?.draggable !== !1 && n("span", {
151
+ class: a.dragHandle(),
152
+ draggable: !t.disabled && !x(u, "order") && C(u) !== "mixed",
153
+ title: s.value.move,
183
154
  "aria-hidden": "true",
184
155
  onDragstart: (c) => {
185
- if (l.disabled || T(s, "order")) return c.preventDefault();
186
- x.value = o.id, c.dataTransfer?.setData("text/plain", o.id), c.dataTransfer && (c.dataTransfer.effectAllowed = "move");
156
+ if (t.disabled || x(u, "order")) return c.preventDefault();
157
+ k.value = i.id, c.dataTransfer?.setData("text/plain", i.id), c.dataTransfer && (c.dataTransfer.effectAllowed = "move");
187
158
  },
188
159
  onDragend: () => {
189
- x.value = null;
160
+ k.value = null;
190
161
  }
191
- }, [ue("⋮⋮")]), n("label", {
192
- class: i.label()
162
+ }, [ee("⋮⋮")]), n("label", {
163
+ class: a.label()
193
164
  }, [n("span", {
194
- class: i.checkboxControl()
165
+ class: a.checkboxControl()
195
166
  }, [n("input", {
196
167
  type: "checkbox",
197
- class: i.checkbox(),
198
- checked: s.visible !== !1,
199
- disabled: l.disabled || t || P(o),
200
- onChange: (c) => J(o, c)
201
- }, null), s.visible !== !1 && n("span", {
202
- class: i.checkMark(),
168
+ class: a.checkbox(),
169
+ checked: u.visible !== !1,
170
+ disabled: t.disabled || l || S(i),
171
+ onChange: (c) => q(i, c)
172
+ }, null), u.visible !== !1 && n("span", {
173
+ class: a.checkMark(),
203
174
  "aria-hidden": "true"
204
175
  }, null)]), n("span", {
205
- class: i.labelText()
206
- }, [d])]), !a && l.options?.fixed !== !1 && n("span", {
207
- class: i.pinActions()
176
+ class: a.labelText()
177
+ }, [d])]), !o && t.options?.fixed !== !1 && n("span", {
178
+ class: a.pinActions()
208
179
  }, [["left", void 0, "right"].map((c) => {
209
- const N = c === "left" ? r.value.fixedLeft : c === "right" ? r.value.fixedRight : r.value.unfixed;
210
- return n(F, {
211
- title: N
180
+ const $ = c === "left" ? s.value.fixedLeft : c === "right" ? s.value.fixedRight : s.value.unfixed;
181
+ return n(M, {
182
+ title: $
212
183
  }, {
213
184
  default: () => [n("button", {
214
185
  type: "button",
215
- class: i.pinAction(),
216
- disabled: l.disabled || !H(o),
217
- "aria-label": `${String(typeof d == "string" || typeof d == "number" ? d : s.key ?? "")}: ${N}`,
218
- "aria-pressed": S(s) === c,
186
+ class: a.pinAction(),
187
+ disabled: t.disabled || !N(i),
188
+ "aria-label": `${String(typeof d == "string" || typeof d == "number" ? d : u.key ?? "")}: ${$}`,
189
+ "aria-pressed": C(u) === c,
219
190
  "data-column-pin": c ?? "none",
220
- onClick: () => Q(o, c)
191
+ onClick: () => J(i, c)
221
192
  }, [n("svg", {
222
- class: i.pinIcon(),
193
+ class: a.pinIcon(),
223
194
  viewBox: "0 0 16 16",
224
195
  fill: "none",
225
196
  "aria-hidden": "true"
@@ -230,7 +201,7 @@ const Pe = /* @__PURE__ */ te({
230
201
  height: "10",
231
202
  rx: "1",
232
203
  stroke: "currentColor"
233
- }, null), c ? n(_, null, [n("path", {
204
+ }, null), c ? n(j, null, [n("path", {
234
205
  d: c === "left" ? "M6 3v10" : "M10 3v10",
235
206
  stroke: "currentColor"
236
207
  }, null), n("rect", {
@@ -245,116 +216,121 @@ const Pe = /* @__PURE__ */ te({
245
216
  stroke: "currentColor"
246
217
  }, null)])])]
247
218
  });
248
- })])]), o.children.length > 0 && n("ul", {
249
- class: i.children()
250
- }, [$(o.children, t || s.visible === !1 || T(s, "checkbox"), !0)])]);
219
+ })])]), i.children.length > 0 && n("ul", {
220
+ class: a.children()
221
+ }, [E(i.children, l || u.visible === !1 || x(u, "checkbox"), !0)])]);
251
222
  });
252
223
  }
253
- function ee() {
254
- return m.value.some((t) => S(t.column) !== void 0) ? ["left", void 0, "right", "mixed"].map((t) => {
255
- const a = m.value.filter((s) => S(s.column) === t);
256
- if (!a.length) return null;
257
- const o = t === "left" ? r.value.fixedLeft : t === "right" ? r.value.fixedRight : t === "mixed" ? r.value.mixed : r.value.unfixed;
224
+ function Z() {
225
+ return m.value.some((l) => C(l.column) !== void 0) ? ["left", void 0, "right", "mixed"].map((l) => {
226
+ const o = m.value.filter((u) => C(u.column) === l);
227
+ if (!o.length) return null;
228
+ const i = l === "left" ? s.value.fixedLeft : l === "right" ? s.value.fixedRight : l === "mixed" ? s.value.mixed : s.value.unfixed;
258
229
  return n("li", {
259
- key: t ?? "none",
260
- class: i.group()
230
+ key: l ?? "none",
231
+ class: a.group()
261
232
  }, [n("div", {
262
- class: i.groupTitle()
263
- }, [o]), n("ul", {
264
- class: i.groupColumns()
265
- }, [$(a)])]);
266
- }) : $(m.value);
233
+ class: a.groupTitle()
234
+ }, [i]), n("ul", {
235
+ class: a.groupColumns()
236
+ }, [E(o)])]);
237
+ }) : E(m.value);
267
238
  }
268
239
  return () => n("span", {
269
- class: i.root()
270
- }, [l.options?.density !== !1 && n(F, {
271
- title: r.value.density,
272
- open: u.value ? !1 : void 0
240
+ ref: V,
241
+ class: a.root()
242
+ }, [t.options?.density !== !1 && n(M, {
243
+ title: s.value.density,
244
+ open: r.value ? !1 : void 0
273
245
  }, {
274
246
  default: () => [n("button", {
275
- ref: O,
247
+ ref: F,
276
248
  type: "button",
277
- class: i.densityTrigger(),
278
- disabled: l.disabled,
279
- "aria-label": r.value.density,
249
+ class: a.densityTrigger(),
250
+ disabled: t.disabled,
251
+ "aria-label": s.value.density,
280
252
  "aria-haspopup": "menu",
281
- "aria-expanded": u.value === "density",
282
- "aria-controls": u.value === "density" ? `${M}-density` : void 0,
283
- onClick: () => {
284
- q("density");
285
- }
286
- }, [n(de, null, null)])]
287
- }), l.options?.setting !== !1 && n(F, {
288
- title: r.value.title,
289
- open: u.value ? !1 : void 0
253
+ "aria-expanded": r.value === "density",
254
+ "aria-controls": r.value === "density" ? `${A}-density` : void 0,
255
+ onClick: () => L("density")
256
+ }, [n(ae, null, null)])]
257
+ }), t.options?.setting !== !1 && n(M, {
258
+ title: s.value.title,
259
+ open: r.value ? !1 : void 0
290
260
  }, {
291
261
  default: () => [n("button", {
292
- ref: I,
262
+ ref: B,
293
263
  type: "button",
294
- class: i.trigger(),
295
- disabled: l.disabled,
296
- "aria-label": r.value.title,
264
+ class: a.trigger(),
265
+ disabled: t.disabled,
266
+ "aria-label": s.value.title,
297
267
  "aria-haspopup": "dialog",
298
- "aria-expanded": u.value === "columns",
299
- "aria-controls": u.value === "columns" ? `${M}-columns` : void 0,
300
- onClick: () => {
301
- q("columns");
302
- }
303
- }, [n(ce, null, null)])]
304
- }), u.value && n(ae, {
305
- to: z.value
268
+ "aria-expanded": r.value === "columns",
269
+ "aria-controls": r.value === "columns" ? `${A}-columns` : void 0,
270
+ onClick: () => L("columns")
271
+ }, [n(ne, null, null)])]
272
+ }), n(fe, {
273
+ open: r.value !== null,
274
+ anchor: O(f.value),
275
+ getPopupContainer: t.getPopupContainer,
276
+ preset: T.value,
277
+ align: "end",
278
+ zIndex: "var(--vtg-column-settings-z)",
279
+ panelKey: f.value,
280
+ panelRef: (e) => z.value = e,
281
+ initialFocus: f.value === "density" ? '[aria-checked="true"]' : "input:not(:disabled), button:not(:disabled)",
282
+ outsideBoundary: V.value,
283
+ closeOnFocusOutside: !0,
284
+ class: f.value === "density" ? a.densityPopup() : a.popup(),
285
+ panelAttrs: {
286
+ id: `${A}-${f.value}`,
287
+ role: f.value === "density" ? "menu" : "dialog",
288
+ "aria-label": f.value === "density" ? s.value.density : s.value.title,
289
+ onKeydown: U
290
+ },
291
+ onDismiss: () => v()
306
292
  }, {
307
- default: () => [n("div", {
308
- ref: f,
309
- key: u.value,
310
- id: `${M}-${u.value}`,
311
- role: u.value === "density" ? "menu" : "dialog",
312
- "aria-label": u.value === "density" ? r.value.density : r.value.title,
313
- "data-vtg-preset": E.value,
314
- class: u.value === "density" ? i.densityPopup() : i.popup(),
315
- style: D.value,
316
- onKeydown: Z
317
- }, [u.value === "density" ? ["large", "middle", "small"].map((e) => n("button", {
293
+ default: () => [f.value === "density" ? ["large", "middle", "small"].map((e) => n("button", {
318
294
  type: "button",
319
295
  role: "menuitemradio",
320
- tabindex: A.value === e ? 0 : -1,
321
- class: i.density(),
322
- "aria-checked": A.value === e,
296
+ tabindex: D.value === e ? 0 : -1,
297
+ class: a.density(),
298
+ "aria-checked": D.value === e,
323
299
  onClick: () => {
324
- l.disabled || (A.value !== e && g("update:size", e), v(!0));
300
+ t.disabled || (D.value !== e && g("update:size", e), v(!0));
325
301
  }
326
- }, [r.value[e]])) : n(_, null, [n("div", {
327
- class: i.header()
302
+ }, [s.value[e]])) : n(j, null, [n("div", {
303
+ class: a.header()
328
304
  }, [n("label", {
329
- class: i.heading()
305
+ class: a.heading()
330
306
  }, [n("span", {
331
- class: i.checkboxControl()
307
+ class: a.checkboxControl()
332
308
  }, [n("input", {
333
309
  type: "checkbox",
334
- class: i.checkbox(),
335
- checked: y.value.all,
336
- indeterminate: y.value.partial,
337
- disabled: l.disabled || !m.value.length,
338
- onChange: Y
339
- }, null), y.value.all && n("span", {
340
- class: i.checkMark(),
310
+ class: a.checkbox(),
311
+ checked: p.value.all,
312
+ indeterminate: p.value.partial,
313
+ disabled: t.disabled || !m.value.length,
314
+ onChange: G
315
+ }, null), p.value.all && n("span", {
316
+ class: a.checkMark(),
341
317
  "aria-hidden": "true"
342
- }, null), y.value.partial && n("span", {
343
- class: i.indeterminateMark(),
318
+ }, null), p.value.partial && n("span", {
319
+ class: a.indeterminateMark(),
344
320
  "aria-hidden": "true"
345
- }, null)]), r.value.columns]), n("button", {
321
+ }, null)]), s.value.columns]), n("button", {
346
322
  type: "button",
347
- class: i.reset(),
348
- onClick: W
349
- }, [r.value.reset])]), m.value.length ? n("ul", {
350
- class: i.columns(),
351
- "aria-label": r.value.columns
352
- }, [ee()]) : n("div", {
353
- class: i.empty()
354
- }, [r.value.empty])])])]
323
+ class: a.reset(),
324
+ onClick: H
325
+ }, [s.value.reset])]), m.value.length ? n("ul", {
326
+ class: a.columns(),
327
+ "aria-label": s.value.columns
328
+ }, [Z()]) : n("div", {
329
+ class: a.empty()
330
+ }, [s.value.empty])])]
355
331
  })]);
356
332
  }
357
333
  });
358
334
  export {
359
- Pe as default
335
+ Te as default
360
336
  };
@@ -1 +1 @@
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
+ {"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;;;cAyBzC,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,wBAg0BE"}