asma-ui-core 3.87.1 → 3.87.3
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.
|
@@ -11,26 +11,26 @@ import { planToolbarActions as D } from "../../../custom/module/header-layout/pl
|
|
|
11
11
|
import { ToolbarActionButton as G } from "../../../custom/module/header-layout/ToolbarActionGroup.js";
|
|
12
12
|
import { useToolbarTranslations as U } from "../../../custom/module/header-layout/useTranslations.js";
|
|
13
13
|
import { useMemo as C, useState as X } from "react";
|
|
14
|
-
import { Fragment as _, jsx as r, jsxs as
|
|
15
|
-
var Y = 470, V = 8, k = "dialog-footer-right", N = "dialog-footer-more", I = (
|
|
16
|
-
function ce({ leftActions:
|
|
17
|
-
const W = U(E), { ref: R, widthPx: c } = F(), { register: m, widths:
|
|
14
|
+
import { Fragment as _, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
15
|
+
var Y = 470, V = 8, k = "dialog-footer-right", N = "dialog-footer-more", I = (t, n) => `dialog-footer-action:${t}:${n ? "label" : "icon"}`;
|
|
16
|
+
function ce({ leftActions: t = [], leadingSlot: n, secondaryAction: a, primaryAction: s, fixed: P = !1, rounded: B = !0, locale: E = "en", className: M, dataTest: d = "styled-dialog-footer" }) {
|
|
17
|
+
const W = U(E), { ref: R, widthPx: c } = F(), { register: m, widths: o } = H(), [p, h] = X(null), g = c > 0 && c < Y, S = g ? 8 : 16, u = C(() => t.filter((e) => !e.hidden).map((e) => e.icon == null && e.canHideLabel == null ? {
|
|
18
18
|
...e,
|
|
19
19
|
canHideLabel: !1
|
|
20
|
-
} : e), [
|
|
20
|
+
} : e), [t]), A = o[k] ?? 0, x = a != null || s != null, v = Math.max(0, c - S * 2 - A - (x ? V : 0)), f = C(() => D({
|
|
21
21
|
actions: u,
|
|
22
22
|
availableWidth: v,
|
|
23
23
|
collapseLabels: !0,
|
|
24
|
-
resolveActionWidth: (e,
|
|
25
|
-
moreButtonWidthPx:
|
|
24
|
+
resolveActionWidth: (e, l) => o[I(e.id, l)],
|
|
25
|
+
moreButtonWidthPx: o[N]
|
|
26
26
|
}), [
|
|
27
27
|
u,
|
|
28
28
|
v,
|
|
29
|
-
|
|
30
|
-
]), b = (e,
|
|
29
|
+
o
|
|
30
|
+
]), b = (e, l, L) => {
|
|
31
31
|
const y = /* @__PURE__ */ r(w, {
|
|
32
32
|
dataTest: e.dataTest ?? `${d}-${L}`,
|
|
33
|
-
variant: e.variant ??
|
|
33
|
+
variant: e.variant ?? l,
|
|
34
34
|
error: e.tone === "danger",
|
|
35
35
|
size: "medium",
|
|
36
36
|
type: e.type ?? "button",
|
|
@@ -54,20 +54,20 @@ function ce({ leftActions: o = [], leadingSlot: t, secondaryAction: a, primaryAc
|
|
|
54
54
|
})
|
|
55
55
|
}) : y;
|
|
56
56
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ i("div", {
|
|
58
58
|
ref: R,
|
|
59
59
|
"data-testid": d,
|
|
60
|
-
className: T("flex items-center justify-end border-0 border-t border-solid border-delta-200 bg-white", g ? "gap-2 p-2" : "gap-4 p-4", B && "rounded-b-lg", P && "sticky bottom-0 z-[1] shadow-[0_0_16px_0_rgba(34,33,51,0.2)]", M),
|
|
60
|
+
className: T("flex items-center justify-end self-stretch border-0 border-t border-solid border-delta-200 bg-white", g ? "gap-2 p-2" : "gap-4 p-4", B && "rounded-b-lg", P && "sticky bottom-0 z-[1] shadow-[0_0_16px_0_rgba(34,33,51,0.2)]", M),
|
|
61
61
|
children: [/* @__PURE__ */ r("div", {
|
|
62
62
|
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
63
|
-
children:
|
|
64
|
-
ref: m(I(e.id,
|
|
63
|
+
children: n ?? /* @__PURE__ */ i(_, { children: [f.inlineActions.map(({ action: e, showLabel: l }) => /* @__PURE__ */ r("span", {
|
|
64
|
+
ref: m(I(e.id, l)),
|
|
65
65
|
className: "inline-flex shrink-0",
|
|
66
66
|
children: /* @__PURE__ */ r(G, {
|
|
67
67
|
action: e,
|
|
68
|
-
showLabel:
|
|
68
|
+
showLabel: l
|
|
69
69
|
})
|
|
70
|
-
}, e.id)), f.showMoreMenu && /* @__PURE__ */
|
|
70
|
+
}, e.id)), f.showMoreMenu && /* @__PURE__ */ i(_, { children: [/* @__PURE__ */ r("span", {
|
|
71
71
|
ref: m(N),
|
|
72
72
|
className: "inline-flex shrink-0",
|
|
73
73
|
children: /* @__PURE__ */ r(w, {
|
|
@@ -101,7 +101,7 @@ function ce({ leftActions: o = [], leadingSlot: t, secondaryAction: a, primaryAc
|
|
|
101
101
|
onClick: () => {
|
|
102
102
|
h(null), e.onClick();
|
|
103
103
|
},
|
|
104
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ i("div", {
|
|
105
105
|
className: T("flex items-center gap-2", e.tone === "danger" ? "text-beta-500" : "text-delta-700"),
|
|
106
106
|
children: [e.icon, /* @__PURE__ */ r("span", { children: e.label })]
|
|
107
107
|
})
|
|
@@ -109,7 +109,7 @@ function ce({ leftActions: o = [], leadingSlot: t, secondaryAction: a, primaryAc
|
|
|
109
109
|
})] })] })
|
|
110
110
|
}), x && /* @__PURE__ */ r("span", {
|
|
111
111
|
className: "flex min-w-px flex-1 flex-nowrap items-center justify-end",
|
|
112
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ i("span", {
|
|
113
113
|
ref: m(k),
|
|
114
114
|
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
115
115
|
children: [a && b(a, "outlined", "secondary"), s && b(s, "contained", "primary")]
|
|
@@ -7,7 +7,7 @@ import { useHelperSlot as Mt } from "../../../helpers/useHelperSlot.js";
|
|
|
7
7
|
import x from "./StyledSlider.module.js";
|
|
8
8
|
import { useId as Pt, useRef as et, useState as rt } from "react";
|
|
9
9
|
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
10
|
-
var j = (m, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (m - l) / (o - l) * 100)), It = (m) => Array.isArray(m) ? [m[0] ?? 0, m[1] ?? 0] : null, Ut = ({ dataTest: m, min: l = 0, max: o = 100, step: h = 1, value: V, defaultValue: lt, disabled: u, size: B = "medium", orientation: F = "horizontal", marks: A, name: at, className: nt, classes: p, slotProps: R, error: N, errorText: ot, helperText: K, reserveHelperText: ct, fromLabel: T, toLabel: D, showButtons: X, ariaLabel: $, ariaLabelledBy: it, onChange: M, onChangeCommitted: k }) => {
|
|
10
|
+
var j = (m, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (m - l) / (o - l) * 100)), It = (m) => Array.isArray(m) ? [m[0] ?? 0, m[1] ?? 0] : null, Ut = ({ dataTest: m, min: l = 0, max: o = 100, step: h = 1, value: V, defaultValue: lt, disabled: u, size: B = "medium", orientation: F = "horizontal", marks: A, name: at, className: nt, classes: p, slotProps: R, error: N, errorText: ot, helperText: K, reserveHelperText: ct, fromLabel: T, toLabel: D, showButtons: X = !0, ariaLabel: $, ariaLabelledBy: it, onChange: M, onChangeCommitted: k }) => {
|
|
11
11
|
const Y = Pt(), a = F === "vertical", s = B === "small" ? 6 : 8, b = et(null), g = et(null), [st, P] = rt(null), [ut, q] = rt(lt ?? l), v = st ?? V ?? ut, n = It(v), d = n !== null, E = N ? ot ?? K : K, { show: G, role: dt } = Mt("StyledSlider", N, E, ct), H = (A === !0 && Number.isFinite(h) && h > 0 && o > l ? Array.from({ length: Math.floor((o - l) / h) + 1 }, (t, r) => ({ value: l + h * r })) : Array.isArray(A) ? A : []).filter((t) => t.value >= l && t.value <= o), J = d ? Math.min(n[0], n[1]) : l, U = d ? Math.max(n[0], n[1]) : v, O = (t) => d ? t >= J && t <= U : t <= U, ft = d ? Math.min(n[0], n[1]) <= l : v <= l, ht = d ? Math.max(n[0], n[1]) >= o : v >= o, z = d ? j(J, l, o) : 0, Q = j(U, l, o) - z, mt = a ? {
|
|
12
12
|
bottom: `${z}%`,
|
|
13
13
|
height: `${Q}%`
|
|
@@ -70,34 +70,35 @@ var j = (m, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (m - l) / (o - l) *
|
|
|
70
70
|
}, t);
|
|
71
71
|
return /* @__PURE__ */ y("div", {
|
|
72
72
|
className: c("flex max-w-[600px] flex-col gap-3", a && "h-full"),
|
|
73
|
-
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
!a &&
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
children: [
|
|
74
|
+
!a && (T ?? D) && /* @__PURE__ */ y("div", {
|
|
75
|
+
className: "grid w-full grid-cols-2 gap-4",
|
|
76
|
+
children: [!a && T && /* @__PURE__ */ i("span", {
|
|
77
|
+
className: "min-w-0 break-words text-left font-normal text-delta-800",
|
|
78
|
+
children: T
|
|
79
|
+
}), !a && D && /* @__PURE__ */ i("span", {
|
|
80
|
+
className: "min-w-0 break-words text-right font-normal text-delta-800",
|
|
81
|
+
children: D
|
|
82
|
+
})]
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ y("div", {
|
|
85
|
+
className: c("flex", !a && "w-full items-start gap-3", a && "h-full flex-col items-center"),
|
|
86
|
+
children: [
|
|
87
|
+
!a && X && /* @__PURE__ */ i(tt, {
|
|
88
|
+
dataTest: "slider-from-button",
|
|
89
|
+
"aria-label": "Decrease value",
|
|
90
|
+
className: "-mt-0.5 w-8",
|
|
91
|
+
variant: "outlined",
|
|
92
|
+
disabled: u ?? ft,
|
|
93
|
+
startIcon: /* @__PURE__ */ i(xt, {
|
|
94
|
+
width: 24,
|
|
95
|
+
height: 24
|
|
96
|
+
}),
|
|
97
|
+
onClick: Z("decrement")
|
|
94
98
|
}),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
className: c("relative flex", a ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", p?.root, nt),
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ y("div", {
|
|
99
|
+
/* @__PURE__ */ y("div", {
|
|
100
|
+
className: c("relative flex", a ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", p?.root, nt),
|
|
101
|
+
children: [/* @__PURE__ */ y("div", {
|
|
101
102
|
className: c("relative", a ? "h-full w-8" : "h-4 w-full", u ? "cursor-default" : "cursor-pointer"),
|
|
102
103
|
style: { touchAction: "none" },
|
|
103
104
|
onPointerDown: bt,
|
|
@@ -128,8 +129,7 @@ var j = (m, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (m - l) / (o - l) *
|
|
|
128
129
|
})
|
|
129
130
|
]
|
|
130
131
|
}), d ? [_(0, n[0]), _(1, n[1])] : _(0, v)]
|
|
131
|
-
}),
|
|
132
|
-
H.some((t) => t.label != null) && /* @__PURE__ */ i("div", {
|
|
132
|
+
}), H.some((t) => t.label != null) && /* @__PURE__ */ i("div", {
|
|
133
133
|
className: c(a ? "pointer-events-none absolute inset-x-0" : "relative mt-[14px] h-6"),
|
|
134
134
|
style: a ? {
|
|
135
135
|
top: s,
|
|
@@ -143,30 +143,30 @@ var j = (m, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (m - l) / (o - l) *
|
|
|
143
143
|
style: W(t.value),
|
|
144
144
|
children: t.label
|
|
145
145
|
}, t.value))
|
|
146
|
-
})
|
|
147
|
-
G && /* @__PURE__ */ i(Nt, {
|
|
148
|
-
id: Y,
|
|
149
|
-
role: dt,
|
|
150
|
-
error: N,
|
|
151
|
-
message: E,
|
|
152
|
-
className: "m-0 items-center"
|
|
153
|
-
})
|
|
154
|
-
]
|
|
155
|
-
}),
|
|
156
|
-
!a && X && /* @__PURE__ */ i(tt, {
|
|
157
|
-
dataTest: "slider-to-button",
|
|
158
|
-
"aria-label": "Increase value",
|
|
159
|
-
className: "-mt-0.5 w-8",
|
|
160
|
-
variant: "outlined",
|
|
161
|
-
disabled: u ?? ht,
|
|
162
|
-
startIcon: /* @__PURE__ */ i(yt, {
|
|
163
|
-
width: 24,
|
|
164
|
-
height: 24
|
|
146
|
+
})]
|
|
165
147
|
}),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
148
|
+
!a && X && /* @__PURE__ */ i(tt, {
|
|
149
|
+
dataTest: "slider-to-button",
|
|
150
|
+
"aria-label": "Increase value",
|
|
151
|
+
className: "-mt-0.5 w-8",
|
|
152
|
+
variant: "outlined",
|
|
153
|
+
disabled: u ?? ht,
|
|
154
|
+
startIcon: /* @__PURE__ */ i(yt, {
|
|
155
|
+
width: 24,
|
|
156
|
+
height: 24
|
|
157
|
+
}),
|
|
158
|
+
onClick: Z("increment")
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
G && /* @__PURE__ */ i(Nt, {
|
|
163
|
+
id: Y,
|
|
164
|
+
role: dt,
|
|
165
|
+
error: N,
|
|
166
|
+
message: E,
|
|
167
|
+
className: "m-0 items-center"
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
170
|
});
|
|
171
171
|
};
|
|
172
172
|
export {
|