asma-ui-core 3.126.0 → 3.126.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/feedback/dialog/StyledDialog.js +59 -59
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +38 -38
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +45 -45
- package/dist/components/inputs/form-layout/StyledFieldPair.js +16 -16
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +81 -80
- package/dist/src/table/components/table-header/SortIndicator.d.ts +3 -2
- package/dist/table/components/StyledTable.module.js +53 -53
- package/package.json +1 -1
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as c } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as K } from "../../../helpers/sx.js";
|
|
3
3
|
import { registerOpenModalDialog as he } from "../../../hooks/useTopLayer.hook.js";
|
|
4
|
-
import { CloseIcon as
|
|
5
|
-
import { DialogBusyContext as
|
|
4
|
+
import { CloseIcon as we } from "../../icons/close-icon/CloseIcon.js";
|
|
5
|
+
import { DialogBusyContext as pe, useDialogBusyBoundary as ye } from "./DialogBusyContext.js";
|
|
6
6
|
import { StyledButton as ve } from "../../inputs/button/StyledButton.js";
|
|
7
7
|
import { useMobileMediaQuery as ge } from "../../../hooks/useMediaQuery.hook.js";
|
|
8
8
|
import { OverlayBackOwnerContext as be, isOverlayBackEnabled as T, requestCloseTopOverlayBack as D, useBackCloses as ke } from "../../../hooks/useBackCloses.hook.js";
|
|
9
9
|
import { warnUnnamedDialog as Ce } from "../../../helpers/warnUnnamedDialog.js";
|
|
10
10
|
import Ee from "./StyledDialog.module.js";
|
|
11
11
|
import { StyledDialogTitleContext as Be } from "./dialogTitleContext.js";
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { jsx as a, jsxs as
|
|
12
|
+
import { useEffect as d, useId as I, useLayoutEffect as U, useMemo as De, useRef as s, useState as X } from "react";
|
|
13
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
14
14
|
var Ie = {
|
|
15
15
|
xs: 444,
|
|
16
16
|
sm: 600,
|
|
17
17
|
md: 900,
|
|
18
18
|
lg: 1200,
|
|
19
19
|
xl: 1536
|
|
20
|
-
}, Fe = ({ open: t, onClose: R, children: S, dataTest: f, maxWidth: N = "sm", fullWidth: G, fullScreen: Q, scroll: V = "paper", disableEscapeKeyDown: H, className: $, style: J, sx: Y, classes: O, PaperProps: Z, slotProps:
|
|
21
|
-
const
|
|
22
|
-
titleId:
|
|
20
|
+
}, Fe = ({ open: t, onClose: R, children: S, dataTest: f, maxWidth: N = "sm", fullWidth: G, fullScreen: Q, scroll: V = "paper", disableEscapeKeyDown: H, className: $, style: J, sx: Y, classes: O, PaperProps: Z, slotProps: x, busyReason: ee, locale: te = "en", onCloseText: q, showCloseIcon: M = !0, dialogLabel: i, dialogTitle: h, dialogHeaderNode: re, ariaLabel: b }) => {
|
|
21
|
+
const w = I(), P = I(), [ne, oe] = X(), se = De(() => ({
|
|
22
|
+
titleId: w,
|
|
23
23
|
setTitleId: oe
|
|
24
|
-
}), [
|
|
25
|
-
|
|
24
|
+
}), [w]), p = h ? w : ne ?? (i ? P : void 0), ae = ge(), l = s(null), k = s(null), C = s(!1), E = s(!1), u = s(!1), _ = s(t);
|
|
25
|
+
d(() => {
|
|
26
26
|
_.current = t;
|
|
27
27
|
}, [t]);
|
|
28
|
-
const
|
|
28
|
+
const j = s(t), y = Q ?? ae, { busy: v, busyReason: le, contextValue: ie } = ye(ee, te), L = I(), [g, ce] = X(), W = s(!1);
|
|
29
29
|
U(() => {
|
|
30
|
-
const e =
|
|
31
|
-
n && !n.id && (n.id =
|
|
30
|
+
const e = l.current, r = !!p || !!b, n = e && t && !r ? e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]') : null;
|
|
31
|
+
n && !n.id && (n.id = L);
|
|
32
32
|
const o = n?.id;
|
|
33
33
|
o !== g && ce(o), e && t && !r && !n && !W.current && (W.current = !0, Ce(f));
|
|
34
34
|
}, [
|
|
35
35
|
t,
|
|
36
|
-
|
|
36
|
+
p,
|
|
37
37
|
b,
|
|
38
38
|
S,
|
|
39
39
|
g,
|
|
40
|
-
|
|
40
|
+
L,
|
|
41
41
|
f
|
|
42
|
-
]),
|
|
43
|
-
|
|
44
|
-
}, [t,
|
|
45
|
-
const e =
|
|
42
|
+
]), d(() => {
|
|
43
|
+
j.current && !t && x?.transition?.onExited?.(), j.current = t;
|
|
44
|
+
}, [t, x]), U(() => {
|
|
45
|
+
const e = l.current;
|
|
46
46
|
if (!e || !t) return;
|
|
47
47
|
e.open || (k.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal(), e.focus({ preventScroll: !0 }), requestAnimationFrame(() => e.open && e.focus({ preventScroll: !0 })));
|
|
48
48
|
const r = he(e);
|
|
49
49
|
return () => {
|
|
50
50
|
r(), k.current?.isConnected && k.current.focus({ preventScroll: !0 });
|
|
51
51
|
};
|
|
52
|
-
}, [t]),
|
|
52
|
+
}, [t]), d(() => {
|
|
53
53
|
if (!t) return;
|
|
54
54
|
const e = document.body.style.overflow, r = document.documentElement.style.overflow;
|
|
55
55
|
return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
|
|
@@ -58,14 +58,14 @@ var Ie = {
|
|
|
58
58
|
}, [t]);
|
|
59
59
|
const B = {
|
|
60
60
|
...Z,
|
|
61
|
-
...
|
|
62
|
-
}, z = N === !1 ? void 0 : Ie[N], { className: de, style: ue, onClick:
|
|
63
|
-
if (v ||
|
|
61
|
+
...x?.paper
|
|
62
|
+
}, z = N === !1 ? void 0 : Ie[N], { className: de, style: ue, onClick: me, ...fe } = x?.backdrop ?? {}, A = (e, r) => {
|
|
63
|
+
if (v || u.current) return;
|
|
64
64
|
const n = R?.(e, r);
|
|
65
65
|
if (n && typeof n.then == "function") {
|
|
66
|
-
|
|
66
|
+
u.current = !0;
|
|
67
67
|
const o = () => {
|
|
68
|
-
|
|
68
|
+
u.current = !1;
|
|
69
69
|
};
|
|
70
70
|
n.then(o, o);
|
|
71
71
|
}
|
|
@@ -75,14 +75,14 @@ var Ie = {
|
|
|
75
75
|
}, 0), A(e, "escapeKeyDown"));
|
|
76
76
|
ke({
|
|
77
77
|
active: t,
|
|
78
|
-
requestClose: (e) => !R || H || v ||
|
|
79
|
-
ownerRef:
|
|
78
|
+
requestClose: (e) => !R || H || v || u.current ? !1 : F(e ?? new Event("overlayBack")),
|
|
79
|
+
ownerRef: l
|
|
80
80
|
});
|
|
81
81
|
const xe = (e) => {
|
|
82
82
|
e.cancelable && e.preventDefault(), !E.current && T() && D();
|
|
83
83
|
};
|
|
84
|
-
return
|
|
85
|
-
const e =
|
|
84
|
+
return d(() => {
|
|
85
|
+
const e = l.current;
|
|
86
86
|
if (!e || !t) return;
|
|
87
87
|
let r = !1;
|
|
88
88
|
const n = () => {
|
|
@@ -90,16 +90,16 @@ var Ie = {
|
|
|
90
90
|
r = !1, _.current && e.isConnected && !e.open && (e.showModal(), e.focus({ preventScroll: !0 }));
|
|
91
91
|
});
|
|
92
92
|
}, o = () => {
|
|
93
|
-
r || (r = !0, T() && !
|
|
93
|
+
r || (r = !0, T() && !u.current && D(), n());
|
|
94
94
|
};
|
|
95
95
|
return e.addEventListener("close", o), () => e.removeEventListener("close", o);
|
|
96
|
-
}, [t]),
|
|
96
|
+
}, [t]), d(() => {
|
|
97
97
|
if (!t || H) return;
|
|
98
98
|
const e = (r) => {
|
|
99
99
|
r.key !== "Escape" || r.defaultPrevented || (r.preventDefault(), r.stopImmediatePropagation(), D(r));
|
|
100
100
|
};
|
|
101
101
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
102
|
-
}),
|
|
102
|
+
}), d(() => {
|
|
103
103
|
if (!t) return;
|
|
104
104
|
const e = (r) => {
|
|
105
105
|
r.key === "Escape" && (E.current = !0, window.setTimeout(() => {
|
|
@@ -107,31 +107,31 @@ var Ie = {
|
|
|
107
107
|
}, 0));
|
|
108
108
|
};
|
|
109
109
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
110
|
-
}, [t]), t ? /* @__PURE__ */
|
|
111
|
-
ref:
|
|
110
|
+
}, [t]), t ? /* @__PURE__ */ m("dialog", {
|
|
111
|
+
ref: l,
|
|
112
112
|
tabIndex: -1,
|
|
113
113
|
"data-testid": f,
|
|
114
|
-
"aria-labelledby":
|
|
115
|
-
"aria-label":
|
|
114
|
+
"aria-labelledby": p ?? g,
|
|
115
|
+
"aria-label": p || g ? void 0 : b,
|
|
116
116
|
onCancel: xe,
|
|
117
117
|
onKeyDown: (e) => {
|
|
118
|
-
!v || e.key !== "Escape" || e.target.closest("dialog[open]") ===
|
|
118
|
+
!v || e.key !== "Escape" || e.target.closest("dialog[open]") === l.current && e.preventDefault();
|
|
119
119
|
},
|
|
120
|
-
className:
|
|
120
|
+
className: c(Ee.StyledDialog, "fixed inset-0 m-0 h-full max-h-none w-full max-w-none items-center justify-center overflow-hidden border-0 bg-transparent p-0 outline-none open:flex", V === "body" && "overflow-y-auto", $, O?.root),
|
|
121
121
|
style: {
|
|
122
122
|
zIndex: 999,
|
|
123
123
|
...K(Y),
|
|
124
124
|
...J
|
|
125
125
|
},
|
|
126
126
|
children: [/* @__PURE__ */ a("div", {
|
|
127
|
-
...
|
|
128
|
-
className:
|
|
127
|
+
...fe,
|
|
128
|
+
className: c("absolute inset-0 bg-[#626e7eb2]", de),
|
|
129
129
|
style: ue,
|
|
130
130
|
onClick: (e) => {
|
|
131
|
-
|
|
131
|
+
me?.(e), e.defaultPrevented || A(e, "backdropClick");
|
|
132
132
|
}
|
|
133
|
-
}), /* @__PURE__ */
|
|
134
|
-
className:
|
|
133
|
+
}), /* @__PURE__ */ m("div", {
|
|
134
|
+
className: c("relative z-[1] flex flex-col overflow-hidden rounded-lg border-0 bg-white p-0 text-delta-800 shadow-[0px_4px_40px_0px_#22213366]", y && "rounded-none", B.className, O?.paper),
|
|
135
135
|
style: {
|
|
136
136
|
minWidth: 0,
|
|
137
137
|
minHeight: 0,
|
|
@@ -154,33 +154,33 @@ var Ie = {
|
|
|
154
154
|
maxHeight: "100%"
|
|
155
155
|
} : { maxHeight: "calc(100% - 64px)" }
|
|
156
156
|
},
|
|
157
|
-
children: [(!!
|
|
158
|
-
className:
|
|
159
|
-
children: [/* @__PURE__ */
|
|
160
|
-
className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5",
|
|
161
|
-
children: [
|
|
157
|
+
children: [(!!i || !!h || M) && /* @__PURE__ */ m("div", {
|
|
158
|
+
className: c("box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4", "max-xs:flex-wrap-reverse max-xs:items-center max-xs:gap-x-2 max-xs:gap-y-0.5"),
|
|
159
|
+
children: [/* @__PURE__ */ m("div", {
|
|
160
|
+
className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5 max-xs:contents",
|
|
161
|
+
children: [i && /* @__PURE__ */ a("div", {
|
|
162
162
|
id: P,
|
|
163
|
-
className:
|
|
164
|
-
children:
|
|
163
|
+
className: c("flex h-8 items-center text-sm font-normal leading-5 text-delta-600", "max-xs:h-auto max-xs:min-h-8 max-xs:min-w-0 max-xs:flex-auto max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]"),
|
|
164
|
+
children: i
|
|
165
165
|
}), h && /* @__PURE__ */ a("div", {
|
|
166
|
-
id:
|
|
167
|
-
className:
|
|
166
|
+
id: w,
|
|
167
|
+
className: c("flex text-2xl font-semibold leading-8 text-delta-800", "max-xs:hyphens-auto", i && "max-xs:order-first max-xs:basis-full max-xs:![overflow-wrap:anywhere]", !i && "max-xs:block max-xs:min-w-[min(100%,5rem)] max-xs:grow max-xs:basis-[min-content] max-xs:break-words"),
|
|
168
168
|
children: h
|
|
169
169
|
})]
|
|
170
|
-
}), M && /* @__PURE__ */
|
|
171
|
-
className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2 max-xs:flex-wrap max-xs:gap-y-2",
|
|
170
|
+
}), M && /* @__PURE__ */ m("div", {
|
|
171
|
+
className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2 max-xs:ml-auto max-xs:flex-wrap max-xs:gap-y-2 max-xs:self-end",
|
|
172
172
|
children: [re, /* @__PURE__ */ a(ve, {
|
|
173
173
|
dataTest: `close-button-${f}`,
|
|
174
174
|
"aria-label": q ? void 0 : "Close",
|
|
175
175
|
variant: "textGray",
|
|
176
176
|
size: "small",
|
|
177
|
-
endIcon: /* @__PURE__ */ a(
|
|
177
|
+
endIcon: /* @__PURE__ */ a(we, {
|
|
178
178
|
width: 20,
|
|
179
179
|
height: 20
|
|
180
180
|
}),
|
|
181
181
|
className: "max-w-full shrink-0 whitespace-nowrap",
|
|
182
182
|
disabled: v,
|
|
183
|
-
disabledReason:
|
|
183
|
+
disabledReason: le,
|
|
184
184
|
onClick: (e) => {
|
|
185
185
|
F(e);
|
|
186
186
|
},
|
|
@@ -193,10 +193,10 @@ var Ie = {
|
|
|
193
193
|
})]
|
|
194
194
|
})]
|
|
195
195
|
}), /* @__PURE__ */ a(be.Provider, {
|
|
196
|
-
value:
|
|
196
|
+
value: l,
|
|
197
197
|
children: /* @__PURE__ */ a(Be.Provider, {
|
|
198
|
-
value:
|
|
199
|
-
children: /* @__PURE__ */ a(
|
|
198
|
+
value: se,
|
|
199
|
+
children: /* @__PURE__ */ a(pe.Provider, {
|
|
200
200
|
value: ie,
|
|
201
201
|
children: S
|
|
202
202
|
})
|
|
@@ -2,7 +2,7 @@ import { cn as w } from "../../../../helpers/cn.js";
|
|
|
2
2
|
import { StyledTooltip as K } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
3
|
import { DotsVerticalIcon as U } from "../../../icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
4
4
|
import { DialogBusyContext as X, WAIT_UNTIL_SAVED as V, useReportDialogBusy as G } from "../DialogBusyContext.js";
|
|
5
|
-
import { StyledButton as
|
|
5
|
+
import { StyledButton as P } from "../../../inputs/button/StyledButton.js";
|
|
6
6
|
import { useMaxXsMediaQuery as Y } from "../../../../hooks/useMediaQuery.hook.js";
|
|
7
7
|
import { StyledMenu as Q } from "../../../navigation/menu/StyledMenu.js";
|
|
8
8
|
import { StyledMenuItem as q } from "../../../navigation/menu/StyledMenuItem.js";
|
|
@@ -11,15 +11,15 @@ import { useWidthRegistry as Z } from "../../../../hooks/useWidthRegistry.js";
|
|
|
11
11
|
import { planToolbarActions as ee } from "../../../custom/module/header-layout/planToolbarActions.js";
|
|
12
12
|
import { ToolbarActionButton as oe, overflowItemState as re } from "../../../custom/module/header-layout/ToolbarActionGroup.js";
|
|
13
13
|
import { useToolbarTranslations as ne } from "../../../custom/module/header-layout/useTranslations.js";
|
|
14
|
-
import { useContext as le, useMemo as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
var
|
|
17
|
-
function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAction: p, fixed: L = !1, rounded: W = !0, locale:
|
|
18
|
-
const T = le(X),
|
|
14
|
+
import { useContext as le, useMemo as R, useState as ie } from "react";
|
|
15
|
+
import { Fragment as _, jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
16
|
+
var te = 2, ae = 470, se = 8, k = "dialog-footer-right", O = "dialog-footer-more", E = (n, l) => `dialog-footer-action:${n}:${l ? "label" : "icon"}`;
|
|
17
|
+
function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAction: p, fixed: L = !1, rounded: W = !0, locale: i = "en", className: S, dataTest: h = "styled-dialog-footer" }) {
|
|
18
|
+
const T = le(X), u = ne(i), { ref: D, widthPx: x } = J(), { register: g, widths: t } = Z(), [b, v] = ie(null), a = x > 0 && x < ae, $ = a ? 8 : 16, s = R(() => n.filter((e) => !e.hidden).map((e) => e.icon == null && e.canHideLabel == null ? {
|
|
19
19
|
...e,
|
|
20
20
|
canHideLabel: !1
|
|
21
|
-
} : e), [n]),
|
|
22
|
-
if (s.length >=
|
|
21
|
+
} : e), [n]), z = t[k] ?? 0, B = f != null || p != null, F = Y(), C = Math.max(0, x - $ * 2 - (F ? 0 : z + (B ? se : 0))), d = R(() => {
|
|
22
|
+
if (s.length >= te) return {
|
|
23
23
|
inlineActions: [],
|
|
24
24
|
overflowActions: s,
|
|
25
25
|
showMoreMenu: !0
|
|
@@ -28,10 +28,10 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
|
|
|
28
28
|
actions: s,
|
|
29
29
|
availableWidth: C,
|
|
30
30
|
collapseLabels: !0,
|
|
31
|
-
resolveActionWidth: (r,
|
|
32
|
-
moreButtonWidthPx:
|
|
31
|
+
resolveActionWidth: (r, c) => t[E(r.id, c)],
|
|
32
|
+
moreButtonWidthPx: t[O]
|
|
33
33
|
});
|
|
34
|
-
return
|
|
34
|
+
return a ? {
|
|
35
35
|
...e,
|
|
36
36
|
inlineActions: e.inlineActions.map((r) => r.action.canHideLabel === !1 ? r : {
|
|
37
37
|
...r,
|
|
@@ -41,25 +41,25 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
|
|
|
41
41
|
}, [
|
|
42
42
|
s,
|
|
43
43
|
C,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
t,
|
|
45
|
+
a
|
|
46
46
|
]);
|
|
47
47
|
G(l == null && d.overflowActions.some((e) => !!e.loading && e.holdsDialog !== !1));
|
|
48
|
-
const M = (e, r,
|
|
49
|
-
const N =
|
|
50
|
-
locale:
|
|
51
|
-
dataTest: e.dataTest ?? `${
|
|
48
|
+
const M = (e, r, c) => {
|
|
49
|
+
const N = c === "secondary" && T?.busy, y = !!e.disabled || !!N, A = N ? T.busyReason ?? V[i] : e.tooltip, I = y || !!e.loading, j = /* @__PURE__ */ o(P, {
|
|
50
|
+
locale: i,
|
|
51
|
+
dataTest: e.dataTest ?? `${h}-${c}`,
|
|
52
52
|
variant: e.variant ?? r,
|
|
53
53
|
error: e.tone === "danger",
|
|
54
54
|
size: "medium",
|
|
55
55
|
type: e.type ?? "button",
|
|
56
|
-
disabled: y && !!
|
|
57
|
-
"aria-disabled":
|
|
58
|
-
disabledReason:
|
|
56
|
+
disabled: y && !!A,
|
|
57
|
+
"aria-disabled": I || void 0,
|
|
58
|
+
disabledReason: A,
|
|
59
59
|
loading: !!e.loading,
|
|
60
60
|
startIcon: e.icon,
|
|
61
61
|
endIcon: e.endIcon,
|
|
62
|
-
onClick:
|
|
62
|
+
onClick: I ? (H) => H.preventDefault() : e.onClick,
|
|
63
63
|
"aria-label": e.ariaLabel,
|
|
64
64
|
children: e.label
|
|
65
65
|
});
|
|
@@ -69,35 +69,35 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
|
|
|
69
69
|
open: y || !e.tooltip ? !1 : void 0,
|
|
70
70
|
children: /* @__PURE__ */ o("span", {
|
|
71
71
|
className: "inline-flex",
|
|
72
|
-
children:
|
|
72
|
+
children: j
|
|
73
73
|
})
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ m("div", {
|
|
77
77
|
ref: D,
|
|
78
|
-
"data-testid":
|
|
79
|
-
className: w("flex items-center justify-end self-stretch border-0 border-t border-solid border-delta-200 bg-white", "max-xs:flex-wrap max-xs:
|
|
78
|
+
"data-testid": h,
|
|
79
|
+
className: w("flex items-center justify-end self-stretch border-0 border-t border-solid border-delta-200 bg-white", "max-xs:flex-wrap max-xs:gap-y-2", a ? "gap-2 p-2" : "gap-4 p-4", W && "rounded-b-lg", L && "sticky bottom-0 z-[1]", S),
|
|
80
80
|
children: [/* @__PURE__ */ o("div", {
|
|
81
|
-
className: "flex shrink-0 flex-nowrap items-center gap-2 max-xs:min-w-0 max-xs:shrink",
|
|
82
|
-
children: l ?? /* @__PURE__ */
|
|
81
|
+
className: "flex shrink-0 flex-nowrap items-center gap-2 max-xs:mr-auto max-xs:min-w-0 max-xs:shrink",
|
|
82
|
+
children: l ?? /* @__PURE__ */ m(_, { children: [d.inlineActions.map(({ action: e, showLabel: r }) => /* @__PURE__ */ o("span", {
|
|
83
83
|
ref: g(E(e.id, r)),
|
|
84
84
|
className: "inline-flex shrink-0",
|
|
85
85
|
children: /* @__PURE__ */ o(oe, {
|
|
86
86
|
action: e,
|
|
87
87
|
showLabel: r,
|
|
88
|
-
inProgressLabel:
|
|
88
|
+
inProgressLabel: u.inProgress
|
|
89
89
|
})
|
|
90
|
-
}, e.id)), d.showMoreMenu && /* @__PURE__ */
|
|
90
|
+
}, e.id)), d.showMoreMenu && /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ o("span", {
|
|
91
91
|
ref: g(O),
|
|
92
92
|
className: "inline-flex shrink-0",
|
|
93
|
-
children: /* @__PURE__ */ o(
|
|
94
|
-
locale:
|
|
95
|
-
dataTest: `${
|
|
93
|
+
children: /* @__PURE__ */ o(P, {
|
|
94
|
+
locale: i,
|
|
95
|
+
dataTest: `${h}-more`,
|
|
96
96
|
variant: "outlined",
|
|
97
97
|
size: "medium",
|
|
98
98
|
type: "button",
|
|
99
99
|
onClick: (e) => v(e.currentTarget),
|
|
100
|
-
"aria-label":
|
|
100
|
+
"aria-label": u.more,
|
|
101
101
|
"aria-haspopup": "menu",
|
|
102
102
|
"aria-expanded": b != null,
|
|
103
103
|
startIcon: /* @__PURE__ */ o(U, {
|
|
@@ -118,7 +118,7 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
|
|
|
118
118
|
horizontal: "left"
|
|
119
119
|
},
|
|
120
120
|
children: d.overflowActions.map((e) => /* @__PURE__ */ o(q, {
|
|
121
|
-
...re(e,
|
|
121
|
+
...re(e, u.inProgress),
|
|
122
122
|
onClick: () => {
|
|
123
123
|
v(null), e.onClick();
|
|
124
124
|
},
|
|
@@ -129,10 +129,10 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
|
|
|
129
129
|
}, e.id))
|
|
130
130
|
})] })] })
|
|
131
131
|
}), B && /* @__PURE__ */ o("span", {
|
|
132
|
-
className: w("flex min-w-px flex-1 flex-nowrap items-center justify-end", "max-xs:
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
-
ref: g(
|
|
135
|
-
className: w("flex shrink-0 flex-nowrap items-center gap-2", "max-xs:
|
|
132
|
+
className: w("flex min-w-px flex-1 flex-nowrap items-center justify-end", "max-xs:contents"),
|
|
133
|
+
children: /* @__PURE__ */ m("span", {
|
|
134
|
+
ref: g(k),
|
|
135
|
+
className: w("flex shrink-0 flex-nowrap items-center gap-2", "max-xs:contents"),
|
|
136
136
|
children: [f && M(f, "outlined", "secondary"), p && M(p, "contained", "primary")]
|
|
137
137
|
})
|
|
138
138
|
})]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as n } from "../../../../helpers/cn.js";
|
|
2
2
|
import { firstTabbable as A } from "../../../../helpers/focusable.js";
|
|
3
|
-
import { StyledTooltip as
|
|
3
|
+
import { StyledTooltip as le } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
4
4
|
import { DialogBusyContext as L, useDialogBusyBoundary as ie } from "../../dialog/DialogBusyContext.js";
|
|
5
5
|
import { useMobileMediaQuery as oe } from "../../../../hooks/useMediaQuery.hook.js";
|
|
6
|
-
import { OverlayBackOwnerContext as
|
|
6
|
+
import { OverlayBackOwnerContext as ae, isOverlayBackNavigationPending as re, useBackCloses as se } from "../../../../hooks/useBackCloses.hook.js";
|
|
7
7
|
import { useFocusTrap as ce } from "../../../../hooks/useFocusTrap.hook.js";
|
|
8
8
|
import { fullScreenFieldWidthVars as me } from "../../../inputs/field-styles.js";
|
|
9
9
|
import { CloseBtn as V } from "../components/CloseBtn.js";
|
|
@@ -14,33 +14,33 @@ import { useTranslations as ue } from "./useTranslations.js";
|
|
|
14
14
|
import { useControlledProps as xe } from "./useControlledProps.js";
|
|
15
15
|
import fe from "clsx";
|
|
16
16
|
import { useId as W, useLayoutEffect as H, useRef as m } from "react";
|
|
17
|
-
import { Fragment as pe, jsx as e, jsxs as
|
|
17
|
+
import { Fragment as pe, jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
18
18
|
var Pe = (C) => {
|
|
19
|
-
const { showCloseIcon: R = !0, showMinimizeIcon: _ = !0, showExpandIcon: Q = !0, enableFullscreen: U = !0, fullscreenLockedReason: N, title: u, label: x, children: G, open:
|
|
19
|
+
const { showCloseIcon: R = !0, showMinimizeIcon: _ = !0, showExpandIcon: Q = !0, enableFullscreen: U = !0, fullscreenLockedReason: N, title: u, label: x, children: G, open: l, onClose: J, classNameOverrides: b = {
|
|
20
20
|
maximized: "",
|
|
21
21
|
minimized: "",
|
|
22
22
|
fullscreen: ""
|
|
23
|
-
}, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style:
|
|
23
|
+
}, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style: k, initialFocusRef: B } = C, r = oe(), i = ue(Y), o = m(null), f = m(null), F = m(null), S = m(null), w = m(!1), y = m(null), p = W(), T = W(), { minimized: t, setMinimized: I, fullScreen: s, setFullScreen: M } = xe(C), c = s && !t, j = !!N, { busy: g, busyReason: E, contextValue: P } = ie(Z ?? i.waitUntilSaved), h = () => {
|
|
24
24
|
if (g) return !1;
|
|
25
25
|
I(!1), J();
|
|
26
26
|
};
|
|
27
27
|
H(() => {
|
|
28
28
|
o.current?.toggleAttribute("inert", t), f.current?.toggleAttribute("inert", !t);
|
|
29
29
|
}, [t]), H(() => {
|
|
30
|
-
const z =
|
|
31
|
-
if (
|
|
32
|
-
const D =
|
|
33
|
-
|
|
30
|
+
const z = l && !w.current, d = !l && w.current;
|
|
31
|
+
if (w.current = l, d) {
|
|
32
|
+
const D = y.current;
|
|
33
|
+
y.current = null, (!document.activeElement || document.activeElement === document.body) && D?.isConnected && D.focus({ preventScroll: !0 });
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
if (!z) return;
|
|
37
|
-
|
|
38
|
-
const q = t ? f.current : o.current,
|
|
39
|
-
(
|
|
37
|
+
y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
38
|
+
const q = t ? f.current : o.current, ne = t ? S.current : F.current;
|
|
39
|
+
(B?.current ?? ne ?? (q ? A(q) : void 0))?.focus({ preventScroll: !0 });
|
|
40
40
|
}, [
|
|
41
|
-
|
|
41
|
+
B,
|
|
42
42
|
t,
|
|
43
|
-
|
|
43
|
+
l
|
|
44
44
|
]);
|
|
45
45
|
const O = () => {
|
|
46
46
|
const z = t ? o : f;
|
|
@@ -49,12 +49,12 @@ var Pe = (C) => {
|
|
|
49
49
|
d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(d))?.focus({ preventScroll: !0 });
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
ce(
|
|
53
|
-
active:
|
|
54
|
-
requestClose: () => !c &&
|
|
52
|
+
ce(l && c, o, h), se({
|
|
53
|
+
active: l && !t,
|
|
54
|
+
requestClose: () => !c && re() ? !1 : h(),
|
|
55
55
|
ownerRef: o
|
|
56
56
|
});
|
|
57
|
-
const ee = c ?
|
|
57
|
+
const ee = c ? r ? {
|
|
58
58
|
inset: 0,
|
|
59
59
|
maxHeight: "100dvh",
|
|
60
60
|
maxWidth: "100dvw",
|
|
@@ -72,30 +72,30 @@ var Pe = (C) => {
|
|
|
72
72
|
height: "95dvh",
|
|
73
73
|
...me
|
|
74
74
|
} : void 0;
|
|
75
|
-
if (!
|
|
75
|
+
if (!l) return null;
|
|
76
76
|
const te = x ? `${T} ${p}` : p;
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ a(pe, { children: [
|
|
78
78
|
/* @__PURE__ */ e("div", {
|
|
79
79
|
ref: f,
|
|
80
80
|
style: {
|
|
81
81
|
zIndex: 51,
|
|
82
|
-
...
|
|
82
|
+
...k
|
|
83
83
|
},
|
|
84
|
-
className:
|
|
85
|
-
children: /* @__PURE__ */
|
|
84
|
+
className: n(v["minimized-dialog"], !t && v.hidden, b.minimized),
|
|
85
|
+
children: /* @__PURE__ */ a("div", {
|
|
86
86
|
className: fe("flex items-center justify-between", !t && "hidden"),
|
|
87
87
|
"data-testid": K,
|
|
88
88
|
children: [/* @__PURE__ */ e("div", {
|
|
89
|
-
className:
|
|
90
|
-
children: /* @__PURE__ */ e(
|
|
89
|
+
className: n("max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
|
|
90
|
+
children: /* @__PURE__ */ e(le, {
|
|
91
91
|
title: u,
|
|
92
92
|
placement: "top",
|
|
93
93
|
children: /* @__PURE__ */ e("div", {
|
|
94
|
-
className:
|
|
94
|
+
className: n("truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
|
|
95
95
|
children: u
|
|
96
96
|
})
|
|
97
97
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ a("div", {
|
|
99
99
|
className: "flex items-center gap-x-1",
|
|
100
100
|
children: [/* @__PURE__ */ e($, {
|
|
101
101
|
type: "expand",
|
|
@@ -103,7 +103,7 @@ var Pe = (C) => {
|
|
|
103
103
|
onClick: O,
|
|
104
104
|
tooltipTitle: i.expand
|
|
105
105
|
}), /* @__PURE__ */ e(V, {
|
|
106
|
-
buttonRef:
|
|
106
|
+
buttonRef: S,
|
|
107
107
|
showCloseIcon: R,
|
|
108
108
|
onClick: h,
|
|
109
109
|
disabledReason: g ? E : void 0,
|
|
@@ -121,43 +121,43 @@ var Pe = (C) => {
|
|
|
121
121
|
/* @__PURE__ */ e("div", {
|
|
122
122
|
style: {
|
|
123
123
|
zIndex: 51,
|
|
124
|
-
...
|
|
124
|
+
...k,
|
|
125
125
|
...ee
|
|
126
126
|
},
|
|
127
127
|
ref: o,
|
|
128
128
|
role: "dialog",
|
|
129
129
|
"aria-modal": c ? !0 : void 0,
|
|
130
130
|
"aria-labelledby": te,
|
|
131
|
-
className:
|
|
132
|
-
children: /* @__PURE__ */
|
|
131
|
+
className: n(v.dialog, t && v.hidden, !s && b.maximized, s && b.fullscreen, c && "fixed z-[53] duration-0"),
|
|
132
|
+
children: /* @__PURE__ */ a(ae.Provider, {
|
|
133
133
|
value: o,
|
|
134
|
-
children: [/* @__PURE__ */
|
|
135
|
-
className:
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
-
className:
|
|
134
|
+
children: [/* @__PURE__ */ a("div", {
|
|
135
|
+
className: n("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
|
|
136
|
+
children: [/* @__PURE__ */ a("div", {
|
|
137
|
+
className: n("flex items-center justify-between", "max-xs:flex-wrap-reverse max-xs:gap-x-2 max-xs:gap-y-2"),
|
|
138
138
|
children: [x ? /* @__PURE__ */ e("div", {
|
|
139
139
|
id: T,
|
|
140
|
-
className: "text-sm text-delta-700 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]",
|
|
140
|
+
className: "text-sm text-delta-700 max-xs:min-w-0 max-xs:flex-auto max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]",
|
|
141
141
|
children: x
|
|
142
142
|
}) : /* @__PURE__ */ e("div", {
|
|
143
143
|
id: p,
|
|
144
|
-
className:
|
|
144
|
+
className: n("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none max-xs:hyphens-auto max-xs:whitespace-normal", "max-xs:block max-xs:min-w-[min(100%,5rem)] max-xs:grow max-xs:basis-[min-content] max-xs:break-words"),
|
|
145
145
|
children: u
|
|
146
|
-
}), /* @__PURE__ */
|
|
147
|
-
className: "flex items-center gap-x-1 max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2",
|
|
146
|
+
}), /* @__PURE__ */ a("div", {
|
|
147
|
+
className: "flex items-center gap-x-1 max-xs:ml-auto max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2 max-xs:self-end",
|
|
148
148
|
children: [
|
|
149
149
|
/* @__PURE__ */ e(L.Provider, {
|
|
150
150
|
value: P,
|
|
151
151
|
children: X
|
|
152
152
|
}),
|
|
153
153
|
/* @__PURE__ */ e($, {
|
|
154
|
-
visibility: _ && !
|
|
154
|
+
visibility: _ && !r,
|
|
155
155
|
type: "minimize",
|
|
156
156
|
onClick: O,
|
|
157
157
|
tooltipTitle: i.minimize
|
|
158
158
|
}),
|
|
159
159
|
/* @__PURE__ */ e(de, {
|
|
160
|
-
showFullScreenIcon: (U || j) && !
|
|
160
|
+
showFullScreenIcon: (U || j) && !r,
|
|
161
161
|
disabledReason: N,
|
|
162
162
|
fullScreen: s,
|
|
163
163
|
onClick: () => {
|
|
@@ -166,7 +166,7 @@ var Pe = (C) => {
|
|
|
166
166
|
tooltipTitle: s ? i.exitFullscreen : i.fullscreen
|
|
167
167
|
}),
|
|
168
168
|
/* @__PURE__ */ e(V, {
|
|
169
|
-
buttonRef:
|
|
169
|
+
buttonRef: F,
|
|
170
170
|
showCloseIcon: R,
|
|
171
171
|
onClick: h,
|
|
172
172
|
disabledReason: g ? E : void 0,
|
|
@@ -176,11 +176,11 @@ var Pe = (C) => {
|
|
|
176
176
|
})]
|
|
177
177
|
}), x && /* @__PURE__ */ e("div", {
|
|
178
178
|
id: p,
|
|
179
|
-
className:
|
|
179
|
+
className: n("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
|
|
180
180
|
children: u
|
|
181
181
|
})]
|
|
182
182
|
}), /* @__PURE__ */ e("div", {
|
|
183
|
-
className:
|
|
183
|
+
className: n(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
|
|
184
184
|
children: /* @__PURE__ */ e(L.Provider, {
|
|
185
185
|
value: P,
|
|
186
186
|
children: G
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as e } from "../../../helpers/cn.js";
|
|
2
2
|
import { fieldLabelAboveClass as s } from "../field-styles.js";
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
"data-testid":
|
|
7
|
-
className:
|
|
8
|
-
children:
|
|
9
|
-
}) : /* @__PURE__ */
|
|
10
|
-
"data-testid":
|
|
11
|
-
className:
|
|
12
|
-
children: [/* @__PURE__ */
|
|
13
|
-
className:
|
|
14
|
-
children: d
|
|
15
|
-
}), /* @__PURE__ */ l("div", {
|
|
16
|
-
className: e.row,
|
|
3
|
+
import l from "./StyledFieldPair.module.js";
|
|
4
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
5
|
+
var n = ({ children: a, legend: i, className: d, dataTest: m }) => i == null ? /* @__PURE__ */ r("div", {
|
|
6
|
+
"data-testid": m,
|
|
7
|
+
className: e(l.row, "max-xs:[&>*]:max-w-full", d),
|
|
8
|
+
children: a
|
|
9
|
+
}) : /* @__PURE__ */ t("fieldset", {
|
|
10
|
+
"data-testid": m,
|
|
11
|
+
className: e(l.fieldset, d),
|
|
12
|
+
children: [/* @__PURE__ */ r("legend", {
|
|
13
|
+
className: e(l.legend, s()),
|
|
17
14
|
children: i
|
|
15
|
+
}), /* @__PURE__ */ r("div", {
|
|
16
|
+
className: e(l.row, "max-xs:[&>*]:max-w-full"),
|
|
17
|
+
children: a
|
|
18
18
|
})]
|
|
19
19
|
});
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
n as StyledFieldPair
|
|
22
22
|
};
|