@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.
- package/README.md +15 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +84 -202
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -132
- package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
- package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +140 -338
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +65 -261
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
- package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
- package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +75 -313
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
- package/dist/components/inputs/Selection/Select/QuerySelect.js +30 -96
- package/dist/components/inputs/Selection/Select/Select.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
- package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
- package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
- package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.js +8 -39
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFormAutosave.js +33 -120
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/package.json +2 -2
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- 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
|
|
464
|
-
state.
|
|
465
|
-
if (!
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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
|
|
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 = (
|
|
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:
|
|
732
|
-
|
|
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
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
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:
|
|
843
|
+
onClick: () => {},
|
|
860
844
|
altText: ""
|
|
861
845
|
} : void 0,
|
|
862
846
|
children: staticSegments
|
|
863
847
|
});
|
|
864
848
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
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 = (
|
|
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
|
-
|
|
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
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
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
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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
|
|
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
|
|
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 = (
|
|
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:
|
|
256
|
-
|
|
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:
|
|
345
|
+
onClick: () => {},
|
|
327
346
|
altText: ""
|
|
328
347
|
} : void 0,
|
|
329
348
|
children: staticSegments
|
|
330
349
|
});
|
|
331
350
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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 = (
|
|
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
|
-
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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 };
|