@povio/ui 3.3.0-rc.4 → 3.3.0

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.
Files changed (63) hide show
  1. package/README.md +15 -1
  2. package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
  3. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  4. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  5. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +84 -202
  8. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -132
  9. package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
  10. package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
  11. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
  12. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
  13. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
  14. package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
  15. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +140 -338
  16. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  17. package/dist/components/inputs/File/FileUpload.js +1 -1
  18. package/dist/components/inputs/File/InputUpload.js +65 -261
  19. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
  20. package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
  21. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
  22. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
  23. package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
  24. package/dist/components/inputs/FormField/FormField.js +34 -47
  25. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +75 -313
  26. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
  27. package/dist/components/inputs/Selection/Select/QuerySelect.js +30 -96
  28. package/dist/components/inputs/Selection/Select/Select.js +3 -3
  29. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
  30. package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
  31. package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
  32. package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
  33. package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
  34. package/dist/components/inputs/shared/InputClear.js +24 -40
  35. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  36. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  37. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  38. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  39. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
  40. package/dist/components/shared/pagination/Pagination.js +22 -108
  41. package/dist/components/status/Alert/Alert.js +30 -97
  42. package/dist/components/table/InfiniteTable.js +16 -67
  43. package/dist/components/table/Table.d.ts +2 -8
  44. package/dist/components/table/Table.js +33 -55
  45. package/dist/components/text/Typography/Typography.js +8 -23
  46. package/dist/config/confirmation.context.js +1 -1
  47. package/dist/config/theme.context.js +45 -98
  48. package/dist/config/uiConfig.context.js +8 -39
  49. package/dist/config/uiOverrides.context.d.ts +0 -1
  50. package/dist/hooks/useDebounceCallback.js +17 -51
  51. package/dist/hooks/useFormAutosave.js +33 -120
  52. package/dist/hooks/useLongPressRepeat.js +20 -55
  53. package/dist/index.d.ts +0 -1
  54. package/dist/index.js +1 -2
  55. package/package.json +2 -2
  56. package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
  57. package/dist/components/inputs/FormField/formField.cva.js +0 -16
  58. package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
  59. package/dist/components/table/TableColumnFilterInput.js +0 -108
  60. package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
  61. package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
  62. package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
  63. package/dist/components/table/TableColumnFilterRow.js +0 -68
@@ -15,10 +15,9 @@ 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";
19
18
  import { jsx, jsxs } from "react/jsx-runtime";
20
19
  import { clsx } from "clsx";
21
- import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
20
+ import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
22
21
  import { Button } from "react-aria-components";
23
22
  import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
24
23
  import { mergeRefs } from "@react-aria/utils";
@@ -460,25 +459,33 @@ var DateRangePickerBase = (props) => {
460
459
  setHoverDate(null);
461
460
  if (fireBlurOnChange) handleBlur(null);
462
461
  };
