asma-ui-core 3.58.4 → 3.59.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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var e = "_root_t64s4_1", _ = "_shell_t64s4_5", a = "_shellCompact_t64s4_9", t = "_shellExpanded_t64s4_13", s = "_content_t64s4_17", r = "_compactItems_t64s4_21", o = "_expandedItems_t64s4_25", l = "_measureRow_t64s4_29", m = "_measureLayer_t64s4_33", v = "_chevron_t64s4_37", d = {
|
|
2
|
+
root: e,
|
|
3
|
+
shell: _,
|
|
4
|
+
shellCompact: a,
|
|
5
|
+
shellExpanded: t,
|
|
6
|
+
content: s,
|
|
7
|
+
compactItems: r,
|
|
8
|
+
expandedItems: o,
|
|
9
|
+
measureRow: l,
|
|
10
|
+
measureLayer: m,
|
|
11
|
+
chevron: v
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
d as default
|
|
15
|
+
};
|
|
@@ -1,146 +1,147 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { ChevronDownIcon as
|
|
3
|
-
import { ChevronUpIcon as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { cn as I } from "../../../helpers/cn.js";
|
|
2
|
+
import { ChevronDownIcon as z } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
+
import { ChevronUpIcon as B } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
|
|
4
|
+
import h from "./Pathfinder.module.js";
|
|
5
|
+
import { useCallback as R, useEffect as y, useLayoutEffect as F, useMemo as C, useRef as w, useState as x, useSyncExternalStore as O } from "react";
|
|
6
|
+
import { Fragment as j, jsx as e, jsxs as N } from "react/jsx-runtime";
|
|
7
|
+
var P = typeof window < "u" ? F : y;
|
|
7
8
|
function D() {
|
|
8
|
-
const [i, n] =
|
|
9
|
+
const [i, n] = x(null), d = R((t) => {
|
|
9
10
|
n(t);
|
|
10
|
-
}, []),
|
|
11
|
+
}, []), s = R(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
|
|
11
12
|
return {
|
|
12
|
-
ref:
|
|
13
|
-
width:
|
|
13
|
+
ref: d,
|
|
14
|
+
width: O(R((t) => {
|
|
14
15
|
if (!i || typeof ResizeObserver > "u") return () => {
|
|
15
16
|
console.log("Node is missing or ResizeObserver is undefined");
|
|
16
17
|
};
|
|
17
|
-
let
|
|
18
|
-
const
|
|
19
|
-
cancelAnimationFrame(
|
|
18
|
+
let a = 0;
|
|
19
|
+
const o = new ResizeObserver(() => {
|
|
20
|
+
cancelAnimationFrame(a), a = requestAnimationFrame(t);
|
|
20
21
|
});
|
|
21
|
-
return
|
|
22
|
-
cancelAnimationFrame(
|
|
22
|
+
return o.observe(i), () => {
|
|
23
|
+
cancelAnimationFrame(a), o.disconnect();
|
|
23
24
|
};
|
|
24
|
-
}, [i]),
|
|
25
|
+
}, [i]), s, () => 0)
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
return [...i].sort((n,
|
|
29
|
-
const
|
|
30
|
-
return
|
|
28
|
+
function M(i) {
|
|
29
|
+
return [...i].sort((n, d) => {
|
|
30
|
+
const s = n.order ?? 0, t = d.order ?? 0;
|
|
31
|
+
return s !== t ? s - t : n.id.localeCompare(d.id);
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
const { items: n, leadSlot:
|
|
34
|
+
function _(i) {
|
|
35
|
+
const { items: n, leadSlot: d, actionSlot: s } = i, t = w({}), a = w(null), o = w(null), [l, p] = x({
|
|
35
36
|
itemWidths: {},
|
|
36
37
|
leadWidth: 0,
|
|
37
38
|
actionWidth: 0
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
}), f = w(l);
|
|
40
|
+
y(() => {
|
|
41
|
+
f.current = l;
|
|
41
42
|
}, [l]);
|
|
42
|
-
const
|
|
43
|
-
t.current[
|
|
43
|
+
const v = R((c) => (m) => {
|
|
44
|
+
t.current[c] = m;
|
|
44
45
|
}, []);
|
|
45
|
-
return
|
|
46
|
-
const
|
|
47
|
-
for (const
|
|
48
|
-
const
|
|
49
|
-
|
|
46
|
+
return P(() => {
|
|
47
|
+
const c = {};
|
|
48
|
+
for (const u of n) {
|
|
49
|
+
const k = t.current[u.id], r = Math.ceil(k?.getBoundingClientRect().width ?? u.estimatedWidth ?? 0);
|
|
50
|
+
c[u.id] = r;
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
-
(!(Object.keys(
|
|
53
|
-
itemWidths:
|
|
54
|
-
leadWidth:
|
|
55
|
-
actionWidth:
|
|
52
|
+
const m = d ? Math.ceil(a.current?.getBoundingClientRect().width ?? 0) : 0, g = s ? Math.ceil(o.current?.getBoundingClientRect().width ?? 0) : 0, W = f.current;
|
|
53
|
+
(!(Object.keys(W.itemWidths).length === Object.keys(c).length && n.every((u) => W.itemWidths[u.id] === c[u.id])) || W.leadWidth !== m || W.actionWidth !== g) && p({
|
|
54
|
+
itemWidths: c,
|
|
55
|
+
leadWidth: m,
|
|
56
|
+
actionWidth: g
|
|
56
57
|
});
|
|
57
58
|
}, [
|
|
58
59
|
n,
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
d,
|
|
61
|
+
s
|
|
61
62
|
]), {
|
|
62
63
|
measurements: l,
|
|
63
|
-
registerItemRef:
|
|
64
|
-
leadRef:
|
|
65
|
-
actionRef:
|
|
64
|
+
registerItemRef: v,
|
|
65
|
+
leadRef: a,
|
|
66
|
+
actionRef: o
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
function q(i) {
|
|
69
|
-
const { items: n, availableWidth:
|
|
70
|
-
let
|
|
71
|
-
for (const l of
|
|
72
|
-
const p = Math.max(0, t[l.id] ?? l.estimatedWidth ?? 0),
|
|
73
|
-
if (
|
|
74
|
-
|
|
70
|
+
const { items: n, availableWidth: d, gapPx: s, itemWidths: t } = i, a = [];
|
|
71
|
+
let o = 0;
|
|
72
|
+
for (const l of M(n)) {
|
|
73
|
+
const p = Math.max(0, t[l.id] ?? l.estimatedWidth ?? 0), f = a.length === 0 ? p : o + s + p;
|
|
74
|
+
if (f > d) break;
|
|
75
|
+
a.push(l), o = f;
|
|
75
76
|
}
|
|
76
|
-
return
|
|
77
|
+
return a;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
return /* @__PURE__ */ e(
|
|
79
|
+
function b({ item: i, compact: n }) {
|
|
80
|
+
return /* @__PURE__ */ e(j, { children: i.render({ compact: n }) });
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
-
const { ref: p, width:
|
|
83
|
-
items:
|
|
84
|
-
leadSlot:
|
|
82
|
+
function Q({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot: t, className: a, leadReservePx: o = 140, actionReservePx: l = 44 }) {
|
|
83
|
+
const { ref: p, width: f } = D(), v = !n, c = C(() => M(i), [i]), { measurements: m, registerItemRef: g, leadRef: W, actionRef: u } = _({
|
|
84
|
+
items: c,
|
|
85
|
+
leadSlot: s,
|
|
85
86
|
actionSlot: t
|
|
86
|
-
}),
|
|
87
|
-
if (n) return
|
|
88
|
-
const
|
|
87
|
+
}), k = C(() => {
|
|
88
|
+
if (n) return c;
|
|
89
|
+
const r = 24, A = 40, E = s ? Math.max(o, m.leadWidth + 12) : 0, L = t ? Math.max(l, m.actionWidth) : 0;
|
|
89
90
|
return q({
|
|
90
|
-
items:
|
|
91
|
-
availableWidth: Math.max(0,
|
|
91
|
+
items: c,
|
|
92
|
+
availableWidth: Math.max(0, f - r - A - E - L - 24),
|
|
92
93
|
gapPx: 12,
|
|
93
|
-
itemWidths:
|
|
94
|
+
itemWidths: m.itemWidths
|
|
94
95
|
});
|
|
95
96
|
}, [
|
|
96
97
|
n,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
c,
|
|
99
|
+
f,
|
|
100
|
+
s,
|
|
100
101
|
t,
|
|
101
|
-
|
|
102
|
+
o,
|
|
102
103
|
l,
|
|
103
|
-
|
|
104
|
+
m
|
|
104
105
|
]);
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ N("div", {
|
|
106
107
|
ref: p,
|
|
107
|
-
className:
|
|
108
|
+
className: I(h.root, v ? "overflow-hidden" : "overflow-visible", a),
|
|
108
109
|
"aria-expanded": n,
|
|
109
110
|
role: "button",
|
|
110
111
|
tabIndex: 0,
|
|
111
|
-
onClick:
|
|
112
|
-
onKeyDown: (
|
|
113
|
-
(
|
|
112
|
+
onClick: d,
|
|
113
|
+
onKeyDown: (r) => {
|
|
114
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), d());
|
|
114
115
|
},
|
|
115
116
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
className:
|
|
118
|
-
children: [
|
|
117
|
+
/* @__PURE__ */ N("div", {
|
|
118
|
+
className: I(h.shell, v ? h.shellCompact : h.shellExpanded),
|
|
119
|
+
children: [s ? /* @__PURE__ */ e("div", {
|
|
119
120
|
className: "shrink-0",
|
|
120
|
-
children:
|
|
121
|
+
children: s
|
|
121
122
|
}) : null, /* @__PURE__ */ e("div", {
|
|
122
|
-
className:
|
|
123
|
-
children:
|
|
124
|
-
className:
|
|
125
|
-
children:
|
|
123
|
+
className: h.content,
|
|
124
|
+
children: v ? /* @__PURE__ */ e("div", {
|
|
125
|
+
className: h.compactItems,
|
|
126
|
+
children: k.map((r) => /* @__PURE__ */ e("div", {
|
|
126
127
|
className: "shrink-0 whitespace-nowrap",
|
|
127
|
-
children: /* @__PURE__ */ e(
|
|
128
|
-
item:
|
|
129
|
-
compact:
|
|
128
|
+
children: /* @__PURE__ */ e(b, {
|
|
129
|
+
item: r,
|
|
130
|
+
compact: v
|
|
130
131
|
})
|
|
131
|
-
},
|
|
132
|
-
}) : /* @__PURE__ */
|
|
133
|
-
className:
|
|
134
|
-
children: [
|
|
132
|
+
}, r.id))
|
|
133
|
+
}) : /* @__PURE__ */ N("div", {
|
|
134
|
+
className: h.expandedItems,
|
|
135
|
+
children: [c.map((r) => /* @__PURE__ */ e("div", {
|
|
135
136
|
className: "shrink-0 whitespace-nowrap",
|
|
136
|
-
children: /* @__PURE__ */ e(
|
|
137
|
-
item:
|
|
138
|
-
compact:
|
|
137
|
+
children: /* @__PURE__ */ e(b, {
|
|
138
|
+
item: r,
|
|
139
|
+
compact: v
|
|
139
140
|
})
|
|
140
|
-
},
|
|
141
|
+
}, r.id)), t ? /* @__PURE__ */ e("div", {
|
|
141
142
|
className: "shrink-0",
|
|
142
143
|
children: /* @__PURE__ */ e("div", {
|
|
143
|
-
ref:
|
|
144
|
+
ref: u,
|
|
144
145
|
children: t
|
|
145
146
|
})
|
|
146
147
|
}) : null]
|
|
@@ -148,34 +149,34 @@ function J({ items: i, expanded: n, onToggleExpanded: o, leadSlot: r, actionSlot
|
|
|
148
149
|
})]
|
|
149
150
|
}),
|
|
150
151
|
/* @__PURE__ */ e("div", {
|
|
151
|
-
className:
|
|
152
|
-
children: n ? /* @__PURE__ */ e(
|
|
152
|
+
className: h.chevron,
|
|
153
|
+
children: n ? /* @__PURE__ */ e(B, { className: "size-6" }) : /* @__PURE__ */ e(z, { className: "size-6" })
|
|
153
154
|
}),
|
|
154
155
|
/* @__PURE__ */ e("div", {
|
|
155
156
|
"aria-hidden": !0,
|
|
156
|
-
className:
|
|
157
|
-
children: /* @__PURE__ */
|
|
158
|
-
className:
|
|
157
|
+
className: h.measureLayer,
|
|
158
|
+
children: /* @__PURE__ */ N("div", {
|
|
159
|
+
className: h.measureRow,
|
|
159
160
|
children: [
|
|
160
|
-
|
|
161
|
+
s ? /* @__PURE__ */ e("div", {
|
|
161
162
|
className: "shrink-0",
|
|
162
163
|
children: /* @__PURE__ */ e("div", {
|
|
163
|
-
ref:
|
|
164
|
-
children:
|
|
164
|
+
ref: W,
|
|
165
|
+
children: s
|
|
165
166
|
})
|
|
166
167
|
}) : null,
|
|
167
|
-
|
|
168
|
-
ref:
|
|
168
|
+
c.map((r) => /* @__PURE__ */ e("div", {
|
|
169
|
+
ref: g(r.id),
|
|
169
170
|
className: "shrink-0 whitespace-nowrap",
|
|
170
|
-
children: /* @__PURE__ */ e(
|
|
171
|
-
item:
|
|
171
|
+
children: /* @__PURE__ */ e(b, {
|
|
172
|
+
item: r,
|
|
172
173
|
compact: !0
|
|
173
174
|
})
|
|
174
|
-
},
|
|
175
|
+
}, r.id)),
|
|
175
176
|
t ? /* @__PURE__ */ e("div", {
|
|
176
177
|
className: "shrink-0",
|
|
177
178
|
children: /* @__PURE__ */ e("div", {
|
|
178
|
-
ref:
|
|
179
|
+
ref: u,
|
|
179
180
|
children: t
|
|
180
181
|
})
|
|
181
182
|
}) : null
|
|
@@ -186,5 +187,5 @@ function J({ items: i, expanded: n, onToggleExpanded: o, leadSlot: r, actionSlot
|
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
export {
|
|
189
|
-
|
|
190
|
+
Q as PathfinderCard
|
|
190
191
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { cn as f } from "../../../helpers/cn.js";
|
|
2
|
-
import { resolveSx as
|
|
2
|
+
import { resolveSx as fe } from "../../../helpers/sx.js";
|
|
3
3
|
import { ChevronDownIcon as pe } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
4
4
|
import { CloseIcon as me } from "../../icons/close-icon/CloseIcon.js";
|
|
5
5
|
import { ErrorOutlineIcon as xe } from "../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
6
|
-
import { TOP_LAYER_PROPS as
|
|
6
|
+
import { TOP_LAYER_PROPS as ye, TOP_LAYER_RESET_STYLE as ge, getOpenModalDialogAncestor as be, useTopLayerRef as he } from "../../../hooks/useTopLayer.hook.js";
|
|
7
7
|
import { outlineClass as we } from "../field-styles.js";
|
|
8
8
|
import { useFormControlContext as Ae } from "../../miscellaneous/FormControlContext.js";
|
|
9
9
|
import { StyledFormHelperText as ve } from "../../miscellaneous/StyledFormHelperText.js";
|
|
10
|
-
import { Children as S, cloneElement as Re, isValidElement as E, useEffect as
|
|
11
|
-
import { jsx as n, jsxs as
|
|
12
|
-
import { FloatingPortal as Fe, autoUpdate as Se, flip as Ee, offset as Ce, shift as Ne, size as _e, useClick as
|
|
13
|
-
var Ge = ({ dataTest:
|
|
14
|
-
const a = Ae(),
|
|
15
|
-
open:
|
|
16
|
-
onOpenChange:
|
|
10
|
+
import { Children as S, cloneElement as Re, isValidElement as E, useEffect as C, useMemo as ke, useRef as De, useState as N } from "react";
|
|
11
|
+
import { jsx as n, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { FloatingPortal as Fe, autoUpdate as Se, flip as Ee, offset as Ce, shift as Ne, size as _e, useClick as qe, useDismiss as Pe, useFloating as Te, useInteractions as Ve, useMergeRefs as K, useRole as je } from "@floating-ui/react";
|
|
13
|
+
var Ge = ({ dataTest: _, value: q, defaultValue: L, onChange: P, error: M, errorText: H, allowClear: T, disabled: O, readOnly: c, name: p, placeholder: b, displayEmpty: h, multiple: d, renderValue: V, fullWidth: Y, className: z, style: W, sx: $, variant: G, children: w, MenuProps: J, onFocus: Q, onBlur: X, labelId: m }) => {
|
|
14
|
+
const a = Ae(), j = `${_}-listbox`, A = G === "standard", I = M ?? a?.error ?? !1, s = O ?? a?.disabled ?? !1, [o, x] = N(!1), [v, R] = N(!1), [Z, U] = N(L), k = q !== void 0, r = k ? q : Z, l = Array.isArray(r) ? r.length > 0 : r !== void 0 && r !== "" && r !== null, i = De(null), { refs: u, floatingStyles: ee, context: D } = Te({
|
|
15
|
+
open: o,
|
|
16
|
+
onOpenChange: x,
|
|
17
17
|
placement: "bottom-start",
|
|
18
18
|
strategy: "fixed",
|
|
19
19
|
whileElementsMounted: Se,
|
|
@@ -25,79 +25,87 @@ var Ge = ({ dataTest: N, value: _, defaultValue: L, onChange: P, error: M, error
|
|
|
25
25
|
t.floating.style.minWidth = `${e.reference.width + 20}px`;
|
|
26
26
|
} })
|
|
27
27
|
]
|
|
28
|
-
}), { getReferenceProps: te, getFloatingProps: re } =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
]), oe = K([
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
}), { getReferenceProps: te, getFloatingProps: re } = Ve([
|
|
29
|
+
qe(D, { enabled: !s && !c }),
|
|
30
|
+
Pe(D),
|
|
31
|
+
je(D, { role: "listbox" })
|
|
32
|
+
]), oe = K([u.setReference]), se = K([he(u.setFloating), i]), ne = ke(() => o ? be(u.reference.current) : void 0, [o, u]);
|
|
33
|
+
C(() => a?.setFocused(o || v), [
|
|
34
|
+
o,
|
|
35
35
|
v,
|
|
36
36
|
a
|
|
37
|
-
]),
|
|
37
|
+
]), C(() => a?.setFilled(l || !!b || !!h), [
|
|
38
38
|
l,
|
|
39
39
|
b,
|
|
40
40
|
h,
|
|
41
41
|
a
|
|
42
|
-
])
|
|
42
|
+
]), C(() => {
|
|
43
|
+
if (!o) return;
|
|
44
|
+
const e = requestAnimationFrame(() => {
|
|
45
|
+
const t = i.current?.querySelector('[role="option"][aria-selected="true"]');
|
|
46
|
+
t && (t.scrollIntoView({ block: "nearest" }), t.focus());
|
|
47
|
+
});
|
|
48
|
+
return () => cancelAnimationFrame(e);
|
|
49
|
+
}, [o]);
|
|
43
50
|
const le = (e, t) => {
|
|
44
|
-
const
|
|
45
|
-
k ||
|
|
46
|
-
value:
|
|
47
|
-
name:
|
|
48
|
-
} }, t),
|
|
51
|
+
const y = d ? Array.isArray(r) && r.includes(e) ? r.filter((F) => F !== e) : [...Array.isArray(r) ? r : [], e] : e;
|
|
52
|
+
k || U(y), P?.({ target: {
|
|
53
|
+
value: y,
|
|
54
|
+
name: p
|
|
55
|
+
} }, t), d || (x(!1), requestAnimationFrame(() => u.domReference.current?.focus()));
|
|
49
56
|
}, B = () => {
|
|
50
|
-
const e =
|
|
51
|
-
k ||
|
|
57
|
+
const e = d ? [] : "";
|
|
58
|
+
k || U(e), P?.({ target: {
|
|
52
59
|
value: e,
|
|
53
|
-
name:
|
|
54
|
-
} }, null),
|
|
60
|
+
name: p
|
|
61
|
+
} }, null), x(!1), R(!1);
|
|
55
62
|
}, ae = S.map(w, (e) => {
|
|
56
63
|
if (!E(e)) return e;
|
|
57
64
|
const t = e.props.value;
|
|
58
65
|
return Re(e, {
|
|
59
|
-
selected:
|
|
66
|
+
selected: d ? Array.isArray(r) && r.includes(t) : t === r,
|
|
60
67
|
onClick: () => le(t, e.props.children)
|
|
61
68
|
});
|
|
62
|
-
}), ie = S.toArray(w).find((e) => E(e) && e.props.value === r), ce =
|
|
69
|
+
}), ie = S.toArray(w).find((e) => E(e) && e.props.value === r), ce = V ? V(r) : d && Array.isArray(r) ? S.toArray(w).filter((e) => E(e) && r.includes(e.props.value)).map((e) => {
|
|
63
70
|
const t = e.props.children;
|
|
64
71
|
return typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
65
72
|
}).join(", ") : ie?.props.children, de = (e) => {
|
|
66
|
-
if ((e.key === "Backspace" || e.key === "Delete") && T && l && !
|
|
73
|
+
if ((e.key === "Backspace" || e.key === "Delete") && T && l && !s && !c) {
|
|
67
74
|
e.preventDefault(), B();
|
|
68
75
|
return;
|
|
69
76
|
}
|
|
70
|
-
e.key !== "ArrowDown" && e.key !== "ArrowUp" ||
|
|
71
|
-
|
|
77
|
+
e.key !== "ArrowDown" && e.key !== "ArrowUp" || s || c || (e.preventDefault(), x(!0), requestAnimationFrame(() => {
|
|
78
|
+
if (i.current?.querySelector('[role="option"][aria-selected="true"]')) return;
|
|
79
|
+
const t = i.current?.querySelectorAll('[role="option"]:not([aria-disabled="true"])');
|
|
72
80
|
t?.length && t[e.key === "ArrowUp" ? t.length - 1 : 0]?.focus();
|
|
73
81
|
}));
|
|
74
|
-
},
|
|
75
|
-
const t =
|
|
82
|
+
}, ue = (e) => {
|
|
83
|
+
const t = i.current ? Array.from(i.current.querySelectorAll('[role="option"]:not([aria-disabled="true"])')) : [];
|
|
76
84
|
if (t.length === 0) return;
|
|
77
|
-
const
|
|
78
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), t[(
|
|
85
|
+
const y = t.findIndex((F) => F === document.activeElement);
|
|
86
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), t[(y + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus()) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), document.activeElement?.click());
|
|
79
87
|
};
|
|
80
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ g("div", {
|
|
81
89
|
className: f("group relative inline-flex flex-col", Y && "w-full", z),
|
|
82
90
|
style: {
|
|
83
91
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
84
|
-
...
|
|
92
|
+
...fe($),
|
|
85
93
|
...W
|
|
86
94
|
},
|
|
87
95
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ g("button", {
|
|
89
97
|
ref: oe,
|
|
90
98
|
type: "button",
|
|
91
|
-
"data-testid":
|
|
99
|
+
"data-testid": _,
|
|
92
100
|
...te({ onKeyDown: de }),
|
|
93
101
|
role: "combobox",
|
|
94
102
|
"aria-haspopup": "listbox",
|
|
95
|
-
"aria-expanded":
|
|
96
|
-
"aria-controls":
|
|
97
|
-
"aria-labelledby":
|
|
98
|
-
"aria-label":
|
|
99
|
-
"aria-disabled":
|
|
100
|
-
disabled:
|
|
103
|
+
"aria-expanded": o,
|
|
104
|
+
"aria-controls": j,
|
|
105
|
+
"aria-labelledby": m,
|
|
106
|
+
"aria-label": m ? void 0 : p,
|
|
107
|
+
"aria-disabled": s ? !0 : void 0,
|
|
108
|
+
disabled: s,
|
|
101
109
|
onFocus: (e) => {
|
|
102
110
|
R(!0), Q?.(e);
|
|
103
111
|
},
|
|
@@ -105,15 +113,15 @@ var Ge = ({ dataTest: N, value: _, defaultValue: L, onChange: P, error: M, error
|
|
|
105
113
|
R(!1), X?.(e);
|
|
106
114
|
},
|
|
107
115
|
style: { minWidth: l && !A ? 105 : void 0 },
|
|
108
|
-
className: f("relative flex w-full items-center justify-between bg-transparent text-left text-delta-800 outline-none", A ? "h-10 min-w-0 border-0 px-0 text-base" : "h-10 rounded-lg border-0 px-3 text-base",
|
|
116
|
+
className: f("relative flex w-full items-center justify-between bg-transparent text-left text-delta-800 outline-none", A ? "h-10 min-w-0 border-0 px-0 text-base" : "h-10 rounded-lg border-0 px-3 text-base", s && "cursor-not-allowed text-delta-300", c && "pointer-events-none"),
|
|
109
117
|
children: [
|
|
110
118
|
/* @__PURE__ */ n("span", {
|
|
111
119
|
className: f("min-w-0 flex-1 truncate", !l && "text-delta-500"),
|
|
112
120
|
children: l || h ? ce : b
|
|
113
121
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ g("span", {
|
|
115
123
|
className: "flex items-center gap-1",
|
|
116
|
-
children: [T && l && !
|
|
124
|
+
children: [T && l && !s && /* @__PURE__ */ n("span", {
|
|
117
125
|
"aria-hidden": "true",
|
|
118
126
|
"data-testid": "select-clear-button",
|
|
119
127
|
className: "flex items-center justify-center rounded-full p-[2px] hover:bg-gama-100",
|
|
@@ -127,38 +135,38 @@ var Ge = ({ dataTest: N, value: _, defaultValue: L, onChange: P, error: M, error
|
|
|
127
135
|
}), /* @__PURE__ */ n(pe, {
|
|
128
136
|
width: 24,
|
|
129
137
|
height: 24,
|
|
130
|
-
className: f("shrink-0 transition-transform",
|
|
138
|
+
className: f("shrink-0 transition-transform", s ? "text-delta-300" : "text-delta-700", o && "rotate-180")
|
|
131
139
|
})]
|
|
132
140
|
}),
|
|
133
141
|
!A && /* @__PURE__ */ n("div", { className: we({
|
|
134
|
-
focused:
|
|
135
|
-
error:
|
|
136
|
-
disabled:
|
|
137
|
-
readOnly:
|
|
142
|
+
focused: o || v,
|
|
143
|
+
error: I,
|
|
144
|
+
disabled: s,
|
|
145
|
+
readOnly: c
|
|
138
146
|
}) })
|
|
139
147
|
]
|
|
140
148
|
}),
|
|
141
|
-
|
|
149
|
+
o && /* @__PURE__ */ n(Fe, {
|
|
142
150
|
root: ne,
|
|
143
151
|
children: /* @__PURE__ */ n("ul", {
|
|
144
152
|
ref: se,
|
|
145
|
-
id:
|
|
153
|
+
id: j,
|
|
146
154
|
role: "listbox",
|
|
147
|
-
"aria-labelledby":
|
|
148
|
-
"aria-label":
|
|
149
|
-
...
|
|
155
|
+
"aria-labelledby": m,
|
|
156
|
+
"aria-label": m ? void 0 : p,
|
|
157
|
+
...ye,
|
|
150
158
|
style: {
|
|
151
|
-
...
|
|
159
|
+
...ge,
|
|
152
160
|
...ee,
|
|
153
161
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif"
|
|
154
162
|
},
|
|
155
163
|
...re(),
|
|
156
|
-
onKeyDown:
|
|
164
|
+
onKeyDown: ue,
|
|
157
165
|
className: f("z-[1300] m-0 max-h-72 list-none overflow-auto rounded-lg border border-solid border-delta-300 bg-white px-0 py-1 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", J?.className),
|
|
158
166
|
children: ae
|
|
159
167
|
})
|
|
160
168
|
}),
|
|
161
|
-
|
|
169
|
+
I && /* @__PURE__ */ g(ve, {
|
|
162
170
|
className: "m-0 flex items-center gap-1 pt-1 text-sm text-error-500",
|
|
163
171
|
children: [/* @__PURE__ */ n(xe, {
|
|
164
172
|
width: 20,
|