@stenajs-webui/calendar 16.1.0 → 17.1.1

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 CHANGED
@@ -1,3 +1,19 @@
1
+ # v17.0.0 (Fri Jun 17 2022)
2
+
3
+ #### 💥 Breaking Change
4
+
5
+ - Upgrade and apply prettier. [#467](https://github.com/StenaIT/stenajs-webui/pull/467) ([@mattias800](https://github.com/mattias800))
6
+
7
+ #### 🔩 Dependency Updates
8
+
9
+ - Update Typescript, React, Jest, etc. [#466](https://github.com/StenaIT/stenajs-webui/pull/466) ([@mattias800](https://github.com/mattias800))
10
+
11
+ #### Authors: 1
12
+
13
+ - Mattias Andersson ([@mattias800](https://github.com/mattias800))
14
+
15
+ ---
16
+
1
17
  # v16.0.0 (Wed Jun 15 2022)
2
18
 
3
19
  #### 💥 Breaking Change
@@ -1,5 +1,5 @@
1
- export declare const useDateInput: (onChange?: ((date: Date | undefined) => void) | undefined, onClose?: (() => void) | undefined, openOnMount?: boolean | undefined) => {
2
- showCalendar: () => boolean;
1
+ export declare const useDateInput: (onChange?: ((date: Date | undefined) => void) | undefined, onClose?: () => void, openOnMount?: boolean) => {
2
+ showCalendar: () => true;
3
3
  hideCalendar: () => void;
4
4
  showingCalendar: boolean;
5
5
  onSelectDate: (date: Date | undefined) => void;
@@ -5,8 +5,8 @@ import { DateRange } from "../../../../types/DateRange";
5
5
  export declare const useDateRangeInput: (value: DateRange | undefined, onValueChange: ((dateRange: DateRange) => void) | undefined) => {
6
6
  showingCalendar: boolean;
7
7
  hideCalendar: () => void;
8
- showCalendarEndDate: () => boolean;
9
- showCalendarStartDate: () => boolean;
8
+ showCalendarEndDate: () => true;
9
+ showCalendarStartDate: () => true;
10
10
  focusedInput: DateRangeFocusedInput;
11
11
  setFocusedInput: import("react").Dispatch<import("react").SetStateAction<DateRangeFocusedInput>>;
12
12
  startDateInputRef: import("react").RefObject<HTMLInputElement>;
@@ -1,10 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { CalendarTheme } from "../../components/calendar/CalendarTheme";
3
+ import { ReactNode } from "react";
3
4
  export interface WithMonthSwitcherBelowProps {
4
5
  theme: CalendarTheme;
5
6
  nextMonth: () => void;
6
7
  prevMonth: () => void;
7
8
  nextYear: () => void;
8
9
  prevYear: () => void;
10
+ children?: ReactNode;
9
11
  }
10
12
  export declare const WithMonthSwitcherBelow: React.FC<WithMonthSwitcherBelowProps>;
@@ -1,4 +1,4 @@
1
- export declare const useSelectedMonthStepperLogic: (dateInFocus: Date, setDateInFocus?: ((dateInFocus: Date) => void) | undefined, monthsPerRow?: number | undefined, numMonths?: number | undefined) => {
1
+ export declare const useSelectedMonthStepperLogic: (dateInFocus: Date, setDateInFocus?: ((dateInFocus: Date) => void) | undefined, monthsPerRow?: number, numMonths?: number) => {
2
2
  nextMonth: () => void;
3
3
  prevMonth: () => void;
4
4
  nextYear: () => void;
package/dist/index.es.js CHANGED
@@ -143,7 +143,7 @@ var setDayStateValueFunction = function (state, date, setter) {
143
143
  var addDayStateHighlights = function (calendarState, date, highlights) {
144
144
  var _a, _b, _c;
145
145
  var month = date.getMonth() + 1;
146
- var monthString = date.getFullYear() + "-" + (month < 10 ? "0" : "") + month;
146
+ var monthString = "".concat(date.getFullYear(), "-").concat(month < 10 ? "0" : "").concat(month);
147
147
  var weekNumber = getISOWeek(date);
148
148
  var dayInMonth = getDate(date);
149
149
  var dayState = calendarState &&
@@ -162,7 +162,7 @@ var addWeekStateHighlights = function (calendarState, week, highlights) {
162
162
  var _a, _b;
163
163
  var date = week.days[0].date;
164
164
  var month = date.getMonth() + 1;
165
- var monthString = date.getFullYear() + "-" + (month < 10 ? "0" : "") + month;
165
+ var monthString = "".concat(date.getFullYear(), "-").concat(month < 10 ? "0" : "").concat(month);
166
166
  var weekNumber = week.weekNumber;
167
167
  var state = calendarState;
168
168
  week.days.forEach(function (day) {
@@ -1019,7 +1019,7 @@ var getWeekStringFromWeekData = function (week) {
1019
1019
  if (!week) {
1020
1020
  return undefined;
1021
1021
  }
1022
- return week.endYear + "-" + week.weekNumber;
1022
+ return "".concat(week.endYear, "-").concat(week.weekNumber);
1023
1023
  };
1024
1024
  var getWeekDataFromWeekString = function (week) {
1025
1025
  if (!week) {
@@ -1295,7 +1295,7 @@ var formatHours = function (hours) {
1295
1295
  }
1296
1296
  switch (hours.length) {
1297
1297
  case 1:
1298
- return "0" + h;
1298
+ return "0".concat(h);
1299
1299
  case 2:
1300
1300
  return hours;
1301
1301
  default:
@@ -1315,7 +1315,7 @@ var formatMinutes = function (minutes) {
1315
1315
  }
1316
1316
  switch (minutes.length) {
1317
1317
  case 1:
1318
- return "0" + m;
1318
+ return "0".concat(m);
1319
1319
  case 2:
1320
1320
  return minutes;
1321
1321
  default:
@@ -1331,7 +1331,7 @@ var formatTimeString = function (time) {
1331
1331
  try {
1332
1332
  var hours = formatHours(arr[0]);
1333
1333
  var minutes = formatMinutes(arr[1]);
1334
- return { time: hours + ":" + minutes, success: true };
1334
+ return { time: "".concat(hours, ":").concat(minutes), success: true };
1335
1335
  }
1336
1336
  catch (_a) {
1337
1337
  return { time: time, success: false };
@@ -1342,21 +1342,21 @@ var formatTimeString = function (time) {
1342
1342
  var minutes = 0;
1343
1343
  switch (time.length) {
1344
1344
  case 1:
1345
- return { time: "0" + time + ":00", success: true };
1345
+ return { time: "0".concat(time, ":00"), success: true };
1346
1346
  case 2:
1347
1347
  var timeNumber = parseInt(arr[0], 10);
1348
1348
  if (timeNumber >= 0 && timeNumber < 24) {
1349
- return { time: time + ":00", success: true };
1349
+ return { time: "".concat(time, ":00"), success: true };
1350
1350
  }
1351
1351
  else if (timeNumber >= 24 && timeNumber < 59) {
1352
- return { time: "00:" + time, success: true };
1352
+ return { time: "00:".concat(time), success: true };
1353
1353
  }
1354
1354
  return { time: time, success: false };
1355
1355
  case 3:
1356
1356
  minutes = parseInt(time.substr(1, 2), 10);
1357
1357
  if (minutes >= 0 && minutes <= 59) {
1358
1358
  return {
1359
- time: "0" + time.substr(0, 1) + ":" + time.substr(1, 2),
1359
+ time: "0".concat(time.substr(0, 1), ":").concat(time.substr(1, 2)),
1360
1360
  success: true,
1361
1361
  };
1362
1362
  }
@@ -1371,7 +1371,7 @@ var formatTimeString = function (time) {
1371
1371
  return { time: time, success: false };
1372
1372
  }
1373
1373
  return {
1374
- time: time.substr(0, 2) + ":" + time.substr(2, 2),
1374
+ time: "".concat(time.substr(0, 2), ":").concat(time.substr(2, 2)),
1375
1375
  success: true,
1376
1376
  };
1377
1377
  default:
@@ -1527,7 +1527,7 @@ var getHoursAndMinutesFromTimeString = function (value) {
1527
1527
  };
1528
1528
  };
1529
1529
  var transformTimeInDateToTimeString = function (date) {
1530
- return formatHours(String(date.getHours())) + ":" + formatMinutes(String(date.getMinutes()));
1530
+ return "".concat(formatHours(String(date.getHours())), ":").concat(formatMinutes(String(date.getMinutes())));
1531
1531
  };
1532
1532
 
1533
1533
  var css_248z = ".TimePicker-module_timePicker__1ElGu {\n overflow: hidden;\n width: 180px;\n}\n\n.TimePicker-module_timePickerColumn__2vfuE {\n overflow-y: hidden;\n flex: 1;\n}\n\n.TimePicker-module_timePickerColumn__2vfuE:hover {\n overflow-y: scroll;\n }\n";
@@ -1572,11 +1572,11 @@ var TimePicker = function (_a) {
1572
1572
  }, [value]);
1573
1573
  var onClickHour = useCallback(function (h) {
1574
1574
  setHour(h);
1575
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(formatHours(String(h !== null && h !== void 0 ? h : 0)) + ":" + formatMinutes(String(minute !== null && minute !== void 0 ? minute : 0)));
1575
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("".concat(formatHours(String(h !== null && h !== void 0 ? h : 0)), ":").concat(formatMinutes(String(minute !== null && minute !== void 0 ? minute : 0))));
1576
1576
  }, [minute, onValueChange]);
1577
1577
  var onClickMinutes = useCallback(function (m) {
1578
1578
  setMinute(m);
1579
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(formatHours(String(hour !== null && hour !== void 0 ? hour : 0)) + ":" + formatMinutes(String(m !== null && m !== void 0 ? m : 0)));
1579
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("".concat(formatHours(String(hour !== null && hour !== void 0 ? hour : 0)), ":").concat(formatMinutes(String(m !== null && m !== void 0 ? m : 0))));
1580
1580
  }, [hour, onValueChange]);
1581
1581
  return (React.createElement(Row, { className: styles.timePicker },
1582
1582
  React.createElement(TimePickerColumn, { items: hours, onClick: onClickHour, selectedItem: hour, canScrollRef: canScrollRef }),