@povio/ui 3.3.0 → 3.3.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/README.md +1 -1
- package/dist/browser-tests/checkbox/CheckboxGroupHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/CheckboxHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/checkbox-group.spec.d.ts +1 -0
- package/dist/browser-tests/checkbox/checkbox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/DateTimeHarnesses.d.ts +43 -0
- package/dist/browser-tests/datetime-picker/assertions.d.ts +9 -0
- package/dist/browser-tests/datetime-picker/date-input-focus.firefox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-range-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload/FileUploadHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload/file-upload.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload-container/FileUploadContainerHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload-container/file-upload-container.spec.d.ts +1 -0
- package/dist/browser-tests/input-upload/InputUploadHarness.d.ts +9 -0
- package/dist/browser-tests/input-upload/input-upload.spec.d.ts +1 -0
- package/dist/browser-tests/modal/ModalHarness.d.ts +5 -0
- package/dist/browser-tests/modal/modal.spec.d.ts +1 -0
- package/dist/browser-tests/number-input/NumberInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-input/number-input.spec.d.ts +1 -0
- package/dist/browser-tests/number-range-input/NumberRangeInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-range-input/number-range-input.spec.d.ts +1 -0
- package/dist/browser-tests/password-input/PasswordInputHarness.d.ts +6 -0
- package/dist/browser-tests/password-input/password-input.spec.d.ts +1 -0
- package/dist/browser-tests/radio-group/RadioGroupHarness.d.ts +15 -0
- package/dist/browser-tests/radio-group/radio-group.spec.d.ts +1 -0
- package/dist/browser-tests/selection/SelectionHarnesses.d.ts +61 -0
- package/dist/browser-tests/selection/autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/interactions.d.ts +2 -0
- package/dist/browser-tests/selection/query-autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/query-select.spec.d.ts +1 -0
- package/dist/browser-tests/selection/select.spec.d.ts +1 -0
- package/dist/browser-tests/slider/SliderHarness.d.ts +11 -0
- package/dist/browser-tests/slider/slider.spec.d.ts +1 -0
- package/dist/browser-tests/text-area/TextAreaHarness.d.ts +10 -0
- package/dist/browser-tests/text-area/text-area.spec.d.ts +1 -0
- package/dist/browser-tests/text-input/TextInputHarness.d.ts +10 -0
- package/dist/browser-tests/text-input/text-input.spec.d.ts +1 -0
- package/dist/browser-tests/toggle/ToggleHarness.d.ts +10 -0
- package/dist/browser-tests/toggle/toggle.spec.d.ts +1 -0
- package/dist/browser-tests/utils/blur.d.ts +22 -0
- package/dist/browser-tests/utils/events.d.ts +4 -0
- package/dist/browser-tests/utils/input.d.ts +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +206 -55
- package/dist/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/Button/button.cva.js +4 -4
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +4 -4
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +222 -74
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +182 -56
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +128 -41
- package/dist/components/inputs/DateTime/shared/Calendar.js +339 -139
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +308 -114
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -35
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +229 -95
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +296 -115
- package/dist/components/inputs/DateTime/shared/DateField.js +306 -135
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +338 -140
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +261 -65
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +180 -48
- package/dist/components/inputs/File/shared/FileUploadContentError.js +265 -95
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +261 -99
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +234 -56
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +313 -75
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +83 -23
- package/dist/components/inputs/Selection/Select/QuerySelect.js +96 -30
- package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
- package/dist/components/inputs/Selection/shared/useSelectItems.js +108 -48
- package/dist/components/inputs/Skeleton/InputFrame.js +550 -177
- package/dist/components/inputs/TextEditor/TextEditor.js +389 -87
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +3 -2
- package/dist/components/overlays/Modal/Modal.js +3 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +110 -29
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.js +39 -8
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFormAutosave.js +120 -33
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/vitest.setup.browser.d.ts +6 -0
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
|
13
13
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
14
14
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
15
15
|
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
16
|
+
import { c } from "react/compiler-runtime";
|
|
16
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
18
|
import { clsx } from "clsx";
|
|
18
19
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -271,7 +272,11 @@ var DatePickerBase = (props) => {
|
|
|
271
272
|
})
|
|
272
273
|
});
|
|
273
274
|
};
|
|
274
|
-
var DatePickerInner = (
|
|
275
|
+
var DatePickerInner = (t0) => {
|
|
276
|
+
const $ = c(28);
|
|
277
|
+
const { fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
278
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
279
|
+
const granularity = t2 === void 0 ? "day" : t2;
|
|
275
280
|
const ui = UIConfig.useConfig();
|
|
276
281
|
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
277
282
|
const { locale } = useLocale();
|
|
@@ -282,42 +287,76 @@ var DatePickerInner = ({ fullIso = true, granularity = "day", minValue, maxValue
|
|
|
282
287
|
inputRef,
|
|
283
288
|
renderInput,
|
|
284
289
|
setRenderInput,
|
|
285
|
-
getFocusTarget:
|
|
286
|
-
|
|
287
|
-
return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
|
|
288
|
-
},
|
|
289
|
-
getPressTarget: (input_0) => {
|
|
290
|
-
const container_0 = input_0.getContainer?.() ?? input_0;
|
|
291
|
-
if (!(container_0 instanceof HTMLElement)) return null;
|
|
292
|
-
return container_0.querySelector("[data-static-press-action]");
|
|
293
|
-
}
|
|
290
|
+
getFocusTarget: _temp,
|
|
291
|
+
getPressTarget: _temp2
|
|
294
292
|
});
|
|
295
293
|
const normalizedValue = props.value ?? null;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
294
|
+
let t3;
|
|
295
|
+
if ($[0] !== granularity) {
|
|
296
|
+
t3 = (date) => {
|
|
297
|
+
if (granularity === "year") return date.set({
|
|
298
|
+
month: 1,
|
|
299
|
+
day: 1
|
|
300
|
+
});
|
|
301
|
+
if (granularity === "month") return date.set({ day: 1 });
|
|
302
|
+
return date;
|
|
303
|
+
};
|
|
304
|
+
$[0] = granularity;
|
|
305
|
+
$[1] = t3;
|
|
306
|
+
} else t3 = $[1];
|
|
307
|
+
const normalizeByGranularity = t3;
|
|
308
|
+
let t4;
|
|
309
|
+
if ($[2] !== fullIso || $[3] !== normalizeByGranularity) {
|
|
310
|
+
t4 = (calendarDate) => {
|
|
311
|
+
if (calendarDate === null) return null;
|
|
312
|
+
const normalizedDate = normalizeByGranularity(calendarDate);
|
|
313
|
+
if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
|
|
314
|
+
const date_0 = DateTimeUtils.fromDateValueToLocal(normalizedDate, "UTC");
|
|
315
|
+
return DateTime.fromJSDate(date_0, { zone: "UTC" }).toISODate();
|
|
316
|
+
};
|
|
317
|
+
$[2] = fullIso;
|
|
318
|
+
$[3] = normalizeByGranularity;
|
|
319
|
+
$[4] = t4;
|
|
320
|
+
} else t4 = $[4];
|
|
321
|
+
const formatCalendarDate = t4;
|
|
322
|
+
let t5;
|
|
323
|
+
if ($[5] !== fullIso || $[6] !== normalizeByGranularity) {
|
|
324
|
+
t5 = (formattedDate) => {
|
|
325
|
+
if (formattedDate == null) return null;
|
|
326
|
+
if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
|
|
327
|
+
const date_1 = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
|
|
328
|
+
return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1, "UTC")));
|
|
329
|
+
};
|
|
330
|
+
$[5] = fullIso;
|
|
331
|
+
$[6] = normalizeByGranularity;
|
|
332
|
+
$[7] = t5;
|
|
333
|
+
} else t5 = $[7];
|
|
334
|
+
const parseCalendarDate = t5;
|
|
335
|
+
let t6;
|
|
336
|
+
if ($[8] !== minValue || $[9] !== parseCalendarDate) {
|
|
337
|
+
t6 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
|
|
338
|
+
$[8] = minValue;
|
|
339
|
+
$[9] = parseCalendarDate;
|
|
340
|
+
$[10] = t6;
|
|
341
|
+
} else t6 = $[10];
|
|
342
|
+
let t7;
|
|
343
|
+
if ($[11] !== maxValue || $[12] !== parseCalendarDate) {
|
|
344
|
+
t7 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
|
|
345
|
+
$[11] = maxValue;
|
|
346
|
+
$[12] = parseCalendarDate;
|
|
347
|
+
$[13] = t7;
|
|
348
|
+
} else t7 = $[13];
|
|
349
|
+
let t8;
|
|
350
|
+
if ($[14] !== t6 || $[15] !== t7) {
|
|
351
|
+
t8 = {
|
|
352
|
+
minValue: t6,
|
|
353
|
+
maxValue: t7
|
|
354
|
+
};
|
|
355
|
+
$[14] = t6;
|
|
356
|
+
$[15] = t7;
|
|
357
|
+
$[16] = t8;
|
|
358
|
+
} else t8 = $[16];
|
|
359
|
+
const dateLimits = t8;
|
|
321
360
|
if (!renderInput) {
|
|
322
361
|
const dateValue = normalizedValue ? parseCalendarDate(normalizedValue) : null;
|
|
323
362
|
const as = props.as ?? ui.input.as;
|
|
@@ -375,54 +414,163 @@ var DatePickerInner = ({ fullIso = true, granularity = "day", minValue, maxValue
|
|
|
375
414
|
trailingClassName: "py-0! pl-0!",
|
|
376
415
|
action: showDropdown ? {
|
|
377
416
|
icon: ui.dateInput.calendarIcon,
|
|
378
|
-
onClick:
|
|
417
|
+
onClick: _temp3,
|
|
379
418
|
altText: ""
|
|
380
419
|
} : void 0,
|
|
381
420
|
children: staticSegments
|
|
382
421
|
});
|
|
383
422
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
value
|
|
390
|
-
|
|
391
|
-
|
|
423
|
+
const T0 = DatePickerBase;
|
|
424
|
+
const t9 = mergeRefs(props.ref, inputRef);
|
|
425
|
+
const t10 = parseCalendarDate(normalizedValue);
|
|
426
|
+
let t11;
|
|
427
|
+
if ($[17] !== formatCalendarDate || $[18] !== props) {
|
|
428
|
+
t11 = (value) => props.onChange?.(formatCalendarDate(value));
|
|
429
|
+
$[17] = formatCalendarDate;
|
|
430
|
+
$[18] = props;
|
|
431
|
+
$[19] = t11;
|
|
432
|
+
} else t11 = $[19];
|
|
433
|
+
let t12;
|
|
434
|
+
if ($[20] !== T0 || $[21] !== dateLimits || $[22] !== granularity || $[23] !== props || $[24] !== t10 || $[25] !== t11 || $[26] !== t9) {
|
|
435
|
+
t12 = /* @__PURE__ */ jsx(T0, {
|
|
436
|
+
...props,
|
|
437
|
+
...dateLimits,
|
|
438
|
+
ref: t9,
|
|
439
|
+
granularity,
|
|
440
|
+
value: t10,
|
|
441
|
+
onChange: t11
|
|
442
|
+
});
|
|
443
|
+
$[20] = T0;
|
|
444
|
+
$[21] = dateLimits;
|
|
445
|
+
$[22] = granularity;
|
|
446
|
+
$[23] = props;
|
|
447
|
+
$[24] = t10;
|
|
448
|
+
$[25] = t11;
|
|
449
|
+
$[26] = t9;
|
|
450
|
+
$[27] = t12;
|
|
451
|
+
} else t12 = $[27];
|
|
452
|
+
return t12;
|
|
392
453
|
};
|
|
393
|
-
var DatePicker = (
|
|
454
|
+
var DatePicker = (t0) => {
|
|
455
|
+
const $ = c(33);
|
|
456
|
+
let maxValue;
|
|
457
|
+
let minValue;
|
|
458
|
+
let props;
|
|
459
|
+
let renderStaticInput;
|
|
460
|
+
let t1;
|
|
461
|
+
let t2;
|
|
462
|
+
if ($[0] !== t0) {
|
|
463
|
+
({fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, ...props} = t0);
|
|
464
|
+
$[0] = t0;
|
|
465
|
+
$[1] = maxValue;
|
|
466
|
+
$[2] = minValue;
|
|
467
|
+
$[3] = props;
|
|
468
|
+
$[4] = renderStaticInput;
|
|
469
|
+
$[5] = t1;
|
|
470
|
+
$[6] = t2;
|
|
471
|
+
} else {
|
|
472
|
+
maxValue = $[1];
|
|
473
|
+
minValue = $[2];
|
|
474
|
+
props = $[3];
|
|
475
|
+
renderStaticInput = $[4];
|
|
476
|
+
t1 = $[5];
|
|
477
|
+
t2 = $[6];
|
|
478
|
+
}
|
|
479
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
480
|
+
const granularity = t2 === void 0 ? "day" : t2;
|
|
394
481
|
if ("formControl" in props && props.formControl) {
|
|
395
|
-
|
|
482
|
+
let formControl;
|
|
483
|
+
let innerProps;
|
|
484
|
+
let ref;
|
|
485
|
+
if ($[7] !== props) {
|
|
486
|
+
({formControl, ref, ...innerProps} = props);
|
|
487
|
+
$[7] = props;
|
|
488
|
+
$[8] = formControl;
|
|
489
|
+
$[9] = innerProps;
|
|
490
|
+
$[10] = ref;
|
|
491
|
+
} else {
|
|
492
|
+
formControl = $[8];
|
|
493
|
+
innerProps = $[9];
|
|
494
|
+
ref = $[10];
|
|
495
|
+
}
|
|
396
496
|
const controlWithOptions = formControl.control;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
497
|
+
let t3;
|
|
498
|
+
if ($[11] !== controlWithOptions._options?.disabled || $[12] !== fullIso || $[13] !== granularity || $[14] !== innerProps || $[15] !== maxValue || $[16] !== minValue || $[17] !== props.error || $[18] !== props.isDisabled || $[19] !== ref || $[20] !== renderStaticInput) {
|
|
499
|
+
t3 = (t4) => {
|
|
500
|
+
const { field, fieldState: t5 } = t4;
|
|
501
|
+
const { error, isDirty } = t5;
|
|
502
|
+
return /* @__PURE__ */ jsx(DatePickerInner, {
|
|
503
|
+
...innerProps,
|
|
504
|
+
ref: mergeRefs(ref, field.ref),
|
|
505
|
+
value: field.value ?? null,
|
|
506
|
+
onChange: field.onChange,
|
|
507
|
+
onBlur: field.onBlur,
|
|
508
|
+
isDirty,
|
|
509
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
510
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
511
|
+
error: props.error ?? error?.message,
|
|
512
|
+
fullIso,
|
|
513
|
+
granularity,
|
|
514
|
+
minValue,
|
|
515
|
+
maxValue,
|
|
516
|
+
renderStaticInput
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
$[11] = controlWithOptions._options?.disabled;
|
|
520
|
+
$[12] = fullIso;
|
|
521
|
+
$[13] = granularity;
|
|
522
|
+
$[14] = innerProps;
|
|
523
|
+
$[15] = maxValue;
|
|
524
|
+
$[16] = minValue;
|
|
525
|
+
$[17] = props.error;
|
|
526
|
+
$[18] = props.isDisabled;
|
|
527
|
+
$[19] = ref;
|
|
528
|
+
$[20] = renderStaticInput;
|
|
529
|
+
$[21] = t3;
|
|
530
|
+
} else t3 = $[21];
|
|
531
|
+
let t4;
|
|
532
|
+
if ($[22] !== formControl.control || $[23] !== formControl.name || $[24] !== t3) {
|
|
533
|
+
t4 = /* @__PURE__ */ jsx(Controller, {
|
|
534
|
+
control: formControl.control,
|
|
535
|
+
name: formControl.name,
|
|
536
|
+
render: t3
|
|
537
|
+
});
|
|
538
|
+
$[22] = formControl.control;
|
|
539
|
+
$[23] = formControl.name;
|
|
540
|
+
$[24] = t3;
|
|
541
|
+
$[25] = t4;
|
|
542
|
+
} else t4 = $[25];
|
|
543
|
+
return t4;
|
|
417
544
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
545
|
+
let t3;
|
|
546
|
+
if ($[26] !== fullIso || $[27] !== granularity || $[28] !== maxValue || $[29] !== minValue || $[30] !== props || $[31] !== renderStaticInput) {
|
|
547
|
+
t3 = /* @__PURE__ */ jsx(DatePickerInner, {
|
|
548
|
+
...props,
|
|
549
|
+
fullIso,
|
|
550
|
+
granularity,
|
|
551
|
+
minValue,
|
|
552
|
+
maxValue,
|
|
553
|
+
renderStaticInput
|
|
554
|
+
});
|
|
555
|
+
$[26] = fullIso;
|
|
556
|
+
$[27] = granularity;
|
|
557
|
+
$[28] = maxValue;
|
|
558
|
+
$[29] = minValue;
|
|
559
|
+
$[30] = props;
|
|
560
|
+
$[31] = renderStaticInput;
|
|
561
|
+
$[32] = t3;
|
|
562
|
+
} else t3 = $[32];
|
|
563
|
+
return t3;
|
|
426
564
|
};
|
|
565
|
+
function _temp(input, staticTarget) {
|
|
566
|
+
const container = input.getContainer?.() ?? input;
|
|
567
|
+
return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
|
|
568
|
+
}
|
|
569
|
+
function _temp2(input_0) {
|
|
570
|
+
const container_0 = input_0.getContainer?.() ?? input_0;
|
|
571
|
+
if (!(container_0 instanceof HTMLElement)) return null;
|
|
572
|
+
return container_0.querySelector("[data-static-press-action]");
|
|
573
|
+
}
|
|
574
|
+
function _temp3() {}
|
|
427
575
|
//#endregion
|
|
428
576
|
export { DatePicker };
|
|
@@ -15,6 +15,7 @@ import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
|
15
15
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
16
16
|
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
17
17
|
import { RangeCalendar } from "../shared/RangeCalendar.js";
|
|
18
|
+
import { c } from "react/compiler-runtime";
|
|
18
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
import { clsx } from "clsx";
|
|
20
21
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -720,7 +721,10 @@ var DateRangePickerBase = (props) => {
|
|
|
720
721
|
})
|
|
721
722
|
});
|
|
722
723
|
};
|
|
723
|
-
var DateRangePickerInner = (
|
|
724
|
+
var DateRangePickerInner = (t0) => {
|
|
725
|
+
const $ = c(21);
|
|
726
|
+
const { fullIso: t1, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
727
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
724
728
|
const ui = UIConfig.useConfig();
|
|
725
729
|
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
726
730
|
const { locale } = useLocale$1();
|
|
@@ -732,15 +736,8 @@ var DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStaticIn
|
|
|
732
736
|
inputRef,
|
|
733
737
|
renderInput,
|
|
734
738
|
setRenderInput,
|
|
735
|
-
getFocusTarget:
|
|
736
|
-
|
|
737
|
-
return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
|
|
738
|
-
},
|
|
739
|
-
getPressTarget: (input_0) => {
|
|
740
|
-
const container_0 = input_0.getContainer?.() ?? input_0;
|
|
741
|
-
if (!(container_0 instanceof HTMLElement)) return null;
|
|
742
|
-
return container_0.querySelector("[data-static-press-action]");
|
|
743
|
-
}
|
|
739
|
+
getFocusTarget: _temp,
|
|
740
|
+
getPressTarget: _temp2
|
|
744
741
|
});
|
|
745
742
|
const normalizedValue = props.value ?? null;
|
|
746
743
|
const formatDateRange = (range) => {
|
|
@@ -771,16 +768,43 @@ var DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStaticIn
|
|
|
771
768
|
end: endZonedDateTime ? toCalendarDate(endZonedDateTime) : null
|
|
772
769
|
};
|
|
773
770
|
};
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
771
|
+
let t2;
|
|
772
|
+
if ($[0] !== fullIso) {
|
|
773
|
+
t2 = (formattedDate) => {
|
|
774
|
+
if (formattedDate == null) return null;
|
|
775
|
+
if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
|
|
776
|
+
const date = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
|
|
777
|
+
return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date, "UTC"));
|
|
778
|
+
};
|
|
779
|
+
$[0] = fullIso;
|
|
780
|
+
$[1] = t2;
|
|
781
|
+
} else t2 = $[1];
|
|
782
|
+
const parseCalendarDate = t2;
|
|
783
|
+
let t3;
|
|
784
|
+
if ($[2] !== minValue || $[3] !== parseCalendarDate) {
|
|
785
|
+
t3 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
|
|
786
|
+
$[2] = minValue;
|
|
787
|
+
$[3] = parseCalendarDate;
|
|
788
|
+
$[4] = t3;
|
|
789
|
+
} else t3 = $[4];
|
|
790
|
+
let t4;
|
|
791
|
+
if ($[5] !== maxValue || $[6] !== parseCalendarDate) {
|
|
792
|
+
t4 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
|
|
793
|
+
$[5] = maxValue;
|
|
794
|
+
$[6] = parseCalendarDate;
|
|
795
|
+
$[7] = t4;
|
|
796
|
+
} else t4 = $[7];
|
|
797
|
+
let t5;
|
|
798
|
+
if ($[8] !== t3 || $[9] !== t4) {
|
|
799
|
+
t5 = {
|
|
800
|
+
minValue: t3,
|
|
801
|
+
maxValue: t4
|
|
802
|
+
};
|
|
803
|
+
$[8] = t3;
|
|
804
|
+
$[9] = t4;
|
|
805
|
+
$[10] = t5;
|
|
806
|
+
} else t5 = $[10];
|
|
807
|
+
const dateLimits = t5;
|
|
784
808
|
if (!renderInput) {
|
|
785
809
|
const startDateValue = parseCalendarDate(normalizedValue?.start ?? null);
|
|
786
810
|
const endDateValue = parseCalendarDate(normalizedValue?.end ?? null);
|
|
@@ -840,51 +864,153 @@ var DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStaticIn
|
|
|
840
864
|
trailingClassName: "py-0! pl-0!",
|
|
841
865
|
action: showDropdown ? {
|
|
842
866
|
icon: ui.dateInput.calendarIcon,
|
|
843
|
-
onClick:
|
|
867
|
+
onClick: _temp3,
|
|
844
868
|
altText: ""
|
|
845
869
|
} : void 0,
|
|
846
870
|
children: staticSegments
|
|
847
871
|
});
|
|
848
872
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
873
|
+
const T0 = DateRangePickerBase;
|
|
874
|
+
const t6 = mergeRefs(props.ref, inputRef);
|
|
875
|
+
const t7 = parseDateRange(normalizedValue);
|
|
876
|
+
let t8;
|
|
877
|
+
if ($[11] !== formatDateRange || $[12] !== props) {
|
|
878
|
+
t8 = (value) => props.onChange?.(formatDateRange(value));
|
|
879
|
+
$[11] = formatDateRange;
|
|
880
|
+
$[12] = props;
|
|
881
|
+
$[13] = t8;
|
|
882
|
+
} else t8 = $[13];
|
|
883
|
+
let t9;
|
|
884
|
+
if ($[14] !== T0 || $[15] !== dateLimits || $[16] !== props || $[17] !== t6 || $[18] !== t7 || $[19] !== t8) {
|
|
885
|
+
t9 = /* @__PURE__ */ jsx(T0, {
|
|
886
|
+
...props,
|
|
887
|
+
...dateLimits,
|
|
888
|
+
ref: t6,
|
|
889
|
+
value: t7,
|
|
890
|
+
onChange: t8
|
|
891
|
+
});
|
|
892
|
+
$[14] = T0;
|
|
893
|
+
$[15] = dateLimits;
|
|
894
|
+
$[16] = props;
|
|
895
|
+
$[17] = t6;
|
|
896
|
+
$[18] = t7;
|
|
897
|
+
$[19] = t8;
|
|
898
|
+
$[20] = t9;
|
|
899
|
+
} else t9 = $[20];
|
|
900
|
+
return t9;
|
|
856
901
|
};
|
|
857
|
-
var DateRangePicker = (
|
|
902
|
+
var DateRangePicker = (t0) => {
|
|
903
|
+
const $ = c(30);
|
|
904
|
+
let maxValue;
|
|
905
|
+
let minValue;
|
|
906
|
+
let props;
|
|
907
|
+
let renderStaticInput;
|
|
908
|
+
let t1;
|
|
909
|
+
if ($[0] !== t0) {
|
|
910
|
+
({fullIso: t1, minValue, maxValue, renderStaticInput, ...props} = t0);
|
|
911
|
+
$[0] = t0;
|
|
912
|
+
$[1] = maxValue;
|
|
913
|
+
$[2] = minValue;
|
|
914
|
+
$[3] = props;
|
|
915
|
+
$[4] = renderStaticInput;
|
|
916
|
+
$[5] = t1;
|
|
917
|
+
} else {
|
|
918
|
+
maxValue = $[1];
|
|
919
|
+
minValue = $[2];
|
|
920
|
+
props = $[3];
|
|
921
|
+
renderStaticInput = $[4];
|
|
922
|
+
t1 = $[5];
|
|
923
|
+
}
|
|
924
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
858
925
|
if ("formControl" in props && props.formControl) {
|
|
859
|
-
|
|
926
|
+
let formControl;
|
|
927
|
+
let innerProps;
|
|
928
|
+
let ref;
|
|
929
|
+
if ($[6] !== props) {
|
|
930
|
+
({formControl, ref, ...innerProps} = props);
|
|
931
|
+
$[6] = props;
|
|
932
|
+
$[7] = formControl;
|
|
933
|
+
$[8] = innerProps;
|
|
934
|
+
$[9] = ref;
|
|
935
|
+
} else {
|
|
936
|
+
formControl = $[7];
|
|
937
|
+
innerProps = $[8];
|
|
938
|
+
ref = $[9];
|
|
939
|
+
}
|
|
860
940
|
const controlWithOptions = formControl.control;
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
941
|
+
let t2;
|
|
942
|
+
if ($[10] !== controlWithOptions._options?.disabled || $[11] !== fullIso || $[12] !== innerProps || $[13] !== maxValue || $[14] !== minValue || $[15] !== props.error || $[16] !== props.isDisabled || $[17] !== ref || $[18] !== renderStaticInput) {
|
|
943
|
+
t2 = (t3) => {
|
|
944
|
+
const { field, fieldState: t4 } = t3;
|
|
945
|
+
const { error, isDirty } = t4;
|
|
946
|
+
return /* @__PURE__ */ jsx(DateRangePickerInner, {
|
|
947
|
+
...innerProps,
|
|
948
|
+
ref: mergeRefs(ref, field.ref),
|
|
949
|
+
value: field.value ?? null,
|
|
950
|
+
onChange: field.onChange,
|
|
951
|
+
onBlur: field.onBlur,
|
|
952
|
+
isDirty,
|
|
953
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
954
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
955
|
+
error: props.error ?? error?.message,
|
|
956
|
+
fullIso,
|
|
957
|
+
minValue,
|
|
958
|
+
maxValue,
|
|
959
|
+
renderStaticInput
|
|
960
|
+
});
|
|
961
|
+
};
|
|
962
|
+
$[10] = controlWithOptions._options?.disabled;
|
|
963
|
+
$[11] = fullIso;
|
|
964
|
+
$[12] = innerProps;
|
|
965
|
+
$[13] = maxValue;
|
|
966
|
+
$[14] = minValue;
|
|
967
|
+
$[15] = props.error;
|
|
968
|
+
$[16] = props.isDisabled;
|
|
969
|
+
$[17] = ref;
|
|
970
|
+
$[18] = renderStaticInput;
|
|
971
|
+
$[19] = t2;
|
|
972
|
+
} else t2 = $[19];
|
|
973
|
+
let t3;
|
|
974
|
+
if ($[20] !== formControl.control || $[21] !== formControl.name || $[22] !== t2) {
|
|
975
|
+
t3 = /* @__PURE__ */ jsx(Controller, {
|
|
976
|
+
control: formControl.control,
|
|
977
|
+
name: formControl.name,
|
|
978
|
+
render: t2
|
|
979
|
+
});
|
|
980
|
+
$[20] = formControl.control;
|
|
981
|
+
$[21] = formControl.name;
|
|
982
|
+
$[22] = t2;
|
|
983
|
+
$[23] = t3;
|
|
984
|
+
} else t3 = $[23];
|
|
985
|
+
return t3;
|
|
880
986
|
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
987
|
+
let t2;
|
|
988
|
+
if ($[24] !== fullIso || $[25] !== maxValue || $[26] !== minValue || $[27] !== props || $[28] !== renderStaticInput) {
|
|
989
|
+
t2 = /* @__PURE__ */ jsx(DateRangePickerInner, {
|
|
990
|
+
...props,
|
|
991
|
+
fullIso,
|
|
992
|
+
minValue,
|
|
993
|
+
maxValue,
|
|
994
|
+
renderStaticInput
|
|
995
|
+
});
|
|
996
|
+
$[24] = fullIso;
|
|
997
|
+
$[25] = maxValue;
|
|
998
|
+
$[26] = minValue;
|
|
999
|
+
$[27] = props;
|
|
1000
|
+
$[28] = renderStaticInput;
|
|
1001
|
+
$[29] = t2;
|
|
1002
|
+
} else t2 = $[29];
|
|
1003
|
+
return t2;
|
|
888
1004
|
};
|
|
1005
|
+
function _temp(input, staticTarget) {
|
|
1006
|
+
const container = input.getContainer?.() ?? input;
|
|
1007
|
+
return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
|
|
1008
|
+
}
|
|
1009
|
+
function _temp2(input_0) {
|
|
1010
|
+
const container_0 = input_0.getContainer?.() ?? input_0;
|
|
1011
|
+
if (!(container_0 instanceof HTMLElement)) return null;
|
|
1012
|
+
return container_0.querySelector("[data-static-press-action]");
|
|
1013
|
+
}
|
|
1014
|
+
function _temp3() {}
|
|
889
1015
|
//#endregion
|
|
890
1016
|
export { DateRangePicker };
|