@povio/ui 3.2.3-rc.1 → 3.2.4-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.
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +142 -127
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +2 -17
- package/dist/components/inputs/DateTime/shared/DateField.js +92 -87
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +2 -0
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +144 -134
- package/dist/components/inputs/DateTime/shared/usePreserveExternalFocusOnUnmount.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/usePreserveExternalFocusOnUnmount.js +32 -0
- package/dist/components/inputs/File/fileUpload.types.d.ts +2 -4
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +80 -85
- package/dist/components/inputs/File/shared/FileUploadContentError.js +97 -102
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +93 -98
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +109 -114
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +91 -111
- package/dist/config/uiConfig.context.d.ts +1 -0
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/helpers/dynamicInputs.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/utils/date-time.utils.d.ts +0 -1
- package/dist/utils/date-time.utils.js +0 -34
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -105,7 +105,6 @@ 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);
|
|
109
108
|
const { fieldState, isOpen, setIsOpen, onInputChange, onChange, onClear, onSelectAll, listItems, selectableListItems, selectedIds, isMultiple } = SelectContext.useSelect();
|
|
110
109
|
const t4 = !isOpen;
|
|
111
110
|
let t5;
|
|
@@ -149,7 +148,6 @@ var SelectDesktop = (t0) => {
|
|
|
149
148
|
}
|
|
150
149
|
if (!isMultiple) {
|
|
151
150
|
onChange(value);
|
|
152
|
-
setShouldBlurAfterSingleSelection(true);
|
|
153
151
|
return;
|
|
154
152
|
}
|
|
155
153
|
if (!Array.isArray(fieldState.value)) {
|
|
@@ -264,44 +262,26 @@ var SelectDesktop = (t0) => {
|
|
|
264
262
|
} else t18 = $[70];
|
|
265
263
|
const showPopover = t18;
|
|
266
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];
|
|
267
271
|
let t20;
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
270
|
-
if (!shouldBlurAfterSingleSelection) return;
|
|
271
|
-
setShouldBlurAfterSingleSelection(false);
|
|
272
|
-
const activeElement = document.activeElement;
|
|
273
|
-
if (activeElement instanceof HTMLElement && triggerRef.current?.contains(activeElement)) activeElement.blur();
|
|
274
|
-
};
|
|
275
|
-
t20 = [shouldBlurAfterSingleSelection];
|
|
276
|
-
$[71] = shouldBlurAfterSingleSelection;
|
|
277
|
-
$[72] = t19;
|
|
278
|
-
$[73] = t20;
|
|
279
|
-
} else {
|
|
280
|
-
t19 = $[72];
|
|
281
|
-
t20 = $[73];
|
|
282
|
-
}
|
|
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 && {
|
|
272
|
+
if ($[74] !== containerClassName || $[75] !== isSearchable || $[76] !== labelProps) {
|
|
273
|
+
t20 = !isSearchable && {
|
|
294
274
|
labelProps,
|
|
295
275
|
className: clsx("group w-full", containerClassName)
|
|
296
276
|
};
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
} else
|
|
302
|
-
let
|
|
303
|
-
if ($[
|
|
304
|
-
|
|
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, {
|
|
305
285
|
...dialogTriggerProps,
|
|
306
286
|
children: /* @__PURE__ */ jsx("div", {
|
|
307
287
|
...fieldProps,
|
|
@@ -335,35 +315,35 @@ var SelectDesktop = (t0) => {
|
|
|
335
315
|
fieldProps,
|
|
336
316
|
headerProps
|
|
337
317
|
});
|
|
338
|
-
$[
|
|
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
|
-
} else
|
|
364
|
-
let
|
|
365
|
-
if ($[
|
|
366
|
-
|
|
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, {
|
|
367
347
|
triggerRef,
|
|
368
348
|
isOpen,
|
|
369
349
|
onOpenChange: setIsOpen,
|
|
@@ -376,61 +356,61 @@ var SelectDesktop = (t0) => {
|
|
|
376
356
|
autoFocus: !isSearchable
|
|
377
357
|
})
|
|
378
358
|
});
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
} else
|
|
390
|
-
let
|
|
391
|
-
if ($[
|
|
392
|
-
|
|
359
|
+
$[103] = ignoreTriggerWidth;
|
|
360
|
+
$[104] = isOpen;
|
|
361
|
+
$[105] = isSearchable;
|
|
362
|
+
$[106] = popoverCva;
|
|
363
|
+
$[107] = popoverWidth;
|
|
364
|
+
$[108] = props;
|
|
365
|
+
$[109] = selectPopoverCva;
|
|
366
|
+
$[110] = setIsOpen;
|
|
367
|
+
$[111] = showPopover;
|
|
368
|
+
$[112] = t22;
|
|
369
|
+
} else t22 = $[112];
|
|
370
|
+
let t23;
|
|
371
|
+
if ($[113] !== as || $[114] !== formFieldProps || $[115] !== onFocusCapture || $[116] !== onMouseEnter || $[117] !== t20 || $[118] !== t21 || $[119] !== t22) {
|
|
372
|
+
t23 = /* @__PURE__ */ jsxs(FormField, {
|
|
393
373
|
...formFieldProps,
|
|
394
|
-
...
|
|
374
|
+
...t20,
|
|
395
375
|
as,
|
|
396
376
|
onMouseEnter,
|
|
397
377
|
onFocusCapture,
|
|
398
378
|
ref: wrapperRef,
|
|
399
|
-
children: [
|
|
379
|
+
children: [t21, t22]
|
|
400
380
|
});
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
} else
|
|
410
|
-
let
|
|
411
|
-
if ($[
|
|
412
|
-
|
|
413
|
-
...
|
|
414
|
-
children:
|
|
381
|
+
$[113] = as;
|
|
382
|
+
$[114] = formFieldProps;
|
|
383
|
+
$[115] = onFocusCapture;
|
|
384
|
+
$[116] = onMouseEnter;
|
|
385
|
+
$[117] = t20;
|
|
386
|
+
$[118] = t21;
|
|
387
|
+
$[119] = t22;
|
|
388
|
+
$[120] = t23;
|
|
389
|
+
} else t23 = $[120];
|
|
390
|
+
let t24;
|
|
391
|
+
if ($[121] !== WrapperComponent || $[122] !== t19 || $[123] !== t23) {
|
|
392
|
+
t24 = /* @__PURE__ */ jsx(WrapperComponent, {
|
|
393
|
+
...t19,
|
|
394
|
+
children: t23
|
|
415
395
|
});
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
} else
|
|
421
|
-
let
|
|
422
|
-
if ($[
|
|
423
|
-
|
|
396
|
+
$[121] = WrapperComponent;
|
|
397
|
+
$[122] = t19;
|
|
398
|
+
$[123] = t23;
|
|
399
|
+
$[124] = t24;
|
|
400
|
+
} else t24 = $[124];
|
|
401
|
+
let t25;
|
|
402
|
+
if ($[125] !== as || $[126] !== error || $[127] !== t24) {
|
|
403
|
+
t25 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
424
404
|
as,
|
|
425
405
|
error,
|
|
426
|
-
children:
|
|
406
|
+
children: t24
|
|
427
407
|
});
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
} else
|
|
433
|
-
return
|
|
408
|
+
$[125] = as;
|
|
409
|
+
$[126] = error;
|
|
410
|
+
$[127] = t24;
|
|
411
|
+
$[128] = t25;
|
|
412
|
+
} else t25 = $[128];
|
|
413
|
+
return t25;
|
|
434
414
|
};
|
|
435
415
|
function _temp(item) {
|
|
436
416
|
return !item.isSelectAllItem;
|
|
@@ -48,6 +48,7 @@ export declare namespace UIConfig {
|
|
|
48
48
|
setDateValueOnDateSelection?: boolean;
|
|
49
49
|
timeZone?: string;
|
|
50
50
|
todayIconButtonComponent?: DatePickerProps["todayIconButtonComponent"];
|
|
51
|
+
allowPartialRange?: boolean;
|
|
51
52
|
};
|
|
52
53
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
53
54
|
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
@@ -78,7 +78,8 @@ var UIConfig;
|
|
|
78
78
|
setDateValueOnDateSelection: false,
|
|
79
79
|
timeZone: "clientLocal",
|
|
80
80
|
granularity: "day",
|
|
81
|
-
shouldUpdateDateOnMonthYearChange: false
|
|
81
|
+
shouldUpdateDateOnMonthYearChange: false,
|
|
82
|
+
allowPartialRange: false
|
|
82
83
|
},
|
|
83
84
|
actionModal: {
|
|
84
85
|
titleTypography: {
|
|
@@ -63,7 +63,7 @@ type GlobalProps = {
|
|
|
63
63
|
[T in Exclude<InputComponentType, "unknown">]: InputDefBaseProps<InputComponentProps<T>>;
|
|
64
64
|
}[Exclude<InputComponentType, "unknown">];
|
|
65
65
|
type SchemaKeyOrString<TSchema extends z.ZodObject<any>> = keyof z.infer<TSchema> | (string & {});
|
|
66
|
-
type DynamicInputsObjectSchema<TSchema extends z.ZodType> = TSchema extends z.ZodObject<any> ? TSchema : Extract<ZodUtils.UnwrapZod<TSchema>, z.ZodObject<any>>;
|
|
66
|
+
export type DynamicInputsObjectSchema<TSchema extends z.ZodType> = TSchema extends z.ZodObject<any> ? TSchema : Extract<ZodUtils.UnwrapZod<TSchema>, z.ZodObject<any>>;
|
|
67
67
|
interface DynamicInputsObjectOptions<TSchema extends z.ZodObject<any>> {
|
|
68
68
|
inputs?: InputsConfig<TSchema>;
|
|
69
69
|
order?: SchemaKeyOrString<TSchema>[];
|
package/dist/index.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ export { tagDefinition } from './components/text/Tag/tag.cva';
|
|
|
222
222
|
export { typographyDefinition } from './components/text/Typography/typography.cva';
|
|
223
223
|
export type { DynamicColumnsOptions } from './helpers/dynamicColumns';
|
|
224
224
|
export { dynamicColumns } from './helpers/dynamicColumns';
|
|
225
|
-
export type { DynamicInputsOptions } from './helpers/dynamicInputs';
|
|
225
|
+
export type { DynamicInputsObjectSchema, DynamicInputsOptions } from './helpers/dynamicInputs';
|
|
226
226
|
export { dynamicInputs } from './helpers/dynamicInputs';
|
|
227
227
|
export { useAutosave } from './hooks/useAutosave';
|
|
228
228
|
export { useBreakpoint } from './hooks/useBreakpoint';
|
|
@@ -38,6 +38,5 @@ export declare namespace DateTimeUtils {
|
|
|
38
38
|
export function fromUTCISOToCalendarDate(isoString: string): CalendarDate;
|
|
39
39
|
export function fromCalendarDateTimeToUTCISO(calendarDateTime: CalendarDateTime): string;
|
|
40
40
|
export function fromUTCISOToCalendarDateTime(isoString: string, timeZone?: string): CalendarDateTime;
|
|
41
|
-
export function formatTextDateToCalendarDateTime(textDate: string | null, timeZone?: string, locale?: string): CalendarDateTime | null;
|
|
42
41
|
export {};
|
|
43
42
|
}
|
|
@@ -39,20 +39,6 @@ var DateTimeUtils;
|
|
|
39
39
|
minute: "2-digit",
|
|
40
40
|
timeZone: "UTC"
|
|
41
41
|
});
|
|
42
|
-
const getLocaleDateFormat = (locale) => {
|
|
43
|
-
const sampleDate = new Date(Date.UTC(2e3, 10, 22));
|
|
44
|
-
return new Intl.DateTimeFormat(locale, {
|
|
45
|
-
day: "2-digit",
|
|
46
|
-
month: "2-digit",
|
|
47
|
-
year: "numeric",
|
|
48
|
-
timeZone: "UTC"
|
|
49
|
-
}).formatToParts(sampleDate).map((part) => {
|
|
50
|
-
if (part.type === "day") return "dd";
|
|
51
|
-
if (part.type === "month") return "MM";
|
|
52
|
-
if (part.type === "year") return "yyyy";
|
|
53
|
-
return part.value;
|
|
54
|
-
}).join("");
|
|
55
|
-
};
|
|
56
42
|
const repeatLocalizedFieldLabel = (type, length, locale) => {
|
|
57
43
|
const placeholderChar = new Intl.DisplayNames(getResolvedLocale(locale), { type: "dateTimeField" }).of(type)?.trim().charAt(0).toLocaleLowerCase(getResolvedLocale(locale));
|
|
58
44
|
if (!placeholderChar) return null;
|
|
@@ -191,26 +177,6 @@ var DateTimeUtils;
|
|
|
191
177
|
return new CalendarDateTime(zonedDateTime.year, zonedDateTime.month, zonedDateTime.day, zonedDateTime.hour, zonedDateTime.minute, zonedDateTime.second, zonedDateTime.millisecond);
|
|
192
178
|
}
|
|
193
179
|
_DateTimeUtils.fromUTCISOToCalendarDateTime = fromUTCISOToCalendarDateTime;
|
|
194
|
-
function formatTextDateToCalendarDateTime(textDate, timeZone, locale) {
|
|
195
|
-
if (!textDate?.includes("hh")) return null;
|
|
196
|
-
const datePart = textDate.split(",").at(0)?.trim();
|
|
197
|
-
if (!datePart) return null;
|
|
198
|
-
const resolvedTimeZone = resolveTimeZone(timeZone);
|
|
199
|
-
const resolvedLocale = locale || Intl.DateTimeFormat().resolvedOptions().locale;
|
|
200
|
-
const localeDateFormat = getLocaleDateFormat(resolvedLocale);
|
|
201
|
-
const parseOptions = {
|
|
202
|
-
zone: resolvedTimeZone,
|
|
203
|
-
locale: resolvedLocale
|
|
204
|
-
};
|
|
205
|
-
let parsedDateTime = DateTime.fromFormat(datePart, localeDateFormat, parseOptions);
|
|
206
|
-
if (!parsedDateTime.isValid && localeDateFormat.includes("yyyy")) {
|
|
207
|
-
const shortYearFormat = localeDateFormat.replace("yyyy", "yy");
|
|
208
|
-
parsedDateTime = DateTime.fromFormat(datePart, shortYearFormat, parseOptions);
|
|
209
|
-
}
|
|
210
|
-
if (!parsedDateTime.isValid) return null;
|
|
211
|
-
return new CalendarDateTime(parsedDateTime.year, parsedDateTime.month, parsedDateTime.day, 0, 0, 0, 0);
|
|
212
|
-
}
|
|
213
|
-
_DateTimeUtils.formatTextDateToCalendarDateTime = formatTextDateToCalendarDateTime;
|
|
214
180
|
})(DateTimeUtils || (DateTimeUtils = {}));
|
|
215
181
|
//#endregion
|
|
216
182
|
export { DateTimeUtils };
|