@abyss-project/commons-front-core 18.1.4 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/catalog/specs/markdown-editor.spec.ts +13 -0
- package/dist/{CookieConsentSettings-D97TY138.js → CookieConsentSettings-C22e74pq.js} +1 -1
- package/dist/{Surface-CN1zQYLJ.js → Surface-54j_wWRk.js} +2 -2
- package/dist/{Tabs-CxD9y18t.js → Tabs-D8h_6Ehv.js} +672 -665
- package/dist/components/data/DataTable/DataTableDesktop.d.ts +1 -1
- package/dist/components/data/DataTable/data-table.types.d.ts +5 -0
- package/dist/components/data/FacetPanel/FacetPanel.d.ts +3 -0
- package/dist/components/inputs/SegmentedControl/SegmentedControl.d.ts +8 -2
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-GGVSCauN.js → design-theme-F3TviTyp.js} +1 -1
- package/dist/{editors-CJ_6PXoL.js → editors-BvzrUh0u.js} +30836 -30826
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +8 -16
- package/dist/{index-BcsTtdwQ.js → index-BAcL0gZM.js} +4 -4
- package/dist/{index-ByRUmH_4.js → index-BCKWga5S.js} +3 -3
- package/dist/{index-BQFouU9U.js → index-BZthWcJ5.js} +2 -2
- package/dist/{index-B6QYagVk.js → index-BlvA6Lxv.js} +2 -2
- package/dist/{index-Drwqi2Fr.js → index-BnIrh2JM.js} +2 -2
- package/dist/{index-p3G-JM7E.js → index-CP9wCW4Z.js} +3 -3
- package/dist/{index-4MsOXuOU.js → index-CXSxZiqU.js} +2 -2
- package/dist/{index-7M2xC_9h.js → index-CeuzZh-h.js} +2 -2
- package/dist/{index-Dtfo8fKg.js → index-ChFskeZj.js} +4 -4
- package/dist/{index-CXUHmTse.js → index-Co1Gxp6L.js} +2 -2
- package/dist/{index-Cl1UafyM.js → index-Cxvpt5Rk.js} +2 -2
- package/dist/{index-5HFSSrP-.js → index-CzBp_cay.js} +1 -1
- package/dist/{index-Berc0QsZ.js → index-DArDCeHJ.js} +4 -4
- package/dist/{index-BbbyRlLu.js → index-DXzb3gco.js} +2 -2
- package/dist/{index-BQLAeM_n.js → index-DhSyqz6f.js} +2 -2
- package/dist/{index-Dh1lFi8d.js → index-DhYE_E7U.js} +2 -2
- package/dist/{index-Bbc0SjAt.js → index-DkqoRb8_.js} +2 -2
- package/dist/{index-8o9jiKS2.js → index-DlREX3RV.js} +2 -2
- package/dist/{index-VLxkKEWK.js → index-DyR6n35f.js} +3 -3
- package/dist/{index-5BCfqxIs.js → index-VOYH3T8l.js} +2 -2
- package/dist/{index-DQgpUR1S.js → index-qfXRn5GL.js} +3 -3
- package/dist/index.js +4304 -4252
- package/dist/latex-DMur4Nmq.js +4 -0
- package/dist/legacy/components/Chips/index.d.ts +0 -2
- package/dist/legacy.js +1235 -1258
- package/package.json +5 -5
- package/dist/legacy/components/Chips/ApplicationWebhookTypeChip/ApplicationWebhookTypeChip.component.d.ts +0 -7
- package/dist/legacy/components/Chips/ApplicationWebhookTypeChip/index.d.ts +0 -1
- package/dist/legacy/components/Chips/WebhookTypeChip/WebhookTypeChip.component.d.ts +0 -7
- package/dist/legacy/components/Chips/WebhookTypeChip/index.d.ts +0 -1
- package/test-results/catalog/.last-run.json +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as C, jsx as i, Fragment as J } from "react/jsx-runtime";
|
|
2
2
|
import { useId as N, cloneElement as mn, useState as F, useMemo as ge, useRef as X, useCallback as Q, useEffect as V, createContext as ze, useContext as Ae, useLayoutEffect as Le } from "react";
|
|
3
3
|
import le from "@mui/material/FormControl";
|
|
4
4
|
import se from "@mui/material/FormHelperText";
|
|
@@ -8,7 +8,7 @@ import hn from "@mui/material/Select";
|
|
|
8
8
|
import { styled as l, useTheme as bn, getContrastRatio as ke } from "@mui/material/styles";
|
|
9
9
|
import { visuallyHidden as fe } from "@mui/utils";
|
|
10
10
|
import { useIntl as P } from "react-intl";
|
|
11
|
-
import { a as A, p as o, h as D, d as Z, D as K, g as yn, t as De, s as de, i as oe, j as te, c as Pe, e as He, k as vn, B as wn } from "./Surface-
|
|
11
|
+
import { a as A, p as o, h as D, d as Z, D as K, g as yn, t as De, s as de, i as oe, j as te, c as Pe, e as He, k as vn, B as wn } from "./Surface-54j_wWRk.js";
|
|
12
12
|
import { i as xn, b as Cn, r as kn, u as Sn, A as In, E as Fn } from "./index-C27b790L.js";
|
|
13
13
|
import Y from "@mui/material/Button";
|
|
14
14
|
import { byteSizeIEC as Wn } from "@abyss-project/main";
|
|
@@ -55,21 +55,21 @@ const Yn = l(Gn)(({ theme: e }) => ({
|
|
|
55
55
|
}));
|
|
56
56
|
function Ve({
|
|
57
57
|
label: e,
|
|
58
|
-
help:
|
|
59
|
-
error:
|
|
58
|
+
help: t,
|
|
59
|
+
error: n,
|
|
60
60
|
required: r = !1,
|
|
61
|
-
children:
|
|
61
|
+
children: a
|
|
62
62
|
}) {
|
|
63
|
-
const
|
|
64
|
-
id:
|
|
65
|
-
"aria-describedby":
|
|
66
|
-
...Kn(
|
|
63
|
+
const u = N(), s = a.props.id ?? u, d = `${s}-label`, g = t !== void 0 ? `${s}-help` : void 0, h = n != null && n !== !1 && n !== "", b = h && n !== !0, m = b ? `${s}-error` : void 0, f = [a.props["aria-describedby"], g, m].filter((c) => c !== void 0 && c !== "").join(" ") || void 0, w = mn(a, {
|
|
64
|
+
id: s,
|
|
65
|
+
"aria-describedby": f,
|
|
66
|
+
...Kn(a, ["Select"]) && { labelId: d }
|
|
67
67
|
});
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ i(Yn, { id:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
return /* @__PURE__ */ C(le, { fullWidth: !0, error: h, required: r, children: [
|
|
69
|
+
/* @__PURE__ */ i(Yn, { id: d, htmlFor: s, children: e }),
|
|
70
|
+
w,
|
|
71
|
+
t !== void 0 && /* @__PURE__ */ i(se, { id: g, error: !1, children: t }),
|
|
72
|
+
b && /* @__PURE__ */ i(se, { id: m, children: n })
|
|
73
73
|
] });
|
|
74
74
|
}
|
|
75
75
|
var je = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Danger = "danger", e))(je || {});
|
|
@@ -94,8 +94,8 @@ const Ge = {
|
|
|
94
94
|
danger: Ln
|
|
95
95
|
}, Zn = l("div", {
|
|
96
96
|
shouldForwardProp: (e) => e !== "severity"
|
|
97
|
-
})(({ theme: e, severity:
|
|
98
|
-
const { tokens:
|
|
97
|
+
})(({ theme: e, severity: t }) => {
|
|
98
|
+
const { tokens: n, space: r, radii: a, fonts: u, typeScale: s } = e.design, { solid: d, soft: g } = Ge[t];
|
|
99
99
|
return {
|
|
100
100
|
display: "flex",
|
|
101
101
|
alignItems: "flex-start",
|
|
@@ -103,23 +103,23 @@ const Ge = {
|
|
|
103
103
|
minWidth: 0,
|
|
104
104
|
boxSizing: "border-box",
|
|
105
105
|
padding: `${o(r[3])} ${o(r[3])} ${o(r[3])} ${o(r[4])}`,
|
|
106
|
-
backgroundColor:
|
|
107
|
-
border: D(
|
|
108
|
-
borderRadius: o(
|
|
109
|
-
color:
|
|
110
|
-
fontFamily:
|
|
111
|
-
fontSize: o(
|
|
106
|
+
backgroundColor: n[g],
|
|
107
|
+
border: D(n[d]),
|
|
108
|
+
borderRadius: o(a.md),
|
|
109
|
+
color: n["text.primary"],
|
|
110
|
+
fontFamily: u.sans,
|
|
111
|
+
fontSize: o(s.body)
|
|
112
112
|
};
|
|
113
113
|
}), Jn = l("span", {
|
|
114
114
|
shouldForwardProp: (e) => e !== "severity"
|
|
115
|
-
})(({ theme: e, severity:
|
|
116
|
-
const { tokens:
|
|
115
|
+
})(({ theme: e, severity: t }) => {
|
|
116
|
+
const { tokens: n, space: r } = e.design;
|
|
117
117
|
return {
|
|
118
118
|
display: "inline-flex",
|
|
119
119
|
flex: "none",
|
|
120
120
|
// Centered on the first line of text.
|
|
121
121
|
paddingTop: o(r[1] / 2),
|
|
122
|
-
color:
|
|
122
|
+
color: n[Ge[t].solid],
|
|
123
123
|
"& svg": {
|
|
124
124
|
width: o(r[4] + r[1]),
|
|
125
125
|
height: o(r[4] + r[1])
|
|
@@ -164,35 +164,35 @@ const Ge = {
|
|
|
164
164
|
}), it = l(ae)(({ theme: e }) => yn(e));
|
|
165
165
|
function st({
|
|
166
166
|
severity: e,
|
|
167
|
-
title:
|
|
168
|
-
children:
|
|
167
|
+
title: t,
|
|
168
|
+
children: n,
|
|
169
169
|
action: r,
|
|
170
|
-
onClose:
|
|
171
|
-
icon:
|
|
170
|
+
onClose: a,
|
|
171
|
+
icon: u
|
|
172
172
|
}) {
|
|
173
|
-
const
|
|
174
|
-
return /* @__PURE__ */
|
|
173
|
+
const s = P(), d = N(), g = Qn[e];
|
|
174
|
+
return /* @__PURE__ */ C(
|
|
175
175
|
Zn,
|
|
176
176
|
{
|
|
177
177
|
severity: e,
|
|
178
178
|
role: e === "danger" ? "alert" : "status",
|
|
179
|
-
"aria-labelledby":
|
|
179
|
+
"aria-labelledby": t !== void 0 ? d : void 0,
|
|
180
180
|
"data-severity": e,
|
|
181
181
|
children: [
|
|
182
|
-
/* @__PURE__ */ i(Jn, { severity: e, "aria-hidden": !0, children:
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
|
|
186
|
-
/* @__PURE__ */ i(tt, { children:
|
|
182
|
+
/* @__PURE__ */ i(Jn, { severity: e, "aria-hidden": !0, children: u ?? /* @__PURE__ */ i(g, {}) }),
|
|
183
|
+
/* @__PURE__ */ C(et, { children: [
|
|
184
|
+
/* @__PURE__ */ C(nt, { children: [
|
|
185
|
+
t !== void 0 && /* @__PURE__ */ i(ot, { id: d, children: t }),
|
|
186
|
+
/* @__PURE__ */ i(tt, { children: n })
|
|
187
187
|
] }),
|
|
188
188
|
r !== void 0 && /* @__PURE__ */ i(rt, { children: r })
|
|
189
189
|
] }),
|
|
190
|
-
|
|
190
|
+
a !== void 0 && /* @__PURE__ */ i(
|
|
191
191
|
it,
|
|
192
192
|
{
|
|
193
193
|
size: "small",
|
|
194
|
-
"aria-label":
|
|
195
|
-
onClick:
|
|
194
|
+
"aria-label": s.formatMessage({ id: "ds.states.callout.close" }),
|
|
195
|
+
onClick: a,
|
|
196
196
|
children: /* @__PURE__ */ i(_e, { "aria-hidden": !0 })
|
|
197
197
|
}
|
|
198
198
|
)
|
|
@@ -200,49 +200,49 @@ function st({
|
|
|
200
200
|
}
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
|
-
const U = (e) => e.id ?? e.name, qe = (e,
|
|
203
|
+
const U = (e) => e.id ?? e.name, qe = (e, t, n) => (t === void 0 || e.sizeOctet <= t) && xn(e, n), Ue = (e, t, n) => [
|
|
204
204
|
...(e.childFile ?? []).filter(
|
|
205
|
-
(r) => qe(r,
|
|
205
|
+
(r) => qe(r, t, n)
|
|
206
206
|
),
|
|
207
207
|
...(e.childFolder ?? []).flatMap(
|
|
208
|
-
(r) => Ue(r,
|
|
208
|
+
(r) => Ue(r, t, n)
|
|
209
209
|
)
|
|
210
210
|
], ue = l("div", {
|
|
211
211
|
shouldForwardProp: (e) => e !== "selected"
|
|
212
|
-
})(({ theme: e, selected:
|
|
213
|
-
const { tokens:
|
|
212
|
+
})(({ theme: e, selected: t }) => {
|
|
213
|
+
const { tokens: n, space: r, radii: a, densityValues: u, density: s, typeScale: d } = e.design;
|
|
214
214
|
return {
|
|
215
215
|
display: "flex",
|
|
216
216
|
alignItems: "center",
|
|
217
217
|
gap: o(r[1]),
|
|
218
|
-
minHeight: o(
|
|
219
|
-
borderRadius: o(
|
|
220
|
-
backgroundColor:
|
|
221
|
-
fontSize: o(
|
|
222
|
-
color:
|
|
218
|
+
minHeight: o(u[s].control),
|
|
219
|
+
borderRadius: o(a.md),
|
|
220
|
+
backgroundColor: t ? de(n.accent) : "transparent",
|
|
221
|
+
fontSize: o(d.body),
|
|
222
|
+
color: n["text.primary"],
|
|
223
223
|
...De(e)
|
|
224
224
|
};
|
|
225
225
|
}), Ke = (e) => {
|
|
226
|
-
const { tokens:
|
|
226
|
+
const { tokens: t, space: n, radii: r, fonts: a } = e.design;
|
|
227
227
|
return {
|
|
228
228
|
flex: "1 1 auto",
|
|
229
229
|
minWidth: 0,
|
|
230
230
|
display: "flex",
|
|
231
231
|
alignItems: "center",
|
|
232
|
-
gap: o(
|
|
232
|
+
gap: o(n[2]),
|
|
233
233
|
alignSelf: "stretch",
|
|
234
234
|
margin: 0,
|
|
235
|
-
padding: `0 ${o(
|
|
235
|
+
padding: `0 ${o(n[2])}`,
|
|
236
236
|
border: "none",
|
|
237
237
|
borderRadius: o(r.md),
|
|
238
238
|
background: "none",
|
|
239
239
|
color: "inherit",
|
|
240
240
|
font: "inherit",
|
|
241
|
-
fontFamily:
|
|
241
|
+
fontFamily: a.sans,
|
|
242
242
|
textAlign: "left",
|
|
243
243
|
cursor: "pointer",
|
|
244
244
|
transition: oe(e, ["background-color"]),
|
|
245
|
-
"&:hover": { backgroundColor:
|
|
245
|
+
"&:hover": { backgroundColor: t["bg.hover"] },
|
|
246
246
|
"&:focus-visible": te(e)
|
|
247
247
|
};
|
|
248
248
|
}, Xe = l("button")(({ theme: e }) => Ke(e)), at = l("label")(({ theme: e }) => Ke(e)), Ye = l("span", {
|
|
@@ -255,28 +255,28 @@ const U = (e) => e.id ?? e.name, qe = (e, n, t) => (n === void 0 || e.sizeOctet
|
|
|
255
255
|
whiteSpace: "nowrap",
|
|
256
256
|
fontWeight: e ? A.medium : A.regular
|
|
257
257
|
})), Qe = l("span")(({ theme: e }) => {
|
|
258
|
-
const { tokens:
|
|
258
|
+
const { tokens: t, space: n, radii: r } = e.design;
|
|
259
259
|
return {
|
|
260
260
|
display: "inline-flex",
|
|
261
261
|
flex: "none",
|
|
262
262
|
alignItems: "center",
|
|
263
263
|
justifyContent: "center",
|
|
264
|
-
width: o(
|
|
265
|
-
height: o(
|
|
264
|
+
width: o(n[5]),
|
|
265
|
+
height: o(n[5]),
|
|
266
266
|
overflow: "hidden",
|
|
267
267
|
borderRadius: o(r.sm),
|
|
268
|
-
color:
|
|
269
|
-
"& svg": { width: o(
|
|
268
|
+
color: t["text.muted"],
|
|
269
|
+
"& svg": { width: o(n[5]), height: o(n[5]) },
|
|
270
270
|
"& img": { width: "100%", height: "100%", objectFit: "cover" }
|
|
271
271
|
};
|
|
272
272
|
}), lt = l(_n, {
|
|
273
273
|
shouldForwardProp: (e) => e !== "open"
|
|
274
|
-
})(({ theme: e, open:
|
|
274
|
+
})(({ theme: e, open: t }) => ({
|
|
275
275
|
flex: "none",
|
|
276
276
|
width: o(e.design.space[4]),
|
|
277
277
|
height: o(e.design.space[4]),
|
|
278
278
|
color: e.design.tokens["text.muted"],
|
|
279
|
-
transform:
|
|
279
|
+
transform: t ? "rotate(90deg)" : "none",
|
|
280
280
|
transition: oe(e, ["transform"])
|
|
281
281
|
})), Ze = l(Pn)(({ theme: e }) => ({
|
|
282
282
|
[Z.down(K.Tablet)]: {
|
|
@@ -293,23 +293,23 @@ const U = (e) => e.id ?? e.name, qe = (e, n, t) => (n === void 0 || e.sizeOctet
|
|
|
293
293
|
})), Me = l("li")({ listStyle: "none" });
|
|
294
294
|
function Je({
|
|
295
295
|
folders: e,
|
|
296
|
-
files:
|
|
297
|
-
context:
|
|
296
|
+
files: t,
|
|
297
|
+
context: n
|
|
298
298
|
}) {
|
|
299
|
-
return /* @__PURE__ */
|
|
300
|
-
e.map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(pt, { folder: r, context:
|
|
301
|
-
|
|
299
|
+
return /* @__PURE__ */ C(J, { children: [
|
|
300
|
+
e.map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(pt, { folder: r, context: n }) }, r.id ?? r.name)),
|
|
301
|
+
t.filter((r) => qe(r, n.maxSize, n.accept)).map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(ut, { file: r, context: n }) }, U(r)))
|
|
302
302
|
] });
|
|
303
303
|
}
|
|
304
304
|
function ct({
|
|
305
305
|
file: e,
|
|
306
|
-
getFileThumbnailUrl:
|
|
306
|
+
getFileThumbnailUrl: t
|
|
307
307
|
}) {
|
|
308
|
-
const [
|
|
309
|
-
return /* @__PURE__ */ i(Qe, { "aria-hidden": !0, children:
|
|
308
|
+
const [n, r] = F(!1), a = e.thumbnailPublicAccessId !== null && !e.isEncrypt && !n ? t(e.thumbnailPublicAccessId) : null;
|
|
309
|
+
return /* @__PURE__ */ i(Qe, { "aria-hidden": !0, children: a !== null ? /* @__PURE__ */ i(
|
|
310
310
|
"img",
|
|
311
311
|
{
|
|
312
|
-
src:
|
|
312
|
+
src: a,
|
|
313
313
|
alt: "",
|
|
314
314
|
draggable: !1,
|
|
315
315
|
onError: () => r(!0)
|
|
@@ -318,77 +318,77 @@ function ct({
|
|
|
318
318
|
}
|
|
319
319
|
function ut({
|
|
320
320
|
file: e,
|
|
321
|
-
context:
|
|
321
|
+
context: t
|
|
322
322
|
}) {
|
|
323
|
-
const
|
|
323
|
+
const n = N(), r = t.selectedIds.has(U(e)), a = () => r ? t.unselect([e]) : t.select([e]), u = /* @__PURE__ */ C(J, { children: [
|
|
324
324
|
/* @__PURE__ */ i(
|
|
325
325
|
ct,
|
|
326
326
|
{
|
|
327
327
|
file: e,
|
|
328
|
-
getFileThumbnailUrl:
|
|
328
|
+
getFileThumbnailUrl: t.getFileThumbnailUrl
|
|
329
329
|
}
|
|
330
330
|
),
|
|
331
331
|
/* @__PURE__ */ i(Ye, { strong: r, title: e.name, children: e.name })
|
|
332
332
|
] });
|
|
333
|
-
return
|
|
333
|
+
return t.multiple ? /* @__PURE__ */ C(ue, { selected: r, children: [
|
|
334
334
|
/* @__PURE__ */ i(
|
|
335
335
|
Ze,
|
|
336
336
|
{
|
|
337
|
-
id:
|
|
337
|
+
id: n,
|
|
338
338
|
size: "small",
|
|
339
339
|
checked: r,
|
|
340
|
-
onChange:
|
|
340
|
+
onChange: a
|
|
341
341
|
}
|
|
342
342
|
),
|
|
343
|
-
/* @__PURE__ */ i(at, { htmlFor:
|
|
344
|
-
] }) : /* @__PURE__ */ i(ue, { selected: r, children: /* @__PURE__ */ i(Xe, { type: "button", "aria-pressed": r, onClick:
|
|
343
|
+
/* @__PURE__ */ i(at, { htmlFor: n, children: u })
|
|
344
|
+
] }) : /* @__PURE__ */ i(ue, { selected: r, children: /* @__PURE__ */ i(Xe, { type: "button", "aria-pressed": r, onClick: a, children: u }) });
|
|
345
345
|
}
|
|
346
346
|
function pt({
|
|
347
347
|
folder: e,
|
|
348
|
-
context:
|
|
348
|
+
context: t
|
|
349
349
|
}) {
|
|
350
|
-
const
|
|
351
|
-
(
|
|
352
|
-
).length, g =
|
|
353
|
-
return /* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
350
|
+
const n = P(), r = N(), [a, u] = F(!1), s = Ue(e, t.maxSize, t.accept), d = s.filter(
|
|
351
|
+
(h) => t.selectedIds.has(U(h))
|
|
352
|
+
).length, g = s.length > 0 && d === s.length;
|
|
353
|
+
return /* @__PURE__ */ C(J, { children: [
|
|
354
|
+
/* @__PURE__ */ C(ue, { selected: g, children: [
|
|
355
|
+
t.multiple && /* @__PURE__ */ i(
|
|
356
356
|
Ze,
|
|
357
357
|
{
|
|
358
358
|
size: "small",
|
|
359
359
|
checked: g,
|
|
360
|
-
indeterminate:
|
|
361
|
-
disabled:
|
|
362
|
-
onChange: () => g ?
|
|
360
|
+
indeterminate: d > 0 && !g,
|
|
361
|
+
disabled: s.length === 0,
|
|
362
|
+
onChange: () => g ? t.unselect(s) : t.select(s),
|
|
363
363
|
inputProps: {
|
|
364
|
-
"aria-label":
|
|
364
|
+
"aria-label": n.formatMessage(
|
|
365
365
|
{ id: "ds.business.cloud-import.select-folder" },
|
|
366
366
|
{ name: e.name }
|
|
367
367
|
)
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
),
|
|
371
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ C(
|
|
372
372
|
Xe,
|
|
373
373
|
{
|
|
374
374
|
type: "button",
|
|
375
|
-
"aria-expanded":
|
|
376
|
-
"aria-controls":
|
|
377
|
-
onClick: () =>
|
|
375
|
+
"aria-expanded": a,
|
|
376
|
+
"aria-controls": a ? r : void 0,
|
|
377
|
+
onClick: () => u(!a),
|
|
378
378
|
children: [
|
|
379
|
-
/* @__PURE__ */ i(lt, { open:
|
|
380
|
-
/* @__PURE__ */ i(Qe, { "aria-hidden": !0, children:
|
|
379
|
+
/* @__PURE__ */ i(lt, { open: a, "aria-hidden": !0 }),
|
|
380
|
+
/* @__PURE__ */ i(Qe, { "aria-hidden": !0, children: a ? /* @__PURE__ */ i(Ne, {}) : /* @__PURE__ */ i(Nn, {}) }),
|
|
381
381
|
/* @__PURE__ */ i(Ye, { strong: g, title: e.name, children: e.name })
|
|
382
382
|
]
|
|
383
383
|
}
|
|
384
384
|
)
|
|
385
385
|
] }),
|
|
386
|
-
|
|
386
|
+
a && /* @__PURE__ */ i(dt, { id: r, children: /* @__PURE__ */ i(
|
|
387
387
|
Je,
|
|
388
388
|
{
|
|
389
389
|
folders: e.childFolder ?? [],
|
|
390
390
|
files: e.childFile ?? [],
|
|
391
|
-
context:
|
|
391
|
+
context: t
|
|
392
392
|
}
|
|
393
393
|
) })
|
|
394
394
|
] });
|
|
@@ -416,46 +416,46 @@ const Oe = "shared", Te = {
|
|
|
416
416
|
fontSize: o(e.design.typeScale.small),
|
|
417
417
|
color: e.design.tokens["text.muted"]
|
|
418
418
|
})), ht = l("ul")(({ theme: e }) => {
|
|
419
|
-
const { tokens:
|
|
419
|
+
const { tokens: t, space: n, radii: r } = e.design;
|
|
420
420
|
return {
|
|
421
421
|
margin: 0,
|
|
422
|
-
padding: o(
|
|
422
|
+
padding: o(n[1]),
|
|
423
423
|
listStyle: "none",
|
|
424
|
-
minHeight: o(
|
|
425
|
-
border: D(
|
|
424
|
+
minHeight: o(n[10] * 3),
|
|
425
|
+
border: D(t["border.subtle"]),
|
|
426
426
|
borderRadius: o(r.md)
|
|
427
427
|
};
|
|
428
428
|
}), ne = l("div")(({ theme: e }) => {
|
|
429
|
-
const { tokens:
|
|
429
|
+
const { tokens: t, space: n, typeScale: r } = e.design;
|
|
430
430
|
return {
|
|
431
431
|
display: "flex",
|
|
432
432
|
flexDirection: "column",
|
|
433
433
|
alignItems: "center",
|
|
434
434
|
justifyContent: "center",
|
|
435
|
-
gap: o(
|
|
436
|
-
minHeight: o(
|
|
437
|
-
padding: o(
|
|
435
|
+
gap: o(n[3]),
|
|
436
|
+
minHeight: o(n[10] * 3),
|
|
437
|
+
padding: o(n[5]),
|
|
438
438
|
textAlign: "center",
|
|
439
439
|
fontSize: o(r.body),
|
|
440
|
-
color:
|
|
440
|
+
color: t["text.secondary"],
|
|
441
441
|
"& > svg": {
|
|
442
|
-
width: o(
|
|
443
|
-
height: o(
|
|
444
|
-
color:
|
|
442
|
+
width: o(n[7]),
|
|
443
|
+
height: o(n[7]),
|
|
444
|
+
color: t["text.muted"]
|
|
445
445
|
}
|
|
446
446
|
};
|
|
447
447
|
}), bt = l("span")(({ theme: e }) => {
|
|
448
|
-
const { tokens:
|
|
448
|
+
const { tokens: t, space: n, radii: r } = e.design;
|
|
449
449
|
return {
|
|
450
450
|
display: "inline-flex",
|
|
451
451
|
alignItems: "center",
|
|
452
452
|
justifyContent: "center",
|
|
453
|
-
width: o(
|
|
454
|
-
height: o(
|
|
453
|
+
width: o(n[9] + n[2]),
|
|
454
|
+
height: o(n[9] + n[2]),
|
|
455
455
|
borderRadius: o(r.lg),
|
|
456
|
-
backgroundColor: de(
|
|
457
|
-
color:
|
|
458
|
-
"& svg": { width: o(
|
|
456
|
+
backgroundColor: de(t["status.warning"]),
|
|
457
|
+
color: t["status.warning"],
|
|
458
|
+
"& svg": { width: o(n[6]), height: o(n[6]) }
|
|
459
459
|
};
|
|
460
460
|
}), yt = l("p")(({ theme: e }) => ({
|
|
461
461
|
margin: 0,
|
|
@@ -489,89 +489,89 @@ const Oe = "shared", Te = {
|
|
|
489
489
|
// A narrow screen wraps it: the scope and the organization tell same-named Spaces apart.
|
|
490
490
|
overflowWrap: "anywhere"
|
|
491
491
|
})), en = l("span")(({ theme: e }) => {
|
|
492
|
-
const { tokens:
|
|
492
|
+
const { tokens: t, space: n, radii: r } = e.design;
|
|
493
493
|
return {
|
|
494
494
|
display: "inline-flex",
|
|
495
495
|
flex: "none",
|
|
496
496
|
alignItems: "center",
|
|
497
497
|
justifyContent: "center",
|
|
498
|
-
minWidth: o(
|
|
499
|
-
height: o(
|
|
498
|
+
minWidth: o(n[5]),
|
|
499
|
+
height: o(n[5]),
|
|
500
500
|
borderRadius: o(r.sm),
|
|
501
|
-
color:
|
|
502
|
-
"& > svg": { width: o(
|
|
501
|
+
color: t["accent.text"],
|
|
502
|
+
"& > svg": { width: o(n[4]), height: o(n[4]) }
|
|
503
503
|
};
|
|
504
504
|
}), Ft = l(en)(({ theme: e }) => ({
|
|
505
505
|
marginRight: o(e.design.space[2])
|
|
506
506
|
})), Wt = l("li")({ listStyle: "none" }), Mt = l("div")(({ theme: e }) => {
|
|
507
|
-
const { space:
|
|
507
|
+
const { space: t, tokens: n, typeScale: r } = e.design;
|
|
508
508
|
return {
|
|
509
|
-
padding: `${o(
|
|
509
|
+
padding: `${o(t[2])} ${o(t[3])} ${o(t[1])}`,
|
|
510
510
|
fontSize: o(r.caption),
|
|
511
511
|
fontWeight: A.semibold,
|
|
512
512
|
letterSpacing: "0.05em",
|
|
513
513
|
textTransform: "uppercase",
|
|
514
|
-
color:
|
|
514
|
+
color: n["text.muted"]
|
|
515
515
|
};
|
|
516
516
|
}), Ot = l("ul")({ margin: 0, padding: 0 });
|
|
517
517
|
function Tt({
|
|
518
518
|
cloudPicker: e,
|
|
519
|
-
onImport:
|
|
520
|
-
multiple:
|
|
519
|
+
onImport: t,
|
|
520
|
+
multiple: n = !1,
|
|
521
521
|
maxSize: r,
|
|
522
|
-
accept:
|
|
522
|
+
accept: a
|
|
523
523
|
}) {
|
|
524
524
|
const {
|
|
525
|
-
abyssCloudUrl:
|
|
526
|
-
getFileThumbnailUrl:
|
|
527
|
-
getSpaceDisplay:
|
|
525
|
+
abyssCloudUrl: u,
|
|
526
|
+
getFileThumbnailUrl: s,
|
|
527
|
+
getSpaceDisplay: d,
|
|
528
528
|
clouds: g,
|
|
529
|
-
cloudShares:
|
|
530
|
-
isLoading:
|
|
531
|
-
hasError:
|
|
532
|
-
refresh:
|
|
533
|
-
onCreateCloud:
|
|
534
|
-
fetchCloudRepository:
|
|
535
|
-
} = e,
|
|
529
|
+
cloudShares: h,
|
|
530
|
+
isLoading: b,
|
|
531
|
+
hasError: m,
|
|
532
|
+
refresh: f,
|
|
533
|
+
onCreateCloud: w,
|
|
534
|
+
fetchCloudRepository: c
|
|
535
|
+
} = e, p = P(), [y, v] = F(null), [W, M] = F(null), [O, S] = F(
|
|
536
536
|
"loading"
|
|
537
537
|
/* Loading */
|
|
538
538
|
), [T, z] = F([]), [R, ee] = F(!1), [re, _] = F(!1), j = ge(() => {
|
|
539
|
-
const
|
|
539
|
+
const x = [], I = /* @__PURE__ */ new Map(), k = p.formatMessage({
|
|
540
540
|
id: "ds.business.cloud-import.section-organization"
|
|
541
541
|
});
|
|
542
542
|
for (const E of g ?? []) {
|
|
543
543
|
if (!E.organizationId) {
|
|
544
|
-
|
|
544
|
+
x.push(E);
|
|
545
545
|
continue;
|
|
546
546
|
}
|
|
547
|
-
const $ =
|
|
547
|
+
const $ = d == null ? void 0 : d(E), B = I.get(E.organizationId) ?? {
|
|
548
548
|
name: ($ == null ? void 0 : $.organizationName) ?? k,
|
|
549
549
|
items: []
|
|
550
550
|
};
|
|
551
551
|
B.items.push(E), I.set(E.organizationId, B);
|
|
552
552
|
}
|
|
553
|
-
if (
|
|
553
|
+
if (d)
|
|
554
554
|
for (const E of I.values())
|
|
555
555
|
E.items.sort(($, B) => {
|
|
556
|
-
const L = Te[
|
|
557
|
-
return L !== xe ? L - xe :
|
|
556
|
+
const L = Te[d($).scope ?? "personal"], xe = Te[d(B).scope ?? "personal"];
|
|
557
|
+
return L !== xe ? L - xe : d($).label.localeCompare(d(B).label);
|
|
558
558
|
});
|
|
559
559
|
const H = (E, $) => (B) => {
|
|
560
|
-
const L =
|
|
560
|
+
const L = d == null ? void 0 : d(B);
|
|
561
561
|
return {
|
|
562
562
|
space: B,
|
|
563
563
|
sectionKey: E,
|
|
564
564
|
sectionLabel: $,
|
|
565
|
-
label: (L == null ? void 0 : L.label) ?? kn(B,
|
|
565
|
+
label: (L == null ? void 0 : L.label) ?? kn(B, p),
|
|
566
566
|
subtitle: L == null ? void 0 : L.subtitle,
|
|
567
567
|
avatar: L == null ? void 0 : L.avatar
|
|
568
568
|
};
|
|
569
569
|
};
|
|
570
570
|
return [
|
|
571
|
-
...
|
|
571
|
+
...x.map(
|
|
572
572
|
H(
|
|
573
573
|
"personal",
|
|
574
|
-
|
|
574
|
+
p.formatMessage({
|
|
575
575
|
id: "ds.business.cloud-import.section-personal"
|
|
576
576
|
})
|
|
577
577
|
)
|
|
@@ -579,25 +579,25 @@ function Tt({
|
|
|
579
579
|
...[...I].flatMap(
|
|
580
580
|
([E, $]) => $.items.map(H(`org:${E}`, $.name))
|
|
581
581
|
),
|
|
582
|
-
...(
|
|
582
|
+
...(h ?? []).map(
|
|
583
583
|
H(
|
|
584
584
|
Oe,
|
|
585
|
-
|
|
585
|
+
p.formatMessage({ id: "ds.business.cloud-import.section-shared" })
|
|
586
586
|
)
|
|
587
587
|
)
|
|
588
588
|
];
|
|
589
|
-
}, [g,
|
|
590
|
-
he.current =
|
|
591
|
-
const ie = Q(async (
|
|
589
|
+
}, [g, h, d, p]), G = j.find((x) => x.space.id === (y == null ? void 0 : y.id)) ?? null, ce = X(0), he = X(c);
|
|
590
|
+
he.current = c;
|
|
591
|
+
const ie = Q(async (x) => {
|
|
592
592
|
const I = ++ce.current;
|
|
593
593
|
S(
|
|
594
594
|
"loading"
|
|
595
595
|
/* Loading */
|
|
596
596
|
), z([]);
|
|
597
597
|
try {
|
|
598
|
-
if (
|
|
598
|
+
if (x.id === void 0)
|
|
599
599
|
throw new Error("A Space without an id has no tree");
|
|
600
|
-
const k = await he.current(
|
|
600
|
+
const k = await he.current(x.id);
|
|
601
601
|
I === ce.current && (M(k), S(
|
|
602
602
|
"ready"
|
|
603
603
|
/* Ready */
|
|
@@ -608,71 +608,71 @@ function Tt({
|
|
|
608
608
|
/* Failed */
|
|
609
609
|
);
|
|
610
610
|
}
|
|
611
|
-
}, []), dn = X(
|
|
611
|
+
}, []), dn = X(f);
|
|
612
612
|
V(() => {
|
|
613
613
|
dn.current();
|
|
614
614
|
}, []), V(() => {
|
|
615
|
-
if (
|
|
615
|
+
if (y && j.some((k) => k.space.id === y.id))
|
|
616
616
|
return;
|
|
617
|
-
const
|
|
617
|
+
const x = j.map((k) => k.space), I = x.find(
|
|
618
618
|
(k) => !!k.userId && !k.organizationId && !k.projectId
|
|
619
619
|
);
|
|
620
|
-
v(I ??
|
|
621
|
-
}, [j,
|
|
622
|
-
|
|
623
|
-
}, [
|
|
620
|
+
v(I ?? x[0] ?? null);
|
|
621
|
+
}, [j, y]), V(() => {
|
|
622
|
+
y && ie(y);
|
|
623
|
+
}, [y, ie]);
|
|
624
624
|
const cn = async () => {
|
|
625
|
-
if (_(!1), !await
|
|
625
|
+
if (_(!1), !await f()) {
|
|
626
626
|
_(!0);
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
|
-
|
|
629
|
+
y && await ie(y);
|
|
630
630
|
}, un = async () => {
|
|
631
631
|
ee(!0);
|
|
632
632
|
try {
|
|
633
|
-
await
|
|
633
|
+
await w();
|
|
634
634
|
} finally {
|
|
635
635
|
ee(!1);
|
|
636
636
|
}
|
|
637
637
|
}, pn = {
|
|
638
|
-
multiple:
|
|
638
|
+
multiple: n,
|
|
639
639
|
maxSize: r,
|
|
640
|
-
accept:
|
|
640
|
+
accept: a,
|
|
641
641
|
selectedIds: new Set(T.map(U)),
|
|
642
|
-
getFileThumbnailUrl:
|
|
643
|
-
select: (
|
|
644
|
-
if (!
|
|
645
|
-
return
|
|
642
|
+
getFileThumbnailUrl: s,
|
|
643
|
+
select: (x) => z((I) => {
|
|
644
|
+
if (!n)
|
|
645
|
+
return x.slice(0, 1);
|
|
646
646
|
const k = new Set(I.map(U));
|
|
647
647
|
return [
|
|
648
648
|
...I,
|
|
649
|
-
...
|
|
649
|
+
...x.filter((H) => !k.has(U(H)))
|
|
650
650
|
];
|
|
651
651
|
}),
|
|
652
|
-
unselect: (
|
|
653
|
-
const I = new Set(
|
|
652
|
+
unselect: (x) => {
|
|
653
|
+
const I = new Set(x.map(U));
|
|
654
654
|
z(
|
|
655
655
|
(k) => k.filter((H) => !I.has(U(H)))
|
|
656
656
|
);
|
|
657
657
|
}
|
|
658
|
-
}, gn = g !== null &&
|
|
658
|
+
}, gn = g !== null && h !== null, be = /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(
|
|
659
659
|
Ie,
|
|
660
660
|
{
|
|
661
661
|
size: 32,
|
|
662
|
-
"aria-label":
|
|
662
|
+
"aria-label": p.formatMessage({
|
|
663
663
|
id: "ds.business.cloud-import.loading"
|
|
664
664
|
})
|
|
665
665
|
}
|
|
666
666
|
) });
|
|
667
|
-
if (!gn && (
|
|
667
|
+
if (!gn && (b || !m))
|
|
668
668
|
return be;
|
|
669
669
|
if (j.length === 0)
|
|
670
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ C(ne, { children: [
|
|
671
671
|
/* @__PURE__ */ i(bt, { "aria-hidden": !0, children: /* @__PURE__ */ i(Tn, {}) }),
|
|
672
|
-
/* @__PURE__ */ i(yt, { children:
|
|
672
|
+
/* @__PURE__ */ i(yt, { children: p.formatMessage({
|
|
673
673
|
id: "ds.business.cloud-import.create-error.title"
|
|
674
674
|
}) }),
|
|
675
|
-
/* @__PURE__ */ i(vt, { children:
|
|
675
|
+
/* @__PURE__ */ i(vt, { children: p.formatMessage({
|
|
676
676
|
id: "ds.business.cloud-import.create-error.description"
|
|
677
677
|
}) }),
|
|
678
678
|
/* @__PURE__ */ i(
|
|
@@ -680,9 +680,9 @@ function Tt({
|
|
|
680
680
|
{
|
|
681
681
|
variant: "contained",
|
|
682
682
|
startIcon: /* @__PURE__ */ i(We, { "aria-hidden": !0 }),
|
|
683
|
-
loading: R ||
|
|
683
|
+
loading: R || b,
|
|
684
684
|
onClick: () => void un(),
|
|
685
|
-
children:
|
|
685
|
+
children: p.formatMessage({
|
|
686
686
|
id: "ds.business.cloud-import.create-error.create-button"
|
|
687
687
|
})
|
|
688
688
|
}
|
|
@@ -691,24 +691,24 @@ function Tt({
|
|
|
691
691
|
if (G === null)
|
|
692
692
|
return be;
|
|
693
693
|
const fn = Cn(
|
|
694
|
-
|
|
694
|
+
u,
|
|
695
695
|
G.space,
|
|
696
696
|
G.sectionKey === Oe
|
|
697
|
-
), ye =
|
|
697
|
+
), ye = p.formatMessage({
|
|
698
698
|
id: "ds.business.cloud-import.refresh"
|
|
699
|
-
}), ve =
|
|
699
|
+
}), ve = p.formatMessage({
|
|
700
700
|
id: "ds.business.cloud-import.open-in-cloud"
|
|
701
|
-
}), we = (
|
|
702
|
-
return /* @__PURE__ */
|
|
701
|
+
}), we = (x) => x.avatar ?? /* @__PURE__ */ i(We, {});
|
|
702
|
+
return /* @__PURE__ */ C(gt, { children: [
|
|
703
703
|
re && /* @__PURE__ */ i(
|
|
704
704
|
st,
|
|
705
705
|
{
|
|
706
706
|
severity: je.Danger,
|
|
707
707
|
onClose: () => _(!1),
|
|
708
|
-
children:
|
|
708
|
+
children: p.formatMessage({ id: "ds.business.cloud-import.refresh-error" })
|
|
709
709
|
}
|
|
710
710
|
),
|
|
711
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ C(ft, { children: [
|
|
712
712
|
/* @__PURE__ */ i(
|
|
713
713
|
On,
|
|
714
714
|
{
|
|
@@ -716,42 +716,42 @@ function Tt({
|
|
|
716
716
|
disableClearable: !0,
|
|
717
717
|
options: j,
|
|
718
718
|
value: G,
|
|
719
|
-
groupBy: (
|
|
720
|
-
getOptionLabel: (
|
|
721
|
-
isOptionEqualToValue: (
|
|
722
|
-
onChange: (
|
|
723
|
-
filterOptions: (
|
|
719
|
+
groupBy: (x) => x.sectionLabel,
|
|
720
|
+
getOptionLabel: (x) => x.label,
|
|
721
|
+
isOptionEqualToValue: (x, I) => x.space.id === I.space.id,
|
|
722
|
+
onChange: (x, I) => v(I.space),
|
|
723
|
+
filterOptions: (x, { inputValue: I }) => {
|
|
724
724
|
const k = I.trim().toLowerCase();
|
|
725
|
-
return k === "" || k === G.label.toLowerCase() ?
|
|
725
|
+
return k === "" || k === G.label.toLowerCase() ? x : x.filter(
|
|
726
726
|
(H) => [H.label, H.subtitle ?? ""].some(
|
|
727
727
|
(E) => E.toLowerCase().includes(k)
|
|
728
728
|
)
|
|
729
729
|
);
|
|
730
730
|
},
|
|
731
|
-
renderGroup: (
|
|
732
|
-
/* @__PURE__ */ i(Mt, { children:
|
|
733
|
-
/* @__PURE__ */ i(Ot, { children:
|
|
734
|
-
] },
|
|
735
|
-
renderOption: ({ key:
|
|
731
|
+
renderGroup: (x) => /* @__PURE__ */ C(Wt, { children: [
|
|
732
|
+
/* @__PURE__ */ i(Mt, { children: x.group }),
|
|
733
|
+
/* @__PURE__ */ i(Ot, { children: x.children })
|
|
734
|
+
] }, x.key),
|
|
735
|
+
renderOption: ({ key: x, ...I }, k) => /* @__PURE__ */ C(Ct, { ...I, children: [
|
|
736
736
|
/* @__PURE__ */ i(en, { "aria-hidden": !0, children: we(k) }),
|
|
737
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ C(kt, { children: [
|
|
738
738
|
/* @__PURE__ */ i(St, { children: k.label }),
|
|
739
739
|
k.subtitle !== void 0 && /* @__PURE__ */ i(It, { children: k.subtitle })
|
|
740
740
|
] })
|
|
741
|
-
] },
|
|
742
|
-
renderInput: (
|
|
741
|
+
] }, x),
|
|
742
|
+
renderInput: (x) => /* @__PURE__ */ i(
|
|
743
743
|
Ve,
|
|
744
744
|
{
|
|
745
|
-
label:
|
|
745
|
+
label: p.formatMessage({
|
|
746
746
|
id: "ds.business.cloud-import.space-label"
|
|
747
747
|
}),
|
|
748
748
|
children: /* @__PURE__ */ i(
|
|
749
749
|
me,
|
|
750
750
|
{
|
|
751
|
-
...
|
|
752
|
-
id:
|
|
751
|
+
...x.InputProps,
|
|
752
|
+
id: x.id,
|
|
753
753
|
fullWidth: !0,
|
|
754
|
-
inputProps:
|
|
754
|
+
inputProps: x.inputProps,
|
|
755
755
|
startAdornment: /* @__PURE__ */ i(Ft, { "aria-hidden": !0, children: we(G) })
|
|
756
756
|
}
|
|
757
757
|
)
|
|
@@ -763,7 +763,7 @@ function Tt({
|
|
|
763
763
|
ae,
|
|
764
764
|
{
|
|
765
765
|
"aria-label": ye,
|
|
766
|
-
disabled: O === "loading" ||
|
|
766
|
+
disabled: O === "loading" || b,
|
|
767
767
|
onClick: () => void cn(),
|
|
768
768
|
children: /* @__PURE__ */ i(zn, { "aria-hidden": !0 })
|
|
769
769
|
}
|
|
@@ -780,34 +780,34 @@ function Tt({
|
|
|
780
780
|
}
|
|
781
781
|
) })
|
|
782
782
|
] }),
|
|
783
|
-
/* @__PURE__ */ i(mt, { children:
|
|
783
|
+
/* @__PURE__ */ i(mt, { children: p.formatMessage({ id: "ds.business.cloud-import.filtered-hint" }) }),
|
|
784
784
|
O === "loading" && /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(
|
|
785
785
|
Ie,
|
|
786
786
|
{
|
|
787
787
|
size: 24,
|
|
788
|
-
"aria-label":
|
|
788
|
+
"aria-label": p.formatMessage({
|
|
789
789
|
id: "ds.business.cloud-import.tree-loading"
|
|
790
790
|
})
|
|
791
791
|
}
|
|
792
792
|
) }),
|
|
793
|
-
O === "failed" && /* @__PURE__ */
|
|
794
|
-
|
|
793
|
+
O === "failed" && /* @__PURE__ */ C(ne, { role: "alert", children: [
|
|
794
|
+
p.formatMessage({ id: "ds.business.cloud-import.tree-error" }),
|
|
795
795
|
/* @__PURE__ */ i(
|
|
796
796
|
Y,
|
|
797
797
|
{
|
|
798
798
|
variant: "outlined",
|
|
799
799
|
onClick: () => void ie(G.space),
|
|
800
|
-
children:
|
|
800
|
+
children: p.formatMessage({ id: "ds.business.cloud-import.retry" })
|
|
801
801
|
}
|
|
802
802
|
)
|
|
803
803
|
] }),
|
|
804
|
-
O === "ready" && W !== null && (W.folders.length === 0 && W.files.length === 0 ? /* @__PURE__ */
|
|
804
|
+
O === "ready" && W !== null && (W.folders.length === 0 && W.files.length === 0 ? /* @__PURE__ */ C(ne, { children: [
|
|
805
805
|
/* @__PURE__ */ i(Ne, { "aria-hidden": !0 }),
|
|
806
|
-
|
|
806
|
+
p.formatMessage({ id: "ds.business.cloud-import.empty-space" })
|
|
807
807
|
] }) : /* @__PURE__ */ i(
|
|
808
808
|
ht,
|
|
809
809
|
{
|
|
810
|
-
"aria-label":
|
|
810
|
+
"aria-label": p.formatMessage({
|
|
811
811
|
id: "ds.business.cloud-import.tree-label"
|
|
812
812
|
}),
|
|
813
813
|
children: /* @__PURE__ */ i(
|
|
@@ -820,8 +820,8 @@ function Tt({
|
|
|
820
820
|
)
|
|
821
821
|
}
|
|
822
822
|
)),
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */ i(xt, { role: "status", children:
|
|
823
|
+
/* @__PURE__ */ C(wt, { children: [
|
|
824
|
+
/* @__PURE__ */ i(xt, { role: "status", children: p.formatMessage(
|
|
825
825
|
{ id: "ds.business.cloud-import.selected" },
|
|
826
826
|
{ count: T.length }
|
|
827
827
|
) }),
|
|
@@ -831,8 +831,8 @@ function Tt({
|
|
|
831
831
|
variant: "contained",
|
|
832
832
|
startIcon: /* @__PURE__ */ i(Rn, { "aria-hidden": !0 }),
|
|
833
833
|
disabled: T.length === 0,
|
|
834
|
-
onClick: () =>
|
|
835
|
-
children:
|
|
834
|
+
onClick: () => t(G.space, T),
|
|
835
|
+
children: p.formatMessage({ id: "ds.business.cloud-import.import" })
|
|
836
836
|
}
|
|
837
837
|
)
|
|
838
838
|
] })
|
|
@@ -840,30 +840,30 @@ function Tt({
|
|
|
840
840
|
}
|
|
841
841
|
function Rt({
|
|
842
842
|
open: e,
|
|
843
|
-
onClose:
|
|
844
|
-
onImport:
|
|
843
|
+
onClose: t,
|
|
844
|
+
onImport: n,
|
|
845
845
|
cloudPicker: r,
|
|
846
|
-
multiple:
|
|
847
|
-
maxSize:
|
|
848
|
-
accept:
|
|
846
|
+
multiple: a,
|
|
847
|
+
maxSize: u,
|
|
848
|
+
accept: s
|
|
849
849
|
}) {
|
|
850
|
-
const
|
|
850
|
+
const d = P();
|
|
851
851
|
return /* @__PURE__ */ i(
|
|
852
852
|
Pe,
|
|
853
853
|
{
|
|
854
854
|
open: e,
|
|
855
|
-
onClose:
|
|
855
|
+
onClose: t,
|
|
856
856
|
size: He.Medium,
|
|
857
|
-
title:
|
|
857
|
+
title: d.formatMessage({ id: "ds.business.cloud-import.title" }),
|
|
858
858
|
children: e && /* @__PURE__ */ i(
|
|
859
859
|
Tt,
|
|
860
860
|
{
|
|
861
861
|
cloudPicker: r,
|
|
862
|
-
multiple:
|
|
863
|
-
maxSize:
|
|
864
|
-
accept:
|
|
865
|
-
onImport: (g,
|
|
866
|
-
|
|
862
|
+
multiple: a,
|
|
863
|
+
maxSize: u,
|
|
864
|
+
accept: s,
|
|
865
|
+
onImport: (g, h) => {
|
|
866
|
+
n(g, h), t();
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
)
|
|
@@ -898,12 +898,12 @@ const Et = ze(
|
|
|
898
898
|
minWidth: 0
|
|
899
899
|
})), $t = l("i", {
|
|
900
900
|
shouldForwardProp: (e) => e !== "token"
|
|
901
|
-
})(({ theme: e, token:
|
|
901
|
+
})(({ theme: e, token: t }) => ({
|
|
902
902
|
flex: "none",
|
|
903
903
|
width: o(e.design.space[2]),
|
|
904
904
|
height: o(e.design.space[2]),
|
|
905
905
|
borderRadius: o(e.design.radii.sm / 2),
|
|
906
|
-
backgroundColor: e.design.tokens[
|
|
906
|
+
backgroundColor: e.design.tokens[t]
|
|
907
907
|
})), Dt = l("span")({
|
|
908
908
|
display: "flex",
|
|
909
909
|
flexDirection: "column",
|
|
@@ -921,47 +921,47 @@ const Et = ze(
|
|
|
921
921
|
}));
|
|
922
922
|
function xr({
|
|
923
923
|
label: e,
|
|
924
|
-
options:
|
|
925
|
-
value:
|
|
924
|
+
options: t,
|
|
925
|
+
value: n,
|
|
926
926
|
onChange: r,
|
|
927
|
-
multiple:
|
|
928
|
-
disabled:
|
|
929
|
-
error:
|
|
930
|
-
size:
|
|
927
|
+
multiple: a = !1,
|
|
928
|
+
disabled: u,
|
|
929
|
+
error: s,
|
|
930
|
+
size: d
|
|
931
931
|
}) {
|
|
932
|
-
const g = P(),
|
|
933
|
-
return /* @__PURE__ */
|
|
932
|
+
const g = P(), h = Ae(Et), b = (d ?? h) === nn.Compact, m = b ? zt : le, f = N(), w = `${f}-label`, c = `${f}-helper`, p = new Map(t.map((v) => [v.value, v]));
|
|
933
|
+
return /* @__PURE__ */ C(m, { fullWidth: !b, disabled: u, error: !!s, children: [
|
|
934
934
|
/* @__PURE__ */ i(
|
|
935
935
|
At,
|
|
936
936
|
{
|
|
937
|
-
id:
|
|
937
|
+
id: w,
|
|
938
938
|
shrink: !0,
|
|
939
|
-
style:
|
|
939
|
+
style: b ? fe : void 0,
|
|
940
940
|
children: e
|
|
941
941
|
}
|
|
942
942
|
),
|
|
943
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ C(
|
|
944
944
|
hn,
|
|
945
945
|
{
|
|
946
|
-
labelId:
|
|
947
|
-
multiple:
|
|
948
|
-
value:
|
|
946
|
+
labelId: w,
|
|
947
|
+
multiple: a,
|
|
948
|
+
value: n,
|
|
949
949
|
displayEmpty: !0,
|
|
950
950
|
renderValue: (v) => {
|
|
951
951
|
const W = Array.isArray(v) ? v : [v];
|
|
952
|
-
return
|
|
952
|
+
return b && W.length === 0 ? /* @__PURE__ */ i(Ht, { "aria-hidden": !0, children: e }) : /* @__PURE__ */ i(pe, { children: W.map((M) => {
|
|
953
953
|
var O;
|
|
954
|
-
return ((O =
|
|
954
|
+
return ((O = p.get(M)) == null ? void 0 : O.label) ?? M;
|
|
955
955
|
}).join(", ") });
|
|
956
956
|
},
|
|
957
|
-
"aria-describedby":
|
|
957
|
+
"aria-describedby": s ? c : void 0,
|
|
958
958
|
onChange: (v) => r(v.target.value),
|
|
959
959
|
children: [
|
|
960
|
-
|
|
961
|
-
|
|
960
|
+
t.length === 0 && /* @__PURE__ */ i(Ce, { disabled: !0, value: "", children: g.formatMessage({ id: "ds.inputs.rich-select.empty" }) }),
|
|
961
|
+
t.map((v) => /* @__PURE__ */ i(Ce, { value: v.value, children: /* @__PURE__ */ C(Lt, { children: [
|
|
962
962
|
v.tone && /* @__PURE__ */ i($t, { token: v.tone }),
|
|
963
963
|
v.icon,
|
|
964
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ C(Dt, { children: [
|
|
965
965
|
/* @__PURE__ */ i(pe, { children: v.label }),
|
|
966
966
|
v.description && /* @__PURE__ */ i(Pt, { children: v.description })
|
|
967
967
|
] })
|
|
@@ -969,7 +969,7 @@ function xr({
|
|
|
969
969
|
]
|
|
970
970
|
}
|
|
971
971
|
),
|
|
972
|
-
|
|
972
|
+
s && /* @__PURE__ */ i(se, { id: c, children: s })
|
|
973
973
|
] });
|
|
974
974
|
}
|
|
975
975
|
const Nt = l("div")(({ theme: e }) => ({
|
|
@@ -983,8 +983,8 @@ const Nt = l("div")(({ theme: e }) => ({
|
|
|
983
983
|
color: e.design.tokens["text.secondary"]
|
|
984
984
|
})), Bt = l("div", {
|
|
985
985
|
shouldForwardProp: (e) => e !== "active"
|
|
986
|
-
})(({ theme: e, active:
|
|
987
|
-
const { tokens:
|
|
986
|
+
})(({ theme: e, active: t }) => {
|
|
987
|
+
const { tokens: n, space: r, radii: a } = e.design;
|
|
988
988
|
return {
|
|
989
989
|
display: "flex",
|
|
990
990
|
flexDirection: "column",
|
|
@@ -994,27 +994,27 @@ const Nt = l("div")(({ theme: e }) => ({
|
|
|
994
994
|
minHeight: o(r[10] * 3),
|
|
995
995
|
padding: `${o(r[6])} ${o(r[4])}`,
|
|
996
996
|
boxSizing: "border-box",
|
|
997
|
-
border: `1px dashed ${
|
|
998
|
-
borderRadius: o(
|
|
999
|
-
backgroundColor:
|
|
1000
|
-
color:
|
|
997
|
+
border: `1px dashed ${t ? n.accent : n["border.control"]}`,
|
|
998
|
+
borderRadius: o(a.md),
|
|
999
|
+
backgroundColor: t ? de(n.accent) : n["bg.raised"],
|
|
1000
|
+
color: n["text.secondary"],
|
|
1001
1001
|
textAlign: "center",
|
|
1002
1002
|
cursor: "pointer",
|
|
1003
1003
|
transition: oe(e, ["border-color", "background-color"]),
|
|
1004
|
-
"&:hover": { borderColor:
|
|
1004
|
+
"&:hover": { borderColor: n.accent }
|
|
1005
1005
|
};
|
|
1006
1006
|
}), Vt = l("span")(({ theme: e }) => {
|
|
1007
|
-
const { tokens:
|
|
1007
|
+
const { tokens: t, space: n } = e.design;
|
|
1008
1008
|
return {
|
|
1009
1009
|
display: "inline-flex",
|
|
1010
1010
|
alignItems: "center",
|
|
1011
1011
|
justifyContent: "center",
|
|
1012
|
-
width: o(
|
|
1013
|
-
height: o(
|
|
1012
|
+
width: o(n[9]),
|
|
1013
|
+
height: o(n[9]),
|
|
1014
1014
|
borderRadius: "50%",
|
|
1015
|
-
backgroundColor: de(
|
|
1016
|
-
color:
|
|
1017
|
-
"& svg": { width: o(
|
|
1015
|
+
backgroundColor: de(t.accent),
|
|
1016
|
+
color: t["accent.text"],
|
|
1017
|
+
"& svg": { width: o(n[5]), height: o(n[5]) }
|
|
1018
1018
|
};
|
|
1019
1019
|
}), jt = l("span")(({ theme: e }) => ({
|
|
1020
1020
|
fontSize: o(e.design.typeScale.body),
|
|
@@ -1036,64 +1036,64 @@ const Nt = l("div")(({ theme: e }) => ({
|
|
|
1036
1036
|
width: o(e.design.space[4]),
|
|
1037
1037
|
height: o(e.design.space[4])
|
|
1038
1038
|
})), Xt = (e) => {
|
|
1039
|
-
const { value:
|
|
1040
|
-
return `${
|
|
1039
|
+
const { value: t, unit: n } = Wn(e);
|
|
1040
|
+
return `${t} ${n}`;
|
|
1041
1041
|
};
|
|
1042
1042
|
function Cr({
|
|
1043
1043
|
onDrop: e,
|
|
1044
|
-
multiple:
|
|
1045
|
-
accept:
|
|
1044
|
+
multiple: t = !0,
|
|
1045
|
+
accept: n,
|
|
1046
1046
|
maxSize: r,
|
|
1047
|
-
caption:
|
|
1048
|
-
title:
|
|
1049
|
-
cloudImport:
|
|
1050
|
-
children:
|
|
1047
|
+
caption: a,
|
|
1048
|
+
title: u,
|
|
1049
|
+
cloudImport: s,
|
|
1050
|
+
children: d
|
|
1051
1051
|
}) {
|
|
1052
|
-
const g = P(),
|
|
1052
|
+
const g = P(), h = N(), b = N(), [m, f] = F(null), [w, c] = F(!1), p = r === void 0 ? null : Xt(r), y = a ?? (p === null ? null : g.formatMessage(
|
|
1053
1053
|
{ id: "ds.inputs.drop-zone.max-size" },
|
|
1054
|
-
{ size:
|
|
1054
|
+
{ size: p, multiple: String(t) }
|
|
1055
1055
|
)), v = (z, R) => {
|
|
1056
1056
|
const ee = r === void 0 ? [] : z.filter((_) => _.size > r), re = z.filter((_) => !ee.includes(_));
|
|
1057
1057
|
R.some(
|
|
1058
1058
|
(_) => _.errors.some((j) => j.code === Fn.TooManyFiles)
|
|
1059
|
-
) ?
|
|
1059
|
+
) ? f(
|
|
1060
1060
|
"too-many"
|
|
1061
1061
|
/* TooMany */
|
|
1062
|
-
) : R.length > 0 ?
|
|
1062
|
+
) : R.length > 0 ? f(
|
|
1063
1063
|
"rejected-type"
|
|
1064
1064
|
/* Rejected */
|
|
1065
|
-
) : ee.length > 0 ?
|
|
1065
|
+
) : ee.length > 0 ? f(
|
|
1066
1066
|
z.length === 1 ? "too-big" : "some-too-big"
|
|
1067
1067
|
/* SomeTooBig */
|
|
1068
|
-
) :
|
|
1068
|
+
) : f(null), re.length > 0 && e(re);
|
|
1069
1069
|
}, { getRootProps: W, getInputProps: M, isDragActive: O, open: S } = Sn({
|
|
1070
1070
|
onDrop: v,
|
|
1071
|
-
multiple:
|
|
1072
|
-
accept:
|
|
1071
|
+
multiple: t,
|
|
1072
|
+
accept: n,
|
|
1073
1073
|
// The zone itself is not a control: the button inside is, for the keyboard and screen readers.
|
|
1074
1074
|
noClick: !0,
|
|
1075
1075
|
noKeyboard: !0
|
|
1076
1076
|
}), T = g.formatMessage(
|
|
1077
1077
|
{ id: "ds.inputs.drop-zone.browse" },
|
|
1078
|
-
{ multiple: String(
|
|
1078
|
+
{ multiple: String(t) }
|
|
1079
1079
|
);
|
|
1080
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ C(
|
|
1081
1081
|
Nt,
|
|
1082
1082
|
{
|
|
1083
1083
|
role: "group",
|
|
1084
|
-
"aria-labelledby":
|
|
1085
|
-
"aria-describedby":
|
|
1084
|
+
"aria-labelledby": u !== void 0 ? h : void 0,
|
|
1085
|
+
"aria-describedby": y !== null ? b : void 0,
|
|
1086
1086
|
children: [
|
|
1087
|
-
|
|
1088
|
-
/* @__PURE__ */
|
|
1087
|
+
u !== void 0 && /* @__PURE__ */ i(_t, { id: h, children: u }),
|
|
1088
|
+
/* @__PURE__ */ C(Bt, { ...W({ onClick: S }), active: O, children: [
|
|
1089
1089
|
/* @__PURE__ */ i("input", { ...M({ "aria-hidden": !0 }) }),
|
|
1090
|
-
|
|
1090
|
+
d ?? /* @__PURE__ */ C(J, { children: [
|
|
1091
1091
|
/* @__PURE__ */ i(Vt, { "aria-hidden": !0, children: /* @__PURE__ */ i(Mn, {}) }),
|
|
1092
1092
|
/* @__PURE__ */ i(jt, { children: g.formatMessage(
|
|
1093
1093
|
{
|
|
1094
1094
|
id: O ? "ds.inputs.drop-zone.release" : "ds.inputs.drop-zone.prompt"
|
|
1095
1095
|
},
|
|
1096
|
-
{ multiple: String(
|
|
1096
|
+
{ multiple: String(t) }
|
|
1097
1097
|
) })
|
|
1098
1098
|
] }),
|
|
1099
1099
|
/* @__PURE__ */ i(
|
|
@@ -1107,32 +1107,32 @@ function Cr({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
)
|
|
1109
1109
|
] }),
|
|
1110
|
-
(
|
|
1111
|
-
|
|
1110
|
+
(s !== void 0 || y !== null) && /* @__PURE__ */ C(Gt, { children: [
|
|
1111
|
+
s !== void 0 && /* @__PURE__ */ i(
|
|
1112
1112
|
Y,
|
|
1113
1113
|
{
|
|
1114
1114
|
variant: "text",
|
|
1115
1115
|
startIcon: /* @__PURE__ */ i(Kt, { src: In, alt: "" }),
|
|
1116
|
-
onClick: () =>
|
|
1116
|
+
onClick: () => c(!0),
|
|
1117
1117
|
children: g.formatMessage({ id: "ds.inputs.drop-zone.cloud" })
|
|
1118
1118
|
}
|
|
1119
1119
|
),
|
|
1120
|
-
|
|
1120
|
+
y !== null && /* @__PURE__ */ i(qt, { id: b, children: y })
|
|
1121
1121
|
] }),
|
|
1122
|
-
|
|
1123
|
-
{ id: `ds.inputs.drop-zone.${
|
|
1124
|
-
{ size:
|
|
1122
|
+
m !== null && /* @__PURE__ */ i(Ut, { role: "alert", children: g.formatMessage(
|
|
1123
|
+
{ id: `ds.inputs.drop-zone.${m}` },
|
|
1124
|
+
{ size: p ?? "" }
|
|
1125
1125
|
) }),
|
|
1126
|
-
|
|
1126
|
+
s !== void 0 && /* @__PURE__ */ i(
|
|
1127
1127
|
Rt,
|
|
1128
1128
|
{
|
|
1129
|
-
open:
|
|
1130
|
-
onClose: () =>
|
|
1131
|
-
onImport:
|
|
1132
|
-
cloudPicker:
|
|
1133
|
-
multiple:
|
|
1129
|
+
open: w,
|
|
1130
|
+
onClose: () => c(!1),
|
|
1131
|
+
onImport: s.onImport,
|
|
1132
|
+
cloudPicker: s,
|
|
1133
|
+
multiple: t,
|
|
1134
1134
|
maxSize: r,
|
|
1135
|
-
accept:
|
|
1135
|
+
accept: n === void 0 ? void 0 : Object.entries(n).flatMap(([z, R]) => [
|
|
1136
1136
|
z,
|
|
1137
1137
|
...R
|
|
1138
1138
|
])
|
|
@@ -1142,50 +1142,66 @@ function Cr({
|
|
|
1142
1142
|
}
|
|
1143
1143
|
);
|
|
1144
1144
|
}
|
|
1145
|
-
|
|
1146
|
-
const
|
|
1145
|
+
const Yt = 1, Qt = (e, t) => t === "vertical" ? e.scrollHeight - e.clientHeight - e.scrollTop : e.scrollWidth - e.clientWidth - e.scrollLeft, Zt = (e, t, n) => {
|
|
1146
|
+
const [r, a] = F(!1), u = Q(() => {
|
|
1147
|
+
const s = e.current;
|
|
1148
|
+
s !== null && a(Qt(s, t) > Yt);
|
|
1149
|
+
}, [e, t]);
|
|
1150
|
+
return Le(u, [u, n]), V(() => {
|
|
1151
|
+
const s = e.current;
|
|
1152
|
+
if (s === null)
|
|
1153
|
+
return;
|
|
1154
|
+
s.addEventListener("scroll", u, { passive: !0 });
|
|
1155
|
+
const d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
1156
|
+
return d !== null && (d.observe(s), Array.from(s.children).forEach((g) => d.observe(g))), () => {
|
|
1157
|
+
s.removeEventListener("scroll", u), d == null || d.disconnect();
|
|
1158
|
+
};
|
|
1159
|
+
}, [e, u, n]), r;
|
|
1160
|
+
};
|
|
1161
|
+
var Jt = /* @__PURE__ */ ((e) => (e.Default = "default", e.Danger = "danger", e.Warning = "warning", e))(Jt || {});
|
|
1162
|
+
const eo = l("form")(({ theme: e }) => ({
|
|
1147
1163
|
display: "flex",
|
|
1148
1164
|
flexDirection: "column",
|
|
1149
1165
|
gap: o(e.design.space[4]),
|
|
1150
1166
|
color: e.design.tokens["text.secondary"],
|
|
1151
1167
|
overflowWrap: "anywhere"
|
|
1152
|
-
})),
|
|
1153
|
-
const { paper:
|
|
1154
|
-
return ke(
|
|
1155
|
-
},
|
|
1168
|
+
})), no = (e, t) => {
|
|
1169
|
+
const { paper: n } = e.design.tokens, r = e.design.tokens["paper.on"];
|
|
1170
|
+
return ke(t, n) >= ke(t, r) ? n : r;
|
|
1171
|
+
}, to = {
|
|
1156
1172
|
default: "primary",
|
|
1157
1173
|
danger: "error",
|
|
1158
1174
|
warning: "warning"
|
|
1159
1175
|
};
|
|
1160
|
-
function
|
|
1176
|
+
function oo({
|
|
1161
1177
|
open: e,
|
|
1162
|
-
title:
|
|
1163
|
-
body:
|
|
1178
|
+
title: t,
|
|
1179
|
+
body: n,
|
|
1164
1180
|
confirmLabel: r,
|
|
1165
|
-
tone:
|
|
1166
|
-
confirmationText:
|
|
1167
|
-
onConfirm:
|
|
1168
|
-
onCancel:
|
|
1181
|
+
tone: a = "default",
|
|
1182
|
+
confirmationText: u,
|
|
1183
|
+
onConfirm: s,
|
|
1184
|
+
onCancel: d
|
|
1169
1185
|
}) {
|
|
1170
|
-
const g = P(),
|
|
1171
|
-
e !== v && (W(e), e && (
|
|
1172
|
-
const M = !
|
|
1173
|
-
|
|
1186
|
+
const g = P(), h = bn(), b = N(), [m, f] = F(""), [w, c] = F(!1), [p, y] = F(!1), [v, W] = F(e);
|
|
1187
|
+
e !== v && (W(e), e && (f(""), y(!1)));
|
|
1188
|
+
const M = !w && (u === void 0 || m === u), O = a !== "default", S = () => {
|
|
1189
|
+
w || d();
|
|
1174
1190
|
}, T = () => {
|
|
1175
1191
|
if (!M)
|
|
1176
1192
|
return;
|
|
1177
|
-
|
|
1193
|
+
y(!1);
|
|
1178
1194
|
let R;
|
|
1179
1195
|
try {
|
|
1180
|
-
R =
|
|
1196
|
+
R = s();
|
|
1181
1197
|
} catch {
|
|
1182
|
-
|
|
1198
|
+
y(!0);
|
|
1183
1199
|
return;
|
|
1184
1200
|
}
|
|
1185
|
-
R instanceof Promise && (
|
|
1186
|
-
() =>
|
|
1201
|
+
R instanceof Promise && (c(!0), R.then(
|
|
1202
|
+
() => c(!1),
|
|
1187
1203
|
() => {
|
|
1188
|
-
|
|
1204
|
+
c(!1), y(!0);
|
|
1189
1205
|
}
|
|
1190
1206
|
));
|
|
1191
1207
|
}, z = (R) => {
|
|
@@ -1197,14 +1213,14 @@ function eo({
|
|
|
1197
1213
|
open: e,
|
|
1198
1214
|
onClose: S,
|
|
1199
1215
|
size: He.Small,
|
|
1200
|
-
title:
|
|
1201
|
-
actions: /* @__PURE__ */
|
|
1216
|
+
title: t,
|
|
1217
|
+
actions: /* @__PURE__ */ C(J, { children: [
|
|
1202
1218
|
/* @__PURE__ */ i(
|
|
1203
1219
|
Y,
|
|
1204
1220
|
{
|
|
1205
1221
|
variant: "outlined",
|
|
1206
|
-
disabled:
|
|
1207
|
-
autoFocus:
|
|
1222
|
+
disabled: w,
|
|
1223
|
+
autoFocus: u === void 0 && O,
|
|
1208
1224
|
onClick: S,
|
|
1209
1225
|
children: g.formatMessage({ id: "ds.layers.confirm-dialog.cancel" })
|
|
1210
1226
|
}
|
|
@@ -1213,17 +1229,17 @@ function eo({
|
|
|
1213
1229
|
Y,
|
|
1214
1230
|
{
|
|
1215
1231
|
type: "submit",
|
|
1216
|
-
form:
|
|
1232
|
+
form: b,
|
|
1217
1233
|
variant: "contained",
|
|
1218
|
-
color:
|
|
1234
|
+
color: to[a],
|
|
1219
1235
|
disabled: !M,
|
|
1220
|
-
loading:
|
|
1221
|
-
autoFocus:
|
|
1222
|
-
sx:
|
|
1236
|
+
loading: w,
|
|
1237
|
+
autoFocus: u === void 0 && !O,
|
|
1238
|
+
sx: a === "warning" ? {
|
|
1223
1239
|
"&:not(.Mui-disabled)": {
|
|
1224
|
-
color:
|
|
1225
|
-
|
|
1226
|
-
|
|
1240
|
+
color: no(
|
|
1241
|
+
h,
|
|
1242
|
+
h.design.tokens["status.warning"]
|
|
1227
1243
|
)
|
|
1228
1244
|
}
|
|
1229
1245
|
} : void 0,
|
|
@@ -1231,59 +1247,59 @@ function eo({
|
|
|
1231
1247
|
}
|
|
1232
1248
|
)
|
|
1233
1249
|
] }),
|
|
1234
|
-
children: /* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */ i("div", { children:
|
|
1236
|
-
|
|
1250
|
+
children: /* @__PURE__ */ C(eo, { id: b, onSubmit: z, noValidate: !0, children: [
|
|
1251
|
+
/* @__PURE__ */ i("div", { children: n }),
|
|
1252
|
+
u !== void 0 && /* @__PURE__ */ i(
|
|
1237
1253
|
Vn,
|
|
1238
1254
|
{
|
|
1239
1255
|
label: g.formatMessage(
|
|
1240
1256
|
{ id: "ds.layers.confirm-dialog.type-to-confirm" },
|
|
1241
|
-
{ text:
|
|
1257
|
+
{ text: u }
|
|
1242
1258
|
),
|
|
1243
|
-
value:
|
|
1244
|
-
onChange: (R) =>
|
|
1245
|
-
disabled:
|
|
1259
|
+
value: m,
|
|
1260
|
+
onChange: (R) => f(R.target.value),
|
|
1261
|
+
disabled: w,
|
|
1246
1262
|
autoFocus: !0,
|
|
1247
1263
|
autoComplete: "off",
|
|
1248
1264
|
fullWidth: !0
|
|
1249
1265
|
}
|
|
1250
1266
|
),
|
|
1251
|
-
|
|
1267
|
+
p && /* @__PURE__ */ i(Bn, { severity: "error", children: g.formatMessage({ id: "ds.layers.confirm-dialog.failed" }) })
|
|
1252
1268
|
] })
|
|
1253
1269
|
}
|
|
1254
1270
|
);
|
|
1255
1271
|
}
|
|
1256
1272
|
const tn = ze(null);
|
|
1257
1273
|
function kr({ children: e }) {
|
|
1258
|
-
const [
|
|
1259
|
-
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1274
|
+
const [t, n] = F([]), [r, a] = F(null), u = X(0), s = X([]);
|
|
1275
|
+
s.current = t;
|
|
1276
|
+
const d = t.length > 0 ? t[0] : null;
|
|
1277
|
+
d !== null && d !== r && a(d), V(
|
|
1262
1278
|
() => () => {
|
|
1263
|
-
|
|
1279
|
+
s.current.forEach((m) => m.resolve(!1));
|
|
1264
1280
|
},
|
|
1265
1281
|
[]
|
|
1266
1282
|
);
|
|
1267
1283
|
const g = Q(
|
|
1268
|
-
(
|
|
1269
|
-
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1284
|
+
(m) => new Promise((f) => {
|
|
1285
|
+
u.current += 1;
|
|
1286
|
+
const w = { id: u.current, options: m, resolve: f };
|
|
1287
|
+
n((c) => [...c, w]);
|
|
1272
1288
|
}),
|
|
1273
1289
|
[]
|
|
1274
|
-
),
|
|
1275
|
-
|
|
1276
|
-
},
|
|
1277
|
-
return /* @__PURE__ */
|
|
1290
|
+
), h = (m) => {
|
|
1291
|
+
d !== null && (d.resolve(m), n((f) => f.filter((w) => w !== d)));
|
|
1292
|
+
}, b = ge(() => ({ confirm: g }), [g]);
|
|
1293
|
+
return /* @__PURE__ */ C(tn.Provider, { value: b, children: [
|
|
1278
1294
|
e,
|
|
1279
1295
|
r !== null && // A new key per request: each one starts from an empty confirmation field.
|
|
1280
1296
|
/* @__PURE__ */ i(
|
|
1281
|
-
|
|
1297
|
+
oo,
|
|
1282
1298
|
{
|
|
1283
|
-
open:
|
|
1299
|
+
open: d === r,
|
|
1284
1300
|
...r.options,
|
|
1285
|
-
onConfirm: () =>
|
|
1286
|
-
onCancel: () =>
|
|
1301
|
+
onConfirm: () => h(!0),
|
|
1302
|
+
onCancel: () => h(!1)
|
|
1287
1303
|
},
|
|
1288
1304
|
r.id
|
|
1289
1305
|
)
|
|
@@ -1297,19 +1313,19 @@ function Sr() {
|
|
|
1297
1313
|
);
|
|
1298
1314
|
return e;
|
|
1299
1315
|
}
|
|
1300
|
-
var
|
|
1301
|
-
const
|
|
1302
|
-
const { tokens:
|
|
1316
|
+
var ro = /* @__PURE__ */ ((e) => (e.BottomStart = "bottom-start", e.BottomEnd = "bottom-end", e))(ro || {});
|
|
1317
|
+
const io = 320, so = l("div")(({ theme: e }) => {
|
|
1318
|
+
const { tokens: t, space: n } = e.design;
|
|
1303
1319
|
return {
|
|
1304
1320
|
flex: "none",
|
|
1305
1321
|
display: "flex",
|
|
1306
1322
|
alignItems: "center",
|
|
1307
1323
|
justifyContent: "space-between",
|
|
1308
|
-
gap: o(
|
|
1309
|
-
padding: `${o(
|
|
1310
|
-
borderBottom: D(
|
|
1324
|
+
gap: o(n[3]),
|
|
1325
|
+
padding: `${o(n[2])} ${o(n[2])} ${o(n[2])} ${o(n[4])}`,
|
|
1326
|
+
borderBottom: D(t["border.subtle"])
|
|
1311
1327
|
};
|
|
1312
|
-
}),
|
|
1328
|
+
}), ao = l("h2")(({ theme: e }) => ({
|
|
1313
1329
|
margin: 0,
|
|
1314
1330
|
minWidth: 0,
|
|
1315
1331
|
color: e.design.tokens["text.primary"],
|
|
@@ -1321,147 +1337,147 @@ const to = 320, oo = l("div")(({ theme: e }) => {
|
|
|
1321
1337
|
flexDirection: "column",
|
|
1322
1338
|
gap: o(e.design.space[3]),
|
|
1323
1339
|
fontSize: o(e.design.typeScale.body)
|
|
1324
|
-
})),
|
|
1340
|
+
})), lo = l(on)(({ theme: e }) => ({
|
|
1325
1341
|
padding: o(e.design.space[4])
|
|
1326
1342
|
}));
|
|
1327
1343
|
function Ir({
|
|
1328
1344
|
anchorEl: e,
|
|
1329
|
-
open:
|
|
1330
|
-
onClose:
|
|
1345
|
+
open: t,
|
|
1346
|
+
onClose: n,
|
|
1331
1347
|
title: r,
|
|
1332
|
-
placement:
|
|
1333
|
-
width:
|
|
1334
|
-
children:
|
|
1348
|
+
placement: a = "bottom-start",
|
|
1349
|
+
width: u = io,
|
|
1350
|
+
children: s
|
|
1335
1351
|
}) {
|
|
1336
|
-
const
|
|
1352
|
+
const d = P(), g = N(), h = vn() === K.Mobile, b = d.formatMessage({
|
|
1337
1353
|
id: "ds.layers.anchored-panel.close"
|
|
1338
|
-
}),
|
|
1339
|
-
if (
|
|
1354
|
+
}), m = t && e !== null;
|
|
1355
|
+
if (h)
|
|
1340
1356
|
return /* @__PURE__ */ i(
|
|
1341
1357
|
wn,
|
|
1342
1358
|
{
|
|
1343
|
-
open:
|
|
1344
|
-
onClose:
|
|
1359
|
+
open: m,
|
|
1360
|
+
onClose: n,
|
|
1345
1361
|
title: r,
|
|
1346
|
-
closeLabel:
|
|
1347
|
-
children: /* @__PURE__ */ i(on, { children:
|
|
1362
|
+
closeLabel: b,
|
|
1363
|
+
children: /* @__PURE__ */ i(on, { children: s })
|
|
1348
1364
|
}
|
|
1349
1365
|
);
|
|
1350
|
-
const
|
|
1351
|
-
return /* @__PURE__ */
|
|
1366
|
+
const f = a === "bottom-end" ? "right" : "left";
|
|
1367
|
+
return /* @__PURE__ */ C(
|
|
1352
1368
|
jn,
|
|
1353
1369
|
{
|
|
1354
1370
|
anchorEl: e,
|
|
1355
|
-
open:
|
|
1356
|
-
onClose: () =>
|
|
1357
|
-
anchorOrigin: { vertical: "bottom", horizontal:
|
|
1358
|
-
transformOrigin: { vertical: "top", horizontal:
|
|
1371
|
+
open: m,
|
|
1372
|
+
onClose: () => n(),
|
|
1373
|
+
anchorOrigin: { vertical: "bottom", horizontal: f },
|
|
1374
|
+
transformOrigin: { vertical: "top", horizontal: f },
|
|
1359
1375
|
slotProps: {
|
|
1360
1376
|
paper: {
|
|
1361
1377
|
role: "dialog",
|
|
1362
1378
|
"aria-modal": !0,
|
|
1363
1379
|
"aria-labelledby": g,
|
|
1364
|
-
sx: (
|
|
1365
|
-
width: o(
|
|
1366
|
-
maxWidth: `calc(100vw - ${o(
|
|
1367
|
-
marginTop: o(
|
|
1368
|
-
color:
|
|
1369
|
-
fontFamily:
|
|
1380
|
+
sx: (w) => ({
|
|
1381
|
+
width: o(u),
|
|
1382
|
+
maxWidth: `calc(100vw - ${o(w.design.space[4] * 2)})`,
|
|
1383
|
+
marginTop: o(w.design.space[1]),
|
|
1384
|
+
color: w.design.tokens["text.primary"],
|
|
1385
|
+
fontFamily: w.design.fonts.sans
|
|
1370
1386
|
})
|
|
1371
1387
|
}
|
|
1372
1388
|
},
|
|
1373
1389
|
children: [
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */ i(
|
|
1376
|
-
/* @__PURE__ */ i(ae, { "aria-label":
|
|
1390
|
+
/* @__PURE__ */ C(so, { children: [
|
|
1391
|
+
/* @__PURE__ */ i(ao, { id: g, children: r }),
|
|
1392
|
+
/* @__PURE__ */ i(ae, { "aria-label": b, onClick: n, children: /* @__PURE__ */ i(_e, { "aria-hidden": !0 }) })
|
|
1377
1393
|
] }),
|
|
1378
|
-
/* @__PURE__ */ i(
|
|
1394
|
+
/* @__PURE__ */ i(lo, { children: s })
|
|
1379
1395
|
]
|
|
1380
1396
|
}
|
|
1381
1397
|
);
|
|
1382
1398
|
}
|
|
1383
|
-
const
|
|
1399
|
+
const co = [32, 160, 8239, 8201].map(
|
|
1384
1400
|
(e) => String.fromCharCode(e)
|
|
1385
|
-
),
|
|
1386
|
-
var
|
|
1387
|
-
const
|
|
1401
|
+
), uo = (e) => {
|
|
1402
|
+
var n, r;
|
|
1403
|
+
const t = new Intl.NumberFormat(e).formatToParts(11111.1);
|
|
1388
1404
|
return {
|
|
1389
|
-
group: ((
|
|
1390
|
-
decimal: ((r =
|
|
1405
|
+
group: ((n = t.find((a) => a.type === "group")) == null ? void 0 : n.value) ?? " ",
|
|
1406
|
+
decimal: ((r = t.find((a) => a.type === "decimal")) == null ? void 0 : r.value) ?? "."
|
|
1391
1407
|
};
|
|
1392
|
-
}, Re = (e,
|
|
1393
|
-
const r = [
|
|
1394
|
-
(
|
|
1408
|
+
}, Re = (e, t) => {
|
|
1409
|
+
const r = [t.group, ...co].reduce(
|
|
1410
|
+
(u, s) => u.split(s).join(""),
|
|
1395
1411
|
e.trim()
|
|
1396
1412
|
).replace(",", ".");
|
|
1397
1413
|
if (r === "" || !/^-?\d*\.?\d+$|^-?\d+\.$/.test(r))
|
|
1398
1414
|
return null;
|
|
1399
|
-
const
|
|
1400
|
-
return Number.isFinite(
|
|
1401
|
-
},
|
|
1415
|
+
const a = Number.parseFloat(r);
|
|
1416
|
+
return Number.isFinite(a) ? a : null;
|
|
1417
|
+
}, po = l("div", {
|
|
1402
1418
|
shouldForwardProp: (e) => e !== "labelHidden"
|
|
1403
1419
|
})(({ labelHidden: e }) => ({
|
|
1404
1420
|
...e && { [`& .${qn.root}`]: fe }
|
|
1405
1421
|
}));
|
|
1406
1422
|
function Fr({
|
|
1407
1423
|
label: e,
|
|
1408
|
-
value:
|
|
1409
|
-
onChange:
|
|
1424
|
+
value: t,
|
|
1425
|
+
onChange: n,
|
|
1410
1426
|
decimals: r = 0,
|
|
1411
|
-
min:
|
|
1412
|
-
max:
|
|
1413
|
-
hideLabel:
|
|
1414
|
-
ariaLabel:
|
|
1427
|
+
min: a = 0,
|
|
1428
|
+
max: u,
|
|
1429
|
+
hideLabel: s = !1,
|
|
1430
|
+
ariaLabel: d,
|
|
1415
1431
|
help: g,
|
|
1416
|
-
error:
|
|
1417
|
-
testId:
|
|
1418
|
-
disabled:
|
|
1419
|
-
adornment:
|
|
1432
|
+
error: h,
|
|
1433
|
+
testId: b,
|
|
1434
|
+
disabled: m,
|
|
1435
|
+
adornment: f
|
|
1420
1436
|
}) {
|
|
1421
|
-
const
|
|
1422
|
-
() =>
|
|
1423
|
-
[
|
|
1424
|
-
),
|
|
1425
|
-
(S) => S === null ? "" :
|
|
1437
|
+
const w = P(), c = ge(
|
|
1438
|
+
() => uo(w.locale),
|
|
1439
|
+
[w.locale]
|
|
1440
|
+
), p = Q(
|
|
1441
|
+
(S) => S === null ? "" : w.formatNumber(S, {
|
|
1426
1442
|
minimumFractionDigits: r,
|
|
1427
1443
|
maximumFractionDigits: r
|
|
1428
1444
|
}),
|
|
1429
|
-
[
|
|
1430
|
-
), [
|
|
1445
|
+
[w, r]
|
|
1446
|
+
), [y, v] = F(!1), [W, M] = F(() => p(t));
|
|
1431
1447
|
return V(() => {
|
|
1432
|
-
|
|
1433
|
-
}, [
|
|
1448
|
+
y || M(p(t));
|
|
1449
|
+
}, [t, y, p]), /* @__PURE__ */ i(po, { labelHidden: s, children: /* @__PURE__ */ i(Ve, { label: e, help: g, error: h, children: /* @__PURE__ */ i(
|
|
1434
1450
|
me,
|
|
1435
1451
|
{
|
|
1436
|
-
disabled:
|
|
1452
|
+
disabled: m,
|
|
1437
1453
|
value: W,
|
|
1438
1454
|
inputProps: {
|
|
1439
1455
|
inputMode: "decimal",
|
|
1440
|
-
"aria-label":
|
|
1441
|
-
"data-testid":
|
|
1456
|
+
"aria-label": d,
|
|
1457
|
+
"data-testid": b
|
|
1442
1458
|
},
|
|
1443
1459
|
onFocus: () => {
|
|
1444
|
-
v(!0),
|
|
1460
|
+
v(!0), t !== null && M(String(t).replace(".", c.decimal));
|
|
1445
1461
|
},
|
|
1446
1462
|
onChange: (S) => {
|
|
1447
1463
|
M(S.target.value);
|
|
1448
|
-
const T = Re(S.target.value,
|
|
1449
|
-
T !== null ?
|
|
1464
|
+
const T = Re(S.target.value, c);
|
|
1465
|
+
T !== null ? n(T) : S.target.value === "" && n(null);
|
|
1450
1466
|
},
|
|
1451
1467
|
onBlur: () => {
|
|
1452
1468
|
v(!1);
|
|
1453
|
-
let S = Re(W,
|
|
1469
|
+
let S = Re(W, c);
|
|
1454
1470
|
if (S !== null) {
|
|
1455
|
-
const T = Math.max(S,
|
|
1471
|
+
const T = Math.max(S, a);
|
|
1456
1472
|
S = Number.parseFloat(
|
|
1457
|
-
(
|
|
1473
|
+
(u === void 0 ? T : Math.min(T, u)).toFixed(
|
|
1458
1474
|
r
|
|
1459
1475
|
)
|
|
1460
1476
|
);
|
|
1461
1477
|
}
|
|
1462
|
-
|
|
1478
|
+
n(S), M(p(S));
|
|
1463
1479
|
},
|
|
1464
|
-
endAdornment:
|
|
1480
|
+
endAdornment: f ? /* @__PURE__ */ i(Un, { position: "end", children: f }) : void 0
|
|
1465
1481
|
}
|
|
1466
1482
|
) }) });
|
|
1467
1483
|
}
|
|
@@ -1491,29 +1507,29 @@ const Wr = { l: 0.72, c: 0.12 }, Mr = [
|
|
|
1491
1507
|
"#37bda2",
|
|
1492
1508
|
"#18b9c9",
|
|
1493
1509
|
"#4eb0e5"
|
|
1494
|
-
], Or = "#767676", Tr = rn[6], Rr = "#111a2f", Er = "#5674be",
|
|
1495
|
-
const
|
|
1496
|
-
return
|
|
1497
|
-
},
|
|
1510
|
+
], Or = "#767676", Tr = rn[6], Rr = "#111a2f", Er = "#5674be", go = /^#?([0-9a-f]{6})$/i, q = (e) => {
|
|
1511
|
+
const t = go.exec(e.trim());
|
|
1512
|
+
return t ? `#${t[1].toLowerCase()}` : null;
|
|
1513
|
+
}, fo = l("div")(({ theme: e }) => ({
|
|
1498
1514
|
display: "flex",
|
|
1499
1515
|
alignItems: "center",
|
|
1500
1516
|
gap: o(e.design.space[3])
|
|
1501
|
-
})),
|
|
1517
|
+
})), mo = l("span")(({ theme: e }) => ({
|
|
1502
1518
|
flex: "none",
|
|
1503
1519
|
width: o(e.design.densityValues[e.design.density].control),
|
|
1504
1520
|
height: o(e.design.densityValues[e.design.density].control),
|
|
1505
1521
|
borderRadius: o(e.design.radii.md),
|
|
1506
1522
|
border: D(e.design.tokens["border.control"])
|
|
1507
|
-
})),
|
|
1523
|
+
})), ho = l("div")(({ theme: e }) => ({
|
|
1508
1524
|
display: "flex",
|
|
1509
1525
|
flexWrap: "wrap",
|
|
1510
1526
|
gap: o(e.design.space[2]),
|
|
1511
1527
|
marginTop: o(e.design.space[2])
|
|
1512
|
-
})),
|
|
1513
|
-
const { densityValues:
|
|
1528
|
+
})), bo = l(Be)(({ theme: e }) => {
|
|
1529
|
+
const { densityValues: t, density: n, space: r } = e.design, a = t[n].control - r[2];
|
|
1514
1530
|
return {
|
|
1515
|
-
width: o(
|
|
1516
|
-
height: o(
|
|
1531
|
+
width: o(a),
|
|
1532
|
+
height: o(a),
|
|
1517
1533
|
borderRadius: o(e.design.radii.sm),
|
|
1518
1534
|
border: D(e.design.tokens["border.control"]),
|
|
1519
1535
|
// The chosen swatch carries the ring of the design system (`focus.ring` is the accent).
|
|
@@ -1527,105 +1543,115 @@ const Wr = { l: 0.72, c: 0.12 }, Mr = [
|
|
|
1527
1543
|
});
|
|
1528
1544
|
function zr({
|
|
1529
1545
|
label: e,
|
|
1530
|
-
value:
|
|
1531
|
-
onChange:
|
|
1546
|
+
value: t,
|
|
1547
|
+
onChange: n,
|
|
1532
1548
|
swatches: r = rn
|
|
1533
1549
|
}) {
|
|
1534
|
-
const
|
|
1550
|
+
const a = P(), u = N(), [s, d] = F(t), g = s !== "" && q(s) === null;
|
|
1535
1551
|
V(() => {
|
|
1536
|
-
|
|
1537
|
-
(
|
|
1552
|
+
d(
|
|
1553
|
+
(m) => q(m) === q(t) ? m : t
|
|
1538
1554
|
);
|
|
1539
|
-
}, [
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1544
|
-
},
|
|
1545
|
-
return /* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */ i($e, { htmlFor: `${
|
|
1547
|
-
/* @__PURE__ */
|
|
1555
|
+
}, [t]);
|
|
1556
|
+
const h = (m) => {
|
|
1557
|
+
d(m);
|
|
1558
|
+
const f = q(m);
|
|
1559
|
+
f !== null && f !== q(t) && n(f);
|
|
1560
|
+
}, b = q(t);
|
|
1561
|
+
return /* @__PURE__ */ C(le, { fullWidth: !0, error: g, children: [
|
|
1562
|
+
/* @__PURE__ */ i($e, { htmlFor: `${u}-hex`, children: e }),
|
|
1563
|
+
/* @__PURE__ */ C(fo, { children: [
|
|
1548
1564
|
/* @__PURE__ */ i(
|
|
1549
|
-
|
|
1565
|
+
mo,
|
|
1550
1566
|
{
|
|
1551
1567
|
"aria-hidden": "true",
|
|
1552
|
-
style: { backgroundColor:
|
|
1568
|
+
style: { backgroundColor: b ?? void 0 }
|
|
1553
1569
|
}
|
|
1554
1570
|
),
|
|
1555
1571
|
/* @__PURE__ */ i(
|
|
1556
1572
|
me,
|
|
1557
1573
|
{
|
|
1558
|
-
id: `${
|
|
1574
|
+
id: `${u}-hex`,
|
|
1559
1575
|
fullWidth: !0,
|
|
1560
|
-
value:
|
|
1576
|
+
value: s,
|
|
1561
1577
|
error: g,
|
|
1562
1578
|
inputProps: {
|
|
1563
|
-
"aria-describedby": g ? `${
|
|
1579
|
+
"aria-describedby": g ? `${u}-error` : void 0,
|
|
1564
1580
|
spellCheck: !1,
|
|
1565
1581
|
autoComplete: "off"
|
|
1566
1582
|
},
|
|
1567
|
-
onChange: (
|
|
1583
|
+
onChange: (m) => h(m.target.value)
|
|
1568
1584
|
}
|
|
1569
1585
|
)
|
|
1570
1586
|
] }),
|
|
1571
|
-
g && /* @__PURE__ */ i(se, { id: `${
|
|
1587
|
+
g && /* @__PURE__ */ i(se, { id: `${u}-error`, children: a.formatMessage({ id: "ds.inputs.color.invalid" }) }),
|
|
1572
1588
|
/* @__PURE__ */ i(
|
|
1573
|
-
|
|
1589
|
+
ho,
|
|
1574
1590
|
{
|
|
1575
1591
|
role: "group",
|
|
1576
|
-
"aria-label":
|
|
1577
|
-
children: r.map((
|
|
1578
|
-
|
|
1592
|
+
"aria-label": a.formatMessage({ id: "ds.inputs.color.swatches" }),
|
|
1593
|
+
children: r.map((m) => /* @__PURE__ */ i(
|
|
1594
|
+
bo,
|
|
1579
1595
|
{
|
|
1580
|
-
"aria-pressed": q(
|
|
1581
|
-
"aria-label":
|
|
1582
|
-
style: { backgroundColor:
|
|
1583
|
-
onClick: () =>
|
|
1596
|
+
"aria-pressed": q(m) === b,
|
|
1597
|
+
"aria-label": m,
|
|
1598
|
+
style: { backgroundColor: m },
|
|
1599
|
+
onClick: () => n(q(m) ?? m)
|
|
1584
1600
|
},
|
|
1585
|
-
|
|
1601
|
+
m
|
|
1586
1602
|
))
|
|
1587
1603
|
}
|
|
1588
1604
|
)
|
|
1589
1605
|
] });
|
|
1590
1606
|
}
|
|
1591
|
-
const
|
|
1592
|
-
shouldForwardProp: (e) => e !== "edges"
|
|
1593
|
-
})(({ theme: e, edges: n }) => {
|
|
1594
|
-
const { tokens:
|
|
1607
|
+
const yo = 6, vo = l("div", {
|
|
1608
|
+
shouldForwardProp: (e) => e !== "edges" && e !== "wrapped"
|
|
1609
|
+
})(({ theme: e, edges: t, wrapped: n }) => {
|
|
1610
|
+
const { tokens: r, radii: a, space: u } = e.design, s = o(u[1] * yo), d = r["text.primary"], g = t.start ? `transparent, ${d} ${s}` : d, h = t.end ? `${d} calc(100% - ${s}), transparent` : d, b = {
|
|
1611
|
+
flexWrap: "wrap",
|
|
1612
|
+
rowGap: o(u[1]),
|
|
1613
|
+
columnGap: o(u[1]),
|
|
1614
|
+
overflowX: "visible",
|
|
1615
|
+
maskImage: "none",
|
|
1616
|
+
border: "none",
|
|
1617
|
+
backgroundColor: "transparent"
|
|
1618
|
+
};
|
|
1595
1619
|
return {
|
|
1596
|
-
maskImage:
|
|
1620
|
+
maskImage: t.start || t.end ? `linear-gradient(to right, ${g}, ${h})` : "none",
|
|
1597
1621
|
display: "inline-flex",
|
|
1598
1622
|
maxWidth: "100%",
|
|
1599
1623
|
minWidth: 0,
|
|
1600
|
-
border: D(
|
|
1601
|
-
borderRadius: o(
|
|
1624
|
+
border: D(r["border.subtle"]),
|
|
1625
|
+
borderRadius: o(a.md),
|
|
1602
1626
|
overflowX: "auto",
|
|
1603
1627
|
overflowY: "hidden",
|
|
1604
|
-
backgroundColor:
|
|
1628
|
+
backgroundColor: r["bg.surface"],
|
|
1605
1629
|
// Below 768 px each segment keeps a 44 px target: the band wraps onto more rows rather than
|
|
1606
1630
|
// hiding segments behind a sideways scroll. A rule between neighbours would then start the
|
|
1607
1631
|
// second row with a stray line and leave the rows unsplit: the band loses its border and each
|
|
1608
1632
|
// segment draws its own, apart by a gap in both directions.
|
|
1609
|
-
[Z.down(K.Tablet)]:
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1633
|
+
[Z.down(K.Tablet)]: b,
|
|
1634
|
+
...n && b
|
|
1635
|
+
};
|
|
1636
|
+
}), wo = l(Be, {
|
|
1637
|
+
shouldForwardProp: (e) => e !== "wrapped"
|
|
1638
|
+
})(({ theme: e, wrapped: t }) => {
|
|
1639
|
+
const { tokens: n, space: r, typeScale: a, fonts: u, densityValues: s, radii: d } = e.design, g = {
|
|
1640
|
+
minWidth: o(s.touchTarget),
|
|
1641
|
+
minHeight: o(s.touchTarget),
|
|
1642
|
+
border: D(n["border.subtle"]),
|
|
1643
|
+
borderRadius: o(d.md),
|
|
1644
|
+
backgroundColor: n["bg.surface"],
|
|
1645
|
+
'&[aria-checked="true"]': { backgroundColor: n["bg.raised"] }
|
|
1618
1646
|
};
|
|
1619
|
-
}), bo = l(Be)(({ theme: e }) => {
|
|
1620
|
-
const { tokens: n, space: t, typeScale: r, fonts: s, densityValues: d, radii: a } = e.design;
|
|
1621
1647
|
return {
|
|
1622
1648
|
flex: "none",
|
|
1623
|
-
gap: o(
|
|
1624
|
-
minHeight: o(
|
|
1625
|
-
paddingLeft: o(
|
|
1626
|
-
paddingRight: o(
|
|
1627
|
-
fontFamily:
|
|
1628
|
-
fontSize: o(
|
|
1649
|
+
gap: o(r[2]),
|
|
1650
|
+
minHeight: o(s[e.design.density].control),
|
|
1651
|
+
paddingLeft: o(r[3]),
|
|
1652
|
+
paddingRight: o(r[3]),
|
|
1653
|
+
fontFamily: u.sans,
|
|
1654
|
+
fontSize: o(a.body),
|
|
1629
1655
|
whiteSpace: "nowrap",
|
|
1630
1656
|
color: n["text.secondary"],
|
|
1631
1657
|
transition: oe(e, ["background-color", "color"]),
|
|
@@ -1639,147 +1665,128 @@ const mo = 6, ho = l("div", {
|
|
|
1639
1665
|
"&.Mui-focusVisible": { ...te(e), outlineOffset: "-2px" },
|
|
1640
1666
|
// A short label (« 1 h », « 7 j ») would leave a segment narrower than a finger. Each segment
|
|
1641
1667
|
// is its own bordered tile once the band wraps.
|
|
1642
|
-
[Z.down(K.Tablet)]:
|
|
1643
|
-
|
|
1644
|
-
minHeight: o(d.touchTarget),
|
|
1645
|
-
border: D(n["border.subtle"]),
|
|
1646
|
-
borderRadius: o(a.md),
|
|
1647
|
-
backgroundColor: n["bg.surface"],
|
|
1648
|
-
'&[aria-checked="true"]': { backgroundColor: n["bg.raised"] }
|
|
1649
|
-
}
|
|
1668
|
+
[Z.down(K.Tablet)]: g,
|
|
1669
|
+
...t && g
|
|
1650
1670
|
};
|
|
1651
|
-
}),
|
|
1671
|
+
}), xo = l("span")(({ theme: e }) => ({
|
|
1652
1672
|
display: "inline-flex",
|
|
1653
1673
|
flex: "none",
|
|
1654
1674
|
"& svg": {
|
|
1655
1675
|
width: o(e.design.space[4]),
|
|
1656
1676
|
height: o(e.design.space[4])
|
|
1657
1677
|
}
|
|
1658
|
-
})),
|
|
1678
|
+
})), Co = l("span")(fe), ko = l("span")(({ theme: e }) => ({
|
|
1659
1679
|
fontFamily: e.design.fonts.mono,
|
|
1660
1680
|
fontSize: o(e.design.typeScale.caption),
|
|
1661
1681
|
color: e.design.tokens["text.muted"]
|
|
1662
1682
|
}));
|
|
1663
1683
|
function Ar({
|
|
1664
1684
|
options: e,
|
|
1665
|
-
value:
|
|
1666
|
-
onChange:
|
|
1685
|
+
value: t,
|
|
1686
|
+
onChange: n,
|
|
1667
1687
|
ariaLabel: r,
|
|
1668
|
-
testId:
|
|
1688
|
+
testId: a,
|
|
1689
|
+
wrap: u = !1
|
|
1669
1690
|
}) {
|
|
1670
|
-
const
|
|
1671
|
-
const
|
|
1672
|
-
if (!
|
|
1691
|
+
const s = X(null), [d, g] = F({ start: !1, end: !1 }), h = Q(() => {
|
|
1692
|
+
const f = s.current;
|
|
1693
|
+
if (!f)
|
|
1673
1694
|
return;
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1676
|
-
(p) => p.start ===
|
|
1695
|
+
const w = f.scrollLeft > 0, c = f.scrollLeft + f.clientWidth < f.scrollWidth - 1;
|
|
1696
|
+
g(
|
|
1697
|
+
(p) => p.start === w && p.end === c ? p : { start: w, end: c }
|
|
1677
1698
|
);
|
|
1678
1699
|
}, []);
|
|
1679
|
-
V(() => (
|
|
1680
|
-
const
|
|
1681
|
-
var p,
|
|
1682
|
-
const
|
|
1683
|
-
let
|
|
1684
|
-
switch (
|
|
1700
|
+
V(() => (h(), window.addEventListener("resize", h), () => window.removeEventListener("resize", h)), [h, e]);
|
|
1701
|
+
const b = (f) => {
|
|
1702
|
+
var p, y;
|
|
1703
|
+
const w = e.findIndex((v) => v.value === t);
|
|
1704
|
+
let c;
|
|
1705
|
+
switch (f.key) {
|
|
1685
1706
|
case "ArrowRight":
|
|
1686
1707
|
case "ArrowDown":
|
|
1687
|
-
|
|
1708
|
+
c = (w + 1) % e.length;
|
|
1688
1709
|
break;
|
|
1689
1710
|
case "ArrowLeft":
|
|
1690
1711
|
case "ArrowUp":
|
|
1691
|
-
|
|
1712
|
+
c = (w - 1 + e.length) % e.length;
|
|
1692
1713
|
break;
|
|
1693
1714
|
case "Home":
|
|
1694
|
-
|
|
1715
|
+
c = 0;
|
|
1695
1716
|
break;
|
|
1696
1717
|
case "End":
|
|
1697
|
-
|
|
1718
|
+
c = e.length - 1;
|
|
1698
1719
|
break;
|
|
1699
1720
|
default:
|
|
1700
1721
|
return;
|
|
1701
1722
|
}
|
|
1702
|
-
|
|
1703
|
-
},
|
|
1704
|
-
e.findIndex((
|
|
1723
|
+
f.preventDefault(), n(e[c].value), (y = (p = s.current) == null ? void 0 : p.querySelectorAll('[role="radio"]')[c]) == null || y.focus();
|
|
1724
|
+
}, m = Math.max(
|
|
1725
|
+
e.findIndex((f) => f.value === t),
|
|
1705
1726
|
0
|
|
1706
1727
|
);
|
|
1707
1728
|
return /* @__PURE__ */ i(
|
|
1708
|
-
|
|
1729
|
+
vo,
|
|
1709
1730
|
{
|
|
1710
|
-
ref:
|
|
1731
|
+
ref: s,
|
|
1711
1732
|
role: "radiogroup",
|
|
1712
1733
|
"aria-label": r,
|
|
1713
|
-
"data-testid":
|
|
1714
|
-
edges:
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1734
|
+
"data-testid": a,
|
|
1735
|
+
edges: d,
|
|
1736
|
+
wrapped: u,
|
|
1737
|
+
onKeyDown: b,
|
|
1738
|
+
onScroll: h,
|
|
1739
|
+
children: e.map((f, w) => {
|
|
1740
|
+
const c = f.value === t;
|
|
1741
|
+
return /* @__PURE__ */ C(
|
|
1742
|
+
wo,
|
|
1721
1743
|
{
|
|
1744
|
+
wrapped: u,
|
|
1722
1745
|
role: "radio",
|
|
1723
|
-
"aria-checked":
|
|
1724
|
-
"aria-label":
|
|
1725
|
-
lang:
|
|
1726
|
-
"data-testid":
|
|
1727
|
-
tabIndex:
|
|
1728
|
-
onClick: () =>
|
|
1746
|
+
"aria-checked": c,
|
|
1747
|
+
"aria-label": f.ariaLabel,
|
|
1748
|
+
lang: f.lang,
|
|
1749
|
+
"data-testid": f.testId,
|
|
1750
|
+
tabIndex: w === m ? 0 : -1,
|
|
1751
|
+
onClick: () => n(f.value),
|
|
1729
1752
|
children: [
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1753
|
+
f.icon !== void 0 && /* @__PURE__ */ i(xo, { "aria-hidden": !0, children: f.icon }),
|
|
1754
|
+
f.icon !== void 0 && f.iconOnly ? /* @__PURE__ */ i(Co, { children: f.label }) : f.label,
|
|
1755
|
+
f.count !== void 0 && /* @__PURE__ */ i(ko, { children: f.count })
|
|
1733
1756
|
]
|
|
1734
1757
|
},
|
|
1735
|
-
|
|
1758
|
+
f.value
|
|
1736
1759
|
);
|
|
1737
1760
|
})
|
|
1738
1761
|
}
|
|
1739
1762
|
);
|
|
1740
1763
|
}
|
|
1741
|
-
const xo = 1, Co = (e, n) => n === "vertical" ? e.scrollHeight - e.clientHeight - e.scrollTop : e.scrollWidth - e.clientWidth - e.scrollLeft, ko = (e, n, t) => {
|
|
1742
|
-
const [r, s] = F(!1), d = Q(() => {
|
|
1743
|
-
const a = e.current;
|
|
1744
|
-
a !== null && s(Co(a, n) > xo);
|
|
1745
|
-
}, [e, n]);
|
|
1746
|
-
return Le(d, [d, t]), V(() => {
|
|
1747
|
-
const a = e.current;
|
|
1748
|
-
if (a === null)
|
|
1749
|
-
return;
|
|
1750
|
-
a.addEventListener("scroll", d, { passive: !0 });
|
|
1751
|
-
const c = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
|
|
1752
|
-
return c !== null && (c.observe(a), Array.from(a.children).forEach((g) => c.observe(g))), () => {
|
|
1753
|
-
a.removeEventListener("scroll", d), c == null || c.disconnect();
|
|
1754
|
-
};
|
|
1755
|
-
}, [e, d, t]), r;
|
|
1756
|
-
};
|
|
1757
1764
|
var So = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e))(So || {});
|
|
1758
1765
|
const Io = 2, Fo = /* @__PURE__ */ new Set(["Enter", " "]), Wo = l("div", {
|
|
1759
1766
|
shouldForwardProp: (e) => e !== "variant"
|
|
1760
|
-
})(({ theme: e, variant:
|
|
1767
|
+
})(({ theme: e, variant: t }) => ({
|
|
1761
1768
|
minWidth: 0,
|
|
1762
|
-
...
|
|
1769
|
+
...t === "primary" && {
|
|
1763
1770
|
borderBottom: D(e.design.tokens["border.subtle"])
|
|
1764
1771
|
}
|
|
1765
1772
|
})), sn = 32, Mo = l("div", {
|
|
1766
1773
|
shouldForwardProp: (e) => e !== "variant" && e !== "fade"
|
|
1767
|
-
})(({ theme: e, variant:
|
|
1768
|
-
const
|
|
1774
|
+
})(({ theme: e, variant: t, fade: n }) => {
|
|
1775
|
+
const a = `linear-gradient(to right, ${e.design.tokens["text.primary"]} calc(100% - ${o(
|
|
1769
1776
|
sn
|
|
1770
1777
|
)}), transparent)`;
|
|
1771
1778
|
return {
|
|
1772
1779
|
position: "relative",
|
|
1773
1780
|
display: "flex",
|
|
1774
|
-
gap: o(e.design.space[
|
|
1781
|
+
gap: o(e.design.space[t === "primary" ? 1 : 2]),
|
|
1775
1782
|
overflowX: "auto",
|
|
1776
1783
|
overflowY: "hidden",
|
|
1777
1784
|
scrollbarWidth: "none",
|
|
1778
1785
|
"&::-webkit-scrollbar": { display: "none" },
|
|
1779
|
-
...
|
|
1786
|
+
...n && { maskImage: a, WebkitMaskImage: a }
|
|
1780
1787
|
};
|
|
1781
|
-
}), an = (e,
|
|
1782
|
-
const { tokens:
|
|
1788
|
+
}), an = (e, t) => {
|
|
1789
|
+
const { tokens: n, space: r, radii: a, typeScale: u, fonts: s, densityValues: d, density: g } = e.design, h = {
|
|
1783
1790
|
position: "relative",
|
|
1784
1791
|
display: "inline-flex",
|
|
1785
1792
|
alignItems: "center",
|
|
@@ -1790,28 +1797,28 @@ const Io = 2, Fo = /* @__PURE__ */ new Set(["Enter", " "]), Wo = l("div", {
|
|
|
1790
1797
|
border: 0,
|
|
1791
1798
|
backgroundColor: "transparent",
|
|
1792
1799
|
cursor: "pointer",
|
|
1793
|
-
fontFamily:
|
|
1800
|
+
fontFamily: s.sans,
|
|
1794
1801
|
whiteSpace: "nowrap",
|
|
1795
1802
|
textDecoration: "none",
|
|
1796
|
-
color:
|
|
1803
|
+
color: n["text.secondary"],
|
|
1797
1804
|
transition: oe(e, ["color", "background-color"]),
|
|
1798
|
-
"&:hover": { color:
|
|
1805
|
+
"&:hover": { color: n["text.primary"] },
|
|
1799
1806
|
'&[aria-selected="true"]': {
|
|
1800
|
-
color:
|
|
1807
|
+
color: n["text.primary"],
|
|
1801
1808
|
fontWeight: A.medium
|
|
1802
1809
|
},
|
|
1803
1810
|
// Inside the scrolling row, an outer ring would be clipped: it is drawn inside the tab.
|
|
1804
1811
|
"&:focus-visible": { ...te(e), outlineOffset: "-2px" }
|
|
1805
|
-
},
|
|
1812
|
+
}, b = {
|
|
1806
1813
|
[Z.down(K.Tablet)]: {
|
|
1807
|
-
minHeight: o(
|
|
1814
|
+
minHeight: o(d.touchTarget)
|
|
1808
1815
|
}
|
|
1809
1816
|
};
|
|
1810
|
-
return
|
|
1811
|
-
...
|
|
1812
|
-
minHeight: o(
|
|
1817
|
+
return t === "primary" ? {
|
|
1818
|
+
...h,
|
|
1819
|
+
minHeight: o(d[g].control + r[2]),
|
|
1813
1820
|
padding: `0 ${o(r[3])}`,
|
|
1814
|
-
fontSize: o(
|
|
1821
|
+
fontSize: o(u.body),
|
|
1815
1822
|
'&[aria-selected="true"]::after': {
|
|
1816
1823
|
content: '""',
|
|
1817
1824
|
position: "absolute",
|
|
@@ -1819,134 +1826,134 @@ const Io = 2, Fo = /* @__PURE__ */ new Set(["Enter", " "]), Wo = l("div", {
|
|
|
1819
1826
|
right: 0,
|
|
1820
1827
|
bottom: 0,
|
|
1821
1828
|
height: o(Io),
|
|
1822
|
-
backgroundColor:
|
|
1829
|
+
backgroundColor: n.accent
|
|
1823
1830
|
},
|
|
1824
|
-
...
|
|
1831
|
+
...b
|
|
1825
1832
|
} : {
|
|
1826
|
-
...
|
|
1827
|
-
minHeight: o(
|
|
1833
|
+
...h,
|
|
1834
|
+
minHeight: o(d.compact.control),
|
|
1828
1835
|
padding: `0 ${o(r[3])}`,
|
|
1829
|
-
borderRadius: o(
|
|
1830
|
-
fontSize: o(
|
|
1836
|
+
borderRadius: o(a.md),
|
|
1837
|
+
fontSize: o(u.small),
|
|
1831
1838
|
"&:hover": {
|
|
1832
|
-
color:
|
|
1833
|
-
backgroundColor:
|
|
1839
|
+
color: n["text.primary"],
|
|
1840
|
+
backgroundColor: n["bg.hover"]
|
|
1834
1841
|
},
|
|
1835
1842
|
'&[aria-selected="true"]': {
|
|
1836
|
-
color:
|
|
1843
|
+
color: n["text.primary"],
|
|
1837
1844
|
fontWeight: A.medium,
|
|
1838
|
-
backgroundColor:
|
|
1845
|
+
backgroundColor: n["bg.raised"]
|
|
1839
1846
|
},
|
|
1840
|
-
...
|
|
1847
|
+
...b
|
|
1841
1848
|
};
|
|
1842
|
-
}, ln = (e) => e !== "variant", Oo = l(Xn, { shouldForwardProp: ln })(({ theme: e, variant:
|
|
1843
|
-
const { tokens:
|
|
1849
|
+
}, ln = (e) => e !== "variant", Oo = l(Xn, { shouldForwardProp: ln })(({ theme: e, variant: t }) => an(e, t)), To = l("button", { shouldForwardProp: ln })(({ theme: e, variant: t }) => an(e, t)), Ro = l("span")(({ theme: e }) => {
|
|
1850
|
+
const { tokens: t, space: n, radii: r, fonts: a, typeScale: u } = e.design;
|
|
1844
1851
|
return {
|
|
1845
1852
|
display: "inline-flex",
|
|
1846
1853
|
alignItems: "center",
|
|
1847
|
-
padding: `0 ${o(
|
|
1854
|
+
padding: `0 ${o(n[1])}`,
|
|
1848
1855
|
borderRadius: o(r.sm),
|
|
1849
|
-
border: D(
|
|
1850
|
-
fontFamily:
|
|
1851
|
-
fontSize: o(
|
|
1856
|
+
border: D(t["border.subtle"]),
|
|
1857
|
+
fontFamily: a.mono,
|
|
1858
|
+
fontSize: o(u.caption),
|
|
1852
1859
|
fontWeight: A.regular,
|
|
1853
1860
|
lineHeight: 1.6,
|
|
1854
|
-
color:
|
|
1861
|
+
color: t["text.muted"]
|
|
1855
1862
|
};
|
|
1856
|
-
}), Ee = (e,
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1863
|
+
}), Ee = (e, t) => {
|
|
1864
|
+
const n = t.offsetLeft, r = n + t.offsetWidth + sn;
|
|
1865
|
+
n < e.scrollLeft ? e.scrollLeft = n : r > e.scrollLeft + e.clientWidth && (e.scrollLeft = r - e.clientWidth);
|
|
1859
1866
|
};
|
|
1860
1867
|
function Lr({
|
|
1861
1868
|
items: e,
|
|
1862
|
-
value:
|
|
1863
|
-
onChange:
|
|
1869
|
+
value: t,
|
|
1870
|
+
onChange: n,
|
|
1864
1871
|
variant: r,
|
|
1865
|
-
"aria-label":
|
|
1872
|
+
"aria-label": a
|
|
1866
1873
|
}) {
|
|
1867
|
-
const
|
|
1874
|
+
const u = P(), s = X(null), d = e.filter((c) => c.hidden !== !0), g = Zt(s, "horizontal", d.length), h = Q(
|
|
1868
1875
|
() => {
|
|
1869
|
-
var
|
|
1876
|
+
var c;
|
|
1870
1877
|
return Array.from(
|
|
1871
|
-
((
|
|
1878
|
+
((c = s.current) == null ? void 0 : c.querySelectorAll('[role="tab"]')) ?? []
|
|
1872
1879
|
);
|
|
1873
1880
|
},
|
|
1874
1881
|
[]
|
|
1875
|
-
),
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1882
|
+
), b = Q(() => {
|
|
1883
|
+
const c = s.current, p = c == null ? void 0 : c.querySelector('[aria-selected="true"]');
|
|
1884
|
+
c && p && Ee(c, p);
|
|
1878
1885
|
}, []);
|
|
1879
|
-
Le(
|
|
1880
|
-
const
|
|
1886
|
+
Le(b, [b, t]);
|
|
1887
|
+
const m = d.map((c) => c.value).join("|");
|
|
1881
1888
|
V(() => {
|
|
1882
|
-
const
|
|
1883
|
-
if (
|
|
1889
|
+
const c = s.current;
|
|
1890
|
+
if (c === null || typeof ResizeObserver > "u")
|
|
1884
1891
|
return;
|
|
1885
|
-
const
|
|
1886
|
-
return
|
|
1887
|
-
}, [
|
|
1888
|
-
const
|
|
1889
|
-
const
|
|
1890
|
-
if (
|
|
1892
|
+
const p = new ResizeObserver(b);
|
|
1893
|
+
return p.observe(c), Array.from(c.children).forEach((y) => p.observe(y)), () => p.disconnect();
|
|
1894
|
+
}, [b, m]);
|
|
1895
|
+
const f = (c) => {
|
|
1896
|
+
const p = h(), y = p.findIndex((W) => W === document.activeElement);
|
|
1897
|
+
if (y < 0)
|
|
1891
1898
|
return;
|
|
1892
|
-
if (Fo.has(
|
|
1893
|
-
|
|
1899
|
+
if (Fo.has(c.key)) {
|
|
1900
|
+
c.key === " " && p[y] instanceof HTMLAnchorElement && (c.preventDefault(), p[y].click());
|
|
1894
1901
|
return;
|
|
1895
1902
|
}
|
|
1896
1903
|
let v;
|
|
1897
|
-
switch (
|
|
1904
|
+
switch (c.key) {
|
|
1898
1905
|
case "ArrowRight":
|
|
1899
|
-
v = (
|
|
1906
|
+
v = (y + 1) % p.length;
|
|
1900
1907
|
break;
|
|
1901
1908
|
case "ArrowLeft":
|
|
1902
|
-
v = (
|
|
1909
|
+
v = (y - 1 + p.length) % p.length;
|
|
1903
1910
|
break;
|
|
1904
1911
|
case "Home":
|
|
1905
1912
|
v = 0;
|
|
1906
1913
|
break;
|
|
1907
1914
|
case "End":
|
|
1908
|
-
v =
|
|
1915
|
+
v = p.length - 1;
|
|
1909
1916
|
break;
|
|
1910
1917
|
default:
|
|
1911
1918
|
return;
|
|
1912
1919
|
}
|
|
1913
|
-
|
|
1914
|
-
},
|
|
1915
|
-
|
|
1920
|
+
c.preventDefault(), p[v].focus(), s.current && Ee(s.current, p[v]);
|
|
1921
|
+
}, w = Math.max(
|
|
1922
|
+
d.findIndex((c) => c.value === t),
|
|
1916
1923
|
0
|
|
1917
1924
|
);
|
|
1918
1925
|
return /* @__PURE__ */ i(Wo, { variant: r, children: /* @__PURE__ */ i(
|
|
1919
1926
|
Mo,
|
|
1920
1927
|
{
|
|
1921
|
-
ref:
|
|
1928
|
+
ref: s,
|
|
1922
1929
|
role: "tablist",
|
|
1923
|
-
"aria-label":
|
|
1930
|
+
"aria-label": a,
|
|
1924
1931
|
variant: r,
|
|
1925
1932
|
fade: g,
|
|
1926
1933
|
"data-overflowing": g || void 0,
|
|
1927
|
-
onKeyDown:
|
|
1928
|
-
children:
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1931
|
-
|
|
1934
|
+
onKeyDown: f,
|
|
1935
|
+
children: d.map((c, p) => {
|
|
1936
|
+
const y = c.value === t, v = /* @__PURE__ */ C(J, { children: [
|
|
1937
|
+
c.label,
|
|
1938
|
+
c.badge !== void 0 && /* @__PURE__ */ i(Ro, { children: typeof c.badge == "number" ? u.formatNumber(c.badge) : c.badge })
|
|
1932
1939
|
] }), W = {
|
|
1933
1940
|
role: "tab",
|
|
1934
|
-
"aria-selected":
|
|
1935
|
-
tabIndex:
|
|
1936
|
-
"data-testid":
|
|
1941
|
+
"aria-selected": y,
|
|
1942
|
+
tabIndex: p === w ? 0 : -1,
|
|
1943
|
+
"data-testid": c.testId,
|
|
1937
1944
|
variant: r,
|
|
1938
|
-
onClick: () =>
|
|
1945
|
+
onClick: () => n == null ? void 0 : n(c.value)
|
|
1939
1946
|
};
|
|
1940
|
-
return
|
|
1947
|
+
return c.to !== void 0 ? /* @__PURE__ */ i(
|
|
1941
1948
|
Oo,
|
|
1942
1949
|
{
|
|
1943
|
-
to:
|
|
1944
|
-
"aria-current":
|
|
1950
|
+
to: c.to,
|
|
1951
|
+
"aria-current": y ? "page" : void 0,
|
|
1945
1952
|
...W,
|
|
1946
1953
|
children: v
|
|
1947
1954
|
},
|
|
1948
|
-
|
|
1949
|
-
) : /* @__PURE__ */ i(To, { type: "button", ...W, children: v },
|
|
1955
|
+
c.value
|
|
1956
|
+
) : /* @__PURE__ */ i(To, { type: "button", ...W, children: v }, c.value);
|
|
1950
1957
|
})
|
|
1951
1958
|
}
|
|
1952
1959
|
) });
|
|
@@ -1964,12 +1971,12 @@ export {
|
|
|
1964
1971
|
je as a,
|
|
1965
1972
|
Et as b,
|
|
1966
1973
|
nn as c,
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1974
|
+
Sr as d,
|
|
1975
|
+
Jt as e,
|
|
1976
|
+
oo as f,
|
|
1970
1977
|
Tt as g,
|
|
1971
1978
|
zr as h,
|
|
1972
|
-
|
|
1979
|
+
ro as i,
|
|
1973
1980
|
kr as j,
|
|
1974
1981
|
Lr as k,
|
|
1975
1982
|
Wr as l,
|
|
@@ -1980,5 +1987,5 @@ export {
|
|
|
1980
1987
|
Tr as q,
|
|
1981
1988
|
Rr as r,
|
|
1982
1989
|
Er as s,
|
|
1983
|
-
|
|
1990
|
+
Zt as u
|
|
1984
1991
|
};
|