@serkonda7/solid-components 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/combobox.d.ts +3 -2
- package/dist/data-table.d.ts +11 -6
- package/dist/index.js +707 -581
- package/dist/styles.css +51 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dynamic as e, className as t, createComponent as n, delegateEvents as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l,
|
|
2
|
-
import { For as
|
|
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 ee, on as y, onCleanup as b, onMount as x, splitProps as S, untrack as C } from "solid-js";
|
|
3
3
|
//#region node_modules/@tabler/icons-solidjs/dist/source/defaultAttributes.js
|
|
4
|
-
var
|
|
4
|
+
var w = {
|
|
5
5
|
outline: {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: 24,
|
|
@@ -21,7 +21,7 @@ var C = {
|
|
|
21
21
|
fill: "currentColor",
|
|
22
22
|
stroke: "none"
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, T = /*#__PURE__*/ d("<svg>"), E = /*#__PURE__*/ d("<title>"), D = (t, r, i, c) => {
|
|
25
25
|
let u = (i) => {
|
|
26
26
|
let [u, d] = S(i, [
|
|
27
27
|
"color",
|
|
@@ -31,9 +31,9 @@ var C = {
|
|
|
31
31
|
"title",
|
|
32
32
|
"children",
|
|
33
33
|
"class"
|
|
34
|
-
]), f =
|
|
34
|
+
]), f = w[t], p = u.stroke ?? u.strokeWidth;
|
|
35
35
|
return (() => {
|
|
36
|
-
var i =
|
|
36
|
+
var i = T();
|
|
37
37
|
return l(i, s(f, d, {
|
|
38
38
|
get width() {
|
|
39
39
|
return o(() => u.size != null)() ? u.size : f.width;
|
|
@@ -50,62 +50,144 @@ var C = {
|
|
|
50
50
|
}), !0, !0), a(i, (() => {
|
|
51
51
|
var e = o(() => u.title != null);
|
|
52
52
|
return () => e() && (() => {
|
|
53
|
-
var e =
|
|
53
|
+
var e = E();
|
|
54
54
|
return a(e, () => u.title), e;
|
|
55
55
|
})();
|
|
56
56
|
})(), null), a(i, () => c.map(([t, r]) => n(e, s({ component: t }, r))), null), a(i, () => u.children, null), i;
|
|
57
57
|
})();
|
|
58
58
|
};
|
|
59
59
|
return u.displayName = `${i}`, u;
|
|
60
|
-
},
|
|
61
|
-
function
|
|
62
|
-
let s, l, u =
|
|
60
|
+
}, te = D("outline", "chevron-down", "ChevronDown", [["path", { d: "M6 9l6 6l6 -6" }]]), O = D("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]), ne = /*#__PURE__*/ d("<span class=combobox-detail>"), k = /*#__PURE__*/ d("<div role=option class=combobox-option><span class=combobox-option-label>"), A = /*#__PURE__*/ d("<span class=combobox-option-icon aria-hidden=true>"), re = /*#__PURE__*/ d("<div role=option class=\"combobox-option combobox-option-add\">"), j = /*#__PURE__*/ d("<div class=combobox-list role=listbox>"), M = /*#__PURE__*/ d("<div class=combobox-empty>"), N = /*#__PURE__*/ d("<span class=combobox-value aria-hidden=true><span class=combobox-option-label></span><span class=combobox-detail>"), P = /*#__PURE__*/ d("<div><input class=combobox-input role=combobox aria-autocomplete=list autocomplete=off>"), F = /*#__PURE__*/ d("<span class=combobox-icon aria-hidden=true>");
|
|
61
|
+
function I(r) {
|
|
62
|
+
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
63
|
value: "",
|
|
64
64
|
label: r.emptyLabel
|
|
65
|
-
}, ...r.options]),
|
|
66
|
-
let e =
|
|
67
|
-
return e === "" ?
|
|
68
|
-
}),
|
|
65
|
+
}, ...r.options]), I = _(() => r.value === "" ? void 0 : D().find((e) => String(e.value) === r.value)), L = _(() => {
|
|
66
|
+
let e = C().trim().toLowerCase();
|
|
67
|
+
return e === "" ? D() : D().filter((t) => t.label.toLowerCase().includes(e) || (t.detail?.toLowerCase().includes(e) ?? !1));
|
|
68
|
+
}), ie = () => r.options.some((e) => e.detail !== void 0), R = () => L().length, ae = () => L().length + +!!r.onAdd, oe = () => !r.disabled && r.onChange !== void 0;
|
|
69
69
|
x(() => {
|
|
70
70
|
r.autofocus === !0 && s?.focus();
|
|
71
|
-
}),
|
|
72
|
-
|
|
71
|
+
}), g(() => {
|
|
72
|
+
b() && l?.querySelector(`[data-index="${T()}"]`)?.scrollIntoView({ block: "nearest" });
|
|
73
73
|
});
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
let e =
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
function
|
|
81
|
-
if (
|
|
82
|
-
r.onAdd(
|
|
74
|
+
function z() {
|
|
75
|
+
if (b() || !oe()) return;
|
|
76
|
+
w("");
|
|
77
|
+
let e = D().findIndex((e) => String(e.value) === r.value);
|
|
78
|
+
E(Math.max(e, 0)), S(!0), r.onOpen?.();
|
|
79
|
+
}
|
|
80
|
+
function B(e) {
|
|
81
|
+
if (S(!1), r.onAdd && e === R()) {
|
|
82
|
+
r.onAdd(C().trim());
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
let t =
|
|
85
|
+
let t = L()[e];
|
|
86
86
|
t && String(t.value) !== r.value && r.onChange?.(String(t.value));
|
|
87
87
|
}
|
|
88
|
-
function B(e) {
|
|
89
|
-
let t = oe();
|
|
90
|
-
S() ? t > 0 && N((E() + e + t) % t) : R();
|
|
91
|
-
}
|
|
92
88
|
function V(e) {
|
|
93
|
-
|
|
89
|
+
let t = ae();
|
|
90
|
+
b() ? t > 0 && E((T() + e + t) % t) : z();
|
|
91
|
+
}
|
|
92
|
+
function H(e) {
|
|
93
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), V(e.key === "ArrowDown" ? 1 : -1)) : b() && (e.key === "Enter" ? (e.preventDefault(), B(T())) : e.key === "Tab" ? r.onAdd && T() === R() ? S(!1) : B(T()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), S(!1)));
|
|
94
|
+
}
|
|
95
|
+
let se = () => b() ? I()?.label ?? r.emptyLabel ?? r.searchLabel ?? "Search" : r.emptyLabel ?? r.placeholder;
|
|
96
|
+
function U(t, o) {
|
|
97
|
+
return (() => {
|
|
98
|
+
var s = k(), l = s.firstChild;
|
|
99
|
+
return s.$$click = () => B(o()), s.$$mousemove = () => E(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(m, {
|
|
100
|
+
get when() {
|
|
101
|
+
return t.icon;
|
|
102
|
+
},
|
|
103
|
+
children: (t) => (() => {
|
|
104
|
+
var r = A();
|
|
105
|
+
return a(r, n(e, {
|
|
106
|
+
get component() {
|
|
107
|
+
return t();
|
|
108
|
+
},
|
|
109
|
+
size: 14
|
|
110
|
+
})), r;
|
|
111
|
+
})()
|
|
112
|
+
}), null), a(l, () => t.label, null), a(s, n(m, {
|
|
113
|
+
get when() {
|
|
114
|
+
return t.detail;
|
|
115
|
+
},
|
|
116
|
+
get children() {
|
|
117
|
+
var e = ne();
|
|
118
|
+
return a(e, () => t.detail), e;
|
|
119
|
+
}
|
|
120
|
+
}), null), i((e) => {
|
|
121
|
+
var n = y(o()), i = o(), a = String(t.value) === r.value, l = o() === T(), u = t.value === "";
|
|
122
|
+
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
|
+
}, {
|
|
124
|
+
e: void 0,
|
|
125
|
+
t: void 0,
|
|
126
|
+
a: void 0,
|
|
127
|
+
o: void 0,
|
|
128
|
+
i: void 0
|
|
129
|
+
}), s;
|
|
130
|
+
})();
|
|
131
|
+
}
|
|
132
|
+
function W() {
|
|
133
|
+
return (() => {
|
|
134
|
+
var e = re();
|
|
135
|
+
return e.$$click = () => B(R()), e.$$mousemove = () => E(R()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(O, {
|
|
136
|
+
size: 14,
|
|
137
|
+
"aria-hidden": "true"
|
|
138
|
+
}), null), a(e, () => r.addLabel ?? "Add", null), i((t) => {
|
|
139
|
+
var n = y(R()), r = R(), i = R() === T();
|
|
140
|
+
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
|
+
}, {
|
|
142
|
+
e: void 0,
|
|
143
|
+
t: void 0,
|
|
144
|
+
a: void 0
|
|
145
|
+
}), e;
|
|
146
|
+
})();
|
|
147
|
+
}
|
|
148
|
+
function G() {
|
|
149
|
+
return (() => {
|
|
150
|
+
var e = j(), t = l;
|
|
151
|
+
return typeof t == "function" ? f(t, e) : l = e, a(e, n(p, {
|
|
152
|
+
get each() {
|
|
153
|
+
return L();
|
|
154
|
+
},
|
|
155
|
+
get fallback() {
|
|
156
|
+
return (() => {
|
|
157
|
+
var e = M();
|
|
158
|
+
return a(e, () => r.noMatchesLabel ?? "No matching objects"), e;
|
|
159
|
+
})();
|
|
160
|
+
},
|
|
161
|
+
children: U
|
|
162
|
+
}), null), a(e, n(m, {
|
|
163
|
+
get when() {
|
|
164
|
+
return r.onAdd;
|
|
165
|
+
},
|
|
166
|
+
get children() {
|
|
167
|
+
return W();
|
|
168
|
+
}
|
|
169
|
+
}), null), i((t) => {
|
|
170
|
+
var n = !!ie(), r = h();
|
|
171
|
+
return n !== t.e && e.classList.toggle("combobox-list-detail", t.e = n), r !== t.t && c(e, "id", t.t = r), t;
|
|
172
|
+
}, {
|
|
173
|
+
e: void 0,
|
|
174
|
+
t: void 0
|
|
175
|
+
}), e;
|
|
176
|
+
})();
|
|
94
177
|
}
|
|
95
|
-
let ce = () => S() ? F()?.label ?? r.emptyLabel ?? r.searchLabel ?? "Search" : r.emptyLabel ?? r.placeholder;
|
|
96
178
|
return (() => {
|
|
97
|
-
var
|
|
98
|
-
|
|
179
|
+
var l = P(), u = l.firstChild;
|
|
180
|
+
u.addEventListener("blur", () => S(!1)), u.$$keydown = H, u.$$input = (e) => {
|
|
99
181
|
let t = e.currentTarget.value;
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
var
|
|
103
|
-
return typeof
|
|
182
|
+
z(), w(t), E(0);
|
|
183
|
+
}, u.$$click = z;
|
|
184
|
+
var p = s;
|
|
185
|
+
return typeof p == "function" ? f(p, u) : s = u, a(l, n(m, {
|
|
104
186
|
get when() {
|
|
105
|
-
return o(() => !
|
|
187
|
+
return o(() => !b())() && I()?.icon;
|
|
106
188
|
},
|
|
107
189
|
children: (t) => (() => {
|
|
108
|
-
var r =
|
|
190
|
+
var r = F();
|
|
109
191
|
return a(r, n(e, {
|
|
110
192
|
get component() {
|
|
111
193
|
return t();
|
|
@@ -113,97 +195,28 @@ function N(r) {
|
|
|
113
195
|
size: 14
|
|
114
196
|
})), r;
|
|
115
197
|
})()
|
|
116
|
-
}), null), a(
|
|
198
|
+
}), null), a(l, n(m, {
|
|
117
199
|
get when() {
|
|
118
|
-
return o(() => !
|
|
200
|
+
return o(() => !b())() && I()?.detail;
|
|
119
201
|
},
|
|
120
202
|
get children() {
|
|
121
|
-
var e =
|
|
122
|
-
return a(t, () =>
|
|
203
|
+
var e = N(), t = e.firstChild, n = t.nextSibling;
|
|
204
|
+
return a(t, () => I()?.label), a(n, () => I()?.detail), e;
|
|
123
205
|
}
|
|
124
|
-
}), null), a(
|
|
206
|
+
}), null), a(l, n(te, {
|
|
125
207
|
class: "combobox-chevron",
|
|
126
208
|
size: 16,
|
|
127
209
|
"aria-hidden": "true"
|
|
128
|
-
}), null), a(
|
|
210
|
+
}), null), a(l, n(m, {
|
|
129
211
|
get when() {
|
|
130
|
-
return
|
|
212
|
+
return b();
|
|
131
213
|
},
|
|
132
214
|
get children() {
|
|
133
|
-
|
|
134
|
-
return typeof o == "function" ? d(o, t) : l = t, a(t, n(f, {
|
|
135
|
-
get each() {
|
|
136
|
-
return I();
|
|
137
|
-
},
|
|
138
|
-
get fallback() {
|
|
139
|
-
return (() => {
|
|
140
|
-
var e = ie();
|
|
141
|
-
return a(e, () => r.noMatchesLabel ?? "No matching objects"), e;
|
|
142
|
-
})();
|
|
143
|
-
},
|
|
144
|
-
children: (t, o) => (() => {
|
|
145
|
-
var s = j(), l = s.firstChild;
|
|
146
|
-
return s.$$click = () => z(o()), s.$$mousemove = () => N(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(p, {
|
|
147
|
-
get when() {
|
|
148
|
-
return t.icon;
|
|
149
|
-
},
|
|
150
|
-
children: (t) => (() => {
|
|
151
|
-
var r = M();
|
|
152
|
-
return a(r, n(e, {
|
|
153
|
-
get component() {
|
|
154
|
-
return t();
|
|
155
|
-
},
|
|
156
|
-
size: 14
|
|
157
|
-
})), r;
|
|
158
|
-
})()
|
|
159
|
-
}), null), a(l, () => t.label, null), a(s, n(p, {
|
|
160
|
-
get when() {
|
|
161
|
-
return t.detail;
|
|
162
|
-
},
|
|
163
|
-
get children() {
|
|
164
|
-
var e = A();
|
|
165
|
-
return a(e, () => t.detail), e;
|
|
166
|
-
}
|
|
167
|
-
}), null), i((e) => {
|
|
168
|
-
var n = b(o()), i = o(), a = String(t.value) === r.value, l = o() === E(), u = t.value === "";
|
|
169
|
-
return n !== e.e && c(s, "id", e.e = n), i !== e.t && c(s, "data-index", e.t = i), a !== e.a && c(s, "aria-selected", e.a = a), l !== e.o && s.classList.toggle("combobox-option-active", e.o = l), u !== e.i && s.classList.toggle("combobox-option-empty", e.i = u), e;
|
|
170
|
-
}, {
|
|
171
|
-
e: void 0,
|
|
172
|
-
t: void 0,
|
|
173
|
-
a: void 0,
|
|
174
|
-
o: void 0,
|
|
175
|
-
i: void 0
|
|
176
|
-
}), s;
|
|
177
|
-
})()
|
|
178
|
-
}), null), a(t, n(p, {
|
|
179
|
-
get when() {
|
|
180
|
-
return r.onAdd;
|
|
181
|
-
},
|
|
182
|
-
get children() {
|
|
183
|
-
var e = ne();
|
|
184
|
-
return e.$$click = () => z(L()), e.$$mousemove = () => N(L()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(te, {
|
|
185
|
-
size: 14,
|
|
186
|
-
"aria-hidden": "true"
|
|
187
|
-
}), null), a(e, () => r.addLabel ?? "Add", null), i((t) => {
|
|
188
|
-
var n = b(L()), r = L(), i = L() === E();
|
|
189
|
-
return n !== t.e && c(e, "id", t.e = n), r !== t.t && c(e, "data-index", t.t = r), i !== t.a && e.classList.toggle("combobox-option-active", t.a = i), t;
|
|
190
|
-
}, {
|
|
191
|
-
e: void 0,
|
|
192
|
-
t: void 0,
|
|
193
|
-
a: void 0
|
|
194
|
-
}), e;
|
|
195
|
-
}
|
|
196
|
-
}), null), i((e) => {
|
|
197
|
-
var n = !!ae(), r = y();
|
|
198
|
-
return n !== e.e && t.classList.toggle("combobox-list-detail", e.e = n), r !== e.t && c(t, "id", e.t = r), e;
|
|
199
|
-
}, {
|
|
200
|
-
e: void 0,
|
|
201
|
-
t: void 0
|
|
202
|
-
}), t;
|
|
215
|
+
return G();
|
|
203
216
|
}
|
|
204
217
|
}), null), i((e) => {
|
|
205
|
-
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!
|
|
206
|
-
return n !== e.e && t(
|
|
218
|
+
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!b(), a = !(b() || !I()?.detail), o = !(b() || I()?.icon === void 0), s = d(), f = b(), p = h(), m = b() && ae() > 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 = se();
|
|
219
|
+
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;
|
|
207
220
|
}, {
|
|
208
221
|
e: void 0,
|
|
209
222
|
t: void 0,
|
|
@@ -220,309 +233,377 @@ function N(r) {
|
|
|
220
233
|
c: void 0,
|
|
221
234
|
w: void 0,
|
|
222
235
|
m: void 0
|
|
223
|
-
}), i(() =>
|
|
236
|
+
}), i(() => u.value = b() ? C() : I()?.label ?? ""), l;
|
|
224
237
|
})();
|
|
225
238
|
}
|
|
226
239
|
r([
|
|
240
|
+
"mousedown",
|
|
241
|
+
"mousemove",
|
|
227
242
|
"click",
|
|
228
243
|
"input",
|
|
229
|
-
"keydown"
|
|
230
|
-
"mousedown",
|
|
231
|
-
"mousemove"
|
|
244
|
+
"keydown"
|
|
232
245
|
]);
|
|
233
246
|
//#endregion
|
|
234
|
-
//#region node_modules/@tabler/icons-solidjs/dist/source/icons/
|
|
235
|
-
var
|
|
236
|
-
function
|
|
247
|
+
//#region node_modules/@tabler/icons-solidjs/dist/source/icons/IconMenu.js
|
|
248
|
+
var L = D("outline", "menu", "Menu", [["path", { d: "M4 8l16 0" }], ["path", { d: "M4 16l16 0" }]]), ie = /*#__PURE__*/ d("<li class=data-table-customizer-item draggable=true><label class=data-table-customizer-option><input type=checkbox>"), R = /*#__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>"), ae = /*#__PURE__*/ d("<div class=data-table-customizer><button type=button class=data-table-customizer-button aria-haspopup=dialog><span aria-hidden=true>⚙</span> "), oe = /*#__PURE__*/ d("<button type=button class=data-table-sort><span class=data-table-sort-indicator aria-hidden=true>"), z = /*#__PURE__*/ d("<span class=data-table-resize-handle role=separator aria-orientation=vertical tabindex=0>"), B = /*#__PURE__*/ d("<th>"), V = /*#__PURE__*/ d("<td>"), H = /*#__PURE__*/ d("<tr>"), se = /*#__PURE__*/ d("<div class=data-table-toolbar-start>"), U = /*#__PURE__*/ d("<div class=data-table-toolbar>"), W = /*#__PURE__*/ d("<th>Actions"), G = /*#__PURE__*/ d("<div><div class=data-table-scroll><table class=data-table><thead><tr></tr></thead><tbody>"), ce = /*#__PURE__*/ d("<p class=data-table-status>Loading…"), K = /*#__PURE__*/ d("<p class=data-table-status>No results.");
|
|
249
|
+
function q(e) {
|
|
237
250
|
return typeof e == "function" ? e() : e;
|
|
238
251
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
252
|
+
function J(e, t) {
|
|
253
|
+
if (t !== void 0) return {
|
|
254
|
+
width: `${t}px`,
|
|
255
|
+
"min-width": `${t}px`,
|
|
256
|
+
"max-width": `${t}px`
|
|
257
|
+
};
|
|
258
|
+
let n = (e) => typeof e == "number" ? `${e}px` : e, r = {};
|
|
259
|
+
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;
|
|
260
|
+
}
|
|
261
|
+
function le(e) {
|
|
262
|
+
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), te = () => e.visibleColumns === void 0 ? E() ?? T() : q(e.visibleColumns), O = _(() => new Set(te())), [ne, k] = v(void 0);
|
|
263
|
+
function A(t) {
|
|
245
264
|
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
265
|
return [...r, ...e.columns.filter((e) => !i.has(e))];
|
|
247
266
|
}
|
|
248
|
-
let
|
|
249
|
-
function
|
|
267
|
+
let re = _(() => A(e.columnOrder === void 0 ? ne() ?? e.defaultColumnOrder ?? [] : q(e.columnOrder))), j = _(() => re().filter((e) => e.toggleable === !1 || O().has(e.key))), M = _(() => e.columns.filter((e) => e.toggleable !== !1)), N = _(() => M().map((e) => e.key));
|
|
268
|
+
function P(e, t) {
|
|
250
269
|
return t.sortValue ? t.sortValue(e) : e[t.key];
|
|
251
270
|
}
|
|
252
|
-
function
|
|
271
|
+
function F(e, t) {
|
|
253
272
|
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 });
|
|
254
273
|
}
|
|
255
|
-
let
|
|
256
|
-
let t = r(), n =
|
|
257
|
-
if (
|
|
274
|
+
let I = _(() => {
|
|
275
|
+
let t = r(), n = y();
|
|
276
|
+
if (s || !n) return t;
|
|
258
277
|
let i = e.columns.find((e) => e.key === n);
|
|
259
278
|
if (!i) return t;
|
|
260
|
-
let a =
|
|
261
|
-
return [...t].sort((e, t) => a *
|
|
279
|
+
let a = x() === "asc" ? 1 : -1;
|
|
280
|
+
return [...t].sort((e, t) => a * F(P(e, i), P(t, i)));
|
|
262
281
|
});
|
|
263
|
-
function
|
|
264
|
-
let n =
|
|
282
|
+
function le(t) {
|
|
283
|
+
let n = y() === t, r = n && x() === "desc" ? void 0 : {
|
|
265
284
|
key: t,
|
|
266
285
|
direction: n ? "desc" : "asc"
|
|
267
286
|
};
|
|
268
|
-
|
|
287
|
+
s || d(r), e.onSort?.(t), r || e.onSortClear?.(), e.onSortChange?.(r);
|
|
269
288
|
}
|
|
270
|
-
function
|
|
289
|
+
function ue(t) {
|
|
271
290
|
let n = new Map(e.columns.map((e, t) => [e.key, t]));
|
|
272
291
|
return [...t].sort((e, t) => (n.get(e) ?? 0) - (n.get(t) ?? 0));
|
|
273
292
|
}
|
|
274
|
-
function
|
|
275
|
-
let n =
|
|
276
|
-
e.visibleColumns === void 0 &&
|
|
293
|
+
function Y(t) {
|
|
294
|
+
let n = ue(t);
|
|
295
|
+
e.visibleColumns === void 0 && D(n), e.onVisibleColumnsChange?.(n);
|
|
296
|
+
}
|
|
297
|
+
function X(e, t) {
|
|
298
|
+
let n = new Set(te());
|
|
299
|
+
t ? n.add(e) : n.delete(e), Y(N().filter((e) => n.has(e)));
|
|
277
300
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
280
|
-
t ? n.add(e) : n.delete(e), he(de().filter((e) => n.has(e)));
|
|
301
|
+
function de() {
|
|
302
|
+
Y(N());
|
|
281
303
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
304
|
+
function fe(t) {
|
|
305
|
+
e.columnOrder === void 0 && k(t), e.onColumnOrderChange?.(t);
|
|
284
306
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
307
|
+
function pe(e, t) {
|
|
308
|
+
let n = re().map((e) => e.key), r = n.indexOf(e);
|
|
309
|
+
r === -1 || t < 0 || t >= n.length || t === r || (n.splice(r, 1), n.splice(t, 0, e), fe(n));
|
|
287
310
|
}
|
|
288
|
-
function
|
|
289
|
-
|
|
290
|
-
r === -1 || t < 0 || t >= n.length || t === r || (n.splice(r, 1), n.splice(t, 0, e), ve(n));
|
|
311
|
+
function me() {
|
|
312
|
+
Y(T()), fe(A(e.defaultColumnOrder ?? []).map((e) => e.key));
|
|
291
313
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
let
|
|
295
|
-
(
|
|
314
|
+
let [Z, he] = v({}), [ge, _e] = v(), Q;
|
|
315
|
+
g(() => {
|
|
316
|
+
let e = j().map((e) => e.key);
|
|
317
|
+
if (!Q || C(ge) === void 0) return;
|
|
318
|
+
let t = C(Z);
|
|
319
|
+
if (e.every((e) => t[e] !== void 0)) return;
|
|
320
|
+
let n = { ...t };
|
|
321
|
+
for (let t of e) {
|
|
322
|
+
if (n[t] !== void 0) continue;
|
|
323
|
+
let e = Q.querySelector(`th[data-column-key="${t}"]`), r = e ? Array.prototype.indexOf.call(e.parentElement?.children, e) : -1, i = 0;
|
|
324
|
+
for (let e of Q.rows) {
|
|
325
|
+
let t = e.cells[r];
|
|
326
|
+
t && (i = Math.max(i, t.scrollWidth));
|
|
327
|
+
}
|
|
328
|
+
n[t] = Math.max(40, Math.ceil(i));
|
|
329
|
+
}
|
|
330
|
+
he(n);
|
|
331
|
+
let r = [...Q.querySelectorAll("thead th:not([data-column-key])")];
|
|
332
|
+
_e(e.reduce((e, t) => e + (n[t] ?? 0), 0) + r.reduce((e, t) => e + t.getBoundingClientRect().width, 0));
|
|
333
|
+
});
|
|
334
|
+
function ve(t, n) {
|
|
335
|
+
if (!Q) return;
|
|
336
|
+
t.preventDefault(), t.stopPropagation();
|
|
337
|
+
let r = t.currentTarget;
|
|
338
|
+
r.setPointerCapture(t.pointerId);
|
|
339
|
+
let i = t.clientX, a = Q.getBoundingClientRect().width, o = {};
|
|
340
|
+
for (let e of Q.querySelectorAll("th[data-column-key]")) o[e.dataset.columnKey] = e.getBoundingClientRect().width;
|
|
341
|
+
let s = o[n] ?? 40, c = !1;
|
|
342
|
+
function l(e) {
|
|
343
|
+
if (!c && Math.abs(e.clientX - i) < 2) return;
|
|
344
|
+
c = !0;
|
|
345
|
+
let t = Math.max(40, s + e.clientX - i);
|
|
346
|
+
he({
|
|
347
|
+
...o,
|
|
348
|
+
[n]: t
|
|
349
|
+
}), _e(a + t - s);
|
|
350
|
+
}
|
|
351
|
+
function u() {
|
|
352
|
+
r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u), c && e.onColumnWidthsChange?.(Z());
|
|
353
|
+
}
|
|
354
|
+
r.addEventListener("pointermove", l), r.addEventListener("pointerup", u), r.addEventListener("pointercancel", u);
|
|
296
355
|
}
|
|
297
|
-
function
|
|
298
|
-
|
|
356
|
+
function ye(t, n) {
|
|
357
|
+
let r = t.key === "ArrowLeft" ? -10 : t.key === "ArrowRight" ? 10 : 0;
|
|
358
|
+
if (!r || !Q) return;
|
|
359
|
+
t.preventDefault();
|
|
360
|
+
let i = {};
|
|
361
|
+
for (let e of Q.querySelectorAll("th[data-column-key]")) i[e.dataset.columnKey] = e.getBoundingClientRect().width;
|
|
362
|
+
let a = i[n] ?? 40, o = Math.max(40, a + r);
|
|
363
|
+
_e(Q.getBoundingClientRect().width + o - a), he({
|
|
364
|
+
...i,
|
|
365
|
+
[n]: o
|
|
366
|
+
}), e.onColumnWidthsChange?.(Z());
|
|
299
367
|
}
|
|
300
|
-
let [
|
|
301
|
-
|
|
302
|
-
if (!
|
|
368
|
+
let [be, xe] = v(), Se = `${ee()}-panel`, [Ce, we] = v(!1), Te;
|
|
369
|
+
g(() => {
|
|
370
|
+
if (!Ce() || !S()) return;
|
|
303
371
|
function e(e) {
|
|
304
|
-
|
|
372
|
+
Te && !Te.contains(e.target) && we(!1);
|
|
305
373
|
}
|
|
306
374
|
function t(e) {
|
|
307
|
-
e.key === "Escape" &&
|
|
375
|
+
e.key === "Escape" && we(!1);
|
|
308
376
|
}
|
|
309
377
|
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), b(() => {
|
|
310
378
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
311
379
|
});
|
|
312
380
|
});
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
X && (X.indeterminate = l().length > 0 && !te());
|
|
316
|
-
});
|
|
317
|
-
function De(t) {
|
|
318
|
-
e.onSelectionChange?.(t ? r().map(e.getRowId) : []);
|
|
381
|
+
function Ee(e) {
|
|
382
|
+
return e.toggleable === !1 || O().has(e.key);
|
|
319
383
|
}
|
|
320
|
-
function
|
|
321
|
-
|
|
322
|
-
e.onSelectionChange?.(a);
|
|
384
|
+
function De(t, n) {
|
|
385
|
+
return e.getCell?.(t, n) ?? n.getValue?.(t) ?? null;
|
|
323
386
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
387
|
+
function Oe(e) {
|
|
388
|
+
if (e.sortable) return y() === e.key ? x() === "asc" ? "ascending" : "descending" : "none";
|
|
326
389
|
}
|
|
327
|
-
function
|
|
328
|
-
return e.
|
|
390
|
+
function ke(e) {
|
|
391
|
+
return y() === e.key ? x() === "asc" ? "▲" : "▼" : "";
|
|
329
392
|
}
|
|
330
|
-
|
|
331
|
-
|
|
393
|
+
let Ae = (t) => !!t.sortable && (!s || !!(e.onSort || e.onSortChange));
|
|
394
|
+
function je(e, t) {
|
|
395
|
+
xe(t.key), e.dataTransfer?.setData("text/plain", t.key), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
396
|
+
}
|
|
397
|
+
function Me(e, t) {
|
|
398
|
+
let n = be();
|
|
399
|
+
n !== void 0 && (e.preventDefault(), pe(n, t));
|
|
400
|
+
}
|
|
401
|
+
function $(e, t) {
|
|
402
|
+
return (() => {
|
|
403
|
+
var r = ie(), o = r.firstChild, s = o.firstChild;
|
|
404
|
+
return r.addEventListener("dragend", () => xe(void 0)), r.addEventListener("drop", (e) => e.preventDefault()), r.addEventListener("dragover", (e) => Me(e, t())), r.addEventListener("dragstart", (t) => je(t, e)), a(r, n(L, {
|
|
405
|
+
class: "data-table-customizer-grip",
|
|
406
|
+
size: 14,
|
|
407
|
+
"aria-hidden": "true"
|
|
408
|
+
}), o), s.addEventListener("change", (t) => X(e.key, t.currentTarget.checked)), a(o, () => e.ariaLabel ?? e.label, null), i((t) => {
|
|
409
|
+
var n = be() === e.key, i = e.toggleable === !1;
|
|
410
|
+
return n !== t.e && r.classList.toggle("data-table-customizer-item-dragging", t.e = n), i !== t.t && (s.disabled = t.t = i), t;
|
|
411
|
+
}, {
|
|
412
|
+
e: void 0,
|
|
413
|
+
t: void 0
|
|
414
|
+
}), i(() => s.checked = Ee(e)), r;
|
|
415
|
+
})();
|
|
416
|
+
}
|
|
417
|
+
function Ne() {
|
|
418
|
+
return (() => {
|
|
419
|
+
var t = R(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
420
|
+
return c(t, "id", Se), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(p, {
|
|
421
|
+
get each() {
|
|
422
|
+
return re();
|
|
423
|
+
},
|
|
424
|
+
children: (e, t) => $(e, t)
|
|
425
|
+
})), s.$$click = de, a(s, () => e.columnCustomizerShowAllLabel ?? "Show all"), l.$$click = me, a(l, () => e.columnCustomizerResetLabel ?? "Reset"), i(() => c(t, "aria-label", e.columnCustomizerTitle ?? "Customize columns")), t;
|
|
426
|
+
})();
|
|
427
|
+
}
|
|
428
|
+
function Pe() {
|
|
429
|
+
return (() => {
|
|
430
|
+
var t = ae(), r = t.firstChild;
|
|
431
|
+
r.firstChild.nextSibling;
|
|
432
|
+
var o = Te;
|
|
433
|
+
return typeof o == "function" ? f(o, t) : Te = t, r.$$click = () => we((e) => !e), c(r, "aria-controls", Se), a(r, () => e.columnCustomizerLabel ?? "Columns", null), a(t, n(m, {
|
|
434
|
+
get when() {
|
|
435
|
+
return Ce();
|
|
436
|
+
},
|
|
437
|
+
get children() {
|
|
438
|
+
return Ne();
|
|
439
|
+
}
|
|
440
|
+
}), null), i(() => c(r, "aria-expanded", Ce())), t;
|
|
441
|
+
})();
|
|
442
|
+
}
|
|
443
|
+
function Fe(r) {
|
|
444
|
+
return (() => {
|
|
445
|
+
var o = B();
|
|
446
|
+
return a(o, n(m, {
|
|
447
|
+
get when() {
|
|
448
|
+
return Ae(r);
|
|
449
|
+
},
|
|
450
|
+
get fallback() {
|
|
451
|
+
return r.label;
|
|
452
|
+
},
|
|
453
|
+
get children() {
|
|
454
|
+
var e = oe(), t = e.firstChild;
|
|
455
|
+
return e.$$click = () => le(r.key), a(e, () => r.label, t), a(t, () => ke(r)), e;
|
|
456
|
+
}
|
|
457
|
+
}), null), a(o, n(m, {
|
|
458
|
+
get when() {
|
|
459
|
+
return e.resizableColumns;
|
|
460
|
+
},
|
|
461
|
+
get children() {
|
|
462
|
+
var e = z();
|
|
463
|
+
return e.$$keydown = (e) => ye(e, r.key), e.$$pointerdown = (e) => ve(e, r.key), i(() => c(e, "aria-label", `Resize ${r.ariaLabel ?? r.label}`)), e;
|
|
464
|
+
}
|
|
465
|
+
}), null), i((e) => {
|
|
466
|
+
var n = r.class, i = r.key, a = J(r, Z()[r.key]), s = Oe(r);
|
|
467
|
+
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;
|
|
468
|
+
}, {
|
|
469
|
+
e: void 0,
|
|
470
|
+
t: void 0,
|
|
471
|
+
a: void 0,
|
|
472
|
+
o: void 0
|
|
473
|
+
}), o;
|
|
474
|
+
})();
|
|
475
|
+
}
|
|
476
|
+
function Ie(r) {
|
|
477
|
+
return (() => {
|
|
478
|
+
var o = H();
|
|
479
|
+
return a(o, n(p, {
|
|
480
|
+
get each() {
|
|
481
|
+
return j();
|
|
482
|
+
},
|
|
483
|
+
children: (e) => (() => {
|
|
484
|
+
var n = V();
|
|
485
|
+
return a(n, () => De(r, e)), i((r) => {
|
|
486
|
+
var i = e.class, a = J(e, Z()[e.key]);
|
|
487
|
+
return i !== r.e && t(n, r.e = i), r.t = u(n, a, r.t), r;
|
|
488
|
+
}, {
|
|
489
|
+
e: void 0,
|
|
490
|
+
t: void 0
|
|
491
|
+
}), n;
|
|
492
|
+
})()
|
|
493
|
+
}), null), a(o, n(m, {
|
|
494
|
+
get when() {
|
|
495
|
+
return e.rowActions;
|
|
496
|
+
},
|
|
497
|
+
get children() {
|
|
498
|
+
var t = V();
|
|
499
|
+
return a(t, () => e.rowActions?.(r)), t;
|
|
500
|
+
}
|
|
501
|
+
}), null), o;
|
|
502
|
+
})();
|
|
332
503
|
}
|
|
504
|
+
let Le = () => !o() && (e.empty === void 0 ? r().length === 0 : q(e.empty));
|
|
333
505
|
return (() => {
|
|
334
|
-
var
|
|
335
|
-
|
|
506
|
+
var r = G(), s = r.firstChild, c = s.firstChild, l = c.firstChild, d = l.firstChild, h = l.nextSibling;
|
|
507
|
+
a(r, n(m, {
|
|
336
508
|
get when() {
|
|
337
|
-
return
|
|
509
|
+
return S() || w.toArray().length > 0;
|
|
338
510
|
},
|
|
339
511
|
get children() {
|
|
340
|
-
var
|
|
341
|
-
return a(
|
|
512
|
+
var e = U();
|
|
513
|
+
return a(e, n(m, {
|
|
342
514
|
get when() {
|
|
343
|
-
return
|
|
515
|
+
return w.toArray().length > 0;
|
|
344
516
|
},
|
|
345
517
|
get children() {
|
|
346
|
-
var e =
|
|
347
|
-
return a(e,
|
|
518
|
+
var e = se();
|
|
519
|
+
return a(e, w), e;
|
|
348
520
|
}
|
|
349
|
-
}), null), a(
|
|
521
|
+
}), null), a(e, n(m, {
|
|
350
522
|
get when() {
|
|
351
|
-
return
|
|
523
|
+
return S();
|
|
352
524
|
},
|
|
353
525
|
get children() {
|
|
354
|
-
|
|
355
|
-
r.firstChild.nextSibling;
|
|
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, {
|
|
358
|
-
get when() {
|
|
359
|
-
return Te();
|
|
360
|
-
},
|
|
361
|
-
get children() {
|
|
362
|
-
var t = ae(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
363
|
-
return c(t, "id", we), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(f, {
|
|
364
|
-
get each() {
|
|
365
|
-
return M();
|
|
366
|
-
},
|
|
367
|
-
children: (t, r) => (() => {
|
|
368
|
-
var o = B(), s = o.firstChild, l = s.firstChild, u = s.nextSibling, d = u.nextSibling;
|
|
369
|
-
return o.addEventListener("dragend", () => Ce(void 0)), o.addEventListener("drop", (e) => e.preventDefault()), o.addEventListener("dragover", (e) => {
|
|
370
|
-
let t = Se();
|
|
371
|
-
t !== void 0 && (e.preventDefault(), ye(t, r()));
|
|
372
|
-
}), o.addEventListener("dragstart", (e) => {
|
|
373
|
-
Ce(t.key), e.dataTransfer?.setData("text/plain", t.key), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
374
|
-
}), a(o, n(F, {
|
|
375
|
-
class: "data-table-customizer-grip",
|
|
376
|
-
size: 14,
|
|
377
|
-
"aria-hidden": "true"
|
|
378
|
-
}), s), l.addEventListener("change", (e) => ge(t.key, e.currentTarget.checked)), a(s, () => t.ariaLabel ?? t.label, null), u.$$click = (e) => be(e.currentTarget, t.key, -1), a(u, n(P, {
|
|
379
|
-
size: 14,
|
|
380
|
-
"aria-hidden": "true"
|
|
381
|
-
})), d.$$click = (e) => be(e.currentTarget, t.key, 1), a(d, n(ee, {
|
|
382
|
-
size: 14,
|
|
383
|
-
"aria-hidden": "true"
|
|
384
|
-
})), i((n) => {
|
|
385
|
-
var i = Se() === t.key, a = t.toggleable === !1, s = `${e.columnCustomizerMoveUpLabel ?? "Move up"}: ${t.ariaLabel ?? t.label}`, f = r() === 0, p = `${e.columnCustomizerMoveDownLabel ?? "Move down"}: ${t.ariaLabel ?? t.label}`, m = r() === M().length - 1;
|
|
386
|
-
return i !== n.e && o.classList.toggle("data-table-customizer-item-dragging", n.e = i), a !== n.t && (l.disabled = n.t = a), s !== n.a && c(u, "aria-label", n.a = s), f !== n.o && (u.disabled = n.o = f), p !== n.i && c(d, "aria-label", n.i = p), m !== n.n && (d.disabled = n.n = m), n;
|
|
387
|
-
}, {
|
|
388
|
-
e: void 0,
|
|
389
|
-
t: void 0,
|
|
390
|
-
a: void 0,
|
|
391
|
-
o: void 0,
|
|
392
|
-
i: void 0,
|
|
393
|
-
n: void 0
|
|
394
|
-
}), i(() => l.checked = Ae(t)), o;
|
|
395
|
-
})()
|
|
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;
|
|
397
|
-
}
|
|
398
|
-
}), null), i(() => c(r, "aria-expanded", Te())), t;
|
|
526
|
+
return Pe();
|
|
399
527
|
}
|
|
400
|
-
}), null),
|
|
401
|
-
}
|
|
402
|
-
}), m), a(g, n(p, {
|
|
403
|
-
get when() {
|
|
404
|
-
return E();
|
|
405
|
-
},
|
|
406
|
-
get children() {
|
|
407
|
-
var t = se(), n = t.firstChild.nextSibling;
|
|
408
|
-
n.addEventListener("change", (e) => De(e.currentTarget.checked));
|
|
409
|
-
var r = X;
|
|
410
|
-
return typeof r == "function" ? d(r, n) : X = n, i(() => c(n, "aria-label", e.selectionLabel ?? "Select all rows")), i(() => n.checked = te()), t;
|
|
528
|
+
}), null), e;
|
|
411
529
|
}
|
|
412
|
-
}),
|
|
530
|
+
}), s);
|
|
531
|
+
var g = Q;
|
|
532
|
+
return typeof g == "function" ? f(g, c) : Q = c, a(d, n(p, {
|
|
413
533
|
get each() {
|
|
414
|
-
return
|
|
534
|
+
return j();
|
|
415
535
|
},
|
|
416
|
-
children:
|
|
417
|
-
|
|
418
|
-
return a(s, n(p, {
|
|
419
|
-
get when() {
|
|
420
|
-
return o(() => !!r.sortable)() && (!u || e.onSort || e.onSortChange);
|
|
421
|
-
},
|
|
422
|
-
get fallback() {
|
|
423
|
-
return r.label;
|
|
424
|
-
},
|
|
425
|
-
get children() {
|
|
426
|
-
var e = V(), t = e.firstChild;
|
|
427
|
-
return e.$$click = () => pe(r.key), a(e, () => r.label, t), a(t, (() => {
|
|
428
|
-
var e = o(() => S() === r.key);
|
|
429
|
-
return () => e() ? C() === "asc" ? "▲" : "▼" : "";
|
|
430
|
-
})()), e;
|
|
431
|
-
}
|
|
432
|
-
})), i((e) => {
|
|
433
|
-
var n = r.class, i = r.sortable ? S() === r.key ? C() === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
434
|
-
return n !== e.e && t(s, e.e = n), i !== e.t && c(s, "aria-sort", e.t = i), e;
|
|
435
|
-
}, {
|
|
436
|
-
e: void 0,
|
|
437
|
-
t: void 0
|
|
438
|
-
}), s;
|
|
439
|
-
})()
|
|
440
|
-
}), null), a(g, n(p, {
|
|
536
|
+
children: Fe
|
|
537
|
+
}), null), a(d, n(m, {
|
|
441
538
|
get when() {
|
|
442
539
|
return e.rowActions;
|
|
443
540
|
},
|
|
444
541
|
get children() {
|
|
445
|
-
return
|
|
542
|
+
return W();
|
|
446
543
|
}
|
|
447
|
-
}), null), a(
|
|
544
|
+
}), null), a(h, n(p, {
|
|
448
545
|
get each() {
|
|
449
|
-
return
|
|
546
|
+
return I();
|
|
450
547
|
},
|
|
451
|
-
children:
|
|
452
|
-
|
|
453
|
-
return a(o, n(p, {
|
|
454
|
-
get when() {
|
|
455
|
-
return E();
|
|
456
|
-
},
|
|
457
|
-
get children() {
|
|
458
|
-
var t = le(), n = t.firstChild;
|
|
459
|
-
return n.addEventListener("change", (e) => Oe(r, e.currentTarget.checked)), i(() => c(n, "aria-label", `Select row ${e.getRowId(r)}`)), i(() => n.checked = ke(r)), t;
|
|
460
|
-
}
|
|
461
|
-
}), null), a(o, n(f, {
|
|
462
|
-
get each() {
|
|
463
|
-
return N();
|
|
464
|
-
},
|
|
465
|
-
children: (e) => (() => {
|
|
466
|
-
var n = H();
|
|
467
|
-
return a(n, () => Z(r, e)), i(() => t(n, e.class)), n;
|
|
468
|
-
})()
|
|
469
|
-
}), null), a(o, n(p, {
|
|
470
|
-
get when() {
|
|
471
|
-
return e.rowActions;
|
|
472
|
-
},
|
|
473
|
-
get children() {
|
|
474
|
-
var t = H();
|
|
475
|
-
return a(t, () => e.rowActions?.(r)), t;
|
|
476
|
-
}
|
|
477
|
-
}), null), o;
|
|
478
|
-
})()
|
|
479
|
-
})), a(l, n(p, {
|
|
548
|
+
children: Ie
|
|
549
|
+
})), a(r, n(m, {
|
|
480
550
|
get when() {
|
|
481
|
-
return
|
|
551
|
+
return o();
|
|
482
552
|
},
|
|
483
553
|
get children() {
|
|
484
|
-
return e.loadingContent ??
|
|
554
|
+
return e.loadingContent ?? ce();
|
|
485
555
|
}
|
|
486
|
-
}), null), a(
|
|
556
|
+
}), null), a(r, n(m, {
|
|
487
557
|
get when() {
|
|
488
|
-
return
|
|
558
|
+
return Le();
|
|
489
559
|
},
|
|
490
560
|
get children() {
|
|
491
|
-
return e.emptyContent ??
|
|
561
|
+
return e.emptyContent ?? K();
|
|
492
562
|
}
|
|
493
|
-
}), null), i(() =>
|
|
563
|
+
}), null), i((n) => {
|
|
564
|
+
var i = `data-table-wrap${e.class ? ` ${e.class}` : ""}`, a = ge() !== void 0, o = ge() === void 0 ? void 0 : { width: `${ge()}px` };
|
|
565
|
+
return i !== n.e && t(r, n.e = i), a !== n.t && c.classList.toggle("data-table-resized", n.t = a), n.a = u(c, o, n.a), n;
|
|
566
|
+
}, {
|
|
567
|
+
e: void 0,
|
|
568
|
+
t: void 0,
|
|
569
|
+
a: void 0
|
|
570
|
+
}), r;
|
|
494
571
|
})();
|
|
495
572
|
}
|
|
496
|
-
r([
|
|
573
|
+
r([
|
|
574
|
+
"click",
|
|
575
|
+
"pointerdown",
|
|
576
|
+
"keydown"
|
|
577
|
+
]);
|
|
497
578
|
//#endregion
|
|
498
579
|
//#region node_modules/@tabler/icons-solidjs/dist/source/icons/IconDeviceFloppy.js
|
|
499
|
-
var
|
|
580
|
+
var ue = D("outline", "device-floppy", "DeviceFloppy", [
|
|
500
581
|
["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
582
|
["path", { d: "M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }],
|
|
502
583
|
["path", { d: "M14 4l0 4l-6 0l0 -4" }]
|
|
503
|
-
]),
|
|
584
|
+
]), Y = D("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 = D("outline", "x", "X", [["path", { d: "M18 6l-12 12" }], ["path", { d: "M6 6l12 12" }]]), de = /*#__PURE__*/ d("<li class=filter-table-chip><button type=button class=filter-table-chip-remove>"), fe = /*#__PURE__*/ d("<ul class=filter-table-chips>"), pe = /*#__PURE__*/ d("<div class=filter-table-multi>"), me = /*#__PURE__*/ d("<input class=filter-table-input type=text>"), Z = /*#__PURE__*/ d("<div class=filter-table-search><input type=search class=filter-table-input>"), he = /*#__PURE__*/ d("<div class=filter-table-saved>"), ge = /*#__PURE__*/ d("<button type=button class=filter-table-chip-remove>"), _e = /*#__PURE__*/ d("<li><button type=button class=filter-table-pill>"), Q = /*#__PURE__*/ d("<li><button type=button class=\"filter-table-pill filter-table-pill-save\">"), ve = /*#__PURE__*/ d("<ul class=filter-table-pills aria-label=\"Applied filters\"><li><button type=button class=\"filter-table-pill filter-table-pill-clear\">"), ye = /*#__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>"), be = /*#__PURE__*/ d("<div class=filter-table-toolbar>"), xe = /*#__PURE__*/ d("<span class=filter-table-badge>"), Se = /*#__PURE__*/ d("<button type=button role=tab class=filter-table-tab>"), Ce = /*#__PURE__*/ d("<div class=filter-table-field><label class=filter-table-label>"), we = /*#__PURE__*/ d("<legend class=filter-table-legend>"), Te = /*#__PURE__*/ d("<fieldset class=filter-table-fieldset>"), Ee = /*#__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\">"), De = /*#__PURE__*/ d("<div><div class=filter-table-tabs role=tablist></div><div role=tabpanel></div><div role=tabpanel>"), Oe = "q";
|
|
504
585
|
function ke(e) {
|
|
505
586
|
return typeof e == "function" ? e() : e;
|
|
506
587
|
}
|
|
507
588
|
function Ae(e) {
|
|
508
589
|
return Array.isArray(e) ? e.length > 0 : (e ?? "").trim() !== "";
|
|
509
590
|
}
|
|
510
|
-
function
|
|
591
|
+
function je(e) {
|
|
511
592
|
let t = {};
|
|
512
593
|
for (let [n, r] of Object.entries(e)) Ae(r) && (t[n] = Array.isArray(r) ? r : r.trim());
|
|
513
594
|
return t;
|
|
514
595
|
}
|
|
515
|
-
function
|
|
596
|
+
function Me(e, t) {
|
|
516
597
|
let n = Object.keys(e);
|
|
517
598
|
return n.length === Object.keys(t).length && n.every((n) => {
|
|
518
599
|
let r = e[n], i = t[n];
|
|
519
600
|
return Array.isArray(r) && Array.isArray(i) ? r.length === i.length && r.every((e) => i.includes(e)) : r === i;
|
|
520
601
|
});
|
|
521
602
|
}
|
|
522
|
-
function
|
|
603
|
+
function $(e) {
|
|
523
604
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
524
605
|
}
|
|
525
|
-
function
|
|
606
|
+
function Ne(e) {
|
|
526
607
|
let [r, l] = S(e, [
|
|
527
608
|
"rows",
|
|
528
609
|
"filters",
|
|
@@ -549,45 +630,45 @@ function $(e) {
|
|
|
549
630
|
"cancelLabel",
|
|
550
631
|
"clearSavedFilterLabel",
|
|
551
632
|
"class"
|
|
552
|
-
]), u =
|
|
553
|
-
function
|
|
554
|
-
let t =
|
|
555
|
-
r.filterValues === void 0 &&
|
|
556
|
-
}
|
|
557
|
-
function
|
|
558
|
-
|
|
559
|
-
...
|
|
633
|
+
]), u = _(() => ke(r.rows)), [d, h] = v(je(r.defaultFilterValues ?? {})), b = _(() => r.filterValues === void 0 ? d() : je(ke(r.filterValues)));
|
|
634
|
+
function x(e) {
|
|
635
|
+
let t = je(e);
|
|
636
|
+
r.filterValues === void 0 && h(t), r.onFilterValuesChange?.(t);
|
|
637
|
+
}
|
|
638
|
+
function C(e, t) {
|
|
639
|
+
x({
|
|
640
|
+
...b(),
|
|
560
641
|
[e]: t
|
|
561
642
|
});
|
|
562
643
|
}
|
|
563
|
-
let
|
|
564
|
-
function
|
|
644
|
+
let w = () => $(b()[Oe]), T = _(() => r.filters.filter((e) => Ae(b()[e.key])));
|
|
645
|
+
function E(e, t) {
|
|
565
646
|
return t.getValue ? t.getValue(e) : e[t.key];
|
|
566
647
|
}
|
|
567
|
-
function
|
|
648
|
+
function D(e, t, n) {
|
|
568
649
|
if (t.match) return t.match(e, n);
|
|
569
|
-
let r =
|
|
650
|
+
let r = E(e, t);
|
|
570
651
|
if (t.type === "select") {
|
|
571
652
|
let e = Array.isArray(n) ? n : [n];
|
|
572
|
-
return (Array.isArray(r) ? r : [r]).some((t) => e.includes(
|
|
653
|
+
return (Array.isArray(r) ? r : [r]).some((t) => e.includes($(t)));
|
|
573
654
|
}
|
|
574
|
-
return t.type === "boolean" ? !!r == (n === "true") :
|
|
655
|
+
return t.type === "boolean" ? !!r == (n === "true") : $(r).toLowerCase().includes($(n).toLowerCase());
|
|
575
656
|
}
|
|
576
|
-
function
|
|
577
|
-
return r.getSearchText ? r.getSearchText(e) : l.columns.map((t) =>
|
|
657
|
+
function te(e) {
|
|
658
|
+
return r.getSearchText ? r.getSearchText(e) : l.columns.map((t) => $(t.sortValue?.(e) ?? e[t.key])).join(" ");
|
|
578
659
|
}
|
|
579
|
-
let
|
|
660
|
+
let O = _(() => {
|
|
580
661
|
if (r.manualFiltering) return u();
|
|
581
|
-
let e =
|
|
582
|
-
return u().filter((n) => (e === "" ||
|
|
662
|
+
let e = w().toLowerCase(), t = T();
|
|
663
|
+
return u().filter((n) => (e === "" || te(n).toLowerCase().includes(e)) && t.every((e) => D(n, e, b()[e.key])));
|
|
583
664
|
});
|
|
584
|
-
function
|
|
665
|
+
function ne(e) {
|
|
585
666
|
if (e.options) return e.options;
|
|
586
667
|
let t = /* @__PURE__ */ new Set();
|
|
587
668
|
for (let n of u()) {
|
|
588
|
-
let r =
|
|
669
|
+
let r = E(n, e);
|
|
589
670
|
for (let e of Array.isArray(r) ? r : [r]) {
|
|
590
|
-
let n =
|
|
671
|
+
let n = $(e);
|
|
591
672
|
n !== "" && t.add(n);
|
|
592
673
|
}
|
|
593
674
|
}
|
|
@@ -596,96 +677,136 @@ function $(e) {
|
|
|
596
677
|
label: e
|
|
597
678
|
}));
|
|
598
679
|
}
|
|
599
|
-
function
|
|
600
|
-
return e.type === "boolean" ? t === "true" ? r.yesLabel ?? "Yes" : r.noLabel ?? "No" : e.type === "select" ?
|
|
680
|
+
function k(e, t) {
|
|
681
|
+
return e.type === "boolean" ? t === "true" ? r.yesLabel ?? "Yes" : r.noLabel ?? "No" : e.type === "select" ? ne(e).find((e) => String(e.value) === t)?.label ?? t : t;
|
|
601
682
|
}
|
|
602
|
-
let
|
|
603
|
-
let t =
|
|
683
|
+
let A = _(() => T().flatMap((e) => {
|
|
684
|
+
let t = b()[e.key];
|
|
604
685
|
return (Array.isArray(t) ? t : [t]).map((t) => ({
|
|
605
686
|
filter: e,
|
|
606
687
|
item: t,
|
|
607
|
-
text: `${e.label}: ${
|
|
688
|
+
text: `${e.label}: ${k(e, t)}`
|
|
608
689
|
}));
|
|
609
690
|
}));
|
|
610
|
-
function
|
|
611
|
-
let n =
|
|
612
|
-
|
|
691
|
+
function re(e, t) {
|
|
692
|
+
let n = b()[e.key];
|
|
693
|
+
C(e.key, Array.isArray(n) ? n.filter((e) => e !== t) : "");
|
|
613
694
|
}
|
|
614
|
-
function
|
|
615
|
-
|
|
695
|
+
function j() {
|
|
696
|
+
x({ [Oe]: w() });
|
|
616
697
|
}
|
|
617
|
-
let
|
|
618
|
-
function
|
|
619
|
-
let t =
|
|
620
|
-
t &&
|
|
698
|
+
let M = _(() => r.savedFilters === void 0 ? void 0 : ke(r.savedFilters)), N = _(() => M()?.find((e) => Me(je(e.values), b()))), [P, F] = v(!1), [L, ie] = v("");
|
|
699
|
+
function R(e) {
|
|
700
|
+
let t = M()?.find((t) => t.name === e);
|
|
701
|
+
t && x(t.values);
|
|
621
702
|
}
|
|
622
|
-
function
|
|
623
|
-
|
|
703
|
+
function ae() {
|
|
704
|
+
ie(N()?.name ?? ""), F(!0);
|
|
624
705
|
}
|
|
625
|
-
function
|
|
706
|
+
function oe(e) {
|
|
626
707
|
e.preventDefault();
|
|
627
|
-
let t =
|
|
708
|
+
let t = L().trim();
|
|
628
709
|
if (t === "") return;
|
|
629
|
-
let n = (
|
|
710
|
+
let n = (M() ?? []).filter((e) => e.name !== t);
|
|
630
711
|
r.onSavedFiltersChange?.([...n, {
|
|
631
712
|
name: t,
|
|
632
|
-
values:
|
|
713
|
+
values: b()
|
|
633
714
|
}]), F(!1);
|
|
634
715
|
}
|
|
635
|
-
let [
|
|
636
|
-
|
|
637
|
-
function
|
|
638
|
-
return
|
|
716
|
+
let [z, B] = v(b());
|
|
717
|
+
g(y(b, (e) => B(e)));
|
|
718
|
+
function V(e) {
|
|
719
|
+
return z()[e];
|
|
639
720
|
}
|
|
640
|
-
function
|
|
641
|
-
|
|
721
|
+
function H(e, t) {
|
|
722
|
+
B((n) => ({
|
|
642
723
|
...n,
|
|
643
724
|
[e]: t
|
|
644
725
|
}));
|
|
645
726
|
}
|
|
646
|
-
let
|
|
727
|
+
let se = _(() => {
|
|
647
728
|
let e = /* @__PURE__ */ new Map([[void 0, []]]);
|
|
648
729
|
for (let t of r.filters) e.set(t.group, [...e.get(t.group) ?? [], t]);
|
|
649
730
|
return [...e.entries()].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
650
731
|
name: e,
|
|
651
732
|
filters: t
|
|
652
733
|
}));
|
|
653
|
-
}),
|
|
654
|
-
function Me(e) {
|
|
655
|
-
e === "filters" && z(x()), W(e);
|
|
656
|
-
}
|
|
734
|
+
}), U = ee(), W = ["results", "filters"], [G, ce] = v("results"), K = (e) => `${U}-tab-${e}`, q = (e) => `${U}-panel-${e}`, J = (e) => `${U}-filter-${e}`;
|
|
657
735
|
function Ne(e) {
|
|
736
|
+
e === "filters" && B(b()), ce(e);
|
|
737
|
+
}
|
|
738
|
+
function Pe(e) {
|
|
658
739
|
let t = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
659
740
|
if (t === 0) return;
|
|
660
741
|
e.preventDefault();
|
|
661
|
-
let n =
|
|
662
|
-
|
|
742
|
+
let n = W[(W.indexOf(G()) + t + W.length) % W.length];
|
|
743
|
+
Ne(n), document.getElementById(K(n))?.focus();
|
|
663
744
|
}
|
|
664
|
-
function
|
|
665
|
-
e.preventDefault(),
|
|
745
|
+
function Fe(e) {
|
|
746
|
+
e.preventDefault(), x(z()), ce("results");
|
|
666
747
|
}
|
|
667
|
-
function
|
|
668
|
-
|
|
748
|
+
function Ie() {
|
|
749
|
+
j(), ce("results");
|
|
669
750
|
}
|
|
670
|
-
function
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
return
|
|
674
|
-
|
|
751
|
+
function Le(e) {
|
|
752
|
+
let t = () => {
|
|
753
|
+
let t = V(e.key);
|
|
754
|
+
return Array.isArray(t) ? t : [];
|
|
755
|
+
}, o = (r) => (() => {
|
|
756
|
+
var o = de(), s = o.firstChild;
|
|
757
|
+
return a(o, () => k(e, r), s), s.$$click = () => H(e.key, t().filter((e) => e !== r)), a(s, n(X, {
|
|
758
|
+
size: 12,
|
|
759
|
+
"aria-hidden": "true"
|
|
760
|
+
})), i(() => c(s, "aria-label", `Remove ${k(e, r)}`)), o;
|
|
761
|
+
})();
|
|
762
|
+
return (() => {
|
|
763
|
+
var i = pe();
|
|
764
|
+
return a(i, n(I, {
|
|
765
|
+
get id() {
|
|
766
|
+
return J(e.key);
|
|
767
|
+
},
|
|
768
|
+
value: "",
|
|
769
|
+
onChange: (n) => H(e.key, [...t(), n]),
|
|
770
|
+
get options() {
|
|
771
|
+
return ne(e).filter((e) => !t().includes(String(e.value)));
|
|
772
|
+
},
|
|
773
|
+
get placeholder() {
|
|
774
|
+
return e.placeholder ?? r.anyLabel ?? "Any";
|
|
775
|
+
}
|
|
776
|
+
}), null), a(i, n(m, {
|
|
777
|
+
get when() {
|
|
778
|
+
return t().length > 0;
|
|
779
|
+
},
|
|
780
|
+
get children() {
|
|
781
|
+
var e = fe();
|
|
782
|
+
return a(e, n(p, {
|
|
783
|
+
get each() {
|
|
784
|
+
return t();
|
|
785
|
+
},
|
|
786
|
+
children: o
|
|
787
|
+
})), e;
|
|
788
|
+
}
|
|
789
|
+
}), null), i;
|
|
790
|
+
})();
|
|
791
|
+
}
|
|
792
|
+
function Re(e) {
|
|
793
|
+
return e.type === "text" ? (() => {
|
|
794
|
+
var t = me();
|
|
795
|
+
return t.$$input = (t) => H(e.key, t.currentTarget.value), i((n) => {
|
|
796
|
+
var r = J(e.key), i = e.placeholder;
|
|
675
797
|
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "placeholder", n.t = i), n;
|
|
676
798
|
}, {
|
|
677
799
|
e: void 0,
|
|
678
800
|
t: void 0
|
|
679
|
-
}), i(() => t.value =
|
|
680
|
-
})()
|
|
681
|
-
if (e.type === "boolean") return n(N, {
|
|
801
|
+
}), i(() => t.value = $(V(e.key))), t;
|
|
802
|
+
})() : e.type === "boolean" ? n(I, {
|
|
682
803
|
get id() {
|
|
683
|
-
return
|
|
804
|
+
return J(e.key);
|
|
684
805
|
},
|
|
685
806
|
get value() {
|
|
686
|
-
return
|
|
807
|
+
return $(V(e.key));
|
|
687
808
|
},
|
|
688
|
-
onChange: (t) =>
|
|
809
|
+
onChange: (t) => H(e.key, t),
|
|
689
810
|
get emptyLabel() {
|
|
690
811
|
return r.anyLabel ?? "Any";
|
|
691
812
|
},
|
|
@@ -698,213 +819,218 @@ function $(e) {
|
|
|
698
819
|
label: r.noLabel ?? "No"
|
|
699
820
|
}];
|
|
700
821
|
}
|
|
701
|
-
});
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
return Array.isArray(t) ? t : [];
|
|
705
|
-
};
|
|
822
|
+
}) : Le(e);
|
|
823
|
+
}
|
|
824
|
+
function ze() {
|
|
706
825
|
return (() => {
|
|
707
|
-
var
|
|
708
|
-
return a(
|
|
709
|
-
|
|
710
|
-
|
|
826
|
+
var e = Z(), t = e.firstChild;
|
|
827
|
+
return a(e, n(Y, {
|
|
828
|
+
class: "filter-table-search-icon",
|
|
829
|
+
size: 16,
|
|
830
|
+
"aria-hidden": "true"
|
|
831
|
+
}), t), t.$$input = (e) => C(Oe, e.currentTarget.value), i((e) => {
|
|
832
|
+
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
833
|
+
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
834
|
+
}, {
|
|
835
|
+
e: void 0,
|
|
836
|
+
t: void 0
|
|
837
|
+
}), i(() => t.value = w()), e;
|
|
838
|
+
})();
|
|
839
|
+
}
|
|
840
|
+
function Be() {
|
|
841
|
+
return (() => {
|
|
842
|
+
var e = he();
|
|
843
|
+
return a(e, n(I, {
|
|
844
|
+
get value() {
|
|
845
|
+
return N()?.name ?? "";
|
|
711
846
|
},
|
|
712
|
-
|
|
713
|
-
onChange: (n) => V(e.key, [...t(), n]),
|
|
847
|
+
onChange: R,
|
|
714
848
|
get options() {
|
|
715
|
-
return
|
|
849
|
+
return (M() ?? []).map((e) => ({
|
|
850
|
+
value: e.name,
|
|
851
|
+
label: e.name
|
|
852
|
+
}));
|
|
853
|
+
},
|
|
854
|
+
get ariaLabel() {
|
|
855
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
716
856
|
},
|
|
717
857
|
get placeholder() {
|
|
718
|
-
return
|
|
858
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
719
859
|
}
|
|
720
|
-
}), null), a(
|
|
860
|
+
}), null), a(e, n(m, {
|
|
721
861
|
get when() {
|
|
722
|
-
return
|
|
862
|
+
return N();
|
|
863
|
+
},
|
|
864
|
+
children: (e) => (() => {
|
|
865
|
+
var t = ge();
|
|
866
|
+
return t.$$click = j, a(t, n(X, {
|
|
867
|
+
size: 14,
|
|
868
|
+
"aria-hidden": "true"
|
|
869
|
+
})), i(() => c(t, "aria-label", `${r.clearSavedFilterLabel ?? "Clear saved filter"} ${e().name}`)), t;
|
|
870
|
+
})()
|
|
871
|
+
}), null), e;
|
|
872
|
+
})();
|
|
873
|
+
}
|
|
874
|
+
function Ve(e) {
|
|
875
|
+
return (() => {
|
|
876
|
+
var t = _e(), r = t.firstChild;
|
|
877
|
+
return r.$$click = () => re(e.filter, e.item), a(r, () => e.text, null), a(r, n(X, {
|
|
878
|
+
size: 12,
|
|
879
|
+
"aria-hidden": "true"
|
|
880
|
+
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
881
|
+
})();
|
|
882
|
+
}
|
|
883
|
+
function He() {
|
|
884
|
+
return (() => {
|
|
885
|
+
var e = ve(), t = e.firstChild, i = t.firstChild;
|
|
886
|
+
return a(e, n(p, {
|
|
887
|
+
get each() {
|
|
888
|
+
return A();
|
|
889
|
+
},
|
|
890
|
+
children: Ve
|
|
891
|
+
}), t), i.$$click = j, a(i, () => r.clearAllLabel ?? "Clear all"), a(e, n(m, {
|
|
892
|
+
get when() {
|
|
893
|
+
return o(() => M() !== void 0)() && !P();
|
|
723
894
|
},
|
|
724
895
|
get children() {
|
|
725
|
-
var
|
|
726
|
-
return a(
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
children: (r) => (() => {
|
|
731
|
-
var o = he(), s = o.firstChild;
|
|
732
|
-
return a(o, () => O(e, r), s), s.$$click = () => V(e.key, t().filter((e) => e !== r)), a(s, n(J, {
|
|
733
|
-
size: 12,
|
|
734
|
-
"aria-hidden": "true"
|
|
735
|
-
})), i(() => c(s, "aria-label", `Remove ${O(e, r)}`)), o;
|
|
736
|
-
})()
|
|
737
|
-
})), r;
|
|
896
|
+
var e = Q(), t = e.firstChild;
|
|
897
|
+
return t.$$click = ae, a(t, n(ue, {
|
|
898
|
+
size: 12,
|
|
899
|
+
"aria-hidden": "true"
|
|
900
|
+
}), null), a(t, () => r.saveLabel ?? "Save", null), e;
|
|
738
901
|
}
|
|
739
|
-
}), null),
|
|
902
|
+
}), null), e;
|
|
740
903
|
})();
|
|
741
904
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
905
|
+
function Ue() {
|
|
906
|
+
return (() => {
|
|
907
|
+
var e = ye(), t = e.firstChild, o = t.nextSibling, s = o.nextSibling;
|
|
908
|
+
return e.$$keydown = (e) => {
|
|
909
|
+
e.key === "Escape" && F(!1);
|
|
910
|
+
}, e.addEventListener("submit", oe), t.$$input = (e) => ie(e.currentTarget.value), f((e) => queueMicrotask(() => e.focus()), t), a(o, n(ue, {
|
|
911
|
+
size: 16,
|
|
912
|
+
"aria-hidden": "true"
|
|
913
|
+
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () => F(!1), a(s, () => r.cancelLabel ?? "Cancel"), i((e) => {
|
|
914
|
+
var n = r.saveNameLabel ?? "Filter name", i = r.saveNameLabel ?? "Filter name";
|
|
915
|
+
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
916
|
+
}, {
|
|
917
|
+
e: void 0,
|
|
918
|
+
t: void 0
|
|
919
|
+
}), i(() => t.value = L()), e;
|
|
920
|
+
})();
|
|
921
|
+
}
|
|
922
|
+
let We = (() => {
|
|
923
|
+
var e = be();
|
|
924
|
+
return a(e, n(m, {
|
|
745
925
|
get when() {
|
|
746
926
|
return r.quickSearch !== !1;
|
|
747
927
|
},
|
|
748
928
|
get children() {
|
|
749
|
-
|
|
750
|
-
return a(e, n(q, {
|
|
751
|
-
class: "filter-table-search-icon",
|
|
752
|
-
size: 16,
|
|
753
|
-
"aria-hidden": "true"
|
|
754
|
-
}), t), t.$$input = (e) => w(Oe, e.currentTarget.value), i((e) => {
|
|
755
|
-
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
756
|
-
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
757
|
-
}, {
|
|
758
|
-
e: void 0,
|
|
759
|
-
t: void 0
|
|
760
|
-
}), i(() => t.value = T()), e;
|
|
929
|
+
return ze();
|
|
761
930
|
}
|
|
762
|
-
}), null), a(e, n(
|
|
931
|
+
}), null), a(e, n(m, {
|
|
763
932
|
get when() {
|
|
764
|
-
return (
|
|
933
|
+
return (M()?.length ?? 0) > 0;
|
|
765
934
|
},
|
|
766
935
|
get children() {
|
|
767
|
-
|
|
768
|
-
return a(e, n(N, {
|
|
769
|
-
get value() {
|
|
770
|
-
return M()?.name ?? "";
|
|
771
|
-
},
|
|
772
|
-
onChange: L,
|
|
773
|
-
get options() {
|
|
774
|
-
return (j() ?? []).map((e) => ({
|
|
775
|
-
value: e.name,
|
|
776
|
-
label: e.name
|
|
777
|
-
}));
|
|
778
|
-
},
|
|
779
|
-
get ariaLabel() {
|
|
780
|
-
return r.savedFiltersLabel ?? "Saved filters";
|
|
781
|
-
},
|
|
782
|
-
get placeholder() {
|
|
783
|
-
return r.savedFiltersLabel ?? "Saved filters";
|
|
784
|
-
}
|
|
785
|
-
}), null), a(e, n(p, {
|
|
786
|
-
get when() {
|
|
787
|
-
return M();
|
|
788
|
-
},
|
|
789
|
-
children: (e) => (() => {
|
|
790
|
-
var t = Se();
|
|
791
|
-
return t.$$click = A, a(t, n(J, {
|
|
792
|
-
size: 14,
|
|
793
|
-
"aria-hidden": "true"
|
|
794
|
-
})), i(() => c(t, "aria-label", `${r.clearSavedFilterLabel ?? "Clear saved filter"} ${e().name}`)), t;
|
|
795
|
-
})()
|
|
796
|
-
}), null), e;
|
|
936
|
+
return Be();
|
|
797
937
|
}
|
|
798
|
-
}), null), a(e, n(
|
|
938
|
+
}), null), a(e, n(m, {
|
|
799
939
|
get when() {
|
|
800
|
-
return
|
|
940
|
+
return A().length > 0;
|
|
801
941
|
},
|
|
802
942
|
get children() {
|
|
803
|
-
|
|
804
|
-
return a(e, n(f, {
|
|
805
|
-
get each() {
|
|
806
|
-
return k();
|
|
807
|
-
},
|
|
808
|
-
children: (e) => (() => {
|
|
809
|
-
var t = Ce(), r = t.firstChild;
|
|
810
|
-
return r.$$click = () => ie(e.filter, e.item), a(r, () => e.text, null), a(r, n(J, {
|
|
811
|
-
size: 12,
|
|
812
|
-
"aria-hidden": "true"
|
|
813
|
-
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
814
|
-
})()
|
|
815
|
-
}), t), s.$$click = A, a(s, () => r.clearAllLabel ?? "Clear all"), a(e, n(p, {
|
|
816
|
-
get when() {
|
|
817
|
-
return o(() => j() !== void 0)() && !P();
|
|
818
|
-
},
|
|
819
|
-
get children() {
|
|
820
|
-
var e = ve(), t = e.firstChild;
|
|
821
|
-
return t.$$click = oe, a(t, n(de, {
|
|
822
|
-
size: 12,
|
|
823
|
-
"aria-hidden": "true"
|
|
824
|
-
}), null), a(t, () => r.saveLabel ?? "Save", null), e;
|
|
825
|
-
}
|
|
826
|
-
}), null), e;
|
|
943
|
+
return He();
|
|
827
944
|
}
|
|
828
|
-
}), null), a(e, n(
|
|
945
|
+
}), null), a(e, n(m, {
|
|
829
946
|
get when() {
|
|
830
|
-
return o(() => !!P())() &&
|
|
947
|
+
return o(() => !!P())() && A().length > 0;
|
|
831
948
|
},
|
|
832
949
|
get children() {
|
|
833
|
-
|
|
834
|
-
return e.$$keydown = (e) => {
|
|
835
|
-
e.key === "Escape" && F(!1);
|
|
836
|
-
}, e.addEventListener("submit", se), t.$$input = (e) => ae(e.currentTarget.value), d((e) => queueMicrotask(() => e.focus()), t), a(o, n(de, {
|
|
837
|
-
size: 16,
|
|
838
|
-
"aria-hidden": "true"
|
|
839
|
-
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () => F(!1), a(s, () => r.cancelLabel ?? "Cancel"), i((e) => {
|
|
840
|
-
var n = r.saveNameLabel ?? "Filter name", i = r.saveNameLabel ?? "Filter name";
|
|
841
|
-
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
842
|
-
}, {
|
|
843
|
-
e: void 0,
|
|
844
|
-
t: void 0
|
|
845
|
-
}), i(() => t.value = I()), e;
|
|
950
|
+
return Ue();
|
|
846
951
|
}
|
|
847
952
|
}), null), e;
|
|
848
953
|
})();
|
|
954
|
+
function Ge(e) {
|
|
955
|
+
return e === "results" ? r.resultsLabel ?? "Results" : r.filtersLabel ?? "Filters";
|
|
956
|
+
}
|
|
957
|
+
function Ke(e) {
|
|
958
|
+
return e === "results" ? O().length : T().length;
|
|
959
|
+
}
|
|
960
|
+
function qe(e) {
|
|
961
|
+
return (() => {
|
|
962
|
+
var t = Se();
|
|
963
|
+
return t.$$keydown = Pe, t.$$click = () => Ne(e), a(t, () => Ge(e), null), a(t, n(m, {
|
|
964
|
+
get when() {
|
|
965
|
+
return e === "results" || T().length > 0;
|
|
966
|
+
},
|
|
967
|
+
get children() {
|
|
968
|
+
var t = xe();
|
|
969
|
+
return a(t, () => Ke(e)), t;
|
|
970
|
+
}
|
|
971
|
+
}), null), i((n) => {
|
|
972
|
+
var r = K(e), i = G() === e, a = q(e), o = G() === e ? 0 : -1;
|
|
973
|
+
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;
|
|
974
|
+
}, {
|
|
975
|
+
e: void 0,
|
|
976
|
+
t: void 0,
|
|
977
|
+
a: void 0,
|
|
978
|
+
o: void 0
|
|
979
|
+
}), t;
|
|
980
|
+
})();
|
|
981
|
+
}
|
|
982
|
+
function Je(e) {
|
|
983
|
+
return (() => {
|
|
984
|
+
var t = Ce(), n = t.firstChild;
|
|
985
|
+
return a(n, () => e.label), a(t, () => Re(e), null), i(() => c(n, "for", J(e.key))), t;
|
|
986
|
+
})();
|
|
987
|
+
}
|
|
988
|
+
function Ye(e) {
|
|
989
|
+
return (() => {
|
|
990
|
+
var t = Te();
|
|
991
|
+
return a(t, n(m, {
|
|
992
|
+
get when() {
|
|
993
|
+
return e.name;
|
|
994
|
+
},
|
|
995
|
+
get children() {
|
|
996
|
+
var t = we();
|
|
997
|
+
return a(t, () => e.name), t;
|
|
998
|
+
}
|
|
999
|
+
}), null), a(t, n(p, {
|
|
1000
|
+
get each() {
|
|
1001
|
+
return e.filters;
|
|
1002
|
+
},
|
|
1003
|
+
children: Je
|
|
1004
|
+
}), null), t;
|
|
1005
|
+
})();
|
|
1006
|
+
}
|
|
1007
|
+
function Xe() {
|
|
1008
|
+
return (() => {
|
|
1009
|
+
var e = Ee(), t = e.firstChild, i = t.firstChild, o = i.nextSibling;
|
|
1010
|
+
return e.addEventListener("submit", Fe), a(e, n(p, {
|
|
1011
|
+
get each() {
|
|
1012
|
+
return se();
|
|
1013
|
+
},
|
|
1014
|
+
children: Ye
|
|
1015
|
+
}), t), i.$$click = Ie, a(i, n(X, {
|
|
1016
|
+
size: 16,
|
|
1017
|
+
"aria-hidden": "true"
|
|
1018
|
+
}), null), a(i, () => r.resetLabel ?? "Reset", null), a(o, n(Y, {
|
|
1019
|
+
size: 16,
|
|
1020
|
+
"aria-hidden": "true"
|
|
1021
|
+
}), null), a(o, () => r.applyLabel ?? "Search", null), e;
|
|
1022
|
+
})();
|
|
1023
|
+
}
|
|
849
1024
|
return (() => {
|
|
850
|
-
var e =
|
|
851
|
-
return a(o, n(
|
|
852
|
-
each:
|
|
853
|
-
children:
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
get children() {
|
|
860
|
-
var t = Te();
|
|
861
|
-
return a(t, () => e === "results" ? ne().length : E().length), t;
|
|
862
|
-
}
|
|
863
|
-
}), null), i((n) => {
|
|
864
|
-
var r = G(e), i = U() === e, a = K(e), o = U() === e ? 0 : -1;
|
|
865
|
-
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "aria-selected", n.t = i), a !== n.a && c(t, "aria-controls", n.a = a), o !== n.o && c(t, "tabindex", n.o = o), n;
|
|
866
|
-
}, {
|
|
867
|
-
e: void 0,
|
|
868
|
-
t: void 0,
|
|
869
|
-
a: void 0,
|
|
870
|
-
o: void 0
|
|
871
|
-
}), t;
|
|
872
|
-
})()
|
|
873
|
-
})), a(u, n(ue, s(l, {
|
|
874
|
-
rows: ne,
|
|
875
|
-
toolbar: Le
|
|
876
|
-
}))), m.addEventListener("submit", Pe), a(m, n(f, {
|
|
877
|
-
get each() {
|
|
878
|
-
return ce();
|
|
879
|
-
},
|
|
880
|
-
children: (e) => (() => {
|
|
881
|
-
var t = X();
|
|
882
|
-
return a(t, n(p, {
|
|
883
|
-
get when() {
|
|
884
|
-
return e.name;
|
|
885
|
-
},
|
|
886
|
-
get children() {
|
|
887
|
-
var t = Y();
|
|
888
|
-
return a(t, () => e.name), t;
|
|
889
|
-
}
|
|
890
|
-
}), null), a(t, n(f, {
|
|
891
|
-
get each() {
|
|
892
|
-
return e.filters;
|
|
893
|
-
},
|
|
894
|
-
children: (e) => (() => {
|
|
895
|
-
var t = De(), n = t.firstChild;
|
|
896
|
-
return a(n, () => e.label), a(t, () => Ie(e), null), i(() => c(n, "for", $(e.key))), t;
|
|
897
|
-
})()
|
|
898
|
-
}), null), t;
|
|
899
|
-
})()
|
|
900
|
-
}), h), g.$$click = Fe, a(g, n(J, {
|
|
901
|
-
size: 16,
|
|
902
|
-
"aria-hidden": "true"
|
|
903
|
-
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(q, {
|
|
904
|
-
size: 16,
|
|
905
|
-
"aria-hidden": "true"
|
|
906
|
-
}), null), a(_, () => r.applyLabel ?? "Search", null), i((n) => {
|
|
907
|
-
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = K("results"), o = G("results"), s = U() !== "results", l = K("filters"), f = G("filters"), p = U() !== "filters";
|
|
1025
|
+
var e = De(), o = e.firstChild, u = o.nextSibling, d = u.nextSibling;
|
|
1026
|
+
return a(o, n(p, {
|
|
1027
|
+
each: W,
|
|
1028
|
+
children: qe
|
|
1029
|
+
})), a(u, n(le, s(l, {
|
|
1030
|
+
rows: O,
|
|
1031
|
+
toolbar: We
|
|
1032
|
+
}))), a(d, Xe), i((n) => {
|
|
1033
|
+
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = q("results"), o = K("results"), s = G() !== "results", l = q("filters"), f = K("filters"), p = G() !== "filters";
|
|
908
1034
|
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;
|
|
909
1035
|
}, {
|
|
910
1036
|
e: void 0,
|
|
@@ -918,14 +1044,14 @@ function $(e) {
|
|
|
918
1044
|
})();
|
|
919
1045
|
}
|
|
920
1046
|
r([
|
|
921
|
-
"input",
|
|
922
1047
|
"click",
|
|
1048
|
+
"input",
|
|
923
1049
|
"keydown"
|
|
924
1050
|
]);
|
|
925
1051
|
//#endregion
|
|
926
1052
|
//#region src/search-bar.tsx
|
|
927
|
-
var
|
|
928
|
-
function
|
|
1053
|
+
var Pe = /*#__PURE__*/ d("<kbd class=search-bar-shortcut>"), Fe = /*#__PURE__*/ d("<button type=button class=search-bar-clear>"), Ie = /*#__PURE__*/ d("<div><input class=search-bar-input>");
|
|
1054
|
+
function Le(e) {
|
|
929
1055
|
let r, s = () => e.shortcutKey ?? "k", l = () => e.shortcutLabel ?? `Ctrl ${String(s()).toUpperCase()}`;
|
|
930
1056
|
return x(() => {
|
|
931
1057
|
let e = (e) => {
|
|
@@ -934,43 +1060,43 @@ function Fe(e) {
|
|
|
934
1060
|
};
|
|
935
1061
|
document.addEventListener("keydown", e), b(() => document.removeEventListener("keydown", e));
|
|
936
1062
|
}), (() => {
|
|
937
|
-
var u =
|
|
938
|
-
a(u, n(
|
|
1063
|
+
var u = Ie(), d = u.firstChild;
|
|
1064
|
+
a(u, n(Y, {
|
|
939
1065
|
size: 17,
|
|
940
1066
|
class: "search-bar-icon",
|
|
941
1067
|
"aria-hidden": "true"
|
|
942
|
-
}),
|
|
943
|
-
var
|
|
944
|
-
return typeof
|
|
1068
|
+
}), d), d.$$input = (t) => e.onInput(t.currentTarget.value);
|
|
1069
|
+
var p = r;
|
|
1070
|
+
return typeof p == "function" ? f(p, d) : r = d, a(u, n(m, {
|
|
945
1071
|
get when() {
|
|
946
1072
|
return o(() => !e.value)() && s() !== !1;
|
|
947
1073
|
},
|
|
948
1074
|
get children() {
|
|
949
|
-
var e =
|
|
1075
|
+
var e = Pe();
|
|
950
1076
|
return a(e, l), e;
|
|
951
1077
|
}
|
|
952
|
-
}), null), a(u, n(
|
|
1078
|
+
}), null), a(u, n(m, {
|
|
953
1079
|
get when() {
|
|
954
1080
|
return e.value;
|
|
955
1081
|
},
|
|
956
1082
|
get children() {
|
|
957
|
-
var t =
|
|
958
|
-
return t.$$click = () => e.onInput(""), a(t, n(
|
|
1083
|
+
var t = Fe();
|
|
1084
|
+
return t.$$click = () => e.onInput(""), a(t, n(X, {
|
|
959
1085
|
size: 15,
|
|
960
1086
|
"aria-hidden": "true"
|
|
961
1087
|
})), i(() => c(t, "aria-label", e.clearLabel ?? "Clear search")), t;
|
|
962
1088
|
}
|
|
963
1089
|
}), null), i((n) => {
|
|
964
1090
|
var r = e.class ? `search-bar ${e.class}` : "search-bar", i = e.placeholder ?? "Search…", a = e.ariaLabel ?? "Search", o = s() === !1 ? void 0 : `Control+${String(s()).toUpperCase()} Meta+${String(s()).toUpperCase()}`;
|
|
965
|
-
return r !== n.e && t(u, n.e = r), i !== n.t && c(
|
|
1091
|
+
return r !== n.e && t(u, n.e = r), i !== n.t && c(d, "placeholder", n.t = i), a !== n.a && c(d, "aria-label", n.a = a), o !== n.o && c(d, "aria-keyshortcuts", n.o = o), n;
|
|
966
1092
|
}, {
|
|
967
1093
|
e: void 0,
|
|
968
1094
|
t: void 0,
|
|
969
1095
|
a: void 0,
|
|
970
1096
|
o: void 0
|
|
971
|
-
}), i(() =>
|
|
1097
|
+
}), i(() => d.value = e.value), u;
|
|
972
1098
|
})();
|
|
973
1099
|
}
|
|
974
1100
|
r(["input", "click"]);
|
|
975
1101
|
//#endregion
|
|
976
|
-
export {
|
|
1102
|
+
export { I as Combobox, le as DataTable, Ne as FilterTable, Le as SearchBar };
|