@povio/ui 3.2.2 → 3.2.3-rc.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.
|
@@ -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(132);
|
|
20
20
|
let containerClassName;
|
|
21
21
|
let customTrigger;
|
|
22
22
|
let error;
|
|
@@ -105,6 +105,7 @@ var SelectDesktop = (t0) => {
|
|
|
105
105
|
const closeComboBoxRef = useRef(null);
|
|
106
106
|
const wrapperRef = useRef(null);
|
|
107
107
|
const [popoverWidth, setPopoverWidth] = useState(void 0);
|
|
108
|
+
const [shouldBlurAfterSingleSelection, setShouldBlurAfterSingleSelection] = useState(false);
|
|
108
109
|
const { fieldState, isOpen, setIsOpen, onInputChange, onChange, onClear, onSelectAll, listItems, selectableListItems, selectedIds, isMultiple } = SelectContext.useSelect();
|
|
109
110
|
const t4 = !isOpen;
|
|
110
111
|
let t5;
|
|
@@ -137,13 +138,9 @@ var SelectDesktop = (t0) => {
|
|
|
137
138
|
t7 = $[32];
|
|
138
139
|
}
|
|
139
140
|
useLayoutEffect(t6, t7);
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
|
|
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) => {
|
|
141
|
+
let t8;
|
|
142
|
+
if ($[33] !== fieldState.value || $[34] !== isMultiple || $[35] !== onChange || $[36] !== onClear || $[37] !== onSelectAll || $[38] !== selectableListItems || $[39] !== selectedIds) {
|
|
143
|
+
t8 = (value) => {
|
|
147
144
|
if (!value) return;
|
|
148
145
|
if (value === "all-item-id") {
|
|
149
146
|
if (selectedIds.length === selectableListItems.length) onClear();
|
|
@@ -152,7 +149,7 @@ var SelectDesktop = (t0) => {
|
|
|
152
149
|
}
|
|
153
150
|
if (!isMultiple) {
|
|
154
151
|
onChange(value);
|
|
155
|
-
|
|
152
|
+
setShouldBlurAfterSingleSelection(true);
|
|
156
153
|
return;
|
|
157
154
|
}
|
|
158
155
|
if (!Array.isArray(fieldState.value)) {
|
|
@@ -162,147 +159,149 @@ var SelectDesktop = (t0) => {
|
|
|
162
159
|
if (fieldState.value.includes(value)) onChange(fieldState.value.filter((id) => id !== value));
|
|
163
160
|
else onChange(fieldState.value.concat(value));
|
|
164
161
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
162
|
+
$[33] = fieldState.value;
|
|
163
|
+
$[34] = isMultiple;
|
|
164
|
+
$[35] = onChange;
|
|
165
|
+
$[36] = onClear;
|
|
166
|
+
$[37] = onSelectAll;
|
|
167
|
+
$[38] = selectableListItems;
|
|
168
|
+
$[39] = selectedIds;
|
|
169
|
+
$[40] = t8;
|
|
170
|
+
} else t8 = $[40];
|
|
171
|
+
const onSelectionChange = t8;
|
|
172
|
+
let t9;
|
|
173
|
+
if ($[41] !== setIsOpen) {
|
|
174
|
+
t9 = (value_0) => {
|
|
175
|
+
if (closeComboBoxRef.current && value_0) {
|
|
176
|
+
closeComboBoxRef.current.setOpen(false);
|
|
177
|
+
closeComboBoxRef.current = null;
|
|
178
|
+
} else setIsOpen(value_0);
|
|
179
|
+
};
|
|
180
|
+
$[41] = setIsOpen;
|
|
181
|
+
$[42] = t9;
|
|
182
|
+
} else t9 = $[42];
|
|
183
|
+
const openChangeHandler = t9;
|
|
184
|
+
const WrapperComponent = isSearchable ? ComboBox : Fragment$1;
|
|
185
|
+
const t10 = isMultiple ? null : fieldState.value;
|
|
186
|
+
const t11 = fieldState.inputValue;
|
|
187
|
+
const t12 = !!error;
|
|
188
|
+
let t13;
|
|
189
|
+
if ($[43] !== containerClassName) {
|
|
190
|
+
t13 = clsx("group w-full", containerClassName);
|
|
191
|
+
$[43] = containerClassName;
|
|
192
|
+
$[44] = t13;
|
|
193
|
+
} else t13 = $[44];
|
|
194
|
+
let t14;
|
|
195
|
+
if ($[45] !== fieldState.inputValue || $[46] !== isDisabled || $[47] !== listItems || $[48] !== onInputChange || $[49] !== onSelectionChange || $[50] !== openChangeHandler || $[51] !== t10 || $[52] !== t12 || $[53] !== t13) {
|
|
196
|
+
t14 = {
|
|
186
197
|
items: listItems,
|
|
187
|
-
selectedKey:
|
|
198
|
+
selectedKey: t10,
|
|
188
199
|
onSelectionChange,
|
|
189
|
-
inputValue:
|
|
200
|
+
inputValue: t11,
|
|
190
201
|
onInputChange,
|
|
191
202
|
onOpenChange: openChangeHandler,
|
|
192
203
|
allowsEmptyCollection: true,
|
|
193
204
|
isDisabled,
|
|
194
|
-
isInvalid:
|
|
205
|
+
isInvalid: t12,
|
|
195
206
|
menuTrigger: "focus",
|
|
196
|
-
className:
|
|
207
|
+
className: t13
|
|
197
208
|
};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
209
|
+
$[45] = fieldState.inputValue;
|
|
210
|
+
$[46] = isDisabled;
|
|
211
|
+
$[47] = listItems;
|
|
212
|
+
$[48] = onInputChange;
|
|
213
|
+
$[49] = onSelectionChange;
|
|
214
|
+
$[50] = openChangeHandler;
|
|
215
|
+
$[51] = t10;
|
|
216
|
+
$[52] = t12;
|
|
217
|
+
$[53] = t13;
|
|
218
|
+
$[54] = t14;
|
|
219
|
+
} else t14 = $[54];
|
|
220
|
+
const comboBoxProps = t14;
|
|
221
|
+
const t15 = hideLabel || isHeaderHidden;
|
|
222
|
+
let t16;
|
|
223
|
+
if ($[55] !== headerClassName || $[56] !== helperText || $[57] !== isDisabled || $[58] !== isRequired || $[59] !== label || $[60] !== labelProps || $[61] !== rightContent || $[62] !== t15 || $[63] !== tooltipText) {
|
|
224
|
+
t16 = {
|
|
225
|
+
label,
|
|
226
|
+
tooltipText,
|
|
227
|
+
helperText,
|
|
228
|
+
isRequired,
|
|
229
|
+
rightContent,
|
|
230
|
+
isHeaderHidden: t15,
|
|
231
|
+
isDisabled,
|
|
232
|
+
className: headerClassName,
|
|
233
|
+
labelProps
|
|
234
|
+
};
|
|
235
|
+
$[55] = headerClassName;
|
|
236
|
+
$[56] = helperText;
|
|
237
|
+
$[57] = isDisabled;
|
|
238
|
+
$[58] = isRequired;
|
|
239
|
+
$[59] = label;
|
|
240
|
+
$[60] = labelProps;
|
|
241
|
+
$[61] = rightContent;
|
|
242
|
+
$[62] = t15;
|
|
243
|
+
$[63] = tooltipText;
|
|
244
|
+
$[64] = t16;
|
|
245
|
+
} else t16 = $[64];
|
|
246
|
+
const headerProps = t16;
|
|
247
|
+
let t17;
|
|
248
|
+
if ($[65] !== isOpen || $[66] !== setIsOpen) {
|
|
249
|
+
t17 = {
|
|
250
|
+
isOpen,
|
|
251
|
+
onOpenChange: setIsOpen
|
|
252
|
+
};
|
|
253
|
+
$[65] = isOpen;
|
|
254
|
+
$[66] = setIsOpen;
|
|
255
|
+
$[67] = t17;
|
|
256
|
+
} else t17 = $[67];
|
|
257
|
+
const dialogTriggerProps = t17;
|
|
258
|
+
let t18;
|
|
259
|
+
if ($[68] !== isLoading || $[69] !== listItems) {
|
|
260
|
+
t18 = listItems.filter(_temp).length > 0 || isLoading;
|
|
261
|
+
$[68] = isLoading;
|
|
262
|
+
$[69] = listItems;
|
|
263
|
+
$[70] = t18;
|
|
264
|
+
} else t18 = $[70];
|
|
265
|
+
const showPopover = t18;
|
|
266
|
+
let t19;
|
|
267
|
+
let t20;
|
|
268
|
+
if ($[71] !== shouldBlurAfterSingleSelection) {
|
|
269
|
+
t19 = () => {
|
|
270
|
+
if (!shouldBlurAfterSingleSelection) return;
|
|
271
|
+
setShouldBlurAfterSingleSelection(false);
|
|
244
272
|
const activeElement = document.activeElement;
|
|
245
|
-
if (activeElement instanceof HTMLElement &&
|
|
273
|
+
if (activeElement instanceof HTMLElement && triggerRef.current?.contains(activeElement)) activeElement.blur();
|
|
246
274
|
};
|
|
247
|
-
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
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;
|
|
275
|
+
t20 = [shouldBlurAfterSingleSelection];
|
|
276
|
+
$[71] = shouldBlurAfterSingleSelection;
|
|
277
|
+
$[72] = t19;
|
|
278
|
+
$[73] = t20;
|
|
278
279
|
} else {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
dialogTriggerProps = $[61];
|
|
282
|
-
headerProps = $[62];
|
|
283
|
-
showPopover = $[63];
|
|
280
|
+
t19 = $[72];
|
|
281
|
+
t20 = $[73];
|
|
284
282
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
283
|
+
useLayoutEffect(t19, t20);
|
|
284
|
+
let t21;
|
|
285
|
+
if ($[74] !== comboBoxProps || $[75] !== isSearchable) {
|
|
286
|
+
t21 = isSearchable ? comboBoxProps : {};
|
|
287
|
+
$[74] = comboBoxProps;
|
|
288
|
+
$[75] = isSearchable;
|
|
289
|
+
$[76] = t21;
|
|
290
|
+
} else t21 = $[76];
|
|
291
|
+
let t22;
|
|
292
|
+
if ($[77] !== containerClassName || $[78] !== isSearchable || $[79] !== labelProps) {
|
|
293
|
+
t22 = !isSearchable && {
|
|
295
294
|
labelProps,
|
|
296
295
|
className: clsx("group w-full", containerClassName)
|
|
297
296
|
};
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
} else
|
|
303
|
-
let
|
|
304
|
-
if ($[
|
|
305
|
-
|
|
297
|
+
$[77] = containerClassName;
|
|
298
|
+
$[78] = isSearchable;
|
|
299
|
+
$[79] = labelProps;
|
|
300
|
+
$[80] = t22;
|
|
301
|
+
} else t22 = $[80];
|
|
302
|
+
let t23;
|
|
303
|
+
if ($[81] !== as || $[82] !== className || $[83] !== collapseAfter || $[84] !== customTrigger || $[85] !== dialogTriggerProps || $[86] !== error || $[87] !== fieldProps || $[88] !== headerProps || $[89] !== hideDropdownIcon || $[90] !== inputClassName || $[91] !== isClearable || $[92] !== isDirty || $[93] !== isDisabled || $[94] !== isRequired || $[95] !== isSearchable || $[96] !== leadingContent || $[97] !== onBlur || $[98] !== placeholder || $[99] !== ref || $[100] !== selectedTagsType || $[101] !== showSelectionContent || $[102] !== size || $[103] !== trailingContent || $[104] !== variant) {
|
|
304
|
+
t23 = customTrigger ? /* @__PURE__ */ jsx(DialogTrigger, {
|
|
306
305
|
...dialogTriggerProps,
|
|
307
306
|
children: /* @__PURE__ */ jsx("div", {
|
|
308
307
|
...fieldProps,
|
|
@@ -336,35 +335,35 @@ var SelectDesktop = (t0) => {
|
|
|
336
335
|
fieldProps,
|
|
337
336
|
headerProps
|
|
338
337
|
});
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
} else
|
|
365
|
-
let
|
|
366
|
-
if ($[
|
|
367
|
-
|
|
338
|
+
$[81] = as;
|
|
339
|
+
$[82] = className;
|
|
340
|
+
$[83] = collapseAfter;
|
|
341
|
+
$[84] = customTrigger;
|
|
342
|
+
$[85] = dialogTriggerProps;
|
|
343
|
+
$[86] = error;
|
|
344
|
+
$[87] = fieldProps;
|
|
345
|
+
$[88] = headerProps;
|
|
346
|
+
$[89] = hideDropdownIcon;
|
|
347
|
+
$[90] = inputClassName;
|
|
348
|
+
$[91] = isClearable;
|
|
349
|
+
$[92] = isDirty;
|
|
350
|
+
$[93] = isDisabled;
|
|
351
|
+
$[94] = isRequired;
|
|
352
|
+
$[95] = isSearchable;
|
|
353
|
+
$[96] = leadingContent;
|
|
354
|
+
$[97] = onBlur;
|
|
355
|
+
$[98] = placeholder;
|
|
356
|
+
$[99] = ref;
|
|
357
|
+
$[100] = selectedTagsType;
|
|
358
|
+
$[101] = showSelectionContent;
|
|
359
|
+
$[102] = size;
|
|
360
|
+
$[103] = trailingContent;
|
|
361
|
+
$[104] = variant;
|
|
362
|
+
$[105] = t23;
|
|
363
|
+
} else t23 = $[105];
|
|
364
|
+
let t24;
|
|
365
|
+
if ($[106] !== ignoreTriggerWidth || $[107] !== isOpen || $[108] !== isSearchable || $[109] !== popoverCva || $[110] !== popoverWidth || $[111] !== props || $[112] !== selectPopoverCva || $[113] !== setIsOpen || $[114] !== showPopover) {
|
|
366
|
+
t24 = (!isSearchable || showPopover) && /* @__PURE__ */ jsx(Popover, {
|
|
368
367
|
triggerRef,
|
|
369
368
|
isOpen,
|
|
370
369
|
onOpenChange: setIsOpen,
|
|
@@ -377,61 +376,61 @@ var SelectDesktop = (t0) => {
|
|
|
377
376
|
autoFocus: !isSearchable
|
|
378
377
|
})
|
|
379
378
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
} else
|
|
391
|
-
let
|
|
392
|
-
if ($[
|
|
393
|
-
|
|
379
|
+
$[106] = ignoreTriggerWidth;
|
|
380
|
+
$[107] = isOpen;
|
|
381
|
+
$[108] = isSearchable;
|
|
382
|
+
$[109] = popoverCva;
|
|
383
|
+
$[110] = popoverWidth;
|
|
384
|
+
$[111] = props;
|
|
385
|
+
$[112] = selectPopoverCva;
|
|
386
|
+
$[113] = setIsOpen;
|
|
387
|
+
$[114] = showPopover;
|
|
388
|
+
$[115] = t24;
|
|
389
|
+
} else t24 = $[115];
|
|
390
|
+
let t25;
|
|
391
|
+
if ($[116] !== as || $[117] !== formFieldProps || $[118] !== onFocusCapture || $[119] !== onMouseEnter || $[120] !== t22 || $[121] !== t23 || $[122] !== t24) {
|
|
392
|
+
t25 = /* @__PURE__ */ jsxs(FormField, {
|
|
394
393
|
...formFieldProps,
|
|
395
|
-
...
|
|
394
|
+
...t22,
|
|
396
395
|
as,
|
|
397
396
|
onMouseEnter,
|
|
398
397
|
onFocusCapture,
|
|
399
398
|
ref: wrapperRef,
|
|
400
|
-
children: [
|
|
399
|
+
children: [t23, t24]
|
|
401
400
|
});
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
} else
|
|
411
|
-
let
|
|
412
|
-
if ($[
|
|
413
|
-
|
|
414
|
-
...
|
|
415
|
-
children:
|
|
401
|
+
$[116] = as;
|
|
402
|
+
$[117] = formFieldProps;
|
|
403
|
+
$[118] = onFocusCapture;
|
|
404
|
+
$[119] = onMouseEnter;
|
|
405
|
+
$[120] = t22;
|
|
406
|
+
$[121] = t23;
|
|
407
|
+
$[122] = t24;
|
|
408
|
+
$[123] = t25;
|
|
409
|
+
} else t25 = $[123];
|
|
410
|
+
let t26;
|
|
411
|
+
if ($[124] !== WrapperComponent || $[125] !== t21 || $[126] !== t25) {
|
|
412
|
+
t26 = /* @__PURE__ */ jsx(WrapperComponent, {
|
|
413
|
+
...t21,
|
|
414
|
+
children: t25
|
|
416
415
|
});
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
} else
|
|
422
|
-
let
|
|
423
|
-
if ($[
|
|
424
|
-
|
|
416
|
+
$[124] = WrapperComponent;
|
|
417
|
+
$[125] = t21;
|
|
418
|
+
$[126] = t25;
|
|
419
|
+
$[127] = t26;
|
|
420
|
+
} else t26 = $[127];
|
|
421
|
+
let t27;
|
|
422
|
+
if ($[128] !== as || $[129] !== error || $[130] !== t26) {
|
|
423
|
+
t27 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
425
424
|
as,
|
|
426
425
|
error,
|
|
427
|
-
children:
|
|
426
|
+
children: t26
|
|
428
427
|
});
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
} else
|
|
434
|
-
return
|
|
428
|
+
$[128] = as;
|
|
429
|
+
$[129] = error;
|
|
430
|
+
$[130] = t26;
|
|
431
|
+
$[131] = t27;
|
|
432
|
+
} else t27 = $[131];
|
|
433
|
+
return t27;
|
|
435
434
|
};
|
|
436
435
|
function _temp(item) {
|
|
437
436
|
return !item.isSelectAllItem;
|