rich-react-component 0.1.0 → 0.2.0
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/README.md +4 -2
- package/dist/base/Card.d.ts +15 -1
- package/dist/base/DataGrid.d.ts +27 -3
- package/dist/base/Flex.d.ts +20 -0
- package/dist/base/IconButton.d.ts +14 -0
- package/dist/base/ListItem.d.ts +25 -0
- package/dist/base/Sparkline.d.ts +22 -0
- package/dist/base/Statistic.d.ts +16 -0
- package/dist/base/Tabs.d.ts +20 -3
- package/dist/base/Text.d.ts +21 -0
- package/dist/base/index.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1179 -893
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
import { jsxs as p, jsx as a, Fragment as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as p, jsx as a, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as O, useState as M, useCallback as A, useId as F, useEffect as _, createContext as he, useMemo as ne, useContext as be } from "react";
|
|
3
3
|
function f(...e) {
|
|
4
4
|
return e.filter(Boolean).join(" ");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function $e({ htmlFor: e, required: n, className: t, children: r }) {
|
|
7
7
|
return /* @__PURE__ */ p("label", { htmlFor: e, className: f("form-label", t), children: [
|
|
8
8
|
r,
|
|
9
9
|
n && /* @__PURE__ */ a("span", { className: "text-danger", children: " *" })
|
|
10
10
|
] });
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function pe({ error: e, helpText: n, className: t }) {
|
|
13
13
|
return e ? /* @__PURE__ */ a("div", { className: f("invalid-feedback d-block", t), children: e }) : n ? /* @__PURE__ */ a("div", { className: f("form-text", t), children: n }) : null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */ p("div", { className: f("mb-3",
|
|
17
|
-
n && /* @__PURE__ */ a(
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */ a(
|
|
15
|
+
function B({ id: e, label: n, required: t, error: r, helpText: l, className: i, children: o }) {
|
|
16
|
+
return /* @__PURE__ */ p("div", { className: f("mb-3", i), children: [
|
|
17
|
+
n && /* @__PURE__ */ a($e, { htmlFor: e, required: t, children: n }),
|
|
18
|
+
o,
|
|
19
|
+
/* @__PURE__ */ a(pe, { error: r, helpText: l })
|
|
20
20
|
] });
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function T({
|
|
23
23
|
value: e,
|
|
24
24
|
defaultValue: n,
|
|
25
25
|
onChange: t
|
|
26
26
|
}) {
|
|
27
|
-
const r = e !== void 0, l =
|
|
27
|
+
const r = e !== void 0, l = O(r);
|
|
28
28
|
process.env.NODE_ENV !== "production" && l.current !== r && console.error(
|
|
29
29
|
"[react-components] A component switched between controlled and uncontrolled `value`. Decide between passing `value` (controlled) or `defaultValue` (uncontrolled) for the lifetime of the component, per the library's controlled/uncontrolled policy."
|
|
30
30
|
);
|
|
31
|
-
const [
|
|
31
|
+
const [i, o] = M(n), c = r ? e : i, s = A(
|
|
32
32
|
(d) => {
|
|
33
|
-
r ||
|
|
33
|
+
r || o(d), t == null || t(d);
|
|
34
34
|
},
|
|
35
35
|
[r, t]
|
|
36
36
|
);
|
|
37
|
-
return [
|
|
37
|
+
return [c, s];
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Z(e) {
|
|
40
40
|
const {
|
|
41
41
|
id: n,
|
|
42
42
|
name: t,
|
|
43
43
|
disabled: r,
|
|
44
44
|
readOnly: l,
|
|
45
|
-
required:
|
|
46
|
-
className:
|
|
47
|
-
label:
|
|
48
|
-
placeholder:
|
|
45
|
+
required: i,
|
|
46
|
+
className: o,
|
|
47
|
+
label: c,
|
|
48
|
+
placeholder: s,
|
|
49
49
|
helpText: d,
|
|
50
50
|
error: u,
|
|
51
51
|
value: h,
|
|
52
52
|
defaultValue: m,
|
|
53
|
-
onChange:
|
|
54
|
-
onBlur:
|
|
55
|
-
type:
|
|
56
|
-
maxLength:
|
|
57
|
-
autoFocus:
|
|
58
|
-
inputProps:
|
|
59
|
-
endAdornment:
|
|
60
|
-
} = e, [
|
|
53
|
+
onChange: v,
|
|
54
|
+
onBlur: g,
|
|
55
|
+
type: w = "text",
|
|
56
|
+
maxLength: k,
|
|
57
|
+
autoFocus: y,
|
|
58
|
+
inputProps: S,
|
|
59
|
+
endAdornment: x
|
|
60
|
+
} = e, [I, b] = T({
|
|
61
61
|
value: h,
|
|
62
62
|
defaultValue: m ?? "",
|
|
63
|
-
onChange:
|
|
64
|
-
}),
|
|
63
|
+
onChange: v
|
|
64
|
+
}), N = F(), C = n ?? N, D = /* @__PURE__ */ a(
|
|
65
65
|
"input",
|
|
66
66
|
{
|
|
67
|
-
id:
|
|
67
|
+
id: C,
|
|
68
68
|
name: t,
|
|
69
69
|
className: f("form-control", u && "is-invalid"),
|
|
70
70
|
disabled: r,
|
|
71
71
|
readOnly: l,
|
|
72
|
-
required:
|
|
73
|
-
placeholder:
|
|
74
|
-
maxLength:
|
|
75
|
-
autoFocus:
|
|
76
|
-
value:
|
|
77
|
-
onChange: (
|
|
78
|
-
onBlur:
|
|
79
|
-
type:
|
|
80
|
-
...
|
|
72
|
+
required: i,
|
|
73
|
+
placeholder: s,
|
|
74
|
+
maxLength: k,
|
|
75
|
+
autoFocus: y,
|
|
76
|
+
value: I,
|
|
77
|
+
onChange: ($) => b($.target.value),
|
|
78
|
+
onBlur: g,
|
|
79
|
+
type: w,
|
|
80
|
+
...S
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
return /* @__PURE__ */ a(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
] }) :
|
|
83
|
+
return /* @__PURE__ */ a(B, { id: C, label: c, required: i, error: u, helpText: d, className: o, children: x ? /* @__PURE__ */ p("div", { className: "input-group", children: [
|
|
84
|
+
D,
|
|
85
|
+
x
|
|
86
|
+
] }) : D });
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Kn(e) {
|
|
89
89
|
const {
|
|
90
90
|
id: n,
|
|
91
91
|
name: t,
|
|
92
92
|
disabled: r,
|
|
93
93
|
readOnly: l,
|
|
94
|
-
required:
|
|
95
|
-
className:
|
|
96
|
-
label:
|
|
97
|
-
placeholder:
|
|
94
|
+
required: i,
|
|
95
|
+
className: o,
|
|
96
|
+
label: c,
|
|
97
|
+
placeholder: s,
|
|
98
98
|
helpText: d,
|
|
99
99
|
error: u,
|
|
100
100
|
value: h,
|
|
101
101
|
defaultValue: m,
|
|
102
|
-
onChange:
|
|
103
|
-
onBlur:
|
|
104
|
-
rows:
|
|
105
|
-
maxLength:
|
|
106
|
-
} = e, [
|
|
102
|
+
onChange: v,
|
|
103
|
+
onBlur: g,
|
|
104
|
+
rows: w = 3,
|
|
105
|
+
maxLength: k
|
|
106
|
+
} = e, [y, S] = T({
|
|
107
107
|
value: h,
|
|
108
108
|
defaultValue: m ?? "",
|
|
109
|
-
onChange:
|
|
110
|
-
}),
|
|
111
|
-
return /* @__PURE__ */ a(
|
|
109
|
+
onChange: v
|
|
110
|
+
}), x = F(), I = n ?? x;
|
|
111
|
+
return /* @__PURE__ */ a(B, { id: I, label: c, required: i, error: u, helpText: d, className: o, children: /* @__PURE__ */ a(
|
|
112
112
|
"textarea",
|
|
113
113
|
{
|
|
114
|
-
id:
|
|
114
|
+
id: I,
|
|
115
115
|
name: t,
|
|
116
116
|
className: f("form-control", u && "is-invalid"),
|
|
117
117
|
disabled: r,
|
|
118
118
|
readOnly: l,
|
|
119
|
-
required:
|
|
120
|
-
placeholder:
|
|
121
|
-
rows:
|
|
122
|
-
maxLength:
|
|
123
|
-
value:
|
|
124
|
-
onChange: (
|
|
125
|
-
onBlur:
|
|
119
|
+
required: i,
|
|
120
|
+
placeholder: s,
|
|
121
|
+
rows: w,
|
|
122
|
+
maxLength: k,
|
|
123
|
+
value: y,
|
|
124
|
+
onChange: (b) => S(b.target.value),
|
|
125
|
+
onBlur: g
|
|
126
126
|
}
|
|
127
127
|
) });
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
const [
|
|
129
|
+
function Bn({ value: e, defaultValue: n, onChange: t, min: r, max: l, step: i, ...o }) {
|
|
130
|
+
const [c, s] = T({
|
|
131
131
|
value: e,
|
|
132
132
|
defaultValue: n ?? null,
|
|
133
133
|
onChange: t
|
|
134
134
|
});
|
|
135
135
|
return /* @__PURE__ */ a(
|
|
136
|
-
|
|
136
|
+
Z,
|
|
137
137
|
{
|
|
138
|
-
...
|
|
139
|
-
value:
|
|
138
|
+
...o,
|
|
139
|
+
value: c === null ? "" : String(c),
|
|
140
140
|
onChange: (d) => {
|
|
141
141
|
if (d.trim() === "") {
|
|
142
|
-
|
|
142
|
+
s(null);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
const u = Number(d);
|
|
146
|
-
Number.isNaN(u) ||
|
|
146
|
+
Number.isNaN(u) || s(u);
|
|
147
147
|
},
|
|
148
|
-
inputProps: { inputMode: "decimal", min: r, max: l, step:
|
|
148
|
+
inputProps: { inputMode: "decimal", min: r, max: l, step: i }
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const [n, t] =
|
|
152
|
+
function jn(e) {
|
|
153
|
+
const [n, t] = M(!1);
|
|
154
154
|
return /* @__PURE__ */ a(
|
|
155
|
-
|
|
155
|
+
Z,
|
|
156
156
|
{
|
|
157
157
|
...e,
|
|
158
158
|
inputProps: { type: n ? "text" : "password", autoComplete: "current-password" },
|
|
@@ -170,65 +170,65 @@ function pn(e) {
|
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
const h =
|
|
175
|
-
return /* @__PURE__ */ a(
|
|
173
|
+
function Hn({ id: e, name: n, disabled: t, required: r, className: l, label: i, helpText: o, error: c, accept: s, multiple: d, onChange: u }) {
|
|
174
|
+
const h = F(), m = e ?? h;
|
|
175
|
+
return /* @__PURE__ */ a(B, { id: m, label: i, required: r, error: c, helpText: o, className: l, children: /* @__PURE__ */ a(
|
|
176
176
|
"input",
|
|
177
177
|
{
|
|
178
178
|
id: m,
|
|
179
179
|
name: n,
|
|
180
180
|
type: "file",
|
|
181
|
-
className: f("form-control",
|
|
181
|
+
className: f("form-control", c && "is-invalid"),
|
|
182
182
|
disabled: t,
|
|
183
183
|
required: r,
|
|
184
|
-
accept:
|
|
184
|
+
accept: s,
|
|
185
185
|
multiple: d,
|
|
186
|
-
onChange: (
|
|
186
|
+
onChange: (v) => u == null ? void 0 : u(v.target.files)
|
|
187
187
|
}
|
|
188
188
|
) });
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function ve({
|
|
191
191
|
id: e,
|
|
192
192
|
name: n,
|
|
193
193
|
disabled: t,
|
|
194
194
|
required: r,
|
|
195
195
|
wrapperClassName: l,
|
|
196
|
-
role:
|
|
197
|
-
label:
|
|
198
|
-
helpText:
|
|
199
|
-
error:
|
|
196
|
+
role: i,
|
|
197
|
+
label: o,
|
|
198
|
+
helpText: c,
|
|
199
|
+
error: s,
|
|
200
200
|
checked: d,
|
|
201
201
|
onChange: u,
|
|
202
202
|
className: h
|
|
203
203
|
}) {
|
|
204
|
-
const m =
|
|
204
|
+
const m = F(), v = e ?? m;
|
|
205
205
|
return /* @__PURE__ */ p("div", { className: f(l, h), children: [
|
|
206
206
|
/* @__PURE__ */ a(
|
|
207
207
|
"input",
|
|
208
208
|
{
|
|
209
|
-
id:
|
|
209
|
+
id: v,
|
|
210
210
|
name: n,
|
|
211
211
|
type: "checkbox",
|
|
212
|
-
role:
|
|
213
|
-
className: f("form-check-input",
|
|
212
|
+
role: i,
|
|
213
|
+
className: f("form-check-input", s && "is-invalid"),
|
|
214
214
|
disabled: t,
|
|
215
215
|
required: r,
|
|
216
216
|
checked: d,
|
|
217
|
-
onChange: (
|
|
217
|
+
onChange: (g) => u(g.target.checked)
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
|
|
221
|
-
/* @__PURE__ */ a(
|
|
220
|
+
o && /* @__PURE__ */ a("label", { htmlFor: v, className: "form-check-label", children: o }),
|
|
221
|
+
/* @__PURE__ */ a(pe, { error: s, helpText: c })
|
|
222
222
|
] });
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const [n, t] =
|
|
224
|
+
function _n(e) {
|
|
225
|
+
const [n, t] = T({
|
|
226
226
|
value: e.checked,
|
|
227
227
|
defaultValue: e.defaultChecked ?? !1,
|
|
228
228
|
onChange: e.onChange
|
|
229
229
|
});
|
|
230
230
|
return /* @__PURE__ */ a(
|
|
231
|
-
|
|
231
|
+
ve,
|
|
232
232
|
{
|
|
233
233
|
id: e.id,
|
|
234
234
|
name: e.name,
|
|
@@ -244,14 +244,14 @@ function yn(e) {
|
|
|
244
244
|
}
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const [n, t] =
|
|
247
|
+
function Un(e) {
|
|
248
|
+
const [n, t] = T({
|
|
249
249
|
value: e.checked,
|
|
250
250
|
defaultValue: e.defaultChecked ?? !1,
|
|
251
251
|
onChange: e.onChange
|
|
252
252
|
});
|
|
253
253
|
return /* @__PURE__ */ a(
|
|
254
|
-
|
|
254
|
+
ve,
|
|
255
255
|
{
|
|
256
256
|
id: e.id,
|
|
257
257
|
name: e.name,
|
|
@@ -268,18 +268,18 @@ function Nn(e) {
|
|
|
268
268
|
}
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Te({
|
|
272
272
|
id: e,
|
|
273
273
|
name: n,
|
|
274
274
|
value: t,
|
|
275
275
|
label: r,
|
|
276
276
|
checked: l,
|
|
277
|
-
disabled:
|
|
278
|
-
className:
|
|
279
|
-
onChange:
|
|
277
|
+
disabled: i,
|
|
278
|
+
className: o,
|
|
279
|
+
onChange: c
|
|
280
280
|
}) {
|
|
281
|
-
const
|
|
282
|
-
return /* @__PURE__ */ p("div", { className: f("form-check",
|
|
281
|
+
const s = F(), d = e ?? s;
|
|
282
|
+
return /* @__PURE__ */ p("div", { className: f("form-check", o), children: [
|
|
283
283
|
/* @__PURE__ */ a(
|
|
284
284
|
"input",
|
|
285
285
|
{
|
|
@@ -289,98 +289,98 @@ function Se({
|
|
|
289
289
|
className: "form-check-input",
|
|
290
290
|
value: String(t),
|
|
291
291
|
checked: l,
|
|
292
|
-
disabled:
|
|
293
|
-
onChange: () =>
|
|
292
|
+
disabled: i,
|
|
293
|
+
onChange: () => c == null ? void 0 : c(t)
|
|
294
294
|
}
|
|
295
295
|
),
|
|
296
296
|
r && /* @__PURE__ */ a("label", { htmlFor: d, className: "form-check-label", children: r })
|
|
297
297
|
] });
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function qn({
|
|
300
300
|
options: e,
|
|
301
301
|
value: n,
|
|
302
302
|
defaultValue: t,
|
|
303
303
|
onChange: r,
|
|
304
304
|
inline: l,
|
|
305
|
-
id:
|
|
306
|
-
name:
|
|
307
|
-
disabled:
|
|
308
|
-
required:
|
|
305
|
+
id: i,
|
|
306
|
+
name: o,
|
|
307
|
+
disabled: c,
|
|
308
|
+
required: s,
|
|
309
309
|
className: d,
|
|
310
310
|
label: u,
|
|
311
311
|
helpText: h,
|
|
312
312
|
error: m
|
|
313
313
|
}) {
|
|
314
|
-
const [
|
|
314
|
+
const [v, g] = T({
|
|
315
315
|
value: n,
|
|
316
316
|
defaultValue: t ?? null,
|
|
317
|
-
onChange: (
|
|
318
|
-
|
|
317
|
+
onChange: (y) => {
|
|
318
|
+
y !== null && (r == null || r(y));
|
|
319
319
|
}
|
|
320
|
-
}),
|
|
321
|
-
return /* @__PURE__ */ a(
|
|
322
|
-
|
|
320
|
+
}), w = F(), k = o ?? i ?? w;
|
|
321
|
+
return /* @__PURE__ */ a(B, { label: u, required: s, error: m, helpText: h, className: d, children: /* @__PURE__ */ a("div", { role: "radiogroup", "aria-label": u, "aria-required": s, className: f(l && "d-flex gap-3"), children: e.map((y) => /* @__PURE__ */ a(
|
|
322
|
+
Te,
|
|
323
323
|
{
|
|
324
|
-
name:
|
|
325
|
-
value:
|
|
326
|
-
label:
|
|
327
|
-
checked:
|
|
328
|
-
disabled:
|
|
329
|
-
onChange: (
|
|
324
|
+
name: k,
|
|
325
|
+
value: y.value,
|
|
326
|
+
label: y.label,
|
|
327
|
+
checked: y.value === v,
|
|
328
|
+
disabled: c || y.disabled,
|
|
329
|
+
onChange: (S) => g(S)
|
|
330
330
|
},
|
|
331
|
-
String(
|
|
331
|
+
String(y.value)
|
|
332
332
|
)) }) });
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Ee({
|
|
335
335
|
options: e,
|
|
336
336
|
value: n,
|
|
337
337
|
defaultValue: t,
|
|
338
338
|
onChange: r,
|
|
339
339
|
placeholder: l,
|
|
340
|
-
loading:
|
|
341
|
-
id:
|
|
342
|
-
name:
|
|
343
|
-
disabled:
|
|
340
|
+
loading: i,
|
|
341
|
+
id: o,
|
|
342
|
+
name: c,
|
|
343
|
+
disabled: s,
|
|
344
344
|
readOnly: d,
|
|
345
345
|
required: u,
|
|
346
346
|
className: h,
|
|
347
347
|
label: m,
|
|
348
|
-
helpText:
|
|
349
|
-
error:
|
|
348
|
+
helpText: v,
|
|
349
|
+
error: g
|
|
350
350
|
}) {
|
|
351
|
-
const [
|
|
351
|
+
const [w, k] = T({
|
|
352
352
|
value: n,
|
|
353
353
|
defaultValue: t ?? null,
|
|
354
354
|
onChange: r
|
|
355
|
-
}),
|
|
356
|
-
return /* @__PURE__ */ a(
|
|
355
|
+
}), y = F(), S = o ?? y;
|
|
356
|
+
return /* @__PURE__ */ a(B, { id: S, label: m, required: u, error: g, helpText: v, className: h, children: /* @__PURE__ */ p(
|
|
357
357
|
"select",
|
|
358
358
|
{
|
|
359
|
-
id:
|
|
360
|
-
name:
|
|
361
|
-
className: f("form-select",
|
|
362
|
-
disabled:
|
|
359
|
+
id: S,
|
|
360
|
+
name: c,
|
|
361
|
+
className: f("form-select", g && "is-invalid"),
|
|
362
|
+
disabled: s || d || i,
|
|
363
363
|
required: u,
|
|
364
|
-
value:
|
|
365
|
-
onChange: (
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
|
|
364
|
+
value: w === null ? "" : String(w),
|
|
365
|
+
onChange: (x) => {
|
|
366
|
+
const I = x.target.value;
|
|
367
|
+
if (I === "") {
|
|
368
|
+
k(null);
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
|
-
const
|
|
372
|
-
|
|
371
|
+
const b = e.find((N) => String(N.value) === I);
|
|
372
|
+
k(b ? b.value : null);
|
|
373
373
|
},
|
|
374
374
|
children: [
|
|
375
|
-
|
|
376
|
-
!
|
|
377
|
-
e.map((
|
|
375
|
+
i && /* @__PURE__ */ a("option", { value: "", children: "Loading…" }),
|
|
376
|
+
!i && l && /* @__PURE__ */ a("option", { value: "", children: l }),
|
|
377
|
+
e.map((x) => /* @__PURE__ */ a("option", { value: String(x.value), disabled: x.disabled, children: x.label }, String(x.value)))
|
|
378
378
|
]
|
|
379
379
|
}
|
|
380
380
|
) });
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
|
|
382
|
+
function ie(e, n) {
|
|
383
|
+
_(() => {
|
|
384
384
|
if (!e)
|
|
385
385
|
return;
|
|
386
386
|
function t(r) {
|
|
@@ -389,413 +389,413 @@ function le(e, n) {
|
|
|
389
389
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
390
390
|
}, [e, n]);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
const
|
|
394
|
-
return
|
|
392
|
+
function W({ open: e, onClose: n, anchorRef: t, className: r, role: l, children: i }) {
|
|
393
|
+
const o = O(null);
|
|
394
|
+
return ie(e, n), _(() => {
|
|
395
395
|
if (!e)
|
|
396
396
|
return;
|
|
397
|
-
function
|
|
397
|
+
function c(s) {
|
|
398
398
|
var u, h;
|
|
399
|
-
const d =
|
|
400
|
-
(u =
|
|
399
|
+
const d = s.target;
|
|
400
|
+
(u = o.current) != null && u.contains(d) || (h = t.current) != null && h.contains(d) || n();
|
|
401
401
|
}
|
|
402
|
-
return document.addEventListener("mousedown",
|
|
403
|
-
}, [e, n, t]), e ? /* @__PURE__ */ a("div", { ref:
|
|
402
|
+
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
403
|
+
}, [e, n, t]), e ? /* @__PURE__ */ a("div", { ref: o, className: f("show", r), role: l, children: i }) : null;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function re({
|
|
406
406
|
itemCount: e,
|
|
407
407
|
isOpen: n,
|
|
408
408
|
onSelect: t,
|
|
409
409
|
onClose: r
|
|
410
410
|
}) {
|
|
411
|
-
const [l,
|
|
412
|
-
|
|
413
|
-
n ||
|
|
414
|
-
}, [n]),
|
|
415
|
-
const
|
|
416
|
-
(
|
|
411
|
+
const [l, i] = M(-1);
|
|
412
|
+
_(() => {
|
|
413
|
+
n || i(-1);
|
|
414
|
+
}, [n]), ie(n, r);
|
|
415
|
+
const o = A(
|
|
416
|
+
(c) => {
|
|
417
417
|
if (!n) {
|
|
418
|
-
(
|
|
418
|
+
(c.key === "ArrowDown" || c.key === "Enter") && c.preventDefault();
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
switch (
|
|
421
|
+
switch (c.key) {
|
|
422
422
|
case "ArrowDown":
|
|
423
|
-
|
|
423
|
+
c.preventDefault(), i((s) => e === 0 ? -1 : (s + 1) % e);
|
|
424
424
|
break;
|
|
425
425
|
case "ArrowUp":
|
|
426
|
-
|
|
426
|
+
c.preventDefault(), i((s) => e === 0 ? -1 : (s - 1 + e) % e);
|
|
427
427
|
break;
|
|
428
428
|
case "Home":
|
|
429
|
-
|
|
429
|
+
c.preventDefault(), i(e === 0 ? -1 : 0);
|
|
430
430
|
break;
|
|
431
431
|
case "End":
|
|
432
|
-
|
|
432
|
+
c.preventDefault(), i(e === 0 ? -1 : e - 1);
|
|
433
433
|
break;
|
|
434
434
|
case "Enter":
|
|
435
|
-
l >= 0 && (
|
|
435
|
+
l >= 0 && (c.preventDefault(), t(l));
|
|
436
436
|
break;
|
|
437
437
|
}
|
|
438
438
|
},
|
|
439
439
|
[n, e, l, t]
|
|
440
440
|
);
|
|
441
|
-
return { activeIndex: l, setActiveIndex:
|
|
441
|
+
return { activeIndex: l, setActiveIndex: i, handleKeyDown: o };
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Me({
|
|
444
444
|
options: e,
|
|
445
445
|
values: n,
|
|
446
446
|
defaultValues: t,
|
|
447
447
|
onChange: r,
|
|
448
448
|
loading: l,
|
|
449
|
-
emptyText:
|
|
450
|
-
id:
|
|
451
|
-
name:
|
|
452
|
-
disabled:
|
|
449
|
+
emptyText: i = "No options",
|
|
450
|
+
id: o,
|
|
451
|
+
name: c,
|
|
452
|
+
disabled: s,
|
|
453
453
|
readOnly: d,
|
|
454
454
|
required: u,
|
|
455
455
|
className: h,
|
|
456
456
|
label: m,
|
|
457
|
-
placeholder:
|
|
458
|
-
helpText:
|
|
459
|
-
error:
|
|
457
|
+
placeholder: v = "Select...",
|
|
458
|
+
helpText: g,
|
|
459
|
+
error: w
|
|
460
460
|
}) {
|
|
461
|
-
const [
|
|
461
|
+
const [k, y] = T({
|
|
462
462
|
value: n,
|
|
463
463
|
defaultValue: t ?? [],
|
|
464
464
|
onChange: r
|
|
465
|
-
}), [
|
|
466
|
-
(
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
465
|
+
}), [S, x] = M(!1), I = O(null), b = F(), N = o ?? b, C = new Set(k), D = A(() => x(!1), []), $ = A(
|
|
466
|
+
(V) => {
|
|
467
|
+
const K = e[V];
|
|
468
|
+
if (!K || K.disabled)
|
|
469
469
|
return;
|
|
470
|
-
const J =
|
|
471
|
-
|
|
470
|
+
const J = C.has(K.value) ? k.filter((ae) => ae !== K.value) : [...k, K.value];
|
|
471
|
+
y(J);
|
|
472
472
|
},
|
|
473
|
-
[e,
|
|
474
|
-
), { activeIndex:
|
|
473
|
+
[e, k, C, y]
|
|
474
|
+
), { activeIndex: E, setActiveIndex: U, handleKeyDown: G } = re({
|
|
475
475
|
itemCount: e.length,
|
|
476
|
-
isOpen:
|
|
477
|
-
onSelect:
|
|
478
|
-
onClose:
|
|
479
|
-
}),
|
|
480
|
-
return /* @__PURE__ */ a(
|
|
476
|
+
isOpen: S,
|
|
477
|
+
onSelect: $,
|
|
478
|
+
onClose: D
|
|
479
|
+
}), R = e.filter((V) => C.has(V.value)).map((V) => V.label).join(", ");
|
|
480
|
+
return /* @__PURE__ */ a(B, { id: N, label: m, required: u, error: w, helpText: g, className: h, children: /* @__PURE__ */ p("div", { className: "position-relative", children: [
|
|
481
481
|
/* @__PURE__ */ a(
|
|
482
482
|
"button",
|
|
483
483
|
{
|
|
484
|
-
ref:
|
|
485
|
-
id:
|
|
484
|
+
ref: I,
|
|
485
|
+
id: N,
|
|
486
486
|
type: "button",
|
|
487
|
-
name:
|
|
488
|
-
className: f("form-select text-start",
|
|
489
|
-
disabled:
|
|
487
|
+
name: c,
|
|
488
|
+
className: f("form-select text-start", w && "is-invalid"),
|
|
489
|
+
disabled: s || d,
|
|
490
490
|
"aria-haspopup": "listbox",
|
|
491
|
-
"aria-expanded":
|
|
492
|
-
onClick: () =>
|
|
493
|
-
onKeyDown:
|
|
494
|
-
children:
|
|
491
|
+
"aria-expanded": S,
|
|
492
|
+
onClick: () => x((V) => !V),
|
|
493
|
+
onKeyDown: G,
|
|
494
|
+
children: R || /* @__PURE__ */ a("span", { className: "text-body-secondary", children: v })
|
|
495
495
|
}
|
|
496
496
|
),
|
|
497
|
-
/* @__PURE__ */ a(
|
|
497
|
+
/* @__PURE__ */ a(W, { open: S, onClose: D, anchorRef: I, className: "dropdown-menu w-100", role: "listbox", children: l ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: i }) : e.map((V, K) => /* @__PURE__ */ p(
|
|
498
498
|
"div",
|
|
499
499
|
{
|
|
500
500
|
role: "option",
|
|
501
|
-
"aria-selected":
|
|
501
|
+
"aria-selected": C.has(V.value),
|
|
502
502
|
className: f(
|
|
503
503
|
"dropdown-item d-flex align-items-center gap-2",
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
K === E && "active",
|
|
505
|
+
V.disabled && "disabled"
|
|
506
506
|
),
|
|
507
|
-
onMouseEnter: () =>
|
|
507
|
+
onMouseEnter: () => U(K),
|
|
508
508
|
onMouseDown: (J) => {
|
|
509
|
-
J.preventDefault(),
|
|
509
|
+
J.preventDefault(), V.disabled || $(K);
|
|
510
510
|
},
|
|
511
511
|
children: [
|
|
512
|
-
/* @__PURE__ */ a("input", { type: "checkbox", className: "form-check-input m-0", checked:
|
|
513
|
-
|
|
512
|
+
/* @__PURE__ */ a("input", { type: "checkbox", className: "form-check-input m-0", checked: C.has(V.value), readOnly: !0, tabIndex: -1 }),
|
|
513
|
+
V.label
|
|
514
514
|
]
|
|
515
515
|
},
|
|
516
|
-
String(
|
|
516
|
+
String(V.value)
|
|
517
517
|
)) })
|
|
518
518
|
] }) });
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function z(e) {
|
|
521
521
|
if (!e)
|
|
522
522
|
return "";
|
|
523
523
|
const n = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
524
524
|
return `${n}-${t}-${r}`;
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function ge(e) {
|
|
527
527
|
if (!e)
|
|
528
528
|
return null;
|
|
529
529
|
const n = e.split("-").map(Number), [t, r, l] = n;
|
|
530
530
|
return !t || !r || !l ? null : new Date(t, r - 1, l);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
const [
|
|
532
|
+
function Oe({ value: e, defaultValue: n, onChange: t, min: r, max: l, ...i }) {
|
|
533
|
+
const [o, c] = T({
|
|
534
534
|
value: e,
|
|
535
535
|
defaultValue: n ?? null,
|
|
536
536
|
onChange: t
|
|
537
537
|
});
|
|
538
538
|
return /* @__PURE__ */ a(
|
|
539
|
-
|
|
539
|
+
Z,
|
|
540
540
|
{
|
|
541
|
-
...
|
|
542
|
-
value:
|
|
543
|
-
onChange: (
|
|
541
|
+
...i,
|
|
542
|
+
value: z(o),
|
|
543
|
+
onChange: (s) => c(ge(s)),
|
|
544
544
|
inputProps: {
|
|
545
545
|
type: "date",
|
|
546
|
-
min: r ?
|
|
547
|
-
max: l ?
|
|
546
|
+
min: r ? z(r) : void 0,
|
|
547
|
+
max: l ? z(l) : void 0
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function ye(e) {
|
|
553
553
|
if (!e)
|
|
554
554
|
return "";
|
|
555
555
|
const n = String(e.getHours()).padStart(2, "0"), t = String(e.getMinutes()).padStart(2, "0");
|
|
556
556
|
return `${n}:${t}`;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function Ne(e) {
|
|
559
559
|
if (!e)
|
|
560
560
|
return null;
|
|
561
561
|
const [n, t] = e.split(":").map(Number);
|
|
562
562
|
return n === void 0 || t === void 0 || Number.isNaN(n) || Number.isNaN(t) ? null : new Date(1970, 0, 1, n, t, 0, 0);
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
const [
|
|
564
|
+
function zn({ value: e, defaultValue: n, onChange: t, step: r, ...l }) {
|
|
565
|
+
const [i, o] = T({
|
|
566
566
|
value: e,
|
|
567
567
|
defaultValue: n ?? null,
|
|
568
568
|
onChange: t
|
|
569
569
|
});
|
|
570
570
|
return /* @__PURE__ */ a(
|
|
571
|
-
|
|
571
|
+
Z,
|
|
572
572
|
{
|
|
573
573
|
...l,
|
|
574
|
-
value:
|
|
575
|
-
onChange: (
|
|
574
|
+
value: ye(i),
|
|
575
|
+
onChange: (c) => o(Ne(c)),
|
|
576
576
|
inputProps: { type: "time", step: r }
|
|
577
577
|
}
|
|
578
578
|
);
|
|
579
579
|
}
|
|
580
|
-
function
|
|
581
|
-
const t =
|
|
580
|
+
function oe(e, n) {
|
|
581
|
+
const t = ge(e);
|
|
582
582
|
if (!t)
|
|
583
583
|
return null;
|
|
584
|
-
const r =
|
|
584
|
+
const r = Ne(n || "00:00");
|
|
585
585
|
return r && t.setHours(r.getHours(), r.getMinutes(), 0, 0), t;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Gn({
|
|
588
588
|
value: e,
|
|
589
589
|
defaultValue: n,
|
|
590
590
|
onChange: t,
|
|
591
591
|
min: r,
|
|
592
592
|
max: l,
|
|
593
|
-
id:
|
|
594
|
-
name:
|
|
595
|
-
disabled:
|
|
596
|
-
readOnly:
|
|
593
|
+
id: i,
|
|
594
|
+
name: o,
|
|
595
|
+
disabled: c,
|
|
596
|
+
readOnly: s,
|
|
597
597
|
required: d,
|
|
598
598
|
className: u,
|
|
599
599
|
label: h,
|
|
600
600
|
helpText: m,
|
|
601
|
-
error:
|
|
601
|
+
error: v
|
|
602
602
|
}) {
|
|
603
|
-
const [
|
|
603
|
+
const [g, w] = T({
|
|
604
604
|
value: e,
|
|
605
605
|
defaultValue: n ?? null,
|
|
606
606
|
onChange: t
|
|
607
|
-
}),
|
|
608
|
-
return /* @__PURE__ */ a(
|
|
607
|
+
}), k = F(), y = i ?? k, S = z(g), x = ye(g);
|
|
608
|
+
return /* @__PURE__ */ a(B, { id: y, label: h, required: d, error: v, helpText: m, className: u, children: /* @__PURE__ */ p("div", { className: "d-flex gap-2", children: [
|
|
609
609
|
/* @__PURE__ */ a(
|
|
610
610
|
"input",
|
|
611
611
|
{
|
|
612
|
-
id:
|
|
613
|
-
name:
|
|
612
|
+
id: y,
|
|
613
|
+
name: o ? `${o}-date` : void 0,
|
|
614
614
|
type: "date",
|
|
615
|
-
className: f("form-control",
|
|
616
|
-
disabled:
|
|
617
|
-
readOnly:
|
|
615
|
+
className: f("form-control", v && "is-invalid"),
|
|
616
|
+
disabled: c,
|
|
617
|
+
readOnly: s,
|
|
618
618
|
required: d,
|
|
619
|
-
min: r ?
|
|
620
|
-
max: l ?
|
|
621
|
-
value:
|
|
622
|
-
onChange: (
|
|
619
|
+
min: r ? z(r) : void 0,
|
|
620
|
+
max: l ? z(l) : void 0,
|
|
621
|
+
value: S,
|
|
622
|
+
onChange: (I) => w(oe(I.target.value, x))
|
|
623
623
|
}
|
|
624
624
|
),
|
|
625
625
|
/* @__PURE__ */ a(
|
|
626
626
|
"input",
|
|
627
627
|
{
|
|
628
|
-
name:
|
|
628
|
+
name: o ? `${o}-time` : void 0,
|
|
629
629
|
type: "time",
|
|
630
|
-
className: f("form-control",
|
|
631
|
-
disabled:
|
|
632
|
-
readOnly:
|
|
630
|
+
className: f("form-control", v && "is-invalid"),
|
|
631
|
+
disabled: c,
|
|
632
|
+
readOnly: s,
|
|
633
633
|
required: d,
|
|
634
|
-
value:
|
|
635
|
-
onChange: (
|
|
634
|
+
value: x,
|
|
635
|
+
onChange: (I) => w(oe(S || z(/* @__PURE__ */ new Date()), I.target.value))
|
|
636
636
|
}
|
|
637
637
|
)
|
|
638
638
|
] }) });
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Re({
|
|
641
641
|
options: e,
|
|
642
642
|
value: n,
|
|
643
643
|
defaultValue: t,
|
|
644
644
|
onChange: r,
|
|
645
645
|
loading: l,
|
|
646
|
-
emptyText:
|
|
647
|
-
id:
|
|
648
|
-
name:
|
|
649
|
-
disabled:
|
|
646
|
+
emptyText: i = "No options",
|
|
647
|
+
id: o,
|
|
648
|
+
name: c,
|
|
649
|
+
disabled: s,
|
|
650
650
|
readOnly: d,
|
|
651
651
|
required: u,
|
|
652
652
|
className: h,
|
|
653
653
|
label: m,
|
|
654
|
-
placeholder:
|
|
655
|
-
helpText:
|
|
656
|
-
error:
|
|
654
|
+
placeholder: v = "Select...",
|
|
655
|
+
helpText: g,
|
|
656
|
+
error: w
|
|
657
657
|
}) {
|
|
658
|
-
const [
|
|
658
|
+
const [k, y] = T({
|
|
659
659
|
value: n,
|
|
660
660
|
defaultValue: t ?? null,
|
|
661
661
|
onChange: r
|
|
662
|
-
}), [
|
|
663
|
-
(
|
|
664
|
-
const
|
|
665
|
-
!
|
|
662
|
+
}), [S, x] = M(!1), I = O(null), b = F(), N = o ?? b, C = e.find((L) => L.value === k) ?? null, D = A(() => x(!1), []), $ = A(
|
|
663
|
+
(L) => {
|
|
664
|
+
const R = e[L];
|
|
665
|
+
!R || R.disabled || (y(R.value), D());
|
|
666
666
|
},
|
|
667
|
-
[e,
|
|
668
|
-
), { activeIndex:
|
|
667
|
+
[e, y, D]
|
|
668
|
+
), { activeIndex: E, setActiveIndex: U, handleKeyDown: G } = re({
|
|
669
669
|
itemCount: e.length,
|
|
670
|
-
isOpen:
|
|
671
|
-
onSelect:
|
|
672
|
-
onClose:
|
|
670
|
+
isOpen: S,
|
|
671
|
+
onSelect: $,
|
|
672
|
+
onClose: D
|
|
673
673
|
});
|
|
674
|
-
return /* @__PURE__ */ a(
|
|
674
|
+
return /* @__PURE__ */ a(B, { id: N, label: m, required: u, error: w, helpText: g, className: h, children: /* @__PURE__ */ p("div", { className: "position-relative", children: [
|
|
675
675
|
/* @__PURE__ */ a(
|
|
676
676
|
"button",
|
|
677
677
|
{
|
|
678
|
-
ref:
|
|
679
|
-
id:
|
|
678
|
+
ref: I,
|
|
679
|
+
id: N,
|
|
680
680
|
type: "button",
|
|
681
|
-
name:
|
|
682
|
-
className: f("form-select text-start",
|
|
683
|
-
disabled:
|
|
681
|
+
name: c,
|
|
682
|
+
className: f("form-select text-start", w && "is-invalid"),
|
|
683
|
+
disabled: s || d,
|
|
684
684
|
"aria-haspopup": "listbox",
|
|
685
|
-
"aria-expanded":
|
|
686
|
-
onClick: () =>
|
|
687
|
-
onKeyDown:
|
|
688
|
-
children:
|
|
685
|
+
"aria-expanded": S,
|
|
686
|
+
onClick: () => x((L) => !L),
|
|
687
|
+
onKeyDown: G,
|
|
688
|
+
children: C ? C.label : /* @__PURE__ */ a("span", { className: "text-body-secondary", children: v })
|
|
689
689
|
}
|
|
690
690
|
),
|
|
691
|
-
/* @__PURE__ */ a(
|
|
691
|
+
/* @__PURE__ */ a(W, { open: S, onClose: D, anchorRef: I, className: "dropdown-menu w-100", role: "listbox", children: l ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: i }) : e.map((L, R) => /* @__PURE__ */ a(
|
|
692
692
|
"div",
|
|
693
693
|
{
|
|
694
694
|
role: "option",
|
|
695
|
-
"aria-selected":
|
|
696
|
-
className: f("dropdown-item",
|
|
697
|
-
onMouseEnter: () =>
|
|
698
|
-
onMouseDown: (
|
|
699
|
-
|
|
695
|
+
"aria-selected": L.value === k,
|
|
696
|
+
className: f("dropdown-item", R === E && "active", L.disabled && "disabled"),
|
|
697
|
+
onMouseEnter: () => U(R),
|
|
698
|
+
onMouseDown: (V) => {
|
|
699
|
+
V.preventDefault(), L.disabled || $(R);
|
|
700
700
|
},
|
|
701
|
-
children:
|
|
701
|
+
children: L.label
|
|
702
702
|
},
|
|
703
|
-
String(
|
|
703
|
+
String(L.value)
|
|
704
704
|
)) })
|
|
705
705
|
] }) });
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function Ae(e, n) {
|
|
708
708
|
return n ? e.label.toLowerCase().includes(n.toLowerCase()) : !0;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Le({
|
|
711
711
|
options: e,
|
|
712
712
|
value: n,
|
|
713
713
|
defaultValue: t,
|
|
714
714
|
onChange: r,
|
|
715
715
|
inputValue: l,
|
|
716
|
-
onInputValueChange:
|
|
717
|
-
loading:
|
|
718
|
-
emptyText:
|
|
719
|
-
filter:
|
|
716
|
+
onInputValueChange: i,
|
|
717
|
+
loading: o,
|
|
718
|
+
emptyText: c = "No results",
|
|
719
|
+
filter: s,
|
|
720
720
|
id: d,
|
|
721
721
|
name: u,
|
|
722
722
|
disabled: h,
|
|
723
723
|
readOnly: m,
|
|
724
|
-
required:
|
|
725
|
-
className:
|
|
726
|
-
label:
|
|
727
|
-
placeholder:
|
|
728
|
-
helpText:
|
|
729
|
-
error:
|
|
724
|
+
required: v,
|
|
725
|
+
className: g,
|
|
726
|
+
label: w,
|
|
727
|
+
placeholder: k,
|
|
728
|
+
helpText: y,
|
|
729
|
+
error: S
|
|
730
730
|
}) {
|
|
731
|
-
const [
|
|
731
|
+
const [x, I] = T({
|
|
732
732
|
value: n,
|
|
733
733
|
defaultValue: t ?? null,
|
|
734
734
|
onChange: r
|
|
735
|
-
}),
|
|
735
|
+
}), b = e.find((P) => P.value === x) ?? null, [N, C] = T({
|
|
736
736
|
value: l,
|
|
737
|
-
defaultValue: (
|
|
738
|
-
onChange:
|
|
739
|
-
}), [
|
|
740
|
-
(
|
|
741
|
-
const j =
|
|
742
|
-
!j || j.disabled || (
|
|
737
|
+
defaultValue: (b == null ? void 0 : b.label) ?? "",
|
|
738
|
+
onChange: i
|
|
739
|
+
}), [D, $] = M(!1), E = O(null), U = F(), G = d ?? U, L = s ?? Ae, R = e.filter((P) => L(P, N)), V = A(() => $(!1), []), K = A(
|
|
740
|
+
(P) => {
|
|
741
|
+
const j = R[P];
|
|
742
|
+
!j || j.disabled || (I(j.value), C(j.label), V());
|
|
743
743
|
},
|
|
744
|
-
[
|
|
745
|
-
), { activeIndex: J, setActiveIndex:
|
|
746
|
-
itemCount:
|
|
747
|
-
isOpen:
|
|
748
|
-
onSelect:
|
|
749
|
-
onClose:
|
|
744
|
+
[R, I, C, V]
|
|
745
|
+
), { activeIndex: J, setActiveIndex: ae, handleKeyDown: De } = re({
|
|
746
|
+
itemCount: R.length,
|
|
747
|
+
isOpen: D,
|
|
748
|
+
onSelect: K,
|
|
749
|
+
onClose: V
|
|
750
750
|
});
|
|
751
|
-
return /* @__PURE__ */ a(
|
|
751
|
+
return /* @__PURE__ */ a(B, { id: G, label: w, required: v, error: S, helpText: y, className: g, children: /* @__PURE__ */ p("div", { className: "position-relative", children: [
|
|
752
752
|
/* @__PURE__ */ a(
|
|
753
753
|
"input",
|
|
754
754
|
{
|
|
755
|
-
ref:
|
|
756
|
-
id:
|
|
755
|
+
ref: E,
|
|
756
|
+
id: G,
|
|
757
757
|
name: u,
|
|
758
758
|
type: "text",
|
|
759
|
-
className: f("form-control",
|
|
759
|
+
className: f("form-control", S && "is-invalid"),
|
|
760
760
|
disabled: h,
|
|
761
761
|
readOnly: m,
|
|
762
|
-
required:
|
|
763
|
-
placeholder:
|
|
762
|
+
required: v,
|
|
763
|
+
placeholder: k,
|
|
764
764
|
autoComplete: "off",
|
|
765
765
|
role: "combobox",
|
|
766
|
-
"aria-expanded":
|
|
766
|
+
"aria-expanded": D,
|
|
767
767
|
"aria-haspopup": "listbox",
|
|
768
|
-
value:
|
|
769
|
-
onFocus: () =>
|
|
770
|
-
onChange: (
|
|
771
|
-
const j =
|
|
772
|
-
|
|
768
|
+
value: N,
|
|
769
|
+
onFocus: () => $(!0),
|
|
770
|
+
onChange: (P) => {
|
|
771
|
+
const j = P.target.value;
|
|
772
|
+
C(j), $(!0), x !== null && I(null);
|
|
773
773
|
},
|
|
774
|
-
onKeyDown:
|
|
774
|
+
onKeyDown: De
|
|
775
775
|
}
|
|
776
776
|
),
|
|
777
|
-
/* @__PURE__ */ a(
|
|
777
|
+
/* @__PURE__ */ a(W, { open: D, onClose: V, anchorRef: E, className: "dropdown-menu w-100", role: "listbox", children: o ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : R.length === 0 ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: c }) : R.map((P, j) => /* @__PURE__ */ a(
|
|
778
778
|
"div",
|
|
779
779
|
{
|
|
780
780
|
role: "option",
|
|
781
|
-
"aria-selected":
|
|
782
|
-
className: f("dropdown-item", j === J && "active",
|
|
783
|
-
onMouseEnter: () =>
|
|
784
|
-
onMouseDown: (
|
|
785
|
-
|
|
781
|
+
"aria-selected": P.value === x,
|
|
782
|
+
className: f("dropdown-item", j === J && "active", P.disabled && "disabled"),
|
|
783
|
+
onMouseEnter: () => ae(j),
|
|
784
|
+
onMouseDown: (Ve) => {
|
|
785
|
+
Ve.preventDefault(), P.disabled || K(j);
|
|
786
786
|
},
|
|
787
|
-
children:
|
|
787
|
+
children: P.label
|
|
788
788
|
},
|
|
789
|
-
String(
|
|
789
|
+
String(P.value)
|
|
790
790
|
)) })
|
|
791
791
|
] }) });
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
return /* @__PURE__ */ a(
|
|
793
|
+
function Wn(e) {
|
|
794
|
+
return /* @__PURE__ */ a(B, { ...e });
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
return
|
|
798
|
-
/* @__PURE__ */ a("div", { className: "modal d-block", tabIndex: -1, role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ a("div", { className: f("modal-dialog",
|
|
796
|
+
function Pe({ open: e, onClose: n, title: t, children: r, footer: l, className: i }) {
|
|
797
|
+
return ie(e, n), e ? /* @__PURE__ */ p(H, { children: [
|
|
798
|
+
/* @__PURE__ */ a("div", { className: "modal d-block", tabIndex: -1, role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ a("div", { className: f("modal-dialog", i), role: "document", children: /* @__PURE__ */ p("div", { className: "modal-content", children: [
|
|
799
799
|
/* @__PURE__ */ p("div", { className: "modal-header", children: [
|
|
800
800
|
t && /* @__PURE__ */ a("h5", { className: "modal-title", children: t }),
|
|
801
801
|
/* @__PURE__ */ a("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: n })
|
|
@@ -806,16 +806,16 @@ function Ee({ open: e, onClose: n, title: t, children: r, footer: l, className:
|
|
|
806
806
|
/* @__PURE__ */ a("div", { className: "modal-backdrop show", onClick: n })
|
|
807
807
|
] }) : null;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
const r = [], l = Math.max(1, e - t),
|
|
809
|
+
function Fe(e, n, t) {
|
|
810
|
+
const r = [], l = Math.max(1, e - t), i = Math.min(n, e + t);
|
|
811
811
|
l > 1 && (r.push(1), l > 2 && r.push("ellipsis"));
|
|
812
|
-
for (let
|
|
813
|
-
r.push(
|
|
814
|
-
return
|
|
812
|
+
for (let o = l; o <= i; o++)
|
|
813
|
+
r.push(o);
|
|
814
|
+
return i < n && (i < n - 1 && r.push("ellipsis"), r.push(n)), r;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
const
|
|
818
|
-
return /* @__PURE__ */ a("nav", { "aria-label": "Pagination", className:
|
|
816
|
+
function Ke({ currentPage: e, pageSize: n, totalItems: t, onPageChange: r, siblingCount: l = 1, className: i }) {
|
|
817
|
+
const o = Math.max(1, Math.ceil(t / n)), c = Fe(e, o, l);
|
|
818
|
+
return /* @__PURE__ */ a("nav", { "aria-label": "Pagination", className: i, children: /* @__PURE__ */ p("ul", { className: "pagination mb-0", children: [
|
|
819
819
|
/* @__PURE__ */ a("li", { className: f("page-item", e <= 1 && "disabled"), children: /* @__PURE__ */ a(
|
|
820
820
|
"button",
|
|
821
821
|
{
|
|
@@ -826,122 +826,156 @@ function $e({ currentPage: e, pageSize: n, totalItems: t, onPageChange: r, sibli
|
|
|
826
826
|
children: "Previous"
|
|
827
827
|
}
|
|
828
828
|
) }),
|
|
829
|
-
|
|
830
|
-
(
|
|
829
|
+
c.map(
|
|
830
|
+
(s, d) => s === "ellipsis" ? /* @__PURE__ */ a("li", { className: "page-item disabled", children: /* @__PURE__ */ a("span", { className: "page-link", children: "…" }) }, `ellipsis-${d}`) : /* @__PURE__ */ a("li", { className: f("page-item", s === e && "active"), children: /* @__PURE__ */ a(
|
|
831
831
|
"button",
|
|
832
832
|
{
|
|
833
833
|
type: "button",
|
|
834
834
|
className: "page-link",
|
|
835
|
-
"aria-current":
|
|
836
|
-
onClick: () => r(
|
|
837
|
-
children:
|
|
835
|
+
"aria-current": s === e ? "page" : void 0,
|
|
836
|
+
onClick: () => r(s),
|
|
837
|
+
children: s
|
|
838
838
|
}
|
|
839
|
-
) },
|
|
839
|
+
) }, s)
|
|
840
840
|
),
|
|
841
|
-
/* @__PURE__ */ a("li", { className: f("page-item", e >=
|
|
841
|
+
/* @__PURE__ */ a("li", { className: f("page-item", e >= o && "disabled"), children: /* @__PURE__ */ a(
|
|
842
842
|
"button",
|
|
843
843
|
{
|
|
844
844
|
type: "button",
|
|
845
845
|
className: "page-link",
|
|
846
|
-
disabled: e >=
|
|
846
|
+
disabled: e >= o,
|
|
847
847
|
onClick: () => r(e + 1),
|
|
848
848
|
children: "Next"
|
|
849
849
|
}
|
|
850
850
|
) })
|
|
851
851
|
] }) });
|
|
852
852
|
}
|
|
853
|
-
|
|
853
|
+
const Be = {
|
|
854
|
+
text: (e) => e == null ? "" : String(e),
|
|
855
|
+
boolean: (e) => e ? "Yes" : "No",
|
|
856
|
+
date: (e) => {
|
|
857
|
+
if (e == null || e === "")
|
|
858
|
+
return "";
|
|
859
|
+
const n = e instanceof Date ? e : new Date(String(e));
|
|
860
|
+
return Number.isNaN(n.getTime()) ? String(e) : n.toLocaleDateString();
|
|
861
|
+
},
|
|
862
|
+
currency: (e) => {
|
|
863
|
+
const n = Number(e);
|
|
864
|
+
return Number.isFinite(n) ? n.toLocaleString(void 0, { style: "currency", currency: "USD" }) : String(e ?? "");
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
function je(e, n) {
|
|
854
868
|
return !e || e.key !== n ? { key: n, direction: "asc" } : e.direction === "asc" ? { key: n, direction: "desc" } : null;
|
|
855
869
|
}
|
|
856
|
-
function
|
|
870
|
+
function ce(e) {
|
|
871
|
+
return e.key ?? e.field ?? e.header;
|
|
872
|
+
}
|
|
873
|
+
function He(e, n) {
|
|
874
|
+
const t = e.field ?? e.key;
|
|
875
|
+
return t ? n[t] : void 0;
|
|
876
|
+
}
|
|
877
|
+
function _e(e, n) {
|
|
878
|
+
if (e.render)
|
|
879
|
+
return e.render(n);
|
|
880
|
+
const t = He(e, n);
|
|
881
|
+
return e.formatter ? e.formatter(t, n) : e.format ? Be[e.format](t) : t == null ? "" : String(t);
|
|
882
|
+
}
|
|
883
|
+
function de(e) {
|
|
884
|
+
return e && `text-${e}`;
|
|
885
|
+
}
|
|
886
|
+
function Ue({
|
|
857
887
|
columns: e,
|
|
858
888
|
rows: n,
|
|
859
889
|
rowKey: t,
|
|
860
890
|
loading: r,
|
|
861
891
|
error: l,
|
|
862
|
-
emptyText:
|
|
863
|
-
className:
|
|
864
|
-
selectedRowKeys:
|
|
865
|
-
onSelectionChange:
|
|
892
|
+
emptyText: i = "No data",
|
|
893
|
+
className: o,
|
|
894
|
+
selectedRowKeys: c,
|
|
895
|
+
onSelectionChange: s,
|
|
866
896
|
sort: d,
|
|
867
897
|
onSortChange: u,
|
|
868
898
|
page: h,
|
|
869
899
|
pageSize: m,
|
|
870
|
-
totalCount:
|
|
871
|
-
onPageChange:
|
|
900
|
+
totalCount: v,
|
|
901
|
+
onPageChange: g
|
|
872
902
|
}) {
|
|
873
|
-
const
|
|
874
|
-
function
|
|
875
|
-
|
|
903
|
+
const w = !!s, k = new Set(c ?? []), y = h !== void 0 && m !== void 0 && v !== void 0, S = y ? Math.max(1, Math.ceil(v / m)) : 1;
|
|
904
|
+
function x() {
|
|
905
|
+
s && (k.size === n.length ? s([]) : s(n.map(t)));
|
|
876
906
|
}
|
|
877
|
-
function
|
|
878
|
-
if (!
|
|
907
|
+
function I(b) {
|
|
908
|
+
if (!s)
|
|
879
909
|
return;
|
|
880
|
-
const
|
|
881
|
-
|
|
910
|
+
const N = new Set(k);
|
|
911
|
+
N.has(b) ? N.delete(b) : N.add(b), s(Array.from(N));
|
|
882
912
|
}
|
|
883
|
-
return /* @__PURE__ */ p("div", { className: f("table-responsive",
|
|
913
|
+
return /* @__PURE__ */ p("div", { className: f("table-responsive", o), children: [
|
|
884
914
|
/* @__PURE__ */ p("table", { className: "table table-hover align-middle", children: [
|
|
885
915
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
886
|
-
|
|
916
|
+
w && /* @__PURE__ */ a("th", { style: { width: "2.5rem" }, children: /* @__PURE__ */ a(
|
|
887
917
|
"input",
|
|
888
918
|
{
|
|
889
919
|
type: "checkbox",
|
|
890
920
|
className: "form-check-input",
|
|
891
|
-
checked: n.length > 0 &&
|
|
892
|
-
onChange:
|
|
921
|
+
checked: n.length > 0 && k.size === n.length,
|
|
922
|
+
onChange: x,
|
|
893
923
|
"aria-label": "Select all rows"
|
|
894
924
|
}
|
|
895
925
|
) }),
|
|
896
|
-
e.map((
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
926
|
+
e.map((b) => {
|
|
927
|
+
const N = ce(b);
|
|
928
|
+
return /* @__PURE__ */ p(
|
|
929
|
+
"th",
|
|
930
|
+
{
|
|
931
|
+
className: de(b.headerAlign ?? b.align),
|
|
932
|
+
style: { width: b.width, minWidth: b.minWidth, maxWidth: b.maxWidth },
|
|
933
|
+
role: b.sortable ? "button" : void 0,
|
|
934
|
+
onClick: b.sortable && u ? () => u(je(d, N)) : void 0,
|
|
935
|
+
children: [
|
|
936
|
+
b.header,
|
|
937
|
+
b.sortable && (d == null ? void 0 : d.key) === N && /* @__PURE__ */ p("span", { "aria-hidden": "true", children: [
|
|
938
|
+
" ",
|
|
939
|
+
d.direction === "asc" ? "▲" : "▼"
|
|
940
|
+
] })
|
|
941
|
+
]
|
|
942
|
+
},
|
|
943
|
+
N
|
|
944
|
+
);
|
|
945
|
+
})
|
|
912
946
|
] }) }),
|
|
913
|
-
/* @__PURE__ */ a("tbody", { children: r ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (
|
|
914
|
-
const
|
|
947
|
+
/* @__PURE__ */ a("tbody", { children: r ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (w ? 1 : 0), className: "text-center text-body-secondary py-4", children: "Loading…" }) }) : l ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (w ? 1 : 0), className: "text-center text-danger py-4", children: l }) }) : n.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (w ? 1 : 0), className: "text-center text-body-secondary py-4", children: i }) }) : n.map((b) => {
|
|
948
|
+
const N = t(b);
|
|
915
949
|
return /* @__PURE__ */ p("tr", { children: [
|
|
916
|
-
|
|
950
|
+
w && /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(
|
|
917
951
|
"input",
|
|
918
952
|
{
|
|
919
953
|
type: "checkbox",
|
|
920
954
|
className: "form-check-input",
|
|
921
|
-
checked:
|
|
922
|
-
onChange: () =>
|
|
955
|
+
checked: k.has(N),
|
|
956
|
+
onChange: () => I(N),
|
|
923
957
|
"aria-label": "Select row"
|
|
924
958
|
}
|
|
925
959
|
) }),
|
|
926
|
-
e.map((
|
|
927
|
-
] },
|
|
960
|
+
e.map((C) => /* @__PURE__ */ a("td", { className: de(C.align), children: _e(C, b) }, ce(C)))
|
|
961
|
+
] }, N);
|
|
928
962
|
}) })
|
|
929
963
|
] }),
|
|
930
|
-
|
|
964
|
+
y && /* @__PURE__ */ p("div", { className: "d-flex justify-content-between align-items-center mt-2", children: [
|
|
931
965
|
/* @__PURE__ */ p("span", { className: "text-body-secondary small", children: [
|
|
932
966
|
"Page ",
|
|
933
967
|
h,
|
|
934
968
|
" of ",
|
|
935
|
-
|
|
969
|
+
S,
|
|
936
970
|
" (",
|
|
937
|
-
|
|
971
|
+
v,
|
|
938
972
|
" rows)"
|
|
939
973
|
] }),
|
|
940
|
-
/* @__PURE__ */ a(
|
|
974
|
+
/* @__PURE__ */ a(Ke, { currentPage: h, pageSize: m, totalItems: v, onPageChange: g })
|
|
941
975
|
] })
|
|
942
976
|
] });
|
|
943
977
|
}
|
|
944
|
-
function
|
|
978
|
+
function qe({ size: e = "md", variant: n, className: t, label: r = "Loading..." }) {
|
|
945
979
|
return /* @__PURE__ */ a(
|
|
946
980
|
"span",
|
|
947
981
|
{
|
|
@@ -951,153 +985,254 @@ function Pe({ size: e = "md", variant: n, className: t, label: r = "Loading..."
|
|
|
951
985
|
}
|
|
952
986
|
);
|
|
953
987
|
}
|
|
954
|
-
function
|
|
988
|
+
function te({
|
|
955
989
|
variant: e = "primary",
|
|
956
990
|
size: n,
|
|
957
991
|
disabled: t,
|
|
958
992
|
loading: r,
|
|
959
993
|
type: l = "button",
|
|
960
|
-
className:
|
|
961
|
-
children:
|
|
962
|
-
onClick:
|
|
963
|
-
...
|
|
994
|
+
className: i,
|
|
995
|
+
children: o,
|
|
996
|
+
onClick: c,
|
|
997
|
+
...s
|
|
964
998
|
}) {
|
|
965
999
|
const d = t || r;
|
|
966
1000
|
return /* @__PURE__ */ p(
|
|
967
1001
|
"button",
|
|
968
1002
|
{
|
|
969
1003
|
type: l,
|
|
970
|
-
className: f("btn", `btn-${e}`, n && `btn-${n}`,
|
|
1004
|
+
className: f("btn", `btn-${e}`, n && `btn-${n}`, i),
|
|
971
1005
|
disabled: d,
|
|
972
1006
|
"aria-busy": r || void 0,
|
|
973
|
-
onClick: d ? void 0 :
|
|
974
|
-
...
|
|
1007
|
+
onClick: d ? void 0 : c,
|
|
1008
|
+
...s,
|
|
975
1009
|
children: [
|
|
976
|
-
r && /* @__PURE__ */ a(
|
|
977
|
-
|
|
1010
|
+
r && /* @__PURE__ */ a(qe, { size: "sm", className: "me-2", label: "" }),
|
|
1011
|
+
o
|
|
978
1012
|
]
|
|
979
1013
|
}
|
|
980
1014
|
);
|
|
981
1015
|
}
|
|
982
|
-
function
|
|
1016
|
+
function xe({ variant: e = "info", dismissible: n, onDismiss: t, className: r, children: l }) {
|
|
983
1017
|
return /* @__PURE__ */ p("div", { className: f("alert", `alert-${e}`, n && "alert-dismissible", r), role: "alert", children: [
|
|
984
1018
|
l,
|
|
985
1019
|
n && /* @__PURE__ */ a("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: t })
|
|
986
1020
|
] });
|
|
987
1021
|
}
|
|
988
|
-
const
|
|
989
|
-
function
|
|
990
|
-
const [n, t] =
|
|
991
|
-
|
|
992
|
-
const
|
|
1022
|
+
const we = he(null), ze = 4e3;
|
|
1023
|
+
function Jn({ children: e }) {
|
|
1024
|
+
const [n, t] = M([]), r = O(0), l = O(/* @__PURE__ */ new Map());
|
|
1025
|
+
_(() => {
|
|
1026
|
+
const s = l.current;
|
|
993
1027
|
return () => {
|
|
994
|
-
|
|
1028
|
+
s.forEach(clearTimeout), s.clear();
|
|
995
1029
|
};
|
|
996
1030
|
}, []);
|
|
997
|
-
const
|
|
998
|
-
const d = l.current.get(
|
|
999
|
-
d && (clearTimeout(d), l.current.delete(
|
|
1000
|
-
}, []),
|
|
1001
|
-
(
|
|
1002
|
-
const u = r.current++, h = (d == null ? void 0 : d.variant) ?? "info", m = (d == null ? void 0 : d.duration) ??
|
|
1003
|
-
return t((
|
|
1031
|
+
const i = A((s) => {
|
|
1032
|
+
const d = l.current.get(s);
|
|
1033
|
+
d && (clearTimeout(d), l.current.delete(s)), t((u) => u.filter((h) => h.id !== s));
|
|
1034
|
+
}, []), o = A(
|
|
1035
|
+
(s, d) => {
|
|
1036
|
+
const u = r.current++, h = (d == null ? void 0 : d.variant) ?? "info", m = (d == null ? void 0 : d.duration) ?? ze;
|
|
1037
|
+
return t((v) => [...v, { id: u, message: s, variant: h }]), m > 0 && l.current.set(
|
|
1004
1038
|
u,
|
|
1005
|
-
setTimeout(() =>
|
|
1039
|
+
setTimeout(() => i(u), m)
|
|
1006
1040
|
), u;
|
|
1007
1041
|
},
|
|
1008
|
-
[
|
|
1009
|
-
),
|
|
1042
|
+
[i]
|
|
1043
|
+
), c = ne(
|
|
1010
1044
|
() => ({
|
|
1011
|
-
show:
|
|
1012
|
-
dismiss:
|
|
1013
|
-
success: (
|
|
1014
|
-
error: (
|
|
1015
|
-
info: (
|
|
1016
|
-
warning: (
|
|
1045
|
+
show: o,
|
|
1046
|
+
dismiss: i,
|
|
1047
|
+
success: (s, d) => o(s, { ...d, variant: "success" }),
|
|
1048
|
+
error: (s, d) => o(s, { ...d, variant: "danger" }),
|
|
1049
|
+
info: (s, d) => o(s, { ...d, variant: "info" }),
|
|
1050
|
+
warning: (s, d) => o(s, { ...d, variant: "warning" })
|
|
1017
1051
|
}),
|
|
1018
|
-
[
|
|
1052
|
+
[o, i]
|
|
1019
1053
|
);
|
|
1020
|
-
return /* @__PURE__ */ p(
|
|
1054
|
+
return /* @__PURE__ */ p(we.Provider, { value: c, children: [
|
|
1021
1055
|
e,
|
|
1022
|
-
/* @__PURE__ */ a("div", { className: "toast-container position-fixed bottom-0 end-0 p-3", style: { zIndex: 1090 }, children: n.map((
|
|
1056
|
+
/* @__PURE__ */ a("div", { className: "toast-container position-fixed bottom-0 end-0 p-3", style: { zIndex: 1090 }, children: n.map((s) => /* @__PURE__ */ a(xe, { variant: s.variant, dismissible: !0, onDismiss: () => i(s.id), className: "shadow-sm", children: s.message }, s.id)) })
|
|
1023
1057
|
] });
|
|
1024
1058
|
}
|
|
1025
|
-
function
|
|
1026
|
-
const e =
|
|
1059
|
+
function Zn() {
|
|
1060
|
+
const e = be(we);
|
|
1027
1061
|
if (!e)
|
|
1028
1062
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1029
1063
|
return e;
|
|
1030
1064
|
}
|
|
1031
|
-
const
|
|
1032
|
-
function
|
|
1033
|
-
const [n, t] =
|
|
1034
|
-
t({ ...
|
|
1035
|
-
}), []), l =
|
|
1036
|
-
(
|
|
1037
|
-
n == null || n.resolve(
|
|
1065
|
+
const ke = he(null);
|
|
1066
|
+
function Yn({ children: e }) {
|
|
1067
|
+
const [n, t] = M(null), r = A((i) => new Promise((o) => {
|
|
1068
|
+
t({ ...i, resolve: o });
|
|
1069
|
+
}), []), l = A(
|
|
1070
|
+
(i) => {
|
|
1071
|
+
n == null || n.resolve(i), t(null);
|
|
1038
1072
|
},
|
|
1039
1073
|
[n]
|
|
1040
1074
|
);
|
|
1041
|
-
return /* @__PURE__ */ p(
|
|
1075
|
+
return /* @__PURE__ */ p(ke.Provider, { value: r, children: [
|
|
1042
1076
|
e,
|
|
1043
1077
|
/* @__PURE__ */ a(
|
|
1044
|
-
|
|
1078
|
+
Pe,
|
|
1045
1079
|
{
|
|
1046
1080
|
open: n !== null,
|
|
1047
1081
|
onClose: () => l(!1),
|
|
1048
1082
|
title: (n == null ? void 0 : n.title) ?? "Confirm",
|
|
1049
|
-
footer: /* @__PURE__ */ p(
|
|
1050
|
-
/* @__PURE__ */ a(
|
|
1051
|
-
/* @__PURE__ */ a(
|
|
1083
|
+
footer: /* @__PURE__ */ p(H, { children: [
|
|
1084
|
+
/* @__PURE__ */ a(te, { variant: "outline-secondary", onClick: () => l(!1), children: (n == null ? void 0 : n.cancelLabel) ?? "Cancel" }),
|
|
1085
|
+
/* @__PURE__ */ a(te, { variant: (n == null ? void 0 : n.confirmVariant) ?? "danger", onClick: () => l(!0), children: (n == null ? void 0 : n.confirmLabel) ?? "Confirm" })
|
|
1052
1086
|
] }),
|
|
1053
1087
|
children: n == null ? void 0 : n.message
|
|
1054
1088
|
}
|
|
1055
1089
|
)
|
|
1056
1090
|
] });
|
|
1057
1091
|
}
|
|
1058
|
-
function
|
|
1059
|
-
const e =
|
|
1092
|
+
function Qn() {
|
|
1093
|
+
const e = be(ke);
|
|
1060
1094
|
if (!e)
|
|
1061
1095
|
throw new Error("useConfirm must be used within a ConfirmProvider");
|
|
1062
1096
|
return e;
|
|
1063
1097
|
}
|
|
1064
|
-
function
|
|
1098
|
+
function Ge({ variant: e = "primary", pill: n, className: t, children: r }) {
|
|
1065
1099
|
return /* @__PURE__ */ a("span", { className: f("badge", `bg-${e}`, n && "rounded-pill", t), children: r });
|
|
1066
1100
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1101
|
+
const We = {
|
|
1102
|
+
sm: "0.875em",
|
|
1103
|
+
lg: "1.5em",
|
|
1104
|
+
xl: "2em"
|
|
1105
|
+
};
|
|
1106
|
+
function se({ name: e, size: n, className: t, label: r }) {
|
|
1107
|
+
return /* @__PURE__ */ a(
|
|
1108
|
+
"i",
|
|
1109
|
+
{
|
|
1110
|
+
className: f(e, t),
|
|
1111
|
+
style: n ? { fontSize: We[n] } : void 0,
|
|
1112
|
+
role: r ? "img" : void 0,
|
|
1113
|
+
"aria-label": r,
|
|
1114
|
+
"aria-hidden": r ? void 0 : !0
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
function Je(e) {
|
|
1119
|
+
switch (e) {
|
|
1120
|
+
case "pill":
|
|
1121
|
+
return "nav-pills";
|
|
1122
|
+
case "underline":
|
|
1123
|
+
return "nav-underline";
|
|
1124
|
+
case "card":
|
|
1125
|
+
return "nav-tabs card-header-tabs";
|
|
1126
|
+
default:
|
|
1127
|
+
return "nav-tabs";
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
const Ze = {
|
|
1131
|
+
sm: "small",
|
|
1132
|
+
lg: "fs-5"
|
|
1133
|
+
};
|
|
1134
|
+
function Xn({ items: e, activeKey: n, defaultActiveKey: t, onChange: r, variant: l = "default", orientation: i = "horizontal", size: o, stretch: c, className: s }) {
|
|
1135
|
+
var I;
|
|
1136
|
+
const [d, u] = T({
|
|
1070
1137
|
value: n,
|
|
1071
|
-
defaultValue: t ?? ((
|
|
1138
|
+
defaultValue: t ?? ((I = e[0]) == null ? void 0 : I.key) ?? "",
|
|
1072
1139
|
onChange: r
|
|
1073
|
-
}),
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1140
|
+
}), h = e.find((b) => b.key === d), m = l === "button", v = i === "vertical", g = O([]);
|
|
1141
|
+
function w(b, N) {
|
|
1142
|
+
var D;
|
|
1143
|
+
const C = e[b];
|
|
1144
|
+
C && (u(C.key), N && ((D = g.current[b]) == null || D.focus()));
|
|
1145
|
+
}
|
|
1146
|
+
function k(b, N) {
|
|
1147
|
+
var D;
|
|
1148
|
+
if (e.length === 0)
|
|
1149
|
+
return b;
|
|
1150
|
+
let C = b;
|
|
1151
|
+
for (let $ = 0; $ < e.length; $++)
|
|
1152
|
+
if (C = (C + N + e.length) % e.length, !((D = e[C]) != null && D.disabled))
|
|
1153
|
+
return C;
|
|
1154
|
+
return b;
|
|
1155
|
+
}
|
|
1156
|
+
function y(b) {
|
|
1157
|
+
var $;
|
|
1158
|
+
const N = e.findIndex((E) => E.key === d), C = v ? "ArrowDown" : "ArrowRight", D = v ? "ArrowUp" : "ArrowLeft";
|
|
1159
|
+
if (b.key === C)
|
|
1160
|
+
b.preventDefault(), w(k(N, 1), !0);
|
|
1161
|
+
else if (b.key === D)
|
|
1162
|
+
b.preventDefault(), w(k(N, -1), !0);
|
|
1163
|
+
else if (b.key === "Home") {
|
|
1164
|
+
b.preventDefault();
|
|
1165
|
+
const E = e.findIndex((U) => !U.disabled);
|
|
1166
|
+
E >= 0 && w(E, !0);
|
|
1167
|
+
} else if (b.key === "End") {
|
|
1168
|
+
b.preventDefault();
|
|
1169
|
+
for (let E = e.length - 1; E >= 0; E--)
|
|
1170
|
+
if (!(($ = e[E]) != null && $.disabled)) {
|
|
1171
|
+
w(E, !0);
|
|
1172
|
+
break;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
const S = /* @__PURE__ */ a(
|
|
1177
|
+
"div",
|
|
1178
|
+
{
|
|
1179
|
+
className: f(
|
|
1180
|
+
m ? "btn-group" : "nav",
|
|
1181
|
+
!m && Je(l),
|
|
1182
|
+
!m && v && "flex-column",
|
|
1183
|
+
!m && c && "nav-fill",
|
|
1184
|
+
!m && o && Ze[o]
|
|
1185
|
+
),
|
|
1186
|
+
role: "tablist",
|
|
1187
|
+
"aria-orientation": i,
|
|
1188
|
+
onKeyDown: y,
|
|
1189
|
+
children: e.map((b, N) => {
|
|
1190
|
+
const C = b.key === d, D = /* @__PURE__ */ p(H, { children: [
|
|
1191
|
+
b.icon && /* @__PURE__ */ a(se, { name: b.icon, size: "sm", className: "me-1" }),
|
|
1192
|
+
b.label,
|
|
1193
|
+
b.badge != null && /* @__PURE__ */ a(Ge, { variant: C && !m ? "primary" : "secondary", pill: !0, className: "ms-2", children: b.badge })
|
|
1194
|
+
] }), $ = /* @__PURE__ */ a(
|
|
1195
|
+
"button",
|
|
1196
|
+
{
|
|
1197
|
+
ref: (E) => {
|
|
1198
|
+
g.current[N] = E;
|
|
1199
|
+
},
|
|
1200
|
+
type: "button",
|
|
1201
|
+
id: `tab-${b.key}`,
|
|
1202
|
+
className: f(m ? f("btn", o ? `btn-${o}` : "btn-sm", C ? "btn-primary" : "btn-outline-primary") : f("nav-link", C && "active")),
|
|
1203
|
+
role: "tab",
|
|
1204
|
+
"aria-selected": C,
|
|
1205
|
+
"aria-controls": `tabpanel-${b.key}`,
|
|
1206
|
+
tabIndex: C ? 0 : -1,
|
|
1207
|
+
disabled: b.disabled,
|
|
1208
|
+
onClick: () => w(N, !1),
|
|
1209
|
+
children: D
|
|
1210
|
+
},
|
|
1211
|
+
b.key
|
|
1212
|
+
);
|
|
1213
|
+
return m ? $ : /* @__PURE__ */ a("div", { className: "nav-item", role: "presentation", children: $ }, b.key);
|
|
1214
|
+
})
|
|
1215
|
+
}
|
|
1216
|
+
), x = (h == null ? void 0 : h.content) != null && /* @__PURE__ */ a("div", { id: `tabpanel-${h.key}`, className: f("tab-content", !v && "pt-3"), role: "tabpanel", "aria-labelledby": `tab-${h.key}`, children: h.content });
|
|
1217
|
+
return v ? /* @__PURE__ */ p("div", { className: f("d-flex align-items-start gap-3", s), children: [
|
|
1218
|
+
S,
|
|
1219
|
+
x && /* @__PURE__ */ a("div", { className: "flex-grow-1", children: x })
|
|
1220
|
+
] }) : /* @__PURE__ */ p("div", { className: s, children: [
|
|
1221
|
+
S,
|
|
1222
|
+
x
|
|
1088
1223
|
] });
|
|
1089
1224
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const [
|
|
1225
|
+
function Ye({ items: e, multiple: n = !1, openKeys: t, defaultOpenKeys: r, onChange: l, className: i }) {
|
|
1226
|
+
const [o, c] = T({
|
|
1092
1227
|
value: t,
|
|
1093
1228
|
defaultValue: r ?? [],
|
|
1094
1229
|
onChange: l
|
|
1095
|
-
}),
|
|
1230
|
+
}), s = new Set(o);
|
|
1096
1231
|
function d(u) {
|
|
1097
|
-
|
|
1232
|
+
s.has(u) ? c(o.filter((h) => h !== u)) : c(n ? [...o, u] : [u]);
|
|
1098
1233
|
}
|
|
1099
|
-
return /* @__PURE__ */ a("div", { className: f("accordion",
|
|
1100
|
-
const h =
|
|
1234
|
+
return /* @__PURE__ */ a("div", { className: f("accordion", i), children: e.map((u) => {
|
|
1235
|
+
const h = s.has(u.key);
|
|
1101
1236
|
return /* @__PURE__ */ p("div", { className: "accordion-item", children: [
|
|
1102
1237
|
/* @__PURE__ */ a("h2", { className: "accordion-header", children: /* @__PURE__ */ a(
|
|
1103
1238
|
"button",
|
|
@@ -1114,44 +1249,44 @@ function Le({ items: e, multiple: n = !1, openKeys: t, defaultOpenKeys: r, onCha
|
|
|
1114
1249
|
] }, u.key);
|
|
1115
1250
|
}) });
|
|
1116
1251
|
}
|
|
1117
|
-
function
|
|
1118
|
-
const [l,
|
|
1252
|
+
function Qe({ content: e, children: n, placement: t = "top", className: r }) {
|
|
1253
|
+
const [l, i] = M(!1), o = O(null), c = F();
|
|
1119
1254
|
return /* @__PURE__ */ p(
|
|
1120
1255
|
"span",
|
|
1121
1256
|
{
|
|
1122
|
-
ref:
|
|
1257
|
+
ref: o,
|
|
1123
1258
|
className: "position-relative d-inline-block",
|
|
1124
|
-
onMouseEnter: () =>
|
|
1125
|
-
onMouseLeave: () =>
|
|
1126
|
-
onFocus: () =>
|
|
1127
|
-
onBlur: () =>
|
|
1128
|
-
"aria-describedby": l ?
|
|
1259
|
+
onMouseEnter: () => i(!0),
|
|
1260
|
+
onMouseLeave: () => i(!1),
|
|
1261
|
+
onFocus: () => i(!0),
|
|
1262
|
+
onBlur: () => i(!1),
|
|
1263
|
+
"aria-describedby": l ? c : void 0,
|
|
1129
1264
|
children: [
|
|
1130
1265
|
n,
|
|
1131
1266
|
/* @__PURE__ */ a(
|
|
1132
|
-
|
|
1267
|
+
W,
|
|
1133
1268
|
{
|
|
1134
1269
|
open: l,
|
|
1135
|
-
onClose: () =>
|
|
1136
|
-
anchorRef:
|
|
1270
|
+
onClose: () => i(!1),
|
|
1271
|
+
anchorRef: o,
|
|
1137
1272
|
className: f("tooltip show", `bs-tooltip-${t}`, "position-absolute", "w-auto", r),
|
|
1138
|
-
children: /* @__PURE__ */ a("span", { id:
|
|
1273
|
+
children: /* @__PURE__ */ a("span", { id: c, role: "tooltip", className: "tooltip-inner", children: e })
|
|
1139
1274
|
}
|
|
1140
1275
|
)
|
|
1141
1276
|
]
|
|
1142
1277
|
}
|
|
1143
1278
|
);
|
|
1144
1279
|
}
|
|
1145
|
-
function
|
|
1146
|
-
const [
|
|
1147
|
-
return /* @__PURE__ */ p("span", { ref:
|
|
1280
|
+
function et({ title: e, content: n, children: t, placement: r = "bottom", className: l }) {
|
|
1281
|
+
const [i, o] = M(!1), c = O(null);
|
|
1282
|
+
return /* @__PURE__ */ p("span", { ref: c, className: "position-relative d-inline-block", onClick: () => o((s) => !s), children: [
|
|
1148
1283
|
t,
|
|
1149
1284
|
/* @__PURE__ */ p(
|
|
1150
|
-
|
|
1285
|
+
W,
|
|
1151
1286
|
{
|
|
1152
|
-
open:
|
|
1153
|
-
onClose: () =>
|
|
1154
|
-
anchorRef:
|
|
1287
|
+
open: i,
|
|
1288
|
+
onClose: () => o(!1),
|
|
1289
|
+
anchorRef: c,
|
|
1155
1290
|
className: f("popover show", `bs-popover-${r}`, "position-absolute", "w-auto", l),
|
|
1156
1291
|
children: [
|
|
1157
1292
|
e && /* @__PURE__ */ a("h3", { className: "popover-header", children: e }),
|
|
@@ -1161,21 +1296,10 @@ function Rn({ title: e, content: n, children: t, placement: r = "bottom", classN
|
|
|
1161
1296
|
)
|
|
1162
1297
|
] });
|
|
1163
1298
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
e && /* @__PURE__ */ a("div", { className: "card-header", children: e }),
|
|
1167
|
-
/* @__PURE__ */ a("div", { className: "card-body", children: r }),
|
|
1168
|
-
n && /* @__PURE__ */ a("div", { className: "card-footer", children: n })
|
|
1169
|
-
] });
|
|
1170
|
-
}
|
|
1171
|
-
function On({ className: e, vertical: n, label: t }) {
|
|
1172
|
-
return n ? /* @__PURE__ */ a("div", { className: f("vr", e), role: "separator", "aria-orientation": "vertical" }) : t ? /* @__PURE__ */ p("div", { className: f("d-flex align-items-center gap-2 my-3", e), role: "separator", children: [
|
|
1173
|
-
/* @__PURE__ */ a("hr", { className: "flex-grow-1 m-0" }),
|
|
1174
|
-
/* @__PURE__ */ a("span", { className: "text-body-secondary small", children: t }),
|
|
1175
|
-
/* @__PURE__ */ a("hr", { className: "flex-grow-1 m-0" })
|
|
1176
|
-
] }) : /* @__PURE__ */ a("hr", { className: f("my-3", e), role: "separator" });
|
|
1299
|
+
function ee({ width: e = "100%", height: n = "1rem", circle: t, className: r }) {
|
|
1300
|
+
return /* @__PURE__ */ a("span", { className: f("placeholder-glow d-inline-block", r), style: { width: e, height: n }, "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: f("placeholder w-100 h-100 d-block", t && "rounded-circle") }) });
|
|
1177
1301
|
}
|
|
1178
|
-
function
|
|
1302
|
+
function Se({ direction: e = "column", gap: n = 2, align: t, justify: r, wrap: l, className: i, children: o }) {
|
|
1179
1303
|
return /* @__PURE__ */ a(
|
|
1180
1304
|
"div",
|
|
1181
1305
|
{
|
|
@@ -1186,19 +1310,87 @@ function An({ direction: e = "column", gap: n = 2, align: t, justify: r, wrap: l
|
|
|
1186
1310
|
t && `align-items-${t}`,
|
|
1187
1311
|
r && `justify-content-${r}`,
|
|
1188
1312
|
l && "flex-wrap",
|
|
1189
|
-
|
|
1313
|
+
i
|
|
1190
1314
|
),
|
|
1191
|
-
children:
|
|
1315
|
+
children: o
|
|
1192
1316
|
}
|
|
1193
1317
|
);
|
|
1194
1318
|
}
|
|
1195
|
-
|
|
1319
|
+
const Xe = {
|
|
1320
|
+
xs: "0.75rem",
|
|
1321
|
+
sm: "0.875rem",
|
|
1322
|
+
md: "1rem",
|
|
1323
|
+
lg: "1.25rem",
|
|
1324
|
+
xl: "1.5rem"
|
|
1325
|
+
}, en = {
|
|
1326
|
+
normal: "fw-normal",
|
|
1327
|
+
medium: "fw-medium",
|
|
1328
|
+
semibold: "fw-semibold",
|
|
1329
|
+
bold: "fw-bold"
|
|
1330
|
+
}, nn = {
|
|
1331
|
+
default: void 0,
|
|
1332
|
+
muted: "text-body-secondary",
|
|
1333
|
+
primary: "text-primary",
|
|
1334
|
+
success: "text-success",
|
|
1335
|
+
danger: "text-danger",
|
|
1336
|
+
warning: "text-warning",
|
|
1337
|
+
info: "text-info"
|
|
1338
|
+
};
|
|
1339
|
+
function q({ as: e, size: n = "md", weight: t, tone: r = "default", align: l, truncate: i, wrap: o = !0, className: c, children: s }) {
|
|
1340
|
+
return /* @__PURE__ */ a(
|
|
1341
|
+
e ?? "span",
|
|
1342
|
+
{
|
|
1343
|
+
className: f(
|
|
1344
|
+
t && en[t],
|
|
1345
|
+
nn[r],
|
|
1346
|
+
l && `text-${l}`,
|
|
1347
|
+
i && "text-truncate",
|
|
1348
|
+
!o && !i && "text-nowrap",
|
|
1349
|
+
c
|
|
1350
|
+
),
|
|
1351
|
+
style: { fontSize: Xe[n] },
|
|
1352
|
+
children: s
|
|
1353
|
+
}
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
function tn({ title: e, subtitle: n, icon: t, avatar: r, actions: l }) {
|
|
1357
|
+
return /* @__PURE__ */ p("div", { className: "d-flex align-items-center justify-content-between gap-3", children: [
|
|
1358
|
+
/* @__PURE__ */ p("div", { className: "d-flex align-items-center gap-3", style: { minWidth: 0 }, children: [
|
|
1359
|
+
r || t && /* @__PURE__ */ a("span", { className: "fs-2 lh-1", children: t }),
|
|
1360
|
+
(e || n) && /* @__PURE__ */ p("div", { style: { minWidth: 0 }, children: [
|
|
1361
|
+
e && /* @__PURE__ */ a(q, { as: "div", size: "lg", weight: "semibold", truncate: !0, children: e }),
|
|
1362
|
+
n && /* @__PURE__ */ a(q, { as: "div", size: "sm", tone: "muted", truncate: !0, children: n })
|
|
1363
|
+
] })
|
|
1364
|
+
] }),
|
|
1365
|
+
l && /* @__PURE__ */ a("div", { className: "d-flex align-items-center gap-2 flex-shrink-0", children: l })
|
|
1366
|
+
] });
|
|
1367
|
+
}
|
|
1368
|
+
function nt({ title: e, subtitle: n, icon: t, avatar: r, actions: l, header: i, footer: o, loading: c, className: s, children: d }) {
|
|
1369
|
+
const h = i ?? (!!(e || n || t || r || l) ? /* @__PURE__ */ a(tn, { title: e, subtitle: n, icon: t, avatar: r, actions: l }) : void 0);
|
|
1370
|
+
return /* @__PURE__ */ p("div", { className: f("card", s), children: [
|
|
1371
|
+
h && /* @__PURE__ */ a("div", { className: "card-header", children: h }),
|
|
1372
|
+
/* @__PURE__ */ a("div", { className: "card-body", children: c ? /* @__PURE__ */ p(Se, { gap: 2, children: [
|
|
1373
|
+
/* @__PURE__ */ a(ee, { height: "1rem", width: "60%" }),
|
|
1374
|
+
/* @__PURE__ */ a(ee, { height: "1rem" }),
|
|
1375
|
+
/* @__PURE__ */ a(ee, { height: "1rem", width: "80%" })
|
|
1376
|
+
] }) : d }),
|
|
1377
|
+
o && /* @__PURE__ */ a("div", { className: "card-footer", children: o })
|
|
1378
|
+
] });
|
|
1379
|
+
}
|
|
1380
|
+
function tt({ className: e, vertical: n, label: t }) {
|
|
1381
|
+
return n ? /* @__PURE__ */ a("div", { className: f("vr", e), role: "separator", "aria-orientation": "vertical" }) : t ? /* @__PURE__ */ p("div", { className: f("d-flex align-items-center gap-2 my-3", e), role: "separator", children: [
|
|
1382
|
+
/* @__PURE__ */ a("hr", { className: "flex-grow-1 m-0" }),
|
|
1383
|
+
/* @__PURE__ */ a("span", { className: "text-body-secondary small", children: t }),
|
|
1384
|
+
/* @__PURE__ */ a("hr", { className: "flex-grow-1 m-0" })
|
|
1385
|
+
] }) : /* @__PURE__ */ a("hr", { className: f("my-3", e), role: "separator" });
|
|
1386
|
+
}
|
|
1387
|
+
function rt({ fluid: e, className: n, children: t }) {
|
|
1196
1388
|
return /* @__PURE__ */ a("div", { className: f(e ? "container-fluid" : "container", n), children: t });
|
|
1197
1389
|
}
|
|
1198
|
-
function
|
|
1390
|
+
function lt({ className: e, children: n }) {
|
|
1199
1391
|
return /* @__PURE__ */ a("div", { className: f("row", e), children: n });
|
|
1200
1392
|
}
|
|
1201
|
-
function
|
|
1393
|
+
function at({ span: e, sm: n, md: t, lg: r, xl: l, className: i, children: o }) {
|
|
1202
1394
|
return /* @__PURE__ */ a(
|
|
1203
1395
|
"div",
|
|
1204
1396
|
{
|
|
@@ -1208,70 +1400,70 @@ function Ln({ span: e, sm: n, md: t, lg: r, xl: l, className: s, children: c })
|
|
|
1208
1400
|
t ? `col-md-${t}` : void 0,
|
|
1209
1401
|
r ? `col-lg-${r}` : void 0,
|
|
1210
1402
|
l ? `col-xl-${l}` : void 0,
|
|
1211
|
-
|
|
1403
|
+
i
|
|
1212
1404
|
),
|
|
1213
|
-
children:
|
|
1405
|
+
children: o
|
|
1214
1406
|
}
|
|
1215
1407
|
);
|
|
1216
1408
|
}
|
|
1217
|
-
function
|
|
1409
|
+
function rn({ items: e, className: n }) {
|
|
1218
1410
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", className: n, children: /* @__PURE__ */ a("ol", { className: "breadcrumb mb-0", children: e.map((t, r) => {
|
|
1219
|
-
const l = r === e.length - 1,
|
|
1220
|
-
return /* @__PURE__ */ a("li", { className: f("breadcrumb-item", l && "active"), "aria-current": l ? "page" : void 0, children:
|
|
1411
|
+
const l = r === e.length - 1, i = !l && (t.href || t.onClick);
|
|
1412
|
+
return /* @__PURE__ */ a("li", { className: f("breadcrumb-item", l && "active"), "aria-current": l ? "page" : void 0, children: i ? /* @__PURE__ */ a(
|
|
1221
1413
|
"a",
|
|
1222
1414
|
{
|
|
1223
1415
|
href: t.href ?? "#",
|
|
1224
|
-
onClick: (
|
|
1225
|
-
var
|
|
1226
|
-
t.href ||
|
|
1416
|
+
onClick: (o) => {
|
|
1417
|
+
var c;
|
|
1418
|
+
t.href || o.preventDefault(), (c = t.onClick) == null || c.call(t);
|
|
1227
1419
|
},
|
|
1228
1420
|
children: t.label
|
|
1229
1421
|
}
|
|
1230
1422
|
) : t.label }, r);
|
|
1231
1423
|
}) }) });
|
|
1232
1424
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const [l,
|
|
1425
|
+
function it({ items: e, children: n, placement: t = "start", className: r }) {
|
|
1426
|
+
const [l, i] = M(!1), o = O(null), c = A(() => i(!1), []), s = A(
|
|
1235
1427
|
(m) => {
|
|
1236
|
-
var
|
|
1237
|
-
const
|
|
1238
|
-
!
|
|
1428
|
+
var g;
|
|
1429
|
+
const v = e[m];
|
|
1430
|
+
!v || v.disabled || ((g = v.onSelect) == null || g.call(v), c());
|
|
1239
1431
|
},
|
|
1240
|
-
[e,
|
|
1241
|
-
), { activeIndex: d, setActiveIndex: u, handleKeyDown: h } =
|
|
1432
|
+
[e, c]
|
|
1433
|
+
), { activeIndex: d, setActiveIndex: u, handleKeyDown: h } = re({
|
|
1242
1434
|
itemCount: e.length,
|
|
1243
1435
|
isOpen: l,
|
|
1244
|
-
onSelect:
|
|
1245
|
-
onClose:
|
|
1436
|
+
onSelect: s,
|
|
1437
|
+
onClose: c
|
|
1246
1438
|
});
|
|
1247
1439
|
return /* @__PURE__ */ p(
|
|
1248
1440
|
"span",
|
|
1249
1441
|
{
|
|
1250
|
-
ref:
|
|
1442
|
+
ref: o,
|
|
1251
1443
|
className: "position-relative d-inline-block",
|
|
1252
|
-
onClick: () =>
|
|
1444
|
+
onClick: () => i((m) => !m),
|
|
1253
1445
|
onKeyDown: h,
|
|
1254
1446
|
children: [
|
|
1255
1447
|
n,
|
|
1256
1448
|
/* @__PURE__ */ a(
|
|
1257
|
-
|
|
1449
|
+
W,
|
|
1258
1450
|
{
|
|
1259
1451
|
open: l,
|
|
1260
|
-
onClose:
|
|
1261
|
-
anchorRef:
|
|
1452
|
+
onClose: c,
|
|
1453
|
+
anchorRef: o,
|
|
1262
1454
|
role: "menu",
|
|
1263
1455
|
className: f("dropdown-menu show", t === "end" && "dropdown-menu-end", r),
|
|
1264
|
-
children: e.map((m,
|
|
1456
|
+
children: e.map((m, v) => /* @__PURE__ */ a(
|
|
1265
1457
|
"button",
|
|
1266
1458
|
{
|
|
1267
1459
|
type: "button",
|
|
1268
1460
|
role: "menuitem",
|
|
1269
|
-
className: f("dropdown-item",
|
|
1461
|
+
className: f("dropdown-item", v === d && "active", m.disabled && "disabled", m.danger && "text-danger"),
|
|
1270
1462
|
disabled: m.disabled,
|
|
1271
|
-
onMouseEnter: () => u(
|
|
1272
|
-
onMouseDown: (
|
|
1273
|
-
onClick: (
|
|
1274
|
-
|
|
1463
|
+
onMouseEnter: () => u(v),
|
|
1464
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
1465
|
+
onClick: (g) => {
|
|
1466
|
+
g.stopPropagation(), s(v);
|
|
1275
1467
|
},
|
|
1276
1468
|
children: m.label
|
|
1277
1469
|
},
|
|
@@ -1283,44 +1475,44 @@ function Kn({ items: e, children: n, placement: t = "start", className: r }) {
|
|
|
1283
1475
|
}
|
|
1284
1476
|
);
|
|
1285
1477
|
}
|
|
1286
|
-
function
|
|
1478
|
+
function st({ steps: e, currentStep: n, className: t }) {
|
|
1287
1479
|
return /* @__PURE__ */ a("ol", { className: f("d-flex list-unstyled align-items-center", t), children: e.map((r, l) => {
|
|
1288
|
-
const
|
|
1289
|
-
return /* @__PURE__ */ p("li", { className: f("d-flex align-items-center", !
|
|
1480
|
+
const i = l < n ? "complete" : l === n ? "active" : "upcoming", o = l === e.length - 1;
|
|
1481
|
+
return /* @__PURE__ */ p("li", { className: f("d-flex align-items-center", !o && "flex-grow-1"), children: [
|
|
1290
1482
|
/* @__PURE__ */ p("div", { className: "d-flex align-items-center gap-2", children: [
|
|
1291
1483
|
/* @__PURE__ */ a(
|
|
1292
1484
|
"span",
|
|
1293
1485
|
{
|
|
1294
1486
|
className: f(
|
|
1295
1487
|
"d-flex align-items-center justify-content-center rounded-circle flex-shrink-0",
|
|
1296
|
-
|
|
1488
|
+
i === "complete" ? "bg-primary text-white" : i === "active" ? "border border-primary text-primary" : "border text-body-secondary"
|
|
1297
1489
|
),
|
|
1298
1490
|
style: { width: "2rem", height: "2rem" },
|
|
1299
|
-
"aria-current":
|
|
1300
|
-
children:
|
|
1491
|
+
"aria-current": i === "active" ? "step" : void 0,
|
|
1492
|
+
children: i === "complete" ? "✓" : l + 1
|
|
1301
1493
|
}
|
|
1302
1494
|
),
|
|
1303
1495
|
/* @__PURE__ */ p("div", { children: [
|
|
1304
|
-
/* @__PURE__ */ a("div", { className: f("small fw-semibold",
|
|
1496
|
+
/* @__PURE__ */ a("div", { className: f("small fw-semibold", i === "upcoming" && "text-body-secondary"), children: r.label }),
|
|
1305
1497
|
r.description && /* @__PURE__ */ a("div", { className: "small text-body-secondary", children: r.description })
|
|
1306
1498
|
] })
|
|
1307
1499
|
] }),
|
|
1308
|
-
!
|
|
1500
|
+
!o && /* @__PURE__ */ a("hr", { className: "flex-grow-1 mx-2" })
|
|
1309
1501
|
] }, r.key);
|
|
1310
1502
|
}) });
|
|
1311
1503
|
}
|
|
1312
|
-
function
|
|
1313
|
-
var l,
|
|
1314
|
-
const n = e.trim().split(/\s+/), t = ((l = n[0]) == null ? void 0 : l[0]) ?? "", r = n.length > 1 ? ((
|
|
1504
|
+
function ln(e) {
|
|
1505
|
+
var l, i;
|
|
1506
|
+
const n = e.trim().split(/\s+/), t = ((l = n[0]) == null ? void 0 : l[0]) ?? "", r = n.length > 1 ? ((i = n[n.length - 1]) == null ? void 0 : i[0]) ?? "" : "";
|
|
1315
1507
|
return (t + r).toUpperCase();
|
|
1316
1508
|
}
|
|
1317
|
-
const
|
|
1509
|
+
const an = {
|
|
1318
1510
|
sm: "1.75rem",
|
|
1319
1511
|
md: "2.5rem",
|
|
1320
1512
|
lg: "3.5rem"
|
|
1321
1513
|
};
|
|
1322
|
-
function
|
|
1323
|
-
const l =
|
|
1514
|
+
function ot({ src: e, name: n, size: t = "md", className: r }) {
|
|
1515
|
+
const l = an[t];
|
|
1324
1516
|
return e ? /* @__PURE__ */ a(
|
|
1325
1517
|
"img",
|
|
1326
1518
|
{
|
|
@@ -1336,11 +1528,11 @@ function Bn({ src: e, name: n, size: t = "md", className: r }) {
|
|
|
1336
1528
|
style: { width: l, height: l, fontSize: `calc(${l} * 0.4)` },
|
|
1337
1529
|
role: n ? "img" : void 0,
|
|
1338
1530
|
"aria-label": n,
|
|
1339
|
-
children: n ?
|
|
1531
|
+
children: n ? ln(n) : null
|
|
1340
1532
|
}
|
|
1341
1533
|
);
|
|
1342
1534
|
}
|
|
1343
|
-
function
|
|
1535
|
+
function ct({ variant: e = "secondary", onRemove: n, className: t, children: r }) {
|
|
1344
1536
|
return /* @__PURE__ */ p("span", { className: f("badge d-inline-flex align-items-center gap-1", `bg-${e}`, t), children: [
|
|
1345
1537
|
r,
|
|
1346
1538
|
n && /* @__PURE__ */ a(
|
|
@@ -1355,93 +1547,73 @@ function Hn({ variant: e = "secondary", onRemove: n, className: t, children: r }
|
|
|
1355
1547
|
)
|
|
1356
1548
|
] });
|
|
1357
1549
|
}
|
|
1358
|
-
function
|
|
1359
|
-
return /* @__PURE__ */ a("span", { className: f("placeholder-glow d-inline-block", r), style: { width: e, height: n }, "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: f("placeholder w-100 h-100 d-block", t && "rounded-circle") }) });
|
|
1360
|
-
}
|
|
1361
|
-
function Un({
|
|
1550
|
+
function dt({
|
|
1362
1551
|
value: e,
|
|
1363
1552
|
defaultValue: n,
|
|
1364
1553
|
onChange: t,
|
|
1365
1554
|
min: r = 0,
|
|
1366
1555
|
max: l = 100,
|
|
1367
|
-
step:
|
|
1368
|
-
id:
|
|
1369
|
-
name:
|
|
1370
|
-
disabled:
|
|
1556
|
+
step: i = 1,
|
|
1557
|
+
id: o,
|
|
1558
|
+
name: c,
|
|
1559
|
+
disabled: s,
|
|
1371
1560
|
required: d,
|
|
1372
1561
|
className: u,
|
|
1373
1562
|
label: h,
|
|
1374
1563
|
helpText: m,
|
|
1375
|
-
error:
|
|
1564
|
+
error: v
|
|
1376
1565
|
}) {
|
|
1377
|
-
const [
|
|
1566
|
+
const [g, w] = T({
|
|
1378
1567
|
value: e,
|
|
1379
1568
|
defaultValue: n ?? r,
|
|
1380
1569
|
onChange: t
|
|
1381
|
-
}),
|
|
1382
|
-
return /* @__PURE__ */ p(
|
|
1570
|
+
}), k = F(), y = o ?? k;
|
|
1571
|
+
return /* @__PURE__ */ p(B, { id: y, label: h, required: d, error: v, helpText: m, className: u, children: [
|
|
1383
1572
|
/* @__PURE__ */ a(
|
|
1384
1573
|
"input",
|
|
1385
1574
|
{
|
|
1386
|
-
id:
|
|
1387
|
-
name:
|
|
1575
|
+
id: y,
|
|
1576
|
+
name: c,
|
|
1388
1577
|
type: "range",
|
|
1389
1578
|
className: "form-range",
|
|
1390
|
-
disabled:
|
|
1579
|
+
disabled: s,
|
|
1391
1580
|
required: d,
|
|
1392
1581
|
min: r,
|
|
1393
1582
|
max: l,
|
|
1394
|
-
step:
|
|
1395
|
-
value:
|
|
1396
|
-
onChange: (
|
|
1583
|
+
step: i,
|
|
1584
|
+
value: g,
|
|
1585
|
+
onChange: (S) => w(Number(S.target.value))
|
|
1397
1586
|
}
|
|
1398
1587
|
),
|
|
1399
|
-
/* @__PURE__ */ a("div", { className: "small text-body-secondary", children:
|
|
1588
|
+
/* @__PURE__ */ a("div", { className: "small text-body-secondary", children: g })
|
|
1400
1589
|
] });
|
|
1401
1590
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const [
|
|
1591
|
+
function ut({ value: e, defaultValue: n, onChange: t, max: r = 5, disabled: l, className: i }) {
|
|
1592
|
+
const [o, c] = T({
|
|
1404
1593
|
value: e,
|
|
1405
1594
|
defaultValue: n ?? 0,
|
|
1406
1595
|
onChange: t
|
|
1407
1596
|
});
|
|
1408
|
-
return /* @__PURE__ */ a("div", { className: f("d-inline-flex gap-1",
|
|
1597
|
+
return /* @__PURE__ */ a("div", { className: f("d-inline-flex gap-1", i), role: "radiogroup", "aria-label": "Rating", children: Array.from({ length: r }, (s, d) => d + 1).map((s) => /* @__PURE__ */ a(
|
|
1409
1598
|
"button",
|
|
1410
1599
|
{
|
|
1411
1600
|
type: "button",
|
|
1412
1601
|
className: "btn btn-link p-0 border-0",
|
|
1413
1602
|
disabled: l,
|
|
1414
1603
|
role: "radio",
|
|
1415
|
-
"aria-checked":
|
|
1416
|
-
"aria-label": `${
|
|
1417
|
-
onClick: () =>
|
|
1418
|
-
children: /* @__PURE__ */ a("span", { "aria-hidden": "true", style: { fontSize: "1.25rem", color:
|
|
1604
|
+
"aria-checked": s === o,
|
|
1605
|
+
"aria-label": `${s} star${s > 1 ? "s" : ""}`,
|
|
1606
|
+
onClick: () => c(s),
|
|
1607
|
+
children: /* @__PURE__ */ a("span", { "aria-hidden": "true", style: { fontSize: "1.25rem", color: s <= o ? "#f5b301" : "#ced4da" }, children: "★" })
|
|
1419
1608
|
},
|
|
1420
|
-
|
|
1609
|
+
s
|
|
1421
1610
|
)) });
|
|
1422
1611
|
}
|
|
1423
|
-
function
|
|
1612
|
+
function ft({ value: e, variant: n = "primary", label: t, className: r }) {
|
|
1424
1613
|
const l = Math.max(0, Math.min(100, e));
|
|
1425
1614
|
return /* @__PURE__ */ a("div", { className: f("progress", r), role: "progressbar", "aria-valuenow": l, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ a("div", { className: f("progress-bar", `bg-${n}`), style: { width: `${l}%` }, children: t ? `${Math.round(l)}%` : null }) });
|
|
1426
1615
|
}
|
|
1427
|
-
|
|
1428
|
-
sm: "0.875em",
|
|
1429
|
-
lg: "1.5em",
|
|
1430
|
-
xl: "2em"
|
|
1431
|
-
};
|
|
1432
|
-
function Jn({ name: e, size: n, className: t, label: r }) {
|
|
1433
|
-
return /* @__PURE__ */ a(
|
|
1434
|
-
"i",
|
|
1435
|
-
{
|
|
1436
|
-
className: f(e, t),
|
|
1437
|
-
style: n ? { fontSize: He[n] } : void 0,
|
|
1438
|
-
role: r ? "img" : void 0,
|
|
1439
|
-
"aria-label": r,
|
|
1440
|
-
"aria-hidden": r ? void 0 : !0
|
|
1441
|
-
}
|
|
1442
|
-
);
|
|
1443
|
-
}
|
|
1444
|
-
function Yn({ brand: e, start: n, end: t, variant: r = "light", className: l }) {
|
|
1616
|
+
function mt({ brand: e, start: n, end: t, variant: r = "light", className: l }) {
|
|
1445
1617
|
return /* @__PURE__ */ a(
|
|
1446
1618
|
"nav",
|
|
1447
1619
|
{
|
|
@@ -1458,10 +1630,10 @@ function Yn({ brand: e, start: n, end: t, variant: r = "light", className: l })
|
|
|
1458
1630
|
}
|
|
1459
1631
|
);
|
|
1460
1632
|
}
|
|
1461
|
-
function
|
|
1633
|
+
function sn(e) {
|
|
1462
1634
|
return "items" in e;
|
|
1463
1635
|
}
|
|
1464
|
-
function
|
|
1636
|
+
function ue({ item: e }) {
|
|
1465
1637
|
return /* @__PURE__ */ p(
|
|
1466
1638
|
"a",
|
|
1467
1639
|
{
|
|
@@ -1480,12 +1652,12 @@ function se({ item: e }) {
|
|
|
1480
1652
|
}
|
|
1481
1653
|
);
|
|
1482
1654
|
}
|
|
1483
|
-
function
|
|
1655
|
+
function ht({ sections: e, header: n, footer: t, className: r }) {
|
|
1484
1656
|
return /* @__PURE__ */ p("div", { className: f("d-flex flex-column h-100", r), children: [
|
|
1485
1657
|
n && /* @__PURE__ */ a("div", { className: "p-3 border-bottom", children: n }),
|
|
1486
1658
|
/* @__PURE__ */ a("nav", { className: "nav flex-column flex-grow-1 p-2 gap-1", children: e.map(
|
|
1487
|
-
(l) =>
|
|
1488
|
-
|
|
1659
|
+
(l) => sn(l) ? /* @__PURE__ */ a(
|
|
1660
|
+
Ye,
|
|
1489
1661
|
{
|
|
1490
1662
|
className: "border-0",
|
|
1491
1663
|
defaultOpenKeys: l.defaultOpen ? [l.key] : [],
|
|
@@ -1493,19 +1665,19 @@ function zn({ sections: e, header: n, footer: t, className: r }) {
|
|
|
1493
1665
|
{
|
|
1494
1666
|
key: l.key,
|
|
1495
1667
|
header: l.label,
|
|
1496
|
-
content: /* @__PURE__ */ a("div", { className: "nav flex-column ps-2 gap-1", children: l.items.map((
|
|
1668
|
+
content: /* @__PURE__ */ a("div", { className: "nav flex-column ps-2 gap-1", children: l.items.map((i) => /* @__PURE__ */ a(ue, { item: i }, i.key)) })
|
|
1497
1669
|
}
|
|
1498
1670
|
]
|
|
1499
1671
|
},
|
|
1500
1672
|
l.key
|
|
1501
|
-
) : /* @__PURE__ */ a(
|
|
1673
|
+
) : /* @__PURE__ */ a(ue, { item: l }, l.key)
|
|
1502
1674
|
) }),
|
|
1503
1675
|
t && /* @__PURE__ */ a("div", { className: "p-3 border-top", children: t })
|
|
1504
1676
|
] });
|
|
1505
1677
|
}
|
|
1506
|
-
function
|
|
1678
|
+
function bt({ title: e, description: n, breadcrumbItems: t, actions: r, className: l }) {
|
|
1507
1679
|
return /* @__PURE__ */ p("div", { className: f("mb-4", l), children: [
|
|
1508
|
-
t && t.length > 0 && /* @__PURE__ */ a(
|
|
1680
|
+
t && t.length > 0 && /* @__PURE__ */ a(rn, { items: t, className: "mb-2" }),
|
|
1509
1681
|
/* @__PURE__ */ p("div", { className: "d-flex align-items-start justify-content-between gap-3 flex-wrap", children: [
|
|
1510
1682
|
/* @__PURE__ */ p("div", { children: [
|
|
1511
1683
|
/* @__PURE__ */ a("h1", { className: "h3 mb-1", children: e }),
|
|
@@ -1515,12 +1687,131 @@ function Zn({ title: e, description: n, breadcrumbItems: t, actions: r, classNam
|
|
|
1515
1687
|
] })
|
|
1516
1688
|
] });
|
|
1517
1689
|
}
|
|
1518
|
-
|
|
1690
|
+
const on = {
|
|
1691
|
+
xs: 1,
|
|
1692
|
+
sm: 2,
|
|
1693
|
+
md: 3,
|
|
1694
|
+
lg: 4,
|
|
1695
|
+
xl: 5
|
|
1696
|
+
};
|
|
1697
|
+
function cn(e) {
|
|
1698
|
+
return typeof e == "number" ? e : on[e];
|
|
1699
|
+
}
|
|
1700
|
+
function pt({ direction: e = "row", gap: n = "sm", grow: t, shrink: r, fullWidth: l, className: i, ...o }) {
|
|
1701
|
+
return /* @__PURE__ */ a(
|
|
1702
|
+
Se,
|
|
1703
|
+
{
|
|
1704
|
+
direction: e,
|
|
1705
|
+
gap: cn(n),
|
|
1706
|
+
className: f(t && "flex-grow-1", r && "flex-shrink-0", l && "w-100", i),
|
|
1707
|
+
...o
|
|
1708
|
+
}
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
function vt({ icon: e, "aria-label": n, iconSize: t, tooltip: r, variant: l = "light", loading: i, className: o, ...c }) {
|
|
1712
|
+
const s = /* @__PURE__ */ a(te, { variant: l, loading: i, className: f("btn-icon", o), "aria-label": n, ...c, children: !i && /* @__PURE__ */ a(se, { name: e, size: t }) });
|
|
1713
|
+
return r ? /* @__PURE__ */ a(Qe, { content: r, children: s }) : s;
|
|
1714
|
+
}
|
|
1715
|
+
function gt({ leading: e, title: n, description: t, trailing: r, onClick: l, disabled: i, dense: o, className: c }) {
|
|
1716
|
+
const s = /* @__PURE__ */ p(H, { children: [
|
|
1717
|
+
e && /* @__PURE__ */ a("span", { className: "flex-shrink-0 d-inline-flex align-items-center", children: e }),
|
|
1718
|
+
/* @__PURE__ */ p("span", { className: "flex-grow-1", style: { minWidth: 0 }, children: [
|
|
1719
|
+
/* @__PURE__ */ a("span", { className: "d-block text-truncate", children: n }),
|
|
1720
|
+
t && /* @__PURE__ */ a("span", { className: "d-block text-truncate small text-body-secondary", children: t })
|
|
1721
|
+
] }),
|
|
1722
|
+
r && /* @__PURE__ */ a("span", { className: "flex-shrink-0 d-inline-flex align-items-center", children: r })
|
|
1723
|
+
] }), d = f(
|
|
1724
|
+
"d-flex align-items-center text-start",
|
|
1725
|
+
o ? "gap-2 py-1" : "gap-3 py-2",
|
|
1726
|
+
l && "w-100 border-0 bg-transparent",
|
|
1727
|
+
i && "opacity-50",
|
|
1728
|
+
c
|
|
1729
|
+
);
|
|
1730
|
+
return l ? /* @__PURE__ */ a("button", { type: "button", className: d, onClick: l, disabled: i, children: s }) : /* @__PURE__ */ a("div", { className: d, "aria-disabled": i || void 0, children: s });
|
|
1731
|
+
}
|
|
1732
|
+
function dn(e, n, t, r) {
|
|
1733
|
+
if (e.length === 0)
|
|
1734
|
+
return [];
|
|
1735
|
+
const l = Math.min(...e), o = Math.max(...e) - l || 1, c = n - r * 2, s = t - r * 2, d = e.length > 1 ? c / (e.length - 1) : 0;
|
|
1736
|
+
return e.map((u, h) => {
|
|
1737
|
+
const m = r + d * h, v = r + s - (u - l) / o * s;
|
|
1738
|
+
return [m, v];
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
function un({ type: e, data: n, width: t, height: r, strokeWidth: l }) {
|
|
1742
|
+
const i = l, o = dn(n, t, r, i);
|
|
1743
|
+
if (o.length === 0)
|
|
1744
|
+
return null;
|
|
1745
|
+
const c = o.map(([s, d]) => `${s},${d}`).join(" ");
|
|
1746
|
+
return /* @__PURE__ */ p(H, { children: [
|
|
1747
|
+
e === "area" && /* @__PURE__ */ a(
|
|
1748
|
+
"polygon",
|
|
1749
|
+
{
|
|
1750
|
+
points: `${i},${r - i} ${c} ${t - i},${r - i}`,
|
|
1751
|
+
fill: "currentColor",
|
|
1752
|
+
opacity: 0.2,
|
|
1753
|
+
stroke: "none"
|
|
1754
|
+
}
|
|
1755
|
+
),
|
|
1756
|
+
/* @__PURE__ */ a("polyline", { points: c, fill: "none", stroke: "currentColor", strokeWidth: l, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1757
|
+
] });
|
|
1758
|
+
}
|
|
1759
|
+
function fn({ data: e, width: n, height: t }) {
|
|
1760
|
+
if (e.length === 0)
|
|
1761
|
+
return null;
|
|
1762
|
+
const r = Math.min(0, ...e), i = Math.max(0, ...e) - r || 1, o = 2, c = Math.max((n - o * (e.length - 1)) / e.length, 1);
|
|
1763
|
+
return /* @__PURE__ */ a(H, { children: e.map((s, d) => {
|
|
1764
|
+
const u = Math.max((s - r) / i * t, 1), h = d * (c + o), m = t - u;
|
|
1765
|
+
return /* @__PURE__ */ a("rect", { x: h, y: m, width: c, height: u, rx: 1, fill: "currentColor" }, d);
|
|
1766
|
+
}) });
|
|
1767
|
+
}
|
|
1768
|
+
function yt({ type: e = "line", data: n, tone: t = "primary", width: r = 80, height: l = 28, strokeWidth: i = 2, className: o, label: c }) {
|
|
1769
|
+
return /* @__PURE__ */ a(
|
|
1770
|
+
"svg",
|
|
1771
|
+
{
|
|
1772
|
+
width: r,
|
|
1773
|
+
height: l,
|
|
1774
|
+
viewBox: `0 0 ${r} ${l}`,
|
|
1775
|
+
className: f(`text-${t}`, o),
|
|
1776
|
+
role: c ? "img" : void 0,
|
|
1777
|
+
"aria-label": c,
|
|
1778
|
+
"aria-hidden": c ? void 0 : !0,
|
|
1779
|
+
children: e === "bar" ? /* @__PURE__ */ a(fn, { data: n, width: r, height: l }) : /* @__PURE__ */ a(un, { type: e, data: n, width: r, height: l, strokeWidth: i })
|
|
1780
|
+
}
|
|
1781
|
+
);
|
|
1782
|
+
}
|
|
1783
|
+
const mn = {
|
|
1784
|
+
up: "success",
|
|
1785
|
+
down: "danger",
|
|
1786
|
+
neutral: "muted"
|
|
1787
|
+
}, hn = {
|
|
1788
|
+
up: "bi bi-arrow-up-short",
|
|
1789
|
+
down: "bi bi-arrow-down-short",
|
|
1790
|
+
neutral: "bi bi-dash"
|
|
1791
|
+
};
|
|
1792
|
+
function bn(e, n) {
|
|
1793
|
+
return typeof e == "number" && n != null ? e.toFixed(n) : String(e);
|
|
1794
|
+
}
|
|
1795
|
+
function Nt({ label: e, value: n, prefix: t, suffix: r, precision: l, trend: i, delta: o, loading: c, className: s }) {
|
|
1796
|
+
return /* @__PURE__ */ p("div", { className: f("d-flex flex-column gap-1", s), children: [
|
|
1797
|
+
/* @__PURE__ */ a(q, { size: "sm", tone: "muted", children: e }),
|
|
1798
|
+
c ? /* @__PURE__ */ a(ee, { height: "1.75rem", width: "60%" }) : /* @__PURE__ */ p("div", { className: "d-flex align-items-baseline gap-1", children: [
|
|
1799
|
+
t && /* @__PURE__ */ a(q, { size: "lg", weight: "semibold", children: t }),
|
|
1800
|
+
/* @__PURE__ */ a(q, { size: "xl", weight: "bold", children: bn(n, l) }),
|
|
1801
|
+
r && /* @__PURE__ */ a(q, { size: "lg", weight: "semibold", children: r })
|
|
1802
|
+
] }),
|
|
1803
|
+
!c && (i || o != null) && /* @__PURE__ */ p(q, { size: "sm", tone: i ? mn[i] : "muted", className: "d-inline-flex align-items-center gap-1", children: [
|
|
1804
|
+
i && /* @__PURE__ */ a(se, { name: hn[i], size: "sm" }),
|
|
1805
|
+
o
|
|
1806
|
+
] })
|
|
1807
|
+
] });
|
|
1808
|
+
}
|
|
1809
|
+
class pn extends Error {
|
|
1519
1810
|
constructor(n, t, r) {
|
|
1520
1811
|
super(`HTTP ${n} ${t} for ${r}`), this.name = "HttpError", this.status = n, this.statusText = t, this.url = r;
|
|
1521
1812
|
}
|
|
1522
1813
|
}
|
|
1523
|
-
function
|
|
1814
|
+
function vn(e) {
|
|
1524
1815
|
if (!e)
|
|
1525
1816
|
return "";
|
|
1526
1817
|
const n = new URLSearchParams();
|
|
@@ -1529,60 +1820,60 @@ function Ge(e) {
|
|
|
1529
1820
|
const t = n.toString();
|
|
1530
1821
|
return t ? `?${t}` : "";
|
|
1531
1822
|
}
|
|
1532
|
-
function
|
|
1823
|
+
function gn(e = {}) {
|
|
1533
1824
|
const { baseUrl: n = "", fetcher: t = fetch, buildRequestInit: r } = e;
|
|
1534
1825
|
return {
|
|
1535
|
-
async get(l,
|
|
1536
|
-
const
|
|
1537
|
-
let
|
|
1538
|
-
r && (
|
|
1539
|
-
const
|
|
1540
|
-
if (!
|
|
1541
|
-
throw new
|
|
1542
|
-
return await
|
|
1826
|
+
async get(l, i = {}) {
|
|
1827
|
+
const o = `${n}${l}${vn(i.params)}`;
|
|
1828
|
+
let c = { method: "GET", signal: i.signal };
|
|
1829
|
+
r && (c = r(o, c));
|
|
1830
|
+
const s = await t(o, c);
|
|
1831
|
+
if (!s.ok)
|
|
1832
|
+
throw new pn(s.status, s.statusText, o);
|
|
1833
|
+
return await s.json();
|
|
1543
1834
|
}
|
|
1544
1835
|
};
|
|
1545
1836
|
}
|
|
1546
|
-
const
|
|
1547
|
-
function
|
|
1837
|
+
const yn = gn();
|
|
1838
|
+
function Nn(e) {
|
|
1548
1839
|
return Object.keys(e).sort().reduce((n, t) => (n[t] = e[t], n), {});
|
|
1549
1840
|
}
|
|
1550
|
-
function
|
|
1551
|
-
client: e =
|
|
1841
|
+
function Y({
|
|
1842
|
+
client: e = yn,
|
|
1552
1843
|
url: n,
|
|
1553
1844
|
params: t,
|
|
1554
1845
|
mapResponse: r,
|
|
1555
1846
|
enabled: l = !0
|
|
1556
1847
|
}) {
|
|
1557
|
-
const [
|
|
1558
|
-
|
|
1848
|
+
const [i, o] = M("idle"), [c, s] = M([]), [d, u] = M(null), [h, m] = M(0), v = ne(() => t ? JSON.stringify(Nn(t)) : "", [t]), g = O(0), w = O(r);
|
|
1849
|
+
w.current = r, _(() => {
|
|
1559
1850
|
if (!l || !n) {
|
|
1560
|
-
|
|
1851
|
+
o("idle"), s([]), u(null);
|
|
1561
1852
|
return;
|
|
1562
1853
|
}
|
|
1563
|
-
const
|
|
1564
|
-
return
|
|
1565
|
-
if (
|
|
1854
|
+
const y = ++g.current, S = new AbortController();
|
|
1855
|
+
return o("loading"), u(null), e.get(n, { params: t, signal: S.signal }).then((x) => {
|
|
1856
|
+
if (y !== g.current)
|
|
1566
1857
|
return;
|
|
1567
|
-
const
|
|
1568
|
-
|
|
1569
|
-
}).catch((
|
|
1570
|
-
|
|
1858
|
+
const I = w.current(x);
|
|
1859
|
+
s(I), o(I.length === 0 ? "empty" : "success");
|
|
1860
|
+
}).catch((x) => {
|
|
1861
|
+
y === g.current && (x instanceof DOMException && x.name === "AbortError" || (u(x instanceof Error ? x : new Error(String(x))), o("error")));
|
|
1571
1862
|
}), () => {
|
|
1572
|
-
|
|
1863
|
+
S.abort();
|
|
1573
1864
|
};
|
|
1574
|
-
}, [e, n,
|
|
1575
|
-
const
|
|
1576
|
-
return { state:
|
|
1865
|
+
}, [e, n, v, l, h]);
|
|
1866
|
+
const k = A(() => m((y) => y + 1), []);
|
|
1867
|
+
return { state: i, items: c, error: d, reload: k };
|
|
1577
1868
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const [t, r] =
|
|
1580
|
-
return
|
|
1869
|
+
function xn(e, n) {
|
|
1870
|
+
const [t, r] = M(e);
|
|
1871
|
+
return _(() => {
|
|
1581
1872
|
const l = setTimeout(() => r(e), n);
|
|
1582
1873
|
return () => clearTimeout(l);
|
|
1583
1874
|
}, [e, n]), t;
|
|
1584
1875
|
}
|
|
1585
|
-
function
|
|
1876
|
+
function Q(e) {
|
|
1586
1877
|
if (Array.isArray(e))
|
|
1587
1878
|
return e;
|
|
1588
1879
|
if (e && typeof e == "object" && Array.isArray(e.items))
|
|
@@ -1591,7 +1882,7 @@ function Z(e) {
|
|
|
1591
1882
|
"Unable to normalize remote response into an array. Provide an explicit `mapResponse` for this endpoint's response shape."
|
|
1592
1883
|
);
|
|
1593
1884
|
}
|
|
1594
|
-
function
|
|
1885
|
+
function le(e, n, t) {
|
|
1595
1886
|
if (e === null || typeof e != "object")
|
|
1596
1887
|
throw new Error("Remote item is not an object; cannot read valueMember/displayMember from it.");
|
|
1597
1888
|
const r = e;
|
|
@@ -1600,151 +1891,151 @@ function ne(e, n, t) {
|
|
|
1600
1891
|
label: String(r[t] ?? "")
|
|
1601
1892
|
};
|
|
1602
1893
|
}
|
|
1603
|
-
function
|
|
1894
|
+
function wn({
|
|
1604
1895
|
url: e,
|
|
1605
1896
|
params: n,
|
|
1606
1897
|
valueMember: t,
|
|
1607
1898
|
displayMember: r,
|
|
1608
1899
|
mapResponse: l,
|
|
1609
|
-
client:
|
|
1610
|
-
enabled:
|
|
1611
|
-
...
|
|
1900
|
+
client: i,
|
|
1901
|
+
enabled: o,
|
|
1902
|
+
...c
|
|
1612
1903
|
}) {
|
|
1613
|
-
const { state:
|
|
1614
|
-
client:
|
|
1904
|
+
const { state: s, items: d, error: u } = Y({
|
|
1905
|
+
client: i,
|
|
1615
1906
|
url: e,
|
|
1616
1907
|
params: n,
|
|
1617
|
-
enabled:
|
|
1618
|
-
mapResponse: (m) => (l ? l(m) :
|
|
1619
|
-
}), h =
|
|
1620
|
-
return /* @__PURE__ */ a(
|
|
1908
|
+
enabled: o,
|
|
1909
|
+
mapResponse: (m) => (l ? l(m) : Q(m)).map((g) => le(g, t, r))
|
|
1910
|
+
}), h = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
|
|
1911
|
+
return /* @__PURE__ */ a(Re, { ...c, options: d, loading: s === "loading", error: h });
|
|
1621
1912
|
}
|
|
1622
|
-
function
|
|
1913
|
+
function xt({
|
|
1623
1914
|
url: e,
|
|
1624
1915
|
params: n,
|
|
1625
1916
|
searchParam: t,
|
|
1626
1917
|
valueMember: r,
|
|
1627
1918
|
displayMember: l,
|
|
1628
|
-
mapResponse:
|
|
1629
|
-
minSearchLength:
|
|
1630
|
-
debounceMs:
|
|
1631
|
-
client:
|
|
1919
|
+
mapResponse: i,
|
|
1920
|
+
minSearchLength: o = 1,
|
|
1921
|
+
debounceMs: c = 300,
|
|
1922
|
+
client: s,
|
|
1632
1923
|
inputValue: d,
|
|
1633
1924
|
onInputValueChange: u,
|
|
1634
1925
|
...h
|
|
1635
1926
|
}) {
|
|
1636
|
-
const [m,
|
|
1927
|
+
const [m, v] = T({
|
|
1637
1928
|
value: d,
|
|
1638
1929
|
defaultValue: "",
|
|
1639
1930
|
onChange: u
|
|
1640
|
-
}),
|
|
1641
|
-
client:
|
|
1931
|
+
}), g = xn(m, c), w = g.length >= o, { state: k, items: y, error: S } = Y({
|
|
1932
|
+
client: s,
|
|
1642
1933
|
url: e,
|
|
1643
|
-
enabled:
|
|
1644
|
-
params: { ...n, [t]:
|
|
1645
|
-
mapResponse: (
|
|
1646
|
-
}),
|
|
1934
|
+
enabled: w,
|
|
1935
|
+
params: { ...n, [t]: g },
|
|
1936
|
+
mapResponse: (I) => (i ? i(I) : Q(I)).map((N) => le(N, r, l))
|
|
1937
|
+
}), x = h.error ?? (k === "error" ? (S == null ? void 0 : S.message) ?? "Failed to load suggestions" : void 0);
|
|
1647
1938
|
return /* @__PURE__ */ a(
|
|
1648
|
-
|
|
1939
|
+
Le,
|
|
1649
1940
|
{
|
|
1650
1941
|
...h,
|
|
1651
|
-
options:
|
|
1652
|
-
loading:
|
|
1653
|
-
error:
|
|
1942
|
+
options: y,
|
|
1943
|
+
loading: k === "loading",
|
|
1944
|
+
error: x,
|
|
1654
1945
|
inputValue: m,
|
|
1655
|
-
onInputValueChange:
|
|
1946
|
+
onInputValueChange: v,
|
|
1656
1947
|
filter: () => !0
|
|
1657
1948
|
}
|
|
1658
1949
|
);
|
|
1659
1950
|
}
|
|
1660
|
-
function
|
|
1951
|
+
function kn({
|
|
1661
1952
|
url: e,
|
|
1662
1953
|
params: n,
|
|
1663
1954
|
mapResponse: t,
|
|
1664
1955
|
getTotalCount: r,
|
|
1665
1956
|
pageSize: l = 20,
|
|
1666
|
-
client:
|
|
1667
|
-
...
|
|
1957
|
+
client: i,
|
|
1958
|
+
...o
|
|
1668
1959
|
}) {
|
|
1669
|
-
const [
|
|
1670
|
-
|
|
1960
|
+
const [c, s] = M(1), [d, u] = M(null), h = ne(() => JSON.stringify(n ?? {}), [n]), m = O(!0);
|
|
1961
|
+
_(() => {
|
|
1671
1962
|
if (m.current) {
|
|
1672
1963
|
m.current = !1;
|
|
1673
1964
|
return;
|
|
1674
1965
|
}
|
|
1675
|
-
|
|
1966
|
+
s(1);
|
|
1676
1967
|
}, [h]);
|
|
1677
|
-
const
|
|
1968
|
+
const v = ne(
|
|
1678
1969
|
() => ({
|
|
1679
1970
|
...n,
|
|
1680
|
-
page:
|
|
1971
|
+
page: c,
|
|
1681
1972
|
pageSize: l,
|
|
1682
1973
|
...d ? { sortKey: d.key, sortDirection: d.direction } : {}
|
|
1683
1974
|
}),
|
|
1684
|
-
[n,
|
|
1685
|
-
),
|
|
1686
|
-
client:
|
|
1975
|
+
[n, c, l, d]
|
|
1976
|
+
), g = O(void 0), { state: w, items: k, error: y } = Y({
|
|
1977
|
+
client: i,
|
|
1687
1978
|
url: e,
|
|
1688
|
-
params:
|
|
1689
|
-
mapResponse: (
|
|
1690
|
-
}),
|
|
1979
|
+
params: v,
|
|
1980
|
+
mapResponse: (N) => (g.current = N, t ? t(N) : Q(N))
|
|
1981
|
+
}), S = g.current !== void 0 ? r == null ? void 0 : r(g.current) : void 0, I = k.length >= l && l > 0 ? c * l + 1 : (c - 1) * l + k.length, b = S ?? I;
|
|
1691
1982
|
return /* @__PURE__ */ a(
|
|
1692
|
-
|
|
1983
|
+
Ue,
|
|
1693
1984
|
{
|
|
1694
|
-
...
|
|
1695
|
-
rows:
|
|
1696
|
-
loading:
|
|
1697
|
-
error:
|
|
1698
|
-
page:
|
|
1985
|
+
...o,
|
|
1986
|
+
rows: k,
|
|
1987
|
+
loading: w === "loading",
|
|
1988
|
+
error: y == null ? void 0 : y.message,
|
|
1989
|
+
page: c,
|
|
1699
1990
|
pageSize: l,
|
|
1700
|
-
totalCount:
|
|
1701
|
-
onPageChange:
|
|
1991
|
+
totalCount: b,
|
|
1992
|
+
onPageChange: s,
|
|
1702
1993
|
sort: d,
|
|
1703
|
-
onSortChange: (
|
|
1704
|
-
u(
|
|
1994
|
+
onSortChange: (N) => {
|
|
1995
|
+
u(N), s(1);
|
|
1705
1996
|
}
|
|
1706
1997
|
}
|
|
1707
1998
|
);
|
|
1708
1999
|
}
|
|
1709
|
-
function
|
|
2000
|
+
function wt({
|
|
1710
2001
|
url: e,
|
|
1711
2002
|
params: n,
|
|
1712
2003
|
valueMember: t,
|
|
1713
2004
|
displayMember: r,
|
|
1714
2005
|
mapResponse: l,
|
|
1715
|
-
client:
|
|
1716
|
-
enabled:
|
|
1717
|
-
...
|
|
2006
|
+
client: i,
|
|
2007
|
+
enabled: o,
|
|
2008
|
+
...c
|
|
1718
2009
|
}) {
|
|
1719
|
-
const { state:
|
|
1720
|
-
client:
|
|
2010
|
+
const { state: s, items: d, error: u } = Y({
|
|
2011
|
+
client: i,
|
|
1721
2012
|
url: e,
|
|
1722
2013
|
params: n,
|
|
1723
|
-
enabled:
|
|
1724
|
-
mapResponse: (m) => (l ? l(m) :
|
|
1725
|
-
}), h =
|
|
1726
|
-
return /* @__PURE__ */ a(
|
|
2014
|
+
enabled: o,
|
|
2015
|
+
mapResponse: (m) => (l ? l(m) : Q(m)).map((g) => le(g, t, r))
|
|
2016
|
+
}), h = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
|
|
2017
|
+
return /* @__PURE__ */ a(Ee, { ...c, options: d, loading: s === "loading", error: h });
|
|
1727
2018
|
}
|
|
1728
|
-
function
|
|
2019
|
+
function kt({
|
|
1729
2020
|
url: e,
|
|
1730
2021
|
params: n,
|
|
1731
2022
|
valueMember: t,
|
|
1732
2023
|
displayMember: r,
|
|
1733
2024
|
mapResponse: l,
|
|
1734
|
-
client:
|
|
1735
|
-
enabled:
|
|
1736
|
-
...
|
|
2025
|
+
client: i,
|
|
2026
|
+
enabled: o,
|
|
2027
|
+
...c
|
|
1737
2028
|
}) {
|
|
1738
|
-
const { state:
|
|
1739
|
-
client:
|
|
2029
|
+
const { state: s, items: d, error: u } = Y({
|
|
2030
|
+
client: i,
|
|
1740
2031
|
url: e,
|
|
1741
2032
|
params: n,
|
|
1742
|
-
enabled:
|
|
1743
|
-
mapResponse: (m) => (l ? l(m) :
|
|
1744
|
-
}), h =
|
|
1745
|
-
return /* @__PURE__ */ a(
|
|
2033
|
+
enabled: o,
|
|
2034
|
+
mapResponse: (m) => (l ? l(m) : Q(m)).map((g) => le(g, t, r))
|
|
2035
|
+
}), h = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
|
|
2036
|
+
return /* @__PURE__ */ a(Me, { ...c, options: d, loading: s === "loading", error: h });
|
|
1746
2037
|
}
|
|
1747
|
-
function
|
|
2038
|
+
function St() {
|
|
1748
2039
|
const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
1749
2040
|
return {
|
|
1750
2041
|
register(t, r) {
|
|
@@ -1761,7 +2052,7 @@ function et() {
|
|
|
1761
2052
|
}
|
|
1762
2053
|
};
|
|
1763
2054
|
}
|
|
1764
|
-
function
|
|
2055
|
+
function Ct(e) {
|
|
1765
2056
|
const n = new Map(Object.entries(e ?? {}));
|
|
1766
2057
|
return {
|
|
1767
2058
|
register(t, r) {
|
|
@@ -1772,7 +2063,7 @@ function nt(e) {
|
|
|
1772
2063
|
}
|
|
1773
2064
|
};
|
|
1774
2065
|
}
|
|
1775
|
-
function
|
|
2066
|
+
function It() {
|
|
1776
2067
|
const e = /* @__PURE__ */ new Map();
|
|
1777
2068
|
return {
|
|
1778
2069
|
register(n, t) {
|
|
@@ -1783,10 +2074,10 @@ function tt() {
|
|
|
1783
2074
|
}
|
|
1784
2075
|
};
|
|
1785
2076
|
}
|
|
1786
|
-
function
|
|
2077
|
+
function Sn(e) {
|
|
1787
2078
|
return "dataSource" in e;
|
|
1788
2079
|
}
|
|
1789
|
-
function
|
|
2080
|
+
function Cn(e, n) {
|
|
1790
2081
|
if (!e)
|
|
1791
2082
|
return;
|
|
1792
2083
|
const t = {};
|
|
@@ -1794,10 +2085,10 @@ function Xe(e, n) {
|
|
|
1794
2085
|
t[r] = l.kind === "static" ? l.value : n[l.field];
|
|
1795
2086
|
return t;
|
|
1796
2087
|
}
|
|
1797
|
-
function
|
|
2088
|
+
function fe(e, n, t) {
|
|
1798
2089
|
return n && t ? t(n) : e;
|
|
1799
2090
|
}
|
|
1800
|
-
function
|
|
2091
|
+
function X(e, n) {
|
|
1801
2092
|
const { values: t, translate: r } = n;
|
|
1802
2093
|
return {
|
|
1803
2094
|
metadata: e,
|
|
@@ -1805,39 +2096,39 @@ function Q(e, n) {
|
|
|
1805
2096
|
readOnly: e.readOnly ?? !1,
|
|
1806
2097
|
disabled: e.disabled ?? !1,
|
|
1807
2098
|
required: e.required ?? !1,
|
|
1808
|
-
label:
|
|
2099
|
+
label: fe(e.label, e.labelKey, r),
|
|
1809
2100
|
placeholder: e.placeholder,
|
|
1810
2101
|
helpText: e.helpText,
|
|
1811
|
-
validationMessage:
|
|
1812
|
-
params:
|
|
2102
|
+
validationMessage: fe(e.validationMessage, e.validationMessageKey, r),
|
|
2103
|
+
params: Sn(e) ? Cn(e.dataSource.params, t) : void 0
|
|
1813
2104
|
};
|
|
1814
2105
|
}
|
|
1815
|
-
function
|
|
2106
|
+
function Dt(e, n, t) {
|
|
1816
2107
|
const r = n == null ? void 0 : n.fields.find((l) => l.name === e);
|
|
1817
2108
|
if (r)
|
|
1818
|
-
return
|
|
2109
|
+
return X(r, t);
|
|
1819
2110
|
}
|
|
1820
|
-
const
|
|
1821
|
-
function
|
|
2111
|
+
const In = [];
|
|
2112
|
+
function Dn(e, n) {
|
|
1822
2113
|
const t = {};
|
|
1823
2114
|
for (const r of n)
|
|
1824
2115
|
t[r] = e[r];
|
|
1825
2116
|
return t;
|
|
1826
2117
|
}
|
|
1827
|
-
function
|
|
1828
|
-
const r = e ??
|
|
1829
|
-
|
|
2118
|
+
function Vn(e, n, t) {
|
|
2119
|
+
const r = e ?? In, l = Dn(n, r), i = r.length === 0 ? "" : JSON.stringify(l), o = O(null), c = O(t);
|
|
2120
|
+
c.current = t, _(() => {
|
|
1830
2121
|
var d;
|
|
1831
2122
|
if (r.length === 0)
|
|
1832
2123
|
return;
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
2124
|
+
const s = o.current;
|
|
2125
|
+
if (s && s.key !== i)
|
|
1835
2126
|
for (const u of r)
|
|
1836
|
-
Object.is(
|
|
1837
|
-
|
|
1838
|
-
}, [
|
|
2127
|
+
Object.is(s.snapshot[u], l[u]) || (d = c.current) == null || d.call(c, u);
|
|
2128
|
+
o.current = { key: i, snapshot: l };
|
|
2129
|
+
}, [i]);
|
|
1839
2130
|
}
|
|
1840
|
-
function
|
|
2131
|
+
function Ce(e, n) {
|
|
1841
2132
|
const { actions: t, translate: r } = n, l = t.resolve(e.id);
|
|
1842
2133
|
return {
|
|
1843
2134
|
metadata: e,
|
|
@@ -1847,19 +2138,19 @@ function ye(e, n) {
|
|
|
1847
2138
|
handler: l
|
|
1848
2139
|
};
|
|
1849
2140
|
}
|
|
1850
|
-
function
|
|
2141
|
+
function Vt(e, n, t) {
|
|
1851
2142
|
var l;
|
|
1852
|
-
const r = (l = n == null ? void 0 : n.actions) == null ? void 0 : l.find((
|
|
2143
|
+
const r = (l = n == null ? void 0 : n.actions) == null ? void 0 : l.find((i) => i.id === e);
|
|
1853
2144
|
if (r)
|
|
1854
|
-
return
|
|
2145
|
+
return Ce(r, t);
|
|
1855
2146
|
}
|
|
1856
|
-
const
|
|
1857
|
-
const t =
|
|
2147
|
+
const $n = (e, n) => {
|
|
2148
|
+
const t = X(e, { values: n.values, translate: n.translate });
|
|
1858
2149
|
if (!t.visible)
|
|
1859
2150
|
return null;
|
|
1860
2151
|
const r = n.dataSources.resolve(e.dataSource.id);
|
|
1861
2152
|
return r ? /* @__PURE__ */ a(
|
|
1862
|
-
|
|
2153
|
+
wn,
|
|
1863
2154
|
{
|
|
1864
2155
|
label: t.label,
|
|
1865
2156
|
url: r.url,
|
|
@@ -1876,64 +2167,52 @@ const rn = (e, n) => {
|
|
|
1876
2167
|
onChange: (l) => n.onFieldChange(e.name, l)
|
|
1877
2168
|
}
|
|
1878
2169
|
) : (console.warn(`Smart: no data source registered for id "${e.dataSource.id}" (field "${e.name}"). Skipping.`), null);
|
|
1879
|
-
}, ln = {
|
|
1880
|
-
text: (e) => e == null ? "" : String(e),
|
|
1881
|
-
boolean: (e, n) => n ? n(e ? "smart.boolean.true" : "smart.boolean.false") : e ? "Yes" : "No",
|
|
1882
|
-
date: (e) => {
|
|
1883
|
-
if (e == null || e === "")
|
|
1884
|
-
return "";
|
|
1885
|
-
const n = e instanceof Date ? e : new Date(String(e));
|
|
1886
|
-
return Number.isNaN(n.getTime()) ? String(e) : n.toLocaleDateString();
|
|
1887
|
-
},
|
|
1888
|
-
currency: (e) => {
|
|
1889
|
-
const n = Number(e);
|
|
1890
|
-
return Number.isFinite(n) ? n.toLocaleString(void 0, { style: "currency", currency: "USD" }) : String(e ?? "");
|
|
1891
|
-
}
|
|
1892
2170
|
};
|
|
1893
|
-
function
|
|
2171
|
+
function Tn(e, n) {
|
|
1894
2172
|
if (e.visible === !1)
|
|
1895
2173
|
return null;
|
|
1896
|
-
const t = e.headerKey && n ? n(e.headerKey) : e.header ?? e.key, r = e.format
|
|
2174
|
+
const t = e.headerKey && n ? n(e.headerKey) : e.header ?? e.key, r = e.format === "boolean" && !!n;
|
|
1897
2175
|
return {
|
|
1898
2176
|
key: e.key,
|
|
1899
2177
|
header: t,
|
|
1900
2178
|
sortable: e.sortable,
|
|
1901
|
-
|
|
2179
|
+
format: r ? void 0 : e.format,
|
|
2180
|
+
formatter: r ? (l) => n(l ? "smart.boolean.true" : "smart.boolean.false") : void 0
|
|
1902
2181
|
};
|
|
1903
2182
|
}
|
|
1904
|
-
const
|
|
1905
|
-
const t =
|
|
2183
|
+
const En = (e, n) => {
|
|
2184
|
+
const t = X(e, { values: n.values, translate: n.translate });
|
|
1906
2185
|
if (!t.visible)
|
|
1907
2186
|
return null;
|
|
1908
2187
|
const r = n.dataSources.resolve(e.dataSource.id);
|
|
1909
2188
|
if (!r)
|
|
1910
2189
|
return console.warn(`Smart: no data source registered for id "${e.dataSource.id}" (field "${e.name}"). Skipping.`), null;
|
|
1911
|
-
const l = e.columns.map((
|
|
1912
|
-
const
|
|
1913
|
-
return typeof
|
|
2190
|
+
const l = e.columns.map((c) => Tn(c, n.translate)).filter((c) => c !== null), i = e.totalCountField, o = i ? (c) => {
|
|
2191
|
+
const s = c == null ? void 0 : c[i];
|
|
2192
|
+
return typeof s == "number" ? s : void 0;
|
|
1914
2193
|
} : void 0;
|
|
1915
2194
|
return /* @__PURE__ */ a(
|
|
1916
|
-
|
|
2195
|
+
kn,
|
|
1917
2196
|
{
|
|
1918
2197
|
url: r.url,
|
|
1919
2198
|
client: r.client,
|
|
1920
2199
|
params: t.params,
|
|
1921
2200
|
columns: l,
|
|
1922
|
-
rowKey: (
|
|
1923
|
-
getTotalCount:
|
|
2201
|
+
rowKey: (c) => c[e.rowKey],
|
|
2202
|
+
getTotalCount: o
|
|
1924
2203
|
}
|
|
1925
2204
|
);
|
|
1926
2205
|
};
|
|
1927
|
-
function
|
|
2206
|
+
function me(e) {
|
|
1928
2207
|
if (!e)
|
|
1929
2208
|
return;
|
|
1930
2209
|
const n = new Date(e);
|
|
1931
2210
|
return Number.isNaN(n.getTime()) ? void 0 : n;
|
|
1932
2211
|
}
|
|
1933
|
-
const
|
|
1934
|
-
const t =
|
|
2212
|
+
const Mn = (e, n) => {
|
|
2213
|
+
const t = X(e, { values: n.values, translate: n.translate });
|
|
1935
2214
|
return t.visible ? /* @__PURE__ */ a(
|
|
1936
|
-
|
|
2215
|
+
Oe,
|
|
1937
2216
|
{
|
|
1938
2217
|
label: t.label,
|
|
1939
2218
|
required: t.required,
|
|
@@ -1941,16 +2220,16 @@ const on = (e, n) => {
|
|
|
1941
2220
|
disabled: t.disabled,
|
|
1942
2221
|
helpText: t.helpText,
|
|
1943
2222
|
error: t.validationMessage,
|
|
1944
|
-
min:
|
|
1945
|
-
max:
|
|
2223
|
+
min: me(e.minDate),
|
|
2224
|
+
max: me(e.maxDate),
|
|
1946
2225
|
value: n.values[e.name] ?? null,
|
|
1947
2226
|
onChange: (r) => n.onFieldChange(e.name, r)
|
|
1948
2227
|
}
|
|
1949
2228
|
) : null;
|
|
1950
|
-
},
|
|
1951
|
-
const t =
|
|
2229
|
+
}, On = (e, n) => {
|
|
2230
|
+
const t = X(e, { values: n.values, translate: n.translate });
|
|
1952
2231
|
return t.visible ? /* @__PURE__ */ a(
|
|
1953
|
-
|
|
2232
|
+
Z,
|
|
1954
2233
|
{
|
|
1955
2234
|
label: t.label,
|
|
1956
2235
|
required: t.required,
|
|
@@ -1965,128 +2244,135 @@ const on = (e, n) => {
|
|
|
1965
2244
|
}
|
|
1966
2245
|
) : null;
|
|
1967
2246
|
};
|
|
1968
|
-
function
|
|
1969
|
-
e.register("Input",
|
|
2247
|
+
function $t(e) {
|
|
2248
|
+
e.register("Input", On), e.register("ComboBox", $n), e.register("DatePicker", Mn), e.register("DataGrid", En);
|
|
1970
2249
|
}
|
|
1971
|
-
function
|
|
2250
|
+
function Rn({ metadata: e, ctx: n }) {
|
|
1972
2251
|
const t = n.onMetadataRefreshNeeded;
|
|
1973
|
-
return
|
|
2252
|
+
return Vn(
|
|
1974
2253
|
e.dependsOn,
|
|
1975
2254
|
n.values,
|
|
1976
2255
|
t ? (r) => t(e.name, r) : void 0
|
|
1977
2256
|
), e.visible === !1 ? null : n.registry.resolve(e, n);
|
|
1978
2257
|
}
|
|
1979
|
-
const
|
|
1980
|
-
function
|
|
2258
|
+
const Ie = 1;
|
|
2259
|
+
function An(e) {
|
|
1981
2260
|
const n = Number(e.split(".")[0]);
|
|
1982
|
-
return Number.isFinite(n) && n ===
|
|
2261
|
+
return Number.isFinite(n) && n === Ie;
|
|
1983
2262
|
}
|
|
1984
|
-
function
|
|
1985
|
-
return
|
|
2263
|
+
function Tt({ metadata: e, ctx: n }) {
|
|
2264
|
+
return An(e.schemaVersion) ? /* @__PURE__ */ a(H, { children: e.fields.map((t) => /* @__PURE__ */ a(Rn, { metadata: t, ctx: n }, t.name)) }) : /* @__PURE__ */ p(xe, { variant: "danger", children: [
|
|
1986
2265
|
'Unsupported form schema version "',
|
|
1987
2266
|
e.schemaVersion,
|
|
1988
2267
|
'" — this app understands schema version ',
|
|
1989
|
-
|
|
2268
|
+
Ie,
|
|
1990
2269
|
".x."
|
|
1991
2270
|
] });
|
|
1992
2271
|
}
|
|
1993
|
-
function
|
|
1994
|
-
const t =
|
|
1995
|
-
return t.visible ? /* @__PURE__ */ a(
|
|
2272
|
+
function Ln({ metadata: e, ctx: n }) {
|
|
2273
|
+
const t = Ce(e, n);
|
|
2274
|
+
return t.visible ? /* @__PURE__ */ a(te, { disabled: !t.enabled, onClick: () => {
|
|
1996
2275
|
var r;
|
|
1997
2276
|
return (r = t.handler) == null ? void 0 : r.call(t);
|
|
1998
2277
|
}, children: t.label ?? e.id }) : null;
|
|
1999
2278
|
}
|
|
2000
|
-
function
|
|
2001
|
-
return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */ a(
|
|
2279
|
+
function Et({ metadata: e, ctx: n }) {
|
|
2280
|
+
return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */ a(H, { children: e.actions.map((t) => /* @__PURE__ */ a(Ln, { metadata: t, ctx: n }, t.id)) });
|
|
2002
2281
|
}
|
|
2003
2282
|
export {
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
Q as
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2283
|
+
Ye as Accordion,
|
|
2284
|
+
xe as Alert,
|
|
2285
|
+
Le as AutoComplete,
|
|
2286
|
+
ot as Avatar,
|
|
2287
|
+
Ge as Badge,
|
|
2288
|
+
rn as Breadcrumb,
|
|
2289
|
+
te as Button,
|
|
2290
|
+
nt as Card,
|
|
2291
|
+
_n as CheckBox,
|
|
2292
|
+
at as Col,
|
|
2293
|
+
Re as ComboBox,
|
|
2294
|
+
Yn as ConfirmProvider,
|
|
2295
|
+
rt as Container,
|
|
2296
|
+
Ue as DataGrid,
|
|
2297
|
+
Oe as DatePicker,
|
|
2298
|
+
Gn as DateTimePicker,
|
|
2299
|
+
tt as Divider,
|
|
2300
|
+
Hn as FileInput,
|
|
2301
|
+
pt as Flex,
|
|
2302
|
+
Wn as FormField,
|
|
2303
|
+
pn as HttpError,
|
|
2304
|
+
se as Icon,
|
|
2305
|
+
vt as IconButton,
|
|
2306
|
+
Z as Input,
|
|
2307
|
+
$e as Label,
|
|
2308
|
+
gt as ListItem,
|
|
2309
|
+
it as Menu,
|
|
2310
|
+
Pe as Modal,
|
|
2311
|
+
Me as MultiSelect,
|
|
2312
|
+
mt as Navbar,
|
|
2313
|
+
Bn as NumberInput,
|
|
2314
|
+
bt as PageHeader,
|
|
2315
|
+
Ke as Pagination,
|
|
2316
|
+
jn as PasswordInput,
|
|
2317
|
+
et as Popover,
|
|
2318
|
+
W as Popup,
|
|
2319
|
+
ft as ProgressBar,
|
|
2320
|
+
Te as RadioButton,
|
|
2321
|
+
qn as RadioGroup,
|
|
2322
|
+
ut as Rating,
|
|
2323
|
+
xt as RemoteAutoComplete,
|
|
2324
|
+
wn as RemoteComboBox,
|
|
2325
|
+
kn as RemoteDataGrid,
|
|
2326
|
+
kt as RemoteMultiSelect,
|
|
2327
|
+
wt as RemoteSelect,
|
|
2328
|
+
lt as Row,
|
|
2329
|
+
Ee as Select,
|
|
2330
|
+
ht as Sidebar,
|
|
2331
|
+
ee as Skeleton,
|
|
2332
|
+
dt as Slider,
|
|
2333
|
+
Ln as SmartAction,
|
|
2334
|
+
Et as SmartActions,
|
|
2335
|
+
Rn as SmartField,
|
|
2336
|
+
Tt as SmartForm,
|
|
2337
|
+
yt as Sparkline,
|
|
2338
|
+
qe as Spinner,
|
|
2339
|
+
Se as Stack,
|
|
2340
|
+
Nt as Statistic,
|
|
2341
|
+
st as Stepper,
|
|
2342
|
+
Un as Switch,
|
|
2343
|
+
Xn as Tabs,
|
|
2344
|
+
ct as Tag,
|
|
2345
|
+
q as Text,
|
|
2346
|
+
Kn as TextArea,
|
|
2347
|
+
zn as TimePicker,
|
|
2348
|
+
Jn as ToastProvider,
|
|
2349
|
+
Qe as Tooltip,
|
|
2350
|
+
pe as ValidationMessage,
|
|
2351
|
+
$n as comboBoxResolver,
|
|
2352
|
+
gn as createHttpClient,
|
|
2353
|
+
It as createSmartActionRegistry,
|
|
2354
|
+
St as createSmartComponentRegistry,
|
|
2355
|
+
Ct as createSmartDataSourceRegistry,
|
|
2356
|
+
Be as dataGridFormatters,
|
|
2357
|
+
En as dataGridResolver,
|
|
2358
|
+
Mn as datePickerResolver,
|
|
2359
|
+
Q as defaultArrayNormalization,
|
|
2360
|
+
yn as defaultHttpClient,
|
|
2361
|
+
ge as fromDateInputValue,
|
|
2362
|
+
Ne as fromTimeInputValue,
|
|
2363
|
+
On as inputResolver,
|
|
2364
|
+
$t as registerBuiltInResolvers,
|
|
2365
|
+
Ce as resolveSmartActionMetadata,
|
|
2366
|
+
X as resolveSmartFieldMetadata,
|
|
2367
|
+
z as toDateInputValue,
|
|
2368
|
+
le as toSelectOption,
|
|
2369
|
+
ye as toTimeInputValue,
|
|
2370
|
+
Qn as useConfirm,
|
|
2371
|
+
xn as useDebouncedValue,
|
|
2372
|
+
Y as useRemoteData,
|
|
2373
|
+
Vt as useSmartAction,
|
|
2374
|
+
Vn as useSmartDependencies,
|
|
2375
|
+
Dt as useSmartField,
|
|
2376
|
+
Zn as useToast
|
|
2091
2377
|
};
|
|
2092
2378
|
//# sourceMappingURL=index.js.map
|