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