@povio/ui 3.2.2-rc.6 → 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/DateTime/shared/DateField.js +80 -83
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +6 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +6 -0
- package/dist/components/inputs/File/shared/FileCard.d.ts +2 -2
- package/dist/components/inputs/File/shared/FileCard.js +46 -40
- package/dist/components/inputs/File/shared/FileCardList.d.ts +2 -2
- package/dist/components/inputs/File/shared/FileCardList.js +27 -21
- package/dist/components/inputs/File/shared/FileUploadContent.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContent.js +98 -84
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.d.ts +2 -2
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +157 -121
- package/dist/components/inputs/File/shared/FileUploadContentError.d.ts +2 -2
- package/dist/components/inputs/File/shared/FileUploadContentError.js +189 -153
- package/dist/components/inputs/File/shared/FileUploadContentFilled.d.ts +2 -2
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +181 -145
- package/dist/components/inputs/File/shared/FileUploadContentLoading.d.ts +2 -2
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +209 -168
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +4 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +42 -38
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +2 -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 +4 -2
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +4 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +91 -64
- package/dist/config/uiConfig.context.d.ts +5 -1
- package/dist/config/uiConfig.context.js +12 -3
- package/package.json +1 -1
|
@@ -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" | "onBlur">;
|
|
28
|
-
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, 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, 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;
|
|
@@ -23,7 +23,7 @@ var SelectContext;
|
|
|
23
23
|
inputValue: "",
|
|
24
24
|
searchValue: ""
|
|
25
25
|
});
|
|
26
|
-
const { callback: onSearchChangeDebounced, isDebouncing } = useDebounceCallback(onSearchChange);
|
|
26
|
+
const { callback: onSearchChangeDebounced, isDebouncing } = useDebounceCallback(onSearchChange, { delay: searchDebounceDelay });
|
|
27
27
|
const [showAll, setShowAll] = useState(false);
|
|
28
28
|
const [cachedItems, setCachedItems] = useState(items);
|
|
29
29
|
const valueRef = useRef(initialSelectedItems);
|
|
@@ -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
|
]);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { PopoverProps } from 'react-aria-components';
|
|
2
3
|
import { BottomSheetProps } from '../BottomSheet/BottomSheet';
|
|
3
4
|
type ResponsivePopoverBottomSheetProps = Partial<Omit<BottomSheetProps, "children" | "isOpen" | "onOpenChange" | "trigger">>;
|
|
5
|
+
type ResponsivePopoverPopoverProps = Partial<Omit<PopoverProps, "children" | "className">>;
|
|
4
6
|
export interface ResponsivePopoverProps {
|
|
5
7
|
trigger: ReactElement;
|
|
6
8
|
children: ReactNode;
|
|
@@ -9,6 +11,7 @@ export interface ResponsivePopoverProps {
|
|
|
9
11
|
popoverClassName?: string;
|
|
10
12
|
sheetLabel: string;
|
|
11
13
|
bottomSheetProps?: ResponsivePopoverBottomSheetProps;
|
|
14
|
+
popoverProps?: ResponsivePopoverPopoverProps;
|
|
12
15
|
}
|
|
13
|
-
export declare const ResponsivePopover: ({ trigger, isOpen, onOpenChange, children, popoverClassName, sheetLabel, bottomSheetProps, }: ResponsivePopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const ResponsivePopover: ({ trigger, isOpen, onOpenChange, children, popoverClassName, sheetLabel, bottomSheetProps, popoverProps, }: ResponsivePopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export {};
|