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