@povio/ui 3.2.2-rc.7 → 3.2.2
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/Selection/shared/SelectBase.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.js +35 -32
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +212 -191
- package/dist/components/inputs/Selection/shared/SelectInput.js +193 -154
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +3 -1
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ export type SelectBaseProps<TKey extends Key = Key, TInitialSelectItem = Default
|
|
|
27
27
|
collapseAfter?: number;
|
|
28
28
|
fireBlurOnChange?: boolean;
|
|
29
29
|
searchDebounceDelay?: number;
|
|
30
|
+
multiSelectAutoConfirm?: boolean;
|
|
30
31
|
onInputChange?: (value: string) => void;
|
|
31
32
|
onSearchChange?: (value: string) => void;
|
|
32
33
|
mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem<TKey>;
|
|
@@ -7,7 +7,7 @@ import { c } from "react/compiler-runtime";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/inputs/Selection/shared/SelectBase.tsx
|
|
9
9
|
var SelectBase = (dProps) => {
|
|
10
|
-
const $ = c(
|
|
10
|
+
const $ = c(22);
|
|
11
11
|
const ui = UIConfig.useConfig();
|
|
12
12
|
const t0 = dProps.selectionMode ?? ui.select.selectionMode;
|
|
13
13
|
const t1 = dProps.variant ?? ui.input.variant;
|
|
@@ -21,10 +21,11 @@ var SelectBase = (dProps) => {
|
|
|
21
21
|
const t9 = dProps.collapseAfter ?? ui.select.collapseAfter;
|
|
22
22
|
const t10 = dProps.hideSearchIcon ?? ui.select.hideSearchIcon;
|
|
23
23
|
const t11 = dProps.fireBlurOnChange ?? ui.select.fireBlurOnChange;
|
|
24
|
-
const t12 = dProps.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const t12 = dProps.multiSelectAutoConfirm ?? ui.select.multiSelectAutoConfirm;
|
|
25
|
+
const t13 = dProps.ignoreInputValueFiltering ?? dProps.isClientSearchDisabled;
|
|
26
|
+
let t14;
|
|
27
|
+
if ($[0] !== dProps || $[1] !== t0 || $[2] !== t1 || $[3] !== t10 || $[4] !== t11 || $[5] !== t12 || $[6] !== t13 || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== t5 || $[11] !== t6 || $[12] !== t7 || $[13] !== t8 || $[14] !== t9) {
|
|
28
|
+
t14 = {
|
|
28
29
|
...dProps,
|
|
29
30
|
selectionMode: t0,
|
|
30
31
|
variant: t1,
|
|
@@ -38,7 +39,8 @@ var SelectBase = (dProps) => {
|
|
|
38
39
|
collapseAfter: t9,
|
|
39
40
|
hideSearchIcon: t10,
|
|
40
41
|
fireBlurOnChange: t11,
|
|
41
|
-
|
|
42
|
+
multiSelectAutoConfirm: t12,
|
|
43
|
+
isClientSearchDisabled: t13
|
|
42
44
|
};
|
|
43
45
|
$[0] = dProps;
|
|
44
46
|
$[1] = t0;
|
|
@@ -46,37 +48,38 @@ var SelectBase = (dProps) => {
|
|
|
46
48
|
$[3] = t10;
|
|
47
49
|
$[4] = t11;
|
|
48
50
|
$[5] = t12;
|
|
49
|
-
$[6] =
|
|
50
|
-
$[7] =
|
|
51
|
-
$[8] =
|
|
52
|
-
$[9] =
|
|
53
|
-
$[10] =
|
|
54
|
-
$[11] =
|
|
55
|
-
$[12] =
|
|
56
|
-
$[13] =
|
|
57
|
-
$[14] =
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
$[6] = t13;
|
|
52
|
+
$[7] = t2;
|
|
53
|
+
$[8] = t3;
|
|
54
|
+
$[9] = t4;
|
|
55
|
+
$[10] = t5;
|
|
56
|
+
$[11] = t6;
|
|
57
|
+
$[12] = t7;
|
|
58
|
+
$[13] = t8;
|
|
59
|
+
$[14] = t9;
|
|
60
|
+
$[15] = t14;
|
|
61
|
+
} else t14 = $[15];
|
|
62
|
+
const props = t14;
|
|
60
63
|
const isDesktop = useBreakpoint("md");
|
|
61
|
-
const
|
|
62
|
-
let t15;
|
|
63
|
-
if ($[15] !== isDesktop || $[16] !== props) {
|
|
64
|
-
t15 = isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props });
|
|
65
|
-
$[15] = isDesktop;
|
|
66
|
-
$[16] = props;
|
|
67
|
-
$[17] = t15;
|
|
68
|
-
} else t15 = $[17];
|
|
64
|
+
const t15 = props;
|
|
69
65
|
let t16;
|
|
70
|
-
if ($[
|
|
71
|
-
t16 = /* @__PURE__ */ jsx(
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
if ($[16] !== isDesktop || $[17] !== props) {
|
|
67
|
+
t16 = isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props });
|
|
68
|
+
$[16] = isDesktop;
|
|
69
|
+
$[17] = props;
|
|
70
|
+
$[18] = t16;
|
|
71
|
+
} else t16 = $[18];
|
|
72
|
+
let t17;
|
|
73
|
+
if ($[19] !== t15 || $[20] !== t16) {
|
|
74
|
+
t17 = /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
75
|
+
...t15,
|
|
76
|
+
children: t16
|
|
74
77
|
});
|
|
75
|
-
$[18] = t14;
|
|
76
78
|
$[19] = t15;
|
|
77
79
|
$[20] = t16;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
$[21] = t17;
|
|
81
|
+
} else t17 = $[21];
|
|
82
|
+
return t17;
|
|
80
83
|
};
|
|
81
84
|
//#endregion
|
|
82
85
|
export { SelectBase };
|
|
@@ -16,7 +16,7 @@ import { useLabel, usePreventScroll } from "react-aria";
|
|
|
16
16
|
import { mergeRefs } from "@react-aria/utils";
|
|
17
17
|
//#region src/components/inputs/Selection/shared/SelectDesktop.tsx
|
|
18
18
|
var SelectDesktop = (t0) => {
|
|
19
|
-
const $ = c(
|
|
19
|
+
const $ = c(142);
|
|
20
20
|
let containerClassName;
|
|
21
21
|
let customTrigger;
|
|
22
22
|
let error;
|
|
@@ -137,9 +137,13 @@ var SelectDesktop = (t0) => {
|
|
|
137
137
|
t7 = $[32];
|
|
138
138
|
}
|
|
139
139
|
useLayoutEffect(t6, t7);
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
let WrapperComponent;
|
|
141
|
+
let comboBoxProps;
|
|
142
|
+
let dialogTriggerProps;
|
|
143
|
+
let headerProps;
|
|
144
|
+
let showPopover;
|
|
145
|
+
if ($[33] !== containerClassName || $[34] !== error || $[35] !== fieldState.inputValue || $[36] !== fieldState.value || $[37] !== headerClassName || $[38] !== helperText || $[39] !== hideLabel || $[40] !== isDisabled || $[41] !== isHeaderHidden || $[42] !== isLoading || $[43] !== isMultiple || $[44] !== isOpen || $[45] !== isRequired || $[46] !== isSearchable || $[47] !== label || $[48] !== labelProps || $[49] !== listItems || $[50] !== onChange || $[51] !== onClear || $[52] !== onInputChange || $[53] !== onSelectAll || $[54] !== rightContent || $[55] !== selectableListItems || $[56] !== selectedIds || $[57] !== setIsOpen || $[58] !== tooltipText) {
|
|
146
|
+
const onSelectionChange = (value) => {
|
|
143
147
|
if (!value) return;
|
|
144
148
|
if (value === "all-item-id") {
|
|
145
149
|
if (selectedIds.length === selectableListItems.length) onClear();
|
|
@@ -148,6 +152,7 @@ var SelectDesktop = (t0) => {
|
|
|
148
152
|
}
|
|
149
153
|
if (!isMultiple) {
|
|
150
154
|
onChange(value);
|
|
155
|
+
if (isSearchable) blurSearchInput();
|
|
151
156
|
return;
|
|
152
157
|
}
|
|
153
158
|
if (!Array.isArray(fieldState.value)) {
|
|
@@ -157,131 +162,147 @@ var SelectDesktop = (t0) => {
|
|
|
157
162
|
if (fieldState.value.includes(value)) onChange(fieldState.value.filter((id) => id !== value));
|
|
158
163
|
else onChange(fieldState.value.concat(value));
|
|
159
164
|
};
|
|
160
|
-
|
|
161
|
-
$[
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
$[
|
|
180
|
-
|
|
181
|
-
const openChangeHandler = t9;
|
|
182
|
-
const WrapperComponent = isSearchable ? ComboBox : Fragment$1;
|
|
183
|
-
const t10 = isMultiple ? null : fieldState.value;
|
|
184
|
-
const t11 = fieldState.inputValue;
|
|
185
|
-
const t12 = !!error;
|
|
186
|
-
let t13;
|
|
187
|
-
if ($[43] !== containerClassName) {
|
|
188
|
-
t13 = clsx("group w-full", containerClassName);
|
|
189
|
-
$[43] = containerClassName;
|
|
190
|
-
$[44] = t13;
|
|
191
|
-
} else t13 = $[44];
|
|
192
|
-
let t14;
|
|
193
|
-
if ($[45] !== fieldState.inputValue || $[46] !== isDisabled || $[47] !== listItems || $[48] !== onInputChange || $[49] !== onSelectionChange || $[50] !== openChangeHandler || $[51] !== t10 || $[52] !== t12 || $[53] !== t13) {
|
|
194
|
-
t14 = {
|
|
165
|
+
let t8;
|
|
166
|
+
if ($[64] !== setIsOpen) {
|
|
167
|
+
t8 = (value_0) => {
|
|
168
|
+
if (closeComboBoxRef.current && value_0) {
|
|
169
|
+
closeComboBoxRef.current.setOpen(false);
|
|
170
|
+
closeComboBoxRef.current = null;
|
|
171
|
+
} else setIsOpen(value_0);
|
|
172
|
+
};
|
|
173
|
+
$[64] = setIsOpen;
|
|
174
|
+
$[65] = t8;
|
|
175
|
+
} else t8 = $[65];
|
|
176
|
+
const openChangeHandler = t8;
|
|
177
|
+
WrapperComponent = isSearchable ? ComboBox : Fragment$1;
|
|
178
|
+
const t9 = fieldState.inputValue;
|
|
179
|
+
let t10;
|
|
180
|
+
if ($[66] !== containerClassName) {
|
|
181
|
+
t10 = clsx("group w-full", containerClassName);
|
|
182
|
+
$[66] = containerClassName;
|
|
183
|
+
$[67] = t10;
|
|
184
|
+
} else t10 = $[67];
|
|
185
|
+
comboBoxProps = {
|
|
195
186
|
items: listItems,
|
|
196
|
-
selectedKey:
|
|
187
|
+
selectedKey: isMultiple ? null : fieldState.value,
|
|
197
188
|
onSelectionChange,
|
|
198
|
-
inputValue:
|
|
189
|
+
inputValue: t9,
|
|
199
190
|
onInputChange,
|
|
200
191
|
onOpenChange: openChangeHandler,
|
|
201
192
|
allowsEmptyCollection: true,
|
|
202
193
|
isDisabled,
|
|
203
|
-
isInvalid:
|
|
194
|
+
isInvalid: !!error,
|
|
204
195
|
menuTrigger: "focus",
|
|
205
|
-
className:
|
|
196
|
+
className: t10
|
|
206
197
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
$[
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
rightContent
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
$[
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
$[
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
198
|
+
const t11 = hideLabel || isHeaderHidden;
|
|
199
|
+
let t12;
|
|
200
|
+
if ($[68] !== headerClassName || $[69] !== helperText || $[70] !== isDisabled || $[71] !== isRequired || $[72] !== label || $[73] !== labelProps || $[74] !== rightContent || $[75] !== t11 || $[76] !== tooltipText) {
|
|
201
|
+
t12 = {
|
|
202
|
+
label,
|
|
203
|
+
tooltipText,
|
|
204
|
+
helperText,
|
|
205
|
+
isRequired,
|
|
206
|
+
rightContent,
|
|
207
|
+
isHeaderHidden: t11,
|
|
208
|
+
isDisabled,
|
|
209
|
+
className: headerClassName,
|
|
210
|
+
labelProps
|
|
211
|
+
};
|
|
212
|
+
$[68] = headerClassName;
|
|
213
|
+
$[69] = helperText;
|
|
214
|
+
$[70] = isDisabled;
|
|
215
|
+
$[71] = isRequired;
|
|
216
|
+
$[72] = label;
|
|
217
|
+
$[73] = labelProps;
|
|
218
|
+
$[74] = rightContent;
|
|
219
|
+
$[75] = t11;
|
|
220
|
+
$[76] = tooltipText;
|
|
221
|
+
$[77] = t12;
|
|
222
|
+
} else t12 = $[77];
|
|
223
|
+
headerProps = t12;
|
|
224
|
+
let t13;
|
|
225
|
+
if ($[78] !== isOpen || $[79] !== setIsOpen) {
|
|
226
|
+
t13 = {
|
|
227
|
+
isOpen,
|
|
228
|
+
onOpenChange: setIsOpen
|
|
229
|
+
};
|
|
230
|
+
$[78] = isOpen;
|
|
231
|
+
$[79] = setIsOpen;
|
|
232
|
+
$[80] = t13;
|
|
233
|
+
} else t13 = $[80];
|
|
234
|
+
dialogTriggerProps = t13;
|
|
235
|
+
let t14;
|
|
236
|
+
if ($[81] !== isLoading || $[82] !== listItems) {
|
|
237
|
+
t14 = listItems.filter(_temp).length > 0 || isLoading;
|
|
238
|
+
$[81] = isLoading;
|
|
239
|
+
$[82] = listItems;
|
|
240
|
+
$[83] = t14;
|
|
241
|
+
} else t14 = $[83];
|
|
242
|
+
showPopover = t14;
|
|
243
|
+
const blurSearchInput = () => {
|
|
244
|
+
const activeElement = document.activeElement;
|
|
245
|
+
if (activeElement instanceof HTMLElement && wrapperRef.current?.contains(activeElement)) activeElement.blur();
|
|
250
246
|
};
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
247
|
+
$[33] = containerClassName;
|
|
248
|
+
$[34] = error;
|
|
249
|
+
$[35] = fieldState.inputValue;
|
|
250
|
+
$[36] = fieldState.value;
|
|
251
|
+
$[37] = headerClassName;
|
|
252
|
+
$[38] = helperText;
|
|
253
|
+
$[39] = hideLabel;
|
|
254
|
+
$[40] = isDisabled;
|
|
255
|
+
$[41] = isHeaderHidden;
|
|
256
|
+
$[42] = isLoading;
|
|
257
|
+
$[43] = isMultiple;
|
|
258
|
+
$[44] = isOpen;
|
|
259
|
+
$[45] = isRequired;
|
|
260
|
+
$[46] = isSearchable;
|
|
261
|
+
$[47] = label;
|
|
262
|
+
$[48] = labelProps;
|
|
263
|
+
$[49] = listItems;
|
|
264
|
+
$[50] = onChange;
|
|
265
|
+
$[51] = onClear;
|
|
266
|
+
$[52] = onInputChange;
|
|
267
|
+
$[53] = onSelectAll;
|
|
268
|
+
$[54] = rightContent;
|
|
269
|
+
$[55] = selectableListItems;
|
|
270
|
+
$[56] = selectedIds;
|
|
271
|
+
$[57] = setIsOpen;
|
|
272
|
+
$[58] = tooltipText;
|
|
273
|
+
$[59] = WrapperComponent;
|
|
274
|
+
$[60] = comboBoxProps;
|
|
275
|
+
$[61] = dialogTriggerProps;
|
|
276
|
+
$[62] = headerProps;
|
|
277
|
+
$[63] = showPopover;
|
|
278
|
+
} else {
|
|
279
|
+
WrapperComponent = $[59];
|
|
280
|
+
comboBoxProps = $[60];
|
|
281
|
+
dialogTriggerProps = $[61];
|
|
282
|
+
headerProps = $[62];
|
|
283
|
+
showPopover = $[63];
|
|
284
|
+
}
|
|
285
|
+
let t8;
|
|
286
|
+
if ($[84] !== comboBoxProps || $[85] !== isSearchable) {
|
|
287
|
+
t8 = isSearchable ? comboBoxProps : {};
|
|
288
|
+
$[84] = comboBoxProps;
|
|
289
|
+
$[85] = isSearchable;
|
|
290
|
+
$[86] = t8;
|
|
291
|
+
} else t8 = $[86];
|
|
292
|
+
let t9;
|
|
293
|
+
if ($[87] !== containerClassName || $[88] !== isSearchable || $[89] !== labelProps) {
|
|
294
|
+
t9 = !isSearchable && {
|
|
274
295
|
labelProps,
|
|
275
296
|
className: clsx("group w-full", containerClassName)
|
|
276
297
|
};
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
} else
|
|
282
|
-
let
|
|
283
|
-
if ($[
|
|
284
|
-
|
|
298
|
+
$[87] = containerClassName;
|
|
299
|
+
$[88] = isSearchable;
|
|
300
|
+
$[89] = labelProps;
|
|
301
|
+
$[90] = t9;
|
|
302
|
+
} else t9 = $[90];
|
|
303
|
+
let t10;
|
|
304
|
+
if ($[91] !== as || $[92] !== className || $[93] !== collapseAfter || $[94] !== customTrigger || $[95] !== dialogTriggerProps || $[96] !== error || $[97] !== fieldProps || $[98] !== headerProps || $[99] !== hideDropdownIcon || $[100] !== inputClassName || $[101] !== isClearable || $[102] !== isDirty || $[103] !== isDisabled || $[104] !== isRequired || $[105] !== isSearchable || $[106] !== leadingContent || $[107] !== onBlur || $[108] !== placeholder || $[109] !== ref || $[110] !== selectedTagsType || $[111] !== showSelectionContent || $[112] !== size || $[113] !== trailingContent || $[114] !== variant) {
|
|
305
|
+
t10 = customTrigger ? /* @__PURE__ */ jsx(DialogTrigger, {
|
|
285
306
|
...dialogTriggerProps,
|
|
286
307
|
children: /* @__PURE__ */ jsx("div", {
|
|
287
308
|
...fieldProps,
|
|
@@ -315,35 +336,35 @@ var SelectDesktop = (t0) => {
|
|
|
315
336
|
fieldProps,
|
|
316
337
|
headerProps
|
|
317
338
|
});
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
} else
|
|
344
|
-
let
|
|
345
|
-
if ($[
|
|
346
|
-
|
|
339
|
+
$[91] = as;
|
|
340
|
+
$[92] = className;
|
|
341
|
+
$[93] = collapseAfter;
|
|
342
|
+
$[94] = customTrigger;
|
|
343
|
+
$[95] = dialogTriggerProps;
|
|
344
|
+
$[96] = error;
|
|
345
|
+
$[97] = fieldProps;
|
|
346
|
+
$[98] = headerProps;
|
|
347
|
+
$[99] = hideDropdownIcon;
|
|
348
|
+
$[100] = inputClassName;
|
|
349
|
+
$[101] = isClearable;
|
|
350
|
+
$[102] = isDirty;
|
|
351
|
+
$[103] = isDisabled;
|
|
352
|
+
$[104] = isRequired;
|
|
353
|
+
$[105] = isSearchable;
|
|
354
|
+
$[106] = leadingContent;
|
|
355
|
+
$[107] = onBlur;
|
|
356
|
+
$[108] = placeholder;
|
|
357
|
+
$[109] = ref;
|
|
358
|
+
$[110] = selectedTagsType;
|
|
359
|
+
$[111] = showSelectionContent;
|
|
360
|
+
$[112] = size;
|
|
361
|
+
$[113] = trailingContent;
|
|
362
|
+
$[114] = variant;
|
|
363
|
+
$[115] = t10;
|
|
364
|
+
} else t10 = $[115];
|
|
365
|
+
let t11;
|
|
366
|
+
if ($[116] !== ignoreTriggerWidth || $[117] !== isOpen || $[118] !== isSearchable || $[119] !== popoverCva || $[120] !== popoverWidth || $[121] !== props || $[122] !== selectPopoverCva || $[123] !== setIsOpen || $[124] !== showPopover) {
|
|
367
|
+
t11 = (!isSearchable || showPopover) && /* @__PURE__ */ jsx(Popover, {
|
|
347
368
|
triggerRef,
|
|
348
369
|
isOpen,
|
|
349
370
|
onOpenChange: setIsOpen,
|
|
@@ -356,61 +377,61 @@ var SelectDesktop = (t0) => {
|
|
|
356
377
|
autoFocus: !isSearchable
|
|
357
378
|
})
|
|
358
379
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
} else
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
380
|
+
$[116] = ignoreTriggerWidth;
|
|
381
|
+
$[117] = isOpen;
|
|
382
|
+
$[118] = isSearchable;
|
|
383
|
+
$[119] = popoverCva;
|
|
384
|
+
$[120] = popoverWidth;
|
|
385
|
+
$[121] = props;
|
|
386
|
+
$[122] = selectPopoverCva;
|
|
387
|
+
$[123] = setIsOpen;
|
|
388
|
+
$[124] = showPopover;
|
|
389
|
+
$[125] = t11;
|
|
390
|
+
} else t11 = $[125];
|
|
391
|
+
let t12;
|
|
392
|
+
if ($[126] !== as || $[127] !== formFieldProps || $[128] !== onFocusCapture || $[129] !== onMouseEnter || $[130] !== t10 || $[131] !== t11 || $[132] !== t9) {
|
|
393
|
+
t12 = /* @__PURE__ */ jsxs(FormField, {
|
|
373
394
|
...formFieldProps,
|
|
374
|
-
...
|
|
395
|
+
...t9,
|
|
375
396
|
as,
|
|
376
397
|
onMouseEnter,
|
|
377
398
|
onFocusCapture,
|
|
378
399
|
ref: wrapperRef,
|
|
379
|
-
children: [
|
|
400
|
+
children: [t10, t11]
|
|
380
401
|
});
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
} else
|
|
390
|
-
let
|
|
391
|
-
if ($[
|
|
392
|
-
|
|
393
|
-
...
|
|
394
|
-
children:
|
|
402
|
+
$[126] = as;
|
|
403
|
+
$[127] = formFieldProps;
|
|
404
|
+
$[128] = onFocusCapture;
|
|
405
|
+
$[129] = onMouseEnter;
|
|
406
|
+
$[130] = t10;
|
|
407
|
+
$[131] = t11;
|
|
408
|
+
$[132] = t9;
|
|
409
|
+
$[133] = t12;
|
|
410
|
+
} else t12 = $[133];
|
|
411
|
+
let t13;
|
|
412
|
+
if ($[134] !== WrapperComponent || $[135] !== t12 || $[136] !== t8) {
|
|
413
|
+
t13 = /* @__PURE__ */ jsx(WrapperComponent, {
|
|
414
|
+
...t8,
|
|
415
|
+
children: t12
|
|
395
416
|
});
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
} else
|
|
401
|
-
let
|
|
402
|
-
if ($[
|
|
403
|
-
|
|
417
|
+
$[134] = WrapperComponent;
|
|
418
|
+
$[135] = t12;
|
|
419
|
+
$[136] = t8;
|
|
420
|
+
$[137] = t13;
|
|
421
|
+
} else t13 = $[137];
|
|
422
|
+
let t14;
|
|
423
|
+
if ($[138] !== as || $[139] !== error || $[140] !== t13) {
|
|
424
|
+
t14 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
404
425
|
as,
|
|
405
426
|
error,
|
|
406
|
-
children:
|
|
427
|
+
children: t13
|
|
407
428
|
});
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
} else
|
|
413
|
-
return
|
|
429
|
+
$[138] = as;
|
|
430
|
+
$[139] = error;
|
|
431
|
+
$[140] = t13;
|
|
432
|
+
$[141] = t14;
|
|
433
|
+
} else t14 = $[141];
|
|
434
|
+
return t14;
|
|
414
435
|
};
|
|
415
436
|
function _temp(item) {
|
|
416
437
|
return !item.isSelectAllItem;
|
|
@@ -18,7 +18,7 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
18
18
|
import { useTranslation } from "react-i18next";
|
|
19
19
|
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
20
20
|
var SelectInput = (t0) => {
|
|
21
|
-
const $0 = c(
|
|
21
|
+
const $0 = c(136);
|
|
22
22
|
const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props } = t0;
|
|
23
23
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
24
24
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
@@ -42,7 +42,7 @@ var SelectInput = (t0) => {
|
|
|
42
42
|
const { focusWithinProps } = useFocusWithin(t2);
|
|
43
43
|
const { isFocusVisible } = useFocusVisible();
|
|
44
44
|
const inputRef = useRef(null);
|
|
45
|
-
const { fieldState, isOpen, setIsOpen,
|
|
45
|
+
const { fieldState, isOpen, setIsOpen, selectableListItems, selectedItems, onChange, onClear, onRemove, isMultiple, multiSelectAutoConfirm, isLoading } = SelectContext.useSelect();
|
|
46
46
|
const isEmpty = selectedItems.length === 0;
|
|
47
47
|
const showTags = isMultiple && !isEmpty;
|
|
48
48
|
const showClearButton = !isDisabled && isClearable && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
|
|
@@ -79,91 +79,130 @@ var SelectInput = (t0) => {
|
|
|
79
79
|
t3 = t7;
|
|
80
80
|
}
|
|
81
81
|
const labelProps = t3;
|
|
82
|
-
|
|
82
|
+
let exactMatchItem;
|
|
83
|
+
if (isMultiple && multiSelectAutoConfirm && fieldState.inputValue !== "") {
|
|
84
|
+
let t4;
|
|
85
|
+
if ($0[10] !== fieldState.inputValue || $0[11] !== selectableListItems) {
|
|
86
|
+
let t5;
|
|
87
|
+
if ($0[13] !== fieldState.inputValue) {
|
|
88
|
+
t5 = (item) => item.label.toLowerCase() === fieldState.inputValue.toLowerCase();
|
|
89
|
+
$0[13] = fieldState.inputValue;
|
|
90
|
+
$0[14] = t5;
|
|
91
|
+
} else t5 = $0[14];
|
|
92
|
+
t4 = selectableListItems.find(t5);
|
|
93
|
+
$0[10] = fieldState.inputValue;
|
|
94
|
+
$0[11] = selectableListItems;
|
|
95
|
+
$0[12] = t4;
|
|
96
|
+
} else t4 = $0[12];
|
|
97
|
+
exactMatchItem = t4;
|
|
98
|
+
}
|
|
99
|
+
let singleRemainingItem;
|
|
100
|
+
if (!isLoading && selectableListItems.length === 1 && !selectableListItems[0].isDisabled) singleRemainingItem = selectableListItems[0];
|
|
101
|
+
let autoConfirmItem;
|
|
102
|
+
if ($0[15] !== exactMatchItem || $0[16] !== isMultiple || $0[17] !== multiSelectAutoConfirm || $0[18] !== singleRemainingItem) {
|
|
103
|
+
if (isMultiple) {
|
|
104
|
+
if (multiSelectAutoConfirm) autoConfirmItem = exactMatchItem ?? singleRemainingItem;
|
|
105
|
+
} else autoConfirmItem = singleRemainingItem;
|
|
106
|
+
$0[15] = exactMatchItem;
|
|
107
|
+
$0[16] = isMultiple;
|
|
108
|
+
$0[17] = multiSelectAutoConfirm;
|
|
109
|
+
$0[18] = singleRemainingItem;
|
|
110
|
+
$0[19] = autoConfirmItem;
|
|
111
|
+
} else autoConfirmItem = $0[19];
|
|
112
|
+
const t4 = !isLoading && !!autoConfirmItem;
|
|
83
113
|
let t5;
|
|
84
|
-
if ($0[
|
|
114
|
+
if ($0[20] !== autoConfirmItem || $0[21] !== fieldState.value || $0[22] !== isMultiple || $0[23] !== onChange || $0[24] !== onCloseComboBox || $0[25] !== state) {
|
|
85
115
|
t5 = () => {
|
|
86
|
-
|
|
116
|
+
if (!autoConfirmItem) return;
|
|
117
|
+
if (isMultiple) {
|
|
118
|
+
if (Array.isArray(fieldState.value)) if (fieldState.value.includes(autoConfirmItem.id)) onChange(fieldState.value.filter((id) => id !== autoConfirmItem.id));
|
|
119
|
+
else onChange(fieldState.value.concat(autoConfirmItem.id));
|
|
120
|
+
else onChange([autoConfirmItem.id]);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
onChange(autoConfirmItem.id);
|
|
87
124
|
onCloseComboBox?.(state);
|
|
88
125
|
};
|
|
89
|
-
$0[
|
|
90
|
-
$0[
|
|
91
|
-
$0[
|
|
92
|
-
$0[
|
|
93
|
-
$0[
|
|
94
|
-
|
|
126
|
+
$0[20] = autoConfirmItem;
|
|
127
|
+
$0[21] = fieldState.value;
|
|
128
|
+
$0[22] = isMultiple;
|
|
129
|
+
$0[23] = onChange;
|
|
130
|
+
$0[24] = onCloseComboBox;
|
|
131
|
+
$0[25] = state;
|
|
132
|
+
$0[26] = t5;
|
|
133
|
+
} else t5 = $0[26];
|
|
95
134
|
let t6;
|
|
96
|
-
if ($0[
|
|
135
|
+
if ($0[27] !== t4 || $0[28] !== t5) {
|
|
97
136
|
t6 = {
|
|
98
137
|
enabled: t4,
|
|
99
138
|
preventDefault: true,
|
|
100
139
|
callback: t5
|
|
101
140
|
};
|
|
102
|
-
$0[
|
|
103
|
-
$0[
|
|
104
|
-
$0[
|
|
105
|
-
} else t6 = $0[
|
|
141
|
+
$0[27] = t4;
|
|
142
|
+
$0[28] = t5;
|
|
143
|
+
$0[29] = t6;
|
|
144
|
+
} else t6 = $0[29];
|
|
106
145
|
const t7 = isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0;
|
|
107
146
|
let t8;
|
|
108
|
-
if ($0[
|
|
147
|
+
if ($0[30] !== fieldState.value || $0[31] !== onChange) {
|
|
109
148
|
t8 = () => {
|
|
110
149
|
if (!Array.isArray(fieldState.value)) return;
|
|
111
150
|
onChange(fieldState.value.slice(0, -1));
|
|
112
151
|
};
|
|
113
|
-
$0[
|
|
114
|
-
$0[
|
|
115
|
-
$0[
|
|
116
|
-
} else t8 = $0[
|
|
152
|
+
$0[30] = fieldState.value;
|
|
153
|
+
$0[31] = onChange;
|
|
154
|
+
$0[32] = t8;
|
|
155
|
+
} else t8 = $0[32];
|
|
117
156
|
let t9;
|
|
118
|
-
if ($0[
|
|
157
|
+
if ($0[33] !== t7 || $0[34] !== t8) {
|
|
119
158
|
t9 = {
|
|
120
159
|
enabled: t7,
|
|
121
160
|
callback: t8
|
|
122
161
|
};
|
|
123
|
-
$0[
|
|
124
|
-
$0[
|
|
125
|
-
$0[
|
|
126
|
-
} else t9 = $0[
|
|
162
|
+
$0[33] = t7;
|
|
163
|
+
$0[34] = t8;
|
|
164
|
+
$0[35] = t9;
|
|
165
|
+
} else t9 = $0[35];
|
|
127
166
|
let t10;
|
|
128
|
-
if ($0[
|
|
167
|
+
if ($0[36] !== t6 || $0[37] !== t9) {
|
|
129
168
|
t10 = {
|
|
130
169
|
enter: t6,
|
|
131
170
|
backspace: t9
|
|
132
171
|
};
|
|
133
|
-
$0[
|
|
134
|
-
$0[
|
|
135
|
-
$0[
|
|
136
|
-
} else t10 = $0[
|
|
172
|
+
$0[36] = t6;
|
|
173
|
+
$0[37] = t9;
|
|
174
|
+
$0[38] = t10;
|
|
175
|
+
} else t10 = $0[38];
|
|
137
176
|
const { onKeyDown } = useKeyInteractions(t10);
|
|
138
177
|
let t11;
|
|
139
|
-
if ($0[
|
|
178
|
+
if ($0[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
140
179
|
t11 = ["up", "down"];
|
|
141
|
-
$0[
|
|
142
|
-
} else t11 = $0[
|
|
180
|
+
$0[39] = t11;
|
|
181
|
+
} else t11 = $0[39];
|
|
143
182
|
const t12 = !isSearchable && !isDisabled && !isOpen;
|
|
144
183
|
let t13;
|
|
145
|
-
if ($0[
|
|
184
|
+
if ($0[40] !== setIsOpen) {
|
|
146
185
|
t13 = () => {
|
|
147
186
|
setIsOpen(true);
|
|
148
187
|
};
|
|
149
|
-
$0[
|
|
150
|
-
$0[
|
|
151
|
-
} else t13 = $0[
|
|
188
|
+
$0[40] = setIsOpen;
|
|
189
|
+
$0[41] = t13;
|
|
190
|
+
} else t13 = $0[41];
|
|
152
191
|
let t14;
|
|
153
|
-
if ($0[
|
|
192
|
+
if ($0[42] !== t12 || $0[43] !== t13) {
|
|
154
193
|
t14 = { interactions: [{
|
|
155
194
|
actions: t11,
|
|
156
195
|
enabled: t12,
|
|
157
196
|
preventDefault: true,
|
|
158
197
|
callback: t13
|
|
159
198
|
}] };
|
|
160
|
-
$0[
|
|
161
|
-
$0[
|
|
162
|
-
$0[
|
|
163
|
-
} else t14 = $0[
|
|
199
|
+
$0[42] = t12;
|
|
200
|
+
$0[43] = t13;
|
|
201
|
+
$0[44] = t14;
|
|
202
|
+
} else t14 = $0[44];
|
|
164
203
|
const { onKeyDown: onTriggerKeyDown } = useKeyInteractions(t14);
|
|
165
204
|
let t15;
|
|
166
|
-
if ($0[
|
|
205
|
+
if ($0[45] !== isDisabled || $0[46] !== isOpen || $0[47] !== isSearchable || $0[48] !== setIsOpen) {
|
|
167
206
|
t15 = () => {
|
|
168
207
|
if (isDisabled) return;
|
|
169
208
|
if (!isSearchable) {
|
|
@@ -172,12 +211,12 @@ var SelectInput = (t0) => {
|
|
|
172
211
|
}
|
|
173
212
|
inputRef.current?.focus();
|
|
174
213
|
};
|
|
175
|
-
$0[
|
|
176
|
-
$0[
|
|
177
|
-
$0[
|
|
178
|
-
$0[
|
|
179
|
-
$0[
|
|
180
|
-
} else t15 = $0[
|
|
214
|
+
$0[45] = isDisabled;
|
|
215
|
+
$0[46] = isOpen;
|
|
216
|
+
$0[47] = isSearchable;
|
|
217
|
+
$0[48] = setIsOpen;
|
|
218
|
+
$0[49] = t15;
|
|
219
|
+
} else t15 = $0[49];
|
|
181
220
|
const onClick = t15;
|
|
182
221
|
const t16 = inputBaseCva({
|
|
183
222
|
variant,
|
|
@@ -207,28 +246,28 @@ var SelectInput = (t0) => {
|
|
|
207
246
|
...props
|
|
208
247
|
}));
|
|
209
248
|
let t34;
|
|
210
|
-
if ($0[
|
|
249
|
+
if ($0[50] !== as || $0[51] !== headerProps || $0[52] !== labelProps) {
|
|
211
250
|
t34 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
212
251
|
as,
|
|
213
252
|
...headerProps,
|
|
214
253
|
labelProps
|
|
215
254
|
});
|
|
216
|
-
$0[
|
|
217
|
-
$0[
|
|
218
|
-
$0[
|
|
219
|
-
$0[
|
|
220
|
-
} else t34 = $0[
|
|
255
|
+
$0[50] = as;
|
|
256
|
+
$0[51] = headerProps;
|
|
257
|
+
$0[52] = labelProps;
|
|
258
|
+
$0[53] = t34;
|
|
259
|
+
} else t34 = $0[53];
|
|
221
260
|
let t35;
|
|
222
|
-
if ($0[
|
|
261
|
+
if ($0[54] !== leadingContent) {
|
|
223
262
|
t35 = leadingContent && /* @__PURE__ */ jsx("div", {
|
|
224
263
|
className: "ml-input-side-default flex shrink-0 items-center",
|
|
225
264
|
children: leadingContent
|
|
226
265
|
});
|
|
227
|
-
$0[
|
|
228
|
-
$0[
|
|
229
|
-
} else t35 = $0[
|
|
266
|
+
$0[54] = leadingContent;
|
|
267
|
+
$0[55] = t35;
|
|
268
|
+
} else t35 = $0[55];
|
|
230
269
|
let t36;
|
|
231
|
-
if ($0[
|
|
270
|
+
if ($0[56] !== as || $0[57] !== collapseAfter || $0[58] !== fieldProps || $0[59] !== inputClassName || $0[60] !== isDisabled || $0[61] !== isSearchable || $0[62] !== onBlur || $0[63] !== onKeyDown || $0[64] !== onRemove || $0[65] !== placeholder || $0[66] !== selectInputTagsContentWrapperCva || $0[67] !== selectedItems || $0[68] !== selectedTagsType || $0[69] !== showTags) {
|
|
232
271
|
t36 = (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
233
272
|
className: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
234
273
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
@@ -246,24 +285,24 @@ var SelectInput = (t0) => {
|
|
|
246
285
|
...fieldProps
|
|
247
286
|
})]
|
|
248
287
|
});
|
|
249
|
-
$0[
|
|
250
|
-
$0[
|
|
251
|
-
$0[
|
|
252
|
-
$0[
|
|
253
|
-
$0[
|
|
254
|
-
$0[
|
|
255
|
-
$0[
|
|
256
|
-
$0[
|
|
257
|
-
$0[
|
|
258
|
-
$0[
|
|
259
|
-
$0[
|
|
260
|
-
$0[
|
|
261
|
-
$0[
|
|
262
|
-
$0[
|
|
263
|
-
$0[
|
|
264
|
-
} else t36 = $0[
|
|
288
|
+
$0[56] = as;
|
|
289
|
+
$0[57] = collapseAfter;
|
|
290
|
+
$0[58] = fieldProps;
|
|
291
|
+
$0[59] = inputClassName;
|
|
292
|
+
$0[60] = isDisabled;
|
|
293
|
+
$0[61] = isSearchable;
|
|
294
|
+
$0[62] = onBlur;
|
|
295
|
+
$0[63] = onKeyDown;
|
|
296
|
+
$0[64] = onRemove;
|
|
297
|
+
$0[65] = placeholder;
|
|
298
|
+
$0[66] = selectInputTagsContentWrapperCva;
|
|
299
|
+
$0[67] = selectedItems;
|
|
300
|
+
$0[68] = selectedTagsType;
|
|
301
|
+
$0[69] = showTags;
|
|
302
|
+
$0[70] = t36;
|
|
303
|
+
} else t36 = $0[70];
|
|
265
304
|
let t37;
|
|
266
|
-
if ($0[
|
|
305
|
+
if ($0[71] !== as || $0[72] !== fieldProps || $0[73] !== isDisabled || $0[74] !== isEmpty || $0[75] !== isMultiple || $0[76] !== isOpen || $0[77] !== isSearchable || $0[78] !== onBlur || $0[79] !== onTriggerKeyDown || $0[80] !== placeholder || $0[81] !== selectedItems[0] || $0[82] !== setIsOpen || $0[83] !== showSelectionContent || $0[84] !== showTags) {
|
|
267
306
|
t37 = !isSearchable && /* @__PURE__ */ jsxs(Button, {
|
|
268
307
|
isDisabled,
|
|
269
308
|
onPress: () => setIsOpen(!isOpen),
|
|
@@ -278,24 +317,24 @@ var SelectInput = (t0) => {
|
|
|
278
317
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
279
318
|
})]
|
|
280
319
|
});
|
|
281
|
-
$0[
|
|
282
|
-
$0[
|
|
283
|
-
$0[
|
|
284
|
-
$0[
|
|
285
|
-
$0[
|
|
286
|
-
$0[
|
|
287
|
-
$0[
|
|
288
|
-
$0[
|
|
289
|
-
$0[
|
|
290
|
-
$0[
|
|
291
|
-
$0[
|
|
292
|
-
$0[
|
|
293
|
-
$0[
|
|
294
|
-
$0[
|
|
295
|
-
$0[
|
|
296
|
-
} else t37 = $0[
|
|
320
|
+
$0[71] = as;
|
|
321
|
+
$0[72] = fieldProps;
|
|
322
|
+
$0[73] = isDisabled;
|
|
323
|
+
$0[74] = isEmpty;
|
|
324
|
+
$0[75] = isMultiple;
|
|
325
|
+
$0[76] = isOpen;
|
|
326
|
+
$0[77] = isSearchable;
|
|
327
|
+
$0[78] = onBlur;
|
|
328
|
+
$0[79] = onTriggerKeyDown;
|
|
329
|
+
$0[80] = placeholder;
|
|
330
|
+
$0[81] = selectedItems[0];
|
|
331
|
+
$0[82] = setIsOpen;
|
|
332
|
+
$0[83] = showSelectionContent;
|
|
333
|
+
$0[84] = showTags;
|
|
334
|
+
$0[85] = t37;
|
|
335
|
+
} else t37 = $0[85];
|
|
297
336
|
let t38;
|
|
298
|
-
if ($0[
|
|
337
|
+
if ($0[86] !== onClick || $0[87] !== t33 || $0[88] !== t34 || $0[89] !== t35 || $0[90] !== t36 || $0[91] !== t37) {
|
|
299
338
|
t38 = /* @__PURE__ */ jsxs("div", {
|
|
300
339
|
className: t33,
|
|
301
340
|
onClick,
|
|
@@ -306,16 +345,16 @@ var SelectInput = (t0) => {
|
|
|
306
345
|
t37
|
|
307
346
|
]
|
|
308
347
|
});
|
|
309
|
-
$0[
|
|
310
|
-
$0[
|
|
311
|
-
$0[
|
|
312
|
-
$0[
|
|
313
|
-
$0[
|
|
314
|
-
$0[
|
|
315
|
-
$0[
|
|
316
|
-
} else t38 = $0[
|
|
348
|
+
$0[86] = onClick;
|
|
349
|
+
$0[87] = t33;
|
|
350
|
+
$0[88] = t34;
|
|
351
|
+
$0[89] = t35;
|
|
352
|
+
$0[90] = t36;
|
|
353
|
+
$0[91] = t37;
|
|
354
|
+
$0[92] = t38;
|
|
355
|
+
} else t38 = $0[92];
|
|
317
356
|
let t39;
|
|
318
|
-
if ($0[
|
|
357
|
+
if ($0[93] !== as || $0[94] !== inputClearClassCva || $0[95] !== isClearable || $0[96] !== isDisabled || $0[97] !== onClear || $0[98] !== showClearButton) {
|
|
319
358
|
t39 = isClearable && !isDisabled && /* @__PURE__ */ jsx(InputClear, {
|
|
320
359
|
onClear: () => {
|
|
321
360
|
onClear();
|
|
@@ -323,25 +362,25 @@ var SelectInput = (t0) => {
|
|
|
323
362
|
className: inputClearClassCva({ as }),
|
|
324
363
|
show: showClearButton
|
|
325
364
|
});
|
|
326
|
-
$0[
|
|
327
|
-
$0[
|
|
328
|
-
$0[
|
|
329
|
-
$0[
|
|
330
|
-
$0[
|
|
331
|
-
$0[
|
|
332
|
-
$0[
|
|
333
|
-
} else t39 = $0[
|
|
365
|
+
$0[93] = as;
|
|
366
|
+
$0[94] = inputClearClassCva;
|
|
367
|
+
$0[95] = isClearable;
|
|
368
|
+
$0[96] = isDisabled;
|
|
369
|
+
$0[97] = onClear;
|
|
370
|
+
$0[98] = showClearButton;
|
|
371
|
+
$0[99] = t39;
|
|
372
|
+
} else t39 = $0[99];
|
|
334
373
|
let t40;
|
|
335
|
-
if ($0[
|
|
374
|
+
if ($0[100] !== trailingContent) {
|
|
336
375
|
t40 = trailingContent && /* @__PURE__ */ jsx("div", {
|
|
337
376
|
className: "flex shrink-0 items-center",
|
|
338
377
|
children: trailingContent
|
|
339
378
|
});
|
|
340
|
-
$0[
|
|
341
|
-
$0[
|
|
342
|
-
} else t40 = $0[
|
|
379
|
+
$0[100] = trailingContent;
|
|
380
|
+
$0[101] = t40;
|
|
381
|
+
} else t40 = $0[101];
|
|
343
382
|
let t41;
|
|
344
|
-
if ($0[
|
|
383
|
+
if ($0[102] !== hideDropdownIcon || $0[103] !== inputSizeCva || $0[104] !== isDisabled || $0[105] !== isOpen || $0[106] !== isSearchable || $0[107] !== setIsOpen || $0[108] !== size || $0[109] !== t) {
|
|
345
384
|
t41 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
346
385
|
excludeFromTabOrder: true,
|
|
347
386
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -355,18 +394,18 @@ var SelectInput = (t0) => {
|
|
|
355
394
|
"aria-hidden": "true"
|
|
356
395
|
})
|
|
357
396
|
});
|
|
358
|
-
$0[
|
|
359
|
-
$0[
|
|
360
|
-
$0[
|
|
361
|
-
$0[
|
|
362
|
-
$0[
|
|
363
|
-
$0[
|
|
364
|
-
$0[
|
|
365
|
-
$0[
|
|
366
|
-
$0[
|
|
367
|
-
} else t41 = $0[
|
|
397
|
+
$0[102] = hideDropdownIcon;
|
|
398
|
+
$0[103] = inputSizeCva;
|
|
399
|
+
$0[104] = isDisabled;
|
|
400
|
+
$0[105] = isOpen;
|
|
401
|
+
$0[106] = isSearchable;
|
|
402
|
+
$0[107] = setIsOpen;
|
|
403
|
+
$0[108] = size;
|
|
404
|
+
$0[109] = t;
|
|
405
|
+
$0[110] = t41;
|
|
406
|
+
} else t41 = $0[110];
|
|
368
407
|
let t42;
|
|
369
|
-
if ($0[
|
|
408
|
+
if ($0[111] !== focusWithinProps || $0[112] !== hoverProps || $0[113] !== onFocusCapture || $0[114] !== onMouseEnter || $0[115] !== ref || $0[116] !== t16 || $0[117] !== t18 || $0[118] !== t19 || $0[119] !== t20 || $0[120] !== t21 || $0[121] !== t22 || $0[122] !== t23 || $0[123] !== t24 || $0[124] !== t25 || $0[125] !== t26 || $0[126] !== t27 || $0[127] !== t28 || $0[128] !== t29 || $0[129] !== t30 || $0[130] !== t31 || $0[131] !== t38 || $0[132] !== t39 || $0[133] !== t40 || $0[134] !== t41) {
|
|
370
409
|
t42 = /* @__PURE__ */ jsxs("div", {
|
|
371
410
|
ref,
|
|
372
411
|
className: t16,
|
|
@@ -397,32 +436,32 @@ var SelectInput = (t0) => {
|
|
|
397
436
|
t41
|
|
398
437
|
]
|
|
399
438
|
});
|
|
400
|
-
$0[
|
|
401
|
-
$0[
|
|
402
|
-
$0[
|
|
403
|
-
$0[
|
|
404
|
-
$0[
|
|
405
|
-
$0[
|
|
406
|
-
$0[
|
|
407
|
-
$0[
|
|
408
|
-
$0[
|
|
409
|
-
$0[
|
|
410
|
-
$0[
|
|
411
|
-
$0[
|
|
412
|
-
$0[
|
|
413
|
-
$0[
|
|
414
|
-
$0[
|
|
415
|
-
$0[
|
|
416
|
-
$0[
|
|
417
|
-
$0[
|
|
418
|
-
$0[
|
|
419
|
-
$0[
|
|
420
|
-
$0[
|
|
421
|
-
$0[
|
|
422
|
-
$0[
|
|
423
|
-
$0[
|
|
424
|
-
$0[
|
|
425
|
-
} else t42 = $0[
|
|
439
|
+
$0[111] = focusWithinProps;
|
|
440
|
+
$0[112] = hoverProps;
|
|
441
|
+
$0[113] = onFocusCapture;
|
|
442
|
+
$0[114] = onMouseEnter;
|
|
443
|
+
$0[115] = ref;
|
|
444
|
+
$0[116] = t16;
|
|
445
|
+
$0[117] = t18;
|
|
446
|
+
$0[118] = t19;
|
|
447
|
+
$0[119] = t20;
|
|
448
|
+
$0[120] = t21;
|
|
449
|
+
$0[121] = t22;
|
|
450
|
+
$0[122] = t23;
|
|
451
|
+
$0[123] = t24;
|
|
452
|
+
$0[124] = t25;
|
|
453
|
+
$0[125] = t26;
|
|
454
|
+
$0[126] = t27;
|
|
455
|
+
$0[127] = t28;
|
|
456
|
+
$0[128] = t29;
|
|
457
|
+
$0[129] = t30;
|
|
458
|
+
$0[130] = t31;
|
|
459
|
+
$0[131] = t38;
|
|
460
|
+
$0[132] = t39;
|
|
461
|
+
$0[133] = t40;
|
|
462
|
+
$0[134] = t41;
|
|
463
|
+
$0[135] = t42;
|
|
464
|
+
} else t42 = $0[135];
|
|
426
465
|
return t42;
|
|
427
466
|
};
|
|
428
467
|
//#endregion
|
|
@@ -23,9 +23,10 @@ export declare namespace SelectContext {
|
|
|
23
23
|
selectedItems: SelectItem[];
|
|
24
24
|
selectedIds: Key[];
|
|
25
25
|
isMultiple: boolean;
|
|
26
|
+
multiSelectAutoConfirm: boolean;
|
|
26
27
|
} & Pick<SelectBaseProps, "onInputChange" | "isLoading" | "hasLoadMore">;
|
|
27
|
-
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering" | "fireBlurOnChange" | "searchDebounceDelay" | "onBlur">;
|
|
28
|
-
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, searchDebounceDelay, onBlur: fieldOnBlur, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering" | "fireBlurOnChange" | "searchDebounceDelay" | "multiSelectAutoConfirm" | "onBlur">;
|
|
29
|
+
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, searchDebounceDelay, multiSelectAutoConfirm, onBlur: fieldOnBlur, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export const useSelect: () => Type;
|
|
30
31
|
export {};
|
|
31
32
|
}
|
|
@@ -10,7 +10,7 @@ var SelectContext;
|
|
|
10
10
|
id: item.id,
|
|
11
11
|
label: item.label ?? item.name ?? ""
|
|
12
12
|
});
|
|
13
|
-
_SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, searchDebounceDelay, onBlur: fieldOnBlur, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
|
|
13
|
+
_SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, searchDebounceDelay, multiSelectAutoConfirm = false, onBlur: fieldOnBlur, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
|
|
14
14
|
const isMultiple = props.selectionMode === "multiple";
|
|
15
15
|
const initialSelectedItems = useMemo(() => {
|
|
16
16
|
if (!props.initialSelection) return null;
|
|
@@ -189,6 +189,7 @@ var SelectContext;
|
|
|
189
189
|
selectedItems,
|
|
190
190
|
selectedIds,
|
|
191
191
|
isMultiple,
|
|
192
|
+
multiSelectAutoConfirm,
|
|
192
193
|
isLoading,
|
|
193
194
|
hasLoadMore
|
|
194
195
|
}), [
|
|
@@ -207,6 +208,7 @@ var SelectContext;
|
|
|
207
208
|
selectedIds,
|
|
208
209
|
selectedItems,
|
|
209
210
|
isMultiple,
|
|
211
|
+
multiSelectAutoConfirm,
|
|
210
212
|
isLoading,
|
|
211
213
|
hasLoadMore
|
|
212
214
|
]);
|
|
@@ -28,7 +28,7 @@ export declare namespace UIConfig {
|
|
|
28
28
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
29
29
|
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel" | "fireBlurOnChange">;
|
|
30
30
|
checkbox: Pick<CheckboxProps, "variant" | "fireBlurOnChange">;
|
|
31
|
-
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon" | "fireBlurOnChange">;
|
|
31
|
+
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon" | "fireBlurOnChange" | "multiSelectAutoConfirm">;
|
|
32
32
|
queryAutocomplete: {
|
|
33
33
|
isInitialQueryDisabled?: boolean;
|
|
34
34
|
resolveSelectedItemsWithIds?: boolean;
|