@stackone/malachite 2.85.0 → 2.87.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/COMPONENTS.md +6 -5
- package/dist/components/Accordion.js +130 -103
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.js +128 -75
- package/dist/components/Card.js.map +1 -1
- package/dist/components/FilterSearch.js +228 -224
- package/dist/components/FilterSearch.js.map +1 -1
- package/dist/components/FrameHeader.js +36 -0
- package/dist/components/FrameHeader.js.map +1 -0
- package/dist/components/LoadingBar.js +5 -5
- package/dist/components/LoadingBar.js.map +1 -1
- package/dist/components/MultiSelect.js +431 -382
- package/dist/components/MultiSelect.js.map +1 -1
- package/dist/components/SplitButton.js.map +1 -1
- package/dist/components/Surface.js +211 -159
- package/dist/components/Surface.js.map +1 -1
- package/dist/components/Table/Table.js +630 -606
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
- package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
- package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
- package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
- package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
- package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
- package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
- package/dist/components/TimeBarChart/stackLayout.js +25 -0
- package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
- package/dist/components/TimeBarChart/timeBuckets.js +133 -0
- package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
- package/dist/components/TimeBarChart/tones.js +10 -0
- package/dist/components/TimeBarChart/tones.js.map +1 -0
- package/dist/components/buttonStyles.js +2 -0
- package/dist/components/buttonStyles.js.map +1 -1
- package/dist/components/dateMath.js +1 -0
- package/dist/components/dateMath.js.map +1 -1
- package/dist/components/filterSearchModel.js +53 -45
- package/dist/components/filterSearchModel.js.map +1 -1
- package/dist/components/focusRing.js +8 -7
- package/dist/components/focusRing.js.map +1 -1
- package/dist/components/frameStyles.js +14 -0
- package/dist/components/frameStyles.js.map +1 -0
- package/dist/components/headerContent.js +10 -0
- package/dist/components/headerContent.js.map +1 -0
- package/dist/index.d.ts +149 -18
- package/dist/index.js +24 -22
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +340 -340
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,82 +1,85 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
1
|
+
import { jsx as r, jsxs as E, Fragment as je } from "react/jsx-runtime";
|
|
2
|
+
import pe, { useId as Ve, useState as $, useRef as k, useMemo as W, useCallback as x, useEffect as Be, useLayoutEffect as Et, useInsertionEffect as It } from "react";
|
|
3
|
+
import { createPortal as St } from "react-dom";
|
|
4
|
+
import Tt, { useFormFieldIds as kt } from "./BaseFormComponent.js";
|
|
5
|
+
import Lt from "./CustomIcons/CaretDownIcon.js";
|
|
6
|
+
import Rt from "./CustomIcons/InfoFilledIcon.js";
|
|
7
|
+
import Ot from "./CustomIcons/SearchIcon.js";
|
|
8
|
+
import { FieldMessage as _t } from "./FieldMessage.js";
|
|
9
|
+
import { FormItem as Nt } from "./FormItem.js";
|
|
10
|
+
import Ge from "./LoadingInput.js";
|
|
11
|
+
import At from "./Spinner.js";
|
|
12
|
+
import { Tag as Mt } from "./Tag.js";
|
|
13
|
+
import ze from "./Tooltip.js";
|
|
14
|
+
import { getDeepActiveElement as Ke } from "./activeElement.js";
|
|
15
|
+
import { CONTROL_TEXT_SIZE_CLASS as me, CONTROL_TEXT_SIZE as Dt } from "./controlTextSize.js";
|
|
16
|
+
import { controlWidthStyle as Ye } from "./controlWidth.js";
|
|
17
|
+
import { getTriggerVisual as Ht, DROPDOWN_TRIGGER_ATTR as Ct } from "./dropdownTriggerStyle.js";
|
|
18
|
+
import { pushEscapeLayer as Pt } from "./escapeLayers.js";
|
|
19
|
+
import { measureMenuGeometry as Wt, MENU_MAX_HEIGHT_PX as $t, MENU_SPECS as Y } from "./floatingMenuGeometry.js";
|
|
20
|
+
import { FOCUS_RING as Bt } from "./focusRing.js";
|
|
21
|
+
import { hasBadge as Gt } from "./hasBadge.js";
|
|
22
|
+
import { ensureMultiSelectPanelStyles as zt } from "./optionRowStyles.js";
|
|
23
|
+
import { usePopupLayer as Kt } from "./overlayLayers.js";
|
|
24
|
+
import { useTopLayer as Yt } from "./topLayer.js";
|
|
25
|
+
import { useLatestRef as Ut } from "./useLatestRef.js";
|
|
26
|
+
import { tooltipLines as Ft, isCut as jt, isClamped as Vt } from "./truncatedLines.js";
|
|
27
|
+
const Xt = pe.lazy(() => import("./ActionMenuTagHost.js")), qt = {
|
|
25
28
|
padding: "8px 10px",
|
|
26
29
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
|
|
27
|
-
},
|
|
30
|
+
}, U = {
|
|
28
31
|
small: "h-[var(--malachite-control-height-small,28px)]",
|
|
29
32
|
medium: "h-[var(--malachite-control-height-medium,32px)]",
|
|
30
33
|
large: "h-[var(--malachite-control-height-large,42px)]"
|
|
31
|
-
},
|
|
32
|
-
small: `${
|
|
33
|
-
medium: `${
|
|
34
|
-
large: `${
|
|
35
|
-
},
|
|
36
|
-
({ triggerRole: n, disabled:
|
|
34
|
+
}, Zt = {
|
|
35
|
+
small: `${U.small} gap-[6px] px-2.5 ${me.small} rounded-[var(--malachite-radius-10,10px)]`,
|
|
36
|
+
medium: `${U.medium} gap-[8px] px-3 ${me.medium} rounded-xl`,
|
|
37
|
+
large: `${U.large} gap-[10px] px-4 ${me.large} rounded-[var(--malachite-radius-xxl,14px)]`
|
|
38
|
+
}, Jt = 10, Xe = "ArrowDown", qe = "ArrowUp", Ze = "Enter", Qt = "Backspace", er = /* @__PURE__ */ new Set([Xe, qe, Ze]), Je = pe.forwardRef(
|
|
39
|
+
({ triggerRole: n, disabled: y, children: I, ...s }, b) => n !== "button" ? /* @__PURE__ */ r(
|
|
37
40
|
"div",
|
|
38
41
|
{
|
|
39
42
|
ref: b,
|
|
40
43
|
role: n,
|
|
41
|
-
tabIndex:
|
|
42
|
-
...
|
|
43
|
-
children:
|
|
44
|
+
tabIndex: y ? -1 : 0,
|
|
45
|
+
...s,
|
|
46
|
+
children: I
|
|
44
47
|
}
|
|
45
48
|
) : /* @__PURE__ */ r(
|
|
46
49
|
"button",
|
|
47
50
|
{
|
|
48
51
|
ref: b,
|
|
49
52
|
type: "button",
|
|
50
|
-
disabled:
|
|
51
|
-
...
|
|
52
|
-
children:
|
|
53
|
+
disabled: y,
|
|
54
|
+
...s,
|
|
55
|
+
children: I
|
|
53
56
|
}
|
|
54
57
|
)
|
|
55
58
|
);
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
return !
|
|
61
|
-
},
|
|
62
|
-
|
|
59
|
+
Je.displayName = "TriggerElement";
|
|
60
|
+
const Ue = 0.6, Fe = 420, tr = ({ option: n }) => {
|
|
61
|
+
const y = k(null), I = k(null), s = n.description ? n.descriptionMode ?? "icon" : null, b = s === "subtitle", [L, B] = $({ label: !0, subtitle: !0 }), _ = () => {
|
|
62
|
+
const v = jt(y.current), i = Vt(I.current);
|
|
63
|
+
return !v && !i && s !== "hover" ? !1 : (B({ label: v, subtitle: i }), !0);
|
|
64
|
+
}, R = s === "hover" || b && L.subtitle, M = (v) => /* @__PURE__ */ r(
|
|
65
|
+
ze,
|
|
63
66
|
{
|
|
64
|
-
text:
|
|
65
|
-
["label",
|
|
66
|
-
["description",
|
|
67
|
+
text: Ft([
|
|
68
|
+
["label", L.label && n.label],
|
|
69
|
+
["description", R && n.description]
|
|
67
70
|
]),
|
|
68
|
-
shouldShow:
|
|
69
|
-
delay:
|
|
71
|
+
shouldShow: _,
|
|
72
|
+
delay: Ue,
|
|
70
73
|
maxWidth: Fe,
|
|
71
74
|
triggerAs: "span",
|
|
72
75
|
isShrinkable: !0,
|
|
73
|
-
describesTrigger:
|
|
74
|
-
children:
|
|
76
|
+
describesTrigger: s === "hover",
|
|
77
|
+
children: v
|
|
75
78
|
}
|
|
76
|
-
),
|
|
79
|
+
), d = /* @__PURE__ */ r(
|
|
77
80
|
"span",
|
|
78
81
|
{
|
|
79
|
-
ref:
|
|
82
|
+
ref: y,
|
|
80
83
|
style: {
|
|
81
84
|
display: "block",
|
|
82
85
|
overflow: "hidden",
|
|
@@ -86,8 +89,8 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
86
89
|
children: n.label
|
|
87
90
|
}
|
|
88
91
|
);
|
|
89
|
-
return b ?
|
|
90
|
-
/* @__PURE__ */
|
|
92
|
+
return b ? M(
|
|
93
|
+
/* @__PURE__ */ E(
|
|
91
94
|
"span",
|
|
92
95
|
{
|
|
93
96
|
style: {
|
|
@@ -99,11 +102,11 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
99
102
|
gap: 2
|
|
100
103
|
},
|
|
101
104
|
children: [
|
|
102
|
-
|
|
105
|
+
d,
|
|
103
106
|
/* @__PURE__ */ r(
|
|
104
107
|
"span",
|
|
105
108
|
{
|
|
106
|
-
ref:
|
|
109
|
+
ref: I,
|
|
107
110
|
style: {
|
|
108
111
|
fontSize: 12,
|
|
109
112
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
|
|
@@ -122,7 +125,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
122
125
|
]
|
|
123
126
|
}
|
|
124
127
|
)
|
|
125
|
-
) : /* @__PURE__ */
|
|
128
|
+
) : /* @__PURE__ */ E(
|
|
126
129
|
"span",
|
|
127
130
|
{
|
|
128
131
|
style: {
|
|
@@ -133,12 +136,12 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
133
136
|
gap: 6
|
|
134
137
|
},
|
|
135
138
|
children: [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
M(d),
|
|
140
|
+
s === "icon" && /* @__PURE__ */ r(
|
|
141
|
+
ze,
|
|
139
142
|
{
|
|
140
143
|
text: n.description,
|
|
141
|
-
delay:
|
|
144
|
+
delay: Ue,
|
|
142
145
|
maxWidth: Fe,
|
|
143
146
|
children: /* @__PURE__ */ r(
|
|
144
147
|
"span",
|
|
@@ -148,8 +151,8 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
148
151
|
color: "var(--malachite-text-placeholder, rgb(187, 187, 187))"
|
|
149
152
|
},
|
|
150
153
|
"aria-label": "More information",
|
|
151
|
-
onClick: (
|
|
152
|
-
children: n.descriptionIcon ?? /* @__PURE__ */ r(
|
|
154
|
+
onClick: (v) => v.stopPropagation(),
|
|
155
|
+
children: n.descriptionIcon ?? /* @__PURE__ */ r(Rt, { size: 14 })
|
|
153
156
|
}
|
|
154
157
|
)
|
|
155
158
|
}
|
|
@@ -157,375 +160,393 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
157
160
|
]
|
|
158
161
|
}
|
|
159
162
|
);
|
|
160
|
-
},
|
|
163
|
+
}, Qe = ({
|
|
161
164
|
options: n,
|
|
162
|
-
value:
|
|
163
|
-
defaultValue:
|
|
164
|
-
onChange:
|
|
165
|
+
value: y,
|
|
166
|
+
defaultValue: I,
|
|
167
|
+
onChange: s,
|
|
165
168
|
placeholder: b = "Select",
|
|
166
|
-
renderTrigger:
|
|
167
|
-
searchable:
|
|
168
|
-
size:
|
|
169
|
-
width:
|
|
170
|
-
minWidth:
|
|
171
|
-
disabled:
|
|
172
|
-
error:
|
|
173
|
-
loading:
|
|
174
|
-
label:
|
|
175
|
-
name:
|
|
176
|
-
description:
|
|
177
|
-
tooltip:
|
|
178
|
-
hint:
|
|
179
|
-
hintIcon:
|
|
180
|
-
rightSideContent:
|
|
181
|
-
required:
|
|
182
|
-
requiredIndicator:
|
|
183
|
-
formControl:
|
|
184
|
-
chips:
|
|
185
|
-
chipsRemovable:
|
|
186
|
-
chipsMax:
|
|
187
|
-
inlineSearch:
|
|
188
|
-
onSearchChange:
|
|
189
|
-
localFilter:
|
|
190
|
-
className:
|
|
191
|
-
style:
|
|
192
|
-
id:
|
|
193
|
-
"aria-label":
|
|
194
|
-
"aria-labelledby":
|
|
169
|
+
renderTrigger: L,
|
|
170
|
+
searchable: B,
|
|
171
|
+
size: _ = "large",
|
|
172
|
+
width: R = "auto",
|
|
173
|
+
minWidth: M,
|
|
174
|
+
disabled: d = !1,
|
|
175
|
+
error: v = !1,
|
|
176
|
+
loading: i = !1,
|
|
177
|
+
label: F,
|
|
178
|
+
name: he,
|
|
179
|
+
description: J,
|
|
180
|
+
tooltip: ge,
|
|
181
|
+
hint: Q,
|
|
182
|
+
hintIcon: et,
|
|
183
|
+
rightSideContent: be,
|
|
184
|
+
required: ee = !1,
|
|
185
|
+
requiredIndicator: tt,
|
|
186
|
+
formControl: ve,
|
|
187
|
+
chips: te = !1,
|
|
188
|
+
chipsRemovable: re = !0,
|
|
189
|
+
chipsMax: xe = "auto",
|
|
190
|
+
inlineSearch: S = !1,
|
|
191
|
+
onSearchChange: G,
|
|
192
|
+
localFilter: ye = !0,
|
|
193
|
+
className: rt = "",
|
|
194
|
+
style: nt,
|
|
195
|
+
id: ot,
|
|
196
|
+
"aria-label": we,
|
|
197
|
+
"aria-labelledby": lt,
|
|
198
|
+
errorMessageId: at,
|
|
199
|
+
onFieldLeave: st
|
|
195
200
|
}) => {
|
|
196
|
-
const
|
|
197
|
-
id:
|
|
198
|
-
label:
|
|
199
|
-
description:
|
|
200
|
-
hint:
|
|
201
|
-
}), [
|
|
202
|
-
|
|
203
|
-
const
|
|
201
|
+
const Ee = Ve(), Ie = `${Ee}-listbox`, Se = (e) => `${Ee}-option-${e}`, { controlId: Te, labelId: ke, descriptionId: it, hintId: ct, describedBy: dt } = kt({
|
|
202
|
+
id: ot,
|
|
203
|
+
label: F,
|
|
204
|
+
description: J,
|
|
205
|
+
hint: Q
|
|
206
|
+
}), [ut, ft] = $(() => I ?? []), ne = y !== void 0, h = ne ? y : ut, [a, oe] = $(!1), [m, Le] = $(null), [N, mt] = $(""), [T, C] = $(-1), j = k(null), le = k(null), D = Ut(st), z = k(null), A = k(null), Re = k(null);
|
|
207
|
+
Yt(A, a);
|
|
208
|
+
const pt = Kt("multiselect", a, A), Oe = k([]), ae = W(() => new Set(h), [h]), c = W(
|
|
204
209
|
() => n.filter((e) => ae.has(e.value)),
|
|
205
210
|
[n, ae]
|
|
206
|
-
),
|
|
207
|
-
if (!
|
|
208
|
-
const e =
|
|
211
|
+
), se = typeof xe == "number" ? xe : void 0, H = W(() => {
|
|
212
|
+
if (!ye) return n;
|
|
213
|
+
const e = N.trim().toLowerCase();
|
|
209
214
|
return e ? n.filter((t) => (t.searchText ?? (typeof t.label == "string" ? t.label : "")).toLowerCase().includes(e)) : n;
|
|
210
|
-
}, [n,
|
|
215
|
+
}, [n, N, ye]), ie = k(!1), _e = k(""), V = x(
|
|
211
216
|
(e, t) => {
|
|
212
|
-
|
|
217
|
+
_e.current !== e && (_e.current = e, t && (ie.current = !0), mt(e), G == null || G(e));
|
|
213
218
|
},
|
|
214
|
-
[
|
|
215
|
-
),
|
|
216
|
-
(e) =>
|
|
217
|
-
[
|
|
218
|
-
),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
const
|
|
223
|
-
var e, t;
|
|
224
|
-
|
|
225
|
-
}, []),
|
|
226
|
-
const e =
|
|
219
|
+
[G]
|
|
220
|
+
), ce = x(
|
|
221
|
+
(e) => V(e, !0),
|
|
222
|
+
[V]
|
|
223
|
+
), K = x(() => V("", !1), [V]);
|
|
224
|
+
Be(() => {
|
|
225
|
+
ie.current && (C(-1), ie.current = !1);
|
|
226
|
+
}, [N]);
|
|
227
|
+
const ht = B ?? (G !== void 0 || n.length > Jt), Ne = S ? !1 : ht, de = x(() => {
|
|
228
|
+
var e, t, o, u;
|
|
229
|
+
oe(!1), (e = A.current) != null && e.contains(Ke()) && ((t = j.current) == null || t.focus()), (o = le.current) != null && o.contains(Ke()) || (u = D.current) == null || u.call(D);
|
|
230
|
+
}, [D]), P = x(() => {
|
|
231
|
+
const e = j.current;
|
|
227
232
|
if (!e) return;
|
|
228
|
-
const t =
|
|
233
|
+
const t = Wt(A.current, {
|
|
229
234
|
triggerRect: e.getBoundingClientRect(),
|
|
230
235
|
preset: "standard",
|
|
231
|
-
minWidth:
|
|
236
|
+
minWidth: M,
|
|
232
237
|
viewportWidth: window.innerWidth,
|
|
233
238
|
viewportHeight: window.innerHeight
|
|
234
239
|
});
|
|
235
|
-
|
|
236
|
-
}, [
|
|
237
|
-
|
|
238
|
-
var
|
|
239
|
-
if (!
|
|
240
|
-
|
|
240
|
+
Le(t);
|
|
241
|
+
}, [M]);
|
|
242
|
+
Be(() => {
|
|
243
|
+
var u;
|
|
244
|
+
if (!a) {
|
|
245
|
+
K(), C(-1), Le(null);
|
|
241
246
|
return;
|
|
242
247
|
}
|
|
243
|
-
|
|
244
|
-
const e = () =>
|
|
245
|
-
const
|
|
246
|
-
(!
|
|
247
|
-
},
|
|
248
|
+
P(), S && ((u = z.current) == null || u.focus());
|
|
249
|
+
const e = () => P(), t = (g) => {
|
|
250
|
+
const p = g.composedPath(), l = j.current, f = A.current;
|
|
251
|
+
(!l || !p.includes(l)) && (!f || !p.includes(f)) && de();
|
|
252
|
+
}, o = Pt(de);
|
|
248
253
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), document.addEventListener("mousedown", t), () => {
|
|
249
|
-
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("mousedown", t),
|
|
254
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("mousedown", t), o();
|
|
250
255
|
};
|
|
251
|
-
}, [
|
|
252
|
-
if (!
|
|
256
|
+
}, [a, P, S, K, de]), Et(() => {
|
|
257
|
+
if (!a)
|
|
253
258
|
return;
|
|
254
|
-
|
|
255
|
-
const e =
|
|
259
|
+
P();
|
|
260
|
+
const e = A.current;
|
|
256
261
|
if (!e || typeof ResizeObserver > "u")
|
|
257
262
|
return;
|
|
258
|
-
const t = new ResizeObserver(() =>
|
|
263
|
+
const t = new ResizeObserver(() => P());
|
|
259
264
|
return t.observe(e), () => t.disconnect();
|
|
260
|
-
}, [
|
|
261
|
-
const
|
|
265
|
+
}, [a, P]);
|
|
266
|
+
const O = x(
|
|
262
267
|
(e) => {
|
|
263
|
-
|
|
268
|
+
ne || ft(e), s == null || s(e);
|
|
264
269
|
},
|
|
265
|
-
[
|
|
266
|
-
),
|
|
270
|
+
[ne, s]
|
|
271
|
+
), X = x(
|
|
267
272
|
(e) => n.some((t) => t.value === e && t.disabled),
|
|
268
273
|
[n]
|
|
269
|
-
),
|
|
274
|
+
), ue = x(
|
|
270
275
|
(e) => {
|
|
271
|
-
|
|
276
|
+
X(e) || (h.includes(e) ? O(h.filter((t) => t !== e)) : O([...h, e]));
|
|
272
277
|
},
|
|
273
|
-
[
|
|
274
|
-
),
|
|
278
|
+
[h, O, X]
|
|
279
|
+
), q = W(() => {
|
|
275
280
|
const e = /* @__PURE__ */ new Set();
|
|
276
281
|
for (const t of n)
|
|
277
282
|
t.disabled && e.add(t.value);
|
|
278
283
|
return e;
|
|
279
|
-
}, [n]),
|
|
284
|
+
}, [n]), gt = x(
|
|
280
285
|
(e) => {
|
|
281
286
|
e.stopPropagation();
|
|
282
|
-
const t =
|
|
283
|
-
|
|
287
|
+
const t = h.filter((o) => q.has(o));
|
|
288
|
+
O(t);
|
|
284
289
|
},
|
|
285
|
-
[
|
|
286
|
-
),
|
|
290
|
+
[O, h, q]
|
|
291
|
+
), Ae = x(
|
|
287
292
|
(e, t) => {
|
|
288
|
-
t.stopPropagation(), !
|
|
293
|
+
t.stopPropagation(), !X(e) && O(h.filter((o) => o !== e));
|
|
289
294
|
},
|
|
290
|
-
[
|
|
291
|
-
),
|
|
295
|
+
[h, O, X]
|
|
296
|
+
), Z = x(
|
|
292
297
|
(e) => {
|
|
293
|
-
if (!
|
|
294
|
-
if (e.preventDefault(), e.stopPropagation(), !
|
|
295
|
-
|
|
298
|
+
if (!er.has(e.key)) return;
|
|
299
|
+
if (e.preventDefault(), e.stopPropagation(), !a) {
|
|
300
|
+
oe(!0);
|
|
296
301
|
return;
|
|
297
302
|
}
|
|
298
|
-
const t =
|
|
303
|
+
const t = H.length;
|
|
299
304
|
if (t === 0) return;
|
|
300
|
-
const
|
|
305
|
+
const o = (p) => {
|
|
301
306
|
requestAnimationFrame(() => {
|
|
302
|
-
const
|
|
303
|
-
if (!
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
top:
|
|
307
|
+
const l = Oe.current[p], f = Re.current;
|
|
308
|
+
if (!l || !f) return;
|
|
309
|
+
const w = l.offsetTop, We = w + l.offsetHeight, $e = f.scrollTop, wt = $e + f.clientHeight;
|
|
310
|
+
We > wt ? f.scrollTo({
|
|
311
|
+
top: We - f.clientHeight,
|
|
307
312
|
behavior: "smooth"
|
|
308
|
-
}) :
|
|
313
|
+
}) : w < $e && f.scrollTo({ top: w, behavior: "smooth" });
|
|
309
314
|
});
|
|
310
|
-
},
|
|
311
|
-
var
|
|
312
|
-
let
|
|
313
|
-
for (let
|
|
314
|
-
if (
|
|
315
|
-
l
|
|
315
|
+
}, u = (p) => {
|
|
316
|
+
var f;
|
|
317
|
+
let l = T;
|
|
318
|
+
for (let w = 0; w < t; w++)
|
|
319
|
+
if (l = p === 1 ? l < t - 1 ? l + 1 : 0 : l > 0 ? l - 1 : t - 1, !((f = H[l]) != null && f.disabled)) {
|
|
320
|
+
o(l), C(l);
|
|
316
321
|
return;
|
|
317
322
|
}
|
|
318
|
-
},
|
|
319
|
-
var
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
var
|
|
326
|
-
return (
|
|
323
|
+
}, g = () => {
|
|
324
|
+
var f;
|
|
325
|
+
if (T < 0 || T >= t || (f = H[T]) != null && f.disabled) return;
|
|
326
|
+
const p = H[T].value;
|
|
327
|
+
ue(p), K();
|
|
328
|
+
const l = n.findIndex((w) => w.value === p);
|
|
329
|
+
C(l >= 0 ? l : -1), o(l >= 0 ? l : 0), requestAnimationFrame(() => {
|
|
330
|
+
var w;
|
|
331
|
+
return (w = z.current) == null ? void 0 : w.focus();
|
|
327
332
|
});
|
|
328
333
|
};
|
|
329
334
|
switch (e.key) {
|
|
330
|
-
case
|
|
331
|
-
|
|
335
|
+
case Xe:
|
|
336
|
+
u(1);
|
|
332
337
|
break;
|
|
333
|
-
case
|
|
334
|
-
|
|
338
|
+
case qe:
|
|
339
|
+
u(-1);
|
|
335
340
|
break;
|
|
336
|
-
case
|
|
337
|
-
|
|
341
|
+
case Ze:
|
|
342
|
+
g();
|
|
338
343
|
break;
|
|
339
344
|
}
|
|
340
345
|
},
|
|
341
|
-
[
|
|
342
|
-
),
|
|
346
|
+
[a, H, T, ue, n, K]
|
|
347
|
+
), Me = x(
|
|
343
348
|
(e) => {
|
|
344
|
-
if (e.key ===
|
|
345
|
-
e.preventDefault(),
|
|
349
|
+
if (e.key === Qt && N === "" && h.length > 0) {
|
|
350
|
+
e.preventDefault(), O(h.slice(0, -1)), requestAnimationFrame(() => {
|
|
346
351
|
var t;
|
|
347
|
-
return (t =
|
|
352
|
+
return (t = z.current) == null ? void 0 : t.focus();
|
|
348
353
|
});
|
|
349
354
|
return;
|
|
350
355
|
}
|
|
351
|
-
|
|
356
|
+
Z(e);
|
|
352
357
|
},
|
|
353
|
-
[
|
|
354
|
-
),
|
|
355
|
-
disabled:
|
|
356
|
-
error:
|
|
357
|
-
open:
|
|
358
|
-
loading:
|
|
359
|
-
hasSelection:
|
|
360
|
-
}),
|
|
358
|
+
[Z, N, h, O]
|
|
359
|
+
), De = c.length > 0 && !d && !i, bt = Ht({
|
|
360
|
+
disabled: d,
|
|
361
|
+
error: v,
|
|
362
|
+
open: a,
|
|
363
|
+
loading: i,
|
|
364
|
+
hasSelection: c.length > 0
|
|
365
|
+
}), fe = W(() => S ? /* @__PURE__ */ r(
|
|
361
366
|
"input",
|
|
362
367
|
{
|
|
363
|
-
ref:
|
|
368
|
+
ref: z,
|
|
364
369
|
type: "text",
|
|
365
|
-
value:
|
|
366
|
-
onChange: (e) =>
|
|
367
|
-
onKeyDown:
|
|
368
|
-
disabled:
|
|
369
|
-
placeholder:
|
|
370
|
+
value: N,
|
|
371
|
+
onChange: (e) => ce(e.target.value),
|
|
372
|
+
onKeyDown: Me,
|
|
373
|
+
disabled: d || i,
|
|
374
|
+
placeholder: c.length === 0 ? b : "",
|
|
370
375
|
className: "flex-1 w-full min-w-[40px] border-none outline-none bg-transparent text-[length:inherit] p-0 text-[var(--malachite-text-primary,rgb(10,10,10))]",
|
|
371
376
|
onMouseDown: (e) => {
|
|
372
377
|
e.preventDefault();
|
|
373
378
|
}
|
|
374
379
|
}
|
|
375
380
|
) : null, [
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
S,
|
|
382
|
+
N,
|
|
383
|
+
ce,
|
|
384
|
+
Me,
|
|
385
|
+
d,
|
|
386
|
+
i,
|
|
387
|
+
c.length,
|
|
383
388
|
b
|
|
384
|
-
]),
|
|
385
|
-
if (
|
|
386
|
-
return
|
|
387
|
-
if (
|
|
388
|
-
const e =
|
|
389
|
-
return /* @__PURE__ */
|
|
389
|
+
]), vt = W(() => {
|
|
390
|
+
if (L && c.length > 0)
|
|
391
|
+
return L(c);
|
|
392
|
+
if (te && c.length > 0) {
|
|
393
|
+
const e = se != null ? c.slice(0, se) : c, t = c.length - e.length;
|
|
394
|
+
return /* @__PURE__ */ E(
|
|
390
395
|
"div",
|
|
391
396
|
{
|
|
392
397
|
className: "flex items-center gap-1 overflow-hidden min-w-0 flex-1",
|
|
393
398
|
style: { flexWrap: "nowrap" },
|
|
394
399
|
children: [
|
|
395
|
-
e.map((
|
|
396
|
-
const
|
|
400
|
+
e.map((o) => {
|
|
401
|
+
const u = q.has(o.value);
|
|
397
402
|
return /* @__PURE__ */ r(
|
|
398
|
-
|
|
403
|
+
Mt,
|
|
399
404
|
{
|
|
400
|
-
value:
|
|
405
|
+
value: o.label,
|
|
401
406
|
type: "default",
|
|
402
407
|
textTransform: "none",
|
|
403
|
-
onRemove:
|
|
408
|
+
onRemove: re && !d && !u ? (g) => Ae(o.value, g) : void 0,
|
|
404
409
|
className: "shrink-0"
|
|
405
410
|
},
|
|
406
|
-
|
|
411
|
+
o.value
|
|
407
412
|
);
|
|
408
413
|
}),
|
|
409
|
-
t > 0 && /* @__PURE__ */
|
|
414
|
+
t > 0 && /* @__PURE__ */ E("span", { className: "shrink-0 text-xs text-[var(--malachite-text-secondary,rgb(123,123,123))]", children: [
|
|
410
415
|
"+",
|
|
411
416
|
t
|
|
412
417
|
] }),
|
|
413
|
-
|
|
418
|
+
fe
|
|
414
419
|
]
|
|
415
420
|
}
|
|
416
421
|
);
|
|
417
422
|
}
|
|
418
|
-
return
|
|
423
|
+
return S && c.length === 0 ? fe : c.length === 0 ? /* @__PURE__ */ r("span", { className: "text-[var(--malachite-text-placeholder)]", children: b }) : c.length === 1 ? /* @__PURE__ */ r("span", { children: c[0].label }) : /* @__PURE__ */ r("span", { children: `${c.length} selected` });
|
|
419
424
|
}, [
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
ee,
|
|
423
|
-
oe,
|
|
425
|
+
c,
|
|
426
|
+
L,
|
|
424
427
|
te,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
428
|
+
se,
|
|
429
|
+
re,
|
|
430
|
+
d,
|
|
431
|
+
Ae,
|
|
432
|
+
S,
|
|
433
|
+
fe,
|
|
429
434
|
b,
|
|
430
|
-
|
|
431
|
-
]),
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}, [
|
|
435
|
-
const
|
|
435
|
+
q
|
|
436
|
+
]), xt = n.length === 0 ? "No options available" : "No results found";
|
|
437
|
+
It(() => {
|
|
438
|
+
a && zt();
|
|
439
|
+
}, [a]);
|
|
440
|
+
const yt = {
|
|
436
441
|
position: "fixed",
|
|
437
|
-
top: (
|
|
438
|
-
left: (
|
|
439
|
-
width:
|
|
440
|
-
background:
|
|
441
|
-
border:
|
|
442
|
-
borderRadius:
|
|
443
|
-
boxShadow:
|
|
444
|
-
padding:
|
|
442
|
+
top: (m == null ? void 0 : m.top) ?? 0,
|
|
443
|
+
left: (m == null ? void 0 : m.left) ?? 0,
|
|
444
|
+
width: m == null ? void 0 : m.width,
|
|
445
|
+
background: Y.standard.background,
|
|
446
|
+
border: Y.standard.border,
|
|
447
|
+
borderRadius: Y.standard.radius,
|
|
448
|
+
boxShadow: Y.standard.shadow,
|
|
449
|
+
padding: Y.standard.padding,
|
|
445
450
|
display: "flex",
|
|
446
451
|
flexDirection: "column",
|
|
447
452
|
gap: 4,
|
|
448
|
-
maxHeight: (
|
|
449
|
-
fontSize:
|
|
450
|
-
visibility:
|
|
451
|
-
opacity:
|
|
452
|
-
},
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
"
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
453
|
+
maxHeight: (m == null ? void 0 : m.maxHeight) ?? $t,
|
|
454
|
+
fontSize: Dt[_],
|
|
455
|
+
visibility: m ? "visible" : "hidden",
|
|
456
|
+
opacity: m ? 1 : 0
|
|
457
|
+
}, He = !!(J || ge || Q || be || he || ve || ee), Ce = He && !!F, Pe = /* @__PURE__ */ E(je, { children: [
|
|
458
|
+
/* @__PURE__ */ E(
|
|
459
|
+
"div",
|
|
460
|
+
{
|
|
461
|
+
ref: le,
|
|
462
|
+
className: "relative",
|
|
463
|
+
style: Ye(R),
|
|
464
|
+
onBlur: (e) => {
|
|
465
|
+
var o;
|
|
466
|
+
const t = e.relatedTarget;
|
|
467
|
+
t && ((o = le.current) != null && o.contains(t)) || queueMicrotask(() => {
|
|
468
|
+
var u, g;
|
|
469
|
+
t && ((u = A.current) != null && u.contains(t)) || (g = D.current) == null || g.call(D);
|
|
470
|
+
});
|
|
471
|
+
},
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ E(
|
|
474
|
+
Je,
|
|
475
|
+
{
|
|
476
|
+
ref: j,
|
|
477
|
+
id: Te,
|
|
478
|
+
triggerRole: S ? "combobox" : te && re ? "group" : "button",
|
|
479
|
+
disabled: d || i,
|
|
480
|
+
[Ct]: "",
|
|
481
|
+
"data-open": a || void 0,
|
|
482
|
+
"aria-haspopup": "listbox",
|
|
483
|
+
"aria-expanded": a,
|
|
484
|
+
"aria-controls": a ? Ie : void 0,
|
|
485
|
+
"aria-activedescendant": S && a && T >= 0 ? Se(T) : void 0,
|
|
486
|
+
"aria-labelledby": lt ?? (Ce && !we ? ke : void 0),
|
|
487
|
+
"aria-label": we ?? (Ce ? void 0 : F),
|
|
488
|
+
"aria-invalid": v || void 0,
|
|
489
|
+
"aria-required": ee || void 0,
|
|
490
|
+
"aria-describedby": [dt, at].filter(Boolean).join(" ") || void 0,
|
|
491
|
+
"aria-busy": i || void 0,
|
|
492
|
+
onClick: () => {
|
|
493
|
+
d || i || oe((e) => !e);
|
|
494
|
+
},
|
|
495
|
+
onKeyDown: Z,
|
|
496
|
+
style: {
|
|
497
|
+
transition: "border-color 0.15s ease, box-shadow 0.15s ease",
|
|
498
|
+
...bt,
|
|
499
|
+
...nt
|
|
500
|
+
},
|
|
501
|
+
className: `w-full ${Zt[_]} border border-solid flex items-center font-normal text-[var(--malachite-text-primary)] ${d || i ? "cursor-not-allowed" : "cursor-pointer"} ${Bt} ${rt}`,
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ r(
|
|
504
|
+
"span",
|
|
505
|
+
{
|
|
506
|
+
className: `flex-1 min-w-0 text-left ${S ? "flex" : "truncate"} ${De ? "pr-[18px]" : ""}`,
|
|
507
|
+
children: vt
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
i ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center shrink-0 size-[14px]", children: /* @__PURE__ */ r(At, { size: "xxxsmall" }) }) : /* @__PURE__ */ r(
|
|
511
|
+
Lt,
|
|
512
|
+
{
|
|
513
|
+
size: 13,
|
|
514
|
+
className: "shrink-0",
|
|
515
|
+
style: {
|
|
516
|
+
color: a ? "var(--malachite-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-placeholder, rgb(187, 187, 187))",
|
|
517
|
+
transition: "transform 0.2s ease, color 0.2s ease",
|
|
518
|
+
transform: a ? "rotate(180deg)" : "rotate(0deg)"
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
De && /* @__PURE__ */ r(
|
|
526
|
+
"button",
|
|
527
|
+
{
|
|
528
|
+
type: "button",
|
|
529
|
+
"aria-label": "Clear selection",
|
|
530
|
+
onClick: gt,
|
|
531
|
+
className: "absolute top-0 bottom-0 right-[28px] flex items-center justify-center px-[2px] leading-none bg-transparent border-none text-[var(--malachite-text-placeholder)] hover:text-[var(--malachite-text-primary)] cursor-pointer",
|
|
532
|
+
children: "×"
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
]
|
|
536
|
+
}
|
|
537
|
+
),
|
|
538
|
+
a && St(
|
|
539
|
+
/* @__PURE__ */ E(
|
|
519
540
|
"div",
|
|
520
541
|
{
|
|
521
|
-
ref:
|
|
522
|
-
id:
|
|
542
|
+
ref: A,
|
|
543
|
+
id: Ie,
|
|
523
544
|
role: "listbox",
|
|
524
545
|
"aria-multiselectable": "true",
|
|
525
|
-
...
|
|
526
|
-
style:
|
|
546
|
+
...pt,
|
|
547
|
+
style: yt,
|
|
527
548
|
children: [
|
|
528
|
-
|
|
549
|
+
Ne && /* @__PURE__ */ E(
|
|
529
550
|
"div",
|
|
530
551
|
{
|
|
531
552
|
style: {
|
|
@@ -540,7 +561,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
540
561
|
},
|
|
541
562
|
children: [
|
|
542
563
|
/* @__PURE__ */ r(
|
|
543
|
-
|
|
564
|
+
Ot,
|
|
544
565
|
{
|
|
545
566
|
size: 13,
|
|
546
567
|
style: {
|
|
@@ -553,9 +574,9 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
553
574
|
"input",
|
|
554
575
|
{
|
|
555
576
|
type: "text",
|
|
556
|
-
value:
|
|
557
|
-
onChange: (e) =>
|
|
558
|
-
onKeyDown:
|
|
577
|
+
value: N,
|
|
578
|
+
onChange: (e) => ce(e.target.value),
|
|
579
|
+
onKeyDown: Z,
|
|
559
580
|
placeholder: "Search",
|
|
560
581
|
"aria-label": "Search options",
|
|
561
582
|
autoFocus: !0,
|
|
@@ -573,7 +594,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
573
594
|
]
|
|
574
595
|
}
|
|
575
596
|
),
|
|
576
|
-
|
|
597
|
+
Ne && /* @__PURE__ */ r(
|
|
577
598
|
"div",
|
|
578
599
|
{
|
|
579
600
|
"aria-hidden": "true",
|
|
@@ -588,7 +609,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
588
609
|
/* @__PURE__ */ r(
|
|
589
610
|
"div",
|
|
590
611
|
{
|
|
591
|
-
ref:
|
|
612
|
+
ref: Re,
|
|
592
613
|
style: {
|
|
593
614
|
display: "flex",
|
|
594
615
|
flexDirection: "column",
|
|
@@ -600,34 +621,34 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
600
621
|
scrollbarWidth: "thin",
|
|
601
622
|
scrollbarColor: "var(--malachite-text-placeholder, rgb(187, 187, 187)) transparent"
|
|
602
623
|
},
|
|
603
|
-
children:
|
|
624
|
+
children: H.length === 0 ? (
|
|
604
625
|
// `role="listbox"` admits only option/group children.
|
|
605
|
-
/* @__PURE__ */ r("div", { role: "presentation", style:
|
|
606
|
-
) :
|
|
607
|
-
const
|
|
608
|
-
return /* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ r("div", { role: "presentation", style: qt, children: xt })
|
|
627
|
+
) : H.map((e, t) => {
|
|
628
|
+
const o = ae.has(e.value), u = t === T, g = !!e.disabled;
|
|
629
|
+
return /* @__PURE__ */ E(
|
|
609
630
|
"button",
|
|
610
631
|
{
|
|
611
|
-
id:
|
|
612
|
-
ref: (
|
|
613
|
-
|
|
632
|
+
id: Se(t),
|
|
633
|
+
ref: (p) => {
|
|
634
|
+
Oe.current[t] = p;
|
|
614
635
|
},
|
|
615
636
|
type: "button",
|
|
616
637
|
role: "option",
|
|
617
|
-
"aria-selected":
|
|
618
|
-
"aria-disabled":
|
|
638
|
+
"aria-selected": o,
|
|
639
|
+
"aria-disabled": g || void 0,
|
|
619
640
|
onClick: () => {
|
|
620
|
-
var
|
|
621
|
-
|
|
641
|
+
var p;
|
|
642
|
+
ue(e.value), K(), (p = z.current) == null || p.focus();
|
|
622
643
|
},
|
|
623
|
-
onMouseEnter: () =>
|
|
644
|
+
onMouseEnter: () => C(t),
|
|
624
645
|
onMouseLeave: () => {
|
|
625
|
-
|
|
646
|
+
T === t && C(-1);
|
|
626
647
|
},
|
|
627
648
|
className: "malachite-multiselect-option",
|
|
628
|
-
"data-checked":
|
|
629
|
-
"data-highlighted":
|
|
630
|
-
"data-disabled":
|
|
649
|
+
"data-checked": o,
|
|
650
|
+
"data-highlighted": u,
|
|
651
|
+
"data-disabled": g,
|
|
631
652
|
style: {
|
|
632
653
|
display: "flex",
|
|
633
654
|
alignItems: "center",
|
|
@@ -639,13 +660,13 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
639
660
|
borderRadius: 8,
|
|
640
661
|
padding: "8px 10px",
|
|
641
662
|
font: "inherit",
|
|
642
|
-
cursor:
|
|
643
|
-
opacity:
|
|
644
|
-
color:
|
|
663
|
+
cursor: g ? "not-allowed" : "pointer",
|
|
664
|
+
opacity: g ? 0.6 : 1,
|
|
665
|
+
color: o ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))"
|
|
645
666
|
},
|
|
646
667
|
children: [
|
|
647
|
-
/* @__PURE__ */ r(
|
|
648
|
-
|
|
668
|
+
/* @__PURE__ */ r(tr, { option: e }),
|
|
669
|
+
Gt(e.badge) && /* @__PURE__ */ r(
|
|
649
670
|
"span",
|
|
650
671
|
{
|
|
651
672
|
style: {
|
|
@@ -653,7 +674,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
653
674
|
flexShrink: 0,
|
|
654
675
|
paddingLeft: 8
|
|
655
676
|
},
|
|
656
|
-
children: /* @__PURE__ */ r(
|
|
677
|
+
children: /* @__PURE__ */ r(pe.Suspense, { fallback: null, children: /* @__PURE__ */ r(Xt, { children: e.badge }) })
|
|
657
678
|
}
|
|
658
679
|
)
|
|
659
680
|
]
|
|
@@ -669,30 +690,58 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
|
|
|
669
690
|
document.body
|
|
670
691
|
)
|
|
671
692
|
] });
|
|
672
|
-
return
|
|
673
|
-
|
|
693
|
+
return He ? /* @__PURE__ */ r(
|
|
694
|
+
Tt,
|
|
674
695
|
{
|
|
675
|
-
label:
|
|
676
|
-
hint:
|
|
677
|
-
hintIcon:
|
|
678
|
-
rightSideContent:
|
|
679
|
-
tooltip:
|
|
680
|
-
name:
|
|
681
|
-
required:
|
|
682
|
-
requiredIndicator:
|
|
683
|
-
loading:
|
|
684
|
-
formControl:
|
|
685
|
-
description:
|
|
686
|
-
controlId:
|
|
687
|
-
labelId:
|
|
688
|
-
descriptionId:
|
|
689
|
-
hintId:
|
|
690
|
-
loadingComponent:
|
|
691
|
-
children:
|
|
696
|
+
label: F,
|
|
697
|
+
hint: Q,
|
|
698
|
+
hintIcon: et,
|
|
699
|
+
rightSideContent: be,
|
|
700
|
+
tooltip: ge,
|
|
701
|
+
name: he ?? "",
|
|
702
|
+
required: ee,
|
|
703
|
+
requiredIndicator: tt,
|
|
704
|
+
loading: i,
|
|
705
|
+
formControl: ve,
|
|
706
|
+
description: J,
|
|
707
|
+
controlId: Te,
|
|
708
|
+
labelId: ke,
|
|
709
|
+
descriptionId: it,
|
|
710
|
+
hintId: ct,
|
|
711
|
+
loadingComponent: R === void 0 ? /* @__PURE__ */ r(Ge, { heightClass: U[_] }) : /* @__PURE__ */ r("div", { style: Ye(R), children: /* @__PURE__ */ r(Ge, { heightClass: U[_] }) }),
|
|
712
|
+
children: Pe
|
|
692
713
|
}
|
|
693
|
-
) :
|
|
694
|
-
}
|
|
714
|
+
) : Pe;
|
|
715
|
+
}, rr = ({
|
|
716
|
+
formControl: n,
|
|
717
|
+
name: y,
|
|
718
|
+
error: I,
|
|
719
|
+
onChange: s,
|
|
720
|
+
...b
|
|
721
|
+
}) => {
|
|
722
|
+
const L = `${Ve()}-error`;
|
|
723
|
+
return /* @__PURE__ */ r(Nt, { control: n, name: y, children: ({ error: B, message: _, onFieldChange: R, onFieldBlur: M, value: d }) => {
|
|
724
|
+
const v = I === !1 ? void 0 : _;
|
|
725
|
+
return /* @__PURE__ */ E(je, { children: [
|
|
726
|
+
/* @__PURE__ */ r(
|
|
727
|
+
Qe,
|
|
728
|
+
{
|
|
729
|
+
...b,
|
|
730
|
+
name: y,
|
|
731
|
+
value: Array.isArray(d) ? d : [],
|
|
732
|
+
error: I ?? B,
|
|
733
|
+
errorMessageId: v ? L : void 0,
|
|
734
|
+
onFieldLeave: M,
|
|
735
|
+
onChange: (i) => {
|
|
736
|
+
R == null || R(i), s == null || s(i);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
),
|
|
740
|
+
/* @__PURE__ */ r(_t, { id: L, message: v, spaced: !0 })
|
|
741
|
+
] });
|
|
742
|
+
} });
|
|
743
|
+
}, Or = (n) => n.formControl ? /* @__PURE__ */ r(rr, { ...n }) : /* @__PURE__ */ r(Qe, { ...n });
|
|
695
744
|
export {
|
|
696
|
-
|
|
745
|
+
Or as default
|
|
697
746
|
};
|
|
698
747
|
//# sourceMappingURL=MultiSelect.js.map
|