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