@serkonda7/solid-components 0.1.0 → 0.2.1
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 +10 -0
- package/dist/data-table.d.ts +6 -0
- package/dist/filter-table.d.ts +17 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +417 -223
- package/dist/search-bar.d.ts +25 -0
- package/dist/styles.css +148 -0
- package/dist/vite.d.ts +16 -0
- package/dist/vite.js +2 -0
- package/package.json +19 -9
package/dist/index.js
CHANGED
|
@@ -57,55 +57,55 @@ var C = {
|
|
|
57
57
|
})();
|
|
58
58
|
};
|
|
59
59
|
return u.displayName = `${i}`, u;
|
|
60
|
-
}, ee = E("outline", "chevron-down", "ChevronDown", [["path", { d: "M6 9l6 6l6 -6" }]]),
|
|
61
|
-
function
|
|
62
|
-
let s, l, u = v(), m = () => r.id ?? u, y = () => `${m()}-listbox`, b = (e) => `${m()}-option-${e}`, [S, C] = _(!1), [w, T] = _(""), [E,
|
|
60
|
+
}, ee = E("outline", "chevron-down", "ChevronDown", [["path", { d: "M6 9l6 6l6 -6" }]]), te = E("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]), D = /*#__PURE__*/ u("<span class=combobox-value aria-hidden=true><span class=combobox-option-label></span><span class=combobox-detail>"), ne = /*#__PURE__*/ u("<div role=option class=\"combobox-option combobox-option-add\">"), re = /*#__PURE__*/ u("<div class=combobox-list role=listbox>"), O = /*#__PURE__*/ u("<div><input class=combobox-input role=combobox aria-autocomplete=list autocomplete=off>"), k = /*#__PURE__*/ u("<span class=combobox-icon aria-hidden=true>"), ie = /*#__PURE__*/ u("<div class=combobox-empty>"), A = /*#__PURE__*/ u("<span class=combobox-detail>"), j = /*#__PURE__*/ u("<div role=option class=combobox-option><span class=combobox-option-label>"), M = /*#__PURE__*/ u("<span class=combobox-option-icon aria-hidden=true>");
|
|
61
|
+
function N(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, N] = _(0), P = g(() => r.emptyLabel === void 0 ? r.options : [{
|
|
63
63
|
value: "",
|
|
64
64
|
label: r.emptyLabel
|
|
65
|
-
}, ...r.options]),
|
|
65
|
+
}, ...r.options]), F = g(() => r.value === "" ? void 0 : P().find((e) => String(e.value) === r.value)), I = g(() => {
|
|
66
66
|
let e = w().trim().toLowerCase();
|
|
67
|
-
return e === "" ?
|
|
68
|
-
}),
|
|
67
|
+
return e === "" ? P() : P().filter((t) => t.label.toLowerCase().includes(e) || (t.detail?.toLowerCase().includes(e) ?? !1));
|
|
68
|
+
}), ae = () => r.options.some((e) => e.detail !== void 0), L = () => I().length, oe = () => I().length + +!!r.onAdd, se = () => !r.disabled && r.onChange !== void 0;
|
|
69
69
|
x(() => {
|
|
70
70
|
r.autofocus === !0 && s?.focus();
|
|
71
71
|
}), h(() => {
|
|
72
72
|
S() && l?.querySelector(`[data-index="${E()}"]`)?.scrollIntoView({ block: "nearest" });
|
|
73
73
|
});
|
|
74
|
-
function
|
|
75
|
-
if (S() || !
|
|
74
|
+
function R() {
|
|
75
|
+
if (S() || !se()) return;
|
|
76
76
|
T("");
|
|
77
|
-
let e =
|
|
78
|
-
|
|
77
|
+
let e = P().findIndex((e) => String(e.value) === r.value);
|
|
78
|
+
N(Math.max(e, 0)), C(!0), r.onOpen?.();
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
if (C(!1), r.onAdd && e ===
|
|
80
|
+
function z(e) {
|
|
81
|
+
if (C(!1), r.onAdd && e === L()) {
|
|
82
82
|
r.onAdd(w().trim());
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
let t =
|
|
85
|
+
let t = I()[e];
|
|
86
86
|
t && String(t.value) !== r.value && r.onChange?.(String(t.value));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
let t =
|
|
90
|
-
S() ? t > 0 &&
|
|
88
|
+
function B(e) {
|
|
89
|
+
let t = oe();
|
|
90
|
+
S() ? t > 0 && N((E() + e + t) % t) : R();
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
92
|
+
function V(e) {
|
|
93
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), B(e.key === "ArrowDown" ? 1 : -1)) : S() && (e.key === "Enter" ? (e.preventDefault(), z(E())) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), C(!1)));
|
|
94
94
|
}
|
|
95
|
-
let
|
|
95
|
+
let ce = () => S() ? F()?.label ?? r.emptyLabel ?? r.searchLabel ?? "Search" : r.emptyLabel ?? r.placeholder;
|
|
96
96
|
return (() => {
|
|
97
|
-
var u =
|
|
98
|
-
h.addEventListener("blur", () => C(!1)), h.$$keydown =
|
|
97
|
+
var u = O(), h = u.firstChild;
|
|
98
|
+
h.addEventListener("blur", () => C(!1)), h.$$keydown = V, h.$$input = (e) => {
|
|
99
99
|
let t = e.currentTarget.value;
|
|
100
|
-
|
|
101
|
-
}, h.$$click =
|
|
100
|
+
R(), T(t), N(0);
|
|
101
|
+
}, h.$$click = R;
|
|
102
102
|
var g = s;
|
|
103
103
|
return typeof g == "function" ? d(g, h) : s = h, a(u, n(p, {
|
|
104
104
|
get when() {
|
|
105
|
-
return o(() => !S())() &&
|
|
105
|
+
return o(() => !S())() && F()?.icon;
|
|
106
106
|
},
|
|
107
107
|
children: (t) => (() => {
|
|
108
|
-
var r =
|
|
108
|
+
var r = k();
|
|
109
109
|
return a(r, n(e, {
|
|
110
110
|
get component() {
|
|
111
111
|
return t();
|
|
@@ -115,11 +115,11 @@ function R(r) {
|
|
|
115
115
|
})()
|
|
116
116
|
}), null), a(u, n(p, {
|
|
117
117
|
get when() {
|
|
118
|
-
return o(() => !S())() &&
|
|
118
|
+
return o(() => !S())() && F()?.detail;
|
|
119
119
|
},
|
|
120
120
|
get children() {
|
|
121
|
-
var e =
|
|
122
|
-
return a(t, () =>
|
|
121
|
+
var e = D(), t = e.firstChild, n = t.nextSibling;
|
|
122
|
+
return a(t, () => F()?.label), a(n, () => F()?.detail), e;
|
|
123
123
|
}
|
|
124
124
|
}), null), a(u, n(ee, {
|
|
125
125
|
class: "combobox-chevron",
|
|
@@ -130,25 +130,25 @@ function R(r) {
|
|
|
130
130
|
return S();
|
|
131
131
|
},
|
|
132
132
|
get children() {
|
|
133
|
-
var t =
|
|
133
|
+
var t = re(), o = l;
|
|
134
134
|
return typeof o == "function" ? d(o, t) : l = t, a(t, n(f, {
|
|
135
135
|
get each() {
|
|
136
|
-
return
|
|
136
|
+
return I();
|
|
137
137
|
},
|
|
138
138
|
get fallback() {
|
|
139
139
|
return (() => {
|
|
140
|
-
var e =
|
|
140
|
+
var e = ie();
|
|
141
141
|
return a(e, () => r.noMatchesLabel ?? "No matching objects"), e;
|
|
142
142
|
})();
|
|
143
143
|
},
|
|
144
144
|
children: (t, o) => (() => {
|
|
145
|
-
var s =
|
|
146
|
-
return s.$$click = () =>
|
|
145
|
+
var s = j(), l = s.firstChild;
|
|
146
|
+
return s.$$click = () => z(o()), s.$$mousemove = () => N(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(p, {
|
|
147
147
|
get when() {
|
|
148
148
|
return t.icon;
|
|
149
149
|
},
|
|
150
150
|
children: (t) => (() => {
|
|
151
|
-
var r =
|
|
151
|
+
var r = M();
|
|
152
152
|
return a(r, n(e, {
|
|
153
153
|
get component() {
|
|
154
154
|
return t();
|
|
@@ -161,7 +161,7 @@ function R(r) {
|
|
|
161
161
|
return t.detail;
|
|
162
162
|
},
|
|
163
163
|
get children() {
|
|
164
|
-
var e =
|
|
164
|
+
var e = A();
|
|
165
165
|
return a(e, () => t.detail), e;
|
|
166
166
|
}
|
|
167
167
|
}), null), i((e) => {
|
|
@@ -180,12 +180,12 @@ function R(r) {
|
|
|
180
180
|
return r.onAdd;
|
|
181
181
|
},
|
|
182
182
|
get children() {
|
|
183
|
-
var e =
|
|
184
|
-
return e.$$click = () =>
|
|
183
|
+
var e = ne();
|
|
184
|
+
return e.$$click = () => z(L()), e.$$mousemove = () => N(L()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(te, {
|
|
185
185
|
size: 14,
|
|
186
186
|
"aria-hidden": "true"
|
|
187
187
|
}), null), a(e, () => r.addLabel ?? "Add", null), i((t) => {
|
|
188
|
-
var n = b(
|
|
188
|
+
var n = b(L()), r = L(), i = L() === E();
|
|
189
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;
|
|
190
190
|
}, {
|
|
191
191
|
e: void 0,
|
|
@@ -194,7 +194,7 @@ function R(r) {
|
|
|
194
194
|
}), e;
|
|
195
195
|
}
|
|
196
196
|
}), null), i((e) => {
|
|
197
|
-
var n = !!
|
|
197
|
+
var n = !!ae(), r = y();
|
|
198
198
|
return n !== e.e && t.classList.toggle("combobox-list-detail", e.e = n), r !== e.t && c(t, "id", e.t = r), e;
|
|
199
199
|
}, {
|
|
200
200
|
e: void 0,
|
|
@@ -202,7 +202,7 @@ function R(r) {
|
|
|
202
202
|
}), t;
|
|
203
203
|
}
|
|
204
204
|
}), null), i((e) => {
|
|
205
|
-
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!S(), a = !(S() || !
|
|
205
|
+
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!S(), a = !(S() || !F()?.detail), o = !(S() || F()?.icon === void 0), s = m(), l = S(), d = y(), f = S() && oe() > 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 = ce();
|
|
206
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;
|
|
207
207
|
}, {
|
|
208
208
|
e: void 0,
|
|
@@ -220,7 +220,7 @@ function R(r) {
|
|
|
220
220
|
c: void 0,
|
|
221
221
|
w: void 0,
|
|
222
222
|
m: void 0
|
|
223
|
-
}), i(() => h.value = S() ? w() :
|
|
223
|
+
}), i(() => h.value = S() ? w() : F()?.label ?? ""), u;
|
|
224
224
|
})();
|
|
225
225
|
}
|
|
226
226
|
r([
|
|
@@ -231,102 +231,119 @@ r([
|
|
|
231
231
|
"mousemove"
|
|
232
232
|
]);
|
|
233
233
|
//#endregion
|
|
234
|
-
//#region
|
|
235
|
-
var
|
|
236
|
-
function
|
|
234
|
+
//#region node_modules/@tabler/icons-solidjs/dist/source/icons/IconChevronUp.js
|
|
235
|
+
var P = E("outline", "chevron-up", "ChevronUp", [["path", { d: "M6 15l6 -6l6 6" }]]), F = E("outline", "menu", "Menu", [["path", { d: "M4 8l16 0" }], ["path", { d: "M4 16l16 0" }]]), I = /*#__PURE__*/ u("<div class=data-table-toolbar-start>"), ae = /*#__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>"), L = /*#__PURE__*/ u("<div class=data-table-customizer><button type=button class=data-table-customizer-button aria-haspopup=dialog><span aria-hidden=true>⚙</span> "), oe = /*#__PURE__*/ u("<div class=data-table-toolbar>"), se = /*#__PURE__*/ u("<th class=data-table-checkbox><span class=data-table-visually-hidden>Select rows</span><input type=checkbox>"), R = /*#__PURE__*/ u("<th>Actions"), z = /*#__PURE__*/ u("<div><div class=data-table-scroll><table class=data-table><thead><tr></tr></thead><tbody>"), B = /*#__PURE__*/ u("<li class=data-table-customizer-item draggable=true><label class=data-table-customizer-option><input type=checkbox></label><button type=button class=data-table-customizer-move></button><button type=button class=data-table-customizer-move>"), V = /*#__PURE__*/ u("<button type=button class=data-table-sort><span class=data-table-sort-indicator aria-hidden=true>"), ce = /*#__PURE__*/ u("<th>"), le = /*#__PURE__*/ u("<td class=data-table-checkbox><input type=checkbox>"), H = /*#__PURE__*/ u("<td>"), U = /*#__PURE__*/ u("<tr>"), W = /*#__PURE__*/ u("<p class=data-table-status>Loading…"), G = /*#__PURE__*/ u("<p class=data-table-status>No results.");
|
|
236
|
+
function K(e) {
|
|
237
237
|
return typeof e == "function" ? e() : e;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
let r = g(() =>
|
|
239
|
+
function ue(e) {
|
|
240
|
+
let r = g(() => K(e.rows)), s = () => K(e.loading ?? !1), l = () => K(e.selected ?? []), u = e.sortKey !== void 0 || e.sortDirection !== void 0, [y, x] = _(e.defaultSort), S = () => u ? K(e.sortKey ?? void 0) : y()?.key, C = () => u ? K(e.sortDirection ?? "asc") : y()?.direction ?? "asc", w = () => K(e.showColumnCustomizer ?? !1), T = m(() => e.toolbar), E = () => e.selected !== void 0 && e.onSelectionChange !== void 0, te = () => {
|
|
241
241
|
let t = l();
|
|
242
242
|
return r().length > 0 && r().every((n) => t.includes(e.getRowId(n)));
|
|
243
|
-
}, D = g(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [
|
|
244
|
-
function
|
|
243
|
+
}, D = g(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [ne, re] = _(void 0), O = () => e.visibleColumns === void 0 ? ne() ?? D() : K(e.visibleColumns), k = g(() => new Set(O())), [ie, A] = _(void 0);
|
|
244
|
+
function j(t) {
|
|
245
|
+
let n = new Map(e.columns.map((e) => [e.key, e])), r = [...new Set(t)].flatMap((e) => n.get(e) ?? []), i = new Set(r);
|
|
246
|
+
return [...r, ...e.columns.filter((e) => !i.has(e))];
|
|
247
|
+
}
|
|
248
|
+
let M = g(() => j(e.columnOrder === void 0 ? ie() ?? e.defaultColumnOrder ?? [] : K(e.columnOrder))), N = g(() => M().filter((e) => e.toggleable === !1 || k().has(e.key))), ue = g(() => e.columns.filter((e) => e.toggleable !== !1)), de = g(() => ue().map((e) => e.key));
|
|
249
|
+
function q(e, t) {
|
|
245
250
|
return t.sortValue ? t.sortValue(e) : e[t.key];
|
|
246
251
|
}
|
|
247
|
-
function
|
|
252
|
+
function J(e, t) {
|
|
248
253
|
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 });
|
|
249
254
|
}
|
|
250
|
-
let
|
|
255
|
+
let fe = g(() => {
|
|
251
256
|
let t = r(), n = S();
|
|
252
257
|
if (u || !n) return t;
|
|
253
258
|
let i = e.columns.find((e) => e.key === n);
|
|
254
259
|
if (!i) return t;
|
|
255
260
|
let a = C() === "asc" ? 1 : -1;
|
|
256
|
-
return [...t].sort((e, t) => a *
|
|
261
|
+
return [...t].sort((e, t) => a * J(q(e, i), q(t, i)));
|
|
257
262
|
});
|
|
258
|
-
function
|
|
263
|
+
function pe(t) {
|
|
259
264
|
let n = S() === t, r = n && C() === "desc" ? void 0 : {
|
|
260
265
|
key: t,
|
|
261
266
|
direction: n ? "desc" : "asc"
|
|
262
267
|
};
|
|
263
268
|
u || x(r), e.onSort?.(t), r || e.onSortClear?.(), e.onSortChange?.(r);
|
|
264
269
|
}
|
|
265
|
-
function
|
|
270
|
+
function me(t) {
|
|
266
271
|
let n = new Map(e.columns.map((e, t) => [e.key, t]));
|
|
267
272
|
return [...t].sort((e, t) => (n.get(e) ?? 0) - (n.get(t) ?? 0));
|
|
268
273
|
}
|
|
269
|
-
function
|
|
270
|
-
let n =
|
|
271
|
-
e.visibleColumns === void 0 &&
|
|
274
|
+
function he(t) {
|
|
275
|
+
let n = me(t);
|
|
276
|
+
e.visibleColumns === void 0 && re(n), e.onVisibleColumnsChange?.(n);
|
|
277
|
+
}
|
|
278
|
+
function ge(e, t) {
|
|
279
|
+
let n = new Set(O());
|
|
280
|
+
t ? n.add(e) : n.delete(e), he(de().filter((e) => n.has(e)));
|
|
281
|
+
}
|
|
282
|
+
function _e() {
|
|
283
|
+
he(de());
|
|
272
284
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
275
|
-
t ? n.add(e) : n.delete(e), Y(N().filter((e) => n.has(e)));
|
|
285
|
+
function ve(t) {
|
|
286
|
+
e.columnOrder === void 0 && A(t), e.onColumnOrderChange?.(t);
|
|
276
287
|
}
|
|
277
|
-
function
|
|
278
|
-
|
|
288
|
+
function ye(e, t) {
|
|
289
|
+
let n = M().map((e) => e.key), r = n.indexOf(e);
|
|
290
|
+
r === -1 || t < 0 || t >= n.length || t === r || (n.splice(r, 1), n.splice(t, 0, e), ve(n));
|
|
279
291
|
}
|
|
280
|
-
function
|
|
281
|
-
|
|
292
|
+
function be(e, t, n) {
|
|
293
|
+
ye(t, M().findIndex((e) => e.key === t) + n);
|
|
294
|
+
let r = e.parentElement?.querySelectorAll(".data-table-customizer-move");
|
|
295
|
+
(e.disabled ? [...r ?? []].find((e) => !e.disabled) : e)?.focus();
|
|
282
296
|
}
|
|
283
|
-
|
|
297
|
+
function xe() {
|
|
298
|
+
he(D()), ve(j(e.defaultColumnOrder ?? []).map((e) => e.key));
|
|
299
|
+
}
|
|
300
|
+
let [Se, Ce] = _(), we = `${v()}-panel`, [Te, Ee] = _(!1), Y;
|
|
284
301
|
h(() => {
|
|
285
|
-
if (!
|
|
302
|
+
if (!Te() || !w()) return;
|
|
286
303
|
function e(e) {
|
|
287
|
-
|
|
304
|
+
Y && !Y.contains(e.target) && Ee(!1);
|
|
288
305
|
}
|
|
289
306
|
function t(e) {
|
|
290
|
-
e.key === "Escape" &&
|
|
307
|
+
e.key === "Escape" && Ee(!1);
|
|
291
308
|
}
|
|
292
309
|
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), b(() => {
|
|
293
310
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
294
311
|
});
|
|
295
312
|
});
|
|
296
|
-
let
|
|
313
|
+
let X;
|
|
297
314
|
h(() => {
|
|
298
|
-
|
|
315
|
+
X && (X.indeterminate = l().length > 0 && !te());
|
|
299
316
|
});
|
|
300
|
-
function
|
|
317
|
+
function De(t) {
|
|
301
318
|
e.onSelectionChange?.(t ? r().map(e.getRowId) : []);
|
|
302
319
|
}
|
|
303
|
-
function
|
|
320
|
+
function Oe(t, n) {
|
|
304
321
|
let r = e.getRowId(t), i = l(), a = n ? [...i, r] : i.filter((e) => e !== r);
|
|
305
322
|
e.onSelectionChange?.(a);
|
|
306
323
|
}
|
|
307
|
-
function
|
|
324
|
+
function ke(t) {
|
|
308
325
|
return l().includes(e.getRowId(t));
|
|
309
326
|
}
|
|
310
|
-
function
|
|
311
|
-
return e.toggleable === !1 ||
|
|
327
|
+
function Ae(e) {
|
|
328
|
+
return e.toggleable === !1 || k().has(e.key);
|
|
312
329
|
}
|
|
313
|
-
function
|
|
330
|
+
function Z(t, n) {
|
|
314
331
|
return e.getCell?.(t, n) ?? n.getValue?.(t) ?? null;
|
|
315
332
|
}
|
|
316
333
|
return (() => {
|
|
317
|
-
var l =
|
|
334
|
+
var l = z(), m = l.firstChild, h = m.firstChild.firstChild, g = h.firstChild, _ = h.nextSibling;
|
|
318
335
|
return a(l, n(p, {
|
|
319
336
|
get when() {
|
|
320
337
|
return w() || T.toArray().length > 0;
|
|
321
338
|
},
|
|
322
339
|
get children() {
|
|
323
|
-
var t =
|
|
340
|
+
var t = oe();
|
|
324
341
|
return a(t, n(p, {
|
|
325
342
|
get when() {
|
|
326
343
|
return T.toArray().length > 0;
|
|
327
344
|
},
|
|
328
345
|
get children() {
|
|
329
|
-
var e =
|
|
346
|
+
var e = I();
|
|
330
347
|
return a(e, T), e;
|
|
331
348
|
}
|
|
332
349
|
}), null), a(t, n(p, {
|
|
@@ -334,26 +351,51 @@ function Y(e) {
|
|
|
334
351
|
return w();
|
|
335
352
|
},
|
|
336
353
|
get children() {
|
|
337
|
-
var t =
|
|
354
|
+
var t = L(), r = t.firstChild;
|
|
338
355
|
r.firstChild.nextSibling;
|
|
339
|
-
var o =
|
|
340
|
-
return typeof o == "function" ? d(o, t) :
|
|
356
|
+
var o = Y;
|
|
357
|
+
return typeof o == "function" ? d(o, t) : Y = t, r.$$click = () => Ee((e) => !e), c(r, "aria-controls", we), a(r, () => e.columnCustomizerLabel ?? "Columns", null), a(t, n(p, {
|
|
341
358
|
get when() {
|
|
342
|
-
return
|
|
359
|
+
return Te();
|
|
343
360
|
},
|
|
344
361
|
get children() {
|
|
345
|
-
var t =
|
|
346
|
-
return c(t, "id",
|
|
362
|
+
var t = ae(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
363
|
+
return c(t, "id", we), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(f, {
|
|
347
364
|
get each() {
|
|
348
|
-
return
|
|
365
|
+
return M();
|
|
349
366
|
},
|
|
350
|
-
children: (
|
|
351
|
-
var
|
|
352
|
-
return
|
|
367
|
+
children: (t, r) => (() => {
|
|
368
|
+
var o = B(), s = o.firstChild, l = s.firstChild, u = s.nextSibling, d = u.nextSibling;
|
|
369
|
+
return o.addEventListener("dragend", () => Ce(void 0)), o.addEventListener("drop", (e) => e.preventDefault()), o.addEventListener("dragover", (e) => {
|
|
370
|
+
let t = Se();
|
|
371
|
+
t !== void 0 && (e.preventDefault(), ye(t, r()));
|
|
372
|
+
}), o.addEventListener("dragstart", (e) => {
|
|
373
|
+
Ce(t.key), e.dataTransfer?.setData("text/plain", t.key), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
374
|
+
}), a(o, n(F, {
|
|
375
|
+
class: "data-table-customizer-grip",
|
|
376
|
+
size: 14,
|
|
377
|
+
"aria-hidden": "true"
|
|
378
|
+
}), s), l.addEventListener("change", (e) => ge(t.key, e.currentTarget.checked)), a(s, () => t.ariaLabel ?? t.label, null), u.$$click = (e) => be(e.currentTarget, t.key, -1), a(u, n(P, {
|
|
379
|
+
size: 14,
|
|
380
|
+
"aria-hidden": "true"
|
|
381
|
+
})), d.$$click = (e) => be(e.currentTarget, t.key, 1), a(d, n(ee, {
|
|
382
|
+
size: 14,
|
|
383
|
+
"aria-hidden": "true"
|
|
384
|
+
})), i((n) => {
|
|
385
|
+
var i = Se() === t.key, a = t.toggleable === !1, s = `${e.columnCustomizerMoveUpLabel ?? "Move up"}: ${t.ariaLabel ?? t.label}`, f = r() === 0, p = `${e.columnCustomizerMoveDownLabel ?? "Move down"}: ${t.ariaLabel ?? t.label}`, m = r() === M().length - 1;
|
|
386
|
+
return i !== n.e && o.classList.toggle("data-table-customizer-item-dragging", n.e = i), a !== n.t && (l.disabled = n.t = a), s !== n.a && c(u, "aria-label", n.a = s), f !== n.o && (u.disabled = n.o = f), p !== n.i && c(d, "aria-label", n.i = p), m !== n.n && (d.disabled = n.n = m), n;
|
|
387
|
+
}, {
|
|
388
|
+
e: void 0,
|
|
389
|
+
t: void 0,
|
|
390
|
+
a: void 0,
|
|
391
|
+
o: void 0,
|
|
392
|
+
i: void 0,
|
|
393
|
+
n: void 0
|
|
394
|
+
}), i(() => l.checked = Ae(t)), o;
|
|
353
395
|
})()
|
|
354
|
-
})), s.$$click =
|
|
396
|
+
})), s.$$click = _e, a(s, () => e.columnCustomizerShowAllLabel ?? "Show all"), l.$$click = xe, a(l, () => e.columnCustomizerResetLabel ?? "Reset"), i(() => c(t, "aria-label", e.columnCustomizerTitle ?? "Customize columns")), t;
|
|
355
397
|
}
|
|
356
|
-
}), null), i(() => c(r, "aria-expanded",
|
|
398
|
+
}), null), i(() => c(r, "aria-expanded", Te())), t;
|
|
357
399
|
}
|
|
358
400
|
}), null), t;
|
|
359
401
|
}
|
|
@@ -362,17 +404,17 @@ function Y(e) {
|
|
|
362
404
|
return E();
|
|
363
405
|
},
|
|
364
406
|
get children() {
|
|
365
|
-
var t =
|
|
366
|
-
n.addEventListener("change", (e) =>
|
|
367
|
-
var r =
|
|
368
|
-
return typeof r == "function" ? d(r, n) :
|
|
407
|
+
var t = se(), n = t.firstChild.nextSibling;
|
|
408
|
+
n.addEventListener("change", (e) => De(e.currentTarget.checked));
|
|
409
|
+
var r = X;
|
|
410
|
+
return typeof r == "function" ? d(r, n) : X = n, i(() => c(n, "aria-label", e.selectionLabel ?? "Select all rows")), i(() => n.checked = te()), t;
|
|
369
411
|
}
|
|
370
412
|
}), null), a(g, n(f, {
|
|
371
413
|
get each() {
|
|
372
|
-
return
|
|
414
|
+
return N();
|
|
373
415
|
},
|
|
374
416
|
children: (r) => (() => {
|
|
375
|
-
var s =
|
|
417
|
+
var s = ce();
|
|
376
418
|
return a(s, n(p, {
|
|
377
419
|
get when() {
|
|
378
420
|
return o(() => !!r.sortable)() && (!u || e.onSort || e.onSortChange);
|
|
@@ -381,8 +423,8 @@ function Y(e) {
|
|
|
381
423
|
return r.label;
|
|
382
424
|
},
|
|
383
425
|
get children() {
|
|
384
|
-
var e =
|
|
385
|
-
return e.$$click = () =>
|
|
426
|
+
var e = V(), t = e.firstChild;
|
|
427
|
+
return e.$$click = () => pe(r.key), a(e, () => r.label, t), a(t, (() => {
|
|
386
428
|
var e = o(() => S() === r.key);
|
|
387
429
|
return () => e() ? C() === "asc" ? "▲" : "▼" : "";
|
|
388
430
|
})()), e;
|
|
@@ -400,36 +442,36 @@ function Y(e) {
|
|
|
400
442
|
return e.rowActions;
|
|
401
443
|
},
|
|
402
444
|
get children() {
|
|
403
|
-
return
|
|
445
|
+
return R();
|
|
404
446
|
}
|
|
405
447
|
}), null), a(_, n(f, {
|
|
406
448
|
get each() {
|
|
407
|
-
return
|
|
449
|
+
return fe();
|
|
408
450
|
},
|
|
409
451
|
children: (r) => (() => {
|
|
410
|
-
var o =
|
|
452
|
+
var o = U();
|
|
411
453
|
return a(o, n(p, {
|
|
412
454
|
get when() {
|
|
413
455
|
return E();
|
|
414
456
|
},
|
|
415
457
|
get children() {
|
|
416
|
-
var t =
|
|
417
|
-
return n.addEventListener("change", (e) =>
|
|
458
|
+
var t = le(), n = t.firstChild;
|
|
459
|
+
return n.addEventListener("change", (e) => Oe(r, e.currentTarget.checked)), i(() => c(n, "aria-label", `Select row ${e.getRowId(r)}`)), i(() => n.checked = ke(r)), t;
|
|
418
460
|
}
|
|
419
461
|
}), null), a(o, n(f, {
|
|
420
462
|
get each() {
|
|
421
|
-
return
|
|
463
|
+
return N();
|
|
422
464
|
},
|
|
423
465
|
children: (e) => (() => {
|
|
424
|
-
var n =
|
|
425
|
-
return a(n, () =>
|
|
466
|
+
var n = H();
|
|
467
|
+
return a(n, () => Z(r, e)), i(() => t(n, e.class)), n;
|
|
426
468
|
})()
|
|
427
469
|
}), null), a(o, n(p, {
|
|
428
470
|
get when() {
|
|
429
471
|
return e.rowActions;
|
|
430
472
|
},
|
|
431
473
|
get children() {
|
|
432
|
-
var t =
|
|
474
|
+
var t = H();
|
|
433
475
|
return a(t, () => e.rowActions?.(r)), t;
|
|
434
476
|
}
|
|
435
477
|
}), null), o;
|
|
@@ -439,43 +481,56 @@ function Y(e) {
|
|
|
439
481
|
return s();
|
|
440
482
|
},
|
|
441
483
|
get children() {
|
|
442
|
-
return e.loadingContent ??
|
|
484
|
+
return e.loadingContent ?? W();
|
|
443
485
|
}
|
|
444
486
|
}), null), a(l, n(p, {
|
|
445
487
|
get when() {
|
|
446
|
-
return o(() => !s())() && (e.empty === void 0 ? r().length === 0 :
|
|
488
|
+
return o(() => !s())() && (e.empty === void 0 ? r().length === 0 : K(e.empty));
|
|
447
489
|
},
|
|
448
490
|
get children() {
|
|
449
|
-
return e.emptyContent ??
|
|
491
|
+
return e.emptyContent ?? G();
|
|
450
492
|
}
|
|
451
493
|
}), null), i(() => t(l, `data-table-wrap${e.class ? ` ${e.class}` : ""}`)), l;
|
|
452
494
|
})();
|
|
453
495
|
}
|
|
454
496
|
r(["click"]);
|
|
455
497
|
//#endregion
|
|
456
|
-
//#region
|
|
457
|
-
var
|
|
458
|
-
|
|
498
|
+
//#region node_modules/@tabler/icons-solidjs/dist/source/icons/IconDeviceFloppy.js
|
|
499
|
+
var de = E("outline", "device-floppy", "DeviceFloppy", [
|
|
500
|
+
["path", { d: "M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" }],
|
|
501
|
+
["path", { d: "M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }],
|
|
502
|
+
["path", { d: "M14 4l0 4l-6 0l0 -4" }]
|
|
503
|
+
]), q = 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" }]]), J = E("outline", "x", "X", [["path", { d: "M18 6l-12 12" }], ["path", { d: "M6 6l12 12" }]]), fe = /*#__PURE__*/ u("<input class=filter-table-input type=text>"), pe = /*#__PURE__*/ u("<ul class=filter-table-chips>"), me = /*#__PURE__*/ u("<div class=filter-table-multi>"), he = /*#__PURE__*/ u("<li class=filter-table-chip><button type=button class=filter-table-chip-remove>"), ge = /*#__PURE__*/ u("<div class=filter-table-search><input type=search class=filter-table-input>"), _e = /*#__PURE__*/ u("<div class=filter-table-saved>"), ve = /*#__PURE__*/ u("<li><button type=button class=\"filter-table-pill filter-table-pill-save\">"), ye = /*#__PURE__*/ u("<ul class=filter-table-pills aria-label=\"Applied filters\"><li><button type=button class=\"filter-table-pill filter-table-pill-clear\">"), be = /*#__PURE__*/ u("<form class=filter-table-save><input type=text class=filter-table-input><button type=submit class=\"filter-table-button filter-table-button-primary\"></button><button type=button class=filter-table-button>"), xe = /*#__PURE__*/ u("<div class=filter-table-toolbar>"), Se = /*#__PURE__*/ u("<button type=button class=filter-table-chip-remove>"), Ce = /*#__PURE__*/ u("<li><button type=button class=filter-table-pill>"), we = /*#__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\">"), Te = /*#__PURE__*/ u("<span class=filter-table-badge>"), Ee = /*#__PURE__*/ u("<button type=button role=tab class=filter-table-tab>"), Y = /*#__PURE__*/ u("<legend class=filter-table-legend>"), X = /*#__PURE__*/ u("<fieldset class=filter-table-fieldset>"), De = /*#__PURE__*/ u("<div class=filter-table-field><label class=filter-table-label>"), Oe = "q";
|
|
504
|
+
function ke(e) {
|
|
459
505
|
return typeof e == "function" ? e() : e;
|
|
460
506
|
}
|
|
461
|
-
function
|
|
507
|
+
function Ae(e) {
|
|
462
508
|
return Array.isArray(e) ? e.length > 0 : (e ?? "").trim() !== "";
|
|
463
509
|
}
|
|
464
|
-
function
|
|
510
|
+
function Z(e) {
|
|
465
511
|
let t = {};
|
|
466
|
-
for (let [n, r] of Object.entries(e))
|
|
512
|
+
for (let [n, r] of Object.entries(e)) Ae(r) && (t[n] = Array.isArray(r) ? r : r.trim());
|
|
467
513
|
return t;
|
|
468
514
|
}
|
|
469
|
-
function
|
|
515
|
+
function je(e, t) {
|
|
516
|
+
let n = Object.keys(e);
|
|
517
|
+
return n.length === Object.keys(t).length && n.every((n) => {
|
|
518
|
+
let r = e[n], i = t[n];
|
|
519
|
+
return Array.isArray(r) && Array.isArray(i) ? r.length === i.length && r.every((e) => i.includes(e)) : r === i;
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
function Q(e) {
|
|
470
523
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
471
524
|
}
|
|
472
|
-
function
|
|
473
|
-
let [r,
|
|
525
|
+
function $(e) {
|
|
526
|
+
let [r, l] = S(e, [
|
|
474
527
|
"rows",
|
|
475
528
|
"filters",
|
|
476
529
|
"filterValues",
|
|
477
530
|
"defaultFilterValues",
|
|
478
531
|
"onFilterValuesChange",
|
|
532
|
+
"savedFilters",
|
|
533
|
+
"onSavedFiltersChange",
|
|
479
534
|
"manualFiltering",
|
|
480
535
|
"quickSearch",
|
|
481
536
|
"getSearchText",
|
|
@@ -488,46 +543,51 @@ function Ce(e) {
|
|
|
488
543
|
"anyLabel",
|
|
489
544
|
"yesLabel",
|
|
490
545
|
"noLabel",
|
|
546
|
+
"savedFiltersLabel",
|
|
547
|
+
"saveLabel",
|
|
548
|
+
"saveNameLabel",
|
|
549
|
+
"cancelLabel",
|
|
550
|
+
"clearSavedFilterLabel",
|
|
491
551
|
"class"
|
|
492
|
-
]),
|
|
493
|
-
function
|
|
494
|
-
let t =
|
|
495
|
-
r.filterValues === void 0 &&
|
|
496
|
-
}
|
|
497
|
-
function
|
|
498
|
-
|
|
499
|
-
...
|
|
552
|
+
]), u = g(() => ke(r.rows)), [m, b] = _(Z(r.defaultFilterValues ?? {})), x = g(() => r.filterValues === void 0 ? m() : Z(ke(r.filterValues)));
|
|
553
|
+
function C(e) {
|
|
554
|
+
let t = Z(e);
|
|
555
|
+
r.filterValues === void 0 && b(t), r.onFilterValuesChange?.(t);
|
|
556
|
+
}
|
|
557
|
+
function w(e, t) {
|
|
558
|
+
C({
|
|
559
|
+
...x(),
|
|
500
560
|
[e]: t
|
|
501
561
|
});
|
|
502
562
|
}
|
|
503
|
-
let
|
|
504
|
-
function
|
|
563
|
+
let T = () => Q(x()[Oe]), E = g(() => r.filters.filter((e) => Ae(x()[e.key])));
|
|
564
|
+
function ee(e, t) {
|
|
505
565
|
return t.getValue ? t.getValue(e) : e[t.key];
|
|
506
566
|
}
|
|
507
|
-
function
|
|
567
|
+
function te(e, t, n) {
|
|
508
568
|
if (t.match) return t.match(e, n);
|
|
509
|
-
let r =
|
|
569
|
+
let r = ee(e, t);
|
|
510
570
|
if (t.type === "select") {
|
|
511
571
|
let e = Array.isArray(n) ? n : [n];
|
|
512
|
-
return (Array.isArray(r) ? r : [r]).some((t) => e.includes(
|
|
572
|
+
return (Array.isArray(r) ? r : [r]).some((t) => e.includes(Q(t)));
|
|
513
573
|
}
|
|
514
|
-
return t.type === "boolean" ? !!r == (n === "true") :
|
|
574
|
+
return t.type === "boolean" ? !!r == (n === "true") : Q(r).toLowerCase().includes(Q(n).toLowerCase());
|
|
515
575
|
}
|
|
516
|
-
function
|
|
517
|
-
return r.getSearchText ? r.getSearchText(e) :
|
|
576
|
+
function D(e) {
|
|
577
|
+
return r.getSearchText ? r.getSearchText(e) : l.columns.map((t) => Q(t.sortValue?.(e) ?? e[t.key])).join(" ");
|
|
518
578
|
}
|
|
519
|
-
let
|
|
520
|
-
if (r.manualFiltering) return
|
|
521
|
-
let e =
|
|
522
|
-
return
|
|
579
|
+
let ne = g(() => {
|
|
580
|
+
if (r.manualFiltering) return u();
|
|
581
|
+
let e = T().toLowerCase(), t = E();
|
|
582
|
+
return u().filter((n) => (e === "" || D(n).toLowerCase().includes(e)) && t.every((e) => te(n, e, x()[e.key])));
|
|
523
583
|
});
|
|
524
|
-
function
|
|
584
|
+
function re(e) {
|
|
525
585
|
if (e.options) return e.options;
|
|
526
586
|
let t = /* @__PURE__ */ new Set();
|
|
527
|
-
for (let n of
|
|
528
|
-
let r =
|
|
587
|
+
for (let n of u()) {
|
|
588
|
+
let r = ee(n, e);
|
|
529
589
|
for (let e of Array.isArray(r) ? r : [r]) {
|
|
530
|
-
let n =
|
|
590
|
+
let n = Q(e);
|
|
531
591
|
n !== "" && t.add(n);
|
|
532
592
|
}
|
|
533
593
|
}
|
|
@@ -536,78 +596,96 @@ function Ce(e) {
|
|
|
536
596
|
label: e
|
|
537
597
|
}));
|
|
538
598
|
}
|
|
539
|
-
function
|
|
540
|
-
return e.type === "boolean" ? t === "true" ? r.yesLabel ?? "Yes" : r.noLabel ?? "No" : e.type === "select" ?
|
|
599
|
+
function O(e, t) {
|
|
600
|
+
return e.type === "boolean" ? t === "true" ? r.yesLabel ?? "Yes" : r.noLabel ?? "No" : e.type === "select" ? re(e).find((e) => String(e.value) === t)?.label ?? t : t;
|
|
541
601
|
}
|
|
542
|
-
let
|
|
543
|
-
let t =
|
|
602
|
+
let k = g(() => E().flatMap((e) => {
|
|
603
|
+
let t = x()[e.key];
|
|
544
604
|
return (Array.isArray(t) ? t : [t]).map((t) => ({
|
|
545
605
|
filter: e,
|
|
546
606
|
item: t,
|
|
547
|
-
text: `${e.label}: ${
|
|
607
|
+
text: `${e.label}: ${O(e, t)}`
|
|
548
608
|
}));
|
|
549
609
|
}));
|
|
550
|
-
function
|
|
551
|
-
let n =
|
|
552
|
-
|
|
610
|
+
function ie(e, t) {
|
|
611
|
+
let n = x()[e.key];
|
|
612
|
+
w(e.key, Array.isArray(n) ? n.filter((e) => e !== t) : "");
|
|
553
613
|
}
|
|
554
|
-
function
|
|
555
|
-
|
|
614
|
+
function A() {
|
|
615
|
+
C({ [Oe]: T() });
|
|
556
616
|
}
|
|
557
|
-
let [P, F] = _(
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
617
|
+
let j = g(() => r.savedFilters === void 0 ? void 0 : ke(r.savedFilters)), M = g(() => j()?.find((e) => je(Z(e.values), x()))), [P, F] = _(!1), [I, ae] = _("");
|
|
618
|
+
function L(e) {
|
|
619
|
+
let t = j()?.find((t) => t.name === e);
|
|
620
|
+
t && C(t.values);
|
|
561
621
|
}
|
|
562
|
-
function
|
|
563
|
-
|
|
622
|
+
function oe() {
|
|
623
|
+
ae(M()?.name ?? ""), F(!0);
|
|
624
|
+
}
|
|
625
|
+
function se(e) {
|
|
626
|
+
e.preventDefault();
|
|
627
|
+
let t = I().trim();
|
|
628
|
+
if (t === "") return;
|
|
629
|
+
let n = (j() ?? []).filter((e) => e.name !== t);
|
|
630
|
+
r.onSavedFiltersChange?.([...n, {
|
|
631
|
+
name: t,
|
|
632
|
+
values: x()
|
|
633
|
+
}]), F(!1);
|
|
634
|
+
}
|
|
635
|
+
let [R, z] = _(x());
|
|
636
|
+
h(y(x, (e) => z(e)));
|
|
637
|
+
function B(e) {
|
|
638
|
+
return R()[e];
|
|
639
|
+
}
|
|
640
|
+
function V(e, t) {
|
|
641
|
+
z((n) => ({
|
|
564
642
|
...n,
|
|
565
643
|
[e]: t
|
|
566
644
|
}));
|
|
567
645
|
}
|
|
568
|
-
let
|
|
646
|
+
let ce = g(() => {
|
|
569
647
|
let e = /* @__PURE__ */ new Map([[void 0, []]]);
|
|
570
648
|
for (let t of r.filters) e.set(t.group, [...e.get(t.group) ?? [], t]);
|
|
571
649
|
return [...e.entries()].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
572
650
|
name: e,
|
|
573
651
|
filters: t
|
|
574
652
|
}));
|
|
575
|
-
}),
|
|
576
|
-
function
|
|
577
|
-
e === "filters" &&
|
|
653
|
+
}), le = v(), H = ["results", "filters"], [U, W] = _("results"), G = (e) => `${le}-tab-${e}`, K = (e) => `${le}-panel-${e}`, $ = (e) => `${le}-filter-${e}`;
|
|
654
|
+
function Me(e) {
|
|
655
|
+
e === "filters" && z(x()), W(e);
|
|
578
656
|
}
|
|
579
|
-
function
|
|
657
|
+
function Ne(e) {
|
|
580
658
|
let t = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
581
659
|
if (t === 0) return;
|
|
582
660
|
e.preventDefault();
|
|
583
|
-
let n =
|
|
584
|
-
|
|
661
|
+
let n = H[(H.indexOf(U()) + t + H.length) % H.length];
|
|
662
|
+
Me(n), document.getElementById(G(n))?.focus();
|
|
585
663
|
}
|
|
586
|
-
function
|
|
587
|
-
e.preventDefault(),
|
|
664
|
+
function Pe(e) {
|
|
665
|
+
e.preventDefault(), C(R()), W("results");
|
|
588
666
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
667
|
+
function Fe() {
|
|
668
|
+
A(), W("results");
|
|
591
669
|
}
|
|
592
|
-
function
|
|
670
|
+
function Ie(e) {
|
|
593
671
|
if (e.type === "text") return (() => {
|
|
594
|
-
var t =
|
|
595
|
-
return t.$$input = (t) =>
|
|
596
|
-
var r =
|
|
672
|
+
var t = fe();
|
|
673
|
+
return t.$$input = (t) => V(e.key, t.currentTarget.value), i((n) => {
|
|
674
|
+
var r = $(e.key), i = e.placeholder;
|
|
597
675
|
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "placeholder", n.t = i), n;
|
|
598
676
|
}, {
|
|
599
677
|
e: void 0,
|
|
600
678
|
t: void 0
|
|
601
|
-
}), i(() => t.value =
|
|
679
|
+
}), i(() => t.value = Q(B(e.key))), t;
|
|
602
680
|
})();
|
|
603
|
-
if (e.type === "boolean") return n(
|
|
681
|
+
if (e.type === "boolean") return n(N, {
|
|
604
682
|
get id() {
|
|
605
|
-
return
|
|
683
|
+
return $(e.key);
|
|
606
684
|
},
|
|
607
685
|
get value() {
|
|
608
|
-
return
|
|
686
|
+
return Q(B(e.key));
|
|
609
687
|
},
|
|
610
|
-
onChange: (t) =>
|
|
688
|
+
onChange: (t) => V(e.key, t),
|
|
611
689
|
get emptyLabel() {
|
|
612
690
|
return r.anyLabel ?? "Any";
|
|
613
691
|
},
|
|
@@ -622,19 +700,19 @@ function Ce(e) {
|
|
|
622
700
|
}
|
|
623
701
|
});
|
|
624
702
|
let t = () => {
|
|
625
|
-
let t =
|
|
703
|
+
let t = B(e.key);
|
|
626
704
|
return Array.isArray(t) ? t : [];
|
|
627
705
|
};
|
|
628
706
|
return (() => {
|
|
629
|
-
var o =
|
|
630
|
-
return a(o, n(
|
|
707
|
+
var o = me();
|
|
708
|
+
return a(o, n(N, {
|
|
631
709
|
get id() {
|
|
632
|
-
return
|
|
710
|
+
return $(e.key);
|
|
633
711
|
},
|
|
634
712
|
value: "",
|
|
635
|
-
onChange: (n) =>
|
|
713
|
+
onChange: (n) => V(e.key, [...t(), n]),
|
|
636
714
|
get options() {
|
|
637
|
-
return
|
|
715
|
+
return re(e).filter((e) => !t().includes(String(e.value)));
|
|
638
716
|
},
|
|
639
717
|
get placeholder() {
|
|
640
718
|
return e.placeholder ?? r.anyLabel ?? "Any";
|
|
@@ -644,80 +722,146 @@ function Ce(e) {
|
|
|
644
722
|
return t().length > 0;
|
|
645
723
|
},
|
|
646
724
|
get children() {
|
|
647
|
-
var r =
|
|
725
|
+
var r = pe();
|
|
648
726
|
return a(r, n(f, {
|
|
649
727
|
get each() {
|
|
650
728
|
return t();
|
|
651
729
|
},
|
|
652
730
|
children: (r) => (() => {
|
|
653
|
-
var o =
|
|
654
|
-
return a(o, () =>
|
|
731
|
+
var o = he(), s = o.firstChild;
|
|
732
|
+
return a(o, () => O(e, r), s), s.$$click = () => V(e.key, t().filter((e) => e !== r)), a(s, n(J, {
|
|
655
733
|
size: 12,
|
|
656
734
|
"aria-hidden": "true"
|
|
657
|
-
})), i(() => c(s, "aria-label", `Remove ${
|
|
735
|
+
})), i(() => c(s, "aria-label", `Remove ${O(e, r)}`)), o;
|
|
658
736
|
})()
|
|
659
737
|
})), r;
|
|
660
738
|
}
|
|
661
739
|
}), null), o;
|
|
662
740
|
})();
|
|
663
741
|
}
|
|
664
|
-
let
|
|
665
|
-
var e =
|
|
742
|
+
let Le = (() => {
|
|
743
|
+
var e = xe();
|
|
666
744
|
return a(e, n(p, {
|
|
667
745
|
get when() {
|
|
668
746
|
return r.quickSearch !== !1;
|
|
669
747
|
},
|
|
670
748
|
get children() {
|
|
671
|
-
var e =
|
|
672
|
-
return a(e, n(
|
|
749
|
+
var e = ge(), t = e.firstChild;
|
|
750
|
+
return a(e, n(q, {
|
|
673
751
|
class: "filter-table-search-icon",
|
|
674
752
|
size: 16,
|
|
675
753
|
"aria-hidden": "true"
|
|
676
|
-
}), t), t.$$input = (e) =>
|
|
754
|
+
}), t), t.$$input = (e) => w(Oe, e.currentTarget.value), i((e) => {
|
|
677
755
|
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
678
756
|
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
679
757
|
}, {
|
|
680
758
|
e: void 0,
|
|
681
759
|
t: void 0
|
|
682
|
-
}), i(() => t.value =
|
|
760
|
+
}), i(() => t.value = T()), e;
|
|
683
761
|
}
|
|
684
762
|
}), null), a(e, n(p, {
|
|
685
763
|
get when() {
|
|
686
|
-
return
|
|
764
|
+
return (j()?.length ?? 0) > 0;
|
|
687
765
|
},
|
|
688
766
|
get children() {
|
|
689
|
-
var e =
|
|
767
|
+
var e = _e();
|
|
768
|
+
return a(e, n(N, {
|
|
769
|
+
get value() {
|
|
770
|
+
return M()?.name ?? "";
|
|
771
|
+
},
|
|
772
|
+
onChange: L,
|
|
773
|
+
get options() {
|
|
774
|
+
return (j() ?? []).map((e) => ({
|
|
775
|
+
value: e.name,
|
|
776
|
+
label: e.name
|
|
777
|
+
}));
|
|
778
|
+
},
|
|
779
|
+
get ariaLabel() {
|
|
780
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
781
|
+
},
|
|
782
|
+
get placeholder() {
|
|
783
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
784
|
+
}
|
|
785
|
+
}), null), a(e, n(p, {
|
|
786
|
+
get when() {
|
|
787
|
+
return M();
|
|
788
|
+
},
|
|
789
|
+
children: (e) => (() => {
|
|
790
|
+
var t = Se();
|
|
791
|
+
return t.$$click = A, a(t, n(J, {
|
|
792
|
+
size: 14,
|
|
793
|
+
"aria-hidden": "true"
|
|
794
|
+
})), i(() => c(t, "aria-label", `${r.clearSavedFilterLabel ?? "Clear saved filter"} ${e().name}`)), t;
|
|
795
|
+
})()
|
|
796
|
+
}), null), e;
|
|
797
|
+
}
|
|
798
|
+
}), null), a(e, n(p, {
|
|
799
|
+
get when() {
|
|
800
|
+
return k().length > 0;
|
|
801
|
+
},
|
|
802
|
+
get children() {
|
|
803
|
+
var e = ye(), t = e.firstChild, s = t.firstChild;
|
|
690
804
|
return a(e, n(f, {
|
|
691
805
|
get each() {
|
|
692
|
-
return
|
|
806
|
+
return k();
|
|
693
807
|
},
|
|
694
808
|
children: (e) => (() => {
|
|
695
|
-
var t =
|
|
696
|
-
return r.$$click = () =>
|
|
809
|
+
var t = Ce(), r = t.firstChild;
|
|
810
|
+
return r.$$click = () => ie(e.filter, e.item), a(r, () => e.text, null), a(r, n(J, {
|
|
697
811
|
size: 12,
|
|
698
812
|
"aria-hidden": "true"
|
|
699
813
|
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
700
814
|
})()
|
|
701
|
-
}), t),
|
|
815
|
+
}), t), s.$$click = A, a(s, () => r.clearAllLabel ?? "Clear all"), a(e, n(p, {
|
|
816
|
+
get when() {
|
|
817
|
+
return o(() => j() !== void 0)() && !P();
|
|
818
|
+
},
|
|
819
|
+
get children() {
|
|
820
|
+
var e = ve(), t = e.firstChild;
|
|
821
|
+
return t.$$click = oe, a(t, n(de, {
|
|
822
|
+
size: 12,
|
|
823
|
+
"aria-hidden": "true"
|
|
824
|
+
}), null), a(t, () => r.saveLabel ?? "Save", null), e;
|
|
825
|
+
}
|
|
826
|
+
}), null), e;
|
|
827
|
+
}
|
|
828
|
+
}), null), a(e, n(p, {
|
|
829
|
+
get when() {
|
|
830
|
+
return o(() => !!P())() && k().length > 0;
|
|
831
|
+
},
|
|
832
|
+
get children() {
|
|
833
|
+
var e = be(), t = e.firstChild, o = t.nextSibling, s = o.nextSibling;
|
|
834
|
+
return e.$$keydown = (e) => {
|
|
835
|
+
e.key === "Escape" && F(!1);
|
|
836
|
+
}, e.addEventListener("submit", se), t.$$input = (e) => ae(e.currentTarget.value), d((e) => queueMicrotask(() => e.focus()), t), a(o, n(de, {
|
|
837
|
+
size: 16,
|
|
838
|
+
"aria-hidden": "true"
|
|
839
|
+
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () => F(!1), a(s, () => r.cancelLabel ?? "Cancel"), i((e) => {
|
|
840
|
+
var n = r.saveNameLabel ?? "Filter name", i = r.saveNameLabel ?? "Filter name";
|
|
841
|
+
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
842
|
+
}, {
|
|
843
|
+
e: void 0,
|
|
844
|
+
t: void 0
|
|
845
|
+
}), i(() => t.value = I()), e;
|
|
702
846
|
}
|
|
703
847
|
}), null), e;
|
|
704
848
|
})();
|
|
705
849
|
return (() => {
|
|
706
|
-
var e =
|
|
707
|
-
return a(
|
|
708
|
-
each:
|
|
850
|
+
var e = we(), o = e.firstChild, u = o.nextSibling, d = u.nextSibling, m = d.firstChild, h = m.firstChild, g = h.firstChild, _ = g.nextSibling;
|
|
851
|
+
return a(o, n(f, {
|
|
852
|
+
each: H,
|
|
709
853
|
children: (e) => (() => {
|
|
710
|
-
var t =
|
|
711
|
-
return t.$$keydown =
|
|
854
|
+
var t = Ee();
|
|
855
|
+
return t.$$keydown = Ne, t.$$click = () => Me(e), a(t, () => e === "results" ? r.resultsLabel ?? "Results" : r.filtersLabel ?? "Filters", null), a(t, n(p, {
|
|
712
856
|
get when() {
|
|
713
|
-
return e === "results" ||
|
|
857
|
+
return e === "results" || E().length > 0;
|
|
714
858
|
},
|
|
715
859
|
get children() {
|
|
716
|
-
var t =
|
|
717
|
-
return a(t, () => e === "results" ?
|
|
860
|
+
var t = Te();
|
|
861
|
+
return a(t, () => e === "results" ? ne().length : E().length), t;
|
|
718
862
|
}
|
|
719
863
|
}), null), i((n) => {
|
|
720
|
-
var r =
|
|
864
|
+
var r = G(e), i = U() === e, a = K(e), o = U() === e ? 0 : -1;
|
|
721
865
|
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
866
|
}, {
|
|
723
867
|
e: void 0,
|
|
@@ -726,21 +870,21 @@ function Ce(e) {
|
|
|
726
870
|
o: void 0
|
|
727
871
|
}), t;
|
|
728
872
|
})()
|
|
729
|
-
})), a(u, n(
|
|
730
|
-
rows:
|
|
731
|
-
toolbar:
|
|
732
|
-
}))), m.addEventListener("submit",
|
|
873
|
+
})), a(u, n(ue, s(l, {
|
|
874
|
+
rows: ne,
|
|
875
|
+
toolbar: Le
|
|
876
|
+
}))), m.addEventListener("submit", Pe), a(m, n(f, {
|
|
733
877
|
get each() {
|
|
734
|
-
return
|
|
878
|
+
return ce();
|
|
735
879
|
},
|
|
736
880
|
children: (e) => (() => {
|
|
737
|
-
var t =
|
|
881
|
+
var t = X();
|
|
738
882
|
return a(t, n(p, {
|
|
739
883
|
get when() {
|
|
740
884
|
return e.name;
|
|
741
885
|
},
|
|
742
886
|
get children() {
|
|
743
|
-
var t =
|
|
887
|
+
var t = Y();
|
|
744
888
|
return a(t, () => e.name), t;
|
|
745
889
|
}
|
|
746
890
|
}), null), a(t, n(f, {
|
|
@@ -748,19 +892,19 @@ function Ce(e) {
|
|
|
748
892
|
return e.filters;
|
|
749
893
|
},
|
|
750
894
|
children: (e) => (() => {
|
|
751
|
-
var t =
|
|
752
|
-
return a(n, () => e.label), a(t, () =>
|
|
895
|
+
var t = De(), n = t.firstChild;
|
|
896
|
+
return a(n, () => e.label), a(t, () => Ie(e), null), i(() => c(n, "for", $(e.key))), t;
|
|
753
897
|
})()
|
|
754
898
|
}), null), t;
|
|
755
899
|
})()
|
|
756
|
-
}), h), g.$$click =
|
|
900
|
+
}), h), g.$$click = Fe, a(g, n(J, {
|
|
757
901
|
size: 16,
|
|
758
902
|
"aria-hidden": "true"
|
|
759
|
-
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(
|
|
903
|
+
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(q, {
|
|
760
904
|
size: 16,
|
|
761
905
|
"aria-hidden": "true"
|
|
762
906
|
}), null), a(_, () => r.applyLabel ?? "Search", null), i((n) => {
|
|
763
|
-
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a =
|
|
907
|
+
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = K("results"), o = G("results"), s = U() !== "results", l = K("filters"), f = G("filters"), p = U() !== "filters";
|
|
764
908
|
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
909
|
}, {
|
|
766
910
|
e: void 0,
|
|
@@ -779,4 +923,54 @@ r([
|
|
|
779
923
|
"keydown"
|
|
780
924
|
]);
|
|
781
925
|
//#endregion
|
|
782
|
-
|
|
926
|
+
//#region src/search-bar.tsx
|
|
927
|
+
var Me = /*#__PURE__*/ u("<kbd class=search-bar-shortcut>"), Ne = /*#__PURE__*/ u("<button type=button class=search-bar-clear>"), Pe = /*#__PURE__*/ u("<div><input class=search-bar-input>");
|
|
928
|
+
function Fe(e) {
|
|
929
|
+
let r, s = () => e.shortcutKey ?? "k", l = () => e.shortcutLabel ?? `Ctrl ${String(s()).toUpperCase()}`;
|
|
930
|
+
return x(() => {
|
|
931
|
+
let e = (e) => {
|
|
932
|
+
let t = s();
|
|
933
|
+
t !== !1 && r && (!(e.ctrlKey || e.metaKey) || e.altKey || e.shiftKey || e.key.toLowerCase() === t.toLowerCase() && (e.preventDefault(), r.focus(), r.select()));
|
|
934
|
+
};
|
|
935
|
+
document.addEventListener("keydown", e), b(() => document.removeEventListener("keydown", e));
|
|
936
|
+
}), (() => {
|
|
937
|
+
var u = Pe(), f = u.firstChild;
|
|
938
|
+
a(u, n(q, {
|
|
939
|
+
size: 17,
|
|
940
|
+
class: "search-bar-icon",
|
|
941
|
+
"aria-hidden": "true"
|
|
942
|
+
}), f), f.$$input = (t) => e.onInput(t.currentTarget.value);
|
|
943
|
+
var m = r;
|
|
944
|
+
return typeof m == "function" ? d(m, f) : r = f, a(u, n(p, {
|
|
945
|
+
get when() {
|
|
946
|
+
return o(() => !e.value)() && s() !== !1;
|
|
947
|
+
},
|
|
948
|
+
get children() {
|
|
949
|
+
var e = Me();
|
|
950
|
+
return a(e, l), e;
|
|
951
|
+
}
|
|
952
|
+
}), null), a(u, n(p, {
|
|
953
|
+
get when() {
|
|
954
|
+
return e.value;
|
|
955
|
+
},
|
|
956
|
+
get children() {
|
|
957
|
+
var t = Ne();
|
|
958
|
+
return t.$$click = () => e.onInput(""), a(t, n(J, {
|
|
959
|
+
size: 15,
|
|
960
|
+
"aria-hidden": "true"
|
|
961
|
+
})), i(() => c(t, "aria-label", e.clearLabel ?? "Clear search")), t;
|
|
962
|
+
}
|
|
963
|
+
}), null), i((n) => {
|
|
964
|
+
var r = e.class ? `search-bar ${e.class}` : "search-bar", i = e.placeholder ?? "Search…", a = e.ariaLabel ?? "Search", o = s() === !1 ? void 0 : `Control+${String(s()).toUpperCase()} Meta+${String(s()).toUpperCase()}`;
|
|
965
|
+
return r !== n.e && t(u, n.e = r), i !== n.t && c(f, "placeholder", n.t = i), a !== n.a && c(f, "aria-label", n.a = a), o !== n.o && c(f, "aria-keyshortcuts", n.o = o), n;
|
|
966
|
+
}, {
|
|
967
|
+
e: void 0,
|
|
968
|
+
t: void 0,
|
|
969
|
+
a: void 0,
|
|
970
|
+
o: void 0
|
|
971
|
+
}), i(() => f.value = e.value), u;
|
|
972
|
+
})();
|
|
973
|
+
}
|
|
974
|
+
r(["input", "click"]);
|
|
975
|
+
//#endregion
|
|
976
|
+
export { N as Combobox, ue as DataTable, $ as FilterTable, Fe as SearchBar };
|