@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.2.4-develop.4

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 (200) hide show
  1. package/calendar/components/Calendar.js +12 -0
  2. package/calendar/components/Calendar.mjs +328 -0
  3. package/calendar/components/CalendarCell.js +8 -0
  4. package/calendar/components/CalendarCell.mjs +101 -0
  5. package/calendar/components/CalendarHeaderTitle.js +8 -0
  6. package/calendar/components/CalendarHeaderTitle.mjs +23 -0
  7. package/calendar/components/CalendarNavigationItem.js +8 -0
  8. package/calendar/components/CalendarNavigationItem.mjs +29 -0
  9. package/calendar/components/CalendarWeekCell.js +8 -0
  10. package/calendar/components/CalendarWeekCell.mjs +23 -0
  11. package/calendar/components/Header.js +8 -0
  12. package/calendar/components/Header.mjs +78 -0
  13. package/calendar/components/HorizontalViewList.js +8 -0
  14. package/calendar/components/HorizontalViewList.mjs +120 -0
  15. package/calendar/components/MultiViewCalendar.js +8 -0
  16. package/calendar/components/MultiViewCalendar.mjs +428 -0
  17. package/calendar/components/Navigation.js +8 -0
  18. package/calendar/components/Navigation.mjs +117 -0
  19. package/calendar/components/TodayCommand.js +8 -0
  20. package/calendar/components/TodayCommand.mjs +74 -0
  21. package/calendar/components/View.js +8 -0
  22. package/calendar/components/View.mjs +153 -0
  23. package/calendar/components/ViewList.js +8 -0
  24. package/calendar/components/ViewList.mjs +228 -0
  25. package/calendar/models/CalendarViewEnum.js +8 -0
  26. package/calendar/models/CalendarViewEnum.mjs +12 -0
  27. package/calendar/models/NavigationAction.js +8 -0
  28. package/calendar/models/NavigationAction.mjs +12 -0
  29. package/calendar/models/SelectionRange.js +8 -0
  30. package/calendar/models/SelectionRange.mjs +12 -0
  31. package/calendar/services/BusViewService.js +8 -0
  32. package/calendar/services/BusViewService.mjs +58 -0
  33. package/calendar/services/CenturyViewService.js +8 -0
  34. package/calendar/services/CenturyViewService.mjs +126 -0
  35. package/calendar/services/DOMService.js +14 -0
  36. package/calendar/services/DOMService.mjs +124 -0
  37. package/calendar/services/DecadeViewService.js +8 -0
  38. package/calendar/services/DecadeViewService.mjs +126 -0
  39. package/calendar/services/MonthViewService.js +8 -0
  40. package/calendar/services/MonthViewService.mjs +139 -0
  41. package/calendar/services/NavigationService.js +8 -0
  42. package/calendar/services/NavigationService.mjs +36 -0
  43. package/calendar/services/ScrollSyncService.js +8 -0
  44. package/calendar/services/ScrollSyncService.mjs +50 -0
  45. package/calendar/services/WeekNamesService.js +8 -0
  46. package/calendar/services/WeekNamesService.mjs +24 -0
  47. package/calendar/services/YearViewService.js +8 -0
  48. package/calendar/services/YearViewService.mjs +135 -0
  49. package/common/AdaptiveMode.js +8 -0
  50. package/common/AdaptiveMode.mjs +73 -0
  51. package/common/PickerWrap.js +8 -0
  52. package/common/PickerWrap.mjs +32 -0
  53. package/common/constants.js +8 -0
  54. package/common/constants.mjs +12 -0
  55. package/dateinput/DateInput.js +8 -0
  56. package/dateinput/DateInput.mjs +503 -0
  57. package/dateinput/models/kendo-date.js +8 -0
  58. package/dateinput/models/kendo-date.mjs +233 -0
  59. package/dateinput/models/mask.js +8 -0
  60. package/dateinput/models/mask.mjs +16 -0
  61. package/dateinput/utils.js +8 -0
  62. package/dateinput/utils.mjs +38 -0
  63. package/datepicker/DatePicker.js +8 -0
  64. package/datepicker/DatePicker.mjs +462 -0
  65. package/datepicker/ToggleButton.js +8 -0
  66. package/datepicker/ToggleButton.mjs +13 -0
  67. package/daterangepicker/DateRangePicker.js +8 -0
  68. package/daterangepicker/DateRangePicker.mjs +426 -0
  69. package/datetimepicker/DateTimePicker.js +8 -0
  70. package/datetimepicker/DateTimePicker.mjs +475 -0
  71. package/datetimepicker/DateTimeSelector.js +8 -0
  72. package/datetimepicker/DateTimeSelector.mjs +275 -0
  73. package/dist/cdn/js/kendo-react-dateinputs.js +8 -21
  74. package/hooks/usePickerFloatingLabel.js +8 -0
  75. package/hooks/usePickerFloatingLabel.mjs +31 -0
  76. package/index.d.mts +4528 -5
  77. package/index.d.ts +4528 -39
  78. package/index.js +8 -21
  79. package/index.mjs +114 -6540
  80. package/messages/index.js +8 -0
  81. package/messages/index.mjs +59 -0
  82. package/package-metadata.js +8 -0
  83. package/package-metadata.mjs +19 -0
  84. package/package.json +7 -7
  85. package/timepicker/TimeList.js +14 -0
  86. package/timepicker/TimeList.mjs +230 -0
  87. package/timepicker/TimePart.js +8 -0
  88. package/timepicker/TimePart.mjs +267 -0
  89. package/timepicker/TimePicker.js +8 -0
  90. package/timepicker/TimePicker.mjs +479 -0
  91. package/timepicker/TimeSelector.js +8 -0
  92. package/timepicker/TimeSelector.mjs +250 -0
  93. package/timepicker/models/TimePart.js +8 -0
  94. package/timepicker/models/TimePart.mjs +18 -0
  95. package/timepicker/services/DOMService.js +8 -0
  96. package/timepicker/services/DOMService.mjs +34 -0
  97. package/timepicker/services/DayPeriodService.js +8 -0
  98. package/timepicker/services/DayPeriodService.mjs +89 -0
  99. package/timepicker/services/HoursService.js +8 -0
  100. package/timepicker/services/HoursService.mjs +92 -0
  101. package/timepicker/services/MinutesService.js +8 -0
  102. package/timepicker/services/MinutesService.mjs +91 -0
  103. package/timepicker/services/SecondsService.js +8 -0
  104. package/timepicker/services/SecondsService.mjs +91 -0
  105. package/timepicker/utils.js +8 -0
  106. package/timepicker/utils.mjs +91 -0
  107. package/utils.js +8 -0
  108. package/utils.mjs +111 -0
  109. package/virtualization/Virtualization.js +8 -0
  110. package/virtualization/Virtualization.mjs +204 -0
  111. package/virtualization/services/RowHeightService.js +8 -0
  112. package/virtualization/services/RowHeightService.mjs +50 -0
  113. package/virtualization/services/ScrollerService.js +8 -0
  114. package/virtualization/services/ScrollerService.mjs +52 -0
  115. package/PopupSettings.d.ts +0 -18
  116. package/calendar/components/Calendar.d.ts +0 -191
  117. package/calendar/components/CalendarCell.d.ts +0 -39
  118. package/calendar/components/CalendarHeaderTitle.d.ts +0 -32
  119. package/calendar/components/CalendarNavigationItem.d.ts +0 -31
  120. package/calendar/components/CalendarWeekCell.d.ts +0 -29
  121. package/calendar/components/Header.d.ts +0 -58
  122. package/calendar/components/HorizontalViewList.d.ts +0 -71
  123. package/calendar/components/MultiViewCalendar.d.ts +0 -212
  124. package/calendar/components/Navigation.d.ts +0 -80
  125. package/calendar/components/TodayCommand.d.ts +0 -35
  126. package/calendar/components/View.d.ts +0 -89
  127. package/calendar/components/ViewList.d.ts +0 -115
  128. package/calendar/models/ActiveView.d.ts +0 -8
  129. package/calendar/models/CalendarSettings.d.ts +0 -106
  130. package/calendar/models/CalendarViewEnum.d.ts +0 -13
  131. package/calendar/models/CellContext.d.ts +0 -23
  132. package/calendar/models/MultiViewCalendarMode.d.ts +0 -13
  133. package/calendar/models/MultiViewCalendarSettings.d.ts +0 -115
  134. package/calendar/models/NavigationAction.d.ts +0 -19
  135. package/calendar/models/SelectionRange.d.ts +0 -21
  136. package/calendar/models/SelectionRangeEnd.d.ts +0 -8
  137. package/calendar/models/ViewService.d.ts +0 -29
  138. package/calendar/models/index.d.ts +0 -15
  139. package/calendar/services/BusViewService.d.ts +0 -25
  140. package/calendar/services/CenturyViewService.d.ts +0 -29
  141. package/calendar/services/DOMService.d.ts +0 -33
  142. package/calendar/services/DecadeViewService.d.ts +0 -31
  143. package/calendar/services/MonthViewService.d.ts +0 -37
  144. package/calendar/services/NavigationService.d.ts +0 -18
  145. package/calendar/services/ScrollSyncService.d.ts +0 -25
  146. package/calendar/services/WeekNamesService.d.ts +0 -13
  147. package/calendar/services/YearViewService.d.ts +0 -35
  148. package/calendar/services/index.d.ts +0 -14
  149. package/common/AdaptiveMode.d.ts +0 -25
  150. package/common/PickerWrap.d.ts +0 -22
  151. package/common/constants.d.ts +0 -8
  152. package/dateinput/DateInput.d.ts +0 -355
  153. package/dateinput/models/DateInputSettings.d.ts +0 -103
  154. package/dateinput/models/format-placeholder.d.ts +0 -43
  155. package/dateinput/models/incremental-steps.d.ts +0 -15
  156. package/dateinput/models/index.d.ts +0 -11
  157. package/dateinput/models/kendo-date.d.ts +0 -57
  158. package/dateinput/models/mask.d.ts +0 -11
  159. package/dateinput/models/selection.d.ts +0 -11
  160. package/dateinput/utils.d.ts +0 -34
  161. package/datepicker/DatePicker.d.ts +0 -358
  162. package/datepicker/ToggleButton.d.ts +0 -14
  163. package/datepicker/models/DatePickerSettings.d.ts +0 -141
  164. package/datepicker/models/index.d.ts +0 -6
  165. package/daterangepicker/DateRangePicker.d.ts +0 -354
  166. package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +0 -10
  167. package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +0 -10
  168. package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +0 -10
  169. package/daterangepicker/models/DateRangePickerSettings.d.ts +0 -126
  170. package/daterangepicker/models/index.d.ts +0 -9
  171. package/datetimepicker/DateTimePicker.d.ts +0 -342
  172. package/datetimepicker/DateTimeSelector.d.ts +0 -106
  173. package/datetimepicker/models/DateTimePickerSettings.d.ts +0 -144
  174. package/datetimepicker/models/index.d.ts +0 -6
  175. package/hooks/usePickerFloatingLabel.d.ts +0 -24
  176. package/messages/index.d.ts +0 -124
  177. package/package-metadata.d.ts +0 -9
  178. package/timepicker/TimeList.d.ts +0 -91
  179. package/timepicker/TimePart.d.ts +0 -141
  180. package/timepicker/TimePicker.d.ts +0 -355
  181. package/timepicker/TimeSelector.d.ts +0 -144
  182. package/timepicker/models/IncrementalSteps.d.ts +0 -12
  183. package/timepicker/models/ListItem.d.ts +0 -11
  184. package/timepicker/models/ListService.d.ts +0 -19
  185. package/timepicker/models/ListServiceSettings.d.ts +0 -16
  186. package/timepicker/models/TimePart.d.ts +0 -14
  187. package/timepicker/models/TimePickerSettings.d.ts +0 -133
  188. package/timepicker/models/index.d.ts +0 -11
  189. package/timepicker/services/DOMService.d.ts +0 -14
  190. package/timepicker/services/DayPeriodService.d.ts +0 -51
  191. package/timepicker/services/HoursService.d.ts +0 -37
  192. package/timepicker/services/MinutesService.d.ts +0 -36
  193. package/timepicker/services/SecondsService.d.ts +0 -36
  194. package/timepicker/services/index.d.ts +0 -10
  195. package/timepicker/utils.d.ts +0 -60
  196. package/utils.d.ts +0 -100
  197. package/virtualization/Virtualization.d.ts +0 -120
  198. package/virtualization/services/RowHeightService.d.ts +0 -22
  199. package/virtualization/services/ScrollerService.d.ts +0 -53
  200. package/virtualization/services/index.d.ts +0 -7
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
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-widget k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber,"k-calendar-lg":this.props.mobileMode},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}.
9
+ ${t} can not be smaller than bottomView.
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
+ ${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;
@@ -0,0 +1,328 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as v from "react";
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";
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";
15
+ import { ViewList as B } from "./ViewList.mjs";
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";
19
+ import { BusViewService as _ } from "../services/BusViewService.mjs";
20
+ import { DOMService as $ } from "../services/DOMService.mjs";
21
+ import { NavigationService as R } from "../services/NavigationService.mjs";
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 {
24
+ constructor(o) {
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
+ this._element && this._element.focus();
27
+ }, this.shouldScroll = () => this.didNavigationChange, this.handleScroll = (t) => {
28
+ this.scrollSyncService && this.scrollSyncService.sync(
29
+ V(this.Navigation),
30
+ V(this.calendarViewList),
31
+ t
32
+ );
33
+ }, this.handleNavigationChange = (t) => {
34
+ if (this.props.disabled)
35
+ return;
36
+ this.didNavigationChange = !0;
37
+ const e = f(t.value);
38
+ this.setState({ focusedDate: e });
39
+ }, this.handleViewChange = ({ view: t }) => {
40
+ this.scrollSyncService && this.scrollSyncService.configure(t), this.setState({ activeView: t });
41
+ }, this.handleDateChange = (t) => {
42
+ const e = f(t.value), a = f(t.value), p = this.bus.canMoveDown(this.state.activeView);
43
+ if (this.props.disabled)
44
+ return;
45
+ if (p)
46
+ if (t.isTodayClick)
47
+ this.bus.moveToBottom(this.state.activeView);
48
+ else {
49
+ this.bus.moveDown(this.state.activeView, t.syntheticEvent), this.setState({ focusedDate: a });
50
+ return;
51
+ }
52
+ this.setState({ value: e, focusedDate: a }), this.valueDuringOnChange = e;
53
+ const { onChange: h } = this.props;
54
+ if (h) {
55
+ const n = {
56
+ syntheticEvent: t.syntheticEvent,
57
+ nativeEvent: t.nativeEvent,
58
+ value: e,
59
+ target: this
60
+ };
61
+ h.call(void 0, n);
62
+ }
63
+ this.valueDuringOnChange = void 0;
64
+ }, this.handleFocus = (t) => {
65
+ if (this.isActive = !0, !this.calendarViewList)
66
+ return;
67
+ this.calendarViewList.focusActiveDate();
68
+ const { onFocus: e } = this.props;
69
+ e && e.call(void 0, t);
70
+ }, this.handleBlur = (t) => {
71
+ if (this.isActive = !1, !this.calendarViewList)
72
+ return;
73
+ this.calendarViewList.blurActiveDate();
74
+ const { onBlur: e } = this.props;
75
+ e && e.call(void 0, t);
76
+ }, this.handleKeyDown = (t) => {
77
+ const { keyCode: a, ctrlKey: p, metaKey: h } = t;
78
+ if (!(!this.focusedDate || !this.service)) {
79
+ if (a === 84 && this.setState({ focusedDate: S() }), (p || h) && (a === m.left || a === m.right)) {
80
+ if (this.props.disabled)
81
+ return;
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 });
85
+ }
86
+ if (a === m.enter) {
87
+ if (this.value !== null && D(this.focusedDate, this.value)) {
88
+ const g = w(this.focusedDate, this.min, this.max);
89
+ V(this.calendarViewList).scrollToIndex(this.service.skip(g, this.min));
90
+ }
91
+ const n = {
92
+ syntheticEvent: t,
93
+ nativeEvent: t.nativeEvent,
94
+ value: this.focusedDate,
95
+ target: this
96
+ };
97
+ this.handleDateChange(n);
98
+ } else {
99
+ const n = w(
100
+ this.navigation.move(
101
+ this.focusedDate,
102
+ this.navigation.action(t),
103
+ this.state.activeView,
104
+ this.service,
105
+ t
106
+ ),
107
+ this.min,
108
+ this.max
109
+ );
110
+ if (D(this.focusedDate, n))
111
+ return;
112
+ this.setState({ focusedDate: n });
113
+ }
114
+ t.preventDefault();
115
+ }
116
+ }, this.handleMouseDown = (t) => {
117
+ t.preventDefault();
118
+ }, this.handleClick = (t) => {
119
+ this._element && this._element.focus({ preventScroll: !0 });
120
+ }, I(O);
121
+ const i = x(
122
+ this.min,
123
+ this.max,
124
+ this.props.defaultValue || l.defaultProps.defaultValue,
125
+ this.props.value
126
+ );
127
+ this.state = {
128
+ value: i,
129
+ activeView: y(
130
+ r[o.defaultActiveView],
131
+ this.bottomView,
132
+ this.topView
133
+ ),
134
+ focusedDate: w(
135
+ o.focusedDate || i || S(),
136
+ this.min,
137
+ this.max
138
+ )
139
+ }, this.dom = new $(), this.bus = new _(this.handleViewChange), this.navigation = new R(this.bus), this.oldValue = i;
140
+ }
141
+ get cellUID() {
142
+ return this.props.id + "-cell-uid";
143
+ }
144
+ get id() {
145
+ return this.props.id + "-id";
146
+ }
147
+ /**
148
+ * Gets the wrapping element of the Calendar.
149
+ */
150
+ get element() {
151
+ return this._element;
152
+ }
153
+ /**
154
+ * Gets the value of the Calendar.
155
+ */
156
+ get value() {
157
+ return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
158
+ }
159
+ get min() {
160
+ return c(this.props.min !== void 0 ? this.props.min : l.defaultProps.min);
161
+ }
162
+ get max() {
163
+ return c(this.props.max !== void 0 ? this.props.max : l.defaultProps.max);
164
+ }
165
+ get bottomView() {
166
+ return r[this.props.bottomView !== void 0 ? this.props.bottomView : l.defaultProps.bottomView];
167
+ }
168
+ get topView() {
169
+ return r[this.props.topView !== void 0 ? this.props.topView : l.defaultProps.topView];
170
+ }
171
+ /**
172
+ * @hidden
173
+ */
174
+ componentDidMount() {
175
+ Promise.resolve().then(() => {
176
+ b(), this._element && (this.dom.calculateHeights(this._element), this.scrollSyncService = new U(this.dom), this.scrollSyncService.configure(this.state.activeView), this.forceUpdate());
177
+ });
178
+ }
179
+ /**
180
+ * @hidden
181
+ */
182
+ componentDidUpdate(o, i) {
183
+ b(), i.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);
184
+ }
185
+ /**
186
+ * @hidden
187
+ */
188
+ render() {
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(
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;
195
+ this.focusedDate = c(w(
196
+ o && t !== null ? t : this.state.focusedDate,
197
+ this.min,
198
+ this.max
199
+ )), this.intl = L(this), this.bus.configure(this.bottomView, this.topView), this.service = this.bus.service(i, this.intl);
200
+ const { smoothScroll: a = Number.parseFloat(v.version) < 18 } = this.props, p = N(
201
+ "k-widget k-calendar k-calendar-infinite",
202
+ {
203
+ "k-disabled": this.props.disabled,
204
+ "k-week-number": this.props.weekNumber,
205
+ "k-calendar-lg": this.props.mobileMode
206
+ },
207
+ this.props.className
208
+ ), h = [this.props.navigation && /* @__PURE__ */ v.createElement(
209
+ T,
210
+ {
211
+ key: 0,
212
+ ref: (n) => {
213
+ this.Navigation = n;
214
+ },
215
+ activeView: this.state.activeView,
216
+ focusedDate: this.focusedDate,
217
+ min: this.min,
218
+ max: this.max,
219
+ onScroll: this.handleScroll,
220
+ onChange: this.handleNavigationChange,
221
+ service: this.service,
222
+ dom: this.dom,
223
+ navigationItem: this.props.navigationItem,
224
+ tabIndex: this.props.tabIndex
225
+ }
226
+ ), /* @__PURE__ */ v.createElement(
227
+ B,
228
+ {
229
+ key: 1,
230
+ ref: (n) => {
231
+ this.calendarViewList = n;
232
+ },
233
+ activeView: this.state.activeView,
234
+ focusedDate: this.focusedDate,
235
+ min: this.min,
236
+ max: this.max,
237
+ bus: this.bus,
238
+ shouldScroll: this.shouldScroll,
239
+ onScroll: this.handleScroll,
240
+ service: this.service,
241
+ cell: this.props.cell,
242
+ weekCell: this.props.weekCell,
243
+ dom: this.dom,
244
+ smoothScroll: a,
245
+ showWeekNumbers: this.props.weekNumber,
246
+ onChange: this.handleDateChange,
247
+ value: e,
248
+ cellUID: this.cellUID,
249
+ headerTitle: this.props.headerTitle,
250
+ tabIndex: this.props.tabIndex
251
+ }
252
+ )];
253
+ return /* @__PURE__ */ v.createElement(
254
+ "div",
255
+ {
256
+ ref: (n) => {
257
+ this._element = n;
258
+ },
259
+ className: p,
260
+ id: this.props.id || this.id,
261
+ "aria-labelledby": this.props.ariaLabelledBy,
262
+ "aria-describedby": this.props.ariaDescribedBy,
263
+ "aria-disabled": this.props.disabled,
264
+ tabIndex: this.props.disabled ? void 0 : this.props.tabIndex || 0,
265
+ onFocus: this.handleFocus,
266
+ onBlur: this.handleBlur,
267
+ onKeyDown: this.handleKeyDown,
268
+ onMouseDown: this.handleMouseDown,
269
+ onClick: this.handleClick
270
+ },
271
+ h
272
+ );
273
+ }
274
+ };
275
+ l.displayName = "Calendar", l.propTypes = {
276
+ className: s.string,
277
+ defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
278
+ defaultValue: s.instanceOf(Date),
279
+ disabled: s.bool,
280
+ focusedDate: s.instanceOf(Date),
281
+ id: s.string,
282
+ ariaLabelledBy: s.string,
283
+ ariaDescribedBy: s.string,
284
+ max: s.instanceOf(Date),
285
+ min: s.instanceOf(Date),
286
+ navigation: s.bool,
287
+ smoothScroll: s.bool,
288
+ onBlur: s.func,
289
+ onChange: s.func,
290
+ onFocus: s.func,
291
+ tabIndex: s.number,
292
+ value: s.instanceOf(Date),
293
+ weekNumber: s.bool,
294
+ topView: (o, i, t) => {
295
+ const e = o[i], a = o.bottomView;
296
+ return e && a && r[e] < r[a] ? new Error(
297
+ `Invalid prop + ${i} suplied to ${t}.
298
+ ${i} can not be smaller than bottomView.
299
+ `
300
+ ) : null;
301
+ },
302
+ bottomView: (o, i, t) => {
303
+ const e = o[i], a = o.topView;
304
+ return e && a && r[e] > r[a] ? new Error(
305
+ `Invalid prop + ${i} suplied to ${t}.
306
+ ${i} can not be bigger than topView.
307
+ `
308
+ ) : null;
309
+ }
310
+ }, l.defaultProps = {
311
+ disabled: !1,
312
+ min: K,
313
+ max: F,
314
+ navigation: !0,
315
+ defaultActiveView: "month",
316
+ defaultValue: null,
317
+ topView: "century",
318
+ bottomView: "month"
319
+ };
320
+ let d = l;
321
+ const Y = E(), z = P(A(Y, d));
322
+ z.displayName = "KendoReactCalendar";
323
+ M(d);
324
+ export {
325
+ z as Calendar,
326
+ Y as CalendarPropsContext,
327
+ d as CalendarWithoutContext
328
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
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;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
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)
14
+ return !1;
15
+ for (let t = 0; t < s.length; t++) {
16
+ const a = s[t];
17
+ if (o[a] !== e[a])
18
+ return !1;
19
+ }
20
+ return !0;
21
+ };
22
+ class w extends l.Component {
23
+ constructor() {
24
+ super(...arguments), this.handleClick = (e) => {
25
+ const { onClick: s, value: n } = this.props;
26
+ s && s.call(void 0, n, e);
27
+ }, this.handleMouseEnter = () => {
28
+ const { onMouseEnter: e, value: s } = this.props;
29
+ e && e.call(void 0, s);
30
+ }, this.handleMouseLeave = () => {
31
+ const { onMouseLeave: e, value: s } = this.props;
32
+ e && e.call(void 0, s);
33
+ };
34
+ }
35
+ // Manually checking if the component needs an update
36
+ // due to date object being compared by instance
37
+ // and new Date object is created
38
+ // every time and fails the shallow compare of the React.PureComponent.
39
+ /**
40
+ * @hidden
41
+ */
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));
45
+ }
46
+ /* eslint-disable max-len */
47
+ /**
48
+ * @return
49
+ * Returns a `<td />` element with a `<span className="k-link" />` inside to apply the styles. The text inside is the [`formattedValue`]({% slug api_dateinputs_calendarcellprops %}#toc-formattedvalue) of the `cell`.
50
+ */
51
+ render() {
52
+ const {
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(
70
+ "k-calendar-td",
71
+ {
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
83
+ },
84
+ e
85
+ );
86
+ return /* @__PURE__ */ l.createElement(
87
+ "td",
88
+ {
89
+ ...m,
90
+ className: E,
91
+ onClick: this.handleClick,
92
+ onMouseEnter: this.handleMouseEnter,
93
+ onMouseLeave: this.handleMouseLeave
94
+ },
95
+ /* @__PURE__ */ l.createElement("span", { className: "k-link" }, this.props.children)
96
+ );
97
+ }
98
+ }
99
+ export {
100
+ w as CalendarCell
101
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-react-buttons"),c=require("react");function l(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=l(c);class s extends o.PureComponent{render(){const{view:r,...t}=this.props;return o.createElement(a.Button,{type:"button",fillMode:"flat",...t},this.props.children)}}exports.CalendarHeaderTitle=s;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import { Button as r } from "@progress/kendo-react-buttons";
10
+ import * as e from "react";
11
+ class s extends e.PureComponent {
12
+ /**
13
+ * @return
14
+ * Returns a `<span />` element with the [`value`]({% slug api_dateinputs_calendarheadertitleprops %}#toc-value) of the title as a child.
15
+ */
16
+ render() {
17
+ const { view: n, ...t } = this.props;
18
+ return /* @__PURE__ */ e.createElement(r, { type: "button", fillMode: "flat", ...t }, this.props.children);
19
+ }
20
+ }
21
+ export {
22
+ s as CalendarHeaderTitle
23
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),s=require("@progress/kendo-react-common");function i(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const r=i(c);class l extends r.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:a}=this.props;e&&e.call(void 0,a,t)}}render(){const{isRangeStart:t,value:e,text:a,...o}=this.props;return r.createElement("li",{...o,onClick:this.handleClick},r.createElement("span",{className:s.classNames({"k-calendar-navigation-marker":t})},this.props.children))}}exports.CalendarNavigationItem=l;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as a from "react";
10
+ import { classNames as n } from "@progress/kendo-react-common";
11
+ class o extends a.Component {
12
+ constructor() {
13
+ super(...arguments), this.handleClick = (e) => {
14
+ const { onClick: t, value: r } = this.props;
15
+ t && t.call(void 0, r, e);
16
+ };
17
+ }
18
+ /**
19
+ * @return
20
+ * Returns a `<li />` element with a `<span />` inside. The text inside represents the [`value`]({% slug api_dateinputs_calendarnavigationitemprops %}#toc-value) of the `navigationItem`.
21
+ */
22
+ render() {
23
+ const { isRangeStart: e, value: t, text: r, ...s } = this.props;
24
+ return /* @__PURE__ */ a.createElement("li", { ...s, onClick: this.handleClick }, /* @__PURE__ */ a.createElement("span", { className: n({ "k-calendar-navigation-marker": e }) }, this.props.children));
25
+ }
26
+ }
27
+ export {
28
+ o as CalendarNavigationItem
29
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
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;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
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
+ */
16
+ 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
+ }
20
+ }
21
+ export {
22
+ o as CalendarWeekCell
23
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),n=require("prop-types"),u=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),d=require("./CalendarHeaderTitle.js"),p=require("../../utils.js");function m(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const i=m(h),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=o.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:o.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},l,i.createElement("span",{className:"k-spacer"}),i.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};r.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number},r.defaultProps={rangeLength:1,min:p.MIN_DATE,max:p.MAX_DATE};let c=r;u.registerForLocalization(c);exports.Header=c;