@skedulo/sked-ui 21.6.0 → 21.6.2
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.
|
@@ -108,15 +108,16 @@ export interface DatepickerProps {
|
|
|
108
108
|
* onCalendarClose fuction
|
|
109
109
|
*/
|
|
110
110
|
onCalendarClose?: () => void;
|
|
111
|
+
inputRef?: React.MutableRefObject<HTMLInputElement>;
|
|
111
112
|
}
|
|
112
113
|
declare type CustomInputType = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
113
|
-
onBlurCustom: () => void;
|
|
114
|
+
onBlurCustom: (event?: React.FocusEvent<HTMLInputElement>) => void;
|
|
114
115
|
openCalendar: (open: boolean) => void;
|
|
115
116
|
onBackspace: () => void;
|
|
116
117
|
Component: (props: React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>) => JSX.Element;
|
|
117
118
|
};
|
|
118
119
|
export declare const CustomInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
119
|
-
onBlurCustom: () => void;
|
|
120
|
+
onBlurCustom: (event?: React.FocusEvent<HTMLInputElement>) => void;
|
|
120
121
|
openCalendar: (open: boolean) => void;
|
|
121
122
|
onBackspace: () => void;
|
|
122
123
|
Component: (props: React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>) => JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -17849,7 +17849,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17849
17849
|
|
|
17850
17850
|
var _excluded = ["onClick", "disabled", "placeholder", "value", "onChange", "onBlur", "onKeyDown"],
|
|
17851
17851
|
_excluded2 = ["openCalendar", "onBlurCustom", "onBackspace", "Component", "onKeyDown", "onBlur"],
|
|
17852
|
-
_excluded3 = ["onChange", "onWeekSelect", "highlightWeek", "selected", "selectWeek", "selectedRange", "customInput", "highlightDates", "locale", "dateFormat", "inline", "clearable"];
|
|
17852
|
+
_excluded3 = ["onChange", "onWeekSelect", "highlightWeek", "selected", "selectWeek", "selectedRange", "customInput", "highlightDates", "locale", "dateFormat", "inline", "clearable", "inputRef"];
|
|
17853
17853
|
|
|
17854
17854
|
|
|
17855
17855
|
|
|
@@ -17949,7 +17949,7 @@ var CustomInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__["forwardRef"](
|
|
|
17949
17949
|
};
|
|
17950
17950
|
|
|
17951
17951
|
var blurEvents = function blurEvents(event) {
|
|
17952
|
-
onBlurCustom();
|
|
17952
|
+
onBlurCustom(event);
|
|
17953
17953
|
onBlur(event);
|
|
17954
17954
|
};
|
|
17955
17955
|
|
|
@@ -17976,6 +17976,7 @@ var Datepicker = function Datepicker(_ref3) {
|
|
|
17976
17976
|
inline = _ref3.inline,
|
|
17977
17977
|
_ref3$clearable = _ref3.clearable,
|
|
17978
17978
|
clearable = _ref3$clearable === void 0 ? true : _ref3$clearable,
|
|
17979
|
+
inputRef = _ref3.inputRef,
|
|
17979
17980
|
pickerProps = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3___default()(_ref3, _excluded3);
|
|
17980
17981
|
|
|
17981
17982
|
var calendarRef = react__WEBPACK_IMPORTED_MODULE_4__["useRef"](null);
|
|
@@ -18025,7 +18026,7 @@ var Datepicker = function Datepicker(_ref3) {
|
|
|
18025
18026
|
date = _React$useState6[0],
|
|
18026
18027
|
setDate = _React$useState6[1];
|
|
18027
18028
|
|
|
18028
|
-
var callOnChangeFunctions = function callOnChangeFunctions() {
|
|
18029
|
+
var callOnChangeFunctions = function callOnChangeFunctions(event) {
|
|
18029
18030
|
if (calendarRef !== null && calendarRef !== void 0 && calendarRef.current.isCalendarOpen() && !inline) {
|
|
18030
18031
|
return;
|
|
18031
18032
|
}
|
|
@@ -18033,7 +18034,15 @@ var Datepicker = function Datepicker(_ref3) {
|
|
|
18033
18034
|
if (selectWeek && !!onWeekSelect) {
|
|
18034
18035
|
onWeekSelect(weekDates(date ? new Date(date) : date, selectedRange));
|
|
18035
18036
|
} else if (formatDateValue(date) !== inputDateValue || date === null) {
|
|
18036
|
-
|
|
18037
|
+
var parsedDate = Object(date_fns__WEBPACK_IMPORTED_MODULE_11__["parse"])(event === null || event === void 0 ? void 0 : event.target.value, dateFormat, new Date(), {
|
|
18038
|
+
locale: localeObject
|
|
18039
|
+
});
|
|
18040
|
+
|
|
18041
|
+
if (parsedDate && Object(date_fns__WEBPACK_IMPORTED_MODULE_11__["isValid"])(parsedDate)) {
|
|
18042
|
+
onChange(parsedDate);
|
|
18043
|
+
} else {
|
|
18044
|
+
onChange(date ? new Date(date) : date);
|
|
18045
|
+
}
|
|
18037
18046
|
}
|
|
18038
18047
|
|
|
18039
18048
|
setInputDateValue(formatDateValue(date));
|
|
@@ -18096,7 +18105,13 @@ var Datepicker = function Datepicker(_ref3) {
|
|
|
18096
18105
|
onBackspace: handleOnBackspace,
|
|
18097
18106
|
Component: customInput || DefaultInput
|
|
18098
18107
|
}),
|
|
18099
|
-
ref:
|
|
18108
|
+
ref: function ref(datepickerRef) {
|
|
18109
|
+
calendarRef.current = datepickerRef;
|
|
18110
|
+
|
|
18111
|
+
if (inputRef) {
|
|
18112
|
+
inputRef.current = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.input;
|
|
18113
|
+
}
|
|
18114
|
+
},
|
|
18100
18115
|
highlightDates: highlightedDates,
|
|
18101
18116
|
locale: localeObject,
|
|
18102
18117
|
isClearable: true,
|
|
@@ -64809,7 +64824,9 @@ var IntersectionObserverWrapper = function IntersectionObserverWrapper(_ref) {
|
|
|
64809
64824
|
});
|
|
64810
64825
|
observer.observe(domRef.current);
|
|
64811
64826
|
return function () {
|
|
64812
|
-
|
|
64827
|
+
if (domRef.current) {
|
|
64828
|
+
observer.unobserve(domRef.current);
|
|
64829
|
+
}
|
|
64813
64830
|
};
|
|
64814
64831
|
}, [root, rootMargin, threshold]);
|
|
64815
64832
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](as, {
|