@sito/dashboard 0.0.36 → 0.0.39
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/components/Form/AutocompleteInput/types.d.ts +2 -1
- package/dist/components/Form/SelectInput/types.d.ts +1 -1
- package/dist/components/Form/TextInput/types.d.ts +1 -1
- package/dist/components/Form/types.d.ts +0 -1
- package/dist/components/Table/components/Widgets/RangeWidget.d.ts +2 -0
- package/dist/components/Table/components/Widgets/index.d.ts +0 -2
- package/dist/components/Table/components/Widgets/types.d.ts +4 -4
- package/dist/dashboard.cjs +1 -1
- package/dist/dashboard.js +456 -443
- package/dist/lib/filters.d.ts +5 -10
- package/dist/main.css +1 -1
- package/package.json +1 -1
- package/dist/components/Table/components/Widgets/DateWidget.d.ts +0 -2
- package/dist/components/Table/components/Widgets/NumberWidget.d.ts +0 -2
package/dist/dashboard.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as t, jsxs as v, Fragment as D } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as I, useState as P, useRef as M, useEffect as H, useCallback as S, createContext as W, useContext as V, useReducer as ae, useMemo as y } from "react";
|
|
4
4
|
function se(e) {
|
|
5
|
-
const { className:
|
|
5
|
+
const { className: a = "" } = e;
|
|
6
6
|
return /* @__PURE__ */ t(
|
|
7
7
|
"svg",
|
|
8
8
|
{
|
|
9
|
-
className:
|
|
9
|
+
className: a,
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
viewBox: "0 0 512 512",
|
|
12
12
|
fill: "currentColor",
|
|
@@ -14,12 +14,12 @@ function se(e) {
|
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const { className:
|
|
17
|
+
function re(e) {
|
|
18
|
+
const { className: a = "" } = e;
|
|
19
19
|
return /* @__PURE__ */ t(
|
|
20
20
|
"svg",
|
|
21
21
|
{
|
|
22
|
-
className:
|
|
22
|
+
className: a,
|
|
23
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24
24
|
viewBox: "0 0 512 512",
|
|
25
25
|
fill: "currentColor",
|
|
@@ -27,12 +27,12 @@ function ae(e) {
|
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const { className:
|
|
30
|
+
function le(e) {
|
|
31
|
+
const { className: a = "" } = e;
|
|
32
32
|
return /* @__PURE__ */ t(
|
|
33
33
|
"svg",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: a,
|
|
36
36
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37
37
|
viewBox: "0 0 320 512",
|
|
38
38
|
fill: "currentColor",
|
|
@@ -40,12 +40,12 @@ function re(e) {
|
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const { className:
|
|
43
|
+
function oe(e) {
|
|
44
|
+
const { className: a = "" } = e;
|
|
45
45
|
return /* @__PURE__ */ t(
|
|
46
46
|
"svg",
|
|
47
47
|
{
|
|
48
|
-
className:
|
|
48
|
+
className: a,
|
|
49
49
|
xmlns: "http://www.w3.org/2000/svg",
|
|
50
50
|
viewBox: "0 0 320 512",
|
|
51
51
|
fill: "currentColor",
|
|
@@ -53,16 +53,16 @@ function le(e) {
|
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
const { className:
|
|
58
|
-
return /* @__PURE__ */ t("svg", { className:
|
|
56
|
+
const ce = (e) => {
|
|
57
|
+
const { className: a = "" } = e;
|
|
58
|
+
return /* @__PURE__ */ t("svg", { className: a, viewBox: "0 0 16 16", children: /* @__PURE__ */ t("path", { d: "M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z" }) });
|
|
59
59
|
};
|
|
60
60
|
function K(e) {
|
|
61
|
-
const { className:
|
|
61
|
+
const { className: a = "" } = e;
|
|
62
62
|
return /* @__PURE__ */ t(
|
|
63
63
|
"svg",
|
|
64
64
|
{
|
|
65
|
-
className:
|
|
65
|
+
className: a,
|
|
66
66
|
xmlns: "http://www.w3.org/2000/svg",
|
|
67
67
|
viewBox: "0 0 384 512",
|
|
68
68
|
fill: "currentColor",
|
|
@@ -70,7 +70,7 @@ function K(e) {
|
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
var
|
|
73
|
+
var U = /* @__PURE__ */ ((e) => (e.error = "error", e.good = "good", e.default = "default", e))(U || {});
|
|
74
74
|
const Q = (e) => {
|
|
75
75
|
switch (e) {
|
|
76
76
|
case "error":
|
|
@@ -80,7 +80,7 @@ const Q = (e) => {
|
|
|
80
80
|
default:
|
|
81
81
|
return "input-normal";
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, X = (e) => {
|
|
84
84
|
switch (e) {
|
|
85
85
|
case "error":
|
|
86
86
|
return "input-label-error";
|
|
@@ -89,7 +89,7 @@ const Q = (e) => {
|
|
|
89
89
|
default:
|
|
90
90
|
return "input-label-normal";
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, Y = (e) => {
|
|
93
93
|
switch (e) {
|
|
94
94
|
case "error":
|
|
95
95
|
return "input-helper-text-error";
|
|
@@ -99,100 +99,99 @@ const Q = (e) => {
|
|
|
99
99
|
return "input-helper-text-normal";
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
const
|
|
102
|
+
const q = I(function(e, a) {
|
|
103
103
|
const {
|
|
104
104
|
value: r,
|
|
105
105
|
onChange: n,
|
|
106
|
-
options:
|
|
106
|
+
options: s,
|
|
107
107
|
containerClassName: l = "",
|
|
108
108
|
inputClassName: o = "",
|
|
109
109
|
labelClassName: c = "",
|
|
110
110
|
helperText: i = "",
|
|
111
|
-
helperTextClassName:
|
|
112
|
-
placeholder:
|
|
113
|
-
label:
|
|
114
|
-
name:
|
|
115
|
-
id:
|
|
116
|
-
state: p =
|
|
117
|
-
|
|
111
|
+
helperTextClassName: N = "",
|
|
112
|
+
placeholder: u = "",
|
|
113
|
+
label: h = "",
|
|
114
|
+
name: m = "",
|
|
115
|
+
id: d = "",
|
|
116
|
+
state: p = U.default,
|
|
117
|
+
children: g,
|
|
118
|
+
...C
|
|
118
119
|
} = e;
|
|
119
|
-
return
|
|
120
|
-
var N;
|
|
121
|
-
(!r || r === "") && (a != null && a.length) && n({ target: { value: (N = a[0]) == null ? void 0 : N.id } });
|
|
122
|
-
}, [n, a, r]), /* @__PURE__ */ b("div", { className: `select-input-container ${l}`, children: [
|
|
120
|
+
return /* @__PURE__ */ v("div", { className: `select-input-container ${l}`, children: [
|
|
123
121
|
/* @__PURE__ */ t(
|
|
124
122
|
"select",
|
|
125
123
|
{
|
|
126
|
-
...
|
|
127
|
-
id:
|
|
128
|
-
ref:
|
|
129
|
-
name:
|
|
124
|
+
...C,
|
|
125
|
+
id: d,
|
|
126
|
+
ref: a,
|
|
127
|
+
name: m,
|
|
130
128
|
value: r,
|
|
131
129
|
onChange: n,
|
|
132
130
|
className: `select-input ${Q(p)} peer ${o}`,
|
|
133
|
-
children:
|
|
131
|
+
children: s == null ? void 0 : s.map((f) => /* @__PURE__ */ t("option", { value: f.id, children: f.value ?? f.name ?? f.id }, f.id))
|
|
134
132
|
}
|
|
135
133
|
),
|
|
136
134
|
/* @__PURE__ */ t(
|
|
137
135
|
"label",
|
|
138
136
|
{
|
|
139
|
-
htmlFor:
|
|
140
|
-
className: `select-input-label ${
|
|
141
|
-
children:
|
|
137
|
+
htmlFor: m,
|
|
138
|
+
className: `select-input-label ${X(p)} ${c}`,
|
|
139
|
+
children: h
|
|
142
140
|
}
|
|
143
141
|
),
|
|
142
|
+
g,
|
|
144
143
|
/* @__PURE__ */ t(
|
|
145
144
|
"p",
|
|
146
145
|
{
|
|
147
|
-
className: `select-input-helper-text ${
|
|
148
|
-
children: p !== "error" && p !== "good" ?
|
|
146
|
+
className: `select-input-helper-text ${Y(p)} ${N}`,
|
|
147
|
+
children: p !== "error" && p !== "good" ? u : i
|
|
149
148
|
}
|
|
150
149
|
)
|
|
151
150
|
] });
|
|
152
151
|
});
|
|
153
|
-
const
|
|
152
|
+
const j = I(function(e, a) {
|
|
154
153
|
const {
|
|
155
154
|
children: r,
|
|
156
155
|
value: n,
|
|
157
|
-
onChange:
|
|
158
|
-
state: l =
|
|
156
|
+
onChange: s,
|
|
157
|
+
state: l = U.default,
|
|
159
158
|
name: o = "",
|
|
160
159
|
id: c = "",
|
|
161
160
|
type: i = "text",
|
|
162
|
-
label:
|
|
163
|
-
required:
|
|
164
|
-
placeholder:
|
|
165
|
-
containerClassName:
|
|
166
|
-
inputClassName:
|
|
161
|
+
label: N = "",
|
|
162
|
+
required: u = !1,
|
|
163
|
+
placeholder: h = "",
|
|
164
|
+
containerClassName: m = "",
|
|
165
|
+
inputClassName: d = "",
|
|
167
166
|
labelClassName: p = "",
|
|
168
|
-
helperText:
|
|
169
|
-
helperTextClassName:
|
|
170
|
-
...
|
|
167
|
+
helperText: g = "",
|
|
168
|
+
helperTextClassName: C = "",
|
|
169
|
+
...f
|
|
171
170
|
} = e;
|
|
172
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ v("div", { className: `text-input-container ${m}`, children: [
|
|
173
172
|
/* @__PURE__ */ t(
|
|
174
173
|
"input",
|
|
175
174
|
{
|
|
176
|
-
ref:
|
|
175
|
+
ref: a,
|
|
177
176
|
type: i,
|
|
178
177
|
name: o,
|
|
179
178
|
id: c,
|
|
180
|
-
className: `text-input ${Q(l)} peer ${
|
|
179
|
+
className: `text-input ${Q(l)} peer ${d}`,
|
|
181
180
|
placeholder: "",
|
|
182
|
-
required:
|
|
181
|
+
required: u,
|
|
183
182
|
value: n,
|
|
184
|
-
onChange:
|
|
185
|
-
...
|
|
183
|
+
onChange: s,
|
|
184
|
+
...f
|
|
186
185
|
}
|
|
187
186
|
),
|
|
188
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ v(
|
|
189
188
|
"label",
|
|
190
189
|
{
|
|
191
190
|
htmlFor: o,
|
|
192
|
-
className: `text-input-label ${
|
|
191
|
+
className: `text-input-label ${X(l)} ${p}`,
|
|
193
192
|
children: [
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
N,
|
|
194
|
+
u ? " *" : ""
|
|
196
195
|
]
|
|
197
196
|
}
|
|
198
197
|
),
|
|
@@ -200,302 +199,306 @@ const U = j(function(e, s) {
|
|
|
200
199
|
/* @__PURE__ */ t(
|
|
201
200
|
"p",
|
|
202
201
|
{
|
|
203
|
-
className: `text-input-helper-text ${
|
|
204
|
-
children: l !== "error" && l !== "good" ?
|
|
202
|
+
className: `text-input-helper-text ${Y(l)} ${C}`,
|
|
203
|
+
children: l !== "error" && l !== "good" ? h : g
|
|
205
204
|
}
|
|
206
205
|
)
|
|
207
206
|
] });
|
|
208
207
|
});
|
|
209
|
-
const
|
|
208
|
+
const ie = I(function(e, a) {
|
|
210
209
|
const {
|
|
211
210
|
checked: r,
|
|
212
211
|
onChange: n,
|
|
213
|
-
state:
|
|
212
|
+
state: s = U.default,
|
|
214
213
|
name: l = "",
|
|
215
214
|
id: o = "",
|
|
216
215
|
type: c = "text",
|
|
217
216
|
label: i = "",
|
|
218
|
-
containerClassName:
|
|
219
|
-
inputClassName:
|
|
220
|
-
labelClassName:
|
|
221
|
-
helperText:
|
|
222
|
-
helperTextClassName:
|
|
217
|
+
containerClassName: N = "",
|
|
218
|
+
inputClassName: u = "",
|
|
219
|
+
labelClassName: h = "",
|
|
220
|
+
helperText: m = "",
|
|
221
|
+
helperTextClassName: d = "",
|
|
223
222
|
...p
|
|
224
223
|
} = e;
|
|
225
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ v("label", { className: `input-check-container ${N}`, children: [
|
|
226
225
|
/* @__PURE__ */ t(
|
|
227
226
|
"input",
|
|
228
227
|
{
|
|
229
228
|
id: o,
|
|
230
|
-
ref:
|
|
229
|
+
ref: a,
|
|
231
230
|
name: l,
|
|
232
231
|
type: "checkbox",
|
|
233
232
|
checked: r,
|
|
234
233
|
onChange: n,
|
|
235
|
-
className: `input-check ${
|
|
234
|
+
className: `input-check ${u}`,
|
|
236
235
|
...p
|
|
237
236
|
}
|
|
238
237
|
),
|
|
239
|
-
/* @__PURE__ */ t("span", { className: `input-check-label ${
|
|
238
|
+
/* @__PURE__ */ t("span", { className: `input-check-label ${h}`, children: i })
|
|
240
239
|
] });
|
|
241
240
|
});
|
|
242
|
-
const
|
|
241
|
+
const de = I(function(e, a) {
|
|
243
242
|
const {
|
|
244
243
|
state: r,
|
|
245
244
|
value: n,
|
|
246
|
-
onChange:
|
|
245
|
+
onChange: s,
|
|
247
246
|
options: l = [],
|
|
248
247
|
name: o = "",
|
|
249
248
|
id: c = "",
|
|
250
249
|
label: i = "",
|
|
251
|
-
containerClassName:
|
|
252
|
-
inputContainerClassName:
|
|
253
|
-
helperText:
|
|
254
|
-
placeholder:
|
|
255
|
-
multiple:
|
|
250
|
+
containerClassName: N = "",
|
|
251
|
+
inputContainerClassName: u = "",
|
|
252
|
+
helperText: h = "",
|
|
253
|
+
placeholder: m = "",
|
|
254
|
+
multiple: d = !1,
|
|
256
255
|
...p
|
|
257
|
-
} = e, [
|
|
258
|
-
const x = String(
|
|
259
|
-
return n && n.length ? n != null && n.some ? !(n != null && n.some((
|
|
260
|
-
}), A =
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
A.current && !A.current.contains(
|
|
264
|
-
}, x = (
|
|
265
|
-
|
|
256
|
+
} = e, [g, C] = P(""), [f, w] = P(!1), $ = l.filter((b) => {
|
|
257
|
+
const x = String(b.value).toLowerCase().includes(g == null ? void 0 : g.toLowerCase());
|
|
258
|
+
return n && n.length ? n != null && n.some ? !(n != null && n.some((R) => R.id === b.id)) : (n == null ? void 0 : n.id) !== b.id : x;
|
|
259
|
+
}), A = M(null);
|
|
260
|
+
H(() => {
|
|
261
|
+
const b = (z) => {
|
|
262
|
+
A.current && !A.current.contains(z.target) && w(!1);
|
|
263
|
+
}, x = (z) => {
|
|
264
|
+
z.key === "Escape" && w(!1);
|
|
266
265
|
};
|
|
267
|
-
return document.addEventListener("mousedown",
|
|
268
|
-
document.removeEventListener("mousedown",
|
|
266
|
+
return document.addEventListener("mousedown", b), document.addEventListener("keydown", x), () => {
|
|
267
|
+
document.removeEventListener("mousedown", b), document.removeEventListener("keydown", x);
|
|
269
268
|
};
|
|
270
269
|
}, []);
|
|
271
|
-
const B = (
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
(
|
|
275
|
-
|
|
270
|
+
const B = (b) => {
|
|
271
|
+
C(b.target.value);
|
|
272
|
+
}, J = S(
|
|
273
|
+
(b) => {
|
|
274
|
+
C(""), b ? d ? Array.isArray(n) && n.length ? s([...n, b]) : s([b]) : s(b) : s(null), w(!1);
|
|
276
275
|
},
|
|
277
|
-
[
|
|
278
|
-
),
|
|
279
|
-
(
|
|
280
|
-
const x = n.filter((
|
|
281
|
-
x.length ?
|
|
276
|
+
[d, s, n]
|
|
277
|
+
), ne = S(
|
|
278
|
+
(b) => {
|
|
279
|
+
const x = n.filter((z, R) => R !== b);
|
|
280
|
+
x.length ? s(x) : s(null);
|
|
282
281
|
},
|
|
283
|
-
[
|
|
282
|
+
[s, n]
|
|
284
283
|
);
|
|
285
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ v(
|
|
286
285
|
"div",
|
|
287
286
|
{
|
|
288
|
-
className: `autocomplete-input-container ${
|
|
287
|
+
className: `autocomplete-input-container ${N}`,
|
|
289
288
|
ref: A,
|
|
290
289
|
children: [
|
|
291
290
|
/* @__PURE__ */ t(
|
|
292
|
-
|
|
291
|
+
j,
|
|
293
292
|
{
|
|
294
293
|
state: r,
|
|
295
294
|
name: o,
|
|
296
295
|
id: c,
|
|
297
|
-
value: !
|
|
296
|
+
value: !d && n ? n : g,
|
|
298
297
|
onChange: B,
|
|
299
|
-
placeholder:
|
|
300
|
-
helperText:
|
|
298
|
+
placeholder: m,
|
|
299
|
+
helperText: h,
|
|
301
300
|
onFocus: () => w(!0),
|
|
302
301
|
label: i,
|
|
303
|
-
containerClassName: `autocomplete-text-input ${
|
|
304
|
-
ref:
|
|
302
|
+
containerClassName: `autocomplete-text-input ${u}`,
|
|
303
|
+
ref: a,
|
|
305
304
|
...p,
|
|
306
|
-
children: !
|
|
305
|
+
children: !d && n && /* @__PURE__ */ t(
|
|
307
306
|
"button",
|
|
308
307
|
{
|
|
309
308
|
type: "button",
|
|
310
309
|
className: "autocomplete-delete-button",
|
|
311
|
-
onClick: (
|
|
312
|
-
|
|
310
|
+
onClick: (b) => {
|
|
311
|
+
J(), b.stopPropagation();
|
|
313
312
|
},
|
|
314
313
|
children: /* @__PURE__ */ t(K, {})
|
|
315
314
|
}
|
|
316
315
|
)
|
|
317
316
|
}
|
|
318
317
|
),
|
|
319
|
-
|
|
318
|
+
f && /* @__PURE__ */ t("ul", { className: "autocomplete-suggestions-container", children: $.map((b) => /* @__PURE__ */ t(
|
|
320
319
|
"li",
|
|
321
320
|
{
|
|
322
321
|
className: "autocomplete-suggestion-item hover:bg-primary/20",
|
|
323
322
|
onClick: (x) => {
|
|
324
|
-
|
|
323
|
+
J(b), x.stopPropagation();
|
|
325
324
|
},
|
|
326
|
-
children:
|
|
325
|
+
children: b.value ?? b.name
|
|
327
326
|
},
|
|
328
|
-
|
|
327
|
+
b.id ?? b.value ?? b.name
|
|
329
328
|
)) }),
|
|
330
|
-
|
|
329
|
+
d && Array.isArray(n) && n.length ? /* @__PURE__ */ t("ul", { className: "autocomplete-value-container", children: n.map((b, x) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
331
330
|
Te,
|
|
332
331
|
{
|
|
333
|
-
label: String(
|
|
334
|
-
onDelete: (
|
|
335
|
-
|
|
332
|
+
label: String(b.value ?? b.name),
|
|
333
|
+
onDelete: (z) => {
|
|
334
|
+
ne(x), z.stopPropagation();
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
|
-
) },
|
|
337
|
+
) }, b.id ?? b.value ?? b.name)) }) : null
|
|
339
338
|
]
|
|
340
339
|
}
|
|
341
340
|
);
|
|
342
341
|
});
|
|
343
|
-
function
|
|
342
|
+
function ue(e) {
|
|
344
343
|
const {
|
|
345
|
-
color:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
344
|
+
color: a = "stroke-blue-800",
|
|
345
|
+
className: r = "",
|
|
346
|
+
loaderClass: n = "",
|
|
347
|
+
strokeWidth: s = "4",
|
|
348
|
+
...l
|
|
349
349
|
} = e;
|
|
350
|
-
return /* @__PURE__ */ t("div", { ...
|
|
350
|
+
return /* @__PURE__ */ t("div", { ...l, className: `loading ${r}`, children: /* @__PURE__ */ t("div", { className: "loader-container", children: /* @__PURE__ */ t("div", { className: `loader ${n}`, children: /* @__PURE__ */ t("svg", { className: "circular", viewBox: "25 25 50 50", children: /* @__PURE__ */ t(
|
|
351
351
|
"circle",
|
|
352
352
|
{
|
|
353
|
-
className: `path ${
|
|
353
|
+
className: `path ${a}`,
|
|
354
354
|
cx: "50",
|
|
355
355
|
cy: "50",
|
|
356
356
|
r: "20",
|
|
357
357
|
fill: "none",
|
|
358
|
-
strokeWidth:
|
|
358
|
+
strokeWidth: s,
|
|
359
359
|
strokeMiterlimit: "10"
|
|
360
360
|
}
|
|
361
361
|
) }) }) }) });
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
365
|
-
const { children:
|
|
366
|
-
return /* @__PURE__ */ t(
|
|
363
|
+
const Z = W({});
|
|
364
|
+
function Be(e) {
|
|
365
|
+
const { children: a, t: r } = e;
|
|
366
|
+
return /* @__PURE__ */ t(Z.Provider, { value: { t: r }, children: a });
|
|
367
367
|
}
|
|
368
368
|
const L = () => {
|
|
369
|
-
const e =
|
|
369
|
+
const e = V(Z);
|
|
370
370
|
if (e === void 0)
|
|
371
371
|
throw new Error("translationContext must be used within a Provider");
|
|
372
372
|
return e;
|
|
373
373
|
};
|
|
374
|
-
var E = /* @__PURE__ */ ((e) => (e[e.text = 0] = "text", e[e.number = 1] = "number", e[e.select = 2] = "select", e[e.autocomplete = 3] = "autocomplete", e[e.date = 4] = "date", e[e.check = 5] = "check", e))(E || {}),
|
|
375
|
-
const
|
|
376
|
-
const { children:
|
|
377
|
-
(
|
|
378
|
-
let
|
|
379
|
-
if (i ===
|
|
380
|
-
switch (
|
|
381
|
-
case
|
|
382
|
-
|
|
374
|
+
var E = /* @__PURE__ */ ((e) => (e[e.text = 0] = "text", e[e.number = 1] = "number", e[e.select = 2] = "select", e[e.autocomplete = 3] = "autocomplete", e[e.date = 4] = "date", e[e.check = 5] = "check", e))(E || {}), F = /* @__PURE__ */ ((e) => (e.ASC = "ASC", e.DESC = "DESC", e))(F || {});
|
|
375
|
+
const pe = [20, 50, 100], ee = W({}), De = (e) => {
|
|
376
|
+
const { children: a } = e, [r, n] = P(0), [s, l] = P(20), [o, c] = P(0), [i, N] = P("id"), [u, h] = P(F.DESC), [m, d] = P({}), p = S(
|
|
377
|
+
(f, w) => {
|
|
378
|
+
let $ = u;
|
|
379
|
+
if (i === f)
|
|
380
|
+
switch (u) {
|
|
381
|
+
case F.ASC:
|
|
382
|
+
$ = F.DESC;
|
|
383
383
|
break;
|
|
384
384
|
default:
|
|
385
|
-
|
|
385
|
+
$ = F.ASC;
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
|
-
|
|
388
|
+
N(f), h($), w && w(f, $);
|
|
389
389
|
},
|
|
390
|
-
[i,
|
|
391
|
-
),
|
|
392
|
-
const w = Object.entries(
|
|
393
|
-
(
|
|
390
|
+
[i, u]
|
|
391
|
+
), g = S((f) => {
|
|
392
|
+
const w = Object.entries(f).reduce(
|
|
393
|
+
($, [A, B]) => (B && typeof B.value < "u" && ($[A] = B.value), $),
|
|
394
394
|
{}
|
|
395
395
|
);
|
|
396
|
-
|
|
397
|
-
}, []),
|
|
396
|
+
d(w);
|
|
397
|
+
}, []), C = {
|
|
398
398
|
onSort: p,
|
|
399
399
|
total: r,
|
|
400
400
|
setTotal: n,
|
|
401
401
|
sortingBy: i,
|
|
402
|
-
setSortingBy:
|
|
403
|
-
sortingOrder:
|
|
404
|
-
setSortingOrder:
|
|
405
|
-
pageSize:
|
|
406
|
-
pageSizes:
|
|
402
|
+
setSortingBy: N,
|
|
403
|
+
sortingOrder: u,
|
|
404
|
+
setSortingOrder: h,
|
|
405
|
+
pageSize: s,
|
|
406
|
+
pageSizes: pe,
|
|
407
407
|
setPageSize: l,
|
|
408
408
|
currentPage: o,
|
|
409
409
|
setCurrentPage: c,
|
|
410
|
-
filters:
|
|
411
|
-
onFilterApply:
|
|
410
|
+
filters: m,
|
|
411
|
+
onFilterApply: g
|
|
412
412
|
};
|
|
413
|
-
return /* @__PURE__ */ t(
|
|
414
|
-
},
|
|
415
|
-
const e =
|
|
413
|
+
return /* @__PURE__ */ t(ee.Provider, { value: C, children: a });
|
|
414
|
+
}, T = () => {
|
|
415
|
+
const e = V(ee);
|
|
416
416
|
if (e === void 0)
|
|
417
417
|
throw new Error("tableOptionsContext must be used within a Provider");
|
|
418
418
|
return e;
|
|
419
419
|
};
|
|
420
|
-
var
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
420
|
+
var k = /* @__PURE__ */ ((e) => (e[e.update = 0] = "update", e[e.reset = 1] = "reset", e))(k || {});
|
|
421
|
+
const he = (e) => {
|
|
422
|
+
if (e) {
|
|
423
|
+
const a = {}, r = Object.keys(e);
|
|
424
|
+
return r == null || r.forEach((n) => {
|
|
425
|
+
a[n] = { value: e[n] };
|
|
426
|
+
}), a;
|
|
427
|
+
}
|
|
428
|
+
return {};
|
|
426
429
|
};
|
|
427
|
-
function
|
|
428
|
-
const { type: r } =
|
|
430
|
+
function me(e, a) {
|
|
431
|
+
const { type: r } = a;
|
|
429
432
|
switch (r) {
|
|
430
|
-
case
|
|
431
|
-
const { filters: n } =
|
|
433
|
+
case k.reset: {
|
|
434
|
+
const { filters: n } = a, s = {};
|
|
432
435
|
return n == null || n.forEach(({ propertyName: l, defaultValue: o }) => {
|
|
433
|
-
|
|
434
|
-
}), { ...e, ...
|
|
436
|
+
s[l] = { value: o };
|
|
437
|
+
}), { ...e, ...s };
|
|
435
438
|
}
|
|
436
|
-
case
|
|
437
|
-
const { toUpdate: n } =
|
|
439
|
+
case k.update: {
|
|
440
|
+
const { toUpdate: n } = a;
|
|
438
441
|
return { ...e, ...n };
|
|
439
442
|
}
|
|
440
443
|
default:
|
|
441
444
|
return e;
|
|
442
445
|
}
|
|
443
446
|
}
|
|
444
|
-
const
|
|
445
|
-
const { children:
|
|
446
|
-
|
|
447
|
-
|
|
447
|
+
const te = W({}), be = (e) => {
|
|
448
|
+
const { children: a } = e, { filters: r } = T(), [n, s] = ae(
|
|
449
|
+
me,
|
|
450
|
+
he(r)
|
|
448
451
|
), l = {
|
|
449
452
|
currentFilters: n,
|
|
450
|
-
setCurrentFilters:
|
|
453
|
+
setCurrentFilters: s
|
|
451
454
|
};
|
|
452
|
-
return /* @__PURE__ */ t(
|
|
453
|
-
},
|
|
454
|
-
const e =
|
|
455
|
+
return /* @__PURE__ */ t(te.Provider, { value: l, children: a });
|
|
456
|
+
}, _ = () => {
|
|
457
|
+
const e = V(te);
|
|
455
458
|
if (e === void 0)
|
|
456
459
|
throw new Error("tableOptionsContext must be used within a Provider");
|
|
457
460
|
return e;
|
|
458
461
|
};
|
|
459
|
-
function
|
|
460
|
-
const { t:
|
|
461
|
-
var
|
|
462
|
-
return (
|
|
463
|
-
id:
|
|
464
|
-
label:
|
|
465
|
-
className:
|
|
466
|
-
sortable:
|
|
467
|
-
sortOptions:
|
|
462
|
+
function ge(e) {
|
|
463
|
+
const { t: a } = L(), { entity: r = "", columns: n = [], hasAction: s = !0, onSortCallback: l } = e, { onSort: o, sortingOrder: c, sortingBy: i } = T(), N = y(() => {
|
|
464
|
+
var u;
|
|
465
|
+
return (u = n.sort((h, m) => (m.pos ?? 0) - (h.pos ?? 0)).filter((h) => h.display !== "none")) == null ? void 0 : u.map((h) => ({
|
|
466
|
+
id: h.key,
|
|
467
|
+
label: h.label,
|
|
468
|
+
className: h.className ?? "",
|
|
469
|
+
sortable: h.sortable ?? !0,
|
|
470
|
+
sortOptions: h.sortOptions
|
|
468
471
|
}));
|
|
469
|
-
}, [n, r,
|
|
470
|
-
return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */
|
|
471
|
-
|
|
472
|
-
var
|
|
472
|
+
}, [n, r, a]);
|
|
473
|
+
return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */ v("tr", { children: [
|
|
474
|
+
N.map((u) => {
|
|
475
|
+
var h, m, d, p, g, C, f, w;
|
|
473
476
|
return /* @__PURE__ */ t(
|
|
474
477
|
"th",
|
|
475
478
|
{
|
|
476
479
|
scope: "col",
|
|
477
|
-
className: `table-headers-column ${
|
|
478
|
-
children: /* @__PURE__ */
|
|
480
|
+
className: `table-headers-column ${u.className}`,
|
|
481
|
+
children: /* @__PURE__ */ v(
|
|
479
482
|
"button",
|
|
480
483
|
{
|
|
481
|
-
disabled: !
|
|
482
|
-
onClick: () => o(
|
|
484
|
+
disabled: !u.sortable,
|
|
485
|
+
onClick: () => o(u.id, l),
|
|
483
486
|
className: "table-headers-cell",
|
|
484
487
|
children: [
|
|
485
|
-
/* @__PURE__ */ t("span", { className: "table-headers-label", children:
|
|
486
|
-
|
|
488
|
+
/* @__PURE__ */ t("span", { className: "table-headers-label", children: u.label }),
|
|
489
|
+
u.sortable && /* @__PURE__ */ t(
|
|
487
490
|
"span",
|
|
488
491
|
{
|
|
489
|
-
className: `${i ===
|
|
490
|
-
children: c ===
|
|
491
|
-
|
|
492
|
+
className: `${i === u.id ? "table-headers-sort-on" : "table-headers-sort"}`,
|
|
493
|
+
children: c === F.ASC ? ((m = (h = u.sortOptions) == null ? void 0 : h.icons) == null ? void 0 : m.asc) ?? /* @__PURE__ */ t(
|
|
494
|
+
re,
|
|
492
495
|
{
|
|
493
|
-
className: ((p = (
|
|
496
|
+
className: ((p = (d = u.sortOptions) == null ? void 0 : d.icons) == null ? void 0 : p.className) ?? "table-headers-sort-indicator"
|
|
494
497
|
}
|
|
495
|
-
) : ((
|
|
498
|
+
) : ((C = (g = u.sortOptions) == null ? void 0 : g.icons) == null ? void 0 : C.desc) ?? /* @__PURE__ */ t(
|
|
496
499
|
se,
|
|
497
500
|
{
|
|
498
|
-
className: ((w = (
|
|
501
|
+
className: ((w = (f = u.sortOptions) == null ? void 0 : f.icons) == null ? void 0 : w.className) ?? "table-headers-sort-indicator"
|
|
499
502
|
}
|
|
500
503
|
)
|
|
501
504
|
}
|
|
@@ -504,19 +507,19 @@ function be(e) {
|
|
|
504
507
|
}
|
|
505
508
|
)
|
|
506
509
|
},
|
|
507
|
-
|
|
510
|
+
u.id
|
|
508
511
|
);
|
|
509
512
|
}),
|
|
510
|
-
|
|
513
|
+
s && /* @__PURE__ */ t("th", { scope: "col", className: "table-headers-action", children: a("_accessibility:labels.actions") })
|
|
511
514
|
] }) });
|
|
512
515
|
}
|
|
513
|
-
function
|
|
516
|
+
function ve() {
|
|
514
517
|
const { t: e } = L();
|
|
515
518
|
return /* @__PURE__ */ t("div", { className: "table-empty", children: /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.empty") }) });
|
|
516
519
|
}
|
|
517
|
-
const
|
|
518
|
-
const { t: e } = L(), { total:
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
+
const Ne = () => {
|
|
521
|
+
const { t: e } = L(), { total: a, pageSize: r, currentPage: n, setCurrentPage: s } = T();
|
|
522
|
+
return /* @__PURE__ */ v("div", { className: "table-navigation-pages", children: [
|
|
520
523
|
/* @__PURE__ */ t(
|
|
521
524
|
"button",
|
|
522
525
|
{
|
|
@@ -524,98 +527,98 @@ const ve = () => {
|
|
|
524
527
|
disabled: n === 0,
|
|
525
528
|
"aria-label": e("_accessibility:buttons.previous"),
|
|
526
529
|
name: e("_accessibility:buttons.previous"),
|
|
527
|
-
onClick: () =>
|
|
528
|
-
children: /* @__PURE__ */ t(
|
|
530
|
+
onClick: () => s(n - 1),
|
|
531
|
+
children: /* @__PURE__ */ t(oe, { className: "w-2.5" })
|
|
529
532
|
}
|
|
530
533
|
),
|
|
531
534
|
/* @__PURE__ */ t(
|
|
532
535
|
"button",
|
|
533
536
|
{
|
|
534
|
-
disabled: Math.floor(
|
|
537
|
+
disabled: Math.floor(a / ((n + 1) * r)) === 0,
|
|
535
538
|
className: "table-navigation-buttons",
|
|
536
539
|
name: e("_accessibility:buttons.next"),
|
|
537
540
|
"aria-label": e("_accessibility:buttons.next"),
|
|
538
|
-
onClick: () =>
|
|
539
|
-
children: /* @__PURE__ */ t(
|
|
541
|
+
onClick: () => s(n + 1),
|
|
542
|
+
children: /* @__PURE__ */ t(le, { className: "w-2.5" })
|
|
540
543
|
}
|
|
541
544
|
)
|
|
542
545
|
] });
|
|
543
|
-
},
|
|
544
|
-
const { t: e } = L(), { total:
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
n[0] <
|
|
547
|
-
|
|
546
|
+
}, fe = () => {
|
|
547
|
+
const { t: e } = L(), { total: a, pageSize: r, pageSizes: n, currentPage: s } = T(), l = (s + 1) * r > a ? a : (s + 1) * r;
|
|
548
|
+
return /* @__PURE__ */ v("div", { className: "table-navigation-sizes", children: [
|
|
549
|
+
n[0] < a && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ v("p", { children: [
|
|
550
|
+
s * r + 1,
|
|
548
551
|
" - ",
|
|
549
552
|
l,
|
|
550
553
|
" ",
|
|
551
554
|
e("_accessibility:components.table.of")
|
|
552
555
|
] }) }),
|
|
553
|
-
/* @__PURE__ */ t("p", { children:
|
|
556
|
+
/* @__PURE__ */ t("p", { children: a })
|
|
554
557
|
] });
|
|
555
558
|
};
|
|
556
|
-
function
|
|
557
|
-
const { t: e } = L(), { pageSizes:
|
|
558
|
-
() =>
|
|
559
|
-
[
|
|
559
|
+
function Ce() {
|
|
560
|
+
const { t: e } = L(), { pageSizes: a, pageSize: r, setPageSize: n } = T(), s = y(
|
|
561
|
+
() => a == null ? void 0 : a.map((l) => ({ id: l, value: l })),
|
|
562
|
+
[a]
|
|
560
563
|
);
|
|
561
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ v("div", { className: "page-size", children: [
|
|
562
565
|
/* @__PURE__ */ t("p", { children: e("_accessibility:components.table.pageSizes") }),
|
|
563
566
|
/* @__PURE__ */ t(
|
|
564
|
-
|
|
567
|
+
q,
|
|
565
568
|
{
|
|
566
569
|
value: r,
|
|
567
|
-
options:
|
|
570
|
+
options: s,
|
|
568
571
|
inputClassName: "page-size-input",
|
|
569
572
|
containerClassName: "page-size-input-container",
|
|
570
573
|
helperTextClassName: "hidden",
|
|
571
|
-
onChange: (l) => n(l.target.value)
|
|
574
|
+
onChange: (l) => n(Number(l.target.value))
|
|
572
575
|
}
|
|
573
576
|
)
|
|
574
577
|
] });
|
|
575
578
|
}
|
|
576
|
-
function
|
|
577
|
-
const { t: e } = L(), { total:
|
|
578
|
-
const o = Math.ceil(
|
|
579
|
+
function ye() {
|
|
580
|
+
const { t: e } = L(), { total: a, pageSize: r, currentPage: n, setCurrentPage: s } = T(), l = y(() => {
|
|
581
|
+
const o = Math.ceil(a / r);
|
|
579
582
|
return Array.from({ length: o }, (c, i) => ({
|
|
580
583
|
id: i,
|
|
581
584
|
value: i + 1
|
|
582
585
|
}));
|
|
583
|
-
}, [
|
|
584
|
-
return /* @__PURE__ */
|
|
586
|
+
}, [a, r]);
|
|
587
|
+
return /* @__PURE__ */ v("div", { className: "jump-to-page", children: [
|
|
585
588
|
/* @__PURE__ */ t("p", { children: e("_accessibility:components.table.jumpToPage") }),
|
|
586
589
|
/* @__PURE__ */ t(
|
|
587
|
-
|
|
590
|
+
q,
|
|
588
591
|
{
|
|
589
592
|
value: n,
|
|
590
593
|
options: l,
|
|
591
594
|
inputClassName: "jump-to-page-input",
|
|
592
595
|
containerClassName: "jump-to-page-input-container",
|
|
593
596
|
helperTextClassName: "hidden",
|
|
594
|
-
onChange: (o) =>
|
|
597
|
+
onChange: (o) => s(Number(o.target.value))
|
|
595
598
|
}
|
|
596
599
|
)
|
|
597
600
|
] });
|
|
598
601
|
}
|
|
599
|
-
function
|
|
600
|
-
return /* @__PURE__ */
|
|
602
|
+
function we() {
|
|
603
|
+
return /* @__PURE__ */ v("div", { className: "table-footer", children: [
|
|
604
|
+
/* @__PURE__ */ t(ye, {}),
|
|
601
605
|
/* @__PURE__ */ t(Ce, {}),
|
|
602
606
|
/* @__PURE__ */ t(fe, {}),
|
|
603
|
-
/* @__PURE__ */ t(Ne, {})
|
|
604
|
-
/* @__PURE__ */ t(ve, {})
|
|
607
|
+
/* @__PURE__ */ t(Ne, {})
|
|
605
608
|
] });
|
|
606
609
|
}
|
|
607
|
-
function
|
|
608
|
-
const { propertyName:
|
|
610
|
+
function xe(e) {
|
|
611
|
+
const { propertyName: a, options: r, label: n } = e, { currentFilters: s, setCurrentFilters: l } = _(), o = y(() => {
|
|
609
612
|
var i;
|
|
610
|
-
return ((i = a
|
|
611
|
-
}, [
|
|
613
|
+
return ((i = s[a]) == null ? void 0 : i.value) ?? r[0];
|
|
614
|
+
}, [s]), c = S((i) => {
|
|
612
615
|
l({
|
|
613
|
-
type:
|
|
614
|
-
toUpdate: { [
|
|
616
|
+
type: k.update,
|
|
617
|
+
toUpdate: { [a]: { value: i.target.value } }
|
|
615
618
|
});
|
|
616
619
|
}, []);
|
|
617
620
|
return /* @__PURE__ */ t(
|
|
618
|
-
|
|
621
|
+
q,
|
|
619
622
|
{
|
|
620
623
|
value: o,
|
|
621
624
|
label: n,
|
|
@@ -626,18 +629,18 @@ function we(e) {
|
|
|
626
629
|
}
|
|
627
630
|
);
|
|
628
631
|
}
|
|
629
|
-
const
|
|
630
|
-
const { propertyName:
|
|
632
|
+
const Se = (e) => {
|
|
633
|
+
const { propertyName: a, label: r } = e, { currentFilters: n, setCurrentFilters: s } = _(), l = y(() => {
|
|
631
634
|
var c;
|
|
632
|
-
return ((c = n[
|
|
633
|
-
}, [n]), o =
|
|
634
|
-
|
|
635
|
-
type:
|
|
636
|
-
toUpdate: { [
|
|
635
|
+
return ((c = n[a]) == null ? void 0 : c.value) ?? "";
|
|
636
|
+
}, [n]), o = S((c) => {
|
|
637
|
+
s({
|
|
638
|
+
type: k.update,
|
|
639
|
+
toUpdate: { [a]: { value: c.target.value } }
|
|
637
640
|
});
|
|
638
641
|
}, []);
|
|
639
642
|
return /* @__PURE__ */ t(
|
|
640
|
-
|
|
643
|
+
j,
|
|
641
644
|
{
|
|
642
645
|
value: l ?? "",
|
|
643
646
|
label: r,
|
|
@@ -647,153 +650,163 @@ const xe = (e) => {
|
|
|
647
650
|
}
|
|
648
651
|
);
|
|
649
652
|
}, ke = (e) => {
|
|
650
|
-
const { propertyName:
|
|
651
|
-
var m;
|
|
652
|
-
return ((m = l[s]) == null ? void 0 : m.value) ?? "";
|
|
653
|
-
}, [l]), i = k(
|
|
654
|
-
(m) => {
|
|
655
|
-
o({
|
|
656
|
-
type: $.update,
|
|
657
|
-
toUpdate: {
|
|
658
|
-
[s]: { value: m.target.value }
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
},
|
|
662
|
-
[c]
|
|
663
|
-
);
|
|
664
|
-
return /* @__PURE__ */ t(
|
|
665
|
-
U,
|
|
666
|
-
{
|
|
667
|
-
value: c ?? "",
|
|
668
|
-
min: n,
|
|
669
|
-
max: a,
|
|
670
|
-
type: "number",
|
|
671
|
-
label: r,
|
|
672
|
-
containerClassName: "input-widget-container",
|
|
673
|
-
onChange: i,
|
|
674
|
-
helperTextClassName: ""
|
|
675
|
-
}
|
|
676
|
-
);
|
|
677
|
-
}, $e = (e) => {
|
|
678
|
-
const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = T(), l = C(() => {
|
|
653
|
+
const { propertyName: a, label: r } = e, { currentFilters: n, setCurrentFilters: s } = _(), l = y(() => {
|
|
679
654
|
var c;
|
|
680
|
-
return ((c = n[
|
|
681
|
-
}, [n]), o =
|
|
682
|
-
|
|
683
|
-
type:
|
|
684
|
-
toUpdate: { [
|
|
655
|
+
return ((c = n[a]) == null ? void 0 : c.value) ?? "";
|
|
656
|
+
}, [n]), o = S((c) => {
|
|
657
|
+
s({
|
|
658
|
+
type: k.update,
|
|
659
|
+
toUpdate: { [a]: { value: c.target.checked } }
|
|
685
660
|
});
|
|
686
661
|
}, []);
|
|
687
|
-
return /* @__PURE__ */ t(
|
|
662
|
+
return /* @__PURE__ */ t(ie, { label: r, checked: l ?? !1, onChange: o });
|
|
688
663
|
};
|
|
689
|
-
function
|
|
690
|
-
const { propertyName:
|
|
691
|
-
(
|
|
664
|
+
function $e(e) {
|
|
665
|
+
const { propertyName: a, label: r, options: n, multiple: s = !0 } = e, { currentFilters: l, setCurrentFilters: o } = _(), c = y(() => l[a] ?? n[0], [l]), i = S(
|
|
666
|
+
(N) => {
|
|
692
667
|
o({
|
|
693
|
-
type:
|
|
668
|
+
type: k.update,
|
|
694
669
|
toUpdate: {
|
|
695
|
-
[
|
|
696
|
-
value:
|
|
670
|
+
[a]: {
|
|
671
|
+
value: N
|
|
697
672
|
}
|
|
698
673
|
}
|
|
699
674
|
});
|
|
700
675
|
},
|
|
701
|
-
[
|
|
676
|
+
[s]
|
|
702
677
|
);
|
|
703
678
|
return /* @__PURE__ */ t(
|
|
704
|
-
|
|
679
|
+
de,
|
|
705
680
|
{
|
|
706
681
|
value: c == null ? void 0 : c.value,
|
|
707
682
|
label: r,
|
|
708
683
|
options: n,
|
|
709
|
-
multiple:
|
|
684
|
+
multiple: s,
|
|
710
685
|
helperTextClassName: "hidden",
|
|
711
686
|
containerClassName: "options-widget-container",
|
|
712
687
|
onChange: i
|
|
713
688
|
}
|
|
714
689
|
);
|
|
715
690
|
}
|
|
716
|
-
const
|
|
717
|
-
const { propertyName:
|
|
718
|
-
var
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
691
|
+
const G = (e) => {
|
|
692
|
+
const { propertyName: a, label: r, inputType: n } = e, { currentFilters: s, setCurrentFilters: l } = _(), o = M(null), c = M(null), i = y(() => {
|
|
693
|
+
var d, p, g;
|
|
694
|
+
const m = (p = (d = s[a]) == null ? void 0 : d.value) == null ? void 0 : p.start;
|
|
695
|
+
return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (g = s[a]) == null ? void 0 : g.value : "";
|
|
696
|
+
}, [s]), N = y(() => {
|
|
697
|
+
var d, p, g;
|
|
698
|
+
const m = (p = (d = s[a]) == null ? void 0 : d.value) == null ? void 0 : p.end;
|
|
699
|
+
return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (g = s[a]) == null ? void 0 : g.value : "";
|
|
700
|
+
}, [s]), u = S((m) => {
|
|
701
|
+
var d;
|
|
702
|
+
l({
|
|
703
|
+
type: k.update,
|
|
704
|
+
toUpdate: {
|
|
705
|
+
[a]: {
|
|
706
|
+
value: { end: ((d = c == null ? void 0 : c.current) == null ? void 0 : d.value) ?? null, start: m.target.value }
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
}, []), h = S((m) => {
|
|
711
|
+
var d;
|
|
712
|
+
l({
|
|
713
|
+
type: k.update,
|
|
714
|
+
toUpdate: {
|
|
715
|
+
[a]: {
|
|
716
|
+
value: {
|
|
717
|
+
start: ((d = o == null ? void 0 : o.current) == null ? void 0 : d.value) ?? null,
|
|
718
|
+
end: m.target.value
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
724
722
|
});
|
|
725
723
|
}, []);
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
724
|
+
return /* @__PURE__ */ v("div", { className: "flex gap-2 items-center", children: [
|
|
725
|
+
/* @__PURE__ */ t(
|
|
726
|
+
j,
|
|
727
|
+
{
|
|
728
|
+
value: i ?? "",
|
|
729
|
+
label: r,
|
|
730
|
+
type: n,
|
|
731
|
+
ref: o,
|
|
732
|
+
onChange: u,
|
|
733
|
+
containerClassName: "input-widget-container",
|
|
734
|
+
helperTextClassName: ""
|
|
735
|
+
}
|
|
736
|
+
),
|
|
737
|
+
/* @__PURE__ */ t(
|
|
738
|
+
j,
|
|
739
|
+
{
|
|
740
|
+
value: N ?? "",
|
|
741
|
+
label: r,
|
|
742
|
+
type: n,
|
|
743
|
+
ref: c,
|
|
744
|
+
onChange: h,
|
|
745
|
+
containerClassName: "input-widget-container",
|
|
746
|
+
helperTextClassName: ""
|
|
747
|
+
}
|
|
748
|
+
)
|
|
749
|
+
] });
|
|
750
|
+
}, Pe = (e) => {
|
|
738
751
|
switch (e.type) {
|
|
739
752
|
case E.text:
|
|
740
|
-
return /* @__PURE__ */ t(
|
|
753
|
+
return /* @__PURE__ */ t(Se, { ...e });
|
|
741
754
|
case E.number:
|
|
742
|
-
return /* @__PURE__ */ t(
|
|
755
|
+
return /* @__PURE__ */ t(G, { ...e });
|
|
756
|
+
case E.date:
|
|
757
|
+
return /* @__PURE__ */ t(G, { ...e });
|
|
743
758
|
case E.select:
|
|
744
|
-
return /* @__PURE__ */ t(
|
|
759
|
+
return /* @__PURE__ */ t(xe, { ...e });
|
|
745
760
|
case E.autocomplete:
|
|
746
|
-
return /* @__PURE__ */ t(Se, { ...e });
|
|
747
|
-
case E.date:
|
|
748
|
-
return /* @__PURE__ */ t(Pe, { ...e });
|
|
749
|
-
case E.check:
|
|
750
761
|
return /* @__PURE__ */ t($e, { ...e });
|
|
762
|
+
case E.check:
|
|
763
|
+
return /* @__PURE__ */ t(ke, { ...e });
|
|
751
764
|
}
|
|
752
765
|
return /* @__PURE__ */ t(D, {});
|
|
753
766
|
};
|
|
754
767
|
const Oe = (e) => {
|
|
755
|
-
const { align:
|
|
756
|
-
return
|
|
757
|
-
const
|
|
758
|
-
var
|
|
759
|
-
|
|
768
|
+
const { align: a = "right", filters: r = [], icon: n } = e, [s, l] = P(!1), { onFilterApply: o, filters: c } = T(), { currentFilters: i, setCurrentFilters: N } = _(), { t: u } = L(), h = M(null), m = M(null);
|
|
769
|
+
return H(() => {
|
|
770
|
+
const d = ({ target: p }) => {
|
|
771
|
+
var g, C;
|
|
772
|
+
m.current && (!s || (g = m.current) != null && g.contains(p) || (C = h == null ? void 0 : h.current) != null && C.contains(p) || l(!1));
|
|
760
773
|
};
|
|
761
|
-
return document.addEventListener("click",
|
|
762
|
-
}),
|
|
763
|
-
const
|
|
764
|
-
!
|
|
774
|
+
return document.addEventListener("click", d), () => document.removeEventListener("click", d);
|
|
775
|
+
}), H(() => {
|
|
776
|
+
const d = (p) => {
|
|
777
|
+
!s || p.code !== "Escape" || l(!1);
|
|
765
778
|
};
|
|
766
|
-
return document.addEventListener("keydown",
|
|
767
|
-
}), /* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
779
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
780
|
+
}), /* @__PURE__ */ v("div", { className: "filter-dropdown-main", children: [
|
|
781
|
+
/* @__PURE__ */ v(
|
|
769
782
|
"button",
|
|
770
783
|
{
|
|
771
|
-
ref:
|
|
784
|
+
ref: h,
|
|
772
785
|
className: "filter-dropdown-button normal filter-dropdown-trigger",
|
|
773
786
|
"aria-haspopup": "true",
|
|
774
|
-
onClick: () => l(!
|
|
775
|
-
"aria-expanded":
|
|
787
|
+
onClick: () => l(!s),
|
|
788
|
+
"aria-expanded": s,
|
|
776
789
|
children: [
|
|
777
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children:
|
|
790
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: u("_accessibility:buttons.filters") }),
|
|
778
791
|
/* @__PURE__ */ t("wbr", {}),
|
|
779
|
-
n ?? /* @__PURE__ */ t(
|
|
792
|
+
n ?? /* @__PURE__ */ t(ce, { className: "filter-dropdown-trigger-icon" })
|
|
780
793
|
]
|
|
781
794
|
}
|
|
782
795
|
),
|
|
783
796
|
/* @__PURE__ */ t(
|
|
784
797
|
"div",
|
|
785
798
|
{
|
|
786
|
-
className: `filter-dropdown-transition ${
|
|
787
|
-
children: /* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */ t("div", { className: "filter-title", children:
|
|
789
|
-
/* @__PURE__ */ t("ul", { className: "filter-container", children: r.map((
|
|
790
|
-
/* @__PURE__ */ t("div", { className: "filter-footer", children: /* @__PURE__ */
|
|
799
|
+
className: `filter-dropdown-transition ${s ? "opened" : "closed"} ${a === "right" ? "right" : "left"}`,
|
|
800
|
+
children: /* @__PURE__ */ v("div", { ref: m, children: [
|
|
801
|
+
/* @__PURE__ */ t("div", { className: "filter-title", children: u("_accessibility:buttons.filters") }),
|
|
802
|
+
/* @__PURE__ */ t("ul", { className: "filter-container", children: r.map((d) => /* @__PURE__ */ t("li", { className: "filter-container-item", children: Pe(d) }, d.propertyName)) }),
|
|
803
|
+
/* @__PURE__ */ t("div", { className: "filter-footer", children: /* @__PURE__ */ v("ul", { className: "filter-buttons-row", children: [
|
|
791
804
|
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
792
805
|
"button",
|
|
793
806
|
{
|
|
794
|
-
onClick: () =>
|
|
807
|
+
onClick: () => N({ type: k.reset, filters: r }),
|
|
795
808
|
className: "filter-dropdown-button small filter-dropdown-cancel",
|
|
796
|
-
children:
|
|
809
|
+
children: u("_accessibility:buttons.clear")
|
|
797
810
|
}
|
|
798
811
|
) }),
|
|
799
812
|
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
@@ -804,7 +817,7 @@ const Oe = (e) => {
|
|
|
804
817
|
l(!1), o(i);
|
|
805
818
|
},
|
|
806
819
|
onBlur: () => l(!1),
|
|
807
|
-
children:
|
|
820
|
+
children: u("_accessibility:buttons.applyFilters")
|
|
808
821
|
}
|
|
809
822
|
) })
|
|
810
823
|
] }) })
|
|
@@ -812,165 +825,165 @@ const Oe = (e) => {
|
|
|
812
825
|
}
|
|
813
826
|
)
|
|
814
827
|
] });
|
|
815
|
-
},
|
|
816
|
-
const { columns:
|
|
817
|
-
() =>
|
|
818
|
-
[
|
|
828
|
+
}, ze = (e) => e, Ee = (e) => {
|
|
829
|
+
const { columns: a, softDeleteProperty: r = "deleted", data: n, actions: s } = e, l = y(
|
|
830
|
+
() => a.sort((o, c) => (c.pos ?? 0) - (o.pos ?? 0)).filter((o) => o.display !== "none"),
|
|
831
|
+
[a]
|
|
819
832
|
);
|
|
820
833
|
return n == null ? void 0 : n.map((o) => {
|
|
821
834
|
var c;
|
|
822
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ v(
|
|
823
836
|
"tr",
|
|
824
837
|
{
|
|
825
838
|
className: `table-row ${o[r] ? "deleted-class" : ""}`,
|
|
826
839
|
children: [
|
|
827
|
-
l == null ? void 0 : l.map((i,
|
|
840
|
+
l == null ? void 0 : l.map((i, N) => /* @__PURE__ */ t(
|
|
828
841
|
"td",
|
|
829
842
|
{
|
|
830
|
-
className: `table-row-cell ${
|
|
831
|
-
children: i.renderBody ? i.renderBody(o[i.key], o) :
|
|
843
|
+
className: `table-row-cell ${N === 0 ? "basic" : ""} ${i.className ?? ""}`,
|
|
844
|
+
children: i.renderBody ? i.renderBody(o[i.key], o) : ze(o[i.key])
|
|
832
845
|
},
|
|
833
846
|
i.key
|
|
834
847
|
)),
|
|
835
|
-
|
|
848
|
+
s ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = s(o).filter((i) => !i.hidden)) == null ? void 0 : c.map((i) => /* @__PURE__ */ t(Le, { content: i.tooltip, children: /* @__PURE__ */ t("button", { onClick: () => i.onClick(o), children: i.icon }) }, i.id)) }) }) : null
|
|
836
849
|
]
|
|
837
850
|
},
|
|
838
851
|
o.id
|
|
839
852
|
);
|
|
840
853
|
});
|
|
841
854
|
};
|
|
842
|
-
function
|
|
855
|
+
function Me(e) {
|
|
843
856
|
const {
|
|
844
|
-
title:
|
|
857
|
+
title: a = "",
|
|
845
858
|
data: r,
|
|
846
859
|
onSort: n,
|
|
847
|
-
entity:
|
|
860
|
+
entity: s = "",
|
|
848
861
|
isLoading: l = !1,
|
|
849
862
|
actions: o,
|
|
850
863
|
columns: c = [],
|
|
851
864
|
contentClassName: i = "",
|
|
852
|
-
className:
|
|
853
|
-
toolbar:
|
|
854
|
-
softDeleteProperty:
|
|
855
|
-
} = e,
|
|
856
|
-
var
|
|
865
|
+
className: N = "",
|
|
866
|
+
toolbar: u = /* @__PURE__ */ t(D, {}),
|
|
867
|
+
softDeleteProperty: h = "deleted"
|
|
868
|
+
} = e, m = y(() => c ? c.sort((p, g) => (g.pos ?? 0) - (p.pos ?? 0)).filter((p) => !!p.filterOptions).map((p) => {
|
|
869
|
+
var g;
|
|
857
870
|
return {
|
|
858
871
|
...p.filterOptions,
|
|
859
|
-
label: ((
|
|
872
|
+
label: ((g = p.filterOptions) == null ? void 0 : g.label) ?? p.label,
|
|
860
873
|
propertyName: p.key
|
|
861
874
|
};
|
|
862
|
-
}) : [], [c]),
|
|
863
|
-
return /* @__PURE__ */ t(
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */ t("h1", { className: "table-header-title", children:
|
|
866
|
-
l ? null : /* @__PURE__ */
|
|
867
|
-
|
|
868
|
-
/* @__PURE__ */ t(Oe, { filters:
|
|
875
|
+
}) : [], [c]), d = y(() => !(r != null && r.length), [r]);
|
|
876
|
+
return /* @__PURE__ */ t(be, { children: /* @__PURE__ */ v("div", { className: `${N} table-main`, children: [
|
|
877
|
+
/* @__PURE__ */ v("div", { className: "table-header", children: [
|
|
878
|
+
/* @__PURE__ */ t("h1", { className: "table-header-title", children: a }),
|
|
879
|
+
l ? null : /* @__PURE__ */ v("div", { className: "table-header-right", children: [
|
|
880
|
+
u,
|
|
881
|
+
!!m && !!m.length && /* @__PURE__ */ t(Oe, { filters: m })
|
|
869
882
|
] })
|
|
870
883
|
] }),
|
|
871
|
-
l ? /* @__PURE__ */ t(
|
|
872
|
-
/* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */
|
|
884
|
+
l ? /* @__PURE__ */ t(ue, { className: "table-loading" }) : /* @__PURE__ */ t(D, { children: d ? /* @__PURE__ */ t(ve, {}) : /* @__PURE__ */ v(D, { children: [
|
|
885
|
+
/* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */ v("table", { className: "table-content", children: [
|
|
873
886
|
/* @__PURE__ */ t(
|
|
874
|
-
|
|
887
|
+
ge,
|
|
875
888
|
{
|
|
876
|
-
entity:
|
|
889
|
+
entity: s,
|
|
877
890
|
columns: c,
|
|
878
891
|
onSortCallback: n,
|
|
879
892
|
hasAction: !!o
|
|
880
893
|
}
|
|
881
894
|
),
|
|
882
895
|
/* @__PURE__ */ t("tbody", { children: /* @__PURE__ */ t(
|
|
883
|
-
|
|
896
|
+
Ee,
|
|
884
897
|
{
|
|
885
898
|
data: r,
|
|
886
899
|
actions: o,
|
|
887
900
|
columns: c,
|
|
888
|
-
softDeleteProperty:
|
|
901
|
+
softDeleteProperty: h
|
|
889
902
|
}
|
|
890
903
|
) })
|
|
891
904
|
] }) }),
|
|
892
|
-
/* @__PURE__ */ t(
|
|
905
|
+
/* @__PURE__ */ t(we, {})
|
|
893
906
|
] }) })
|
|
894
907
|
] }) });
|
|
895
908
|
}
|
|
896
|
-
function
|
|
897
|
-
const { content:
|
|
898
|
-
return /* @__PURE__ */
|
|
909
|
+
function Le(e) {
|
|
910
|
+
const { content: a, children: r } = e;
|
|
911
|
+
return /* @__PURE__ */ v("div", { className: "tooltip-container", children: [
|
|
899
912
|
r,
|
|
900
|
-
/* @__PURE__ */ t("div", { className: "tooltip-text", children:
|
|
913
|
+
/* @__PURE__ */ t("div", { className: "tooltip-text", children: a })
|
|
901
914
|
] });
|
|
902
915
|
}
|
|
903
|
-
var
|
|
916
|
+
var O = /* @__PURE__ */ ((e) => (e.empty = "empty", e.outlined = "outlined", e.default = "default", e))(O || {});
|
|
904
917
|
function Te(e) {
|
|
905
918
|
const {
|
|
906
|
-
label:
|
|
919
|
+
label: a,
|
|
907
920
|
onDelete: r,
|
|
908
921
|
className: n = "",
|
|
909
|
-
spanClassName:
|
|
910
|
-
variant: l =
|
|
911
|
-
} = e, o =
|
|
922
|
+
spanClassName: s = "",
|
|
923
|
+
variant: l = O.default
|
|
924
|
+
} = e, o = y(() => {
|
|
912
925
|
switch (l) {
|
|
913
|
-
case
|
|
926
|
+
case O.empty:
|
|
914
927
|
return "text-primary bg-transparent";
|
|
915
|
-
case
|
|
928
|
+
case O.outlined:
|
|
916
929
|
return "border border-primary";
|
|
917
|
-
case
|
|
930
|
+
case O.default:
|
|
918
931
|
default:
|
|
919
932
|
return "text-white bg-primary";
|
|
920
933
|
}
|
|
921
|
-
}, [l]), c =
|
|
934
|
+
}, [l]), c = y(() => {
|
|
922
935
|
switch (l) {
|
|
923
|
-
case
|
|
924
|
-
case
|
|
936
|
+
case O.empty:
|
|
937
|
+
case O.outlined:
|
|
925
938
|
return "chip-delete-button-svg";
|
|
926
|
-
case
|
|
939
|
+
case O.default:
|
|
927
940
|
default:
|
|
928
941
|
return "filled-chip-delete-button-svg";
|
|
929
942
|
}
|
|
930
943
|
}, [l]);
|
|
931
|
-
return /* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */ t("span", { className:
|
|
944
|
+
return /* @__PURE__ */ v("div", { className: `chip-main ${o} ${n}`, children: [
|
|
945
|
+
/* @__PURE__ */ t("span", { className: s, children: a }),
|
|
933
946
|
r ? /* @__PURE__ */ t("button", { type: "button", className: "chip-delete-button", onClick: r, children: /* @__PURE__ */ t(K, { className: c }) }) : null
|
|
934
947
|
] });
|
|
935
948
|
}
|
|
936
949
|
export {
|
|
937
|
-
|
|
938
|
-
|
|
950
|
+
de as AutocompleteInput,
|
|
951
|
+
ie as CheckInput,
|
|
939
952
|
se as ChevronDown,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
953
|
+
oe as ChevronLeft,
|
|
954
|
+
le as ChevronRight,
|
|
955
|
+
re as ChevronUp,
|
|
943
956
|
Te as Chip,
|
|
944
|
-
|
|
957
|
+
O as ChipVariant,
|
|
945
958
|
K as Close,
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
959
|
+
ge as Columns,
|
|
960
|
+
fe as CountOfTotal,
|
|
961
|
+
ve as Empty,
|
|
949
962
|
Oe as FilterPopup,
|
|
950
963
|
E as FilterTypes,
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
964
|
+
ce as Filters,
|
|
965
|
+
k as FiltersActions,
|
|
966
|
+
be as FiltersProvider,
|
|
967
|
+
we as Footer,
|
|
968
|
+
ue as Loading,
|
|
969
|
+
Ne as Navigation,
|
|
970
|
+
Ce as PageSize,
|
|
971
|
+
Ee as Rows,
|
|
972
|
+
q as SelectInput,
|
|
973
|
+
F as SortOrder,
|
|
974
|
+
U as State,
|
|
975
|
+
Me as Table,
|
|
976
|
+
De as TableOptionsProvider,
|
|
977
|
+
j as TextInput,
|
|
978
|
+
Le as Tooltip,
|
|
979
|
+
Be as TranslationProvider,
|
|
980
|
+
me as filtersReducer,
|
|
981
|
+
Y as helperTextStateClassName,
|
|
982
|
+
he as initializer,
|
|
970
983
|
Q as inputStateClassName,
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
984
|
+
X as labelStateClassName,
|
|
985
|
+
Pe as renderFilterComponent,
|
|
986
|
+
_ as useFilters,
|
|
987
|
+
T as useTableOptions,
|
|
975
988
|
L as useTranslation
|
|
976
989
|
};
|