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