@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.3.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 (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,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="multiviewcalendar.prevView",t="multiviewcalendar.nextView",a="dateinput.increment",c="dateinput.decrement",i="calendar.today",r="datepicker.toggleCalendar",n="daterangepicker.swapStartEnd",o="daterangepicker.start",l="daterangepicker.end",s="daterangepicker.separator",d="datetimepicker.toggleDateTimeSelector",g="timepicker.now",m="timepicker.selectNow",k="timepicker.cancel",p="timepicker.set",S="timepicker.toggleTimeSelector",w="timepicker.toggleClock",T="datetimepicker.date",u="datetimepicker.time",C="datetimepicker.cancel",v="datetimepicker.set",P="daterangepicker.cancel",V="daterangepicker.set",N={[i]:"TODAY",[g]:"NOW",[p]:"Set",[k]:"Cancel",[T]:"Date",[u]:"Time",[C]:"Cancel",[v]:"Set",[P]:"Cancel",[V]:"Set",[o]:"Start",[l]:"End",[s]:" ",[m]:"Select Now",[S]:"Toggle TimeSelector",[w]:"Toggle Clock",[a]:"Increase value",[c]:"Decrease value",[r]:"Toggle calendar",[e]:"Navigate to previous view",[t]:"Navigate to next view",[n]:"Swap start and end values",[d]:"Toggle date-time selector"};exports.date=T;exports.dateRangePickerCancel=P;exports.dateRangePickerSet=V;exports.dateTimePickerCancel=C;exports.dateTimePickerSet=v;exports.decreaseValue=c;exports.end=l;exports.increaseValue=a;exports.messages=N;exports.nextView=t;exports.now=g;exports.prevView=e;exports.selectNow=m;exports.separator=s;exports.start=o;exports.swapStartEnd=n;exports.time=u;exports.timePickerCancel=k;exports.timePickerSet=p;exports.today=i;exports.toggleCalendar=r;exports.toggleClock=w;exports.toggleDateTimeSelector=d;exports.toggleTimeSelector=S;
@@ -0,0 +1,59 @@
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
+ const e = "multiviewcalendar.prevView", t = "multiviewcalendar.nextView", a = "dateinput.increment", c = "dateinput.decrement", n = "calendar.today", i = "datepicker.toggleCalendar", r = "daterangepicker.swapStartEnd", o = "daterangepicker.start", l = "daterangepicker.end", s = "daterangepicker.separator", d = "datetimepicker.toggleDateTimeSelector", g = "timepicker.now", m = "timepicker.selectNow", p = "timepicker.cancel", k = "timepicker.set", w = "timepicker.toggleTimeSelector", S = "timepicker.toggleClock", T = "datetimepicker.date", v = "datetimepicker.time", u = "datetimepicker.cancel", C = "datetimepicker.set", N = "daterangepicker.cancel", P = "daterangepicker.set", V = {
10
+ [n]: "TODAY",
11
+ [g]: "NOW",
12
+ [k]: "Set",
13
+ [p]: "Cancel",
14
+ [T]: "Date",
15
+ [v]: "Time",
16
+ [u]: "Cancel",
17
+ [C]: "Set",
18
+ [N]: "Cancel",
19
+ [P]: "Set",
20
+ [o]: "Start",
21
+ [l]: "End",
22
+ [s]: " ",
23
+ [m]: "Select Now",
24
+ [w]: "Toggle TimeSelector",
25
+ [S]: "Toggle Clock",
26
+ [a]: "Increase value",
27
+ [c]: "Decrease value",
28
+ [i]: "Toggle calendar",
29
+ [e]: "Navigate to previous view",
30
+ [t]: "Navigate to next view",
31
+ [r]: "Swap start and end values",
32
+ [d]: "Toggle date-time selector"
33
+ };
34
+ export {
35
+ T as date,
36
+ N as dateRangePickerCancel,
37
+ P as dateRangePickerSet,
38
+ u as dateTimePickerCancel,
39
+ C as dateTimePickerSet,
40
+ c as decreaseValue,
41
+ l as end,
42
+ a as increaseValue,
43
+ V as messages,
44
+ t as nextView,
45
+ g as now,
46
+ e as prevView,
47
+ m as selectNow,
48
+ s as separator,
49
+ o as start,
50
+ r as swapStartEnd,
51
+ v as time,
52
+ p as timePickerCancel,
53
+ k as timePickerSet,
54
+ n as today,
55
+ i as toggleCalendar,
56
+ S as toggleClock,
57
+ d as toggleDateTimeSelector,
58
+ w as toggleTimeSelector
59
+ };
@@ -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={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"};exports.packageMetadata=e;
@@ -0,0 +1,19 @@
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
+ const e = {
10
+ name: "@progress/kendo-react-dateinputs",
11
+ productName: "KendoReact",
12
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
+ publishDate: 1709715306,
14
+ version: "",
15
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
16
+ };
17
+ export {
18
+ e as packageMetadata
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-dateinputs",
3
- "version": "7.2.4-develop.3",
3
+ "version": "7.3.0-develop.1",
4
4
  "description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -24,12 +24,12 @@
24
24
  "peerDependencies": {
25
25
  "@progress/kendo-date-math": "^1.4.0",
26
26
  "@progress/kendo-licensing": "^1.3.4",
27
- "@progress/kendo-react-buttons": "7.2.4-develop.3",
28
- "@progress/kendo-react-common": "7.2.4-develop.3",
29
- "@progress/kendo-react-intl": "7.2.4-develop.3",
30
- "@progress/kendo-react-labels": "7.2.4-develop.3",
31
- "@progress/kendo-react-layout": "7.2.4-develop.3",
32
- "@progress/kendo-react-popup": "7.2.4-develop.3",
27
+ "@progress/kendo-react-buttons": "7.3.0-develop.1",
28
+ "@progress/kendo-react-common": "7.3.0-develop.1",
29
+ "@progress/kendo-react-intl": "7.3.0-develop.1",
30
+ "@progress/kendo-react-labels": "7.3.0-develop.1",
31
+ "@progress/kendo-react-layout": "7.3.0-develop.1",
32
+ "@progress/kendo-react-popup": "7.3.0-develop.1",
33
33
  "@progress/kendo-svg-icons": "^2.1.0",
34
34
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
35
35
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
@@ -0,0 +1,14 @@
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 T=require("react"),c=require("prop-types"),v=require("@progress/kendo-date-math"),r=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-intl"),b=require("../virtualization/Virtualization.js"),u=require("./models/TimePart.js"),x=require("./services/DayPeriodService.js"),y=require("./services/DOMService.js"),I=require("./services/HoursService.js"),M=require("./services/MinutesService.js"),H=require("./services/SecondsService.js"),d=require("../utils.js");function D(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(s,t,e.get?e:{enumerable:!0,get:()=>n[t]})}}return s.default=n,Object.freeze(s)}const l=D(T),E=2,g=.05,P=100,R=0,O=9,_={[r.Keys.end]:(n,s)=>n[n.length-1],[r.Keys.home]:(n,s)=>n[0],[r.Keys.up]:(n,s)=>n[s-1],[r.Keys.down]:(n,s)=>n[s+1]},m={[u.TIME_PART.dayperiod]:x.DayPeriodService,[u.TIME_PART.hour]:I.HoursService,[u.TIME_PART.minute]:M.MinutesService,[u.TIME_PART.second]:H.SecondsService},a=class a extends l.Component{constructor(s){super(s),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=t=>{Promise.resolve().then(()=>{this.element&&this.element.focus(t)})},this.itemOffset=t=>{if(!this.virtualization||!this.service)return-1;const e=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),o=this.virtualization.itemOffset(i),h=Math.abs(Math.ceil(t)-o);if(e===i&&h<E)return o;const f=e>i;return f&&h>=this.bottomThreshold||!f&&h>this.topThreshold?this.virtualization.itemOffset(i+1):o},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=O,this.bottomOffset+=O*2),this.topThreshold=this.itemHeight*g,this.bottomThreshold=this.itemHeight*(1-g))},this.configureServices=({min:t,max:e,value:i}=this.props)=>{if(this.service){const[o,h]=this.service.limitRange(t||this.min,e||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:o,max:h}))}},this.serviceSettings=t=>{const e={boundRange:this.props.boundRange||a.defaultProps.boundRange,insertUndividedMax:!1,min:v.cloneDate(this.min),max:v.cloneDate(this.max),part:this.props.part,step:this.step},i=Object.assign({},e,t);return i.boundRange=i.part.type!=="hour"||this.props.boundRange||a.defaultProps.boundRange,i},this.handleScrollAction=({target:t,animationInProgress:e})=>{if(!(!this.virtualization||!this.service)&&t&&!e){this.animateToIndex=!1;const i=this.virtualization.itemIndex(this.itemOffset(t.scrollTop)),o=this.service.data(this.props.value)[i];this.handleChange(o)}},this.handleFocus=t=>{const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleBlur=t=>{const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleMouseOver=()=>{if(!this._element)return;const t=r.getActiveElement(document);document&&t!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=t=>{if(!this.service)return;const{keyCode:e}=t;(e===r.Keys.down||e===r.Keys.up||e===r.Keys.end||e===r.Keys.home)&&t.preventDefault();const o=(_[t.keyCode]||r.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));o&&this.handleChange(o)},this.handleChange=d.debounce(t=>{if(!this.service)return;const e=this.service.apply(this.props.value,t.value);if(this.props.value.getTime()===e.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,e)},P),this.dom=new y.DOMService}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||a.defaultProps.min}get max(){return this.props.max||a.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):a.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const s=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](s),this.animateToIndex=!0}render(){if(!this.props.part.type||!m[this.props.part.type])return;this.calculateHeights(),this.intl=S.provideIntlService(this),this.service=new m[this.props.part.type](this.intl),this.configureServices();const s=this.service.data(this.props.value),t="translateY("+this.topOffset+"px)",e=this.service.total(this.props.value),i=l.createElement("ul",{style:{transform:t,msTransform:t},className:"k-reset"},s.map((o,h)=>l.createElement("li",{key:h,className:"k-item",onClick:()=>{this.handleChange(o)}},l.createElement("span",null,o.text))));return l.createElement("div",{className:"k-time-list",id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:o=>{this._element=o},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?l.createElement(b.Virtualization,{bottomOffset:this.bottomOffset,children:i,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:o=>{this.virtualization=o},role:"presentation",skip:R,tabIndex:-1,take:e,topOffset:this.topOffset,total:e}):l.createElement("div",{className:"k-time-container"},i))}};a.propTypes={id:c.number,max:c.instanceOf(Date),min:c.instanceOf(Date),part:function(s,t,e){const i=s[t];if(!i||!m[i.type])throw new Error(`
9
+ Invalid prop '${t}' supplied to ${e}.
10
+ Supported part types are hour|minute|second|dayperiod.
11
+ `);return null},step:function(s,t,e){const i=s[t];if(i!==void 0&&i<=0)throw new Error(`
12
+ Invalid prop '${t}' supplied to ${e}.
13
+ ${t} cannot be less than 1.
14
+ `);return null},value:c.instanceOf(Date),smoothScroll:c.bool,show:c.bool},a.defaultProps={boundRange:!1,max:d.MAX_TIME,min:d.MIDNIGHT_DATE,step:1,smoothScroll:!0};let p=a;S.registerForIntl(p);exports.TimeList=p;
@@ -0,0 +1,230 @@
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 p from "prop-types";
11
+ import { cloneDate as f } from "@progress/kendo-date-math";
12
+ import { Keys as h, getActiveElement as x, noop as O } from "@progress/kendo-react-common";
13
+ import { provideIntlService as S, registerForIntl as T } from "@progress/kendo-react-intl";
14
+ import { Virtualization as I } from "../virtualization/Virtualization.mjs";
15
+ import { TIME_PART as c } from "./models/TimePart.mjs";
16
+ import { DayPeriodService as b } from "./services/DayPeriodService.mjs";
17
+ import { DOMService as H } from "./services/DOMService.mjs";
18
+ import { HoursService as y } from "./services/HoursService.mjs";
19
+ import { MinutesService as E } from "./services/MinutesService.mjs";
20
+ import { SecondsService as M } from "./services/SecondsService.mjs";
21
+ import { debounce as D, MAX_TIME as w, MIDNIGHT_DATE as R } from "../utils.mjs";
22
+ const C = 2, v = 0.05, P = 100, k = 0, g = 9, z = {
23
+ [h.end]: (r, o) => r[r.length - 1],
24
+ [h.home]: (r, o) => r[0],
25
+ [h.up]: (r, o) => r[o - 1],
26
+ [h.down]: (r, o) => r[o + 1]
27
+ }, m = {
28
+ [c.dayperiod]: b,
29
+ [c.hour]: y,
30
+ [c.minute]: E,
31
+ [c.second]: M
32
+ }, n = class n extends l.Component {
33
+ constructor(o) {
34
+ super(o), this.intl = null, this._element = null, this.service = null, this.virtualization = null, this.topOffset = 0, this.bottomOffset = 0, this.itemHeight = 0, this.listHeight = 0, this.topThreshold = 0, this.bottomThreshold = 0, this.animateToIndex = !1, this.focus = (t) => {
35
+ Promise.resolve().then(() => {
36
+ this.element && this.element.focus(t);
37
+ });
38
+ }, this.itemOffset = (t) => {
39
+ if (!this.virtualization || !this.service)
40
+ return -1;
41
+ const e = this.service.selectedIndex(this.props.value), i = this.virtualization.activeIndex(), s = this.virtualization.itemOffset(i), a = Math.abs(Math.ceil(t) - s);
42
+ if (e === i && a < C)
43
+ return s;
44
+ const u = e > i;
45
+ return u && a >= this.bottomThreshold || !u && a > this.topThreshold ? this.virtualization.itemOffset(i + 1) : s;
46
+ }, this.calculateHeights = () => {
47
+ this.dom.didCalculate && (this.itemHeight = this.dom.itemHeight, this.listHeight = this.dom.timeListHeight, this.topOffset = (this.listHeight - this.itemHeight) / 2, this.bottomOffset = this.listHeight - this.itemHeight, this.props.mobileMode && (this.topOffset += g, this.bottomOffset += g * 2), this.topThreshold = this.itemHeight * v, this.bottomThreshold = this.itemHeight * (1 - v));
48
+ }, this.configureServices = ({ min: t, max: e, value: i } = this.props) => {
49
+ if (this.service) {
50
+ const [s, a] = this.service.limitRange(t || this.min, e || this.max, i || this.props.value);
51
+ this.service.configure(this.serviceSettings({ min: s, max: a }));
52
+ }
53
+ }, this.serviceSettings = (t) => {
54
+ const e = {
55
+ boundRange: this.props.boundRange || n.defaultProps.boundRange,
56
+ insertUndividedMax: !1,
57
+ min: f(this.min),
58
+ max: f(this.max),
59
+ part: this.props.part,
60
+ step: this.step
61
+ }, i = Object.assign({}, e, t);
62
+ return i.boundRange = i.part.type !== "hour" || this.props.boundRange || n.defaultProps.boundRange, i;
63
+ }, this.handleScrollAction = ({ target: t, animationInProgress: e }) => {
64
+ if (!(!this.virtualization || !this.service) && t && !e) {
65
+ this.animateToIndex = !1;
66
+ const i = this.virtualization.itemIndex(this.itemOffset(t.scrollTop)), s = this.service.data(this.props.value)[i];
67
+ this.handleChange(s);
68
+ }
69
+ }, this.handleFocus = (t) => {
70
+ const { onFocus: e } = this.props;
71
+ e && e.call(void 0, t);
72
+ }, this.handleBlur = (t) => {
73
+ const { onBlur: e } = this.props;
74
+ e && e.call(void 0, t);
75
+ }, this.handleMouseOver = () => {
76
+ if (!this._element)
77
+ return;
78
+ const t = x(document);
79
+ document && t !== this._element && this.props.show && this._element.focus({ preventScroll: !0 });
80
+ }, this.handleKeyDown = (t) => {
81
+ if (!this.service)
82
+ return;
83
+ const { keyCode: e } = t;
84
+ (e === h.down || e === h.up || e === h.end || e === h.home) && t.preventDefault();
85
+ const s = (z[t.keyCode] || O)(
86
+ this.service.data(this.props.value),
87
+ this.service.selectedIndex(this.props.value)
88
+ );
89
+ s && this.handleChange(s);
90
+ }, this.handleChange = D((t) => {
91
+ if (!this.service)
92
+ return;
93
+ const e = this.service.apply(this.props.value, t.value);
94
+ if (this.props.value.getTime() === e.getTime())
95
+ return;
96
+ const { onChange: i } = this.props;
97
+ i && i.call(void 0, e);
98
+ }, P), this.dom = new H();
99
+ }
100
+ get element() {
101
+ return this._element;
102
+ }
103
+ get animate() {
104
+ return !!(this.props.smoothScroll && this.animateToIndex);
105
+ }
106
+ get min() {
107
+ return this.props.min || n.defaultProps.min;
108
+ }
109
+ get max() {
110
+ return this.props.max || n.defaultProps.max;
111
+ }
112
+ get step() {
113
+ return this.props.step !== void 0 && this.props.step !== 0 ? Math.floor(this.props.step) : n.defaultProps.step;
114
+ }
115
+ /**
116
+ * @hidden
117
+ */
118
+ componentDidMount() {
119
+ Promise.resolve().then(() => {
120
+ this._element && (this.dom.calculateHeights(this._element), this.forceUpdate());
121
+ });
122
+ }
123
+ /**
124
+ * @hidden
125
+ */
126
+ componentDidUpdate() {
127
+ if (!this.virtualization || !this.service)
128
+ return;
129
+ const o = this.service.selectedIndex(this.props.value);
130
+ this.virtualization[this.animate ? "animateToIndex" : "scrollToIndex"](o), this.animateToIndex = !0;
131
+ }
132
+ /**
133
+ * @hidden
134
+ */
135
+ render() {
136
+ if (!this.props.part.type || !m[this.props.part.type])
137
+ return;
138
+ this.calculateHeights(), this.intl = S(this), this.service = new m[this.props.part.type](this.intl), this.configureServices();
139
+ const o = this.service.data(this.props.value), t = "translateY(" + this.topOffset + "px)", e = this.service.total(this.props.value), i = /* @__PURE__ */ l.createElement(
140
+ "ul",
141
+ {
142
+ style: { transform: t, msTransform: t },
143
+ className: "k-reset"
144
+ },
145
+ o.map((s, a) => /* @__PURE__ */ l.createElement(
146
+ "li",
147
+ {
148
+ key: a,
149
+ className: "k-item",
150
+ onClick: () => {
151
+ this.handleChange(s);
152
+ }
153
+ },
154
+ /* @__PURE__ */ l.createElement("span", null, s.text)
155
+ ))
156
+ );
157
+ return /* @__PURE__ */ l.createElement(
158
+ "div",
159
+ {
160
+ className: "k-time-list",
161
+ id: String(this.props.id || ""),
162
+ tabIndex: this.props.disabled ? -1 : 0,
163
+ ref: (s) => {
164
+ this._element = s;
165
+ },
166
+ onKeyDown: this.handleKeyDown,
167
+ onFocus: this.handleFocus,
168
+ onBlur: this.handleBlur,
169
+ onMouseOver: this.handleMouseOver
170
+ },
171
+ this.dom.didCalculate ? /* @__PURE__ */ l.createElement(
172
+ I,
173
+ {
174
+ bottomOffset: this.bottomOffset,
175
+ children: i,
176
+ className: "k-time-container",
177
+ itemHeight: this.itemHeight,
178
+ maxScrollDifference: this.listHeight,
179
+ onScrollAction: this.handleScrollAction,
180
+ ref: (s) => {
181
+ this.virtualization = s;
182
+ },
183
+ role: "presentation",
184
+ skip: k,
185
+ tabIndex: -1,
186
+ take: e,
187
+ topOffset: this.topOffset,
188
+ total: e
189
+ }
190
+ ) : /* @__PURE__ */ l.createElement("div", { className: "k-time-container" }, i)
191
+ );
192
+ }
193
+ };
194
+ n.propTypes = {
195
+ id: p.number,
196
+ max: p.instanceOf(Date),
197
+ min: p.instanceOf(Date),
198
+ part: function(o, t, e) {
199
+ const i = o[t];
200
+ if (!i || !m[i.type])
201
+ throw new Error(`
202
+ Invalid prop '${t}' supplied to ${e}.
203
+ Supported part types are hour|minute|second|dayperiod.
204
+ `);
205
+ return null;
206
+ },
207
+ step: function(o, t, e) {
208
+ const i = o[t];
209
+ if (i !== void 0 && i <= 0)
210
+ throw new Error(`
211
+ Invalid prop '${t}' supplied to ${e}.
212
+ ${t} cannot be less than 1.
213
+ `);
214
+ return null;
215
+ },
216
+ value: p.instanceOf(Date),
217
+ smoothScroll: p.bool,
218
+ show: p.bool
219
+ }, n.defaultProps = {
220
+ boundRange: !1,
221
+ max: w,
222
+ min: R,
223
+ step: 1,
224
+ smoothScroll: !0
225
+ };
226
+ let d = n;
227
+ T(d);
228
+ export {
229
+ d as TimeList
230
+ };
@@ -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 x=require("react"),e=require("prop-types"),R=require("@progress/kendo-date-math"),p=require("@progress/kendo-react-common"),v=require("@progress/kendo-react-intl"),m=require("../messages/index.js"),O=require("./TimeList.js"),w=require("../utils.js"),g=require("./models/TimePart.js"),u=require("./utils.js"),B=require("@progress/kendo-react-buttons");function D(c){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const s in c)if(s!=="default"){const t=Object.getOwnPropertyDescriptor(c,s);Object.defineProperty(n,s,t.get?t:{enumerable:!0,get:()=>c[s]})}}return n.default=c,Object.freeze(n)}const i=D(x),b=new RegExp(`${g.TIME_PART.hour}|${g.TIME_PART.minute}|${g.TIME_PART.second}|${g.TIME_PART.dayperiod}|literal`),a=class a extends i.Component{constructor(n){super(n),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(s,t)=>{Promise.resolve().then(()=>{t&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const o=this.timeLists[0];!t&&this.state.activeListIndex===-1&&!this.hasActiveButton()&&o&&o.element&&o.focus(s)})},this.timeFormatReducer=(s,t)=>s+t.pattern,this.timeFormatFilter=(s,t,o)=>{const r=t>=1&&o[t-1];return r&&r&&s.type==="literal"?b.test(r.type||""):b.test(s.type||"")},this.focusList=s=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(t=>s===1?t.next:t.prev).map(t=>t&&t.element&&t.element.focus({preventScroll:!0}))},this.listReducer=(s,t,o,r)=>s.length||t.props.id!==this.state.activeListIndex?s:[{next:r[o+1]||t,prev:r[o-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&u.isInTimeRange(u.getNow(),this.min,this.max),this.handleKeyDown=s=>{const{keyCode:t}=s;switch(t){case p.Keys.left:s.preventDefault(),this.focusList(0);return;case p.Keys.right:s.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=s=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:s})},this.handleChange=s=>{const{onChange:t}=this.props;t&&t.call(void 0,s)},this.snapTime=u.snapTime(u.generateSnappers(this.props.steps,this.props.min||a.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return u.timeInRange(this.snapTime(R.cloneDate(this.props.value||w.MIDNIGHT_DATE)),this.min,this.max)}get intl(){return v.provideIntlService(this)}get min(){return this.snapTime(this.props.min||a.defaultProps.min)}get max(){return this.snapTime(this.props.max||a.defaultProps.max)}get steps(){return this.props.steps||a.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:a.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:n}=this.props;n&&n.call(void 0,this.value)}render(){const{format:n,smoothScroll:s,onNowClick:t,className:o,disabled:r,mobileMode:T,show:I,onNowKeyDown:L}=this.props;this.snapTime=u.snapTime(u.generateSnappers(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(n||a.defaultProps.format).filter(this.timeFormatFilter);const N=p.classNames({"k-disabled":r,"k-time-part":T},o);this.timeLists=[];const y=v.provideLocalizationService(this),k=y.toLanguageString(m.selectNow,m.messages[m.selectNow]);return i.createElement("div",{className:N},i.createElement("div",{className:"k-time-header"},i.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&i.createElement(B.Button,{type:"button",ref:l=>{this._nowButton=l},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:k,onKeyDown:L,"aria-label":k,onClick:t,tabIndex:r?-1:0},y.toLanguageString(m.now,m.messages[m.now]))),i.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},i.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((l,h)=>l.type!=="literal"?i.createElement("div",{key:h,className:p.classNames("k-time-list-wrapper",{"k-focus":h===this.state.activeListIndex}),role:"presentation",tabIndex:-1},i.createElement("span",{className:"k-title",onMouseDown:f=>{f.preventDefault()}},this.intl.dateFieldName(l)),i.createElement(O.TimeList,{min:this.min,max:this.max,boundRange:this.boundRange,part:l,step:l.type?this.steps[l.type]:1,smoothScroll:s,ref:f=>{f&&this.timeLists.push(f)},id:h,onFocus:()=>{this.handleListFocus(h)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:r,show:I,mobileMode:T})):i.createElement("div",{key:h,className:"k-time-separator"},l.pattern))))}nextTick(n){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>n())}hasActiveButton(){const n=p.getActiveElement(document);return this._nowButton&&n===this._nowButton.element}hasSteps(){const n=Object.keys(this.steps);return n.length!==n.reduce((s,t)=>s+this.steps[t],0)}};a.propTypes={cancelButton:e.bool,disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),max:e.instanceOf(Date),min:e.instanceOf(Date),nowButton:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,value:e.instanceOf(Date),show:e.bool},a.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:w.MIN_TIME,max:w.MAX_TIME,steps:{},boundRange:!1};let d=a;v.registerForIntl(d);v.registerForLocalization(d);exports.TimePart=d;