@progress/kendo-react-dateinputs 7.5.0-develop.8 → 8.0.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 (41) hide show
  1. package/calendar/components/Calendar.js +2 -2
  2. package/calendar/components/Calendar.mjs +46 -40
  3. package/calendar/components/CalendarCell.js +1 -1
  4. package/calendar/components/CalendarCell.mjs +53 -49
  5. package/calendar/components/CalendarWeekCell.js +1 -1
  6. package/calendar/components/CalendarWeekCell.mjs +12 -10
  7. package/calendar/components/Header.js +1 -1
  8. package/calendar/components/Header.mjs +20 -19
  9. package/calendar/components/HorizontalViewList.js +1 -1
  10. package/calendar/components/HorizontalViewList.mjs +37 -29
  11. package/calendar/components/MultiViewCalendar.js +1 -1
  12. package/calendar/components/MultiViewCalendar.mjs +153 -123
  13. package/calendar/components/TodayCommand.js +1 -1
  14. package/calendar/components/TodayCommand.mjs +1 -1
  15. package/calendar/components/View.js +1 -1
  16. package/calendar/components/View.mjs +56 -48
  17. package/calendar/components/ViewList.js +1 -1
  18. package/calendar/components/ViewList.mjs +47 -45
  19. package/calendar/services/MonthViewService.js +1 -1
  20. package/calendar/services/MonthViewService.mjs +14 -16
  21. package/calendar/services/WeekNamesService.js +1 -1
  22. package/calendar/services/WeekNamesService.mjs +5 -5
  23. package/common/ClearButton.js +8 -0
  24. package/common/ClearButton.mjs +41 -0
  25. package/dateinput/DateInput.js +1 -1
  26. package/dateinput/DateInput.mjs +32 -29
  27. package/datepicker/DatePicker.js +1 -1
  28. package/datepicker/DatePicker.mjs +3 -0
  29. package/daterangepicker/DateRangePicker.js +1 -1
  30. package/daterangepicker/DateRangePicker.mjs +6 -4
  31. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  32. package/index.d.mts +80 -7
  33. package/index.d.ts +80 -7
  34. package/messages/index.js +1 -1
  35. package/messages/index.mjs +38 -36
  36. package/package-metadata.mjs +1 -1
  37. package/package.json +8 -8
  38. package/virtualization/Virtualization.js +1 -1
  39. package/virtualization/Virtualization.mjs +5 -6
  40. package/virtualization/services/RowHeightService.js +0 -8
  41. package/virtualization/services/RowHeightService.mjs +0 -50
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),a=require("prop-types"),u=require("@progress/kendo-react-common"),l=require("@progress/kendo-date-math"),V=require("@progress/kendo-react-intl"),E=require("../../package-metadata.js"),k=require("./ViewList.js"),I=require("./Navigation.js"),d=require("../models/CalendarViewEnum.js"),r=require("../../utils.js"),x=require("../services/BusViewService.js"),N=require("../services/DOMService.js"),P=require("../services/NavigationService.js"),O=require("../services/ScrollSyncService.js");function M(c){const s=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(s,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return s.default=c,Object.freeze(s)}const m=M(C),g=c=>c?c.virtualization:null,D=(c=v.defaultProps.min,s=v.defaultProps.max,t,e)=>e!==void 0?e!==null&&r.isInRange(l.getDate(e),c,s)?e:null:t!==null&&r.isInRange(l.getDate(t),c,s)?t:null,h=class h extends m.Component{constructor(s){super(s),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(g(this.Navigation),g(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const i=l.cloneDate(e.value);this.setState({focusedDate:i})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const i=l.cloneDate(e.value),n=l.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:i,focusedDate:n}),this.valueDuringOnChange=i;const{onChange:p}=this.props;if(p){const o={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,target:this};p.call(void 0,o)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:i}=this.props;i&&i.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:i}=this.props;i&&i.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===u.Keys.left||n===u.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const o=n===u.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,w=new Date(this.focusedDate.setMonth(o)),y=l.cloneDate(w);this.setState({focusedDate:y})}if(n===u.Keys.enter){if(this.value!==null&&l.isEqualDate(this.focusedDate,this.value)){const w=r.dateInRange(this.focusedDate,this.min,this.max);g(this.calendarViewList).scrollToIndex(this.service.skip(w,this.min))}const o={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(o)}else{const o=r.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(l.isEqualDate(this.focusedDate,o))return;this.setState({focusedDate:o})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},u.validatePackage(E.packageMetadata);const t=D(this.min,this.max,this.props.defaultValue||h.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:r.viewInRange(d.CalendarViewEnum[s.defaultActiveView],this.bottomView,this.topView),focusedDate:r.dateInRange(s.focusedDate||t||r.getToday(),this.min,this.max)},this.dom=new N.DOMService,this.bus=new x.BusViewService(this.handleViewChange),this.navigation=new P.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 l.getDate(this.props.min!==void 0?this.props.min:h.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:h.defaultProps.max)}get bottomView(){return d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:h.defaultProps.bottomView]}get topView(){return d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:h.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{u.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new O.ScrollSyncService(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,t){u.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(){this.props._ref&&this.props._ref(this);const s=this.value!==null&&this.oldValue!==null?!l.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,t=r.viewInRange(this.state.activeView,d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:h.defaultProps.bottomView],d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:h.defaultProps.topView]),e=D(this.min,this.max,this.value,this.value),i=e?l.getDate(e):null;this.focusedDate=l.getDate(r.dateInRange(s&&e!==null?e:this.state.focusedDate,this.min,this.max)),this.intl=V.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(t,this.intl);const{smoothScroll:n=Number.parseFloat(m.version)<18}=this.props,f=u.classNames("k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber},this.props.mobileMode?"k-calendar-lg":"k-calendar-md",this.props.className),p=[this.props.navigation&&m.createElement(I.Navigation,{key:0,ref:o=>{this.Navigation=o},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}),m.createElement(k.ViewList,{key:1,ref:o=>{this.calendarViewList=o},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:n,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:i,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return m.createElement("div",{ref:o=>{this._element=o},className:f,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},p)}};h.displayName="Calendar",h.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,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:(s,t,e)=>{const i=s[t],n=s.bottomView;return i&&n&&d.CalendarViewEnum[i]<d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),a=require("prop-types"),u=require("@progress/kendo-react-common"),r=require("@progress/kendo-date-math"),V=require("@progress/kendo-react-intl"),k=require("../../package-metadata.js"),E=require("./ViewList.js"),I=require("./Navigation.js"),d=require("../models/CalendarViewEnum.js"),l=require("../../utils.js"),x=require("../services/BusViewService.js"),N=require("../services/DOMService.js"),O=require("../services/NavigationService.js"),M=require("../services/ScrollSyncService.js");function P(c){const s=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(s,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return s.default=c,Object.freeze(s)}const m=P(C),g=c=>c?c.virtualization:null,D=(c=p.defaultProps.min,s=p.defaultProps.max,t,e)=>e!==void 0?e!==null&&l.isInRange(r.getDate(e),c,s)?e:null:t!==null&&l.isInRange(r.getDate(t),c,s)?t:null,h=class h extends m.Component{constructor(s){super(s),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(g(this.Navigation),g(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const i=r.cloneDate(e.value);this.setState({focusedDate:i})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const i=r.cloneDate(e.value),n=r.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:i,focusedDate:n}),this.valueDuringOnChange=i;const{onChange:v}=this.props;if(v){const o={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,target:this};v.call(void 0,o)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:i}=this.props;i&&i.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:i}=this.props;i&&i.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:n,ctrlKey:f,metaKey:v}=e;if(!(!this.focusedDate||!this.service)){if(n===84&&this.setState({focusedDate:l.getToday()}),(f||v)&&(n===u.Keys.left||n===u.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const o=n===u.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,w=new Date(this.focusedDate.setMonth(o)),S=r.cloneDate(w);this.setState({focusedDate:S})}if(n===u.Keys.enter){if(this.value!==null&&r.isEqualDate(this.focusedDate,this.value)){const w=l.dateInRange(this.focusedDate,this.min,this.max);g(this.calendarViewList).scrollToIndex(this.service.skip(w,this.min))}const o={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(o)}else{const o=l.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(r.isEqualDate(this.focusedDate,o))return;this.setState({focusedDate:o})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},u.validatePackage(k.packageMetadata);const t=D(this.min,this.max,this.props.defaultValue||h.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:l.viewInRange(d.CalendarViewEnum[s.defaultActiveView],this.bottomView,this.topView),focusedDate:l.dateInRange(s.focusedDate||t||l.getToday(),this.min,this.max)},this.dom=new N.DOMService,this.bus=new x.BusViewService(this.handleViewChange),this.navigation=new O.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 r.getDate(this.props.min!==void 0?this.props.min:h.defaultProps.min)}get max(){return r.getDate(this.props.max!==void 0?this.props.max:h.defaultProps.max)}get bottomView(){return d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:h.defaultProps.bottomView]}get topView(){return d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:h.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{u.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new M.ScrollSyncService(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,t){u.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(){this.props._ref&&this.props._ref(this);const s=this.value!==null&&this.oldValue!==null?!r.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,t=l.viewInRange(this.state.activeView,d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:h.defaultProps.bottomView],d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:h.defaultProps.topView]),e=D(this.min,this.max,this.value,this.value),i=e?r.getDate(e):null;this.focusedDate=r.getDate(l.dateInRange(s&&e!==null?e:this.state.focusedDate,this.min,this.max)),this.intl=V.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(t,this.intl);const{smoothScroll:n=Number.parseFloat(m.version)<18}=this.props,f=u.classNames("k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber},this.props.mobileMode?"k-calendar-lg":"k-calendar-md",this.props.className),v=[this.props.navigation&&m.createElement(I.Navigation,{key:0,ref:o=>{this.Navigation=o},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}),m.createElement(E.ViewList,{key:1,ref:o=>{this.calendarViewList=o},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:n,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:i,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays})];return m.createElement("div",{ref:o=>{this._element=o},className:f,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},v)}};h.displayName="Calendar",h.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:(s,t,e)=>{const i=s[t],n=s.bottomView;return i&&n&&d.CalendarViewEnum[i]<d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
9
9
  ${t} can not be smaller than bottomView.
10
10
  `):null},bottomView:(s,t,e)=>{const i=s[t],n=s.topView;return i&&n&&d.CalendarViewEnum[i]>d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
11
11
  ${t} can not be bigger than topView.
12
- `):null}},h.defaultProps={disabled:!1,min:r.MIN_DATE,max:r.MAX_DATE,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};let v=h;const b=u.createPropsContext(),S=u.withIdHOC(u.withPropsContext(b,v));S.displayName="KendoReactCalendar";V.registerForIntl(v);exports.Calendar=S;exports.CalendarPropsContext=b;exports.CalendarWithoutContext=v;
12
+ `):null}},h.defaultProps={disabled:!1,min:l.MIN_DATE,max:l.MAX_DATE,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let p=h;const b=u.createPropsContext(),y=u.withIdHOC(u.withPropsContext(b,p));y.displayName="KendoReactCalendar";V.registerForIntl(p);exports.Calendar=y;exports.CalendarPropsContext=b;exports.CalendarWithoutContext=p;
@@ -8,19 +8,19 @@
8
8
  "use client";
9
9
  import * as v from "react";
10
10
  import s from "prop-types";
11
- import { Keys as m, validatePackage as I, setScrollbarWidth as b, classNames as N, createPropsContext as E, withIdHOC as P, withPropsContext as A } from "@progress/kendo-react-common";
11
+ import { Keys as m, validatePackage as I, setScrollbarWidth as b, classNames as N, createPropsContext as E, withIdHOC as O, withPropsContext as P } from "@progress/kendo-react-common";
12
12
  import { cloneDate as f, isEqualDate as D, getDate as c } from "@progress/kendo-date-math";
13
- import { provideIntlService as L, registerForIntl as M } from "@progress/kendo-react-intl";
14
- import { packageMetadata as O } from "../../package-metadata.mjs";
13
+ import { provideIntlService as A, registerForIntl as M } from "@progress/kendo-react-intl";
14
+ import { packageMetadata as L } from "../../package-metadata.mjs";
15
15
  import { ViewList as B } from "./ViewList.mjs";
16
16
  import { Navigation as T } from "./Navigation.mjs";
17
- import { CalendarViewEnum as r } from "../models/CalendarViewEnum.mjs";
18
- import { getToday as S, dateInRange as w, viewInRange as y, MIN_DATE as K, MAX_DATE as F, isInRange as C } from "../../utils.mjs";
17
+ import { CalendarViewEnum as h } from "../models/CalendarViewEnum.mjs";
18
+ import { getToday as y, dateInRange as w, viewInRange as S, MIN_DATE as F, MAX_DATE as K, isInRange as C } from "../../utils.mjs";
19
19
  import { BusViewService as _ } from "../services/BusViewService.mjs";
20
20
  import { DOMService as $ } from "../services/DOMService.mjs";
21
21
  import { NavigationService as R } from "../services/NavigationService.mjs";
22
22
  import { ScrollSyncService as U } from "../services/ScrollSyncService.mjs";
23
- const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d.defaultProps.max, i, t) => t !== void 0 ? t !== null && C(c(t), u, o) ? t : null : i !== null && C(c(i), u, o) ? i : null, l = class l extends v.Component {
23
+ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d.defaultProps.max, i, t) => t !== void 0 ? t !== null && C(c(t), u, o) ? t : null : i !== null && C(c(i), u, o) ? i : null, r = class r extends v.Component {
24
24
  constructor(o) {
25
25
  super(o), 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 = () => {
26
26
  this._element && this._element.focus();
@@ -50,15 +50,15 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
50
50
  return;
51
51
  }
52
52
  this.setState({ value: e, focusedDate: a }), this.valueDuringOnChange = e;
53
- const { onChange: h } = this.props;
54
- if (h) {
53
+ const { onChange: l } = this.props;
54
+ if (l) {
55
55
  const n = {
56
56
  syntheticEvent: t.syntheticEvent,
57
57
  nativeEvent: t.nativeEvent,
58
58
  value: e,
59
59
  target: this
60
60
  };
61
- h.call(void 0, n);
61
+ l.call(void 0, n);
62
62
  }
63
63
  this.valueDuringOnChange = void 0;
64
64
  }, this.handleFocus = (t) => {
@@ -74,14 +74,14 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
74
74
  const { onBlur: e } = this.props;
75
75
  e && e.call(void 0, t);
76
76
  }, this.handleKeyDown = (t) => {
77
- const { keyCode: a, ctrlKey: p, metaKey: h } = t;
77
+ const { keyCode: a, ctrlKey: p, metaKey: l } = t;
78
78
  if (!(!this.focusedDate || !this.service)) {
79
- if (a === 84 && this.setState({ focusedDate: S() }), (p || h) && (a === m.left || a === m.right)) {
79
+ if (a === 84 && this.setState({ focusedDate: y() }), (p || l) && (a === m.left || a === m.right)) {
80
80
  if (this.props.disabled)
81
81
  return;
82
82
  this.didNavigationChange = !0, this.focusedDate.getDate() === 31 && this.focusedDate.setDate(30);
83
- const n = a === m.left ? this.focusedDate.getMonth() - 1 : this.focusedDate.getMonth() + 1, g = new Date(this.focusedDate.setMonth(n)), k = f(g);
84
- this.setState({ focusedDate: k });
83
+ const n = a === m.left ? this.focusedDate.getMonth() - 1 : this.focusedDate.getMonth() + 1, g = new Date(this.focusedDate.setMonth(n)), x = f(g);
84
+ this.setState({ focusedDate: x });
85
85
  }
86
86
  if (a === m.enter) {
87
87
  if (this.value !== null && D(this.focusedDate, this.value)) {
@@ -117,22 +117,22 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
117
117
  t.preventDefault();
118
118
  }, this.handleClick = (t) => {
119
119
  this._element && this._element.focus({ preventScroll: !0 });
120
- }, I(O);
121
- const i = x(
120
+ }, I(L);
121
+ const i = k(
122
122
  this.min,
123
123
  this.max,
124
- this.props.defaultValue || l.defaultProps.defaultValue,
124
+ this.props.defaultValue || r.defaultProps.defaultValue,
125
125
  this.props.value
126
126
  );
127
127
  this.state = {
128
128
  value: i,
129
- activeView: y(
130
- r[o.defaultActiveView],
129
+ activeView: S(
130
+ h[o.defaultActiveView],
131
131
  this.bottomView,
132
132
  this.topView
133
133
  ),
134
134
  focusedDate: w(
135
- o.focusedDate || i || S(),
135
+ o.focusedDate || i || y(),
136
136
  this.min,
137
137
  this.max
138
138
  )
@@ -157,16 +157,16 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
157
157
  return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
158
158
  }
159
159
  get min() {
160
- return c(this.props.min !== void 0 ? this.props.min : l.defaultProps.min);
160
+ return c(this.props.min !== void 0 ? this.props.min : r.defaultProps.min);
161
161
  }
162
162
  get max() {
163
- return c(this.props.max !== void 0 ? this.props.max : l.defaultProps.max);
163
+ return c(this.props.max !== void 0 ? this.props.max : r.defaultProps.max);
164
164
  }
165
165
  get bottomView() {
166
- return r[this.props.bottomView !== void 0 ? this.props.bottomView : l.defaultProps.bottomView];
166
+ return h[this.props.bottomView !== void 0 ? this.props.bottomView : r.defaultProps.bottomView];
167
167
  }
168
168
  get topView() {
169
- return r[this.props.topView !== void 0 ? this.props.topView : l.defaultProps.topView];
169
+ return h[this.props.topView !== void 0 ? this.props.topView : r.defaultProps.topView];
170
170
  }
171
171
  /**
172
172
  * @hidden
@@ -187,16 +187,16 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
187
187
  */
188
188
  render() {
189
189
  this.props._ref && this.props._ref(this);
190
- const o = this.value !== null && this.oldValue !== null ? !D(this.value, this.oldValue) : this.value !== this.oldValue, i = y(
190
+ const o = this.value !== null && this.oldValue !== null ? !D(this.value, this.oldValue) : this.value !== this.oldValue, i = S(
191
191
  this.state.activeView,
192
- r[this.props.bottomView !== void 0 ? this.props.bottomView : l.defaultProps.bottomView],
193
- r[this.props.topView !== void 0 ? this.props.topView : l.defaultProps.topView]
194
- ), t = x(this.min, this.max, this.value, this.value), e = t ? c(t) : null;
192
+ h[this.props.bottomView !== void 0 ? this.props.bottomView : r.defaultProps.bottomView],
193
+ h[this.props.topView !== void 0 ? this.props.topView : r.defaultProps.topView]
194
+ ), t = k(this.min, this.max, this.value, this.value), e = t ? c(t) : null;
195
195
  this.focusedDate = c(w(
196
196
  o && t !== null ? t : this.state.focusedDate,
197
197
  this.min,
198
198
  this.max
199
- )), this.intl = L(this), this.bus.configure(this.bottomView, this.topView), this.service = this.bus.service(i, this.intl);
199
+ )), this.intl = A(this), this.bus.configure(this.bottomView, this.topView), this.service = this.bus.service(i, this.intl);
200
200
  const { smoothScroll: a = Number.parseFloat(v.version) < 18 } = this.props, p = N(
201
201
  "k-calendar k-calendar-infinite",
202
202
  {
@@ -205,7 +205,7 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
205
205
  },
206
206
  this.props.mobileMode ? "k-calendar-lg" : "k-calendar-md",
207
207
  this.props.className
208
- ), h = [this.props.navigation && /* @__PURE__ */ v.createElement(
208
+ ), l = [this.props.navigation && /* @__PURE__ */ v.createElement(
209
209
  T,
210
210
  {
211
211
  key: 0,
@@ -247,7 +247,10 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
247
247
  value: e,
248
248
  cellUID: this.cellUID,
249
249
  headerTitle: this.props.headerTitle,
250
- tabIndex: this.props.tabIndex
250
+ header: this.props.header,
251
+ tabIndex: this.props.tabIndex,
252
+ weekDaysFormat: this.props.weekDaysFormat,
253
+ showOtherMonthDays: this.props.showOtherMonthDays
251
254
  }
252
255
  )];
253
256
  return /* @__PURE__ */ v.createElement(
@@ -268,11 +271,11 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
268
271
  onMouseDown: this.handleMouseDown,
269
272
  onClick: this.handleClick
270
273
  },
271
- h
274
+ l
272
275
  );
273
276
  }
274
277
  };
275
- l.displayName = "Calendar", l.propTypes = {
278
+ r.displayName = "Calendar", r.propTypes = {
276
279
  className: s.string,
277
280
  defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
278
281
  defaultValue: s.instanceOf(Date),
@@ -281,6 +284,7 @@ l.displayName = "Calendar", l.propTypes = {
281
284
  id: s.string,
282
285
  ariaLabelledBy: s.string,
283
286
  ariaDescribedBy: s.string,
287
+ weekDaysFormat: s.oneOf(["short", "abbreviated", "narrow"]),
284
288
  max: s.instanceOf(Date),
285
289
  min: s.instanceOf(Date),
286
290
  navigation: s.bool,
@@ -293,7 +297,7 @@ l.displayName = "Calendar", l.propTypes = {
293
297
  weekNumber: s.bool,
294
298
  topView: (o, i, t) => {
295
299
  const e = o[i], a = o.bottomView;
296
- return e && a && r[e] < r[a] ? new Error(
300
+ return e && a && h[e] < h[a] ? new Error(
297
301
  `Invalid prop + ${i} suplied to ${t}.
