@fluidattacks/design 10.0.1 → 10.2.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/components/card/card-with-input/index.js +3 -2
- package/dist/components/filters/filters-menu/index.js +24 -23
- package/dist/components/filters/options-menu/options/index.js +38 -37
- package/dist/components/filters/utils.js +22 -22
- package/dist/components/form/index.js +26 -26
- package/dist/components/form/styles.d.ts +6 -1
- package/dist/components/form/styles.js +14 -3
- package/dist/components/inputs/fields/combobox/field/index.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/field/index.js +115 -112
- package/dist/components/inputs/fields/combobox/index.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/index.js +34 -31
- package/dist/components/inputs/fields/combobox/index.stories.d.ts +4 -1
- package/dist/components/inputs/fields/combobox/option/index.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/option/index.js +79 -68
- package/dist/components/inputs/fields/combobox/styles.js +10 -3
- package/dist/components/inputs/fields/combobox/types.d.ts +5 -0
- package/dist/components/inputs/fields/combobox/utils.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/utils.js +10 -10
- package/dist/components/list-item/styles.js +2 -0
- package/dist/components/loading/index.js +11 -11
- package/dist/components/loading/index.stories.d.ts +2 -1
- package/dist/components/modal/index.stories.d.ts +6 -2
- package/dist/components/modal/modal-confirm/index.d.ts +1 -1
- package/dist/components/modal/modal-confirm/index.js +34 -20
- package/dist/components/modal/types.d.ts +2 -0
- package/dist/components/slider/index.js +3 -2
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsx as r, jsxs as G } from "react/jsx-runtime";
|
|
2
|
-
import { useVirtualizer as
|
|
2
|
+
import { useVirtualizer as Je } from "../../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
3
3
|
import { useState as g, useMemo as $, useRef as y, useCallback as v } from "react";
|
|
4
|
-
import { useButton as
|
|
5
|
-
import { useComboBox as
|
|
6
|
-
import { useFilter as
|
|
7
|
-
import { useListBox as
|
|
8
|
-
import { useComboBoxState as
|
|
9
|
-
import { Item as
|
|
10
|
-
import { useTheme as
|
|
11
|
-
import { OutlineContainer as
|
|
12
|
-
import { StyledTextInputContainer as
|
|
13
|
-
import { Popover as
|
|
14
|
-
import { Option as
|
|
15
|
-
import { StyledStatusMessage as
|
|
16
|
-
import { describeSelection as
|
|
4
|
+
import { useButton as Pe } from "../../../../../node_modules/react-aria/dist/private/button/useButton.js";
|
|
5
|
+
import { useComboBox as Qe } from "../../../../../node_modules/react-aria/dist/private/combobox/useComboBox.js";
|
|
6
|
+
import { useFilter as Xe } from "../../../../../node_modules/react-aria/dist/private/i18n/useFilter.js";
|
|
7
|
+
import { useListBox as Ze } from "../../../../../node_modules/react-aria/dist/private/listbox/useListBox.js";
|
|
8
|
+
import { useComboBoxState as _e } from "../../../../../node_modules/react-stately/dist/private/combobox/useComboBoxState.js";
|
|
9
|
+
import { Item as eo } from "../../../../../node_modules/react-stately/dist/private/collections/Item.js";
|
|
10
|
+
import { useTheme as oo } from "styled-components";
|
|
11
|
+
import { OutlineContainer as to } from "../../../outline-container/index.js";
|
|
12
|
+
import { StyledTextInputContainer as ro } from "../../../styles.js";
|
|
13
|
+
import { Popover as ye } from "../../../utils/popover/index.js";
|
|
14
|
+
import { Option as no } from "../option/index.js";
|
|
15
|
+
import { StyledStatusMessage as so, ChevronIconButton as lo, StyledDropdown as ve, StyledGroupHeader as ao, StyledEmptyMessage as co } from "../styles.js";
|
|
16
|
+
import { describeSelection as io, toSelection as xe } from "../utils.js";
|
|
17
17
|
import { Icon as J } from "../../../../icon/index.js";
|
|
18
|
-
import { IconButton as
|
|
18
|
+
import { IconButton as po } from "../../../../icon-button/index.js";
|
|
19
19
|
import "../../../../typography/heading/index.js";
|
|
20
20
|
import "../../../../typography/span/index.js";
|
|
21
21
|
import { Text as P } from "../../../../typography/text/index.js";
|
|
22
|
-
import { useClickOutside as
|
|
23
|
-
const
|
|
22
|
+
import { useClickOutside as uo } from "../../../../../hooks/use-click-outside.js";
|
|
23
|
+
const Mo = ({
|
|
24
24
|
field: i,
|
|
25
25
|
disabled: h = !1,
|
|
26
26
|
disabledKeys: b,
|
|
27
|
-
error:
|
|
28
|
-
helpLink:
|
|
29
|
-
helpLinkText:
|
|
30
|
-
helpText:
|
|
27
|
+
error: $e,
|
|
28
|
+
helpLink: be,
|
|
29
|
+
helpLinkText: we,
|
|
30
|
+
helpText: Se,
|
|
31
31
|
label: Q,
|
|
32
32
|
loadingItems: X,
|
|
33
33
|
name: l,
|
|
@@ -36,30 +36,32 @@ const ko = ({
|
|
|
36
36
|
onBlur: j,
|
|
37
37
|
onChange: d,
|
|
38
38
|
onClear: Z,
|
|
39
|
-
placeholder:
|
|
40
|
-
clearable:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
placeholder: Be,
|
|
40
|
+
clearable: Ce = !1,
|
|
41
|
+
countLabel: _,
|
|
42
|
+
emptyMessage: ee,
|
|
43
|
+
statusMessage: oe,
|
|
44
|
+
required: Ae,
|
|
44
45
|
setValue: w,
|
|
45
|
-
tooltip:
|
|
46
|
-
value:
|
|
46
|
+
tooltip: Oe,
|
|
47
|
+
value: ze,
|
|
47
48
|
watch: S,
|
|
48
|
-
weight:
|
|
49
|
+
weight: Re
|
|
49
50
|
}) => {
|
|
50
|
-
const m =
|
|
51
|
-
|
|
51
|
+
const m = oo(), k = h ? void 0 : $e, a = i?.value ?? ze, [M, x] = g(() => t ? io(
|
|
52
|
+
xe(S?.(`${l}Options`)),
|
|
52
53
|
o.map((e) => e.value),
|
|
53
54
|
b ?? [],
|
|
54
|
-
o.find((e) => e.value === "All")?.name
|
|
55
|
-
|
|
55
|
+
o.find((e) => e.value === "All")?.name,
|
|
56
|
+
_
|
|
57
|
+
).text : o.find((e) => e.value === a)?.name ?? ""), [te, B] = g(a), H = (X === !1 || !a) && !t, C = $(
|
|
56
58
|
() => H ? o.find((e) => e.value === a)?.name ?? "" : "",
|
|
57
59
|
[H, a, o]
|
|
58
|
-
), [
|
|
59
|
-
a !==
|
|
60
|
+
), [Ie, Fe] = g(a), [De, re] = g(C), [Ge, N] = g(a);
|
|
61
|
+
a !== Ie ? (Fe(a), re(C), !t && (X !== !0 || !a) && a !== Ge && (N(a), x(
|
|
60
62
|
o.find((e) => e.value === a)?.name ?? ""
|
|
61
|
-
), B(a ?? ""))) : H && C !==
|
|
62
|
-
const [
|
|
63
|
+
), B(a ?? ""))) : H && C !== De && (re(C), x(C), B(a ?? ""));
|
|
64
|
+
const [ke, U] = g(o), [ne, A] = g(!1), { contains: V } = Xe({ sensitivity: "base" }), W = y(null), Y = y(null), O = y(null), z = y(null), se = y(null), R = y(null), q = y(/* @__PURE__ */ new Set()), Me = $(() => {
|
|
63
65
|
const e = q.current, s = Array.from(b ?? []), p = o.some((n) => n.group !== void 0);
|
|
64
66
|
return o.toSorted((n, f) => {
|
|
65
67
|
if (n.value === "All") return -1;
|
|
@@ -74,9 +76,9 @@ const ko = ({
|
|
|
74
76
|
if (K && !L) return 1;
|
|
75
77
|
if (!K && L) return -1;
|
|
76
78
|
if (t) {
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
if (!
|
|
79
|
+
const me = e.has(n.value), ge = e.has(f.value);
|
|
80
|
+
if (me && !ge) return -1;
|
|
81
|
+
if (!me && ge) return 1;
|
|
80
82
|
}
|
|
81
83
|
return n.name.localeCompare(f.name);
|
|
82
84
|
}
|
|
@@ -88,8 +90,8 @@ const ko = ({
|
|
|
88
90
|
}
|
|
89
91
|
return 0;
|
|
90
92
|
}).map(
|
|
91
|
-
(n) => V(n.name, M) ||
|
|
92
|
-
|
|
93
|
+
(n) => V(n.name, M) || ne ? /* @__PURE__ */ r(
|
|
94
|
+
eo,
|
|
93
95
|
{
|
|
94
96
|
"aria-label": n.value,
|
|
95
97
|
hrefLang: n.href,
|
|
@@ -99,7 +101,7 @@ const ko = ({
|
|
|
99
101
|
n.value
|
|
100
102
|
) : null
|
|
101
103
|
);
|
|
102
|
-
}, [V, b, M, o, t,
|
|
104
|
+
}, [V, b, M, o, t, ne]), Ne = v(
|
|
103
105
|
(e) => {
|
|
104
106
|
const s = e.split(/,|\s/u).slice(-1)[0].trim();
|
|
105
107
|
x(t ? s : e), e === "" || e.endsWith(",") ? A(!0) : (A(!1), i || N(e), B((p) => {
|
|
@@ -112,45 +114,45 @@ const ko = ({
|
|
|
112
114
|
));
|
|
113
115
|
},
|
|
114
116
|
[V, o, i, t, d]
|
|
115
|
-
),
|
|
117
|
+
), Ve = v(
|
|
116
118
|
(e) => {
|
|
117
119
|
x(o.find((s) => s.value === e)?.name ?? ""), B(e ? String(e) : ""), N(i ? e : String(e ?? "")), i && i.onChange(e), d && d(e ? String(e) : ""), U(o);
|
|
118
120
|
},
|
|
119
121
|
[o, i, d]
|
|
120
|
-
),
|
|
122
|
+
), le = v(
|
|
121
123
|
(e) => {
|
|
122
124
|
e.key === "Enter" && e.preventDefault(), A(!1);
|
|
123
125
|
},
|
|
124
126
|
[]
|
|
125
|
-
),
|
|
127
|
+
), Te = v(() => {
|
|
126
128
|
j && j(), i && i.onBlur();
|
|
127
|
-
}, [i, j]),
|
|
129
|
+
}, [i, j]), Ee = v(() => {
|
|
128
130
|
A(!0);
|
|
129
|
-
}, []), c =
|
|
131
|
+
}, []), c = _e({
|
|
130
132
|
allowsCustomValue: t,
|
|
131
133
|
allowsEmptyCollection: !0,
|
|
132
134
|
disabledKeys: b,
|
|
133
135
|
inputValue: M,
|
|
134
|
-
items:
|
|
136
|
+
items: ke,
|
|
135
137
|
menuTrigger: "focus",
|
|
136
138
|
shouldCloseOnBlur: !t,
|
|
137
|
-
selectedKey:
|
|
138
|
-
onBlur:
|
|
139
|
-
onInputChange:
|
|
140
|
-
onKeyDown:
|
|
141
|
-
onKeyUp:
|
|
139
|
+
selectedKey: te,
|
|
140
|
+
onBlur: Te,
|
|
141
|
+
onInputChange: Ne,
|
|
142
|
+
onKeyDown: le,
|
|
143
|
+
onKeyUp: Ee,
|
|
142
144
|
onOpenChange(e, s) {
|
|
143
145
|
e && t && S && (q.current = new Set(
|
|
144
|
-
|
|
146
|
+
xe(S(`${l}Options`)).filter(Boolean)
|
|
145
147
|
)), A(
|
|
146
148
|
e && (s === "manual" || s === "focus")
|
|
147
149
|
), e && s !== "focus" && requestAnimationFrame(() => {
|
|
148
150
|
W.current?.focus();
|
|
149
151
|
});
|
|
150
152
|
},
|
|
151
|
-
onSelectionChange: t ? void 0 :
|
|
152
|
-
children:
|
|
153
|
-
}),
|
|
153
|
+
onSelectionChange: t ? void 0 : Ve,
|
|
154
|
+
children: Me
|
|
155
|
+
}), Ke = v(() => {
|
|
154
156
|
x(""), B(null), U(o), c.setSelectedKey(null), c.setInputValue(""), i || N(""), d && d(""), t && w && (w(`${l}Options`, []), w(`${l}CheckAll`, "")), Z?.();
|
|
155
157
|
}, [
|
|
156
158
|
i,
|
|
@@ -162,10 +164,10 @@ const ko = ({
|
|
|
162
164
|
w,
|
|
163
165
|
c
|
|
164
166
|
]), {
|
|
165
|
-
buttonProps:
|
|
166
|
-
inputProps:
|
|
167
|
-
listBoxProps:
|
|
168
|
-
} =
|
|
167
|
+
buttonProps: Le,
|
|
168
|
+
inputProps: je,
|
|
169
|
+
listBoxProps: He
|
|
170
|
+
} = Qe(
|
|
169
171
|
{
|
|
170
172
|
inputValue: M,
|
|
171
173
|
buttonRef: Y,
|
|
@@ -174,70 +176,70 @@ const ko = ({
|
|
|
174
176
|
label: Q ?? l,
|
|
175
177
|
listBoxRef: O,
|
|
176
178
|
name: l,
|
|
177
|
-
placeholder:
|
|
179
|
+
placeholder: Be,
|
|
178
180
|
popoverRef: R
|
|
179
181
|
},
|
|
180
182
|
c
|
|
181
|
-
), { listBoxProps:
|
|
183
|
+
), { listBoxProps: ae } = Ze(He, c, O), { buttonProps: Ue } = Pe(Le, Y), { width: ce } = z.current?.getBoundingClientRect() ?? {
|
|
182
184
|
width: 240
|
|
183
185
|
};
|
|
184
|
-
|
|
186
|
+
uo(z, () => {
|
|
185
187
|
c.isOpen && !t && c.close();
|
|
186
188
|
}, [R]);
|
|
187
|
-
const I = Array.from(c.collection),
|
|
189
|
+
const I = Array.from(c.collection), ie = t ? I.findLastIndex(
|
|
188
190
|
(e) => e.key === "All" || q.current.has(String(e.key))
|
|
189
|
-
) : -1,
|
|
191
|
+
) : -1, We = $(() => o.map((e) => e.value), [o]), pe = $(
|
|
190
192
|
() => new Map(o.map((e) => [e.value, e.group])),
|
|
191
193
|
[o]
|
|
192
|
-
),
|
|
194
|
+
), Ye = $(
|
|
193
195
|
() => new Map(o.map((e) => [e.value, e.tag])),
|
|
194
196
|
[o]
|
|
195
197
|
), T = $(() => I.reduce(
|
|
196
198
|
(e, s, p) => {
|
|
197
|
-
const u =
|
|
199
|
+
const u = pe.get(String(s.key));
|
|
198
200
|
return u !== void 0 && u !== e.currentGroup ? (e.result.push({ type: "header", group: u }), e.currentGroup = u) : u === void 0 && e.currentGroup !== void 0 && (e.currentGroup = void 0), e.result.push({ type: "item", index: p }), e;
|
|
199
201
|
},
|
|
200
202
|
{ result: [], currentGroup: void 0 }
|
|
201
|
-
).result, [I,
|
|
203
|
+
).result, [I, pe]), ue = Je({
|
|
202
204
|
count: T.length,
|
|
203
205
|
estimateSize: (e) => T[e].type === "header" ? 44 : 28,
|
|
204
206
|
getScrollElement: () => O.current,
|
|
205
207
|
useFlushSync: !1
|
|
206
|
-
}),
|
|
208
|
+
}), fe = c.isOpen && !h, E = fe && !!oe, de = fe && o.length === 0 && !!ee, qe = v(
|
|
207
209
|
(e) => {
|
|
208
210
|
e.preventDefault();
|
|
209
211
|
},
|
|
210
212
|
[]
|
|
211
|
-
),
|
|
213
|
+
), he = E ? (
|
|
212
214
|
// A listbox only owns options, so the row itself must stay presentational
|
|
213
|
-
/* @__PURE__ */ r(
|
|
215
|
+
/* @__PURE__ */ r(so, { onMouseDown: qe, role: "presentation", children: /* @__PURE__ */ r("div", { "aria-live": "polite", role: "status", children: /* @__PURE__ */ r(
|
|
214
216
|
P,
|
|
215
217
|
{
|
|
216
218
|
color: m.palette.gray[400],
|
|
217
219
|
size: "sm",
|
|
218
220
|
textOverflow: "auto",
|
|
219
221
|
whiteSpace: "wrap",
|
|
220
|
-
children:
|
|
222
|
+
children: oe
|
|
221
223
|
}
|
|
222
224
|
) }) })
|
|
223
225
|
) : null;
|
|
224
226
|
return /* @__PURE__ */ G(
|
|
225
|
-
|
|
227
|
+
to,
|
|
226
228
|
{
|
|
227
|
-
containerRef:
|
|
229
|
+
containerRef: se,
|
|
228
230
|
error: k,
|
|
229
|
-
helpLink:
|
|
230
|
-
helpLinkText:
|
|
231
|
-
helpText:
|
|
231
|
+
helpLink: be,
|
|
232
|
+
helpLinkText: we,
|
|
233
|
+
helpText: Se,
|
|
232
234
|
htmlFor: l,
|
|
233
235
|
id: `combobox-${l}`,
|
|
234
236
|
label: Q,
|
|
235
|
-
required:
|
|
236
|
-
tooltip:
|
|
237
|
-
weight:
|
|
237
|
+
required: Ae,
|
|
238
|
+
tooltip: Oe,
|
|
239
|
+
weight: Re,
|
|
238
240
|
children: [
|
|
239
241
|
/* @__PURE__ */ G(
|
|
240
|
-
|
|
242
|
+
ro,
|
|
241
243
|
{
|
|
242
244
|
className: `${h ? "disabled" : ""} ${k ? "error" : ""}`,
|
|
243
245
|
ref: z,
|
|
@@ -245,11 +247,11 @@ const ko = ({
|
|
|
245
247
|
/* @__PURE__ */ r(
|
|
246
248
|
"input",
|
|
247
249
|
{
|
|
248
|
-
...
|
|
250
|
+
...je,
|
|
249
251
|
"aria-invalid": k ? "true" : "false",
|
|
250
252
|
"aria-label": l,
|
|
251
253
|
disabled: h,
|
|
252
|
-
onKeyDown:
|
|
254
|
+
onKeyDown: le,
|
|
253
255
|
ref: W
|
|
254
256
|
}
|
|
255
257
|
),
|
|
@@ -262,14 +264,14 @@ const ko = ({
|
|
|
262
264
|
iconSize: "lg"
|
|
263
265
|
}
|
|
264
266
|
) : void 0,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
Ce && !h && (t ? (S?.(`${l}Options`)?.length ?? 0) > 0 : te) ? /* @__PURE__ */ r(
|
|
268
|
+
po,
|
|
267
269
|
{
|
|
268
270
|
icon: "xmark",
|
|
269
271
|
iconColor: m.palette.gray[400],
|
|
270
272
|
iconSize: "sm",
|
|
271
273
|
iconType: "fa-light",
|
|
272
|
-
onClick:
|
|
274
|
+
onClick: Ke,
|
|
273
275
|
px: 0.125,
|
|
274
276
|
py: 0.125,
|
|
275
277
|
type: "reset",
|
|
@@ -277,9 +279,9 @@ const ko = ({
|
|
|
277
279
|
}
|
|
278
280
|
) : void 0,
|
|
279
281
|
/* @__PURE__ */ G(
|
|
280
|
-
|
|
282
|
+
lo,
|
|
281
283
|
{
|
|
282
|
-
...
|
|
284
|
+
...Ue,
|
|
283
285
|
$variant: "ghost",
|
|
284
286
|
className: `action ${c.isOpen && !h ? "open" : "closed"}`,
|
|
285
287
|
disabled: h,
|
|
@@ -315,7 +317,7 @@ const ko = ({
|
|
|
315
317
|
}
|
|
316
318
|
),
|
|
317
319
|
c.isOpen && c.collection.size > 0 && !h ? /* @__PURE__ */ r(
|
|
318
|
-
|
|
320
|
+
ye,
|
|
319
321
|
{
|
|
320
322
|
className: "dropdown",
|
|
321
323
|
id: `popover-${l}`,
|
|
@@ -325,22 +327,22 @@ const ko = ({
|
|
|
325
327
|
state: c,
|
|
326
328
|
triggerRef: z,
|
|
327
329
|
children: /* @__PURE__ */ G(
|
|
328
|
-
|
|
330
|
+
ve,
|
|
329
331
|
{
|
|
330
|
-
...
|
|
332
|
+
...ae,
|
|
331
333
|
$hasStatus: E,
|
|
332
334
|
$multiSelection: t && !Array.from(b ?? []).includes("All"),
|
|
333
|
-
$width:
|
|
335
|
+
$width: ce,
|
|
334
336
|
ref: O,
|
|
335
337
|
children: [
|
|
336
338
|
/* @__PURE__ */ r(
|
|
337
339
|
"div",
|
|
338
340
|
{
|
|
339
341
|
style: {
|
|
340
|
-
height: `${
|
|
342
|
+
height: `${ue.getTotalSize()}px`,
|
|
341
343
|
position: "relative"
|
|
342
344
|
},
|
|
343
|
-
children:
|
|
345
|
+
children: ue.getVirtualItems().map((e) => {
|
|
344
346
|
const s = T[e.index];
|
|
345
347
|
if (s.type === "header")
|
|
346
348
|
return /* @__PURE__ */ r(
|
|
@@ -354,7 +356,7 @@ const ko = ({
|
|
|
354
356
|
height: `${e.size}px`,
|
|
355
357
|
transform: `translateY(${e.start}px)`
|
|
356
358
|
},
|
|
357
|
-
children: /* @__PURE__ */ r(
|
|
359
|
+
children: /* @__PURE__ */ r(ao, { children: /* @__PURE__ */ r(
|
|
358
360
|
P,
|
|
359
361
|
{
|
|
360
362
|
color: m.palette.gray[400],
|
|
@@ -366,7 +368,7 @@ const ko = ({
|
|
|
366
368
|
},
|
|
367
369
|
`header-${e.index}`
|
|
368
370
|
);
|
|
369
|
-
const p = I[s.index], u = T[e.index + 1], n = p.key === "All" && u?.type === "header", f = t && s.index ===
|
|
371
|
+
const p = I[s.index], u = T[e.index + 1], n = p.key === "All" && u?.type === "header", f = t && s.index === ie && ie >= 0 && s.index < I.length - 1 && !n;
|
|
370
372
|
return /* @__PURE__ */ r(
|
|
371
373
|
"div",
|
|
372
374
|
{
|
|
@@ -380,10 +382,11 @@ const ko = ({
|
|
|
380
382
|
borderBottom: f ? `1px solid ${m.palette.gray[200]}` : void 0
|
|
381
383
|
},
|
|
382
384
|
children: /* @__PURE__ */ r(
|
|
383
|
-
|
|
385
|
+
no,
|
|
384
386
|
{
|
|
385
|
-
allItemKeys:
|
|
386
|
-
containerRef:
|
|
387
|
+
allItemKeys: We,
|
|
388
|
+
containerRef: se,
|
|
389
|
+
countLabel: _,
|
|
387
390
|
item: p,
|
|
388
391
|
multiSelection: t,
|
|
389
392
|
name: l,
|
|
@@ -391,7 +394,7 @@ const ko = ({
|
|
|
391
394
|
setInputValue: x,
|
|
392
395
|
setValue: w,
|
|
393
396
|
state: c,
|
|
394
|
-
tag:
|
|
397
|
+
tag: Ye.get(String(p.key)),
|
|
395
398
|
watch: S
|
|
396
399
|
}
|
|
397
400
|
)
|
|
@@ -401,13 +404,13 @@ const ko = ({
|
|
|
401
404
|
})
|
|
402
405
|
}
|
|
403
406
|
),
|
|
404
|
-
|
|
407
|
+
he
|
|
405
408
|
]
|
|
406
409
|
}
|
|
407
410
|
)
|
|
408
411
|
}
|
|
409
|
-
) : !
|
|
410
|
-
|
|
412
|
+
) : !de && !E ? null : /* @__PURE__ */ r(
|
|
413
|
+
ye,
|
|
411
414
|
{
|
|
412
415
|
className: "dropdown",
|
|
413
416
|
id: `popover-${l}-empty`,
|
|
@@ -417,25 +420,25 @@ const ko = ({
|
|
|
417
420
|
state: c,
|
|
418
421
|
triggerRef: z,
|
|
419
422
|
children: /* @__PURE__ */ G(
|
|
420
|
-
|
|
423
|
+
ve,
|
|
421
424
|
{
|
|
422
|
-
...
|
|
425
|
+
...ae,
|
|
423
426
|
$hasStatus: E,
|
|
424
427
|
$multiSelection: !1,
|
|
425
|
-
$width:
|
|
428
|
+
$width: ce,
|
|
426
429
|
ref: O,
|
|
427
430
|
children: [
|
|
428
|
-
|
|
431
|
+
de ? /* @__PURE__ */ r(co, { children: /* @__PURE__ */ r(
|
|
429
432
|
P,
|
|
430
433
|
{
|
|
431
434
|
color: m.palette.gray[400],
|
|
432
435
|
size: "md",
|
|
433
436
|
textOverflow: "auto",
|
|
434
437
|
whiteSpace: "wrap",
|
|
435
|
-
children:
|
|
438
|
+
children: ee
|
|
436
439
|
}
|
|
437
440
|
) }) : null,
|
|
438
|
-
|
|
441
|
+
he
|
|
439
442
|
]
|
|
440
443
|
}
|
|
441
444
|
)
|
|
@@ -446,5 +449,5 @@ const ko = ({
|
|
|
446
449
|
);
|
|
447
450
|
};
|
|
448
451
|
export {
|
|
449
|
-
|
|
452
|
+
Mo as ComboBoxField
|
|
450
453
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IComboBoxProps, IItem } from './types';
|
|
2
|
-
declare const ComboBox: ({ control, disabled, disabledKeys, error, helpLink, helpLinkText, helpText, label, loadingItems, name, multiSelection, items, onBlur, onChange, onClear, placeholder, clearable, emptyMessage, required, setValue, statusMessage, tooltip, value, watch, weight, }: Readonly<IComboBoxProps>) => JSX.Element;
|
|
2
|
+
declare const ComboBox: ({ control, disabled, disabledKeys, error, helpLink, helpLinkText, helpText, label, loadingItems, name, multiSelection, items, onBlur, onChange, onClear, placeholder, clearable, countLabel, emptyMessage, required, setValue, statusMessage, tooltip, value, watch, weight, }: Readonly<IComboBoxProps>) => JSX.Element;
|
|
3
3
|
export { ComboBox };
|
|
4
4
|
export type { IComboBoxProps, IItem };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { ComboBoxField as
|
|
4
|
-
const
|
|
2
|
+
import { Controller as w } from "../../../../node_modules/react-hook-form/dist/index.esm.js";
|
|
3
|
+
import { ComboBoxField as X } from "./field/index.js";
|
|
4
|
+
const k = ({
|
|
5
5
|
control: m,
|
|
6
6
|
disabled: x = !1,
|
|
7
7
|
disabledKeys: j,
|
|
8
|
-
error:
|
|
8
|
+
error: Y,
|
|
9
9
|
helpLink: B,
|
|
10
10
|
helpLinkText: C,
|
|
11
11
|
helpText: F,
|
|
@@ -19,28 +19,30 @@ const S = ({
|
|
|
19
19
|
onClear: J,
|
|
20
20
|
placeholder: N,
|
|
21
21
|
clearable: O = !1,
|
|
22
|
-
|
|
22
|
+
countLabel: P,
|
|
23
|
+
emptyMessage: Q,
|
|
23
24
|
required: o,
|
|
24
|
-
setValue:
|
|
25
|
-
statusMessage:
|
|
26
|
-
tooltip:
|
|
27
|
-
value:
|
|
28
|
-
watch:
|
|
29
|
-
weight:
|
|
25
|
+
setValue: Z,
|
|
26
|
+
statusMessage: R,
|
|
27
|
+
tooltip: U,
|
|
28
|
+
value: V,
|
|
29
|
+
watch: _,
|
|
30
|
+
weight: W
|
|
30
31
|
}) => m ? /* @__PURE__ */ f(
|
|
31
|
-
|
|
32
|
+
w,
|
|
32
33
|
{
|
|
33
34
|
control: m,
|
|
34
35
|
name: r,
|
|
35
|
-
render: ({ field:
|
|
36
|
-
|
|
36
|
+
render: ({ field: $, fieldState: v }) => /* @__PURE__ */ f(
|
|
37
|
+
X,
|
|
37
38
|
{
|
|
38
39
|
clearable: O,
|
|
40
|
+
countLabel: P,
|
|
39
41
|
disabled: x,
|
|
40
42
|
disabledKeys: j,
|
|
41
|
-
emptyMessage:
|
|
42
|
-
error:
|
|
43
|
-
field:
|
|
43
|
+
emptyMessage: Q,
|
|
44
|
+
error: v.error?.message,
|
|
45
|
+
field: $,
|
|
44
46
|
helpLink: B,
|
|
45
47
|
helpLinkText: C,
|
|
46
48
|
helpText: F,
|
|
@@ -54,24 +56,25 @@ const S = ({
|
|
|
54
56
|
onClear: J,
|
|
55
57
|
placeholder: N,
|
|
56
58
|
required: o,
|
|
57
|
-
setValue:
|
|
58
|
-
statusMessage:
|
|
59
|
-
tooltip:
|
|
60
|
-
value:
|
|
61
|
-
watch:
|
|
62
|
-
weight:
|
|
59
|
+
setValue: Z,
|
|
60
|
+
statusMessage: R,
|
|
61
|
+
tooltip: U,
|
|
62
|
+
value: V,
|
|
63
|
+
watch: _,
|
|
64
|
+
weight: W
|
|
63
65
|
}
|
|
64
66
|
),
|
|
65
67
|
rules: { required: o }
|
|
66
68
|
}
|
|
67
69
|
) : /* @__PURE__ */ f(
|
|
68
|
-
|
|
70
|
+
X,
|
|
69
71
|
{
|
|
70
72
|
clearable: O,
|
|
73
|
+
countLabel: P,
|
|
71
74
|
disabled: x,
|
|
72
75
|
disabledKeys: j,
|
|
73
|
-
emptyMessage:
|
|
74
|
-
error:
|
|
76
|
+
emptyMessage: Q,
|
|
77
|
+
error: Y,
|
|
75
78
|
helpLink: B,
|
|
76
79
|
helpLinkText: C,
|
|
77
80
|
helpText: F,
|
|
@@ -85,12 +88,12 @@ const S = ({
|
|
|
85
88
|
onClear: J,
|
|
86
89
|
placeholder: N,
|
|
87
90
|
required: o,
|
|
88
|
-
statusMessage:
|
|
89
|
-
tooltip:
|
|
90
|
-
value:
|
|
91
|
-
weight:
|
|
91
|
+
statusMessage: R,
|
|
92
|
+
tooltip: U,
|
|
93
|
+
value: V,
|
|
94
|
+
weight: W
|
|
92
95
|
}
|
|
93
96
|
);
|
|
94
97
|
export {
|
|
95
|
-
|
|
98
|
+
k as ComboBox
|
|
96
99
|
};
|
|
@@ -7,6 +7,9 @@ declare const withEmptyMessage: import('storybook/internal/csf').AnnotatedStoryF
|
|
|
7
7
|
declare const withStatusMessage: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
8
8
|
declare const withClearButton: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
9
9
|
declare const groupedMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
10
|
+
declare const narrowMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
11
|
+
declare const countLabelMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
12
|
+
declare const whiteOptionsMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
10
13
|
declare const preselectedMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
|
|
11
|
-
export { Default, multiSelectWithAll, withEmptyMessage, withStatusMessage, withClearButton, groupedMultiSelect, preselectedMultiSelect, };
|
|
14
|
+
export { countLabelMultiSelect, Default, multiSelectWithAll, withEmptyMessage, withStatusMessage, withClearButton, groupedMultiSelect, narrowMultiSelect, preselectedMultiSelect, whiteOptionsMultiSelect, };
|
|
12
15
|
export default config;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IOptionProps } from '../types';
|
|
2
|
-
declare const Option: <T extends object>({ allItemKeys, containerRef, item, multiSelection, name, popoverRef, setInputValue, setValue, state, tag, watch, }: Readonly<IOptionProps<T>>) => JSX.Element;
|
|
2
|
+
declare const Option: <T extends object>({ allItemKeys, containerRef, countLabel, item, multiSelection, name, popoverRef, setInputValue, setValue, state, tag, watch, }: Readonly<IOptionProps<T>>) => JSX.Element;
|
|
3
3
|
export { Option };
|