@stenajs-webui/calendar 15.0.0-alpha.8 → 15.0.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.
- package/CHANGELOG.md +13 -0
- package/dist/components/input-types/date-range-dual-text-input/DateRangeDualTextInput.d.ts +3 -2
- package/dist/components/input-types/date-range-dual-text-input/DateRangeDualTextInput.stories.d.ts +2 -1
- package/dist/components/input-types/date-time-input/DateTimeInput.d.ts +2 -1
- package/dist/index.es.js +9 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1799,13 +1799,13 @@ var useUserInputHandlers$1 = function (onChangeDate, dateInputRef, showCalendar,
|
|
|
1799
1799
|
};
|
|
1800
1800
|
|
|
1801
1801
|
var DateTimeInput = function (_a) {
|
|
1802
|
-
var value = _a.value, onValueChange = _a.onValueChange, onEnter = _a.onEnter, onEsc = _a.onEsc, onBlur = _a.onBlur, autoFocus = _a.autoFocus, minDate = _a.minDate, _b = _a.maxDate, maxDate =
|
|
1802
|
+
var value = _a.value, onValueChange = _a.onValueChange, onEnter = _a.onEnter, onEsc = _a.onEsc, onBlur = _a.onBlur, autoFocus = _a.autoFocus, minDate = _a.minDate, _b = _a.widthLeft, widthLeft = _b === void 0 ? 128 : _b, _c = _a.widthRight, widthRight = _c === void 0 ? 80 : _c, _d = _a.maxDate, maxDate = _d === void 0 ? defaultMaxDate : _d;
|
|
1803
1803
|
var dateInputRef = React.useRef(null);
|
|
1804
1804
|
var timeInputRef = React.useRef(null);
|
|
1805
1805
|
var states = useInputStates$1(value);
|
|
1806
1806
|
var setCurrentPanel = states.setCurrentPanel, currentPanel = states.currentPanel, isCalendarVisible = states.isCalendarVisible, dateInFocus = states.dateInFocus, setDateInFocus = states.setDateInFocus, isTimePickerVisible = states.isTimePickerVisible, hideTimePicker = states.hideTimePicker, localTime = states.localTime, localDate = states.localDate;
|
|
1807
|
-
var
|
|
1808
|
-
var
|
|
1807
|
+
var _e = useDateRangeHandlers$1(value, onValueChange, states, dateInputRef), showCalendar = _e.showCalendar, hideCalendar = _e.hideCalendar, inputLeftChangeHandler = _e.inputLeftChangeHandler, inputRightChangeHandler = _e.inputRightChangeHandler, onChangeTime = _e.onChangeTime, onChangeDate = _e.onChangeDate;
|
|
1808
|
+
var _f = useUserInputHandlers$1(onChangeDate, dateInputRef, showCalendar, hideCalendar, states), onKeyDownHandler = _f.onKeyDownHandler, onFocusRight = _f.onFocusRight, onFocusLeft = _f.onFocusLeft, onClickDay = _f.onClickDay, onClickCalendarButton = _f.onClickCalendarButton, onClickArrowButton = _f.onClickArrowButton;
|
|
1809
1809
|
useDateRangeEffects$1(value, setDateInFocus, dateInputRef);
|
|
1810
1810
|
var statePerMonth = React.useMemo(function () {
|
|
1811
1811
|
var dateToHighlight = value || localDate;
|
|
@@ -1831,7 +1831,7 @@ var DateTimeInput = function (_a) {
|
|
|
1831
1831
|
React__namespace.createElement(core.Space, null),
|
|
1832
1832
|
React__namespace.createElement(core.Row, { justifyContent: "flex-end" },
|
|
1833
1833
|
React__namespace.createElement(elements.PrimaryButton, { label: "Done", onClick: hideTimePicker })))) : null)) },
|
|
1834
|
-
React__namespace.createElement(DualTextInput, { autoFocusLeft: autoFocus, onEsc: onEsc, onEnter: onEnter, onBlur: onBlur, separatorIcon: faClock$1.faClock, typeLeft: "date", typeRight: "time", placeholderLeft: "yyyy-mm-dd", placeholderRight: "hh:mm", onChangeLeft: inputLeftChangeHandler, onChangeRight: inputRightChangeHandler, onClickArrowDown: onClickArrowButton, onClickCalendar: onClickCalendarButton, onFocusLeft: onFocusLeft, onFocusRight: onFocusRight, onClickLeft: onFocusLeft, onClickRight: onFocusRight, inputRefLeft: dateInputRef, inputRefRight: timeInputRef, valueRight: timeValue !== null && timeValue !== void 0 ? timeValue : "", widthLeft:
|
|
1834
|
+
React__namespace.createElement(DualTextInput, { autoFocusLeft: autoFocus, onEsc: onEsc, onEnter: onEnter, onBlur: onBlur, separatorIcon: faClock$1.faClock, typeLeft: "date", typeRight: "time", placeholderLeft: "yyyy-mm-dd", placeholderRight: "hh:mm", onChangeLeft: inputLeftChangeHandler, onChangeRight: inputRightChangeHandler, onClickArrowDown: onClickArrowButton, onClickCalendar: onClickCalendarButton, onFocusLeft: onFocusLeft, onFocusRight: onFocusRight, onClickLeft: onFocusLeft, onClickRight: onFocusRight, inputRefLeft: dateInputRef, inputRefRight: timeInputRef, valueRight: timeValue !== null && timeValue !== void 0 ? timeValue : "", widthLeft: widthLeft, widthRight: widthRight, minLeft: minDate, maxLeft: maxDate }))));
|
|
1835
1835
|
};
|
|
1836
1836
|
|
|
1837
1837
|
var useDateRangeEffects = function (startDate, endDate, setDateInFocus, startDateInputRef, endDateInputRef) {
|
|
@@ -2082,14 +2082,14 @@ var useUserInputHandlers = function (startDate, endDate, onValueChange, startDat
|
|
|
2082
2082
|
};
|
|
2083
2083
|
|
|
2084
2084
|
var DateRangeDualTextInput = function (_a) {
|
|
2085
|
-
var value = _a.value, onValueChange = _a.onValueChange, autoFocus = _a.autoFocus, onBlur = _a.onBlur, onEnter = _a.onEnter, onEsc = _a.onEsc, minDate = _a.minDate, _b = _a.maxDate, maxDate = _b === void 0 ? defaultMaxDate : _b, calendarProps = _a.calendarProps;
|
|
2086
|
-
var
|
|
2085
|
+
var value = _a.value, onValueChange = _a.onValueChange, autoFocus = _a.autoFocus, onBlur = _a.onBlur, onEnter = _a.onEnter, onEsc = _a.onEsc, minDate = _a.minDate, _b = _a.maxDate, maxDate = _b === void 0 ? defaultMaxDate : _b, calendarProps = _a.calendarProps, _c = _a.widthLeft, widthLeft = _c === void 0 ? 128 : _c, _d = _a.widthRight, widthRight = _d === void 0 ? 128 : _d;
|
|
2086
|
+
var _e = value || {}, startDate = _e.startDate, endDate = _e.endDate;
|
|
2087
2087
|
var startDateInputRef = React.useRef(null);
|
|
2088
2088
|
var endDateInputRef = React.useRef(null);
|
|
2089
2089
|
var states = useInputStates(startDate, endDate);
|
|
2090
2090
|
var dateInFocus = states.dateInFocus, setDateInFocus = states.setDateInFocus, isCalendarVisible = states.isCalendarVisible, currentPanel = states.currentPanel, setCurrentPanel = states.setCurrentPanel;
|
|
2091
|
-
var
|
|
2092
|
-
var
|
|
2091
|
+
var _f = useDateRangeHandlers(startDate, endDate, onValueChange, states), showCalendar = _f.showCalendar, hideCalendar = _f.hideCalendar, inputLeftChangeHandler = _f.inputLeftChangeHandler, inputRightChangeHandler = _f.inputRightChangeHandler;
|
|
2092
|
+
var _g = useUserInputHandlers(startDate, endDate, onValueChange, startDateInputRef, endDateInputRef, showCalendar, hideCalendar, states), onKeyDownHandler = _g.onKeyDownHandler, onFocusRight = _g.onFocusRight, onFocusLeft = _g.onFocusLeft, onClickDay = _g.onClickDay, onClickCalendarButton = _g.onClickCalendarButton, onClickArrowButton = _g.onClickArrowButton;
|
|
2093
2093
|
useDateRangeEffects(startDate, endDate, setDateInFocus, startDateInputRef, endDateInputRef);
|
|
2094
2094
|
var startDateIsAfterEnd = React.useMemo(function () { return startDate && endDate && dateFns.isAfter(startDate, endDate); }, [startDate, endDate]);
|
|
2095
2095
|
var statePerMonth = React.useMemo(function () {
|
|
@@ -2098,7 +2098,7 @@ var DateRangeDualTextInput = function (_a) {
|
|
|
2098
2098
|
var delayedIsCalendarVisible = core.useDelayedFalse(isCalendarVisible, 300);
|
|
2099
2099
|
return (React__namespace.createElement(core.Box, { onKeyDown: onKeyDownHandler },
|
|
2100
2100
|
React__namespace.createElement(tooltip.Popover, { arrow: false, lazy: true, placement: defaultPopoverPlacement, onClickOutside: hideCalendar, visible: isCalendarVisible, content: delayedIsCalendarVisible && (React__namespace.createElement(CalendarWithMonthSwitcher, __assign({ onClickDay: onClickDay, dateInFocus: dateInFocus, setDateInFocus: setDateInFocus, currentPanel: currentPanel, setCurrentPanel: setCurrentPanel, minDate: minDate, maxDate: maxDate }, calendarProps, { statePerMonth: statePerMonth }))) },
|
|
2101
|
-
React__namespace.createElement(DualTextInput, { autoFocusLeft: autoFocus, onEsc: onEsc, onEnter: onEnter, onBlur: onBlur, separatorIcon: elements.stenaArrowRight, typeLeft: "date", typeRight: "date", placeholderLeft: "Start date", placeholderRight: "End date", onChangeLeft: inputLeftChangeHandler, onChangeRight: inputRightChangeHandler, onClickArrowDown: onClickArrowButton, onClickCalendar: onClickCalendarButton, onFocusLeft: onFocusLeft, onFocusRight: onFocusRight, onClickLeft: onFocusLeft, onClickRight: onFocusRight, inputRefLeft: startDateInputRef, inputRefRight: endDateInputRef, variant: startDateIsAfterEnd ? "error" : undefined, widthLeft:
|
|
2101
|
+
React__namespace.createElement(DualTextInput, { autoFocusLeft: autoFocus, onEsc: onEsc, onEnter: onEnter, onBlur: onBlur, separatorIcon: elements.stenaArrowRight, typeLeft: "date", typeRight: "date", placeholderLeft: "Start date", placeholderRight: "End date", onChangeLeft: inputLeftChangeHandler, onChangeRight: inputRightChangeHandler, onClickArrowDown: onClickArrowButton, onClickCalendar: onClickCalendarButton, onFocusLeft: onFocusLeft, onFocusRight: onFocusRight, onClickLeft: onFocusLeft, onClickRight: onFocusRight, inputRefLeft: startDateInputRef, inputRefRight: endDateInputRef, variant: startDateIsAfterEnd ? "error" : undefined, widthLeft: widthLeft, widthRight: widthRight, minLeft: minDate, maxLeft: maxDate, minRight: minDate, maxRight: maxDate }))));
|
|
2102
2102
|
};
|
|
2103
2103
|
|
|
2104
2104
|
exports.Calendar = Calendar;
|