@stenajs-webui/calendar 20.10.0 → 20.11.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/dist/components/calendar/CalendarMonth.d.ts +2 -1
- package/dist/components/input-types/date-input/DateInput.d.ts +1 -1
- package/dist/components/input-types/date-text-input/DateTextInput.d.ts +1 -1
- package/dist/index.es.js +6 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/CalendarTypes.d.ts +3 -3
- package/package.json +7 -7
|
@@ -2,13 +2,14 @@ import * as React from "react";
|
|
|
2
2
|
import { CalendarDayProps, CalendarOnClicks, CalendarUserMonthData, DayState, DayStateHighlight, ExtraDayContentProps, OptionalMinMaxDates, Renderers } from "../../types/CalendarTypes";
|
|
3
3
|
import { MonthData } from "../../util/calendar/CalendarDataFactory";
|
|
4
4
|
import { CalendarTheme } from "./CalendarTheme";
|
|
5
|
+
import { ReactNode } from "react";
|
|
5
6
|
export interface CalendarMonthProps<T> extends CalendarOnClicks<T>, Renderers, OptionalMinMaxDates {
|
|
6
7
|
month: MonthData;
|
|
7
8
|
dayComponent?: React.ComponentType<CalendarDayProps<T>>;
|
|
8
9
|
userDataPerWeek?: CalendarUserMonthData<T>;
|
|
9
10
|
statePerWeek?: CalendarUserMonthData<DayState>;
|
|
10
11
|
theme?: CalendarTheme;
|
|
11
|
-
headerRightContent?:
|
|
12
|
+
headerRightContent?: ReactNode;
|
|
12
13
|
extraDayContent?: React.ComponentType<ExtraDayContentProps<T>>;
|
|
13
14
|
defaultHighlights?: Array<DayStateHighlight>;
|
|
14
15
|
showWeekNumber: boolean;
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { CalendarTheme } from "../../calendar/CalendarTheme";
|
|
4
4
|
import { DateTextInputCalendarProps } from "../date-text-input/DateTextInput";
|
|
5
5
|
import { OptionalMinMaxDatesAsString } from "../../../types/CalendarTypes";
|
|
6
|
-
export interface DateInputProps<T =
|
|
6
|
+
export interface DateInputProps<T = unknown> extends OptionalMinMaxDatesAsString {
|
|
7
7
|
/** The current value */
|
|
8
8
|
value?: Date;
|
|
9
9
|
/** onChange handler for when the user selects a date. */
|
|
@@ -25,4 +25,4 @@ export interface DateTextInputProps<T> extends Omit<TextInputProps, "onChange" |
|
|
|
25
25
|
/** The date text input theme to use. */
|
|
26
26
|
calendarTheme?: CalendarTheme;
|
|
27
27
|
}
|
|
28
|
-
export declare const DateTextInput: React.FC<DateTextInputProps<
|
|
28
|
+
export declare const DateTextInput: React.FC<DateTextInputProps<unknown>>;
|
package/dist/index.es.js
CHANGED
|
@@ -1513,17 +1513,18 @@ const Mn = ({
|
|
|
1513
1513
|
switch (t.length) {
|
|
1514
1514
|
case 1:
|
|
1515
1515
|
return { time: `0${t}:00`, success: !0 };
|
|
1516
|
-
case 2:
|
|
1516
|
+
case 2: {
|
|
1517
1517
|
const s = parseInt(e[0], 10);
|
|
1518
1518
|
return s >= 0 && s < 24 ? { time: `${t}:00`, success: !0 } : s >= 24 && s < 59 ? { time: `00:${t}`, success: !0 } : { time: t, success: !1 };
|
|
1519
|
+
}
|
|
1519
1520
|
case 3:
|
|
1520
|
-
return n = parseInt(t.
|
|
1521
|
-
time: `0${t.
|
|
1521
|
+
return n = parseInt(t.substring(1, 3), 10), n >= 0 && n <= 59 ? {
|
|
1522
|
+
time: `0${t.substring(0, 1)}:${t.substring(1, 3)}`,
|
|
1522
1523
|
success: !0
|
|
1523
1524
|
} : { time: t, success: !1 };
|
|
1524
1525
|
case 4:
|
|
1525
|
-
return r = parseInt(t.
|
|
1526
|
-
time: `${t.
|
|
1526
|
+
return r = parseInt(t.substring(0, 2), 10), n = parseInt(t.substring(2, 4), 10), r < 0 || r > 23 ? { time: t, success: !1 } : n < 0 || n > 59 ? { time: t, success: !1 } : {
|
|
1527
|
+
time: `${t.substring(0, 2)}:${t.substring(2, 4)}`,
|
|
1527
1528
|
success: !0
|
|
1528
1529
|
};
|
|
1529
1530
|
default:
|