463
- const onOpenChange = (isOpen) => {
464
- state.toggle();
465
- if (!isOpen) {
466
- if (state.value) {
467
- dialogState.setValue(state.value);
468
- leftCalendarState.setValue(state.value);
469
- rightCalendarState.setValue(state.value);
470
- const startDate_3 = state.value.start || today(effectiveTimeZone);
471
- const endDate_3 = state.value.end || today(effectiveTimeZone).add({ months: 1 });
472
- leftCalendarState.setFocusedDate(startDate_3);
473
- if (startDate_3.year === endDate_3.year && startDate_3.month === endDate_3.month) rightCalendarState.setFocusedDate(startDate_3.add({ months: 1 }));
474
- else rightCalendarState.setFocusedDate(endDate_3);
475
- setRangeSelection({
476
- start: state.value.start,
477
- end: state.value.end,
478
- isSelecting: false
479
- });
480
- }
462
+ const syncSelectionFromControlledValue = () => {
463
+ const currentValue = state.value;
464
+ if (!(currentValue != null && currentValue.start != null && currentValue.end != null)) {
465
+ syncCalendarStates(null);
466
+ return;
467
+ }
468
+ syncCalendarStates(currentValue);
469
+ const startDate_3 = currentValue.start;
470
+ const endDate_3 = currentValue.end;
471
+ leftCalendarState.setFocusedDate(startDate_3);
472
+ if (startDate_3.year === endDate_3.year && startDate_3.month === endDate_3.month) {
473
+ rightCalendarState.setFocusedDate(startDate_3.add({ months: 1 }));
474
+ return;
481
475
  }
476
+ rightCalendarState.setFocusedDate(endDate_3);
477
+ };
478
+ useEffect(() => {
479
+ if (!state.isOpen) return;
480
+ syncSelectionFromControlledValue();
481
+ }, [state.isOpen]);
482
+ const onOpenChange = (_isOpen) => {
483
+ state.toggle();
484
+ syncSelectionFromControlledValue();
485
+ };
486
+ const onOpenDropdown = () => {
487
+ syncSelectionFromControlledValue();
488
+ state.toggle();
482
489
  };
483
490
  const todayDate_0 = today(effectiveTimeZone);
484
491
  const getThisWeekRange = () => {
@@ -659,7 +666,7 @@ var DateRangePickerBase = (props) => {
659
666
  autoFixYear,
660
667
  placeholder,
661
668
  className: inputClassName,
662
- onOpenDropdown: () => state.toggle(),
669
+ onOpenDropdown,
663
670
  timeZone: effectiveTimeZone,
664
671
  fireBlurOnChange,
665
672
  onClear: onInputClear
@@ -713,10 +720,7 @@ var DateRangePickerBase = (props) => {
713
720
  })
714
721
  });
715
722
  };
716
- var DateRangePickerInner = (t0) => {
717
- const $ = c(21);
718
- const { fullIso: t1, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
719
- const fullIso = t1 === void 0 ? true : t1;
723
+ var DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props }) => {
720
724
  const ui = UIConfig.useConfig();
721
725
  const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
722
726
  const { locale } = useLocale$1();
@@ -728,8 +732,15 @@ var DateRangePickerInner = (t0) => {
728
732
  inputRef,
729
733
  renderInput,
730
734
  setRenderInput,
731
- getFocusTarget: _temp,
732
- getPressTarget: _temp2
735
+ getFocusTarget: (input, staticTarget) => {
736
+ const container = input.getContainer?.() ?? input;
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
+ }
733
744
  });
734
745
  const normalizedValue = props.value ?? null;
735
746
  const formatDateRange = (range) => {
@@ -760,43 +771,16 @@ var DateRangePickerInner = (t0) => {
760
771
  end: endZonedDateTime ? toCalendarDate(endZonedDateTime) : null
761
772
  };
762
773
  };
763
- let t2;
764
- if ($[0] !== fullIso) {
765
- t2 = (formattedDate) => {
766
- if (formattedDate == null) return null;
767
- if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
768
- const date = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
769
- return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date, "UTC"));
770
- };
771
- $[0] = fullIso;
772
- $[1] = t2;
773
- } else t2 = $[1];
774
- const parseCalendarDate = t2;
775
- let t3;
776
- if ($[2] !== minValue || $[3] !== parseCalendarDate) {
777
- t3 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
778
- $[2] = minValue;
779
- $[3] = parseCalendarDate;
780
- $[4] = t3;
781
- } else t3 = $[4];
782
- let t4;
783
- if ($[5] !== maxValue || $[6] !== parseCalendarDate) {
784
- t4 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
785
- $[5] = maxValue;
786
- $[6] = parseCalendarDate;
787
- $[7] = t4;
788
- } else t4 = $[7];
789
- let t5;
790
- if ($[8] !== t3 || $[9] !== t4) {
791
- t5 = {
792
- minValue: t3,
793
- maxValue: t4
794
- };
795
- $[8] = t3;
796
- $[9] = t4;
797
- $[10] = t5;
798
- } else t5 = $[10];
799
- const dateLimits = t5;
774
+ const parseCalendarDate = (formattedDate) => {
775
+ if (formattedDate == null) return null;
776
+ if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
777
+ const date = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
778
+ return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date, "UTC"));
779
+ };
780
+ const dateLimits = {
781
+ minValue: typeof minValue === "string" ? parseCalendarDate(minValue) : minValue,
782
+ maxValue: typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue
783
+ };
800
784
  if (!renderInput) {
801
785
  const startDateValue = parseCalendarDate(normalizedValue?.start ?? null);
802
786
  const endDateValue = parseCalendarDate(normalizedValue?.end ?? null);
@@ -856,153 +840,51 @@ var DateRangePickerInner = (t0) => {
856
840
  trailingClassName: "py-0! pl-0!",
857
841
  action: showDropdown ? {
858
842
  icon: ui.dateInput.calendarIcon,
859
- onClick: _temp3,
843
+ onClick: () => {},
860
844
  altText: ""
861
845
  } : void 0,
862
846
  children: staticSegments
863
847
  });
