@progress/kendo-react-dateinputs 14.4.1 → 14.5.0-develop.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.
Files changed (35) hide show
  1. package/calendar/components/Calendar.d.ts +35 -110
  2. package/calendar/components/Calendar.js +5 -5
  3. package/calendar/components/Calendar.mjs +288 -313
  4. package/calendar/components/CalendarCell.d.ts +1 -10
  5. package/calendar/components/CalendarCell.js +1 -1
  6. package/calendar/components/CalendarCell.mjs +68 -78
  7. package/calendar/components/Header.d.ts +10 -23
  8. package/calendar/components/Header.js +1 -1
  9. package/calendar/components/Header.mjs +41 -55
  10. package/calendar/components/HorizontalViewList.d.ts +28 -26
  11. package/calendar/components/HorizontalViewList.js +1 -1
  12. package/calendar/components/HorizontalViewList.mjs +112 -102
  13. package/calendar/components/MultiViewCalendar.d.ts +39 -141
  14. package/calendar/components/MultiViewCalendar.js +1 -1
  15. package/calendar/components/MultiViewCalendar.mjs +331 -373
  16. package/calendar/components/Navigation.d.ts +19 -39
  17. package/calendar/components/Navigation.js +1 -1
  18. package/calendar/components/Navigation.mjs +95 -107
  19. package/calendar/components/TodayCommand.d.ts +8 -25
  20. package/calendar/components/TodayCommand.js +1 -1
  21. package/calendar/components/TodayCommand.mjs +44 -61
  22. package/calendar/components/View.d.ts +11 -42
  23. package/calendar/components/View.js +1 -1
  24. package/calendar/components/View.mjs +111 -137
  25. package/calendar/components/ViewList.d.ts +25 -65
  26. package/calendar/components/ViewList.js +1 -1
  27. package/calendar/components/ViewList.mjs +207 -225
  28. package/calendar/services/ScrollSyncService.d.ts +4 -4
  29. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  30. package/package-metadata.js +1 -1
  31. package/package-metadata.mjs +2 -2
  32. package/package.json +8 -8
  33. package/virtualization/Virtualization.d.ts +25 -63
  34. package/virtualization/Virtualization.js +1 -1
  35. package/virtualization/Virtualization.mjs +163 -168
@@ -5,15 +5,13 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { default as PropTypes } from 'prop-types';
9
8
  import { DateInputsClassStructure } from '@progress/kendo-react-common';
10
9
  import { CalendarViewEnum, ActiveView, CalendarSettings } from '../models/index.js';
11
- import { DOMService, ScrollSyncService } from '../services/index.js';
12
10
  import * as React from 'react';
13
11
  /**
14
12
  * The arguments for the `change` event of the Calendar. The generic argument sets the target type of the event. Defaults to `Calendar`.
15
13
  */
