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