@ssa-ui-kit/core 2.15.0-canary-9a56baa-20250506 → 2.15.0-canary-6d341b5-20250506
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/index.js +10 -14
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11543,10 +11543,8 @@ const TriggerInput = ({
|
|
|
11543
11543
|
setLastFocusedElement,
|
|
11544
11544
|
onBlur: handleBlur
|
|
11545
11545
|
} = useDateRangePickerContext();
|
|
11546
|
-
const formContext = (0,external_react_hook_form_namespaceObject.useFormContext)(); // Using FormProvider from react-hook-form
|
|
11547
|
-
const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
11548
11546
|
const currentName = datepickerType === 'from' ? nameFrom : nameTo;
|
|
11549
|
-
const hookFormResult =
|
|
11547
|
+
const hookFormResult = (0,external_react_hook_form_namespaceObject.useFormContext)() ?? (0,external_react_hook_form_namespaceObject.useForm)();
|
|
11550
11548
|
const {
|
|
11551
11549
|
register,
|
|
11552
11550
|
formState: {
|
|
@@ -11639,7 +11637,7 @@ const Trigger = () => {
|
|
|
11639
11637
|
handleToggleOpen
|
|
11640
11638
|
} = useDateRangePickerContext();
|
|
11641
11639
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
11642
|
-
const
|
|
11640
|
+
const hookFormResult = (0,external_react_hook_form_namespaceObject.useFormContext)() || (0,external_react_hook_form_namespaceObject.useForm)();
|
|
11643
11641
|
const wrapperRef = (0,external_react_namespaceObject.useRef)(null);
|
|
11644
11642
|
(0,hooks_namespaceObject.useClickOutside)(wrapperRef, event => {
|
|
11645
11643
|
const {
|
|
@@ -11650,8 +11648,8 @@ const Trigger = () => {
|
|
|
11650
11648
|
setIsOpen(false);
|
|
11651
11649
|
}
|
|
11652
11650
|
});
|
|
11653
|
-
const errorsFrom =
|
|
11654
|
-
const errorsTo =
|
|
11651
|
+
const errorsFrom = hookFormResult.formState.errors[nameFrom]?.message;
|
|
11652
|
+
const errorsTo = hookFormResult.formState.errors[nameTo]?.message;
|
|
11655
11653
|
const errorMessage = [errorsFrom, errorsTo].filter(Boolean);
|
|
11656
11654
|
return (0,jsx_runtime_namespaceObject.jsxs)(FieldRoot, {
|
|
11657
11655
|
status: status,
|
|
@@ -11811,21 +11809,19 @@ const useDateRangePicker = ({
|
|
|
11811
11809
|
const handleSetIsOpen = open => {
|
|
11812
11810
|
setIsOpen(open);
|
|
11813
11811
|
};
|
|
11812
|
+
const hookFormResult = (0,external_react_hook_form_namespaceObject.useFormContext)() ?? (0,external_react_hook_form_namespaceObject.useForm)();
|
|
11814
11813
|
const {
|
|
11815
11814
|
clearErrors,
|
|
11816
11815
|
setError,
|
|
11817
11816
|
setValue,
|
|
11818
11817
|
resetField,
|
|
11819
|
-
setFocus
|
|
11820
|
-
|
|
11818
|
+
setFocus,
|
|
11819
|
+
watch
|
|
11820
|
+
} = hookFormResult;
|
|
11821
11821
|
const nameFrom = `${_name}From`;
|
|
11822
11822
|
const nameTo = `${_name}To`;
|
|
11823
|
-
const inputValueFrom = (
|
|
11824
|
-
|
|
11825
|
-
});
|
|
11826
|
-
const inputValueTo = (0,external_react_hook_form_namespaceObject.useWatch)({
|
|
11827
|
-
name: nameTo
|
|
11828
|
-
});
|
|
11823
|
+
const inputValueFrom = watch(nameFrom);
|
|
11824
|
+
const inputValueTo = watch(nameTo);
|
|
11829
11825
|
const [dateTime, setDateTime] = (0,external_react_namespaceObject.useState)([undefined, undefined]);
|
|
11830
11826
|
const [lastChangedDate, setLastChangedDate] = (0,external_react_namespaceObject.useState)([undefined, undefined]);
|
|
11831
11827
|
const [lastFocusedElement, setLastFocusedElement] = (0,external_react_namespaceObject.useState)('from');
|