@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.
- package/css/index.css +17 -0
- package/css/presets/antdv.css +10 -5
- package/css/presets/element-plus.css +9 -4
- package/css/style.css +83 -84
- package/css/tailwind3-utilities.css +35 -44
- package/css/tailwind3.css +48 -40
- package/css/tailwind4.css +48 -40
- package/css/transitions.css +12 -31
- package/dist/css/index.css +17 -0
- package/dist/css/presets/antdv.css +10 -5
- package/dist/css/presets/element-plus.css +9 -4
- package/dist/css/style.css +83 -84
- package/dist/css/tailwind3-utilities.css +35 -44
- package/dist/css/tailwind3.css +48 -40
- package/dist/css/tailwind4.css +48 -40
- package/dist/css/transitions.css +12 -31
- package/dist/index.full.mjs +5297 -5255
- package/dist/table/src/components/FilterDropdown.d.ts +23 -23
- package/dist/table/src/components/FilterDropdown.d.ts.map +1 -1
- package/dist/table/src/components/FilterDropdown.mjs +163 -175
- package/dist/table/src/components/PaginationSizeSelect.d.ts.map +1 -1
- package/dist/table/src/components/PaginationSizeSelect.mjs +85 -95
- package/dist/table/src/components/SelectionDropdown.d.ts +0 -27
- package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
- package/dist/table/src/components/SelectionDropdown.mjs +31 -56
- package/dist/table/src/components/Table.d.ts +1 -1
- package/dist/table/src/components/TableColumnSettings.d.ts.map +1 -1
- package/dist/table/src/components/TableColumnSettings.mjs +212 -236
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +272 -278
- package/dist/table/src/components/TablePopup.d.ts +77 -0
- package/dist/table/src/components/TablePopup.d.ts.map +1 -0
- package/dist/table/src/components/TablePopup.mjs +104 -0
- package/dist/table/src/components/TablePopup.test.d.ts +2 -0
- package/dist/table/src/components/TablePopup.test.d.ts.map +1 -0
- package/dist/table/src/components/VTableHeaderAlignment.test.d.ts +2 -0
- package/dist/table/src/components/VTableHeaderAlignment.test.d.ts.map +1 -0
- package/dist/table/src/composables/useHeaderTitleBalance.d.ts +7 -0
- package/dist/table/src/composables/useHeaderTitleBalance.d.ts.map +1 -0
- package/dist/table/src/composables/useHeaderTitleBalance.mjs +50 -0
- package/dist/table/src/composables/useHeaderTitleBalance.test.d.ts +2 -0
- package/dist/table/src/composables/useHeaderTitleBalance.test.d.ts.map +1 -0
- package/dist/table/src/preset-config.d.ts +2 -0
- package/dist/table/src/preset-config.d.ts.map +1 -1
- package/dist/table/src/preset-config.mjs +12 -10
- package/dist/table/src/utils/popupPosition.d.ts +1 -6
- package/dist/table/src/utils/popupPosition.d.ts.map +1 -1
- package/dist/table/src/utils/popupPosition.mjs +22 -26
- package/dist/theme/src/column-settings.d.ts +8 -8
- package/dist/theme/src/column-settings.d.ts.map +1 -1
- package/dist/theme/src/column-settings.mjs +16 -18
- package/dist/theme/src/pagination.d.ts +2 -2
- package/dist/theme/src/pagination.d.ts.map +1 -1
- package/dist/theme/src/pagination.mjs +7 -8
- package/dist/theme/src/presets/antdv/table.d.ts +6 -6
- package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
- package/dist/theme/src/presets/antdv/table.mjs +9 -19
- package/dist/theme/src/presets/element-plus/table.d.ts +6 -6
- package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
- package/dist/theme/src/presets/element-plus/table.mjs +9 -20
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import
|
|
4
|
-
import { VTABLE_GUILD_INJECTION_KEY as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { resolveColumnSettingsThemePreset as
|
|
8
|
-
import { resolveTableThemePreset as
|
|
9
|
-
import { configurableEntries as
|
|
10
|
-
import
|
|
11
|
-
const
|
|
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": (
|
|
28
|
-
"update:size": (
|
|
27
|
+
"update:columns": (t) => !0,
|
|
28
|
+
"update:size": (t) => !0,
|
|
29
29
|
reset: () => !0
|
|
30
30
|
},
|
|
31
31
|
slots: Object,
|
|
32
|
-
setup(
|
|
32
|
+
setup(t, {
|
|
33
33
|
emit: g,
|
|
34
|
-
slots:
|
|
34
|
+
slots: _
|
|
35
35
|
}) {
|
|
36
|
-
const
|
|
37
|
-
slots:
|
|
38
|
-
} =
|
|
39
|
-
if (
|
|
40
|
-
const e =
|
|
41
|
-
return e === "large" || e === "middle" || e === "small" ? e :
|
|
42
|
-
}),
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
})),
|
|
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
|
|
51
|
-
for (const
|
|
52
|
-
if (
|
|
53
|
-
const d =
|
|
54
|
-
|
|
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
|
|
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
|
|
63
|
-
for (const
|
|
64
|
-
|
|
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
|
-
|
|
66
|
+
w(m, K, {
|
|
67
67
|
immediate: !0,
|
|
68
68
|
flush: "sync"
|
|
69
69
|
});
|
|
70
|
-
function
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
g("update:columns",
|
|
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
|
|
76
|
-
|
|
75
|
+
function H() {
|
|
76
|
+
t.disabled || (g("update:columns", P(t.columns, I)), g("reset"));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
function
|
|
82
|
-
for (const d of
|
|
83
|
-
|
|
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
|
-
|
|
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
|
|
88
|
-
return e === "density" ?
|
|
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
|
|
93
|
-
|
|
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
|
|
111
|
-
!
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
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
|
|
128
|
-
|
|
129
|
-
} else if (e.key === "
|
|
130
|
-
|
|
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
|
|
137
|
-
if (!
|
|
138
|
-
(e.shiftKey && e.target ===
|
|
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
|
-
|
|
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
|
-
}),
|
|
150
|
-
(
|
|
151
|
-
})
|
|
152
|
-
function
|
|
153
|
-
if (
|
|
154
|
-
const
|
|
155
|
-
|
|
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
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
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
|
|
165
|
-
return e.map((
|
|
166
|
-
const
|
|
167
|
-
column:
|
|
168
|
-
}) ?? (typeof
|
|
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:
|
|
171
|
-
class:
|
|
172
|
-
"data-column-setting":
|
|
141
|
+
key: i.id,
|
|
142
|
+
class: a.item(),
|
|
143
|
+
"data-column-setting": i.id,
|
|
173
144
|
onDragover: (c) => {
|
|
174
|
-
|
|
145
|
+
k.value && !o && c.preventDefault();
|
|
175
146
|
},
|
|
176
|
-
onDrop:
|
|
147
|
+
onDrop: o ? void 0 : (c) => Y(i, c)
|
|
177
148
|
}, [n("div", {
|
|
178
|
-
class:
|
|
179
|
-
}, [!
|
|
180
|
-
class:
|
|
181
|
-
draggable: !
|
|
182
|
-
title:
|
|
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 (
|
|
186
|
-
|
|
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
|
-
|
|
160
|
+
k.value = null;
|
|
190
161
|
}
|
|
191
|
-
}, [
|
|
192
|
-
class:
|
|
162
|
+
}, [ee("⋮⋮")]), n("label", {
|
|
163
|
+
class: a.label()
|
|
193
164
|
}, [n("span", {
|
|
194
|
-
class:
|
|
165
|
+
class: a.checkboxControl()
|
|
195
166
|
}, [n("input", {
|
|
196
167
|
type: "checkbox",
|
|
197
|
-
class:
|
|
198
|
-
checked:
|
|
199
|
-
disabled:
|
|
200
|
-
onChange: (c) =>
|
|
201
|
-
}, null),
|
|
202
|
-
class:
|
|
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:
|
|
206
|
-
}, [d])]), !
|
|
207
|
-
class:
|
|
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
|
|
210
|
-
return n(
|
|
211
|
-
title:
|
|
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:
|
|
216
|
-
disabled:
|
|
217
|
-
"aria-label": `${String(typeof d == "string" || typeof d == "number" ? d :
|
|
218
|
-
"aria-pressed":
|
|
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: () =>
|
|
191
|
+
onClick: () => J(i, c)
|
|
221
192
|
}, [n("svg", {
|
|
222
|
-
class:
|
|
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(
|
|
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
|
-
})])]),
|
|
249
|
-
class:
|
|
250
|
-
}, [
|
|
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
|
|
254
|
-
return m.value.some((
|
|
255
|
-
const
|
|
256
|
-
if (!
|
|
257
|
-
const
|
|
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:
|
|
260
|
-
class:
|
|
230
|
+
key: l ?? "none",
|
|
231
|
+
class: a.group()
|
|
261
232
|
}, [n("div", {
|
|
262
|
-
class:
|
|
263
|
-
}, [
|
|
264
|
-
class:
|
|
265
|
-
}, [
|
|
266
|
-
}) :
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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:
|
|
247
|
+
ref: F,
|
|
276
248
|
type: "button",
|
|
277
|
-
class:
|
|
278
|
-
disabled:
|
|
279
|
-
"aria-label":
|
|
249
|
+
class: a.densityTrigger(),
|
|
250
|
+
disabled: t.disabled,
|
|
251
|
+
"aria-label": s.value.density,
|
|
280
252
|
"aria-haspopup": "menu",
|
|
281
|
-
"aria-expanded":
|
|
282
|
-
"aria-controls":
|
|
283
|
-
onClick: () =>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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:
|
|
262
|
+
ref: B,
|
|
293
263
|
type: "button",
|
|
294
|
-
class:
|
|
295
|
-
disabled:
|
|
296
|
-
"aria-label":
|
|
264
|
+
class: a.trigger(),
|
|
265
|
+
disabled: t.disabled,
|
|
266
|
+
"aria-label": s.value.title,
|
|
297
267
|
"aria-haspopup": "dialog",
|
|
298
|
-
"aria-expanded":
|
|
299
|
-
"aria-controls":
|
|
300
|
-
onClick: () =>
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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("
|
|
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:
|
|
321
|
-
class:
|
|
322
|
-
"aria-checked":
|
|
296
|
+
tabindex: D.value === e ? 0 : -1,
|
|
297
|
+
class: a.density(),
|
|
298
|
+
"aria-checked": D.value === e,
|
|
323
299
|
onClick: () => {
|
|
324
|
-
|
|
300
|
+
t.disabled || (D.value !== e && g("update:size", e), v(!0));
|
|
325
301
|
}
|
|
326
|
-
}, [
|
|
327
|
-
class:
|
|
302
|
+
}, [s.value[e]])) : n(j, null, [n("div", {
|
|
303
|
+
class: a.header()
|
|
328
304
|
}, [n("label", {
|
|
329
|
-
class:
|
|
305
|
+
class: a.heading()
|
|
330
306
|
}, [n("span", {
|
|
331
|
-
class:
|
|
307
|
+
class: a.checkboxControl()
|
|
332
308
|
}, [n("input", {
|
|
333
309
|
type: "checkbox",
|
|
334
|
-
class:
|
|
335
|
-
checked:
|
|
336
|
-
indeterminate:
|
|
337
|
-
disabled:
|
|
338
|
-
onChange:
|
|
339
|
-
}, null),
|
|
340
|
-
class:
|
|
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),
|
|
343
|
-
class:
|
|
318
|
+
}, null), p.value.partial && n("span", {
|
|
319
|
+
class: a.indeterminateMark(),
|
|
344
320
|
"aria-hidden": "true"
|
|
345
|
-
}, null)]),
|
|
321
|
+
}, null)]), s.value.columns]), n("button", {
|
|
346
322
|
type: "button",
|
|
347
|
-
class:
|
|
348
|
-
onClick:
|
|
349
|
-
}, [
|
|
350
|
-
class:
|
|
351
|
-
"aria-label":
|
|
352
|
-
}, [
|
|
353
|
-
class:
|
|
354
|
-
}, [
|
|
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
|
-
|
|
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;;;
|
|
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"}
|