298
302
  ${i} can not be smaller than bottomView.
299
303
  `
@@ -301,24 +305,26 @@ l.displayName = "Calendar", l.propTypes = {
301
305
  },
302
306
  bottomView: (o, i, t) => {
303
307
  const e = o[i], a = o.topView;
304
- return e && a && r[e] > r[a] ? new Error(
308
+ return e && a && h[e] > h[a] ? new Error(
305
309
  `Invalid prop + ${i} suplied to ${t}.
306
310
  ${i} can not be bigger than topView.
307
311
  `
308
312
  ) : null;
309
313
  }
310
- }, l.defaultProps = {
314
+ }, r.defaultProps = {
311
315
  disabled: !1,
312
- min: K,
313
- max: F,
316
+ min: F,
317
+ max: K,
318
+ weekDaysFormat: "short",
314
319
  navigation: !0,
315
320
  defaultActiveView: "month",
316
321
  defaultValue: null,
317
322
  topView: "century",
318
- bottomView: "month"
323
+ bottomView: "month",
324
+ showOtherMonthDays: !1
319
325
  };
320
- let d = l;
321
- const Y = E(), z = P(A(Y, d));
326
+ let d = r;
327
+ const Y = E(), z = O(P(Y, d));
322
328
  z.displayName = "KendoReactCalendar";
323
329
  M(d);
324
330
  export {
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),b=require("@progress/kendo-react-common");function C(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const l=C(E),M=(n,t)=>{const e=Object.getOwnPropertyNames(n),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let a=0;a<e.length;a++){const o=e[a];if(n[o]!==t[o])return!1}return!0};class R extends l.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:a,...o}=t;return!((!(e&&a)||e.getTime()===a.getTime())&&M(s,o))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:a,isInRange:o,isSelected:c,isRangeStart:r,isRangeMid:d,isRangeEnd:i,isRangeSplitStart:u,isRangeSplitEnd:p,isToday:g,isDisabled:h,view:O,value:S,...m}=this.props,v=this.props.activeRangeEnd==="end"&&i,k=this.props.activeRangeEnd==="start"&&r,f=b.classNames("k-calendar-td",{"k-range-end":i,"k-range-mid":d,"k-range-split-end":p,"k-range-split-start":u,"k-range-start":r,"k-active":k||v,"k-state-pending-focus":a,"k-selected":c||r||i,"k-today":g,"k-weekend":s,"k-disabled":h},t);return l.createElement("td",{...m,className:f,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},l.createElement("span",{className:"k-link"},this.props.children))}}exports.CalendarCell=R;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),O=require("@progress/kendo-react-common");function R(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const l=R(C),y=(n,t)=>{const e=Object.getOwnPropertyNames(n),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let r=0;r<e.length;r++){const o=e[r];if(n[o]!==t[o])return!1}return!0};class N extends l.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:r,...o}=t;return!((!(e&&r)||e.getTime()===r.getTime())&&y(s,o))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:r,isInRange:o,isSelected:d,isRangeStart:i,isRangeMid:p,isRangeEnd:c,isRangeSplitStart:h,isRangeSplitEnd:g,isToday:m,isDisabled:k,view:S,value:w,isOtherMonth:a,showOtherMonthDays:v,allowReverse:u,...f}=this.props,E=this.props.activeRangeEnd==="end"&&c,M=this.props.activeRangeEnd==="start"&&i,b=O.classNames("k-calendar-td",{"k-range-start":!a&&!u&&i,"k-range-end":!a&&!u&&c,"k-range-mid":!a&&p,"k-range-split-end":!a&&g,"k-range-split-start":!a&&h,"k-active":M||E,"k-state-pending-focus":r,"k-selected":!a&&(d||i||c),"k-today":!a&&m,"k-weekend":s,"k-disabled":k,"k-other-month":a},t);return!v&&a?l.createElement("td",{role:"gridcell",className:"k-empty k-calendar-td"}):l.createElement("td",{...f,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},l.createElement("span",{className:"k-link"},this.props.children))}}exports.CalendarCell=N;
@@ -6,30 +6,30 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as l from "react";
10
- import { classNames as f } from "@progress/kendo-react-common";
11
- const C = (o, e) => {
12
- const s = Object.getOwnPropertyNames(o), n = Object.getOwnPropertyNames(e);
13
- if (s.length !== n.length)
9
+ import * as r from "react";
10
+ import { classNames as C } from "@progress/kendo-react-common";
11
+ const N = (l, e) => {
12
+ const t = Object.getOwnPropertyNames(l), a = Object.getOwnPropertyNames(e);
13
+ if (t.length !== a.length)
14
14
  return !1;
15
- for (let t = 0; t < s.length; t++) {
16
- const a = s[t];
17
- if (o[a] !== e[a])
15
+ for (let n = 0; n < t.length; n++) {
16
+ const o = t[n];
17
+ if (l[o] !== e[o])
18
18
  return !1;
19
19
  }
20
20
  return !0;
21
21
  };
22
- class w extends l.Component {
22
+ class P extends r.Component {
23
23
  constructor() {
24
24
  super(...arguments), this.handleClick = (e) => {
25
- const { onClick: s, value: n } = this.props;
26
- s && s.call(void 0, n, e);
25
+ const { onClick: t, value: a } = this.props;
26
+ t && t.call(void 0, a, e);
27
27
  }, this.handleMouseEnter = () => {
28
- const { onMouseEnter: e, value: s } = this.props;
29
- e && e.call(void 0, s);
28
+ const { onMouseEnter: e, value: t } = this.props;
29
+ e && e.call(void 0, t);
30
30
  }, this.handleMouseLeave = () => {
31
- const { onMouseLeave: e, value: s } = this.props;
32
- e && e.call(void 0, s);
31
+ const { onMouseLeave: e, value: t } = this.props;
32
+ e && e.call(void 0, t);
33
33
  };
34
34
  }
35
35
  // Manually checking if the component needs an update
@@ -40,8 +40,8 @@ class w extends l.Component {
40
40
  * @hidden
41
41
  */
42
42
  shouldComponentUpdate(e) {
43
- const { value: s, ...n } = this.props, { value: t, ...a } = e;
44
- return !((!(s && t) || s.getTime() === t.getTime()) && C(n, a));
43
+ const { value: t, ...a } = this.props, { value: n, ...o } = e;
44
+ return !((!(t && n) || t.getTime() === n.getTime()) && N(a, o));
45
45
  }
46
46
  /* eslint-disable max-len */
47
47
  /**
@@ -51,51 +51,55 @@ class w extends l.Component {
51
51
  render() {
52
52
  const {
53
53
  className: e,
54
- formattedValue: s,
55
- isWeekend: n,
56
- isFocused: t,
57
- isInRange: a,
58
- isSelected: c,
59
- isRangeStart: r,
60
- isRangeMid: d,
61
- isRangeEnd: i,
62
- isRangeSplitStart: p,
63
- isRangeSplitEnd: u,
64
- isToday: h,
65
- isDisabled: g,
66
- view: M,
67
- value: R,
68
- ...m
69
- } = this.props, v = this.props.activeRangeEnd === "end" && i, k = this.props.activeRangeEnd === "start" && r, E = f(
54
+ formattedValue: t,
55
+ isWeekend: a,
56
+ isFocused: n,
57
+ isInRange: o,
58
+ isSelected: d,
59
+ isRangeStart: i,
60
+ isRangeMid: u,
61
+ isRangeEnd: c,
62
+ isRangeSplitStart: h,
63
+ isRangeSplitEnd: m,
64
+ isToday: g,
65
+ isDisabled: k,
66
+ view: w,
67
+ value: y,
68
+ isOtherMonth: s,
69
+ showOtherMonthDays: v,
70
+ allowReverse: p,
71
+ ...E
72
+ } = this.props, f = this.props.activeRangeEnd === "end" && c, M = this.props.activeRangeEnd === "start" && i, R = C(
70
73
  "k-calendar-td",
71
74
  {
72
- "k-range-end": i,
73
- "k-range-mid": d,
74
- "k-range-split-end": u,
75
- "k-range-split-start": p,
76
- "k-range-start": r,
77
- "k-active": k || v,
78
- "k-state-pending-focus": t,
79
- "k-selected": c || r || i,
80
- "k-today": h,
81
- "k-weekend": n,
82
- "k-disabled": g
75
+ "k-range-start": !s && !p && i,
76
+ "k-range-end": !s && !p && c,
77
+ "k-range-mid": !s && u,
78
+ "k-range-split-end": !s && m,
79
+ "k-range-split-start": !s && h,
80
+ "k-active": M || f,
81
+ "k-state-pending-focus": n,
82
+ "k-selected": !s && (d || i || c),
83
+ "k-today": !s && g,
84
+ "k-weekend": a,
85
+ "k-disabled": k,
86
+ "k-other-month": s
83
87
  },
84
88
  e
85
89
  );
86
- return /* @__PURE__ */ l.createElement(
90
+ return !v && s ? /* @__PURE__ */ r.createElement("td", { role: "gridcell", className: "k-empty k-calendar-td" }) : /* @__PURE__ */ r.createElement(
87
91
  "td",
88
92
  {
89
- ...m,
90
- className: E,
93
+ ...E,
94
+ className: R,
91
95
  onClick: this.handleClick,
92
96
  onMouseEnter: this.handleMouseEnter,
93
97
  onMouseLeave: this.handleMouseLeave
94
98
  },
95
- /* @__PURE__ */ l.createElement("span", { className: "k-link" }, this.props.children)
99
+ /* @__PURE__ */ r.createElement("span", { className: "k-link" }, this.props.children)
96
100
  );
97
101
  }
98
102
  }
99
103
  export {
100
- w as CalendarCell
104
+ P as CalendarCell
101
105
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=require("@progress/kendo-react-common");function s(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=s(c);class l extends a.Component{render(){const{className:t,firstDate:r,...n}=this.props;return a.createElement("td",{className:o.classNames("k-calendar-td",t),...n},this.props.children)}}exports.CalendarWeekCell=l;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=require("@progress/kendo-react-common");function l(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const a=l(c);class i extends a.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,firstDate:n,weekDays:s}=this.props;t&&e&&t.call(void 0,n,s||[],e)}}render(){const{className:e,firstDate:t,weekDays:n,...s}=this.props;return a.createElement("td",{className:o.classNames("k-calendar-td",e),...s,onClick:this.handleClick},this.props.children)}}exports.CalendarWeekCell=i;
@@ -6,18 +6,20 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as e from "react";
10
- import { classNames as r } from "@progress/kendo-react-common";
11
- class o extends e.Component {
12
- /**
13
- * @return
14
- * Returns a `<td />` element with the [`value`]({% slug api_dateinputs_calendarweekcellprops %}#toc-value) as a child.
15
- */
9
+ import * as a from "react";
10
+ import { classNames as l } from "@progress/kendo-react-common";
11
+ class i extends a.Component {
12
+ constructor() {
13
+ super(...arguments), this.handleClick = (e) => {
14
+ const { onClick: s, firstDate: r, weekDays: t } = this.props;
15
+ s && e && s.call(void 0, r, t || [], e);
16
+ };
17
+ }
16
18
  render() {
17
- const { className: s, firstDate: l, ...t } = this.props;
18
- return /* @__PURE__ */ e.createElement("td", { className: r("k-calendar-td", s), ...t }, this.props.children);
19
+ const { className: e, firstDate: s, weekDays: r, ...t } = this.props;
20
+ return /* @__PURE__ */ a.createElement("td", { className: l("k-calendar-td", e), ...t, onClick: this.handleClick }, this.props.children);
19
21
  }
20
22
  }
21
23
  export {
22
- o as CalendarWeekCell
24
+ i as CalendarWeekCell
23
25
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),a=require("prop-types"),h=require("@progress/kendo-react-intl"),c=require("@progress/kendo-react-common"),d=require("./CalendarHeaderTitle.js"),p=require("../../utils.js");function m(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const i=m(u),r=class r extends i.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),s=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(s,this.min,this.max)?t:`${t} - ${this.props.service.title(s)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return this.props.min!==void 0?this.props.min:r.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:r.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:r.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const e=this.getTitle(),t=c.classNames("k-calendar-title"),s={children:e,value:e,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},l=this.props.headerTitle?i.createElement(this.props.headerTitle,{...s},e):i.createElement(d.CalendarHeaderTitle,{...s},e);return i.createElement("div",{className:c.classNames("k-calendar-header",{"k-vstack":this.props.verticalView})},l,i.createElement("span",{className:"k-spacer"}),i.createElement("span",{className:"k-calendar-nav"},this.props.commands))}};r.propTypes={activeView:a.number.isRequired,currentDate:a.instanceOf(Date).isRequired,max:a.instanceOf(Date).isRequired,min:a.instanceOf(Date).isRequired,rangeLength:a.number},r.defaultProps={rangeLength:1,min:p.MIN_DATE,max:p.MAX_DATE};let o=r;h.registerForLocalization(o);exports.Header=o;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("prop-types"),m=require("@progress/kendo-react-intl"),c=require("@progress/kendo-react-common"),g=require("./CalendarHeaderTitle.js"),p=require("../../utils.js");function v(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const s=v(d),i=class i extends s.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),r=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(r,this.min,this.max)?t:`${t} - ${this.props.service.title(r)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return this.props.min!==void 0?this.props.min:i.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:i.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:i.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const e=this.getTitle(),t=c.classNames("k-calendar-title"),r={children:e,value:e,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},l={headerTitleProps:r,commands:this.props.commands},h=this.props.headerTitle?s.createElement(this.props.headerTitle,{...r},e):s.createElement(g.CalendarHeaderTitle,{...r},e),u=this.props.header?s.createElement(this.props.header,{...l}):s.createElement(s.Fragment,null,h,s.createElement("span",{className:"k-spacer"}),s.createElement("span",{className:"k-calendar-nav"},this.props.commands));return s.createElement("div",{className:c.classNames("k-calendar-header",{"k-vstack":this.props.verticalView})},u)}};i.propTypes={activeView:a.number.isRequired,currentDate:a.instanceOf(Date).isRequired,max:a.instanceOf(Date).isRequired,min:a.instanceOf(Date).isRequired,rangeLength:a.number},i.defaultProps={rangeLength:1,min:p.MIN_DATE,max:p.MAX_DATE};let o=i;m.registerForLocalization(o);exports.Header=o;
@@ -6,13 +6,13 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as s from "react";
9
+ import * as t from "react";
10
10
  import i from "prop-types";
11
- import { registerForLocalization as c } from "@progress/kendo-react-intl";
11
+ import { registerForLocalization as m } from "@progress/kendo-react-intl";
12
12
  import { classNames as p } from "@progress/kendo-react-common";
13
- import { CalendarHeaderTitle as h } from "./CalendarHeaderTitle.mjs";
14
- import { MIN_DATE as l, MAX_DATE as m } from "../../utils.mjs";
15
- const t = class t extends s.Component {
13
+ import { CalendarHeaderTitle as l } from "./CalendarHeaderTitle.mjs";
14
+ import { MIN_DATE as d, MAX_DATE as u } from "../../utils.mjs";
15
+ const s = class s extends t.Component {
16
16
  constructor() {
17
17
  super(...arguments), this.getTitle = () => {
18
18
  if (!this.props.currentDate)
@@ -24,13 +24,13 @@ const t = class t extends s.Component {
24
24
  };
25
25
  }
26
26
  get min() {
27
- return this.props.min !== void 0 ? this.props.min : t.defaultProps.min;
27
+ return this.props.min !== void 0 ? this.props.min : s.defaultProps.min;
28
28
  }
29
29
  get max() {
30
- return this.props.max !== void 0 ? this.props.max : t.defaultProps.max;
30
+ return this.props.max !== void 0 ? this.props.max : s.defaultProps.max;
31
31
  }
32
32
  get rangeLength() {
33
- return this.props.rangeLength !== void 0 ? this.props.rangeLength : t.defaultProps.rangeLength;
33
+ return this.props.rangeLength !== void 0 ? this.props.rangeLength : s.defaultProps.rangeLength;
34
34
  }
35
35
  get canMoveUp() {
36
36
  return this.props.bus.canMoveUp(this.props.activeView);
@@ -45,33 +45,34 @@ const t = class t extends s.Component {
45
45
  className: a,
46
46
  onClick: this.handleTitleClick,
47
47
  disabled: !this.canMoveUp
48
- }, o = this.props.headerTitle ? /* @__PURE__ */ s.createElement(this.props.headerTitle, { ...r }, e) : /* @__PURE__ */ s.createElement(h, { ...r }, e);
49
- return /* @__PURE__ */ s.createElement(
48
+ }, o = {
49
+ headerTitleProps: r,
50
+ commands: this.props.commands
51
+ }, c = this.props.headerTitle ? /* @__PURE__ */ t.createElement(this.props.headerTitle, { ...r }, e) : /* @__PURE__ */ t.createElement(l, { ...r }, e), h = this.props.header ? /* @__PURE__ */ t.createElement(this.props.header, { ...o }) : /* @__PURE__ */ t.createElement(t.Fragment, null, c, /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("span", { className: "k-calendar-nav" }, this.props.commands));
52
+ return /* @__PURE__ */ t.createElement(
50
53
  "div",
51
54
  {
52
55
  className: p("k-calendar-header", {
53
56
  "k-vstack": this.props.verticalView
54
57
  })
55
58
  },
56
- o,
57
- /* @__PURE__ */ s.createElement("span", { className: "k-spacer" }),
58
- /* @__PURE__ */ s.createElement("span", { className: "k-calendar-nav" }, this.props.commands)
59
+ h
59
60
  );
60
61
  }
61
62
  };
62
- t.propTypes = {
63
+ s.propTypes = {
63
64
  activeView: i.number.isRequired,
64
65
  currentDate: i.instanceOf(Date).isRequired,
65
66
  max: i.instanceOf(Date).isRequired,
66
67
  min: i.instanceOf(Date).isRequired,
67
68
  rangeLength: i.number
68
- }, t.defaultProps = {
69
+ }, s.defaultProps = {
69
70
  rangeLength: 1,
70
- min: l,
71
- max: m
71
+ min: d,
72
+ max: u
72
73
  };
73
- let n = t;
74
- c(n);
74
+ let n = s;
75
+ m(n);
75
76
  export {
76
77
  n as Header
77
78
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),m=require("./View.js"),r=require("../models/CalendarViewEnum.js"),d=require("@progress/kendo-react-common"),v=require("@progress/kendo-date-math"),l=require("../../utils.js");function f(i){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>i[e]})}}return s.default=i,Object.freeze(s)}const n=f(h),u=2,a=class a extends n.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleDateChange=(e,t=!1)=>{const{onChange:c}=this.props;if(c){const p={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:v.cloneDate(e.value),target:this,isTodayClick:t};c.call(void 0,p)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===r.CalendarViewEnum.month)}get min(){return this.props.min!==void 0?this.props.min:a.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:a.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===r.CalendarViewEnum.month,"k-calendar-yearview":this.props.activeView===r.CalendarViewEnum.year,"k-calendar-decadeview":this.props.activeView===r.CalendarViewEnum.decade,"k-calendar-centuryview":this.props.activeView===r.CalendarViewEnum.century});return n.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>n.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},n.createElement(m.View,{bus:this.props.bus,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};a.defaultProps={showWeekNumbers:!1,views:u,take:u,allowReverse:!0,min:l.MIN_DATE,max:l.MAX_DATE};let o=a;exports.HorizontalViewList=o;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),m=require("./View.js"),a=require("../models/CalendarViewEnum.js"),d=require("@progress/kendo-react-common"),v=require("@progress/kendo-date-math"),h=require("../../utils.js");function f(i){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>i[e]})}}return s.default=i,Object.freeze(s)}const l=f(u),p=2,n=class n extends l.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleWeekCellClick=(e,t,r)=>{const{onWeekSelect:o}=this.props;o&&r&&o.call(void 0,e,t,r)},this.handleDateChange=(e,t=!1)=>{const{onChange:r}=this.props;if(r){const o={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:v.cloneDate(e.value),target:this,isTodayClick:t};r.call(void 0,o)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===a.CalendarViewEnum.month)}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===a.CalendarViewEnum.month,"k-calendar-yearview":this.props.activeView===a.CalendarViewEnum.year,"k-calendar-decadeview":this.props.activeView===a.CalendarViewEnum.decade,"k-calendar-centuryview":this.props.activeView===a.CalendarViewEnum.century});return l.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>l.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},l.createElement(m.View,{bus:this.props.bus,weekDaysFormat:this.props.weekDaysFormat,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onWeekSelect:this.handleWeekCellClick,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}))))}};n.defaultProps={showWeekNumbers:!1,views:p,take:p,allowReverse:!0,weekDaysFormat:"short",min:h.MIN_DATE,max:h.MAX_DATE};let c=n;exports.HorizontalViewList=c;