864
848
  }
865
- const T0 = DateRangePickerBase;
866
- const t6 = mergeRefs(props.ref, inputRef);
867
- const t7 = parseDateRange(normalizedValue);
868
- let t8;
869
- if ($[11] !== formatDateRange || $[12] !== props) {
870
- t8 = (value) => props.onChange?.(formatDateRange(value));
871
- $[11] = formatDateRange;
872
- $[12] = props;
873
- $[13] = t8;
874
- } else t8 = $[13];
875
- let t9;
876
- if ($[14] !== T0 || $[15] !== dateLimits || $[16] !== props || $[17] !== t6 || $[18] !== t7 || $[19] !== t8) {
877
- t9 = /* @__PURE__ */ jsx(T0, {
878
- ...props,
879
- ...dateLimits,
880
- ref: t6,
881
- value: t7,
882
- onChange: t8
883
- });
884
- $[14] = T0;
885
- $[15] = dateLimits;
886
- $[16] = props;
887
- $[17] = t6;
888
- $[18] = t7;
889
- $[19] = t8;
890
- $[20] = t9;
891
- } else t9 = $[20];
892
- return t9;
849
+ return /* @__PURE__ */ jsx(DateRangePickerBase, {
850
+ ...props,
851
+ ...dateLimits,
852
+ ref: mergeRefs(props.ref, inputRef),
853
+ value: parseDateRange(normalizedValue),
854
+ onChange: (value) => props.onChange?.(formatDateRange(value))
855
+ });
893
856
  };
