asma-ui-core 3.86.0 → 3.86.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/data-display/chip/StyledChip.js +28 -27
- package/dist/components/data-display/tooltip/StyledTooltip.js +76 -47
- package/dist/components/feedback/dialog/StyledDialog.js +62 -58
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +113 -105
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +10 -12
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +75 -67
- package/dist/components/feedback/snack-bar/StyledSnackbar.js +12 -10
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +69 -71
- package/dist/components/inputs/input-field/StyledInputField.js +10 -9
- package/dist/components/inputs/phone-field/CountryCodeOptions.js +16 -15
- package/dist/components/inputs/phone-field/CountryCodeSelect.js +98 -85
- package/dist/components/inputs/phone-field/useCountryPicker.js +44 -24
- package/dist/components/inputs/select/StyledSelect.js +15 -14
- package/dist/components/inputs/select/StyledSelectItem.js +4 -4
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +199 -172
- package/dist/components/inputs/slider/StyledSlider.js +158 -107
- package/dist/components/navigation/listbox/Listbox.js +104 -54
- package/dist/components/navigation/menu/StyledMenu.js +22 -18
- package/dist/components/navigation/menu/StyledMenuItem.js +6 -6
- package/dist/components/utils/accordion/base-ui/StyledAccordionDetails.js +26 -22
- package/dist/components/utils/copy-wrapper/CopyWrapper.module.js +2 -2
- package/dist/components/utils/popover/StyledPopover.js +102 -52
- package/dist/datetime/components/date-picker/StyledDatePicker.js +40 -34
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +5 -4
- package/dist/datetime/components/time-picker/StyledTimePicker.js +69 -56
- package/dist/helpers/focusable.js +5 -0
- package/dist/hooks/useFocusTrap.hook.js +24 -19
- package/dist/src/components/data-display/chip/StyledChip.d.ts +2 -0
- package/dist/src/components/inputs/dynamic-select/StyledDynamicSelect.d.ts +3 -4
- package/dist/src/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.test.d.ts +1 -0
- package/dist/src/components/inputs/phone-field/CountryCodeOptions.d.ts +1 -1
- package/dist/src/components/inputs/phone-field/useCountryPicker.d.ts +5 -2
- package/dist/src/components/inputs/slider/StyledSlider.d.ts +4 -1
- package/dist/src/components/navigation/listbox/Listbox.d.ts +3 -2
- package/dist/src/components/navigation/menu/StyledMenu.d.ts +3 -2
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionDetails.d.ts +2 -1
- package/dist/src/components/utils/popover/StyledPopover.d.ts +9 -2
- package/dist/src/helpers/focusable.d.ts +8 -0
- package/dist/src/hooks/useFocusTrap.hook.d.ts +2 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +30 -34
- package/dist/table/components/table-footer/TablePagination.js +18 -17
- package/dist/table/components/table-footer/TableRowCountSelect.js +5 -4
- package/package.json +1 -1
|
@@ -1,198 +1,213 @@
|
|
|
1
1
|
import { cn as E } from "../../../helpers/cn.js";
|
|
2
|
-
import { ChevronDownIcon as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { CheckIcon as
|
|
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 { useEffect as
|
|
12
|
-
import { jsx as s, jsxs as
|
|
13
|
-
import { FloatingPortal as
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
e && (
|
|
18
|
-
}, [
|
|
19
|
-
R === void 0 &&
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
R !== void 0 ||
|
|
2
|
+
import { ChevronDownIcon as et } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
+
import { CloseIcon as tt } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { CheckIcon as lt } from "../../icons/check-icon/CheckIcon.js";
|
|
5
|
+
import { PlusIconCircle as rt } from "../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
6
|
+
import { StyledChip as ot } from "../../data-display/chip/StyledChip.js";
|
|
7
|
+
import { StyledCheckbox as ae } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
8
|
+
import { TOP_LAYER_PROPS as st, TOP_LAYER_RESET_STYLE as nt, getOpenModalDialogAncestor as at, shouldUsePopoverTopLayer as it, useTopLayerRef as ct } from "../../../hooks/useTopLayer.hook.js";
|
|
9
|
+
import { LoadingIcon as dt } from "../../../table/shared-components/LoadingIcon.js";
|
|
10
|
+
import z from "./StyledSelectAutocomplete.module.js";
|
|
11
|
+
import { useEffect as ie, useMemo as W, useRef as ce, useState as D } from "react";
|
|
12
|
+
import { jsx as s, jsxs as I } from "react/jsx-runtime";
|
|
13
|
+
import { FloatingPortal as ut, autoUpdate as ft, flip as pt, offset as mt, shift as ht, size as bt, useDismiss as gt, useFloating as xt, useInteractions as wt, useMergeRefs as de, useRole as yt } from "@floating-ui/react";
|
|
14
|
+
var kt = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), vt = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
|
|
15
|
+
function Ft({ dataTest: l, options: f, renderInput: ue, value: A, onChange: N, getOptionLabel: fe, getOptionKey: C, isOptionEqualToValue: H, renderOption: U, renderValue: V, filterOptions: _, loading: B, loadingText: pe = "Loading…", noOptionsText: me = "No options", disabled: M, readOnly: g, error: he, helperText: be, size: ge = "small", disableClearable: xe, disableCloseOnSelect: we, popupIcon: ye, autoHeight: ke, multiple: ve, allowSelectAll: T, selectAllLabel: De = "Select all", fullWidth: Ie, classes: Ae, inputValue: R, onInputChange: Ne, open: Y, onOpen: Ce, onClose: Me, className: Re, wrapperClassName: Se, getOptionDisabled: $e, slotProps: q }) {
|
|
16
|
+
const r = ve === !0, d = fe ?? kt, S = (e, t) => H ? H(e, t) : e === t, [Pe, Le] = D(!1), a = Y ?? Pe, u = (e) => {
|
|
17
|
+
e && (g || M) || (Y === void 0 && Le(e), e ? Ce?.() : (x(null), Me?.()));
|
|
18
|
+
}, [Ee, G] = D(""), b = R ?? Ee, $ = (e, t, n) => {
|
|
19
|
+
R === void 0 && G(t), Ne?.(e, t, n);
|
|
20
|
+
}, [o, x] = D(null), J = `${l}-listbox`, Q = ce([]), X = ce(null), [_e, Fe] = D(null), [Z, Oe] = D(null), i = r ? Array.isArray(A) ? A : [] : [], w = r ? null : A ?? null, K = !r && w !== null ? d(w) : "";
|
|
21
|
+
ie(() => {
|
|
22
|
+
R !== void 0 || r || G(K);
|
|
23
23
|
}, [
|
|
24
24
|
R,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
r,
|
|
26
|
+
K
|
|
27
27
|
]);
|
|
28
|
-
const F = (e) =>
|
|
29
|
-
const e = [...
|
|
30
|
-
if (_) return _(e, { inputValue:
|
|
31
|
-
const t = !
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
return e.filter((
|
|
28
|
+
const F = (e) => r ? i.some((t) => S(e, t)) : w !== null && S(e, w), P = (e) => $e?.(e) ?? vt(e), ee = W(() => {
|
|
29
|
+
const e = [...f];
|
|
30
|
+
if (_) return _(e, { inputValue: b });
|
|
31
|
+
const t = !r && w !== null ? d(w).toLowerCase() : null;
|
|
32
|
+
if (!b || b.toLowerCase() === t) return e;
|
|
33
|
+
const n = b.toLowerCase();
|
|
34
|
+
return e.filter((m) => d(m).toLowerCase().includes(n));
|
|
35
35
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
f,
|
|
37
|
+
b,
|
|
38
38
|
_,
|
|
39
|
-
|
|
40
|
-
]),
|
|
41
|
-
|
|
42
|
-
if (!
|
|
43
|
-
const e =
|
|
39
|
+
A
|
|
40
|
+
]), p = W(() => ee.slice(0, 100), [ee]), te = p.flatMap((e, t) => P(e) ? [] : [t]), c = T && r ? [-1, ...te] : te, k = p.findIndex(F);
|
|
41
|
+
ie(() => {
|
|
42
|
+
if (!a) return;
|
|
43
|
+
const e = o ?? k;
|
|
44
44
|
if (e < 0) return;
|
|
45
|
-
const t = requestAnimationFrame(() =>
|
|
45
|
+
const t = requestAnimationFrame(() => Q.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
46
46
|
return () => cancelAnimationFrame(t);
|
|
47
47
|
}, [
|
|
48
|
+
o,
|
|
48
49
|
a,
|
|
49
|
-
|
|
50
|
-
Q,
|
|
50
|
+
Z,
|
|
51
51
|
k
|
|
52
52
|
]);
|
|
53
|
-
const { refs: L, floatingStyles:
|
|
54
|
-
open:
|
|
55
|
-
onOpenChange:
|
|
53
|
+
const { refs: L, floatingStyles: je, context: le } = xt({
|
|
54
|
+
open: a,
|
|
55
|
+
onOpenChange: u,
|
|
56
56
|
placement: "bottom-start",
|
|
57
57
|
strategy: "fixed",
|
|
58
|
-
whileElementsMounted:
|
|
58
|
+
whileElementsMounted: ft,
|
|
59
59
|
middleware: [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
mt(0),
|
|
61
|
+
pt({ padding: 8 }),
|
|
62
|
+
ht({ padding: 8 }),
|
|
63
|
+
bt({ apply({ rects: e, availableHeight: t }) {
|
|
64
|
+
Fe(e.reference.width), Oe(ke ? t - 8 : Math.min(t - 8, 320));
|
|
65
65
|
} })
|
|
66
66
|
]
|
|
67
|
-
}), { getReferenceProps:
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
return
|
|
67
|
+
}), { getReferenceProps: ze, getFloatingProps: We, getItemProps: He } = wt([gt(le), yt(le, { role: "listbox" })]), Ue = de([L.setReference]), re = W(() => a ? at(L.reference.current) : void 0, [a, L]), O = it(re), Ve = de([ct(L.setFloating, O)]), Be = (e) => c.includes(k) ? k : c[e === 1 ? 0 : c.length - 1] ?? null, Te = (e) => {
|
|
68
|
+
c.length !== 0 && x((t) => {
|
|
69
|
+
const n = c.indexOf(t ?? k);
|
|
70
|
+
return n === -1 ? c[e === 1 ? 0 : c.length - 1] ?? null : c[Math.min(Math.max(n + e, 0), c.length - 1)] ?? null;
|
|
71
71
|
});
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
N?.(e,
|
|
72
|
+
}, v = (e, t, n = !r || !we) => {
|
|
73
|
+
if (r) {
|
|
74
|
+
const m = i.some((h) => S(t, h)), y = m ? i.filter((h) => !S(t, h)) : [...i, t];
|
|
75
|
+
N?.(e, y, m ? "removeOption" : "selectOption", { option: t }), $(e, "", "reset"), n && u(!1);
|
|
76
76
|
} else
|
|
77
|
-
N?.(e, t, "selectOption", { option: t }),
|
|
78
|
-
},
|
|
79
|
-
N?.(e,
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
N?.(e, t, "selectOption", { option: t }), $(e, d(t), "reset"), n && u(!1);
|
|
78
|
+
}, oe = (e) => {
|
|
79
|
+
N?.(e, r ? [] : null, "clear", void 0), $(e, "", "clear");
|
|
80
|
+
}, j = (e) => {
|
|
81
|
+
const t = f.length > 0 && i.length === f.length;
|
|
82
|
+
N?.(e, t ? [] : f, t ? "clear" : "selectOption", void 0);
|
|
83
|
+
}, Ye = (e) => {
|
|
84
|
+
if (e.key === "Backspace" && b === "" && se) {
|
|
85
|
+
const t = i[i.length - 1];
|
|
86
|
+
r ? t !== void 0 && v(e, t, !1) : oe(e);
|
|
87
|
+
} else if (e.key === "Enter" && !a)
|
|
88
|
+
e.preventDefault(), u(!0);
|
|
89
|
+
else if (e.key === "Enter" && o === -1)
|
|
90
|
+
e.preventDefault(), j(e);
|
|
91
|
+
else if (e.key === "Enter" && o != null && p[o] != null) {
|
|
84
92
|
e.preventDefault();
|
|
85
|
-
const t =
|
|
86
|
-
|
|
93
|
+
const t = p[o];
|
|
94
|
+
P(t) || v(e, t, !0);
|
|
87
95
|
} else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
88
|
-
if (e.preventDefault(), !
|
|
89
|
-
|
|
96
|
+
if (e.preventDefault(), !a) {
|
|
97
|
+
x(Be(e.key === "ArrowDown" ? 1 : -1)), u(!0);
|
|
90
98
|
return;
|
|
91
99
|
}
|
|
92
|
-
|
|
100
|
+
Te(e.key === "ArrowDown" ? 1 : -1);
|
|
93
101
|
} else if (e.key === "Home" || e.key === "End")
|
|
94
|
-
e.preventDefault(),
|
|
95
|
-
else if (e.key === " " &&
|
|
102
|
+
e.preventDefault(), x(c[e.key === "Home" ? 0 : c.length - 1] ?? null);
|
|
103
|
+
else if (e.key === " " && o === -1)
|
|
104
|
+
e.preventDefault(), j(e);
|
|
105
|
+
else if (e.key === " " && o != null && p[o] != null) {
|
|
96
106
|
e.preventDefault();
|
|
97
|
-
const t =
|
|
98
|
-
|
|
99
|
-
} else e.key === "Escape" ? (e.preventDefault(),
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
const t = p[o];
|
|
108
|
+
P(t) || v(e, t, !1);
|
|
109
|
+
} else e.key === "Escape" ? (e.preventDefault(), u(!1)) : e.key === "Tab" && u(!1);
|
|
110
|
+
}, se = !xe && !g && !M && (r ? i.length > 0 : w !== null);
|
|
111
|
+
let ne;
|
|
112
|
+
a && o != null && (o === -1 || p[o] !== void 0) && (ne = o === -1 ? `${l}-select-all` : `${l}-option-${o}`);
|
|
113
|
+
const qe = (e) => {
|
|
114
|
+
e.preventDefault(), !(M || g) && (X.current?.focus(), u(!a));
|
|
115
|
+
}, Ge = r ? V ? V(i, ({ index: e }) => ({ "data-index": e })) : i.map((e, t) => /* @__PURE__ */ s(ot, {
|
|
116
|
+
dataTest: `selected-chip-${d(e)}`,
|
|
117
|
+
label: d(e),
|
|
118
|
+
readOnly: g,
|
|
119
|
+
deleteButtonTabIndex: -1,
|
|
120
|
+
onDelete: g ? void 0 : (n) => v(n, e)
|
|
121
|
+
}, C ? C(e) : `${d(e)}-${t}`)) : void 0, Je = /* @__PURE__ */ I("span", {
|
|
108
122
|
className: "flex items-center gap-1",
|
|
109
123
|
children: [
|
|
110
|
-
|
|
124
|
+
B && /* @__PURE__ */ s(dt, {
|
|
111
125
|
width: 20,
|
|
112
126
|
height: 20,
|
|
113
127
|
className: "animate-spin"
|
|
114
128
|
}),
|
|
115
|
-
|
|
129
|
+
se && /* @__PURE__ */ s("button", {
|
|
116
130
|
type: "button",
|
|
117
131
|
tabIndex: -1,
|
|
118
132
|
"aria-label": "Clear",
|
|
119
133
|
"data-testid": `${l}-clear`,
|
|
120
134
|
className: "invisible flex min-h-6 min-w-6 cursor-pointer items-center justify-center rounded-full border-0 bg-delta-50 group-focus-within:visible",
|
|
121
135
|
onMouseDown: (e) => e.preventDefault(),
|
|
122
|
-
onClick:
|
|
123
|
-
children: /* @__PURE__ */ s(
|
|
136
|
+
onClick: oe,
|
|
137
|
+
children: /* @__PURE__ */ s(tt, {
|
|
124
138
|
width: 20,
|
|
125
139
|
height: 20,
|
|
126
140
|
className: "text-delta-700"
|
|
127
141
|
})
|
|
128
142
|
}),
|
|
129
|
-
|
|
143
|
+
g ? null : /* @__PURE__ */ s("button", {
|
|
130
144
|
type: "button",
|
|
131
145
|
tabIndex: -1,
|
|
132
146
|
"aria-label": "Toggle options",
|
|
133
|
-
"aria-expanded":
|
|
147
|
+
"aria-expanded": a,
|
|
134
148
|
"data-testid": `${l}-popup-indicator`,
|
|
135
149
|
className: "flex cursor-pointer items-center border-0 bg-transparent",
|
|
136
150
|
onMouseDown: (e) => e.preventDefault(),
|
|
137
|
-
onClick:
|
|
138
|
-
children:
|
|
151
|
+
onClick: qe,
|
|
152
|
+
children: ye ?? (r ? /* @__PURE__ */ s(rt, {
|
|
139
153
|
width: 24,
|
|
140
154
|
height: 24,
|
|
141
155
|
className: "text-delta-700"
|
|
142
|
-
}) : /* @__PURE__ */ s(
|
|
156
|
+
}) : /* @__PURE__ */ s(et, {
|
|
143
157
|
width: 24,
|
|
144
158
|
height: 24,
|
|
145
|
-
className: E(
|
|
159
|
+
className: E(z["select-custom-icon"], a && z["select-custom-icon-open"], "text-delta-700")
|
|
146
160
|
}))
|
|
147
161
|
})
|
|
148
162
|
]
|
|
149
|
-
}),
|
|
150
|
-
disabled:
|
|
151
|
-
size:
|
|
163
|
+
}), Qe = {
|
|
164
|
+
disabled: M,
|
|
165
|
+
size: ge,
|
|
152
166
|
fullWidth: !0,
|
|
153
|
-
error:
|
|
154
|
-
helperText:
|
|
155
|
-
value:
|
|
167
|
+
error: he,
|
|
168
|
+
helperText: be,
|
|
169
|
+
value: b,
|
|
156
170
|
onChange: (e) => {
|
|
157
|
-
|
|
171
|
+
x(null), $(e, e.target.value, "input"), a || u(!0);
|
|
158
172
|
},
|
|
159
|
-
onKeyDown:
|
|
173
|
+
onKeyDown: Ye,
|
|
160
174
|
slotProps: {
|
|
161
175
|
htmlInput: {
|
|
162
|
-
|
|
163
|
-
ref:
|
|
164
|
-
onClick: () =>
|
|
176
|
+
...ze(),
|
|
177
|
+
ref: X,
|
|
178
|
+
onClick: () => u(!0),
|
|
165
179
|
role: "combobox",
|
|
166
180
|
"aria-autocomplete": "list",
|
|
167
|
-
"aria-expanded":
|
|
168
|
-
"aria-
|
|
181
|
+
"aria-expanded": a,
|
|
182
|
+
"aria-controls": a ? J : void 0,
|
|
183
|
+
"aria-activedescendant": ne,
|
|
169
184
|
autoComplete: "off",
|
|
170
|
-
readOnly:
|
|
185
|
+
readOnly: g
|
|
171
186
|
},
|
|
172
187
|
input: {
|
|
173
|
-
ref:
|
|
174
|
-
startAdornment:
|
|
175
|
-
endAdornment:
|
|
188
|
+
ref: Ue,
|
|
189
|
+
startAdornment: Ge,
|
|
190
|
+
endAdornment: Je
|
|
176
191
|
}
|
|
177
192
|
}
|
|
178
|
-
},
|
|
179
|
-
const { key:
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
...
|
|
193
|
+
}, Xe = E("relative box-border flex min-h-10 cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-800", "aria-selected:bg-gama-50 hover:bg-delta-50", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300"), Ze = (e, t, n) => {
|
|
194
|
+
const { key: m, ...y } = e;
|
|
195
|
+
return /* @__PURE__ */ I("li", {
|
|
196
|
+
...y,
|
|
182
197
|
children: [
|
|
183
198
|
e["data-active"] !== void 0 && /* @__PURE__ */ s("span", {
|
|
184
199
|
"aria-hidden": "true",
|
|
185
200
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
186
201
|
}),
|
|
187
|
-
|
|
188
|
-
dataTest: `${l}-${
|
|
189
|
-
checked:
|
|
202
|
+
r ? /* @__PURE__ */ s(ae, {
|
|
203
|
+
dataTest: `${l}-${d(t)}-checkbox`,
|
|
204
|
+
checked: n.selected,
|
|
190
205
|
size: "small",
|
|
191
206
|
hideWrapper: !0,
|
|
192
207
|
decorative: !0
|
|
193
208
|
}) : /* @__PURE__ */ s("span", {
|
|
194
209
|
className: "w-5",
|
|
195
|
-
children:
|
|
210
|
+
children: n.selected && /* @__PURE__ */ s(lt, {
|
|
196
211
|
width: 20,
|
|
197
212
|
height: 20,
|
|
198
213
|
className: "text-gama-500"
|
|
@@ -200,84 +215,96 @@ function Lt({ dataTest: l, options: h, renderInput: oe, value: I, onChange: N, g
|
|
|
200
215
|
}),
|
|
201
216
|
/* @__PURE__ */ s("span", {
|
|
202
217
|
className: "line-clamp-2 min-w-0 flex-1 break-words",
|
|
203
|
-
children:
|
|
218
|
+
children: d(t)
|
|
204
219
|
})
|
|
205
220
|
]
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
const
|
|
209
|
-
...
|
|
210
|
-
onMouseDown: (
|
|
211
|
-
onClick: (
|
|
212
|
-
|
|
221
|
+
}, m);
|
|
222
|
+
}, Ke = (e, t) => {
|
|
223
|
+
const n = P(e), m = {
|
|
224
|
+
...He({
|
|
225
|
+
onMouseDown: (h) => h.preventDefault(),
|
|
226
|
+
onClick: (h) => {
|
|
227
|
+
n || v(h, e);
|
|
213
228
|
},
|
|
214
|
-
onMouseMove: () =>
|
|
229
|
+
onMouseMove: () => x(null)
|
|
215
230
|
}),
|
|
216
|
-
key:
|
|
217
|
-
ref: (
|
|
218
|
-
|
|
231
|
+
key: C ? String(C(e)) : `${d(e)}-${t}`,
|
|
232
|
+
ref: (h) => {
|
|
233
|
+
Q.current[t] = h;
|
|
219
234
|
},
|
|
220
235
|
role: "option",
|
|
221
236
|
id: `${l}-option-${t}`,
|
|
222
237
|
"aria-selected": F(e),
|
|
223
|
-
"aria-disabled":
|
|
224
|
-
"data-active":
|
|
225
|
-
className:
|
|
226
|
-
},
|
|
238
|
+
"aria-disabled": n || void 0,
|
|
239
|
+
"data-active": o === t ? "" : void 0,
|
|
240
|
+
className: Xe
|
|
241
|
+
}, y = {
|
|
227
242
|
selected: F(e),
|
|
228
243
|
index: t,
|
|
229
|
-
inputValue:
|
|
244
|
+
inputValue: b
|
|
230
245
|
};
|
|
231
|
-
return
|
|
246
|
+
return U ? U(m, e, y) : Ze(m, e, y);
|
|
232
247
|
};
|
|
233
|
-
return /* @__PURE__ */
|
|
234
|
-
className: E(
|
|
235
|
-
children: [
|
|
236
|
-
root:
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
-
ref:
|
|
239
|
-
...
|
|
248
|
+
return /* @__PURE__ */ I("div", {
|
|
249
|
+
className: E(z.styledSelectAutocompleteWrapper, !Ie && "w-auto", Se, Re),
|
|
250
|
+
children: [ue(Qe), a && /* @__PURE__ */ s(ut, {
|
|
251
|
+
root: re,
|
|
252
|
+
children: /* @__PURE__ */ I("ul", {
|
|
253
|
+
ref: Ve,
|
|
254
|
+
...O ? st : {},
|
|
240
255
|
style: {
|
|
241
|
-
...
|
|
242
|
-
...
|
|
243
|
-
width:
|
|
244
|
-
maxHeight:
|
|
256
|
+
...O ? nt : {},
|
|
257
|
+
...je,
|
|
258
|
+
width: _e ?? void 0,
|
|
259
|
+
maxHeight: Z ?? void 0,
|
|
245
260
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
246
261
|
...q?.popper?.style
|
|
247
262
|
},
|
|
248
|
-
...
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
...We(),
|
|
264
|
+
id: J,
|
|
265
|
+
role: "listbox",
|
|
266
|
+
"aria-multiselectable": r ? !0 : void 0,
|
|
267
|
+
className: E("z-[1300] m-0 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", "[&>li:not(:last-child)]:border-0 [&>li:not(:last-child)]:border-b", "[&>li:not(:last-child)]:border-solid [&>li:not(:last-child)]:border-delta-200", Ae?.listbox, q?.popper?.className),
|
|
268
|
+
children: [T && r && /* @__PURE__ */ I("li", {
|
|
269
|
+
id: `${l}-select-all`,
|
|
270
|
+
role: "option",
|
|
271
|
+
"aria-selected": f.length > 0 && i.length === f.length,
|
|
272
|
+
"data-active": o === -1 ? "" : void 0,
|
|
273
|
+
tabIndex: -1,
|
|
274
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
275
|
+
onClick: j,
|
|
276
|
+
onMouseMove: () => x(null),
|
|
277
|
+
className: "relative flex min-h-12 cursor-pointer items-center gap-x-1 border-0 border-b border-solid border-delta-200 px-4 text-sm text-delta-700 aria-selected:bg-gama-50 hover:bg-delta-50",
|
|
278
|
+
children: [
|
|
279
|
+
o === -1 && /* @__PURE__ */ s("span", {
|
|
280
|
+
"aria-hidden": "true",
|
|
281
|
+
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ s(ae, {
|
|
284
|
+
dataTest: `${l}-select-all`,
|
|
285
|
+
checked: f.length > 0 && i.length === f.length,
|
|
286
|
+
size: "small",
|
|
287
|
+
hideWrapper: !0,
|
|
288
|
+
decorative: !0
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ s("span", {
|
|
291
|
+
className: "flex-1 truncate py-2",
|
|
292
|
+
children: De
|
|
293
|
+
})
|
|
294
|
+
]
|
|
295
|
+
}), B ? /* @__PURE__ */ s("li", {
|
|
269
296
|
role: "presentation",
|
|
270
297
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
271
|
-
children:
|
|
272
|
-
}) :
|
|
298
|
+
children: pe
|
|
299
|
+
}) : p.length === 0 ? /* @__PURE__ */ s("li", {
|
|
273
300
|
role: "presentation",
|
|
274
301
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
275
|
-
children:
|
|
276
|
-
}) :
|
|
302
|
+
children: me
|
|
303
|
+
}) : p.map(Ke)]
|
|
277
304
|
})
|
|
278
305
|
})]
|
|
279
306
|
});
|
|
280
307
|
}
|
|
281
308
|
export {
|
|
282
|
-
|
|
309
|
+
Ft as StyledSelectAutocomplete
|
|
283
310
|
};
|