rich-react-component 0.2.0 → 0.3.1
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/LICENSE +21 -21
- package/README.md +314 -120
- package/dist/base/Appearance.d.ts +116 -0
- package/dist/base/AppearanceMenu.d.ts +65 -0
- package/dist/base/Badge.d.ts +8 -1
- package/dist/base/Button.d.ts +9 -1
- package/dist/base/Sidebar.d.ts +111 -21
- package/dist/base/Tag.d.ts +4 -2
- package/dist/base/Tooltip.d.ts +8 -1
- package/dist/base/appearanceSchemes.d.ts +92 -0
- package/dist/base/index.d.ts +4 -0
- package/dist/base/sidebarModel.d.ts +171 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.js +2211 -1333
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -0
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
function
|
|
1
|
+
import { jsxs as y, jsx as o, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as L, useState as M, useCallback as F, useId as W, useEffect as U, createContext as Ve, useMemo as J, useContext as we, useLayoutEffect as _r } from "react";
|
|
3
|
+
function h(...e) {
|
|
4
4
|
return e.filter(Boolean).join(" ");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
function xr({ htmlFor: e, required: r, className: n, children: t }) {
|
|
7
|
+
return /* @__PURE__ */ y("label", { htmlFor: e, className: h("form-label", "rrc-label", n), children: [
|
|
8
|
+
t,
|
|
9
|
+
r && /* @__PURE__ */ o("span", { className: "text-danger", children: " *" })
|
|
10
10
|
] });
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return e ? /* @__PURE__ */
|
|
12
|
+
function er({ error: e, helpText: r, className: n }) {
|
|
13
|
+
return e ? /* @__PURE__ */ o("div", { className: h("invalid-feedback d-block", "rrc-field__error", n), children: e }) : r ? /* @__PURE__ */ o("div", { className: h("form-text", "rrc-field__help", n), children: r }) : null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
15
|
+
function Y({ id: e, label: r, required: n, error: t, helpText: a, className: i, children: l }) {
|
|
16
|
+
return /* @__PURE__ */ y("div", { className: h("mb-3", "rrc-field", i), children: [
|
|
17
|
+
r && /* @__PURE__ */ o(xr, { htmlFor: e, required: n, children: r }),
|
|
18
|
+
l,
|
|
19
|
+
/* @__PURE__ */ o(er, { error: t, helpText: a })
|
|
20
20
|
] });
|
|
21
21
|
}
|
|
22
22
|
function T({
|
|
23
23
|
value: e,
|
|
24
|
-
defaultValue:
|
|
25
|
-
onChange:
|
|
24
|
+
defaultValue: r,
|
|
25
|
+
onChange: n
|
|
26
26
|
}) {
|
|
27
|
-
const
|
|
28
|
-
process.env.NODE_ENV !== "production" &&
|
|
27
|
+
const t = e !== void 0, a = L(t);
|
|
28
|
+
process.env.NODE_ENV !== "production" && a.current !== t && 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 [i,
|
|
31
|
+
const [i, l] = M(r), c = t ? e : i, s = F(
|
|
32
32
|
(d) => {
|
|
33
|
-
|
|
33
|
+
t || l(d), n == null || n(d);
|
|
34
34
|
},
|
|
35
|
-
[
|
|
35
|
+
[t, n]
|
|
36
36
|
);
|
|
37
37
|
return [c, s];
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function de(e) {
|
|
40
40
|
const {
|
|
41
|
-
id:
|
|
42
|
-
name:
|
|
43
|
-
disabled:
|
|
44
|
-
readOnly:
|
|
41
|
+
id: r,
|
|
42
|
+
name: n,
|
|
43
|
+
disabled: t,
|
|
44
|
+
readOnly: a,
|
|
45
45
|
required: i,
|
|
46
|
-
className:
|
|
46
|
+
className: l,
|
|
47
47
|
label: c,
|
|
48
48
|
placeholder: s,
|
|
49
49
|
helpText: d,
|
|
50
50
|
error: u,
|
|
51
|
-
value:
|
|
51
|
+
value: f,
|
|
52
52
|
defaultValue: m,
|
|
53
|
-
onChange:
|
|
54
|
-
onBlur:
|
|
55
|
-
type:
|
|
56
|
-
maxLength:
|
|
57
|
-
autoFocus:
|
|
58
|
-
inputProps:
|
|
59
|
-
endAdornment:
|
|
60
|
-
} = e, [
|
|
61
|
-
value:
|
|
53
|
+
onChange: p,
|
|
54
|
+
onBlur: k,
|
|
55
|
+
type: S = "text",
|
|
56
|
+
maxLength: x,
|
|
57
|
+
autoFocus: _,
|
|
58
|
+
inputProps: C,
|
|
59
|
+
endAdornment: v
|
|
60
|
+
} = e, [N, b] = T({
|
|
61
|
+
value: f,
|
|
62
62
|
defaultValue: m ?? "",
|
|
63
|
-
onChange:
|
|
64
|
-
}),
|
|
63
|
+
onChange: p
|
|
64
|
+
}), w = W(), g = r ?? w, I = /* @__PURE__ */ o(
|
|
65
65
|
"input",
|
|
66
66
|
{
|
|
67
|
-
id:
|
|
68
|
-
name:
|
|
69
|
-
className:
|
|
70
|
-
disabled:
|
|
71
|
-
readOnly:
|
|
67
|
+
id: g,
|
|
68
|
+
name: n,
|
|
69
|
+
className: h("form-control", "rrc-input", u && "is-invalid"),
|
|
70
|
+
disabled: t,
|
|
71
|
+
readOnly: a,
|
|
72
72
|
required: i,
|
|
73
73
|
placeholder: s,
|
|
74
|
-
maxLength:
|
|
75
|
-
autoFocus:
|
|
76
|
-
value:
|
|
77
|
-
onChange: (
|
|
78
|
-
onBlur:
|
|
79
|
-
type:
|
|
80
|
-
...
|
|
74
|
+
maxLength: x,
|
|
75
|
+
autoFocus: _,
|
|
76
|
+
value: N,
|
|
77
|
+
onChange: (D) => b(D.target.value),
|
|
78
|
+
onBlur: k,
|
|
79
|
+
type: S,
|
|
80
|
+
...C
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
] }) :
|
|
83
|
+
return /* @__PURE__ */ o(Y, { id: g, label: c, required: i, error: u, helpText: d, className: l, children: v ? /* @__PURE__ */ y("div", { className: "input-group rrc-input-group", children: [
|
|
84
|
+
I,
|
|
85
|
+
v
|
|
86
|
+
] }) : I });
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function nt(e) {
|
|
89
89
|
const {
|
|
90
|
-
id:
|
|
91
|
-
name:
|
|
92
|
-
disabled:
|
|
93
|
-
readOnly:
|
|
90
|
+
id: r,
|
|
91
|
+
name: n,
|
|
92
|
+
disabled: t,
|
|
93
|
+
readOnly: a,
|
|
94
94
|
required: i,
|
|
95
|
-
className:
|
|
95
|
+
className: l,
|
|
96
96
|
label: c,
|
|
97
97
|
placeholder: s,
|
|
98
98
|
helpText: d,
|
|
99
99
|
error: u,
|
|
100
|
-
value:
|
|
100
|
+
value: f,
|
|
101
101
|
defaultValue: m,
|
|
102
|
-
onChange:
|
|
103
|
-
onBlur:
|
|
104
|
-
rows:
|
|
105
|
-
maxLength:
|
|
106
|
-
} = e, [
|
|
107
|
-
value:
|
|
102
|
+
onChange: p,
|
|
103
|
+
onBlur: k,
|
|
104
|
+
rows: S = 3,
|
|
105
|
+
maxLength: x
|
|
106
|
+
} = e, [_, C] = T({
|
|
107
|
+
value: f,
|
|
108
108
|
defaultValue: m ?? "",
|
|
109
|
-
onChange:
|
|
110
|
-
}),
|
|
111
|
-
return /* @__PURE__ */
|
|
109
|
+
onChange: p
|
|
110
|
+
}), v = W(), N = r ?? v;
|
|
111
|
+
return /* @__PURE__ */ o(Y, { id: N, label: c, required: i, error: u, helpText: d, className: l, children: /* @__PURE__ */ o(
|
|
112
112
|
"textarea",
|
|
113
113
|
{
|
|
114
|
-
id:
|
|
115
|
-
name:
|
|
116
|
-
className:
|
|
117
|
-
disabled:
|
|
118
|
-
readOnly:
|
|
114
|
+
id: N,
|
|
115
|
+
name: n,
|
|
116
|
+
className: h("form-control", "rrc-input", u && "is-invalid"),
|
|
117
|
+
disabled: t,
|
|
118
|
+
readOnly: a,
|
|
119
119
|
required: i,
|
|
120
120
|
placeholder: s,
|
|
121
|
-
rows:
|
|
122
|
-
maxLength:
|
|
123
|
-
value:
|
|
124
|
-
onChange: (b) =>
|
|
125
|
-
onBlur:
|
|
121
|
+
rows: S,
|
|
122
|
+
maxLength: x,
|
|
123
|
+
value: _,
|
|
124
|
+
onChange: (b) => C(b.target.value),
|
|
125
|
+
onBlur: k
|
|
126
126
|
}
|
|
127
127
|
) });
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function tt({ value: e, defaultValue: r, onChange: n, min: t, max: a, step: i, ...l }) {
|
|
130
130
|
const [c, s] = T({
|
|
131
131
|
value: e,
|
|
132
|
-
defaultValue:
|
|
133
|
-
onChange:
|
|
132
|
+
defaultValue: r ?? null,
|
|
133
|
+
onChange: n
|
|
134
134
|
});
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
|
|
135
|
+
return /* @__PURE__ */ o(
|
|
136
|
+
de,
|
|
137
137
|
{
|
|
138
|
-
...
|
|
138
|
+
...l,
|
|
139
139
|
value: c === null ? "" : String(c),
|
|
140
140
|
onChange: (d) => {
|
|
141
141
|
if (d.trim() === "") {
|
|
@@ -145,90 +145,90 @@ function Bn({ value: e, defaultValue: n, onChange: t, min: r, max: l, step: i, .
|
|
|
145
145
|
const u = Number(d);
|
|
146
146
|
Number.isNaN(u) || s(u);
|
|
147
147
|
},
|
|
148
|
-
inputProps: { inputMode: "decimal", min:
|
|
148
|
+
inputProps: { inputMode: "decimal", min: t, max: a, step: i }
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const [
|
|
154
|
-
return /* @__PURE__ */
|
|
155
|
-
|
|
152
|
+
function at(e) {
|
|
153
|
+
const [r, n] = M(!1);
|
|
154
|
+
return /* @__PURE__ */ o(
|
|
155
|
+
de,
|
|
156
156
|
{
|
|
157
157
|
...e,
|
|
158
|
-
inputProps: { type:
|
|
159
|
-
endAdornment: /* @__PURE__ */
|
|
158
|
+
inputProps: { type: r ? "text" : "password", autoComplete: "current-password" },
|
|
159
|
+
endAdornment: /* @__PURE__ */ o(
|
|
160
160
|
"button",
|
|
161
161
|
{
|
|
162
162
|
type: "button",
|
|
163
|
-
className: "btn btn-outline-secondary",
|
|
164
|
-
"aria-label":
|
|
165
|
-
"aria-pressed":
|
|
166
|
-
onClick: () =>
|
|
167
|
-
children:
|
|
163
|
+
className: "btn btn-outline-secondary rrc-btn rrc-input-group__action",
|
|
164
|
+
"aria-label": r ? "Hide password" : "Show password",
|
|
165
|
+
"aria-pressed": r,
|
|
166
|
+
onClick: () => n((t) => !t),
|
|
167
|
+
children: r ? "Hide" : "Show"
|
|
168
168
|
}
|
|
169
169
|
)
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
175
|
-
return /* @__PURE__ */
|
|
173
|
+
function ot({ id: e, name: r, disabled: n, required: t, className: a, label: i, helpText: l, error: c, accept: s, multiple: d, onChange: u }) {
|
|
174
|
+
const f = W(), m = e ?? f;
|
|
175
|
+
return /* @__PURE__ */ o(Y, { id: m, label: i, required: t, error: c, helpText: l, className: a, children: /* @__PURE__ */ o(
|
|
176
176
|
"input",
|
|
177
177
|
{
|
|
178
178
|
id: m,
|
|
179
|
-
name:
|
|
179
|
+
name: r,
|
|
180
180
|
type: "file",
|
|
181
|
-
className:
|
|
182
|
-
disabled:
|
|
183
|
-
required:
|
|
181
|
+
className: h("form-control", "rrc-input", c && "is-invalid"),
|
|
182
|
+
disabled: n,
|
|
183
|
+
required: t,
|
|
184
184
|
accept: s,
|
|
185
185
|
multiple: d,
|
|
186
|
-
onChange: (
|
|
186
|
+
onChange: (p) => u == null ? void 0 : u(p.target.files)
|
|
187
187
|
}
|
|
188
188
|
) });
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function rr({
|
|
191
191
|
id: e,
|
|
192
|
-
name:
|
|
193
|
-
disabled:
|
|
194
|
-
required:
|
|
195
|
-
wrapperClassName:
|
|
192
|
+
name: r,
|
|
193
|
+
disabled: n,
|
|
194
|
+
required: t,
|
|
195
|
+
wrapperClassName: a,
|
|
196
196
|
role: i,
|
|
197
|
-
label:
|
|
197
|
+
label: l,
|
|
198
198
|
helpText: c,
|
|
199
199
|
error: s,
|
|
200
200
|
checked: d,
|
|
201
201
|
onChange: u,
|
|
202
|
-
className:
|
|
202
|
+
className: f
|
|
203
203
|
}) {
|
|
204
|
-
const m =
|
|
205
|
-
return /* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
204
|
+
const m = W(), p = e ?? m;
|
|
205
|
+
return /* @__PURE__ */ y("div", { className: h(a, f), children: [
|
|
206
|
+
/* @__PURE__ */ o(
|
|
207
207
|
"input",
|
|
208
208
|
{
|
|
209
|
-
id:
|
|
210
|
-
name:
|
|
209
|
+
id: p,
|
|
210
|
+
name: r,
|
|
211
211
|
type: "checkbox",
|
|
212
212
|
role: i,
|
|
213
|
-
className:
|
|
214
|
-
disabled:
|
|
215
|
-
required:
|
|
213
|
+
className: h("form-check-input", "rrc-check", s && "is-invalid"),
|
|
214
|
+
disabled: n,
|
|
215
|
+
required: t,
|
|
216
216
|
checked: d,
|
|
217
|
-
onChange: (
|
|
217
|
+
onChange: (k) => u(k.target.checked)
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
|
|
221
|
-
/* @__PURE__ */
|
|
220
|
+
l && /* @__PURE__ */ o("label", { htmlFor: p, className: "form-check-label rrc-check__label", children: l }),
|
|
221
|
+
/* @__PURE__ */ o(er, { error: s, helpText: c })
|
|
222
222
|
] });
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const [
|
|
224
|
+
function it(e) {
|
|
225
|
+
const [r, n] = T({
|
|
226
226
|
value: e.checked,
|
|
227
227
|
defaultValue: e.defaultChecked ?? !1,
|
|
228
228
|
onChange: e.onChange
|
|
229
229
|
});
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
|
|
230
|
+
return /* @__PURE__ */ o(
|
|
231
|
+
rr,
|
|
232
232
|
{
|
|
233
233
|
id: e.id,
|
|
234
234
|
name: e.name,
|
|
@@ -239,19 +239,19 @@ function _n(e) {
|
|
|
239
239
|
label: e.label,
|
|
240
240
|
helpText: e.helpText,
|
|
241
241
|
error: e.error,
|
|
242
|
-
checked:
|
|
243
|
-
onChange:
|
|
242
|
+
checked: r,
|
|
243
|
+
onChange: n
|
|
244
244
|
}
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const [
|
|
247
|
+
function lt(e) {
|
|
248
|
+
const [r, n] = T({
|
|
249
249
|
value: e.checked,
|
|
250
250
|
defaultValue: e.defaultChecked ?? !1,
|
|
251
251
|
onChange: e.onChange
|
|
252
252
|
});
|
|
253
|
-
return /* @__PURE__ */
|
|
254
|
-
|
|
253
|
+
return /* @__PURE__ */ o(
|
|
254
|
+
rr,
|
|
255
255
|
{
|
|
256
256
|
id: e.id,
|
|
257
257
|
name: e.name,
|
|
@@ -263,158 +263,158 @@ function Un(e) {
|
|
|
263
263
|
label: e.label,
|
|
264
264
|
helpText: e.helpText,
|
|
265
265
|
error: e.error,
|
|
266
|
-
checked:
|
|
267
|
-
onChange:
|
|
266
|
+
checked: r,
|
|
267
|
+
onChange: n
|
|
268
268
|
}
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Sr({
|
|
272
272
|
id: e,
|
|
273
|
-
name:
|
|
274
|
-
value:
|
|
275
|
-
label:
|
|
276
|
-
checked:
|
|
273
|
+
name: r,
|
|
274
|
+
value: n,
|
|
275
|
+
label: t,
|
|
276
|
+
checked: a,
|
|
277
277
|
disabled: i,
|
|
278
|
-
className:
|
|
278
|
+
className: l,
|
|
279
279
|
onChange: c
|
|
280
280
|
}) {
|
|
281
|
-
const s =
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
281
|
+
const s = W(), d = e ?? s;
|
|
282
|
+
return /* @__PURE__ */ y("div", { className: h("form-check", "rrc-check-row", l), children: [
|
|
283
|
+
/* @__PURE__ */ o(
|
|
284
284
|
"input",
|
|
285
285
|
{
|
|
286
286
|
id: d,
|
|
287
|
-
name:
|
|
287
|
+
name: r,
|
|
288
288
|
type: "radio",
|
|
289
|
-
className: "form-check-input",
|
|
290
|
-
value: String(
|
|
291
|
-
checked:
|
|
289
|
+
className: "form-check-input rrc-check",
|
|
290
|
+
value: String(n),
|
|
291
|
+
checked: a,
|
|
292
292
|
disabled: i,
|
|
293
|
-
onChange: () => c == null ? void 0 : c(
|
|
293
|
+
onChange: () => c == null ? void 0 : c(n)
|
|
294
294
|
}
|
|
295
295
|
),
|
|
296
|
-
|
|
296
|
+
t && /* @__PURE__ */ o("label", { htmlFor: d, className: "form-check-label rrc-check__label", children: t })
|
|
297
297
|
] });
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function st({
|
|
300
300
|
options: e,
|
|
301
|
-
value:
|
|
302
|
-
defaultValue:
|
|
303
|
-
onChange:
|
|
304
|
-
inline:
|
|
301
|
+
value: r,
|
|
302
|
+
defaultValue: n,
|
|
303
|
+
onChange: t,
|
|
304
|
+
inline: a,
|
|
305
305
|
id: i,
|
|
306
|
-
name:
|
|
306
|
+
name: l,
|
|
307
307
|
disabled: c,
|
|
308
308
|
required: s,
|
|
309
309
|
className: d,
|
|
310
310
|
label: u,
|
|
311
|
-
helpText:
|
|
311
|
+
helpText: f,
|
|
312
312
|
error: m
|
|
313
313
|
}) {
|
|
314
|
-
const [
|
|
315
|
-
value:
|
|
316
|
-
defaultValue:
|
|
317
|
-
onChange: (
|
|
318
|
-
|
|
314
|
+
const [p, k] = T({
|
|
315
|
+
value: r,
|
|
316
|
+
defaultValue: n ?? null,
|
|
317
|
+
onChange: (_) => {
|
|
318
|
+
_ !== null && (t == null || t(_));
|
|
319
319
|
}
|
|
320
|
-
}),
|
|
321
|
-
return /* @__PURE__ */
|
|
322
|
-
|
|
320
|
+
}), S = W(), x = l ?? i ?? S;
|
|
321
|
+
return /* @__PURE__ */ o(Y, { label: u, required: s, error: m, helpText: f, className: d, children: /* @__PURE__ */ o("div", { role: "radiogroup", "aria-label": u, "aria-required": s, className: h("rrc-radio-group", a && "d-flex gap-3 rrc-radio-group--inline"), children: e.map((_) => /* @__PURE__ */ o(
|
|
322
|
+
Sr,
|
|
323
323
|
{
|
|
324
|
-
name:
|
|
325
|
-
value:
|
|
326
|
-
label:
|
|
327
|
-
checked:
|
|
328
|
-
disabled: c ||
|
|
329
|
-
onChange: (
|
|
324
|
+
name: x,
|
|
325
|
+
value: _.value,
|
|
326
|
+
label: _.label,
|
|
327
|
+
checked: _.value === p,
|
|
328
|
+
disabled: c || _.disabled,
|
|
329
|
+
onChange: (C) => k(C)
|
|
330
330
|
},
|
|
331
|
-
String(
|
|
331
|
+
String(_.value)
|
|
332
332
|
)) }) });
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Cr({
|
|
335
335
|
options: e,
|
|
336
|
-
value:
|
|
337
|
-
defaultValue:
|
|
338
|
-
onChange:
|
|
339
|
-
placeholder:
|
|
336
|
+
value: r,
|
|
337
|
+
defaultValue: n,
|
|
338
|
+
onChange: t,
|
|
339
|
+
placeholder: a,
|
|
340
340
|
loading: i,
|
|
341
|
-
id:
|
|
341
|
+
id: l,
|
|
342
342
|
name: c,
|
|
343
343
|
disabled: s,
|
|
344
344
|
readOnly: d,
|
|
345
345
|
required: u,
|
|
346
|
-
className:
|
|
346
|
+
className: f,
|
|
347
347
|
label: m,
|
|
348
|
-
helpText:
|
|
349
|
-
error:
|
|
348
|
+
helpText: p,
|
|
349
|
+
error: k
|
|
350
350
|
}) {
|
|
351
|
-
const [
|
|
352
|
-
value:
|
|
353
|
-
defaultValue:
|
|
354
|
-
onChange:
|
|
355
|
-
}),
|
|
356
|
-
return /* @__PURE__ */
|
|
351
|
+
const [S, x] = T({
|
|
352
|
+
value: r,
|
|
353
|
+
defaultValue: n ?? null,
|
|
354
|
+
onChange: t
|
|
355
|
+
}), _ = W(), C = l ?? _;
|
|
356
|
+
return /* @__PURE__ */ o(Y, { id: C, label: m, required: u, error: k, helpText: p, className: f, children: /* @__PURE__ */ y(
|
|
357
357
|
"select",
|
|
358
358
|
{
|
|
359
|
-
id:
|
|
359
|
+
id: C,
|
|
360
360
|
name: c,
|
|
361
|
-
className:
|
|
361
|
+
className: h("form-select", "rrc-select", k && "is-invalid"),
|
|
362
362
|
disabled: s || d || i,
|
|
363
363
|
required: u,
|
|
364
|
-
value:
|
|
365
|
-
onChange: (
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
|
|
364
|
+
value: S === null ? "" : String(S),
|
|
365
|
+
onChange: (v) => {
|
|
366
|
+
const N = v.target.value;
|
|
367
|
+
if (N === "") {
|
|
368
|
+
x(null);
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
|
-
const b = e.find((
|
|
372
|
-
|
|
371
|
+
const b = e.find((w) => String(w.value) === N);
|
|
372
|
+
x(b ? b.value : null);
|
|
373
373
|
},
|
|
374
374
|
children: [
|
|
375
|
-
i && /* @__PURE__ */
|
|
376
|
-
!i &&
|
|
377
|
-
e.map((
|
|
375
|
+
i && /* @__PURE__ */ o("option", { value: "", children: "Loading…" }),
|
|
376
|
+
!i && a && /* @__PURE__ */ o("option", { value: "", children: a }),
|
|
377
|
+
e.map((v) => /* @__PURE__ */ o("option", { value: String(v.value), disabled: v.disabled, children: v.label }, String(v.value)))
|
|
378
378
|
]
|
|
379
379
|
}
|
|
380
380
|
) });
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
|
|
382
|
+
function _e(e, r) {
|
|
383
|
+
U(() => {
|
|
384
384
|
if (!e)
|
|
385
385
|
return;
|
|
386
|
-
function t
|
|
387
|
-
|
|
386
|
+
function n(t) {
|
|
387
|
+
t.key === "Escape" && r();
|
|
388
388
|
}
|
|
389
|
-
return document.addEventListener("keydown",
|
|
390
|
-
}, [e,
|
|
389
|
+
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
390
|
+
}, [e, r]);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
const
|
|
394
|
-
return
|
|
392
|
+
function oe({ open: e, onClose: r, anchorRef: n, className: t, role: a, children: i }) {
|
|
393
|
+
const l = L(null);
|
|
394
|
+
return _e(e, r), U(() => {
|
|
395
395
|
if (!e)
|
|
396
396
|
return;
|
|
397
397
|
function c(s) {
|
|
398
|
-
var u,
|
|
398
|
+
var u, f;
|
|
399
399
|
const d = s.target;
|
|
400
|
-
(u =
|
|
400
|
+
(u = l.current) != null && u.contains(d) || (f = n.current) != null && f.contains(d) || r();
|
|
401
401
|
}
|
|
402
402
|
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
403
|
-
}, [e,
|
|
403
|
+
}, [e, r, n]), e ? /* @__PURE__ */ o("div", { ref: l, className: h("show", "rrc-popup", t), role: a, children: i }) : null;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function xe({
|
|
406
406
|
itemCount: e,
|
|
407
|
-
isOpen:
|
|
408
|
-
onSelect:
|
|
409
|
-
onClose:
|
|
407
|
+
isOpen: r,
|
|
408
|
+
onSelect: n,
|
|
409
|
+
onClose: t
|
|
410
410
|
}) {
|
|
411
|
-
const [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}, [
|
|
415
|
-
const
|
|
411
|
+
const [a, i] = M(-1);
|
|
412
|
+
U(() => {
|
|
413
|
+
r || i(-1);
|
|
414
|
+
}, [r]), _e(r, t);
|
|
415
|
+
const l = F(
|
|
416
416
|
(c) => {
|
|
417
|
-
if (!
|
|
417
|
+
if (!r) {
|
|
418
418
|
(c.key === "ArrowDown" || c.key === "Enter") && c.preventDefault();
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
@@ -432,690 +432,706 @@ function re({
|
|
|
432
432
|
c.preventDefault(), i(e === 0 ? -1 : e - 1);
|
|
433
433
|
break;
|
|
434
434
|
case "Enter":
|
|
435
|
-
|
|
435
|
+
a >= 0 && (c.preventDefault(), n(a));
|
|
436
436
|
break;
|
|
437
437
|
}
|
|
438
438
|
},
|
|
439
|
-
[
|
|
439
|
+
[r, e, a, n]
|
|
440
440
|
);
|
|
441
|
-
return { activeIndex:
|
|
441
|
+
return { activeIndex: a, setActiveIndex: i, handleKeyDown: l };
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Ir({
|
|
444
444
|
options: e,
|
|
445
|
-
values:
|
|
446
|
-
defaultValues:
|
|
447
|
-
onChange:
|
|
448
|
-
loading:
|
|
445
|
+
values: r,
|
|
446
|
+
defaultValues: n,
|
|
447
|
+
onChange: t,
|
|
448
|
+
loading: a,
|
|
449
449
|
emptyText: i = "No options",
|
|
450
|
-
id:
|
|
450
|
+
id: l,
|
|
451
451
|
name: c,
|
|
452
452
|
disabled: s,
|
|
453
453
|
readOnly: d,
|
|
454
454
|
required: u,
|
|
455
|
-
className:
|
|
455
|
+
className: f,
|
|
456
456
|
label: m,
|
|
457
|
-
placeholder:
|
|
458
|
-
helpText:
|
|
459
|
-
error:
|
|
457
|
+
placeholder: p = "Select...",
|
|
458
|
+
helpText: k,
|
|
459
|
+
error: S
|
|
460
460
|
}) {
|
|
461
|
-
const [
|
|
462
|
-
value:
|
|
463
|
-
defaultValue:
|
|
464
|
-
onChange:
|
|
465
|
-
}), [
|
|
466
|
-
(
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
461
|
+
const [x, _] = T({
|
|
462
|
+
value: r,
|
|
463
|
+
defaultValue: n ?? [],
|
|
464
|
+
onChange: t
|
|
465
|
+
}), [C, v] = M(!1), N = L(null), b = W(), w = l ?? b, g = new Set(x), I = F(() => v(!1), []), D = F(
|
|
466
|
+
(A) => {
|
|
467
|
+
const H = e[A];
|
|
468
|
+
if (!H || H.disabled)
|
|
469
469
|
return;
|
|
470
|
-
const
|
|
471
|
-
|
|
470
|
+
const R = g.has(H.value) ? x.filter((Z) => Z !== H.value) : [...x, H.value];
|
|
471
|
+
_(R);
|
|
472
472
|
},
|
|
473
|
-
[e,
|
|
474
|
-
), { activeIndex:
|
|
473
|
+
[e, x, g, _]
|
|
474
|
+
), { activeIndex: O, setActiveIndex: q, handleKeyDown: G } = xe({
|
|
475
475
|
itemCount: e.length,
|
|
476
|
-
isOpen:
|
|
477
|
-
onSelect:
|
|
478
|
-
onClose:
|
|
479
|
-
}),
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */
|
|
476
|
+
isOpen: C,
|
|
477
|
+
onSelect: D,
|
|
478
|
+
onClose: I
|
|
479
|
+
}), V = e.filter((A) => g.has(A.value)).map((A) => A.label).join(", ");
|
|
480
|
+
return /* @__PURE__ */ o(Y, { id: w, label: m, required: u, error: S, helpText: k, className: f, children: /* @__PURE__ */ y("div", { className: "position-relative", children: [
|
|
481
|
+
/* @__PURE__ */ o(
|
|
482
482
|
"button",
|
|
483
483
|
{
|
|
484
|
-
ref:
|
|
485
|
-
id:
|
|
484
|
+
ref: N,
|
|
485
|
+
id: w,
|
|
486
486
|
type: "button",
|
|
487
487
|
name: c,
|
|
488
|
-
className:
|
|
488
|
+
className: h("form-select text-start", "rrc-select", "rrc-select__trigger", S && "is-invalid"),
|
|
489
489
|
disabled: s || d,
|
|
490
490
|
"aria-haspopup": "listbox",
|
|
491
|
-
"aria-expanded":
|
|
492
|
-
onClick: () =>
|
|
491
|
+
"aria-expanded": C,
|
|
492
|
+
onClick: () => v((A) => !A),
|
|
493
493
|
onKeyDown: G,
|
|
494
|
-
children:
|
|
494
|
+
children: V || /* @__PURE__ */ o("span", { className: "text-body-secondary", children: p })
|
|
495
495
|
}
|
|
496
496
|
),
|
|
497
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ o(oe, { open: C, onClose: I, anchorRef: N, className: "dropdown-menu w-100 rrc-menu rrc-select__menu", role: "listbox", children: a ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: i }) : e.map((A, H) => /* @__PURE__ */ y(
|
|
498
498
|
"div",
|
|
499
499
|
{
|
|
500
500
|
role: "option",
|
|
501
|
-
"aria-selected":
|
|
502
|
-
className:
|
|
501
|
+
"aria-selected": g.has(A.value),
|
|
502
|
+
className: h(
|
|
503
503
|
"dropdown-item d-flex align-items-center gap-2",
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
H === O && "active",
|
|
505
|
+
A.disabled && "disabled"
|
|
506
506
|
),
|
|
507
|
-
onMouseEnter: () =>
|
|
508
|
-
onMouseDown: (
|
|
509
|
-
|
|
507
|
+
onMouseEnter: () => q(H),
|
|
508
|
+
onMouseDown: (R) => {
|
|
509
|
+
R.preventDefault(), A.disabled || D(H);
|
|
510
510
|
},
|
|
511
511
|
children: [
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
|
|
512
|
+
/* @__PURE__ */ o("input", { type: "checkbox", className: "form-check-input m-0", checked: g.has(A.value), readOnly: !0, tabIndex: -1 }),
|
|
513
|
+
A.label
|
|
514
514
|
]
|
|
515
515
|
},
|
|
516
|
-
String(
|
|
516
|
+
String(A.value)
|
|
517
517
|
)) })
|
|
518
518
|
] }) });
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function ae(e) {
|
|
521
521
|
if (!e)
|
|
522
522
|
return "";
|
|
523
|
-
const
|
|
524
|
-
return `${
|
|
523
|
+
const r = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), t = String(e.getDate()).padStart(2, "0");
|
|
524
|
+
return `${r}-${n}-${t}`;
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function nr(e) {
|
|
527
527
|
if (!e)
|
|
528
528
|
return null;
|
|
529
|
-
const
|
|
530
|
-
return !
|
|
529
|
+
const r = e.split("-").map(Number), [n, t, a] = r;
|
|
530
|
+
return !n || !t || !a ? null : new Date(n, t - 1, a);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
const [
|
|
532
|
+
function Er({ value: e, defaultValue: r, onChange: n, min: t, max: a, ...i }) {
|
|
533
|
+
const [l, c] = T({
|
|
534
534
|
value: e,
|
|
535
|
-
defaultValue:
|
|
536
|
-
onChange:
|
|
535
|
+
defaultValue: r ?? null,
|
|
536
|
+
onChange: n
|
|
537
537
|
});
|
|
538
|
-
return /* @__PURE__ */
|
|
539
|
-
|
|
538
|
+
return /* @__PURE__ */ o(
|
|
539
|
+
de,
|
|
540
540
|
{
|
|
541
541
|
...i,
|
|
542
|
-
value:
|
|
543
|
-
onChange: (s) => c(
|
|
542
|
+
value: ae(l),
|
|
543
|
+
onChange: (s) => c(nr(s)),
|
|
544
544
|
inputProps: {
|
|
545
545
|
type: "date",
|
|
546
|
-
min:
|
|
547
|
-
max:
|
|
546
|
+
min: t ? ae(t) : void 0,
|
|
547
|
+
max: a ? ae(a) : void 0
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function tr(e) {
|
|
553
553
|
if (!e)
|
|
554
554
|
return "";
|
|
555
|
-
const
|
|
556
|
-
return `${
|
|
555
|
+
const r = String(e.getHours()).padStart(2, "0"), n = String(e.getMinutes()).padStart(2, "0");
|
|
556
|
+
return `${r}:${n}`;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function ar(e) {
|
|
559
559
|
if (!e)
|
|
560
560
|
return null;
|
|
561
|
-
const [
|
|
562
|
-
return
|
|
561
|
+
const [r, n] = e.split(":").map(Number);
|
|
562
|
+
return r === void 0 || n === void 0 || Number.isNaN(r) || Number.isNaN(n) ? null : new Date(1970, 0, 1, r, n, 0, 0);
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
const [i,
|
|
564
|
+
function ct({ value: e, defaultValue: r, onChange: n, step: t, ...a }) {
|
|
565
|
+
const [i, l] = T({
|
|
566
566
|
value: e,
|
|
567
|
-
defaultValue:
|
|
568
|
-
onChange:
|
|
567
|
+
defaultValue: r ?? null,
|
|
568
|
+
onChange: n
|
|
569
569
|
});
|
|
570
|
-
return /* @__PURE__ */
|
|
571
|
-
|
|
570
|
+
return /* @__PURE__ */ o(
|
|
571
|
+
de,
|
|
572
572
|
{
|
|
573
|
-
...
|
|
574
|
-
value:
|
|
575
|
-
onChange: (c) =>
|
|
576
|
-
inputProps: { type: "time", step:
|
|
573
|
+
...a,
|
|
574
|
+
value: tr(i),
|
|
575
|
+
onChange: (c) => l(ar(c)),
|
|
576
|
+
inputProps: { type: "time", step: t }
|
|
577
577
|
}
|
|
578
578
|
);
|
|
579
579
|
}
|
|
580
|
-
function
|
|
581
|
-
const
|
|
582
|
-
if (!
|
|
580
|
+
function We(e, r) {
|
|
581
|
+
const n = nr(e);
|
|
582
|
+
if (!n)
|
|
583
583
|
return null;
|
|
584
|
-
const
|
|
585
|
-
return
|
|
584
|
+
const t = ar(r || "00:00");
|
|
585
|
+
return t && n.setHours(t.getHours(), t.getMinutes(), 0, 0), n;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function dt({
|
|
588
588
|
value: e,
|
|
589
|
-
defaultValue:
|
|
590
|
-
onChange:
|
|
591
|
-
min:
|
|
592
|
-
max:
|
|
589
|
+
defaultValue: r,
|
|
590
|
+
onChange: n,
|
|
591
|
+
min: t,
|
|
592
|
+
max: a,
|
|
593
593
|
id: i,
|
|
594
|
-
name:
|
|
594
|
+
name: l,
|
|
595
595
|
disabled: c,
|
|
596
596
|
readOnly: s,
|
|
597
597
|
required: d,
|
|
598
598
|
className: u,
|
|
599
|
-
label:
|
|
599
|
+
label: f,
|
|
600
600
|
helpText: m,
|
|
601
|
-
error:
|
|
601
|
+
error: p
|
|
602
602
|
}) {
|
|
603
|
-
const [
|
|
603
|
+
const [k, S] = T({
|
|
604
604
|
value: e,
|
|
605
|
-
defaultValue:
|
|
606
|
-
onChange:
|
|
607
|
-
}),
|
|
608
|
-
return /* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
605
|
+
defaultValue: r ?? null,
|
|
606
|
+
onChange: n
|
|
607
|
+
}), x = W(), _ = i ?? x, C = ae(k), v = tr(k);
|
|
608
|
+
return /* @__PURE__ */ o(Y, { id: _, label: f, required: d, error: p, helpText: m, className: u, children: /* @__PURE__ */ y("div", { className: "d-flex gap-2", children: [
|
|
609
|
+
/* @__PURE__ */ o(
|
|
610
610
|
"input",
|
|
611
611
|
{
|
|
612
|
-
id:
|
|
613
|
-
name:
|
|
612
|
+
id: _,
|
|
613
|
+
name: l ? `${l}-date` : void 0,
|
|
614
614
|
type: "date",
|
|
615
|
-
className:
|
|
615
|
+
className: h("form-control", "rrc-input", p && "is-invalid"),
|
|
616
616
|
disabled: c,
|
|
617
617
|
readOnly: s,
|
|
618
618
|
required: d,
|
|
619
|
-
min:
|
|
620
|
-
max:
|
|
621
|
-
value:
|
|
622
|
-
onChange: (
|
|
619
|
+
min: t ? ae(t) : void 0,
|
|
620
|
+
max: a ? ae(a) : void 0,
|
|
621
|
+
value: C,
|
|
622
|
+
onChange: (N) => S(We(N.target.value, v))
|
|
623
623
|
}
|
|
624
624
|
),
|
|
625
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ o(
|
|
626
626
|
"input",
|
|
627
627
|
{
|
|
628
|
-
name:
|
|
628
|
+
name: l ? `${l}-time` : void 0,
|
|
629
629
|
type: "time",
|
|
630
|
-
className:
|
|
630
|
+
className: h("form-control", "rrc-input", p && "is-invalid"),
|
|
631
631
|
disabled: c,
|
|
632
632
|
readOnly: s,
|
|
633
633
|
required: d,
|
|
634
|
-
value:
|
|
635
|
-
onChange: (
|
|
634
|
+
value: v,
|
|
635
|
+
onChange: (N) => S(We(C || ae(/* @__PURE__ */ new Date()), N.target.value))
|
|
636
636
|
}
|
|
637
637
|
)
|
|
638
638
|
] }) });
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Ar({
|
|
641
641
|
options: e,
|
|
642
|
-
value:
|
|
643
|
-
defaultValue:
|
|
644
|
-
onChange:
|
|
645
|
-
loading:
|
|
642
|
+
value: r,
|
|
643
|
+
defaultValue: n,
|
|
644
|
+
onChange: t,
|
|
645
|
+
loading: a,
|
|
646
646
|
emptyText: i = "No options",
|
|
647
|
-
id:
|
|
647
|
+
id: l,
|
|
648
648
|
name: c,
|
|
649
649
|
disabled: s,
|
|
650
650
|
readOnly: d,
|
|
651
651
|
required: u,
|
|
652
|
-
className:
|
|
652
|
+
className: f,
|
|
653
653
|
label: m,
|
|
654
|
-
placeholder:
|
|
655
|
-
helpText:
|
|
656
|
-
error:
|
|
654
|
+
placeholder: p = "Select...",
|
|
655
|
+
helpText: k,
|
|
656
|
+
error: S
|
|
657
657
|
}) {
|
|
658
|
-
const [
|
|
659
|
-
value:
|
|
660
|
-
defaultValue:
|
|
661
|
-
onChange:
|
|
662
|
-
}), [
|
|
663
|
-
(
|
|
664
|
-
const
|
|
665
|
-
!
|
|
658
|
+
const [x, _] = T({
|
|
659
|
+
value: r,
|
|
660
|
+
defaultValue: n ?? null,
|
|
661
|
+
onChange: t
|
|
662
|
+
}), [C, v] = M(!1), N = L(null), b = W(), w = l ?? b, g = e.find((P) => P.value === x) ?? null, I = F(() => v(!1), []), D = F(
|
|
663
|
+
(P) => {
|
|
664
|
+
const V = e[P];
|
|
665
|
+
!V || V.disabled || (_(V.value), I());
|
|
666
666
|
},
|
|
667
|
-
[e,
|
|
668
|
-
), { activeIndex:
|
|
667
|
+
[e, _, I]
|
|
668
|
+
), { activeIndex: O, setActiveIndex: q, handleKeyDown: G } = xe({
|
|
669
669
|
itemCount: e.length,
|
|
670
|
-
isOpen:
|
|
671
|
-
onSelect:
|
|
672
|
-
onClose:
|
|
670
|
+
isOpen: C,
|
|
671
|
+
onSelect: D,
|
|
672
|
+
onClose: I
|
|
673
673
|
});
|
|
674
|
-
return /* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ o(Y, { id: w, label: m, required: u, error: S, helpText: k, className: f, children: /* @__PURE__ */ y("div", { className: "position-relative", children: [
|
|
675
|
+
/* @__PURE__ */ o(
|
|
676
676
|
"button",
|
|
677
677
|
{
|
|
678
|
-
ref:
|
|
679
|
-
id:
|
|
678
|
+
ref: N,
|
|
679
|
+
id: w,
|
|
680
680
|
type: "button",
|
|
681
681
|
name: c,
|
|
682
|
-
className:
|
|
682
|
+
className: h("form-select text-start", "rrc-select", "rrc-select__trigger", S && "is-invalid"),
|
|
683
683
|
disabled: s || d,
|
|
684
684
|
"aria-haspopup": "listbox",
|
|
685
|
-
"aria-expanded":
|
|
686
|
-
onClick: () =>
|
|
685
|
+
"aria-expanded": C,
|
|
686
|
+
onClick: () => v((P) => !P),
|
|
687
687
|
onKeyDown: G,
|
|
688
|
-
children:
|
|
688
|
+
children: g ? g.label : /* @__PURE__ */ o("span", { className: "text-body-secondary", children: p })
|
|
689
689
|
}
|
|
690
690
|
),
|
|
691
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ o(oe, { open: C, onClose: I, anchorRef: N, className: "dropdown-menu w-100 rrc-menu rrc-select__menu", role: "listbox", children: a ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: i }) : e.map((P, V) => /* @__PURE__ */ o(
|
|
692
692
|
"div",
|
|
693
693
|
{
|
|
694
694
|
role: "option",
|
|
695
|
-
"aria-selected":
|
|
696
|
-
className:
|
|
697
|
-
onMouseEnter: () =>
|
|
698
|
-
onMouseDown: (
|
|
699
|
-
|
|
695
|
+
"aria-selected": P.value === x,
|
|
696
|
+
className: h("dropdown-item", "rrc-menu__item", V === O && "active", P.disabled && "disabled"),
|
|
697
|
+
onMouseEnter: () => q(V),
|
|
698
|
+
onMouseDown: (A) => {
|
|
699
|
+
A.preventDefault(), P.disabled || D(V);
|
|
700
700
|
},
|
|
701
|
-
children:
|
|
701
|
+
children: P.label
|
|
702
702
|
},
|
|
703
|
-
String(
|
|
703
|
+
String(P.value)
|
|
704
704
|
)) })
|
|
705
705
|
] }) });
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
707
|
+
function Dr(e, r) {
|
|
708
|
+
return r ? e.label.toLowerCase().includes(r.toLowerCase()) : !0;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Tr({
|
|
711
711
|
options: e,
|
|
712
|
-
value:
|
|
713
|
-
defaultValue:
|
|
714
|
-
onChange:
|
|
715
|
-
inputValue:
|
|
712
|
+
value: r,
|
|
713
|
+
defaultValue: n,
|
|
714
|
+
onChange: t,
|
|
715
|
+
inputValue: a,
|
|
716
716
|
onInputValueChange: i,
|
|
717
|
-
loading:
|
|
717
|
+
loading: l,
|
|
718
718
|
emptyText: c = "No results",
|
|
719
719
|
filter: s,
|
|
720
720
|
id: d,
|
|
721
721
|
name: u,
|
|
722
|
-
disabled:
|
|
722
|
+
disabled: f,
|
|
723
723
|
readOnly: m,
|
|
724
|
-
required:
|
|
725
|
-
className:
|
|
726
|
-
label:
|
|
727
|
-
placeholder:
|
|
728
|
-
helpText:
|
|
729
|
-
error:
|
|
724
|
+
required: p,
|
|
725
|
+
className: k,
|
|
726
|
+
label: S,
|
|
727
|
+
placeholder: x,
|
|
728
|
+
helpText: _,
|
|
729
|
+
error: C
|
|
730
730
|
}) {
|
|
731
|
-
const [
|
|
732
|
-
value:
|
|
733
|
-
defaultValue:
|
|
734
|
-
onChange:
|
|
735
|
-
}), b = e.find((
|
|
736
|
-
value:
|
|
731
|
+
const [v, N] = T({
|
|
732
|
+
value: r,
|
|
733
|
+
defaultValue: n ?? null,
|
|
734
|
+
onChange: t
|
|
735
|
+
}), b = e.find((K) => K.value === v) ?? null, [w, g] = T({
|
|
736
|
+
value: a,
|
|
737
737
|
defaultValue: (b == null ? void 0 : b.label) ?? "",
|
|
738
738
|
onChange: i
|
|
739
|
-
}), [
|
|
740
|
-
(
|
|
741
|
-
const j =
|
|
742
|
-
!j || j.disabled || (
|
|
739
|
+
}), [I, D] = M(!1), O = L(null), q = W(), G = d ?? q, P = s ?? Dr, V = e.filter((K) => P(K, w)), A = F(() => D(!1), []), H = F(
|
|
740
|
+
(K) => {
|
|
741
|
+
const j = V[K];
|
|
742
|
+
!j || j.disabled || (N(j.value), g(j.label), A());
|
|
743
743
|
},
|
|
744
|
-
[
|
|
745
|
-
), { activeIndex:
|
|
746
|
-
itemCount:
|
|
747
|
-
isOpen:
|
|
748
|
-
onSelect:
|
|
749
|
-
onClose:
|
|
744
|
+
[V, N, g, A]
|
|
745
|
+
), { activeIndex: R, setActiveIndex: Z, handleKeyDown: X } = xe({
|
|
746
|
+
itemCount: V.length,
|
|
747
|
+
isOpen: I,
|
|
748
|
+
onSelect: H,
|
|
749
|
+
onClose: A
|
|
750
750
|
});
|
|
751
|
-
return /* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ o(Y, { id: G, label: S, required: p, error: C, helpText: _, className: k, children: /* @__PURE__ */ y("div", { className: "position-relative", children: [
|
|
752
|
+
/* @__PURE__ */ o(
|
|
753
753
|
"input",
|
|
754
754
|
{
|
|
755
|
-
ref:
|
|
755
|
+
ref: O,
|
|
756
756
|
id: G,
|
|
757
757
|
name: u,
|
|
758
758
|
type: "text",
|
|
759
|
-
className:
|
|
760
|
-
disabled:
|
|
759
|
+
className: h("form-control", "rrc-input", C && "is-invalid"),
|
|
760
|
+
disabled: f,
|
|
761
761
|
readOnly: m,
|
|
762
|
-
required:
|
|
763
|
-
placeholder:
|
|
762
|
+
required: p,
|
|
763
|
+
placeholder: x,
|
|
764
764
|
autoComplete: "off",
|
|
765
765
|
role: "combobox",
|
|
766
|
-
"aria-expanded":
|
|
766
|
+
"aria-expanded": I,
|
|
767
767
|
"aria-haspopup": "listbox",
|
|
768
|
-
value:
|
|
769
|
-
onFocus: () =>
|
|
770
|
-
onChange: (
|
|
771
|
-
const j =
|
|
772
|
-
|
|
768
|
+
value: w,
|
|
769
|
+
onFocus: () => D(!0),
|
|
770
|
+
onChange: (K) => {
|
|
771
|
+
const j = K.target.value;
|
|
772
|
+
g(j), D(!0), v !== null && N(null);
|
|
773
773
|
},
|
|
774
|
-
onKeyDown:
|
|
774
|
+
onKeyDown: X
|
|
775
775
|
}
|
|
776
776
|
),
|
|
777
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ o(oe, { open: I, onClose: A, anchorRef: O, className: "dropdown-menu w-100 rrc-menu rrc-select__menu", role: "listbox", children: l ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : V.length === 0 ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: c }) : V.map((K, j) => /* @__PURE__ */ o(
|
|
778
778
|
"div",
|
|
779
779
|
{
|
|
780
780
|
role: "option",
|
|
781
|
-
"aria-selected":
|
|
782
|
-
className:
|
|
783
|
-
onMouseEnter: () =>
|
|
784
|
-
onMouseDown: (
|
|
785
|
-
|
|
781
|
+
"aria-selected": K.value === v,
|
|
782
|
+
className: h("dropdown-item", "rrc-menu__item", j === R && "active", K.disabled && "disabled"),
|
|
783
|
+
onMouseEnter: () => Z(j),
|
|
784
|
+
onMouseDown: (E) => {
|
|
785
|
+
E.preventDefault(), K.disabled || H(j);
|
|
786
786
|
},
|
|
787
|
-
children:
|
|
787
|
+
children: K.label
|
|
788
788
|
},
|
|
789
|
-
String(
|
|
789
|
+
String(K.value)
|
|
790
790
|
)) })
|
|
791
791
|
] }) });
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
return /* @__PURE__ */
|
|
793
|
+
function ut(e) {
|
|
794
|
+
return /* @__PURE__ */ o(Y, { ...e });
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
return
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
|
|
801
|
-
/* @__PURE__ */
|
|
796
|
+
function Vr({ open: e, onClose: r, title: n, children: t, footer: a, className: i }) {
|
|
797
|
+
return _e(e, r), e ? /* @__PURE__ */ y(Q, { children: [
|
|
798
|
+
/* @__PURE__ */ o("div", { className: "modal d-block rrc-modal", tabIndex: -1, role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ o("div", { className: h("modal-dialog", "rrc-modal__dialog", i), role: "document", children: /* @__PURE__ */ y("div", { className: "modal-content rrc-modal__content", children: [
|
|
799
|
+
/* @__PURE__ */ y("div", { className: "modal-header rrc-modal__header", children: [
|
|
800
|
+
n && /* @__PURE__ */ o("h5", { className: "modal-title", children: n }),
|
|
801
|
+
/* @__PURE__ */ o("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: r })
|
|
802
802
|
] }),
|
|
803
|
-
/* @__PURE__ */
|
|
804
|
-
|
|
803
|
+
/* @__PURE__ */ o("div", { className: "modal-body rrc-modal__body", children: t }),
|
|
804
|
+
a && /* @__PURE__ */ o("div", { className: "modal-footer rrc-modal__footer", children: a })
|
|
805
805
|
] }) }) }),
|
|
806
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ o("div", { className: "modal-backdrop show rrc-modal__backdrop", onClick: r })
|
|
807
807
|
] }) : null;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
for (let
|
|
813
|
-
|
|
814
|
-
return i <
|
|
815
|
-
}
|
|
816
|
-
function
|
|
817
|
-
const
|
|
818
|
-
return /* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
809
|
+
function Lr(e, r, n) {
|
|
810
|
+
const t = [], a = Math.max(1, e - n), i = Math.min(r, e + n);
|
|
811
|
+
a > 1 && (t.push(1), a > 2 && t.push("ellipsis"));
|
|
812
|
+
for (let l = a; l <= i; l++)
|
|
813
|
+
t.push(l);
|
|
814
|
+
return i < r && (i < r - 1 && t.push("ellipsis"), t.push(r)), t;
|
|
815
|
+
}
|
|
816
|
+
function Rr({ currentPage: e, pageSize: r, totalItems: n, onPageChange: t, siblingCount: a = 1, className: i }) {
|
|
817
|
+
const l = Math.max(1, Math.ceil(n / r)), c = Lr(e, l, a);
|
|
818
|
+
return /* @__PURE__ */ o("nav", { "aria-label": "Pagination", className: i, children: /* @__PURE__ */ y("ul", { className: "pagination mb-0 rrc-pagination", children: [
|
|
819
|
+
/* @__PURE__ */ o("li", { className: h("page-item", e <= 1 && "disabled"), children: /* @__PURE__ */ o(
|
|
820
820
|
"button",
|
|
821
821
|
{
|
|
822
822
|
type: "button",
|
|
823
823
|
className: "page-link",
|
|
824
824
|
disabled: e <= 1,
|
|
825
|
-
onClick: () =>
|
|
825
|
+
onClick: () => t(e - 1),
|
|
826
826
|
children: "Previous"
|
|
827
827
|
}
|
|
828
828
|
) }),
|
|
829
829
|
c.map(
|
|
830
|
-
(s, d) => s === "ellipsis" ? /* @__PURE__ */
|
|
830
|
+
(s, d) => s === "ellipsis" ? /* @__PURE__ */ o("li", { className: "page-item disabled", children: /* @__PURE__ */ o("span", { className: "page-link", children: "…" }) }, `ellipsis-${d}`) : /* @__PURE__ */ o("li", { className: h("page-item", s === e && "active"), children: /* @__PURE__ */ o(
|
|
831
831
|
"button",
|
|
832
832
|
{
|
|
833
833
|
type: "button",
|
|
834
834
|
className: "page-link",
|
|
835
835
|
"aria-current": s === e ? "page" : void 0,
|
|
836
|
-
onClick: () =>
|
|
836
|
+
onClick: () => t(s),
|
|
837
837
|
children: s
|
|
838
838
|
}
|
|
839
839
|
) }, s)
|
|
840
840
|
),
|
|
841
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ o("li", { className: h("page-item", e >= l && "disabled"), children: /* @__PURE__ */ o(
|
|
842
842
|
"button",
|
|
843
843
|
{
|
|
844
844
|
type: "button",
|
|
845
845
|
className: "page-link",
|
|
846
|
-
disabled: e >=
|
|
847
|
-
onClick: () =>
|
|
846
|
+
disabled: e >= l,
|
|
847
|
+
onClick: () => t(e + 1),
|
|
848
848
|
children: "Next"
|
|
849
849
|
}
|
|
850
850
|
) })
|
|
851
851
|
] }) });
|
|
852
852
|
}
|
|
853
|
-
const
|
|
853
|
+
const $r = {
|
|
854
854
|
text: (e) => e == null ? "" : String(e),
|
|
855
855
|
boolean: (e) => e ? "Yes" : "No",
|
|
856
856
|
date: (e) => {
|
|
857
857
|
if (e == null || e === "")
|
|
858
858
|
return "";
|
|
859
|
-
const
|
|
860
|
-
return Number.isNaN(
|
|
859
|
+
const r = e instanceof Date ? e : new Date(String(e));
|
|
860
|
+
return Number.isNaN(r.getTime()) ? String(e) : r.toLocaleDateString();
|
|
861
861
|
},
|
|
862
862
|
currency: (e) => {
|
|
863
|
-
const
|
|
864
|
-
return Number.isFinite(
|
|
863
|
+
const r = Number(e);
|
|
864
|
+
return Number.isFinite(r) ? r.toLocaleString(void 0, { style: "currency", currency: "USD" }) : String(e ?? "");
|
|
865
865
|
}
|
|
866
866
|
};
|
|
867
|
-
function
|
|
868
|
-
return !e || e.key !==
|
|
867
|
+
function Or(e, r) {
|
|
868
|
+
return !e || e.key !== r ? { key: r, direction: "asc" } : e.direction === "asc" ? { key: r, direction: "desc" } : null;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Ge(e) {
|
|
871
871
|
return e.key ?? e.field ?? e.header;
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
const
|
|
875
|
-
return
|
|
873
|
+
function Mr(e, r) {
|
|
874
|
+
const n = e.field ?? e.key;
|
|
875
|
+
return n ? r[n] : void 0;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Pr(e, r) {
|
|
878
878
|
if (e.render)
|
|
879
|
-
return e.render(
|
|
880
|
-
const
|
|
881
|
-
return e.formatter ? e.formatter(
|
|
879
|
+
return e.render(r);
|
|
880
|
+
const n = Mr(e, r);
|
|
881
|
+
return e.formatter ? e.formatter(n, r) : e.format ? $r[e.format](n) : n == null ? "" : String(n);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Je(e) {
|
|
884
884
|
return e && `text-${e}`;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Kr({
|
|
887
887
|
columns: e,
|
|
888
|
-
rows:
|
|
889
|
-
rowKey:
|
|
890
|
-
loading:
|
|
891
|
-
error:
|
|
888
|
+
rows: r,
|
|
889
|
+
rowKey: n,
|
|
890
|
+
loading: t,
|
|
891
|
+
error: a,
|
|
892
892
|
emptyText: i = "No data",
|
|
893
|
-
className:
|
|
893
|
+
className: l,
|
|
894
894
|
selectedRowKeys: c,
|
|
895
895
|
onSelectionChange: s,
|
|
896
896
|
sort: d,
|
|
897
897
|
onSortChange: u,
|
|
898
|
-
page:
|
|
898
|
+
page: f,
|
|
899
899
|
pageSize: m,
|
|
900
|
-
totalCount:
|
|
901
|
-
onPageChange:
|
|
900
|
+
totalCount: p,
|
|
901
|
+
onPageChange: k
|
|
902
902
|
}) {
|
|
903
|
-
const
|
|
904
|
-
function
|
|
905
|
-
s && (
|
|
903
|
+
const S = !!s, x = new Set(c ?? []), _ = f !== void 0 && m !== void 0 && p !== void 0, C = _ ? Math.max(1, Math.ceil(p / m)) : 1;
|
|
904
|
+
function v() {
|
|
905
|
+
s && (x.size === r.length ? s([]) : s(r.map(n)));
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function N(b) {
|
|
908
908
|
if (!s)
|
|
909
909
|
return;
|
|
910
|
-
const
|
|
911
|
-
|
|
910
|
+
const w = new Set(x);
|
|
911
|
+
w.has(b) ? w.delete(b) : w.add(b), s(Array.from(w));
|
|
912
912
|
}
|
|
913
|
-
return /* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
|
|
913
|
+
return /* @__PURE__ */ y("div", { className: h("table-responsive", "rrc-data-grid", l), children: [
|
|
914
|
+
/* @__PURE__ */ y("table", { className: "table table-hover align-middle rrc-data-grid__table", children: [
|
|
915
|
+
/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ y("tr", { children: [
|
|
916
|
+
S && /* @__PURE__ */ o("th", { style: { width: "2.5rem" }, children: /* @__PURE__ */ o(
|
|
917
917
|
"input",
|
|
918
918
|
{
|
|
919
919
|
type: "checkbox",
|
|
920
920
|
className: "form-check-input",
|
|
921
|
-
checked:
|
|
922
|
-
onChange:
|
|
921
|
+
checked: r.length > 0 && x.size === r.length,
|
|
922
|
+
onChange: v,
|
|
923
923
|
"aria-label": "Select all rows"
|
|
924
924
|
}
|
|
925
925
|
) }),
|
|
926
926
|
e.map((b) => {
|
|
927
|
-
const
|
|
928
|
-
return /* @__PURE__ */
|
|
927
|
+
const w = Ge(b);
|
|
928
|
+
return /* @__PURE__ */ y(
|
|
929
929
|
"th",
|
|
930
930
|
{
|
|
931
|
-
className:
|
|
931
|
+
className: Je(b.headerAlign ?? b.align),
|
|
932
932
|
style: { width: b.width, minWidth: b.minWidth, maxWidth: b.maxWidth },
|
|
933
933
|
role: b.sortable ? "button" : void 0,
|
|
934
|
-
onClick: b.sortable && u ? () => u(
|
|
934
|
+
onClick: b.sortable && u ? () => u(Or(d, w)) : void 0,
|
|
935
935
|
children: [
|
|
936
936
|
b.header,
|
|
937
|
-
b.sortable && (d == null ? void 0 : d.key) ===
|
|
937
|
+
b.sortable && (d == null ? void 0 : d.key) === w && /* @__PURE__ */ y("span", { "aria-hidden": "true", children: [
|
|
938
938
|
" ",
|
|
939
939
|
d.direction === "asc" ? "▲" : "▼"
|
|
940
940
|
] })
|
|
941
941
|
]
|
|
942
942
|
},
|
|
943
|
-
|
|
943
|
+
w
|
|
944
944
|
);
|
|
945
945
|
})
|
|
946
946
|
] }) }),
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
const
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
|
|
947
|
+
/* @__PURE__ */ o("tbody", { children: t ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.length + (S ? 1 : 0), className: "text-center text-body-secondary py-4", children: "Loading…" }) }) : a ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.length + (S ? 1 : 0), className: "text-center text-danger py-4", children: a }) }) : r.length === 0 ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.length + (S ? 1 : 0), className: "text-center text-body-secondary py-4", children: i }) }) : r.map((b) => {
|
|
948
|
+
const w = n(b);
|
|
949
|
+
return /* @__PURE__ */ y("tr", { children: [
|
|
950
|
+
S && /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(
|
|
951
951
|
"input",
|
|
952
952
|
{
|
|
953
953
|
type: "checkbox",
|
|
954
954
|
className: "form-check-input",
|
|
955
|
-
checked:
|
|
956
|
-
onChange: () =>
|
|
955
|
+
checked: x.has(w),
|
|
956
|
+
onChange: () => N(w),
|
|
957
957
|
"aria-label": "Select row"
|
|
958
958
|
}
|
|
959
959
|
) }),
|
|
960
|
-
e.map((
|
|
961
|
-
] },
|
|
960
|
+
e.map((g) => /* @__PURE__ */ o("td", { className: Je(g.align), children: Pr(g, b) }, Ge(g)))
|
|
961
|
+
] }, w);
|
|
962
962
|
}) })
|
|
963
963
|
] }),
|
|
964
|
-
|
|
965
|
-
/* @__PURE__ */
|
|
964
|
+
_ && /* @__PURE__ */ y("div", { className: "d-flex justify-content-between align-items-center mt-2 rrc-data-grid__footer", children: [
|
|
965
|
+
/* @__PURE__ */ y("span", { className: "text-body-secondary small", children: [
|
|
966
966
|
"Page ",
|
|
967
|
-
|
|
967
|
+
f,
|
|
968
968
|
" of ",
|
|
969
|
-
|
|
969
|
+
C,
|
|
970
970
|
" (",
|
|
971
|
-
|
|
971
|
+
p,
|
|
972
972
|
" rows)"
|
|
973
973
|
] }),
|
|
974
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ o(Rr, { currentPage: f, pageSize: m, totalItems: p, onPageChange: k })
|
|
975
975
|
] })
|
|
976
976
|
] });
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
return /* @__PURE__ */
|
|
978
|
+
function Br({ size: e = "md", variant: r, className: n, label: t = "Loading..." }) {
|
|
979
|
+
return /* @__PURE__ */ o(
|
|
980
980
|
"span",
|
|
981
981
|
{
|
|
982
|
-
className:
|
|
982
|
+
className: h("spinner-border", "rrc-spinner", e === "sm" && "spinner-border-sm", r && `text-${r}`, n),
|
|
983
983
|
role: "status",
|
|
984
|
-
children: /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ o("span", { className: "visually-hidden", children: t })
|
|
985
985
|
}
|
|
986
986
|
);
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function ke({
|
|
989
989
|
variant: e = "primary",
|
|
990
|
-
size:
|
|
991
|
-
disabled:
|
|
992
|
-
loading:
|
|
993
|
-
type:
|
|
990
|
+
size: r,
|
|
991
|
+
disabled: n,
|
|
992
|
+
loading: t,
|
|
993
|
+
type: a = "button",
|
|
994
994
|
className: i,
|
|
995
|
-
children:
|
|
995
|
+
children: l,
|
|
996
996
|
onClick: c,
|
|
997
997
|
...s
|
|
998
998
|
}) {
|
|
999
|
-
const d =
|
|
1000
|
-
return /* @__PURE__ */
|
|
999
|
+
const d = n || t;
|
|
1000
|
+
return /* @__PURE__ */ y(
|
|
1001
1001
|
"button",
|
|
1002
1002
|
{
|
|
1003
|
-
type:
|
|
1004
|
-
className:
|
|
1003
|
+
type: a,
|
|
1004
|
+
className: h("btn", `btn-${e}`, r && `btn-${r}`, "rrc-btn", `rrc-btn--${e}`, i),
|
|
1005
1005
|
disabled: d,
|
|
1006
|
-
"aria-busy":
|
|
1006
|
+
"aria-busy": t || void 0,
|
|
1007
1007
|
onClick: d ? void 0 : c,
|
|
1008
1008
|
...s,
|
|
1009
1009
|
children: [
|
|
1010
|
-
|
|
1011
|
-
|
|
1010
|
+
t && /* @__PURE__ */ o(Br, { size: "sm", className: "me-2", label: "" }),
|
|
1011
|
+
l
|
|
1012
1012
|
]
|
|
1013
1013
|
}
|
|
1014
1014
|
);
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
return /* @__PURE__ */
|
|
1018
|
-
|
|
1019
|
-
|
|
1016
|
+
function or({ variant: e = "info", dismissible: r, onDismiss: n, className: t, children: a }) {
|
|
1017
|
+
return /* @__PURE__ */ y("div", { className: h("alert", `alert-${e}`, r && "alert-dismissible", "rrc-alert", `rrc-alert--${e}`, t), role: "alert", children: [
|
|
1018
|
+
a,
|
|
1019
|
+
r && /* @__PURE__ */ o("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: n })
|
|
1020
1020
|
] });
|
|
1021
1021
|
}
|
|
1022
|
-
const
|
|
1023
|
-
function
|
|
1024
|
-
const [
|
|
1025
|
-
|
|
1026
|
-
const s =
|
|
1022
|
+
const ir = Ve(null), Fr = 4e3;
|
|
1023
|
+
function mt({ children: e }) {
|
|
1024
|
+
const [r, n] = M([]), t = L(0), a = L(/* @__PURE__ */ new Map());
|
|
1025
|
+
U(() => {
|
|
1026
|
+
const s = a.current;
|
|
1027
1027
|
return () => {
|
|
1028
1028
|
s.forEach(clearTimeout), s.clear();
|
|
1029
1029
|
};
|
|
1030
1030
|
}, []);
|
|
1031
|
-
const i =
|
|
1032
|
-
const d =
|
|
1033
|
-
d && (clearTimeout(d),
|
|
1034
|
-
}, []),
|
|
1031
|
+
const i = F((s) => {
|
|
1032
|
+
const d = a.current.get(s);
|
|
1033
|
+
d && (clearTimeout(d), a.current.delete(s)), n((u) => u.filter((f) => f.id !== s));
|
|
1034
|
+
}, []), l = F(
|
|
1035
1035
|
(s, d) => {
|
|
1036
|
-
const u =
|
|
1037
|
-
return
|
|
1036
|
+
const u = t.current++, f = (d == null ? void 0 : d.variant) ?? "info", m = (d == null ? void 0 : d.duration) ?? Fr;
|
|
1037
|
+
return n((p) => [...p, { id: u, message: s, variant: f }]), m > 0 && a.current.set(
|
|
1038
1038
|
u,
|
|
1039
1039
|
setTimeout(() => i(u), m)
|
|
1040
1040
|
), u;
|
|
1041
1041
|
},
|
|
1042
1042
|
[i]
|
|
1043
|
-
), c =
|
|
1043
|
+
), c = J(
|
|
1044
1044
|
() => ({
|
|
1045
|
-
show:
|
|
1045
|
+
show: l,
|
|
1046
1046
|
dismiss: i,
|
|
1047
|
-
success: (s, d) =>
|
|
1048
|
-
error: (s, d) =>
|
|
1049
|
-
info: (s, d) =>
|
|
1050
|
-
warning: (s, d) =>
|
|
1047
|
+
success: (s, d) => l(s, { ...d, variant: "success" }),
|
|
1048
|
+
error: (s, d) => l(s, { ...d, variant: "danger" }),
|
|
1049
|
+
info: (s, d) => l(s, { ...d, variant: "info" }),
|
|
1050
|
+
warning: (s, d) => l(s, { ...d, variant: "warning" })
|
|
1051
1051
|
}),
|
|
1052
|
-
[
|
|
1052
|
+
[l, i]
|
|
1053
1053
|
);
|
|
1054
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ y(ir.Provider, { value: c, children: [
|
|
1055
1055
|
e,
|
|
1056
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ o("div", { className: "toast-container position-fixed bottom-0 end-0 p-3 rrc-toast-container", style: { zIndex: 1090 }, children: r.map((s) => /* @__PURE__ */ o(or, { variant: s.variant, dismissible: !0, onDismiss: () => i(s.id), className: "shadow-sm", children: s.message }, s.id)) })
|
|
1057
1057
|
] });
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const e =
|
|
1059
|
+
function ft() {
|
|
1060
|
+
const e = we(ir);
|
|
1061
1061
|
if (!e)
|
|
1062
1062
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1063
1063
|
return e;
|
|
1064
1064
|
}
|
|
1065
|
-
const
|
|
1066
|
-
function
|
|
1067
|
-
const [
|
|
1068
|
-
|
|
1069
|
-
}), []),
|
|
1065
|
+
const lr = Ve(null);
|
|
1066
|
+
function ht({ children: e }) {
|
|
1067
|
+
const [r, n] = M(null), t = F((i) => new Promise((l) => {
|
|
1068
|
+
n({ ...i, resolve: l });
|
|
1069
|
+
}), []), a = F(
|
|
1070
1070
|
(i) => {
|
|
1071
|
-
|
|
1071
|
+
r == null || r.resolve(i), n(null);
|
|
1072
1072
|
},
|
|
1073
|
-
[
|
|
1073
|
+
[r]
|
|
1074
1074
|
);
|
|
1075
|
-
return /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ y(lr.Provider, { value: t, children: [
|
|
1076
1076
|
e,
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
|
|
1077
|
+
/* @__PURE__ */ o(
|
|
1078
|
+
Vr,
|
|
1079
1079
|
{
|
|
1080
|
-
open:
|
|
1081
|
-
onClose: () =>
|
|
1082
|
-
title: (
|
|
1083
|
-
footer: /* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1080
|
+
open: r !== null,
|
|
1081
|
+
onClose: () => a(!1),
|
|
1082
|
+
title: (r == null ? void 0 : r.title) ?? "Confirm",
|
|
1083
|
+
footer: /* @__PURE__ */ y(Q, { children: [
|
|
1084
|
+
/* @__PURE__ */ o(ke, { variant: "outline-secondary", onClick: () => a(!1), children: (r == null ? void 0 : r.cancelLabel) ?? "Cancel" }),
|
|
1085
|
+
/* @__PURE__ */ o(ke, { variant: (r == null ? void 0 : r.confirmVariant) ?? "danger", onClick: () => a(!0), children: (r == null ? void 0 : r.confirmLabel) ?? "Confirm" })
|
|
1086
1086
|
] }),
|
|
1087
|
-
children:
|
|
1087
|
+
children: r == null ? void 0 : r.message
|
|
1088
1088
|
}
|
|
1089
1089
|
)
|
|
1090
1090
|
] });
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const e =
|
|
1092
|
+
function pt() {
|
|
1093
|
+
const e = we(lr);
|
|
1094
1094
|
if (!e)
|
|
1095
1095
|
throw new Error("useConfirm must be used within a ConfirmProvider");
|
|
1096
1096
|
return e;
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return /* @__PURE__ */
|
|
1098
|
+
function Hr({ variant: e = "primary", appearance: r = "solid", pill: n, className: t, children: a }) {
|
|
1099
|
+
return /* @__PURE__ */ o(
|
|
1100
|
+
"span",
|
|
1101
|
+
{
|
|
1102
|
+
className: h(
|
|
1103
|
+
"badge",
|
|
1104
|
+
// Bootstrap's own solid fill is only correct for the solid appearance;
|
|
1105
|
+
// the tinted forms are painted by this library's stylesheet instead.
|
|
1106
|
+
r === "solid" && `bg-${e}`,
|
|
1107
|
+
n && "rounded-pill",
|
|
1108
|
+
"rrc-badge",
|
|
1109
|
+
`rrc-badge--${e}`,
|
|
1110
|
+
`rrc-badge--${r}`,
|
|
1111
|
+
t
|
|
1112
|
+
),
|
|
1113
|
+
children: a
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1100
1116
|
}
|
|
1101
|
-
const
|
|
1117
|
+
const jr = {
|
|
1102
1118
|
sm: "0.875em",
|
|
1103
1119
|
lg: "1.5em",
|
|
1104
1120
|
xl: "2em"
|
|
1105
1121
|
};
|
|
1106
|
-
function
|
|
1107
|
-
return /* @__PURE__ */
|
|
1122
|
+
function Le({ name: e, size: r, className: n, label: t }) {
|
|
1123
|
+
return /* @__PURE__ */ o(
|
|
1108
1124
|
"i",
|
|
1109
1125
|
{
|
|
1110
|
-
className:
|
|
1111
|
-
style:
|
|
1112
|
-
role:
|
|
1113
|
-
"aria-label":
|
|
1114
|
-
"aria-hidden":
|
|
1126
|
+
className: h(e, "rrc-icon", n),
|
|
1127
|
+
style: r ? { fontSize: jr[r] } : void 0,
|
|
1128
|
+
role: t ? "img" : void 0,
|
|
1129
|
+
"aria-label": t,
|
|
1130
|
+
"aria-hidden": t ? void 0 : !0
|
|
1115
1131
|
}
|
|
1116
1132
|
);
|
|
1117
1133
|
}
|
|
1118
|
-
function
|
|
1134
|
+
function Ur(e) {
|
|
1119
1135
|
switch (e) {
|
|
1120
1136
|
case "pill":
|
|
1121
1137
|
return "nav-pills";
|
|
@@ -1127,207 +1143,210 @@ function Je(e) {
|
|
|
1127
1143
|
return "nav-tabs";
|
|
1128
1144
|
}
|
|
1129
1145
|
}
|
|
1130
|
-
const
|
|
1146
|
+
const qr = {
|
|
1131
1147
|
sm: "small",
|
|
1132
1148
|
lg: "fs-5"
|
|
1133
1149
|
};
|
|
1134
|
-
function
|
|
1135
|
-
var
|
|
1150
|
+
function bt({ items: e, activeKey: r, defaultActiveKey: n, onChange: t, variant: a = "default", orientation: i = "horizontal", size: l, stretch: c, className: s }) {
|
|
1151
|
+
var N;
|
|
1136
1152
|
const [d, u] = T({
|
|
1137
|
-
value:
|
|
1138
|
-
defaultValue:
|
|
1139
|
-
onChange:
|
|
1140
|
-
}),
|
|
1141
|
-
function
|
|
1142
|
-
var
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1153
|
+
value: r,
|
|
1154
|
+
defaultValue: n ?? ((N = e[0]) == null ? void 0 : N.key) ?? "",
|
|
1155
|
+
onChange: t
|
|
1156
|
+
}), f = e.find((b) => b.key === d), m = a === "button", p = i === "vertical", k = L([]);
|
|
1157
|
+
function S(b, w) {
|
|
1158
|
+
var I;
|
|
1159
|
+
const g = e[b];
|
|
1160
|
+
g && (u(g.key), w && ((I = k.current[b]) == null || I.focus()));
|
|
1145
1161
|
}
|
|
1146
|
-
function
|
|
1147
|
-
var
|
|
1162
|
+
function x(b, w) {
|
|
1163
|
+
var I;
|
|
1148
1164
|
if (e.length === 0)
|
|
1149
1165
|
return b;
|
|
1150
|
-
let
|
|
1151
|
-
for (let
|
|
1152
|
-
if (
|
|
1153
|
-
return
|
|
1166
|
+
let g = b;
|
|
1167
|
+
for (let D = 0; D < e.length; D++)
|
|
1168
|
+
if (g = (g + w + e.length) % e.length, !((I = e[g]) != null && I.disabled))
|
|
1169
|
+
return g;
|
|
1154
1170
|
return b;
|
|
1155
1171
|
}
|
|
1156
|
-
function
|
|
1157
|
-
var
|
|
1158
|
-
const
|
|
1159
|
-
if (b.key ===
|
|
1160
|
-
b.preventDefault(),
|
|
1161
|
-
else if (b.key ===
|
|
1162
|
-
b.preventDefault(),
|
|
1172
|
+
function _(b) {
|
|
1173
|
+
var D;
|
|
1174
|
+
const w = e.findIndex((O) => O.key === d), g = p ? "ArrowDown" : "ArrowRight", I = p ? "ArrowUp" : "ArrowLeft";
|
|
1175
|
+
if (b.key === g)
|
|
1176
|
+
b.preventDefault(), S(x(w, 1), !0);
|
|
1177
|
+
else if (b.key === I)
|
|
1178
|
+
b.preventDefault(), S(x(w, -1), !0);
|
|
1163
1179
|
else if (b.key === "Home") {
|
|
1164
1180
|
b.preventDefault();
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1181
|
+
const O = e.findIndex((q) => !q.disabled);
|
|
1182
|
+
O >= 0 && S(O, !0);
|
|
1167
1183
|
} else if (b.key === "End") {
|
|
1168
1184
|
b.preventDefault();
|
|
1169
|
-
for (let
|
|
1170
|
-
if (!((
|
|
1171
|
-
|
|
1185
|
+
for (let O = e.length - 1; O >= 0; O--)
|
|
1186
|
+
if (!((D = e[O]) != null && D.disabled)) {
|
|
1187
|
+
S(O, !0);
|
|
1172
1188
|
break;
|
|
1173
1189
|
}
|
|
1174
1190
|
}
|
|
1175
1191
|
}
|
|
1176
|
-
const
|
|
1192
|
+
const C = /* @__PURE__ */ o(
|
|
1177
1193
|
"div",
|
|
1178
1194
|
{
|
|
1179
|
-
className:
|
|
1195
|
+
className: h(
|
|
1180
1196
|
m ? "btn-group" : "nav",
|
|
1181
|
-
|
|
1182
|
-
|
|
1197
|
+
"rrc-tabs__list",
|
|
1198
|
+
`rrc-tabs__list--${a}`,
|
|
1199
|
+
!m && Ur(a),
|
|
1200
|
+
!m && p && "flex-column",
|
|
1183
1201
|
!m && c && "nav-fill",
|
|
1184
|
-
!m &&
|
|
1202
|
+
!m && l && qr[l]
|
|
1185
1203
|
),
|
|
1186
1204
|
role: "tablist",
|
|
1187
1205
|
"aria-orientation": i,
|
|
1188
|
-
onKeyDown:
|
|
1189
|
-
children: e.map((b,
|
|
1190
|
-
const
|
|
1191
|
-
b.icon && /* @__PURE__ */
|
|
1206
|
+
onKeyDown: _,
|
|
1207
|
+
children: e.map((b, w) => {
|
|
1208
|
+
const g = b.key === d, I = /* @__PURE__ */ y(Q, { children: [
|
|
1209
|
+
b.icon && /* @__PURE__ */ o(Le, { name: b.icon, size: "sm", className: "me-1" }),
|
|
1192
1210
|
b.label,
|
|
1193
|
-
b.badge != null && /* @__PURE__ */
|
|
1194
|
-
] }),
|
|
1211
|
+
b.badge != null && /* @__PURE__ */ o(Hr, { variant: g && !m ? "primary" : "secondary", appearance: "light", pill: !0, className: "ms-2", children: b.badge })
|
|
1212
|
+
] }), D = /* @__PURE__ */ o(
|
|
1195
1213
|
"button",
|
|
1196
1214
|
{
|
|
1197
|
-
ref: (
|
|
1198
|
-
|
|
1215
|
+
ref: (O) => {
|
|
1216
|
+
k.current[w] = O;
|
|
1199
1217
|
},
|
|
1200
1218
|
type: "button",
|
|
1201
1219
|
id: `tab-${b.key}`,
|
|
1202
|
-
className:
|
|
1220
|
+
className: h(m ? h("btn", l ? `btn-${l}` : "btn-sm", g ? "btn-primary" : "btn-outline-primary") : h("nav-link", "rrc-tabs__link", g && "active")),
|
|
1203
1221
|
role: "tab",
|
|
1204
|
-
"aria-selected":
|
|
1222
|
+
"aria-selected": g,
|
|
1205
1223
|
"aria-controls": `tabpanel-${b.key}`,
|
|
1206
|
-
tabIndex:
|
|
1224
|
+
tabIndex: g ? 0 : -1,
|
|
1207
1225
|
disabled: b.disabled,
|
|
1208
|
-
onClick: () => w
|
|
1209
|
-
children:
|
|
1226
|
+
onClick: () => S(w, !1),
|
|
1227
|
+
children: I
|
|
1210
1228
|
},
|
|
1211
1229
|
b.key
|
|
1212
1230
|
);
|
|
1213
|
-
return m ?
|
|
1231
|
+
return m ? D : /* @__PURE__ */ o("div", { className: "nav-item", role: "presentation", children: D }, b.key);
|
|
1214
1232
|
})
|
|
1215
1233
|
}
|
|
1216
|
-
),
|
|
1217
|
-
return
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
] }) : /* @__PURE__ */
|
|
1221
|
-
|
|
1222
|
-
|
|
1234
|
+
), v = (f == null ? void 0 : f.content) != null && /* @__PURE__ */ o("div", { id: `tabpanel-${f.key}`, className: h("tab-content", "rrc-tabs__panel", !p && "pt-3"), role: "tabpanel", "aria-labelledby": `tab-${f.key}`, children: f.content });
|
|
1235
|
+
return p ? /* @__PURE__ */ y("div", { className: h("d-flex align-items-start gap-3", "rrc-tabs", "rrc-tabs--vertical", s), children: [
|
|
1236
|
+
C,
|
|
1237
|
+
v && /* @__PURE__ */ o("div", { className: "flex-grow-1", children: v })
|
|
1238
|
+
] }) : /* @__PURE__ */ y("div", { className: h("rrc-tabs", s), children: [
|
|
1239
|
+
C,
|
|
1240
|
+
v
|
|
1223
1241
|
] });
|
|
1224
1242
|
}
|
|
1225
|
-
function
|
|
1226
|
-
const [
|
|
1227
|
-
value:
|
|
1228
|
-
defaultValue:
|
|
1229
|
-
onChange:
|
|
1230
|
-
}), s = new Set(
|
|
1243
|
+
function vt({ items: e, multiple: r = !1, openKeys: n, defaultOpenKeys: t, onChange: a, className: i }) {
|
|
1244
|
+
const [l, c] = T({
|
|
1245
|
+
value: n,
|
|
1246
|
+
defaultValue: t ?? [],
|
|
1247
|
+
onChange: a
|
|
1248
|
+
}), s = new Set(l);
|
|
1231
1249
|
function d(u) {
|
|
1232
|
-
s.has(u) ? c(
|
|
1250
|
+
s.has(u) ? c(l.filter((f) => f !== u)) : c(r ? [...l, u] : [u]);
|
|
1233
1251
|
}
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
const
|
|
1236
|
-
return /* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ o("div", { className: h("accordion", "rrc-accordion", i), children: e.map((u) => {
|
|
1253
|
+
const f = s.has(u.key);
|
|
1254
|
+
return /* @__PURE__ */ y("div", { className: "accordion-item rrc-accordion__item", children: [
|
|
1255
|
+
/* @__PURE__ */ o("h2", { className: "accordion-header", children: /* @__PURE__ */ o(
|
|
1238
1256
|
"button",
|
|
1239
1257
|
{
|
|
1240
1258
|
type: "button",
|
|
1241
|
-
className:
|
|
1242
|
-
"aria-expanded":
|
|
1259
|
+
className: h("accordion-button", "rrc-accordion__button", !f && "collapsed"),
|
|
1260
|
+
"aria-expanded": f,
|
|
1243
1261
|
disabled: u.disabled,
|
|
1244
1262
|
onClick: () => d(u.key),
|
|
1245
1263
|
children: u.header
|
|
1246
1264
|
}
|
|
1247
1265
|
) }),
|
|
1248
|
-
|
|
1266
|
+
f && /* @__PURE__ */ o("div", { className: "accordion-collapse", children: /* @__PURE__ */ o("div", { className: "accordion-body rrc-accordion__body", children: u.content }) })
|
|
1249
1267
|
] }, u.key);
|
|
1250
1268
|
}) });
|
|
1251
1269
|
}
|
|
1252
|
-
function
|
|
1253
|
-
const [
|
|
1254
|
-
return /* @__PURE__ */
|
|
1270
|
+
function sr({ content: e, children: r, placement: n = "top", className: t, wrapperClassName: a }) {
|
|
1271
|
+
const [i, l] = M(!1), c = L(null), s = W();
|
|
1272
|
+
return /* @__PURE__ */ y(
|
|
1255
1273
|
"span",
|
|
1256
1274
|
{
|
|
1257
|
-
ref:
|
|
1258
|
-
className: "position-relative d-inline-block",
|
|
1259
|
-
onMouseEnter: () =>
|
|
1260
|
-
onMouseLeave: () =>
|
|
1261
|
-
onFocus: () =>
|
|
1262
|
-
onBlur: () =>
|
|
1263
|
-
"aria-describedby":
|
|
1275
|
+
ref: c,
|
|
1276
|
+
className: h("position-relative", a ?? "d-inline-block"),
|
|
1277
|
+
onMouseEnter: () => l(!0),
|
|
1278
|
+
onMouseLeave: () => l(!1),
|
|
1279
|
+
onFocus: () => l(!0),
|
|
1280
|
+
onBlur: () => l(!1),
|
|
1281
|
+
"aria-describedby": i ? s : void 0,
|
|
1264
1282
|
children: [
|
|
1265
|
-
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
|
|
1283
|
+
r,
|
|
1284
|
+
/* @__PURE__ */ o(
|
|
1285
|
+
oe,
|
|
1268
1286
|
{
|
|
1269
|
-
open:
|
|
1270
|
-
onClose: () =>
|
|
1271
|
-
anchorRef:
|
|
1272
|
-
className:
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1287
|
+
open: i,
|
|
1288
|
+
onClose: () => l(!1),
|
|
1289
|
+
anchorRef: c,
|
|
1290
|
+
className: h("tooltip show", `bs-tooltip-${n}`, "position-absolute", "w-auto", "rrc-tooltip", t),
|
|
1291
|
+
children: /* @__PURE__ */ o("span", { id: s, role: "tooltip", className: "tooltip-inner", children: e })
|
|
1274
1292
|
}
|
|
1275
1293
|
)
|
|
1276
1294
|
]
|
|
1277
1295
|
}
|
|
1278
1296
|
);
|
|
1279
1297
|
}
|
|
1280
|
-
function
|
|
1281
|
-
const [i,
|
|
1282
|
-
return /* @__PURE__ */
|
|
1283
|
-
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
|
|
1298
|
+
function gt({ title: e, content: r, children: n, placement: t = "bottom", className: a }) {
|
|
1299
|
+
const [i, l] = M(!1), c = L(null);
|
|
1300
|
+
return /* @__PURE__ */ y("span", { ref: c, className: "position-relative d-inline-block", onClick: () => l((s) => !s), children: [
|
|
1301
|
+
n,
|
|
1302
|
+
/* @__PURE__ */ y(
|
|
1303
|
+
oe,
|
|
1286
1304
|
{
|
|
1287
1305
|
open: i,
|
|
1288
|
-
onClose: () =>
|
|
1306
|
+
onClose: () => l(!1),
|
|
1289
1307
|
anchorRef: c,
|
|
1290
|
-
className:
|
|
1308
|
+
className: h("popover show", `bs-popover-${t}`, "position-absolute", "w-auto", "rrc-popover", a),
|
|
1291
1309
|
children: [
|
|
1292
|
-
e && /* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1310
|
+
e && /* @__PURE__ */ o("h3", { className: "popover-header rrc-popover__header", children: e }),
|
|
1311
|
+
/* @__PURE__ */ o("div", { className: "popover-body rrc-popover__body", children: r })
|
|
1294
1312
|
]
|
|
1295
1313
|
}
|
|
1296
1314
|
)
|
|
1297
1315
|
] });
|
|
1298
1316
|
}
|
|
1299
|
-
function
|
|
1300
|
-
return /* @__PURE__ */
|
|
1317
|
+
function ye({ width: e = "100%", height: r = "1rem", circle: n, className: t }) {
|
|
1318
|
+
return /* @__PURE__ */ o("span", { className: h("placeholder-glow d-inline-block", "rrc-skeleton", t), style: { width: e, height: r }, "aria-hidden": "true", children: /* @__PURE__ */ o("span", { className: h("placeholder w-100 h-100 d-block", n && "rounded-circle") }) });
|
|
1301
1319
|
}
|
|
1302
|
-
function
|
|
1303
|
-
return /* @__PURE__ */
|
|
1320
|
+
function cr({ direction: e = "column", gap: r = 2, align: n, justify: t, wrap: a, className: i, children: l }) {
|
|
1321
|
+
return /* @__PURE__ */ o(
|
|
1304
1322
|
"div",
|
|
1305
1323
|
{
|
|
1306
|
-
className:
|
|
1324
|
+
className: h(
|
|
1307
1325
|
"d-flex",
|
|
1326
|
+
"rrc-stack",
|
|
1308
1327
|
e === "row" ? "flex-row" : "flex-column",
|
|
1309
|
-
`gap-${
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1328
|
+
`gap-${r}`,
|
|
1329
|
+
n && `align-items-${n}`,
|
|
1330
|
+
t && `justify-content-${t}`,
|
|
1331
|
+
a && "flex-wrap",
|
|
1313
1332
|
i
|
|
1314
1333
|
),
|
|
1315
|
-
children:
|
|
1334
|
+
children: l
|
|
1316
1335
|
}
|
|
1317
1336
|
);
|
|
1318
1337
|
}
|
|
1319
|
-
const
|
|
1338
|
+
const zr = {
|
|
1320
1339
|
xs: "0.75rem",
|
|
1321
1340
|
sm: "0.875rem",
|
|
1322
1341
|
md: "1rem",
|
|
1323
1342
|
lg: "1.25rem",
|
|
1324
1343
|
xl: "1.5rem"
|
|
1325
|
-
},
|
|
1344
|
+
}, Wr = {
|
|
1326
1345
|
normal: "fw-normal",
|
|
1327
1346
|
medium: "fw-medium",
|
|
1328
1347
|
semibold: "fw-semibold",
|
|
1329
1348
|
bold: "fw-bold"
|
|
1330
|
-
},
|
|
1349
|
+
}, Gr = {
|
|
1331
1350
|
default: void 0,
|
|
1332
1351
|
muted: "text-body-secondary",
|
|
1333
1352
|
primary: "text-primary",
|
|
@@ -1336,134 +1355,136 @@ const Xe = {
|
|
|
1336
1355
|
warning: "text-warning",
|
|
1337
1356
|
info: "text-info"
|
|
1338
1357
|
};
|
|
1339
|
-
function
|
|
1340
|
-
return /* @__PURE__ */
|
|
1358
|
+
function te({ as: e, size: r = "md", weight: n, tone: t = "default", align: a, truncate: i, wrap: l = !0, className: c, children: s }) {
|
|
1359
|
+
return /* @__PURE__ */ o(
|
|
1341
1360
|
e ?? "span",
|
|
1342
1361
|
{
|
|
1343
|
-
className:
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1362
|
+
className: h(
|
|
1363
|
+
"rrc-text",
|
|
1364
|
+
n && Wr[n],
|
|
1365
|
+
Gr[t],
|
|
1366
|
+
a && `text-${a}`,
|
|
1347
1367
|
i && "text-truncate",
|
|
1348
|
-
!
|
|
1368
|
+
!l && !i && "text-nowrap",
|
|
1349
1369
|
c
|
|
1350
1370
|
),
|
|
1351
|
-
style: { fontSize:
|
|
1371
|
+
style: { fontSize: zr[r] },
|
|
1352
1372
|
children: s
|
|
1353
1373
|
}
|
|
1354
1374
|
);
|
|
1355
1375
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return /* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
|
|
1360
|
-
(e ||
|
|
1361
|
-
e && /* @__PURE__ */
|
|
1362
|
-
|
|
1376
|
+
function Jr({ title: e, subtitle: r, icon: n, avatar: t, actions: a }) {
|
|
1377
|
+
return /* @__PURE__ */ y("div", { className: "d-flex align-items-center justify-content-between gap-3 rrc-card__header-row", children: [
|
|
1378
|
+
/* @__PURE__ */ y("div", { className: "d-flex align-items-center gap-3", style: { minWidth: 0 }, children: [
|
|
1379
|
+
t || n && /* @__PURE__ */ o("span", { className: "fs-2 lh-1", children: n }),
|
|
1380
|
+
(e || r) && /* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
|
|
1381
|
+
e && /* @__PURE__ */ o(te, { as: "div", size: "lg", weight: "semibold", truncate: !0, children: e }),
|
|
1382
|
+
r && /* @__PURE__ */ o(te, { as: "div", size: "sm", tone: "muted", truncate: !0, children: r })
|
|
1363
1383
|
] })
|
|
1364
1384
|
] }),
|
|
1365
|
-
|
|
1385
|
+
a && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-2 flex-shrink-0", children: a })
|
|
1366
1386
|
] });
|
|
1367
1387
|
}
|
|
1368
|
-
function
|
|
1369
|
-
const
|
|
1370
|
-
return /* @__PURE__ */
|
|
1371
|
-
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1388
|
+
function yt({ title: e, subtitle: r, icon: n, avatar: t, actions: a, header: i, footer: l, loading: c, className: s, children: d }) {
|
|
1389
|
+
const f = i ?? (!!(e || r || n || t || a) ? /* @__PURE__ */ o(Jr, { title: e, subtitle: r, icon: n, avatar: t, actions: a }) : void 0);
|
|
1390
|
+
return /* @__PURE__ */ y("div", { className: h("card", "rrc-card", s), children: [
|
|
1391
|
+
f && /* @__PURE__ */ o("div", { className: "card-header rrc-card__header", children: f }),
|
|
1392
|
+
/* @__PURE__ */ o("div", { className: "card-body rrc-card__body", children: c ? /* @__PURE__ */ y(cr, { gap: 2, children: [
|
|
1393
|
+
/* @__PURE__ */ o(ye, { height: "1rem", width: "60%" }),
|
|
1394
|
+
/* @__PURE__ */ o(ye, { height: "1rem" }),
|
|
1395
|
+
/* @__PURE__ */ o(ye, { height: "1rem", width: "80%" })
|
|
1376
1396
|
] }) : d }),
|
|
1377
|
-
|
|
1397
|
+
l && /* @__PURE__ */ o("div", { className: "card-footer rrc-card__footer", children: l })
|
|
1378
1398
|
] });
|
|
1379
1399
|
}
|
|
1380
|
-
function
|
|
1381
|
-
return
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
] }) : /* @__PURE__ */
|
|
1400
|
+
function Zr({ className: e, vertical: r, label: n }) {
|
|
1401
|
+
return r ? /* @__PURE__ */ o("div", { className: h("vr", "rrc-divider", e), role: "separator", "aria-orientation": "vertical" }) : n ? /* @__PURE__ */ y("div", { className: h("d-flex align-items-center gap-2 my-3", "rrc-divider", "rrc-divider--labelled", e), role: "separator", children: [
|
|
1402
|
+
/* @__PURE__ */ o("hr", { className: "flex-grow-1 m-0" }),
|
|
1403
|
+
/* @__PURE__ */ o("span", { className: "text-body-secondary small", children: n }),
|
|
1404
|
+
/* @__PURE__ */ o("hr", { className: "flex-grow-1 m-0" })
|
|
1405
|
+
] }) : /* @__PURE__ */ o("hr", { className: h("my-3", "rrc-divider", e), role: "separator" });
|
|
1386
1406
|
}
|
|
1387
|
-
function
|
|
1388
|
-
return /* @__PURE__ */
|
|
1407
|
+
function Nt({ fluid: e, className: r, children: n }) {
|
|
1408
|
+
return /* @__PURE__ */ o("div", { className: h(e ? "container-fluid" : "container", "rrc-container", r), children: n });
|
|
1389
1409
|
}
|
|
1390
|
-
function
|
|
1391
|
-
return /* @__PURE__ */
|
|
1410
|
+
function kt({ className: e, children: r }) {
|
|
1411
|
+
return /* @__PURE__ */ o("div", { className: h("row", "rrc-row", e), children: r });
|
|
1392
1412
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return /* @__PURE__ */
|
|
1413
|
+
function wt({ span: e, sm: r, md: n, lg: t, xl: a, className: i, children: l }) {
|
|
1414
|
+
return /* @__PURE__ */ o(
|
|
1395
1415
|
"div",
|
|
1396
1416
|
{
|
|
1397
|
-
className:
|
|
1417
|
+
className: h(
|
|
1398
1418
|
e ? `col-${e}` : "col",
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1419
|
+
"rrc-col",
|
|
1420
|
+
r ? `col-sm-${r}` : void 0,
|
|
1421
|
+
n ? `col-md-${n}` : void 0,
|
|
1422
|
+
t ? `col-lg-${t}` : void 0,
|
|
1423
|
+
a ? `col-xl-${a}` : void 0,
|
|
1403
1424
|
i
|
|
1404
1425
|
),
|
|
1405
|
-
children:
|
|
1426
|
+
children: l
|
|
1406
1427
|
}
|
|
1407
1428
|
);
|
|
1408
1429
|
}
|
|
1409
|
-
function
|
|
1410
|
-
return /* @__PURE__ */
|
|
1411
|
-
const
|
|
1412
|
-
return /* @__PURE__ */
|
|
1430
|
+
function Yr({ items: e, className: r }) {
|
|
1431
|
+
return /* @__PURE__ */ o("nav", { "aria-label": "breadcrumb", className: h("rrc-breadcrumb", r), children: /* @__PURE__ */ o("ol", { className: "breadcrumb mb-0 rrc-breadcrumb__list", children: e.map((n, t) => {
|
|
1432
|
+
const a = t === e.length - 1, i = !a && (n.href || n.onClick);
|
|
1433
|
+
return /* @__PURE__ */ o("li", { className: h("breadcrumb-item", a && "active"), "aria-current": a ? "page" : void 0, children: i ? /* @__PURE__ */ o(
|
|
1413
1434
|
"a",
|
|
1414
1435
|
{
|
|
1415
|
-
href:
|
|
1416
|
-
onClick: (
|
|
1436
|
+
href: n.href ?? "#",
|
|
1437
|
+
onClick: (l) => {
|
|
1417
1438
|
var c;
|
|
1418
|
-
|
|
1439
|
+
n.href || l.preventDefault(), (c = n.onClick) == null || c.call(n);
|
|
1419
1440
|
},
|
|
1420
|
-
children:
|
|
1441
|
+
children: n.label
|
|
1421
1442
|
}
|
|
1422
|
-
) :
|
|
1443
|
+
) : n.label }, t);
|
|
1423
1444
|
}) }) });
|
|
1424
1445
|
}
|
|
1425
|
-
function
|
|
1426
|
-
const [
|
|
1446
|
+
function _t({ items: e, children: r, placement: n = "start", className: t }) {
|
|
1447
|
+
const [a, i] = M(!1), l = L(null), c = F(() => i(!1), []), s = F(
|
|
1427
1448
|
(m) => {
|
|
1428
|
-
var
|
|
1429
|
-
const
|
|
1430
|
-
!
|
|
1449
|
+
var k;
|
|
1450
|
+
const p = e[m];
|
|
1451
|
+
!p || p.disabled || ((k = p.onSelect) == null || k.call(p), c());
|
|
1431
1452
|
},
|
|
1432
1453
|
[e, c]
|
|
1433
|
-
), { activeIndex: d, setActiveIndex: u, handleKeyDown:
|
|
1454
|
+
), { activeIndex: d, setActiveIndex: u, handleKeyDown: f } = xe({
|
|
1434
1455
|
itemCount: e.length,
|
|
1435
|
-
isOpen:
|
|
1456
|
+
isOpen: a,
|
|
1436
1457
|
onSelect: s,
|
|
1437
1458
|
onClose: c
|
|
1438
1459
|
});
|
|
1439
|
-
return /* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ y(
|
|
1440
1461
|
"span",
|
|
1441
1462
|
{
|
|
1442
|
-
ref:
|
|
1463
|
+
ref: l,
|
|
1443
1464
|
className: "position-relative d-inline-block",
|
|
1444
1465
|
onClick: () => i((m) => !m),
|
|
1445
|
-
onKeyDown:
|
|
1466
|
+
onKeyDown: f,
|
|
1446
1467
|
children: [
|
|
1447
|
-
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
|
|
1468
|
+
r,
|
|
1469
|
+
/* @__PURE__ */ o(
|
|
1470
|
+
oe,
|
|
1450
1471
|
{
|
|
1451
|
-
open:
|
|
1472
|
+
open: a,
|
|
1452
1473
|
onClose: c,
|
|
1453
|
-
anchorRef:
|
|
1474
|
+
anchorRef: l,
|
|
1454
1475
|
role: "menu",
|
|
1455
|
-
className:
|
|
1456
|
-
children: e.map((m,
|
|
1476
|
+
className: h("dropdown-menu show", n === "end" && "dropdown-menu-end", "rrc-menu", t),
|
|
1477
|
+
children: e.map((m, p) => /* @__PURE__ */ o(
|
|
1457
1478
|
"button",
|
|
1458
1479
|
{
|
|
1459
1480
|
type: "button",
|
|
1460
1481
|
role: "menuitem",
|
|
1461
|
-
className:
|
|
1482
|
+
className: h("dropdown-item", "rrc-menu__item", p === d && "active", m.disabled && "disabled", m.danger && "text-danger"),
|
|
1462
1483
|
disabled: m.disabled,
|
|
1463
|
-
onMouseEnter: () => u(
|
|
1464
|
-
onMouseDown: (
|
|
1465
|
-
onClick: (
|
|
1466
|
-
|
|
1484
|
+
onMouseEnter: () => u(p),
|
|
1485
|
+
onMouseDown: (k) => k.preventDefault(),
|
|
1486
|
+
onClick: (k) => {
|
|
1487
|
+
k.stopPropagation(), s(p);
|
|
1467
1488
|
},
|
|
1468
1489
|
children: m.label
|
|
1469
1490
|
},
|
|
@@ -1475,67 +1496,67 @@ function it({ items: e, children: n, placement: t = "start", className: r }) {
|
|
|
1475
1496
|
}
|
|
1476
1497
|
);
|
|
1477
1498
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return /* @__PURE__ */
|
|
1480
|
-
const i =
|
|
1481
|
-
return /* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1499
|
+
function xt({ steps: e, currentStep: r, className: n }) {
|
|
1500
|
+
return /* @__PURE__ */ o("ol", { className: h("d-flex list-unstyled align-items-center", "rrc-stepper", n), children: e.map((t, a) => {
|
|
1501
|
+
const i = a < r ? "complete" : a === r ? "active" : "upcoming", l = a === e.length - 1;
|
|
1502
|
+
return /* @__PURE__ */ y("li", { className: h("d-flex align-items-center", !l && "flex-grow-1"), children: [
|
|
1503
|
+
/* @__PURE__ */ y("div", { className: "d-flex align-items-center gap-2", children: [
|
|
1504
|
+
/* @__PURE__ */ o(
|
|
1484
1505
|
"span",
|
|
1485
1506
|
{
|
|
1486
|
-
className:
|
|
1507
|
+
className: h(
|
|
1487
1508
|
"d-flex align-items-center justify-content-center rounded-circle flex-shrink-0",
|
|
1488
1509
|
i === "complete" ? "bg-primary text-white" : i === "active" ? "border border-primary text-primary" : "border text-body-secondary"
|
|
1489
1510
|
),
|
|
1490
1511
|
style: { width: "2rem", height: "2rem" },
|
|
1491
1512
|
"aria-current": i === "active" ? "step" : void 0,
|
|
1492
|
-
children: i === "complete" ? "✓" :
|
|
1513
|
+
children: i === "complete" ? "✓" : a + 1
|
|
1493
1514
|
}
|
|
1494
1515
|
),
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
|
|
1516
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1517
|
+
/* @__PURE__ */ o("div", { className: h("small fw-semibold", i === "upcoming" && "text-body-secondary"), children: t.label }),
|
|
1518
|
+
t.description && /* @__PURE__ */ o("div", { className: "small text-body-secondary", children: t.description })
|
|
1498
1519
|
] })
|
|
1499
1520
|
] }),
|
|
1500
|
-
!
|
|
1501
|
-
] },
|
|
1521
|
+
!l && /* @__PURE__ */ o("hr", { className: "flex-grow-1 mx-2" })
|
|
1522
|
+
] }, t.key);
|
|
1502
1523
|
}) });
|
|
1503
1524
|
}
|
|
1504
|
-
function
|
|
1505
|
-
var
|
|
1506
|
-
const
|
|
1507
|
-
return (
|
|
1525
|
+
function Qr(e) {
|
|
1526
|
+
var a, i;
|
|
1527
|
+
const r = e.trim().split(/\s+/), n = ((a = r[0]) == null ? void 0 : a[0]) ?? "", t = r.length > 1 ? ((i = r[r.length - 1]) == null ? void 0 : i[0]) ?? "" : "";
|
|
1528
|
+
return (n + t).toUpperCase();
|
|
1508
1529
|
}
|
|
1509
|
-
const
|
|
1530
|
+
const Xr = {
|
|
1510
1531
|
sm: "1.75rem",
|
|
1511
1532
|
md: "2.5rem",
|
|
1512
1533
|
lg: "3.5rem"
|
|
1513
1534
|
};
|
|
1514
|
-
function
|
|
1515
|
-
const
|
|
1516
|
-
return e ? /* @__PURE__ */
|
|
1535
|
+
function St({ src: e, name: r, size: n = "md", className: t }) {
|
|
1536
|
+
const a = Xr[n];
|
|
1537
|
+
return e ? /* @__PURE__ */ o(
|
|
1517
1538
|
"img",
|
|
1518
1539
|
{
|
|
1519
1540
|
src: e,
|
|
1520
|
-
alt:
|
|
1521
|
-
className:
|
|
1522
|
-
style: { width:
|
|
1541
|
+
alt: r ?? "",
|
|
1542
|
+
className: h("rounded-circle", "rrc-avatar", t),
|
|
1543
|
+
style: { width: a, height: a, objectFit: "cover" }
|
|
1523
1544
|
}
|
|
1524
|
-
) : /* @__PURE__ */
|
|
1545
|
+
) : /* @__PURE__ */ o(
|
|
1525
1546
|
"span",
|
|
1526
1547
|
{
|
|
1527
|
-
className:
|
|
1528
|
-
style: { width:
|
|
1529
|
-
role:
|
|
1530
|
-
"aria-label":
|
|
1531
|
-
children:
|
|
1548
|
+
className: h("d-inline-flex align-items-center justify-content-center rounded-circle bg-secondary text-white", "rrc-avatar", "rrc-avatar--initials", t),
|
|
1549
|
+
style: { width: a, height: a, fontSize: `calc(${a} * 0.4)` },
|
|
1550
|
+
role: r ? "img" : void 0,
|
|
1551
|
+
"aria-label": r,
|
|
1552
|
+
children: r ? Qr(r) : null
|
|
1532
1553
|
}
|
|
1533
1554
|
);
|
|
1534
1555
|
}
|
|
1535
|
-
function
|
|
1536
|
-
return /* @__PURE__ */
|
|
1537
|
-
|
|
1538
|
-
n && /* @__PURE__ */
|
|
1556
|
+
function Ct({ variant: e = "secondary", appearance: r = "solid", onRemove: n, className: t, children: a }) {
|
|
1557
|
+
return /* @__PURE__ */ y("span", { className: h("badge d-inline-flex align-items-center gap-1", r === "solid" && `bg-${e}`, "rrc-tag", `rrc-tag--${e}`, `rrc-tag--${r}`, t), children: [
|
|
1558
|
+
a,
|
|
1559
|
+
n && /* @__PURE__ */ o(
|
|
1539
1560
|
"button",
|
|
1540
1561
|
{
|
|
1541
1562
|
type: "button",
|
|
@@ -1547,333 +1568,1169 @@ function ct({ variant: e = "secondary", onRemove: n, className: t, children: r }
|
|
|
1547
1568
|
)
|
|
1548
1569
|
] });
|
|
1549
1570
|
}
|
|
1550
|
-
function
|
|
1571
|
+
function It({
|
|
1551
1572
|
value: e,
|
|
1552
|
-
defaultValue:
|
|
1553
|
-
onChange:
|
|
1554
|
-
min:
|
|
1555
|
-
max:
|
|
1573
|
+
defaultValue: r,
|
|
1574
|
+
onChange: n,
|
|
1575
|
+
min: t = 0,
|
|
1576
|
+
max: a = 100,
|
|
1556
1577
|
step: i = 1,
|
|
1557
|
-
id:
|
|
1578
|
+
id: l,
|
|
1558
1579
|
name: c,
|
|
1559
1580
|
disabled: s,
|
|
1560
1581
|
required: d,
|
|
1561
1582
|
className: u,
|
|
1562
|
-
label:
|
|
1583
|
+
label: f,
|
|
1563
1584
|
helpText: m,
|
|
1564
|
-
error:
|
|
1585
|
+
error: p
|
|
1565
1586
|
}) {
|
|
1566
|
-
const [
|
|
1587
|
+
const [k, S] = T({
|
|
1567
1588
|
value: e,
|
|
1568
|
-
defaultValue:
|
|
1569
|
-
onChange:
|
|
1570
|
-
}),
|
|
1571
|
-
return /* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1589
|
+
defaultValue: r ?? t,
|
|
1590
|
+
onChange: n
|
|
1591
|
+
}), x = W(), _ = l ?? x;
|
|
1592
|
+
return /* @__PURE__ */ y(Y, { id: _, label: f, required: d, error: p, helpText: m, className: u, children: [
|
|
1593
|
+
/* @__PURE__ */ o(
|
|
1573
1594
|
"input",
|
|
1574
1595
|
{
|
|
1575
|
-
id:
|
|
1596
|
+
id: _,
|
|
1576
1597
|
name: c,
|
|
1577
1598
|
type: "range",
|
|
1578
|
-
className: "form-range",
|
|
1599
|
+
className: "form-range rrc-range",
|
|
1579
1600
|
disabled: s,
|
|
1580
1601
|
required: d,
|
|
1581
|
-
min:
|
|
1582
|
-
max:
|
|
1602
|
+
min: t,
|
|
1603
|
+
max: a,
|
|
1583
1604
|
step: i,
|
|
1584
|
-
value:
|
|
1585
|
-
onChange: (
|
|
1605
|
+
value: k,
|
|
1606
|
+
onChange: (C) => S(Number(C.target.value))
|
|
1586
1607
|
}
|
|
1587
1608
|
),
|
|
1588
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ o("div", { className: "small text-body-secondary", children: k })
|
|
1589
1610
|
] });
|
|
1590
1611
|
}
|
|
1591
|
-
function
|
|
1592
|
-
const [
|
|
1612
|
+
function Et({ value: e, defaultValue: r, onChange: n, max: t = 5, disabled: a, className: i }) {
|
|
1613
|
+
const [l, c] = T({
|
|
1593
1614
|
value: e,
|
|
1594
|
-
defaultValue:
|
|
1595
|
-
onChange:
|
|
1615
|
+
defaultValue: r ?? 0,
|
|
1616
|
+
onChange: n
|
|
1596
1617
|
});
|
|
1597
|
-
return /* @__PURE__ */
|
|
1618
|
+
return /* @__PURE__ */ o("div", { className: h("d-inline-flex gap-1", "rrc-rating", i), role: "radiogroup", "aria-label": "Rating", children: Array.from({ length: t }, (s, d) => d + 1).map((s) => /* @__PURE__ */ o(
|
|
1598
1619
|
"button",
|
|
1599
1620
|
{
|
|
1600
1621
|
type: "button",
|
|
1601
|
-
className: "btn btn-link p-0 border-0",
|
|
1602
|
-
disabled:
|
|
1622
|
+
className: "btn btn-link p-0 border-0 rrc-rating__star",
|
|
1623
|
+
disabled: a,
|
|
1603
1624
|
role: "radio",
|
|
1604
|
-
"aria-checked": s ===
|
|
1625
|
+
"aria-checked": s === l,
|
|
1605
1626
|
"aria-label": `${s} star${s > 1 ? "s" : ""}`,
|
|
1606
1627
|
onClick: () => c(s),
|
|
1607
|
-
children: /* @__PURE__ */
|
|
1628
|
+
children: /* @__PURE__ */ o("span", { "aria-hidden": "true", style: { fontSize: "1.25rem", color: s <= l ? "#f5b301" : "#ced4da" }, children: "★" })
|
|
1608
1629
|
},
|
|
1609
1630
|
s
|
|
1610
1631
|
)) });
|
|
1611
1632
|
}
|
|
1612
|
-
function
|
|
1613
|
-
const
|
|
1614
|
-
return /* @__PURE__ */
|
|
1633
|
+
function At({ value: e, variant: r = "primary", label: n, className: t }) {
|
|
1634
|
+
const a = Math.max(0, Math.min(100, e));
|
|
1635
|
+
return /* @__PURE__ */ o("div", { className: h("progress", "rrc-progress", t), role: "progressbar", "aria-valuenow": a, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ o("div", { className: h("progress-bar", "rrc-progress__bar", `bg-${r}`), style: { width: `${a}%` }, children: n ? `${Math.round(a)}%` : null }) });
|
|
1615
1636
|
}
|
|
1616
|
-
function
|
|
1617
|
-
return /* @__PURE__ */
|
|
1637
|
+
function Dt({ brand: e, start: r, end: n, variant: t = "light", className: a }) {
|
|
1638
|
+
return /* @__PURE__ */ o(
|
|
1618
1639
|
"nav",
|
|
1619
1640
|
{
|
|
1620
|
-
className:
|
|
1641
|
+
className: h(
|
|
1621
1642
|
"navbar navbar-expand-lg border-bottom",
|
|
1622
|
-
|
|
1623
|
-
|
|
1643
|
+
"rrc-navbar",
|
|
1644
|
+
t === "dark" ? "navbar-dark bg-dark" : "navbar-light bg-light",
|
|
1645
|
+
a
|
|
1624
1646
|
),
|
|
1625
|
-
children: /* @__PURE__ */
|
|
1626
|
-
e && /* @__PURE__ */
|
|
1627
|
-
|
|
1628
|
-
|
|
1647
|
+
children: /* @__PURE__ */ y("div", { className: "container-fluid", children: [
|
|
1648
|
+
e && /* @__PURE__ */ o("span", { className: "navbar-brand mb-0", children: e }),
|
|
1649
|
+
r && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-3", children: r }),
|
|
1650
|
+
n && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-3 ms-auto", children: n })
|
|
1629
1651
|
] })
|
|
1630
1652
|
}
|
|
1631
1653
|
);
|
|
1632
1654
|
}
|
|
1655
|
+
const dr = [
|
|
1656
|
+
"primary",
|
|
1657
|
+
"primaryActive",
|
|
1658
|
+
"primaryLight",
|
|
1659
|
+
"primaryInverse",
|
|
1660
|
+
"primaryRgb",
|
|
1661
|
+
"componentActiveColor",
|
|
1662
|
+
"componentActiveBg",
|
|
1663
|
+
"componentHoverColor",
|
|
1664
|
+
"componentHoverBg",
|
|
1665
|
+
"componentCheckedColor",
|
|
1666
|
+
"componentCheckedBg",
|
|
1667
|
+
"menuLinkColorHover",
|
|
1668
|
+
"menuLinkColorShow",
|
|
1669
|
+
"menuLinkColorHere",
|
|
1670
|
+
"menuLinkColorActive"
|
|
1671
|
+
];
|
|
1672
|
+
function en(e) {
|
|
1673
|
+
if (typeof e != "object" || e === null)
|
|
1674
|
+
return !1;
|
|
1675
|
+
const r = e;
|
|
1676
|
+
if (typeof r.id != "string" || r.id.length === 0 || typeof r.tokens != "object" || r.tokens === null)
|
|
1677
|
+
return !1;
|
|
1678
|
+
const n = r.tokens;
|
|
1679
|
+
return dr.every((t) => typeof n[t] == "string" && n[t].length > 0);
|
|
1680
|
+
}
|
|
1681
|
+
function ve(e) {
|
|
1682
|
+
const { id: r, primary: n, primaryActive: t, primaryLight: a, primaryInverse: i, primaryRgb: l, swatch: c } = e;
|
|
1683
|
+
return {
|
|
1684
|
+
id: r,
|
|
1685
|
+
...c !== void 0 ? { swatch: c } : {},
|
|
1686
|
+
tokens: {
|
|
1687
|
+
primary: n,
|
|
1688
|
+
primaryActive: t,
|
|
1689
|
+
primaryLight: a,
|
|
1690
|
+
primaryInverse: i,
|
|
1691
|
+
primaryRgb: l,
|
|
1692
|
+
componentActiveColor: i,
|
|
1693
|
+
componentActiveBg: n,
|
|
1694
|
+
componentHoverColor: t,
|
|
1695
|
+
componentHoverBg: a,
|
|
1696
|
+
componentCheckedColor: i,
|
|
1697
|
+
componentCheckedBg: n,
|
|
1698
|
+
menuLinkColorHover: t,
|
|
1699
|
+
menuLinkColorShow: t,
|
|
1700
|
+
menuLinkColorHere: t,
|
|
1701
|
+
menuLinkColorActive: n
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
const rn = [
|
|
1706
|
+
ve({
|
|
1707
|
+
id: "blue",
|
|
1708
|
+
primary: "#0d6efd",
|
|
1709
|
+
primaryActive: "#0a58ca",
|
|
1710
|
+
primaryLight: "#cfe2ff",
|
|
1711
|
+
primaryInverse: "#ffffff",
|
|
1712
|
+
primaryRgb: "13, 110, 253"
|
|
1713
|
+
}),
|
|
1714
|
+
ve({
|
|
1715
|
+
id: "indigo",
|
|
1716
|
+
primary: "#6610f2",
|
|
1717
|
+
primaryActive: "#520dc2",
|
|
1718
|
+
primaryLight: "#e0cffc",
|
|
1719
|
+
primaryInverse: "#ffffff",
|
|
1720
|
+
primaryRgb: "102, 16, 242"
|
|
1721
|
+
}),
|
|
1722
|
+
// Deliberately taken from the deeper end of Bootstrap's teal ramp: a scheme
|
|
1723
|
+
// must carry usable contrast values, and `--bs-teal` (#20c997) is a surface
|
|
1724
|
+
// color that measures ~2:1 as text on white.
|
|
1725
|
+
ve({
|
|
1726
|
+
id: "teal",
|
|
1727
|
+
primary: "#13795b",
|
|
1728
|
+
primaryActive: "#0d503c",
|
|
1729
|
+
primaryLight: "#d2f4ea",
|
|
1730
|
+
primaryInverse: "#ffffff",
|
|
1731
|
+
primaryRgb: "19, 121, 91",
|
|
1732
|
+
swatch: "#20c997"
|
|
1733
|
+
}),
|
|
1734
|
+
ve({
|
|
1735
|
+
id: "green",
|
|
1736
|
+
primary: "#198754",
|
|
1737
|
+
primaryActive: "#146c43",
|
|
1738
|
+
primaryLight: "#d1e7dd",
|
|
1739
|
+
primaryInverse: "#ffffff",
|
|
1740
|
+
primaryRgb: "25, 135, 84"
|
|
1741
|
+
})
|
|
1742
|
+
], Re = "blue", ce = new Map(rn.map((e) => [e.id, e]));
|
|
1743
|
+
function Tt(e) {
|
|
1744
|
+
if (!en(e))
|
|
1745
|
+
throw new Error(
|
|
1746
|
+
"[react-components] registerColorScheme() requires a complete token family: " + dr.join(", ") + "."
|
|
1747
|
+
);
|
|
1748
|
+
ce.set(e.id, e);
|
|
1749
|
+
}
|
|
1750
|
+
function nn(e) {
|
|
1751
|
+
return ce.get(e);
|
|
1752
|
+
}
|
|
1753
|
+
function tn() {
|
|
1754
|
+
return [...ce.values()];
|
|
1755
|
+
}
|
|
1756
|
+
function an(e) {
|
|
1757
|
+
const r = e !== void 0 ? ce.get(e) : void 0;
|
|
1758
|
+
return r || ce.get(Re);
|
|
1759
|
+
}
|
|
1760
|
+
function on(e) {
|
|
1761
|
+
const r = e.tokens;
|
|
1762
|
+
return {
|
|
1763
|
+
"--bs-primary": r.primary,
|
|
1764
|
+
"--bs-primary-rgb": r.primaryRgb,
|
|
1765
|
+
"--bs-primary-active": r.primaryActive,
|
|
1766
|
+
"--bs-primary-light": r.primaryLight,
|
|
1767
|
+
"--bs-primary-inverse": r.primaryInverse,
|
|
1768
|
+
"--bs-component-active-color": r.componentActiveColor,
|
|
1769
|
+
"--bs-component-active-bg": r.componentActiveBg,
|
|
1770
|
+
"--bs-component-hover-color": r.componentHoverColor,
|
|
1771
|
+
"--bs-component-hover-bg": r.componentHoverBg,
|
|
1772
|
+
"--bs-component-checked-color": r.componentCheckedColor,
|
|
1773
|
+
"--bs-component-checked-bg": r.componentCheckedBg,
|
|
1774
|
+
"--bs-menu-link-color-hover": r.menuLinkColorHover,
|
|
1775
|
+
"--bs-menu-link-color-show": r.menuLinkColorShow,
|
|
1776
|
+
"--bs-menu-link-color-here": r.menuLinkColorHere,
|
|
1777
|
+
"--bs-menu-link-color-active": r.menuLinkColorActive,
|
|
1778
|
+
// This repository's own tokens. Only the theme-independent ones are
|
|
1779
|
+
// published here: these are applied as an inline style on the root, which
|
|
1780
|
+
// outranks every stylesheet rule, so a token whose value depends on the
|
|
1781
|
+
// light/dark theme must not be set from a scheme. The stylesheet resolves
|
|
1782
|
+
// those from the `--bs-*` names above in light mode and derives its own
|
|
1783
|
+
// values under `[data-bs-theme="dark"]`; publishing a light-mode shade here
|
|
1784
|
+
// pinned the dark sidebar's menu links to ~2:1.
|
|
1785
|
+
"--rrc-primary": r.primary,
|
|
1786
|
+
"--rrc-primary-rgb": r.primaryRgb,
|
|
1787
|
+
"--rrc-primary-active": r.primaryActive,
|
|
1788
|
+
"--rrc-primary-inverse": r.primaryInverse,
|
|
1789
|
+
"--rrc-component-active-color": r.componentActiveColor,
|
|
1790
|
+
"--rrc-component-active-bg": r.componentActiveBg,
|
|
1791
|
+
"--rrc-component-hover-bg": r.componentHoverBg,
|
|
1792
|
+
"--rrc-component-checked-color": r.componentCheckedColor,
|
|
1793
|
+
"--rrc-component-checked-bg": r.componentCheckedBg
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
const ur = ["light", "dark", "system"], mr = ["compact", "grouped"], fr = ["light", "dark", "auto"], $e = Ve(void 0);
|
|
1797
|
+
function ln(e) {
|
|
1798
|
+
return typeof e == "string" && ur.includes(e);
|
|
1799
|
+
}
|
|
1633
1800
|
function sn(e) {
|
|
1801
|
+
return typeof e == "string" && mr.includes(e);
|
|
1802
|
+
}
|
|
1803
|
+
function cn(e) {
|
|
1804
|
+
return typeof e == "string" && fr.includes(e);
|
|
1805
|
+
}
|
|
1806
|
+
function dn(e, r) {
|
|
1807
|
+
let n;
|
|
1808
|
+
try {
|
|
1809
|
+
n = e.getItem(r);
|
|
1810
|
+
} catch {
|
|
1811
|
+
return {};
|
|
1812
|
+
}
|
|
1813
|
+
if (!n)
|
|
1814
|
+
return {};
|
|
1815
|
+
let t;
|
|
1816
|
+
try {
|
|
1817
|
+
t = JSON.parse(n);
|
|
1818
|
+
} catch {
|
|
1819
|
+
return {};
|
|
1820
|
+
}
|
|
1821
|
+
if (typeof t != "object" || t === null)
|
|
1822
|
+
return {};
|
|
1823
|
+
const a = t, i = {};
|
|
1824
|
+
return ln(a.mode) && (i.mode = a.mode), sn(a.sidebarPresentation) && (i.sidebarPresentation = a.sidebarPresentation), cn(a.sidebarTone) && (i.sidebarTone = a.sidebarTone), typeof a.colorSchemeId == "string" && nn(a.colorSchemeId) && (i.colorSchemeId = a.colorSchemeId), i;
|
|
1825
|
+
}
|
|
1826
|
+
function Vt({
|
|
1827
|
+
children: e,
|
|
1828
|
+
mode: r,
|
|
1829
|
+
defaultMode: n,
|
|
1830
|
+
onModeChange: t,
|
|
1831
|
+
sidebarPresentation: a,
|
|
1832
|
+
defaultSidebarPresentation: i,
|
|
1833
|
+
onSidebarPresentationChange: l,
|
|
1834
|
+
sidebarTone: c,
|
|
1835
|
+
defaultSidebarTone: s,
|
|
1836
|
+
onSidebarToneChange: d,
|
|
1837
|
+
colorSchemeId: u,
|
|
1838
|
+
defaultColorSchemeId: f,
|
|
1839
|
+
onColorSchemeIdChange: m,
|
|
1840
|
+
storage: p,
|
|
1841
|
+
storageKey: k,
|
|
1842
|
+
applyTo: S = "none",
|
|
1843
|
+
themeAttribute: x = "data-bs-theme"
|
|
1844
|
+
}) {
|
|
1845
|
+
const [_, C] = T({
|
|
1846
|
+
value: r,
|
|
1847
|
+
defaultValue: n ?? "system",
|
|
1848
|
+
onChange: t
|
|
1849
|
+
}), [v, N] = T({
|
|
1850
|
+
value: a,
|
|
1851
|
+
defaultValue: i ?? "grouped",
|
|
1852
|
+
onChange: l
|
|
1853
|
+
}), [b, w] = T({
|
|
1854
|
+
value: c,
|
|
1855
|
+
defaultValue: s ?? "auto",
|
|
1856
|
+
onChange: d
|
|
1857
|
+
}), [g, I] = T({
|
|
1858
|
+
value: u,
|
|
1859
|
+
defaultValue: f ?? Re,
|
|
1860
|
+
onChange: m
|
|
1861
|
+
}), [D, O] = M("light");
|
|
1862
|
+
U(() => {
|
|
1863
|
+
if (typeof window > "u" || typeof window.matchMedia != "function")
|
|
1864
|
+
return;
|
|
1865
|
+
const E = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1866
|
+
O(E.matches ? "dark" : "light");
|
|
1867
|
+
const B = (z) => O(z.matches ? "dark" : "light");
|
|
1868
|
+
if (typeof E.addEventListener == "function")
|
|
1869
|
+
return E.addEventListener("change", B), () => E.removeEventListener("change", B);
|
|
1870
|
+
if (typeof E.addListener == "function")
|
|
1871
|
+
return E.addListener(B), () => E.removeListener(B);
|
|
1872
|
+
}, []);
|
|
1873
|
+
const q = p !== void 0 && k !== void 0, [G, P] = M(!1), V = {
|
|
1874
|
+
mode: r !== void 0,
|
|
1875
|
+
sidebarPresentation: a !== void 0,
|
|
1876
|
+
sidebarTone: c !== void 0,
|
|
1877
|
+
colorSchemeId: u !== void 0
|
|
1878
|
+
}, A = L(V);
|
|
1879
|
+
A.current = V;
|
|
1880
|
+
const H = L({ setMode: C, setSidebarPresentation: N, setSidebarTone: w, setColorSchemeId: I });
|
|
1881
|
+
H.current = { setMode: C, setSidebarPresentation: N, setSidebarTone: w, setColorSchemeId: I }, U(() => {
|
|
1882
|
+
if (!q)
|
|
1883
|
+
return;
|
|
1884
|
+
const E = dn(p, k), B = A.current, z = H.current;
|
|
1885
|
+
E.mode !== void 0 && !B.mode && z.setMode(E.mode), E.sidebarPresentation !== void 0 && !B.sidebarPresentation && z.setSidebarPresentation(E.sidebarPresentation), E.sidebarTone !== void 0 && !B.sidebarTone && z.setSidebarTone(E.sidebarTone), E.colorSchemeId !== void 0 && !B.colorSchemeId && z.setColorSchemeId(E.colorSchemeId), P(!0);
|
|
1886
|
+
}, [q, p, k]), U(() => {
|
|
1887
|
+
if (!(!q || !G))
|
|
1888
|
+
try {
|
|
1889
|
+
p.setItem(
|
|
1890
|
+
k,
|
|
1891
|
+
JSON.stringify({
|
|
1892
|
+
mode: _,
|
|
1893
|
+
sidebarPresentation: v,
|
|
1894
|
+
sidebarTone: b,
|
|
1895
|
+
colorSchemeId: g
|
|
1896
|
+
})
|
|
1897
|
+
);
|
|
1898
|
+
} catch {
|
|
1899
|
+
}
|
|
1900
|
+
}, [q, G, p, k, _, v, b, g]);
|
|
1901
|
+
const R = _ === "system" ? D : _, Z = an(g), X = J(() => on(Z), [Z]);
|
|
1902
|
+
U(() => {
|
|
1903
|
+
if (S === "none" || typeof document > "u")
|
|
1904
|
+
return;
|
|
1905
|
+
const E = S === "body" ? document.body : document.documentElement;
|
|
1906
|
+
if (!E)
|
|
1907
|
+
return;
|
|
1908
|
+
const B = E.getAttribute(x);
|
|
1909
|
+
E.setAttribute(x, R);
|
|
1910
|
+
for (const [z, ie] of Object.entries(X))
|
|
1911
|
+
E.style.setProperty(z, ie);
|
|
1912
|
+
return () => {
|
|
1913
|
+
B === null ? E.removeAttribute(x) : E.setAttribute(x, B);
|
|
1914
|
+
for (const z of Object.keys(X))
|
|
1915
|
+
E.style.removeProperty(z);
|
|
1916
|
+
};
|
|
1917
|
+
}, [S, x, R, X]);
|
|
1918
|
+
const K = J(
|
|
1919
|
+
() => ({ "data-bs-theme": R, style: X }),
|
|
1920
|
+
[R, X]
|
|
1921
|
+
), j = J(
|
|
1922
|
+
() => ({
|
|
1923
|
+
mode: _,
|
|
1924
|
+
sidebarPresentation: v,
|
|
1925
|
+
sidebarTone: b,
|
|
1926
|
+
colorSchemeId: g,
|
|
1927
|
+
resolvedTheme: R,
|
|
1928
|
+
systemTheme: D,
|
|
1929
|
+
colorScheme: Z,
|
|
1930
|
+
setMode: C,
|
|
1931
|
+
setSidebarPresentation: N,
|
|
1932
|
+
setSidebarTone: w,
|
|
1933
|
+
setColorSchemeId: I,
|
|
1934
|
+
appearanceProps: K
|
|
1935
|
+
}),
|
|
1936
|
+
[
|
|
1937
|
+
_,
|
|
1938
|
+
v,
|
|
1939
|
+
b,
|
|
1940
|
+
g,
|
|
1941
|
+
R,
|
|
1942
|
+
D,
|
|
1943
|
+
Z,
|
|
1944
|
+
C,
|
|
1945
|
+
N,
|
|
1946
|
+
w,
|
|
1947
|
+
I,
|
|
1948
|
+
K
|
|
1949
|
+
]
|
|
1950
|
+
);
|
|
1951
|
+
return /* @__PURE__ */ o($e.Provider, { value: j, children: e });
|
|
1952
|
+
}
|
|
1953
|
+
function Lt() {
|
|
1954
|
+
const e = we($e);
|
|
1955
|
+
if (!e)
|
|
1956
|
+
throw new Error("[react-components] useAppearance() must be used inside an <AppearanceProvider>.");
|
|
1957
|
+
return e;
|
|
1958
|
+
}
|
|
1959
|
+
function hr() {
|
|
1960
|
+
return we($e);
|
|
1961
|
+
}
|
|
1962
|
+
function Rt({
|
|
1963
|
+
storageKey: e,
|
|
1964
|
+
themeAttribute: r = "data-bs-theme",
|
|
1965
|
+
target: n = "documentElement",
|
|
1966
|
+
defaultMode: t = "system"
|
|
1967
|
+
}) {
|
|
1968
|
+
const a = (d) => JSON.stringify(d).replace(/</g, "\\u003C"), i = a(e), l = a(r), c = a(t), s = n === "body" ? "document.body" : "document.documentElement";
|
|
1969
|
+
return "(function(){try{var raw=window.localStorage.getItem(" + i + ");var mode=" + c + ";if(raw){var parsed=JSON.parse(raw);if(parsed&&typeof parsed.mode==='string'){mode=parsed.mode;}}var dark=mode==='dark'||(mode==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);" + s + ".setAttribute(" + l + ",dark?'dark':'light');}catch(e){}})();";
|
|
1970
|
+
}
|
|
1971
|
+
function un(e) {
|
|
1972
|
+
return e.type === "collapsible" || e.type === "group";
|
|
1973
|
+
}
|
|
1974
|
+
function pr(e) {
|
|
1975
|
+
return e.type === "collapsible" || e.type === "group" && e.collapsible === !0;
|
|
1976
|
+
}
|
|
1977
|
+
function Oe(e) {
|
|
1634
1978
|
return "items" in e;
|
|
1635
1979
|
}
|
|
1636
|
-
function
|
|
1637
|
-
return
|
|
1638
|
-
|
|
1980
|
+
function mn(e) {
|
|
1981
|
+
return e.map((r) => Oe(r) ? fn(r) : br(r));
|
|
1982
|
+
}
|
|
1983
|
+
function fn(e) {
|
|
1984
|
+
return {
|
|
1985
|
+
type: "group",
|
|
1986
|
+
key: e.key,
|
|
1987
|
+
label: e.label,
|
|
1988
|
+
collapsible: !0,
|
|
1989
|
+
children: e.items.map(br)
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
function br(e) {
|
|
1993
|
+
const r = {
|
|
1994
|
+
key: e.key,
|
|
1995
|
+
label: e.label,
|
|
1996
|
+
...e.icon !== void 0 ? { icon: e.icon } : {},
|
|
1997
|
+
...e.disabled !== void 0 ? { disabled: e.disabled } : {}
|
|
1998
|
+
}, n = e.onClick ? () => {
|
|
1999
|
+
var t;
|
|
2000
|
+
return (t = e.onClick) == null ? void 0 : t.call(e);
|
|
2001
|
+
} : void 0;
|
|
2002
|
+
return e.href !== void 0 ? { ...r, type: "link", href: e.href, ...n ? { onSelect: n } : {} } : { ...r, type: "action", ...n ? { onSelect: n } : {} };
|
|
2003
|
+
}
|
|
2004
|
+
function hn(e) {
|
|
2005
|
+
return e.filter(Oe).filter((r) => r.defaultOpen).map((r) => r.key);
|
|
2006
|
+
}
|
|
2007
|
+
function pn(e) {
|
|
2008
|
+
for (const r of e)
|
|
2009
|
+
if (Oe(r)) {
|
|
2010
|
+
const n = r.items.find((t) => t.active);
|
|
2011
|
+
if (n)
|
|
2012
|
+
return n.key;
|
|
2013
|
+
} else if (r.active)
|
|
2014
|
+
return r.key;
|
|
2015
|
+
}
|
|
2016
|
+
function bn(e) {
|
|
2017
|
+
const r = /* @__PURE__ */ new Map(), n = [], t = [];
|
|
2018
|
+
function a(l, c, s) {
|
|
2019
|
+
const d = [];
|
|
2020
|
+
for (const u of l) {
|
|
2021
|
+
const f = { item: u, key: u.key, depth: c, ancestors: s, children: [] };
|
|
2022
|
+
r.has(u.key) ? t.push(u.key) : (r.set(u.key, f), n.push(u.key)), un(u) && (f.children = a(u.children, c + 1, [...s, u.key])), d.push(f);
|
|
2023
|
+
}
|
|
2024
|
+
return d;
|
|
2025
|
+
}
|
|
2026
|
+
return { roots: a(e, 0, []), byKey: r, order: n, duplicateKeys: t };
|
|
2027
|
+
}
|
|
2028
|
+
function le(e, r) {
|
|
2029
|
+
const n = new Set(r), t = e.filter((i) => n.has(i)), a = new Set(t);
|
|
2030
|
+
for (const i of n)
|
|
2031
|
+
a.has(i) || t.push(i);
|
|
2032
|
+
return t;
|
|
2033
|
+
}
|
|
2034
|
+
function vn(e, r, n, t) {
|
|
2035
|
+
const a = e.byKey.get(n), i = new Set(r);
|
|
2036
|
+
if (i.has(n)) {
|
|
2037
|
+
if (i.delete(n), a)
|
|
2038
|
+
for (const l of vr(a))
|
|
2039
|
+
i.delete(l);
|
|
2040
|
+
return le(e.order, i);
|
|
2041
|
+
}
|
|
2042
|
+
if (t === "single") {
|
|
2043
|
+
const l = new Set(a ? a.ancestors : []);
|
|
2044
|
+
return l.add(n), le(e.order, l);
|
|
2045
|
+
}
|
|
2046
|
+
if (i.add(n), a)
|
|
2047
|
+
for (const l of a.ancestors)
|
|
2048
|
+
i.add(l);
|
|
2049
|
+
return le(e.order, i);
|
|
2050
|
+
}
|
|
2051
|
+
function Ze(e, r, n, t) {
|
|
2052
|
+
if (n.length === 0)
|
|
2053
|
+
return le(e.order, new Set(r));
|
|
2054
|
+
if (t === "single")
|
|
2055
|
+
return le(e.order, new Set(n));
|
|
2056
|
+
const a = new Set(r);
|
|
2057
|
+
for (const i of n)
|
|
2058
|
+
a.add(i);
|
|
2059
|
+
return le(e.order, a);
|
|
2060
|
+
}
|
|
2061
|
+
function gn(e, r) {
|
|
2062
|
+
return e.length === r.length && e.every((n, t) => n === r[t]);
|
|
2063
|
+
}
|
|
2064
|
+
function vr(e) {
|
|
2065
|
+
const r = [];
|
|
2066
|
+
for (const n of e.children)
|
|
2067
|
+
r.push(n.key), r.push(...vr(n));
|
|
2068
|
+
return r;
|
|
2069
|
+
}
|
|
2070
|
+
function gr(e, r) {
|
|
2071
|
+
var n;
|
|
2072
|
+
return r === void 0 ? [] : ((n = e.byKey.get(r)) == null ? void 0 : n.ancestors) ?? [];
|
|
2073
|
+
}
|
|
2074
|
+
function Ye(e, r) {
|
|
2075
|
+
return gr(e, r).filter((n) => {
|
|
2076
|
+
const t = e.byKey.get(n);
|
|
2077
|
+
return t !== void 0 && pr(t.item);
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
const yn = typeof document < "u" ? _r : U, Nn = Symbol("unresolved-active-key");
|
|
2081
|
+
function kn(e) {
|
|
2082
|
+
if (e.type !== "divider")
|
|
2083
|
+
return e.ariaLabel !== void 0 ? e.ariaLabel : typeof e.label == "string" ? e.label : void 0;
|
|
2084
|
+
}
|
|
2085
|
+
function wn(e, r) {
|
|
2086
|
+
return `${e}-${r.replace(/[^A-Za-z0-9_-]/g, "_")}`;
|
|
2087
|
+
}
|
|
2088
|
+
function Ae({ node: e, expandable: r }) {
|
|
2089
|
+
const n = e.item;
|
|
2090
|
+
return n.type === "divider" ? null : /* @__PURE__ */ y(Q, { children: [
|
|
2091
|
+
n.icon !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__icon", "aria-hidden": "true", children: n.icon }),
|
|
2092
|
+
/* @__PURE__ */ o("span", { className: "rrc-sidebar__label", children: n.label }),
|
|
2093
|
+
n.badge !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__badge", children: n.badge }),
|
|
2094
|
+
r && /* @__PURE__ */ o("span", { className: "rrc-sidebar__arrow", "aria-hidden": "true" })
|
|
2095
|
+
] });
|
|
2096
|
+
}
|
|
2097
|
+
function De({ name: e, children: r }) {
|
|
2098
|
+
return e === void 0 ? /* @__PURE__ */ o(Q, { children: r }) : /* @__PURE__ */ o(sr, { content: e, placement: "bottom", wrapperClassName: "rrc-sidebar__tooltip", children: r });
|
|
2099
|
+
}
|
|
2100
|
+
function _n(e) {
|
|
2101
|
+
if (!e)
|
|
2102
|
+
return;
|
|
2103
|
+
const r = e.getBoundingClientRect(), n = (e.closest(".rrc-sidebar") ?? e).getBoundingClientRect(), t = getComputedStyle(e).direction === "rtl", a = document.documentElement.clientWidth;
|
|
2104
|
+
e.style.setProperty("--rrc-rail-tip-block-start", `${Math.round(r.top + r.height / 2)}px`), e.style.setProperty("--rrc-rail-tip-inline-start", `${Math.round(t ? a - n.left : n.right)}px`);
|
|
2105
|
+
}
|
|
2106
|
+
function Te(e) {
|
|
2107
|
+
if (!e)
|
|
2108
|
+
return {};
|
|
2109
|
+
const r = (n) => _n(n.currentTarget);
|
|
2110
|
+
return { onPointerEnter: r, onFocusCapture: r };
|
|
2111
|
+
}
|
|
2112
|
+
function Ne({ node: e, ctx: r }) {
|
|
2113
|
+
const n = e.item, t = L(null), [a, i] = M(!1), l = F(() => i(!1), []);
|
|
2114
|
+
if (yn(() => {
|
|
2115
|
+
const v = t.current;
|
|
2116
|
+
if (!a || !v)
|
|
2117
|
+
return;
|
|
2118
|
+
const N = () => {
|
|
2119
|
+
const b = v.getBoundingClientRect(), w = (v.closest(".rrc-sidebar") ?? v).getBoundingClientRect(), g = getComputedStyle(v).direction === "rtl", I = document.documentElement.clientWidth;
|
|
2120
|
+
v.style.setProperty("--rrc-flyout-block-start", `${Math.round(b.top)}px`), v.style.setProperty("--rrc-flyout-inline-start", `${Math.round(g ? I - w.left : w.right)}px`);
|
|
2121
|
+
};
|
|
2122
|
+
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
2123
|
+
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
2124
|
+
};
|
|
2125
|
+
}, [a]), n.type === "divider")
|
|
2126
|
+
return /* @__PURE__ */ o("li", { role: "none", className: h("rrc-sidebar__divider", n.className), children: /* @__PURE__ */ o(Zr, { className: "my-1" }) });
|
|
2127
|
+
const c = { "--rrc-sidebar-depth": String(Math.max(0, e.depth - r.depthOffset)) }, s = kn(n), d = r.activeKey === n.key, u = r.activeAncestors.has(n.key), f = pr(n), m = f && r.expanded.has(n.key), p = wn(r.idPrefix, n.key), k = h(
|
|
2128
|
+
"rrc-sidebar__row",
|
|
2129
|
+
d && "rrc-sidebar__row--active",
|
|
2130
|
+
u && "rrc-sidebar__row--active-ancestor",
|
|
2131
|
+
n.disabled && "rrc-sidebar__row--disabled",
|
|
2132
|
+
n.className
|
|
2133
|
+
);
|
|
2134
|
+
if (n.type === "link") {
|
|
2135
|
+
const v = (w) => {
|
|
2136
|
+
if (n.disabled) {
|
|
2137
|
+
w.preventDefault();
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
r.select(n, w);
|
|
2141
|
+
}, N = {
|
|
2142
|
+
item: n,
|
|
2143
|
+
href: n.href,
|
|
2144
|
+
className: h(k, "rrc-sidebar__row--link"),
|
|
2145
|
+
style: c,
|
|
2146
|
+
children: /* @__PURE__ */ o(Ae, { node: e, expandable: !1 }),
|
|
2147
|
+
onClick: v,
|
|
2148
|
+
"aria-current": d ? "page" : void 0,
|
|
2149
|
+
"aria-disabled": n.disabled ? !0 : void 0,
|
|
2150
|
+
"aria-label": r.collapsed ? s : void 0,
|
|
2151
|
+
"data-active-ancestor": u ? "true" : void 0,
|
|
2152
|
+
target: n.target,
|
|
2153
|
+
rel: n.rel
|
|
2154
|
+
}, b = r.renderLink ? r.renderLink(N) : /* @__PURE__ */ o(
|
|
2155
|
+
"a",
|
|
2156
|
+
{
|
|
2157
|
+
href: N.href,
|
|
2158
|
+
className: N.className,
|
|
2159
|
+
style: N.style,
|
|
2160
|
+
onClick: N.onClick,
|
|
2161
|
+
"aria-current": N["aria-current"],
|
|
2162
|
+
"aria-disabled": N["aria-disabled"],
|
|
2163
|
+
"aria-label": N["aria-label"],
|
|
2164
|
+
"data-active-ancestor": N["data-active-ancestor"],
|
|
2165
|
+
target: N.target,
|
|
2166
|
+
rel: N.rel,
|
|
2167
|
+
children: N.children
|
|
2168
|
+
}
|
|
2169
|
+
);
|
|
2170
|
+
return /* @__PURE__ */ o("li", { className: "rrc-sidebar__item", ...Te(r.collapsed), children: r.collapsed ? /* @__PURE__ */ o(De, { name: s, children: b }) : b });
|
|
2171
|
+
}
|
|
2172
|
+
if (n.type === "action") {
|
|
2173
|
+
const v = /* @__PURE__ */ o(
|
|
2174
|
+
"button",
|
|
2175
|
+
{
|
|
2176
|
+
type: "button",
|
|
2177
|
+
className: h(k, "rrc-sidebar__row--action"),
|
|
2178
|
+
style: c,
|
|
2179
|
+
disabled: n.disabled,
|
|
2180
|
+
"aria-label": r.collapsed ? s : void 0,
|
|
2181
|
+
"data-active-ancestor": u ? "true" : void 0,
|
|
2182
|
+
"data-active": d ? "true" : void 0,
|
|
2183
|
+
onClick: (N) => r.select(n, N),
|
|
2184
|
+
children: /* @__PURE__ */ o(Ae, { node: e, expandable: !1 })
|
|
2185
|
+
}
|
|
2186
|
+
);
|
|
2187
|
+
return /* @__PURE__ */ o("li", { className: "rrc-sidebar__item", ...Te(r.collapsed), children: r.collapsed ? /* @__PURE__ */ o(De, { name: s, children: v }) : v });
|
|
2188
|
+
}
|
|
2189
|
+
if (!f) {
|
|
2190
|
+
const v = `${p}-title`;
|
|
2191
|
+
return /* @__PURE__ */ y("li", { className: h("rrc-sidebar__item", "rrc-sidebar__group", n.className), children: [
|
|
2192
|
+
/* @__PURE__ */ y("div", { className: "rrc-sidebar__group-title", id: v, style: c, children: [
|
|
2193
|
+
n.icon !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__icon", "aria-hidden": "true", children: n.icon }),
|
|
2194
|
+
/* @__PURE__ */ o("span", { className: "rrc-sidebar__label", children: n.label }),
|
|
2195
|
+
n.badge !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__badge", children: n.badge })
|
|
2196
|
+
] }),
|
|
2197
|
+
/* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__submenu", "aria-labelledby": v, children: e.children.map((N) => /* @__PURE__ */ o(Ne, { node: N, ctx: { ...r, depthOffset: r.depthOffset + 1 } }, N.key)) })
|
|
2198
|
+
] });
|
|
2199
|
+
}
|
|
2200
|
+
const S = /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__submenu", id: p, children: e.children.map((v) => /* @__PURE__ */ o(Ne, { node: v, ctx: r }, v.key)) }), x = r.collapsed, _ = () => {
|
|
2201
|
+
n.disabled || (x ? i((v) => !v) : r.toggle(n.key));
|
|
2202
|
+
}, C = /* @__PURE__ */ o(
|
|
2203
|
+
"button",
|
|
1639
2204
|
{
|
|
1640
|
-
|
|
1641
|
-
className:
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
2205
|
+
type: "button",
|
|
2206
|
+
className: h(k, "rrc-sidebar__row--toggle", n.type === "group" && "rrc-sidebar__row--group-toggle"),
|
|
2207
|
+
style: c,
|
|
2208
|
+
disabled: n.disabled,
|
|
2209
|
+
"aria-expanded": x ? a : m,
|
|
2210
|
+
"aria-controls": p,
|
|
2211
|
+
"aria-label": r.collapsed ? s : void 0,
|
|
2212
|
+
"data-active-ancestor": u ? "true" : void 0,
|
|
2213
|
+
onClick: _,
|
|
2214
|
+
children: /* @__PURE__ */ o(Ae, { node: e, expandable: !0 })
|
|
2215
|
+
}
|
|
2216
|
+
);
|
|
2217
|
+
return /* @__PURE__ */ y(
|
|
2218
|
+
"li",
|
|
2219
|
+
{
|
|
2220
|
+
ref: t,
|
|
2221
|
+
className: h("rrc-sidebar__item", x && "rrc-sidebar__item--flyout-anchor"),
|
|
2222
|
+
...Te(r.collapsed),
|
|
1648
2223
|
children: [
|
|
1649
|
-
|
|
1650
|
-
e.
|
|
2224
|
+
x ? /* @__PURE__ */ o(De, { name: s, children: C }) : C,
|
|
2225
|
+
x ? /* @__PURE__ */ o(oe, { open: a, onClose: l, anchorRef: t, className: "rrc-sidebar__flyout", children: /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__submenu", id: p, children: e.children.map((v) => (
|
|
2226
|
+
// Inside the panel the branch is fully expanded again, and its
|
|
2227
|
+
// rows start flush rather than inheriting the aside's indentation.
|
|
2228
|
+
/* @__PURE__ */ o(Ne, { node: v, ctx: { ...r, collapsed: !1, depthOffset: e.depth + 1 } }, v.key)
|
|
2229
|
+
)) }) }) : m && S
|
|
1651
2230
|
]
|
|
1652
2231
|
}
|
|
1653
2232
|
);
|
|
1654
2233
|
}
|
|
1655
|
-
function
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
},
|
|
1672
|
-
l.key
|
|
1673
|
-
) : /* @__PURE__ */ a(ue, { item: l }, l.key)
|
|
1674
|
-
) }),
|
|
1675
|
-
t && /* @__PURE__ */ a("div", { className: "p-3 border-top", children: t })
|
|
1676
|
-
] });
|
|
2234
|
+
function xn({ collapsed: e, toggle: r, label: n }) {
|
|
2235
|
+
return /* @__PURE__ */ o("button", { type: "button", className: "rrc-sidebar__collapse-btn", "aria-label": n, onClick: r, children: /* @__PURE__ */ o(
|
|
2236
|
+
"svg",
|
|
2237
|
+
{
|
|
2238
|
+
className: h("rrc-sidebar__collapse-icon", e && "rrc-sidebar__collapse-icon--collapsed"),
|
|
2239
|
+
viewBox: "0 0 24 24",
|
|
2240
|
+
fill: "none",
|
|
2241
|
+
stroke: "currentColor",
|
|
2242
|
+
strokeWidth: "2",
|
|
2243
|
+
strokeLinecap: "round",
|
|
2244
|
+
strokeLinejoin: "round",
|
|
2245
|
+
"aria-hidden": "true",
|
|
2246
|
+
focusable: "false",
|
|
2247
|
+
children: /* @__PURE__ */ o("path", { d: "M14.5 6.5 9 12l5.5 5.5" })
|
|
2248
|
+
}
|
|
2249
|
+
) });
|
|
1677
2250
|
}
|
|
1678
|
-
function
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
2251
|
+
function $t({
|
|
2252
|
+
items: e,
|
|
2253
|
+
sections: r,
|
|
2254
|
+
variant: n,
|
|
2255
|
+
tone: t,
|
|
2256
|
+
activeKey: a,
|
|
2257
|
+
expandActivePath: i = !1,
|
|
2258
|
+
activePathExpansion: l,
|
|
2259
|
+
expandedKeys: c,
|
|
2260
|
+
defaultExpandedKeys: s,
|
|
2261
|
+
onExpandedKeysChange: d,
|
|
2262
|
+
expandMode: u = "multiple",
|
|
2263
|
+
collapsed: f,
|
|
2264
|
+
defaultCollapsed: m,
|
|
2265
|
+
onCollapsedChange: p,
|
|
2266
|
+
collapsible: k = !1,
|
|
2267
|
+
renderCollapseControl: S,
|
|
2268
|
+
collapseLabel: x = "Collapse sidebar",
|
|
2269
|
+
expandLabel: _ = "Expand sidebar",
|
|
2270
|
+
mobileOpen: C,
|
|
2271
|
+
defaultMobileOpen: v,
|
|
2272
|
+
onMobileOpenChange: N,
|
|
2273
|
+
mobileLabel: b,
|
|
2274
|
+
closeMobileOnSelect: w = !0,
|
|
2275
|
+
header: g,
|
|
2276
|
+
footer: I,
|
|
2277
|
+
collapsedFooter: D,
|
|
2278
|
+
className: O,
|
|
2279
|
+
navLabel: q,
|
|
2280
|
+
onSelect: G,
|
|
2281
|
+
renderLink: P
|
|
2282
|
+
}) {
|
|
2283
|
+
const V = hr(), A = r ?? [], H = J(
|
|
2284
|
+
() => e !== void 0 ? e : mn(A),
|
|
2285
|
+
// `legacySections` is a fresh array only when `sections` changes.
|
|
2286
|
+
[e, r]
|
|
2287
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
2288
|
+
), R = J(() => bn(H), [H]), Z = R.duplicateKeys.join(", ");
|
|
2289
|
+
U(() => {
|
|
2290
|
+
process.env.NODE_ENV !== "production" && Z.length > 0 && console.error(
|
|
2291
|
+
"[react-components] Sidebar received duplicate item keys: " + Z + ". Keys must be unique and stable: expansion and active state are keyed by them, so every duplicate shares one identity and the first occurrence in tree order defines it."
|
|
2292
|
+
);
|
|
2293
|
+
}, [Z]);
|
|
2294
|
+
const X = J(() => hn(A), [r]), K = a ?? (e === void 0 ? pn(A) : void 0), j = l ?? (i ? "on-active-change" : "never"), E = L(null);
|
|
2295
|
+
if (E.current === null) {
|
|
2296
|
+
const $ = s ?? X;
|
|
2297
|
+
E.current = j === "never" ? $ : Ze(R, $, Ye(R, K), u);
|
|
2298
|
+
}
|
|
2299
|
+
const [B, z] = T({
|
|
2300
|
+
value: c,
|
|
2301
|
+
defaultValue: E.current,
|
|
2302
|
+
onChange: d
|
|
2303
|
+
}), [ie, kr] = T({
|
|
2304
|
+
value: f,
|
|
2305
|
+
defaultValue: m ?? !1,
|
|
2306
|
+
onChange: p
|
|
2307
|
+
}), [ee, he] = T({
|
|
2308
|
+
value: C,
|
|
2309
|
+
defaultValue: v ?? !1,
|
|
2310
|
+
onChange: N
|
|
2311
|
+
}), re = K, pe = J(
|
|
2312
|
+
() => new Set(gr(R, re)),
|
|
2313
|
+
[R, re]
|
|
2314
|
+
), Me = J(() => {
|
|
2315
|
+
const $ = new Set(B);
|
|
2316
|
+
if (j === "always")
|
|
2317
|
+
for (const ne of pe)
|
|
2318
|
+
$.add(ne);
|
|
2319
|
+
return $;
|
|
2320
|
+
}, [B, j, pe]), Ce = L(B);
|
|
2321
|
+
Ce.current = B;
|
|
2322
|
+
const Ie = L(Nn);
|
|
2323
|
+
U(() => {
|
|
2324
|
+
if (j !== "on-active-change") {
|
|
2325
|
+
Ie.current = re;
|
|
2326
|
+
return;
|
|
2327
|
+
}
|
|
2328
|
+
if (Ie.current === re)
|
|
2329
|
+
return;
|
|
2330
|
+
Ie.current = re;
|
|
2331
|
+
const $ = Ye(R, re);
|
|
2332
|
+
if ($.length === 0)
|
|
2333
|
+
return;
|
|
2334
|
+
const ne = Ze(R, Ce.current, $, u);
|
|
2335
|
+
gn(ne, Ce.current) || z(ne);
|
|
2336
|
+
}, [j, re, R, u, z]);
|
|
2337
|
+
const Pe = F(
|
|
2338
|
+
($) => z(vn(R, B, $, u)),
|
|
2339
|
+
[R, B, u, z]
|
|
2340
|
+
), Ke = F(() => he(!1), [he]);
|
|
2341
|
+
_e(ee, Ke);
|
|
2342
|
+
const Ee = L(null);
|
|
2343
|
+
U(() => {
|
|
2344
|
+
if (typeof document > "u")
|
|
2345
|
+
return;
|
|
2346
|
+
if (ee) {
|
|
2347
|
+
Ee.current = document.activeElement;
|
|
2348
|
+
return;
|
|
2349
|
+
}
|
|
2350
|
+
const $ = Ee.current;
|
|
2351
|
+
Ee.current = null, $ instanceof HTMLElement && $.isConnected && $.focus();
|
|
2352
|
+
}, [ee]);
|
|
2353
|
+
const Be = F(
|
|
2354
|
+
($, ne) => {
|
|
2355
|
+
var ze;
|
|
2356
|
+
$.disabled || ((ze = $.onSelect) == null || ze.call($, $, ne), G == null || G($, ne), w && ee && he(!1));
|
|
2357
|
+
},
|
|
2358
|
+
[G, w, ee, he]
|
|
2359
|
+
), Fe = W(), be = n ?? (V == null ? void 0 : V.sidebarPresentation) ?? "grouped", He = t ?? (V == null ? void 0 : V.sidebarTone) ?? "auto", se = ie && !ee, wr = J(
|
|
2360
|
+
() => ({
|
|
2361
|
+
variant: be,
|
|
2362
|
+
collapsed: se,
|
|
2363
|
+
expanded: Me,
|
|
2364
|
+
activeKey: re,
|
|
2365
|
+
activeAncestors: pe,
|
|
2366
|
+
toggle: Pe,
|
|
2367
|
+
select: Be,
|
|
2368
|
+
renderLink: P,
|
|
2369
|
+
idPrefix: Fe,
|
|
2370
|
+
depthOffset: 0
|
|
2371
|
+
}),
|
|
2372
|
+
[be, se, Me, re, pe, Pe, Be, P, Fe]
|
|
2373
|
+
), je = {
|
|
2374
|
+
collapsed: ie,
|
|
2375
|
+
toggle: () => kr(!ie),
|
|
2376
|
+
label: ie ? _ : x
|
|
2377
|
+
}, Ue = se ? D : I, qe = /* @__PURE__ */ y(
|
|
2378
|
+
"aside",
|
|
2379
|
+
{
|
|
2380
|
+
className: h(
|
|
2381
|
+
"rrc-sidebar",
|
|
2382
|
+
`rrc-sidebar--${be}`,
|
|
2383
|
+
se ? "rrc-sidebar--collapsed" : "rrc-sidebar--expanded",
|
|
2384
|
+
ee && "rrc-sidebar--mobile-open",
|
|
2385
|
+
O
|
|
2386
|
+
),
|
|
2387
|
+
"data-variant": be,
|
|
2388
|
+
"data-collapsed": se ? "true" : "false",
|
|
2389
|
+
"data-bs-theme": He === "auto" ? void 0 : He,
|
|
2390
|
+
...ee ? { role: "dialog", "aria-modal": !0, "aria-label": b ?? q } : {},
|
|
2391
|
+
children: [
|
|
2392
|
+
/* @__PURE__ */ y("div", { className: "rrc-sidebar__panel", children: [
|
|
2393
|
+
(g !== void 0 || k) && /* @__PURE__ */ o("div", { className: "rrc-sidebar__header", children: g !== void 0 && /* @__PURE__ */ o("div", { className: "rrc-sidebar__brand", children: g }) }),
|
|
2394
|
+
/* @__PURE__ */ o("nav", { className: "rrc-sidebar__body", "aria-label": q, children: /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__menu--root", children: R.roots.map(($) => /* @__PURE__ */ o(Ne, { node: $, ctx: wr }, $.key)) }) }),
|
|
2395
|
+
Ue !== void 0 && /* @__PURE__ */ o("div", { className: "rrc-sidebar__footer", children: Ue })
|
|
2396
|
+
] }),
|
|
2397
|
+
k && /* @__PURE__ */ o("div", { className: "rrc-sidebar__collapse", children: S ? S(je) : /* @__PURE__ */ o(xn, { ...je }) })
|
|
2398
|
+
]
|
|
2399
|
+
}
|
|
2400
|
+
);
|
|
2401
|
+
return ee ? /* @__PURE__ */ y("div", { className: "rrc-sidebar-drawer", children: [
|
|
2402
|
+
/* @__PURE__ */ o("div", { className: "rrc-sidebar-drawer__backdrop", onClick: Ke, "data-testid": "rrc-sidebar-backdrop" }),
|
|
2403
|
+
qe
|
|
2404
|
+
] }) : qe;
|
|
2405
|
+
}
|
|
2406
|
+
function Ot({ title: e, description: r, breadcrumbItems: n, actions: t, className: a }) {
|
|
2407
|
+
return /* @__PURE__ */ y("div", { className: h("mb-4", "rrc-page-header", a), children: [
|
|
2408
|
+
n && n.length > 0 && /* @__PURE__ */ o(Yr, { items: n, className: "mb-2 rrc-page-header__breadcrumb" }),
|
|
2409
|
+
/* @__PURE__ */ y("div", { className: "d-flex align-items-start justify-content-between gap-3 flex-wrap rrc-page-header__row", children: [
|
|
2410
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2411
|
+
/* @__PURE__ */ o("h1", { className: "h3 mb-1 rrc-page-header__title", children: e }),
|
|
2412
|
+
r && /* @__PURE__ */ o("p", { className: "text-body-secondary mb-0 rrc-page-header__description", children: r })
|
|
1685
2413
|
] }),
|
|
1686
|
-
|
|
2414
|
+
t && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-2 rrc-page-header__actions", children: t })
|
|
1687
2415
|
] })
|
|
1688
2416
|
] });
|
|
1689
2417
|
}
|
|
1690
|
-
const
|
|
2418
|
+
const Sn = {
|
|
1691
2419
|
xs: 1,
|
|
1692
2420
|
sm: 2,
|
|
1693
2421
|
md: 3,
|
|
1694
2422
|
lg: 4,
|
|
1695
2423
|
xl: 5
|
|
1696
2424
|
};
|
|
1697
|
-
function
|
|
1698
|
-
return typeof e == "number" ? e :
|
|
2425
|
+
function Cn(e) {
|
|
2426
|
+
return typeof e == "number" ? e : Sn[e];
|
|
1699
2427
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return /* @__PURE__ */
|
|
1702
|
-
|
|
2428
|
+
function Mt({ direction: e = "row", gap: r = "sm", grow: n, shrink: t, fullWidth: a, className: i, ...l }) {
|
|
2429
|
+
return /* @__PURE__ */ o(
|
|
2430
|
+
cr,
|
|
1703
2431
|
{
|
|
1704
2432
|
direction: e,
|
|
1705
|
-
gap:
|
|
1706
|
-
className:
|
|
1707
|
-
...
|
|
2433
|
+
gap: Cn(r),
|
|
2434
|
+
className: h("rrc-flex", n && "flex-grow-1", t && "flex-shrink-0", a && "w-100", i),
|
|
2435
|
+
...l
|
|
1708
2436
|
}
|
|
1709
2437
|
);
|
|
1710
2438
|
}
|
|
1711
|
-
function
|
|
1712
|
-
const s = /* @__PURE__ */
|
|
1713
|
-
return
|
|
2439
|
+
function Pt({ icon: e, "aria-label": r, iconSize: n, tooltip: t, variant: a = "light", loading: i, className: l, ...c }) {
|
|
2440
|
+
const s = /* @__PURE__ */ o(ke, { variant: a, loading: i, className: h("btn-icon", "rrc-btn-icon", l), "aria-label": r, ...c, children: !i && /* @__PURE__ */ o(Le, { name: e, size: n }) });
|
|
2441
|
+
return t ? /* @__PURE__ */ o(sr, { content: t, children: s }) : s;
|
|
1714
2442
|
}
|
|
1715
|
-
function
|
|
1716
|
-
const s = /* @__PURE__ */
|
|
1717
|
-
e && /* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
|
|
2443
|
+
function Kt({ leading: e, title: r, description: n, trailing: t, onClick: a, disabled: i, dense: l, className: c }) {
|
|
2444
|
+
const s = /* @__PURE__ */ y(Q, { children: [
|
|
2445
|
+
e && /* @__PURE__ */ o("span", { className: "flex-shrink-0 d-inline-flex align-items-center rrc-list-item__leading", children: e }),
|
|
2446
|
+
/* @__PURE__ */ y("span", { className: "flex-grow-1", style: { minWidth: 0 }, children: [
|
|
2447
|
+
/* @__PURE__ */ o("span", { className: "d-block text-truncate rrc-list-item__title", children: r }),
|
|
2448
|
+
n && /* @__PURE__ */ o("span", { className: "d-block text-truncate small text-body-secondary rrc-list-item__description", children: n })
|
|
1721
2449
|
] }),
|
|
1722
|
-
|
|
1723
|
-
] }), d =
|
|
2450
|
+
t && /* @__PURE__ */ o("span", { className: "flex-shrink-0 d-inline-flex align-items-center rrc-list-item__trailing", children: t })
|
|
2451
|
+
] }), d = h(
|
|
1724
2452
|
"d-flex align-items-center text-start",
|
|
1725
|
-
|
|
1726
|
-
|
|
2453
|
+
"rrc-list-item",
|
|
2454
|
+
a && "rrc-list-item--interactive",
|
|
2455
|
+
l ? "gap-2 py-1" : "gap-3 py-2",
|
|
2456
|
+
a && "w-100 border-0 bg-transparent",
|
|
1727
2457
|
i && "opacity-50",
|
|
1728
2458
|
c
|
|
1729
2459
|
);
|
|
1730
|
-
return
|
|
2460
|
+
return a ? /* @__PURE__ */ o("button", { type: "button", className: d, onClick: a, disabled: i, children: s }) : /* @__PURE__ */ o("div", { className: d, "aria-disabled": i || void 0, children: s });
|
|
1731
2461
|
}
|
|
1732
|
-
function
|
|
2462
|
+
function In(e, r, n, t) {
|
|
1733
2463
|
if (e.length === 0)
|
|
1734
2464
|
return [];
|
|
1735
|
-
const
|
|
1736
|
-
return e.map((u,
|
|
1737
|
-
const m =
|
|
1738
|
-
return [m,
|
|
2465
|
+
const a = Math.min(...e), l = Math.max(...e) - a || 1, c = r - t * 2, s = n - t * 2, d = e.length > 1 ? c / (e.length - 1) : 0;
|
|
2466
|
+
return e.map((u, f) => {
|
|
2467
|
+
const m = t + d * f, p = t + s - (u - a) / l * s;
|
|
2468
|
+
return [m, p];
|
|
1739
2469
|
});
|
|
1740
2470
|
}
|
|
1741
|
-
function
|
|
1742
|
-
const i =
|
|
1743
|
-
if (
|
|
2471
|
+
function En({ type: e, data: r, width: n, height: t, strokeWidth: a }) {
|
|
2472
|
+
const i = a, l = In(r, n, t, i);
|
|
2473
|
+
if (l.length === 0)
|
|
1744
2474
|
return null;
|
|
1745
|
-
const c =
|
|
1746
|
-
return /* @__PURE__ */
|
|
1747
|
-
e === "area" && /* @__PURE__ */
|
|
2475
|
+
const c = l.map(([s, d]) => `${s},${d}`).join(" ");
|
|
2476
|
+
return /* @__PURE__ */ y(Q, { children: [
|
|
2477
|
+
e === "area" && /* @__PURE__ */ o(
|
|
1748
2478
|
"polygon",
|
|
1749
2479
|
{
|
|
1750
|
-
points: `${i},${
|
|
2480
|
+
points: `${i},${t - i} ${c} ${n - i},${t - i}`,
|
|
1751
2481
|
fill: "currentColor",
|
|
1752
2482
|
opacity: 0.2,
|
|
1753
2483
|
stroke: "none"
|
|
1754
2484
|
}
|
|
1755
2485
|
),
|
|
1756
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ o("polyline", { points: c, fill: "none", stroke: "currentColor", strokeWidth: a, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1757
2487
|
] });
|
|
1758
2488
|
}
|
|
1759
|
-
function
|
|
2489
|
+
function An({ data: e, width: r, height: n }) {
|
|
1760
2490
|
if (e.length === 0)
|
|
1761
2491
|
return null;
|
|
1762
|
-
const
|
|
1763
|
-
return /* @__PURE__ */
|
|
1764
|
-
const u = Math.max((s -
|
|
1765
|
-
return /* @__PURE__ */
|
|
2492
|
+
const t = Math.min(0, ...e), i = Math.max(0, ...e) - t || 1, l = 2, c = Math.max((r - l * (e.length - 1)) / e.length, 1);
|
|
2493
|
+
return /* @__PURE__ */ o(Q, { children: e.map((s, d) => {
|
|
2494
|
+
const u = Math.max((s - t) / i * n, 1), f = d * (c + l), m = n - u;
|
|
2495
|
+
return /* @__PURE__ */ o("rect", { x: f, y: m, width: c, height: u, rx: 1, fill: "currentColor" }, d);
|
|
1766
2496
|
}) });
|
|
1767
2497
|
}
|
|
1768
|
-
function
|
|
1769
|
-
return /* @__PURE__ */
|
|
2498
|
+
function Bt({ type: e = "line", data: r, tone: n = "primary", width: t = 80, height: a = 28, strokeWidth: i = 2, className: l, label: c }) {
|
|
2499
|
+
return /* @__PURE__ */ o(
|
|
1770
2500
|
"svg",
|
|
1771
2501
|
{
|
|
1772
|
-
width:
|
|
1773
|
-
height:
|
|
1774
|
-
viewBox: `0 0 ${
|
|
1775
|
-
className:
|
|
2502
|
+
width: t,
|
|
2503
|
+
height: a,
|
|
2504
|
+
viewBox: `0 0 ${t} ${a}`,
|
|
2505
|
+
className: h(`text-${n}`, "rrc-sparkline", l),
|
|
1776
2506
|
role: c ? "img" : void 0,
|
|
1777
2507
|
"aria-label": c,
|
|
1778
2508
|
"aria-hidden": c ? void 0 : !0,
|
|
1779
|
-
children: e === "bar" ? /* @__PURE__ */
|
|
2509
|
+
children: e === "bar" ? /* @__PURE__ */ o(An, { data: r, width: t, height: a }) : /* @__PURE__ */ o(En, { type: e, data: r, width: t, height: a, strokeWidth: i })
|
|
1780
2510
|
}
|
|
1781
2511
|
);
|
|
1782
2512
|
}
|
|
1783
|
-
const
|
|
2513
|
+
const Dn = {
|
|
1784
2514
|
up: "success",
|
|
1785
2515
|
down: "danger",
|
|
1786
2516
|
neutral: "muted"
|
|
1787
|
-
},
|
|
2517
|
+
}, Tn = {
|
|
1788
2518
|
up: "bi bi-arrow-up-short",
|
|
1789
2519
|
down: "bi bi-arrow-down-short",
|
|
1790
2520
|
neutral: "bi bi-dash"
|
|
1791
2521
|
};
|
|
1792
|
-
function
|
|
1793
|
-
return typeof e == "number" &&
|
|
1794
|
-
}
|
|
1795
|
-
function
|
|
1796
|
-
return /* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
c ? /* @__PURE__ */
|
|
1799
|
-
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
|
|
2522
|
+
function Vn(e, r) {
|
|
2523
|
+
return typeof e == "number" && r != null ? e.toFixed(r) : String(e);
|
|
2524
|
+
}
|
|
2525
|
+
function Ft({ label: e, value: r, prefix: n, suffix: t, precision: a, trend: i, delta: l, loading: c, className: s }) {
|
|
2526
|
+
return /* @__PURE__ */ y("div", { className: h("d-flex flex-column gap-1", "rrc-statistic", s), children: [
|
|
2527
|
+
/* @__PURE__ */ o(te, { size: "sm", tone: "muted", children: e }),
|
|
2528
|
+
c ? /* @__PURE__ */ o(ye, { height: "1.75rem", width: "60%" }) : /* @__PURE__ */ y("div", { className: "d-flex align-items-baseline gap-1", children: [
|
|
2529
|
+
n && /* @__PURE__ */ o(te, { size: "lg", weight: "semibold", children: n }),
|
|
2530
|
+
/* @__PURE__ */ o(te, { size: "xl", weight: "bold", children: Vn(r, a) }),
|
|
2531
|
+
t && /* @__PURE__ */ o(te, { size: "lg", weight: "semibold", children: t })
|
|
1802
2532
|
] }),
|
|
1803
|
-
!c && (i ||
|
|
1804
|
-
i && /* @__PURE__ */
|
|
1805
|
-
|
|
2533
|
+
!c && (i || l != null) && /* @__PURE__ */ y(te, { size: "sm", tone: i ? Dn[i] : "muted", className: "d-inline-flex align-items-center gap-1", children: [
|
|
2534
|
+
i && /* @__PURE__ */ o(Le, { name: Tn[i], size: "sm" }),
|
|
2535
|
+
l
|
|
1806
2536
|
] })
|
|
1807
2537
|
] });
|
|
1808
2538
|
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
2539
|
+
function ge({
|
|
2540
|
+
title: e,
|
|
2541
|
+
options: r,
|
|
2542
|
+
value: n,
|
|
2543
|
+
onChange: t,
|
|
2544
|
+
className: a
|
|
2545
|
+
}) {
|
|
2546
|
+
const i = W(), l = L([]);
|
|
2547
|
+
function c(d, u) {
|
|
2548
|
+
var p;
|
|
2549
|
+
if (r.length === 0)
|
|
2550
|
+
return;
|
|
2551
|
+
const f = (d + u + r.length) % r.length, m = r[f];
|
|
2552
|
+
m && (t(m.value), (p = l.current[f]) == null || p.focus());
|
|
2553
|
+
}
|
|
2554
|
+
function s(d) {
|
|
2555
|
+
const u = r.findIndex((f) => f.value === n);
|
|
2556
|
+
d.key === "ArrowDown" || d.key === "ArrowRight" ? (d.preventDefault(), c(u, 1)) : (d.key === "ArrowUp" || d.key === "ArrowLeft") && (d.preventDefault(), c(u, -1));
|
|
2557
|
+
}
|
|
2558
|
+
return /* @__PURE__ */ y("div", { className: h("rrc-appearance__section", a), children: [
|
|
2559
|
+
/* @__PURE__ */ o("div", { className: "rrc-appearance__title", id: i, children: e }),
|
|
2560
|
+
/* @__PURE__ */ o("div", { className: "rrc-appearance__options", role: "radiogroup", "aria-labelledby": i, onKeyDown: s, children: r.map((d, u) => {
|
|
2561
|
+
const f = d.value === n;
|
|
2562
|
+
return /* @__PURE__ */ y(
|
|
2563
|
+
"button",
|
|
2564
|
+
{
|
|
2565
|
+
ref: (m) => {
|
|
2566
|
+
l.current[u] = m;
|
|
2567
|
+
},
|
|
2568
|
+
type: "button",
|
|
2569
|
+
role: "radio",
|
|
2570
|
+
"aria-checked": f,
|
|
2571
|
+
tabIndex: f ? 0 : -1,
|
|
2572
|
+
className: h("rrc-appearance__option", f && "rrc-appearance__option--selected"),
|
|
2573
|
+
onClick: () => t(d.value),
|
|
2574
|
+
children: [
|
|
2575
|
+
d.adornment,
|
|
2576
|
+
/* @__PURE__ */ o("span", { className: "rrc-appearance__option-label", children: d.label }),
|
|
2577
|
+
/* @__PURE__ */ o("span", { className: "rrc-appearance__check", "aria-hidden": "true" })
|
|
2578
|
+
]
|
|
2579
|
+
},
|
|
2580
|
+
d.value
|
|
2581
|
+
);
|
|
2582
|
+
}) })
|
|
2583
|
+
] });
|
|
2584
|
+
}
|
|
2585
|
+
function Ht({
|
|
2586
|
+
labels: e,
|
|
2587
|
+
sections: r,
|
|
2588
|
+
className: n,
|
|
2589
|
+
mode: t,
|
|
2590
|
+
onModeChange: a,
|
|
2591
|
+
sidebarPresentation: i,
|
|
2592
|
+
onSidebarPresentationChange: l,
|
|
2593
|
+
sidebarTone: c,
|
|
2594
|
+
onSidebarToneChange: s,
|
|
2595
|
+
colorSchemeId: d,
|
|
2596
|
+
onColorSchemeIdChange: u,
|
|
2597
|
+
colorSchemes: f
|
|
2598
|
+
}) {
|
|
2599
|
+
const m = hr(), p = {
|
|
2600
|
+
presentation: (r == null ? void 0 : r.presentation) ?? !0,
|
|
2601
|
+
mode: (r == null ? void 0 : r.mode) ?? !0,
|
|
2602
|
+
tone: (r == null ? void 0 : r.tone) ?? !0,
|
|
2603
|
+
colorScheme: (r == null ? void 0 : r.colorScheme) ?? !0
|
|
2604
|
+
}, k = t ?? (m == null ? void 0 : m.mode) ?? "system", S = i ?? (m == null ? void 0 : m.sidebarPresentation) ?? "grouped", x = c ?? (m == null ? void 0 : m.sidebarTone) ?? "auto", _ = d ?? (m == null ? void 0 : m.colorSchemeId) ?? Re, C = (g) => {
|
|
2605
|
+
a == null || a(g), t === void 0 && (m == null || m.setMode(g));
|
|
2606
|
+
}, v = (g) => {
|
|
2607
|
+
l == null || l(g), i === void 0 && (m == null || m.setSidebarPresentation(g));
|
|
2608
|
+
}, N = (g) => {
|
|
2609
|
+
s == null || s(g), c === void 0 && (m == null || m.setSidebarTone(g));
|
|
2610
|
+
}, b = (g) => {
|
|
2611
|
+
u == null || u(g), d === void 0 && (m == null || m.setColorSchemeId(g));
|
|
2612
|
+
}, w = f ?? tn();
|
|
2613
|
+
return /* @__PURE__ */ y("div", { className: h("rrc-appearance", n), children: [
|
|
2614
|
+
p.presentation && /* @__PURE__ */ o(
|
|
2615
|
+
ge,
|
|
2616
|
+
{
|
|
2617
|
+
title: e.presentation.title,
|
|
2618
|
+
value: S,
|
|
2619
|
+
onChange: v,
|
|
2620
|
+
options: mr.map((g) => ({ value: g, label: e.presentation[g] }))
|
|
2621
|
+
}
|
|
2622
|
+
),
|
|
2623
|
+
p.mode && /* @__PURE__ */ o(
|
|
2624
|
+
ge,
|
|
2625
|
+
{
|
|
2626
|
+
title: e.mode.title,
|
|
2627
|
+
value: k,
|
|
2628
|
+
onChange: C,
|
|
2629
|
+
options: ur.map((g) => ({ value: g, label: e.mode[g] }))
|
|
2630
|
+
}
|
|
2631
|
+
),
|
|
2632
|
+
p.tone && /* @__PURE__ */ o(
|
|
2633
|
+
ge,
|
|
2634
|
+
{
|
|
2635
|
+
title: e.tone.title,
|
|
2636
|
+
value: x,
|
|
2637
|
+
onChange: N,
|
|
2638
|
+
options: fr.map((g) => ({ value: g, label: e.tone[g] }))
|
|
2639
|
+
}
|
|
2640
|
+
),
|
|
2641
|
+
p.colorScheme && /* @__PURE__ */ o(
|
|
2642
|
+
ge,
|
|
2643
|
+
{
|
|
2644
|
+
title: e.colorScheme.title,
|
|
2645
|
+
value: _,
|
|
2646
|
+
onChange: b,
|
|
2647
|
+
className: "rrc-appearance__section--schemes",
|
|
2648
|
+
options: w.map((g) => ({
|
|
2649
|
+
value: g.id,
|
|
2650
|
+
// Falls back to the registered identifier rather than to invented
|
|
2651
|
+
// English copy, so a swatch always has a real accessible name.
|
|
2652
|
+
label: e.colorScheme.options[g.id] ?? g.id,
|
|
2653
|
+
adornment: /* @__PURE__ */ o(
|
|
2654
|
+
"span",
|
|
2655
|
+
{
|
|
2656
|
+
className: "rrc-appearance__swatch",
|
|
2657
|
+
style: { backgroundColor: g.swatch ?? g.tokens.primary },
|
|
2658
|
+
"aria-hidden": "true"
|
|
2659
|
+
}
|
|
2660
|
+
)
|
|
2661
|
+
}))
|
|
2662
|
+
}
|
|
2663
|
+
)
|
|
2664
|
+
] });
|
|
2665
|
+
}
|
|
2666
|
+
class Ln extends Error {
|
|
2667
|
+
constructor(r, n, t) {
|
|
2668
|
+
super(`HTTP ${r} ${n} for ${t}`), this.name = "HttpError", this.status = r, this.statusText = n, this.url = t;
|
|
1812
2669
|
}
|
|
1813
2670
|
}
|
|
1814
|
-
function
|
|
2671
|
+
function Rn(e) {
|
|
1815
2672
|
if (!e)
|
|
1816
2673
|
return "";
|
|
1817
|
-
const
|
|
1818
|
-
for (const [
|
|
1819
|
-
|
|
1820
|
-
const
|
|
1821
|
-
return
|
|
1822
|
-
}
|
|
1823
|
-
function
|
|
1824
|
-
const { baseUrl:
|
|
2674
|
+
const r = new URLSearchParams();
|
|
2675
|
+
for (const [t, a] of Object.entries(e))
|
|
2676
|
+
a != null && r.set(t, String(a));
|
|
2677
|
+
const n = r.toString();
|
|
2678
|
+
return n ? `?${n}` : "";
|
|
2679
|
+
}
|
|
2680
|
+
function $n(e = {}) {
|
|
2681
|
+
const { baseUrl: r = "", fetcher: n = fetch, buildRequestInit: t } = e;
|
|
1825
2682
|
return {
|
|
1826
|
-
async get(
|
|
1827
|
-
const
|
|
2683
|
+
async get(a, i = {}) {
|
|
2684
|
+
const l = `${r}${a}${Rn(i.params)}`;
|
|
1828
2685
|
let c = { method: "GET", signal: i.signal };
|
|
1829
|
-
|
|
1830
|
-
const s = await
|
|
2686
|
+
t && (c = t(l, c));
|
|
2687
|
+
const s = await n(l, c);
|
|
1831
2688
|
if (!s.ok)
|
|
1832
|
-
throw new
|
|
2689
|
+
throw new Ln(s.status, s.statusText, l);
|
|
1833
2690
|
return await s.json();
|
|
1834
2691
|
}
|
|
1835
2692
|
};
|
|
1836
2693
|
}
|
|
1837
|
-
const
|
|
1838
|
-
function
|
|
1839
|
-
return Object.keys(e).sort().reduce((
|
|
2694
|
+
const On = $n();
|
|
2695
|
+
function Mn(e) {
|
|
2696
|
+
return Object.keys(e).sort().reduce((r, n) => (r[n] = e[n], r), {});
|
|
1840
2697
|
}
|
|
1841
|
-
function
|
|
1842
|
-
client: e =
|
|
1843
|
-
url:
|
|
1844
|
-
params:
|
|
1845
|
-
mapResponse:
|
|
1846
|
-
enabled:
|
|
2698
|
+
function ue({
|
|
2699
|
+
client: e = On,
|
|
2700
|
+
url: r,
|
|
2701
|
+
params: n,
|
|
2702
|
+
mapResponse: t,
|
|
2703
|
+
enabled: a = !0
|
|
1847
2704
|
}) {
|
|
1848
|
-
const [i,
|
|
1849
|
-
|
|
1850
|
-
if (!
|
|
1851
|
-
|
|
2705
|
+
const [i, l] = M("idle"), [c, s] = M([]), [d, u] = M(null), [f, m] = M(0), p = J(() => n ? JSON.stringify(Mn(n)) : "", [n]), k = L(0), S = L(t);
|
|
2706
|
+
S.current = t, U(() => {
|
|
2707
|
+
if (!a || !r) {
|
|
2708
|
+
l("idle"), s([]), u(null);
|
|
1852
2709
|
return;
|
|
1853
2710
|
}
|
|
1854
|
-
const
|
|
1855
|
-
return
|
|
1856
|
-
if (
|
|
2711
|
+
const _ = ++k.current, C = new AbortController();
|
|
2712
|
+
return l("loading"), u(null), e.get(r, { params: n, signal: C.signal }).then((v) => {
|
|
2713
|
+
if (_ !== k.current)
|
|
1857
2714
|
return;
|
|
1858
|
-
const
|
|
1859
|
-
s(
|
|
1860
|
-
}).catch((
|
|
1861
|
-
|
|
2715
|
+
const N = S.current(v);
|
|
2716
|
+
s(N), l(N.length === 0 ? "empty" : "success");
|
|
2717
|
+
}).catch((v) => {
|
|
2718
|
+
_ === k.current && (v instanceof DOMException && v.name === "AbortError" || (u(v instanceof Error ? v : new Error(String(v))), l("error")));
|
|
1862
2719
|
}), () => {
|
|
1863
|
-
|
|
2720
|
+
C.abort();
|
|
1864
2721
|
};
|
|
1865
|
-
}, [e,
|
|
1866
|
-
const
|
|
1867
|
-
return { state: i, items: c, error: d, reload:
|
|
1868
|
-
}
|
|
1869
|
-
function
|
|
1870
|
-
const [
|
|
1871
|
-
return
|
|
1872
|
-
const
|
|
1873
|
-
return () => clearTimeout(
|
|
1874
|
-
}, [e,
|
|
1875
|
-
}
|
|
1876
|
-
function
|
|
2722
|
+
}, [e, r, p, a, f]);
|
|
2723
|
+
const x = F(() => m((_) => _ + 1), []);
|
|
2724
|
+
return { state: i, items: c, error: d, reload: x };
|
|
2725
|
+
}
|
|
2726
|
+
function Pn(e, r) {
|
|
2727
|
+
const [n, t] = M(e);
|
|
2728
|
+
return U(() => {
|
|
2729
|
+
const a = setTimeout(() => t(e), r);
|
|
2730
|
+
return () => clearTimeout(a);
|
|
2731
|
+
}, [e, r]), n;
|
|
2732
|
+
}
|
|
2733
|
+
function me(e) {
|
|
1877
2734
|
if (Array.isArray(e))
|
|
1878
2735
|
return e;
|
|
1879
2736
|
if (e && typeof e == "object" && Array.isArray(e.items))
|
|
@@ -1882,497 +2739,518 @@ function Q(e) {
|
|
|
1882
2739
|
"Unable to normalize remote response into an array. Provide an explicit `mapResponse` for this endpoint's response shape."
|
|
1883
2740
|
);
|
|
1884
2741
|
}
|
|
1885
|
-
function
|
|
2742
|
+
function Se(e, r, n) {
|
|
1886
2743
|
if (e === null || typeof e != "object")
|
|
1887
2744
|
throw new Error("Remote item is not an object; cannot read valueMember/displayMember from it.");
|
|
1888
|
-
const
|
|
2745
|
+
const t = e;
|
|
1889
2746
|
return {
|
|
1890
|
-
value: r
|
|
1891
|
-
label: String(
|
|
2747
|
+
value: t[r],
|
|
2748
|
+
label: String(t[n] ?? "")
|
|
1892
2749
|
};
|
|
1893
2750
|
}
|
|
1894
|
-
function
|
|
2751
|
+
function Kn({
|
|
1895
2752
|
url: e,
|
|
1896
|
-
params:
|
|
1897
|
-
valueMember:
|
|
1898
|
-
displayMember:
|
|
1899
|
-
mapResponse:
|
|
2753
|
+
params: r,
|
|
2754
|
+
valueMember: n,
|
|
2755
|
+
displayMember: t,
|
|
2756
|
+
mapResponse: a,
|
|
1900
2757
|
client: i,
|
|
1901
|
-
enabled:
|
|
2758
|
+
enabled: l,
|
|
1902
2759
|
...c
|
|
1903
2760
|
}) {
|
|
1904
|
-
const { state: s, items: d, error: u } =
|
|
2761
|
+
const { state: s, items: d, error: u } = ue({
|
|
1905
2762
|
client: i,
|
|
1906
2763
|
url: e,
|
|
1907
|
-
params:
|
|
1908
|
-
enabled:
|
|
1909
|
-
mapResponse: (m) => (
|
|
1910
|
-
}),
|
|
1911
|
-
return /* @__PURE__ */
|
|
2764
|
+
params: r,
|
|
2765
|
+
enabled: l,
|
|
2766
|
+
mapResponse: (m) => (a ? a(m) : me(m)).map((k) => Se(k, n, t))
|
|
2767
|
+
}), f = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
|
|
2768
|
+
return /* @__PURE__ */ o(Ar, { ...c, options: d, loading: s === "loading", error: f });
|
|
1912
2769
|
}
|
|
1913
|
-
function
|
|
2770
|
+
function jt({
|
|
1914
2771
|
url: e,
|
|
1915
|
-
params:
|
|
1916
|
-
searchParam:
|
|
1917
|
-
valueMember:
|
|
1918
|
-
displayMember:
|
|
2772
|
+
params: r,
|
|
2773
|
+
searchParam: n,
|
|
2774
|
+
valueMember: t,
|
|
2775
|
+
displayMember: a,
|
|
1919
2776
|
mapResponse: i,
|
|
1920
|
-
minSearchLength:
|
|
2777
|
+
minSearchLength: l = 1,
|
|
1921
2778
|
debounceMs: c = 300,
|
|
1922
2779
|
client: s,
|
|
1923
2780
|
inputValue: d,
|
|
1924
2781
|
onInputValueChange: u,
|
|
1925
|
-
...
|
|
2782
|
+
...f
|
|
1926
2783
|
}) {
|
|
1927
|
-
const [m,
|
|
2784
|
+
const [m, p] = T({
|
|
1928
2785
|
value: d,
|
|
1929
2786
|
defaultValue: "",
|
|
1930
2787
|
onChange: u
|
|
1931
|
-
}),
|
|
2788
|
+
}), k = Pn(m, c), S = k.length >= l, { state: x, items: _, error: C } = ue({
|
|
1932
2789
|
client: s,
|
|
1933
2790
|
url: e,
|
|
1934
|
-
enabled:
|
|
1935
|
-
params: { ...
|
|
1936
|
-
mapResponse: (
|
|
1937
|
-
}),
|
|
1938
|
-
return /* @__PURE__ */
|
|
1939
|
-
|
|
2791
|
+
enabled: S,
|
|
2792
|
+
params: { ...r, [n]: k },
|
|
2793
|
+
mapResponse: (N) => (i ? i(N) : me(N)).map((w) => Se(w, t, a))
|
|
2794
|
+
}), v = f.error ?? (x === "error" ? (C == null ? void 0 : C.message) ?? "Failed to load suggestions" : void 0);
|
|
2795
|
+
return /* @__PURE__ */ o(
|
|
2796
|
+
Tr,
|
|
1940
2797
|
{
|
|
1941
|
-
...
|
|
1942
|
-
options:
|
|
1943
|
-
loading:
|
|
1944
|
-
error:
|
|
2798
|
+
...f,
|
|
2799
|
+
options: _,
|
|
2800
|
+
loading: x === "loading",
|
|
2801
|
+
error: v,
|
|
1945
2802
|
inputValue: m,
|
|
1946
|
-
onInputValueChange:
|
|
2803
|
+
onInputValueChange: p,
|
|
1947
2804
|
filter: () => !0
|
|
1948
2805
|
}
|
|
1949
2806
|
);
|
|
1950
2807
|
}
|
|
1951
|
-
function
|
|
2808
|
+
function Bn({
|
|
1952
2809
|
url: e,
|
|
1953
|
-
params:
|
|
1954
|
-
mapResponse:
|
|
1955
|
-
getTotalCount:
|
|
1956
|
-
pageSize:
|
|
2810
|
+
params: r,
|
|
2811
|
+
mapResponse: n,
|
|
2812
|
+
getTotalCount: t,
|
|
2813
|
+
pageSize: a = 20,
|
|
1957
2814
|
client: i,
|
|
1958
|
-
...
|
|
2815
|
+
...l
|
|
1959
2816
|
}) {
|
|
1960
|
-
const [c, s] = M(1), [d, u] = M(null),
|
|
1961
|
-
|
|
2817
|
+
const [c, s] = M(1), [d, u] = M(null), f = J(() => JSON.stringify(r ?? {}), [r]), m = L(!0);
|
|
2818
|
+
U(() => {
|
|
1962
2819
|
if (m.current) {
|
|
1963
2820
|
m.current = !1;
|
|
1964
2821
|
return;
|
|
1965
2822
|
}
|
|
1966
2823
|
s(1);
|
|
1967
|
-
}, [
|
|
1968
|
-
const
|
|
2824
|
+
}, [f]);
|
|
2825
|
+
const p = J(
|
|
1969
2826
|
() => ({
|
|
1970
|
-
...
|
|
2827
|
+
...r,
|
|
1971
2828
|
page: c,
|
|
1972
|
-
pageSize:
|
|
2829
|
+
pageSize: a,
|
|
1973
2830
|
...d ? { sortKey: d.key, sortDirection: d.direction } : {}
|
|
1974
2831
|
}),
|
|
1975
|
-
[
|
|
1976
|
-
),
|
|
2832
|
+
[r, c, a, d]
|
|
2833
|
+
), k = L(void 0), { state: S, items: x, error: _ } = ue({
|
|
1977
2834
|
client: i,
|
|
1978
2835
|
url: e,
|
|
1979
|
-
params:
|
|
1980
|
-
mapResponse: (
|
|
1981
|
-
}),
|
|
1982
|
-
return /* @__PURE__ */
|
|
1983
|
-
|
|
2836
|
+
params: p,
|
|
2837
|
+
mapResponse: (w) => (k.current = w, n ? n(w) : me(w))
|
|
2838
|
+
}), C = k.current !== void 0 ? t == null ? void 0 : t(k.current) : void 0, N = x.length >= a && a > 0 ? c * a + 1 : (c - 1) * a + x.length, b = C ?? N;
|
|
2839
|
+
return /* @__PURE__ */ o(
|
|
2840
|
+
Kr,
|
|
1984
2841
|
{
|
|
1985
|
-
...
|
|
1986
|
-
rows:
|
|
1987
|
-
loading:
|
|
1988
|
-
error:
|
|
2842
|
+
...l,
|
|
2843
|
+
rows: x,
|
|
2844
|
+
loading: S === "loading",
|
|
2845
|
+
error: _ == null ? void 0 : _.message,
|
|
1989
2846
|
page: c,
|
|
1990
|
-
pageSize:
|
|
2847
|
+
pageSize: a,
|
|
1991
2848
|
totalCount: b,
|
|
1992
2849
|
onPageChange: s,
|
|
1993
2850
|
sort: d,
|
|
1994
|
-
onSortChange: (
|
|
1995
|
-
u(
|
|
2851
|
+
onSortChange: (w) => {
|
|
2852
|
+
u(w), s(1);
|
|
1996
2853
|
}
|
|
1997
2854
|
}
|
|
1998
2855
|
);
|
|
1999
2856
|
}
|
|
2000
|
-
function
|
|
2857
|
+
function Ut({
|
|
2001
2858
|
url: e,
|
|
2002
|
-
params:
|
|
2003
|
-
valueMember:
|
|
2004
|
-
displayMember:
|
|
2005
|
-
mapResponse:
|
|
2859
|
+
params: r,
|
|
2860
|
+
valueMember: n,
|
|
2861
|
+
displayMember: t,
|
|
2862
|
+
mapResponse: a,
|
|
2006
2863
|
client: i,
|
|
2007
|
-
enabled:
|
|
2864
|
+
enabled: l,
|
|
2008
2865
|
...c
|
|
2009
2866
|
}) {
|
|
2010
|
-
const { state: s, items: d, error: u } =
|
|
2867
|
+
const { state: s, items: d, error: u } = ue({
|
|
2011
2868
|
client: i,
|
|
2012
2869
|
url: e,
|
|
2013
|
-
params:
|
|
2014
|
-
enabled:
|
|
2015
|
-
mapResponse: (m) => (
|
|
2016
|
-
}),
|
|
2017
|
-
return /* @__PURE__ */
|
|
2870
|
+
params: r,
|
|
2871
|
+
enabled: l,
|
|
2872
|
+
mapResponse: (m) => (a ? a(m) : me(m)).map((k) => Se(k, n, t))
|
|
2873
|
+
}), f = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
|
|
2874
|
+
return /* @__PURE__ */ o(Cr, { ...c, options: d, loading: s === "loading", error: f });
|
|
2018
2875
|
}
|
|
2019
|
-
function
|
|
2876
|
+
function qt({
|
|
2020
2877
|
url: e,
|
|
2021
|
-
params:
|
|
2022
|
-
valueMember:
|
|
2023
|
-
displayMember:
|
|
2024
|
-
mapResponse:
|
|
2878
|
+
params: r,
|
|
2879
|
+
valueMember: n,
|
|
2880
|
+
displayMember: t,
|
|
2881
|
+
mapResponse: a,
|
|
2025
2882
|
client: i,
|
|
2026
|
-
enabled:
|
|
2883
|
+
enabled: l,
|
|
2027
2884
|
...c
|
|
2028
2885
|
}) {
|
|
2029
|
-
const { state: s, items: d, error: u } =
|
|
2886
|
+
const { state: s, items: d, error: u } = ue({
|
|
2030
2887
|
client: i,
|
|
2031
2888
|
url: e,
|
|
2032
|
-
params:
|
|
2033
|
-
enabled:
|
|
2034
|
-
mapResponse: (m) => (
|
|
2035
|
-
}),
|
|
2036
|
-
return /* @__PURE__ */
|
|
2037
|
-
}
|
|
2038
|
-
function
|
|
2039
|
-
const e = /* @__PURE__ */ new Map(),
|
|
2889
|
+
params: r,
|
|
2890
|
+
enabled: l,
|
|
2891
|
+
mapResponse: (m) => (a ? a(m) : me(m)).map((k) => Se(k, n, t))
|
|
2892
|
+
}), f = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
|
|
2893
|
+
return /* @__PURE__ */ o(Ir, { ...c, options: d, loading: s === "loading", error: f });
|
|
2894
|
+
}
|
|
2895
|
+
function zt() {
|
|
2896
|
+
const e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
2040
2897
|
return {
|
|
2041
|
-
register(
|
|
2042
|
-
e.set(
|
|
2898
|
+
register(n, t) {
|
|
2899
|
+
e.set(n, t);
|
|
2043
2900
|
},
|
|
2044
|
-
resolve(
|
|
2045
|
-
const
|
|
2046
|
-
return
|
|
2047
|
-
`Smart: no resolver registered for component "${
|
|
2901
|
+
resolve(n, t) {
|
|
2902
|
+
const a = e.get(n.component);
|
|
2903
|
+
return a ? a(n, t) : (r.has(n.component) || (r.add(n.component), console.warn(
|
|
2904
|
+
`Smart: no resolver registered for component "${n.component}" (field "${n.name}"). Skipping.`
|
|
2048
2905
|
)), null);
|
|
2049
2906
|
},
|
|
2050
|
-
has(
|
|
2051
|
-
return e.has(
|
|
2907
|
+
has(n) {
|
|
2908
|
+
return e.has(n);
|
|
2052
2909
|
}
|
|
2053
2910
|
};
|
|
2054
2911
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const
|
|
2912
|
+
function Wt(e) {
|
|
2913
|
+
const r = new Map(Object.entries(e ?? {}));
|
|
2057
2914
|
return {
|
|
2058
|
-
register(
|
|
2059
|
-
|
|
2915
|
+
register(n, t) {
|
|
2916
|
+
r.set(n, t);
|
|
2060
2917
|
},
|
|
2061
|
-
resolve(
|
|
2062
|
-
return
|
|
2918
|
+
resolve(n) {
|
|
2919
|
+
return r.get(n);
|
|
2063
2920
|
}
|
|
2064
2921
|
};
|
|
2065
2922
|
}
|
|
2066
|
-
function
|
|
2923
|
+
function Gt() {
|
|
2067
2924
|
const e = /* @__PURE__ */ new Map();
|
|
2068
2925
|
return {
|
|
2069
|
-
register(
|
|
2070
|
-
e.set(
|
|
2926
|
+
register(r, n) {
|
|
2927
|
+
e.set(r, n);
|
|
2071
2928
|
},
|
|
2072
|
-
resolve(
|
|
2073
|
-
return e.get(
|
|
2929
|
+
resolve(r) {
|
|
2930
|
+
return e.get(r);
|
|
2074
2931
|
}
|
|
2075
2932
|
};
|
|
2076
2933
|
}
|
|
2077
|
-
function
|
|
2934
|
+
function Fn(e) {
|
|
2078
2935
|
return "dataSource" in e;
|
|
2079
2936
|
}
|
|
2080
|
-
function
|
|
2937
|
+
function Hn(e, r) {
|
|
2081
2938
|
if (!e)
|
|
2082
2939
|
return;
|
|
2083
|
-
const
|
|
2084
|
-
for (const [
|
|
2085
|
-
t
|
|
2086
|
-
return
|
|
2940
|
+
const n = {};
|
|
2941
|
+
for (const [t, a] of Object.entries(e))
|
|
2942
|
+
n[t] = a.kind === "static" ? a.value : r[a.field];
|
|
2943
|
+
return n;
|
|
2087
2944
|
}
|
|
2088
|
-
function
|
|
2089
|
-
return
|
|
2945
|
+
function Qe(e, r, n) {
|
|
2946
|
+
return r && n ? n(r) : e;
|
|
2090
2947
|
}
|
|
2091
|
-
function
|
|
2092
|
-
const { values:
|
|
2948
|
+
function fe(e, r) {
|
|
2949
|
+
const { values: n, translate: t } = r;
|
|
2093
2950
|
return {
|
|
2094
2951
|
metadata: e,
|
|
2095
2952
|
visible: e.visible ?? !0,
|
|
2096
2953
|
readOnly: e.readOnly ?? !1,
|
|
2097
2954
|
disabled: e.disabled ?? !1,
|
|
2098
2955
|
required: e.required ?? !1,
|
|
2099
|
-
label:
|
|
2956
|
+
label: Qe(e.label, e.labelKey, t),
|
|
2100
2957
|
placeholder: e.placeholder,
|
|
2101
2958
|
helpText: e.helpText,
|
|
2102
|
-
validationMessage:
|
|
2103
|
-
params:
|
|
2959
|
+
validationMessage: Qe(e.validationMessage, e.validationMessageKey, t),
|
|
2960
|
+
params: Fn(e) ? Hn(e.dataSource.params, n) : void 0
|
|
2104
2961
|
};
|
|
2105
2962
|
}
|
|
2106
|
-
function
|
|
2107
|
-
const
|
|
2108
|
-
if (
|
|
2109
|
-
return
|
|
2110
|
-
}
|
|
2111
|
-
const
|
|
2112
|
-
function
|
|
2113
|
-
const
|
|
2114
|
-
for (const
|
|
2115
|
-
t
|
|
2116
|
-
return
|
|
2117
|
-
}
|
|
2118
|
-
function
|
|
2119
|
-
const
|
|
2120
|
-
c.current =
|
|
2963
|
+
function Jt(e, r, n) {
|
|
2964
|
+
const t = r == null ? void 0 : r.fields.find((a) => a.name === e);
|
|
2965
|
+
if (t)
|
|
2966
|
+
return fe(t, n);
|
|
2967
|
+
}
|
|
2968
|
+
const jn = [];
|
|
2969
|
+
function Un(e, r) {
|
|
2970
|
+
const n = {};
|
|
2971
|
+
for (const t of r)
|
|
2972
|
+
n[t] = e[t];
|
|
2973
|
+
return n;
|
|
2974
|
+
}
|
|
2975
|
+
function qn(e, r, n) {
|
|
2976
|
+
const t = e ?? jn, a = Un(r, t), i = t.length === 0 ? "" : JSON.stringify(a), l = L(null), c = L(n);
|
|
2977
|
+
c.current = n, U(() => {
|
|
2121
2978
|
var d;
|
|
2122
|
-
if (
|
|
2979
|
+
if (t.length === 0)
|
|
2123
2980
|
return;
|
|
2124
|
-
const s =
|
|
2981
|
+
const s = l.current;
|
|
2125
2982
|
if (s && s.key !== i)
|
|
2126
|
-
for (const u of
|
|
2127
|
-
Object.is(s.snapshot[u],
|
|
2128
|
-
|
|
2983
|
+
for (const u of t)
|
|
2984
|
+
Object.is(s.snapshot[u], a[u]) || (d = c.current) == null || d.call(c, u);
|
|
2985
|
+
l.current = { key: i, snapshot: a };
|
|
2129
2986
|
}, [i]);
|
|
2130
2987
|
}
|
|
2131
|
-
function
|
|
2132
|
-
const { actions:
|
|
2988
|
+
function yr(e, r) {
|
|
2989
|
+
const { actions: n, translate: t } = r, a = n.resolve(e.id);
|
|
2133
2990
|
return {
|
|
2134
2991
|
metadata: e,
|
|
2135
2992
|
visible: e.visible ?? !0,
|
|
2136
|
-
enabled: (e.enabled ?? !0) && !!
|
|
2137
|
-
label: e.labelKey &&
|
|
2138
|
-
handler:
|
|
2993
|
+
enabled: (e.enabled ?? !0) && !!a,
|
|
2994
|
+
label: e.labelKey && t ? t(e.labelKey) : e.label,
|
|
2995
|
+
handler: a
|
|
2139
2996
|
};
|
|
2140
2997
|
}
|
|
2141
|
-
function
|
|
2142
|
-
var
|
|
2143
|
-
const
|
|
2144
|
-
if (
|
|
2145
|
-
return
|
|
2998
|
+
function Zt(e, r, n) {
|
|
2999
|
+
var a;
|
|
3000
|
+
const t = (a = r == null ? void 0 : r.actions) == null ? void 0 : a.find((i) => i.id === e);
|
|
3001
|
+
if (t)
|
|
3002
|
+
return yr(t, n);
|
|
2146
3003
|
}
|
|
2147
|
-
const
|
|
2148
|
-
const
|
|
2149
|
-
if (!
|
|
3004
|
+
const zn = (e, r) => {
|
|
3005
|
+
const n = fe(e, { values: r.values, translate: r.translate });
|
|
3006
|
+
if (!n.visible)
|
|
2150
3007
|
return null;
|
|
2151
|
-
const
|
|
2152
|
-
return
|
|
2153
|
-
|
|
3008
|
+
const t = r.dataSources.resolve(e.dataSource.id);
|
|
3009
|
+
return t ? /* @__PURE__ */ o(
|
|
3010
|
+
Kn,
|
|
2154
3011
|
{
|
|
2155
|
-
label:
|
|
2156
|
-
url:
|
|
2157
|
-
client:
|
|
2158
|
-
params:
|
|
3012
|
+
label: n.label,
|
|
3013
|
+
url: t.url,
|
|
3014
|
+
client: t.client,
|
|
3015
|
+
params: n.params,
|
|
2159
3016
|
valueMember: e.valueMember,
|
|
2160
3017
|
displayMember: e.displayMember,
|
|
2161
|
-
required:
|
|
2162
|
-
readOnly:
|
|
2163
|
-
disabled:
|
|
2164
|
-
helpText:
|
|
2165
|
-
error:
|
|
2166
|
-
value:
|
|
2167
|
-
onChange: (
|
|
3018
|
+
required: n.required,
|
|
3019
|
+
readOnly: n.readOnly,
|
|
3020
|
+
disabled: n.disabled,
|
|
3021
|
+
helpText: n.helpText,
|
|
3022
|
+
error: n.validationMessage,
|
|
3023
|
+
value: r.values[e.name] ?? null,
|
|
3024
|
+
onChange: (a) => r.onFieldChange(e.name, a)
|
|
2168
3025
|
}
|
|
2169
3026
|
) : (console.warn(`Smart: no data source registered for id "${e.dataSource.id}" (field "${e.name}"). Skipping.`), null);
|
|
2170
3027
|
};
|
|
2171
|
-
function
|
|
3028
|
+
function Wn(e, r) {
|
|
2172
3029
|
if (e.visible === !1)
|
|
2173
3030
|
return null;
|
|
2174
|
-
const
|
|
3031
|
+
const n = e.headerKey && r ? r(e.headerKey) : e.header ?? e.key, t = e.format === "boolean" && !!r;
|
|
2175
3032
|
return {
|
|
2176
3033
|
key: e.key,
|
|
2177
|
-
header:
|
|
3034
|
+
header: n,
|
|
2178
3035
|
sortable: e.sortable,
|
|
2179
|
-
format:
|
|
2180
|
-
formatter:
|
|
3036
|
+
format: t ? void 0 : e.format,
|
|
3037
|
+
formatter: t ? (a) => r(a ? "smart.boolean.true" : "smart.boolean.false") : void 0
|
|
2181
3038
|
};
|
|
2182
3039
|
}
|
|
2183
|
-
const
|
|
2184
|
-
const
|
|
2185
|
-
if (!
|
|
3040
|
+
const Gn = (e, r) => {
|
|
3041
|
+
const n = fe(e, { values: r.values, translate: r.translate });
|
|
3042
|
+
if (!n.visible)
|
|
2186
3043
|
return null;
|
|
2187
|
-
const
|
|
2188
|
-
if (!
|
|
3044
|
+
const t = r.dataSources.resolve(e.dataSource.id);
|
|
3045
|
+
if (!t)
|
|
2189
3046
|
return console.warn(`Smart: no data source registered for id "${e.dataSource.id}" (field "${e.name}"). Skipping.`), null;
|
|
2190
|
-
const
|
|
3047
|
+
const a = e.columns.map((c) => Wn(c, r.translate)).filter((c) => c !== null), i = e.totalCountField, l = i ? (c) => {
|
|
2191
3048
|
const s = c == null ? void 0 : c[i];
|
|
2192
3049
|
return typeof s == "number" ? s : void 0;
|
|
2193
3050
|
} : void 0;
|
|
2194
|
-
return /* @__PURE__ */
|
|
2195
|
-
|
|
3051
|
+
return /* @__PURE__ */ o(
|
|
3052
|
+
Bn,
|
|
2196
3053
|
{
|
|
2197
|
-
url:
|
|
2198
|
-
client:
|
|
2199
|
-
params:
|
|
2200
|
-
columns:
|
|
3054
|
+
url: t.url,
|
|
3055
|
+
client: t.client,
|
|
3056
|
+
params: n.params,
|
|
3057
|
+
columns: a,
|
|
2201
3058
|
rowKey: (c) => c[e.rowKey],
|
|
2202
|
-
getTotalCount:
|
|
3059
|
+
getTotalCount: l
|
|
2203
3060
|
}
|
|
2204
3061
|
);
|
|
2205
3062
|
};
|
|
2206
|
-
function
|
|
3063
|
+
function Xe(e) {
|
|
2207
3064
|
if (!e)
|
|
2208
3065
|
return;
|
|
2209
|
-
const
|
|
2210
|
-
return Number.isNaN(
|
|
3066
|
+
const r = new Date(e);
|
|
3067
|
+
return Number.isNaN(r.getTime()) ? void 0 : r;
|
|
2211
3068
|
}
|
|
2212
|
-
const
|
|
2213
|
-
const
|
|
2214
|
-
return
|
|
2215
|
-
|
|
3069
|
+
const Jn = (e, r) => {
|
|
3070
|
+
const n = fe(e, { values: r.values, translate: r.translate });
|
|
3071
|
+
return n.visible ? /* @__PURE__ */ o(
|
|
3072
|
+
Er,
|
|
2216
3073
|
{
|
|
2217
|
-
label:
|
|
2218
|
-
required:
|
|
2219
|
-
readOnly:
|
|
2220
|
-
disabled:
|
|
2221
|
-
helpText:
|
|
2222
|
-
error:
|
|
2223
|
-
min:
|
|
2224
|
-
max:
|
|
2225
|
-
value:
|
|
2226
|
-
onChange: (
|
|
3074
|
+
label: n.label,
|
|
3075
|
+
required: n.required,
|
|
3076
|
+
readOnly: n.readOnly,
|
|
3077
|
+
disabled: n.disabled,
|
|
3078
|
+
helpText: n.helpText,
|
|
3079
|
+
error: n.validationMessage,
|
|
3080
|
+
min: Xe(e.minDate),
|
|
3081
|
+
max: Xe(e.maxDate),
|
|
3082
|
+
value: r.values[e.name] ?? null,
|
|
3083
|
+
onChange: (t) => r.onFieldChange(e.name, t)
|
|
2227
3084
|
}
|
|
2228
3085
|
) : null;
|
|
2229
|
-
},
|
|
2230
|
-
const
|
|
2231
|
-
return
|
|
2232
|
-
|
|
3086
|
+
}, Zn = (e, r) => {
|
|
3087
|
+
const n = fe(e, { values: r.values, translate: r.translate });
|
|
3088
|
+
return n.visible ? /* @__PURE__ */ o(
|
|
3089
|
+
de,
|
|
2233
3090
|
{
|
|
2234
|
-
label:
|
|
2235
|
-
required:
|
|
2236
|
-
readOnly:
|
|
2237
|
-
disabled:
|
|
2238
|
-
helpText:
|
|
2239
|
-
placeholder:
|
|
2240
|
-
error:
|
|
3091
|
+
label: n.label,
|
|
3092
|
+
required: n.required,
|
|
3093
|
+
readOnly: n.readOnly,
|
|
3094
|
+
disabled: n.disabled,
|
|
3095
|
+
helpText: n.helpText,
|
|
3096
|
+
placeholder: n.placeholder,
|
|
3097
|
+
error: n.validationMessage,
|
|
2241
3098
|
maxLength: e.maxLength,
|
|
2242
|
-
value:
|
|
2243
|
-
onChange: (
|
|
3099
|
+
value: r.values[e.name] ?? "",
|
|
3100
|
+
onChange: (t) => r.onFieldChange(e.name, t)
|
|
2244
3101
|
}
|
|
2245
3102
|
) : null;
|
|
2246
3103
|
};
|
|
2247
|
-
function
|
|
2248
|
-
e.register("Input",
|
|
3104
|
+
function Yt(e) {
|
|
3105
|
+
e.register("Input", Zn), e.register("ComboBox", zn), e.register("DatePicker", Jn), e.register("DataGrid", Gn);
|
|
2249
3106
|
}
|
|
2250
|
-
function
|
|
2251
|
-
const
|
|
2252
|
-
return
|
|
3107
|
+
function Yn({ metadata: e, ctx: r }) {
|
|
3108
|
+
const n = r.onMetadataRefreshNeeded;
|
|
3109
|
+
return qn(
|
|
2253
3110
|
e.dependsOn,
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
), e.visible === !1 ? null :
|
|
3111
|
+
r.values,
|
|
3112
|
+
n ? (t) => n(e.name, t) : void 0
|
|
3113
|
+
), e.visible === !1 ? null : r.registry.resolve(e, r);
|
|
2257
3114
|
}
|
|
2258
|
-
const
|
|
2259
|
-
function
|
|
2260
|
-
const
|
|
2261
|
-
return Number.isFinite(
|
|
3115
|
+
const Nr = 1;
|
|
3116
|
+
function Qn(e) {
|
|
3117
|
+
const r = Number(e.split(".")[0]);
|
|
3118
|
+
return Number.isFinite(r) && r === Nr;
|
|
2262
3119
|
}
|
|
2263
|
-
function
|
|
2264
|
-
return
|
|
3120
|
+
function Qt({ metadata: e, ctx: r }) {
|
|
3121
|
+
return Qn(e.schemaVersion) ? /* @__PURE__ */ o(Q, { children: e.fields.map((n) => /* @__PURE__ */ o(Yn, { metadata: n, ctx: r }, n.name)) }) : /* @__PURE__ */ y(or, { variant: "danger", children: [
|
|
2265
3122
|
'Unsupported form schema version "',
|
|
2266
3123
|
e.schemaVersion,
|
|
2267
3124
|
'" — this app understands schema version ',
|
|
2268
|
-
|
|
3125
|
+
Nr,
|
|
2269
3126
|
".x."
|
|
2270
3127
|
] });
|
|
2271
3128
|
}
|
|
2272
|
-
function
|
|
2273
|
-
const
|
|
2274
|
-
return
|
|
2275
|
-
var
|
|
2276
|
-
return (
|
|
2277
|
-
}, children:
|
|
3129
|
+
function Xn({ metadata: e, ctx: r }) {
|
|
3130
|
+
const n = yr(e, r);
|
|
3131
|
+
return n.visible ? /* @__PURE__ */ o(ke, { disabled: !n.enabled, onClick: () => {
|
|
3132
|
+
var t;
|
|
3133
|
+
return (t = n.handler) == null ? void 0 : t.call(n);
|
|
3134
|
+
}, children: n.label ?? e.id }) : null;
|
|
2278
3135
|
}
|
|
2279
|
-
function
|
|
2280
|
-
return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */
|
|
3136
|
+
function Xt({ metadata: e, ctx: r }) {
|
|
3137
|
+
return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */ o(Q, { children: e.actions.map((n) => /* @__PURE__ */ o(Xn, { metadata: n, ctx: r }, n.id)) });
|
|
2281
3138
|
}
|
|
2282
3139
|
export {
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
3140
|
+
vt as Accordion,
|
|
3141
|
+
or as Alert,
|
|
3142
|
+
Ht as AppearanceMenu,
|
|
3143
|
+
Vt as AppearanceProvider,
|
|
3144
|
+
Tr as AutoComplete,
|
|
3145
|
+
St as Avatar,
|
|
3146
|
+
Hr as Badge,
|
|
3147
|
+
Yr as Breadcrumb,
|
|
3148
|
+
ke as Button,
|
|
3149
|
+
dr as COLOR_SCHEME_TOKEN_KEYS,
|
|
3150
|
+
yt as Card,
|
|
3151
|
+
it as CheckBox,
|
|
3152
|
+
wt as Col,
|
|
3153
|
+
Ar as ComboBox,
|
|
3154
|
+
ht as ConfirmProvider,
|
|
3155
|
+
Nt as Container,
|
|
3156
|
+
Re as DEFAULT_COLOR_SCHEME_ID,
|
|
3157
|
+
Kr as DataGrid,
|
|
3158
|
+
Er as DatePicker,
|
|
3159
|
+
dt as DateTimePicker,
|
|
3160
|
+
Zr as Divider,
|
|
3161
|
+
ot as FileInput,
|
|
3162
|
+
Mt as Flex,
|
|
3163
|
+
ut as FormField,
|
|
3164
|
+
Ln as HttpError,
|
|
3165
|
+
Le as Icon,
|
|
3166
|
+
Pt as IconButton,
|
|
3167
|
+
de as Input,
|
|
3168
|
+
xr as Label,
|
|
3169
|
+
Kt as ListItem,
|
|
3170
|
+
_t as Menu,
|
|
3171
|
+
Vr as Modal,
|
|
3172
|
+
Ir as MultiSelect,
|
|
3173
|
+
Dt as Navbar,
|
|
3174
|
+
tt as NumberInput,
|
|
3175
|
+
Ot as PageHeader,
|
|
3176
|
+
Rr as Pagination,
|
|
3177
|
+
at as PasswordInput,
|
|
3178
|
+
gt as Popover,
|
|
3179
|
+
oe as Popup,
|
|
3180
|
+
At as ProgressBar,
|
|
3181
|
+
Sr as RadioButton,
|
|
3182
|
+
st as RadioGroup,
|
|
3183
|
+
Et as Rating,
|
|
3184
|
+
jt as RemoteAutoComplete,
|
|
3185
|
+
Kn as RemoteComboBox,
|
|
3186
|
+
Bn as RemoteDataGrid,
|
|
3187
|
+
qt as RemoteMultiSelect,
|
|
3188
|
+
Ut as RemoteSelect,
|
|
3189
|
+
kt as Row,
|
|
3190
|
+
mr as SIDEBAR_PRESENTATIONS,
|
|
3191
|
+
fr as SIDEBAR_TONES,
|
|
3192
|
+
Cr as Select,
|
|
3193
|
+
$t as Sidebar,
|
|
3194
|
+
ye as Skeleton,
|
|
3195
|
+
It as Slider,
|
|
3196
|
+
Xn as SmartAction,
|
|
3197
|
+
Xt as SmartActions,
|
|
3198
|
+
Yn as SmartField,
|
|
3199
|
+
Qt as SmartForm,
|
|
3200
|
+
Bt as Sparkline,
|
|
3201
|
+
Br as Spinner,
|
|
3202
|
+
cr as Stack,
|
|
3203
|
+
Ft as Statistic,
|
|
3204
|
+
xt as Stepper,
|
|
3205
|
+
lt as Switch,
|
|
3206
|
+
ur as THEME_MODES,
|
|
3207
|
+
bt as Tabs,
|
|
3208
|
+
Ct as Tag,
|
|
3209
|
+
te as Text,
|
|
3210
|
+
nt as TextArea,
|
|
3211
|
+
ct as TimePicker,
|
|
3212
|
+
mt as ToastProvider,
|
|
3213
|
+
sr as Tooltip,
|
|
3214
|
+
er as ValidationMessage,
|
|
3215
|
+
on as colorSchemeCssVariables,
|
|
3216
|
+
zn as comboBoxResolver,
|
|
3217
|
+
Rt as createAppearanceInitScript,
|
|
3218
|
+
ve as createColorScheme,
|
|
3219
|
+
$n as createHttpClient,
|
|
3220
|
+
Gt as createSmartActionRegistry,
|
|
3221
|
+
zt as createSmartComponentRegistry,
|
|
3222
|
+
Wt as createSmartDataSourceRegistry,
|
|
3223
|
+
$r as dataGridFormatters,
|
|
3224
|
+
Gn as dataGridResolver,
|
|
3225
|
+
Jn as datePickerResolver,
|
|
3226
|
+
me as defaultArrayNormalization,
|
|
3227
|
+
On as defaultHttpClient,
|
|
3228
|
+
nr as fromDateInputValue,
|
|
3229
|
+
ar as fromTimeInputValue,
|
|
3230
|
+
nn as getColorScheme,
|
|
3231
|
+
Zn as inputResolver,
|
|
3232
|
+
pr as isSidebarExpandable,
|
|
3233
|
+
un as isSidebarParent,
|
|
3234
|
+
en as isValidColorScheme,
|
|
3235
|
+
pn as legacyActiveKey,
|
|
3236
|
+
hn as legacyDefaultExpandedKeys,
|
|
3237
|
+
tn as listColorSchemes,
|
|
3238
|
+
Yt as registerBuiltInResolvers,
|
|
3239
|
+
Tt as registerColorScheme,
|
|
3240
|
+
an as resolveColorScheme,
|
|
3241
|
+
yr as resolveSmartActionMetadata,
|
|
3242
|
+
fe as resolveSmartFieldMetadata,
|
|
3243
|
+
ae as toDateInputValue,
|
|
3244
|
+
Se as toSelectOption,
|
|
3245
|
+
mn as toSidebarItems,
|
|
3246
|
+
tr as toTimeInputValue,
|
|
3247
|
+
Lt as useAppearance,
|
|
3248
|
+
pt as useConfirm,
|
|
3249
|
+
Pn as useDebouncedValue,
|
|
3250
|
+
ue as useRemoteData,
|
|
3251
|
+
Zt as useSmartAction,
|
|
3252
|
+
qn as useSmartDependencies,
|
|
3253
|
+
Jt as useSmartField,
|
|
3254
|
+
ft as useToast
|
|
2377
3255
|
};
|
|
2378
3256
|
//# sourceMappingURL=index.js.map
|