894
- var DateRangePicker = (t0) => {
895
- const $ = c(30);
896
- let maxValue;
897
- let minValue;
898
- let props;
899
- let renderStaticInput;
900
- let t1;
901
- if ($[0] !== t0) {
902
- ({fullIso: t1, minValue, maxValue, renderStaticInput, ...props} = t0);
903
- $[0] = t0;
904
- $[1] = maxValue;
905
- $[2] = minValue;
906
- $[3] = props;
907
- $[4] = renderStaticInput;
908
- $[5] = t1;
909
- } else {
910
- maxValue = $[1];
911
- minValue = $[2];
912
- props = $[3];
913
- renderStaticInput = $[4];
914
- t1 = $[5];
915
- }
916
- const fullIso = t1 === void 0 ? true : t1;
857
+ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput, ...props }) => {
917
858
  if ("formControl" in props && props.formControl) {
918
- let formControl;
919
- let innerProps;
920
- let ref;
921
- if ($[6] !== props) {
922
- ({formControl, ref, ...innerProps} = props);
923
- $[6] = props;
924
- $[7] = formControl;
925
- $[8] = innerProps;
926
- $[9] = ref;
927
- } else {
928
- formControl = $[7];
929
- innerProps = $[8];
930
- ref = $[9];
931
- }
859
+ const { formControl, ref, ...innerProps } = props;
932
860
  const controlWithOptions = formControl.control;
933
- let t2;
934
- if ($[10] !== controlWithOptions._options?.disabled || $[11] !== fullIso || $[12] !== innerProps || $[13] !== maxValue || $[14] !== minValue || $[15] !== props.error || $[16] !== props.isDisabled || $[17] !== ref || $[18] !== renderStaticInput) {
935
- t2 = (t3) => {
936
- const { field, fieldState: t4 } = t3;
937
- const { error, isDirty } = t4;
938
- return /* @__PURE__ */ jsx(DateRangePickerInner, {
939
- ...innerProps,
940
- ref: mergeRefs(ref, field.ref),
941
- value: field.value ?? null,
942
- onChange: field.onChange,
943
- onBlur: field.onBlur,
944
- isDirty,
945
- isDisabled: field.disabled || props.isDisabled,
946
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
947
- error: props.error ?? error?.message,
948
- fullIso,
949
- minValue,
950
- maxValue,
951
- renderStaticInput
952
- });
953
- };
954
- $[10] = controlWithOptions._options?.disabled;
955
- $[11] = fullIso;
956
- $[12] = innerProps;
957
- $[13] = maxValue;
958
- $[14] = minValue;
959
- $[15] = props.error;
960
- $[16] = props.isDisabled;
961
- $[17] = ref;
962
- $[18] = renderStaticInput;
963
- $[19] = t2;
964
- } else t2 = $[19];
965
- let t3;
966
- if ($[20] !== formControl.control || $[21] !== formControl.name || $[22] !== t2) {
967
- t3 = /* @__PURE__ */ jsx(Controller, {
968
- control: formControl.control,
969
- name: formControl.name,
970
- render: t2
971
- });
972
- $[20] = formControl.control;
973
- $[21] = formControl.name;
974
- $[22] = t2;
975
- $[23] = t3;
976
- } else t3 = $[23];
977
- return t3;
978
- }
979
- let t2;
980
- if ($[24] !== fullIso || $[25] !== maxValue || $[26] !== minValue || $[27] !== props || $[28] !== renderStaticInput) {
981
- t2 = /* @__PURE__ */ jsx(DateRangePickerInner, {
982
- ...props,
983
- fullIso,
984
- minValue,
985
- maxValue,
986
- renderStaticInput
861
+ return /* @__PURE__ */ jsx(Controller, {
862
+ control: formControl.control,
863
+ name: formControl.name,
864
+ render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateRangePickerInner, {
865
+ ...innerProps,
866
+ ref: mergeRefs(ref, field.ref),
867
+ value: field.value ?? null,
868
+ onChange: field.onChange,
869
+ onBlur: field.onBlur,
870
+ isDirty,
871
+ isDisabled: field.disabled || props.isDisabled,
872
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
873
+ error: props.error ?? error?.message,
874
+ fullIso,
875
+ minValue,
876
+ maxValue,
877
+ renderStaticInput
878
+ })
987
879
  });
988
- $[24] = fullIso;
989
- $[25] = maxValue;
990
- $[26] = minValue;
991
- $[27] = props;
992
- $[28] = renderStaticInput;
993
- $[29] = t2;
994
- } else t2 = $[29];
995
- return t2;
880
+ }
881
+ return /* @__PURE__ */ jsx(DateRangePickerInner, {
882
+ ...props,
883
+ fullIso,
884
+ minValue,
885
+ maxValue,
886
+ renderStaticInput
887
+ });
996
888
  };
997
- function _temp(input, staticTarget) {
998
- const container = input.getContainer?.() ?? input;
999
- return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
1000
- }
1001
- function _temp2(input_0) {
1002
- const container_0 = input_0.getContainer?.() ?? input_0;
1003
- if (!(container_0 instanceof HTMLElement)) return null;
1004
- return container_0.querySelector("[data-static-press-action]");
1005
- }
1006
- function _temp3() {}
1007
889
  //#endregion
1008
890
  export { DateRangePicker };
@@ -13,7 +13,6 @@ 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";
17
16
  import { jsx, jsxs } from "react/jsx-runtime";
18
17
  import { clsx } from "clsx";
19
18
  import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
@@ -157,10 +156,25 @@ var DateTimePickerBase = (props) => {
157
156
  dialogState.setValue(null);
158
157
  if (fireBlurOnChange) handleBlur(null);
159
158
  };
