@stenajs-webui/calendar 20.6.11 → 20.7.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/CalendarTheme.d.ts +3 -3
- package/dist/components/calendar/DisabledDayWrapper.d.ts +1 -1
- package/dist/components/calendar/renderers/CalendarDay.d.ts +1 -1
- package/dist/components/calendar-types/date-range-calendar/DateRangeCalendar.d.ts +2 -2
- package/dist/components/calendar-types/single-week-calendar/SingleWeekCalendar.d.ts +1 -1
- package/dist/components/input-types/date-input/UseDateInput.d.ts +1 -1
- package/dist/components/input-types/date-range-dual-text-input/hooks/UseInputStates.d.ts +1 -1
- package/dist/components/input-types/date-text-input/DateTextInput.d.ts +1 -1
- package/dist/components/input-types/date-time-input/hooks/UseInputStates.d.ts +1 -1
- package/dist/features/calendar-with-month-year-pickers/CalendarPanelType.d.ts +1 -1
- package/dist/features/internal-panel-state/UseInternalPanelState.d.ts +1 -1
- package/dist/features/month-switcher/CalendarWithMonthSwitcher.d.ts +1 -1
- package/dist/features/month-switcher/hooks/UseSelectedMonthStepperLogic.d.ts +1 -1
- package/dist/features/preset-picker/CalendarPreset.d.ts +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.es.js +1036 -1082
- 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 +15 -15
- package/dist/types/InternalPanelAndFocusStateProps.d.ts +1 -1
- package/dist/util/calendar/StateHelper.d.ts +1 -1
- package/package.json +7 -7
- package/dist/components/calendar-types/date-range-exclusion-calendar/DateRangeExclusionCalendar.d.ts +0 -7
- package/dist/components/calendar-types/date-range-exclusion-calendar/UseDateRangeExclusionSelection.d.ts +0 -3
|
@@ -26,8 +26,8 @@ export interface CalendarOnClicks<T> {
|
|
|
26
26
|
/** onClick for the year in the calendar header */
|
|
27
27
|
onClickYear?: OnClickYear;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
30
|
-
export
|
|
29
|
+
export type RenderWeekNumber = (week: WeekData, theme: CalendarTheme, onClick?: OnClickWeek) => JSX.Element;
|
|
30
|
+
export type RenderWeekDay = (weekDayName: string, theme: CalendarTheme, onClick?: OnClickWeekDay) => JSX.Element;
|
|
31
31
|
export interface Renderers {
|
|
32
32
|
/** Render function for week number to the left of the days in the month. */
|
|
33
33
|
renderWeekNumber?: RenderWeekNumber;
|
|
@@ -85,7 +85,7 @@ export interface CalendarPropsWithDateSet<T> {
|
|
|
85
85
|
monthsPerRow?: number;
|
|
86
86
|
dayComponent?: React.ComponentType<CalendarDayProps<T>>;
|
|
87
87
|
}
|
|
88
|
-
export
|
|
88
|
+
export type DayStateHighlight = "selected" | "singleSelected" | "selectedStart" | "selectedEnd" | "range" | "today" | "error" | "disabled" | string;
|
|
89
89
|
export interface HighlightsState {
|
|
90
90
|
highlights?: Array<DayStateHighlight>;
|
|
91
91
|
}
|
|
@@ -109,27 +109,27 @@ export interface OptionalMinMaxDatesAsString {
|
|
|
109
109
|
*/
|
|
110
110
|
maxDate?: string;
|
|
111
111
|
}
|
|
112
|
-
export
|
|
113
|
-
export
|
|
114
|
-
export
|
|
115
|
-
export
|
|
116
|
-
export
|
|
117
|
-
export
|
|
118
|
-
export
|
|
112
|
+
export type DayState = HighlightsState;
|
|
113
|
+
export type OnClickDay<T> = (day: DayData, data: T | undefined, ev: React.MouseEvent<HTMLButtonElement>) => void;
|
|
114
|
+
export type OnClickWeekDay = (weekDay: number, ev: React.MouseEvent<HTMLButtonElement>) => void;
|
|
115
|
+
export type OnClickWeek = (week: WeekData, ev: React.MouseEvent<HTMLButtonElement>) => void;
|
|
116
|
+
export type OnClickMonth = (month: MonthData) => void;
|
|
117
|
+
export type OnClickYear = (year: number) => void;
|
|
118
|
+
export type CalendarUserData<T> = {
|
|
119
119
|
[key: string]: CalendarUserMonthData<T>;
|
|
120
120
|
};
|
|
121
|
-
export
|
|
121
|
+
export type CalendarUserMonthData<T> = {
|
|
122
122
|
[key: number]: CalendarUserWeekData<T>;
|
|
123
123
|
};
|
|
124
|
-
export
|
|
124
|
+
export type CalendarUserWeekData<T> = {
|
|
125
125
|
[key: number]: T;
|
|
126
126
|
};
|
|
127
|
-
export
|
|
127
|
+
export type CalendarState = {
|
|
128
128
|
[key: string]: StateForMonth;
|
|
129
129
|
};
|
|
130
|
-
export
|
|
130
|
+
export type StateForMonth = {
|
|
131
131
|
[key: number]: StateForWeek;
|
|
132
132
|
};
|
|
133
|
-
export
|
|
133
|
+
export type StateForWeek = {
|
|
134
134
|
[key: number]: DayState;
|
|
135
135
|
} & HighlightsState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UseInternalPanelStateProps } from "../features/internal-panel-state/UseInternalPanelState";
|
|
2
2
|
import { CalendarWithMonthSwitcherProps } from "../features/month-switcher/CalendarWithMonthSwitcher";
|
|
3
|
-
export
|
|
3
|
+
export type InternalPanelAndFocusStateProps<T> = Omit<CalendarWithMonthSwitcherProps<T>, "currentPanel" | "setCurrentPanel" | "dateInFocus" | "setDateInFocus"> & UseInternalPanelStateProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DayState, DayStateHighlight } from "../../types/CalendarTypes";
|
|
2
2
|
export declare const dayHasHighlight: (dayState: DayState | undefined, defaultHighlights: Array<DayStateHighlight> | undefined, highlight: string) => boolean;
|
|
3
|
-
export declare const dayHighlightSelect: <T>(dayState: DayState | undefined, defaultHighlights: Array<DayStateHighlight> | undefined, highlightsOrBoolean: Array<string | boolean>, returnValues: T
|
|
3
|
+
export declare const dayHighlightSelect: <T>(dayState: DayState | undefined, defaultHighlights: Array<DayStateHighlight> | undefined, highlightsOrBoolean: Array<string | boolean>, returnValues: Array<T>, fallbackValue?: T) => T | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/calendar",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"deploy": "gh-pages -d example/build"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@stenajs-webui/core": "20.
|
|
37
|
-
"@stenajs-webui/elements": "20.
|
|
38
|
-
"@stenajs-webui/forms": "20.
|
|
39
|
-
"@stenajs-webui/theme": "20.
|
|
40
|
-
"@stenajs-webui/tooltip": "20.
|
|
36
|
+
"@stenajs-webui/core": "20.7.1",
|
|
37
|
+
"@stenajs-webui/elements": "20.7.1",
|
|
38
|
+
"@stenajs-webui/forms": "20.7.1",
|
|
39
|
+
"@stenajs-webui/theme": "20.7.1",
|
|
40
|
+
"@stenajs-webui/tooltip": "20.7.1",
|
|
41
41
|
"date-fns": "2.26.0",
|
|
42
42
|
"lodash-es": "^4.17.21"
|
|
43
43
|
},
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"files": [
|
|
77
77
|
"dist"
|
|
78
78
|
],
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "ecd4c387ff487b41a963a69ddc79ad7cf3cee419"
|
|
80
80
|
}
|
package/dist/components/calendar-types/date-range-exclusion-calendar/DateRangeExclusionCalendar.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { UseInternalPanelStateProps } from "../../../features/internal-panel-state/UseInternalPanelState";
|
|
3
|
-
import { InternalPanelAndFocusStateProps } from "../../../types/InternalPanelAndFocusStateProps";
|
|
4
|
-
import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
|
|
5
|
-
export interface DateRangeExclusionCalendarProps<T> extends InternalPanelAndFocusStateProps<T>, UseInternalPanelStateProps, ValueAndOnValueChangeProps<Array<Date>> {
|
|
6
|
-
}
|
|
7
|
-
export declare function DateRangeExclusionCalendar<T>(props: DateRangeExclusionCalendarProps<T>): JSX.Element;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { DateRangeExclusionCalendarProps } from "./DateRangeExclusionCalendar";
|
|
2
|
-
import { CalendarWithMonthSwitcherProps } from "../../../features/month-switcher/CalendarWithMonthSwitcher";
|
|
3
|
-
export declare const useDateRangeExclusionSelection: <T>({ value, onValueChange, statePerMonth, onChangePanel, }: DateRangeExclusionCalendarProps<T>) => CalendarWithMonthSwitcherProps<T>;
|