@cascivo/react 0.18.0 → 1.0.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 +4 -3
- package/dist/action-sheet/action-sheet.js +1 -1
- package/dist/breadcrumb/breadcrumb.js +7 -7
- package/dist/checkbox/checkbox.js +11 -10
- package/dist/color-picker/color-picker.js +81 -77
- package/dist/combobox/combobox.js +81 -76
- package/dist/command-menu/command-menu.js +104 -104
- package/dist/comparison/comparison.js +18 -18
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +148 -121
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.js +98 -93
- package/dist/date-range-picker/date-range-picker.js +1 -1
- package/dist/dock/dock.js +2 -2
- package/dist/dropdown/dropdown.js +43 -40
- package/dist/editable/editable.js +29 -20
- package/dist/fab/fab.js +37 -37
- package/dist/field/field.js +24 -17
- package/dist/file-uploader/file-uploader.js +24 -23
- package/dist/filter/filter.js +11 -11
- package/dist/index.d.ts +1302 -85
- package/dist/input/input.js +14 -13
- package/dist/navigation-menu/navigation-menu.js +9 -9
- package/dist/node/action-sheet/action-sheet.js +1 -1
- package/dist/node/breadcrumb/breadcrumb.js +7 -7
- package/dist/node/checkbox/checkbox.js +11 -10
- package/dist/node/color-picker/color-picker.js +81 -77
- package/dist/node/combobox/combobox.js +81 -76
- package/dist/node/command-menu/command-menu.js +104 -104
- package/dist/node/comparison/comparison.js +18 -18
- package/dist/node/data-table/data-table.js +148 -121
- package/dist/node/data-table/data-table.module.js +29 -29
- package/dist/node/date-picker/date-picker.js +98 -93
- package/dist/node/date-range-picker/date-range-picker.js +1 -1
- package/dist/node/dock/dock.js +2 -2
- package/dist/node/dropdown/dropdown.js +43 -40
- package/dist/node/editable/editable.js +29 -20
- package/dist/node/fab/fab.js +37 -37
- package/dist/node/field/field.js +24 -17
- package/dist/node/file-uploader/file-uploader.js +24 -23
- package/dist/node/filter/filter.js +11 -11
- package/dist/node/input/input.js +14 -13
- package/dist/node/navigation-menu/navigation-menu.js +9 -9
- package/dist/node/number-input/number-input.js +28 -27
- package/dist/node/overflow-menu/overflow-menu.js +7 -7
- package/dist/node/progress/progress.js +3 -3
- package/dist/node/progress-circle/progress-circle.js +8 -8
- package/dist/node/progress-indicator/progress-indicator.js +1 -1
- package/dist/node/qr-code/qr-code.js +11 -11
- package/dist/node/radial-progress/radial-progress.js +9 -9
- package/dist/node/radio/radio.js +10 -9
- package/dist/node/react/src/index.js +93 -93
- package/dist/node/resizable/resizable.js +24 -24
- package/dist/node/search/search.js +35 -31
- package/dist/node/select/select.js +15 -14
- package/dist/node/side-nav/side-nav.js +35 -35
- package/dist/node/side-nav/side-nav.module.js +27 -27
- package/dist/node/slider/slider.js +13 -12
- package/dist/node/spinner/spinner.js +4 -4
- package/dist/node/steps/steps.js +10 -10
- package/dist/node/structured-list/structured-list.js +14 -14
- package/dist/node/swap/swap.js +5 -5
- package/dist/node/switcher/switcher.js +5 -5
- package/dist/node/tags-input/tags-input.js +20 -16
- package/dist/node/textarea/textarea.js +14 -13
- package/dist/node/time-picker/time-picker.js +21 -20
- package/dist/node/toggle/toggle.js +8 -7
- package/dist/node/tree-view/tree-view.js +43 -43
- package/dist/node/virtual-list/virtual-list.js +10 -10
- package/dist/node/wheel-picker/wheel-picker.js +36 -36
- package/dist/number-input/number-input.js +28 -27
- package/dist/overflow-menu/overflow-menu.js +7 -7
- package/dist/progress/progress.js +3 -3
- package/dist/progress-circle/progress-circle.js +8 -8
- package/dist/progress-indicator/progress-indicator.js +1 -1
- package/dist/qr-code/qr-code.js +11 -11
- package/dist/radial-progress/radial-progress.js +9 -9
- package/dist/radio/radio.js +10 -9
- package/dist/react/src/index.js +93 -93
- package/dist/resizable/resizable.js +24 -24
- package/dist/search/search.js +35 -31
- package/dist/select/select.js +15 -14
- package/dist/side-nav/side-nav.css +1 -1
- package/dist/side-nav/side-nav.js +35 -35
- package/dist/side-nav/side-nav.module.js +27 -27
- package/dist/slider/slider.js +13 -12
- package/dist/spinner/spinner.js +4 -4
- package/dist/steps/steps.js +10 -10
- package/dist/structured-list/structured-list.js +14 -14
- package/dist/styles.css +2 -2
- package/dist/swap/swap.js +5 -5
- package/dist/switcher/switcher.js +5 -5
- package/dist/tags-input/tags-input.js +20 -16
- package/dist/textarea/textarea.js +14 -13
- package/dist/time-picker/time-picker.js +21 -20
- package/dist/toggle/toggle.js +8 -7
- package/dist/tree-view/tree-view.js +43 -43
- package/dist/virtual-list/virtual-list.js +10 -10
- package/dist/wheel-picker/wheel-picker.js +36 -36
- package/package.json +4 -4
- package/readme.body.md +4 -3
|
@@ -9,31 +9,55 @@ import { builtin as d, t as f } from "@cascivo/i18n";
|
|
|
9
9
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
import { flushSync as ne } from "react-dom";
|
|
11
11
|
//#region ../components/src/data-table/data-table.tsx
|
|
12
|
-
|
|
12
|
+
var h = /* @__PURE__ */ new Set();
|
|
13
|
+
function g() {
|
|
14
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
15
|
+
}
|
|
16
|
+
var _ = /* @__PURE__ */ new Set();
|
|
17
|
+
function re(e, t, n) {
|
|
18
|
+
if (!g()) return;
|
|
19
|
+
let r = e.scrollWidth - e.clientWidth;
|
|
20
|
+
if (r <= 1) return;
|
|
21
|
+
let i = `${n}:${e.clientWidth}`;
|
|
22
|
+
_.has(i) || (_.add(i), console.warn(`cascivo DataTable: the table overflows its container (scrollWidth ${e.scrollWidth}px > clientWidth ${e.clientWidth}px, by ${r}px), so the last column is cut off. ` + (t.length > 0 ? `Drop a \`width\` from one of the sized columns (${t.join(", ")}), or lower the \`minWidth\` on the free-form one.` : "Lower the `minWidth` on the widest column.")));
|
|
23
|
+
}
|
|
24
|
+
function ie(e, t, n) {
|
|
25
|
+
g() && (e !== void 0 || t !== void 0 || h.has(n) || (h.add(n), console.warn(`cascivo DataTable: this table has no accessible name (columns: ${n}). Pass \`title\` for a visible caption, or \`ariaLabel\` for a name only screen readers hear.`)));
|
|
26
|
+
}
|
|
27
|
+
function v(e, t) {
|
|
13
28
|
return e[t];
|
|
14
29
|
}
|
|
15
|
-
function
|
|
30
|
+
function ae(e, t) {
|
|
16
31
|
return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
|
|
17
32
|
}
|
|
18
|
-
function
|
|
33
|
+
function y({ columns: h, rows: g, getRowId: _, sort: y, defaultSort: oe, sortMode: se = "client", onSortChange: ce, searchable: le = !1, pagination: b, selection: x, batchActions: S, renderExpandedRow: C, density: ue = "normal", zebra: de = !1, stickyHeader: fe = !1, loading: w = !1, emptyState: pe, title: T, ariaLabel: me, description: E, labels: D, className: he, virtualized: O = !1, rowHeight: k = 40, windowSize: ge = 20, overscan: _e = 3 }) {
|
|
19
34
|
te();
|
|
20
|
-
let
|
|
21
|
-
search:
|
|
22
|
-
empty:
|
|
23
|
-
selectAll:
|
|
24
|
-
selectRow:
|
|
25
|
-
itemsSelected: (e) =>
|
|
26
|
-
expandRow:
|
|
27
|
-
previousPage:
|
|
28
|
-
nextPage:
|
|
29
|
-
}, [
|
|
30
|
-
value:
|
|
35
|
+
let A = i(), j = {
|
|
36
|
+
search: D?.search ?? f(d.dataTable.search),
|
|
37
|
+
empty: D?.empty ?? f(d.dataTable.empty),
|
|
38
|
+
selectAll: D?.selectAll ?? f(d.dataTable.selectAll),
|
|
39
|
+
selectRow: D?.selectRow ?? f(d.dataTable.selectRow),
|
|
40
|
+
itemsSelected: (e) => D?.itemsSelected?.(e) ?? f(d.dataTable.itemsSelected, { count: e }),
|
|
41
|
+
expandRow: D?.expandRow ?? f(d.dataTable.expandRow),
|
|
42
|
+
previousPage: D?.previousPage ?? f(d.dataTable.previousPage),
|
|
43
|
+
nextPage: D?.nextPage ?? f(d.dataTable.nextPage)
|
|
44
|
+
}, [ve] = l({ value: g }), [ye] = l({ value: h }), [M, be] = l({
|
|
45
|
+
value: y,
|
|
31
46
|
defaultValue: oe
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
}, F = u(""), I = u(1), L = u(
|
|
47
|
+
}), xe = u([]), N = x?.selected ?? xe.value, P = (e) => {
|
|
48
|
+
x?.selected === void 0 && (xe.value = e), x?.onChange?.(e);
|
|
49
|
+
}, F = u(""), I = u(1), L = u(b?.pageSize ?? 0), R = u(/* @__PURE__ */ new Set()), z = a(null), B = u(0);
|
|
35
50
|
ee(() => {
|
|
36
|
-
|
|
51
|
+
let e = z.current;
|
|
52
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
53
|
+
let t = h.filter((e) => e.width !== void 0).map((e) => e.key), n = h.map((e) => e.key).join(","), r = 0, i = new ResizeObserver(() => {
|
|
54
|
+
cancelAnimationFrame(r), r = requestAnimationFrame(() => re(e, t, n));
|
|
55
|
+
});
|
|
56
|
+
return i.observe(e), () => {
|
|
57
|
+
cancelAnimationFrame(r), i.disconnect();
|
|
58
|
+
};
|
|
59
|
+
}), ee(() => {
|
|
60
|
+
if (!O) return;
|
|
37
61
|
let e = z.current;
|
|
38
62
|
if (!e) return;
|
|
39
63
|
let t = () => {
|
|
@@ -43,28 +67,28 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
43
67
|
};
|
|
44
68
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
45
69
|
});
|
|
46
|
-
let
|
|
70
|
+
let Se = c(() => ve.value.map((e, t) => ({
|
|
47
71
|
row: e,
|
|
48
72
|
id: _ ? _(e) : String(t)
|
|
49
|
-
}))),
|
|
73
|
+
}))), V = c(() => {
|
|
50
74
|
let e = F.value.trim().toLowerCase();
|
|
51
|
-
if (!e) return
|
|
52
|
-
let t =
|
|
53
|
-
return
|
|
54
|
-
}),
|
|
55
|
-
let e =
|
|
56
|
-
if (!e || se === "server") return
|
|
57
|
-
let t =
|
|
75
|
+
if (!e) return Se.value;
|
|
76
|
+
let t = ye.value;
|
|
77
|
+
return Se.value.filter((n) => t.some((t) => String(v(n.row, t.key) ?? "").toLowerCase().includes(e)));
|
|
78
|
+
}), H = c(() => {
|
|
79
|
+
let e = M.value;
|
|
80
|
+
if (!e || se === "server") return V.value;
|
|
81
|
+
let t = V.value.map((e, t) => [e, t]);
|
|
58
82
|
return t.sort((t, n) => {
|
|
59
|
-
let r =
|
|
83
|
+
let r = ae(v(t[0].row, e.key), v(n[0].row, e.key));
|
|
60
84
|
return e.direction === "desc" && (r = -r), r === 0 ? t[1] - n[1] : r;
|
|
61
85
|
}), t.map(([e]) => e);
|
|
62
|
-
}),
|
|
63
|
-
if (!
|
|
86
|
+
}), U = c(() => b ? Math.max(1, Math.ceil(V.value.length / L.value)) : 1), W = c(() => Math.min(I.value, U.value)), G = c(() => {
|
|
87
|
+
if (!b) return H.value;
|
|
64
88
|
let e = (W.value - 1) * L.value;
|
|
65
|
-
return
|
|
66
|
-
}), K = c(() =>
|
|
67
|
-
let t =
|
|
89
|
+
return H.value.slice(e, e + L.value);
|
|
90
|
+
}), K = c(() => O ? Math.floor(B.value / k) : 0), q = c(() => O ? Math.min(K.value + ge + _e * 2, G.value.length) : G.value.length), Ce = c(() => O ? G.value.slice(K.value, q.value) : G.value), we = (e) => {
|
|
91
|
+
let t = M.value, n;
|
|
68
92
|
n = !t || t.key !== e ? {
|
|
69
93
|
key: e,
|
|
70
94
|
direction: "asc"
|
|
@@ -72,9 +96,9 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
72
96
|
key: e,
|
|
73
97
|
direction: "desc"
|
|
74
98
|
} : void 0, o(() => {
|
|
75
|
-
|
|
99
|
+
be(n), I.value = 1;
|
|
76
100
|
}), ce?.(n);
|
|
77
|
-
},
|
|
101
|
+
}, Te = (e) => {
|
|
78
102
|
if (![
|
|
79
103
|
"ArrowUp",
|
|
80
104
|
"ArrowDown",
|
|
@@ -96,61 +120,63 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
96
120
|
}
|
|
97
121
|
}
|
|
98
122
|
a?.focus();
|
|
99
|
-
},
|
|
123
|
+
}, Ee = (e) => {
|
|
100
124
|
let t = N;
|
|
101
|
-
|
|
102
|
-
},
|
|
125
|
+
x?.mode === "single" ? P(t.includes(e) ? [] : [e]) : P(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
126
|
+
}, De = (e) => {
|
|
103
127
|
let t = new Set(R.value);
|
|
104
128
|
t.has(e) ? t.delete(e) : t.add(e), R.value = t;
|
|
105
|
-
},
|
|
106
|
-
let e =
|
|
107
|
-
P(
|
|
108
|
-
},
|
|
129
|
+
}, J = G.value, Oe = R.value, Y = J.length > 0 && J.every((e) => N.includes(e.id)), ke = J.some((e) => N.includes(e.id)), X = Ce.value, Z = K.value, Ae = q.value, je = () => {
|
|
130
|
+
let e = J.map((e) => e.id);
|
|
131
|
+
P(Y ? N.filter((t) => !e.includes(t)) : [...new Set([...N, ...e])]);
|
|
132
|
+
}, Q = h.length + +!!x + +!!C, Me = b && !O && X.length > 0 ? Math.max(0, L.value - X.length) : 0;
|
|
133
|
+
ie(T, me, h.map((e) => e.key).join(","));
|
|
134
|
+
let Ne = `${A}-title`, Pe = `${A}-description`, $ = V.value.length, Fe = $ === 0 ? 0 : (W.value - 1) * L.value + 1, Ie = $ === 0 ? 0 : Fe + J.length - 1, Le = !!S && S.length > 0 && N.length > 0;
|
|
109
135
|
return /* @__PURE__ */ m("div", {
|
|
110
|
-
className: s(n.root,
|
|
111
|
-
"data-density":
|
|
112
|
-
"data-zebra":
|
|
113
|
-
"data-sticky-header":
|
|
114
|
-
"data-paginated":
|
|
115
|
-
"data-fixed-layout":
|
|
136
|
+
className: s(n.root, he),
|
|
137
|
+
"data-density": ue,
|
|
138
|
+
"data-zebra": de || void 0,
|
|
139
|
+
"data-sticky-header": fe || void 0,
|
|
140
|
+
"data-paginated": b ? !0 : void 0,
|
|
141
|
+
"data-fixed-layout": h.every((e) => e.width !== void 0) || void 0,
|
|
116
142
|
children: [
|
|
117
143
|
/* @__PURE__ */ p("span", {
|
|
118
144
|
"aria-live": "polite",
|
|
119
145
|
className: n.srOnly,
|
|
120
|
-
children: N.length > 0 ?
|
|
146
|
+
children: N.length > 0 ? j.itemsSelected(N.length) : ""
|
|
121
147
|
}),
|
|
122
|
-
(
|
|
148
|
+
(T !== void 0 || E !== void 0 || le) && /* @__PURE__ */ m("div", {
|
|
123
149
|
className: n.toolbar,
|
|
124
|
-
children: [(
|
|
150
|
+
children: [(T !== void 0 || E !== void 0) && /* @__PURE__ */ m("div", {
|
|
125
151
|
className: n.heading,
|
|
126
|
-
children: [
|
|
127
|
-
id:
|
|
152
|
+
children: [T !== void 0 && /* @__PURE__ */ p("div", {
|
|
153
|
+
id: Ne,
|
|
128
154
|
className: n.title,
|
|
129
|
-
children: w
|
|
130
|
-
}), T !== void 0 && /* @__PURE__ */ p("div", {
|
|
131
|
-
id: Me,
|
|
132
|
-
className: n.description,
|
|
133
155
|
children: T
|
|
156
|
+
}), E !== void 0 && /* @__PURE__ */ p("div", {
|
|
157
|
+
id: Pe,
|
|
158
|
+
className: n.description,
|
|
159
|
+
children: E
|
|
134
160
|
})]
|
|
135
|
-
}),
|
|
161
|
+
}), le && /* @__PURE__ */ p("input", {
|
|
136
162
|
type: "search",
|
|
137
163
|
className: n.search,
|
|
138
|
-
"aria-label":
|
|
139
|
-
placeholder:
|
|
164
|
+
"aria-label": j.search,
|
|
165
|
+
placeholder: j.search,
|
|
140
166
|
value: F.value,
|
|
141
167
|
onChange: (e) => {
|
|
142
168
|
F.value = e.target.value, I.value = 1;
|
|
143
169
|
}
|
|
144
170
|
})]
|
|
145
171
|
}),
|
|
146
|
-
|
|
172
|
+
Le && /* @__PURE__ */ m("div", {
|
|
147
173
|
className: n.batchBar,
|
|
148
174
|
children: [/* @__PURE__ */ p("span", {
|
|
149
175
|
className: n.batchCount,
|
|
150
|
-
children:
|
|
176
|
+
children: j.itemsSelected(N.length)
|
|
151
177
|
}), /* @__PURE__ */ p("div", {
|
|
152
178
|
className: n.batchActions,
|
|
153
|
-
children:
|
|
179
|
+
children: S.map((t, n) => /* @__PURE__ */ p(e, {
|
|
154
180
|
size: "sm",
|
|
155
181
|
variant: "secondary",
|
|
156
182
|
onClick: () => t.onClick(N),
|
|
@@ -159,48 +185,49 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
159
185
|
})]
|
|
160
186
|
}),
|
|
161
187
|
/* @__PURE__ */ p("div", {
|
|
162
|
-
ref:
|
|
163
|
-
className: s(n.scroller,
|
|
188
|
+
ref: z,
|
|
189
|
+
className: s(n.scroller, O && n.scrollerVirtualized),
|
|
164
190
|
children: /* @__PURE__ */ m("table", {
|
|
165
191
|
className: n.table,
|
|
166
|
-
"aria-labelledby":
|
|
167
|
-
"aria-
|
|
168
|
-
"aria-
|
|
169
|
-
"aria-
|
|
170
|
-
|
|
192
|
+
"aria-labelledby": T === void 0 ? void 0 : Ne,
|
|
193
|
+
"aria-label": T === void 0 ? me : void 0,
|
|
194
|
+
"aria-describedby": E === void 0 ? void 0 : Pe,
|
|
195
|
+
"aria-busy": w || void 0,
|
|
196
|
+
"aria-rowcount": O ? J.length : void 0,
|
|
197
|
+
onKeyDown: Te,
|
|
171
198
|
children: [
|
|
172
199
|
/* @__PURE__ */ m("colgroup", { children: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
200
|
+
C && /* @__PURE__ */ p("col", { className: n.controlCol }),
|
|
201
|
+
x && /* @__PURE__ */ p("col", { className: n.controlCol }),
|
|
202
|
+
h.map((e) => /* @__PURE__ */ p("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
|
|
176
203
|
...e.width === void 0 ? {} : { width: e.width },
|
|
177
204
|
...e.minWidth === void 0 ? {} : { minWidth: e.minWidth }
|
|
178
205
|
} : void 0 }, e.key))
|
|
179
206
|
] }),
|
|
180
207
|
/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
181
|
-
|
|
208
|
+
C && /* @__PURE__ */ p("th", {
|
|
182
209
|
scope: "col",
|
|
183
210
|
className: n.controlCell,
|
|
184
211
|
children: /* @__PURE__ */ p("span", {
|
|
185
212
|
className: n.srOnly,
|
|
186
|
-
children:
|
|
213
|
+
children: j.expandRow
|
|
187
214
|
})
|
|
188
215
|
}),
|
|
189
|
-
|
|
216
|
+
x && /* @__PURE__ */ p("th", {
|
|
190
217
|
scope: "col",
|
|
191
218
|
className: n.controlCell,
|
|
192
|
-
children:
|
|
193
|
-
"aria-label":
|
|
194
|
-
checked:
|
|
195
|
-
indeterminate:
|
|
196
|
-
onChange:
|
|
219
|
+
children: x.mode === "multi" ? /* @__PURE__ */ p(t, {
|
|
220
|
+
"aria-label": j.selectAll,
|
|
221
|
+
checked: Y,
|
|
222
|
+
indeterminate: ke && !Y,
|
|
223
|
+
onChange: je
|
|
197
224
|
}) : /* @__PURE__ */ p("span", {
|
|
198
225
|
className: n.srOnly,
|
|
199
|
-
children:
|
|
226
|
+
children: j.selectRow
|
|
200
227
|
})
|
|
201
228
|
}),
|
|
202
|
-
|
|
203
|
-
let t =
|
|
229
|
+
h.map((e) => {
|
|
230
|
+
let t = M.value?.key === e.key ? M.value.direction : void 0, r = t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
|
|
204
231
|
return /* @__PURE__ */ p("th", {
|
|
205
232
|
scope: "col",
|
|
206
233
|
"data-align": e.align ?? "start",
|
|
@@ -210,96 +237,96 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
210
237
|
type: "button",
|
|
211
238
|
className: n.sortButton,
|
|
212
239
|
"data-state": r,
|
|
213
|
-
onClick: () =>
|
|
240
|
+
onClick: () => we(e.key),
|
|
214
241
|
children: e.header
|
|
215
242
|
}) : e.header
|
|
216
243
|
}, e.key);
|
|
217
244
|
})
|
|
218
245
|
] }) }),
|
|
219
246
|
/* @__PURE__ */ m("tbody", { children: [
|
|
220
|
-
|
|
247
|
+
w && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ p("tr", {
|
|
221
248
|
className: n.row,
|
|
222
|
-
children: Array.from({ length:
|
|
249
|
+
children: Array.from({ length: Q }, (e, t) => /* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("span", {
|
|
223
250
|
className: n.shimmer,
|
|
224
251
|
"aria-hidden": "true"
|
|
225
252
|
}) }, t))
|
|
226
253
|
}, t)),
|
|
227
|
-
!
|
|
254
|
+
!w && J.length === 0 && /* @__PURE__ */ p("tr", {
|
|
228
255
|
"data-empty-row": !0,
|
|
229
256
|
children: /* @__PURE__ */ p("td", {
|
|
230
|
-
colSpan:
|
|
257
|
+
colSpan: Q,
|
|
231
258
|
className: n.emptyCell,
|
|
232
|
-
children:
|
|
259
|
+
children: pe ?? j.empty
|
|
233
260
|
})
|
|
234
261
|
}),
|
|
235
|
-
!
|
|
262
|
+
!w && O && Z > 0 && /* @__PURE__ */ p("tr", {
|
|
236
263
|
"aria-hidden": "true",
|
|
237
|
-
style: { height:
|
|
264
|
+
style: { height: Z * k }
|
|
238
265
|
}),
|
|
239
|
-
!
|
|
240
|
-
let a =
|
|
266
|
+
!w && X.map((e, i) => {
|
|
267
|
+
let a = O ? Z + i : i, o = N.includes(e.id), s = Oe.has(e.id);
|
|
241
268
|
return /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ m("tr", {
|
|
242
269
|
className: n.row,
|
|
243
270
|
"data-parity": a % 2 == 0 ? "even" : "odd",
|
|
244
271
|
"data-state": o ? "selected" : void 0,
|
|
245
|
-
"aria-rowindex":
|
|
272
|
+
"aria-rowindex": O ? Z + i + 1 : void 0,
|
|
246
273
|
children: [
|
|
247
|
-
|
|
274
|
+
C && /* @__PURE__ */ p("td", {
|
|
248
275
|
className: n.controlCell,
|
|
249
276
|
children: /* @__PURE__ */ p("button", {
|
|
250
277
|
type: "button",
|
|
251
278
|
className: n.expandButton,
|
|
252
279
|
"aria-expanded": s,
|
|
253
|
-
"aria-label":
|
|
280
|
+
"aria-label": j.expandRow,
|
|
254
281
|
"data-state": s ? "open" : "closed",
|
|
255
|
-
onClick: () =>
|
|
282
|
+
onClick: () => De(e.id),
|
|
256
283
|
children: /* @__PURE__ */ p("span", {
|
|
257
284
|
className: n.chevron,
|
|
258
285
|
"aria-hidden": "true"
|
|
259
286
|
})
|
|
260
287
|
})
|
|
261
288
|
}),
|
|
262
|
-
|
|
289
|
+
x && /* @__PURE__ */ p("td", {
|
|
263
290
|
className: n.controlCell,
|
|
264
291
|
children: /* @__PURE__ */ p(t, {
|
|
265
|
-
"aria-label":
|
|
292
|
+
"aria-label": j.selectRow,
|
|
266
293
|
checked: o,
|
|
267
|
-
onChange: () =>
|
|
294
|
+
onChange: () => Ee(e.id)
|
|
268
295
|
})
|
|
269
296
|
}),
|
|
270
|
-
|
|
297
|
+
h.map((t) => /* @__PURE__ */ p("td", {
|
|
271
298
|
"data-align": t.align ?? "start",
|
|
272
299
|
"data-sized": t.width !== void 0 || void 0,
|
|
273
|
-
children: t.render ? t.render(e.row) : String(
|
|
300
|
+
children: t.render ? t.render(e.row) : String(v(e.row, t.key) ?? "")
|
|
274
301
|
}, t.key))
|
|
275
302
|
]
|
|
276
|
-
}),
|
|
303
|
+
}), C && /* @__PURE__ */ p("tr", {
|
|
277
304
|
className: n.expansionRow,
|
|
278
305
|
"data-state": s ? "open" : "closed",
|
|
279
306
|
children: /* @__PURE__ */ p("td", {
|
|
280
|
-
colSpan:
|
|
307
|
+
colSpan: Q,
|
|
281
308
|
children: /* @__PURE__ */ p("div", {
|
|
282
309
|
className: n.expansionGrid,
|
|
283
310
|
"data-state": s ? "open" : "closed",
|
|
284
311
|
children: /* @__PURE__ */ p("div", {
|
|
285
312
|
className: n.expansionInner,
|
|
286
|
-
children:
|
|
313
|
+
children: C(e.row)
|
|
287
314
|
})
|
|
288
315
|
})
|
|
289
316
|
})
|
|
290
317
|
})] }, e.id);
|
|
291
318
|
}),
|
|
292
|
-
!
|
|
319
|
+
!w && O && Ae < J.length && /* @__PURE__ */ p("tr", {
|
|
293
320
|
"aria-hidden": "true",
|
|
294
|
-
style: { height: (
|
|
321
|
+
style: { height: (J.length - Ae) * k }
|
|
295
322
|
}),
|
|
296
|
-
|
|
323
|
+
Me > 0 && /* @__PURE__ */ p("tr", {
|
|
297
324
|
"aria-hidden": "true",
|
|
298
325
|
"data-filler-row": !0,
|
|
299
326
|
children: /* @__PURE__ */ p("td", {
|
|
300
|
-
colSpan:
|
|
327
|
+
colSpan: Q,
|
|
301
328
|
style: {
|
|
302
|
-
blockSize: `calc(var(--_row-height) * ${
|
|
329
|
+
blockSize: `calc(var(--_row-height) * ${Me})`,
|
|
303
330
|
padding: 0
|
|
304
331
|
}
|
|
305
332
|
})
|
|
@@ -308,17 +335,17 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
308
335
|
]
|
|
309
336
|
})
|
|
310
337
|
}),
|
|
311
|
-
|
|
338
|
+
b && /* @__PURE__ */ m("div", {
|
|
312
339
|
className: n.footer,
|
|
313
340
|
children: [
|
|
314
|
-
|
|
341
|
+
b.pageSizeOptions && /* @__PURE__ */ m("label", {
|
|
315
342
|
className: n.pageSize,
|
|
316
343
|
children: [/* @__PURE__ */ p("span", { children: "Rows per page" }), /* @__PURE__ */ p("select", {
|
|
317
344
|
value: L.value,
|
|
318
345
|
onChange: (e) => {
|
|
319
346
|
L.value = Number(e.target.value), I.value = 1;
|
|
320
347
|
},
|
|
321
|
-
children:
|
|
348
|
+
children: b.pageSizeOptions.map((e) => /* @__PURE__ */ p("option", {
|
|
322
349
|
value: e,
|
|
323
350
|
children: e
|
|
324
351
|
}, e))
|
|
@@ -327,11 +354,11 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
327
354
|
/* @__PURE__ */ m("span", {
|
|
328
355
|
className: n.range,
|
|
329
356
|
children: [
|
|
330
|
-
|
|
357
|
+
Fe,
|
|
331
358
|
"–",
|
|
332
|
-
|
|
359
|
+
Ie,
|
|
333
360
|
" of ",
|
|
334
|
-
|
|
361
|
+
$
|
|
335
362
|
]
|
|
336
363
|
}),
|
|
337
364
|
/* @__PURE__ */ m("div", {
|
|
@@ -339,7 +366,7 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
339
366
|
children: [/* @__PURE__ */ p("button", {
|
|
340
367
|
type: "button",
|
|
341
368
|
className: n.pageButton,
|
|
342
|
-
"aria-label":
|
|
369
|
+
"aria-label": j.previousPage,
|
|
343
370
|
disabled: W.value <= 1,
|
|
344
371
|
onClick: () => {
|
|
345
372
|
I.value = W.value - 1;
|
|
@@ -351,8 +378,8 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
351
378
|
}), /* @__PURE__ */ p("button", {
|
|
352
379
|
type: "button",
|
|
353
380
|
className: n.pageButton,
|
|
354
|
-
"aria-label":
|
|
355
|
-
disabled: W.value >=
|
|
381
|
+
"aria-label": j.nextPage,
|
|
382
|
+
disabled: W.value >= U.value,
|
|
356
383
|
onClick: () => {
|
|
357
384
|
I.value = W.value + 1;
|
|
358
385
|
},
|
|
@@ -368,4 +395,4 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
|
|
|
368
395
|
});
|
|
369
396
|
}
|
|
370
397
|
//#endregion
|
|
371
|
-
export {
|
|
398
|
+
export { y as DataTable };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import './data-table.css';
|
|
2
2
|
var e = {
|
|
3
|
-
root: "
|
|
4
|
-
toolbar: "
|
|
5
|
-
heading: "
|
|
6
|
-
title: "
|
|
7
|
-
description: "
|
|
8
|
-
search: "
|
|
9
|
-
batchBar: "
|
|
10
|
-
batchCount: "
|
|
11
|
-
batchActions: "
|
|
12
|
-
scroller: "
|
|
13
|
-
scrollerVirtualized: "
|
|
14
|
-
table: "
|
|
15
|
-
row: "
|
|
16
|
-
controlCol: "
|
|
17
|
-
controlCell: "
|
|
18
|
-
sortButton: "
|
|
19
|
-
emptyCell: "
|
|
20
|
-
expansionRow: "
|
|
21
|
-
expansionGrid: "
|
|
22
|
-
expansionInner: "
|
|
23
|
-
expandButton: "
|
|
24
|
-
chevron: "
|
|
25
|
-
shimmer: "
|
|
26
|
-
footer: "
|
|
27
|
-
pageSize: "
|
|
28
|
-
range: "
|
|
29
|
-
pageButtons: "
|
|
30
|
-
pageButton: "
|
|
31
|
-
srOnly: "
|
|
3
|
+
root: "_root_1bz3s_2",
|
|
4
|
+
toolbar: "_toolbar_1bz3s_26",
|
|
5
|
+
heading: "_heading_1bz3s_35",
|
|
6
|
+
title: "_title_1bz3s_41",
|
|
7
|
+
description: "_description_1bz3s_47",
|
|
8
|
+
search: "_search_1bz3s_52",
|
|
9
|
+
batchBar: "_batchBar_1bz3s_79",
|
|
10
|
+
batchCount: "_batchCount_1bz3s_89",
|
|
11
|
+
batchActions: "_batchActions_1bz3s_95",
|
|
12
|
+
scroller: "_scroller_1bz3s_101",
|
|
13
|
+
scrollerVirtualized: "_scrollerVirtualized_1bz3s_137",
|
|
14
|
+
table: "_table_1bz3s_143",
|
|
15
|
+
row: "_row_1bz3s_225",
|
|
16
|
+
controlCol: "_controlCol_1bz3s_245",
|
|
17
|
+
controlCell: "_controlCell_1bz3s_249",
|
|
18
|
+
sortButton: "_sortButton_1bz3s_255",
|
|
19
|
+
emptyCell: "_emptyCell_1bz3s_303",
|
|
20
|
+
expansionRow: "_expansionRow_1bz3s_310",
|
|
21
|
+
expansionGrid: "_expansionGrid_1bz3s_316",
|
|
22
|
+
expansionInner: "_expansionInner_1bz3s_320",
|
|
23
|
+
expandButton: "_expandButton_1bz3s_325",
|
|
24
|
+
chevron: "_chevron_1bz3s_348",
|
|
25
|
+
shimmer: "_shimmer_1bz3s_363",
|
|
26
|
+
footer: "_footer_1bz3s_390",
|
|
27
|
+
pageSize: "_pageSize_1bz3s_400",
|
|
28
|
+
range: "_range_1bz3s_426",
|
|
29
|
+
pageButtons: "_pageButtons_1bz3s_431",
|
|
30
|
+
pageButton: "_pageButton_1bz3s_431",
|
|
31
|
+
srOnly: "_srOnly_1bz3s_472"
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
34
34
|
export { e as default };
|