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