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