@serkonda7/solid-components 0.0.7 → 0.0.8
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/index.js +184 -129
- package/package.json +1 -2
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,60 +1,115 @@
|
|
|
1
|
-
import { Dynamic as e, className as t, createComponent as n, delegateEvents as r, effect as i, insert as a, memo as o,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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, template as u, use as d } from "solid-js/web";
|
|
2
|
+
import { For as f, Show as p, createEffect as m, createMemo as h, createSignal as g, createUniqueId as _, onCleanup as v, onMount as y, splitProps as b } from "solid-js";
|
|
3
|
+
//#region node_modules/@tabler/icons-solidjs/dist/source/defaultAttributes.js
|
|
4
|
+
var x = {
|
|
5
|
+
outline: {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: 24,
|
|
8
|
+
height: 24,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": 2,
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round"
|
|
15
|
+
},
|
|
16
|
+
filled: {
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
width: 24,
|
|
19
|
+
height: 24,
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
fill: "currentColor",
|
|
22
|
+
stroke: "none"
|
|
23
|
+
}
|
|
24
|
+
}, S = /*#__PURE__*/ u("<svg>"), C = /*#__PURE__*/ u("<title>"), w = (t, r, i, c) => {
|
|
25
|
+
let u = (i) => {
|
|
26
|
+
let [u, d] = b(i, [
|
|
27
|
+
"color",
|
|
28
|
+
"size",
|
|
29
|
+
"stroke",
|
|
30
|
+
"strokeWidth",
|
|
31
|
+
"title",
|
|
32
|
+
"children",
|
|
33
|
+
"class"
|
|
34
|
+
]), f = x[t], p = u.stroke ?? u.strokeWidth;
|
|
35
|
+
return (() => {
|
|
36
|
+
var i = S();
|
|
37
|
+
return l(i, s(f, d, {
|
|
38
|
+
get width() {
|
|
39
|
+
return o(() => u.size != null)() ? u.size : f.width;
|
|
40
|
+
},
|
|
41
|
+
get height() {
|
|
42
|
+
return o(() => u.size != null)() ? u.size : f.height;
|
|
43
|
+
},
|
|
44
|
+
get class() {
|
|
45
|
+
return `tabler-icon tabler-icon-${r}${u.class ? ` ${u.class}` : ""}`;
|
|
46
|
+
}
|
|
47
|
+
}, () => t === "filled" ? { fill: u.color == null ? "currentColor" : u.color } : {
|
|
48
|
+
stroke: u.color == null ? "currentColor" : u.color,
|
|
49
|
+
"stroke-width": p ?? f["stroke-width"]
|
|
50
|
+
}), !0, !0), a(i, (() => {
|
|
51
|
+
var e = o(() => u.title != null);
|
|
52
|
+
return () => e() && (() => {
|
|
53
|
+
var e = C();
|
|
54
|
+
return a(e, () => u.title), e;
|
|
55
|
+
})();
|
|
56
|
+
})(), null), a(i, () => c.map(([t, r]) => n(e, s({ component: t }, r))), null), a(i, () => u.children, null), i;
|
|
57
|
+
})();
|
|
58
|
+
};
|
|
59
|
+
return u.displayName = `${i}`, u;
|
|
60
|
+
}, T = w("outline", "chevron-down", "ChevronDown", [["path", { d: "M6 9l6 6l6 -6" }]]), E = w("outline", "plus", "Plus", [["path", { d: "M12 5l0 14" }], ["path", { d: "M5 12l14 0" }]]), D = /*#__PURE__*/ u("<span class=combobox-value aria-hidden=true><span class=combobox-option-label></span><span class=combobox-detail>"), ee = /*#__PURE__*/ u("<div role=option class=\"combobox-option combobox-option-add\">"), O = /*#__PURE__*/ u("<div class=combobox-list role=listbox>"), k = /*#__PURE__*/ u("<div><input class=combobox-input role=combobox aria-autocomplete=list autocomplete=off>"), A = /*#__PURE__*/ u("<span class=combobox-icon aria-hidden=true>"), te = /*#__PURE__*/ u("<div class=combobox-empty>"), j = /*#__PURE__*/ u("<span class=combobox-detail>"), M = /*#__PURE__*/ u("<div role=option class=combobox-option><span class=combobox-option-label>"), N = /*#__PURE__*/ u("<span class=combobox-option-icon aria-hidden=true>");
|
|
61
|
+
function P(r) {
|
|
62
|
+
let s, l, u = _(), v = () => r.id ?? u, b = () => `${v()}-listbox`, x = (e) => `${v()}-option-${e}`, [S, C] = g(!1), [w, P] = g(""), [F, I] = g(0), L = h(() => r.emptyLabel === void 0 ? r.options : [{
|
|
8
63
|
value: "",
|
|
9
64
|
label: r.emptyLabel
|
|
10
|
-
}, ...r.options]),
|
|
11
|
-
let e =
|
|
12
|
-
return e === "" ?
|
|
13
|
-
}),
|
|
65
|
+
}, ...r.options]), R = h(() => r.value === "" ? void 0 : L().find((e) => String(e.value) === r.value)), z = h(() => {
|
|
66
|
+
let e = w().trim().toLowerCase();
|
|
67
|
+
return e === "" ? L() : L().filter((t) => t.label.toLowerCase().includes(e) || (t.detail?.toLowerCase().includes(e) ?? !1));
|
|
68
|
+
}), ne = () => r.options.some((e) => e.detail !== void 0), B = () => z().length, V = () => z().length + +!!r.onAdd, re = () => !r.disabled && r.onChange !== void 0;
|
|
14
69
|
y(() => {
|
|
15
|
-
r.autofocus === !0 &&
|
|
70
|
+
r.autofocus === !0 && s?.focus();
|
|
16
71
|
}), m(() => {
|
|
17
|
-
|
|
72
|
+
S() && l?.querySelector(`[data-index="${F()}"]`)?.scrollIntoView({ block: "nearest" });
|
|
18
73
|
});
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
let e =
|
|
23
|
-
|
|
74
|
+
function H() {
|
|
75
|
+
if (S() || !re()) return;
|
|
76
|
+
P("");
|
|
77
|
+
let e = L().findIndex((e) => String(e.value) === r.value);
|
|
78
|
+
I(Math.max(e, 0)), C(!0), r.onOpen?.();
|
|
24
79
|
}
|
|
25
|
-
function
|
|
26
|
-
if (
|
|
27
|
-
r.onAdd(
|
|
80
|
+
function U(e) {
|
|
81
|
+
if (C(!1), r.onAdd && e === B()) {
|
|
82
|
+
r.onAdd(w().trim());
|
|
28
83
|
return;
|
|
29
84
|
}
|
|
30
|
-
let t =
|
|
85
|
+
let t = z()[e];
|
|
31
86
|
t && String(t.value) !== r.value && r.onChange?.(String(t.value));
|
|
32
87
|
}
|
|
33
|
-
function
|
|
34
|
-
let t =
|
|
35
|
-
|
|
88
|
+
function W(e) {
|
|
89
|
+
let t = V();
|
|
90
|
+
S() ? t > 0 && I((F() + e + t) % t) : H();
|
|
36
91
|
}
|
|
37
|
-
function
|
|
92
|
+
function G(e) {
|
|
38
93
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
39
|
-
e.preventDefault(),
|
|
94
|
+
e.preventDefault(), W(e.key === "ArrowDown" ? 1 : -1);
|
|
40
95
|
return;
|
|
41
96
|
}
|
|
42
|
-
|
|
97
|
+
S() && (e.key === "Enter" ? (e.preventDefault(), U(F())) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), C(!1)));
|
|
43
98
|
}
|
|
44
|
-
let
|
|
99
|
+
let K = () => S() ? R()?.label ?? r.emptyLabel ?? r.searchLabel ?? "Search" : r.emptyLabel;
|
|
45
100
|
return (() => {
|
|
46
|
-
var
|
|
47
|
-
|
|
101
|
+
var u = k(), m = u.firstChild;
|
|
102
|
+
m.addEventListener("blur", () => C(!1)), m.$$keydown = G, m.$$input = (e) => {
|
|
48
103
|
let t = e.currentTarget.value;
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
var
|
|
52
|
-
return typeof
|
|
104
|
+
H(), P(t), I(0);
|
|
105
|
+
}, m.$$click = H;
|
|
106
|
+
var h = s;
|
|
107
|
+
return typeof h == "function" ? d(h, m) : s = m, a(u, n(p, {
|
|
53
108
|
get when() {
|
|
54
|
-
return o(() => !
|
|
109
|
+
return o(() => !S())() && R()?.icon;
|
|
55
110
|
},
|
|
56
111
|
children: (t) => (() => {
|
|
57
|
-
var r =
|
|
112
|
+
var r = A();
|
|
58
113
|
return a(r, n(e, {
|
|
59
114
|
get component() {
|
|
60
115
|
return t();
|
|
@@ -62,42 +117,42 @@ function O(r) {
|
|
|
62
117
|
size: 14
|
|
63
118
|
})), r;
|
|
64
119
|
})()
|
|
65
|
-
}), null), a(
|
|
120
|
+
}), null), a(u, n(p, {
|
|
66
121
|
get when() {
|
|
67
|
-
return o(() => !
|
|
122
|
+
return o(() => !S())() && R()?.detail;
|
|
68
123
|
},
|
|
69
124
|
get children() {
|
|
70
|
-
var e =
|
|
71
|
-
return a(t, () =>
|
|
125
|
+
var e = D(), t = e.firstChild, n = t.nextSibling;
|
|
126
|
+
return a(t, () => R()?.label), a(n, () => R()?.detail), e;
|
|
72
127
|
}
|
|
73
|
-
}), null), a(
|
|
128
|
+
}), null), a(u, n(T, {
|
|
74
129
|
class: "combobox-chevron",
|
|
75
130
|
size: 16,
|
|
76
131
|
"aria-hidden": "true"
|
|
77
|
-
}), null), a(
|
|
132
|
+
}), null), a(u, n(p, {
|
|
78
133
|
get when() {
|
|
79
|
-
return
|
|
134
|
+
return S();
|
|
80
135
|
},
|
|
81
136
|
get children() {
|
|
82
|
-
var t =
|
|
83
|
-
return typeof o == "function" ?
|
|
137
|
+
var t = O(), o = l;
|
|
138
|
+
return typeof o == "function" ? d(o, t) : l = t, a(t, n(f, {
|
|
84
139
|
get each() {
|
|
85
|
-
return
|
|
140
|
+
return z();
|
|
86
141
|
},
|
|
87
142
|
get fallback() {
|
|
88
143
|
return (() => {
|
|
89
|
-
var e =
|
|
144
|
+
var e = te();
|
|
90
145
|
return a(e, () => r.noMatchesLabel ?? "No matching objects"), e;
|
|
91
146
|
})();
|
|
92
147
|
},
|
|
93
148
|
children: (t, o) => (() => {
|
|
94
|
-
var
|
|
95
|
-
return
|
|
149
|
+
var s = M(), l = s.firstChild;
|
|
150
|
+
return s.$$click = () => U(o()), s.$$mousemove = () => I(o()), s.$$mousedown = (e) => e.preventDefault(), a(l, n(p, {
|
|
96
151
|
get when() {
|
|
97
152
|
return t.icon;
|
|
98
153
|
},
|
|
99
154
|
children: (t) => (() => {
|
|
100
|
-
var r =
|
|
155
|
+
var r = N();
|
|
101
156
|
return a(r, n(e, {
|
|
102
157
|
get component() {
|
|
103
158
|
return t();
|
|
@@ -105,37 +160,37 @@ function O(r) {
|
|
|
105
160
|
size: 14
|
|
106
161
|
})), r;
|
|
107
162
|
})()
|
|
108
|
-
}), null), a(l, () => t.label, null), a(
|
|
163
|
+
}), null), a(l, () => t.label, null), a(s, n(p, {
|
|
109
164
|
get when() {
|
|
110
165
|
return t.detail;
|
|
111
166
|
},
|
|
112
167
|
get children() {
|
|
113
|
-
var e =
|
|
168
|
+
var e = j();
|
|
114
169
|
return a(e, () => t.detail), e;
|
|
115
170
|
}
|
|
116
171
|
}), null), i((e) => {
|
|
117
|
-
var n =
|
|
118
|
-
return n !== e.e && s
|
|
172
|
+
var n = x(o()), i = o(), a = String(t.value) === r.value, l = o() === F(), u = t.value === "";
|
|
173
|
+
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;
|
|
119
174
|
}, {
|
|
120
175
|
e: void 0,
|
|
121
176
|
t: void 0,
|
|
122
177
|
a: void 0,
|
|
123
178
|
o: void 0,
|
|
124
179
|
i: void 0
|
|
125
|
-
}),
|
|
180
|
+
}), s;
|
|
126
181
|
})()
|
|
127
182
|
}), null), a(t, n(p, {
|
|
128
183
|
get when() {
|
|
129
184
|
return r.onAdd;
|
|
130
185
|
},
|
|
131
186
|
get children() {
|
|
132
|
-
var e =
|
|
133
|
-
return e.$$click = () =>
|
|
187
|
+
var e = ee();
|
|
188
|
+
return e.$$click = () => U(B()), e.$$mousemove = () => I(B()), e.$$mousedown = (e) => e.preventDefault(), c(e, "aria-selected", !1), a(e, n(E, {
|
|
134
189
|
size: 14,
|
|
135
190
|
"aria-hidden": "true"
|
|
136
191
|
}), null), a(e, () => r.addLabel ?? "Add", null), i((t) => {
|
|
137
|
-
var n =
|
|
138
|
-
return n !== t.e &&
|
|
192
|
+
var n = x(B()), r = B(), i = B() === F();
|
|
193
|
+
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;
|
|
139
194
|
}, {
|
|
140
195
|
e: void 0,
|
|
141
196
|
t: void 0,
|
|
@@ -143,16 +198,16 @@ function O(r) {
|
|
|
143
198
|
}), e;
|
|
144
199
|
}
|
|
145
200
|
}), null), i((e) => {
|
|
146
|
-
var n = !!
|
|
147
|
-
return n !== e.e && t.classList.toggle("combobox-list-detail", e.e = n), r !== e.t &&
|
|
201
|
+
var n = !!ne(), r = b();
|
|
202
|
+
return n !== e.e && t.classList.toggle("combobox-list-detail", e.e = n), r !== e.t && c(t, "id", e.t = r), e;
|
|
148
203
|
}, {
|
|
149
204
|
e: void 0,
|
|
150
205
|
t: void 0
|
|
151
206
|
}), t;
|
|
152
207
|
}
|
|
153
208
|
}), null), i((e) => {
|
|
154
|
-
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!
|
|
155
|
-
return n !== e.e && t(
|
|
209
|
+
var n = r.class ? `combobox ${r.class}` : "combobox", i = !!S(), a = !(S() || !R()?.detail), o = !(S() || R()?.icon === void 0), s = v(), l = S(), d = b(), f = S() && V() > 0 ? x(F()) : void 0, p = r.ariaLabel, h = r.describedBy, g = r.required, _ = r.disabled, y = r.onChange === void 0, C = r.value, w = K();
|
|
210
|
+
return n !== e.e && t(u, e.e = n), i !== e.t && u.classList.toggle("combobox-open", e.t = i), a !== e.a && u.classList.toggle("combobox-with-detail", e.a = a), o !== e.o && u.classList.toggle("combobox-with-icon", e.o = o), s !== e.i && c(m, "id", e.i = s), l !== e.n && c(m, "aria-expanded", e.n = l), d !== e.s && c(m, "aria-controls", e.s = d), f !== e.h && c(m, "aria-activedescendant", e.h = f), p !== e.r && c(m, "aria-label", e.r = p), h !== e.d && c(m, "aria-describedby", e.d = h), g !== e.l && (m.required = e.l = g), _ !== e.u && (m.disabled = e.u = _), y !== e.c && (m.readOnly = e.c = y), C !== e.w && c(m, "data-value", e.w = C), w !== e.m && c(m, "placeholder", e.m = w), e;
|
|
156
211
|
}, {
|
|
157
212
|
e: void 0,
|
|
158
213
|
t: void 0,
|
|
@@ -169,7 +224,7 @@ function O(r) {
|
|
|
169
224
|
c: void 0,
|
|
170
225
|
w: void 0,
|
|
171
226
|
m: void 0
|
|
172
|
-
}), i(() =>
|
|
227
|
+
}), i(() => m.value = S() ? w() : R()?.label ?? ""), u;
|
|
173
228
|
})();
|
|
174
229
|
}
|
|
175
230
|
r([
|
|
@@ -181,55 +236,55 @@ r([
|
|
|
181
236
|
]);
|
|
182
237
|
//#endregion
|
|
183
238
|
//#region src/data-table.tsx
|
|
184
|
-
var
|
|
185
|
-
function
|
|
239
|
+
var F = /*#__PURE__*/ u("<div role=dialog class=data-table-customizer-panel><p class=data-table-customizer-title></p><ul class=data-table-customizer-list></ul><div class=data-table-customizer-actions><button type=button></button><button type=button>"), I = /*#__PURE__*/ u("<div class=data-table-toolbar><div class=data-table-customizer><button type=button class=data-table-customizer-button aria-haspopup=dialog><span aria-hidden=true>⚙</span> "), L = /*#__PURE__*/ u("<th class=data-table-checkbox><span class=data-table-visually-hidden>Select rows</span><input type=checkbox>"), R = /*#__PURE__*/ u("<th>Actions"), z = /*#__PURE__*/ u("<div><div class=data-table-scroll><table class=data-table><thead><tr></tr></thead><tbody>"), ne = /*#__PURE__*/ u("<li><label class=data-table-customizer-option><input type=checkbox>"), B = /*#__PURE__*/ u("<button type=button class=data-table-sort><span class=data-table-sort-indicator aria-hidden=true>"), V = /*#__PURE__*/ u("<th>"), re = /*#__PURE__*/ u("<td class=data-table-checkbox><input type=checkbox>"), H = /*#__PURE__*/ u("<td>"), U = /*#__PURE__*/ u("<tr>"), W = /*#__PURE__*/ u("<p class=data-table-status>Loading…"), G = /*#__PURE__*/ u("<p class=data-table-status>No results.");
|
|
240
|
+
function K(e) {
|
|
186
241
|
return typeof e == "function" ? e() : e;
|
|
187
242
|
}
|
|
188
|
-
function
|
|
189
|
-
let r = h(() =>
|
|
190
|
-
let t =
|
|
243
|
+
function q(e) {
|
|
244
|
+
let r = h(() => K(e.rows)), s = () => K(e.loading ?? !1), l = () => K(e.selected ?? []), u = e.sortKey !== void 0 || e.sortDirection !== void 0, [y, b] = g(e.defaultSort), x = () => u ? K(e.sortKey ?? void 0) : y()?.key, S = () => u ? K(e.sortDirection ?? "asc") : y()?.direction ?? "asc", C = () => K(e.showColumnCustomizer ?? !1), w = () => e.selected !== void 0 && e.onSelectionChange !== void 0, T = () => {
|
|
245
|
+
let t = l();
|
|
191
246
|
return r().length > 0 && r().every((n) => t.includes(e.getRowId(n)));
|
|
192
|
-
}, E = h(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [D, ee] = g(void 0), O = () => e.visibleColumns === void 0 ? D() ?? E() :
|
|
193
|
-
function
|
|
247
|
+
}, E = h(() => e.defaultVisibleColumns ?? e.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [D, ee] = g(void 0), O = () => e.visibleColumns === void 0 ? D() ?? E() : K(e.visibleColumns), k = h(() => new Set(O())), A = h(() => e.columns.filter((e) => e.toggleable === !1 || k().has(e.key))), te = h(() => e.columns.filter((e) => e.toggleable !== !1)), j = h(() => te().map((e) => e.key));
|
|
248
|
+
function M(e, t) {
|
|
194
249
|
return t.sortValue ? t.sortValue(e) : e[t.key];
|
|
195
250
|
}
|
|
196
|
-
function
|
|
251
|
+
function N(e, t) {
|
|
197
252
|
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 });
|
|
198
253
|
}
|
|
199
|
-
let
|
|
254
|
+
let P = h(() => {
|
|
200
255
|
let t = r(), n = x();
|
|
201
|
-
if (
|
|
256
|
+
if (u || !n) return t;
|
|
202
257
|
let i = e.columns.find((e) => e.key === n);
|
|
203
258
|
if (!i) return t;
|
|
204
259
|
let a = S() === "asc" ? 1 : -1;
|
|
205
|
-
return [...t].sort((e, t) => a *
|
|
260
|
+
return [...t].sort((e, t) => a * N(M(e, i), M(t, i)));
|
|
206
261
|
});
|
|
207
|
-
function
|
|
262
|
+
function q(t) {
|
|
208
263
|
let n = x() === t, r = n && S() === "desc" ? void 0 : {
|
|
209
264
|
key: t,
|
|
210
265
|
direction: n ? "desc" : "asc"
|
|
211
266
|
};
|
|
212
|
-
|
|
267
|
+
u || b(r), e.onSort?.(t), r || e.onSortClear?.(), e.onSortChange?.(r);
|
|
213
268
|
}
|
|
214
|
-
function
|
|
269
|
+
function ie(t) {
|
|
215
270
|
let n = new Map(e.columns.map((e, t) => [e.key, t]));
|
|
216
271
|
return [...t].sort((e, t) => (n.get(e) ?? 0) - (n.get(t) ?? 0));
|
|
217
272
|
}
|
|
218
|
-
function
|
|
219
|
-
let n =
|
|
273
|
+
function J(t) {
|
|
274
|
+
let n = ie(t);
|
|
220
275
|
e.visibleColumns === void 0 && ee(n), e.onVisibleColumnsChange?.(n);
|
|
221
276
|
}
|
|
222
|
-
function
|
|
277
|
+
function ae(e, t) {
|
|
223
278
|
let n = new Set(O());
|
|
224
|
-
t ? n.add(e) : n.delete(e),
|
|
225
|
-
}
|
|
226
|
-
function ae() {
|
|
227
|
-
Y(K());
|
|
279
|
+
t ? n.add(e) : n.delete(e), J(j().filter((e) => n.has(e)));
|
|
228
280
|
}
|
|
229
281
|
function oe() {
|
|
230
|
-
|
|
282
|
+
J(j());
|
|
283
|
+
}
|
|
284
|
+
function se() {
|
|
285
|
+
J(E());
|
|
231
286
|
}
|
|
232
|
-
let
|
|
287
|
+
let Y = `${_()}-panel`, [X, Z] = g(!1), Q;
|
|
233
288
|
m(() => {
|
|
234
289
|
if (!X() || !C()) return;
|
|
235
290
|
function e(e) {
|
|
@@ -244,117 +299,117 @@ function U(e) {
|
|
|
244
299
|
});
|
|
245
300
|
let $;
|
|
246
301
|
m(() => {
|
|
247
|
-
$ && ($.indeterminate =
|
|
302
|
+
$ && ($.indeterminate = l().length > 0 && !T());
|
|
248
303
|
});
|
|
249
304
|
function ce(t) {
|
|
250
305
|
e.onSelectionChange?.(t ? r().map(e.getRowId) : []);
|
|
251
306
|
}
|
|
252
307
|
function le(t, n) {
|
|
253
|
-
let r = e.getRowId(t), i =
|
|
308
|
+
let r = e.getRowId(t), i = l(), a = n ? [...i, r] : i.filter((e) => e !== r);
|
|
254
309
|
e.onSelectionChange?.(a);
|
|
255
310
|
}
|
|
256
311
|
function ue(t) {
|
|
257
|
-
return
|
|
312
|
+
return l().includes(e.getRowId(t));
|
|
258
313
|
}
|
|
259
314
|
function de(e) {
|
|
260
|
-
return e.toggleable === !1 ||
|
|
315
|
+
return e.toggleable === !1 || k().has(e.key);
|
|
261
316
|
}
|
|
262
317
|
function fe(t, n) {
|
|
263
318
|
return e.getCell?.(t, n) ?? n.getValue?.(t) ?? null;
|
|
264
319
|
}
|
|
265
320
|
return (() => {
|
|
266
|
-
var
|
|
267
|
-
return a(
|
|
321
|
+
var l = z(), m = l.firstChild, h = m.firstChild.firstChild, g = h.firstChild, _ = h.nextSibling;
|
|
322
|
+
return a(l, n(p, {
|
|
268
323
|
get when() {
|
|
269
324
|
return C();
|
|
270
325
|
},
|
|
271
326
|
get children() {
|
|
272
|
-
var t =
|
|
327
|
+
var t = I(), r = t.firstChild, o = r.firstChild;
|
|
273
328
|
o.firstChild.nextSibling;
|
|
274
|
-
var
|
|
275
|
-
return typeof
|
|
329
|
+
var s = Q;
|
|
330
|
+
return typeof s == "function" ? d(s, r) : Q = r, o.$$click = () => Z((e) => !e), c(o, "aria-controls", Y), a(o, () => e.columnCustomizerLabel ?? "Columns", null), a(r, n(p, {
|
|
276
331
|
get when() {
|
|
277
332
|
return X();
|
|
278
333
|
},
|
|
279
334
|
get children() {
|
|
280
|
-
var t =
|
|
281
|
-
return
|
|
335
|
+
var t = F(), r = t.firstChild, o = r.nextSibling, s = o.nextSibling.firstChild, l = s.nextSibling;
|
|
336
|
+
return c(t, "id", Y), a(r, () => e.columnCustomizerTitle ?? "Shown columns"), a(o, n(f, {
|
|
282
337
|
get each() {
|
|
283
338
|
return e.columns;
|
|
284
339
|
},
|
|
285
340
|
children: (e) => (() => {
|
|
286
|
-
var t =
|
|
287
|
-
return r.addEventListener("change", (t) =>
|
|
341
|
+
var t = ne(), n = t.firstChild, r = n.firstChild;
|
|
342
|
+
return r.addEventListener("change", (t) => ae(e.key, t.currentTarget.checked)), a(n, () => e.ariaLabel ?? e.label, null), i(() => r.disabled = e.toggleable === !1), i(() => r.checked = de(e)), t;
|
|
288
343
|
})()
|
|
289
|
-
})),
|
|
344
|
+
})), s.$$click = oe, a(s, () => e.columnCustomizerShowAllLabel ?? "Show all"), l.$$click = se, a(l, () => e.columnCustomizerResetLabel ?? "Reset"), i(() => c(t, "aria-label", e.columnCustomizerTitle ?? "Customize columns")), t;
|
|
290
345
|
}
|
|
291
|
-
}), null), i(() =>
|
|
346
|
+
}), null), i(() => c(o, "aria-expanded", X())), t;
|
|
292
347
|
}
|
|
293
348
|
}), m), a(g, n(p, {
|
|
294
349
|
get when() {
|
|
295
350
|
return w();
|
|
296
351
|
},
|
|
297
352
|
get children() {
|
|
298
|
-
var t =
|
|
353
|
+
var t = L(), n = t.firstChild.nextSibling;
|
|
299
354
|
n.addEventListener("change", (e) => ce(e.currentTarget.checked));
|
|
300
355
|
var r = $;
|
|
301
|
-
return typeof r == "function" ?
|
|
356
|
+
return typeof r == "function" ? d(r, n) : $ = n, i(() => c(n, "aria-label", e.selectionLabel ?? "Select all rows")), i(() => n.checked = T()), t;
|
|
302
357
|
}
|
|
303
358
|
}), null), a(g, n(f, {
|
|
304
359
|
get each() {
|
|
305
|
-
return
|
|
360
|
+
return A();
|
|
306
361
|
},
|
|
307
362
|
children: (r) => (() => {
|
|
308
|
-
var
|
|
309
|
-
return a(
|
|
363
|
+
var s = V();
|
|
364
|
+
return a(s, n(p, {
|
|
310
365
|
get when() {
|
|
311
|
-
return o(() => !!r.sortable)() && (!
|
|
366
|
+
return o(() => !!r.sortable)() && (!u || e.onSort || e.onSortChange);
|
|
312
367
|
},
|
|
313
368
|
get fallback() {
|
|
314
369
|
return r.label;
|
|
315
370
|
},
|
|
316
371
|
get children() {
|
|
317
|
-
var e =
|
|
318
|
-
return e.$$click = () =>
|
|
372
|
+
var e = B(), t = e.firstChild;
|
|
373
|
+
return e.$$click = () => q(r.key), a(e, () => r.label, t), a(t, (() => {
|
|
319
374
|
var e = o(() => x() === r.key);
|
|
320
375
|
return () => e() ? S() === "asc" ? "▲" : "▼" : "";
|
|
321
376
|
})()), e;
|
|
322
377
|
}
|
|
323
378
|
})), i((e) => {
|
|
324
379
|
var n = r.class, i = r.sortable ? x() === r.key ? S() === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
325
|
-
return n !== e.e && t(
|
|
380
|
+
return n !== e.e && t(s, e.e = n), i !== e.t && c(s, "aria-sort", e.t = i), e;
|
|
326
381
|
}, {
|
|
327
382
|
e: void 0,
|
|
328
383
|
t: void 0
|
|
329
|
-
}),
|
|
384
|
+
}), s;
|
|
330
385
|
})()
|
|
331
386
|
}), null), a(g, n(p, {
|
|
332
387
|
get when() {
|
|
333
388
|
return e.rowActions;
|
|
334
389
|
},
|
|
335
390
|
get children() {
|
|
336
|
-
return
|
|
391
|
+
return R();
|
|
337
392
|
}
|
|
338
393
|
}), null), a(_, n(f, {
|
|
339
394
|
get each() {
|
|
340
|
-
return
|
|
395
|
+
return P();
|
|
341
396
|
},
|
|
342
397
|
children: (r) => (() => {
|
|
343
|
-
var o =
|
|
398
|
+
var o = U();
|
|
344
399
|
return a(o, n(p, {
|
|
345
400
|
get when() {
|
|
346
401
|
return w();
|
|
347
402
|
},
|
|
348
403
|
get children() {
|
|
349
|
-
var t =
|
|
350
|
-
return n.addEventListener("change", (e) => le(r, e.currentTarget.checked)), i(() =>
|
|
404
|
+
var t = re(), n = t.firstChild;
|
|
405
|
+
return n.addEventListener("change", (e) => le(r, e.currentTarget.checked)), i(() => c(n, "aria-label", `Select row ${e.getRowId(r)}`)), i(() => n.checked = ue(r)), t;
|
|
351
406
|
}
|
|
352
407
|
}), null), a(o, n(f, {
|
|
353
408
|
get each() {
|
|
354
|
-
return
|
|
409
|
+
return A();
|
|
355
410
|
},
|
|
356
411
|
children: (e) => (() => {
|
|
357
|
-
var n =
|
|
412
|
+
var n = H();
|
|
358
413
|
return a(n, () => fe(r, e)), i(() => t(n, e.class)), n;
|
|
359
414
|
})()
|
|
360
415
|
}), null), a(o, n(p, {
|
|
@@ -362,28 +417,28 @@ function U(e) {
|
|
|
362
417
|
return e.rowActions;
|
|
363
418
|
},
|
|
364
419
|
get children() {
|
|
365
|
-
var t =
|
|
420
|
+
var t = H();
|
|
366
421
|
return a(t, () => e.rowActions?.(r)), t;
|
|
367
422
|
}
|
|
368
423
|
}), null), o;
|
|
369
424
|
})()
|
|
370
|
-
})), a(
|
|
425
|
+
})), a(l, n(p, {
|
|
371
426
|
get when() {
|
|
372
|
-
return
|
|
427
|
+
return s();
|
|
373
428
|
},
|
|
374
429
|
get children() {
|
|
375
|
-
return e.loadingContent ??
|
|
430
|
+
return e.loadingContent ?? W();
|
|
376
431
|
}
|
|
377
|
-
}), null), a(
|
|
432
|
+
}), null), a(l, n(p, {
|
|
378
433
|
get when() {
|
|
379
|
-
return o(() => !
|
|
434
|
+
return o(() => !s())() && (e.empty === void 0 ? r().length === 0 : K(e.empty));
|
|
380
435
|
},
|
|
381
436
|
get children() {
|
|
382
|
-
return e.emptyContent ??
|
|
437
|
+
return e.emptyContent ?? G();
|
|
383
438
|
}
|
|
384
|
-
}), null), i(() => t(
|
|
439
|
+
}), null), i(() => t(l, `data-table-wrap${e.class ? ` ${e.class}` : ""}`)), l;
|
|
385
440
|
})();
|
|
386
441
|
}
|
|
387
442
|
r(["click"]);
|
|
388
443
|
//#endregion
|
|
389
|
-
export {
|
|
444
|
+
export { P as Combobox, q as DataTable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serkonda7/solid-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Reusable components for SolidJS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "serkonda7",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"packageManager": "bun@1.4.2",
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@tabler/icons-solidjs": ">=3.0.0",
|
|
43
42
|
"solid-js": ">=1.9.0"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|