@cascivo/react 0.16.1 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/dist/accordion/accordion.js +5 -4
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +28 -26
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/breadcrumb/breadcrumb.js +1 -1
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +4 -1
- package/dist/button/button.module.js +4 -1
- package/dist/calendar/calendar.js +67 -63
- package/dist/card/card.css +1 -1
- package/dist/card/card.module.js +8 -8
- package/dist/checkbox/checkbox.css +1 -1
- package/dist/checkbox/checkbox.module.js +4 -4
- package/dist/code-snippet/code-snippet.js +31 -26
- package/dist/combobox/combobox.js +55 -54
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +155 -160
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.js +90 -89
- package/dist/dock/dock.js +1 -1
- package/dist/field/field.css +1 -1
- package/dist/field/field.module.js +3 -3
- package/dist/index.d.ts +157 -10
- package/dist/large-title-header/large-title-header.js +1 -1
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.module.js +3 -3
- package/dist/node/accordion/accordion.js +5 -4
- package/dist/node/app-shell/app-shell.js +28 -26
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/breadcrumb/breadcrumb.js +1 -1
- package/dist/node/button/button.js +4 -1
- package/dist/node/button/button.module.js +4 -1
- package/dist/node/calendar/calendar.js +67 -63
- package/dist/node/card/card.module.js +8 -8
- package/dist/node/checkbox/checkbox.module.js +4 -4
- package/dist/node/code-snippet/code-snippet.js +31 -26
- package/dist/node/combobox/combobox.js +55 -54
- package/dist/node/data-table/data-table.js +155 -160
- package/dist/node/data-table/data-table.module.js +29 -29
- package/dist/node/date-picker/date-picker.js +90 -89
- package/dist/node/dock/dock.js +1 -1
- package/dist/node/field/field.module.js +3 -3
- package/dist/node/large-title-header/large-title-header.js +1 -1
- package/dist/node/layouts/src/grid/grid.module.js +3 -3
- package/dist/node/search/search.js +5 -4
- package/dist/node/side-nav/side-nav.js +90 -89
- package/dist/node/swap/swap.js +4 -3
- package/dist/node/switcher/switcher.js +1 -1
- package/dist/node/tabs/tabs.js +5 -4
- package/dist/node/toc/toc.js +5 -4
- package/dist/search/search.js +5 -4
- package/dist/side-nav/side-nav.js +90 -89
- package/dist/styles.css +7 -7
- package/dist/swap/swap.js +4 -3
- package/dist/switcher/switcher.js +1 -1
- package/dist/tabs/tabs.js +5 -4
- package/dist/toc/toc.js +5 -4
- package/dist/types.d.ts +21 -0
- package/dist/types.js +1 -0
- package/package.json +11 -4
- package/readme.body.md +14 -13
|
@@ -4,70 +4,67 @@ import { Button as e } from "../button/button.js";
|
|
|
4
4
|
import { Checkbox as t } from "../checkbox/checkbox.js";
|
|
5
5
|
import n from "./data-table.module.js";
|
|
6
6
|
import { Fragment as r, useId as i, useRef as a } from "react";
|
|
7
|
-
import { batch as o, cn as s, useComputed as c,
|
|
8
|
-
import { builtin as
|
|
9
|
-
import { jsx as
|
|
7
|
+
import { batch as o, cn as s, useComputed as c, useControllableSignal as l, useSignal as u, useSignalEffect as ee, useSignals as te } from "@cascivo/core";
|
|
8
|
+
import { builtin as d, t as f } from "@cascivo/i18n";
|
|
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
|
-
function
|
|
12
|
+
function h(e, t) {
|
|
13
13
|
return e[t];
|
|
14
14
|
}
|
|
15
15
|
function re(e, t) {
|
|
16
16
|
return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortMode: se = "client", onSortChange: ce, searchable: v = !1, pagination: y, selection: b, batchActions: x, renderExpandedRow: S, density: le = "normal", zebra: ue = !1, stickyHeader: de = !1, loading: C = !1, emptyState: fe, title: w, description: T, labels: E, className: pe, virtualized: D = !1, rowHeight: O = 40, windowSize: me = 20, overscan: he = 3 }) {
|
|
19
19
|
te();
|
|
20
|
-
let
|
|
21
|
-
search: E?.search ?? d
|
|
22
|
-
empty: E?.empty ?? d
|
|
23
|
-
selectAll: E?.selectAll ?? d
|
|
24
|
-
selectRow: E?.selectRow ?? d
|
|
25
|
-
itemsSelected: (e) => E?.itemsSelected?.(e) ?? d
|
|
26
|
-
expandRow: E?.expandRow ?? d
|
|
27
|
-
previousPage: E?.previousPage ?? d
|
|
28
|
-
nextPage: E?.nextPage ?? d
|
|
29
|
-
}, ge = l(g)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
let j = l(b?.selected ?? []);
|
|
36
|
-
b?.selected !== void 0 && (j.value = b.selected);
|
|
37
|
-
let M = l(""), N = l(1), P = l(y?.pageSize ?? 0), F = l(/* @__PURE__ */ new Set()), I = a(null), L = l(0);
|
|
20
|
+
let k = i(), A = {
|
|
21
|
+
search: E?.search ?? f(d.dataTable.search),
|
|
22
|
+
empty: E?.empty ?? f(d.dataTable.empty),
|
|
23
|
+
selectAll: E?.selectAll ?? f(d.dataTable.selectAll),
|
|
24
|
+
selectRow: E?.selectRow ?? f(d.dataTable.selectRow),
|
|
25
|
+
itemsSelected: (e) => E?.itemsSelected?.(e) ?? f(d.dataTable.itemsSelected, { count: e }),
|
|
26
|
+
expandRow: E?.expandRow ?? f(d.dataTable.expandRow),
|
|
27
|
+
previousPage: E?.previousPage ?? f(d.dataTable.previousPage),
|
|
28
|
+
nextPage: E?.nextPage ?? f(d.dataTable.nextPage)
|
|
29
|
+
}, [ge] = l({ value: ie }), [_e] = l({ value: g }), [j, ve] = l({
|
|
30
|
+
value: ae,
|
|
31
|
+
defaultValue: oe
|
|
32
|
+
}), M = u([]), N = b?.selected ?? M.value, P = (e) => {
|
|
33
|
+
b?.selected === void 0 && (M.value = e), b?.onChange?.(e);
|
|
34
|
+
}, F = u(""), I = u(1), L = u(y?.pageSize ?? 0), R = u(/* @__PURE__ */ new Set()), z = a(null), B = u(0);
|
|
38
35
|
ee(() => {
|
|
39
36
|
if (!D) return;
|
|
40
|
-
let e =
|
|
37
|
+
let e = z.current;
|
|
41
38
|
if (!e) return;
|
|
42
39
|
let t = () => {
|
|
43
40
|
ne(() => {
|
|
44
|
-
|
|
41
|
+
B.value = e.scrollTop;
|
|
45
42
|
});
|
|
46
43
|
};
|
|
47
44
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
48
45
|
});
|
|
49
|
-
let
|
|
46
|
+
let V = c(() => ge.value.map((e, t) => ({
|
|
50
47
|
row: e,
|
|
51
48
|
id: _ ? _(e) : String(t)
|
|
52
|
-
}))),
|
|
53
|
-
let e =
|
|
54
|
-
if (!e) return
|
|
49
|
+
}))), H = c(() => {
|
|
50
|
+
let e = F.value.trim().toLowerCase();
|
|
51
|
+
if (!e) return V.value;
|
|
55
52
|
let t = _e.value;
|
|
56
|
-
return
|
|
57
|
-
}),
|
|
58
|
-
let e =
|
|
59
|
-
if (!e ||
|
|
60
|
-
let t =
|
|
53
|
+
return V.value.filter((n) => t.some((t) => String(h(n.row, t.key) ?? "").toLowerCase().includes(e)));
|
|
54
|
+
}), U = c(() => {
|
|
55
|
+
let e = j.value;
|
|
56
|
+
if (!e || se === "server") return H.value;
|
|
57
|
+
let t = H.value.map((e, t) => [e, t]);
|
|
61
58
|
return t.sort((t, n) => {
|
|
62
|
-
let r = re(
|
|
59
|
+
let r = re(h(t[0].row, e.key), h(n[0].row, e.key));
|
|
63
60
|
return e.direction === "desc" && (r = -r), r === 0 ? t[1] - n[1] : r;
|
|
64
61
|
}), t.map(([e]) => e);
|
|
65
|
-
}),
|
|
66
|
-
if (!y) return
|
|
67
|
-
let e = (
|
|
68
|
-
return
|
|
69
|
-
}),
|
|
70
|
-
let t =
|
|
62
|
+
}), ye = c(() => y ? Math.max(1, Math.ceil(H.value.length / L.value)) : 1), W = c(() => Math.min(I.value, ye.value)), G = c(() => {
|
|
63
|
+
if (!y) return U.value;
|
|
64
|
+
let e = (W.value - 1) * L.value;
|
|
65
|
+
return U.value.slice(e, e + L.value);
|
|
66
|
+
}), K = c(() => D ? Math.floor(B.value / O) : 0), be = c(() => D ? Math.min(K.value + me + he * 2, G.value.length) : G.value.length), xe = c(() => D ? G.value.slice(K.value, be.value) : G.value), Se = (e) => {
|
|
67
|
+
let t = j.value, n;
|
|
71
68
|
n = !t || t.key !== e ? {
|
|
72
69
|
key: e,
|
|
73
70
|
direction: "asc"
|
|
@@ -75,9 +72,9 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
|
|
|
75
72
|
key: e,
|
|
76
73
|
direction: "desc"
|
|
77
74
|
} : void 0, o(() => {
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
},
|
|
75
|
+
ve(n), I.value = 1;
|
|
76
|
+
}), ce?.(n);
|
|
77
|
+
}, Ce = (e) => {
|
|
81
78
|
if (![
|
|
82
79
|
"ArrowUp",
|
|
83
80
|
"ArrowDown",
|
|
@@ -99,194 +96,192 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
|
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
98
|
a?.focus();
|
|
102
|
-
}, W = (e) => {
|
|
103
|
-
b?.selected === void 0 && (j.value = e), b?.onChange?.(e);
|
|
104
|
-
}, Ce = (e) => {
|
|
105
|
-
let t = j.value;
|
|
106
|
-
b?.mode === "single" ? W(t.includes(e) ? [] : [e]) : W(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
107
99
|
}, we = (e) => {
|
|
108
|
-
let t =
|
|
109
|
-
t.
|
|
110
|
-
},
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
100
|
+
let t = N;
|
|
101
|
+
b?.mode === "single" ? P(t.includes(e) ? [] : [e]) : P(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
102
|
+
}, Te = (e) => {
|
|
103
|
+
let t = new Set(R.value);
|
|
104
|
+
t.has(e) ? t.delete(e) : t.add(e), R.value = t;
|
|
105
|
+
}, q = G.value, Ee = R.value, J = q.length > 0 && q.every((e) => N.includes(e.id)), De = q.some((e) => N.includes(e.id)), Y = xe.value, X = K.value, Oe = be.value, ke = () => {
|
|
106
|
+
let e = q.map((e) => e.id);
|
|
107
|
+
P(J ? N.filter((t) => !e.includes(t)) : [...new Set([...N, ...e])]);
|
|
108
|
+
}, Z = g.length + +!!b + +!!S, Ae = y && !D && Y.length > 0 ? Math.max(0, L.value - Y.length) : 0, je = `${k}-title`, Me = `${k}-description`, Q = H.value.length, $ = Q === 0 ? 0 : (W.value - 1) * L.value + 1, Ne = Q === 0 ? 0 : $ + q.length - 1, Pe = !!x && x.length > 0 && N.length > 0;
|
|
109
|
+
return /* @__PURE__ */ m("div", {
|
|
110
|
+
className: s(n.root, pe),
|
|
111
|
+
"data-density": le,
|
|
112
|
+
"data-zebra": ue || void 0,
|
|
113
|
+
"data-sticky-header": de || void 0,
|
|
119
114
|
"data-paginated": y ? !0 : void 0,
|
|
120
|
-
"data-fixed-layout":
|
|
115
|
+
"data-fixed-layout": g.every((e) => e.width !== void 0) || void 0,
|
|
121
116
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ p("span", {
|
|
123
118
|
"aria-live": "polite",
|
|
124
119
|
className: n.srOnly,
|
|
125
|
-
children:
|
|
120
|
+
children: N.length > 0 ? A.itemsSelected(N.length) : ""
|
|
126
121
|
}),
|
|
127
|
-
(w !== void 0 || T !== void 0 ||
|
|
122
|
+
(w !== void 0 || T !== void 0 || v) && /* @__PURE__ */ m("div", {
|
|
128
123
|
className: n.toolbar,
|
|
129
|
-
children: [(w !== void 0 || T !== void 0) && /* @__PURE__ */
|
|
124
|
+
children: [(w !== void 0 || T !== void 0) && /* @__PURE__ */ m("div", {
|
|
130
125
|
className: n.heading,
|
|
131
|
-
children: [w !== void 0 && /* @__PURE__ */
|
|
132
|
-
id:
|
|
126
|
+
children: [w !== void 0 && /* @__PURE__ */ p("div", {
|
|
127
|
+
id: je,
|
|
133
128
|
className: n.title,
|
|
134
129
|
children: w
|
|
135
|
-
}), T !== void 0 && /* @__PURE__ */
|
|
136
|
-
id:
|
|
130
|
+
}), T !== void 0 && /* @__PURE__ */ p("div", {
|
|
131
|
+
id: Me,
|
|
137
132
|
className: n.description,
|
|
138
133
|
children: T
|
|
139
134
|
})]
|
|
140
|
-
}),
|
|
135
|
+
}), v && /* @__PURE__ */ p("input", {
|
|
141
136
|
type: "search",
|
|
142
137
|
className: n.search,
|
|
143
|
-
"aria-label":
|
|
144
|
-
placeholder:
|
|
145
|
-
value:
|
|
138
|
+
"aria-label": A.search,
|
|
139
|
+
placeholder: A.search,
|
|
140
|
+
value: F.value,
|
|
146
141
|
onChange: (e) => {
|
|
147
|
-
|
|
142
|
+
F.value = e.target.value, I.value = 1;
|
|
148
143
|
}
|
|
149
144
|
})]
|
|
150
145
|
}),
|
|
151
|
-
|
|
146
|
+
Pe && /* @__PURE__ */ m("div", {
|
|
152
147
|
className: n.batchBar,
|
|
153
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ p("span", {
|
|
154
149
|
className: n.batchCount,
|
|
155
|
-
children:
|
|
156
|
-
}), /* @__PURE__ */
|
|
150
|
+
children: A.itemsSelected(N.length)
|
|
151
|
+
}), /* @__PURE__ */ p("div", {
|
|
157
152
|
className: n.batchActions,
|
|
158
|
-
children: x.map((t, n) => /* @__PURE__ */
|
|
153
|
+
children: x.map((t, n) => /* @__PURE__ */ p(e, {
|
|
159
154
|
size: "sm",
|
|
160
155
|
variant: "secondary",
|
|
161
|
-
onClick: () => t.onClick(
|
|
156
|
+
onClick: () => t.onClick(N),
|
|
162
157
|
children: t.label
|
|
163
158
|
}, t.id ?? `${n}-${t.label}`))
|
|
164
159
|
})]
|
|
165
160
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
ref: D ?
|
|
161
|
+
/* @__PURE__ */ p("div", {
|
|
162
|
+
ref: D ? z : void 0,
|
|
168
163
|
className: s(n.scroller, D && n.scrollerVirtualized),
|
|
169
|
-
children: /* @__PURE__ */
|
|
164
|
+
children: /* @__PURE__ */ m("table", {
|
|
170
165
|
className: n.table,
|
|
171
|
-
"aria-labelledby": w === void 0 ? void 0 :
|
|
172
|
-
"aria-describedby": T === void 0 ? void 0 :
|
|
166
|
+
"aria-labelledby": w === void 0 ? void 0 : je,
|
|
167
|
+
"aria-describedby": T === void 0 ? void 0 : Me,
|
|
173
168
|
"aria-busy": C || void 0,
|
|
174
|
-
"aria-rowcount": D ?
|
|
175
|
-
onKeyDown:
|
|
169
|
+
"aria-rowcount": D ? q.length : void 0,
|
|
170
|
+
onKeyDown: Ce,
|
|
176
171
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
S && /* @__PURE__ */
|
|
179
|
-
b && /* @__PURE__ */
|
|
180
|
-
|
|
172
|
+
/* @__PURE__ */ m("colgroup", { children: [
|
|
173
|
+
S && /* @__PURE__ */ p("col", { className: n.controlCol }),
|
|
174
|
+
b && /* @__PURE__ */ p("col", { className: n.controlCol }),
|
|
175
|
+
g.map((e) => /* @__PURE__ */ p("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
|
|
181
176
|
...e.width === void 0 ? {} : { width: e.width },
|
|
182
177
|
...e.minWidth === void 0 ? {} : { minWidth: e.minWidth }
|
|
183
178
|
} : void 0 }, e.key))
|
|
184
179
|
] }),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
S && /* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
181
|
+
S && /* @__PURE__ */ p("th", {
|
|
187
182
|
scope: "col",
|
|
188
183
|
className: n.controlCell,
|
|
189
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ p("span", {
|
|
190
185
|
className: n.srOnly,
|
|
191
|
-
children:
|
|
186
|
+
children: A.expandRow
|
|
192
187
|
})
|
|
193
188
|
}),
|
|
194
|
-
b && /* @__PURE__ */
|
|
189
|
+
b && /* @__PURE__ */ p("th", {
|
|
195
190
|
scope: "col",
|
|
196
191
|
className: n.controlCell,
|
|
197
|
-
children: b.mode === "multi" ? /* @__PURE__ */
|
|
198
|
-
"aria-label":
|
|
199
|
-
checked:
|
|
200
|
-
indeterminate:
|
|
201
|
-
onChange:
|
|
202
|
-
}) : /* @__PURE__ */
|
|
192
|
+
children: b.mode === "multi" ? /* @__PURE__ */ p(t, {
|
|
193
|
+
"aria-label": A.selectAll,
|
|
194
|
+
checked: J,
|
|
195
|
+
indeterminate: De && !J,
|
|
196
|
+
onChange: ke
|
|
197
|
+
}) : /* @__PURE__ */ p("span", {
|
|
203
198
|
className: n.srOnly,
|
|
204
|
-
children:
|
|
199
|
+
children: A.selectRow
|
|
205
200
|
})
|
|
206
201
|
}),
|
|
207
|
-
|
|
208
|
-
let t =
|
|
209
|
-
return /* @__PURE__ */
|
|
202
|
+
g.map((e) => {
|
|
203
|
+
let t = j.value?.key === e.key ? j.value.direction : void 0, r = t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
|
|
204
|
+
return /* @__PURE__ */ p("th", {
|
|
210
205
|
scope: "col",
|
|
211
206
|
"data-align": e.align ?? "start",
|
|
212
207
|
"data-sized": e.width !== void 0 || void 0,
|
|
213
208
|
"aria-sort": e.sortable ? r : void 0,
|
|
214
|
-
children: e.sortable ? /* @__PURE__ */
|
|
209
|
+
children: e.sortable ? /* @__PURE__ */ p("button", {
|
|
215
210
|
type: "button",
|
|
216
211
|
className: n.sortButton,
|
|
217
212
|
"data-state": r,
|
|
218
|
-
onClick: () =>
|
|
213
|
+
onClick: () => Se(e.key),
|
|
219
214
|
children: e.header
|
|
220
215
|
}) : e.header
|
|
221
216
|
}, e.key);
|
|
222
217
|
})
|
|
223
218
|
] }) }),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
C && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ m("tbody", { children: [
|
|
220
|
+
C && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ p("tr", {
|
|
226
221
|
className: n.row,
|
|
227
|
-
children: Array.from({ length: Z }, (e, t) => /* @__PURE__ */
|
|
222
|
+
children: Array.from({ length: Z }, (e, t) => /* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("span", {
|
|
228
223
|
className: n.shimmer,
|
|
229
224
|
"aria-hidden": "true"
|
|
230
225
|
}) }, t))
|
|
231
226
|
}, t)),
|
|
232
|
-
!C &&
|
|
227
|
+
!C && q.length === 0 && /* @__PURE__ */ p("tr", {
|
|
233
228
|
"data-empty-row": !0,
|
|
234
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ p("td", {
|
|
235
230
|
colSpan: Z,
|
|
236
231
|
className: n.emptyCell,
|
|
237
|
-
children:
|
|
232
|
+
children: fe ?? A.empty
|
|
238
233
|
})
|
|
239
234
|
}),
|
|
240
|
-
!C && D &&
|
|
235
|
+
!C && D && X > 0 && /* @__PURE__ */ p("tr", {
|
|
241
236
|
"aria-hidden": "true",
|
|
242
|
-
style: { height:
|
|
237
|
+
style: { height: X * O }
|
|
243
238
|
}),
|
|
244
|
-
!C &&
|
|
245
|
-
let a = D ?
|
|
246
|
-
return /* @__PURE__ */
|
|
239
|
+
!C && Y.map((e, i) => {
|
|
240
|
+
let a = D ? X + i : i, o = N.includes(e.id), s = Ee.has(e.id);
|
|
241
|
+
return /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ m("tr", {
|
|
247
242
|
className: n.row,
|
|
248
243
|
"data-parity": a % 2 == 0 ? "even" : "odd",
|
|
249
244
|
"data-state": o ? "selected" : void 0,
|
|
250
|
-
"aria-rowindex": D ?
|
|
245
|
+
"aria-rowindex": D ? X + i + 1 : void 0,
|
|
251
246
|
children: [
|
|
252
|
-
S && /* @__PURE__ */
|
|
247
|
+
S && /* @__PURE__ */ p("td", {
|
|
253
248
|
className: n.controlCell,
|
|
254
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ p("button", {
|
|
255
250
|
type: "button",
|
|
256
251
|
className: n.expandButton,
|
|
257
252
|
"aria-expanded": s,
|
|
258
|
-
"aria-label":
|
|
253
|
+
"aria-label": A.expandRow,
|
|
259
254
|
"data-state": s ? "open" : "closed",
|
|
260
|
-
onClick: () =>
|
|
261
|
-
children: /* @__PURE__ */
|
|
255
|
+
onClick: () => Te(e.id),
|
|
256
|
+
children: /* @__PURE__ */ p("span", {
|
|
262
257
|
className: n.chevron,
|
|
263
258
|
"aria-hidden": "true"
|
|
264
259
|
})
|
|
265
260
|
})
|
|
266
261
|
}),
|
|
267
|
-
b && /* @__PURE__ */
|
|
262
|
+
b && /* @__PURE__ */ p("td", {
|
|
268
263
|
className: n.controlCell,
|
|
269
|
-
children: /* @__PURE__ */
|
|
270
|
-
"aria-label":
|
|
264
|
+
children: /* @__PURE__ */ p(t, {
|
|
265
|
+
"aria-label": A.selectRow,
|
|
271
266
|
checked: o,
|
|
272
|
-
onChange: () =>
|
|
267
|
+
onChange: () => we(e.id)
|
|
273
268
|
})
|
|
274
269
|
}),
|
|
275
|
-
|
|
270
|
+
g.map((t) => /* @__PURE__ */ p("td", {
|
|
276
271
|
"data-align": t.align ?? "start",
|
|
277
272
|
"data-sized": t.width !== void 0 || void 0,
|
|
278
|
-
children: t.render ? t.render(e.row) : String(
|
|
273
|
+
children: t.render ? t.render(e.row) : String(h(e.row, t.key) ?? "")
|
|
279
274
|
}, t.key))
|
|
280
275
|
]
|
|
281
|
-
}), S && /* @__PURE__ */
|
|
276
|
+
}), S && /* @__PURE__ */ p("tr", {
|
|
282
277
|
className: n.expansionRow,
|
|
283
278
|
"data-state": s ? "open" : "closed",
|
|
284
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ p("td", {
|
|
285
280
|
colSpan: Z,
|
|
286
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ p("div", {
|
|
287
282
|
className: n.expansionGrid,
|
|
288
283
|
"data-state": s ? "open" : "closed",
|
|
289
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ p("div", {
|
|
290
285
|
className: n.expansionInner,
|
|
291
286
|
children: S(e.row)
|
|
292
287
|
})
|
|
@@ -294,17 +289,17 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
|
|
|
294
289
|
})
|
|
295
290
|
})] }, e.id);
|
|
296
291
|
}),
|
|
297
|
-
!C && D &&
|
|
292
|
+
!C && D && Oe < q.length && /* @__PURE__ */ p("tr", {
|
|
298
293
|
"aria-hidden": "true",
|
|
299
|
-
style: { height: (
|
|
294
|
+
style: { height: (q.length - Oe) * O }
|
|
300
295
|
}),
|
|
301
|
-
|
|
296
|
+
Ae > 0 && /* @__PURE__ */ p("tr", {
|
|
302
297
|
"aria-hidden": "true",
|
|
303
298
|
"data-filler-row": !0,
|
|
304
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ p("td", {
|
|
305
300
|
colSpan: Z,
|
|
306
301
|
style: {
|
|
307
|
-
blockSize: `calc(var(--_row-height) * ${
|
|
302
|
+
blockSize: `calc(var(--_row-height) * ${Ae})`,
|
|
308
303
|
padding: 0
|
|
309
304
|
}
|
|
310
305
|
})
|
|
@@ -313,55 +308,55 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
|
|
|
313
308
|
]
|
|
314
309
|
})
|
|
315
310
|
}),
|
|
316
|
-
y && /* @__PURE__ */
|
|
311
|
+
y && /* @__PURE__ */ m("div", {
|
|
317
312
|
className: n.footer,
|
|
318
313
|
children: [
|
|
319
|
-
y.pageSizeOptions && /* @__PURE__ */
|
|
314
|
+
y.pageSizeOptions && /* @__PURE__ */ m("label", {
|
|
320
315
|
className: n.pageSize,
|
|
321
|
-
children: [/* @__PURE__ */
|
|
322
|
-
value:
|
|
316
|
+
children: [/* @__PURE__ */ p("span", { children: "Rows per page" }), /* @__PURE__ */ p("select", {
|
|
317
|
+
value: L.value,
|
|
323
318
|
onChange: (e) => {
|
|
324
|
-
|
|
319
|
+
L.value = Number(e.target.value), I.value = 1;
|
|
325
320
|
},
|
|
326
|
-
children: y.pageSizeOptions.map((e) => /* @__PURE__ */
|
|
321
|
+
children: y.pageSizeOptions.map((e) => /* @__PURE__ */ p("option", {
|
|
327
322
|
value: e,
|
|
328
323
|
children: e
|
|
329
324
|
}, e))
|
|
330
325
|
})]
|
|
331
326
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ m("span", {
|
|
333
328
|
className: n.range,
|
|
334
329
|
children: [
|
|
335
330
|
$,
|
|
336
331
|
"–",
|
|
337
|
-
|
|
332
|
+
Ne,
|
|
338
333
|
" of ",
|
|
339
334
|
Q
|
|
340
335
|
]
|
|
341
336
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ m("div", {
|
|
343
338
|
className: n.pageButtons,
|
|
344
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ p("button", {
|
|
345
340
|
type: "button",
|
|
346
341
|
className: n.pageButton,
|
|
347
|
-
"aria-label":
|
|
348
|
-
disabled:
|
|
342
|
+
"aria-label": A.previousPage,
|
|
343
|
+
disabled: W.value <= 1,
|
|
349
344
|
onClick: () => {
|
|
350
|
-
|
|
345
|
+
I.value = W.value - 1;
|
|
351
346
|
},
|
|
352
|
-
children: /* @__PURE__ */
|
|
347
|
+
children: /* @__PURE__ */ p("span", {
|
|
353
348
|
"aria-hidden": "true",
|
|
354
349
|
children: "‹"
|
|
355
350
|
})
|
|
356
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ p("button", {
|
|
357
352
|
type: "button",
|
|
358
353
|
className: n.pageButton,
|
|
359
|
-
"aria-label":
|
|
360
|
-
disabled:
|
|
354
|
+
"aria-label": A.nextPage,
|
|
355
|
+
disabled: W.value >= ye.value,
|
|
361
356
|
onClick: () => {
|
|
362
|
-
|
|
357
|
+
I.value = W.value + 1;
|
|
363
358
|
},
|
|
364
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ p("span", {
|
|
365
360
|
"aria-hidden": "true",
|
|
366
361
|
children: "›"
|
|
367
362
|
})
|
|
@@ -373,4 +368,4 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
|
|
|
373
368
|
});
|
|
374
369
|
}
|
|
375
370
|
//#endregion
|
|
376
|
-
export {
|
|
371
|
+
export { g 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_bwapn_2",
|
|
4
|
+
toolbar: "_toolbar_bwapn_26",
|
|
5
|
+
heading: "_heading_bwapn_35",
|
|
6
|
+
title: "_title_bwapn_41",
|
|
7
|
+
description: "_description_bwapn_47",
|
|
8
|
+
search: "_search_bwapn_52",
|
|
9
|
+
batchBar: "_batchBar_bwapn_79",
|
|
10
|
+
batchCount: "_batchCount_bwapn_89",
|
|
11
|
+
batchActions: "_batchActions_bwapn_95",
|
|
12
|
+
scroller: "_scroller_bwapn_101",
|
|
13
|
+
scrollerVirtualized: "_scrollerVirtualized_bwapn_111",
|
|
14
|
+
table: "_table_bwapn_117",
|
|
15
|
+
row: "_row_bwapn_199",
|
|
16
|
+
controlCol: "_controlCol_bwapn_219",
|
|
17
|
+
controlCell: "_controlCell_bwapn_223",
|
|
18
|
+
sortButton: "_sortButton_bwapn_229",
|
|
19
|
+
emptyCell: "_emptyCell_bwapn_277",
|
|
20
|
+
expansionRow: "_expansionRow_bwapn_284",
|
|
21
|
+
expansionGrid: "_expansionGrid_bwapn_290",
|
|
22
|
+
expansionInner: "_expansionInner_bwapn_294",
|
|
23
|
+
expandButton: "_expandButton_bwapn_299",
|
|
24
|
+
chevron: "_chevron_bwapn_322",
|
|
25
|
+
shimmer: "_shimmer_bwapn_337",
|
|
26
|
+
footer: "_footer_bwapn_364",
|
|
27
|
+
pageSize: "_pageSize_bwapn_374",
|
|
28
|
+
range: "_range_bwapn_400",
|
|
29
|
+
pageButtons: "_pageButtons_bwapn_405",
|
|
30
|
+
pageButton: "_pageButton_bwapn_405",
|
|
31
|
+
srOnly: "_srOnly_bwapn_446"
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
34
34
|
export { e as default };
|