@stenajs-webui/calendar 15.0.0 → 15.0.3

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 ADDED
@@ -0,0 +1,13 @@
1
+ # v15.0.1 (Thu Feb 17 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Increase width of DateTimeInput [#429](https://github.com/StenaIT/stenajs-webui/pull/429) ([@lindskogen](https://github.com/lindskogen))
6
+
7
+ #### ⚠️ Pushed to `master`
8
+
9
+ - Fix exact version reference ([@lindskogen](https://github.com/lindskogen))
10
+
11
+ #### Authors: 1
12
+
13
+ - Johan Lindskogen ([@lindskogen](https://github.com/lindskogen))
@@ -1,7 +1,8 @@
1
1
  import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
2
2
  import * as React from "react";
3
+ import { DualTextInputProps } from "../../../features/dual-text-input/DualTextInput";
3
4
  import { OptionalMinMaxDatesAsString } from "../../../types/CalendarTypes";
4
- export interface DateTimeInputProps extends ValueAndOnValueChangeProps<Date | null>, OptionalMinMaxDatesAsString {
5
+ export interface DateTimeInputProps extends ValueAndOnValueChangeProps<Date | null>, OptionalMinMaxDatesAsString, Pick<DualTextInputProps, "widthLeft" | "widthRight"> {
5
6
  onEsc?: () => void;
6
7
  onEnter?: () => void;
7
8
  onBlur?: () => void;
package/dist/index.es.js CHANGED
@@ -1773,13 +1773,13 @@ var useUserInputHandlers$1 = function (onChangeDate, dateInputRef, showCalendar,
1773
1773
  };
1774
1774
 
1775
1775
  var DateTimeInput = function (_a) {
1776
- 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 = _b === void 0 ? defaultMaxDate : _b;
1776
+ 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;
1777
1777
  var dateInputRef = useRef(null);
1778
1778
  var timeInputRef = useRef(null);
1779
1779
  var states = useInputStates$1(value);
1780
1780
  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;
1781
- var _c = useDateRangeHandlers$1(value, onValueChange, states, dateInputRef), showCalendar = _c.showCalendar, hideCalendar = _c.hideCalendar, inputLeftChangeHandler = _c.inputLeftChangeHandler, inputRightChangeHandler = _c.inputRightChangeHandler, onChangeTime = _c.onChangeTime, onChangeDate = _c.onChangeDate;
1782
- var _d = useUserInputHandlers$1(onChangeDate, dateInputRef, showCalendar, hideCalendar, states), onKeyDownHandler = _d.onKeyDownHandler, onFocusRight = _d.onFocusRight, onFocusLeft = _d.onFocusLeft, onClickDay = _d.onClickDay, onClickCalendarButton = _d.onClickCalendarButton, onClickArrowButton = _d.onClickArrowButton;
1781
+ 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;
1782
+ 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;
1783
1783
  useDateRangeEffects$1(value, setDateInFocus, dateInputRef);
1784
1784
  var statePerMonth = useMemo(function () {
1785
1785
  var dateToHighlight = value || localDate;
@@ -1805,7 +1805,7 @@ var DateTimeInput = function (_a) {
1805
1805
  React.createElement(Space, null),
1806
1806
  React.createElement(Row, { justifyContent: "flex-end" },
1807
1807
  React.createElement(PrimaryButton, { label: "Done", onClick: hideTimePicker })))) : null)) },
1808
- React.createElement(DualTextInput, { autoFocusLeft: autoFocus, onEsc: onEsc, onEnter: onEnter, onBlur: onBlur, separatorIcon: faClock$1, 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: "104px", widthRight: "64px", minLeft: minDate, maxLeft: maxDate }))));
1808
+ React.createElement(DualTextInput, { autoFocusLeft: autoFocus, onEsc: onEsc, onEnter: onEnter, onBlur: onBlur, separatorIcon: faClock$1, 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 }))));
1809
1809
  };
1810
1810
 
1811
1811
  var useDateRangeEffects = function (startDate, endDate, setDateInFocus, startDateInputRef, endDateInputRef) {