asma-ui-core 3.108.3 → 3.109.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/dist/asma-ui-core.css +1 -1
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +18 -18
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +52 -51
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +66 -65
- package/dist/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.js +13 -12
- package/dist/components/inputs/dynamic-select/components/DynamicSelectTitle.js +9 -0
- package/dist/components/inputs/select/StyledSelect.js +56 -50
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +102 -96
- package/dist/components/navigation/drawer/StyledDrawer.js +55 -51
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +158 -118
- package/dist/components/utils/popover/PopoverSheet.js +95 -85
- package/dist/components/utils/popover/StyledPopover.js +81 -71
- package/dist/datetime/components/date-picker/StyledDatePicker.js +36 -27
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +9 -8
- package/dist/datetime/components/time-picker/StyledTimePicker.js +75 -64
- package/dist/datetime/hooks/useBackNavigationClose.hook.js +19 -0
- package/dist/src/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.d.ts +2 -2
- package/dist/src/components/inputs/dynamic-select/components/DynamicSelectTitle.d.ts +14 -0
- package/dist/src/components/inputs/dynamic-select/types.d.ts +8 -2
- package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +2 -0
- package/dist/src/components/utils/bottom-sheet/StyledBottomSheet.d.ts +6 -2
- package/dist/src/components/utils/popover/StyledPopover.d.ts +3 -1
- package/dist/src/datetime/hooks/useBackNavigationClose.hook.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { cn as o } from "../../../helpers/cn.js";
|
|
2
|
-
import { StyledChip as
|
|
3
|
-
import { StyledCheckbox as
|
|
2
|
+
import { StyledChip as v } from "../chip/StyledChip.js";
|
|
3
|
+
import { StyledCheckbox as f } from "../../inputs/checkbox/base-ui/StyledCheckbox.js";
|
|
4
4
|
import { StyledRadio as x } from "../../inputs/radio-button/base-ui/StyledRadio.js";
|
|
5
5
|
import i from "./StyledInteractiveChip.module.js";
|
|
6
|
-
import { forwardRef as
|
|
6
|
+
import { forwardRef as _ } from "react";
|
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
-
const t = l === "checkbox", m = n ?? (typeof
|
|
10
|
-
dataTest:
|
|
8
|
+
var y = "[&[data-testid][role]]:border-gama-400 [&[data-testid][role]]:shadow-[inset_0_0_0_1px_var(--colors-gama-400)] [&[data-testid][role]]:bg-gama-25", S = { paddingLeft: "6px" }, R = _(({ type: l = "checkbox", checked: e, size: d = "small", ariaLabel: n, ...a }, c) => {
|
|
9
|
+
const t = l === "checkbox", m = n ?? (typeof a.label == "string" ? a.label : void 0), s = !a.readOnly && !t && !!e, b = t ? /* @__PURE__ */ r(f, {
|
|
10
|
+
dataTest: a.dataTest,
|
|
11
11
|
disableRipple: !0,
|
|
12
|
-
checked:
|
|
12
|
+
checked: e,
|
|
13
13
|
size: d,
|
|
14
|
-
readOnly:
|
|
14
|
+
readOnly: a.readOnly,
|
|
15
15
|
decorative: !0,
|
|
16
16
|
className: o("pointer-events-none", i.control)
|
|
17
17
|
}) : /* @__PURE__ */ r(x, {
|
|
18
|
-
dataTest:
|
|
19
|
-
checked:
|
|
18
|
+
dataTest: a.dataTest,
|
|
19
|
+
checked: e,
|
|
20
20
|
size: d,
|
|
21
21
|
decorative: !0,
|
|
22
22
|
className: o("pointer-events-none", i.control)
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */ r(
|
|
24
|
+
return /* @__PURE__ */ r(v, {
|
|
25
25
|
ref: c,
|
|
26
26
|
"aria-label": m,
|
|
27
27
|
role: l,
|
|
28
|
-
"aria-checked": !!
|
|
29
|
-
"aria-readonly": t ?
|
|
28
|
+
"aria-checked": !!e,
|
|
29
|
+
"aria-readonly": t ? a.readOnly : void 0,
|
|
30
30
|
avatar: b,
|
|
31
31
|
clickable: !0,
|
|
32
32
|
tabIndex: 0,
|
|
33
|
-
...
|
|
34
|
-
className: o(s &&
|
|
33
|
+
...a,
|
|
34
|
+
className: o(s && y, a.className),
|
|
35
35
|
sx: {
|
|
36
|
-
...
|
|
37
|
-
...
|
|
36
|
+
...S,
|
|
37
|
+
...a.sx
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
R as StyledInteractiveChip
|
|
43
43
|
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { cn as v } from "../../../../helpers/cn.js";
|
|
2
|
-
import { StyledTooltip as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { ErrorOutlineIcon as
|
|
5
|
-
import { StyledChip as
|
|
6
|
-
import { StyledInteractiveChip as
|
|
7
|
-
import { StyledButton as
|
|
8
|
-
import { useHelperAlertRole as
|
|
9
|
-
import { warnMissingErrorMessage as
|
|
10
|
-
import { useWrap as
|
|
2
|
+
import { StyledTooltip as P } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
|
+
import { CloseIcon as k } from "../../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { ErrorOutlineIcon as Q } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
5
|
+
import { StyledChip as U } from "../../../data-display/chip/StyledChip.js";
|
|
6
|
+
import { StyledInteractiveChip as j } from "../../../data-display/interactive-chip/StyledInteractiveChip.js";
|
|
7
|
+
import { StyledButton as X } from "../../button/StyledButton.js";
|
|
8
|
+
import { useHelperAlertRole as Y } from "../../../../helpers/useHelperAlertRole.js";
|
|
9
|
+
import { warnMissingErrorMessage as Z } from "../../../../helpers/warnMissingErrorMessage.js";
|
|
10
|
+
import { useWrap as _ } from "../helpers/useWrap.js";
|
|
11
|
+
import { DynamicSelectTitle as ee } from "./DynamicSelectTitle.js";
|
|
11
12
|
import { Skeleton as N } from "../../../mui-compat/Skeleton.js";
|
|
12
|
-
import { forwardRef as
|
|
13
|
+
import { forwardRef as te, useEffect as le, useId as re } from "react";
|
|
13
14
|
import { jsx as t, jsxs as T } from "react/jsx-runtime";
|
|
14
|
-
var
|
|
15
|
-
const { options: d, dataTest:
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
15
|
+
var ge = te((O, V) => {
|
|
16
|
+
const { options: d, dataTest: A, value: r, readOnly: i, multiple: n, title: D, titleSize: R, disabled: b, onChange: p, required: z, error: f, helperText: S, valueKey: E = "value", labelKey: L = "label", renderLabel: o, getOptionTooltip: C, loading: $, size: g, locale: B = "en", clearSelectionLabel: q } = O, G = re();
|
|
17
|
+
Z("DynamicInteractiveChipGroup", f, S);
|
|
18
|
+
const K = Y(f), { containerRef: m, wrapDisabled: y } = _({ dependencyList: [d, d.length] });
|
|
19
|
+
le(() => {
|
|
19
20
|
m.current && (m.current.inert = !0);
|
|
20
21
|
}, [m]);
|
|
21
|
-
const u = (e) => typeof e == "object" ? e?.[L]?.toString() ?? "" : e?.toString() ?? "",
|
|
22
|
-
const l =
|
|
22
|
+
const u = (e) => typeof e == "object" ? e?.[L]?.toString() ?? "" : e?.toString() ?? "", w = (e) => typeof e == "object" ? e?.[E] : e, c = (e) => {
|
|
23
|
+
const l = w(e);
|
|
23
24
|
return l == null ? "" : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : e == null ? "" : u(e);
|
|
24
|
-
}, s = (e, l) =>
|
|
25
|
-
if (!
|
|
25
|
+
}, s = (e, l) => w(e) === w(l), M = n ? Array.isArray(r) && r.length > 0 : r != null, F = (e) => {
|
|
26
|
+
if (!n) {
|
|
26
27
|
const a = s(e, r) ? null : e;
|
|
27
28
|
if (a === null) return;
|
|
28
29
|
p(a);
|
|
@@ -30,30 +31,30 @@ var he = _((V, A) => {
|
|
|
30
31
|
}
|
|
31
32
|
const l = r ?? [];
|
|
32
33
|
p(l.find((a) => s(a, e)) ? l.filter((a) => !s(a, e)) : [...l, e]);
|
|
33
|
-
}, h =
|
|
34
|
+
}, h = i ? d.filter((e) => !!(n ? r?.find((l) => s(l, e)) : s(r, e))) : d, H = h.findIndex((e) => !(typeof e == "object" && e?.disabled) && !i);
|
|
34
35
|
return /* @__PURE__ */ T("div", {
|
|
35
|
-
"data-testid": `${
|
|
36
|
+
"data-testid": `${A}-dynamic-radio-group`,
|
|
36
37
|
className: "relative flex flex-col gap-y-1",
|
|
37
38
|
children: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
/* @__PURE__ */ t(ee, {
|
|
40
|
+
title: D,
|
|
41
|
+
titleSize: R
|
|
41
42
|
}),
|
|
42
43
|
/* @__PURE__ */ t("div", {
|
|
43
44
|
"aria-hidden": !0,
|
|
44
45
|
ref: m,
|
|
45
46
|
className: "pointer-events-none absolute left-0 top-0 flex flex-wrap gap-2 opacity-0",
|
|
46
47
|
style: { width: "100%" },
|
|
47
|
-
children: h.map((e) => /* @__PURE__ */ t(
|
|
48
|
+
children: h.map((e) => /* @__PURE__ */ t(j, {
|
|
48
49
|
className: "w-fit",
|
|
49
|
-
readOnly:
|
|
50
|
-
type:
|
|
50
|
+
readOnly: i,
|
|
51
|
+
type: n ? "checkbox" : "radio",
|
|
51
52
|
dataTest: `ic-${c(e)}-hidden`,
|
|
52
53
|
label: o ? o(e) : u(e)
|
|
53
54
|
}, c(e)))
|
|
54
55
|
}),
|
|
55
56
|
/* @__PURE__ */ t("div", {
|
|
56
|
-
className: v("flex flex-wrap gap-2",
|
|
57
|
+
className: v("flex flex-wrap gap-2", y && "flex-col gap-1"),
|
|
57
58
|
children: $ ? /* @__PURE__ */ T("div", {
|
|
58
59
|
className: "flex flex-wrap gap-2",
|
|
59
60
|
children: [
|
|
@@ -62,74 +63,74 @@ var he = _((V, A) => {
|
|
|
62
63
|
/* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" })
|
|
63
64
|
]
|
|
64
65
|
}) : h?.length ? h.map((e, l) => {
|
|
65
|
-
const a = !!(
|
|
66
|
-
if (
|
|
67
|
-
const x = typeof e == "object" ? !!e?.disabled : !1,
|
|
68
|
-
return /* @__PURE__ */ t(
|
|
69
|
-
title:
|
|
66
|
+
const a = !!(n ? r?.find((J) => s(J, e)) : s(r, e)), W = C ? C(e) : null;
|
|
67
|
+
if (i && !a) return null;
|
|
68
|
+
const x = typeof e == "object" ? !!e?.disabled : !1, I = !x && !i && l === H ? V : void 0;
|
|
69
|
+
return /* @__PURE__ */ t(P, {
|
|
70
|
+
title: W,
|
|
70
71
|
arrow: !0,
|
|
71
72
|
children: /* @__PURE__ */ t("span", {
|
|
72
73
|
className: v(x && "cursor-not-allowed"),
|
|
73
|
-
children:
|
|
74
|
-
ref:
|
|
74
|
+
children: i && !y ? /* @__PURE__ */ t(U, {
|
|
75
|
+
ref: I,
|
|
75
76
|
disabled: !!b || x,
|
|
76
77
|
classes: { root: "min-h-[32px] h-full" },
|
|
77
78
|
className: "w-fit",
|
|
78
79
|
dataTest: `ic-${c(e)}`,
|
|
79
80
|
label: o ? o(e) : u(e)
|
|
80
|
-
}) : /* @__PURE__ */ t(
|
|
81
|
-
ref:
|
|
81
|
+
}) : /* @__PURE__ */ t(j, {
|
|
82
|
+
ref: I,
|
|
82
83
|
disabled: !!b || x,
|
|
83
|
-
classes:
|
|
84
|
+
classes: y ? {
|
|
84
85
|
root: "border-none outline-none bg-transparent w-full flex justify-start h-full min-h-[40px] shadow-none",
|
|
85
86
|
label: "block whitespace-normal break-words overflow-visible"
|
|
86
87
|
} : { root: "min-h-[32px] h-full" },
|
|
87
88
|
className: "w-fit",
|
|
88
|
-
readOnly:
|
|
89
|
-
type:
|
|
89
|
+
readOnly: i,
|
|
90
|
+
type: n ? "checkbox" : "radio",
|
|
90
91
|
dataTest: `ic-${c(e)}`,
|
|
91
92
|
checked: a,
|
|
92
93
|
size: g,
|
|
93
|
-
onClick: () =>
|
|
94
|
+
onClick: () => F(e),
|
|
94
95
|
label: o ? o(e) : u(e)
|
|
95
96
|
})
|
|
96
97
|
})
|
|
97
98
|
}, c(e));
|
|
98
99
|
}) : /* @__PURE__ */ t("span", { children: "-" })
|
|
99
100
|
}),
|
|
100
|
-
!
|
|
101
|
+
!z && M && !i && !b && /* @__PURE__ */ t(X, {
|
|
101
102
|
dataTest: "clear-selection-btn",
|
|
102
103
|
variant: "text",
|
|
103
|
-
startIcon: g === "medium" ? /* @__PURE__ */ t(
|
|
104
|
+
startIcon: g === "medium" ? /* @__PURE__ */ t(k, {
|
|
104
105
|
height: 24,
|
|
105
106
|
width: 24,
|
|
106
107
|
className: "size-6"
|
|
107
|
-
}) : /* @__PURE__ */ t(
|
|
108
|
+
}) : /* @__PURE__ */ t(k, {
|
|
108
109
|
height: 20,
|
|
109
110
|
width: 20,
|
|
110
111
|
className: "size-5"
|
|
111
112
|
}),
|
|
112
113
|
className: "w-fit",
|
|
113
114
|
size: g,
|
|
114
|
-
onClick: () => p(
|
|
115
|
-
children:
|
|
115
|
+
onClick: () => p(n ? [] : null),
|
|
116
|
+
children: q ?? (B === "en" ? "Clear selection" : "Fjern valget")
|
|
116
117
|
}),
|
|
117
118
|
/* @__PURE__ */ T("div", {
|
|
118
|
-
id:
|
|
119
|
-
role:
|
|
119
|
+
id: G,
|
|
120
|
+
role: K,
|
|
120
121
|
className: v("flex min-h-[24px] items-center gap-1 pt-1 text-sm/5 text-delta-600", f && "text-error-500"),
|
|
121
|
-
children: [f && /* @__PURE__ */ t(
|
|
122
|
+
children: [f && /* @__PURE__ */ t(Q, {
|
|
122
123
|
width: 20,
|
|
123
124
|
height: 20,
|
|
124
125
|
className: "min-w-5"
|
|
125
126
|
}), /* @__PURE__ */ t("span", {
|
|
126
127
|
className: "line-clamp-1",
|
|
127
|
-
children:
|
|
128
|
+
children: S
|
|
128
129
|
})]
|
|
129
130
|
})
|
|
130
131
|
]
|
|
131
132
|
});
|
|
132
133
|
});
|
|
133
134
|
export {
|
|
134
|
-
|
|
135
|
+
ge as DynamicInteractiveChipGroup
|
|
135
136
|
};
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { StyledTooltip as
|
|
3
|
-
import { LoadingIcon as
|
|
4
|
-
import { CheckIcon as
|
|
1
|
+
import { cn as L } from "../../../../helpers/cn.js";
|
|
2
|
+
import { StyledTooltip as q } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
|
+
import { LoadingIcon as le } from "../../../icons/loading-icon/LoadingIcon.js";
|
|
4
|
+
import { CheckIcon as re } from "../../../icons/check-icon/CheckIcon.js";
|
|
5
5
|
import { PlusIconCircle as ae } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
6
6
|
import { StyledChip as E } from "../../../data-display/chip/StyledChip.js";
|
|
7
|
-
import { StyledCheckbox as
|
|
8
|
-
import { StyledInputField as
|
|
9
|
-
import { StyledSelectAutocomplete as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { StyledCheckbox as oe } from "../../checkbox/base-ui/StyledCheckbox.js";
|
|
8
|
+
import { StyledInputField as ie } from "../../input-field/StyledInputField.js";
|
|
9
|
+
import { StyledSelectAutocomplete as ne } from "../../select-autocomplete/StyledSelectAutocomplete.js";
|
|
10
|
+
import { DynamicSelectTitle as se } from "./DynamicSelectTitle.js";
|
|
11
|
+
import { DynamicInteractiveChipGroup as de } from "./DynamicInteractiveChipGroup.js";
|
|
12
|
+
import { createElement as F, forwardRef as ce, useCallback as h, useState as ue } from "react";
|
|
12
13
|
import { Fragment as K, jsx as l, jsxs as T } from "react/jsx-runtime";
|
|
13
|
-
var
|
|
14
|
-
const [_,
|
|
15
|
-
const t =
|
|
14
|
+
var Se = ce((C, H) => {
|
|
15
|
+
const [_, O] = ue(!1), { options: S, dataTest: f, value: g, readOnly: u, multiple: o, required: R, onChange: x, size: W, rowSize: y = "compact", title: k, titleSize: G, noOptionsText: J, placeholder: M, disabled: I, helperText: Q, disableHelperText: N, error: A, valueKey: P = "value", labelKey: U = "label", renderLabel: s, getOptionTooltip: V, startAdornment: X, autocompleteProps: i, loading: m, maxTags: Y, onFocus: Z, onBlur: ee } = C, d = (e) => typeof e == "object" ? e?.[U]?.toString() ?? "" : e?.toString() ?? "", p = h((e) => typeof e == "object" ? e?.[P] : e, [P]), $ = h((e, t) => p(e) === p(t), [p]), v = (e) => {
|
|
16
|
+
const t = p(e);
|
|
16
17
|
return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : d(e);
|
|
17
18
|
}, B = h((e) => {
|
|
18
|
-
|
|
19
|
-
}, [i]),
|
|
20
|
-
|
|
19
|
+
O(!0), i?.onOpen?.(e);
|
|
20
|
+
}, [i]), te = h((e, t) => {
|
|
21
|
+
O(!1), i?.onClose?.(e, t);
|
|
21
22
|
}, [i]);
|
|
22
|
-
if (o && u) return /* @__PURE__ */ l(
|
|
23
|
-
const
|
|
23
|
+
if (o && u) return /* @__PURE__ */ l(de, { ...C });
|
|
24
|
+
const w = k ? `${f}-title` : void 0;
|
|
24
25
|
return /* @__PURE__ */ T("div", {
|
|
25
26
|
className: "flex w-full flex-col gap-y-1",
|
|
26
|
-
children: [
|
|
27
|
-
id:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}), /* @__PURE__ */ l(
|
|
27
|
+
children: [/* @__PURE__ */ l(se, {
|
|
28
|
+
id: w,
|
|
29
|
+
title: k,
|
|
30
|
+
titleSize: G
|
|
31
|
+
}), /* @__PURE__ */ l(ne, {
|
|
31
32
|
open: _,
|
|
32
33
|
onOpen: B,
|
|
33
|
-
onClose:
|
|
34
|
+
onClose: te,
|
|
34
35
|
disableCloseOnSelect: o,
|
|
35
36
|
dataTest: f,
|
|
36
37
|
disabled: !!I || !!m,
|
|
37
|
-
noOptionsText:
|
|
38
|
+
noOptionsText: J,
|
|
38
39
|
loading: m,
|
|
39
40
|
readOnly: u,
|
|
40
41
|
value: g,
|
|
41
42
|
size: W,
|
|
42
43
|
rowSize: y,
|
|
43
44
|
disableClearable: R,
|
|
44
|
-
options:
|
|
45
|
+
options: S,
|
|
45
46
|
fullWidth: !0,
|
|
46
47
|
classes: { listbox: "max-h-[300px]" },
|
|
47
48
|
getOptionLabel: i?.getOptionLabel ?? d,
|
|
@@ -54,12 +55,12 @@ var Ce = se((O, H) => {
|
|
|
54
55
|
multiple: o,
|
|
55
56
|
renderValue: o ? (e) => {
|
|
56
57
|
if (!Array.isArray(e)) return null;
|
|
57
|
-
const t = e, c =
|
|
58
|
-
return [...
|
|
59
|
-
dataTest: `${
|
|
58
|
+
const t = e, c = Y ?? S.length, a = t.slice(0, c), n = t.length - c;
|
|
59
|
+
return [...a.map((r) => /* @__PURE__ */ l(E, {
|
|
60
|
+
dataTest: `${v(r)}-chip`,
|
|
60
61
|
readOnly: u,
|
|
61
62
|
variant: "outlined",
|
|
62
|
-
label: s ? s(
|
|
63
|
+
label: s ? s(r) : d(r),
|
|
63
64
|
classes: {
|
|
64
65
|
root: "h-fit w-fit min-h-[32px]",
|
|
65
66
|
label: "block whitespace-normal"
|
|
@@ -67,9 +68,9 @@ var Ce = se((O, H) => {
|
|
|
67
68
|
disabled: !!I || !!m,
|
|
68
69
|
deleteButtonTabIndex: -1,
|
|
69
70
|
onDelete: () => {
|
|
70
|
-
Array.isArray(g) && x(g.filter((
|
|
71
|
+
Array.isArray(g) && x(g.filter((b) => !$(b, r)));
|
|
71
72
|
}
|
|
72
|
-
},
|
|
73
|
+
}, v(r))), n > 0 ? /* @__PURE__ */ l(E, {
|
|
73
74
|
dataTest: "remaining-count-tag-chip",
|
|
74
75
|
label: `+${n}`,
|
|
75
76
|
variant: "outlined",
|
|
@@ -77,7 +78,7 @@ var Ce = se((O, H) => {
|
|
|
77
78
|
onClick: B
|
|
78
79
|
}, "remaining-count") : null];
|
|
79
80
|
} : void 0,
|
|
80
|
-
popupIcon: m ? /* @__PURE__ */ l(
|
|
81
|
+
popupIcon: m ? /* @__PURE__ */ l(le, {
|
|
81
82
|
height: 24,
|
|
82
83
|
width: 24
|
|
83
84
|
}) : o ? /* @__PURE__ */ l(ae, {
|
|
@@ -85,64 +86,64 @@ var Ce = se((O, H) => {
|
|
|
85
86
|
width: 24
|
|
86
87
|
}) : void 0,
|
|
87
88
|
renderOption: (e, t, c) => {
|
|
88
|
-
const
|
|
89
|
-
id:
|
|
89
|
+
const a = typeof t == "object" ? !!t?.disabled : !1, n = V ? V(t) : null, r = a && n ? `${e.id}-reason` : void 0, b = r && e["data-active"] !== void 0 ? !0 : void 0, D = r && /* @__PURE__ */ l("span", {
|
|
90
|
+
id: r,
|
|
90
91
|
className: "sr-only",
|
|
91
92
|
"aria-hidden": "true",
|
|
92
93
|
children: n
|
|
93
94
|
});
|
|
94
95
|
if (o) {
|
|
95
|
-
const
|
|
96
|
+
const z = c.selected;
|
|
96
97
|
return /* @__PURE__ */ F("li", {
|
|
97
98
|
...e,
|
|
98
99
|
role: "option",
|
|
99
|
-
"aria-selected":
|
|
100
|
+
"aria-selected": z,
|
|
100
101
|
key: e.id,
|
|
101
|
-
onClick:
|
|
102
|
-
className:
|
|
103
|
-
"aria-disabled":
|
|
104
|
-
"aria-describedby":
|
|
105
|
-
},
|
|
102
|
+
onClick: a ? void 0 : e.onClick,
|
|
103
|
+
className: L("relative box-border flex cursor-pointer items-center gap-x-1 bg-white px-2 py-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", y === "regular" ? "min-h-12" : "min-h-10", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
|
|
104
|
+
"aria-disabled": a,
|
|
105
|
+
"aria-describedby": r
|
|
106
|
+
}, D, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
|
|
106
107
|
"aria-hidden": "true",
|
|
107
108
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
108
|
-
}), /* @__PURE__ */ l(
|
|
109
|
+
}), /* @__PURE__ */ l(q, {
|
|
109
110
|
arrow: !0,
|
|
110
111
|
title: n,
|
|
111
|
-
open:
|
|
112
|
-
children: /* @__PURE__ */ T(K, { children: [/* @__PURE__ */ l(
|
|
113
|
-
disabled:
|
|
114
|
-
dataTest: `${
|
|
112
|
+
open: b,
|
|
113
|
+
children: /* @__PURE__ */ T(K, { children: [/* @__PURE__ */ l(oe, {
|
|
114
|
+
disabled: a,
|
|
115
|
+
dataTest: `${v(t)}-checkbox`,
|
|
115
116
|
size: "small",
|
|
116
117
|
decorative: !0,
|
|
117
118
|
hideWrapper: !0,
|
|
118
119
|
className: "min-w-[36px]",
|
|
119
|
-
checked:
|
|
120
|
+
checked: z
|
|
120
121
|
}), s ? s(t) : /* @__PURE__ */ l("span", {
|
|
121
122
|
className: "line-clamp-2 h-fit min-w-0 flex-1 break-words text-base text-delta-800",
|
|
122
123
|
children: d(t)
|
|
123
124
|
})] })
|
|
124
125
|
}));
|
|
125
126
|
}
|
|
126
|
-
const
|
|
127
|
+
const j = c.selected;
|
|
127
128
|
return /* @__PURE__ */ F("li", {
|
|
128
129
|
...e,
|
|
129
130
|
role: "option",
|
|
130
|
-
"aria-selected":
|
|
131
|
+
"aria-selected": j,
|
|
131
132
|
key: e.id,
|
|
132
|
-
className:
|
|
133
|
-
onClick:
|
|
134
|
-
"aria-disabled":
|
|
135
|
-
"aria-describedby":
|
|
136
|
-
},
|
|
133
|
+
className: L("relative box-border flex cursor-pointer items-center gap-x-1 px-2 py-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", y === "regular" ? "min-h-12" : "min-h-10", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
|
|
134
|
+
onClick: a ? void 0 : e.onClick,
|
|
135
|
+
"aria-disabled": a,
|
|
136
|
+
"aria-describedby": r
|
|
137
|
+
}, D, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
|
|
137
138
|
"aria-hidden": "true",
|
|
138
139
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
139
|
-
}), /* @__PURE__ */ l(
|
|
140
|
+
}), /* @__PURE__ */ l(q, {
|
|
140
141
|
arrow: !0,
|
|
141
142
|
title: n,
|
|
142
|
-
open:
|
|
143
|
+
open: b,
|
|
143
144
|
children: /* @__PURE__ */ T(K, { children: [/* @__PURE__ */ l("span", {
|
|
144
145
|
className: "w-5 min-w-5",
|
|
145
|
-
children:
|
|
146
|
+
children: j && /* @__PURE__ */ l(re, {
|
|
146
147
|
className: "size-5 min-h-5 min-w-5 text-gama-500",
|
|
147
148
|
height: 20,
|
|
148
149
|
width: 20
|
|
@@ -153,30 +154,30 @@ var Ce = se((O, H) => {
|
|
|
153
154
|
})] })
|
|
154
155
|
}));
|
|
155
156
|
},
|
|
156
|
-
renderInput: (e) => /* @__PURE__ */ l(
|
|
157
|
+
renderInput: (e) => /* @__PURE__ */ l(ie, {
|
|
157
158
|
dataTest: `${f}-input-field`,
|
|
158
159
|
...e,
|
|
159
160
|
inputRef: H,
|
|
160
161
|
error: A,
|
|
161
|
-
helperText: N ? void 0 :
|
|
162
|
+
helperText: N ? void 0 : Q,
|
|
162
163
|
reserveHelperText: N ? !1 : A !== void 0,
|
|
163
164
|
variant: "outlined",
|
|
164
165
|
label: "",
|
|
165
|
-
placeholder:
|
|
166
|
+
placeholder: M,
|
|
166
167
|
readOnly: u,
|
|
167
|
-
onFocus:
|
|
168
|
-
onBlur:
|
|
168
|
+
onFocus: Z,
|
|
169
|
+
onBlur: ee,
|
|
169
170
|
onKeyDown: e.onKeyDown,
|
|
170
171
|
autoComplete: "off",
|
|
171
172
|
slotProps: {
|
|
172
173
|
...e.slotProps,
|
|
173
174
|
input: {
|
|
174
175
|
...e.slotProps?.input ?? {},
|
|
175
|
-
startAdornment:
|
|
176
|
+
startAdornment: X ?? e.slotProps?.input?.startAdornment
|
|
176
177
|
},
|
|
177
178
|
htmlInput: {
|
|
178
179
|
...e.slotProps?.htmlInput ?? {},
|
|
179
|
-
...
|
|
180
|
+
...w ? { "aria-labelledby": w } : {}
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
}),
|
|
@@ -185,5 +186,5 @@ var Ce = se((O, H) => {
|
|
|
185
186
|
});
|
|
186
187
|
});
|
|
187
188
|
export {
|
|
188
|
-
|
|
189
|
+
Se as DynamicSelectAutocomplete
|
|
189
190
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DynamicSelectTitle as m } from "./DynamicSelectTitle.js";
|
|
2
|
+
import { jsx as c, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
var b = ({ dataTest: r, options: i, value: t, title: d, titleSize: s, valueKey: o = "value", labelKey: f = "label", renderLabel: n }) => {
|
|
4
|
+
const a = (e) => typeof e == "object" ? e?.[o] : e, u = (e) => typeof e == "object" ? e?.[f]?.toString() ?? "" : e?.toString() ?? "", l = t == null ? null : i.find((e) => a(e) === a(t)) ?? t;
|
|
5
|
+
return /* @__PURE__ */ y("div", {
|
|
6
|
+
"data-testid": `${r}-read-only`,
|
|
6
7
|
className: "flex flex-col gap-y-1",
|
|
7
|
-
children: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}), /* @__PURE__ */
|
|
11
|
-
"data-testid": `${
|
|
8
|
+
children: [/* @__PURE__ */ c(m, {
|
|
9
|
+
title: d,
|
|
10
|
+
titleSize: s
|
|
11
|
+
}), /* @__PURE__ */ c("div", {
|
|
12
|
+
"data-testid": `${r}-read-only-value`,
|
|
12
13
|
className: "text-base/6 text-delta-700",
|
|
13
|
-
children: l === null ? "-" :
|
|
14
|
+
children: l === null ? "-" : n ? n(l) : u(l)
|
|
14
15
|
})]
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
b as DynamicSelectReadOnlyValue
|
|
19
20
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
var r = ({ title: e, titleSize: l = "base", id: a }) => e == null || e === !1 || e === "" ? null : /* @__PURE__ */ t("span", {
|
|
3
|
+
id: a,
|
|
4
|
+
className: l === "lg" ? "text-lg/7 font-semibold text-delta-800" : "text-base font-semibold text-delta-800",
|
|
5
|
+
children: e
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
r as DynamicSelectTitle
|
|
9
|
+
};
|