160
- const onOpenChange = (isOpen) => {
159
+ const syncDialogFromControlledValue = () => {
160
+ dialogState.setValue(state.value);
161
+ if (state.value) {
162
+ calendarState.setFocusedDate(state.value);
163
+ return;
164
+ }
165
+ calendarState.setFocusedDate(today(effectiveTimeZone));
166
+ };
167
+ useEffect(() => {
168
+ if (!state.isOpen) return;
169
+ syncDialogFromControlledValue();
170
+ }, [state.isOpen]);
171
+ const onOpenChange = (_isOpen) => {
172
+ state.toggle();
173
+ syncDialogFromControlledValue();
174
+ };
175
+ const onOpenDropdown = () => {
176
+ syncDialogFromControlledValue();
161
177
  state.toggle();
162
- calendarState.setFocusedDate(state.value || today(effectiveTimeZone));
163
- if (!isOpen) dialogState.setValue(state.value);
164
178
  };
165
179
  return /* @__PURE__ */ jsx(TooltipWrapper, {
166
180
  as,
@@ -205,7 +219,7 @@ var DateTimePickerBase = (props) => {
205
219
  disableManualEntry,
206
220
  autoFixYear,
207
221
  placeholder,
208
- onOpenDropdown: () => state.toggle(),
222
+ onOpenDropdown,
209
223
  className: inputClassName,
210
224
  timeZone: effectiveTimeZone,
211
225
  isTimeOptional,
@@ -239,9 +253,7 @@ var DateTimePickerBase = (props) => {
239
253
  })
240
254
  });
241
255
  };
242
- var DateTimePickerInner = (t0) => {
243
- const $ = c(9);
244
- const { fullIso: t1, renderStaticInput, isFormControlDisabled, ...props } = t0;
256
+ var DateTimePickerInner = ({ fullIso: _fullIso = true, renderStaticInput, isFormControlDisabled, ...props }) => {
245
257
  const ui = UIConfig.useConfig();
246
258
  const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
247
259
  const { locale } = useLocale();
@@ -252,8 +264,15 @@ var DateTimePickerInner = (t0) => {
252
264
  inputRef,
253
265
  renderInput,
254
266
  setRenderInput,
255
- getFocusTarget: _temp,
256
- getPressTarget: _temp2
267
+ getFocusTarget: (input, staticTarget) => {
268
+ const container = input.getContainer?.() ?? input;
269
+ return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
270
+ },
271
+ getPressTarget: (input_0) => {
272
+ const container_0 = input_0.getContainer?.() ?? input_0;
273
+ if (!(container_0 instanceof HTMLElement)) return null;
274
+ return container_0.querySelector("[data-static-press-action]");
275
+ }
257
276
  });
258
277
  const normalizedValue = props.value ?? null;
259
278
  const timeZone = props.timeZone ?? ui.dateInput.timeZone;
@@ -323,137 +342,46 @@ var DateTimePickerInner = (t0) => {
323
342
  trailingClassName: "py-0! pl-0!",
324
343
  action: showDropdown ? {
325
344
  icon: ui.dateInput.dateTimeIcon,
326
- onClick: _temp3,
345
+ onClick: () => {},
327
346
  altText: ""
328
347
  } : void 0,
329
348
  children: staticSegments
330
349
  });
331
350
  }
332
- const T0 = DateTimePickerBase;
333
- const t2 = mergeRefs(props.ref, inputRef);
334
- const t3 = parseDateValue(normalizedValue);
335
- let t4;
336
- if ($[0] !== formatDateValue || $[1] !== props) {
337
- t4 = (value) => props.onChange?.(formatDateValue(value));
338
- $[0] = formatDateValue;
339
- $[1] = props;
340
- $[2] = t4;
341
- } else t4 = $[2];
342
- let t5;
343
- if ($[3] !== T0 || $[4] !== props || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
344
- t5 = /* @__PURE__ */ jsx(T0, {
345
- ...props,
346
- ref: t2,
347
- value: t3,
348
- onChange: t4
349
- });
350
- $[3] = T0;
351
- $[4] = props;
352
- $[5] = t2;
353
- $[6] = t3;
354
- $[7] = t4;
355
- $[8] = t5;
356
- } else t5 = $[8];
357
- return t5;
351
+ return /* @__PURE__ */ jsx(DateTimePickerBase, {
352
+ ...props,
353
+ ref: mergeRefs(props.ref, inputRef),
354
+ value: parseDateValue(normalizedValue),
355
+ onChange: (value) => props.onChange?.(formatDateValue(value))
356
+ });
358
357
  };
