@serkonda7/solid-components 0.3.2 → 0.4.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 +3 -1
- package/dist/color-input.d.ts +18 -0
- package/dist/data-table.d.ts +38 -1
- package/dist/filter-table.d.ts +19 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +834 -428
- package/dist/modal.d.ts +39 -0
- package/dist/styles.css +328 -0
- package/package.json +14 -11
package/dist/index.js
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { Dynamic as e, className as t, createComponent as n, delegateEvents as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, style as u, template as d, use as f } from "solid-js/web";
|
|
2
|
-
import { For as p, Show as m, children as h, createEffect as g, createMemo as _, createSignal as v, createUniqueId as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { For as p, Show as m, children as h, createEffect as g, createMemo as _, createSignal as v, createUniqueId as ee, on as y, onCleanup as b, onMount as x, splitProps as S, untrack as C } from "solid-js";
|
|
3
|
+
import { columnFilteringFeature as w, columnOrderingFeature as T, columnSizingFeature as E, columnVisibilityFeature as D, createFilteredRowModel as O, createSortedRowModel as k, createTable as te, filterFn_includesString as A, functionalUpdate as j, globalFilteringFeature as ne, rowSortingFeature as re, tableFeatures as M } from "@tanstack/solid-table";
|
|
4
|
+
// src/color-input.tsx
|
|
5
|
+
var N = /*#__PURE__*/ d("<div><input type=color class=color-input-picker><input class=color-input-text autocomplete=off>");
|
|
6
|
+
function P(e) {
|
|
7
|
+
let t = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim())?.[1]?.toLowerCase();
|
|
8
|
+
if (t) return `#${t.length === 3 ? t.replace(/./g, "$&$&") : t}`;
|
|
9
|
+
}
|
|
10
|
+
function ie(e) {
|
|
11
|
+
let [n, r] = v();
|
|
12
|
+
return (() => {
|
|
13
|
+
var a = N(), o = a.firstChild, s = o.nextSibling;
|
|
14
|
+
return o.$$input = (t) => e.onInput(t.currentTarget.value), s.addEventListener("blur", () => r(void 0)), s.$$input = (t) => {
|
|
15
|
+
let n = t.currentTarget.value;
|
|
16
|
+
r(n);
|
|
17
|
+
let i = P(n);
|
|
18
|
+
i && e.onInput(i);
|
|
19
|
+
}, c(s, "spellcheck", !1), i((n) => {
|
|
20
|
+
var r = e.class ? `color-input ${e.class}` : "color-input", i = e.pickerLabel ?? "Pick color", l = e.disabled, u = e.ariaLabel ?? "Color", d = e.disabled;
|
|
21
|
+
return r !== n.e && t(a, n.e = r), i !== n.t && c(o, "aria-label", n.t = i), l !== n.a && (o.disabled = n.a = l), u !== n.o && c(s, "aria-label", n.o = u), d !== n.i && (s.disabled = n.i = d), n;
|
|
22
|
+
}, {
|
|
23
|
+
e: void 0,
|
|
24
|
+
t: void 0,
|
|
25
|
+
a: void 0,
|
|
26
|
+
o: void 0,
|
|
27
|
+
i: void 0
|
|
28
|
+
}), i(() => o.value = P(e.value) ?? "#000000"), i(() => s.value = n() ?? e.value), a;
|
|
29
|
+
})();
|
|
30
|
+
}
|
|
31
|
+
r(["input"]);
|
|
32
|
+
// node_modules/@tabler/icons-solidjs/dist/source/defaultAttributes.js
|
|
33
|
+
var ae = {
|
|
5
34
|
outline: {
|
|
6
35
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
36
|
width: 24,
|
|
@@ -21,9 +50,9 @@ var T = {
|
|
|
21
50
|
fill: "currentColor",
|
|
22
51
|
stroke: "none"
|
|
23
52
|
}
|
|
24
|
-
},
|
|
53
|
+
}, oe = /*#__PURE__*/ d("<svg>"), F = /*#__PURE__*/ d("<title>"), I = (t, r, i, c) => {
|
|
25
54
|
let u = (i) => {
|
|
26
|
-
let [u, d] =
|
|
55
|
+
let [u, d] = S(i, [
|
|
27
56
|
"color",
|
|
28
57
|
"size",
|
|
29
58
|
"stroke",
|
|
@@ -31,9 +60,9 @@ var T = {
|
|
|
31
60
|
"title",
|
|
32
61
|
"children",
|
|
33
62
|
"class"
|
|
34
|
-
]), f =
|
|
63
|
+
]), f = ae[t], p = u.stroke ?? u.strokeWidth;
|
|
35
64
|
return (() => {
|
|
36
|
-
var i =
|
|
65
|
+
var i = oe();
|
|
37
66
|
return l(i, s(f, d, {
|
|
38
67
|
get width() {
|
|
39
68
|
return o(() => u.size != null)() ? u.size : f.width;
|
|
@@ -50,58 +79,58 @@ var T = {
|
|
|
50
79
|
}), !0, !0), a(i, (() => {
|
|
51
80
|
var e = o(() => u.title != null);
|
|
52
81
|
return () => e() && (() => {
|
|
53
|
-
var e =
|
|
82
|
+
var e = F();
|
|
54
83
|
return a(e, () => u.title), e;
|
|
55
84
|
})();
|
|
56
85
|
})(), null), a(i, () => c.map(([t, r]) => n(e, s({ component: t }, r))), null), a(i, () => u.children, null), i;
|
|
57
86
|
})();
|
|
58
87
|
};
|
|
59
88
|
return u.displayName = `${i}`, u;
|
|
60
|
-
},
|
|
61
|
-
function
|
|
62
|
-
let s, l, u =
|
|
89
|
+
}, se = I("outline", "chevron-down", "ChevronDown", [["path", { d: "M6 9l6 6l6 -6" }]]), ce = I("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]), le = /*#__PURE__*/ d("<span class=combobox-detail>"), ue = /*#__PURE__*/ d("<div role=option class=combobox-option><span class=combobox-option-label>"), de = /*#__PURE__*/ d("<span class=combobox-option-icon aria-hidden=true>"), fe = /*#__PURE__*/ d("<div role=option class=\"combobox-option combobox-option-add\">"), pe = /*#__PURE__*/ d("<div class=combobox-list role=listbox>"), L = /*#__PURE__*/ d("<div class=combobox-empty>"), me = /*#__PURE__*/ d("<span class=combobox-value aria-hidden=true><span class=combobox-option-label></span><span class=combobox-detail>"), R = /*#__PURE__*/ d("<div><input class=combobox-input role=combobox aria-autocomplete=list autocomplete=off>"), z = /*#__PURE__*/ d("<span class=combobox-icon aria-hidden=true>"), B = /*#__PURE__*/ d("<div class=combobox-preview aria-hidden=true>");
|
|
90
|
+
function V(r) {
|
|
91
|
+
let s, l, u = ee(), d = () => r.id ?? u, h = () => `${d()}-listbox`, y = (e) => `${d()}-option-${e}`, [b, S] = v(!1), [C, w] = v(""), [T, E] = v(0), D = _(() => r.emptyLabel === void 0 ? r.options : [{
|
|
63
92
|
value: "",
|
|
64
93
|
label: r.emptyLabel
|
|
65
|
-
}, ...r.options]),
|
|
66
|
-
let e =
|
|
67
|
-
return e === "" ?
|
|
68
|
-
}),
|
|
69
|
-
|
|
94
|
+
}, ...r.options]), O = _(() => r.value === "" ? void 0 : D().find((e) => String(e.value) === r.value)), k = _(() => {
|
|
95
|
+
let e = C().trim().toLowerCase();
|
|
96
|
+
return e === "" ? D() : D().filter((t) => t.label.toLowerCase().includes(e) || (t.detail?.toLowerCase().includes(e) ?? !1));
|
|
97
|
+
}), te = () => r.options.some((e) => e.detail !== void 0), A = () => k().length, j = () => k().length + +!!r.onAdd, ne = () => !r.disabled && r.onChange !== void 0, re = () => k()[T()]?.preview;
|
|
98
|
+
x(() => {
|
|
70
99
|
r.autofocus === !0 && s?.focus();
|
|
71
100
|
}), g(() => {
|
|
72
|
-
|
|
101
|
+
b() && l?.querySelector(`[data-index="${T()}"]`)?.scrollIntoView({ block: "nearest" });
|
|
73
102
|
});
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
let e =
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
function
|
|
81
|
-
if (
|
|
82
|
-
r.onAdd(
|
|
103
|
+
function M() {
|
|
104
|
+
if (b() || !ne()) return;
|
|
105
|
+
w("");
|
|
106
|
+
let e = D().findIndex((e) => String(e.value) === r.value);
|
|
107
|
+
E(Math.max(e, 0)), S(!0), r.onOpen?.();
|
|
108
|
+
}
|
|
109
|
+
function N(e) {
|
|
110
|
+
if (S(!1), r.onAdd && e === A()) {
|
|
111
|
+
r.onAdd(C().trim());
|
|
83
112
|
return;
|
|
84
113
|
}
|
|
85
|
-
let t =
|
|
114
|
+
let t = k()[e];
|
|
86
115
|
t && String(t.value) !== r.value && r.onChange?.(String(t.value));
|
|
87
116
|
}
|
|
88
|
-
function
|
|
89
|
-
let t =
|
|
90
|
-
|
|
117
|
+
function P(e) {
|
|
118
|
+
let t = j();
|
|
119
|
+
b() ? t > 0 && E((T() + e + t) % t) : M();
|
|
91
120
|
}
|
|
92
|
-
function
|
|
93
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
121
|
+
function ie(e) {
|
|
122
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), P(e.key === "ArrowDown" ? 1 : -1)) : b() && (e.key === "Enter" ? (e.preventDefault(), N(T())) : e.key === "Tab" ? r.onAdd && T() === A() ? S(!1) : N(T()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), S(!1)));
|
|
94
123
|
}
|
|
95
|
-
let
|
|
96
|
-
function
|
|
124
|
+
let ae = () => b() ? O()?.label ?? r.emptyLabel ?? r.searchLabel ?? "Search" : r.emptyLabel ?? r.placeholder;
|
|
125
|
+
function oe(t, o) {
|
|
97
126
|
return (() => {
|
|
98
|
-
var s =
|
|
99
|
-
return s.$$click = () =>
|
|
127
|
+
var s = ue(), l = s.firstChild;
|
|
128
|
+
return s.$$click = () => N(o()), s.$$mousemove = () => E(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(m, {
|
|
100
129
|
get when() {
|
|
101
130
|
return t.icon;
|
|
102
131
|
},
|
|
103
132
|
children: (t) => (() => {
|
|
104
|
-
var r =
|
|
133
|
+
var r = de();
|
|
105
134
|
return a(r, n(e, {
|
|
106
135
|
get component() {
|
|
107
136
|
return t();
|
|
@@ -114,11 +143,11 @@ function L(r) {
|
|
|
114
143
|
return t.detail;
|
|
115
144
|
},
|
|
116
145
|
get children() {
|
|
117
|
-
var e =
|
|
146
|
+
var e = le();
|
|
118
147
|
return a(e, () => t.detail), e;
|
|
119
148
|
}
|
|
120
149
|
}), null), i((e) => {
|
|
121
|
-
var n =
|
|
150
|
+
var n = y(o()), i = o(), a = String(t.value) === r.value, l = o() === T(), u = t.value === "";
|
|
122
151
|
return n !== e.e && c(s, "id", e.e = n), i !== e.t && c(s, "data-index", e.t = i), a !== e.a && c(s, "aria-selected", e.a = a), l !== e.o && s.classList.toggle("combobox-option-active", e.o = l), u !== e.i && s.classList.toggle("combobox-option-empty", e.i = u), e;
|
|
123
152
|
}, {
|
|
124
153
|
e: void 0,
|
|
@@ -129,14 +158,14 @@ function L(r) {
|
|
|
129
158
|
}), s;
|
|
130
159
|
})();
|
|
131
160
|
}
|
|
132
|
-
function
|
|
161
|
+
function F() {
|
|
133
162
|
return (() => {
|
|
134
|
-
var e =
|
|
135
|
-
return e.$$click = () =>
|
|
163
|
+
var e = fe();
|
|
164
|
+
return e.$$click = () => N(A()), e.$$mousemove = () => E(A()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(ce, {
|
|
136
165
|
size: 14,
|
|
137
166
|
"aria-hidden": "true"
|
|
138
167
|
}), null), a(e, () => r.addLabel ?? "Add", null), i((t) => {
|
|
139
|
-
var n =
|
|
168
|
+
var n = y(A()), r = A(), i = A() === T();
|
|
140
169
|
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;
|
|
141
170
|
}, {
|
|
142
171
|
e: void 0,
|
|
@@ -145,29 +174,29 @@ function L(r) {
|
|
|
145
174
|
}), e;
|
|
146
175
|
})();
|
|
147
176
|
}
|
|
148
|
-
function
|
|
177
|
+
function I() {
|
|
149
178
|
return (() => {
|
|
150
|
-
var e =
|
|
179
|
+
var e = pe(), t = l;
|
|
151
180
|
return typeof t == "function" ? f(t, e) : l = e, a(e, n(p, {
|
|
152
181
|
get each() {
|
|
153
|
-
return
|
|
182
|
+
return k();
|
|
154
183
|
},
|
|
155
184
|
get fallback() {
|
|
156
185
|
return (() => {
|
|
157
|
-
var e =
|
|
186
|
+
var e = L();
|
|
158
187
|
return a(e, () => r.noMatchesLabel ?? "No matching objects"), e;
|
|
159
188
|
})();
|
|
160
189
|
},
|
|
161
|
-
children:
|
|
190
|
+
children: oe
|
|
162
191
|
}), null), a(e, n(m, {
|
|
163
192
|
get when() {
|
|
164
193
|
return r.onAdd;
|
|
165
194
|
},
|
|
166
195
|
get children() {
|
|
167
|
-
return
|
|
196
|
+
return F();
|
|
168
197
|
}
|
|
169
198
|
}), null), i((t) => {
|
|
170
|
-
var n = !!
|
|
199
|
+
var n = !!te(), r = h();
|
|
171
200
|
return n !== t.e && e.classList.toggle("combobox-list-detail", t.e = n), r !== t.t && c(e, "id", t.t = r), t;
|
|
172
201
|
}, {
|
|
173
202
|
e: void 0,
|
|
@@ -176,18 +205,18 @@ function L(r) {
|
|
|
176
205
|
})();
|
|
177
206
|
}
|
|
178
207
|
return (() => {
|
|
179
|
-
var l =
|
|
180
|
-
u.addEventListener("blur", () =>
|
|
208
|
+
var l = R(), u = l.firstChild;
|
|
209
|
+
u.addEventListener("blur", () => S(!1)), u.$$keydown = ie, u.$$input = (e) => {
|
|
181
210
|
let t = e.currentTarget.value;
|
|
182
|
-
|
|
183
|
-
}, u.$$click =
|
|
211
|
+
M(), w(t), E(0);
|
|
212
|
+
}, u.$$click = M;
|
|
184
213
|
var p = s;
|
|
185
214
|
return typeof p == "function" ? f(p, u) : s = u, a(l, n(m, {
|
|
186
215
|
get when() {
|
|
187
|
-
return o(() => !
|
|
216
|
+
return o(() => !b())() && O()?.icon;
|
|
188
217
|
},
|
|
189
218
|
children: (t) => (() => {
|
|
190
|
-
var r =
|
|
219
|
+
var r = z();
|
|
191
220
|
return a(r, n(e, {
|
|
192
221
|
get component() {
|
|
193
222
|
return t();
|
|
@@ -197,36 +226,36 @@ function L(r) {
|
|
|
197
226
|
})()
|
|
198
227
|
}), null), a(l, n(m, {
|
|
199
228
|
get when() {
|
|
200
|
-
return o(() => !
|
|
229
|
+
return o(() => !b())() && O()?.detail;
|
|
201
230
|
},
|
|
202
231
|
get children() {
|
|
203
|
-
var e =
|
|
204
|
-
return a(t, () =>
|
|
232
|
+
var e = me(), t = e.firstChild, n = t.nextSibling;
|
|
233
|
+
return a(t, () => O()?.label), a(n, () => O()?.detail), e;
|
|
205
234
|
}
|
|
206
|
-
}), null), a(l, n(
|
|
235
|
+
}), null), a(l, n(se, {
|
|
207
236
|
class: "combobox-chevron",
|
|
208
237
|
size: 16,
|
|
209
238
|
"aria-hidden": "true"
|
|
210
239
|
}), null), a(l, n(m, {
|
|
211
240
|
get when() {
|
|
212
|
-
return
|
|
241
|
+
return b();
|
|
213
242
|
},
|
|
214
243
|
get children() {
|
|
215
|
-
return
|
|
244
|
+
return I();
|
|
216
245
|
}
|
|
217
246
|
}), null), a(l, n(m, {
|
|
218
247
|
get when() {
|
|
219
|
-
return o(() => !!
|
|
248
|
+
return o(() => !!b())() && re();
|
|
220
249
|
},
|
|
221
250
|
children: (t) => (() => {
|
|
222
|
-
var r =
|
|
251
|
+
var r = B();
|
|
223
252
|
return a(r, n(e, { get component() {
|
|
224
253
|
return t();
|
|
225
254
|
} })), r;
|
|
226
255
|
})()
|
|
227
256
|
}), null), i((e) => {
|
|
228
|
-
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!
|
|
229
|
-
return n !== e.e && t(l, e.e = n), i !== e.t && l.classList.toggle("combobox-open", e.t = i), a !== e.a && l.classList.toggle("combobox-with-detail", e.a = a), o !== e.o && l.classList.toggle("combobox-with-icon", e.o = o), s !== e.i && c(u, "id", e.i = s), f !== e.n && c(u, "aria-expanded", e.n = f), p !== e.s && c(u, "aria-controls", e.s = p), m !== e.h && c(u, "aria-activedescendant", e.h = m), g !== e.r && c(u, "aria-label", e.r = g), _ !== e.d && c(u, "aria-describedby", e.d = _), v !== e.l && (u.required = e.l = v),
|
|
257
|
+
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!b(), a = !(b() || !O()?.detail), o = !(b() || O()?.icon === void 0), s = d(), f = b(), p = h(), m = b() && j() > 0 ? y(T()) : void 0, g = r.ariaLabel, _ = r.describedBy, v = r.required, ee = r.disabled, x = r.onChange === void 0, S = r.value, C = ae();
|
|
258
|
+
return n !== e.e && t(l, e.e = n), i !== e.t && l.classList.toggle("combobox-open", e.t = i), a !== e.a && l.classList.toggle("combobox-with-detail", e.a = a), o !== e.o && l.classList.toggle("combobox-with-icon", e.o = o), s !== e.i && c(u, "id", e.i = s), f !== e.n && c(u, "aria-expanded", e.n = f), p !== e.s && c(u, "aria-controls", e.s = p), m !== e.h && c(u, "aria-activedescendant", e.h = m), g !== e.r && c(u, "aria-label", e.r = g), _ !== e.d && c(u, "aria-describedby", e.d = _), v !== e.l && (u.required = e.l = v), ee !== e.u && (u.disabled = e.u = ee), x !== e.c && (u.readOnly = e.c = x), S !== e.w && c(u, "data-value", e.w = S), C !== e.m && c(u, "placeholder", e.m = C), e;
|
|
230
259
|
}, {
|
|
231
260
|
e: void 0,
|
|
232
261
|
t: void 0,
|
|
@@ -243,7 +272,7 @@ function L(r) {
|
|
|
243
272
|
c: void 0,
|
|
244
273
|
w: void 0,
|
|
245
274
|
m: void 0
|
|
246
|
-
}), i(() => u.value =
|
|
275
|
+
}), i(() => u.value = b() ? C() : O()?.label ?? ""), l;
|
|
247
276
|
})();
|
|
248
277
|
}
|
|
249
278
|
r([
|
|
@@ -253,13 +282,21 @@ r([
|
|
|
253
282
|
"input",
|
|
254
283
|
"keydown"
|
|
255
284
|
]);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
285
|
+
// node_modules/@tabler/icons-solidjs/dist/source/icons/IconChevronLeft.js
|
|
286
|
+
var he = I("outline", "chevron-left", "ChevronLeft", [["path", { d: "M15 6l-6 6l6 6" }]]), ge = I("outline", "chevron-right", "ChevronRight", [["path", { d: "M9 6l6 6l-6 6" }]]), _e = I("outline", "menu", "Menu", [["path", { d: "M4 8l16 0" }], ["path", { d: "M4 16l16 0" }]]), ve = /*#__PURE__*/ d("<li class=data-table-customizer-item draggable=true><span class=data-table-customizer-grip role=button aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown\"></span><label class=data-table-customizer-option><input type=checkbox aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown\">"), ye = /*#__PURE__*/ d("<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>"), be = /*#__PURE__*/ d("<div class=data-table-customizer><button type=button class=data-table-customizer-button aria-haspopup=dialog><span aria-hidden=true>⚙</span> "), xe = /*#__PURE__*/ d("<button type=button class=data-table-sort><span class=data-table-sort-indicator aria-hidden=true>"), H = /*#__PURE__*/ d("<span class=data-table-resize-handle role=separator aria-orientation=vertical tabindex=0>"), Se = /*#__PURE__*/ d("<th>"), Ce = /*#__PURE__*/ d("<td class=data-table-actions>"), U = /*#__PURE__*/ d("<tr>"), W = /*#__PURE__*/ d("<td>"), we = /*#__PURE__*/ d("<td class=data-table-actions><span class=data-table-skeleton>"), Te = /*#__PURE__*/ d("<tr aria-hidden=true>"), Ee = /*#__PURE__*/ d("<td><span class=data-table-skeleton>"), G = /*#__PURE__*/ d("<nav class=data-table-pagination><span aria-live=polite></span><button type=button></button><button type=button>"), De = /*#__PURE__*/ d("<label class=data-table-page-size><select>"), Oe = /*#__PURE__*/ d("<option>"), ke = /*#__PURE__*/ d("<div class=data-table-toolbar-start>"), Ae = /*#__PURE__*/ d("<div class=data-table-toolbar>"), je = /*#__PURE__*/ d("<th class=data-table-actions>Actions"), Me = /*#__PURE__*/ d("<div><div class=data-table-scroll><table class=data-table><thead><tr></tr></thead><tbody>"), Ne = /*#__PURE__*/ d("<p class=data-table-status role=status>Loading…"), Pe = /*#__PURE__*/ d("<p class=data-table-status>No results."), K = 40, Fe = 5, Ie = M({
|
|
287
|
+
rowSortingFeature: re,
|
|
288
|
+
sortedRowModel: k(),
|
|
289
|
+
columnVisibilityFeature: D,
|
|
290
|
+
columnOrderingFeature: T,
|
|
291
|
+
columnSizingFeature: E
|
|
292
|
+
});
|
|
293
|
+
function Le(e, t) {
|
|
294
|
+
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 });
|
|
295
|
+
}
|
|
296
|
+
function q(e) {
|
|
260
297
|
return typeof e == "function" ? e() : e;
|
|
261
298
|
}
|
|
262
|
-
function
|
|
299
|
+
function Re(e, t) {
|
|
263
300
|
if (t !== void 0) return {
|
|
264
301
|
width: `${t}px`,
|
|
265
302
|
"min-width": `${t}px`,
|
|
@@ -268,212 +305,285 @@ function le(e, t) {
|
|
|
268
305
|
let n = (e) => typeof e == "number" ? `${e}px` : e, r = {};
|
|
269
306
|
return e.width !== void 0 && (r.width = n(e.width)), e.minWidth !== void 0 && (r["min-width"] = n(e.minWidth)), e.maxWidth !== void 0 && (r["max-width"] = n(e.maxWidth)), Object.keys(r).length > 0 ? r : void 0;
|
|
270
307
|
}
|
|
271
|
-
function
|
|
272
|
-
let r = _(() =>
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
308
|
+
function J(e) {
|
|
309
|
+
let r = _(() => q(e.rows)), o = () => q(e.loading ?? !1), s = e.sortKey !== void 0 || e.sortDirection !== void 0, [l, d] = v(e.defaultSort), y = () => s ? q(e.sortKey ?? void 0) : l()?.key, x = () => s ? q(e.sortDirection ?? "asc") : l()?.direction ?? "asc", S = () => q(e.showColumnCustomizer ?? !1), w = h(() => e.toolbar), T = _(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [E, D] = v(void 0), O = () => e.visibleColumns === void 0 ? E() ?? T() : q(e.visibleColumns), k = _(() => {
|
|
310
|
+
let t = new Set(O());
|
|
311
|
+
return Object.fromEntries(e.columns.map((e) => [e.key, e.toggleable === !1 || t.has(e.key)]));
|
|
312
|
+
}), [A, ne] = v(void 0), re = () => e.columnOrder === void 0 ? A() ?? e.defaultColumnOrder ?? [] : q(e.columnOrder), M = _(() => {
|
|
313
|
+
let e = y();
|
|
314
|
+
return e === void 0 ? [] : [{
|
|
315
|
+
id: e,
|
|
316
|
+
desc: x() === "desc"
|
|
317
|
+
}];
|
|
318
|
+
}), N = _(() => e.columns.map((e) => ({
|
|
319
|
+
id: e.key,
|
|
320
|
+
accessorFn: (t) => e.sortValue ? e.sortValue(t) : t[e.key],
|
|
321
|
+
enableHiding: e.toggleable !== !1,
|
|
322
|
+
sortFn: (e, t, n) => Le(e.getValue(n), t.getValue(n))
|
|
323
|
+
}))), P = te({
|
|
324
|
+
features: Ie,
|
|
325
|
+
get data() {
|
|
326
|
+
return r();
|
|
327
|
+
},
|
|
328
|
+
get columns() {
|
|
329
|
+
return N();
|
|
330
|
+
},
|
|
331
|
+
getRowId: (t) => String(e.getRowId(t)),
|
|
332
|
+
manualSorting: s,
|
|
333
|
+
enableMultiSort: !1,
|
|
334
|
+
sortDescFirst: !1,
|
|
335
|
+
defaultColumn: { minSize: K },
|
|
336
|
+
state: {
|
|
337
|
+
get sorting() {
|
|
338
|
+
return M();
|
|
339
|
+
},
|
|
340
|
+
get columnVisibility() {
|
|
341
|
+
return k();
|
|
342
|
+
},
|
|
343
|
+
get columnOrder() {
|
|
344
|
+
return re();
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
onSortingChange: le,
|
|
348
|
+
onColumnVisibilityChange: fe,
|
|
349
|
+
onColumnOrderChange: (e) => pe(j(e, re()))
|
|
350
|
+
}), ie = _(() => new Map(e.columns.map((e) => [e.key, e]))), ae = (e) => e.flatMap((e) => ie().get(e.id) ?? []), oe = _(() => ae(P.getAllLeafColumns())), F = _(() => ae(P.getVisibleLeafColumns())), I = _(() => P.getRowModel().rows.map((e) => e.original)), se = _(() => e.columns.filter((e) => e.toggleable !== !1)), ce = _(() => se().map((e) => e.key));
|
|
351
|
+
function le(t) {
|
|
352
|
+
let [n] = j(t, M()), r = n && {
|
|
353
|
+
key: n.id,
|
|
354
|
+
direction: n.desc ? "desc" : "asc"
|
|
355
|
+
}, i = r?.key ?? y();
|
|
356
|
+
s || d(r), i !== void 0 && e.onSort?.(i), r || e.onSortClear?.(), e.onSortChange?.(r);
|
|
298
357
|
}
|
|
299
358
|
function ue(t) {
|
|
300
359
|
let n = new Map(e.columns.map((e, t) => [e.key, t]));
|
|
301
360
|
return [...t].sort((e, t) => (n.get(e) ?? 0) - (n.get(t) ?? 0));
|
|
302
361
|
}
|
|
303
|
-
function
|
|
362
|
+
function de(t) {
|
|
304
363
|
let n = ue(t);
|
|
305
|
-
e.visibleColumns === void 0 &&
|
|
306
|
-
}
|
|
307
|
-
function de(e, t) {
|
|
308
|
-
let n = new Set(ee());
|
|
309
|
-
t ? n.add(e) : n.delete(e), Y(P().filter((e) => n.has(e)));
|
|
364
|
+
e.visibleColumns === void 0 && D(n), e.onVisibleColumnsChange?.(n);
|
|
310
365
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
366
|
+
function fe(e) {
|
|
367
|
+
let t = j(e, k());
|
|
368
|
+
de(ce().filter((e) => t[e]));
|
|
313
369
|
}
|
|
314
|
-
function
|
|
315
|
-
e.columnOrder === void 0 &&
|
|
370
|
+
function pe(t) {
|
|
371
|
+
e.columnOrder === void 0 && ne(t), e.onColumnOrderChange?.(t);
|
|
316
372
|
}
|
|
317
|
-
function
|
|
318
|
-
let n =
|
|
319
|
-
r === -1 || t < 0 || t >= n.length || t === r || (n.splice(r, 1), n.splice(t, 0, e),
|
|
373
|
+
function L(e, t) {
|
|
374
|
+
let n = P.getAllLeafColumns().map((e) => e.id), r = n.indexOf(e);
|
|
375
|
+
r === -1 || t < 0 || t >= n.length || t === r || (n.splice(r, 1), n.splice(t, 0, e), P.setColumnOrder(n));
|
|
320
376
|
}
|
|
321
377
|
function me() {
|
|
322
|
-
|
|
378
|
+
de(T());
|
|
379
|
+
let t = e.columns.map((e) => e.key), n = (e.defaultColumnOrder ?? []).filter((e) => t.includes(e));
|
|
380
|
+
pe([.../* @__PURE__ */ new Set([...n, ...t])]), ze(), e.onColumnWidthsChange?.({});
|
|
323
381
|
}
|
|
324
|
-
let
|
|
382
|
+
let R = () => P.atoms.columnSizing.get(), [z, B] = v(), V = () => {
|
|
383
|
+
let e = z();
|
|
384
|
+
return e === void 0 ? void 0 : P.getTotalSize() + e;
|
|
385
|
+
}, J;
|
|
386
|
+
function ze() {
|
|
387
|
+
B(void 0), P.setColumnSizing({});
|
|
388
|
+
}
|
|
389
|
+
function Y(e) {
|
|
390
|
+
if (!J) return 0;
|
|
391
|
+
let t = J.cloneNode(!1);
|
|
392
|
+
t.classList.remove("data-table-resized"), t.style.cssText = "position:absolute;visibility:hidden;width:max-content;max-width:none";
|
|
393
|
+
for (let n of J.rows) {
|
|
394
|
+
let r = n.cells[e]?.cloneNode(!0);
|
|
395
|
+
r && (r.removeAttribute("style"), t.insertRow().append(r));
|
|
396
|
+
}
|
|
397
|
+
J.after(t);
|
|
398
|
+
let n = t.getBoundingClientRect().width;
|
|
399
|
+
return t.remove(), Math.ceil(n);
|
|
400
|
+
}
|
|
401
|
+
let X = () => F().length;
|
|
325
402
|
g(() => {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
403
|
+
if (e.columnWidths === void 0) return;
|
|
404
|
+
let t = q(e.columnWidths);
|
|
405
|
+
Object.keys(t).length === 0 ? ze() : (P.setColumnSizing(t), B((t) => t ?? (e.rowActions ? Y(C(X)) : 0)));
|
|
406
|
+
}), g(() => {
|
|
407
|
+
let e = F().map((e) => e.key), t = R();
|
|
408
|
+
if (z() === void 0 || e.every((e) => t[e] !== void 0)) return;
|
|
330
409
|
let n = { ...t };
|
|
331
|
-
for (let t of e)
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
n[t] = Math.max(40, Math.ceil(i));
|
|
339
|
-
}
|
|
340
|
-
he(n);
|
|
341
|
-
let r = [...Q.querySelectorAll("thead th:not([data-column-key])")];
|
|
342
|
-
_e(e.reduce((e, t) => e + (n[t] ?? 0), 0) + r.reduce((e, t) => e + t.getBoundingClientRect().width, 0));
|
|
410
|
+
for (let [t, r] of e.entries()) n[r] ??= Math.max(K, Y(t));
|
|
411
|
+
P.setColumnSizing(n);
|
|
412
|
+
}), g(() => {
|
|
413
|
+
I();
|
|
414
|
+
let t = C(z);
|
|
415
|
+
e.rowActions && t !== void 0 && B(Math.max(t, Y(C(X))));
|
|
343
416
|
});
|
|
344
|
-
function
|
|
345
|
-
|
|
417
|
+
function Be(e) {
|
|
418
|
+
let t = {};
|
|
419
|
+
for (let n of e.querySelectorAll("th[data-column-key]")) t[n.dataset.columnKey] = n.getBoundingClientRect().width;
|
|
420
|
+
let n = Object.values(t).reduce((e, t) => e + t, 0);
|
|
421
|
+
return {
|
|
422
|
+
sizing: t,
|
|
423
|
+
extra: e.getBoundingClientRect().width - n
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
function Ve(e, t) {
|
|
427
|
+
P.setColumnSizing(e), B(t);
|
|
428
|
+
}
|
|
429
|
+
function He(t, n) {
|
|
430
|
+
if (!J) return;
|
|
346
431
|
t.preventDefault(), t.stopPropagation();
|
|
347
432
|
let r = t.currentTarget;
|
|
348
433
|
r.setPointerCapture(t.pointerId);
|
|
349
|
-
let i = t.clientX, a =
|
|
350
|
-
for (let e of Q.querySelectorAll("th[data-column-key]")) o[e.dataset.columnKey] = e.getBoundingClientRect().width;
|
|
351
|
-
let s = o[n] ?? 40, c = !1;
|
|
434
|
+
let i = t.clientX, { sizing: a, extra: o } = Be(J), s = a[n] ?? K, c = !1;
|
|
352
435
|
function l(e) {
|
|
353
436
|
if (!c && Math.abs(e.clientX - i) < 2) return;
|
|
354
437
|
c = !0;
|
|
355
|
-
let t = Math.max(
|
|
356
|
-
|
|
357
|
-
...
|
|
438
|
+
let t = Math.max(K, s + e.clientX - i);
|
|
439
|
+
Ve({
|
|
440
|
+
...a,
|
|
358
441
|
[n]: t
|
|
359
|
-
}
|
|
442
|
+
}, o);
|
|
360
443
|
}
|
|
361
444
|
function u() {
|
|
362
|
-
r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u), c && e.onColumnWidthsChange?.(
|
|
445
|
+
r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u), c && e.onColumnWidthsChange?.(R());
|
|
363
446
|
}
|
|
364
447
|
r.addEventListener("pointermove", l), r.addEventListener("pointerup", u), r.addEventListener("pointercancel", u);
|
|
365
448
|
}
|
|
366
|
-
function
|
|
449
|
+
function Ue(t) {
|
|
450
|
+
if (!J) return;
|
|
451
|
+
let n = F().findIndex((e) => e.key === t), { sizing: r, extra: i } = Be(J);
|
|
452
|
+
Ve({
|
|
453
|
+
...r,
|
|
454
|
+
[t]: Math.max(K, Y(n))
|
|
455
|
+
}, i), e.onColumnWidthsChange?.(R());
|
|
456
|
+
}
|
|
457
|
+
function We(t, n) {
|
|
458
|
+
if (t.key === "Enter") {
|
|
459
|
+
t.preventDefault(), Ue(n);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
367
462
|
let r = t.key === "ArrowLeft" ? -10 : t.key === "ArrowRight" ? 10 : 0;
|
|
368
|
-
if (!r || !
|
|
463
|
+
if (!r || !J) return;
|
|
369
464
|
t.preventDefault();
|
|
370
|
-
let i =
|
|
371
|
-
|
|
372
|
-
let a = i[n] ?? 40, o = Math.max(40, a + r);
|
|
373
|
-
_e(Q.getBoundingClientRect().width + o - a), he({
|
|
465
|
+
let { sizing: i, extra: a } = Be(J), o = i[n] ?? K;
|
|
466
|
+
Ve({
|
|
374
467
|
...i,
|
|
375
|
-
[n]: o
|
|
376
|
-
}), e.onColumnWidthsChange?.(
|
|
468
|
+
[n]: Math.max(K, o + r)
|
|
469
|
+
}, a), e.onColumnWidthsChange?.(R());
|
|
377
470
|
}
|
|
378
|
-
let [
|
|
471
|
+
let [Ge, Ke] = v(), qe = `${ee()}-panel`, [Je, Ye] = v(!1), Xe;
|
|
379
472
|
g(() => {
|
|
380
|
-
if (!
|
|
473
|
+
if (!Je() || !S()) return;
|
|
381
474
|
function e(e) {
|
|
382
|
-
|
|
475
|
+
Xe && !Xe.contains(e.target) && Ye(!1);
|
|
383
476
|
}
|
|
384
477
|
function t(e) {
|
|
385
|
-
e.key === "Escape" &&
|
|
478
|
+
e.key === "Escape" && Ye(!1);
|
|
386
479
|
}
|
|
387
|
-
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t),
|
|
480
|
+
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), b(() => {
|
|
388
481
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
389
482
|
});
|
|
390
483
|
});
|
|
391
|
-
function
|
|
392
|
-
return e.toggleable === !1 || k().has(e.key);
|
|
393
|
-
}
|
|
394
|
-
function De(t, n) {
|
|
484
|
+
function Ze(t, n) {
|
|
395
485
|
return e.getCell?.(t, n) ?? n.getValue?.(t) ?? null;
|
|
396
486
|
}
|
|
397
|
-
function
|
|
398
|
-
if (e.sortable) return
|
|
487
|
+
function Qe(e) {
|
|
488
|
+
if (e.sortable) return y() === e.key ? x() === "asc" ? "ascending" : "descending" : "none";
|
|
399
489
|
}
|
|
400
|
-
function
|
|
401
|
-
return
|
|
490
|
+
function $e(e) {
|
|
491
|
+
return y() === e.key ? x() === "asc" ? "▲" : "▼" : "";
|
|
402
492
|
}
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
|
|
493
|
+
let et = (t) => !!t.sortable && (!s || !!(e.onSort || e.onSortChange));
|
|
494
|
+
function tt(e, t) {
|
|
495
|
+
Ke(t.key), e.dataTransfer?.setData("text/plain", t.key), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
406
496
|
}
|
|
407
|
-
function
|
|
408
|
-
let n =
|
|
409
|
-
n !== void 0 && (e.preventDefault(),
|
|
497
|
+
function nt(e, t) {
|
|
498
|
+
let n = Ge();
|
|
499
|
+
n !== void 0 && (e.preventDefault(), L(n, t));
|
|
410
500
|
}
|
|
411
|
-
function
|
|
501
|
+
function rt(e, t, n) {
|
|
502
|
+
let r = e.key === "ArrowUp" ? -1 : +(e.key === "ArrowDown");
|
|
503
|
+
if (!e.altKey || !r) return;
|
|
504
|
+
e.preventDefault();
|
|
505
|
+
let i = document.activeElement;
|
|
506
|
+
L(t.key, n + r), i?.focus();
|
|
507
|
+
}
|
|
508
|
+
function it(e, t) {
|
|
509
|
+
if (e.pointerType === "mouse") return;
|
|
510
|
+
Ke(t.key);
|
|
511
|
+
function n(e) {
|
|
512
|
+
let n = document.elementFromPoint(e.clientX, e.clientY)?.closest(".data-table-customizer-item");
|
|
513
|
+
n?.parentElement && L(t.key, Array.prototype.indexOf.call(n.parentElement.children, n));
|
|
514
|
+
}
|
|
515
|
+
function r() {
|
|
516
|
+
document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", r), document.removeEventListener("pointercancel", r), Ke(void 0);
|
|
517
|
+
}
|
|
518
|
+
document.addEventListener("pointermove", n), document.addEventListener("pointerup", r), document.addEventListener("pointercancel", r);
|
|
519
|
+
}
|
|
520
|
+
function at(e, t) {
|
|
521
|
+
let r = e.ariaLabel ?? e.label;
|
|
412
522
|
return (() => {
|
|
413
|
-
var
|
|
414
|
-
return
|
|
415
|
-
class: "data-table-customizer-grip",
|
|
523
|
+
var o = ve(), s = o.firstChild, l = s.nextSibling, u = l.firstChild;
|
|
524
|
+
return o.$$keydown = (n) => rt(n, e, t()), o.addEventListener("dragend", () => Ke(void 0)), o.addEventListener("drop", (e) => e.preventDefault()), o.addEventListener("dragover", (e) => nt(e, t())), o.addEventListener("dragstart", (t) => tt(t, e)), s.$$pointerdown = (t) => it(t, e), c(s, "aria-label", `Reorder ${r}`), a(s, n(_e, {
|
|
416
525
|
size: 14,
|
|
417
526
|
"aria-hidden": "true"
|
|
418
|
-
})
|
|
419
|
-
var n =
|
|
420
|
-
return n !== t.e &&
|
|
527
|
+
})), u.addEventListener("change", (t) => P.getColumn(e.key)?.toggleVisibility(t.currentTarget.checked)), a(l, r, null), i((t) => {
|
|
528
|
+
var n = Ge() === e.key, r = e.toggleable === !1 ? 0 : -1, i = e.toggleable === !1;
|
|
529
|
+
return n !== t.e && o.classList.toggle("data-table-customizer-item-dragging", t.e = n), r !== t.t && c(s, "tabindex", t.t = r), i !== t.a && (u.disabled = t.a = i), t;
|
|
421
530
|
}, {
|
|
422
531
|
e: void 0,
|
|
423
|
-
t: void 0
|
|
424
|
-
|
|
532
|
+
t: void 0,
|
|
533
|
+
a: void 0
|
|
534
|
+
}), i(() => u.checked = k()[e.key]), o;
|
|
425
535
|
})();
|
|
426
536
|
}
|
|
427
|
-
function
|
|
537
|
+
function ot() {
|
|
428
538
|
return (() => {
|
|
429
|
-
var t =
|
|
430
|
-
return c(t, "id",
|
|
539
|
+
var t = ye(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
540
|
+
return c(t, "id", qe), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(p, {
|
|
431
541
|
get each() {
|
|
432
|
-
return
|
|
542
|
+
return oe();
|
|
433
543
|
},
|
|
434
|
-
children: (e, t) =>
|
|
435
|
-
})), s.$$click =
|
|
544
|
+
children: (e, t) => at(e, t)
|
|
545
|
+
})), s.$$click = () => P.toggleAllColumnsVisible(!0), a(s, () => e.columnCustomizerShowAllLabel ?? "Show all"), l.$$click = me, a(l, () => e.columnCustomizerResetLabel ?? "Reset"), i(() => c(t, "aria-label", e.columnCustomizerTitle ?? "Customize columns")), t;
|
|
436
546
|
})();
|
|
437
547
|
}
|
|
438
|
-
function
|
|
548
|
+
function st() {
|
|
439
549
|
return (() => {
|
|
440
|
-
var t =
|
|
550
|
+
var t = be(), r = t.firstChild;
|
|
441
551
|
r.firstChild.nextSibling;
|
|
442
|
-
var o =
|
|
443
|
-
return typeof o == "function" ? f(o, t) :
|
|
552
|
+
var o = Xe;
|
|
553
|
+
return typeof o == "function" ? f(o, t) : Xe = t, r.$$click = () => Ye((e) => !e), c(r, "aria-controls", qe), a(r, () => e.columnCustomizerLabel ?? "Columns", null), a(t, n(m, {
|
|
444
554
|
get when() {
|
|
445
|
-
return
|
|
555
|
+
return Je();
|
|
446
556
|
},
|
|
447
557
|
get children() {
|
|
448
|
-
return
|
|
558
|
+
return ot();
|
|
449
559
|
}
|
|
450
|
-
}), null), i(() => c(r, "aria-expanded",
|
|
560
|
+
}), null), i(() => c(r, "aria-expanded", Je())), t;
|
|
451
561
|
})();
|
|
452
562
|
}
|
|
453
|
-
function
|
|
563
|
+
function ct(r) {
|
|
454
564
|
return (() => {
|
|
455
|
-
var o =
|
|
565
|
+
var o = Se();
|
|
456
566
|
return a(o, n(m, {
|
|
457
567
|
get when() {
|
|
458
|
-
return
|
|
568
|
+
return et(r);
|
|
459
569
|
},
|
|
460
570
|
get fallback() {
|
|
461
571
|
return r.label;
|
|
462
572
|
},
|
|
463
573
|
get children() {
|
|
464
|
-
var e =
|
|
465
|
-
return e.$$click = () =>
|
|
574
|
+
var e = xe(), t = e.firstChild;
|
|
575
|
+
return e.$$click = () => P.getColumn(r.key)?.toggleSorting(), a(e, () => r.label, t), a(t, () => $e(r)), e;
|
|
466
576
|
}
|
|
467
577
|
}), null), a(o, n(m, {
|
|
468
578
|
get when() {
|
|
469
579
|
return e.resizableColumns;
|
|
470
580
|
},
|
|
471
581
|
get children() {
|
|
472
|
-
var e =
|
|
473
|
-
return e.$$keydown = (e) =>
|
|
582
|
+
var e = H();
|
|
583
|
+
return e.$$dblclick = () => Ue(r.key), e.$$keydown = (e) => We(e, r.key), e.$$pointerdown = (e) => He(e, r.key), i(() => c(e, "aria-label", `Resize ${r.ariaLabel ?? r.label}`)), e;
|
|
474
584
|
}
|
|
475
585
|
}), null), i((e) => {
|
|
476
|
-
var n = r.class, i = r.key, a =
|
|
586
|
+
var n = r.class, i = r.key, a = Re(r, R()[r.key]), s = Qe(r);
|
|
477
587
|
return n !== e.e && t(o, e.e = n), i !== e.t && c(o, "data-column-key", e.t = i), e.a = u(o, a, e.a), s !== e.o && c(o, "aria-sort", e.o = s), e;
|
|
478
588
|
}, {
|
|
479
589
|
e: void 0,
|
|
@@ -483,17 +593,17 @@ function ue(e) {
|
|
|
483
593
|
}), o;
|
|
484
594
|
})();
|
|
485
595
|
}
|
|
486
|
-
function
|
|
596
|
+
function lt(r) {
|
|
487
597
|
return (() => {
|
|
488
|
-
var o =
|
|
598
|
+
var o = U();
|
|
489
599
|
return a(o, n(p, {
|
|
490
600
|
get each() {
|
|
491
|
-
return
|
|
601
|
+
return F();
|
|
492
602
|
},
|
|
493
603
|
children: (e) => (() => {
|
|
494
|
-
var n =
|
|
495
|
-
return a(n, () =>
|
|
496
|
-
var i = e.class, a =
|
|
604
|
+
var n = W();
|
|
605
|
+
return a(n, () => Ze(r, e)), i((r) => {
|
|
606
|
+
var i = e.class, a = Re(e, R()[e.key]);
|
|
497
607
|
return i !== r.e && t(n, r.e = i), r.t = u(n, a, r.t), r;
|
|
498
608
|
}, {
|
|
499
609
|
e: void 0,
|
|
@@ -505,105 +615,224 @@ function ue(e) {
|
|
|
505
615
|
return e.rowActions;
|
|
506
616
|
},
|
|
507
617
|
get children() {
|
|
508
|
-
var t =
|
|
618
|
+
var t = Ce();
|
|
509
619
|
return a(t, () => e.rowActions?.(r)), t;
|
|
510
620
|
}
|
|
511
621
|
}), null), o;
|
|
512
622
|
})();
|
|
513
623
|
}
|
|
514
|
-
|
|
624
|
+
function ut() {
|
|
625
|
+
return (() => {
|
|
626
|
+
var r = Te();
|
|
627
|
+
return a(r, n(p, {
|
|
628
|
+
get each() {
|
|
629
|
+
return F();
|
|
630
|
+
},
|
|
631
|
+
children: (e) => (() => {
|
|
632
|
+
var n = Ee();
|
|
633
|
+
return i((r) => {
|
|
634
|
+
var i = e.class, a = Re(e, R()[e.key]);
|
|
635
|
+
return i !== r.e && t(n, r.e = i), r.t = u(n, a, r.t), r;
|
|
636
|
+
}, {
|
|
637
|
+
e: void 0,
|
|
638
|
+
t: void 0
|
|
639
|
+
}), n;
|
|
640
|
+
})()
|
|
641
|
+
}), null), a(r, n(m, {
|
|
642
|
+
get when() {
|
|
643
|
+
return e.rowActions;
|
|
644
|
+
},
|
|
645
|
+
get children() {
|
|
646
|
+
return we();
|
|
647
|
+
}
|
|
648
|
+
}), null), r;
|
|
649
|
+
})();
|
|
650
|
+
}
|
|
651
|
+
let Z = () => q(e.pagination), dt = () => {
|
|
652
|
+
let e = Z();
|
|
653
|
+
return e ? Math.max(1, Math.ceil(e.rowCount / e.pageSize)) : 1;
|
|
654
|
+
};
|
|
655
|
+
function Q(t) {
|
|
656
|
+
let n = Z();
|
|
657
|
+
n && e.onPaginationChange?.({
|
|
658
|
+
page: t,
|
|
659
|
+
pageSize: n.pageSize
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
function ft(t) {
|
|
663
|
+
let n = Math.min((t.page - 1) * t.pageSize + 1, t.rowCount), r = Math.min(t.page * t.pageSize, t.rowCount), i = e.paginationLabels?.range;
|
|
664
|
+
return i ? i(n, r, t.rowCount) : `${n}–${r} of ${t.rowCount}`;
|
|
665
|
+
}
|
|
666
|
+
function pt(t) {
|
|
667
|
+
return (() => {
|
|
668
|
+
var r = G(), o = r.firstChild, s = o.nextSibling, l = s.nextSibling;
|
|
669
|
+
return a(r, n(m, {
|
|
670
|
+
get when() {
|
|
671
|
+
return t().pageSizeOptions;
|
|
672
|
+
},
|
|
673
|
+
children: (r) => (() => {
|
|
674
|
+
var o = De(), s = o.firstChild;
|
|
675
|
+
return a(o, () => e.paginationLabels?.pageSize ?? "Rows per page", s), s.addEventListener("change", (t) => e.onPaginationChange?.({
|
|
676
|
+
page: 1,
|
|
677
|
+
pageSize: Number(t.currentTarget.value)
|
|
678
|
+
})), a(s, n(p, {
|
|
679
|
+
get each() {
|
|
680
|
+
return r();
|
|
681
|
+
},
|
|
682
|
+
children: (e) => (() => {
|
|
683
|
+
var n = Oe();
|
|
684
|
+
return n.value = e, a(n, e), i(() => n.selected = e === t().pageSize), n;
|
|
685
|
+
})()
|
|
686
|
+
})), i(() => s.value = t().pageSize), o;
|
|
687
|
+
})()
|
|
688
|
+
}), o), a(o, () => ft(t())), s.$$click = () => Q(t().page - 1), a(s, n(he, {
|
|
689
|
+
size: 16,
|
|
690
|
+
"aria-hidden": "true"
|
|
691
|
+
})), l.$$click = () => Q(t().page + 1), a(l, n(ge, {
|
|
692
|
+
size: 16,
|
|
693
|
+
"aria-hidden": "true"
|
|
694
|
+
})), i((n) => {
|
|
695
|
+
var i = e.paginationLabels?.navigation ?? "Pagination", a = e.paginationLabels?.previous ?? "Previous page", o = t().page <= 1, u = e.paginationLabels?.next ?? "Next page", d = t().page >= dt();
|
|
696
|
+
return i !== n.e && c(r, "aria-label", n.e = i), a !== n.t && c(s, "aria-label", n.t = a), o !== n.a && (s.disabled = n.a = o), u !== n.o && c(l, "aria-label", n.o = u), d !== n.i && (l.disabled = n.i = d), n;
|
|
697
|
+
}, {
|
|
698
|
+
e: void 0,
|
|
699
|
+
t: void 0,
|
|
700
|
+
a: void 0,
|
|
701
|
+
o: void 0,
|
|
702
|
+
i: void 0
|
|
703
|
+
}), r;
|
|
704
|
+
})();
|
|
705
|
+
}
|
|
706
|
+
let mt = () => !o() && (e.empty === void 0 ? r().length === 0 : q(e.empty)), $ = () => o() && I().length === 0 && e.loadingContent === void 0;
|
|
515
707
|
return (() => {
|
|
516
|
-
var r =
|
|
708
|
+
var r = Me(), s = r.firstChild, l = s.firstChild, d = l.firstChild, h = d.firstChild, g = d.nextSibling;
|
|
517
709
|
a(r, n(m, {
|
|
518
710
|
get when() {
|
|
519
|
-
return
|
|
711
|
+
return S() || w.toArray().length > 0;
|
|
520
712
|
},
|
|
521
713
|
get children() {
|
|
522
|
-
var e =
|
|
714
|
+
var e = Ae();
|
|
523
715
|
return a(e, n(m, {
|
|
524
716
|
get when() {
|
|
525
|
-
return
|
|
717
|
+
return w.toArray().length > 0;
|
|
526
718
|
},
|
|
527
719
|
get children() {
|
|
528
|
-
var e =
|
|
529
|
-
return a(e,
|
|
720
|
+
var e = ke();
|
|
721
|
+
return a(e, w), e;
|
|
530
722
|
}
|
|
531
723
|
}), null), a(e, n(m, {
|
|
532
724
|
get when() {
|
|
533
|
-
return
|
|
725
|
+
return S();
|
|
534
726
|
},
|
|
535
727
|
get children() {
|
|
536
|
-
return
|
|
728
|
+
return st();
|
|
537
729
|
}
|
|
538
730
|
}), null), e;
|
|
539
731
|
}
|
|
540
732
|
}), s);
|
|
541
|
-
var
|
|
542
|
-
return typeof
|
|
733
|
+
var _ = J;
|
|
734
|
+
return typeof _ == "function" ? f(_, l) : J = l, a(h, n(p, {
|
|
543
735
|
get each() {
|
|
544
|
-
return
|
|
736
|
+
return F();
|
|
545
737
|
},
|
|
546
|
-
children:
|
|
547
|
-
}), null), a(
|
|
738
|
+
children: ct
|
|
739
|
+
}), null), a(h, n(m, {
|
|
548
740
|
get when() {
|
|
549
741
|
return e.rowActions;
|
|
550
742
|
},
|
|
551
743
|
get children() {
|
|
552
|
-
return
|
|
744
|
+
return je();
|
|
553
745
|
}
|
|
554
|
-
}), null), a(
|
|
746
|
+
}), null), a(g, n(p, {
|
|
555
747
|
get each() {
|
|
556
|
-
return
|
|
748
|
+
return I();
|
|
749
|
+
},
|
|
750
|
+
children: lt
|
|
751
|
+
}), null), a(g, n(m, {
|
|
752
|
+
get when() {
|
|
753
|
+
return $();
|
|
557
754
|
},
|
|
558
|
-
children
|
|
559
|
-
|
|
755
|
+
get children() {
|
|
756
|
+
return n(p, {
|
|
757
|
+
get each() {
|
|
758
|
+
return Array.from({ length: e.skeletonRows ?? Fe });
|
|
759
|
+
},
|
|
760
|
+
children: ut
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
}), null), a(r, n(m, {
|
|
560
764
|
get when() {
|
|
561
765
|
return o();
|
|
562
766
|
},
|
|
563
767
|
get children() {
|
|
564
|
-
return e.loadingContent ??
|
|
768
|
+
return e.loadingContent ?? (() => {
|
|
769
|
+
var e = Ne();
|
|
770
|
+
return i(() => e.classList.toggle("data-table-visually-hidden", !!$())), e;
|
|
771
|
+
})();
|
|
565
772
|
}
|
|
566
773
|
}), null), a(r, n(m, {
|
|
567
774
|
get when() {
|
|
568
|
-
return
|
|
775
|
+
return mt();
|
|
569
776
|
},
|
|
570
777
|
get children() {
|
|
571
|
-
return e.emptyContent ??
|
|
778
|
+
return e.emptyContent ?? Pe();
|
|
572
779
|
}
|
|
780
|
+
}), null), a(r, n(m, {
|
|
781
|
+
get when() {
|
|
782
|
+
return Z();
|
|
783
|
+
},
|
|
784
|
+
children: pt
|
|
573
785
|
}), null), i((n) => {
|
|
574
|
-
var i = `data-table-wrap${e.class ? ` ${e.class}` : ""}`, a =
|
|
575
|
-
return i !== n.e && t(r, n.e = i), a !== n.t &&
|
|
786
|
+
var i = `data-table-wrap${e.class ? ` ${e.class}` : ""}`, a = V() !== void 0, s = !!e.stickyHeader, d = !!e.stickyActions, f = o(), p = V() === void 0 ? void 0 : { width: `${V()}px` };
|
|
787
|
+
return i !== n.e && t(r, n.e = i), a !== n.t && l.classList.toggle("data-table-resized", n.t = a), s !== n.a && l.classList.toggle("data-table-sticky-header", n.a = s), d !== n.o && l.classList.toggle("data-table-sticky-actions", n.o = d), f !== n.i && c(l, "aria-busy", n.i = f), n.n = u(l, p, n.n), n;
|
|
576
788
|
}, {
|
|
577
789
|
e: void 0,
|
|
578
790
|
t: void 0,
|
|
579
|
-
a: void 0
|
|
791
|
+
a: void 0,
|
|
792
|
+
o: void 0,
|
|
793
|
+
i: void 0,
|
|
794
|
+
n: void 0
|
|
580
795
|
}), r;
|
|
581
796
|
})();
|
|
582
797
|
}
|
|
583
798
|
r([
|
|
584
|
-
"
|
|
799
|
+
"keydown",
|
|
585
800
|
"pointerdown",
|
|
586
|
-
"
|
|
801
|
+
"click",
|
|
802
|
+
"dblclick"
|
|
587
803
|
]);
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var Y = O("outline", "device-floppy", "DeviceFloppy", [
|
|
804
|
+
// node_modules/@tabler/icons-solidjs/dist/source/icons/IconDeviceFloppy.js
|
|
805
|
+
var ze = I("outline", "device-floppy", "DeviceFloppy", [
|
|
591
806
|
["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" }],
|
|
592
807
|
["path", { d: "M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }],
|
|
593
808
|
["path", { d: "M14 4l0 4l-6 0l0 -4" }]
|
|
594
|
-
]),
|
|
595
|
-
|
|
809
|
+
]), Y = I("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" }]]), X = I("outline", "x", "X", [["path", { d: "M18 6l-12 12" }], ["path", { d: "M6 6l12 12" }]]), Be = /*#__PURE__*/ d("<li class=filter-table-chip><button type=button class=filter-table-chip-remove>"), Ve = /*#__PURE__*/ d("<ul class=filter-table-chips>"), He = /*#__PURE__*/ d("<div class=filter-table-multi>"), Ue = /*#__PURE__*/ d("<div class=filter-table-range><input class=filter-table-input step=any><input class=filter-table-input step=any>"), We = /*#__PURE__*/ d("<input class=filter-table-input type=text>"), Ge = /*#__PURE__*/ d("<div class=filter-table-search><input type=search class=filter-table-input>"), Ke = /*#__PURE__*/ d("<div class=filter-table-saved>"), qe = /*#__PURE__*/ d("<button type=button class=filter-table-chip-remove>"), Je = /*#__PURE__*/ d("<li><button type=button class=filter-table-pill>"), Ye = /*#__PURE__*/ d("<li><button type=button class=\"filter-table-pill filter-table-pill-save\">"), Xe = /*#__PURE__*/ d("<ul class=filter-table-pills aria-label=\"Applied filters\"><li><button type=button class=\"filter-table-pill filter-table-pill-clear\">"), Ze = /*#__PURE__*/ d("<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>"), Qe = /*#__PURE__*/ d("<div class=filter-table-toolbar>"), $e = /*#__PURE__*/ d("<span class=filter-table-badge>"), et = /*#__PURE__*/ d("<button type=button role=tab class=filter-table-tab>"), tt = /*#__PURE__*/ d("<div class=filter-table-field><label class=filter-table-label>"), nt = /*#__PURE__*/ d("<legend class=filter-table-legend>"), rt = /*#__PURE__*/ d("<fieldset class=filter-table-fieldset>"), it = /*#__PURE__*/ d("<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\">"), at = /*#__PURE__*/ d("<div><div class=filter-table-tabs role=tablist></div><div role=tabpanel></div><div role=tabpanel>"), ot = "q", st = 300, ct = "..", lt = "__search__", ut = M({
|
|
810
|
+
columnFilteringFeature: w,
|
|
811
|
+
globalFilteringFeature: ne,
|
|
812
|
+
filteredRowModel: O()
|
|
813
|
+
});
|
|
814
|
+
function Z(e) {
|
|
815
|
+
let [t = "", n = ""] = e.split(ct);
|
|
816
|
+
return {
|
|
817
|
+
min: t,
|
|
818
|
+
max: n
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
function dt(e, t) {
|
|
822
|
+
return e === "" && t === "" ? "" : `${e}${ct}${t}`;
|
|
823
|
+
}
|
|
824
|
+
function Q(e) {
|
|
596
825
|
return typeof e == "function" ? e() : e;
|
|
597
826
|
}
|
|
598
|
-
function
|
|
827
|
+
function ft(e) {
|
|
599
828
|
return Array.isArray(e) ? e.length > 0 : (e ?? "").trim() !== "";
|
|
600
829
|
}
|
|
601
|
-
function
|
|
830
|
+
function pt(e) {
|
|
602
831
|
let t = {};
|
|
603
|
-
for (let [n, r] of Object.entries(e))
|
|
832
|
+
for (let [n, r] of Object.entries(e)) ft(r) && (t[n] = Array.isArray(r) ? r : r.trim());
|
|
604
833
|
return t;
|
|
605
834
|
}
|
|
606
|
-
function
|
|
835
|
+
function mt(e, t) {
|
|
607
836
|
let n = Object.keys(e);
|
|
608
837
|
return n.length === Object.keys(t).length && n.every((n) => {
|
|
609
838
|
let r = e[n], i = t[n];
|
|
@@ -613,172 +842,235 @@ function Ne(e, t) {
|
|
|
613
842
|
function $(e) {
|
|
614
843
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
615
844
|
}
|
|
616
|
-
function
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
]), u = _(() => Ae(r.rows)), [d, h] = v(Me(r.defaultFilterValues ?? {})), x = _(() => r.filterValues === void 0 ? d() : Me(Ae(r.filterValues)));
|
|
644
|
-
function S(e) {
|
|
645
|
-
let t = Me(e);
|
|
646
|
-
r.filterValues === void 0 && h(t), r.onFilterValuesChange?.(t);
|
|
845
|
+
function ht(e) {
|
|
846
|
+
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return e;
|
|
847
|
+
if (!(e instanceof Date || typeof e == "string" || typeof e == "number")) return;
|
|
848
|
+
let t = new Date(e);
|
|
849
|
+
if (Number.isNaN(t.getTime())) return;
|
|
850
|
+
let n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
|
|
851
|
+
return `${t.getFullYear()}-${n}-${r}`;
|
|
852
|
+
}
|
|
853
|
+
function gt(e, t, n) {
|
|
854
|
+
if (e == null || e === "") return !1;
|
|
855
|
+
let r = Number(e);
|
|
856
|
+
return !Number.isNaN(r) && (t === "" || r >= Number(t)) && (n === "" || r <= Number(n));
|
|
857
|
+
}
|
|
858
|
+
function _t(e, t, n) {
|
|
859
|
+
let r = ht(e);
|
|
860
|
+
return r !== void 0 && (t === "" || r >= t) && (n === "" || r <= n);
|
|
861
|
+
}
|
|
862
|
+
function vt(e) {
|
|
863
|
+
let [r, l] = S(e, /* @__PURE__ */ "rows.filters.filterValues.defaultFilterValues.onFilterValuesChange.savedFilters.onSavedFiltersChange.manualFiltering.totalCount.quickSearch.quickSearchDebounce.getSearchText.quickSearchLabel.resultsLabel.filtersLabel.applyLabel.resetLabel.clearAllLabel.anyLabel.yesLabel.noLabel.fromLabel.toLabel.savedFiltersLabel.saveLabel.saveNameLabel.cancelLabel.clearSavedFilterLabel.class".split(".")), u = _(() => Q(r.rows)), [d, h] = v(pt(r.defaultFilterValues ?? {})), x = _(() => r.filterValues === void 0 ? d() : pt(Q(r.filterValues)));
|
|
864
|
+
function C(e) {
|
|
865
|
+
let t = O !== void 0;
|
|
866
|
+
k();
|
|
867
|
+
let n = pt(t ? {
|
|
868
|
+
...e,
|
|
869
|
+
[ot]: E()
|
|
870
|
+
} : e);
|
|
871
|
+
r.filterValues === void 0 && h(n), r.onFilterValuesChange?.(n);
|
|
647
872
|
}
|
|
648
873
|
function w(e, t) {
|
|
649
|
-
|
|
874
|
+
C({
|
|
650
875
|
...x(),
|
|
651
876
|
[e]: t
|
|
652
877
|
});
|
|
653
878
|
}
|
|
654
|
-
let T = () => $(x()[
|
|
655
|
-
function
|
|
879
|
+
let T = () => $(x()[ot]), [E, D] = v(T()), O;
|
|
880
|
+
function k() {
|
|
881
|
+
clearTimeout(O), O = void 0;
|
|
882
|
+
}
|
|
883
|
+
b(k);
|
|
884
|
+
function j() {
|
|
885
|
+
E().trim() !== T() && w(ot, E());
|
|
886
|
+
}
|
|
887
|
+
function ne() {
|
|
888
|
+
O !== void 0 && (k(), j());
|
|
889
|
+
}
|
|
890
|
+
function re(e) {
|
|
891
|
+
D(e), k();
|
|
892
|
+
let t = r.quickSearchDebounce ?? (r.manualFiltering ? st : 0);
|
|
893
|
+
t <= 0 ? j() : O = setTimeout(() => {
|
|
894
|
+
O = void 0, j();
|
|
895
|
+
}, t);
|
|
896
|
+
}
|
|
897
|
+
g(y(T, (e) => {
|
|
898
|
+
O === void 0 && e !== E().trim() && D(e);
|
|
899
|
+
}));
|
|
900
|
+
let M = _(() => r.filters.filter((e) => ft(x()[e.key])));
|
|
901
|
+
function N(e, t) {
|
|
656
902
|
return t.getValue ? t.getValue(e) : e[t.key];
|
|
657
903
|
}
|
|
658
|
-
function
|
|
904
|
+
function P(e, t, n) {
|
|
659
905
|
if (t.match) return t.match(e, n);
|
|
660
|
-
let r =
|
|
906
|
+
let r = N(e, t);
|
|
661
907
|
if (t.type === "select") {
|
|
662
908
|
let e = Array.isArray(n) ? n : [n];
|
|
663
909
|
return (Array.isArray(r) ? r : [r]).some((t) => e.includes($(t)));
|
|
664
910
|
}
|
|
665
|
-
|
|
911
|
+
if (t.type === "boolean") return !!r == (n === "true");
|
|
912
|
+
if (t.type === "number-range" || t.type === "date-range") {
|
|
913
|
+
let { min: e, max: i } = Z($(n));
|
|
914
|
+
return (t.type === "date-range" ? _t : gt)(r, e, i);
|
|
915
|
+
}
|
|
916
|
+
return $(r).toLowerCase().includes($(n).toLowerCase());
|
|
666
917
|
}
|
|
667
|
-
function
|
|
918
|
+
function ie(e) {
|
|
668
919
|
return r.getSearchText ? r.getSearchText(e) : l.columns.map((t) => $(t.sortValue?.(e) ?? e[t.key])).join(" ");
|
|
669
920
|
}
|
|
670
|
-
let
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
921
|
+
let ae = _(() => M().map((e) => ({
|
|
922
|
+
id: e.key,
|
|
923
|
+
value: x()[e.key]
|
|
924
|
+
}))), oe = _(() => {
|
|
925
|
+
let e = r.filters.map((e) => ({
|
|
926
|
+
id: e.key,
|
|
927
|
+
accessorFn: (t) => N(t, e),
|
|
928
|
+
filterFn: (t, n, r) => P(t.original, e, r)
|
|
929
|
+
}));
|
|
930
|
+
return e.push({
|
|
931
|
+
id: lt,
|
|
932
|
+
accessorFn: ie
|
|
933
|
+
}), e;
|
|
934
|
+
}), F = te({
|
|
935
|
+
features: ut,
|
|
936
|
+
get data() {
|
|
937
|
+
return u();
|
|
938
|
+
},
|
|
939
|
+
get columns() {
|
|
940
|
+
return oe();
|
|
941
|
+
},
|
|
942
|
+
getRowId: (e) => String(l.getRowId(e)),
|
|
943
|
+
get manualFiltering() {
|
|
944
|
+
return r.manualFiltering;
|
|
945
|
+
},
|
|
946
|
+
globalFilterFn: A,
|
|
947
|
+
getColumnCanGlobalFilter: (e) => e.id === lt,
|
|
948
|
+
state: {
|
|
949
|
+
get columnFilters() {
|
|
950
|
+
return ae();
|
|
951
|
+
},
|
|
952
|
+
get globalFilter() {
|
|
953
|
+
return T();
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}), I = _(() => F.getRowModel().rows.map((e) => e.original)), se = _((e) => {
|
|
957
|
+
let t = /* @__PURE__ */ new Map();
|
|
958
|
+
for (let n of r.filters) {
|
|
959
|
+
if (n.type !== "select" || n.options) continue;
|
|
960
|
+
let i = new Set(r.manualFiltering ? e.get(n.key) : void 0);
|
|
961
|
+
for (let e of u()) {
|
|
962
|
+
let t = N(e, n);
|
|
963
|
+
for (let e of Array.isArray(t) ? t : [t]) {
|
|
964
|
+
let t = $(e);
|
|
965
|
+
t !== "" && i.add(t);
|
|
966
|
+
}
|
|
683
967
|
}
|
|
968
|
+
t.set(n.key, [...i].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })));
|
|
684
969
|
}
|
|
685
|
-
return
|
|
970
|
+
return t;
|
|
971
|
+
}, /* @__PURE__ */ new Map());
|
|
972
|
+
function ce(e) {
|
|
973
|
+
return e.options ? e.options : (se().get(e.key) ?? []).map((e) => ({
|
|
686
974
|
value: e,
|
|
687
975
|
label: e
|
|
688
976
|
}));
|
|
689
977
|
}
|
|
690
|
-
function
|
|
691
|
-
|
|
978
|
+
function le(e, t) {
|
|
979
|
+
let n = e.formatValue ?? ((e) => e), { min: r, max: i } = Z(t);
|
|
980
|
+
return i === "" ? `≥ ${n(r)}` : r === "" ? `≤ ${n(i)}` : `${n(r)} – ${n(i)}`;
|
|
981
|
+
}
|
|
982
|
+
function ue(e, t) {
|
|
983
|
+
return e.type === "boolean" ? t === "true" ? r.yesLabel ?? "Yes" : r.noLabel ?? "No" : e.type === "number-range" || e.type === "date-range" ? le(e, t) : e.type === "select" ? ce(e).find((e) => String(e.value) === t)?.label ?? t : t;
|
|
692
984
|
}
|
|
693
|
-
let
|
|
985
|
+
let de = _(() => M().flatMap((e) => {
|
|
694
986
|
let t = x()[e.key];
|
|
695
987
|
return (Array.isArray(t) ? t : [t]).map((t) => ({
|
|
696
988
|
filter: e,
|
|
697
989
|
item: t,
|
|
698
|
-
text: `${e.label}: ${
|
|
990
|
+
text: `${e.label}: ${ue(e, t)}`
|
|
699
991
|
}));
|
|
700
992
|
}));
|
|
701
|
-
function
|
|
993
|
+
function fe(e, t) {
|
|
702
994
|
let n = x()[e.key];
|
|
703
995
|
w(e.key, Array.isArray(n) ? n.filter((e) => e !== t) : "");
|
|
704
996
|
}
|
|
705
|
-
function
|
|
706
|
-
|
|
997
|
+
function pe() {
|
|
998
|
+
C({ [ot]: T() });
|
|
707
999
|
}
|
|
708
|
-
let
|
|
709
|
-
function
|
|
710
|
-
let t =
|
|
711
|
-
t &&
|
|
1000
|
+
let L = _(() => r.savedFilters === void 0 ? void 0 : Q(r.savedFilters)), me = _(() => L()?.find((e) => mt(pt(e.values), x()))), [R, z] = v(!1), [B, he] = v("");
|
|
1001
|
+
function ge(e) {
|
|
1002
|
+
let t = L()?.find((t) => t.name === e);
|
|
1003
|
+
t && (k(), D($(t.values[ot])), C(t.values));
|
|
712
1004
|
}
|
|
713
|
-
function
|
|
714
|
-
|
|
1005
|
+
function _e() {
|
|
1006
|
+
ne(), he(me()?.name ?? ""), z(!0);
|
|
715
1007
|
}
|
|
716
|
-
function
|
|
1008
|
+
function ve(e) {
|
|
717
1009
|
e.preventDefault();
|
|
718
|
-
let t =
|
|
1010
|
+
let t = B().trim();
|
|
719
1011
|
if (t === "") return;
|
|
720
|
-
let n = (
|
|
1012
|
+
let n = (L() ?? []).filter((e) => e.name !== t);
|
|
721
1013
|
r.onSavedFiltersChange?.([...n, {
|
|
722
1014
|
name: t,
|
|
723
1015
|
values: x()
|
|
724
|
-
}]),
|
|
1016
|
+
}]), z(!1);
|
|
725
1017
|
}
|
|
726
|
-
let [
|
|
727
|
-
g(
|
|
728
|
-
function
|
|
729
|
-
return
|
|
1018
|
+
let [ye, be] = v(x());
|
|
1019
|
+
g(y(x, (e) => be(e)));
|
|
1020
|
+
function xe(e) {
|
|
1021
|
+
return ye()[e];
|
|
730
1022
|
}
|
|
731
1023
|
function H(e, t) {
|
|
732
|
-
|
|
1024
|
+
be((n) => ({
|
|
733
1025
|
...n,
|
|
734
1026
|
[e]: t
|
|
735
1027
|
}));
|
|
736
1028
|
}
|
|
737
|
-
let
|
|
1029
|
+
let Se = _(() => {
|
|
738
1030
|
let e = /* @__PURE__ */ new Map([[void 0, []]]);
|
|
739
1031
|
for (let t of r.filters) e.set(t.group, [...e.get(t.group) ?? [], t]);
|
|
740
1032
|
return [...e.entries()].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
741
1033
|
name: e,
|
|
742
1034
|
filters: t
|
|
743
1035
|
}));
|
|
744
|
-
}),
|
|
745
|
-
function
|
|
746
|
-
e === "filters" &&
|
|
1036
|
+
}), Ce = ee(), U = ["results", "filters"], [W, we] = v("results"), Te = (e) => `${Ce}-tab-${e}`, Ee = (e) => `${Ce}-panel-${e}`, G = (e) => `${Ce}-filter-${e}`;
|
|
1037
|
+
function De(e) {
|
|
1038
|
+
e === "filters" && be(x()), we(e);
|
|
747
1039
|
}
|
|
748
|
-
function
|
|
1040
|
+
function Oe(e) {
|
|
749
1041
|
let t = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
750
1042
|
if (t === 0) return;
|
|
751
1043
|
e.preventDefault();
|
|
752
|
-
let n =
|
|
753
|
-
|
|
1044
|
+
let n = U[(U.indexOf(W()) + t + U.length) % U.length];
|
|
1045
|
+
De(n), document.getElementById(Te(n))?.focus();
|
|
754
1046
|
}
|
|
755
|
-
function
|
|
756
|
-
e.preventDefault(),
|
|
1047
|
+
function ke(e) {
|
|
1048
|
+
e.preventDefault(), C(ye()), we("results");
|
|
757
1049
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
1050
|
+
function Ae() {
|
|
1051
|
+
pe(), we("results");
|
|
760
1052
|
}
|
|
761
|
-
function
|
|
1053
|
+
function je(e) {
|
|
762
1054
|
let t = () => {
|
|
763
|
-
let t =
|
|
1055
|
+
let t = xe(e.key);
|
|
764
1056
|
return Array.isArray(t) ? t : [];
|
|
765
1057
|
}, o = (r) => (() => {
|
|
766
|
-
var o =
|
|
767
|
-
return a(o, () =>
|
|
1058
|
+
var o = Be(), s = o.firstChild;
|
|
1059
|
+
return a(o, () => ue(e, r), s), s.$$click = () => H(e.key, t().filter((e) => e !== r)), a(s, n(X, {
|
|
768
1060
|
size: 12,
|
|
769
1061
|
"aria-hidden": "true"
|
|
770
|
-
})), i(() => c(s, "aria-label", `Remove ${
|
|
1062
|
+
})), i(() => c(s, "aria-label", `Remove ${ue(e, r)}`)), o;
|
|
771
1063
|
})();
|
|
772
1064
|
return (() => {
|
|
773
|
-
var i =
|
|
774
|
-
return a(i, n(
|
|
1065
|
+
var i = He();
|
|
1066
|
+
return a(i, n(V, {
|
|
775
1067
|
get id() {
|
|
776
|
-
return
|
|
1068
|
+
return G(e.key);
|
|
777
1069
|
},
|
|
778
1070
|
value: "",
|
|
779
1071
|
onChange: (n) => H(e.key, [...t(), n]),
|
|
780
1072
|
get options() {
|
|
781
|
-
return
|
|
1073
|
+
return ce(e).filter((e) => !t().includes(String(e.value)));
|
|
782
1074
|
},
|
|
783
1075
|
get placeholder() {
|
|
784
1076
|
return e.placeholder ?? r.anyLabel ?? "Any";
|
|
@@ -788,7 +1080,7 @@ function Pe(e) {
|
|
|
788
1080
|
return t().length > 0;
|
|
789
1081
|
},
|
|
790
1082
|
get children() {
|
|
791
|
-
var e =
|
|
1083
|
+
var e = Ve();
|
|
792
1084
|
return a(e, n(p, {
|
|
793
1085
|
get each() {
|
|
794
1086
|
return t();
|
|
@@ -799,22 +1091,40 @@ function Pe(e) {
|
|
|
799
1091
|
}), null), i;
|
|
800
1092
|
})();
|
|
801
1093
|
}
|
|
802
|
-
function
|
|
803
|
-
|
|
804
|
-
|
|
1094
|
+
function Me(e) {
|
|
1095
|
+
let t = e.type === "date-range" ? "date" : "number", n = () => Z($(xe(e.key))), a = _(() => n().min), o = _(() => n().max), s = () => r.fromLabel ?? "From", l = () => r.toLabel ?? "To";
|
|
1096
|
+
return (() => {
|
|
1097
|
+
var n = Ue(), r = n.firstChild, u = r.nextSibling;
|
|
1098
|
+
return r.$$input = (t) => H(e.key, dt(t.currentTarget.value, o())), c(r, "type", t), u.$$input = (t) => H(e.key, dt(a(), t.currentTarget.value)), c(u, "type", t), i((t) => {
|
|
1099
|
+
var n = G(e.key), i = o() || void 0, d = `${e.label} ${s()}`, f = s(), p = a() || void 0, m = `${e.label} ${l()}`, h = l();
|
|
1100
|
+
return n !== t.e && c(r, "id", t.e = n), i !== t.t && c(r, "max", t.t = i), d !== t.a && c(r, "aria-label", t.a = d), f !== t.o && c(r, "placeholder", t.o = f), p !== t.i && c(u, "min", t.i = p), m !== t.n && c(u, "aria-label", t.n = m), h !== t.s && c(u, "placeholder", t.s = h), t;
|
|
1101
|
+
}, {
|
|
1102
|
+
e: void 0,
|
|
1103
|
+
t: void 0,
|
|
1104
|
+
a: void 0,
|
|
1105
|
+
o: void 0,
|
|
1106
|
+
i: void 0,
|
|
1107
|
+
n: void 0,
|
|
1108
|
+
s: void 0
|
|
1109
|
+
}), i(() => r.value = a()), i(() => u.value = o()), n;
|
|
1110
|
+
})();
|
|
1111
|
+
}
|
|
1112
|
+
function Ne(e) {
|
|
1113
|
+
return e.type === "number-range" || e.type === "date-range" ? Me(e) : e.type === "text" ? (() => {
|
|
1114
|
+
var t = We();
|
|
805
1115
|
return t.$$input = (t) => H(e.key, t.currentTarget.value), i((n) => {
|
|
806
|
-
var r =
|
|
1116
|
+
var r = G(e.key), i = e.placeholder;
|
|
807
1117
|
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "placeholder", n.t = i), n;
|
|
808
1118
|
}, {
|
|
809
1119
|
e: void 0,
|
|
810
1120
|
t: void 0
|
|
811
|
-
}), i(() => t.value = $(
|
|
812
|
-
})() : e.type === "boolean" ? n(
|
|
1121
|
+
}), i(() => t.value = $(xe(e.key))), t;
|
|
1122
|
+
})() : e.type === "boolean" ? n(V, {
|
|
813
1123
|
get id() {
|
|
814
|
-
return
|
|
1124
|
+
return G(e.key);
|
|
815
1125
|
},
|
|
816
1126
|
get value() {
|
|
817
|
-
return $(
|
|
1127
|
+
return $(xe(e.key));
|
|
818
1128
|
},
|
|
819
1129
|
onChange: (t) => H(e.key, t),
|
|
820
1130
|
get emptyLabel() {
|
|
@@ -829,34 +1139,36 @@ function Pe(e) {
|
|
|
829
1139
|
label: r.noLabel ?? "No"
|
|
830
1140
|
}];
|
|
831
1141
|
}
|
|
832
|
-
}) :
|
|
1142
|
+
}) : je(e);
|
|
833
1143
|
}
|
|
834
|
-
function
|
|
1144
|
+
function Pe() {
|
|
835
1145
|
return (() => {
|
|
836
|
-
var e =
|
|
837
|
-
return a(e, n(
|
|
1146
|
+
var e = Ge(), t = e.firstChild;
|
|
1147
|
+
return a(e, n(Y, {
|
|
838
1148
|
class: "filter-table-search-icon",
|
|
839
1149
|
size: 16,
|
|
840
1150
|
"aria-hidden": "true"
|
|
841
|
-
}), t), t.$$
|
|
1151
|
+
}), t), t.$$keydown = (e) => {
|
|
1152
|
+
e.key === "Enter" && ne();
|
|
1153
|
+
}, t.$$input = (e) => re(e.currentTarget.value), i((e) => {
|
|
842
1154
|
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
843
1155
|
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
844
1156
|
}, {
|
|
845
1157
|
e: void 0,
|
|
846
1158
|
t: void 0
|
|
847
|
-
}), i(() => t.value =
|
|
1159
|
+
}), i(() => t.value = E()), e;
|
|
848
1160
|
})();
|
|
849
1161
|
}
|
|
850
|
-
function
|
|
1162
|
+
function K() {
|
|
851
1163
|
return (() => {
|
|
852
|
-
var e =
|
|
853
|
-
return a(e, n(
|
|
1164
|
+
var e = Ke();
|
|
1165
|
+
return a(e, n(V, {
|
|
854
1166
|
get value() {
|
|
855
|
-
return
|
|
1167
|
+
return me()?.name ?? "";
|
|
856
1168
|
},
|
|
857
|
-
onChange:
|
|
1169
|
+
onChange: ge,
|
|
858
1170
|
get options() {
|
|
859
|
-
return (
|
|
1171
|
+
return (L() ?? []).map((e) => ({
|
|
860
1172
|
value: e.name,
|
|
861
1173
|
label: e.name
|
|
862
1174
|
}));
|
|
@@ -869,11 +1181,11 @@ function Pe(e) {
|
|
|
869
1181
|
}
|
|
870
1182
|
}), null), a(e, n(m, {
|
|
871
1183
|
get when() {
|
|
872
|
-
return
|
|
1184
|
+
return me();
|
|
873
1185
|
},
|
|
874
1186
|
children: (e) => (() => {
|
|
875
|
-
var t =
|
|
876
|
-
return t.$$click =
|
|
1187
|
+
var t = qe();
|
|
1188
|
+
return t.$$click = pe, a(t, n(X, {
|
|
877
1189
|
size: 14,
|
|
878
1190
|
"aria-hidden": "true"
|
|
879
1191
|
})), i(() => c(t, "aria-label", `${r.clearSavedFilterLabel ?? "Clear saved filter"} ${e().name}`)), t;
|
|
@@ -881,30 +1193,30 @@ function Pe(e) {
|
|
|
881
1193
|
}), null), e;
|
|
882
1194
|
})();
|
|
883
1195
|
}
|
|
884
|
-
function
|
|
1196
|
+
function Fe(e) {
|
|
885
1197
|
return (() => {
|
|
886
|
-
var t =
|
|
887
|
-
return r.$$click = () =>
|
|
1198
|
+
var t = Je(), r = t.firstChild;
|
|
1199
|
+
return r.$$click = () => fe(e.filter, e.item), a(r, () => e.text, null), a(r, n(X, {
|
|
888
1200
|
size: 12,
|
|
889
1201
|
"aria-hidden": "true"
|
|
890
1202
|
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
891
1203
|
})();
|
|
892
1204
|
}
|
|
893
|
-
function
|
|
1205
|
+
function Ie() {
|
|
894
1206
|
return (() => {
|
|
895
|
-
var e =
|
|
1207
|
+
var e = Xe(), t = e.firstChild, i = t.firstChild;
|
|
896
1208
|
return a(e, n(p, {
|
|
897
1209
|
get each() {
|
|
898
|
-
return
|
|
1210
|
+
return de();
|
|
899
1211
|
},
|
|
900
|
-
children:
|
|
901
|
-
}), t), i.$$click =
|
|
1212
|
+
children: Fe
|
|
1213
|
+
}), t), i.$$click = pe, a(i, () => r.clearAllLabel ?? "Clear all"), a(e, n(m, {
|
|
902
1214
|
get when() {
|
|
903
|
-
return o(() =>
|
|
1215
|
+
return o(() => L() !== void 0)() && !R();
|
|
904
1216
|
},
|
|
905
1217
|
get children() {
|
|
906
|
-
var e =
|
|
907
|
-
return t.$$click =
|
|
1218
|
+
var e = Ye(), t = e.firstChild;
|
|
1219
|
+
return t.$$click = _e, a(t, n(ze, {
|
|
908
1220
|
size: 12,
|
|
909
1221
|
"aria-hidden": "true"
|
|
910
1222
|
}), null), a(t, () => r.saveLabel ?? "Save", null), e;
|
|
@@ -912,74 +1224,74 @@ function Pe(e) {
|
|
|
912
1224
|
}), null), e;
|
|
913
1225
|
})();
|
|
914
1226
|
}
|
|
915
|
-
function
|
|
1227
|
+
function Le() {
|
|
916
1228
|
return (() => {
|
|
917
|
-
var e =
|
|
1229
|
+
var e = Ze(), t = e.firstChild, o = t.nextSibling, s = o.nextSibling;
|
|
918
1230
|
return e.$$keydown = (e) => {
|
|
919
|
-
e.key === "Escape" &&
|
|
920
|
-
}, e.addEventListener("submit",
|
|
1231
|
+
e.key === "Escape" && z(!1);
|
|
1232
|
+
}, e.addEventListener("submit", ve), t.$$input = (e) => he(e.currentTarget.value), f((e) => queueMicrotask(() => e.focus()), t), a(o, n(ze, {
|
|
921
1233
|
size: 16,
|
|
922
1234
|
"aria-hidden": "true"
|
|
923
|
-
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () =>
|
|
1235
|
+
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () => z(!1), a(s, () => r.cancelLabel ?? "Cancel"), i((e) => {
|
|
924
1236
|
var n = r.saveNameLabel ?? "Filter name", i = r.saveNameLabel ?? "Filter name";
|
|
925
1237
|
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
926
1238
|
}, {
|
|
927
1239
|
e: void 0,
|
|
928
1240
|
t: void 0
|
|
929
|
-
}), i(() => t.value =
|
|
1241
|
+
}), i(() => t.value = B()), e;
|
|
930
1242
|
})();
|
|
931
1243
|
}
|
|
932
|
-
let
|
|
933
|
-
var e =
|
|
1244
|
+
let q = (() => {
|
|
1245
|
+
var e = Qe();
|
|
934
1246
|
return a(e, n(m, {
|
|
935
1247
|
get when() {
|
|
936
1248
|
return r.quickSearch !== !1;
|
|
937
1249
|
},
|
|
938
1250
|
get children() {
|
|
939
|
-
return
|
|
1251
|
+
return Pe();
|
|
940
1252
|
}
|
|
941
1253
|
}), null), a(e, n(m, {
|
|
942
1254
|
get when() {
|
|
943
|
-
return (
|
|
1255
|
+
return (L()?.length ?? 0) > 0;
|
|
944
1256
|
},
|
|
945
1257
|
get children() {
|
|
946
|
-
return
|
|
1258
|
+
return K();
|
|
947
1259
|
}
|
|
948
1260
|
}), null), a(e, n(m, {
|
|
949
1261
|
get when() {
|
|
950
|
-
return
|
|
1262
|
+
return de().length > 0;
|
|
951
1263
|
},
|
|
952
1264
|
get children() {
|
|
953
|
-
return
|
|
1265
|
+
return Ie();
|
|
954
1266
|
}
|
|
955
1267
|
}), null), a(e, n(m, {
|
|
956
1268
|
get when() {
|
|
957
|
-
return o(() => !!
|
|
1269
|
+
return o(() => !!R())() && de().length > 0;
|
|
958
1270
|
},
|
|
959
1271
|
get children() {
|
|
960
|
-
return
|
|
1272
|
+
return Le();
|
|
961
1273
|
}
|
|
962
1274
|
}), null), e;
|
|
963
1275
|
})();
|
|
964
|
-
function
|
|
1276
|
+
function Re(e) {
|
|
965
1277
|
return e === "results" ? r.resultsLabel ?? "Results" : r.filtersLabel ?? "Filters";
|
|
966
1278
|
}
|
|
967
|
-
function
|
|
968
|
-
return e === "results" ?
|
|
1279
|
+
function ct(e) {
|
|
1280
|
+
return e === "results" ? Q(r.totalCount) ?? Q(l.pagination)?.rowCount ?? I().length : M().length;
|
|
969
1281
|
}
|
|
970
|
-
function
|
|
1282
|
+
function ht(e) {
|
|
971
1283
|
return (() => {
|
|
972
|
-
var t =
|
|
973
|
-
return t.$$keydown =
|
|
1284
|
+
var t = et();
|
|
1285
|
+
return t.$$keydown = Oe, t.$$click = () => De(e), a(t, () => Re(e), null), a(t, n(m, {
|
|
974
1286
|
get when() {
|
|
975
|
-
return e === "results" ||
|
|
1287
|
+
return e === "results" || M().length > 0;
|
|
976
1288
|
},
|
|
977
1289
|
get children() {
|
|
978
|
-
var t =
|
|
979
|
-
return a(t, () =>
|
|
1290
|
+
var t = $e();
|
|
1291
|
+
return a(t, () => ct(e)), t;
|
|
980
1292
|
}
|
|
981
1293
|
}), null), i((n) => {
|
|
982
|
-
var r =
|
|
1294
|
+
var r = Te(e), i = W() === e, a = Ee(e), o = W() === e ? 0 : -1;
|
|
983
1295
|
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;
|
|
984
1296
|
}, {
|
|
985
1297
|
e: void 0,
|
|
@@ -989,58 +1301,58 @@ function Pe(e) {
|
|
|
989
1301
|
}), t;
|
|
990
1302
|
})();
|
|
991
1303
|
}
|
|
992
|
-
function
|
|
1304
|
+
function vt(e) {
|
|
993
1305
|
return (() => {
|
|
994
|
-
var t =
|
|
995
|
-
return a(n, () => e.label), a(t, () =>
|
|
1306
|
+
var t = tt(), n = t.firstChild;
|
|
1307
|
+
return a(n, () => e.label), a(t, () => Ne(e), null), i(() => c(n, "for", G(e.key))), t;
|
|
996
1308
|
})();
|
|
997
1309
|
}
|
|
998
|
-
function
|
|
1310
|
+
function yt(e) {
|
|
999
1311
|
return (() => {
|
|
1000
|
-
var t =
|
|
1312
|
+
var t = rt();
|
|
1001
1313
|
return a(t, n(m, {
|
|
1002
1314
|
get when() {
|
|
1003
1315
|
return e.name;
|
|
1004
1316
|
},
|
|
1005
1317
|
get children() {
|
|
1006
|
-
var t =
|
|
1318
|
+
var t = nt();
|
|
1007
1319
|
return a(t, () => e.name), t;
|
|
1008
1320
|
}
|
|
1009
1321
|
}), null), a(t, n(p, {
|
|
1010
1322
|
get each() {
|
|
1011
1323
|
return e.filters;
|
|
1012
1324
|
},
|
|
1013
|
-
children:
|
|
1325
|
+
children: vt
|
|
1014
1326
|
}), null), t;
|
|
1015
1327
|
})();
|
|
1016
1328
|
}
|
|
1017
|
-
function
|
|
1329
|
+
function bt() {
|
|
1018
1330
|
return (() => {
|
|
1019
|
-
var e =
|
|
1020
|
-
return e.addEventListener("submit",
|
|
1331
|
+
var e = it(), t = e.firstChild, i = t.firstChild, o = i.nextSibling;
|
|
1332
|
+
return e.addEventListener("submit", ke), a(e, n(p, {
|
|
1021
1333
|
get each() {
|
|
1022
|
-
return
|
|
1334
|
+
return Se();
|
|
1023
1335
|
},
|
|
1024
|
-
children:
|
|
1025
|
-
}), t), i.$$click =
|
|
1336
|
+
children: yt
|
|
1337
|
+
}), t), i.$$click = Ae, a(i, n(X, {
|
|
1026
1338
|
size: 16,
|
|
1027
1339
|
"aria-hidden": "true"
|
|
1028
|
-
}), null), a(i, () => r.resetLabel ?? "Reset", null), a(o, n(
|
|
1340
|
+
}), null), a(i, () => r.resetLabel ?? "Reset", null), a(o, n(Y, {
|
|
1029
1341
|
size: 16,
|
|
1030
1342
|
"aria-hidden": "true"
|
|
1031
1343
|
}), null), a(o, () => r.applyLabel ?? "Search", null), e;
|
|
1032
1344
|
})();
|
|
1033
1345
|
}
|
|
1034
1346
|
return (() => {
|
|
1035
|
-
var e =
|
|
1347
|
+
var e = at(), o = e.firstChild, u = o.nextSibling, d = u.nextSibling;
|
|
1036
1348
|
return a(o, n(p, {
|
|
1037
|
-
each:
|
|
1038
|
-
children:
|
|
1039
|
-
})), a(u, n(
|
|
1040
|
-
rows:
|
|
1041
|
-
toolbar:
|
|
1042
|
-
}))), a(d,
|
|
1043
|
-
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a =
|
|
1349
|
+
each: U,
|
|
1350
|
+
children: ht
|
|
1351
|
+
})), a(u, n(J, s(l, {
|
|
1352
|
+
rows: I,
|
|
1353
|
+
toolbar: q
|
|
1354
|
+
}))), a(d, bt), i((n) => {
|
|
1355
|
+
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = Ee("results"), o = Te("results"), s = W() !== "results", l = Ee("filters"), f = Te("filters"), p = W() !== "filters";
|
|
1044
1356
|
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;
|
|
1045
1357
|
}, {
|
|
1046
1358
|
e: void 0,
|
|
@@ -1058,20 +1370,115 @@ r([
|
|
|
1058
1370
|
"input",
|
|
1059
1371
|
"keydown"
|
|
1060
1372
|
]);
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1373
|
+
// src/modal.tsx
|
|
1374
|
+
var yt = /*#__PURE__*/ d("<h2 class=modal-title>"), bt = /*#__PURE__*/ d("<button type=button class=modal-close>"), xt = /*#__PURE__*/ d("<div class=modal-header>"), St = /*#__PURE__*/ d("<div class=modal-footer>"), Ct = /*#__PURE__*/ d("<dialog><div class=modal-panel><div class=modal-body>");
|
|
1375
|
+
function wt(e) {
|
|
1376
|
+
return n(m, {
|
|
1377
|
+
get when() {
|
|
1378
|
+
return e.open;
|
|
1379
|
+
},
|
|
1380
|
+
get children() {
|
|
1381
|
+
return n(Tt, e);
|
|
1382
|
+
}
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
function Tt(e) {
|
|
1386
|
+
let r, o = ee(), s = !1, l = !1, u = !1;
|
|
1387
|
+
x(() => {
|
|
1388
|
+
if (!r) return;
|
|
1389
|
+
let e = document.activeElement;
|
|
1390
|
+
r.showModal(), b(() => {
|
|
1391
|
+
l = !0, r?.close(), e instanceof HTMLElement && e.isConnected && e.focus();
|
|
1392
|
+
});
|
|
1393
|
+
});
|
|
1394
|
+
function d() {
|
|
1395
|
+
if (u) return;
|
|
1396
|
+
let t = e.onBeforeClose?.();
|
|
1397
|
+
t instanceof Promise ? (u = !0, t.then((t) => {
|
|
1398
|
+
t !== !1 && !l && e.onClose();
|
|
1399
|
+
}).finally(() => {
|
|
1400
|
+
u = !1;
|
|
1401
|
+
})) : t !== !1 && e.onClose();
|
|
1402
|
+
}
|
|
1403
|
+
function p(t) {
|
|
1404
|
+
t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), e.closeOnEscape !== !1 && d());
|
|
1405
|
+
}
|
|
1406
|
+
return (() => {
|
|
1407
|
+
var u = Ct(), h = u.firstChild, g = h.firstChild;
|
|
1408
|
+
u.$$click = (t) => {
|
|
1409
|
+
s && t.target === r && e.closeOnBackdrop !== !1 && d(), s = !1;
|
|
1410
|
+
}, u.$$pointerdown = (e) => {
|
|
1411
|
+
s = e.target === r;
|
|
1412
|
+
}, u.addEventListener("close", () => {
|
|
1413
|
+
l || e.onClose();
|
|
1414
|
+
}), u.addEventListener("cancel", (t) => {
|
|
1415
|
+
t.preventDefault(), e.closeOnEscape !== !1 && d();
|
|
1416
|
+
}), u.$$keydown = p;
|
|
1417
|
+
var _ = r;
|
|
1418
|
+
return typeof _ == "function" ? f(_, u) : r = u, a(h, n(m, {
|
|
1419
|
+
get when() {
|
|
1420
|
+
return e.title !== void 0 || !e.hideCloseButton;
|
|
1421
|
+
},
|
|
1422
|
+
get children() {
|
|
1423
|
+
var t = xt();
|
|
1424
|
+
return a(t, n(m, {
|
|
1425
|
+
get when() {
|
|
1426
|
+
return e.title !== void 0;
|
|
1427
|
+
},
|
|
1428
|
+
get children() {
|
|
1429
|
+
var t = yt();
|
|
1430
|
+
return c(t, "id", o), a(t, () => e.title), t;
|
|
1431
|
+
}
|
|
1432
|
+
}), null), a(t, n(m, {
|
|
1433
|
+
get when() {
|
|
1434
|
+
return !e.hideCloseButton;
|
|
1435
|
+
},
|
|
1436
|
+
get children() {
|
|
1437
|
+
var t = bt();
|
|
1438
|
+
return t.$$click = d, a(t, n(X, {
|
|
1439
|
+
size: 18,
|
|
1440
|
+
"aria-hidden": "true"
|
|
1441
|
+
})), i(() => c(t, "aria-label", e.closeLabel ?? "Close")), t;
|
|
1442
|
+
}
|
|
1443
|
+
}), null), t;
|
|
1444
|
+
}
|
|
1445
|
+
}), g), a(g, () => e.children), a(h, n(m, {
|
|
1446
|
+
get when() {
|
|
1447
|
+
return e.footer !== void 0;
|
|
1448
|
+
},
|
|
1449
|
+
get children() {
|
|
1450
|
+
var t = St();
|
|
1451
|
+
return a(t, () => e.footer), t;
|
|
1452
|
+
}
|
|
1453
|
+
}), null), i((n) => {
|
|
1454
|
+
var r = e.class ? `modal ${e.class}` : "modal", i = e.title === void 0 ? void 0 : o, a = e.title === void 0 ? e.ariaLabel : void 0, s = e.describedBy;
|
|
1455
|
+
return r !== n.e && t(u, n.e = r), i !== n.t && c(u, "aria-labelledby", n.t = i), a !== n.a && c(u, "aria-label", n.a = a), s !== n.o && c(u, "aria-describedby", n.o = s), n;
|
|
1456
|
+
}, {
|
|
1457
|
+
e: void 0,
|
|
1458
|
+
t: void 0,
|
|
1459
|
+
a: void 0,
|
|
1460
|
+
o: void 0
|
|
1461
|
+
}), u;
|
|
1462
|
+
})();
|
|
1463
|
+
}
|
|
1464
|
+
r([
|
|
1465
|
+
"keydown",
|
|
1466
|
+
"pointerdown",
|
|
1467
|
+
"click"
|
|
1468
|
+
]);
|
|
1469
|
+
// src/search-bar.tsx
|
|
1470
|
+
var Et = /*#__PURE__*/ d("<kbd class=search-bar-shortcut>"), Dt = /*#__PURE__*/ d("<button type=button class=search-bar-clear>"), Ot = /*#__PURE__*/ d("<div><input class=search-bar-input>");
|
|
1471
|
+
function kt(e) {
|
|
1065
1472
|
let r, s = () => e.shortcutKey ?? "k", l = () => e.shortcutLabel ?? `Ctrl ${String(s()).toUpperCase()}`;
|
|
1066
|
-
return
|
|
1473
|
+
return x(() => {
|
|
1067
1474
|
let e = (e) => {
|
|
1068
1475
|
let t = s();
|
|
1069
1476
|
t !== !1 && r && (!(e.ctrlKey || e.metaKey) || e.altKey || e.shiftKey || e.key.toLowerCase() === t.toLowerCase() && (e.preventDefault(), r.focus(), r.select()));
|
|
1070
1477
|
};
|
|
1071
|
-
document.addEventListener("keydown", e),
|
|
1478
|
+
document.addEventListener("keydown", e), b(() => document.removeEventListener("keydown", e));
|
|
1072
1479
|
}), (() => {
|
|
1073
|
-
var u =
|
|
1074
|
-
a(u, n(
|
|
1480
|
+
var u = Ot(), d = u.firstChild;
|
|
1481
|
+
a(u, n(Y, {
|
|
1075
1482
|
size: 17,
|
|
1076
1483
|
class: "search-bar-icon",
|
|
1077
1484
|
"aria-hidden": "true"
|
|
@@ -1082,7 +1489,7 @@ function Re(e) {
|
|
|
1082
1489
|
return o(() => !e.value)() && s() !== !1;
|
|
1083
1490
|
},
|
|
1084
1491
|
get children() {
|
|
1085
|
-
var e =
|
|
1492
|
+
var e = Et();
|
|
1086
1493
|
return a(e, l), e;
|
|
1087
1494
|
}
|
|
1088
1495
|
}), null), a(u, n(m, {
|
|
@@ -1090,7 +1497,7 @@ function Re(e) {
|
|
|
1090
1497
|
return e.value;
|
|
1091
1498
|
},
|
|
1092
1499
|
get children() {
|
|
1093
|
-
var t =
|
|
1500
|
+
var t = Dt();
|
|
1094
1501
|
return t.$$click = () => e.onInput(""), a(t, n(X, {
|
|
1095
1502
|
size: 15,
|
|
1096
1503
|
"aria-hidden": "true"
|
|
@@ -1108,5 +1515,4 @@ function Re(e) {
|
|
|
1108
1515
|
})();
|
|
1109
1516
|
}
|
|
1110
1517
|
r(["input", "click"]);
|
|
1111
|
-
|
|
1112
|
-
export { L as Combobox, ue as DataTable, Pe as FilterTable, Re as SearchBar };
|
|
1518
|
+
export { ie as ColorInput, V as Combobox, J as DataTable, vt as FilterTable, wt as Modal, kt as SearchBar, Z as parseFilterTableRange };
|