@instructure/ui-calendar 8.52.1-snapshot-7 → 8.53.0
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 +5 -89
- package/es/Calendar/index.js +22 -15
- package/es/Calendar/props.js +3 -2
- package/lib/Calendar/index.js +22 -15
- package/lib/Calendar/props.js +3 -2
- package/package.json +19 -19
- package/src/Calendar/README.md +26 -33
- package/src/Calendar/index.tsx +31 -24
- package/src/Calendar/props.ts +17 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Calendar/index.d.ts +7 -5
- package/types/Calendar/index.d.ts.map +1 -1
- package/types/Calendar/props.d.ts +7 -3
- package/types/Calendar/props.d.ts.map +1 -1
|
@@ -27,8 +27,8 @@ declare class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
27
27
|
disabledDates?: string[] | ((isoDateToCheck: string) => boolean) | undefined;
|
|
28
28
|
locale?: string | undefined;
|
|
29
29
|
onDateSelected?: ((dateString: string, momentDate: Moment, e: React.MouseEvent<Element, globalThis.MouseEvent>) => void) | undefined;
|
|
30
|
-
onRequestRenderNextMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent
|
|
31
|
-
onRequestRenderPrevMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent
|
|
30
|
+
onRequestRenderNextMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent>, requestedMonth: string) => void) | undefined;
|
|
31
|
+
onRequestRenderPrevMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent>, requestedMonth: string) => void) | undefined;
|
|
32
32
|
renderNavigationLabel?: Renderable;
|
|
33
33
|
renderNextMonthButton?: Renderable;
|
|
34
34
|
renderPrevMonthButton?: Renderable;
|
|
@@ -36,6 +36,7 @@ declare class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
36
36
|
role?: "table" | "listbox" | undefined;
|
|
37
37
|
selectedDate?: string | undefined;
|
|
38
38
|
timezone?: string | undefined;
|
|
39
|
+
visibleMonth?: string | undefined;
|
|
39
40
|
}>;
|
|
40
41
|
static allowedProps: readonly (keyof {
|
|
41
42
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
@@ -44,8 +45,8 @@ declare class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
44
45
|
disabledDates?: string[] | ((isoDateToCheck: string) => boolean) | undefined;
|
|
45
46
|
locale?: string | undefined;
|
|
46
47
|
onDateSelected?: ((dateString: string, momentDate: Moment, e: React.MouseEvent<Element, globalThis.MouseEvent>) => void) | undefined;
|
|
47
|
-
onRequestRenderNextMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent
|
|
48
|
-
onRequestRenderPrevMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent
|
|
48
|
+
onRequestRenderNextMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent>, requestedMonth: string) => void) | undefined;
|
|
49
|
+
onRequestRenderPrevMonth?: ((e: React.MouseEvent<Element, globalThis.MouseEvent>, requestedMonth: string) => void) | undefined;
|
|
49
50
|
renderNavigationLabel?: Renderable;
|
|
50
51
|
renderNextMonthButton?: Renderable;
|
|
51
52
|
renderPrevMonthButton?: Renderable;
|
|
@@ -53,6 +54,7 @@ declare class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
53
54
|
role?: "table" | "listbox" | undefined;
|
|
54
55
|
selectedDate?: string | undefined;
|
|
55
56
|
timezone?: string | undefined;
|
|
57
|
+
visibleMonth?: string | undefined;
|
|
56
58
|
})[];
|
|
57
59
|
static defaultProps: {
|
|
58
60
|
as: string;
|
|
@@ -65,7 +67,7 @@ declare class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
65
67
|
componentDidMount(): void;
|
|
66
68
|
componentDidUpdate(prevProps: CalendarProps): void;
|
|
67
69
|
calculateState: (locale: string, timezone: string, currentDate?: string) => {
|
|
68
|
-
|
|
70
|
+
visibleMonth: Moment;
|
|
69
71
|
today: Moment;
|
|
70
72
|
};
|
|
71
73
|
get role(): "listbox" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Calendar/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAY,SAAS,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAA;AAe5E,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAKlD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAG3B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAQtD;;;;GAIG;AACH,cAEM,QAAS,SAAQ,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAEhC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAA;IAC7D,MAAM,CAAC,WAAW;;;OAAqB;IACvC,MAAM,CAAC,GAAG,aAAM;IAChB,MAAM,CAAC,SAAS,SAAK;IAErB,MAAM,CAAC,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Calendar/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAY,SAAS,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAA;AAe5E,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAKlD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO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 -41,12 +41,12 @@ type CalendarOwnProps = {
|
|
|
41
41
|
* Callback fired when the next month button is clicked in the navigation
|
|
42
42
|
* header, requesting to render the next month.
|
|
43
43
|
*/
|
|
44
|
-
onRequestRenderNextMonth?: (e: React.MouseEvent) => void;
|
|
44
|
+
onRequestRenderNextMonth?: (e: React.MouseEvent, requestedMonth: string) => void;
|
|
45
45
|
/**
|
|
46
46
|
* Callback fired when the previous month button is clicked in the navigation
|
|
47
47
|
* header, requesting to render the previous month.
|
|
48
48
|
*/
|
|
49
|
-
onRequestRenderPrevMonth?: (e: React.MouseEvent) => void;
|
|
49
|
+
onRequestRenderPrevMonth?: (e: React.MouseEvent, requestedMonth: string) => void;
|
|
50
50
|
/**
|
|
51
51
|
* Content to render in the navigation header. The recommendation is to include
|
|
52
52
|
* the name of the current rendered month along with the year.
|
|
@@ -98,6 +98,10 @@ type CalendarOwnProps = {
|
|
|
98
98
|
* property or a context property.
|
|
99
99
|
*/
|
|
100
100
|
timezone?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Visible month for the rendered calendar. Formatted as an ISO date string.
|
|
103
|
+
*/
|
|
104
|
+
visibleMonth?: string;
|
|
101
105
|
};
|
|
102
106
|
type PropKeys = keyof CalendarOwnProps;
|
|
103
107
|
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
@@ -106,7 +110,7 @@ type CalendarStyle = ComponentStyle<'navigation' | 'navigationWithButtons' | 'we
|
|
|
106
110
|
declare const propTypes: PropValidators<PropKeys>;
|
|
107
111
|
declare const allowedProps: AllowedPropKeys;
|
|
108
112
|
type CalendarState = {
|
|
109
|
-
|
|
113
|
+
visibleMonth: Moment;
|
|
110
114
|
today: Moment;
|
|
111
115
|
};
|
|
112
116
|
export type { CalendarProps, CalendarStyle, CalendarState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Calendar/props.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,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