asma-ui-core 3.46.2 → 3.47.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.
|
@@ -1,121 +1,123 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { StyledButton as
|
|
5
|
-
import { useMobileMediaQuery as
|
|
6
|
-
import
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { jsx as l, jsxs as
|
|
9
|
-
var
|
|
1
|
+
import { cn as f } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as D } from "../../../helpers/sx.js";
|
|
3
|
+
import { CloseIcon as B } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { StyledButton as F } from "../../inputs/button/StyledButton.js";
|
|
5
|
+
import { useMobileMediaQuery as G } from "../../../hooks/useMediaQuery.hook.js";
|
|
6
|
+
import P from "./StyledDialog.module.js";
|
|
7
|
+
import { useEffect as _, useLayoutEffect as Q, useRef as u } from "react";
|
|
8
|
+
import { jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
9
|
+
var $ = {
|
|
10
10
|
xs: 444,
|
|
11
11
|
sm: 600,
|
|
12
12
|
md: 900,
|
|
13
13
|
lg: 1200,
|
|
14
14
|
xl: 1536
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
}, te = ({ open: t, onClose: a, children: C, dataTest: i, maxWidth: x = "sm", fullWidth: E, fullScreen: H, scroll: p = "paper", disableEscapeKeyDown: h, className: S, style: j, sx: M, classes: y, PaperProps: R, slotProps: o, onCloseText: w, showCloseIcon: b = !0, dialogLabel: d, dialogTitle: s, dialogHeaderNode: W }) => {
|
|
16
|
+
const I = G(), v = u(null), c = u(!1), g = u(t), n = I ? !0 : H;
|
|
17
|
+
_(() => {
|
|
18
|
+
g.current && !t && o?.transition?.onExited?.(), g.current = t;
|
|
19
|
+
}, [t, o]), Q(() => {
|
|
20
|
+
const e = v.current;
|
|
19
21
|
e && t && !e.open && e.showModal();
|
|
20
|
-
}, [t]),
|
|
22
|
+
}, [t]), _(() => {
|
|
21
23
|
if (!t) return;
|
|
22
|
-
const e = document.body.style.overflow,
|
|
24
|
+
const e = document.body.style.overflow, A = document.documentElement.style.overflow;
|
|
23
25
|
return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
|
|
24
|
-
document.body.style.overflow = e, document.documentElement.style.overflow =
|
|
26
|
+
document.body.style.overflow = e, document.documentElement.style.overflow = A;
|
|
25
27
|
};
|
|
26
28
|
}, [t]);
|
|
27
|
-
const
|
|
28
|
-
...
|
|
29
|
-
...
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, 0),
|
|
34
|
-
},
|
|
35
|
-
e.preventDefault(),
|
|
29
|
+
const m = {
|
|
30
|
+
...R,
|
|
31
|
+
...o?.paper
|
|
32
|
+
}, k = x === !1 ? void 0 : $[x], { className: O, style: z, onClick: K, ...X } = o?.backdrop ?? {}, N = (e) => {
|
|
33
|
+
c.current || (c.current = !0, window.setTimeout(() => {
|
|
34
|
+
c.current = !1;
|
|
35
|
+
}, 0), a?.(e, "escapeKeyDown"));
|
|
36
|
+
}, q = (e) => {
|
|
37
|
+
e.preventDefault(), h || N(e);
|
|
36
38
|
};
|
|
37
|
-
return t ? /* @__PURE__ */
|
|
38
|
-
ref:
|
|
39
|
+
return t ? /* @__PURE__ */ r("dialog", {
|
|
40
|
+
ref: v,
|
|
39
41
|
tabIndex: -1,
|
|
40
|
-
"data-testid":
|
|
41
|
-
"aria-label":
|
|
42
|
-
onCancel:
|
|
42
|
+
"data-testid": i,
|
|
43
|
+
"aria-label": i,
|
|
44
|
+
onCancel: q,
|
|
43
45
|
onKeyDown: (e) => {
|
|
44
|
-
e.key !== "Escape" ||
|
|
46
|
+
e.key !== "Escape" || h || (e.preventDefault(), N(e));
|
|
45
47
|
},
|
|
46
|
-
className:
|
|
48
|
+
className: f(P.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", p === "body" && "overflow-y-auto", S, y?.root),
|
|
47
49
|
style: {
|
|
48
50
|
zIndex: 999,
|
|
49
|
-
...
|
|
50
|
-
...
|
|
51
|
+
...D(M),
|
|
52
|
+
...j
|
|
51
53
|
},
|
|
52
54
|
children: [/* @__PURE__ */ l("div", {
|
|
53
|
-
...
|
|
54
|
-
className:
|
|
55
|
-
style:
|
|
55
|
+
...X,
|
|
56
|
+
className: f("absolute inset-0 bg-[#626e7eb2]", O),
|
|
57
|
+
style: z,
|
|
56
58
|
onClick: (e) => {
|
|
57
|
-
|
|
59
|
+
K?.(e), e.defaultPrevented || a?.(e, "backdropClick");
|
|
58
60
|
}
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
-
className:
|
|
61
|
+
}), /* @__PURE__ */ r("div", {
|
|
62
|
+
className: f("relative z-[1] flex overflow-hidden rounded-lg border-0 bg-white p-0 text-delta-800 shadow-[0px_4px_40px_0px_#22213366]", p === "paper" && "flex-col", n && "rounded-none", m.className, y?.paper),
|
|
61
63
|
style: {
|
|
62
64
|
minWidth: 0,
|
|
63
65
|
minHeight: 0,
|
|
64
|
-
...!
|
|
65
|
-
...
|
|
66
|
+
...!n && k ? { maxWidth: k } : {},
|
|
67
|
+
...n ? {
|
|
66
68
|
width: "100%",
|
|
67
69
|
maxWidth: "100%",
|
|
68
70
|
height: "100%",
|
|
69
71
|
maxHeight: "100%"
|
|
70
72
|
} : {
|
|
71
|
-
width:
|
|
73
|
+
width: E ? "calc(100% - 64px)" : "auto",
|
|
72
74
|
maxHeight: "100%"
|
|
73
75
|
},
|
|
74
|
-
...
|
|
75
|
-
...
|
|
76
|
-
...
|
|
76
|
+
...D(m.sx),
|
|
77
|
+
...m.style,
|
|
78
|
+
...n ? {
|
|
77
79
|
width: "100%",
|
|
78
80
|
maxWidth: "100%",
|
|
79
81
|
height: "100%",
|
|
80
82
|
maxHeight: "100%"
|
|
81
83
|
} : { maxHeight: "calc(100% - 64px)" }
|
|
82
84
|
},
|
|
83
|
-
children: [(!!
|
|
85
|
+
children: [(!!d || !!s || b) && /* @__PURE__ */ r("div", {
|
|
84
86
|
className: "box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ r("div", {
|
|
86
88
|
className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5",
|
|
87
|
-
children: [
|
|
89
|
+
children: [d && /* @__PURE__ */ l("div", {
|
|
88
90
|
className: "flex h-8 items-center text-sm font-normal leading-5 text-delta-600",
|
|
89
|
-
children: i
|
|
90
|
-
}), d && /* @__PURE__ */ l("div", {
|
|
91
|
-
className: "flex text-2xl font-semibold leading-8 text-delta-800",
|
|
92
91
|
children: d
|
|
92
|
+
}), s && /* @__PURE__ */ l("div", {
|
|
93
|
+
className: "flex text-2xl font-semibold leading-8 text-delta-800",
|
|
94
|
+
children: s
|
|
93
95
|
})]
|
|
94
|
-
}),
|
|
96
|
+
}), b && /* @__PURE__ */ r("div", {
|
|
95
97
|
className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2",
|
|
96
|
-
children: [
|
|
97
|
-
dataTest: `close-button-${
|
|
98
|
-
"aria-label":
|
|
98
|
+
children: [W, /* @__PURE__ */ l(F, {
|
|
99
|
+
dataTest: `close-button-${i}`,
|
|
100
|
+
"aria-label": w ? void 0 : "Close",
|
|
99
101
|
variant: "textGray",
|
|
100
102
|
size: "small",
|
|
101
|
-
endIcon: /* @__PURE__ */ l(
|
|
103
|
+
endIcon: /* @__PURE__ */ l(B, {
|
|
102
104
|
width: 20,
|
|
103
105
|
height: 20
|
|
104
106
|
}),
|
|
105
107
|
className: "max-w-full shrink-0 whitespace-nowrap",
|
|
106
|
-
onClick: (e) =>
|
|
108
|
+
onClick: (e) => a?.(e, "escapeKeyDown"),
|
|
107
109
|
style: {
|
|
108
110
|
color: "var(--colors-delta-800)",
|
|
109
111
|
paddingRight: "6px",
|
|
110
112
|
paddingLeft: "6px"
|
|
111
113
|
},
|
|
112
|
-
children:
|
|
114
|
+
children: w
|
|
113
115
|
})]
|
|
114
116
|
})]
|
|
115
|
-
}),
|
|
117
|
+
}), C]
|
|
116
118
|
})]
|
|
117
119
|
}) : null;
|
|
118
120
|
};
|
|
119
121
|
export {
|
|
120
|
-
|
|
122
|
+
te as StyledDialog
|
|
121
123
|
};
|
|
@@ -1,92 +1,100 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { ChevronDownIcon as
|
|
1
|
+
import { cn as $ } from "../../../helpers/cn.js";
|
|
2
|
+
import { ChevronDownIcon as Ve } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
3
|
import { CloseIcon as He } from "../../icons/close-icon/CloseIcon.js";
|
|
4
4
|
import { CheckIcon as Te } from "../../icons/check-icon/CheckIcon.js";
|
|
5
|
-
import { PlusIconCircle as
|
|
6
|
-
import { StyledChip as
|
|
7
|
-
import { StyledCheckbox as
|
|
8
|
-
import { TOP_LAYER_PROPS as
|
|
9
|
-
import { LoadingIcon as
|
|
10
|
-
import
|
|
11
|
-
import { useMemo as
|
|
5
|
+
import { PlusIconCircle as Ye } from "../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
6
|
+
import { StyledChip as Oe } from "../../data-display/chip/StyledChip.js";
|
|
7
|
+
import { StyledCheckbox as q } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
8
|
+
import { TOP_LAYER_PROPS as Be, TOP_LAYER_RESET_STYLE as qe, getOpenModalDialogAncestor as Ge, useTopLayerRef as Je } from "../../../hooks/useTopLayer.hook.js";
|
|
9
|
+
import { LoadingIcon as Qe } from "../../../table/shared-components/LoadingIcon.js";
|
|
10
|
+
import G from "./StyledSelectAutocomplete.module.js";
|
|
11
|
+
import { useEffect as Xe, useMemo as L, useRef as J, useState as w } from "react";
|
|
12
12
|
import { jsx as s, jsxs as y } from "react/jsx-runtime";
|
|
13
|
-
import { FloatingPortal as
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
const o =
|
|
17
|
-
e && (m || R) || (W === void 0 &&
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
}, [
|
|
13
|
+
import { FloatingPortal as Ze, autoUpdate as Ke, flip as et, offset as tt, shift as rt, size as lt, useDismiss as st, useFloating as ot, useInteractions as at, useMergeRefs as Q, useRole as nt } from "@floating-ui/react";
|
|
14
|
+
var ct = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), X = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
|
|
15
|
+
function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, getOptionLabel: K, getOptionKey: D, isOptionEqualToValue: _, renderOption: E, renderValue: j, filterOptions: k, loading: z, loadingText: ee = "Loading…", noOptionsText: te = "No options", disabled: R, readOnly: m, size: re = "small", disableClearable: le, disableCloseOnSelect: se, popupIcon: oe, autoHeight: ae, multiple: ne, allowSelectAll: ce, selectAllLabel: F = "Select all", fullWidth: ie, classes: de, inputValue: S, onInputChange: ue, open: W, onOpen: pe, onClose: me, className: fe, wrapperClassName: he, getOptionDisabled: ge, slotProps: U }) {
|
|
16
|
+
const o = ne === !0, n = K ?? ct, C = (e, t) => _ ? _(e, t) : e === t, [be, xe] = w(!1), a = W ?? be, f = (e) => {
|
|
17
|
+
e && (m || R) || (W === void 0 && xe(e), e ? pe?.() : me?.());
|
|
18
|
+
}, [we, V] = w(""), h = S ?? we, A = (e, t, r) => {
|
|
19
|
+
S === void 0 && V(t), ue?.(e, t, r);
|
|
20
|
+
}, [b, I] = w(null), ye = J([]), H = J(null), [ve, Ne] = w(null), [De, Re] = w(null), c = o ? Array.isArray(v) ? v : [] : [], g = o ? null : v ?? null, T = !o && g !== null ? n(g) : "";
|
|
21
|
+
Xe(() => {
|
|
22
|
+
S !== void 0 || o || V(T);
|
|
23
|
+
}, [
|
|
24
|
+
S,
|
|
25
|
+
o,
|
|
26
|
+
T
|
|
27
|
+
]);
|
|
28
|
+
const Y = (e) => o ? c.some((t) => C(e, t)) : g !== null && C(e, g), O = L(() => {
|
|
21
29
|
const e = [...p];
|
|
22
|
-
if (
|
|
23
|
-
const t = !o &&
|
|
30
|
+
if (k) return k(e, { inputValue: h });
|
|
31
|
+
const t = !o && g !== null ? n(g).toLowerCase() : null;
|
|
24
32
|
if (!h || h.toLowerCase() === t) return e;
|
|
25
33
|
const r = h.toLowerCase();
|
|
26
34
|
return e.filter((d) => n(d).toLowerCase().includes(r));
|
|
27
35
|
}, [
|
|
28
36
|
p,
|
|
29
37
|
h,
|
|
30
|
-
|
|
38
|
+
k,
|
|
31
39
|
v
|
|
32
|
-
]), i =
|
|
40
|
+
]), i = L(() => O.slice(0, 100), [O]), { refs: P, floatingStyles: Se, context: B } = ot({
|
|
33
41
|
open: a,
|
|
34
42
|
onOpenChange: f,
|
|
35
43
|
placement: "bottom-start",
|
|
36
44
|
strategy: "fixed",
|
|
37
|
-
whileElementsMounted:
|
|
45
|
+
whileElementsMounted: Ke,
|
|
38
46
|
middleware: [
|
|
39
|
-
|
|
40
|
-
Ze({ padding: 8 }),
|
|
47
|
+
tt(4),
|
|
41
48
|
et({ padding: 8 }),
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
rt({ padding: 8 }),
|
|
50
|
+
lt({ apply({ rects: e, availableHeight: t }) {
|
|
51
|
+
Ne(e.reference.width), Re(ae ? t - 8 : Math.min(t - 8, 320));
|
|
44
52
|
} })
|
|
45
53
|
]
|
|
46
|
-
}), { getReferenceProps:
|
|
54
|
+
}), { getReferenceProps: Ce, getFloatingProps: Ae, getItemProps: Pe } = at([st(B), nt(B, { role: "listbox" })]), $e = Q([P.setReference]), ke = Q([Je(P.setFloating)]), Ie = L(() => a ? Ge(P.reference.current) : void 0, [a, P]), M = (e, t) => {
|
|
47
55
|
if (o) {
|
|
48
|
-
const r = c.some((u) =>
|
|
49
|
-
N?.(e, d, r ? "removeOption" : "selectOption", { option: t }),
|
|
56
|
+
const r = c.some((u) => C(t, u)), d = r ? c.filter((u) => !C(t, u)) : [...c, t];
|
|
57
|
+
N?.(e, d, r ? "removeOption" : "selectOption", { option: t }), A(e, "", "reset"), se || f(!1);
|
|
50
58
|
} else
|
|
51
|
-
N?.(e, t, "selectOption", { option: t }),
|
|
52
|
-
}, ke = (e) => {
|
|
53
|
-
N?.(e, o ? [] : null, "clear", void 0), C(e, "", "clear");
|
|
59
|
+
N?.(e, t, "selectOption", { option: t }), A(e, n(t), "reset"), f(!1);
|
|
54
60
|
}, Me = (e) => {
|
|
55
|
-
|
|
61
|
+
N?.(e, o ? [] : null, "clear", void 0), A(e, "", "clear");
|
|
62
|
+
}, Le = (e) => {
|
|
63
|
+
if (e.key === "Enter" && a && b != null && i[b] != null) {
|
|
56
64
|
e.preventDefault();
|
|
57
|
-
const t = i[
|
|
58
|
-
|
|
65
|
+
const t = i[b];
|
|
66
|
+
X(t) || M(e, t);
|
|
59
67
|
} else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
60
68
|
if (e.preventDefault(), !a) {
|
|
61
|
-
|
|
69
|
+
I(null), f(!0);
|
|
62
70
|
return;
|
|
63
71
|
}
|
|
64
72
|
if (i.length === 0) return;
|
|
65
73
|
const t = e.key === "ArrowDown" ? 1 : -1;
|
|
66
|
-
|
|
74
|
+
I((r) => r == null ? t > 0 ? 0 : i.length - 1 : (r + t + i.length) % i.length);
|
|
67
75
|
}
|
|
68
|
-
},
|
|
76
|
+
}, _e = !le && !m && !R && (o ? c.length > 0 : g !== null), Ee = (e) => {
|
|
69
77
|
e.preventDefault(), !(R || m) && (H.current?.focus(), f(!a));
|
|
70
|
-
}, je = o ? j ? j(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ s(
|
|
78
|
+
}, je = o ? j ? j(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ s(Oe, {
|
|
71
79
|
dataTest: `selected-chip-${n(e)}`,
|
|
72
80
|
label: n(e),
|
|
73
81
|
readOnly: m,
|
|
74
|
-
onDelete: m ? void 0 : (r) =>
|
|
75
|
-
}, D ? D(e) : `${n(e)}-${t}`)) : void 0,
|
|
82
|
+
onDelete: m ? void 0 : (r) => M(r, e)
|
|
83
|
+
}, D ? D(e) : `${n(e)}-${t}`)) : void 0, ze = /* @__PURE__ */ y("span", {
|
|
76
84
|
className: "flex items-center gap-1",
|
|
77
85
|
children: [
|
|
78
|
-
|
|
86
|
+
z && /* @__PURE__ */ s(Qe, {
|
|
79
87
|
width: 20,
|
|
80
88
|
height: 20,
|
|
81
89
|
className: "animate-spin"
|
|
82
90
|
}),
|
|
83
|
-
|
|
91
|
+
_e && /* @__PURE__ */ s("button", {
|
|
84
92
|
type: "button",
|
|
85
93
|
"aria-label": "Clear",
|
|
86
94
|
"data-testid": `${l}-clear`,
|
|
87
95
|
className: "flex min-h-6 min-w-6 cursor-pointer items-center justify-center rounded-full border-0 bg-delta-50",
|
|
88
96
|
onMouseDown: (e) => {
|
|
89
|
-
e.preventDefault(),
|
|
97
|
+
e.preventDefault(), Me(e);
|
|
90
98
|
},
|
|
91
99
|
children: /* @__PURE__ */ s(He, {
|
|
92
100
|
width: 20,
|
|
@@ -100,51 +108,51 @@ function yt({ dataTest: l, options: p, renderInput: Q, value: v, onChange: N, ge
|
|
|
100
108
|
"aria-expanded": a,
|
|
101
109
|
"data-testid": `${l}-popup-indicator`,
|
|
102
110
|
className: "flex cursor-pointer items-center border-0 bg-transparent",
|
|
103
|
-
onMouseDown:
|
|
104
|
-
children:
|
|
111
|
+
onMouseDown: Ee,
|
|
112
|
+
children: oe ?? (o ? /* @__PURE__ */ s(Ye, {
|
|
105
113
|
width: 24,
|
|
106
114
|
height: 24,
|
|
107
115
|
className: "text-delta-700"
|
|
108
|
-
}) : /* @__PURE__ */ s(
|
|
116
|
+
}) : /* @__PURE__ */ s(Ve, {
|
|
109
117
|
width: 24,
|
|
110
118
|
height: 24,
|
|
111
|
-
className:
|
|
119
|
+
className: $(G["select-custom-icon"], "text-delta-700 transition-transform", a && "rotate-180")
|
|
112
120
|
}))
|
|
113
121
|
})
|
|
114
122
|
]
|
|
115
|
-
}),
|
|
123
|
+
}), Fe = {
|
|
116
124
|
disabled: R,
|
|
117
|
-
size:
|
|
125
|
+
size: re,
|
|
118
126
|
fullWidth: !0,
|
|
119
127
|
value: h,
|
|
120
128
|
onChange: (e) => {
|
|
121
|
-
|
|
129
|
+
A(e, e.target.value, "input"), a || f(!0);
|
|
122
130
|
},
|
|
123
|
-
onKeyDown:
|
|
131
|
+
onKeyDown: Le,
|
|
124
132
|
slotProps: {
|
|
125
133
|
htmlInput: {
|
|
126
|
-
...
|
|
134
|
+
...Ce(),
|
|
127
135
|
ref: H,
|
|
128
136
|
onClick: () => f(!0),
|
|
129
137
|
role: "combobox",
|
|
130
138
|
"aria-autocomplete": "list",
|
|
131
139
|
"aria-expanded": a,
|
|
132
|
-
"aria-activedescendant": a &&
|
|
140
|
+
"aria-activedescendant": a && b != null ? `${l}-option-${b}` : void 0,
|
|
133
141
|
autoComplete: "off",
|
|
134
142
|
readOnly: m
|
|
135
143
|
},
|
|
136
144
|
input: {
|
|
137
|
-
ref:
|
|
145
|
+
ref: $e,
|
|
138
146
|
startAdornment: je,
|
|
139
|
-
endAdornment:
|
|
147
|
+
endAdornment: ze
|
|
140
148
|
}
|
|
141
149
|
}
|
|
142
|
-
},
|
|
150
|
+
}, We = (e, t, r) => {
|
|
143
151
|
const { key: d, ...u } = e;
|
|
144
152
|
return /* @__PURE__ */ y("li", {
|
|
145
153
|
...u,
|
|
146
|
-
className:
|
|
147
|
-
children: [o ? /* @__PURE__ */ s(
|
|
154
|
+
className: $("box-border flex min-h-10 cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-700 first:-mt-1", "aria-selected:bg-gama-50 data-[active]:bg-gama-50 data-[active]:text-delta-800", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300", o && "border-0 border-b border-solid border-delta-200"),
|
|
155
|
+
children: [o ? /* @__PURE__ */ s(q, {
|
|
148
156
|
dataTest: `${l}-${n(t)}-checkbox`,
|
|
149
157
|
checked: r.selected,
|
|
150
158
|
size: "small",
|
|
@@ -162,54 +170,54 @@ function yt({ dataTest: l, options: p, renderInput: Q, value: v, onChange: N, ge
|
|
|
162
170
|
children: n(t)
|
|
163
171
|
})]
|
|
164
172
|
}, d);
|
|
165
|
-
},
|
|
166
|
-
const r =
|
|
167
|
-
...
|
|
173
|
+
}, Ue = (e, t) => {
|
|
174
|
+
const r = ge?.(e) ?? X(e), d = {
|
|
175
|
+
...Pe({
|
|
168
176
|
onMouseDown: (x) => x.preventDefault(),
|
|
169
177
|
onClick: (x) => {
|
|
170
|
-
r ||
|
|
178
|
+
r || M(x, e);
|
|
171
179
|
},
|
|
172
|
-
onMouseMove: () =>
|
|
180
|
+
onMouseMove: () => I(r ? null : t)
|
|
173
181
|
}),
|
|
174
182
|
key: D ? String(D(e)) : `${n(e)}-${t}`,
|
|
175
183
|
ref: (x) => {
|
|
176
|
-
|
|
184
|
+
ye.current[t] = x;
|
|
177
185
|
},
|
|
178
186
|
role: "option",
|
|
179
187
|
id: `${l}-option-${t}`,
|
|
180
|
-
"aria-selected":
|
|
188
|
+
"aria-selected": Y(e),
|
|
181
189
|
"aria-disabled": r || void 0,
|
|
182
|
-
"data-active":
|
|
190
|
+
"data-active": b === t ? "" : void 0
|
|
183
191
|
}, u = {
|
|
184
|
-
selected:
|
|
192
|
+
selected: Y(e),
|
|
185
193
|
index: t,
|
|
186
194
|
inputValue: h
|
|
187
195
|
};
|
|
188
|
-
return
|
|
196
|
+
return E ? E(d, e, u) : We(d, e, u);
|
|
189
197
|
};
|
|
190
198
|
return /* @__PURE__ */ y("div", {
|
|
191
|
-
className:
|
|
192
|
-
children: [
|
|
193
|
-
root:
|
|
199
|
+
className: $(G.styledSelectAutocompleteWrapper, !ie && "w-auto", he, fe),
|
|
200
|
+
children: [Z(Fe), a && /* @__PURE__ */ s(Ze, {
|
|
201
|
+
root: Ie,
|
|
194
202
|
children: /* @__PURE__ */ y("ul", {
|
|
195
|
-
ref:
|
|
196
|
-
...
|
|
203
|
+
ref: ke,
|
|
204
|
+
...Be,
|
|
197
205
|
style: {
|
|
198
|
-
...
|
|
199
|
-
...
|
|
200
|
-
width:
|
|
201
|
-
maxHeight:
|
|
206
|
+
...qe,
|
|
207
|
+
...Se,
|
|
208
|
+
width: ve ?? void 0,
|
|
209
|
+
maxHeight: De ?? void 0,
|
|
202
210
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
203
211
|
...U?.popper?.style
|
|
204
212
|
},
|
|
205
|
-
...
|
|
206
|
-
className:
|
|
207
|
-
children: [
|
|
213
|
+
...Ae(),
|
|
214
|
+
className: $("z-[1300] m-0 list-none overflow-auto rounded-lg border border-solid border-delta-300 bg-white p-0 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", de?.listbox, U?.popper?.className),
|
|
215
|
+
children: [ce && o && /* @__PURE__ */ y("div", {
|
|
208
216
|
role: "group",
|
|
209
217
|
className: "flex min-h-12 items-center gap-x-1 border-0 border-b border-solid border-delta-200 px-4 text-sm text-delta-700",
|
|
210
|
-
children: [/* @__PURE__ */ s(
|
|
218
|
+
children: [/* @__PURE__ */ s(q, {
|
|
211
219
|
dataTest: `${l}-select-all`,
|
|
212
|
-
"aria-label":
|
|
220
|
+
"aria-label": F,
|
|
213
221
|
checked: p.length > 0 && c.length === p.length,
|
|
214
222
|
size: "small",
|
|
215
223
|
hideWrapper: !0,
|
|
@@ -220,21 +228,21 @@ function yt({ dataTest: l, options: p, renderInput: Q, value: v, onChange: N, ge
|
|
|
220
228
|
}
|
|
221
229
|
}), /* @__PURE__ */ s("span", {
|
|
222
230
|
className: "flex-1 truncate py-2",
|
|
223
|
-
children:
|
|
231
|
+
children: F
|
|
224
232
|
})]
|
|
225
|
-
}),
|
|
233
|
+
}), z ? /* @__PURE__ */ s("li", {
|
|
226
234
|
role: "presentation",
|
|
227
235
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
228
|
-
children:
|
|
236
|
+
children: ee
|
|
229
237
|
}) : i.length === 0 ? /* @__PURE__ */ s("li", {
|
|
230
238
|
role: "presentation",
|
|
231
239
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
232
|
-
children:
|
|
233
|
-
}) : i.map(
|
|
240
|
+
children: te
|
|
241
|
+
}) : i.map(Ue)]
|
|
234
242
|
})
|
|
235
243
|
})]
|
|
236
244
|
});
|
|
237
245
|
}
|
|
238
246
|
export {
|
|
239
|
-
|
|
247
|
+
Nt as StyledSelectAutocomplete
|
|
240
248
|
};
|