asma-ui-core 3.104.0 → 3.106.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/DynamicToolbar.js +99 -97
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +62 -43
- package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
- package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
- package/dist/components/custom/page/page-header/PageHeader.js +41 -40
- package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
- package/dist/components/data-display/chip/StyledChip.js +70 -52
- package/dist/components/data-display/tooltip/StyledTooltip.js +110 -65
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +104 -80
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +94 -85
- package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
- package/dist/components/inputs/button/StyledButton.js +83 -33
- package/dist/components/inputs/button/StyledButton.module.js +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +91 -82
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +152 -152
- package/dist/components/navigation/link/StyledLink.js +53 -26
- package/dist/components/navigation/link/StyledLink.module.js +6 -6
- package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
- package/dist/components/navigation/menu/StyledMenuList.js +47 -38
- package/dist/components/navigation/tabs/StyledTab.js +25 -18
- package/dist/components/navigation/tabs/StyledTabs.js +33 -33
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
- package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
- package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
- package/dist/helpers/focusable.js +4 -3
- package/dist/helpers/warnUnnamedDialog.js +6 -0
- package/dist/index.js +589 -585
- package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
- package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
- package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
- package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
- package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +15 -2
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +10 -7
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
- package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
- package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
- package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +2 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -1
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +9 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/helpers/warnUnnamedDialog.d.ts +5 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +57 -50
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- 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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { LoadingIcon as
|
|
10
|
-
import
|
|
11
|
-
import { useEffect as
|
|
1
|
+
import { cn as _ } from "../../../helpers/cn.js";
|
|
2
|
+
import { TOP_LAYER_PROPS as nt, TOP_LAYER_RESET_STYLE as at, getOpenModalDialogAncestor as it, shouldUsePopoverTopLayer as ct, useTopLayerRef as dt } from "../../../hooks/useTopLayer.hook.js";
|
|
3
|
+
import { ChevronDownIcon as ut } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
4
|
+
import { CloseIcon as pt } from "../../icons/close-icon/CloseIcon.js";
|
|
5
|
+
import { CheckIcon as ft } from "../../icons/check-icon/CheckIcon.js";
|
|
6
|
+
import { PlusIconCircle as mt } from "../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
7
|
+
import { StyledChip as ht } from "../../data-display/chip/StyledChip.js";
|
|
8
|
+
import { StyledCheckbox as de } from "../checkbox/base-ui/StyledCheckbox.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 ? it(E.reference.current) : void 0, [a, E]), z = ct(ne), qe = fe([dt(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(ht, {
|
|
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(pt, {
|
|
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(mt, {
|
|
153
153
|
width: 24,
|
|
154
154
|
height: 24,
|
|
155
155
|
className: "text-delta-700"
|
|
156
|
-
}) : /* @__PURE__ */ s(
|
|
156
|
+
}) : /* @__PURE__ */ s(ut, {
|
|
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(ft, {
|
|
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 ? nt : {},
|
|
256
256
|
style: {
|
|
257
|
-
...
|
|
258
|
-
...
|
|
259
|
-
width:
|
|
260
|
-
maxHeight:
|
|
257
|
+
...z ? at : {},
|
|
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,40 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { StyledTooltip as D } from "../../data-display/tooltip/StyledTooltip.js";
|
|
2
|
+
import e from "./StyledLink.module.js";
|
|
3
|
+
import k from "clsx";
|
|
3
4
|
import "react";
|
|
4
|
-
import { jsxs as
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
switch (
|
|
5
|
+
import { jsx as g, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
var v = ({ href: y, disabled: l, disabledReason: d, size: p = "large", dataTest: m, reflink: u, className: r, content: n, contentNode: s, onClick: x, ...i }) => {
|
|
7
|
+
let a = e["styled-link-large"];
|
|
8
|
+
switch (p) {
|
|
8
9
|
case "large":
|
|
9
|
-
|
|
10
|
+
a = e["styled-link-large"];
|
|
10
11
|
break;
|
|
11
12
|
case "small":
|
|
12
|
-
|
|
13
|
+
a = e["styled-link-small"];
|
|
13
14
|
break;
|
|
14
15
|
case "xs":
|
|
15
|
-
|
|
16
|
+
a = e["styled-link-xs"];
|
|
16
17
|
break;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
className:
|
|
20
|
-
children: [
|
|
21
|
-
})
|
|
22
|
-
|
|
19
|
+
if (l && !d) return /* @__PURE__ */ o("span", {
|
|
20
|
+
className: k(e["styled-link"], e["styled-link-disabled"], a, r),
|
|
21
|
+
children: [n, s]
|
|
22
|
+
});
|
|
23
|
+
const c = (t) => /* @__PURE__ */ g(D, {
|
|
24
|
+
title: d,
|
|
25
|
+
open: l ? void 0 : !1,
|
|
26
|
+
openOnTap: !!l,
|
|
27
|
+
persistentDescription: !!l,
|
|
28
|
+
children: t
|
|
29
|
+
}), f = (t) => {
|
|
30
|
+
if (l) {
|
|
31
|
+
t.preventDefault();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
x?.(t);
|
|
35
|
+
};
|
|
36
|
+
return c(y ? /* @__PURE__ */ o("a", {
|
|
37
|
+
...i,
|
|
23
38
|
"data-testid": m,
|
|
24
|
-
ref:
|
|
25
|
-
href:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
ref: u,
|
|
40
|
+
href: l ? void 0 : y,
|
|
41
|
+
role: l ? "link" : i.role,
|
|
42
|
+
"aria-disabled": l ? !0 : i["aria-disabled"],
|
|
43
|
+
tabIndex: l ? 0 : i.tabIndex,
|
|
44
|
+
onClick: f,
|
|
45
|
+
onKeyDown: (t) => {
|
|
46
|
+
if (l && t.key === "Enter") {
|
|
47
|
+
t.preventDefault();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
i.onKeyDown?.(t);
|
|
51
|
+
},
|
|
52
|
+
className: k(e["styled-link"], l ? e["styled-link-disabled"] : "asma-touch-ready", a, r),
|
|
53
|
+
children: [n, s]
|
|
54
|
+
}) : /* @__PURE__ */ o("button", {
|
|
55
|
+
...i,
|
|
30
56
|
"data-testid": m,
|
|
31
|
-
ref:
|
|
57
|
+
ref: u,
|
|
32
58
|
type: "button",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
59
|
+
"aria-disabled": l ? !0 : i["aria-disabled"],
|
|
60
|
+
onClick: f,
|
|
61
|
+
className: k(e["styled-link"], e["styled-link-button"], l ? e["styled-link-disabled"] : "asma-touch-ready", a, r),
|
|
62
|
+
children: [n, s]
|
|
63
|
+
}));
|
|
37
64
|
};
|
|
38
65
|
export {
|
|
39
|
-
|
|
66
|
+
v as StyledLink
|
|
40
67
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var l = {
|
|
2
|
-
"styled-link": "_styled-
|
|
3
|
-
"styled-link-disabled": "_styled-link-
|
|
4
|
-
"styled-link-button": "_styled-link-
|
|
5
|
-
"styled-link-xs": "_styled-link-
|
|
6
|
-
"styled-link-small": "_styled-link-
|
|
7
|
-
"styled-link-large": "_styled-link-
|
|
2
|
+
"styled-link": "_styled-link_ttb58_1",
|
|
3
|
+
"styled-link-disabled": "_styled-link-disabled_ttb58_14",
|
|
4
|
+
"styled-link-button": "_styled-link-button_ttb58_37",
|
|
5
|
+
"styled-link-xs": "_styled-link-xs_ttb58_42",
|
|
6
|
+
"styled-link-small": "_styled-link-small_ttb58_47",
|
|
7
|
+
"styled-link-large": "_styled-link-large_ttb58_52"
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
l as default
|