asma-ui-core 3.137.0 → 3.137.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,7 @@ import { Skeleton as N } from "../../../mui-compat/Skeleton.js";
|
|
|
13
13
|
import { forwardRef as ae, useEffect as ie, useId as ne } from "react";
|
|
14
14
|
import { jsx as t, jsxs as S } from "react/jsx-runtime";
|
|
15
15
|
var ve = ae((V, D) => {
|
|
16
|
-
const { options: d, dataTest: z, value: r, readOnly:
|
|
16
|
+
const { options: d, dataTest: z, value: r, readOnly: a, multiple: n, title: A, titleSize: L, width: T = "full", disabled: x, onChange: p, required: R, error: b, helperText: C, disableHelperText: $, valueKey: B = "value", labelKey: E = "label", renderLabel: o, getOptionTooltip: I, loading: H, size: w, locale: q = "en", clearSelectionLabel: G } = V, K = ne(), { show: W, role: F } = ee("DynamicInteractiveChipGroup", b, C, !$, a), { containerRef: f, wrapDisabled: y } = le({ dependencyList: [d, d.length] });
|
|
17
17
|
ie(() => {
|
|
18
18
|
f.current && (f.current.inert = !0);
|
|
19
19
|
}, [f]);
|
|
@@ -22,14 +22,14 @@ var ve = ae((V, D) => {
|
|
|
22
22
|
return l == null ? "" : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : e == null ? "" : m(e);
|
|
23
23
|
}, s = (e, l) => g(e) === g(l), J = n ? Array.isArray(r) && r.length > 0 : r != null, M = (e) => {
|
|
24
24
|
if (!n) {
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
p(
|
|
25
|
+
const i = s(e, r) ? null : e;
|
|
26
|
+
if (i === null) return;
|
|
27
|
+
p(i);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const l = r ?? [];
|
|
31
|
-
p(l.find((
|
|
32
|
-
}, u =
|
|
31
|
+
p(l.find((i) => s(i, e)) ? l.filter((i) => !s(i, e)) : [...l, e]);
|
|
32
|
+
}, u = a ? d.filter((e) => !!(n ? r?.find((l) => s(l, e)) : s(r, e))) : d, P = u.findIndex((e) => !(typeof e == "object" && e?.disabled) && !a);
|
|
33
33
|
return /* @__PURE__ */ S("div", {
|
|
34
34
|
"data-testid": `${z}-dynamic-radio-group`,
|
|
35
35
|
className: "relative flex flex-col gap-y-1",
|
|
@@ -47,7 +47,7 @@ var ve = ae((V, D) => {
|
|
|
47
47
|
style: { width: "100%" },
|
|
48
48
|
children: u.map((e) => /* @__PURE__ */ t(O, {
|
|
49
49
|
className: "w-fit",
|
|
50
|
-
readOnly:
|
|
50
|
+
readOnly: a,
|
|
51
51
|
type: n ? "checkbox" : "radio",
|
|
52
52
|
dataTest: `ic-${c(e)}-hidden`,
|
|
53
53
|
label: o ? o(e) : m(e)
|
|
@@ -63,15 +63,15 @@ var ve = ae((V, D) => {
|
|
|
63
63
|
/* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" })
|
|
64
64
|
]
|
|
65
65
|
}) : u?.length ? u.map((e, l) => {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
const h = typeof e == "object" ? !!e?.disabled : !1, k = !h && !
|
|
66
|
+
const i = !!(n ? r?.find((U) => s(U, e)) : s(r, e)), Q = I ? I(e) : null;
|
|
67
|
+
if (a && !i) return null;
|
|
68
|
+
const h = typeof e == "object" ? !!e?.disabled : !1, k = !h && !a && l === P ? D : void 0;
|
|
69
69
|
return /* @__PURE__ */ t(X, {
|
|
70
70
|
title: Q,
|
|
71
71
|
arrow: !0,
|
|
72
72
|
children: /* @__PURE__ */ t("span", {
|
|
73
73
|
className: v(h && "cursor-not-allowed"),
|
|
74
|
-
children:
|
|
74
|
+
children: a && !y ? /* @__PURE__ */ t(_, {
|
|
75
75
|
ref: k,
|
|
76
76
|
disabled: !!x || h,
|
|
77
77
|
classes: { root: "min-h-[32px] h-full" },
|
|
@@ -86,10 +86,10 @@ var ve = ae((V, D) => {
|
|
|
86
86
|
label: "block whitespace-normal break-words overflow-visible"
|
|
87
87
|
} : { root: "min-h-[32px] h-full" },
|
|
88
88
|
className: "w-fit",
|
|
89
|
-
readOnly:
|
|
89
|
+
readOnly: a,
|
|
90
90
|
type: n ? "checkbox" : "radio",
|
|
91
91
|
dataTest: `ic-${c(e)}`,
|
|
92
|
-
checked:
|
|
92
|
+
checked: i,
|
|
93
93
|
size: w,
|
|
94
94
|
onClick: () => M(e),
|
|
95
95
|
label: o ? o(e) : m(e)
|
|
@@ -98,7 +98,7 @@ var ve = ae((V, D) => {
|
|
|
98
98
|
}, c(e));
|
|
99
99
|
}) : /* @__PURE__ */ t("span", { children: "-" })
|
|
100
100
|
}),
|
|
101
|
-
!R && J && !
|
|
101
|
+
!R && J && !a && !x && /* @__PURE__ */ t(Z, {
|
|
102
102
|
dataTest: "clear-selection-btn",
|
|
103
103
|
variant: "text",
|
|
104
104
|
startIcon: w === "medium" ? /* @__PURE__ */ t(j, {
|