@serkonda7/solid-components 0.0.7 → 0.1.0
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/README.md +2 -1
- package/dist/combobox.d.ts +2 -0
- package/dist/data-table.d.ts +2 -0
- package/dist/filter-table.d.ts +53 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +558 -165
- package/dist/styles.css +292 -0
- package/package.json +8 -9
package/dist/index.js
CHANGED
|
@@ -1,60 +1,111 @@
|
|
|
1
|
-
import { Dynamic as e, className as t, createComponent as n, delegateEvents as r, effect as i, insert as a, memo as o,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Dynamic as e, className as t, createComponent as n, delegateEvents as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, template as u, use as d } from "solid-js/web";
|
|
2
|
+
import { For as f, Show as p, children as m, createEffect as h, createMemo as g, createSignal as _, createUniqueId as v, on as y, onCleanup as b, onMount as x, splitProps as S } from "solid-js";
|
|
3
|
+
//#region node_modules/@tabler/icons-solidjs/dist/source/defaultAttributes.js
|
|
4
|
+
var C = {
|
|
5
|
+
outline: {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: 24,
|
|
8
|
+
height: 24,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": 2,
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round"
|
|
15
|
+
},
|
|
16
|
+
filled: {
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
width: 24,
|
|
19
|
+
height: 24,
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
fill: "currentColor",
|
|
22
|
+
stroke: "none"
|
|
23
|
+
}
|
|
24
|
+
}, w = /*#__PURE__*/ u("<svg>"), T = /*#__PURE__*/ u("<title>"), E = (t, r, i, c) => {
|
|
25
|
+
let u = (i) => {
|
|
26
|
+
let [u, d] = S(i, [
|
|
27
|
+
"color",
|
|
28
|
+
"size",
|
|
29
|
+
"stroke",
|
|
30
|
+
"strokeWidth",
|
|
31
|
+
"title",
|
|
32
|
+
"children",
|
|
33
|
+
"class"
|
|
34
|
+
]), f = C[t], p = u.stroke ?? u.strokeWidth;
|
|
35
|
+
return (() => {
|
|
36
|
+
var i = w();
|
|
37
|
+
return l(i, s(f, d, {
|
|
38
|
+
get width() {
|
|
39
|
+
return o(() => u.size != null)() ? u.size : f.width;
|
|
40
|
+
},
|
|
41
|
+
get height() {
|
|
42
|
+
return o(() => u.size != null)() ? u.size : f.height;
|
|
43
|
+
},
|
|
44
|
+
get class() {
|
|
45
|
+
return `tabler-icon tabler-icon-${r}${u.class ? ` ${u.class}` : ""}`;
|
|
46
|
+
}
|
|
47
|
+
}, () => t === "filled" ? { fill: u.color == null ? "currentColor" : u.color } : {
|
|
48
|
+
stroke: u.color == null ? "currentColor" : u.color,
|
|
49
|
+
"stroke-width": p ?? f["stroke-width"]
|
|
50
|
+
}), !0, !0), a(i, (() => {
|
|
51
|
+
var e = o(() => u.title != null);
|
|
52
|
+
return () => e() && (() => {
|
|
53
|
+
var e = T();
|
|
54
|
+
return a(e, () => u.title), e;
|
|
55
|
+
})();
|
|
56
|
+
})(), null), a(i, () => c.map(([t, r]) => n(e, s({ component: t }, r))), null), a(i, () => u.children, null), i;
|
|
57
|
+
})();
|
|
58
|
+
};
|
|
59
|
+
return u.displayName = `${i}`, u;
|
|
60
|
+
}, ee = E("outline", "chevron-down", "ChevronDown", [["path", { d: "M6 9l6 6l6 -6" }]]), D = E("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]), O = E("outline", "search", "Search", [["path", { d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }], ["path", { d: "M21 21l-6 -6" }]]), k = E("outline", "x", "X", [["path", { d: "M18 6l-12 12" }], ["path", { d: "M6 6l12 12" }]]), A = /*#__PURE__*/ u("<span class=combobox-value aria-hidden=true><span class=combobox-option-label></span><span class=combobox-detail>"), j = /*#__PURE__*/ u("<div role=option class=\"combobox-option combobox-option-add\">"), M = /*#__PURE__*/ u("<div class=combobox-list role=listbox>"), te = /*#__PURE__*/ u("<div><input class=combobox-input role=combobox aria-autocomplete=list autocomplete=off>"), N = /*#__PURE__*/ u("<span class=combobox-icon aria-hidden=true>"), P = /*#__PURE__*/ u("<div class=combobox-empty>"), F = /*#__PURE__*/ u("<span class=combobox-detail>"), I = /*#__PURE__*/ u("<div role=option class=combobox-option><span class=combobox-option-label>"), L = /*#__PURE__*/ u("<span class=combobox-option-icon aria-hidden=true>");
|
|
61
|
+
function R(r) {
|
|
62
|
+
let s, l, u = v(), m = () => r.id ?? u, y = () => `${m()}-listbox`, b = (e) => `${m()}-option-${e}`, [S, C] = _(!1), [w, T] = _(""), [E, O] = _(0), k = g(() => r.emptyLabel === void 0 ? r.options : [{
|
|
8
63
|
value: "",
|
|
9
64
|
label: r.emptyLabel
|
|
10
|
-
}, ...r.options]),
|
|
11
|
-
let e =
|
|
12
|
-
return e === "" ?
|
|
13
|
-
}),
|
|
14
|
-
|
|
15
|
-
r.autofocus === !0 &&
|
|
16
|
-
}),
|
|
17
|
-
|
|
65
|
+
}, ...r.options]), R = g(() => r.value === "" ? void 0 : k().find((e) => String(e.value) === r.value)), z = g(() => {
|
|
66
|
+
let e = w().trim().toLowerCase();
|
|
67
|
+
return e === "" ? k() : k().filter((t) => t.label.toLowerCase().includes(e) || (t.detail?.toLowerCase().includes(e) ?? !1));
|
|
68
|
+
}), B = () => r.options.some((e) => e.detail !== void 0), V = () => z().length, H = () => z().length + +!!r.onAdd, U = () => !r.disabled && r.onChange !== void 0;
|
|
69
|
+
x(() => {
|
|
70
|
+
r.autofocus === !0 && s?.focus();
|
|
71
|
+
}), h(() => {
|
|
72
|
+
S() && l?.querySelector(`[data-index="${E()}"]`)?.scrollIntoView({ block: "nearest" });
|
|
18
73
|
});
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
let e =
|
|
23
|
-
|
|
74
|
+
function W() {
|
|
75
|
+
if (S() || !U()) return;
|
|
76
|
+
T("");
|
|
77
|
+
let e = k().findIndex((e) => String(e.value) === r.value);
|
|
78
|
+
O(Math.max(e, 0)), C(!0), r.onOpen?.();
|
|
24
79
|
}
|
|
25
|
-
function
|
|
26
|
-
if (
|
|
27
|
-
r.onAdd(
|
|
80
|
+
function G(e) {
|
|
81
|
+
if (C(!1), r.onAdd && e === V()) {
|
|
82
|
+
r.onAdd(w().trim());
|
|
28
83
|
return;
|
|
29
84
|
}
|
|
30
|
-
let t =
|
|
85
|
+
let t = z()[e];
|
|
31
86
|
t && String(t.value) !== r.value && r.onChange?.(String(t.value));
|
|
32
87
|
}
|
|
33
|
-
function
|
|
34
|
-
let t =
|
|
35
|
-
|
|
88
|
+
function K(e) {
|
|
89
|
+
let t = H();
|
|
90
|
+
S() ? t > 0 && O((E() + e + t) % t) : W();
|
|
36
91
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
e.preventDefault(), q(e.key === "ArrowDown" ? 1 : -1);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
M() && (e.key === "Enter" ? (e.preventDefault(), K(I())) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), N(!1)));
|
|
92
|
+
function q(e) {
|
|
93
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), K(e.key === "ArrowDown" ? 1 : -1)) : S() && (e.key === "Enter" ? (e.preventDefault(), G(E())) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), C(!1)));
|
|
43
94
|
}
|
|
44
|
-
let
|
|
95
|
+
let ne = () => S() ? R()?.label ?? r.emptyLabel ?? r.searchLabel ?? "Search" : r.emptyLabel ?? r.placeholder;
|
|
45
96
|
return (() => {
|
|
46
|
-
var
|
|
47
|
-
h.addEventListener("blur", () =>
|
|
97
|
+
var u = te(), h = u.firstChild;
|
|
98
|
+
h.addEventListener("blur", () => C(!1)), h.$$keydown = q, h.$$input = (e) => {
|
|
48
99
|
let t = e.currentTarget.value;
|
|
49
|
-
|
|
50
|
-
}, h.$$click =
|
|
51
|
-
var g =
|
|
52
|
-
return typeof g == "function" ?
|
|
100
|
+
W(), T(t), O(0);
|
|
101
|
+
}, h.$$click = W;
|
|
102
|
+
var g = s;
|
|
103
|
+
return typeof g == "function" ? d(g, h) : s = h, a(u, n(p, {
|
|
53
104
|
get when() {
|
|
54
|
-
return o(() => !
|
|
105
|
+
return o(() => !S())() && R()?.icon;
|
|
55
106
|
},
|
|
56
107
|
children: (t) => (() => {
|
|
57
|
-
var r =
|
|
108
|
+
var r = N();
|
|
58
109
|
return a(r, n(e, {
|
|
59
110
|
get component() {
|
|
60
111
|
return t();
|
|
@@ -62,42 +113,42 @@ function O(r) {
|
|
|
62
113
|
size: 14
|
|
63
114
|
})), r;
|
|
64
115
|
})()
|
|
65
|
-
}), null), a(
|
|
116
|
+
}), null), a(u, n(p, {
|
|
66
117
|
get when() {
|
|
67
|
-
return o(() => !
|
|
118
|
+
return o(() => !S())() && R()?.detail;
|
|
68
119
|
},
|
|
69
120
|
get children() {
|
|
70
|
-
var e =
|
|
71
|
-
return a(t, () =>
|
|
121
|
+
var e = A(), t = e.firstChild, n = t.nextSibling;
|
|
122
|
+
return a(t, () => R()?.label), a(n, () => R()?.detail), e;
|
|
72
123
|
}
|
|
73
|
-
}), null), a(
|
|
124
|
+
}), null), a(u, n(ee, {
|
|
74
125
|
class: "combobox-chevron",
|
|
75
126
|
size: 16,
|
|
76
127
|
"aria-hidden": "true"
|
|
77
|
-
}), null), a(
|
|
128
|
+
}), null), a(u, n(p, {
|
|
78
129
|
get when() {
|
|
79
|
-
return
|
|
130
|
+
return S();
|
|
80
131
|
},
|
|
81
132
|
get children() {
|
|
82
|
-
var t =
|
|
83
|
-
return typeof o == "function" ?
|
|
133
|
+
var t = M(), o = l;
|
|
134
|
+
return typeof o == "function" ? d(o, t) : l = t, a(t, n(f, {
|
|
84
135
|
get each() {
|
|
85
|
-
return
|
|
136
|
+
return z();
|
|
86
137
|
},
|
|
87
138
|
get fallback() {
|
|
88
139
|
return (() => {
|
|
89
|
-
var e =
|
|
140
|
+
var e = P();
|
|
90
141
|
return a(e, () => r.noMatchesLabel ?? "No matching objects"), e;
|
|
91
142
|
})();
|
|
92
143
|
},
|
|
93
144
|
children: (t, o) => (() => {
|
|
94
|
-
var
|
|
95
|
-
return
|
|
145
|
+
var s = I(), l = s.firstChild;
|
|
146
|
+
return s.$$click = () => G(o()), s.$$mousemove = () => O(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(p, {
|
|
96
147
|
get when() {
|
|
97
148
|
return t.icon;
|
|
98
149
|
},
|
|
99
150
|
children: (t) => (() => {
|
|
100
|
-
var r =
|
|
151
|
+
var r = L();
|
|
101
152
|
return a(r, n(e, {
|
|
102
153
|
get component() {
|
|
103
154
|
return t();
|
|
@@ -105,37 +156,37 @@ function O(r) {
|
|
|
105
156
|
size: 14
|
|
106
157
|
})), r;
|
|
107
158
|
})()
|
|
108
|
-
}), null), a(l, () => t.label, null), a(
|
|
159
|
+
}), null), a(l, () => t.label, null), a(s, n(p, {
|
|
109
160
|
get when() {
|
|
110
161
|
return t.detail;
|
|
111
162
|
},
|
|
112
163
|
get children() {
|
|
113
|
-
var e =
|
|
164
|
+
var e = F();
|
|
114
165
|
return a(e, () => t.detail), e;
|
|
115
166
|
}
|
|
116
167
|
}), null), i((e) => {
|
|
117
|
-
var n =
|
|
118
|
-
return n !== e.e && s
|
|
168
|
+
var n = b(o()), i = o(), a = String(t.value) === r.value, l = o() === E(), u = t.value === "";
|
|
169
|
+
return n !== e.e && c(s, "id", e.e = n), i !== e.t && c(s, "data-index", e.t = i), a !== e.a && c(s, "aria-selected", e.a = a), l !== e.o && s.classList.toggle("combobox-option-active", e.o = l), u !== e.i && s.classList.toggle("combobox-option-empty", e.i = u), e;
|
|
119
170
|
}, {
|
|
120
171
|
e: void 0,
|
|
121
172
|
t: void 0,
|
|
122
173
|
a: void 0,
|
|
123
174
|
o: void 0,
|
|
124
175
|
i: void 0
|
|
125
|
-
}),
|
|
176
|
+
}), s;
|
|
126
177
|
})()
|
|
127
178
|
}), null), a(t, n(p, {
|
|
128
179
|
get when() {
|
|
129
180
|
return r.onAdd;
|
|
130
181
|
},
|
|
131
182
|
get children() {
|
|
132
|
-
var e =
|
|
133
|
-
return e.$$click = () =>
|
|
183
|
+
var e = j();
|
|
184
|
+
return e.$$click = () => G(V()), e.$$mousemove = () => O(V()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(D, {
|
|
134
185
|
size: 14,
|
|
135
186
|
"aria-hidden": "true"
|
|
136
187
|
}), null), a(e, () => r.addLabel ?? "Add", null), i((t) => {
|
|
137
|
-
var n =
|
|
138
|
-
return n !== t.e &&
|
|
188
|
+
var n = b(V()), r = V(), i = V() === E();
|
|
189
|
+
return n !== t.e && c(e, "id", t.e = n), r !== t.t && c(e, "data-index", t.t = r), i !== t.a && e.classList.toggle("combobox-option-active", t.a = i), t;
|
|
139
190
|
}, {
|
|
140
191
|
e: void 0,
|
|
141
192
|
t: void 0,
|
|
@@ -143,16 +194,16 @@ function O(r) {
|
|
|
143
194
|
}), e;
|
|
144
195
|
}
|
|
145
196
|
}), null), i((e) => {
|
|
146
|
-
var n = !!
|
|
147
|
-
return n !== e.e && t.classList.toggle("combobox-list-detail", e.e = n), r !== e.t &&
|
|
197
|
+
var n = !!B(), r = y();
|
|
198
|
+
return n !== e.e && t.classList.toggle("combobox-list-detail", e.e = n), r !== e.t && c(t, "id", e.t = r), e;
|
|
148
199
|
}, {
|
|
149
200
|
e: void 0,
|
|
150
201
|
t: void 0
|
|
151
202
|
}), t;
|
|
152
203
|
}
|
|
153
204
|
}), null), i((e) => {
|
|
154
|
-
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!
|
|
155
|
-
return n !== e.e && t(
|
|
205
|
+
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!S(), a = !(S() || !R()?.detail), o = !(S() || R()?.icon === void 0), s = m(), l = S(), d = y(), f = S() && H() > 0 ? b(E()) : void 0, p = r.ariaLabel, g = r.describedBy, _ = r.required, v = r.disabled, x = r.onChange === void 0, C = r.value, w = ne();
|
|
206
|
+
return n !== e.e && t(u, e.e = n), i !== e.t && u.classList.toggle("combobox-open", e.t = i), a !== e.a && u.classList.toggle("combobox-with-detail", e.a = a), o !== e.o && u.classList.toggle("combobox-with-icon", e.o = o), s !== e.i && c(h, "id", e.i = s), l !== e.n && c(h, "aria-expanded", e.n = l), d !== e.s && c(h, "aria-controls", e.s = d), f !== e.h && c(h, "aria-activedescendant", e.h = f), p !== e.r && c(h, "aria-label", e.r = p), g !== e.d && c(h, "aria-describedby", e.d = g), _ !== e.l && (h.required = e.l = _), v !== e.u && (h.disabled = e.u = v), x !== e.c && (h.readOnly = e.c = x), C !== e.w && c(h, "data-value", e.w = C), w !== e.m && c(h, "placeholder", e.m = w), e;
|
|
156
207
|
}, {
|
|
157
208
|
e: void 0,
|
|
158
209
|
t: void 0,
|
|
@@ -169,7 +220,7 @@ function O(r) {
|
|
|
169
220
|
c: void 0,
|
|
170
221
|
w: void 0,
|
|
171
222
|
m: void 0
|
|
172
|
-
}), i(() => h.value =
|
|
223
|
+
}), i(() => h.value = S() ? w() : R()?.label ?? ""), u;
|
|
173
224
|
})();
|
|
174
225
|
}
|
|
175
226
|
r([
|
|
@@ -181,209 +232,551 @@ r([
|
|
|
181
232
|
]);
|
|
182
233
|
//#endregion
|
|
183
234
|
//#region src/data-table.tsx
|
|
184
|
-
var
|
|
185
|
-
function
|
|
235
|
+
var z = /*#__PURE__*/ u("<div class=data-table-toolbar-start>"), B = /*#__PURE__*/ u("<div role=dialog class=data-table-customizer-panel><p class=data-table-customizer-title></p><ul class=data-table-customizer-list></ul><div class=data-table-customizer-actions><button type=button></button><button type=button>"), V = /*#__PURE__*/ u("<div class=data-table-customizer><button type=button class=data-table-customizer-button aria-haspopup=dialog><span aria-hidden=true>⚙</span> "), H = /*#__PURE__*/ u("<div class=data-table-toolbar>"), U = /*#__PURE__*/ u("<th class=data-table-checkbox><span class=data-table-visually-hidden>Select rows</span><input type=checkbox>"), W = /*#__PURE__*/ u("<th>Actions"), G = /*#__PURE__*/ u("<div><div class=data-table-scroll><table class=data-table><thead><tr></tr></thead><tbody>"), K = /*#__PURE__*/ u("<li><label class=data-table-customizer-option><input type=checkbox>"), q = /*#__PURE__*/ u("<button type=button class=data-table-sort><span class=data-table-sort-indicator aria-hidden=true>"), ne = /*#__PURE__*/ u("<th>"), re = /*#__PURE__*/ u("<td class=data-table-checkbox><input type=checkbox>"), ie = /*#__PURE__*/ u("<td>"), ae = /*#__PURE__*/ u("<tr>"), oe = /*#__PURE__*/ u("<p class=data-table-status>Loading…"), se = /*#__PURE__*/ u("<p class=data-table-status>No results.");
|
|
236
|
+
function J(e) {
|
|
186
237
|
return typeof e == "function" ? e() : e;
|
|
187
238
|
}
|
|
188
|
-
function
|
|
189
|
-
let r =
|
|
190
|
-
let t =
|
|
239
|
+
function Y(e) {
|
|
240
|
+
let r = g(() => J(e.rows)), s = () => J(e.loading ?? !1), l = () => J(e.selected ?? []), u = e.sortKey !== void 0 || e.sortDirection !== void 0, [y, x] = _(e.defaultSort), S = () => u ? J(e.sortKey ?? void 0) : y()?.key, C = () => u ? J(e.sortDirection ?? "asc") : y()?.direction ?? "asc", w = () => J(e.showColumnCustomizer ?? !1), T = m(() => e.toolbar), E = () => e.selected !== void 0 && e.onSelectionChange !== void 0, ee = () => {
|
|
241
|
+
let t = l();
|
|
191
242
|
return r().length > 0 && r().every((n) => t.includes(e.getRowId(n)));
|
|
192
|
-
},
|
|
193
|
-
function
|
|
243
|
+
}, D = g(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [O, k] = _(void 0), A = () => e.visibleColumns === void 0 ? O() ?? D() : J(e.visibleColumns), j = g(() => new Set(A())), M = g(() => e.columns.filter((e) => e.toggleable === !1 || j().has(e.key))), te = g(() => e.columns.filter((e) => e.toggleable !== !1)), N = g(() => te().map((e) => e.key));
|
|
244
|
+
function P(e, t) {
|
|
194
245
|
return t.sortValue ? t.sortValue(e) : e[t.key];
|
|
195
246
|
}
|
|
196
|
-
function
|
|
247
|
+
function F(e, t) {
|
|
197
248
|
return e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), void 0, { numeric: !0 });
|
|
198
249
|
}
|
|
199
|
-
let
|
|
200
|
-
let t = r(), n =
|
|
201
|
-
if (
|
|
250
|
+
let I = g(() => {
|
|
251
|
+
let t = r(), n = S();
|
|
252
|
+
if (u || !n) return t;
|
|
202
253
|
let i = e.columns.find((e) => e.key === n);
|
|
203
254
|
if (!i) return t;
|
|
204
|
-
let a =
|
|
205
|
-
return [...t].sort((e, t) => a *
|
|
255
|
+
let a = C() === "asc" ? 1 : -1;
|
|
256
|
+
return [...t].sort((e, t) => a * F(P(e, i), P(t, i)));
|
|
206
257
|
});
|
|
207
|
-
function
|
|
208
|
-
let n =
|
|
258
|
+
function L(t) {
|
|
259
|
+
let n = S() === t, r = n && C() === "desc" ? void 0 : {
|
|
209
260
|
key: t,
|
|
210
261
|
direction: n ? "desc" : "asc"
|
|
211
262
|
};
|
|
212
|
-
|
|
263
|
+
u || x(r), e.onSort?.(t), r || e.onSortClear?.(), e.onSortChange?.(r);
|
|
213
264
|
}
|
|
214
|
-
function
|
|
265
|
+
function R(t) {
|
|
215
266
|
let n = new Map(e.columns.map((e, t) => [e.key, t]));
|
|
216
267
|
return [...t].sort((e, t) => (n.get(e) ?? 0) - (n.get(t) ?? 0));
|
|
217
268
|
}
|
|
218
269
|
function Y(t) {
|
|
219
|
-
let n =
|
|
220
|
-
e.visibleColumns === void 0 &&
|
|
270
|
+
let n = R(t);
|
|
271
|
+
e.visibleColumns === void 0 && k(n), e.onVisibleColumnsChange?.(n);
|
|
221
272
|
}
|
|
222
|
-
function
|
|
223
|
-
let n = new Set(
|
|
224
|
-
t ? n.add(e) : n.delete(e), Y(
|
|
273
|
+
function ce(e, t) {
|
|
274
|
+
let n = new Set(A());
|
|
275
|
+
t ? n.add(e) : n.delete(e), Y(N().filter((e) => n.has(e)));
|
|
225
276
|
}
|
|
226
|
-
function
|
|
227
|
-
Y(
|
|
277
|
+
function le() {
|
|
278
|
+
Y(N());
|
|
228
279
|
}
|
|
229
|
-
function
|
|
230
|
-
Y(
|
|
280
|
+
function ue() {
|
|
281
|
+
Y(D());
|
|
231
282
|
}
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
if (!X() || !
|
|
283
|
+
let de = `${v()}-panel`, [X, fe] = _(!1), Z;
|
|
284
|
+
h(() => {
|
|
285
|
+
if (!X() || !w()) return;
|
|
235
286
|
function e(e) {
|
|
236
|
-
|
|
287
|
+
Z && !Z.contains(e.target) && fe(!1);
|
|
237
288
|
}
|
|
238
289
|
function t(e) {
|
|
239
|
-
e.key === "Escape" &&
|
|
290
|
+
e.key === "Escape" && fe(!1);
|
|
240
291
|
}
|
|
241
|
-
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t),
|
|
292
|
+
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), b(() => {
|
|
242
293
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
243
294
|
});
|
|
244
295
|
});
|
|
245
|
-
let
|
|
246
|
-
|
|
247
|
-
|
|
296
|
+
let Q;
|
|
297
|
+
h(() => {
|
|
298
|
+
Q && (Q.indeterminate = l().length > 0 && !ee());
|
|
248
299
|
});
|
|
249
|
-
function
|
|
300
|
+
function pe(t) {
|
|
250
301
|
e.onSelectionChange?.(t ? r().map(e.getRowId) : []);
|
|
251
302
|
}
|
|
252
|
-
function
|
|
253
|
-
let r = e.getRowId(t), i =
|
|
303
|
+
function me(t, n) {
|
|
304
|
+
let r = e.getRowId(t), i = l(), a = n ? [...i, r] : i.filter((e) => e !== r);
|
|
254
305
|
e.onSelectionChange?.(a);
|
|
255
306
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
307
|
+
function he(t) {
|
|
308
|
+
return l().includes(e.getRowId(t));
|
|
258
309
|
}
|
|
259
|
-
function
|
|
260
|
-
return e.toggleable === !1 ||
|
|
310
|
+
function ge(e) {
|
|
311
|
+
return e.toggleable === !1 || j().has(e.key);
|
|
261
312
|
}
|
|
262
|
-
function
|
|
313
|
+
function _e(t, n) {
|
|
263
314
|
return e.getCell?.(t, n) ?? n.getValue?.(t) ?? null;
|
|
264
315
|
}
|
|
265
316
|
return (() => {
|
|
266
|
-
var
|
|
267
|
-
return a(
|
|
317
|
+
var l = G(), m = l.firstChild, h = m.firstChild.firstChild, g = h.firstChild, _ = h.nextSibling;
|
|
318
|
+
return a(l, n(p, {
|
|
268
319
|
get when() {
|
|
269
|
-
return
|
|
320
|
+
return w() || T.toArray().length > 0;
|
|
270
321
|
},
|
|
271
322
|
get children() {
|
|
272
|
-
var t =
|
|
273
|
-
|
|
274
|
-
var c = Q;
|
|
275
|
-
return typeof c == "function" ? l(c, r) : Q = r, o.$$click = () => Z((e) => !e), s(o, "aria-controls", se), a(o, () => e.columnCustomizerLabel ?? "Columns", null), a(r, n(p, {
|
|
323
|
+
var t = H();
|
|
324
|
+
return a(t, n(p, {
|
|
276
325
|
get when() {
|
|
277
|
-
return
|
|
326
|
+
return T.toArray().length > 0;
|
|
278
327
|
},
|
|
279
328
|
get children() {
|
|
280
|
-
var
|
|
281
|
-
return
|
|
282
|
-
|
|
283
|
-
|
|
329
|
+
var e = z();
|
|
330
|
+
return a(e, T), e;
|
|
331
|
+
}
|
|
332
|
+
}), null), a(t, n(p, {
|
|
333
|
+
get when() {
|
|
334
|
+
return w();
|
|
335
|
+
},
|
|
336
|
+
get children() {
|
|
337
|
+
var t = V(), r = t.firstChild;
|
|
338
|
+
r.firstChild.nextSibling;
|
|
339
|
+
var o = Z;
|
|
340
|
+
return typeof o == "function" ? d(o, t) : Z = t, r.$$click = () => fe((e) => !e), c(r, "aria-controls", de), a(r, () => e.columnCustomizerLabel ?? "Columns", null), a(t, n(p, {
|
|
341
|
+
get when() {
|
|
342
|
+
return X();
|
|
284
343
|
},
|
|
285
|
-
children
|
|
286
|
-
var t =
|
|
287
|
-
return
|
|
288
|
-
|
|
289
|
-
|
|
344
|
+
get children() {
|
|
345
|
+
var t = B(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
346
|
+
return c(t, "id", de), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(f, {
|
|
347
|
+
get each() {
|
|
348
|
+
return e.columns;
|
|
349
|
+
},
|
|
350
|
+
children: (e) => (() => {
|
|
351
|
+
var t = K(), n = t.firstChild, r = n.firstChild;
|
|
352
|
+
return r.addEventListener("change", (t) => ce(e.key, t.currentTarget.checked)), a(n, () => e.ariaLabel ?? e.label, null), i(() => r.disabled = e.toggleable === !1), i(() => r.checked = ge(e)), t;
|
|
353
|
+
})()
|
|
354
|
+
})), s.$$click = le, a(s, () => e.columnCustomizerShowAllLabel ?? "Show all"), l.$$click = ue, a(l, () => e.columnCustomizerResetLabel ?? "Reset"), i(() => c(t, "aria-label", e.columnCustomizerTitle ?? "Customize columns")), t;
|
|
355
|
+
}
|
|
356
|
+
}), null), i(() => c(r, "aria-expanded", X())), t;
|
|
290
357
|
}
|
|
291
|
-
}), null),
|
|
358
|
+
}), null), t;
|
|
292
359
|
}
|
|
293
360
|
}), m), a(g, n(p, {
|
|
294
361
|
get when() {
|
|
295
|
-
return
|
|
362
|
+
return E();
|
|
296
363
|
},
|
|
297
364
|
get children() {
|
|
298
|
-
var t =
|
|
299
|
-
n.addEventListener("change", (e) =>
|
|
300
|
-
var r =
|
|
301
|
-
return typeof r == "function" ?
|
|
365
|
+
var t = U(), n = t.firstChild.nextSibling;
|
|
366
|
+
n.addEventListener("change", (e) => pe(e.currentTarget.checked));
|
|
367
|
+
var r = Q;
|
|
368
|
+
return typeof r == "function" ? d(r, n) : Q = n, i(() => c(n, "aria-label", e.selectionLabel ?? "Select all rows")), i(() => n.checked = ee()), t;
|
|
302
369
|
}
|
|
303
370
|
}), null), a(g, n(f, {
|
|
304
371
|
get each() {
|
|
305
|
-
return
|
|
372
|
+
return M();
|
|
306
373
|
},
|
|
307
374
|
children: (r) => (() => {
|
|
308
|
-
var
|
|
309
|
-
return a(
|
|
375
|
+
var s = ne();
|
|
376
|
+
return a(s, n(p, {
|
|
310
377
|
get when() {
|
|
311
|
-
return o(() => !!r.sortable)() && (!
|
|
378
|
+
return o(() => !!r.sortable)() && (!u || e.onSort || e.onSortChange);
|
|
312
379
|
},
|
|
313
380
|
get fallback() {
|
|
314
381
|
return r.label;
|
|
315
382
|
},
|
|
316
383
|
get children() {
|
|
317
|
-
var e =
|
|
318
|
-
return e.$$click = () =>
|
|
319
|
-
var e = o(() =>
|
|
320
|
-
return () => e() ?
|
|
384
|
+
var e = q(), t = e.firstChild;
|
|
385
|
+
return e.$$click = () => L(r.key), a(e, () => r.label, t), a(t, (() => {
|
|
386
|
+
var e = o(() => S() === r.key);
|
|
387
|
+
return () => e() ? C() === "asc" ? "▲" : "▼" : "";
|
|
321
388
|
})()), e;
|
|
322
389
|
}
|
|
323
390
|
})), i((e) => {
|
|
324
|
-
var n = r.class, i = r.sortable ?
|
|
325
|
-
return n !== e.e && t(
|
|
391
|
+
var n = r.class, i = r.sortable ? S() === r.key ? C() === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
392
|
+
return n !== e.e && t(s, e.e = n), i !== e.t && c(s, "aria-sort", e.t = i), e;
|
|
326
393
|
}, {
|
|
327
394
|
e: void 0,
|
|
328
395
|
t: void 0
|
|
329
|
-
}),
|
|
396
|
+
}), s;
|
|
330
397
|
})()
|
|
331
398
|
}), null), a(g, n(p, {
|
|
332
399
|
get when() {
|
|
333
400
|
return e.rowActions;
|
|
334
401
|
},
|
|
335
402
|
get children() {
|
|
336
|
-
return
|
|
403
|
+
return W();
|
|
337
404
|
}
|
|
338
405
|
}), null), a(_, n(f, {
|
|
339
406
|
get each() {
|
|
340
|
-
return
|
|
407
|
+
return I();
|
|
341
408
|
},
|
|
342
409
|
children: (r) => (() => {
|
|
343
|
-
var o =
|
|
410
|
+
var o = ae();
|
|
344
411
|
return a(o, n(p, {
|
|
345
412
|
get when() {
|
|
346
|
-
return
|
|
413
|
+
return E();
|
|
347
414
|
},
|
|
348
415
|
get children() {
|
|
349
|
-
var t =
|
|
350
|
-
return n.addEventListener("change", (e) =>
|
|
416
|
+
var t = re(), n = t.firstChild;
|
|
417
|
+
return n.addEventListener("change", (e) => me(r, e.currentTarget.checked)), i(() => c(n, "aria-label", `Select row ${e.getRowId(r)}`)), i(() => n.checked = he(r)), t;
|
|
351
418
|
}
|
|
352
419
|
}), null), a(o, n(f, {
|
|
353
420
|
get each() {
|
|
354
|
-
return
|
|
421
|
+
return M();
|
|
355
422
|
},
|
|
356
423
|
children: (e) => (() => {
|
|
357
|
-
var n =
|
|
358
|
-
return a(n, () =>
|
|
424
|
+
var n = ie();
|
|
425
|
+
return a(n, () => _e(r, e)), i(() => t(n, e.class)), n;
|
|
359
426
|
})()
|
|
360
427
|
}), null), a(o, n(p, {
|
|
361
428
|
get when() {
|
|
362
429
|
return e.rowActions;
|
|
363
430
|
},
|
|
364
431
|
get children() {
|
|
365
|
-
var t =
|
|
432
|
+
var t = ie();
|
|
366
433
|
return a(t, () => e.rowActions?.(r)), t;
|
|
367
434
|
}
|
|
368
435
|
}), null), o;
|
|
369
436
|
})()
|
|
370
|
-
})), a(
|
|
437
|
+
})), a(l, n(p, {
|
|
371
438
|
get when() {
|
|
372
|
-
return
|
|
439
|
+
return s();
|
|
373
440
|
},
|
|
374
441
|
get children() {
|
|
375
|
-
return e.loadingContent ??
|
|
442
|
+
return e.loadingContent ?? oe();
|
|
376
443
|
}
|
|
377
|
-
}), null), a(
|
|
444
|
+
}), null), a(l, n(p, {
|
|
378
445
|
get when() {
|
|
379
|
-
return o(() => !
|
|
446
|
+
return o(() => !s())() && (e.empty === void 0 ? r().length === 0 : J(e.empty));
|
|
380
447
|
},
|
|
381
448
|
get children() {
|
|
382
|
-
return e.emptyContent ??
|
|
449
|
+
return e.emptyContent ?? se();
|
|
383
450
|
}
|
|
384
|
-
}), null), i(() => t(
|
|
451
|
+
}), null), i(() => t(l, `data-table-wrap${e.class ? ` ${e.class}` : ""}`)), l;
|
|
385
452
|
})();
|
|
386
453
|
}
|
|
387
454
|
r(["click"]);
|
|
388
455
|
//#endregion
|
|
389
|
-
|
|
456
|
+
//#region src/filter-table.tsx
|
|
457
|
+
var ce = /*#__PURE__*/ u("<input class=filter-table-input type=text>"), le = /*#__PURE__*/ u("<ul class=filter-table-chips>"), ue = /*#__PURE__*/ u("<div class=filter-table-multi>"), de = /*#__PURE__*/ u("<li class=filter-table-chip><button type=button class=filter-table-chip-remove>"), X = /*#__PURE__*/ u("<div class=filter-table-search><input type=search class=filter-table-input>"), fe = /*#__PURE__*/ u("<ul class=filter-table-pills aria-label=\"Applied filters\"><li><button type=button class=\"filter-table-pill filter-table-pill-clear\">"), Z = /*#__PURE__*/ u("<div class=filter-table-toolbar>"), Q = /*#__PURE__*/ u("<li><button type=button class=filter-table-pill>"), pe = /*#__PURE__*/ u("<div><div class=filter-table-tabs role=tablist></div><div role=tabpanel></div><div role=tabpanel><form class=filter-table-form><div class=filter-table-form-actions><button type=button class=filter-table-button></button><button type=submit class=\"filter-table-button filter-table-button-primary\">"), me = /*#__PURE__*/ u("<span class=filter-table-badge>"), he = /*#__PURE__*/ u("<button type=button role=tab class=filter-table-tab>"), ge = /*#__PURE__*/ u("<legend class=filter-table-legend>"), _e = /*#__PURE__*/ u("<fieldset class=filter-table-fieldset>"), ve = /*#__PURE__*/ u("<div class=filter-table-field><label class=filter-table-label>"), ye = "q";
|
|
458
|
+
function be(e) {
|
|
459
|
+
return typeof e == "function" ? e() : e;
|
|
460
|
+
}
|
|
461
|
+
function xe(e) {
|
|
462
|
+
return Array.isArray(e) ? e.length > 0 : (e ?? "").trim() !== "";
|
|
463
|
+
}
|
|
464
|
+
function Se(e) {
|
|
465
|
+
let t = {};
|
|
466
|
+
for (let [n, r] of Object.entries(e)) xe(r) && (t[n] = Array.isArray(r) ? r : r.trim());
|
|
467
|
+
return t;
|
|
468
|
+
}
|
|
469
|
+
function $(e) {
|
|
470
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
471
|
+
}
|
|
472
|
+
function Ce(e) {
|
|
473
|
+
let [r, o] = S(e, [
|
|
474
|
+
"rows",
|
|
475
|
+
"filters",
|
|
476
|
+
"filterValues",
|
|
477
|
+
"defaultFilterValues",
|
|
478
|
+
"onFilterValuesChange",
|
|
479
|
+
"manualFiltering",
|
|
480
|
+
"quickSearch",
|
|
481
|
+
"getSearchText",
|
|
482
|
+
"quickSearchLabel",
|
|
483
|
+
"resultsLabel",
|
|
484
|
+
"filtersLabel",
|
|
485
|
+
"applyLabel",
|
|
486
|
+
"resetLabel",
|
|
487
|
+
"clearAllLabel",
|
|
488
|
+
"anyLabel",
|
|
489
|
+
"yesLabel",
|
|
490
|
+
"noLabel",
|
|
491
|
+
"class"
|
|
492
|
+
]), l = g(() => be(r.rows)), [u, d] = _(Se(r.defaultFilterValues ?? {})), m = g(() => r.filterValues === void 0 ? u() : Se(be(r.filterValues)));
|
|
493
|
+
function b(e) {
|
|
494
|
+
let t = Se(e);
|
|
495
|
+
r.filterValues === void 0 && d(t), r.onFilterValuesChange?.(t);
|
|
496
|
+
}
|
|
497
|
+
function x(e, t) {
|
|
498
|
+
b({
|
|
499
|
+
...m(),
|
|
500
|
+
[e]: t
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
let C = () => $(m()[ye]), w = g(() => r.filters.filter((e) => xe(m()[e.key])));
|
|
504
|
+
function T(e, t) {
|
|
505
|
+
return t.getValue ? t.getValue(e) : e[t.key];
|
|
506
|
+
}
|
|
507
|
+
function E(e, t, n) {
|
|
508
|
+
if (t.match) return t.match(e, n);
|
|
509
|
+
let r = T(e, t);
|
|
510
|
+
if (t.type === "select") {
|
|
511
|
+
let e = Array.isArray(n) ? n : [n];
|
|
512
|
+
return (Array.isArray(r) ? r : [r]).some((t) => e.includes($(t)));
|
|
513
|
+
}
|
|
514
|
+
return t.type === "boolean" ? !!r == (n === "true") : $(r).toLowerCase().includes($(n).toLowerCase());
|
|
515
|
+
}
|
|
516
|
+
function ee(e) {
|
|
517
|
+
return r.getSearchText ? r.getSearchText(e) : o.columns.map((t) => $(t.sortValue?.(e) ?? e[t.key])).join(" ");
|
|
518
|
+
}
|
|
519
|
+
let D = g(() => {
|
|
520
|
+
if (r.manualFiltering) return l();
|
|
521
|
+
let e = C().toLowerCase(), t = w();
|
|
522
|
+
return l().filter((n) => (e === "" || ee(n).toLowerCase().includes(e)) && t.every((e) => E(n, e, m()[e.key])));
|
|
523
|
+
});
|
|
524
|
+
function A(e) {
|
|
525
|
+
if (e.options) return e.options;
|
|
526
|
+
let t = /* @__PURE__ */ new Set();
|
|
527
|
+
for (let n of l()) {
|
|
528
|
+
let r = T(n, e);
|
|
529
|
+
for (let e of Array.isArray(r) ? r : [r]) {
|
|
530
|
+
let n = $(e);
|
|
531
|
+
n !== "" && t.add(n);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return [...t].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({
|
|
535
|
+
value: e,
|
|
536
|
+
label: e
|
|
537
|
+
}));
|
|
538
|
+
}
|
|
539
|
+
function j(e, t) {
|
|
540
|
+
return e.type === "boolean" ? t === "true" ? r.yesLabel ?? "Yes" : r.noLabel ?? "No" : e.type === "select" ? A(e).find((e) => String(e.value) === t)?.label ?? t : t;
|
|
541
|
+
}
|
|
542
|
+
let M = g(() => w().flatMap((e) => {
|
|
543
|
+
let t = m()[e.key];
|
|
544
|
+
return (Array.isArray(t) ? t : [t]).map((t) => ({
|
|
545
|
+
filter: e,
|
|
546
|
+
item: t,
|
|
547
|
+
text: `${e.label}: ${j(e, t)}`
|
|
548
|
+
}));
|
|
549
|
+
}));
|
|
550
|
+
function te(e, t) {
|
|
551
|
+
let n = m()[e.key];
|
|
552
|
+
x(e.key, Array.isArray(n) ? n.filter((e) => e !== t) : "");
|
|
553
|
+
}
|
|
554
|
+
function N() {
|
|
555
|
+
b({ [ye]: C() });
|
|
556
|
+
}
|
|
557
|
+
let [P, F] = _(m());
|
|
558
|
+
h(y(m, (e) => F(e)));
|
|
559
|
+
function I(e) {
|
|
560
|
+
return P()[e];
|
|
561
|
+
}
|
|
562
|
+
function L(e, t) {
|
|
563
|
+
F((n) => ({
|
|
564
|
+
...n,
|
|
565
|
+
[e]: t
|
|
566
|
+
}));
|
|
567
|
+
}
|
|
568
|
+
let z = g(() => {
|
|
569
|
+
let e = /* @__PURE__ */ new Map([[void 0, []]]);
|
|
570
|
+
for (let t of r.filters) e.set(t.group, [...e.get(t.group) ?? [], t]);
|
|
571
|
+
return [...e.entries()].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
572
|
+
name: e,
|
|
573
|
+
filters: t
|
|
574
|
+
}));
|
|
575
|
+
}), B = v(), V = ["results", "filters"], [H, U] = _("results"), W = (e) => `${B}-tab-${e}`, G = (e) => `${B}-panel-${e}`, K = (e) => `${B}-filter-${e}`;
|
|
576
|
+
function q(e) {
|
|
577
|
+
e === "filters" && F(m()), U(e);
|
|
578
|
+
}
|
|
579
|
+
function ne(e) {
|
|
580
|
+
let t = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
581
|
+
if (t === 0) return;
|
|
582
|
+
e.preventDefault();
|
|
583
|
+
let n = V[(V.indexOf(H()) + t + V.length) % V.length];
|
|
584
|
+
q(n), document.getElementById(W(n))?.focus();
|
|
585
|
+
}
|
|
586
|
+
function re(e) {
|
|
587
|
+
e.preventDefault(), b(P()), U("results");
|
|
588
|
+
}
|
|
589
|
+
function ie() {
|
|
590
|
+
N(), U("results");
|
|
591
|
+
}
|
|
592
|
+
function ae(e) {
|
|
593
|
+
if (e.type === "text") return (() => {
|
|
594
|
+
var t = ce();
|
|
595
|
+
return t.$$input = (t) => L(e.key, t.currentTarget.value), i((n) => {
|
|
596
|
+
var r = K(e.key), i = e.placeholder;
|
|
597
|
+
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "placeholder", n.t = i), n;
|
|
598
|
+
}, {
|
|
599
|
+
e: void 0,
|
|
600
|
+
t: void 0
|
|
601
|
+
}), i(() => t.value = $(I(e.key))), t;
|
|
602
|
+
})();
|
|
603
|
+
if (e.type === "boolean") return n(R, {
|
|
604
|
+
get id() {
|
|
605
|
+
return K(e.key);
|
|
606
|
+
},
|
|
607
|
+
get value() {
|
|
608
|
+
return $(I(e.key));
|
|
609
|
+
},
|
|
610
|
+
onChange: (t) => L(e.key, t),
|
|
611
|
+
get emptyLabel() {
|
|
612
|
+
return r.anyLabel ?? "Any";
|
|
613
|
+
},
|
|
614
|
+
get options() {
|
|
615
|
+
return [{
|
|
616
|
+
value: "true",
|
|
617
|
+
label: r.yesLabel ?? "Yes"
|
|
618
|
+
}, {
|
|
619
|
+
value: "false",
|
|
620
|
+
label: r.noLabel ?? "No"
|
|
621
|
+
}];
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
let t = () => {
|
|
625
|
+
let t = I(e.key);
|
|
626
|
+
return Array.isArray(t) ? t : [];
|
|
627
|
+
};
|
|
628
|
+
return (() => {
|
|
629
|
+
var o = ue();
|
|
630
|
+
return a(o, n(R, {
|
|
631
|
+
get id() {
|
|
632
|
+
return K(e.key);
|
|
633
|
+
},
|
|
634
|
+
value: "",
|
|
635
|
+
onChange: (n) => L(e.key, [...t(), n]),
|
|
636
|
+
get options() {
|
|
637
|
+
return A(e).filter((e) => !t().includes(String(e.value)));
|
|
638
|
+
},
|
|
639
|
+
get placeholder() {
|
|
640
|
+
return e.placeholder ?? r.anyLabel ?? "Any";
|
|
641
|
+
}
|
|
642
|
+
}), null), a(o, n(p, {
|
|
643
|
+
get when() {
|
|
644
|
+
return t().length > 0;
|
|
645
|
+
},
|
|
646
|
+
get children() {
|
|
647
|
+
var r = le();
|
|
648
|
+
return a(r, n(f, {
|
|
649
|
+
get each() {
|
|
650
|
+
return t();
|
|
651
|
+
},
|
|
652
|
+
children: (r) => (() => {
|
|
653
|
+
var o = de(), s = o.firstChild;
|
|
654
|
+
return a(o, () => j(e, r), s), s.$$click = () => L(e.key, t().filter((e) => e !== r)), a(s, n(k, {
|
|
655
|
+
size: 12,
|
|
656
|
+
"aria-hidden": "true"
|
|
657
|
+
})), i(() => c(s, "aria-label", `Remove ${j(e, r)}`)), o;
|
|
658
|
+
})()
|
|
659
|
+
})), r;
|
|
660
|
+
}
|
|
661
|
+
}), null), o;
|
|
662
|
+
})();
|
|
663
|
+
}
|
|
664
|
+
let oe = (() => {
|
|
665
|
+
var e = Z();
|
|
666
|
+
return a(e, n(p, {
|
|
667
|
+
get when() {
|
|
668
|
+
return r.quickSearch !== !1;
|
|
669
|
+
},
|
|
670
|
+
get children() {
|
|
671
|
+
var e = X(), t = e.firstChild;
|
|
672
|
+
return a(e, n(O, {
|
|
673
|
+
class: "filter-table-search-icon",
|
|
674
|
+
size: 16,
|
|
675
|
+
"aria-hidden": "true"
|
|
676
|
+
}), t), t.$$input = (e) => x(ye, e.currentTarget.value), i((e) => {
|
|
677
|
+
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
678
|
+
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
679
|
+
}, {
|
|
680
|
+
e: void 0,
|
|
681
|
+
t: void 0
|
|
682
|
+
}), i(() => t.value = C()), e;
|
|
683
|
+
}
|
|
684
|
+
}), null), a(e, n(p, {
|
|
685
|
+
get when() {
|
|
686
|
+
return M().length > 0;
|
|
687
|
+
},
|
|
688
|
+
get children() {
|
|
689
|
+
var e = fe(), t = e.firstChild, o = t.firstChild;
|
|
690
|
+
return a(e, n(f, {
|
|
691
|
+
get each() {
|
|
692
|
+
return M();
|
|
693
|
+
},
|
|
694
|
+
children: (e) => (() => {
|
|
695
|
+
var t = Q(), r = t.firstChild;
|
|
696
|
+
return r.$$click = () => te(e.filter, e.item), a(r, () => e.text, null), a(r, n(k, {
|
|
697
|
+
size: 12,
|
|
698
|
+
"aria-hidden": "true"
|
|
699
|
+
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
700
|
+
})()
|
|
701
|
+
}), t), o.$$click = N, a(o, () => r.clearAllLabel ?? "Clear all"), e;
|
|
702
|
+
}
|
|
703
|
+
}), null), e;
|
|
704
|
+
})();
|
|
705
|
+
return (() => {
|
|
706
|
+
var e = pe(), l = e.firstChild, u = l.nextSibling, d = u.nextSibling, m = d.firstChild, h = m.firstChild, g = h.firstChild, _ = g.nextSibling;
|
|
707
|
+
return a(l, n(f, {
|
|
708
|
+
each: V,
|
|
709
|
+
children: (e) => (() => {
|
|
710
|
+
var t = he();
|
|
711
|
+
return t.$$keydown = ne, t.$$click = () => q(e), a(t, () => e === "results" ? r.resultsLabel ?? "Results" : r.filtersLabel ?? "Filters", null), a(t, n(p, {
|
|
712
|
+
get when() {
|
|
713
|
+
return e === "results" || w().length > 0;
|
|
714
|
+
},
|
|
715
|
+
get children() {
|
|
716
|
+
var t = me();
|
|
717
|
+
return a(t, () => e === "results" ? D().length : w().length), t;
|
|
718
|
+
}
|
|
719
|
+
}), null), i((n) => {
|
|
720
|
+
var r = W(e), i = H() === e, a = G(e), o = H() === e ? 0 : -1;
|
|
721
|
+
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "aria-selected", n.t = i), a !== n.a && c(t, "aria-controls", n.a = a), o !== n.o && c(t, "tabindex", n.o = o), n;
|
|
722
|
+
}, {
|
|
723
|
+
e: void 0,
|
|
724
|
+
t: void 0,
|
|
725
|
+
a: void 0,
|
|
726
|
+
o: void 0
|
|
727
|
+
}), t;
|
|
728
|
+
})()
|
|
729
|
+
})), a(u, n(Y, s(o, {
|
|
730
|
+
rows: D,
|
|
731
|
+
toolbar: oe
|
|
732
|
+
}))), m.addEventListener("submit", re), a(m, n(f, {
|
|
733
|
+
get each() {
|
|
734
|
+
return z();
|
|
735
|
+
},
|
|
736
|
+
children: (e) => (() => {
|
|
737
|
+
var t = _e();
|
|
738
|
+
return a(t, n(p, {
|
|
739
|
+
get when() {
|
|
740
|
+
return e.name;
|
|
741
|
+
},
|
|
742
|
+
get children() {
|
|
743
|
+
var t = ge();
|
|
744
|
+
return a(t, () => e.name), t;
|
|
745
|
+
}
|
|
746
|
+
}), null), a(t, n(f, {
|
|
747
|
+
get each() {
|
|
748
|
+
return e.filters;
|
|
749
|
+
},
|
|
750
|
+
children: (e) => (() => {
|
|
751
|
+
var t = ve(), n = t.firstChild;
|
|
752
|
+
return a(n, () => e.label), a(t, () => ae(e), null), i(() => c(n, "for", K(e.key))), t;
|
|
753
|
+
})()
|
|
754
|
+
}), null), t;
|
|
755
|
+
})()
|
|
756
|
+
}), h), g.$$click = ie, a(g, n(k, {
|
|
757
|
+
size: 16,
|
|
758
|
+
"aria-hidden": "true"
|
|
759
|
+
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(O, {
|
|
760
|
+
size: 16,
|
|
761
|
+
"aria-hidden": "true"
|
|
762
|
+
}), null), a(_, () => r.applyLabel ?? "Search", null), i((n) => {
|
|
763
|
+
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = G("results"), o = W("results"), s = H() !== "results", l = G("filters"), f = W("filters"), p = H() !== "filters";
|
|
764
|
+
return i !== n.e && t(e, n.e = i), a !== n.t && c(u, "id", n.t = a), o !== n.a && c(u, "aria-labelledby", n.a = o), s !== n.o && (u.hidden = n.o = s), l !== n.i && c(d, "id", n.i = l), f !== n.n && c(d, "aria-labelledby", n.n = f), p !== n.s && (d.hidden = n.s = p), n;
|
|
765
|
+
}, {
|
|
766
|
+
e: void 0,
|
|
767
|
+
t: void 0,
|
|
768
|
+
a: void 0,
|
|
769
|
+
o: void 0,
|
|
770
|
+
i: void 0,
|
|
771
|
+
n: void 0,
|
|
772
|
+
s: void 0
|
|
773
|
+
}), e;
|
|
774
|
+
})();
|
|
775
|
+
}
|
|
776
|
+
r([
|
|
777
|
+
"input",
|
|
778
|
+
"click",
|
|
779
|
+
"keydown"
|
|
780
|
+
]);
|
|
781
|
+
//#endregion
|
|
782
|
+
export { R as Combobox, Y as DataTable, Ce as FilterTable };
|