359
- var DateTimePicker = (t0) => {
360
- const $ = c(24);
361
- let props;
362
- let renderStaticInput;
363
- let t1;
364
- if ($[0] !== t0) {
365
- ({fullIso: t1, renderStaticInput, ...props} = t0);
366
- $[0] = t0;
367
- $[1] = props;
368
- $[2] = renderStaticInput;
369
- $[3] = t1;
370
- } else {
371
- props = $[1];
372
- renderStaticInput = $[2];
373
- t1 = $[3];
374
- }
375
- const fullIso = t1 === void 0 ? true : t1;
358
+ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
376
359
  if ("formControl" in props && props.formControl) {
377
- let formControl;
378
- let innerProps;
379
- let ref;
380
- if ($[4] !== props) {
381
- ({formControl, ref, ...innerProps} = props);
382
- $[4] = props;
383
- $[5] = formControl;
384
- $[6] = innerProps;
385
- $[7] = ref;
386
- } else {
387
- formControl = $[5];
388
- innerProps = $[6];
389
- ref = $[7];
390
- }
360
+ const { formControl, ref, ...innerProps } = props;
391
361
  const controlWithOptions = formControl.control;
392
- let t2;
393
- if ($[8] !== controlWithOptions._options?.disabled || $[9] !== fullIso || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
394
- t2 = (t3) => {
395
- const { field, fieldState: t4 } = t3;
396
- const { error, isDirty } = t4;
397
- return /* @__PURE__ */ jsx(DateTimePickerInner, {
398
- ...innerProps,
399
- ref: mergeRefs(ref, field.ref),
400
- value: field.value ?? null,
401
- onChange: field.onChange,
402
- onBlur: field.onBlur,
403
- isDirty,
404
- isDisabled: field.disabled || props.isDisabled,
405
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
406
- error: props.error ?? error?.message,
407
- fullIso,
408
- renderStaticInput
409
- });
410
- };
411
- $[8] = controlWithOptions._options?.disabled;
412
- $[9] = fullIso;
413
- $[10] = innerProps;
414
- $[11] = props.error;
415
- $[12] = props.isDisabled;
416
- $[13] = ref;
417
- $[14] = renderStaticInput;
418
- $[15] = t2;
419
- } else t2 = $[15];
420
- let t3;
421
- if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
422
- t3 = /* @__PURE__ */ jsx(Controller, {
423
- control: formControl.control,
424
- name: formControl.name,
425
- render: t2
426
- });
427
- $[16] = formControl.control;
428
- $[17] = formControl.name;
429
- $[18] = t2;
430
- $[19] = t3;
431
- } else t3 = $[19];
432
- return t3;
433
- }
434
- let t2;
435
- if ($[20] !== fullIso || $[21] !== props || $[22] !== renderStaticInput) {
436
- t2 = /* @__PURE__ */ jsx(DateTimePickerInner, {
437
- ...props,
438
- fullIso,
439
- renderStaticInput
362
+ return /* @__PURE__ */ jsx(Controller, {
363
+ control: formControl.control,
364
+ name: formControl.name,
365
+ render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateTimePickerInner, {
366
+ ...innerProps,
367
+ ref: mergeRefs(ref, field.ref),
368
+ value: field.value ?? null,
369
+ onChange: field.onChange,
370
+ onBlur: field.onBlur,
371
+ isDirty,
372
+ isDisabled: field.disabled || props.isDisabled,
373
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
374
+ error: props.error ?? error?.message,
375
+ fullIso,
376
+ renderStaticInput
377
+ })
440
378
  });
441
- $[20] = fullIso;
442
- $[21] = props;
443
- $[22] = renderStaticInput;
444
- $[23] = t2;
445
- } else t2 = $[23];
446
- return t2;
379
+ }
380
+ return /* @__PURE__ */ jsx(DateTimePickerInner, {
381
+ ...props,
382
+ fullIso,
383
+ renderStaticInput
384
+ });
447
385
  };
448
- function _temp(input, staticTarget) {
449
- const container = input.getContainer?.() ?? input;
450
- return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
451
- }
452
- function _temp2(input_0) {
453
- const container_0 = input_0.getContainer?.() ?? input_0;
454
- if (!(container_0 instanceof HTMLElement)) return null;
455
- return container_0.querySelector("[data-static-press-action]");
456
- }
457
- function _temp3() {}
458
386
  //#endregion
459
387
  export { DateTimePicker };