@serkonda7/solid-components 0.2.0 → 0.3.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 +1 -1
- package/dist/data-table.d.ts +11 -6
- package/dist/filter-table.d.ts +1 -1
- package/dist/index.js +690 -567
- 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 ee, createEffect as h, createMemo as g, createSignal as _, createUniqueId as v, 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 = v(),
|
|
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>"), re = /*#__PURE__*/ d("<div role=option class=combobox-option><span class=combobox-option-label>"), k = /*#__PURE__*/ d("<span class=combobox-option-icon aria-hidden=true>"), A = /*#__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 = v(), d = () => r.id ?? u, ee = () => `${d()}-listbox`, y = (e) => `${d()}-option-${e}`, [b, S] = _(!1), [C, w] = _(""), [T, E] = _(0), D = g(() => 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 = g(() => r.value === "" ? void 0 : D().find((e) => String(e.value) === r.value)), L = g(() => {
|
|
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
71
|
}), h(() => {
|
|
72
|
-
|
|
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 && M((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 === "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 = re(), 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 = k();
|
|
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 = A();
|
|
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 = ee();
|
|
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 H = () => S() ? P()?.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 M(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 F();
|
|
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 = A(), l = s.firstChild;
|
|
146
|
-
return s.$$click = () => z(o()), s.$$mousemove = () => M(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(p, {
|
|
147
|
-
get when() {
|
|
148
|
-
return t.icon;
|
|
149
|
-
},
|
|
150
|
-
children: (t) => (() => {
|
|
151
|
-
var r = j();
|
|
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 = ae();
|
|
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 = () => M(L()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(D, {
|
|
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 = !!I(), 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 = ee(), m = b() && ae() > 0 ? y(T()) : void 0, h = r.ariaLabel, g = r.describedBy, _ = r.required, v = 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), h !== e.r && c(u, "aria-label", e.r = h), g !== e.d && c(u, "aria-describedby", e.d = g), _ !== e.l && (u.required = e.l = _), v !== e.u && (u.disabled = e.u = v), 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 M(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 = g(() => q(e.rows)), o = () => q(e.loading ?? !1), s = e.sortKey !== void 0 || e.sortDirection !== void 0, [l, d] = _(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 = ee(() => e.toolbar), T = g(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [E, D] = _(void 0), te = () => e.visibleColumns === void 0 ? E() ?? T() : q(e.visibleColumns), O = g(() => new Set(te())), [ne, re] = _(void 0);
|
|
263
|
+
function k(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 A = g(() => k(e.columnOrder === void 0 ? ne() ?? e.defaultColumnOrder ?? [] : q(e.columnOrder))), j = g(() => A().filter((e) => e.toggleable === !1 || O().has(e.key))), M = g(() => e.columns.filter((e) => e.toggleable !== !1)), N = g(() => 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 = g(() => {
|
|
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);
|
|
277
296
|
}
|
|
278
|
-
function
|
|
279
|
-
let n = new Set(
|
|
280
|
-
t ? n.add(e) : n.delete(e),
|
|
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)));
|
|
281
300
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
301
|
+
function de() {
|
|
302
|
+
Y(N());
|
|
284
303
|
}
|
|
285
|
-
function
|
|
286
|
-
e.columnOrder === void 0 &&
|
|
304
|
+
function fe(t) {
|
|
305
|
+
e.columnOrder === void 0 && re(t), e.onColumnOrderChange?.(t);
|
|
287
306
|
}
|
|
288
|
-
function
|
|
289
|
-
let n =
|
|
290
|
-
r === -1 || t < 0 || t >= n.length || t === r || (n.splice(r, 1), n.splice(t, 0, e),
|
|
307
|
+
function pe(e, t) {
|
|
308
|
+
let n = A().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));
|
|
291
310
|
}
|
|
292
|
-
function
|
|
293
|
-
|
|
294
|
-
let r = e.parentElement?.querySelectorAll(".data-table-customizer-move");
|
|
295
|
-
(e.disabled ? [...r ?? []].find((e) => !e.disabled) : e)?.focus();
|
|
311
|
+
function me() {
|
|
312
|
+
Y(T()), fe(k(e.defaultColumnOrder ?? []).map((e) => e.key));
|
|
296
313
|
}
|
|
297
|
-
|
|
298
|
-
|
|
314
|
+
let [Z, he] = _({}), [ge, _e] = _(), Q;
|
|
315
|
+
h(() => {
|
|
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);
|
|
299
355
|
}
|
|
300
|
-
|
|
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());
|
|
367
|
+
}
|
|
368
|
+
let [be, xe] = _(), Se = `${v()}-panel`, [Ce, we] = _(!1), Te;
|
|
301
369
|
h(() => {
|
|
302
|
-
if (!
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
e.onSelectionChange?.(t ? r().map(e.getRowId) : []);
|
|
381
|
+
function Ee(e) {
|
|
382
|
+
return e.toggleable === !1 || O().has(e.key);
|
|
383
|
+
}
|
|
384
|
+
function De(t, n) {
|
|
385
|
+
return e.getCell?.(t, n) ?? n.getValue?.(t) ?? null;
|
|
319
386
|
}
|
|
320
|
-
function Oe(
|
|
321
|
-
|
|
322
|
-
e.onSelectionChange?.(a);
|
|
387
|
+
function Oe(e) {
|
|
388
|
+
if (e.sortable) return y() === e.key ? x() === "asc" ? "ascending" : "descending" : "none";
|
|
323
389
|
}
|
|
324
|
-
function ke(
|
|
325
|
-
return
|
|
390
|
+
function ke(e) {
|
|
391
|
+
return y() === e.key ? x() === "asc" ? "▲" : "▼" : "";
|
|
326
392
|
}
|
|
327
|
-
|
|
328
|
-
|
|
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");
|
|
329
396
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
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
|
+
})();
|
|
332
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 A();
|
|
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
|
+
})();
|
|
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, ee = 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 = I(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
363
|
-
return c(t, "id", we), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(f, {
|
|
364
|
-
get each() {
|
|
365
|
-
return j();
|
|
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(P, {
|
|
375
|
-
class: "data-table-customizer-grip",
|
|
376
|
-
size: 14,
|
|
377
|
-
"aria-hidden": "true"
|
|
378
|
-
}), s), l.addEventListener("change", (e) => ge(t.key, e.currentTarget.checked)), a(s, () => t.ariaLabel ?? t.label, null), u.$$click = (e) => be(e.currentTarget, t.key, -1), a(u, n(N, {
|
|
379
|
-
size: 14,
|
|
380
|
-
"aria-hidden": "true"
|
|
381
|
-
})), d.$$click = (e) => be(e.currentTarget, t.key, 1), a(d, n(ee, {
|
|
382
|
-
size: 14,
|
|
383
|
-
"aria-hidden": "true"
|
|
384
|
-
})), i((n) => {
|
|
385
|
-
var i = Se() === t.key, a = t.toggleable === !1, s = `${e.columnCustomizerMoveUpLabel ?? "Move up"}: ${t.ariaLabel ?? t.label}`, f = r() === 0, p = `${e.columnCustomizerMoveDownLabel ?? "Move down"}: ${t.ariaLabel ?? t.label}`, m = r() === j().length - 1;
|
|
386
|
-
return i !== n.e && o.classList.toggle("data-table-customizer-item-dragging", n.e = i), a !== n.t && (l.disabled = n.t = a), s !== n.a && c(u, "aria-label", n.a = s), f !== n.o && (u.disabled = n.o = f), p !== n.i && c(d, "aria-label", n.i = p), m !== n.n && (d.disabled = n.n = m), n;
|
|
387
|
-
}, {
|
|
388
|
-
e: void 0,
|
|
389
|
-
t: void 0,
|
|
390
|
-
a: void 0,
|
|
391
|
-
o: void 0,
|
|
392
|
-
i: void 0,
|
|
393
|
-
n: void 0
|
|
394
|
-
}), i(() => l.checked = Ae(t)), o;
|
|
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 = D()), t;
|
|
528
|
+
}), null), e;
|
|
411
529
|
}
|
|
412
|
-
}),
|
|
530
|
+
}), s);
|
|
531
|
+
var h = Q;
|
|
532
|
+
return typeof h == "function" ? f(h, 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(ee, 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 = ce(), n = t.firstChild;
|
|
459
|
-
return n.addEventListener("change", (e) => Oe(r, e.currentTarget.checked)), i(() => c(n, "aria-label", `Select row ${e.getRowId(r)}`)), i(() => n.checked = ke(r)), t;
|
|
460
|
-
}
|
|
461
|
-
}), null), a(o, n(f, {
|
|
462
|
-
get each() {
|
|
463
|
-
return M();
|
|
464
|
-
},
|
|
465
|
-
children: (e) => (() => {
|
|
466
|
-
var n = U();
|
|
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 = U();
|
|
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",
|
|
@@ -547,47 +628,47 @@ function Me(e) {
|
|
|
547
628
|
"saveLabel",
|
|
548
629
|
"saveNameLabel",
|
|
549
630
|
"cancelLabel",
|
|
550
|
-
"
|
|
631
|
+
"clearSavedFilterLabel",
|
|
551
632
|
"class"
|
|
552
|
-
]), u = g(() => ke(r.rows)), [
|
|
553
|
-
function
|
|
554
|
-
let t =
|
|
555
|
-
r.filterValues === void 0 &&
|
|
556
|
-
}
|
|
557
|
-
function
|
|
558
|
-
|
|
559
|
-
...
|
|
633
|
+
]), u = g(() => ke(r.rows)), [d, ee] = _(je(r.defaultFilterValues ?? {})), b = g(() => r.filterValues === void 0 ? d() : je(ke(r.filterValues)));
|
|
634
|
+
function x(e) {
|
|
635
|
+
let t = je(e);
|
|
636
|
+
r.filterValues === void 0 && ee(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 = g(() => 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
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
657
|
function te(e) {
|
|
577
|
-
return r.getSearchText ? r.getSearchText(e) : l.columns.map((t) =>
|
|
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 = g(() => {
|
|
580
661
|
if (r.manualFiltering) return u();
|
|
581
|
-
let e =
|
|
582
|
-
return u().filter((n) => (e === "" || te(n).toLowerCase().includes(e)) && t.every((e) => D(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,47 +677,44 @@ function Me(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 re(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 k = g(() =>
|
|
603
|
-
let t =
|
|
683
|
+
let k = g(() => 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}: ${re(e, t)}`
|
|
608
689
|
}));
|
|
609
690
|
}));
|
|
610
|
-
function
|
|
611
|
-
let n =
|
|
612
|
-
|
|
691
|
+
function A(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 = g(() => r.savedFilters === void 0 ? void 0 : ke(r.savedFilters)), N = g(() => M()?.find((e) => Me(je(e.values), b()))), [P, F] = _(!1), [L, ie] = _("");
|
|
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:
|
|
633
|
-
}]),
|
|
634
|
-
}
|
|
635
|
-
function R(e) {
|
|
636
|
-
r.onSavedFiltersChange?.((A() ?? []).filter((t) => t.name !== e));
|
|
713
|
+
values: b()
|
|
714
|
+
}]), F(!1);
|
|
637
715
|
}
|
|
638
|
-
let [z, B] = _(
|
|
639
|
-
h(y(
|
|
716
|
+
let [z, B] = _(b());
|
|
717
|
+
h(y(b, (e) => B(e)));
|
|
640
718
|
function V(e) {
|
|
641
719
|
return z()[e];
|
|
642
720
|
}
|
|
@@ -646,16 +724,16 @@ function Me(e) {
|
|
|
646
724
|
[e]: t
|
|
647
725
|
}));
|
|
648
726
|
}
|
|
649
|
-
let
|
|
727
|
+
let se = g(() => {
|
|
650
728
|
let e = /* @__PURE__ */ new Map([[void 0, []]]);
|
|
651
729
|
for (let t of r.filters) e.set(t.group, [...e.get(t.group) ?? [], t]);
|
|
652
730
|
return [...e.entries()].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
653
731
|
name: e,
|
|
654
732
|
filters: t
|
|
655
733
|
}));
|
|
656
|
-
}), U = v(), W = ["results", "filters"], [G,
|
|
734
|
+
}), U = v(), W = ["results", "filters"], [G, ce] = _("results"), K = (e) => `${U}-tab-${e}`, q = (e) => `${U}-panel-${e}`, J = (e) => `${U}-filter-${e}`;
|
|
657
735
|
function Ne(e) {
|
|
658
|
-
e === "filters" && B(
|
|
736
|
+
e === "filters" && B(b()), ce(e);
|
|
659
737
|
}
|
|
660
738
|
function Pe(e) {
|
|
661
739
|
let t = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
@@ -665,28 +743,68 @@ function Me(e) {
|
|
|
665
743
|
Ne(n), document.getElementById(K(n))?.focus();
|
|
666
744
|
}
|
|
667
745
|
function Fe(e) {
|
|
668
|
-
e.preventDefault(),
|
|
746
|
+
e.preventDefault(), x(z()), ce("results");
|
|
669
747
|
}
|
|
670
748
|
function Ie() {
|
|
671
|
-
|
|
749
|
+
j(), ce("results");
|
|
672
750
|
}
|
|
673
751
|
function Le(e) {
|
|
674
|
-
|
|
675
|
-
|
|
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, () => re(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 ${re(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();
|
|
676
795
|
return t.$$input = (t) => H(e.key, t.currentTarget.value), i((n) => {
|
|
677
|
-
var r =
|
|
796
|
+
var r = J(e.key), i = e.placeholder;
|
|
678
797
|
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "placeholder", n.t = i), n;
|
|
679
798
|
}, {
|
|
680
799
|
e: void 0,
|
|
681
800
|
t: void 0
|
|
682
|
-
}), i(() => t.value =
|
|
683
|
-
})()
|
|
684
|
-
if (e.type === "boolean") return n(M, {
|
|
801
|
+
}), i(() => t.value = $(V(e.key))), t;
|
|
802
|
+
})() : e.type === "boolean" ? n(I, {
|
|
685
803
|
get id() {
|
|
686
|
-
return
|
|
804
|
+
return J(e.key);
|
|
687
805
|
},
|
|
688
806
|
get value() {
|
|
689
|
-
return
|
|
807
|
+
return $(V(e.key));
|
|
690
808
|
},
|
|
691
809
|
onChange: (t) => H(e.key, t),
|
|
692
810
|
get emptyLabel() {
|
|
@@ -701,213 +819,218 @@ function Me(e) {
|
|
|
701
819
|
label: r.noLabel ?? "No"
|
|
702
820
|
}];
|
|
703
821
|
}
|
|
704
|
-
});
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
return Array.isArray(t) ? t : [];
|
|
708
|
-
};
|
|
822
|
+
}) : Le(e);
|
|
823
|
+
}
|
|
824
|
+
function ze() {
|
|
709
825
|
return (() => {
|
|
710
|
-
var
|
|
711
|
-
return a(
|
|
712
|
-
|
|
713
|
-
|
|
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 ?? "";
|
|
714
846
|
},
|
|
715
|
-
|
|
716
|
-
onChange: (n) => H(e.key, [...t(), n]),
|
|
847
|
+
onChange: R,
|
|
717
848
|
get options() {
|
|
718
|
-
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";
|
|
719
856
|
},
|
|
720
857
|
get placeholder() {
|
|
721
|
-
return
|
|
858
|
+
return r.savedFiltersLabel ?? "Saved filters";
|
|
722
859
|
}
|
|
723
|
-
}), null), a(
|
|
860
|
+
}), null), a(e, n(m, {
|
|
724
861
|
get when() {
|
|
725
|
-
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 = () => A(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 k();
|
|
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();
|
|
726
894
|
},
|
|
727
895
|
get children() {
|
|
728
|
-
var
|
|
729
|
-
return a(
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
children: (r) => (() => {
|
|
734
|
-
var o = he(), s = o.firstChild;
|
|
735
|
-
return a(o, () => O(e, r), s), s.$$click = () => H(e.key, t().filter((e) => e !== r)), a(s, n(J, {
|
|
736
|
-
size: 12,
|
|
737
|
-
"aria-hidden": "true"
|
|
738
|
-
})), i(() => c(s, "aria-label", `Remove ${O(e, r)}`)), o;
|
|
739
|
-
})()
|
|
740
|
-
})), 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;
|
|
741
901
|
}
|
|
742
|
-
}), null),
|
|
902
|
+
}), null), e;
|
|
743
903
|
})();
|
|
744
904
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
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, {
|
|
748
925
|
get when() {
|
|
749
926
|
return r.quickSearch !== !1;
|
|
750
927
|
},
|
|
751
928
|
get children() {
|
|
752
|
-
|
|
753
|
-
return a(e, n(q, {
|
|
754
|
-
class: "filter-table-search-icon",
|
|
755
|
-
size: 16,
|
|
756
|
-
"aria-hidden": "true"
|
|
757
|
-
}), t), t.$$input = (e) => w(Oe, e.currentTarget.value), i((e) => {
|
|
758
|
-
var n = r.quickSearchLabel ?? "Quick search", i = r.quickSearchLabel ?? "Quick search";
|
|
759
|
-
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
760
|
-
}, {
|
|
761
|
-
e: void 0,
|
|
762
|
-
t: void 0
|
|
763
|
-
}), i(() => t.value = T()), e;
|
|
929
|
+
return ze();
|
|
764
930
|
}
|
|
765
|
-
}), null), a(e, n(
|
|
931
|
+
}), null), a(e, n(m, {
|
|
766
932
|
get when() {
|
|
767
|
-
return (
|
|
933
|
+
return (M()?.length ?? 0) > 0;
|
|
768
934
|
},
|
|
769
935
|
get children() {
|
|
770
|
-
|
|
771
|
-
return a(e, n(M, {
|
|
772
|
-
get value() {
|
|
773
|
-
return j()?.name ?? "";
|
|
774
|
-
},
|
|
775
|
-
onChange: L,
|
|
776
|
-
get options() {
|
|
777
|
-
return (A() ?? []).map((e) => ({
|
|
778
|
-
value: e.name,
|
|
779
|
-
label: e.name
|
|
780
|
-
}));
|
|
781
|
-
},
|
|
782
|
-
get ariaLabel() {
|
|
783
|
-
return r.savedFiltersLabel ?? "Saved filters";
|
|
784
|
-
},
|
|
785
|
-
get placeholder() {
|
|
786
|
-
return r.savedFiltersLabel ?? "Saved filters";
|
|
787
|
-
}
|
|
788
|
-
}), null), a(e, n(p, {
|
|
789
|
-
get when() {
|
|
790
|
-
return j();
|
|
791
|
-
},
|
|
792
|
-
children: (e) => (() => {
|
|
793
|
-
var t = Se();
|
|
794
|
-
return t.$$click = () => R(e().name), a(t, n(J, {
|
|
795
|
-
size: 14,
|
|
796
|
-
"aria-hidden": "true"
|
|
797
|
-
})), i(() => c(t, "aria-label", `${r.deleteSavedFilterLabel ?? "Delete saved filter"} ${e().name}`)), t;
|
|
798
|
-
})()
|
|
799
|
-
}), null), e;
|
|
936
|
+
return Be();
|
|
800
937
|
}
|
|
801
|
-
}), null), a(e, n(
|
|
938
|
+
}), null), a(e, n(m, {
|
|
802
939
|
get when() {
|
|
803
940
|
return k().length > 0;
|
|
804
941
|
},
|
|
805
942
|
get children() {
|
|
806
|
-
|
|
807
|
-
return a(e, n(f, {
|
|
808
|
-
get each() {
|
|
809
|
-
return k();
|
|
810
|
-
},
|
|
811
|
-
children: (e) => (() => {
|
|
812
|
-
var t = Ce(), r = t.firstChild;
|
|
813
|
-
return r.$$click = () => ie(e.filter, e.item), a(r, () => e.text, null), a(r, n(J, {
|
|
814
|
-
size: 12,
|
|
815
|
-
"aria-hidden": "true"
|
|
816
|
-
}), null), i(() => c(r, "aria-label", `Remove filter ${e.text}`)), t;
|
|
817
|
-
})()
|
|
818
|
-
}), t), s.$$click = ae, a(s, () => r.clearAllLabel ?? "Clear all"), a(e, n(p, {
|
|
819
|
-
get when() {
|
|
820
|
-
return o(() => A() !== void 0)() && !N();
|
|
821
|
-
},
|
|
822
|
-
get children() {
|
|
823
|
-
var e = ve(), t = e.firstChild;
|
|
824
|
-
return t.$$click = oe, a(t, n(de, {
|
|
825
|
-
size: 12,
|
|
826
|
-
"aria-hidden": "true"
|
|
827
|
-
}), null), a(t, () => r.saveLabel ?? "Save", null), e;
|
|
828
|
-
}
|
|
829
|
-
}), null), e;
|
|
943
|
+
return He();
|
|
830
944
|
}
|
|
831
|
-
}), null), a(e, n(
|
|
945
|
+
}), null), a(e, n(m, {
|
|
832
946
|
get when() {
|
|
833
|
-
return o(() => !!
|
|
947
|
+
return o(() => !!P())() && k().length > 0;
|
|
834
948
|
},
|
|
835
949
|
get children() {
|
|
836
|
-
|
|
837
|
-
return e.$$keydown = (e) => {
|
|
838
|
-
e.key === "Escape" && P(!1);
|
|
839
|
-
}, e.addEventListener("submit", se), t.$$input = (e) => I(e.currentTarget.value), d((e) => queueMicrotask(() => e.focus()), t), a(o, n(de, {
|
|
840
|
-
size: 16,
|
|
841
|
-
"aria-hidden": "true"
|
|
842
|
-
}), null), a(o, () => r.saveLabel ?? "Save", null), s.$$click = () => P(!1), a(s, () => r.cancelLabel ?? "Cancel"), i((e) => {
|
|
843
|
-
var n = r.saveNameLabel ?? "Filter name", i = r.saveNameLabel ?? "Filter name";
|
|
844
|
-
return n !== e.e && c(t, "aria-label", e.e = n), i !== e.t && c(t, "placeholder", e.t = i), e;
|
|
845
|
-
}, {
|
|
846
|
-
e: void 0,
|
|
847
|
-
t: void 0
|
|
848
|
-
}), i(() => t.value = F()), e;
|
|
950
|
+
return Ue();
|
|
849
951
|
}
|
|
850
952
|
}), null), e;
|
|
851
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
|
+
}
|
|
852
1024
|
return (() => {
|
|
853
|
-
var e =
|
|
854
|
-
return a(o, n(
|
|
1025
|
+
var e = De(), o = e.firstChild, u = o.nextSibling, d = u.nextSibling;
|
|
1026
|
+
return a(o, n(p, {
|
|
855
1027
|
each: W,
|
|
856
|
-
children:
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
get children() {
|
|
863
|
-
var t = Te();
|
|
864
|
-
return a(t, () => e === "results" ? ne().length : E().length), t;
|
|
865
|
-
}
|
|
866
|
-
}), null), i((n) => {
|
|
867
|
-
var r = K(e), i = G() === e, a = Me(e), o = G() === e ? 0 : -1;
|
|
868
|
-
return r !== n.e && c(t, "id", n.e = r), i !== n.t && c(t, "aria-selected", n.t = i), a !== n.a && c(t, "aria-controls", n.a = a), o !== n.o && c(t, "tabindex", n.o = o), n;
|
|
869
|
-
}, {
|
|
870
|
-
e: void 0,
|
|
871
|
-
t: void 0,
|
|
872
|
-
a: void 0,
|
|
873
|
-
o: void 0
|
|
874
|
-
}), t;
|
|
875
|
-
})()
|
|
876
|
-
})), a(u, n(ue, s(l, {
|
|
877
|
-
rows: ne,
|
|
878
|
-
toolbar: Re
|
|
879
|
-
}))), m.addEventListener("submit", Fe), a(m, n(f, {
|
|
880
|
-
get each() {
|
|
881
|
-
return ce();
|
|
882
|
-
},
|
|
883
|
-
children: (e) => (() => {
|
|
884
|
-
var t = X();
|
|
885
|
-
return a(t, n(p, {
|
|
886
|
-
get when() {
|
|
887
|
-
return e.name;
|
|
888
|
-
},
|
|
889
|
-
get children() {
|
|
890
|
-
var t = Y();
|
|
891
|
-
return a(t, () => e.name), t;
|
|
892
|
-
}
|
|
893
|
-
}), null), a(t, n(f, {
|
|
894
|
-
get each() {
|
|
895
|
-
return e.filters;
|
|
896
|
-
},
|
|
897
|
-
children: (e) => (() => {
|
|
898
|
-
var t = De(), n = t.firstChild;
|
|
899
|
-
return a(n, () => e.label), a(t, () => Le(e), null), i(() => c(n, "for", $(e.key))), t;
|
|
900
|
-
})()
|
|
901
|
-
}), null), t;
|
|
902
|
-
})()
|
|
903
|
-
}), h), g.$$click = Ie, a(g, n(J, {
|
|
904
|
-
size: 16,
|
|
905
|
-
"aria-hidden": "true"
|
|
906
|
-
}), null), a(g, () => r.resetLabel ?? "Reset", null), a(_, n(q, {
|
|
907
|
-
size: 16,
|
|
908
|
-
"aria-hidden": "true"
|
|
909
|
-
}), null), a(_, () => r.applyLabel ?? "Search", null), i((n) => {
|
|
910
|
-
var i = `filter-table${r.class ? ` ${r.class}` : ""}`, a = Me("results"), o = K("results"), s = G() !== "results", l = Me("filters"), f = K("filters"), p = G() !== "filters";
|
|
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";
|
|
911
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;
|
|
912
1035
|
}, {
|
|
913
1036
|
e: void 0,
|
|
@@ -921,14 +1044,14 @@ function Me(e) {
|
|
|
921
1044
|
})();
|
|
922
1045
|
}
|
|
923
1046
|
r([
|
|
924
|
-
"input",
|
|
925
1047
|
"click",
|
|
1048
|
+
"input",
|
|
926
1049
|
"keydown"
|
|
927
1050
|
]);
|
|
928
1051
|
//#endregion
|
|
929
1052
|
//#region src/search-bar.tsx
|
|
930
|
-
var
|
|
931
|
-
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) {
|
|
932
1055
|
let r, s = () => e.shortcutKey ?? "k", l = () => e.shortcutLabel ?? `Ctrl ${String(s()).toUpperCase()}`;
|
|
933
1056
|
return x(() => {
|
|
934
1057
|
let e = (e) => {
|
|
@@ -937,43 +1060,43 @@ function Fe(e) {
|
|
|
937
1060
|
};
|
|
938
1061
|
document.addEventListener("keydown", e), b(() => document.removeEventListener("keydown", e));
|
|
939
1062
|
}), (() => {
|
|
940
|
-
var u =
|
|
941
|
-
a(u, n(
|
|
1063
|
+
var u = Ie(), d = u.firstChild;
|
|
1064
|
+
a(u, n(Y, {
|
|
942
1065
|
size: 17,
|
|
943
1066
|
class: "search-bar-icon",
|
|
944
1067
|
"aria-hidden": "true"
|
|
945
|
-
}),
|
|
946
|
-
var
|
|
947
|
-
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, {
|
|
948
1071
|
get when() {
|
|
949
1072
|
return o(() => !e.value)() && s() !== !1;
|
|
950
1073
|
},
|
|
951
1074
|
get children() {
|
|
952
|
-
var e =
|
|
1075
|
+
var e = Pe();
|
|
953
1076
|
return a(e, l), e;
|
|
954
1077
|
}
|
|
955
|
-
}), null), a(u, n(
|
|
1078
|
+
}), null), a(u, n(m, {
|
|
956
1079
|
get when() {
|
|
957
1080
|
return e.value;
|
|
958
1081
|
},
|
|
959
1082
|
get children() {
|
|
960
|
-
var t =
|
|
961
|
-
return t.$$click = () => e.onInput(""), a(t, n(
|
|
1083
|
+
var t = Fe();
|
|
1084
|
+
return t.$$click = () => e.onInput(""), a(t, n(X, {
|
|
962
1085
|
size: 15,
|
|
963
1086
|
"aria-hidden": "true"
|
|
964
1087
|
})), i(() => c(t, "aria-label", e.clearLabel ?? "Clear search")), t;
|
|
965
1088
|
}
|
|
966
1089
|
}), null), i((n) => {
|
|
967
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()}`;
|
|
968
|
-
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;
|
|
969
1092
|
}, {
|
|
970
1093
|
e: void 0,
|
|
971
1094
|
t: void 0,
|
|
972
1095
|
a: void 0,
|
|
973
1096
|
o: void 0
|
|
974
|
-
}), i(() =>
|
|
1097
|
+
}), i(() => d.value = e.value), u;
|
|
975
1098
|
})();
|
|
976
1099
|
}
|
|
977
1100
|
r(["input", "click"]);
|
|
978
1101
|
//#endregion
|
|
979
|
-
export {
|
|
1102
|
+
export { I as Combobox, le as DataTable, Ne as FilterTable, Le as SearchBar };
|