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