@serkonda7/solid-components 0.1.0 → 0.2.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 +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 +418 -221
- 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" }]]), D = E("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]),
|
|
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" }]]), D = E("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]), te = /*#__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>"), ae = /*#__PURE__*/ u("<span class=combobox-detail>"), A = /*#__PURE__*/ u("<div role=option class=combobox-option><span class=combobox-option-label>"), j = /*#__PURE__*/ u("<span class=combobox-option-icon aria-hidden=true>");
|
|
61
|
+
function M(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, M] = _(0), N = g(() => r.emptyLabel === void 0 ? r.options : [{
|
|
63
63
|
value: "",
|
|
64
64
|
label: r.emptyLabel
|
|
65
|
-
}, ...r.options]),
|
|
65
|
+
}, ...r.options]), P = g(() => r.value === "" ? void 0 : N().find((e) => String(e.value) === r.value)), F = g(() => {
|
|
66
66
|
let e = w().trim().toLowerCase();
|
|
67
|
-
return e === "" ?
|
|
68
|
-
}),
|
|
67
|
+
return e === "" ? N() : N().filter((t) => t.label.toLowerCase().includes(e) || (t.detail?.toLowerCase().includes(e) ?? !1));
|
|
68
|
+
}), I = () => r.options.some((e) => e.detail !== void 0), L = () => F().length, oe = () => F().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 = N().findIndex((e) => String(e.value) === r.value);
|
|
78
|
+
M(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 = F()[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 && M((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 H = () => S() ? P()?.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), M(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())() && P()?.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())() && P()?.detail;
|
|
119
119
|
},
|
|
120
120
|
get children() {
|
|
121
|
-
var e =
|
|
122
|
-
return a(t, () =>
|
|
121
|
+
var e = te(), t = e.firstChild, n = t.nextSibling;
|
|
122
|
+
return a(t, () => P()?.label), a(n, () => P()?.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 F();
|
|
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 = A(), l = s.firstChild;
|
|
146
|
+
return s.$$click = () => z(o()), s.$$mousemove = () => M(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 = j();
|
|
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 = ae();
|
|
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 = () => M(L()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(D, {
|
|
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 = !!I(), 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() || !P()?.detail), o = !(S() || P()?.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 = H();
|
|
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() : P()?.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 N = E("outline", "chevron-up", "ChevronUp", [["path", { d: "M6 15l6 -6l6 6" }]]), P = E("outline", "menu", "Menu", [["path", { d: "M4 8l16 0" }], ["path", { d: "M4 16l16 0" }]]), F = /*#__PURE__*/ u("<div class=data-table-toolbar-start>"), I = /*#__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>"), H = /*#__PURE__*/ u("<th>"), ce = /*#__PURE__*/ u("<td class=data-table-checkbox><input type=checkbox>"), U = /*#__PURE__*/ u("<td>"), W = /*#__PURE__*/ u("<tr>"), G = /*#__PURE__*/ u("<p class=data-table-status>Loading…"), le = /*#__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, D = () => {
|
|
241
241
|
let t = l();
|
|
242
242
|
return r().length > 0 && r().every((n) => t.includes(e.getRowId(n)));
|
|
243
|
-
},
|
|
244
|
-
function
|
|
243
|
+
}, te = g(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [ne, re] = _(void 0), O = () => e.visibleColumns === void 0 ? ne() ?? te() : K(e.visibleColumns), k = g(() => new Set(O())), [ie, ae] = _(void 0);
|
|
244
|
+
function A(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 j = g(() => A(e.columnOrder === void 0 ? ie() ?? e.defaultColumnOrder ?? [] : K(e.columnOrder))), M = g(() => j().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 && ae(t), e.onColumnOrderChange?.(t);
|
|
276
287
|
}
|
|
277
|
-
function
|
|
278
|
-
|
|
288
|
+
function ye(e, t) {
|
|
289
|
+
let n = j().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, j().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(te()), ve(A(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 && !D());
|
|
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 = F();
|
|
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 = I(), 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 j();
|
|
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(P, {
|
|
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(N, {
|
|
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() === j().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 = D()), t;
|
|
369
411
|
}
|
|
370
412
|
}), null), a(g, n(f, {
|
|
371
413
|
get each() {
|
|
372
414
|
return M();
|
|
373
415
|
},
|
|
374
416
|
children: (r) => (() => {
|
|
375
|
-
var s =
|
|
417
|
+
var s = H();
|
|
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 = W();
|
|
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 = ce(), 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
463
|
return M();
|
|
422
464
|
},
|
|
423
465
|
children: (e) => (() => {
|
|
424
|
-
var n =
|
|
425
|
-
return a(n, () =>
|
|
466
|
+
var n = U();
|
|
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 = U();
|
|
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 ?? G();
|
|
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 ?? le();
|
|
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 Me(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
|
+
"deleteSavedFilterLabel",
|
|
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 D(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 te(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 === "" || te(n).toLowerCase().includes(e)) && t.every((e) => D(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,99 @@ 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 ae() {
|
|
615
|
+
C({ [Oe]: T() });
|
|
556
616
|
}
|
|
557
|
-
let [P, F] = _(
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
617
|
+
let A = g(() => r.savedFilters === void 0 ? void 0 : ke(r.savedFilters)), j = g(() => A()?.find((e) => je(Z(e.values), x()))), [N, P] = _(!1), [F, I] = _("");
|
|
618
|
+
function L(e) {
|
|
619
|
+
let t = A()?.find((t) => t.name === e);
|
|
620
|
+
t && C(t.values);
|
|
561
621
|
}
|
|
562
|
-
function
|
|
563
|
-
|
|
622
|
+
function oe() {
|
|
623
|
+
I(j()?.name ?? ""), P(!0);
|
|
624
|
+
}
|
|
625
|
+
function se(e) {
|
|
626
|
+
e.preventDefault();
|
|
627
|
+
let t = F().trim();
|
|
628
|
+
if (t === "") return;
|
|
629
|
+
let n = (A() ?? []).filter((e) => e.name !== t);
|
|
630
|
+
r.onSavedFiltersChange?.([...n, {
|
|
631
|
+
name: t,
|
|
632
|
+
values: x()
|
|
633
|
+
}]), P(!1);
|
|
634
|
+
}
|
|
635
|
+
function R(e) {
|
|
636
|
+
r.onSavedFiltersChange?.((A() ?? []).filter((t) => t.name !== e));
|
|
637
|
+
}
|
|
638
|
+
let [z, B] = _(x());
|
|
639
|
+
h(y(x, (e) => B(e)));
|
|
640
|
+
function V(e) {
|
|
641
|
+
return z()[e];
|
|
642
|
+
}
|
|
643
|
+
function H(e, t) {
|
|
644
|
+
B((n) => ({
|
|
564
645
|
...n,
|
|
565
646
|
[e]: t
|
|
566
647
|
}));
|
|
567
648
|
}
|
|
568
|
-
let
|
|
649
|
+
let ce = g(() => {
|
|
569
650
|
let e = /* @__PURE__ */ new Map([[void 0, []]]);
|
|
570
651
|
for (let t of r.filters) e.set(t.group, [...e.get(t.group) ?? [], t]);
|
|
571
652
|
return [...e.entries()].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
572
653
|
name: e,
|
|
573
654
|
filters: t
|
|
574
655
|
}));
|
|
575
|
-
}),
|
|
576
|
-
function
|
|
577
|
-
e === "filters" &&
|
|
656
|
+
}), U = v(), W = ["results", "filters"], [G, le] = _("results"), K = (e) => `${U}-tab-${e}`, Me = (e) => `${U}-panel-${e}`, $ = (e) => `${U}-filter-${e}`;
|
|
657
|
+
function Ne(e) {
|
|
658
|
+
e === "filters" && B(x()), le(e);
|
|
578
659
|
}
|
|
579
|
-
function
|
|
660
|
+
function Pe(e) {
|
|
580
661
|
let t = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
581
662
|
if (t === 0) return;
|
|
582
663
|
e.preventDefault();
|
|
583
|
-
let n =
|
|
584
|
-
|
|
664
|
+
let n = W[(W.indexOf(G()) + t + W.length) % W.length];
|
|
665
|
+
Ne(n), document.getElementById(K(n))?.focus();
|
|
585
666
|
}
|
|
586
|
-
function
|
|
587
|
-
e.preventDefault(),
|
|
667
|
+
function Fe(e) {
|
|
668
|
+
e.preventDefault(), C(z()), le("results");
|
|
588
669
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
670
|
+
function Ie() {
|
|
671
|
+
ae(), le("results");
|
|
591
672
|
}
|
|
592
|
-
function
|
|
673
|
+
function Le(e) {
|
|
593
674
|
if (e.type === "text") return (() => {
|
|
594
|
-
var t =
|
|
595
|
-
return t.$$input = (t) =>
|
|
596
|
-
var r =
|
|
675
|
+
var t = fe();
|
|
676
|
+
return t.$$input = (t) => H(e.key, t.currentTarget.value), i((n) => {
|
|
677
|
+
var r = $(e.key), i = e.placeholder;
|
|
597
678
|
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "placeholder", n.t = i), n;
|
|
598
679
|
}, {
|
|
599
680
|
e: void 0,
|
|
600
681
|
t: void 0
|
|
601
|
-
}), i(() => t.value =
|
|
682
|
+
}), i(() => t.value = Q(V(e.key))), t;
|
|
602
683
|
})();
|
|
603
|
-
if (e.type === "boolean") return n(
|
|
684
|
+
if (e.type === "boolean") return n(M, {
|
|
604
685
|
get id() {
|
|
605
|
-
return
|
|
686
|
+
return $(e.key);
|
|
606
687
|
},
|
|
607
688
|
get value() {
|
|
608
|
-
return
|
|
689
|
+
return Q(V(e.key));
|
|
609
690
|
},
|
|
610
|
-
onChange: (t) =>
|
|
691
|
+
onChange: (t) => H(e.key, t),
|
|
611
692
|
get emptyLabel() {
|
|
612
693
|
return r.anyLabel ?? "Any";
|
|
613
694
|
},
|
|
@@ -622,19 +703,19 @@ function Ce(e) {
|
|
|
622
703
|
}
|
|
623
704
|
});
|
|
624
705
|
let t = () => {
|
|
625
|
-
let t =
|
|
706
|
+
let t = V(e.key);
|
|
626
707
|
return Array.isArray(t) ? t : [];
|
|
627
708
|
};
|
|
628
709
|
return (() => {
|
|
629
|
-
var o =
|
|
630
|
-
return a(o, n(
|
|
710
|
+
var o = me();
|
|
711
|
+
return a(o, n(M, {
|
|
631
712
|
get id() {
|
|
632
|
-
return
|
|
713
|
+
return $(e.key);
|
|
633
714
|
},
|
|
634
715
|
value: "",
|
|
635
|
-
onChange: (n) =>
|
|
716
|
+
onChange: (n) => H(e.key, [...t(), n]),
|
|
636
717
|
get options() {
|
|
637
|
-
return
|
|
718
|
+
return re(e).filter((e) => !t().includes(String(e.value)));
|
|
638
719
|
},
|
|
639
720
|
get placeholder() {
|
|
640
721
|
return e.placeholder ?? r.anyLabel ?? "Any";
|
|
@@ -644,80 +725,146 @@ function Ce(e) {
|
|
|
644
725
|
return t().length > 0;
|
|
645
726
|
},
|
|
646
727
|
get children() {
|
|
647
|
-
var r =
|
|
728
|
+
var r = pe();
|
|
648
729
|
return a(r, n(f, {
|
|
649
730
|
get each() {
|
|
650
731
|
return t();
|
|
651
732
|
},
|
|
652
733
|
children: (r) => (() => {
|
|
653
|
-
var o =
|
|
654
|
-
return a(o, () =>
|
|
734
|
+
var o = he(), s = o.firstChild;
|
|
735
|
+
return a(o, () => O(e, r), s), s.$$click = () => H(e.key, t().filter((e) => e !== r)), a(s, n(J, {
|
|
655
736
|
size: 12,
|
|
656
737
|
"aria-hidden": "true"
|
|
657
|
-
})), i(() => c(s, "aria-label", `Remove ${
|
|
738
|
+
})), i(() => c(s, "aria-label", `Remove ${O(e, r)}`)), o;
|
|
658
739
|
})()
|
|
659
740
|
})), r;
|
|
660
741
|
}
|
|
661
742
|
}), null), o;
|
|
662
743
|
})();
|
|
663
744
|
}
|
|
664
|
-
let
|
|
665
|
-
var e =
|
|
745
|
+
let Re = (() => {
|
|
746
|
+
var e = xe();
|
|
666
747
|
return a(e, n(p, {
|
|
667
748
|
get when() {
|
|
668
749
|
return r.quickSearch !== !1;
|
|
669
750
|
},
|
|
670
751
|
get children() {
|
|
671
|
-
var e =
|
|
672
|
-
return a(e, n(
|
|
752
|
+
var e = ge(), t = e.firstChild;
|
|
753
|
+
return a(e, n(q, {
|
|
673
754
|
class: "filter-table-search-icon",
|
|
674
755
|
size: 16,
|
|
675
756
|
"aria-hidden": "true"
|
|
676
|
-
}), t), t.$$input = (e) =>
|
|
757
|
+
}), t), t.$$input = (e) => w(Oe, e.currentTarget.value), i((e) => {
|
|
677
758
|
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
678
759
|
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
679
760
|
}, {
|
|
680
761
|
e: void 0,
|
|
681
762
|
t: void 0
|
|
682
|
-
}), i(() => t.value =
|
|
763
|
+
}), i(() => t.value = T()), e;
|
|
683
764
|
}
|
|
684
765
|
}), null), a(e, n(p, {
|
|
685
766
|
get when() {
|
|
686
|
-
return
|
|
767
|
+
return (A()?.length ?? 0) > 0;
|
|
687
768
|
},
|
|
688
769
|
get children() {
|
|
689
|
-
var e =
|
|
770
|
+
var e = _e();
|
|
771
|
+
return a(e, n(M, {
|
|
772
|
+
get value() {
|
|
773
|
+
return j()?.name ?? "";
|
|
774
|
+
},
|
|
775
|
+
onChange: L,
|
|
776
|
+
get options() {
|
|
777
|
+
return (A() ?? []).map((e) => ({
|
|
778
|
+
value: e.name,
|
|
779
|
+
label: e.name
|
|
780
|
+
}));
|
|
781
|
+
},
|
|
782
|
+
get ariaLabel() {
|
|
783
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
784
|
+
},
|
|
785
|
+
get placeholder() {
|
|
786
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
787
|
+
}
|
|
788
|
+
}), null), a(e, n(p, {
|
|
789
|
+
get when() {
|
|
790
|
+
return j();
|
|
791
|
+
},
|
|
792
|
+
children: (e) => (() => {
|
|
793
|
+
var t = Se();
|
|
794
|
+
return t.$$click = () => R(e().name), a(t, n(J, {
|
|
795
|
+
size: 14,
|
|
796
|
+
"aria-hidden": "true"
|
|
797
|
+
})), i(() => c(t, "aria-label", `${r.deleteSavedFilterLabel ?? "Delete saved filter"} ${e().name}`)), t;
|
|
798
|
+
})()
|
|
799
|
+
}), null), e;
|
|
800
|
+
}
|
|
801
|
+
}), null), a(e, n(p, {
|
|
802
|
+
get when() {
|
|
803
|
+
return k().length > 0;
|
|
804
|
+
},
|
|
805
|
+
get children() {
|
|
806
|
+
var e = ye(), t = e.firstChild, s = t.firstChild;
|
|
690
807
|
return a(e, n(f, {
|
|
691
808
|
get each() {
|
|
692
|
-
return
|
|
809
|
+
return k();
|
|
693
810
|
},
|
|
694
811
|
children: (e) => (() => {
|
|
695
|
-
var t =
|
|
696
|
-
return r.$$click = () =>
|
|
812
|
+
var t = Ce(), r = t.firstChild;
|
|
813
|
+
return r.$$click = () => ie(e.filter, e.item), a(r, () => e.text, null), a(r, n(J, {
|
|
697
814
|
size: 12,
|
|
698
815
|
"aria-hidden": "true"
|
|
699
816
|
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
700
817
|
})()
|
|
701
|
-
}), t),
|
|
818
|
+
}), t), s.$$click = ae, a(s, () => r.clearAllLabel ?? "Clear all"), a(e, n(p, {
|
|
819
|
+
get when() {
|
|
820
|
+
return o(() => A() !== void 0)() && !N();
|
|
821
|
+
},
|
|
822
|
+
get children() {
|
|
823
|
+
var e = ve(), t = e.firstChild;
|
|
824
|
+
return t.$$click = oe, a(t, n(de, {
|
|
825
|
+
size: 12,
|
|
826
|
+
"aria-hidden": "true"
|
|
827
|
+
}), null), a(t, () => r.saveLabel ?? "Save", null), e;
|
|
828
|
+
}
|
|
829
|
+
}), null), e;
|
|
830
|
+
}
|
|
831
|
+
}), null), a(e, n(p, {
|
|
832
|
+
get when() {
|
|
833
|
+
return o(() => !!N())() && k().length > 0;
|
|
834
|
+
},
|
|
835
|
+
get children() {
|
|
836
|
+
var e = be(), t = e.firstChild, o = t.nextSibling, s = o.nextSibling;
|
|
837
|
+
return e.$$keydown = (e) => {
|
|
838
|
+
e.key === "Escape" && P(!1);
|
|
839
|
+
}, e.addEventListener("submit", se), t.$$input = (e) => I(e.currentTarget.value), d((e) => queueMicrotask(() => e.focus()), t), a(o, n(de, {
|
|
840
|
+
size: 16,
|
|
841
|
+
"aria-hidden": "true"
|
|
842
|
+
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () => P(!1), a(s, () => r.cancelLabel ?? "Cancel"), i((e) => {
|
|
843
|
+
var n = r.saveNameLabel ?? "Filter name", i = r.saveNameLabel ?? "Filter name";
|
|
844
|
+
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
845
|
+
}, {
|
|
846
|
+
e: void 0,
|
|
847
|
+
t: void 0
|
|
848
|
+
}), i(() => t.value = F()), e;
|
|
702
849
|
}
|
|
703
850
|
}), null), e;
|
|
704
851
|
})();
|
|
705
852
|
return (() => {
|
|
706
|
-
var e =
|
|
707
|
-
return a(
|
|
708
|
-
each:
|
|
853
|
+
var e = we(), o = e.firstChild, u = o.nextSibling, d = u.nextSibling, m = d.firstChild, h = m.firstChild, g = h.firstChild, _ = g.nextSibling;
|
|
854
|
+
return a(o, n(f, {
|
|
855
|
+
each: W,
|
|
709
856
|
children: (e) => (() => {
|
|
710
|
-
var t =
|
|
711
|
-
return t.$$keydown =
|
|
857
|
+
var t = Ee();
|
|
858
|
+
return t.$$keydown = Pe, t.$$click = () => Ne(e), a(t, () => e === "results" ? r.resultsLabel ?? "Results" : r.filtersLabel ?? "Filters", null), a(t, n(p, {
|
|
712
859
|
get when() {
|
|
713
|
-
return e === "results" ||
|
|
860
|
+
return e === "results" || E().length > 0;
|
|
714
861
|
},
|
|
715
862
|
get children() {
|
|
716
|
-
var t =
|
|
717
|
-
return a(t, () => e === "results" ?
|
|
863
|
+
var t = Te();
|
|
864
|
+
return a(t, () => e === "results" ? ne().length : E().length), t;
|
|
718
865
|
}
|
|
719
866
|
}), null), i((n) => {
|
|
720
|
-
var r =
|
|
867
|
+
var r = K(e), i = G() === e, a = Me(e), o = G() === e ? 0 : -1;
|
|
721
868
|
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
869
|
}, {
|
|
723
870
|
e: void 0,
|
|
@@ -726,21 +873,21 @@ function Ce(e) {
|
|
|
726
873
|
o: void 0
|
|
727
874
|
}), t;
|
|
728
875
|
})()
|
|
729
|
-
})), a(u, n(
|
|
730
|
-
rows:
|
|
731
|
-
toolbar:
|
|
732
|
-
}))), m.addEventListener("submit",
|
|
876
|
+
})), a(u, n(ue, s(l, {
|
|
877
|
+
rows: ne,
|
|
878
|
+
toolbar: Re
|
|
879
|
+
}))), m.addEventListener("submit", Fe), a(m, n(f, {
|
|
733
880
|
get each() {
|
|
734
|
-
return
|
|
881
|
+
return ce();
|
|
735
882
|
},
|
|
736
883
|
children: (e) => (() => {
|
|
737
|
-
var t =
|
|
884
|
+
var t = X();
|
|
738
885
|
return a(t, n(p, {
|
|
739
886
|
get when() {
|
|
740
887
|
return e.name;
|
|
741
888
|
},
|
|
742
889
|
get children() {
|
|
743
|
-
var t =
|
|
890
|
+
var t = Y();
|
|
744
891
|
return a(t, () => e.name), t;
|
|
745
892
|
}
|
|
746
893
|
}), null), a(t, n(f, {
|
|
@@ -748,19 +895,19 @@ function Ce(e) {
|
|
|
748
895
|
return e.filters;
|
|
749
896
|
},
|
|
750
897
|
children: (e) => (() => {
|
|
751
|
-
var t =
|
|
752
|
-
return a(n, () => e.label), a(t, () =>
|
|
898
|
+
var t = De(), n = t.firstChild;
|
|
899
|
+
return a(n, () => e.label), a(t, () => Le(e), null), i(() => c(n, "for", $(e.key))), t;
|
|
753
900
|
})()
|
|
754
901
|
}), null), t;
|
|
755
902
|
})()
|
|
756
|
-
}), h), g.$$click =
|
|
903
|
+
}), h), g.$$click = Ie, a(g, n(J, {
|
|
757
904
|
size: 16,
|
|
758
905
|
"aria-hidden": "true"
|
|
759
|
-
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(
|
|
906
|
+
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(q, {
|
|
760
907
|
size: 16,
|
|
761
908
|
"aria-hidden": "true"
|
|
762
909
|
}), null), a(_, () => r.applyLabel ?? "Search", null), i((n) => {
|
|
763
|
-
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a =
|
|
910
|
+
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = Me("results"), o = K("results"), s = G() !== "results", l = Me("filters"), f = K("filters"), p = G() !== "filters";
|
|
764
911
|
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
912
|
}, {
|
|
766
913
|
e: void 0,
|
|
@@ -779,4 +926,54 @@ r([
|
|
|
779
926
|
"keydown"
|
|
780
927
|
]);
|
|
781
928
|
//#endregion
|
|
782
|
-
|
|
929
|
+
//#region src/search-bar.tsx
|
|
930
|
+
var $ = /*#__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>");
|
|
931
|
+
function Fe(e) {
|
|
932
|
+
let r, s = () => e.shortcutKey ?? "k", l = () => e.shortcutLabel ?? `Ctrl ${String(s()).toUpperCase()}`;
|
|
933
|
+
return x(() => {
|
|
934
|
+
let e = (e) => {
|
|
935
|
+
let t = s();
|
|
936
|
+
t !== !1 && r && (!(e.ctrlKey || e.metaKey) || e.altKey || e.shiftKey || e.key.toLowerCase() === t.toLowerCase() && (e.preventDefault(), r.focus(), r.select()));
|
|
937
|
+
};
|
|
938
|
+
document.addEventListener("keydown", e), b(() => document.removeEventListener("keydown", e));
|
|
939
|
+
}), (() => {
|
|
940
|
+
var u = Pe(), f = u.firstChild;
|
|
941
|
+
a(u, n(q, {
|
|
942
|
+
size: 17,
|
|
943
|
+
class: "search-bar-icon",
|
|
944
|
+
"aria-hidden": "true"
|
|
945
|
+
}), f), f.$$input = (t) => e.onInput(t.currentTarget.value);
|
|
946
|
+
var m = r;
|
|
947
|
+
return typeof m == "function" ? d(m, f) : r = f, a(u, n(p, {
|
|
948
|
+
get when() {
|
|
949
|
+
return o(() => !e.value)() && s() !== !1;
|
|
950
|
+
},
|
|
951
|
+
get children() {
|
|
952
|
+
var e = $();
|
|
953
|
+
return a(e, l), e;
|
|
954
|
+
}
|
|
955
|
+
}), null), a(u, n(p, {
|
|
956
|
+
get when() {
|
|
957
|
+
return e.value;
|
|
958
|
+
},
|
|
959
|
+
get children() {
|
|
960
|
+
var t = Ne();
|
|
961
|
+
return t.$$click = () => e.onInput(""), a(t, n(J, {
|
|
962
|
+
size: 15,
|
|
963
|
+
"aria-hidden": "true"
|
|
964
|
+
})), i(() => c(t, "aria-label", e.clearLabel ?? "Clear search")), t;
|
|
965
|
+
}
|
|
966
|
+
}), null), i((n) => {
|
|
967
|
+
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()}`;
|
|
968
|
+
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;
|
|
969
|
+
}, {
|
|
970
|
+
e: void 0,
|
|
971
|
+
t: void 0,
|
|
972
|
+
a: void 0,
|
|
973
|
+
o: void 0
|
|
974
|
+
}), i(() => f.value = e.value), u;
|
|
975
|
+
})();
|
|
976
|
+
}
|
|
977
|
+
r(["input", "click"]);
|
|
978
|
+
//#endregion
|
|
979
|
+
export { M as Combobox, ue as DataTable, Me as FilterTable, Fe as SearchBar };
|