asma-ui-core 3.50.0 → 3.51.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/ToolbarRows.js +50 -49
- package/dist/components/inputs/search-field/StyledSearchField.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +45 -45
- package/dist/hooks/useFocusTrap.hook.js +18 -18
- package/dist/table/components/StyledTable.module.js +55 -54
- package/dist/table/components/columns/selectColumn.js +33 -33
- package/package.json +1 -1
|
@@ -1,110 +1,111 @@
|
|
|
1
1
|
import { cn as f } from "../../../../helpers/cn.js";
|
|
2
2
|
import { CloseIcon as T } from "../../../icons/close-icon/CloseIcon.js";
|
|
3
|
-
import { StyledButton as
|
|
4
|
-
import { StyledWidgetTitle as
|
|
3
|
+
import { StyledButton as b } from "../../../inputs/button/StyledButton.js";
|
|
4
|
+
import { StyledWidgetTitle as j } from "../../widget/widget-title/StyledWidgetTitle.js";
|
|
5
5
|
import { ToolbarActionGroup as c, hasPlannedActions as u } from "./ToolbarActionGroup.js";
|
|
6
|
-
import { formatSelectionLabel as
|
|
7
|
-
import { Fragment as o, jsx as
|
|
8
|
-
function
|
|
9
|
-
return /* @__PURE__ */
|
|
6
|
+
import { formatSelectionLabel as k } from "./useTranslations.js";
|
|
7
|
+
import { Fragment as o, jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
8
|
+
function I({ selectedCount: e, onClearSelection: n, translations: t }) {
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
10
|
className: "flex shrink-0 items-center whitespace-nowrap",
|
|
11
11
|
"aria-live": "polite",
|
|
12
12
|
"aria-atomic": "true",
|
|
13
|
-
children: /* @__PURE__ */
|
|
13
|
+
children: /* @__PURE__ */ i(b, {
|
|
14
14
|
dataTest: "dynamic-toolbar-clear-selection",
|
|
15
15
|
variant: "text",
|
|
16
16
|
size: "small",
|
|
17
17
|
className: "!min-w-0 !px-1 !font-semibold",
|
|
18
|
-
startIcon:
|
|
18
|
+
startIcon: n ? /* @__PURE__ */ i(T, {
|
|
19
19
|
width: 20,
|
|
20
20
|
height: 20
|
|
21
21
|
}) : void 0,
|
|
22
|
-
onClick:
|
|
22
|
+
onClick: n,
|
|
23
23
|
"aria-label": t.clearSelection,
|
|
24
|
-
children:
|
|
24
|
+
children: k(e, t)
|
|
25
25
|
})
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function q({ selectedCount: e, onClearSelection: n, translations: t, bulkActionsPlan: l }) {
|
|
29
29
|
return /* @__PURE__ */ r("div", {
|
|
30
30
|
className: "flex w-full min-w-0 flex-nowrap items-center justify-between gap-3",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ i(I, {
|
|
32
32
|
selectedCount: e,
|
|
33
|
-
onClearSelection:
|
|
33
|
+
onClearSelection: n,
|
|
34
34
|
translations: t
|
|
35
|
-
}), /* @__PURE__ */
|
|
35
|
+
}), /* @__PURE__ */ i(c, {
|
|
36
36
|
plan: l,
|
|
37
37
|
overflowMenuLabel: t.more,
|
|
38
38
|
selectionTone: !0
|
|
39
39
|
})]
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function N({ search: e, expanded:
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
ref:
|
|
45
|
-
|
|
42
|
+
function N({ search: e, expanded: n, measureRef: t }) {
|
|
43
|
+
return /* @__PURE__ */ i("div", {
|
|
44
|
+
ref: n ? void 0 : t,
|
|
45
|
+
style: n ? { "--dynamic-toolbar-search-width": "100%" } : void 0,
|
|
46
|
+
className: f(n ? "min-w-0 flex-1" : "w-40 shrink-0"),
|
|
46
47
|
children: e
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
function S({ visible: e, children:
|
|
50
|
-
return /* @__PURE__ */
|
|
50
|
+
function S({ visible: e, children: n }) {
|
|
51
|
+
return /* @__PURE__ */ i("div", {
|
|
51
52
|
className: f("overflow-hidden whitespace-nowrap transition-[max-width,opacity] duration-200 ease-in-out", e ? "max-w-[2000px] opacity-100" : "pointer-events-none max-w-0 opacity-0"),
|
|
52
53
|
"aria-hidden": !e,
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ i("div", {
|
|
54
55
|
className: "inline-flex items-center gap-2",
|
|
55
|
-
children:
|
|
56
|
+
children: n
|
|
56
57
|
})
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
return typeof e == "string" ? /* @__PURE__ */
|
|
61
|
-
ref:
|
|
60
|
+
function F({ title: e, measureRef: n }) {
|
|
61
|
+
return typeof e == "string" ? /* @__PURE__ */ i(j, {
|
|
62
|
+
ref: n,
|
|
62
63
|
className: "!min-w-0 truncate",
|
|
63
64
|
children: e
|
|
64
|
-
}) : /* @__PURE__ */
|
|
65
|
-
ref:
|
|
65
|
+
}) : /* @__PURE__ */ i("div", {
|
|
66
|
+
ref: n,
|
|
66
67
|
className: "min-w-0 truncate",
|
|
67
68
|
children: e
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
return !e && !
|
|
71
|
+
function D({ title: e, helperText: n, titleMeasureRef: t }) {
|
|
72
|
+
return !e && !n ? null : /* @__PURE__ */ r("div", {
|
|
72
73
|
className: "min-w-0 max-w-full",
|
|
73
|
-
children: [e && /* @__PURE__ */
|
|
74
|
+
children: [e && /* @__PURE__ */ i(F, {
|
|
74
75
|
title: e,
|
|
75
76
|
measureRef: t
|
|
76
|
-
}),
|
|
77
|
+
}), n && /* @__PURE__ */ i("div", {
|
|
77
78
|
className: "mt-1 text-sm text-delta-700",
|
|
78
|
-
children:
|
|
79
|
+
children: n
|
|
79
80
|
})]
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
const m =
|
|
83
|
+
function E({ variant: e, beforeFilterActionsPlan: n, filter: t, search: l, afterSearchActionsPlan: h, bulkActionsPlan: a, showPageActions: p, overflowMenuLabel: s, searchMeasureRef: g, align: B = "end" }) {
|
|
84
|
+
const m = p && u(n), d = p && u(h), w = e === "inline-selection" && u(a);
|
|
84
85
|
if (!(t != null || l != null) && !m && !d && !w) return null;
|
|
85
|
-
const x = m ? /* @__PURE__ */
|
|
86
|
+
const x = m ? /* @__PURE__ */ i(S, {
|
|
86
87
|
visible: m,
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
plan:
|
|
88
|
+
children: /* @__PURE__ */ i(c, {
|
|
89
|
+
plan: n,
|
|
89
90
|
overflowMenuLabel: s
|
|
90
91
|
})
|
|
91
|
-
}) : null, v = d ? /* @__PURE__ */
|
|
92
|
+
}) : null, v = d ? /* @__PURE__ */ i(S, {
|
|
92
93
|
visible: d,
|
|
93
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ i("div", {
|
|
94
95
|
className: "flex flex-nowrap items-center gap-2",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
plan:
|
|
96
|
+
children: /* @__PURE__ */ i(c, {
|
|
97
|
+
plan: h,
|
|
97
98
|
overflowMenuLabel: s
|
|
98
99
|
})
|
|
99
100
|
})
|
|
100
|
-
}) : null, y = /* @__PURE__ */ r(o, { children: [t, l != null && /* @__PURE__ */
|
|
101
|
+
}) : null, y = /* @__PURE__ */ r(o, { children: [t, l != null && /* @__PURE__ */ i(N, {
|
|
101
102
|
search: l,
|
|
102
103
|
measureRef: g
|
|
103
104
|
})] });
|
|
104
105
|
return /* @__PURE__ */ r("div", {
|
|
105
106
|
className: f("flex w-full min-w-0 flex-nowrap items-center gap-2", B === "end" ? "justify-end" : "justify-start"),
|
|
106
107
|
children: [
|
|
107
|
-
e === "inline-selection" && /* @__PURE__ */ r(o, { children: [w && a && /* @__PURE__ */
|
|
108
|
+
e === "inline-selection" && /* @__PURE__ */ r(o, { children: [w && a && /* @__PURE__ */ i(c, {
|
|
108
109
|
plan: a,
|
|
109
110
|
overflowMenuLabel: s,
|
|
110
111
|
selectionTone: !0
|
|
@@ -116,7 +117,7 @@ function q({ variant: e, beforeFilterActionsPlan: i, filter: t, search: l, after
|
|
|
116
117
|
] }),
|
|
117
118
|
e === "utility-row" && /* @__PURE__ */ r(o, { children: [
|
|
118
119
|
x,
|
|
119
|
-
l != null && /* @__PURE__ */
|
|
120
|
+
l != null && /* @__PURE__ */ i(N, {
|
|
120
121
|
search: l,
|
|
121
122
|
expanded: !0
|
|
122
123
|
}),
|
|
@@ -128,9 +129,9 @@ function q({ variant: e, beforeFilterActionsPlan: i, filter: t, search: l, after
|
|
|
128
129
|
}
|
|
129
130
|
export {
|
|
130
131
|
N as SearchSlot,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
I as SelectionIndicator,
|
|
133
|
+
q as SelectionRow,
|
|
134
|
+
D as TitleBlock,
|
|
135
|
+
F as TitleText,
|
|
136
|
+
E as UtilityCluster
|
|
136
137
|
};
|
|
@@ -4,8 +4,8 @@ import { CloseIcon as f } from "../../icons/close-icon/CloseIcon.js";
|
|
|
4
4
|
import { StyledInputField as u } from "../input-field/StyledInputField.js";
|
|
5
5
|
import { useState as v } from "react";
|
|
6
6
|
import { jsx as t } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
const [h,
|
|
7
|
+
var I = ({ value: o, onClear: s, label: n, onFocus: d, onBlur: c, ...r }) => {
|
|
8
|
+
const [h, a] = v(!1), i = h || o, l = typeof n == "string" ? n : void 0;
|
|
9
9
|
return /* @__PURE__ */ t("div", {
|
|
10
10
|
className: "relative w-full",
|
|
11
11
|
children: /* @__PURE__ */ t(u, {
|
|
@@ -13,12 +13,12 @@ var b = ({ value: o, onClear: s, label: n, onFocus: d, onBlur: c, ...r }) => {
|
|
|
13
13
|
variant: "outlined",
|
|
14
14
|
value: o,
|
|
15
15
|
label: i ? n : void 0,
|
|
16
|
-
placeholder: i ? void 0 :
|
|
16
|
+
placeholder: i ? void 0 : l,
|
|
17
17
|
onFocus: (e) => {
|
|
18
|
-
|
|
18
|
+
a(!0), d?.(e);
|
|
19
19
|
},
|
|
20
20
|
onBlur: (e) => {
|
|
21
|
-
|
|
21
|
+
a(!1), c?.(e);
|
|
22
22
|
},
|
|
23
23
|
slotProps: {
|
|
24
24
|
htmlInput: {
|
|
@@ -28,7 +28,7 @@ var b = ({ value: o, onClear: s, label: n, onFocus: d, onBlur: c, ...r }) => {
|
|
|
28
28
|
whiteSpace: "nowrap",
|
|
29
29
|
...o ? { paddingRight: 40 } : {}
|
|
30
30
|
},
|
|
31
|
-
"aria-label": i ? void 0 :
|
|
31
|
+
"aria-label": i ? void 0 : l
|
|
32
32
|
},
|
|
33
33
|
input: {
|
|
34
34
|
endAdornment: o ? /* @__PURE__ */ t("button", {
|
|
@@ -65,12 +65,12 @@ var b = ({ value: o, onClear: s, label: n, onFocus: d, onBlur: c, ...r }) => {
|
|
|
65
65
|
},
|
|
66
66
|
...r,
|
|
67
67
|
sx: {
|
|
68
|
-
|
|
68
|
+
width: r.fullWidth ? "100%" : "var(--dynamic-toolbar-search-width, 160px)",
|
|
69
69
|
...r.sx
|
|
70
70
|
}
|
|
71
71
|
})
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
I as StyledSearchField
|
|
76
76
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { cn as $ } from "../../../helpers/cn.js";
|
|
2
|
-
import { ChevronDownIcon as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { CheckIcon as
|
|
5
|
-
import { PlusIconCircle as
|
|
6
|
-
import { StyledChip as
|
|
2
|
+
import { ChevronDownIcon as He } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
+
import { CloseIcon as Te } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { CheckIcon as Ye } from "../../icons/check-icon/CheckIcon.js";
|
|
5
|
+
import { PlusIconCircle as Oe } from "../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
6
|
+
import { StyledChip as Be } from "../../data-display/chip/StyledChip.js";
|
|
7
7
|
import { StyledCheckbox as q } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
8
|
-
import { TOP_LAYER_PROPS as
|
|
9
|
-
import { LoadingIcon as
|
|
8
|
+
import { TOP_LAYER_PROPS as qe, TOP_LAYER_RESET_STYLE as Ge, getOpenModalDialogAncestor as Je, useTopLayerRef as Qe } from "../../../hooks/useTopLayer.hook.js";
|
|
9
|
+
import { LoadingIcon as Xe } from "../../../table/shared-components/LoadingIcon.js";
|
|
10
10
|
import G from "./StyledSelectAutocomplete.module.js";
|
|
11
|
-
import { useEffect as
|
|
11
|
+
import { useEffect as Ze, useMemo as L, useRef as J, useState as w } from "react";
|
|
12
12
|
import { jsx as s, jsxs as y } from "react/jsx-runtime";
|
|
13
|
-
import { FloatingPortal as
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
const o = ne === !0, n = K ??
|
|
17
|
-
e && (m ||
|
|
13
|
+
import { FloatingPortal as Ke, autoUpdate as et, flip as tt, offset as rt, shift as lt, size as st, useDismiss as ot, useFloating as at, useInteractions as nt, useMergeRefs as Q, useRole as ct } from "@floating-ui/react";
|
|
14
|
+
var it = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), X = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
|
|
15
|
+
function Rt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, getOptionLabel: K, getOptionKey: R, isOptionEqualToValue: _, renderOption: E, renderValue: j, filterOptions: k, loading: z, loadingText: ee = "Loading…", noOptionsText: te = "No options", disabled: D, readOnly: m, size: re = "small", disableClearable: le, disableCloseOnSelect: se, popupIcon: oe, autoHeight: ae, multiple: ne, allowSelectAll: ce, selectAllLabel: F = "Select all", fullWidth: ie, classes: de, inputValue: S, onInputChange: ue, open: W, onOpen: pe, onClose: me, className: fe, wrapperClassName: he, getOptionDisabled: ge, slotProps: U }) {
|
|
16
|
+
const o = ne === !0, n = K ?? it, C = (e, t) => _ ? _(e, t) : e === t, [be, xe] = w(!1), a = W ?? be, f = (e) => {
|
|
17
|
+
e && (m || D) || (W === void 0 && xe(e), e ? pe?.() : me?.());
|
|
18
18
|
}, [we, V] = w(""), h = S ?? we, A = (e, t, r) => {
|
|
19
19
|
S === void 0 && V(t), ue?.(e, t, r);
|
|
20
|
-
}, [b, I] = w(null), ye = J([]), H = J(null), [ve, Ne] = w(null), [
|
|
21
|
-
|
|
20
|
+
}, [b, I] = w(null), ye = J([]), H = J(null), [ve, Ne] = w(null), [Re, De] = w(null), c = o ? Array.isArray(v) ? v : [] : [], g = o ? null : v ?? null, T = !o && g !== null ? n(g) : "";
|
|
21
|
+
Ze(() => {
|
|
22
22
|
S !== void 0 || o || V(T);
|
|
23
23
|
}, [
|
|
24
24
|
S,
|
|
@@ -37,21 +37,21 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
37
37
|
h,
|
|
38
38
|
k,
|
|
39
39
|
v
|
|
40
|
-
]), i = L(() => O.slice(0, 100), [O]), { refs: P, floatingStyles: Se, context: B } =
|
|
40
|
+
]), i = L(() => O.slice(0, 100), [O]), { refs: P, floatingStyles: Se, context: B } = at({
|
|
41
41
|
open: a,
|
|
42
42
|
onOpenChange: f,
|
|
43
43
|
placement: "bottom-start",
|
|
44
44
|
strategy: "fixed",
|
|
45
|
-
whileElementsMounted:
|
|
45
|
+
whileElementsMounted: et,
|
|
46
46
|
middleware: [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Ne(e.reference.width),
|
|
47
|
+
rt(4),
|
|
48
|
+
tt({ padding: 8 }),
|
|
49
|
+
lt({ padding: 8 }),
|
|
50
|
+
st({ apply({ rects: e, availableHeight: t }) {
|
|
51
|
+
Ne(e.reference.width), De(ae ? t - 8 : Math.min(t - 8, 320));
|
|
52
52
|
} })
|
|
53
53
|
]
|
|
54
|
-
}), { getReferenceProps: Ce, getFloatingProps: Ae, getItemProps: Pe } =
|
|
54
|
+
}), { getReferenceProps: Ce, getFloatingProps: Ae, getItemProps: Pe } = nt([ot(B), ct(B, { role: "listbox" })]), $e = Q([P.setReference]), ke = Q([Qe(P.setFloating)]), Ie = L(() => a ? Je(P.reference.current) : void 0, [a, P]), M = (e, t) => {
|
|
55
55
|
if (o) {
|
|
56
56
|
const r = c.some((u) => C(t, u)), d = r ? c.filter((u) => !C(t, u)) : [...c, t];
|
|
57
57
|
N?.(e, d, r ? "removeOption" : "selectOption", { option: t }), A(e, "", "reset"), se || f(!1);
|
|
@@ -73,17 +73,17 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
73
73
|
const t = e.key === "ArrowDown" ? 1 : -1;
|
|
74
74
|
I((r) => r == null ? t > 0 ? 0 : i.length - 1 : (r + t + i.length) % i.length);
|
|
75
75
|
}
|
|
76
|
-
}, _e = !le && !m && !
|
|
77
|
-
e.preventDefault(), !(
|
|
78
|
-
}, je = o ? j ? j(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ s(
|
|
76
|
+
}, _e = !le && !m && !D && (o ? c.length > 0 : g !== null), Ee = (e) => {
|
|
77
|
+
e.preventDefault(), !(D || m) && (H.current?.focus(), f(!a));
|
|
78
|
+
}, je = o ? j ? j(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ s(Be, {
|
|
79
79
|
dataTest: `selected-chip-${n(e)}`,
|
|
80
80
|
label: n(e),
|
|
81
81
|
readOnly: m,
|
|
82
82
|
onDelete: m ? void 0 : (r) => M(r, e)
|
|
83
|
-
},
|
|
83
|
+
}, R ? R(e) : `${n(e)}-${t}`)) : void 0, ze = /* @__PURE__ */ y("span", {
|
|
84
84
|
className: "flex items-center gap-1",
|
|
85
85
|
children: [
|
|
86
|
-
z && /* @__PURE__ */ s(
|
|
86
|
+
z && /* @__PURE__ */ s(Xe, {
|
|
87
87
|
width: 20,
|
|
88
88
|
height: 20,
|
|
89
89
|
className: "animate-spin"
|
|
@@ -96,7 +96,7 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
96
96
|
onMouseDown: (e) => {
|
|
97
97
|
e.preventDefault(), Me(e);
|
|
98
98
|
},
|
|
99
|
-
children: /* @__PURE__ */ s(
|
|
99
|
+
children: /* @__PURE__ */ s(Te, {
|
|
100
100
|
width: 20,
|
|
101
101
|
height: 20,
|
|
102
102
|
className: "text-delta-700"
|
|
@@ -109,11 +109,11 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
109
109
|
"data-testid": `${l}-popup-indicator`,
|
|
110
110
|
className: "flex cursor-pointer items-center border-0 bg-transparent",
|
|
111
111
|
onMouseDown: Ee,
|
|
112
|
-
children: oe ?? (o ? /* @__PURE__ */ s(
|
|
112
|
+
children: oe ?? (o ? /* @__PURE__ */ s(Oe, {
|
|
113
113
|
width: 24,
|
|
114
114
|
height: 24,
|
|
115
115
|
className: "text-delta-700"
|
|
116
|
-
}) : /* @__PURE__ */ s(
|
|
116
|
+
}) : /* @__PURE__ */ s(He, {
|
|
117
117
|
width: 24,
|
|
118
118
|
height: 24,
|
|
119
119
|
className: $(G["select-custom-icon"], "text-delta-700 transition-transform", a && "rotate-180")
|
|
@@ -121,7 +121,7 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
121
121
|
})
|
|
122
122
|
]
|
|
123
123
|
}), Fe = {
|
|
124
|
-
disabled:
|
|
124
|
+
disabled: D,
|
|
125
125
|
size: re,
|
|
126
126
|
fullWidth: !0,
|
|
127
127
|
value: h,
|
|
@@ -147,11 +147,10 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
147
147
|
endAdornment: ze
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
}, We = (e, t, r) => {
|
|
150
|
+
}, We = $("box-border flex min-h-10 cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-700 first:-mt-1", "aria-selected:bg-gama-50 data-[active]:bg-gama-50 data-[active]:text-delta-800", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300", o && "border-0 border-b border-solid border-delta-200"), Ue = (e, t, r) => {
|
|
151
151
|
const { key: d, ...u } = e;
|
|
152
152
|
return /* @__PURE__ */ y("li", {
|
|
153
153
|
...u,
|
|
154
|
-
className: $("box-border flex min-h-10 cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-700 first:-mt-1", "aria-selected:bg-gama-50 data-[active]:bg-gama-50 data-[active]:text-delta-800", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300", o && "border-0 border-b border-solid border-delta-200"),
|
|
155
154
|
children: [o ? /* @__PURE__ */ s(q, {
|
|
156
155
|
dataTest: `${l}-${n(t)}-checkbox`,
|
|
157
156
|
checked: r.selected,
|
|
@@ -160,7 +159,7 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
160
159
|
decorative: !0
|
|
161
160
|
}) : /* @__PURE__ */ s("span", {
|
|
162
161
|
className: "w-5",
|
|
163
|
-
children: r.selected && /* @__PURE__ */ s(
|
|
162
|
+
children: r.selected && /* @__PURE__ */ s(Ye, {
|
|
164
163
|
width: 20,
|
|
165
164
|
height: 20,
|
|
166
165
|
className: "text-gama-500"
|
|
@@ -170,7 +169,7 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
170
169
|
children: n(t)
|
|
171
170
|
})]
|
|
172
171
|
}, d);
|
|
173
|
-
},
|
|
172
|
+
}, Ve = (e, t) => {
|
|
174
173
|
const r = ge?.(e) ?? X(e), d = {
|
|
175
174
|
...Pe({
|
|
176
175
|
onMouseDown: (x) => x.preventDefault(),
|
|
@@ -179,7 +178,7 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
179
178
|
},
|
|
180
179
|
onMouseMove: () => I(r ? null : t)
|
|
181
180
|
}),
|
|
182
|
-
key:
|
|
181
|
+
key: R ? String(R(e)) : `${n(e)}-${t}`,
|
|
183
182
|
ref: (x) => {
|
|
184
183
|
ye.current[t] = x;
|
|
185
184
|
},
|
|
@@ -187,26 +186,27 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
187
186
|
id: `${l}-option-${t}`,
|
|
188
187
|
"aria-selected": Y(e),
|
|
189
188
|
"aria-disabled": r || void 0,
|
|
190
|
-
"data-active": b === t ? "" : void 0
|
|
189
|
+
"data-active": b === t ? "" : void 0,
|
|
190
|
+
className: We
|
|
191
191
|
}, u = {
|
|
192
192
|
selected: Y(e),
|
|
193
193
|
index: t,
|
|
194
194
|
inputValue: h
|
|
195
195
|
};
|
|
196
|
-
return E ? E(d, e, u) :
|
|
196
|
+
return E ? E(d, e, u) : Ue(d, e, u);
|
|
197
197
|
};
|
|
198
198
|
return /* @__PURE__ */ y("div", {
|
|
199
199
|
className: $(G.styledSelectAutocompleteWrapper, !ie && "w-auto", he, fe),
|
|
200
|
-
children: [Z(Fe), a && /* @__PURE__ */ s(
|
|
200
|
+
children: [Z(Fe), a && /* @__PURE__ */ s(Ke, {
|
|
201
201
|
root: Ie,
|
|
202
202
|
children: /* @__PURE__ */ y("ul", {
|
|
203
203
|
ref: ke,
|
|
204
|
-
...
|
|
204
|
+
...qe,
|
|
205
205
|
style: {
|
|
206
|
-
...
|
|
206
|
+
...Ge,
|
|
207
207
|
...Se,
|
|
208
208
|
width: ve ?? void 0,
|
|
209
|
-
maxHeight:
|
|
209
|
+
maxHeight: Re ?? void 0,
|
|
210
210
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
211
211
|
...U?.popper?.style
|
|
212
212
|
},
|
|
@@ -238,11 +238,11 @@ function Nt({ dataTest: l, options: p, renderInput: Z, value: v, onChange: N, ge
|
|
|
238
238
|
role: "presentation",
|
|
239
239
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
240
240
|
children: te
|
|
241
|
-
}) : i.map(
|
|
241
|
+
}) : i.map(Ve)]
|
|
242
242
|
})
|
|
243
243
|
})]
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
export {
|
|
247
|
-
|
|
247
|
+
Rt as StyledSelectAutocomplete
|
|
248
248
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
if (!
|
|
5
|
-
const t =
|
|
1
|
+
import { useEffect as d } from "react";
|
|
2
|
+
var m = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])', b = (c, u, a) => {
|
|
3
|
+
d(() => {
|
|
4
|
+
if (!c) return;
|
|
5
|
+
const t = u.current;
|
|
6
6
|
if (!t) return;
|
|
7
|
-
const r = document.activeElement,
|
|
8
|
-
|
|
9
|
-
}),
|
|
7
|
+
const r = document.activeElement, l = requestAnimationFrame(() => {
|
|
8
|
+
t.focus({ preventScroll: !0 });
|
|
9
|
+
}), i = (e) => {
|
|
10
10
|
if (e.key === "Escape") {
|
|
11
|
-
|
|
11
|
+
a?.();
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
if (e.key !== "Tab") return;
|
|
15
|
-
const n = Array.from(t.querySelectorAll(
|
|
15
|
+
const n = Array.from(t.querySelectorAll(m));
|
|
16
16
|
if (n.length === 0) {
|
|
17
17
|
e.preventDefault();
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
e.shiftKey &&
|
|
20
|
+
const s = n[0], f = n[n.length - 1], o = document.activeElement;
|
|
21
|
+
e.shiftKey && (o === s || o === t) ? (e.preventDefault(), f?.focus()) : (!e.shiftKey && o === f || !e.shiftKey && o === t) && (e.preventDefault(), s?.focus());
|
|
22
22
|
};
|
|
23
|
-
return document.addEventListener("keydown",
|
|
24
|
-
cancelAnimationFrame(
|
|
23
|
+
return document.addEventListener("keydown", i), () => {
|
|
24
|
+
cancelAnimationFrame(l), document.removeEventListener("keydown", i), r && document.contains(r) && r.focus();
|
|
25
25
|
};
|
|
26
26
|
}, [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
c,
|
|
28
|
+
u,
|
|
29
|
+
a
|
|
30
30
|
]);
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
b as useFocusTrap
|
|
34
34
|
};
|
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
var
|
|
2
|
-
"asma-ui-table-styled-table": "_asma-ui-table-styled-
|
|
3
|
-
"table-wrapper": "_table-
|
|
4
|
-
"table-shell": "_table-
|
|
5
|
-
"table-wrapper--no-rows": "_table-wrapper--no-
|
|
6
|
-
"table-wrapper--proxy": "_table-wrapper--
|
|
7
|
-
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-
|
|
8
|
-
"table-wrapper-fetching": "_table-wrapper-
|
|
9
|
-
"table-scroll": "_table-
|
|
10
|
-
"table-x--fill-height": "_table-x--fill-
|
|
11
|
-
"table-x": "_table-
|
|
12
|
-
"table-content": "_table-
|
|
13
|
-
"table-header--sticky": "_table-header--
|
|
14
|
-
"table-hscroll": "_table-
|
|
15
|
-
"table-hscroll__content": "_table-
|
|
16
|
-
"no-rows-overlay-container": "_no-rows-overlay-
|
|
17
|
-
"no-rows-overlay-content": "_no-rows-overlay-
|
|
18
|
-
"styled-table": "_styled-
|
|
19
|
-
tbody:
|
|
20
|
-
"loading-icon": "_loading-
|
|
21
|
-
"t-row": "_t-
|
|
22
|
-
"t-cell": "_t-
|
|
23
|
-
"action-cell": "_action-
|
|
24
|
-
"fixed-cell": "_fixed-
|
|
25
|
-
"fixed-right-cell": "_fixed-right-
|
|
26
|
-
expanded_row:
|
|
27
|
-
selected:
|
|
28
|
-
"single-selection": "_single-
|
|
29
|
-
"action-cell--no-shadow": "_action-cell--no-
|
|
30
|
-
shadowed:
|
|
31
|
-
"shadowed-right": "_shadowed-
|
|
32
|
-
"is-loading": "_is-
|
|
33
|
-
"action-cell-default-background": "_action-cell-default-
|
|
34
|
-
"fixed-cell-default-background": "_fixed-cell-default-
|
|
35
|
-
"fixed-right-cell-default-background": "_fixed-right-cell-default-
|
|
36
|
-
"sortable-column": "_sortable-
|
|
37
|
-
resizer:
|
|
38
|
-
isResizing:
|
|
39
|
-
"hide-table-header": "_hide-table-
|
|
40
|
-
"show-table-header": "_show-table-
|
|
41
|
-
"table-header": "_table-
|
|
42
|
-
"hide-header": "_hide-
|
|
43
|
-
"t-cell__actions": "_t-
|
|
44
|
-
"t-cell__actions--no-shadow": "_t-cell__actions--no-
|
|
45
|
-
"t-cell__fixed": "_t-
|
|
46
|
-
"t-cell__fixed-right": "_t-cell__fixed-
|
|
47
|
-
"sort-icon": "_sort-
|
|
48
|
-
"header-content": "_header-
|
|
49
|
-
"table-footer--sticky": "_table-footer--
|
|
50
|
-
"table-footer--inline": "_table-footer--
|
|
51
|
-
"table-bottom": "_table-
|
|
52
|
-
"table-bottom--sticky": "_table-bottom--
|
|
53
|
-
"cursor-not-allowed": "_cursor-not-
|
|
1
|
+
var e = "_tbody_qdh8h_124", _ = "_expanded_row_qdh8h_187", l = "_selected_qdh8h_205", h = "_shadowed_qdh8h_228", t = "_resizer_qdh8h_282", a = "_isResizing_qdh8h_294", d = {
|
|
2
|
+
"asma-ui-table-styled-table": "_asma-ui-table-styled-table_qdh8h_1",
|
|
3
|
+
"table-wrapper": "_table-wrapper_qdh8h_26",
|
|
4
|
+
"table-shell": "_table-shell_qdh8h_33",
|
|
5
|
+
"table-wrapper--no-rows": "_table-wrapper--no-rows_qdh8h_39",
|
|
6
|
+
"table-wrapper--proxy": "_table-wrapper--proxy_qdh8h_42",
|
|
7
|
+
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_qdh8h_43",
|
|
8
|
+
"table-wrapper-fetching": "_table-wrapper-fetching_qdh8h_53",
|
|
9
|
+
"table-scroll": "_table-scroll_qdh8h_56",
|
|
10
|
+
"table-x--fill-height": "_table-x--fill-height_qdh8h_65",
|
|
11
|
+
"table-x": "_table-x_qdh8h_65",
|
|
12
|
+
"table-content": "_table-content_qdh8h_80",
|
|
13
|
+
"table-header--sticky": "_table-header--sticky_qdh8h_85",
|
|
14
|
+
"table-hscroll": "_table-hscroll_qdh8h_90",
|
|
15
|
+
"table-hscroll__content": "_table-hscroll__content_qdh8h_100",
|
|
16
|
+
"no-rows-overlay-container": "_no-rows-overlay-container_qdh8h_103",
|
|
17
|
+
"no-rows-overlay-content": "_no-rows-overlay-content_qdh8h_111",
|
|
18
|
+
"styled-table": "_styled-table_qdh8h_115",
|
|
19
|
+
tbody: e,
|
|
20
|
+
"loading-icon": "_loading-icon_qdh8h_129",
|
|
21
|
+
"t-row": "_t-row_qdh8h_136",
|
|
22
|
+
"t-cell": "_t-cell_qdh8h_136",
|
|
23
|
+
"action-cell": "_action-cell_qdh8h_146",
|
|
24
|
+
"fixed-cell": "_fixed-cell_qdh8h_150",
|
|
25
|
+
"fixed-right-cell": "_fixed-right-cell_qdh8h_153",
|
|
26
|
+
expanded_row: _,
|
|
27
|
+
selected: l,
|
|
28
|
+
"single-selection": "_single-selection_qdh8h_208",
|
|
29
|
+
"action-cell--no-shadow": "_action-cell--no-shadow_qdh8h_225",
|
|
30
|
+
shadowed: h,
|
|
31
|
+
"shadowed-right": "_shadowed-right_qdh8h_262",
|
|
32
|
+
"is-loading": "_is-loading_qdh8h_266",
|
|
33
|
+
"action-cell-default-background": "_action-cell-default-background_qdh8h_269",
|
|
34
|
+
"fixed-cell-default-background": "_fixed-cell-default-background_qdh8h_272",
|
|
35
|
+
"fixed-right-cell-default-background": "_fixed-right-cell-default-background_qdh8h_275",
|
|
36
|
+
"sortable-column": "_sortable-column_qdh8h_278",
|
|
37
|
+
resizer: t,
|
|
38
|
+
isResizing: a,
|
|
39
|
+
"hide-table-header": "_hide-table-header_qdh8h_306",
|
|
40
|
+
"show-table-header": "_show-table-header_qdh8h_310",
|
|
41
|
+
"table-header": "_table-header_qdh8h_85",
|
|
42
|
+
"hide-header": "_hide-header_qdh8h_346",
|
|
43
|
+
"t-cell__actions": "_t-cell__actions_qdh8h_349",
|
|
44
|
+
"t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_qdh8h_357",
|
|
45
|
+
"t-cell__fixed": "_t-cell__fixed_qdh8h_361",
|
|
46
|
+
"t-cell__fixed-right": "_t-cell__fixed-right_qdh8h_368",
|
|
47
|
+
"sort-icon": "_sort-icon_qdh8h_375",
|
|
48
|
+
"header-content": "_header-content_qdh8h_379",
|
|
49
|
+
"table-footer--sticky": "_table-footer--sticky_qdh8h_394",
|
|
50
|
+
"table-footer--inline": "_table-footer--inline_qdh8h_405",
|
|
51
|
+
"table-bottom": "_table-bottom_qdh8h_416",
|
|
52
|
+
"table-bottom--sticky": "_table-bottom--sticky_qdh8h_430",
|
|
53
|
+
"cursor-not-allowed": "_cursor-not-allowed_qdh8h_434",
|
|
54
|
+
"select-control": "_select-control_qdh8h_438"
|
|
54
55
|
};
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
d as default
|
|
57
58
|
};
|