16
- export interface CalendarChangeEvent<T = Calendar> {
14
+ export interface CalendarChangeEvent<T = CalendarHandle> {
17
15
  /**
18
16
  * A native DOM event.
19
17
  */
@@ -68,109 +66,44 @@ export interface CalendarState {
68
66
  activeView: CalendarViewEnum;
69
67
  focusedDate: Date;
70
68
  }
71
- /** @hidden */
72
- export declare class CalendarWithoutContext extends React.Component<CalendarProps, CalendarState> {
73
- /**
74
- * @hidden
75
- */
76
- static displayName: string;
77
- /**
78
- * @hidden
79
- */
80
- static propTypes: {
81
- className: PropTypes.Requireable<string>;
82
- defaultActiveView: PropTypes.Requireable<ActiveView>;
83
- defaultValue: PropTypes.Requireable<Date>;
84
- disabled: PropTypes.Requireable<boolean>;
85
- focusedDate: PropTypes.Requireable<Date>;
86
- id: PropTypes.Requireable<string>;
87
- ariaLabelledBy: PropTypes.Requireable<string>;
88
- ariaDescribedBy: PropTypes.Requireable<string>;
89
- weekDaysFormat: PropTypes.Requireable<string>;
90
- max: PropTypes.Requireable<Date>;
91
- min: PropTypes.Requireable<Date>;
92
- navigation: PropTypes.Requireable<boolean>;
93
- smoothScroll: PropTypes.Requireable<boolean>;
94
- onBlur: PropTypes.Requireable<(...args: any[]) => any>;
95
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
96
- onFocus: PropTypes.Requireable<(...args: any[]) => any>;
97
- tabIndex: PropTypes.Requireable<number>;
98
- value: PropTypes.Requireable<Date>;
99
- weekNumber: PropTypes.Requireable<boolean>;
100
- topView: (props: CalendarProps, propName: keyof CalendarProps<any>, componentName: string) => Error | null;
101
- bottomView: (props: CalendarProps, propName: keyof CalendarProps<any>, componentName: string) => Error | null;
102
- };
103
- /**
104
- * @hidden
105
- */
106
- static defaultProps: {
107
- disabled: boolean;
108
- min: Date;
109
- max: Date;
110
- weekDaysFormat: string;
111
- navigation: boolean;
112
- defaultActiveView: ActiveView;
113
- defaultValue: null;
114
- topView: ActiveView;
115
- bottomView: ActiveView;
116
- showOtherMonthDays: boolean;
117
- };
118
- protected dom: DOMService;
119
- protected scrollSyncService: ScrollSyncService | null;
120
- private valueDuringOnChange?;
121
- private focusedDate;
122
- private get cellUID();
123
- private get id();
124
- private Navigation;
125
- private calendarViewList;
126
- private _element;
127
- private intl;
128
- private bus;
129
- private service;
130
- private navigation;
131
- private isActive;
132
- private oldValue;
133
- private didNavigationChange;
134
- /**
135
- * Gets the wrapping element of the Calendar.
136
- */
137
- get element(): HTMLDivElement | null;
138
- /**
139
- * Gets the value of the Calendar.
140
- */
141
- get value(): Date | null;
142
- protected get min(): Date;
143
- protected get max(): Date;
144
- protected get bottomView(): CalendarViewEnum;
145
- protected get topView(): CalendarViewEnum;
146
- constructor(props: CalendarProps);
69
+ /**
70
+ * Represent the `ref` of the Calendar component.
71
+ */
72
+ export interface CalendarHandle {
147
73
  /**
148
- * @hidden
74
+ * Returns the HTML element of the Calendar component.
149
75
  */
150
- componentDidMount(): void;
76
+ element: HTMLDivElement | null;
151
77
  /**
152
- * @hidden
78
+ * Returns the `value` of the Calendar component.
153
79
  */
154
- componentDidUpdate(prevProps: CalendarProps, prevState: CalendarState): void;
80
+ value: Date | null;
155
81
  /**
156
- * @hidden
82
+ * Returns the props of the Calendar component.
157
83
  */
158
- focus: () => void;
84
+ readonly props: CalendarProps;
159
85
  /**
160
86
  * @hidden
87
+ * Focuses the Calendar component.
161
88
  */
162
- render(): React.JSX.Element;
163
- private shouldScroll;
164
- private handleScroll;
165
- private handleNavigationChange;
166
- private handleViewChange;
167
- private handleDateChange;
168
- private handleFocus;
169
- private handleBlur;
170
- private handleKeyDown;
171
- private handleMouseDown;
172
- private handleClick;
89
+ focus(): void;
173
90
  }
91
+ /**
92
+ * @hidden
93
+ * The default props of the Calendar component.
94
+ */
95
+ export declare const calendarDefaultProps: {
96
+ disabled: boolean;
97
+ min: Date;
98
+ max: Date;
99
+ weekDaysFormat: "short";
100
+ navigation: boolean;
101
+ defaultActiveView: ActiveView;
102
+ defaultValue: Date | null;
103
+ topView: ActiveView;
104
+ bottomView: ActiveView;
105
+ showOtherMonthDays: boolean;
106
+ };
174
107
  /**
175
108
  * Represents the PropsContext of the `Calendar` component.
176
109
  * Used for global configuration of all `Calendar` instances.
@@ -179,24 +112,16 @@ export declare class CalendarWithoutContext extends React.Component<CalendarProp
179
112
  */
180
113
  export declare const CalendarPropsContext: React.Context<(p: CalendarProps<any>) => CalendarProps<any>>;
181
114
  /**
182
- * Represent the `ref` of the Calendar component.
115
+ * @hidden
116
+ * @deprecated Use CalendarHandle directly.
183
117
  */
184
- export interface CalendarHandle extends Pick<CalendarWithoutContext, keyof CalendarWithoutContext> {
185
- /**
186
- * Returns the HTML element of the Calendar component.
187
- */
188
- element: HTMLDivElement | null;
189
- /**
190
- * Returns the `value` of the Calendar component.
191
- */
192
- value: Date | null;
193
- }
194
- /** @hidden */
195
- export type Calendar = CalendarHandle;
118
+ export declare const CalendarWithoutContext: React.ForwardRefExoticComponent<CalendarProps<any> & React.RefAttributes<CalendarHandle | null>>;
196
119
  /**
197
120
  * Represents the KendoReact Calendar Component.
198
121
  *
199
122
  * Accepts properties of type [CalendarProps](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/calendarprops).
200
123
  * Obtaining the `ref` returns an object of type [CalendarHandle](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/calendarhandle).
201
124
  */
202
- export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps<any> & React.RefAttributes<any>>;
125
+ export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps<any> & React.RefAttributes<CalendarHandle | null>>;
126
+ /** @deprecated Use CalendarHandle directly. */
127
+ export type Calendar = CalendarHandle;
@@ -5,8 +5,8 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),a=require("prop-types"),h=require("@progress/kendo-react-common"),o=require("@progress/kendo-date-math"),S=require("@progress/kendo-react-intl"),M=require("./ViewList.js"),A=require("./Navigation.js"),d=require("../models/CalendarViewEnum.js"),r=require("../../utils.js"),q=require("../services/BusViewService.js"),L=require("../services/DOMService.js"),T=require("../services/NavigationService.js"),B=require("../services/ScrollSyncService.js");function R(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return i.default=c,Object.freeze(i)}const g=R(P),b=c=>c?c.virtualization:null,y=(c=v.defaultProps.min,i=v.defaultProps.max,t,e)=>e!==void 0?e!==null&&r.isInRange(o.getDate(e),c,i)?e:null:t!==null&&r.isInRange(o.getDate(t),c,i)?t:null,l=class l extends g.Component{constructor(i){super(i),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(b(this.Navigation),b(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const s=o.cloneDate(e.value);this.setState({focusedDate:s})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const s=o.cloneDate(e.value),n=o.cloneDate(e.value),f=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(f)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:n});return}this.setState({value:s,focusedDate:n}),this.valueDuringOnChange=s;const{onChange:p}=this.props;if(p){const u={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};p.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:n,ctrlKey:f,metaKey:p}=e;if(!(!this.focusedDate||!this.service)){if(n===84&&this.setState({focusedDate:r.getToday()}),(f||p)&&(n===h.Keys.left||n===h.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const u=n===h.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,m=new Date(this.focusedDate.setMonth(u)),V=o.cloneDate(m);this.setState({focusedDate:V})}if(n===h.Keys.enter){if(this.value!==null&&o.isEqualDate(this.focusedDate,this.value)){const m=r.dateInRange(this.focusedDate,this.min,this.max);b(this.calendarViewList).scrollToIndex(this.service.skip(m,this.min))}const u={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(u)}else{const u=r.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(o.isEqualDate(this.focusedDate,u))return;this.setState({focusedDate:u})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})};const t=y(this.min,this.max,this.props.defaultValue||l.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:r.viewInRange(d.CalendarViewEnum[i.defaultActiveView],this.bottomView,this.topView),focusedDate:r.dateInRange(i.focusedDate||t||r.getToday(),this.min,this.max)},this.dom=new L.DOMService,this.bus=new q.BusViewService(this.handleViewChange),this.navigation=new T.NavigationService(this.bus),this.oldValue=t}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get min(){return o.getDate(this.props.min!==void 0?this.props.min:l.defaultProps.min)}get max(){return o.getDate(this.props.max!==void 0?this.props.max:l.defaultProps.max)}get bottomView(){return d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:l.defaultProps.bottomView]}get topView(){return d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:l.defaultProps.topView]}componentDidMount(){const{unstyled:i}=this.props;Promise.resolve().then(()=>{h.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element,i),this.scrollSyncService=new B.ScrollSyncService(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(i,t){h.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){const{_ref:i,unstyled:t,bottomView:e,topView:s,disabled:n,weekNumber:f,mobileMode:p,className:u}=this.props;i&&i(this);const m=t&&t.uCalendar,V=this.value!==null&&this.oldValue!==null?!o.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,I=r.viewInRange(this.state.activeView,d.CalendarViewEnum[e!==void 0?e:l.defaultProps.bottomView],d.CalendarViewEnum[s!==void 0?s:l.defaultProps.topView]),D=y(this.min,this.max,this.value,this.value),O=D?o.getDate(D):null;this.focusedDate=o.getDate(r.dateInRange(V&&D!==null?D:this.state.focusedDate,this.min,this.max)),this.intl=S.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(I,this.intl);const{smoothScroll:x=Number.parseFloat(g.version)<18}=this.props,N=h.classNames(h.uCalendar.wrapper({c:m,disabled:n,weekNumber:f,mobileMode:p}),u),k=[this.props.navigation&&g.createElement(A.Navigation,{key:0,ref:w=>{this.Navigation=w},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex,unstyled:t}),g.createElement(M.ViewList,{key:1,ref:w=>{this.calendarViewList=w},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:x,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:O,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:t})];return g.createElement("div",{ref:w=>{this._element=w},className:N,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},k)}};l.displayName="Calendar",l.propTypes={className:a.string,defaultActiveView:a.oneOf(["month","year","decade","century"]),defaultValue:a.instanceOf(Date),disabled:a.bool,focusedDate:a.instanceOf(Date),id:a.string,ariaLabelledBy:a.string,ariaDescribedBy:a.string,weekDaysFormat:a.oneOf(["short","abbreviated","narrow"]),max:a.instanceOf(Date),min:a.instanceOf(Date),navigation:a.bool,smoothScroll:a.bool,onBlur:a.func,onChange:a.func,onFocus:a.func,tabIndex:a.number,value:a.instanceOf(Date),weekNumber:a.bool,topView:(i,t,e)=>{const s=i[t],n=i.bottomView;return s&&n&&d.CalendarViewEnum[s]<d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
9
- ${t} can not be smaller than bottomView.
10
- `):null},bottomView:(i,t,e)=>{const s=i[t],n=i.topView;return s&&n&&d.CalendarViewEnum[s]>d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
11
- ${t} can not be bigger than topView.
12
- `):null}},l.defaultProps={disabled:!1,min:r.MIN_DATE,max:r.MAX_DATE,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let v=l;const C=h.createPropsContext(),E=h.withIdHOC(h.withPropsContext(C,h.withUnstyledHOC(v)));E.displayName="KendoReactCalendar";S.registerForIntl(v);exports.Calendar=E;exports.CalendarPropsContext=C;exports.CalendarWithoutContext=v;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("react"),r=require("prop-types"),l=require("@progress/kendo-react-common"),c=require("@progress/kendo-date-math"),Le=require("@progress/kendo-react-intl"),We=require("./ViewList.js"),Ue=require("./Navigation.js"),E=require("../models/CalendarViewEnum.js"),d=require("../../utils.js"),Ye=require("../services/BusViewService.js"),He=require("../services/DOMService.js"),Xe=require("../services/NavigationService.js"),Ge=require("../services/ScrollSyncService.js");function Je(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(a,o,i.get?i:{enumerable:!0,get:()=>n[o]})}}return a.default=n,Object.freeze(a)}const t=Je(ze),L=n=>n?n.virtualization:null,te=(n,a,o=u.min,i=u.max)=>a!==void 0?a!==null&&d.isInRange(c.getDate(a),o,i)?a:null:n!==null&&d.isInRange(c.getDate(n),o,i)?n:null,u={disabled:!1,min:d.MIN_DATE,max:d.MAX_DATE,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1},ne=l.createPropsContext(),A=t.forwardRef((n,a)=>{const o=l.usePropsContext(ne,n),i=l.useUnstyled(),D=l.useId(o.id),re=Le.useInternationalization(),{disabled:S=u.disabled,min:ae=u.min,max:oe=u.max,weekDaysFormat:ce=u.weekDaysFormat,navigation:ie=u.navigation,defaultActiveView:ue=u.defaultActiveView,defaultValue:se=u.defaultValue,topView:le=u.topView,bottomView:de=u.bottomView,showOtherMonthDays:fe=u.showOtherMonthDays,_ref:W,unstyled:ve,className:we,weekNumber:U,mobileMode:me,focusedDate:ge,value:T,onChange:Y,onFocus:H,onBlur:X,cell:De,weekCell:he,headerTitle:be,header:Ve,tabIndex:B,navigationItem:ye,ariaLabelledBy:pe,ariaDescribedBy:Ce}=o,I=ve||i,m=c.getDate(ae),h=c.getDate(oe),K=E.CalendarViewEnum[de],F=E.CalendarViewEnum[le],Re=D+"-cell-uid",Ee=o.id||D+"-id",Se=({view:e})=>{V.current&&V.current.configure(e),R({activeView:e})},Ie=()=>x.current,G=e=>{V.current&&V.current.sync(L(Q.current),L(f.current),e)},Oe=e=>{if(S)return;x.current=!0;const y=c.cloneDate(e.value);R({focusedDate:y})},J=e=>{const y=c.cloneDate(e.value),p=c.cloneDate(e.value),$=C.current.canMoveDown(v.activeView);if(!S){if($)if(e.isTodayClick)C.current.moveToBottom(v.activeView);else{C.current.moveDown(v.activeView,e.syntheticEvent),R({focusedDate:p});return}if(R({value:y,focusedDate:p}),k.current=y,Y){const j={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:y,target:_.current};Y(j)}k.current=void 0}},Pe=e=>{M.current=!0,f.current&&(f.current.focusActiveDate(),H&&H(e))},ke=e=>{M.current=!1,f.current&&(f.current.blurActiveDate(),X&&X(e))},Me=e=>{const{keyCode:p,ctrlKey:$,metaKey:j}=e;if(!(!g||!O)){if(p===84&&R({focusedDate:d.getToday()}),($||j)&&(p===l.Keys.left||p===l.Keys.right)){if(S)return;x.current=!0;const w=c.cloneDate(g);w.getDate()===31&&w.setDate(30);const z=p===l.Keys.left?w.getMonth()-1:w.getMonth()+1,je=new Date(w.setMonth(z));R({focusedDate:c.cloneDate(je)})}if(p===l.Keys.enter){if(s!==null&&c.isEqualDate(g,s)){const z=d.dateInRange(g,m,h);L(f.current).scrollToIndex(O.skip(z,m))}const w={syntheticEvent:e,nativeEvent:e.nativeEvent,value:g,target:f.current};J(w)}else{const w=d.dateInRange(Z.current.move(g,Z.current.action(e),v.activeView,O,e),m,h);if(c.isEqualDate(g,w))return;R({focusedDate:w})}e.preventDefault()}},qe=e=>{e.preventDefault()},xe=e=>{b.current&&b.current.focus({preventScroll:!0})},_=t.useRef(null);t.useImperativeHandle(_,()=>({get element(){return b.current},get value(){return s},get props(){return o},focus:()=>{var e;return(e=b.current)==null?void 0:e.focus()}})),t.useImperativeHandle(a,()=>_.current);const b=t.useRef(null),Q=t.useRef(null),f=t.useRef(null),P=t.useRef(new He.DOMService),C=t.useRef(new Ye.BusViewService(Se)),Z=t.useRef(new Xe.NavigationService(C.current)),V=t.useRef(null),k=t.useRef(void 0),M=t.useRef(!1),q=t.useRef(null),x=t.useRef(!1),[v,Ne]=t.useState(()=>{const e=te(se,T,m,h);return{value:e,activeView:d.viewInRange(E.CalendarViewEnum[ue],K,F),focusedDate:d.dateInRange(ge||e||d.getToday(),m,h)}}),R=e=>{Ne(y=>({...y,...e}))},[,Ae]=t.useReducer(e=>e+1,0);t.useEffect(()=>{Promise.resolve().then(()=>{l.setScrollbarWidth(),b.current&&(P.current.calculateHeights(b.current,I),V.current=new Ge.ScrollSyncService(P.current),V.current.configure(v.activeView),Ae())})},[]),t.useEffect(()=>{l.setScrollbarWidth(),V.current&&V.current.configure(ee),f.current&&(M.current?f.current.focusActiveDate:f.current.blurActiveDate)(),x.current=!1,M.current&&(q.current=s)});let s;k.current!==void 0?s=k.current:T!==void 0?s=T:s=v.value;const Te=I&&I.uCalendar,Be=s!==null&&q.current!==null?!c.isEqualDate(s,q.current):s!==q.current,ee=d.viewInRange(v.activeView,K,F),N=te(s,s,m,h),Ke=N?c.getDate(N):null,g=c.getDate(d.dateInRange(Be&&N!==null?N:v.focusedDate,m,h));C.current.configure(K,F);const O=C.current.service(ee,re),{smoothScroll:Fe=Number.parseFloat(t.version)<18}=o,_e=l.classNames(l.uCalendar.wrapper({c:Te,disabled:S,weekNumber:U,mobileMode:me}),we);t.useEffect(()=>{W&&W({element:b.current})});const $e=[ie&&t.createElement(Ue.Navigation,{key:0,ref:Q,activeView:v.activeView,focusedDate:g,min:m,max:h,onScroll:G,onChange:Oe,service:O,dom:P.current,navigationItem:ye,tabIndex:B,unstyled:I}),t.createElement(We.ViewList,{key:1,ref:f,activeView:v.activeView,focusedDate:g,min:m,max:h,bus:C.current,shouldScroll:Ie,onScroll:G,service:O,cell:De,weekCell:he,dom:P.current,smoothScroll:Fe,showWeekNumbers:U,onChange:J,value:Ke,cellUID:Re,headerTitle:be,header:Ve,tabIndex:B,weekDaysFormat:ce,showOtherMonthDays:fe,unstyled:I})];return t.createElement("div",{ref:b,className:_e,id:Ee,"aria-labelledby":pe,"aria-describedby":Ce,"aria-disabled":S,tabIndex:S?void 0:B||0,onFocus:Pe,onBlur:ke,onKeyDown:Me,onMouseDown:qe,onClick:xe},$e)});A.propTypes={className:r.string,defaultActiveView:r.oneOf(["month","year","decade","century"]),defaultValue:r.instanceOf(Date),disabled:r.bool,focusedDate:r.instanceOf(Date),id:r.string,ariaLabelledBy:r.string,ariaDescribedBy:r.string,weekDaysFormat:r.oneOf(["short","abbreviated","narrow"]),max:r.instanceOf(Date),min:r.instanceOf(Date),navigation:r.bool,smoothScroll:r.bool,onBlur:r.func,onChange:r.func,onFocus:r.func,tabIndex:r.number,value:r.instanceOf(Date),weekNumber:r.bool,topView:(n,a,o)=>{const i=n[a],D=n.bottomView;return i&&D&&E.CalendarViewEnum[i]<E.CalendarViewEnum[D]?new Error(`Invalid prop + ${a} suplied to ${o}.
9
+ ${a} can not be smaller than bottomView.
10
+ `):null},bottomView:(n,a,o)=>{const i=n[a],D=n.topView;return i&&D&&E.CalendarViewEnum[i]>E.CalendarViewEnum[D]?new Error(`Invalid prop + ${a} suplied to ${o}.
11
+ ${a} can not be bigger than topView.
12
+ `):null}};A.displayName="KendoReactCalendar";const Qe=A,Ze=A;exports.Calendar=Ze;exports.CalendarPropsContext=ne;exports.CalendarWithoutContext=Qe;exports.calendarDefaultProps=u;