@sito/dashboard 0.0.74 → 0.0.76
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/dist/Badge-DSSlox-y.cjs +1 -0
- package/dist/Badge-DW9i2Rh6.js +10 -0
- package/dist/Badge.cjs +1 -1
- package/dist/Badge.js +1 -1
- package/dist/Button-BxyXUUMe.cjs +1 -0
- package/dist/Button-C6icqzyN.js +25 -0
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Chip-6bEZ7uwv.js +43 -0
- package/dist/Chip-N4r2Xf9l.cjs +1 -0
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +1 -1
- package/dist/FileInput-C7ZYKt_i.js +100 -0
- package/dist/FileInput-Cz2R3z3k.cjs +1 -0
- package/dist/Form.cjs +1 -1
- package/dist/Form.js +2 -2
- package/dist/{IconButton-BpsTEj0z.js → IconButton-CqPk_OXG.js} +9 -8
- package/dist/IconButton-DVZCHIHB.cjs +1 -0
- package/dist/IconButton.cjs +1 -1
- package/dist/IconButton.css +1 -1
- package/dist/IconButton.js +1 -1
- package/dist/Loading-BTwXNOEv.js +27 -0
- package/dist/Loading-C70yH2dC.cjs +1 -0
- package/dist/Loading.cjs +1 -1
- package/dist/Loading.js +1 -1
- package/dist/SelectInput-BKFTGaAm.js +569 -0
- package/dist/SelectInput-C4wtTiHe.cjs +1 -0
- package/dist/SelectInput.css +1 -1
- package/dist/Table-BofsZtu9.cjs +1 -0
- package/dist/{Table-DO7FFraQ.js → Table-Mx5SOKp_.js} +311 -281
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/Tooltip-B7LXJBLs.cjs +1 -0
- package/dist/Tooltip-p-nQtZ5Y.js +38 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/Translation.cjs +1 -1
- package/dist/Translation.js +1 -1
- package/dist/TranslationProvider-BmV4WUQy.cjs +1 -0
- package/dist/TranslationProvider-DNybGe-x.js +19 -0
- package/dist/classNames-DDRjbGA1.js +20 -0
- package/dist/classNames-DHAzUjfZ.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +76 -74
- package/dist/lib/classNames.d.ts +7 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +4 -2
- package/dist/providers/FiltersProvider/FiltersProvider.d.ts +1 -1
- package/dist/providers/TableOptions/TableOptionsProvider.d.ts +3 -3
- package/dist/providers/Translation/TranslationProvider.d.ts +2 -6
- package/dist/providers/Translation/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/Badge-CIeYthEy.js +0 -9
- package/dist/Badge-Z78MlGoQ.cjs +0 -1
- package/dist/Button-BlYa3uPc.cjs +0 -1
- package/dist/Button-D73-swfo.js +0 -24
- package/dist/Chip-C5ogKbFn.js +0 -37
- package/dist/Chip-D17UJHW6.cjs +0 -1
- package/dist/FileInput-CqzVk1gQ.cjs +0 -1
- package/dist/FileInput-Cr4TxWUg.js +0 -93
- package/dist/IconButton-CVnmT2E9.cjs +0 -1
- package/dist/Loading-B_c_4XLr.js +0 -26
- package/dist/Loading-CNECRan-.cjs +0 -1
- package/dist/SelectInput-Dm7gv03Z.js +0 -521
- package/dist/SelectInput-dYjrdopP.cjs +0 -1
- package/dist/Table-C03frnWb.cjs +0 -1
- package/dist/Tooltip-B4E-FRwY.js +0 -37
- package/dist/Tooltip-BSKAgRkc.cjs +0 -1
- package/dist/TranslationProvider-BR4s--Vu.js +0 -19
- package/dist/TranslationProvider-Czr0WIDH.cjs +0 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "./Table.css";
|
|
2
|
-
import { jsxs as b, jsx as e, Fragment as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as ie,
|
|
7
|
-
import {
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
2
|
+
import { jsxs as b, jsx as e, Fragment as G } from "react/jsx-runtime";
|
|
3
|
+
import { c as O } from "./classNames-DDRjbGA1.js";
|
|
4
|
+
import { useState as V, useRef as B, useEffect as j, useMemo as S, useCallback as x, Fragment as ue } from "react";
|
|
5
|
+
import { u as J, a as $, F as pe } from "./FiltersProvider-iOkSYSFZ.js";
|
|
6
|
+
import { E as me, c as ae, C as ie, T as he, a as fe, b as be, B as ge, F as Ne } from "./TableColumns-CIddkosX.js";
|
|
7
|
+
import { C as re, A as Ce, S as te, T as Z } from "./SelectInput-BKFTGaAm.js";
|
|
8
|
+
import { u as D } from "./TableOptionsProvider-Dzq4dOu8.js";
|
|
9
|
+
import { u as _ } from "./TranslationProvider-DNybGe-x.js";
|
|
10
|
+
import { I as U } from "./IconButton-CqPk_OXG.js";
|
|
11
|
+
import { B as ye } from "./Badge-DW9i2Rh6.js";
|
|
12
|
+
import { FilterTypes as q } from "./lib.js";
|
|
13
|
+
import { B as ee } from "./Button-C6icqzyN.js";
|
|
14
|
+
import { C as ne } from "./Chip-6bEZ7uwv.js";
|
|
15
|
+
import { T as oe } from "./Tooltip-p-nQtZ5Y.js";
|
|
16
|
+
import { S as ve } from "./query-CwuehjY1.js";
|
|
17
|
+
import { D as we } from "./Dropdown-D-fYEGo2.js";
|
|
18
|
+
import { L as xe } from "./Loading-BTwXNOEv.js";
|
|
19
|
+
function ce(n) {
|
|
19
20
|
const {
|
|
20
21
|
id: t,
|
|
21
22
|
icon: a,
|
|
@@ -33,7 +34,11 @@ function oe(n) {
|
|
|
33
34
|
{
|
|
34
35
|
type: "button",
|
|
35
36
|
id: t,
|
|
36
|
-
className:
|
|
37
|
+
className: O(
|
|
38
|
+
"action",
|
|
39
|
+
c ? "text-action" : "icon-action",
|
|
40
|
+
p
|
|
41
|
+
),
|
|
37
42
|
disabled: o,
|
|
38
43
|
"aria-label": s,
|
|
39
44
|
onClick: (d) => {
|
|
@@ -51,7 +56,7 @@ function oe(n) {
|
|
|
51
56
|
}
|
|
52
57
|
);
|
|
53
58
|
}
|
|
54
|
-
function
|
|
59
|
+
function Se(n) {
|
|
55
60
|
const {
|
|
56
61
|
actions: t = [],
|
|
57
62
|
className: a = "",
|
|
@@ -60,12 +65,12 @@ function xe(n) {
|
|
|
60
65
|
showTooltips: i = !0,
|
|
61
66
|
showActionTexts: u = !1
|
|
62
67
|
} = n;
|
|
63
|
-
return /* @__PURE__ */ e("ul", { className:
|
|
68
|
+
return /* @__PURE__ */ e("ul", { className: O("actions-container", a), children: t.map((o) => /* @__PURE__ */ e(
|
|
64
69
|
"li",
|
|
65
70
|
{
|
|
66
|
-
className:
|
|
71
|
+
className: O("actions-container-item", s),
|
|
67
72
|
children: /* @__PURE__ */ e(
|
|
68
|
-
|
|
73
|
+
ce,
|
|
69
74
|
{
|
|
70
75
|
showTooltips: i,
|
|
71
76
|
showText: u,
|
|
@@ -77,13 +82,13 @@ function xe(n) {
|
|
|
77
82
|
o.id
|
|
78
83
|
)) });
|
|
79
84
|
}
|
|
80
|
-
const
|
|
81
|
-
const { actions: t = [], className: a = "" } = n, { t: s } =
|
|
82
|
-
return /* @__PURE__ */ b("div", { className:
|
|
85
|
+
const Re = (n) => {
|
|
86
|
+
const { actions: t = [], className: a = "" } = n, { t: s } = _(), [l, i] = V(!1), [u, o] = V(null);
|
|
87
|
+
return /* @__PURE__ */ b("div", { className: O("actions-dropdown", a), children: [
|
|
83
88
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
89
|
+
U,
|
|
85
90
|
{
|
|
86
|
-
icon: /* @__PURE__ */ e(
|
|
91
|
+
icon: /* @__PURE__ */ e(me, {}),
|
|
87
92
|
onClick: (c) => {
|
|
88
93
|
c.stopPropagation(), o(c.currentTarget), i((r) => !r);
|
|
89
94
|
},
|
|
@@ -96,13 +101,13 @@ const Se = (n) => {
|
|
|
96
101
|
}
|
|
97
102
|
),
|
|
98
103
|
/* @__PURE__ */ e(
|
|
99
|
-
|
|
104
|
+
we,
|
|
100
105
|
{
|
|
101
106
|
open: l,
|
|
102
107
|
onClose: () => i(!1),
|
|
103
108
|
anchorEl: u,
|
|
104
109
|
children: /* @__PURE__ */ e(
|
|
105
|
-
|
|
110
|
+
Se,
|
|
106
111
|
{
|
|
107
112
|
showActionTexts: !0,
|
|
108
113
|
actions: t,
|
|
@@ -116,24 +121,24 @@ const Se = (n) => {
|
|
|
116
121
|
)
|
|
117
122
|
] });
|
|
118
123
|
};
|
|
119
|
-
function
|
|
124
|
+
function se(n, t = []) {
|
|
120
125
|
return [...n].sort((a, s) => (s.pos ?? 0) - (a.pos ?? 0)).filter(
|
|
121
126
|
(a) => a.display !== "none" && !t.includes(a.key)
|
|
122
127
|
);
|
|
123
128
|
}
|
|
124
|
-
function
|
|
125
|
-
const { t } =
|
|
129
|
+
function Te(n) {
|
|
130
|
+
const { t } = _(), {
|
|
126
131
|
entity: a = "",
|
|
127
132
|
columns: s = [],
|
|
128
133
|
hasAction: l = !0,
|
|
129
134
|
onSortCallback: i,
|
|
130
135
|
selectionState: u,
|
|
131
136
|
onToggleAllRows: o
|
|
132
|
-
} = n, c =
|
|
133
|
-
|
|
137
|
+
} = n, c = B(null);
|
|
138
|
+
j(() => {
|
|
134
139
|
c.current && (c.current.indeterminate = !!(u?.hasSomeSelected && !u?.allSelected));
|
|
135
140
|
}, [u]);
|
|
136
|
-
const { onSort: r, sortingOrder: p, sortingBy: d, hiddenColumns: y } =
|
|
141
|
+
const { onSort: r, sortingOrder: p, sortingBy: d, hiddenColumns: y } = D(), f = S(() => se(s, y).map((h) => ({
|
|
137
142
|
id: h.key,
|
|
138
143
|
label: h.label,
|
|
139
144
|
renderHead: h.renderHead,
|
|
@@ -157,22 +162,22 @@ function Re(n) {
|
|
|
157
162
|
"th",
|
|
158
163
|
{
|
|
159
164
|
scope: "col",
|
|
160
|
-
className:
|
|
165
|
+
className: O("table-headers-column", h.className),
|
|
161
166
|
children: /* @__PURE__ */ b(
|
|
162
|
-
|
|
167
|
+
ee,
|
|
163
168
|
{
|
|
164
169
|
disabled: !h.sortable,
|
|
165
170
|
onClick: () => r(h.id, i),
|
|
166
171
|
className: "table-headers-cell",
|
|
167
172
|
children: [
|
|
168
173
|
h.renderHead ? h.renderHead() : /* @__PURE__ */ e("span", { className: "table-headers-label", children: h.label }),
|
|
169
|
-
h.sortable && d === h.id && /* @__PURE__ */ e("span", { children: p ===
|
|
170
|
-
|
|
174
|
+
h.sortable && d === h.id && /* @__PURE__ */ e("span", { children: p === ve.ASC ? h.sortOptions?.icons?.asc ?? /* @__PURE__ */ e(
|
|
175
|
+
ae,
|
|
171
176
|
{
|
|
172
177
|
className: h.sortOptions?.icons?.className ?? "table-headers-sort-indicator"
|
|
173
178
|
}
|
|
174
179
|
) : h.sortOptions?.icons?.desc ?? /* @__PURE__ */ e(
|
|
175
|
-
|
|
180
|
+
ie,
|
|
176
181
|
{
|
|
177
182
|
className: h.sortOptions?.icons?.className ?? "table-headers-sort-indicator"
|
|
178
183
|
}
|
|
@@ -185,9 +190,9 @@ function Re(n) {
|
|
|
185
190
|
))
|
|
186
191
|
] }) });
|
|
187
192
|
}
|
|
188
|
-
function
|
|
189
|
-
const { columns: t } = n, { hiddenColumns: a, toggleColumn: s } =
|
|
190
|
-
() =>
|
|
193
|
+
function ke(n) {
|
|
194
|
+
const { columns: t } = n, { hiddenColumns: a, toggleColumn: s } = D(), { t: l } = _(), [i, u] = V(!1), o = B(null), c = S(
|
|
195
|
+
() => se(
|
|
191
196
|
t.filter(
|
|
192
197
|
(d) => d.hideable !== !1 && d.display !== "none"
|
|
193
198
|
),
|
|
@@ -204,9 +209,9 @@ function Te(n) {
|
|
|
204
209
|
);
|
|
205
210
|
return c.length === 0 ? null : /* @__PURE__ */ b("div", { className: "column-visibility-menu", ref: o, children: [
|
|
206
211
|
/* @__PURE__ */ e(
|
|
207
|
-
|
|
212
|
+
U,
|
|
208
213
|
{
|
|
209
|
-
icon: /* @__PURE__ */ e(
|
|
214
|
+
icon: /* @__PURE__ */ e(he, { className: "column-visibility-icon" }),
|
|
210
215
|
className: "normal column-visibility-trigger",
|
|
211
216
|
"aria-haspopup": "true",
|
|
212
217
|
"aria-expanded": i,
|
|
@@ -214,7 +219,7 @@ function Te(n) {
|
|
|
214
219
|
children: /* @__PURE__ */ e("span", { className: "table-header-sr", children: l("_accessibility:buttons.columns") })
|
|
215
220
|
}
|
|
216
221
|
),
|
|
217
|
-
i && /* @__PURE__ */ b(
|
|
222
|
+
i && /* @__PURE__ */ b(G, { children: [
|
|
218
223
|
/* @__PURE__ */ e(
|
|
219
224
|
"div",
|
|
220
225
|
{
|
|
@@ -223,7 +228,7 @@ function Te(n) {
|
|
|
223
228
|
}
|
|
224
229
|
),
|
|
225
230
|
/* @__PURE__ */ e("div", { className: "column-visibility-dropdown", role: "menu", children: c.map((d) => /* @__PURE__ */ e(
|
|
226
|
-
|
|
231
|
+
re,
|
|
227
232
|
{
|
|
228
233
|
checked: !a.includes(d.key),
|
|
229
234
|
onChange: () => p(d.key),
|
|
@@ -235,35 +240,35 @@ function Te(n) {
|
|
|
235
240
|
] })
|
|
236
241
|
] });
|
|
237
242
|
}
|
|
238
|
-
const
|
|
243
|
+
const Ae = (n) => {
|
|
239
244
|
const { items: t, text: a, id: s, onClearFilter: l } = n;
|
|
240
245
|
return /* @__PURE__ */ e(
|
|
241
|
-
|
|
246
|
+
ne,
|
|
242
247
|
{
|
|
243
248
|
text: `${a}: ${t.map((i) => i.value ?? i.name).join(", ")}`,
|
|
244
249
|
onDelete: () => l(s)
|
|
245
250
|
}
|
|
246
251
|
);
|
|
247
|
-
},
|
|
252
|
+
}, Ee = (n) => {
|
|
248
253
|
const { end: t, start: a, text: s, id: l, onClearFilter: i } = n, u = (o) => o !== null && typeof o < "u" && o !== "";
|
|
249
254
|
return /* @__PURE__ */ e(
|
|
250
|
-
|
|
255
|
+
ne,
|
|
251
256
|
{
|
|
252
257
|
text: `${s}: ${u(a) ? a : "♾️"} - ${u(t) ? t : "♾️"}`,
|
|
253
258
|
onDelete: () => i(l)
|
|
254
259
|
}
|
|
255
260
|
);
|
|
256
|
-
},
|
|
261
|
+
}, Fe = (n) => typeof n == "object" && n !== null && !Array.isArray(n) && ("start" in n || "end" in n), Oe = (n) => {
|
|
257
262
|
const { filtersDefinition: t } = n, a = S(() => {
|
|
258
263
|
const o = {};
|
|
259
264
|
return t.forEach((c) => {
|
|
260
265
|
o[c.propertyName] = c.label ?? c.propertyName;
|
|
261
266
|
}), o;
|
|
262
|
-
}, [t]), { filters: s, clearFilters: l } =
|
|
267
|
+
}, [t]), { filters: s, clearFilters: l } = D(), i = S(() => Object.keys(s), [s]), u = x(
|
|
263
268
|
(o) => {
|
|
264
269
|
const c = s[o];
|
|
265
|
-
return
|
|
266
|
-
|
|
270
|
+
return Fe(c) ? /* @__PURE__ */ e(
|
|
271
|
+
Ee,
|
|
267
272
|
{
|
|
268
273
|
id: o,
|
|
269
274
|
text: a[o],
|
|
@@ -272,7 +277,7 @@ const ke = (n) => {
|
|
|
272
277
|
onClearFilter: l
|
|
273
278
|
}
|
|
274
279
|
) : Array.isArray(c) ? /* @__PURE__ */ e(
|
|
275
|
-
|
|
280
|
+
Ae,
|
|
276
281
|
{
|
|
277
282
|
id: o,
|
|
278
283
|
text: a[o],
|
|
@@ -280,7 +285,7 @@ const ke = (n) => {
|
|
|
280
285
|
onClearFilter: l
|
|
281
286
|
}
|
|
282
287
|
) : /* @__PURE__ */ e(
|
|
283
|
-
|
|
288
|
+
ne,
|
|
284
289
|
{
|
|
285
290
|
text: `${a[o]}: ${c?.value ?? c?.name ?? c}`,
|
|
286
291
|
onDelete: () => l(o)
|
|
@@ -291,14 +296,14 @@ const ke = (n) => {
|
|
|
291
296
|
);
|
|
292
297
|
return /* @__PURE__ */ e("ul", { className: "active-filters-main", children: i?.map((o) => /* @__PURE__ */ e("li", { children: u(o) }, o)) });
|
|
293
298
|
};
|
|
294
|
-
function
|
|
295
|
-
const { propertyName: t, label: a, placeholder: s, options: l, multiple: i = !0 } = n, { currentFilters: u, setCurrentFilters: o } =
|
|
299
|
+
function _e(n) {
|
|
300
|
+
const { propertyName: t, label: a, placeholder: s, options: l, multiple: i = !0 } = n, { currentFilters: u, setCurrentFilters: o } = J(), c = S(() => {
|
|
296
301
|
const p = u[t]?.value;
|
|
297
302
|
return typeof p > "u" ? null : p;
|
|
298
303
|
}, [u, t]), r = x(
|
|
299
304
|
(p) => {
|
|
300
305
|
o({
|
|
301
|
-
type:
|
|
306
|
+
type: $.update,
|
|
302
307
|
toUpdate: {
|
|
303
308
|
[t]: {
|
|
304
309
|
value: p
|
|
@@ -309,7 +314,7 @@ function Oe(n) {
|
|
|
309
314
|
[t, o]
|
|
310
315
|
);
|
|
311
316
|
return /* @__PURE__ */ e(
|
|
312
|
-
|
|
317
|
+
Ce,
|
|
313
318
|
{
|
|
314
319
|
value: c,
|
|
315
320
|
label: a,
|
|
@@ -322,17 +327,17 @@ function Oe(n) {
|
|
|
322
327
|
}
|
|
323
328
|
);
|
|
324
329
|
}
|
|
325
|
-
const
|
|
326
|
-
const { propertyName: t, label: a } = n, { currentFilters: s, setCurrentFilters: l } =
|
|
330
|
+
const Me = (n) => {
|
|
331
|
+
const { propertyName: t, label: a } = n, { currentFilters: s, setCurrentFilters: l } = J(), i = S(() => s[t]?.value ?? "", [s]), u = x((o) => {
|
|
327
332
|
l({
|
|
328
|
-
type:
|
|
333
|
+
type: $.update,
|
|
329
334
|
toUpdate: { [t]: { value: o.target.checked } }
|
|
330
335
|
});
|
|
331
336
|
}, []);
|
|
332
|
-
return /* @__PURE__ */ e(
|
|
337
|
+
return /* @__PURE__ */ e(re, { label: a, checked: i ?? !1, onChange: u });
|
|
333
338
|
};
|
|
334
|
-
function
|
|
335
|
-
const { propertyName: t, options: a, label: s, placeholder: l } = n, { currentFilters: i, setCurrentFilters: u } =
|
|
339
|
+
function Pe(n) {
|
|
340
|
+
const { propertyName: t, options: a, label: s, placeholder: l } = n, { currentFilters: i, setCurrentFilters: u } = J(), o = S(() => {
|
|
336
341
|
const r = i[t]?.value;
|
|
337
342
|
if (r === null || typeof r > "u")
|
|
338
343
|
return a[0]?.id ?? "";
|
|
@@ -347,7 +352,7 @@ function $e(n) {
|
|
|
347
352
|
(d) => String(d.id) === r.target.value
|
|
348
353
|
);
|
|
349
354
|
u({
|
|
350
|
-
type:
|
|
355
|
+
type: $.update,
|
|
351
356
|
toUpdate: {
|
|
352
357
|
[t]: { value: p?.id ?? r.target.value }
|
|
353
358
|
}
|
|
@@ -356,7 +361,7 @@ function $e(n) {
|
|
|
356
361
|
[a, t, u]
|
|
357
362
|
);
|
|
358
363
|
return /* @__PURE__ */ e(
|
|
359
|
-
|
|
364
|
+
te,
|
|
360
365
|
{
|
|
361
366
|
value: o,
|
|
362
367
|
label: s,
|
|
@@ -368,15 +373,15 @@ function $e(n) {
|
|
|
368
373
|
}
|
|
369
374
|
);
|
|
370
375
|
}
|
|
371
|
-
const
|
|
372
|
-
const { propertyName: t, label: a, placeholder: s } = n, { currentFilters: l, setCurrentFilters: i } =
|
|
376
|
+
const Ve = (n) => {
|
|
377
|
+
const { propertyName: t, label: a, placeholder: s } = n, { currentFilters: l, setCurrentFilters: i } = J(), u = S(() => l[t]?.value ?? "", [l]), o = x((c) => {
|
|
373
378
|
i({
|
|
374
|
-
type:
|
|
379
|
+
type: $.update,
|
|
375
380
|
toUpdate: { [t]: { value: c.target.value } }
|
|
376
381
|
});
|
|
377
382
|
}, []);
|
|
378
383
|
return /* @__PURE__ */ e(
|
|
379
|
-
|
|
384
|
+
Z,
|
|
380
385
|
{
|
|
381
386
|
value: u ?? "",
|
|
382
387
|
label: a,
|
|
@@ -386,10 +391,10 @@ const Me = (n) => {
|
|
|
386
391
|
placeholder: s
|
|
387
392
|
}
|
|
388
393
|
);
|
|
389
|
-
},
|
|
390
|
-
const { propertyName: t, label: a, inputType: s } = n, { t: l } =
|
|
394
|
+
}, le = (n) => {
|
|
395
|
+
const { propertyName: t, label: a, inputType: s } = n, { t: l } = _(), { currentFilters: i, setCurrentFilters: u } = J(), o = B(null), c = B(null), r = x((d) => {
|
|
391
396
|
u({
|
|
392
|
-
type:
|
|
397
|
+
type: $.update,
|
|
393
398
|
toUpdate: {
|
|
394
399
|
[t]: {
|
|
395
400
|
value: { end: c?.current?.value ?? null, start: d.target.value }
|
|
@@ -398,7 +403,7 @@ const Me = (n) => {
|
|
|
398
403
|
});
|
|
399
404
|
}, []), p = x((d) => {
|
|
400
405
|
u({
|
|
401
|
-
type:
|
|
406
|
+
type: $.update,
|
|
402
407
|
toUpdate: {
|
|
403
408
|
[t]: {
|
|
404
409
|
value: {
|
|
@@ -413,7 +418,7 @@ const Me = (n) => {
|
|
|
413
418
|
/* @__PURE__ */ e("p", { className: "text-input-label input-widget-label input-label-normal", children: a }),
|
|
414
419
|
/* @__PURE__ */ b("div", { className: "range-widget-row", children: [
|
|
415
420
|
/* @__PURE__ */ e(
|
|
416
|
-
|
|
421
|
+
Z,
|
|
417
422
|
{
|
|
418
423
|
value: i[t]?.value?.start ?? "",
|
|
419
424
|
placeholder: l("_accessibility:components.table.filters.range.start"),
|
|
@@ -425,7 +430,7 @@ const Me = (n) => {
|
|
|
425
430
|
}
|
|
426
431
|
),
|
|
427
432
|
/* @__PURE__ */ e(
|
|
428
|
-
|
|
433
|
+
Z,
|
|
429
434
|
{
|
|
430
435
|
value: i[t]?.value?.end ?? "",
|
|
431
436
|
placeholder: l("_accessibility:components.table.filters.range.end"),
|
|
@@ -438,37 +443,37 @@ const Me = (n) => {
|
|
|
438
443
|
)
|
|
439
444
|
] })
|
|
440
445
|
] });
|
|
441
|
-
},
|
|
446
|
+
}, De = (n) => {
|
|
442
447
|
switch (n.type) {
|
|
443
|
-
case
|
|
444
|
-
return /* @__PURE__ */ e(
|
|
445
|
-
case
|
|
448
|
+
case q.text:
|
|
449
|
+
return /* @__PURE__ */ e(Ve, { ...n });
|
|
450
|
+
case q.number:
|
|
446
451
|
return /* @__PURE__ */ e(
|
|
447
|
-
|
|
452
|
+
le,
|
|
448
453
|
{
|
|
449
454
|
...n,
|
|
450
455
|
inputType: "number"
|
|
451
456
|
}
|
|
452
457
|
);
|
|
453
|
-
case
|
|
458
|
+
case q.date:
|
|
454
459
|
return /* @__PURE__ */ e(
|
|
455
|
-
|
|
460
|
+
le,
|
|
456
461
|
{
|
|
457
462
|
...n,
|
|
458
463
|
inputType: "date"
|
|
459
464
|
}
|
|
460
465
|
);
|
|
461
|
-
case
|
|
462
|
-
return /* @__PURE__ */ e(
|
|
463
|
-
case
|
|
464
|
-
return /* @__PURE__ */ e(Oe, { ...n });
|
|
465
|
-
case W.check:
|
|
466
|
+
case q.select:
|
|
467
|
+
return /* @__PURE__ */ e(Pe, { ...n });
|
|
468
|
+
case q.autocomplete:
|
|
466
469
|
return /* @__PURE__ */ e(_e, { ...n });
|
|
470
|
+
case q.check:
|
|
471
|
+
return /* @__PURE__ */ e(Me, { ...n });
|
|
467
472
|
}
|
|
468
|
-
return /* @__PURE__ */ e(
|
|
469
|
-
},
|
|
470
|
-
const { filters: t = [], show: a, handleShow: s } = n, { onFilterApply: l } =
|
|
471
|
-
return
|
|
473
|
+
return /* @__PURE__ */ e(G, {});
|
|
474
|
+
}, Ie = (n) => {
|
|
475
|
+
const { filters: t = [], show: a, handleShow: s } = n, { onFilterApply: l } = D(), { currentFilters: i, setCurrentFilters: u } = J(), { t: o } = _(), c = B(null);
|
|
476
|
+
return j(() => {
|
|
472
477
|
const r = ({ target: d }) => {
|
|
473
478
|
c.current && (d?.closest(".filter-dropdown-trigger") || !a || c.current.contains(d) || s(!1));
|
|
474
479
|
}, p = ({ code: d }) => {
|
|
@@ -477,42 +482,51 @@ const Me = (n) => {
|
|
|
477
482
|
return document.addEventListener("click", r), document.addEventListener("keydown", p), () => {
|
|
478
483
|
document.removeEventListener("click", r), document.removeEventListener("keydown", p);
|
|
479
484
|
};
|
|
480
|
-
}, [s, a]), /* @__PURE__ */ e(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
485
|
+
}, [s, a]), /* @__PURE__ */ e(
|
|
486
|
+
"div",
|
|
487
|
+
{
|
|
488
|
+
className: O(
|
|
489
|
+
"filter-dropdown-backdrop",
|
|
490
|
+
a ? "opened" : "closed"
|
|
491
|
+
),
|
|
492
|
+
children: /* @__PURE__ */ b("div", { className: "filter-popup", ref: c, children: [
|
|
493
|
+
/* @__PURE__ */ e("div", { className: "filter-title", children: o("_accessibility:buttons.filters") }),
|
|
494
|
+
/* @__PURE__ */ e("ul", { className: "filter-container", children: t.map((r) => /* @__PURE__ */ e("li", { className: "filter-container-item", children: De(r) }, r.propertyName)) }),
|
|
495
|
+
/* @__PURE__ */ e("div", { className: "filter-footer", children: /* @__PURE__ */ b("ul", { className: "filter-buttons-row", children: [
|
|
496
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
497
|
+
ee,
|
|
498
|
+
{
|
|
499
|
+
type: "button",
|
|
500
|
+
variant: "submit",
|
|
501
|
+
onClick: () => u({
|
|
502
|
+
type: $.reset,
|
|
503
|
+
filters: t
|
|
504
|
+
}),
|
|
505
|
+
className: "filter-dropdown-button filter-dropdown-cancel",
|
|
506
|
+
children: o("_accessibility:buttons.clear")
|
|
507
|
+
}
|
|
508
|
+
) }),
|
|
509
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
510
|
+
ee,
|
|
511
|
+
{
|
|
512
|
+
type: "button",
|
|
513
|
+
variant: "submit",
|
|
514
|
+
color: "primary",
|
|
515
|
+
className: "filter-dropdown-button filter-dropdown-submit",
|
|
516
|
+
onClick: () => {
|
|
517
|
+
s(!1), l(i);
|
|
518
|
+
},
|
|
519
|
+
children: o("_accessibility:buttons.applyFilters")
|
|
520
|
+
}
|
|
521
|
+
) })
|
|
522
|
+
] }) })
|
|
523
|
+
] })
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
}, ze = () => {
|
|
527
|
+
const { t: n } = _(), { total: t, pageSize: a, pageSizes: s, currentPage: l } = D(), i = (l + 1) * a > t ? t : (l + 1) * a;
|
|
514
528
|
return /* @__PURE__ */ b("div", { className: "table-navigation-sizes", children: [
|
|
515
|
-
s[0] < t && /* @__PURE__ */ e(
|
|
529
|
+
s[0] < t && /* @__PURE__ */ e(G, { children: /* @__PURE__ */ b("p", { children: [
|
|
516
530
|
l * a + 1,
|
|
517
531
|
" - ",
|
|
518
532
|
i,
|
|
@@ -522,8 +536,8 @@ const Me = (n) => {
|
|
|
522
536
|
/* @__PURE__ */ e("p", { children: t })
|
|
523
537
|
] });
|
|
524
538
|
};
|
|
525
|
-
function
|
|
526
|
-
const { t: n } =
|
|
539
|
+
function je() {
|
|
540
|
+
const { t: n } = _(), { total: t, pageSize: a, currentPage: s, setCurrentPage: l } = D(), i = S(() => {
|
|
527
541
|
const u = Math.ceil(t / a);
|
|
528
542
|
return Array.from({ length: u }, (o, c) => ({
|
|
529
543
|
id: c,
|
|
@@ -533,7 +547,7 @@ function Ie() {
|
|
|
533
547
|
return /* @__PURE__ */ b("div", { className: "jump-to-page", children: [
|
|
534
548
|
/* @__PURE__ */ e("p", { children: n("_accessibility:components.table.jumpToPage") }),
|
|
535
549
|
/* @__PURE__ */ e(
|
|
536
|
-
|
|
550
|
+
te,
|
|
537
551
|
{
|
|
538
552
|
value: s,
|
|
539
553
|
options: i,
|
|
@@ -545,13 +559,13 @@ function Ie() {
|
|
|
545
559
|
)
|
|
546
560
|
] });
|
|
547
561
|
}
|
|
548
|
-
const
|
|
549
|
-
const { t: n } =
|
|
562
|
+
const Le = () => {
|
|
563
|
+
const { t: n } = _(), { total: t, pageSize: a, currentPage: s, setCurrentPage: l } = D(), i = Math.ceil(t / a), u = s < i - 1;
|
|
550
564
|
return /* @__PURE__ */ b("div", { className: "table-navigation-pages", children: [
|
|
551
565
|
/* @__PURE__ */ e(
|
|
552
|
-
|
|
566
|
+
U,
|
|
553
567
|
{
|
|
554
|
-
icon: /* @__PURE__ */ e(
|
|
568
|
+
icon: /* @__PURE__ */ e(fe, { className: "table-navigation-icon" }),
|
|
555
569
|
className: "table-navigation-buttons",
|
|
556
570
|
disabled: s === 0,
|
|
557
571
|
"aria-label": n("_accessibility:buttons.previous"),
|
|
@@ -560,9 +574,9 @@ const ze = () => {
|
|
|
560
574
|
}
|
|
561
575
|
),
|
|
562
576
|
/* @__PURE__ */ e(
|
|
563
|
-
|
|
577
|
+
U,
|
|
564
578
|
{
|
|
565
|
-
icon: /* @__PURE__ */ e(
|
|
579
|
+
icon: /* @__PURE__ */ e(be, { className: "table-navigation-icon" }),
|
|
566
580
|
disabled: !u,
|
|
567
581
|
className: "table-navigation-buttons",
|
|
568
582
|
name: n("_accessibility:buttons.next"),
|
|
@@ -574,15 +588,15 @@ const ze = () => {
|
|
|
574
588
|
)
|
|
575
589
|
] });
|
|
576
590
|
};
|
|
577
|
-
function
|
|
578
|
-
const { t: n } =
|
|
591
|
+
function Be() {
|
|
592
|
+
const { t: n } = _(), { pageSizes: t, pageSize: a, setPageSize: s } = D(), l = S(
|
|
579
593
|
() => t?.map((i) => ({ id: i, value: i })),
|
|
580
594
|
[t]
|
|
581
595
|
);
|
|
582
596
|
return /* @__PURE__ */ b("div", { className: "page-size", children: [
|
|
583
597
|
/* @__PURE__ */ e("p", { children: n("_accessibility:components.table.pageSizes") }),
|
|
584
598
|
/* @__PURE__ */ e(
|
|
585
|
-
|
|
599
|
+
te,
|
|
586
600
|
{
|
|
587
601
|
value: a,
|
|
588
602
|
options: l,
|
|
@@ -594,16 +608,16 @@ function je() {
|
|
|
594
608
|
)
|
|
595
609
|
] });
|
|
596
610
|
}
|
|
597
|
-
function
|
|
611
|
+
function He() {
|
|
598
612
|
return /* @__PURE__ */ b("div", { className: "table-footer", children: [
|
|
599
|
-
/* @__PURE__ */ e(Ie, {}),
|
|
600
613
|
/* @__PURE__ */ e(je, {}),
|
|
601
|
-
/* @__PURE__ */ e(
|
|
602
|
-
/* @__PURE__ */ e(ze, {})
|
|
614
|
+
/* @__PURE__ */ e(Be, {}),
|
|
615
|
+
/* @__PURE__ */ e(ze, {}),
|
|
616
|
+
/* @__PURE__ */ e(Le, {})
|
|
603
617
|
] });
|
|
604
618
|
}
|
|
605
|
-
const
|
|
606
|
-
const { t } =
|
|
619
|
+
const $e = (n) => n, Ue = (n) => {
|
|
620
|
+
const { t } = _(), { hiddenColumns: a } = D(), {
|
|
607
621
|
columns: s,
|
|
608
622
|
softDeleteProperty: l = "deletedAt",
|
|
609
623
|
data: i,
|
|
@@ -613,7 +627,7 @@ const Be = (n) => n, He = (n) => {
|
|
|
613
627
|
onRowSelectionChange: r,
|
|
614
628
|
onRowExpand: p
|
|
615
629
|
} = n, d = S(
|
|
616
|
-
() =>
|
|
630
|
+
() => se(s, a),
|
|
617
631
|
[s, a]
|
|
618
632
|
), y = S(
|
|
619
633
|
() => new Map(
|
|
@@ -622,12 +636,18 @@ const Be = (n) => n, He = (n) => {
|
|
|
622
636
|
[c]
|
|
623
637
|
);
|
|
624
638
|
return i?.map((f) => {
|
|
625
|
-
const h = o.has(f.id), w = y.get(f.id), E = !!w,
|
|
626
|
-
return /* @__PURE__ */ b(
|
|
639
|
+
const h = o.has(f.id), w = y.get(f.id), E = !!w, I = d.length + 1 + (u ? 1 : 0);
|
|
640
|
+
return /* @__PURE__ */ b(ue, { children: [
|
|
627
641
|
/* @__PURE__ */ b(
|
|
628
642
|
"tr",
|
|
629
643
|
{
|
|
630
|
-
className:
|
|
644
|
+
className: O(
|
|
645
|
+
"table-row",
|
|
646
|
+
p ? "expandable" : "",
|
|
647
|
+
f[l] ? "deleted-class" : "",
|
|
648
|
+
h ? "selected" : "",
|
|
649
|
+
E ? "expanded" : ""
|
|
650
|
+
),
|
|
631
651
|
onClick: () => p?.(f),
|
|
632
652
|
children: [
|
|
633
653
|
/* @__PURE__ */ e("td", { className: "table-row-cell table-row-checkbox", children: /* @__PURE__ */ e(
|
|
@@ -648,24 +668,28 @@ const Be = (n) => n, He = (n) => {
|
|
|
648
668
|
), T = R.filter(
|
|
649
669
|
(C) => !C.sticky
|
|
650
670
|
);
|
|
651
|
-
return /* @__PURE__ */ b(
|
|
652
|
-
N.map((C) => /* @__PURE__ */ e(
|
|
653
|
-
|
|
671
|
+
return /* @__PURE__ */ b(G, { children: [
|
|
672
|
+
N.map((C) => /* @__PURE__ */ e(oe, { content: C.tooltip, children: /* @__PURE__ */ e(
|
|
673
|
+
ce,
|
|
654
674
|
{
|
|
655
675
|
...C,
|
|
656
676
|
onClick: () => C.onClick(f),
|
|
657
677
|
className: "row-table-action"
|
|
658
678
|
}
|
|
659
679
|
) }, C.id)),
|
|
660
|
-
T.length > 0 && /* @__PURE__ */ e(
|
|
680
|
+
T.length > 0 && /* @__PURE__ */ e(Re, { actions: T })
|
|
661
681
|
] });
|
|
662
682
|
})() }) }) : null,
|
|
663
683
|
d?.map((R, N) => {
|
|
664
|
-
const T = f[R.key], C = R.renderBody ? R.renderBody(T, f) :
|
|
684
|
+
const T = f[R.key], C = R.renderBody ? R.renderBody(T, f) : $e(T);
|
|
665
685
|
return /* @__PURE__ */ e(
|
|
666
686
|
"td",
|
|
667
687
|
{
|
|
668
|
-
className:
|
|
688
|
+
className: O(
|
|
689
|
+
"table-row-cell",
|
|
690
|
+
N === 0 ? "basic" : "",
|
|
691
|
+
R.className ?? ""
|
|
692
|
+
),
|
|
669
693
|
children: p && N === 0 ? /* @__PURE__ */ b("div", { className: "table-row-expand-content", children: [
|
|
670
694
|
/* @__PURE__ */ e(
|
|
671
695
|
"span",
|
|
@@ -673,7 +697,7 @@ const Be = (n) => n, He = (n) => {
|
|
|
673
697
|
className: "table-row-expand-indicator",
|
|
674
698
|
"aria-hidden": !0,
|
|
675
699
|
"data-state": E ? "expanded" : "collapsed",
|
|
676
|
-
children: E ? /* @__PURE__ */ e(
|
|
700
|
+
children: E ? /* @__PURE__ */ e(ae, { className: "table-row-expand-chevron" }) : /* @__PURE__ */ e(ie, { className: "table-row-expand-chevron" })
|
|
677
701
|
}
|
|
678
702
|
),
|
|
679
703
|
/* @__PURE__ */ e("div", { className: "table-row-expand-value", children: C })
|
|
@@ -685,21 +709,24 @@ const Be = (n) => n, He = (n) => {
|
|
|
685
709
|
]
|
|
686
710
|
}
|
|
687
711
|
),
|
|
688
|
-
E && w?.content !== null && typeof w?.content < "u" && /* @__PURE__ */ e("tr", { className: "table-row-expanded", children: /* @__PURE__ */ e("td", { className: "table-row-expanded-cell", colSpan:
|
|
712
|
+
E && w?.content !== null && typeof w?.content < "u" && /* @__PURE__ */ e("tr", { className: "table-row-expanded", children: /* @__PURE__ */ e("td", { className: "table-row-expanded-cell", colSpan: I, children: /* @__PURE__ */ e(
|
|
689
713
|
"div",
|
|
690
714
|
{
|
|
691
|
-
className:
|
|
715
|
+
className: O(
|
|
716
|
+
"table-row-expanded-content",
|
|
717
|
+
w.isVisible ? "open" : "closed"
|
|
718
|
+
),
|
|
692
719
|
children: /* @__PURE__ */ e("div", { className: "table-row-expanded-inner", children: w.content })
|
|
693
720
|
}
|
|
694
721
|
) }) })
|
|
695
722
|
] }, f.id);
|
|
696
723
|
});
|
|
697
724
|
};
|
|
698
|
-
function
|
|
699
|
-
const { t: n } =
|
|
725
|
+
function We() {
|
|
726
|
+
const { t: n } = _();
|
|
700
727
|
return /* @__PURE__ */ e("div", { className: "table-empty", children: /* @__PURE__ */ e("p", { children: n("_accessibility:components.table.empty") }) });
|
|
701
728
|
}
|
|
702
|
-
const
|
|
729
|
+
const qe = (n) => {
|
|
703
730
|
const {
|
|
704
731
|
columns: t,
|
|
705
732
|
title: a,
|
|
@@ -708,11 +735,11 @@ const We = (n) => {
|
|
|
708
735
|
filterOptions: i,
|
|
709
736
|
canHideColumns: u = !1,
|
|
710
737
|
canReset: o = !1
|
|
711
|
-
} = n, { countOfFilters: c, resetTableOptions: r } =
|
|
738
|
+
} = n, { countOfFilters: c, resetTableOptions: r } = D(), { t: p } = _(), d = S(() => t ? [...t].sort((N, T) => (T.pos ?? 0) - (N.pos ?? 0)).filter((N) => !!N.filterOptions).map((N) => ({
|
|
712
739
|
...N.filterOptions,
|
|
713
740
|
label: N.filterOptions?.label ?? N.label,
|
|
714
741
|
propertyName: N.key
|
|
715
|
-
})) : [], [t]), [y, f] =
|
|
742
|
+
})) : [], [t]), [y, f] = V(!1), h = x(
|
|
716
743
|
(N) => {
|
|
717
744
|
i?.dropdown?.setOpened ? i.dropdown.setOpened(N ?? !1) : f(N ?? !1);
|
|
718
745
|
},
|
|
@@ -720,40 +747,43 @@ const We = (n) => {
|
|
|
720
747
|
), w = S(
|
|
721
748
|
() => i?.dropdown?.opened ?? y,
|
|
722
749
|
[i, y]
|
|
723
|
-
), E = d.length > 0,
|
|
750
|
+
), E = d.length > 0, I = E && i?.button?.hide !== !0, R = E && w;
|
|
724
751
|
return /* @__PURE__ */ b(
|
|
725
752
|
"div",
|
|
726
753
|
{
|
|
727
|
-
className:
|
|
754
|
+
className: O(
|
|
755
|
+
"table-header",
|
|
756
|
+
R ? "showing-filters" : ""
|
|
757
|
+
),
|
|
728
758
|
children: [
|
|
729
759
|
/* @__PURE__ */ b("div", { children: [
|
|
730
760
|
a && /* @__PURE__ */ e("h1", { className: "table-header-title", children: a }),
|
|
731
761
|
s ? null : /* @__PURE__ */ b("div", { className: "table-header-content", children: [
|
|
732
762
|
l,
|
|
733
|
-
u && t && /* @__PURE__ */ e(
|
|
763
|
+
u && t && /* @__PURE__ */ e(ke, { columns: t }),
|
|
734
764
|
o && /* @__PURE__ */ e(
|
|
735
|
-
|
|
765
|
+
U,
|
|
736
766
|
{
|
|
737
|
-
icon: /* @__PURE__ */ e(
|
|
767
|
+
icon: /* @__PURE__ */ e(ge, { className: "reset-table-icon" }),
|
|
738
768
|
className: "normal",
|
|
739
769
|
onClick: r,
|
|
740
770
|
children: /* @__PURE__ */ e("span", { className: "table-header-sr", children: p("_accessibility:buttons.reset") })
|
|
741
771
|
}
|
|
742
772
|
),
|
|
743
|
-
|
|
744
|
-
|
|
773
|
+
I && /* @__PURE__ */ b(
|
|
774
|
+
U,
|
|
745
775
|
{
|
|
746
|
-
icon: i?.button?.icon ?? /* @__PURE__ */ e(
|
|
776
|
+
icon: i?.button?.icon ?? /* @__PURE__ */ e(Ne, { className: "filter-dropdown-trigger-icon" }),
|
|
747
777
|
className: "filter-dropdown-button normal filter-dropdown-trigger",
|
|
748
778
|
"aria-haspopup": "true",
|
|
749
779
|
onClick: () => h(!w),
|
|
750
780
|
"aria-expanded": w,
|
|
751
781
|
children: [
|
|
752
782
|
/* @__PURE__ */ e(
|
|
753
|
-
|
|
783
|
+
ye,
|
|
754
784
|
{
|
|
755
785
|
count: c,
|
|
756
|
-
className:
|
|
786
|
+
className: O(c > 0 ? "show" : "hide")
|
|
757
787
|
}
|
|
758
788
|
),
|
|
759
789
|
/* @__PURE__ */ e("span", { className: "table-header-sr", children: p("_accessibility:buttons.filters") }),
|
|
@@ -764,7 +794,7 @@ const We = (n) => {
|
|
|
764
794
|
] })
|
|
765
795
|
] }),
|
|
766
796
|
E && /* @__PURE__ */ e(
|
|
767
|
-
|
|
797
|
+
Ie,
|
|
768
798
|
{
|
|
769
799
|
filters: d,
|
|
770
800
|
show: R,
|
|
@@ -772,21 +802,21 @@ const We = (n) => {
|
|
|
772
802
|
options: i
|
|
773
803
|
}
|
|
774
804
|
),
|
|
775
|
-
/* @__PURE__ */ e(
|
|
805
|
+
/* @__PURE__ */ e(Oe, { filtersDefinition: d })
|
|
776
806
|
]
|
|
777
807
|
}
|
|
778
808
|
);
|
|
779
809
|
};
|
|
780
|
-
function
|
|
810
|
+
function Ge({
|
|
781
811
|
count: n,
|
|
782
812
|
multiActions: t,
|
|
783
813
|
onActionClick: a
|
|
784
814
|
}) {
|
|
785
|
-
const { t: s } =
|
|
815
|
+
const { t: s } = _();
|
|
786
816
|
return /* @__PURE__ */ b("div", { className: "table-selection-bar", children: [
|
|
787
817
|
/* @__PURE__ */ e("p", { className: "table-selection-bar-count", children: s("_accessibility:components.table.selectedCount", { count: n }) }),
|
|
788
|
-
t.length > 0 && /* @__PURE__ */ e("div", { className: "table-selection-bar-actions", children: t.map((l) => /* @__PURE__ */ e(
|
|
789
|
-
|
|
818
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: "table-selection-bar-actions", children: t.map((l) => /* @__PURE__ */ e(oe, { content: l.tooltip, children: /* @__PURE__ */ e(
|
|
819
|
+
U,
|
|
790
820
|
{
|
|
791
821
|
icon: l.icon,
|
|
792
822
|
className: "multi-table-action",
|
|
@@ -797,8 +827,8 @@ function qe({
|
|
|
797
827
|
) }, l.id)) })
|
|
798
828
|
] });
|
|
799
829
|
}
|
|
800
|
-
const
|
|
801
|
-
function
|
|
830
|
+
const Y = 220;
|
|
831
|
+
function Je({
|
|
802
832
|
data: n,
|
|
803
833
|
allowMultipleExpandedRows: t,
|
|
804
834
|
controlledExpandedRowId: a,
|
|
@@ -806,43 +836,43 @@ function Ge({
|
|
|
806
836
|
onRowExpand: l,
|
|
807
837
|
findRowById: i
|
|
808
838
|
}) {
|
|
809
|
-
const [u, o] =
|
|
839
|
+
const [u, o] = V(null), [c, r] = V(null), [p, d] = V(null), [y, f] = V(null), [h, w] = V(!1), [E, I] = V(/* @__PURE__ */ new Set()), [R, N] = V([]), T = B(null), C = B(null), L = B(/* @__PURE__ */ new Map()), M = typeof a < "u", P = t && !M, k = M ? a ?? null : u, W = x(() => {
|
|
810
840
|
C.current && (clearTimeout(C.current), C.current = null);
|
|
811
841
|
}, []), F = x(
|
|
812
842
|
(m) => {
|
|
813
843
|
if (typeof m < "u") {
|
|
814
|
-
const g =
|
|
844
|
+
const g = L.current.get(m);
|
|
815
845
|
if (!g) return;
|
|
816
|
-
clearTimeout(g),
|
|
846
|
+
clearTimeout(g), L.current.delete(m);
|
|
817
847
|
return;
|
|
818
848
|
}
|
|
819
|
-
|
|
849
|
+
L.current.forEach(
|
|
820
850
|
(g) => clearTimeout(g)
|
|
821
|
-
),
|
|
851
|
+
), L.current.clear();
|
|
822
852
|
},
|
|
823
853
|
[]
|
|
824
|
-
),
|
|
854
|
+
), X = x(
|
|
825
855
|
(m) => {
|
|
826
856
|
F(m), N((g) => g.some(
|
|
827
857
|
(A) => A.rowId === m
|
|
828
858
|
) ? g.map(
|
|
829
859
|
(A) => A.rowId === m ? { ...A, isVisible: !1 } : A
|
|
830
|
-
) : g),
|
|
860
|
+
) : g), L.current.set(
|
|
831
861
|
m,
|
|
832
862
|
setTimeout(() => {
|
|
833
863
|
N(
|
|
834
864
|
(g) => g.filter((v) => v.rowId !== m)
|
|
835
|
-
),
|
|
836
|
-
},
|
|
865
|
+
), L.current.delete(m);
|
|
866
|
+
}, Y)
|
|
837
867
|
);
|
|
838
868
|
},
|
|
839
869
|
[F]
|
|
840
|
-
),
|
|
870
|
+
), Q = x(
|
|
841
871
|
(m, g) => {
|
|
842
872
|
F(m), N((v) => v.some(
|
|
843
|
-
(
|
|
873
|
+
(z) => z.rowId === m
|
|
844
874
|
) ? v.map(
|
|
845
|
-
(
|
|
875
|
+
(z) => z.rowId === m ? { ...z, content: g, isVisible: !1 } : z
|
|
846
876
|
) : [...v, { rowId: m, content: g, isVisible: !1 }]), requestAnimationFrame(() => {
|
|
847
877
|
N(
|
|
848
878
|
(v) => v.map(
|
|
@@ -853,10 +883,10 @@ function Ge({
|
|
|
853
883
|
},
|
|
854
884
|
[F]
|
|
855
885
|
);
|
|
856
|
-
|
|
857
|
-
if (
|
|
886
|
+
j(() => {
|
|
887
|
+
if (!P) return;
|
|
858
888
|
const m = new Set(n.map((g) => g.id));
|
|
859
|
-
|
|
889
|
+
I((g) => {
|
|
860
890
|
const v = /* @__PURE__ */ new Set();
|
|
861
891
|
return g.forEach((A) => {
|
|
862
892
|
if (m.has(A)) {
|
|
@@ -870,29 +900,29 @@ function Ge({
|
|
|
870
900
|
}), g.filter(
|
|
871
901
|
(v) => m.has(v.rowId)
|
|
872
902
|
)));
|
|
873
|
-
}, [n,
|
|
874
|
-
if (
|
|
903
|
+
}, [n, P, F]), j(() => {
|
|
904
|
+
if (P) return;
|
|
875
905
|
if (k === null) {
|
|
876
|
-
r(null),
|
|
906
|
+
r(null), M && (T.current = null);
|
|
877
907
|
return;
|
|
878
908
|
}
|
|
879
|
-
i(k) || (
|
|
909
|
+
i(k) || (M || o(null), r(null), M && (T.current = null));
|
|
880
910
|
}, [
|
|
881
911
|
n,
|
|
882
912
|
k,
|
|
883
913
|
i,
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
]),
|
|
887
|
-
if (
|
|
888
|
-
if (
|
|
914
|
+
M,
|
|
915
|
+
P
|
|
916
|
+
]), j(() => {
|
|
917
|
+
if (!P) {
|
|
918
|
+
if (W(), k === null || c === null) {
|
|
889
919
|
if (p === null) {
|
|
890
920
|
w(!1), f(null);
|
|
891
921
|
return;
|
|
892
922
|
}
|
|
893
923
|
w(!1), C.current = setTimeout(() => {
|
|
894
924
|
d(null), f(null), C.current = null;
|
|
895
|
-
},
|
|
925
|
+
}, Y);
|
|
896
926
|
return;
|
|
897
927
|
}
|
|
898
928
|
if (p === null) {
|
|
@@ -905,21 +935,21 @@ function Ge({
|
|
|
905
935
|
}
|
|
906
936
|
w(!1), C.current = setTimeout(() => {
|
|
907
937
|
d(k), f(c), requestAnimationFrame(() => w(!0)), C.current = null;
|
|
908
|
-
},
|
|
938
|
+
}, Y);
|
|
909
939
|
}
|
|
910
940
|
}, [
|
|
911
|
-
|
|
941
|
+
W,
|
|
912
942
|
c,
|
|
913
943
|
k,
|
|
914
|
-
|
|
944
|
+
P,
|
|
915
945
|
p
|
|
916
|
-
]),
|
|
946
|
+
]), j(
|
|
917
947
|
() => () => {
|
|
918
|
-
|
|
948
|
+
W(), F();
|
|
919
949
|
},
|
|
920
|
-
[
|
|
921
|
-
),
|
|
922
|
-
if (!
|
|
950
|
+
[W, F]
|
|
951
|
+
), j(() => {
|
|
952
|
+
if (!M) return;
|
|
923
953
|
if (k === null) {
|
|
924
954
|
r(null), T.current = null;
|
|
925
955
|
return;
|
|
@@ -931,29 +961,29 @@ function Ge({
|
|
|
931
961
|
}
|
|
932
962
|
const g = T.current;
|
|
933
963
|
r(l?.(m, g) ?? null), T.current = m;
|
|
934
|
-
}, [k, i,
|
|
935
|
-
const
|
|
964
|
+
}, [k, i, M, l]);
|
|
965
|
+
const de = x(
|
|
936
966
|
(m) => {
|
|
937
|
-
if (
|
|
967
|
+
if (P) {
|
|
938
968
|
if (E.has(m.id)) {
|
|
939
|
-
|
|
940
|
-
const
|
|
941
|
-
return
|
|
942
|
-
}),
|
|
969
|
+
I((K) => {
|
|
970
|
+
const H = new Set(K);
|
|
971
|
+
return H.delete(m.id), H;
|
|
972
|
+
}), X(m.id), s?.(null, m);
|
|
943
973
|
return;
|
|
944
974
|
}
|
|
945
|
-
|
|
946
|
-
const
|
|
947
|
-
return
|
|
975
|
+
I((K) => {
|
|
976
|
+
const H = new Set(K);
|
|
977
|
+
return H.add(m.id), H;
|
|
948
978
|
});
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
(
|
|
979
|
+
const z = l?.(m, null) ?? null;
|
|
980
|
+
z !== null && typeof z < "u" ? Q(m.id, z) : (F(m.id), N(
|
|
981
|
+
(K) => K.filter((H) => H.rowId !== m.id)
|
|
952
982
|
)), s?.(m, null);
|
|
953
983
|
return;
|
|
954
984
|
}
|
|
955
985
|
const g = k === m.id, v = g ? m : i(k);
|
|
956
|
-
if (
|
|
986
|
+
if (M) {
|
|
957
987
|
s?.(g ? null : m, v);
|
|
958
988
|
return;
|
|
959
989
|
}
|
|
@@ -965,18 +995,18 @@ function Ge({
|
|
|
965
995
|
},
|
|
966
996
|
[
|
|
967
997
|
k,
|
|
968
|
-
|
|
998
|
+
X,
|
|
969
999
|
F,
|
|
970
|
-
|
|
1000
|
+
Q,
|
|
971
1001
|
i,
|
|
972
1002
|
E,
|
|
973
|
-
|
|
974
|
-
|
|
1003
|
+
M,
|
|
1004
|
+
P,
|
|
975
1005
|
s,
|
|
976
1006
|
l
|
|
977
1007
|
]
|
|
978
1008
|
);
|
|
979
|
-
return { expandedRowsToRender: S(() =>
|
|
1009
|
+
return { expandedRowsToRender: S(() => P ? R : p === null || y === null || typeof y > "u" ? [] : [
|
|
980
1010
|
{
|
|
981
1011
|
rowId: p,
|
|
982
1012
|
content: y,
|
|
@@ -984,13 +1014,13 @@ function Ge({
|
|
|
984
1014
|
}
|
|
985
1015
|
], [
|
|
986
1016
|
h,
|
|
987
|
-
|
|
1017
|
+
P,
|
|
988
1018
|
y,
|
|
989
1019
|
p,
|
|
990
1020
|
R
|
|
991
|
-
]), onRowExpandChange:
|
|
1021
|
+
]), onRowExpandChange: de };
|
|
992
1022
|
}
|
|
993
|
-
function
|
|
1023
|
+
function Xe({
|
|
994
1024
|
actions: n,
|
|
995
1025
|
selectedRowsData: t
|
|
996
1026
|
}) {
|
|
@@ -1027,16 +1057,16 @@ function Je({
|
|
|
1027
1057
|
);
|
|
1028
1058
|
return { multiActions: a, handleMultipleActionClick: s };
|
|
1029
1059
|
}
|
|
1030
|
-
function
|
|
1060
|
+
function Ke({
|
|
1031
1061
|
data: n,
|
|
1032
1062
|
onRowSelect: t,
|
|
1033
1063
|
onSelectedRowsChange: a
|
|
1034
1064
|
}) {
|
|
1035
|
-
const [s, l] =
|
|
1065
|
+
const [s, l] = V(/* @__PURE__ */ new Set()), i = S(
|
|
1036
1066
|
() => n?.filter((r) => s.has(r.id)) ?? [],
|
|
1037
1067
|
[n, s]
|
|
1038
1068
|
);
|
|
1039
|
-
|
|
1069
|
+
j(() => {
|
|
1040
1070
|
if (!n?.length) {
|
|
1041
1071
|
l(/* @__PURE__ */ new Set());
|
|
1042
1072
|
return;
|
|
@@ -1047,7 +1077,7 @@ function Xe({
|
|
|
1047
1077
|
d.has(y) && p.add(y);
|
|
1048
1078
|
}), p;
|
|
1049
1079
|
});
|
|
1050
|
-
}, [n]),
|
|
1080
|
+
}, [n]), j(() => {
|
|
1051
1081
|
a && a(i);
|
|
1052
1082
|
}, [i, a]);
|
|
1053
1083
|
const u = x(
|
|
@@ -1082,7 +1112,7 @@ function Xe({
|
|
|
1082
1112
|
onToggleAllRows: o
|
|
1083
1113
|
};
|
|
1084
1114
|
}
|
|
1085
|
-
function
|
|
1115
|
+
function bt(n) {
|
|
1086
1116
|
const {
|
|
1087
1117
|
data: t,
|
|
1088
1118
|
onSort: a,
|
|
@@ -1100,85 +1130,85 @@ function ht(n) {
|
|
|
1100
1130
|
onExpandedRowChange: h,
|
|
1101
1131
|
onRowExpand: w,
|
|
1102
1132
|
...E
|
|
1103
|
-
} = n,
|
|
1104
|
-
(
|
|
1133
|
+
} = n, I = S(() => !t?.length, [t]), R = x(
|
|
1134
|
+
(X) => X === null ? null : t.find((Q) => Q.id === X) ?? null,
|
|
1105
1135
|
[t]
|
|
1106
1136
|
), {
|
|
1107
1137
|
selectedRows: N,
|
|
1108
1138
|
selectedRowsData: T,
|
|
1109
1139
|
selectionState: C,
|
|
1110
|
-
onRowSelectionChange:
|
|
1111
|
-
onToggleAllRows:
|
|
1112
|
-
} =
|
|
1140
|
+
onRowSelectionChange: L,
|
|
1141
|
+
onToggleAllRows: M
|
|
1142
|
+
} = Ke({ data: t, onRowSelect: p, onSelectedRowsChange: d }), { expandedRowsToRender: P, onRowExpandChange: k } = Je({
|
|
1113
1143
|
data: t,
|
|
1114
1144
|
allowMultipleExpandedRows: y,
|
|
1115
1145
|
controlledExpandedRowId: f,
|
|
1116
1146
|
onExpandedRowChange: h,
|
|
1117
1147
|
onRowExpand: w,
|
|
1118
1148
|
findRowById: R
|
|
1119
|
-
}), { multiActions:
|
|
1149
|
+
}), { multiActions: W, handleMultipleActionClick: F } = Xe({
|
|
1120
1150
|
actions: i,
|
|
1121
1151
|
selectedRowsData: T
|
|
1122
1152
|
});
|
|
1123
|
-
return /* @__PURE__ */ e(
|
|
1124
|
-
/* @__PURE__ */ e(
|
|
1125
|
-
l ? /* @__PURE__ */ e(
|
|
1153
|
+
return /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ b("div", { className: O("table-main", c), children: [
|
|
1154
|
+
/* @__PURE__ */ e(qe, { columns: u, isLoading: l, ...E }),
|
|
1155
|
+
l ? /* @__PURE__ */ e(xe, { className: "table-loading" }) : /* @__PURE__ */ e(G, { children: I ? /* @__PURE__ */ e(We, {}) : /* @__PURE__ */ b(G, { children: [
|
|
1126
1156
|
!!T.length && /* @__PURE__ */ e(
|
|
1127
|
-
|
|
1157
|
+
Ge,
|
|
1128
1158
|
{
|
|
1129
1159
|
count: T.length,
|
|
1130
|
-
multiActions:
|
|
1160
|
+
multiActions: W,
|
|
1131
1161
|
onActionClick: F
|
|
1132
1162
|
}
|
|
1133
1163
|
),
|
|
1134
|
-
/* @__PURE__ */ e("div", { className:
|
|
1164
|
+
/* @__PURE__ */ e("div", { className: O("table-body", o), children: /* @__PURE__ */ b("table", { className: "table-content", children: [
|
|
1135
1165
|
/* @__PURE__ */ e(
|
|
1136
|
-
|
|
1166
|
+
Te,
|
|
1137
1167
|
{
|
|
1138
1168
|
entity: s,
|
|
1139
1169
|
columns: u,
|
|
1140
1170
|
onSortCallback: a,
|
|
1141
1171
|
hasAction: !!i,
|
|
1142
1172
|
selectionState: C,
|
|
1143
|
-
onToggleAllRows:
|
|
1173
|
+
onToggleAllRows: M
|
|
1144
1174
|
}
|
|
1145
1175
|
),
|
|
1146
1176
|
/* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ e(
|
|
1147
|
-
|
|
1177
|
+
Ue,
|
|
1148
1178
|
{
|
|
1149
1179
|
data: t,
|
|
1150
1180
|
actions: i,
|
|
1151
1181
|
columns: u,
|
|
1152
1182
|
softDeleteProperty: r,
|
|
1153
1183
|
selectedRows: N,
|
|
1154
|
-
expandedRows:
|
|
1155
|
-
onRowSelectionChange:
|
|
1184
|
+
expandedRows: P,
|
|
1185
|
+
onRowSelectionChange: L,
|
|
1156
1186
|
onRowExpand: w ? k : void 0
|
|
1157
1187
|
}
|
|
1158
1188
|
) })
|
|
1159
1189
|
] }) }),
|
|
1160
|
-
/* @__PURE__ */ e(
|
|
1190
|
+
/* @__PURE__ */ e(He, {})
|
|
1161
1191
|
] }) })
|
|
1162
1192
|
] }) });
|
|
1163
1193
|
}
|
|
1164
1194
|
export {
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1195
|
+
Oe as A,
|
|
1196
|
+
Te as C,
|
|
1197
|
+
Ie as F,
|
|
1198
|
+
Le as N,
|
|
1199
|
+
Be as P,
|
|
1200
|
+
Ee as R,
|
|
1201
|
+
We as T,
|
|
1202
|
+
ke as a,
|
|
1203
|
+
Ae as b,
|
|
1204
|
+
ze as c,
|
|
1205
|
+
He as d,
|
|
1206
|
+
Ue as e,
|
|
1207
|
+
qe as f,
|
|
1208
|
+
Ge as g,
|
|
1209
|
+
bt as h,
|
|
1210
|
+
ce as i,
|
|
1211
|
+
Se as j,
|
|
1212
|
+
Re as k,
|
|
1213
|
+
De as r
|
|
1184
1214
|
};
|