@sito/dashboard 0.0.35 → 0.0.38
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 +388 -375
- 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,7 +1,7 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as t, jsxs as g, 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 se, useMemo as y } from "react";
|
|
4
|
+
function ae(e) {
|
|
5
5
|
const { className: s = "" } = e;
|
|
6
6
|
return /* @__PURE__ */ t(
|
|
7
7
|
"svg",
|
|
@@ -14,7 +14,7 @@ function se(e) {
|
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function re(e) {
|
|
18
18
|
const { className: s = "" } = e;
|
|
19
19
|
return /* @__PURE__ */ t(
|
|
20
20
|
"svg",
|
|
@@ -27,7 +27,7 @@ function ae(e) {
|
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function le(e) {
|
|
31
31
|
const { className: s = "" } = e;
|
|
32
32
|
return /* @__PURE__ */ t(
|
|
33
33
|
"svg",
|
|
@@ -40,7 +40,7 @@ function re(e) {
|
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function oe(e) {
|
|
44
44
|
const { className: s = "" } = e;
|
|
45
45
|
return /* @__PURE__ */ t(
|
|
46
46
|
"svg",
|
|
@@ -53,7 +53,7 @@ function le(e) {
|
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const ce = (e) => {
|
|
57
57
|
const { className: s = "" } = e;
|
|
58
58
|
return /* @__PURE__ */ t("svg", { className: s, 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
|
};
|
|
@@ -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,7 +99,7 @@ const Q = (e) => {
|
|
|
99
99
|
return "input-helper-text-normal";
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
const
|
|
102
|
+
const q = I(function(e, s) {
|
|
103
103
|
const {
|
|
104
104
|
value: r,
|
|
105
105
|
onChange: n,
|
|
@@ -108,68 +108,67 @@ const J = j(function(e, s) {
|
|
|
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: b,
|
|
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__ */ g("div", { className: `select-input-container ${l}`, children: [
|
|
123
121
|
/* @__PURE__ */ t(
|
|
124
122
|
"select",
|
|
125
123
|
{
|
|
126
|
-
...
|
|
127
|
-
id:
|
|
124
|
+
...C,
|
|
125
|
+
id: d,
|
|
128
126
|
ref: s,
|
|
129
|
-
name:
|
|
127
|
+
name: m,
|
|
130
128
|
value: r,
|
|
131
129
|
onChange: n,
|
|
132
130
|
className: `select-input ${Q(p)} peer ${o}`,
|
|
133
|
-
children: a == null ? void 0 : a.map((
|
|
131
|
+
children: a == null ? void 0 : a.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
|
+
b,
|
|
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, s) {
|
|
154
153
|
const {
|
|
155
154
|
children: r,
|
|
156
155
|
value: n,
|
|
157
156
|
onChange: a,
|
|
158
|
-
state: l =
|
|
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: b = "",
|
|
168
|
+
helperTextClassName: C = "",
|
|
169
|
+
...f
|
|
171
170
|
} = e;
|
|
172
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ g("div", { className: `text-input-container ${m}`, children: [
|
|
173
172
|
/* @__PURE__ */ t(
|
|
174
173
|
"input",
|
|
175
174
|
{
|
|
@@ -177,22 +176,22 @@ const U = j(function(e, s) {
|
|
|
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
183
|
onChange: a,
|
|
185
|
-
...
|
|
184
|
+
...f
|
|
186
185
|
}
|
|
187
186
|
),
|
|
188
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ g(
|
|
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,29 +199,29 @@ 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 : b
|
|
205
204
|
}
|
|
206
205
|
)
|
|
207
206
|
] });
|
|
208
207
|
});
|
|
209
|
-
const
|
|
208
|
+
const ie = I(function(e, s) {
|
|
210
209
|
const {
|
|
211
210
|
checked: r,
|
|
212
211
|
onChange: n,
|
|
213
|
-
state: a =
|
|
212
|
+
state: a = 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__ */ g("label", { className: `input-check-container ${N}`, children: [
|
|
226
225
|
/* @__PURE__ */ t(
|
|
227
226
|
"input",
|
|
228
227
|
{
|
|
@@ -232,14 +231,14 @@ const ce = j(function(e, s) {
|
|
|
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, s) {
|
|
243
242
|
const {
|
|
244
243
|
state: r,
|
|
245
244
|
value: n,
|
|
@@ -248,106 +247,107 @@ const ie = j(function(e, s) {
|
|
|
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, [b, C] = P(""), [f, w] = P(!1), $ = l.filter((v) => {
|
|
257
|
+
const x = String(v.value).toLowerCase().includes(b == null ? void 0 : b.toLowerCase());
|
|
258
|
+
return n && n.length ? n != null && n.some ? !(n != null && n.some((R) => R.id === v.id)) : (n == null ? void 0 : n.id) !== v.id : x;
|
|
259
|
+
}), A = M(null);
|
|
260
|
+
H(() => {
|
|
261
|
+
const v = (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", v), document.addEventListener("keydown", x), () => {
|
|
267
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", x);
|
|
269
268
|
};
|
|
270
269
|
}, []);
|
|
271
|
-
const B = (
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
(
|
|
275
|
-
|
|
270
|
+
const B = (v) => {
|
|
271
|
+
C(v.target.value);
|
|
272
|
+
}, J = S(
|
|
273
|
+
(v) => {
|
|
274
|
+
C(""), v ? d ? Array.isArray(n) && n.length ? a([...n, v]) : a([v]) : a(v) : a(null), w(!1);
|
|
276
275
|
},
|
|
277
|
-
[
|
|
278
|
-
),
|
|
279
|
-
(
|
|
280
|
-
const x = n.filter((
|
|
276
|
+
[d, a, n]
|
|
277
|
+
), ne = S(
|
|
278
|
+
(v) => {
|
|
279
|
+
const x = n.filter((z, R) => R !== v);
|
|
281
280
|
x.length ? a(x) : a(null);
|
|
282
281
|
},
|
|
283
282
|
[a, n]
|
|
284
283
|
);
|
|
285
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ g(
|
|
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 : b,
|
|
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 ${
|
|
302
|
+
containerClassName: `autocomplete-text-input ${u}`,
|
|
304
303
|
ref: s,
|
|
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: (v) => {
|
|
311
|
+
J(), v.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((v) => /* @__PURE__ */ t(
|
|
320
319
|
"li",
|
|
321
320
|
{
|
|
322
321
|
className: "autocomplete-suggestion-item hover:bg-primary/20",
|
|
323
322
|
onClick: (x) => {
|
|
324
|
-
|
|
323
|
+
J(v), x.stopPropagation();
|
|
325
324
|
},
|
|
326
|
-
children:
|
|
325
|
+
children: v.value
|
|
327
326
|
},
|
|
328
|
-
|
|
327
|
+
v.id
|
|
329
328
|
)) }),
|
|
330
|
-
|
|
329
|
+
d && Array.isArray(n) && n.length ? /* @__PURE__ */ t("ul", { className: "autocomplete-value-container", children: n.map((v, x) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
331
330
|
Te,
|
|
332
331
|
{
|
|
333
|
-
label: String(
|
|
334
|
-
onDelete: (
|
|
335
|
-
|
|
332
|
+
label: String(v.value),
|
|
333
|
+
onDelete: (z) => {
|
|
334
|
+
ne(x), z.stopPropagation();
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
|
-
) },
|
|
337
|
+
) }, v.value)) }) : null
|
|
339
338
|
]
|
|
340
339
|
}
|
|
341
340
|
);
|
|
342
341
|
});
|
|
343
|
-
function
|
|
342
|
+
function ue(e) {
|
|
344
343
|
const {
|
|
345
344
|
color: s = "stroke-blue-800",
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
className: r = "",
|
|
346
|
+
loaderClass: n = "",
|
|
347
|
+
strokeWidth: a = "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
353
|
className: `path ${s}`,
|
|
@@ -355,85 +355,88 @@ function de(e) {
|
|
|
355
355
|
cy: "50",
|
|
356
356
|
r: "20",
|
|
357
357
|
fill: "none",
|
|
358
|
-
strokeWidth:
|
|
358
|
+
strokeWidth: a,
|
|
359
359
|
strokeMiterlimit: "10"
|
|
360
360
|
}
|
|
361
361
|
) }) }) }) });
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
363
|
+
const Z = W({});
|
|
364
|
+
function Be(e) {
|
|
365
365
|
const { children: s, t: r } = e;
|
|
366
|
-
return /* @__PURE__ */ t(
|
|
366
|
+
return /* @__PURE__ */ t(Z.Provider, { value: { t: r }, children: s });
|
|
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: s } = e, [r, n] = P(0), [a, l] = P(20), [o, c] = P(0), [i,
|
|
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: s } = e, [r, n] = P(0), [a, 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
|
+
), b = 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:
|
|
402
|
+
setSortingBy: N,
|
|
403
|
+
sortingOrder: u,
|
|
404
|
+
setSortingOrder: h,
|
|
405
405
|
pageSize: a,
|
|
406
|
-
pageSizes:
|
|
406
|
+
pageSizes: pe,
|
|
407
407
|
setPageSize: l,
|
|
408
408
|
currentPage: o,
|
|
409
409
|
setCurrentPage: c,
|
|
410
|
-
filters:
|
|
411
|
-
onFilterApply:
|
|
410
|
+
filters: m,
|
|
411
|
+
onFilterApply: b
|
|
412
412
|
};
|
|
413
|
-
return /* @__PURE__ */ t(
|
|
414
|
-
},
|
|
415
|
-
const e =
|
|
413
|
+
return /* @__PURE__ */ t(ee.Provider, { value: C, children: s });
|
|
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 s = {}, r = Object.keys(e);
|
|
424
|
+
return r == null || r.forEach((n) => {
|
|
425
|
+
s[n] = { value: e[n] };
|
|
426
|
+
}), s;
|
|
427
|
+
}
|
|
428
|
+
return {};
|
|
426
429
|
};
|
|
427
|
-
function
|
|
430
|
+
function me(e, s) {
|
|
428
431
|
const { type: r } = s;
|
|
429
432
|
switch (r) {
|
|
430
|
-
case
|
|
433
|
+
case k.reset: {
|
|
431
434
|
const { filters: n } = s, a = {};
|
|
432
435
|
return n == null || n.forEach(({ propertyName: l, defaultValue: o }) => {
|
|
433
436
|
a[l] = { value: o };
|
|
434
437
|
}), { ...e, ...a };
|
|
435
438
|
}
|
|
436
|
-
case
|
|
439
|
+
case k.update: {
|
|
437
440
|
const { toUpdate: n } = s;
|
|
438
441
|
return { ...e, ...n };
|
|
439
442
|
}
|
|
@@ -441,61 +444,61 @@ function he(e, s) {
|
|
|
441
444
|
return e;
|
|
442
445
|
}
|
|
443
446
|
}
|
|
444
|
-
const
|
|
445
|
-
const { children: s } = e, { filters: r } =
|
|
446
|
-
|
|
447
|
-
|
|
447
|
+
const te = W({}), be = (e) => {
|
|
448
|
+
const { children: s } = e, { filters: r } = T(), [n, a] = se(
|
|
449
|
+
me,
|
|
450
|
+
he(r)
|
|
448
451
|
), l = {
|
|
449
452
|
currentFilters: n,
|
|
450
453
|
setCurrentFilters: a
|
|
451
454
|
};
|
|
452
|
-
return /* @__PURE__ */ t(
|
|
453
|
-
},
|
|
454
|
-
const e =
|
|
455
|
+
return /* @__PURE__ */ t(te.Provider, { value: l, children: s });
|
|
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: s } = L(), { entity: r = "", columns: n = [], hasAction: a = !0, onSortCallback: l } = e, { onSort: o, sortingOrder: c, sortingBy: i } =
|
|
461
|
-
var
|
|
462
|
-
return (
|
|
463
|
-
id:
|
|
464
|
-
label:
|
|
465
|
-
className:
|
|
466
|
-
sortable:
|
|
467
|
-
sortOptions:
|
|
462
|
+
function ge(e) {
|
|
463
|
+
const { t: s } = L(), { entity: r = "", columns: n = [], hasAction: a = !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
472
|
}, [n, r, s]);
|
|
470
|
-
return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */
|
|
471
|
-
|
|
472
|
-
var
|
|
473
|
+
return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */ g("tr", { children: [
|
|
474
|
+
N.map((u) => {
|
|
475
|
+
var h, m, d, p, b, 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__ */ g(
|
|
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
|
-
) : ((
|
|
496
|
-
|
|
498
|
+
) : ((C = (b = u.sortOptions) == null ? void 0 : b.icons) == null ? void 0 : C.desc) ?? /* @__PURE__ */ t(
|
|
499
|
+
ae,
|
|
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
|
a && /* @__PURE__ */ t("th", { scope: "col", className: "table-headers-action", children: s("_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: s, pageSize: r, currentPage: n, setCurrentPage: a } =
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
+
const Ne = () => {
|
|
521
|
+
const { t: e } = L(), { total: s, pageSize: r, currentPage: n, setCurrentPage: a } = T();
|
|
522
|
+
return /* @__PURE__ */ g("div", { className: "table-navigation-pages", children: [
|
|
520
523
|
/* @__PURE__ */ t(
|
|
521
524
|
"button",
|
|
522
525
|
{
|
|
@@ -525,7 +528,7 @@ const ve = () => {
|
|
|
525
528
|
"aria-label": e("_accessibility:buttons.previous"),
|
|
526
529
|
name: e("_accessibility:buttons.previous"),
|
|
527
530
|
onClick: () => a(n - 1),
|
|
528
|
-
children: /* @__PURE__ */ t(
|
|
531
|
+
children: /* @__PURE__ */ t(oe, { className: "w-2.5" })
|
|
529
532
|
}
|
|
530
533
|
),
|
|
531
534
|
/* @__PURE__ */ t(
|
|
@@ -536,14 +539,14 @@ const ve = () => {
|
|
|
536
539
|
name: e("_accessibility:buttons.next"),
|
|
537
540
|
"aria-label": e("_accessibility:buttons.next"),
|
|
538
541
|
onClick: () => a(n + 1),
|
|
539
|
-
children: /* @__PURE__ */ t(
|
|
542
|
+
children: /* @__PURE__ */ t(le, { className: "w-2.5" })
|
|
540
543
|
}
|
|
541
544
|
)
|
|
542
545
|
] });
|
|
543
|
-
},
|
|
544
|
-
const { t: e } = L(), { total: s, pageSize: r, pageSizes: n, currentPage: a } =
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
n[0] < s && /* @__PURE__ */ t(D, { children: /* @__PURE__ */
|
|
546
|
+
}, fe = () => {
|
|
547
|
+
const { t: e } = L(), { total: s, pageSize: r, pageSizes: n, currentPage: a } = T(), l = (a + 1) * r > s ? s : (a + 1) * r;
|
|
548
|
+
return /* @__PURE__ */ g("div", { className: "table-navigation-sizes", children: [
|
|
549
|
+
n[0] < s && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ g("p", { children: [
|
|
547
550
|
a * r + 1,
|
|
548
551
|
" - ",
|
|
549
552
|
l,
|
|
@@ -553,38 +556,38 @@ const ve = () => {
|
|
|
553
556
|
/* @__PURE__ */ t("p", { children: s })
|
|
554
557
|
] });
|
|
555
558
|
};
|
|
556
|
-
function
|
|
557
|
-
const { t: e } = L(), { pageSizes: s, pageSize: r, setPageSize: n } =
|
|
559
|
+
function Ce() {
|
|
560
|
+
const { t: e } = L(), { pageSizes: s, pageSize: r, setPageSize: n } = T(), a = y(
|
|
558
561
|
() => s == null ? void 0 : s.map((l) => ({ id: l, value: l })),
|
|
559
562
|
[s]
|
|
560
563
|
);
|
|
561
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ g("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
570
|
options: a,
|
|
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: s, pageSize: r, currentPage: n, setCurrentPage: a } =
|
|
579
|
+
function ye() {
|
|
580
|
+
const { t: e } = L(), { total: s, pageSize: r, currentPage: n, setCurrentPage: a } = T(), l = y(() => {
|
|
578
581
|
const o = Math.ceil(s / r);
|
|
579
582
|
return Array.from({ length: o }, (c, i) => ({
|
|
580
583
|
id: i,
|
|
581
584
|
value: i + 1
|
|
582
585
|
}));
|
|
583
586
|
}, [s, r]);
|
|
584
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ g("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,
|
|
@@ -596,26 +599,26 @@ function Ce() {
|
|
|
596
599
|
)
|
|
597
600
|
] });
|
|
598
601
|
}
|
|
599
|
-
function
|
|
600
|
-
return /* @__PURE__ */
|
|
602
|
+
function we() {
|
|
603
|
+
return /* @__PURE__ */ g("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: s, options: r, label: n } = e, { currentFilters: a, setCurrentFilters: l } =
|
|
610
|
+
function xe(e) {
|
|
611
|
+
const { propertyName: s, options: r, label: n } = e, { currentFilters: a, setCurrentFilters: l } = _(), o = y(() => {
|
|
609
612
|
var i;
|
|
610
613
|
return ((i = a[s]) == null ? void 0 : i.value) ?? r[0];
|
|
611
|
-
}, [a]), c =
|
|
614
|
+
}, [a]), c = S((i) => {
|
|
612
615
|
l({
|
|
613
|
-
type:
|
|
616
|
+
type: k.update,
|
|
614
617
|
toUpdate: { [s]: { 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: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } =
|
|
632
|
+
const Se = (e) => {
|
|
633
|
+
const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = _(), l = y(() => {
|
|
631
634
|
var c;
|
|
632
635
|
return ((c = n[s]) == null ? void 0 : c.value) ?? "";
|
|
633
|
-
}, [n]), o =
|
|
636
|
+
}, [n]), o = S((c) => {
|
|
634
637
|
a({
|
|
635
|
-
type:
|
|
638
|
+
type: k.update,
|
|
636
639
|
toUpdate: { [s]: { 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,53 +650,25 @@ const xe = (e) => {
|
|
|
647
650
|
}
|
|
648
651
|
);
|
|
649
652
|
}, ke = (e) => {
|
|
650
|
-
const { propertyName: s, label: r
|
|
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: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = _(), l = y(() => {
|
|
679
654
|
var c;
|
|
680
655
|
return ((c = n[s]) == null ? void 0 : c.value) ?? "";
|
|
681
|
-
}, [n]), o =
|
|
656
|
+
}, [n]), o = S((c) => {
|
|
682
657
|
a({
|
|
683
|
-
type:
|
|
658
|
+
type: k.update,
|
|
684
659
|
toUpdate: { [s]: { 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: s, label: r, options: n, multiple: a = !0 } = e, { currentFilters: l, setCurrentFilters: o } =
|
|
691
|
-
(
|
|
664
|
+
function $e(e) {
|
|
665
|
+
const { propertyName: s, label: r, options: n, multiple: a = !0 } = e, { currentFilters: l, setCurrentFilters: o } = _(), c = y(() => l[s] ?? n[0], [l]), i = S(
|
|
666
|
+
(N) => {
|
|
692
667
|
o({
|
|
693
|
-
type:
|
|
668
|
+
type: k.update,
|
|
694
669
|
toUpdate: {
|
|
695
670
|
[s]: {
|
|
696
|
-
value:
|
|
671
|
+
value: N
|
|
697
672
|
}
|
|
698
673
|
}
|
|
699
674
|
});
|
|
@@ -701,7 +676,7 @@ function Se(e) {
|
|
|
701
676
|
[a]
|
|
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,
|
|
@@ -713,70 +688,108 @@ function Se(e) {
|
|
|
713
688
|
}
|
|
714
689
|
);
|
|
715
690
|
}
|
|
716
|
-
const
|
|
717
|
-
const { propertyName: s, label: r } = e, { currentFilters:
|
|
718
|
-
var
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
691
|
+
const G = (e) => {
|
|
692
|
+
const { propertyName: s, label: r, inputType: n } = e, { currentFilters: a, setCurrentFilters: l } = _(), o = M(null), c = M(null), i = y(() => {
|
|
693
|
+
var d, p, b;
|
|
694
|
+
const m = (p = (d = a[s]) == null ? void 0 : d.value) == null ? void 0 : p.start;
|
|
695
|
+
return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (b = a[s]) == null ? void 0 : b.value : "";
|
|
696
|
+
}, [a]), N = y(() => {
|
|
697
|
+
var d, p, b;
|
|
698
|
+
const m = (p = (d = a[s]) == null ? void 0 : d.value) == null ? void 0 : p.end;
|
|
699
|
+
return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (b = a[s]) == null ? void 0 : b.value : "";
|
|
700
|
+
}, [a]), u = S((m) => {
|
|
701
|
+
var d;
|
|
702
|
+
l({
|
|
703
|
+
type: k.update,
|
|
704
|
+
toUpdate: {
|
|
705
|
+
[s]: {
|
|
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
|
+
[s]: {
|
|
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__ */ g("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: s = "right", filters: r = [], icon: n } = e, [a, l] = P(!1), { onFilterApply: o, filters: c } =
|
|
756
|
-
return
|
|
757
|
-
const
|
|
758
|
-
var
|
|
759
|
-
|
|
768
|
+
const { align: s = "right", filters: r = [], icon: n } = e, [a, 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 b, C;
|
|
772
|
+
m.current && (!a || (b = m.current) != null && b.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
|
|
774
|
+
return document.addEventListener("click", d), () => document.removeEventListener("click", d);
|
|
775
|
+
}), H(() => {
|
|
776
|
+
const d = (p) => {
|
|
764
777
|
!a || 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__ */ g("div", { className: "filter-dropdown-main", children: [
|
|
781
|
+
/* @__PURE__ */ g(
|
|
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
787
|
onClick: () => l(!a),
|
|
775
788
|
"aria-expanded": a,
|
|
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
|
),
|
|
@@ -784,16 +797,16 @@ const Oe = (e) => {
|
|
|
784
797
|
"div",
|
|
785
798
|
{
|
|
786
799
|
className: `filter-dropdown-transition ${a ? "opened" : "closed"} ${s === "right" ? "right" : "left"}`,
|
|
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__ */
|
|
800
|
+
children: /* @__PURE__ */ g("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__ */ g("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,34 +825,34 @@ const Oe = (e) => {
|
|
|
812
825
|
}
|
|
813
826
|
)
|
|
814
827
|
] });
|
|
815
|
-
},
|
|
816
|
-
const { columns: s, softDeleteProperty: r = "deleted", data: n, actions: a } = e, l =
|
|
828
|
+
}, ze = (e) => e, Ee = (e) => {
|
|
829
|
+
const { columns: s, softDeleteProperty: r = "deleted", data: n, actions: a } = e, l = y(
|
|
817
830
|
() => s.sort((o, c) => (c.pos ?? 0) - (o.pos ?? 0)).filter((o) => o.display !== "none"),
|
|
818
831
|
[s]
|
|
819
832
|
);
|
|
820
833
|
return n == null ? void 0 : n.map((o) => {
|
|
821
834
|
var c;
|
|
822
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ g(
|
|
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
|
-
a ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = a(o).filter((i) => !i.hidden)) == null ? void 0 : c.map((i) => /* @__PURE__ */ t(
|
|
848
|
+
a ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = a(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
857
|
title: s = "",
|
|
845
858
|
data: r,
|
|
@@ -849,29 +862,29 @@ function je(e) {
|
|
|
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, b) => (b.pos ?? 0) - (p.pos ?? 0)).filter((p) => !!p.filterOptions).map((p) => {
|
|
869
|
+
var b;
|
|
857
870
|
return {
|
|
858
871
|
...p.filterOptions,
|
|
859
|
-
label: ((
|
|
872
|
+
label: ((b = p.filterOptions) == null ? void 0 : b.label) ?? p.label,
|
|
860
873
|
propertyName: p.key
|
|
861
874
|
};
|
|
862
|
-
}) : [], [c]),
|
|
863
|
-
return /* @__PURE__ */ t(
|
|
864
|
-
/* @__PURE__ */
|
|
875
|
+
}) : [], [c]), d = y(() => !(r != null && r.length), [r]);
|
|
876
|
+
return /* @__PURE__ */ t(be, { children: /* @__PURE__ */ g("div", { className: `${N} table-main`, children: [
|
|
877
|
+
/* @__PURE__ */ g("div", { className: "table-header", children: [
|
|
865
878
|
/* @__PURE__ */ t("h1", { className: "table-header-title", children: s }),
|
|
866
|
-
l ? null : /* @__PURE__ */
|
|
867
|
-
|
|
868
|
-
/* @__PURE__ */ t(Oe, { filters:
|
|
879
|
+
l ? null : /* @__PURE__ */ g("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__ */ g(D, { children: [
|
|
885
|
+
/* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */ g("table", { className: "table-content", children: [
|
|
873
886
|
/* @__PURE__ */ t(
|
|
874
|
-
|
|
887
|
+
ge,
|
|
875
888
|
{
|
|
876
889
|
entity: a,
|
|
877
890
|
columns: c,
|
|
@@ -880,97 +893,97 @@ function je(e) {
|
|
|
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
|
|
909
|
+
function Le(e) {
|
|
897
910
|
const { content: s, children: r } = e;
|
|
898
|
-
return /* @__PURE__ */
|
|
911
|
+
return /* @__PURE__ */ g("div", { className: "tooltip-container", children: [
|
|
899
912
|
r,
|
|
900
913
|
/* @__PURE__ */ t("div", { className: "tooltip-text", children: s })
|
|
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
919
|
label: s,
|
|
907
920
|
onDelete: r,
|
|
908
921
|
className: n = "",
|
|
909
922
|
spanClassName: a = "",
|
|
910
|
-
variant: l =
|
|
911
|
-
} = e, o =
|
|
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__ */
|
|
944
|
+
return /* @__PURE__ */ g("div", { className: `chip-main ${o} ${n}`, children: [
|
|
932
945
|
/* @__PURE__ */ t("span", { className: a, children: s }),
|
|
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
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
950
|
+
de as AutocompleteInput,
|
|
951
|
+
ie as CheckInput,
|
|
952
|
+
ae as ChevronDown,
|
|
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
|
};
|