@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,91 @@
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 { isEqual as c } from "@progress/kendo-date-math";
10
+ import { MIDNIGHT_DATE as p } from "../../utils.mjs";
11
+ import { setSeconds as r, range as x } from "../utils.mjs";
12
+ const m = 60, l = (n) => (t) => t % n, g = l(m), S = (n, t) => (s) => g(n + s * t), a = (n, t) => g(m + n - t), u = (n) => (t, s) => !s || t.getMinutes() === s.getMinutes() && t.getHours() === s.getHours() ? t : r(t, n), I = u(0), L = u(m - 1);
13
+ class D {
14
+ constructor(t) {
15
+ this.intl = t, this.toListItem = null, this.min = null, this.max = null, this.step = 0, this.insertUndividedMax = !1;
16
+ }
17
+ apply(t, s) {
18
+ return r(t, s.getSeconds());
19
+ }
20
+ configure(t) {
21
+ const {
22
+ insertUndividedMax: s = this.insertUndividedMax,
23
+ min: i = this.min,
24
+ max: o = this.max,
25
+ part: e,
26
+ step: h = this.step
27
+ } = t;
28
+ this.insertUndividedMax = s, this.toListItem = (M) => {
29
+ const d = r(p, M);
30
+ return {
31
+ text: this.intl.formatDate(d, e.pattern),
32
+ value: d
33
+ };
34
+ }, this.min = i, this.max = o, this.step = h;
35
+ }
36
+ data(t) {
37
+ const [s] = this.range(t), i = S(s, this.step), o = (h) => this.toListItem && this.toListItem(i(h)), e = x(0, this.countFromMin(t)).map(o);
38
+ return this.addLast(e), t && this.addMissing(e, t), e;
39
+ }
40
+ isRangeChanged(t, s) {
41
+ return this.min !== null && this.max !== null && (!c(this.min, t) || !c(this.max, s));
42
+ }
43
+ limitRange(t, s, i) {
44
+ return [I(t, i), L(s, i)];
45
+ }
46
+ total(t) {
47
+ const s = this.insertUndividedMax && this.isLastMissing(t) ? 1 : 0, i = this.isMissing(t) ? 1 : 0;
48
+ return this.countFromMin(t) + i + s;
49
+ }
50
+ selectedIndex(t) {
51
+ return Math.ceil(this.divideByStep(t));
52
+ }
53
+ valueInList(t) {
54
+ return t ? this.insertUndividedMax && this.lastSecond(t) === t.getSeconds() || !this.isMissing(t) : !0;
55
+ }
56
+ divideByStep(t) {
57
+ return a(t.getSeconds(), this.min.getSeconds()) / this.step;
58
+ }
59
+ addLast(t, s) {
60
+ return this.insertUndividedMax && this.isLastMissing(s) && this.toListItem && t.push(this.toListItem(this.lastSecond(s))), t;
61
+ }
62
+ addMissing(t, s) {
63
+ if (this.valueInList(s))
64
+ return t;
65
+ if (this.toListItem) {
66
+ const i = this.toListItem(s.getSeconds());
67
+ t.splice(this.selectedIndex(s), 0, i);
68
+ }
69
+ return t;
70
+ }
71
+ countFromMin(t) {
72
+ const [s, i] = this.range(t);
73
+ return Math.floor(a(i, s) / this.step) + 1;
74
+ }
75
+ isMissing(t) {
76
+ return t ? this.selectedIndex(t) !== this.divideByStep(t) : !1;
77
+ }
78
+ isLastMissing(t) {
79
+ return this.max !== null && this.isMissing(r(this.max, this.lastSecond(t)));
80
+ }
81
+ lastSecond(t) {
82
+ return this.range(t)[1];
83
+ }
84
+ range(t) {
85
+ const [s, i] = this.limitRange(this.min, this.max, t);
86
+ return [s.getSeconds(), i.getSeconds()];
87
+ }
88
+ }
89
+ export {
90
+ D as SecondsService
91
+ };
@@ -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 i=require("@progress/kendo-date-math"),a=require("./models/TimePart.js"),o=require("../utils.js"),l=e=>(t,n)=>{const r=i.cloneDate(t);return r[e](n),r},g=[{type:a.TIME_PART.hour,getter:e=>e.getHours()},{type:a.TIME_PART.minute,getter:e=>e.getMinutes()},{type:a.TIME_PART.second,getter:e=>e.getSeconds()},{type:a.TIME_PART.millisecond,getter:e=>e.getMilliseconds()}],m=e=>(t,n)=>e(t),M=e=>(t,n)=>e(n),I=e=>e.reduce((t,n)=>(t[n.type]=n.type,t),{}),p=e=>t=>e[t.type]?M(t.getter):m(t.getter),D=e=>t=>e.map(p(I(t))),H=(e,t,n,r)=>s=>{const u=e(s),T=e(n);return r==="hour"?u-(u-T)%t:s.getTime()<=n.getTime()&&u!==0&&u<=T?Math.ceil(u/t)*t:u-u%t},f=e=>(t,n)=>e.map(r=>{const s=Math.floor(t[r.type]);return s?H(r.getter,s,n,r.type):r.getter}),V=D(g),y=f(g),d=e=>(t,n)=>(t.setHours(...e.map(r=>r(t,n))),t),_=e=>t=>{const n=i.cloneDate(t);return n.setHours(...e.map(r=>r(n))),n},h=l("setHours"),A=l("setMinutes"),E=l("setSeconds"),G=()=>new Date,R=(e,t,n=1)=>{const r=[];for(let s=e;s<t;s=s+n)r.push(s);return r},c=(e,t,n)=>({candidateValue:o.setTime(o.MIDNIGHT_DATE,e),maxValue:i.addDays(o.setTime(o.MIDNIGHT_DATE,n),t.getHours()<n.getHours()?0:1),minValue:o.setTime(o.MIDNIGHT_DATE,t)}),S=(e,t,n)=>{if(!e||!t||!n)return e;const{candidateValue:r,minValue:s,maxValue:u}=c(e,t,n);return r<s?o.setTime(e,t):r>u?o.setTime(e,n):e},N=(e,t,n)=>{if(!e||!t||!n)return!0;const{candidateValue:r,minValue:s,maxValue:u}=c(e,t,n);return s<=r&&r<=u},P=(e,t,n)=>{if(e===null)return!0;const{candidateValue:r,minValue:s,maxValue:u}=c(e,t,n);return s<=r&&r<=u},z=(e,t)=>{if(e===null||t===null)return!1;const n=o.setTime(o.MIDNIGHT_DATE,e),r=o.setTime(o.MIDNIGHT_DATE,t);return n.getTime()<r.getHours()},q=(e,t)=>{if(e===null||t===null)return!1;const n=o.setTime(o.MIDNIGHT_DATE,e);return o.setTime(o.MIDNIGHT_DATE,t).getTime()<n.getHours()};exports.generateGetters=V;exports.generateSnappers=y;exports.getNow=G;exports.isBiggerThanMax=q;exports.isInRange=P;exports.isInTimeRange=N;exports.isSmallerThanMin=z;exports.range=R;exports.setHours=h;exports.setMinutes=A;exports.setSeconds=E;exports.snapTime=_;exports.timeInRange=S;exports.valueMerger=d;
@@ -0,0 +1,91 @@
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 { cloneDate as g, addDays as f } from "@progress/kendo-date-math";
10
+ import { TIME_PART as l } from "./models/TimePart.mjs";
11
+ import { setTime as u, MIDNIGHT_DATE as c } from "../utils.mjs";
12
+ const a = (e) => (t, r) => {
13
+ const n = g(t);
14
+ return n[e](r), n;
15
+ }, p = [
16
+ { type: l.hour, getter: (e) => e.getHours() },
17
+ { type: l.minute, getter: (e) => e.getMinutes() },
18
+ { type: l.second, getter: (e) => e.getSeconds() },
19
+ { type: l.millisecond, getter: (e) => e.getMilliseconds() }
20
+ ], V = (e) => (t, r) => e(t), T = (e) => (t, r) => e(r), M = (e) => e.reduce((t, r) => (t[r.type] = r.type, t), {}), y = (e) => (t) => e[t.type] ? T(t.getter) : V(t.getter), H = (e) => (t) => e.map(y(M(t))), d = (e, t, r, n) => (s) => {
21
+ const o = e(s), m = e(r);
22
+ return n === "hour" ? o - (o - m) % t : s.getTime() <= r.getTime() && o !== 0 && o <= m ? Math.ceil(o / t) * t : o - o % t;
23
+ }, h = (e) => (t, r) => e.map((n) => {
24
+ const s = Math.floor(t[n.type]);
25
+ return s ? d(n.getter, s, r, n.type) : n.getter;
26
+ }), S = H(p), R = h(p), _ = (e) => (t, r) => (t.setHours(...e.map((n) => n(t, r))), t), x = (e) => (t) => {
27
+ const r = g(t);
28
+ return r.setHours(...e.map((n) => n(r))), r;
29
+ }, G = a("setHours"), w = a("setMinutes"), A = a("setSeconds"), B = () => /* @__PURE__ */ new Date(), E = (e, t, r = 1) => {
30
+ const n = [];
31
+ for (let s = e; s < t; s = s + r)
32
+ n.push(s);
33
+ return n;
34
+ }, i = (e, t, r) => ({
35
+ candidateValue: u(c, e),
36
+ maxValue: f(u(c, r), t.getHours() < r.getHours() ? 0 : 1),
37
+ minValue: u(c, t)
38
+ }), F = (e, t, r) => {
39
+ if (!e || !t || !r)
40
+ return e;
41
+ const {
42
+ candidateValue: n,
43
+ minValue: s,
44
+ maxValue: o
45
+ } = i(e, t, r);
46
+ return n < s ? u(e, t) : n > o ? u(e, r) : e;
47
+ }, N = (e, t, r) => {
48
+ if (!e || !t || !r)
49
+ return !0;
50
+ const {
51
+ candidateValue: n,
52
+ minValue: s,
53
+ maxValue: o
54
+ } = i(e, t, r);
55
+ return s <= n && n <= o;
56
+ }, P = (e, t, r) => {
57
+ if (e === null)
58
+ return !0;
59
+ const {
60
+ candidateValue: n,
61
+ minValue: s,
62
+ maxValue: o
63
+ } = i(e, t, r);
64
+ return s <= n && n <= o;
65
+ }, v = (e, t) => {
66
+ if (e === null || t === null)
67
+ return !1;
68
+ const r = u(c, e), n = u(c, t);
69
+ return r.getTime() < n.getHours();
70
+ }, O = (e, t) => {
71
+ if (e === null || t === null)
72
+ return !1;
73
+ const r = u(c, e);
74
+ return u(c, t).getTime() < r.getHours();
75
+ };
76
+ export {
77
+ S as generateGetters,
78
+ R as generateSnappers,
79
+ B as getNow,
80
+ O as isBiggerThanMax,
81
+ P as isInRange,
82
+ N as isInTimeRange,
83
+ v as isSmallerThanMin,
84
+ E as range,
85
+ G as setHours,
86
+ w as setMinutes,
87
+ A as setSeconds,
88
+ x as snapTime,
89
+ F as timeInRange,
90
+ _ as valueMerger
91
+ };
package/utils.js ADDED
@@ -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 l=require("@progress/kendo-date-math"),y=require("./calendar/models/SelectionRange.js");function S(t){const e=(r,o,s,...u)=>o[s]===null?null:(r?t.isRequired:t)(o,s,...u),n=e.bind(null,!1);return n.isRequired=e.bind(null,!0),n}const w=(t,e,n)=>e===void 0||n===void 0||e<=t&&t<=n?t:t<e?e:n,C=new Date(1980,0,1),F=new Date(1900,0,1),k=new Date(2099,11,31),W=new Date(1980,0,1),q=new Date(1980,0,1,23,59,59),H=(t,e)=>{const n=l.cloneDate(t);return n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n},L=()=>l.getDate(new Date),X=(t,e,n)=>!t||!(e&&e>t||n&&n<t),G=(t,e,n)=>t===null||!(e&&l.getDate(e)>l.getDate(t)||n&&l.getDate(n)<l.getDate(t)),O=(t,e)=>{const{start:n,end:r}=e||y.EMPTY_SELECTIONRANGE;return!n||!r?!1:n<t&&t<r},j=(t,e,n=1)=>{const r=[];for(let o=t;o<e;o=o+n)r.push(o);return r},P=(t,e,n)=>e.getTime()<=t.getTime()&&t.getTime()<=n.getTime(),Y=(t,e)=>t.slice(e).concat(t.slice(0,e)),z=(t,e,n)=>t&&(e&&t<e?l.cloneDate(e):n&&t>n?l.cloneDate(n):t),B=t=>(e,n="",r={})=>{const o=document.createElement(t);return o.className=n,Object.keys(r).map(s=>o.style[s]=r[s]),typeof e=="string"?o.innerHTML=e||"":(e||[]).forEach(s=>s&&o.appendChild(s)),o};function J(t,e,n={}){let r,o;n.maxWait;let s,u,a;const f=window;let v=!1,R=!1;const I=!e&&e!==0&&typeof f.requestAnimationFrame=="function";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;function E(i){const c=r,T=o;return r=o=void 0,s=t.apply(T,c),s}function m(i,c){return I?(f.cancelAnimationFrame(u),f.requestAnimationFrame(i)):setTimeout(i,c)}function p(i){if(I)return f.cancelAnimationFrame(i);clearTimeout(i)}function b(i){return u=m(D,e),v?E():s}function d(i){const c=i-a;return e-c}function M(i){const c=i-a;return a===void 0||c>=e||c<0||R}function D(){const i=Date.now();if(M(i))return A();u=m(D,d(i))}function A(i){return u=void 0,r?E():(r=o=void 0,s)}function h(){u!==void 0&&p(u),r=a=o=u=void 0}function N(){return u===void 0?s:A()}function _(){return u!==void 0}function g(...i){const c=Date.now(),T=M(c);return r=i,o=this,a=c,T&&u===void 0?b():(u===void 0&&(u=m(D,e)),s)}return g.cancel=h,g.flush=N,g.pending=_,g}exports.MAX_DATE=k;exports.MAX_TIME=q;exports.MIDNIGHT_DATE=C;exports.MIN_DATE=F;exports.MIN_TIME=W;exports.dateInRange=z;exports.debounce=J;exports.domContainerFactory=B;exports.getToday=L;exports.intersects=P;exports.isInDateRange=G;exports.isInRange=X;exports.isInSelectionRange=O;exports.nullable=S;exports.range=j;exports.setTime=H;exports.shiftWeekNames=Y;exports.viewInRange=w;
package/utils.mjs ADDED
@@ -0,0 +1,111 @@
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 { getDate as f, cloneDate as v } from "@progress/kendo-date-math";
10
+ import { EMPTY_SELECTIONRANGE as F } from "./calendar/models/SelectionRange.mjs";
11
+ function W(t) {
12
+ const e = (r, o, s, ...u) => o[s] === null ? null : (r ? t.isRequired : t)(o, s, ...u), n = e.bind(null, !1);
13
+ return n.isRequired = e.bind(null, !0), n;
14
+ }
15
+ const d = (t, e, n) => e === void 0 || n === void 0 || e <= t && t <= n ? t : t < e ? e : n, k = new Date(1980, 0, 1), H = new Date(1900, 0, 1), L = new Date(2099, 11, 31), q = new Date(1980, 0, 1), G = new Date(1980, 0, 1, 23, 59, 59), O = (t, e) => {
16
+ const n = v(t);
17
+ return n.setHours(
18
+ e.getHours(),
19
+ e.getMinutes(),
20
+ e.getSeconds(),
21
+ e.getMilliseconds()
22
+ ), n;
23
+ }, X = () => f(/* @__PURE__ */ new Date()), j = (t, e, n) => !t || !(e && e > t || n && n < t), P = (t, e, n) => t === null || !(e && f(e) > f(t) || n && f(n) < f(t)), Y = (t, e) => {
24
+ const { start: n, end: r } = e || F;
25
+ return !n || !r ? !1 : n < t && t < r;
26
+ }, z = (t, e, n = 1) => {
27
+ const r = [];
28
+ for (let o = t; o < e; o = o + n)
29
+ r.push(o);
30
+ return r;
31
+ }, B = (t, e, n) => e.getTime() <= t.getTime() && t.getTime() <= n.getTime(), J = (t, e) => t.slice(e).concat(t.slice(0, e)), K = (t, e, n) => t && (e && t < e ? v(e) : n && t > n ? v(n) : t), Q = (t) => (e, n = "", r = {}) => {
32
+ const o = document.createElement(t);
33
+ return o.className = n, Object.keys(r).map((s) => o.style[s] = r[s]), typeof e == "string" ? o.innerHTML = e || "" : (e || []).forEach((s) => s && o.appendChild(s)), o;
34
+ };
35
+ function U(t, e, n = {}) {
36
+ let r, o;
37
+ n.maxWait;
38
+ let s, u, l;
39
+ const g = window;
40
+ let M = !1, h = !1;
41
+ const D = !e && e !== 0 && typeof g.requestAnimationFrame == "function";
42
+ if (typeof t != "function")
43
+ throw new TypeError("Expected a function");
44
+ e = +e || 0;
45
+ function I(i) {
46
+ const c = r, m = o;
47
+ return r = o = void 0, s = t.apply(m, c), s;
48
+ }
49
+ function T(i, c) {
50
+ return D ? (g.cancelAnimationFrame(u), g.requestAnimationFrame(i)) : setTimeout(i, c);
51
+ }
52
+ function R(i) {
53
+ if (D)
54
+ return g.cancelAnimationFrame(i);
55
+ clearTimeout(i);
56
+ }
57
+ function b(i) {
58
+ return u = T(E, e), M ? I() : s;
59
+ }
60
+ function N(i) {
61
+ const c = i - l;
62
+ return e - c;
63
+ }
64
+ function p(i) {
65
+ const c = i - l;
66
+ return l === void 0 || c >= e || c < 0 || h;
67
+ }
68
+ function E() {
69
+ const i = Date.now();
70
+ if (p(i))
71
+ return A();
72
+ u = T(E, N(i));
73
+ }
74
+ function A(i) {
75
+ return u = void 0, r ? I() : (r = o = void 0, s);
76
+ }
77
+ function w() {
78
+ u !== void 0 && R(u), r = l = o = u = void 0;
79
+ }
80
+ function y() {
81
+ return u === void 0 ? s : A();
82
+ }
83
+ function C() {
84
+ return u !== void 0;
85
+ }
86
+ function a(...i) {
87
+ const c = Date.now(), m = p(c);
88
+ return r = i, o = this, l = c, m && u === void 0 ? b() : (u === void 0 && (u = T(E, e)), s);
89
+ }
90
+ return a.cancel = w, a.flush = y, a.pending = C, a;
91
+ }
92
+ export {
93
+ L as MAX_DATE,
94
+ G as MAX_TIME,
95
+ k as MIDNIGHT_DATE,
96
+ H as MIN_DATE,
97
+ q as MIN_TIME,
98
+ K as dateInRange,
99
+ U as debounce,
100
+ Q as domContainerFactory,
101
+ X as getToday,
102
+ B as intersects,
103
+ P as isInDateRange,
104
+ j as isInRange,
105
+ Y as isInSelectionRange,
106
+ W as nullable,
107
+ z as range,
108
+ O as setTime,
109
+ J as shiftWeekNames,
110
+ d as viewInRange
111
+ };
@@ -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 b=require("react"),s=require("prop-types"),m=require("@progress/kendo-react-common"),w=require("./services/RowHeightService.js"),H=require("./services/ScrollerService.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const h=P(b),T=(r,e,t)=>Math.min(Math.abs(e-r),t),O=17,A=10,x={1:r=>e=>e+r,0:r=>e=>e-r},I={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},C={1:r=>e=>e<r,0:r=>e=>e>r},c=class c extends h.Component{constructor(e){super(e),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const i=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const o=this.scrollContainer[i];this.restrictScroll&&i==="scrollTop"&&(!Number.isInteger(o)||!Number.isInteger(t))&&Math.abs(o-t)<A||(this.scrollContainer[i]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const i=this.rowHeightService.offset(t),o=this.getContainerScrollDirection(i);let{start:n,end:l}=this.scrollRange(i,o);if(n===l)return;const f=this.scrollStep(n,l),a=x[o](f),u=I[o](l),g=C[o](a(l)),p=v=>{this.animationInProgress=!0;const S=a(v);this.scrollTo(u(S)),g(S)?this.cancelAnimation=window.requestAnimationFrame(()=>{p(S)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{p(n)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const o=this.props.scrollDuration||c.defaultProps.scrollDuration;return Math.abs(i-t)/(o/O)},this.scrollRange=(t,i)=>{const o=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${o}`,10))return{start:t,end:t};const n=this.containerMaxScroll(),l=i===0?1:-1,f=T(o,t,this.props.maxScrollDifference||0),a=Math.min(t,n);return{start:Math.min(Math.max(a+l*f,0),n),end:a}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const i=this.direction==="vertical"?t.itemHeight:t.itemWidth;i!==void 0&&(this.rowHeightService=new w.RowHeightService(t.total,i,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const i=t.target;this.scrollerService.onScroll({scrollLeft:i.scrollLeft,scrollTop:i.scrollTop,offsetHeight:i.offsetHeight,offsetWidth:i.offsetWidth});const o=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:n}=this.props,l={index:o,target:i,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),n&&n.call(void 0,l),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new H.ScrollerService(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(h.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:c.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:c.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,o=this.rowHeightService.offset(e),n=o+this.rowHeightService.height(e);return o>=t&&n<=i}isListScrolled(e){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(e):!1}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const e=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${e}px`}:{width:`${e}px`},i=m.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),o=m.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return h.createElement("div",{ref:n=>{this.scrollContainer=n},onScroll:this.handleScroll,className:i,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,h.createElement("div",{style:t,className:o}))}};c.propTypes={bottomOffset:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},c.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let d=c;exports.Virtualization=d;
@@ -0,0 +1,204 @@
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 o from "prop-types";
11
+ import { classNames as m } from "@progress/kendo-react-common";
12
+ import { RowHeightService as w } from "./services/RowHeightService.mjs";
13
+ import { ScrollerService as b } from "./services/ScrollerService.mjs";
14
+ const H = (s, i, t) => Math.min(Math.abs(i - s), t), P = 17, T = 10, x = {
15
+ 1: (s) => (i) => i + s,
16
+ 0: (s) => (i) => i - s
17
+ }, A = {
18
+ 1: (s) => (i) => Math.min(i, s),
19
+ 0: (s) => (i) => Math.max(i, s)
20
+ }, I = {
21
+ 1: (s) => (i) => i < s,
22
+ 0: (s) => (i) => i > s
23
+ }, c = class c extends a.Component {
24
+ constructor(i) {
25
+ super(i), this.rowHeightService = null, this.scrollContainer = null, this.lastDirection = null, this.lastTotal = 0, this.lastTake = 0, this.animationInProgress = !1, this.restrictScroll = !1, this.scrollTo = (t) => {
26
+ const e = this.direction === "vertical" ? "scrollTop" : "scrollLeft";
27
+ if (!this.scrollContainer)
28
+ return;
29
+ const r = this.scrollContainer[e];
30
+ this.restrictScroll && e === "scrollTop" && (!Number.isInteger(r) || !Number.isInteger(t)) && Math.abs(r - t) < T || (this.scrollContainer[e] = t);
31
+ }, this.scrollToIndex = (t) => {
32
+ this.animationInProgress = !1, this.rowHeightService && this.scrollTo(this.rowHeightService.offset(t));
33
+ }, this.animateToIndex = (t) => {
34
+ if (!this.rowHeightService || !window)
35
+ return;
36
+ window.cancelAnimationFrame(this.cancelAnimation);
37
+ const e = this.rowHeightService.offset(t), r = this.getContainerScrollDirection(e);
38
+ let { start: n, end: l } = this.scrollRange(e, r);
39
+ if (n === l)
40
+ return;
41
+ const f = this.scrollStep(n, l), h = x[r](f), p = A[r](l), u = I[r](h(l)), d = (v) => {
42
+ this.animationInProgress = !0;
43
+ const S = h(v);
44
+ this.scrollTo(p(S)), u(S) ? this.cancelAnimation = window.requestAnimationFrame(() => {
45
+ d(S);
46
+ }) : this.animationInProgress = !1;
47
+ };
48
+ this.cancelAnimation = window.requestAnimationFrame(() => {
49
+ d(n);
50
+ });
51
+ }, this.scrollToBottom = () => {
52
+ this.rowHeightService && this.scrollTo(this.rowHeightService.totalHeight() + this.props.bottomOffset);
53
+ }, this.scrollStep = (t, e) => {
54
+ const r = this.props.scrollDuration || c.defaultProps.scrollDuration;
55
+ return Math.abs(e - t) / (r / P);
56
+ }, this.scrollRange = (t, e) => {
57
+ const r = this.containerScrollPosition;
58
+ if (parseInt(`${t}`, 10) === parseInt(`${r}`, 10))
59
+ return { start: t, end: t };
60
+ const n = this.containerMaxScroll(), l = e === 0 ? 1 : -1, f = H(r, t, this.props.maxScrollDifference || 0), h = Math.min(t, n);
61
+ return { start: Math.min(Math.max(h + l * f, 0), n), end: h };
62
+ }, this.containerMaxScroll = () => this.containerScrollSize - this.containerOffsetSize, this.getContainerScrollDirection = (t) => t < this.containerScrollPosition ? 0 : 1, this.initServices = (t = this.props) => {
63
+ const e = this.direction === "vertical" ? t.itemHeight : t.itemWidth;
64
+ e !== void 0 && (this.rowHeightService = new w(t.total, e, 0), this.scrollerService.create(
65
+ this.rowHeightService,
66
+ t.skip,
67
+ t.take,
68
+ t.total,
69
+ t.topOffset,
70
+ this.scrollOffsetSize,
71
+ this.direction
72
+ ));
73
+ }, this.getContainerProperty = (t) => this.scrollContainer ? this.scrollContainer[t] : 0, this.handleScroll = (t) => {
74
+ if (!this.scrollContainer || !this.rowHeightService)
75
+ return;
76
+ const e = t.target;
77
+ this.scrollerService.onScroll({
78
+ scrollLeft: e.scrollLeft,
79
+ scrollTop: e.scrollTop,
80
+ offsetHeight: e.offsetHeight,
81
+ offsetWidth: e.offsetWidth
82
+ });
83
+ const r = this.rowHeightService.index(this.containerScrollPosition - this.props.topOffset), { onScrollAction: n } = this.props, l = {
84
+ index: r,
85
+ target: e,
86
+ scrollAction: this.scrollAction,
87
+ pageAction: this.pageAction,
88
+ animationInProgress: this.animationInProgress
89
+ };
90
+ this.props.onScroll && this.props.onScroll.call(void 0, t), n && n.call(void 0, l), this.scrollAction = void 0, this.pageAction = void 0;
91
+ }, this.handleScrollAction = (t) => {
92
+ this.scrollAction = t;
93
+ }, this.handlePageAction = (t) => {
94
+ this.pageAction = t;
95
+ }, this.scrollerService = new b(
96
+ this.handleScrollAction,
97
+ this.handlePageAction
98
+ ), this.restrictScroll = Number.parseFloat(a.version) > 17;
99
+ }
100
+ get element() {
101
+ return this.scrollContainer;
102
+ }
103
+ get containerOffsetSize() {
104
+ return this.getContainerProperty(this.direction === "vertical" ? "offsetHeight" : "offsetWidth");
105
+ }
106
+ get containerScrollSize() {
107
+ return this.getContainerProperty(this.direction === "vertical" ? "scrollHeight" : "scrollWidth");
108
+ }
109
+ get containerScrollPosition() {
110
+ return this.getContainerProperty(this.direction === "vertical" ? "scrollTop" : "scrollLeft");
111
+ }
112
+ get direction() {
113
+ return this.props.direction !== void 0 ? this.props.direction : c.defaultProps.direction;
114
+ }
115
+ get scrollOffsetSize() {
116
+ return this.props.scrollOffsetSize !== void 0 ? this.props.scrollOffsetSize : c.defaultProps.scrollOffsetSize;
117
+ }
118
+ activeIndex() {
119
+ return this.itemIndex(Math.ceil(this.containerScrollPosition));
120
+ }
121
+ itemIndex(i) {
122
+ return this.rowHeightService ? this.rowHeightService.index(i) : 0;
123
+ }
124
+ itemOffset(i) {
125
+ return this.rowHeightService ? this.rowHeightService.offset(i) : 0;
126
+ }
127
+ isIndexVisible(i) {
128
+ if (!this.rowHeightService)
129
+ return !1;
130
+ const t = this.containerScrollPosition, e = t + this.containerOffsetSize, r = this.rowHeightService.offset(i), n = r + this.rowHeightService.height(i);
131
+ return r >= t && n <= e;
132
+ }
133
+ isListScrolled(i) {
134
+ return this.rowHeightService ? this.containerScrollPosition !== this.rowHeightService.offset(i) : !1;
135
+ }
136
+ componentDidMount() {
137
+ const { onMount: i } = this.props;
138
+ i && i.call(void 0, this);
139
+ }
140
+ render() {
141
+ (this.lastTotal !== this.props.total || this.lastDirection !== this.direction || this.lastTake !== this.props.take) && (this.initServices(), this.lastTotal = this.props.total, this.lastDirection = this.direction, this.lastTake = this.props.take);
142
+ const i = `${(this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + this.props.bottomOffset}`, t = this.direction === "vertical" ? { height: `${i}px` } : { width: `${i}px` }, e = m(
143
+ "k-content k-scrollable",
144
+ {
145
+ "k-scrollable-horizontal": this.direction === "horizontal"
146
+ },
147
+ this.props.className
148
+ ), r = m(
149
+ "k-scrollable-placeholder",
150
+ {
151
+ "k-scrollable-horizontal-placeholder": this.direction === "horizontal"
152
+ }
153
+ );
154
+ return /* @__PURE__ */ a.createElement(
155
+ "div",
156
+ {
157
+ ref: (n) => {
158
+ this.scrollContainer = n;
159
+ },
160
+ onScroll: this.handleScroll,
161
+ className: e,
162
+ tabIndex: this.props.tabIndex,
163
+ role: this.props.role
164
+ },
165
+ this.props.children,
166
+ /* @__PURE__ */ a.createElement(
167
+ "div",
168
+ {
169
+ style: t,
170
+ className: r
171
+ }
172
+ )
173
+ );
174
+ }
175
+ };
176
+ c.propTypes = {
177
+ bottomOffset: o.number.isRequired,
178
+ className: o.string,
179
+ direction: o.oneOf(["horizontal", "vertical"]),
180
+ forceScroll: o.bool,
181
+ itemHeight: o.number,
182
+ itemWidth: o.number,
183
+ maxScrollDifference: o.number,
184
+ onScroll: o.func,
185
+ onScrollAction: o.func,
186
+ scrollDuration: o.number,
187
+ scrollOffsetSize: o.number,
188
+ skip: o.number.isRequired,
189
+ tabIndex: o.number,
190
+ take: o.number.isRequired,
191
+ topOffset: o.number.isRequired,
192
+ total: o.number.isRequired,
193
+ role: o.string
194
+ }, c.defaultProps = {
195
+ direction: "vertical",
196
+ forceScroll: !1,
197
+ scrollOffsetSize: 0,
198
+ maxScrollDifference: 100,
199
+ scrollDuration: 100
200
+ };
201
+ let g = c;
202
+ export {
203
+ g as Virtualization
204
+ };
@@ -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 o=(i,t,e)=>[...i.slice(0,t+1),...i.slice(t+1).map(s=>s+e)];class g{constructor(t=0,e,s){this.total=t,this.rowHeight=e,this.detailRowHeight=s,this.offsets=[],this.heights=[];let h=0;for(let f=0;f<t;f++)this.offsets.push(h),h+=e,this.heights.push(e)}height(t){return this.heights[t]}expandDetail(t){this.height(t)===this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight)}collapseDetail(t){this.height(t)>this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight*-1)}index(t){for(let e=0;e<this.offsets.length;e++){if(t===this.offsets[e])return e;if(t<this.offsets[e])return e-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){return this.heights.reduce((t,e)=>t+e,0)}updateRowHeight(t,e){this.heights[t]+=e,this.offsets=o(this.offsets,t,e)}}exports.RowHeightService=g;
@@ -0,0 +1,50 @@
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 o = (i, t, s) => [
10
+ ...i.slice(0, t + 1),
11
+ ...i.slice(t + 1).map((e) => e + s)
12
+ ];
13
+ class g {
14
+ constructor(t = 0, s, e) {
15
+ this.total = t, this.rowHeight = s, this.detailRowHeight = e, this.offsets = [], this.heights = [];
16
+ let h = 0;
17
+ for (let f = 0; f < t; f++)
18
+ this.offsets.push(h), h += s, this.heights.push(s);
19
+ }
20
+ height(t) {
21
+ return this.heights[t];
22
+ }
23
+ expandDetail(t) {
24
+ this.height(t) === this.rowHeight && this.updateRowHeight(t, this.detailRowHeight);
25
+ }
26
+ collapseDetail(t) {
27
+ this.height(t) > this.rowHeight && this.updateRowHeight(t, this.detailRowHeight * -1);
28
+ }
29
+ index(t) {
30
+ for (let s = 0; s < this.offsets.length; s++) {
31
+ if (t === this.offsets[s])
32
+ return s;
33
+ if (t < this.offsets[s])
34
+ return s - 1;
35
+ }
36
+ return this.total - 1;
37
+ }
38
+ offset(t) {
39
+ return this.offsets[t];
40
+ }
41
+ totalHeight() {
42
+ return this.heights.reduce((t, s) => t + s, 0);
43
+ }
44
+ updateRowHeight(t, s) {
45
+ this.heights[t] += s, this.offsets = o(this.offsets, t, s);
46
+ }
47
+ }
48
+ export {
49
+ g as RowHeightService
50
+ };
@@ -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 l=e=>Math.max(e,0);class a{constructor(t){this.offset=t}}class n{constructor(t){this.skip=t}}class w{constructor(t,s){this.onScrollAction=t,this.onPageAction=s,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(t,s,r,f,i=0,d=0,h="vertical"){this.rowHeightService=t,this.firstLoaded=s,this.lastLoaded=s+r,this.take=r,this.total=f,this.lastScrollTop=0,this.topOffset=i,this.bottomOffset=d,this.direction=h;const o=this.rowsForHeight(i),c=l(s-o);this.onScrollAction(new a(this.rowOffset(c))),this.onPageAction(new n(c))}onScroll({scrollLeft:t,scrollTop:s,offsetHeight:r,offsetWidth:f}){const i=this.direction==="vertical"?s:t,d=this.direction==="vertical"?r:f;if(this.lastScrollTop===i||!this.rowHeightService)return;const h=this.lastScrollTop>=i;this.lastScrollTop=i;const o=this.rowHeightService.index(l(i-this.topOffset)),c=this.rowHeightService.index(l(i+d-this.bottomOffset));if(!h&&c>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=o,this.onScrollAction(new a(this.rowOffset(o))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new n(this.firstLoaded))),h&&o<=this.firstLoaded){const S=Math.floor(this.take*.3);this.firstLoaded=l(o-S),this.onScrollAction(new a(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new n(this.firstLoaded))}}rowOffset(t){return this.rowHeightService?this.rowHeightService.offset(t)+this.topOffset:0}rowsForHeight(t){return this.rowHeightService?Math.ceil(t/this.rowHeightService.height(0)):0}}exports.PageAction=n;exports.ScrollAction=a;exports.ScrollerService=w;
@@ -0,0 +1,52 @@
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 a = (e) => Math.max(e, 0);
10
+ class f {
11
+ constructor(t) {
12
+ this.offset = t;
13
+ }
14
+ }
15
+ class d {
16
+ constructor(t) {
17
+ this.skip = t;
18
+ }
19
+ }
20
+ class w {
21
+ constructor(t, s) {
22
+ this.onScrollAction = t, this.onPageAction = s, this.direction = "vertical", this.firstLoaded = 0, this.lastLoaded = 0, this.lastScrollTop = 0, this.take = 0, this.total = 0, this.rowHeightService = null, this.bottomOffset = 0, this.topOffset = 0;
23
+ }
24
+ create(t, s, h, l, i = 0, n = 0, r = "vertical") {
25
+ this.rowHeightService = t, this.firstLoaded = s, this.lastLoaded = s + h, this.take = h, this.total = l, this.lastScrollTop = 0, this.topOffset = i, this.bottomOffset = n, this.direction = r;
26
+ const o = this.rowsForHeight(i), c = a(s - o);
27
+ this.onScrollAction(new f(this.rowOffset(c))), this.onPageAction(new d(c));
28
+ }
29
+ onScroll({ scrollLeft: t, scrollTop: s, offsetHeight: h, offsetWidth: l }) {
30
+ const i = this.direction === "vertical" ? s : t, n = this.direction === "vertical" ? h : l;
31
+ if (this.lastScrollTop === i || !this.rowHeightService)
32
+ return;
33
+ const r = this.lastScrollTop >= i;
34
+ this.lastScrollTop = i;
35
+ const o = this.rowHeightService.index(a(i - this.topOffset)), c = this.rowHeightService.index(a(i + n - this.bottomOffset));
36
+ if (!r && c >= this.lastLoaded && this.lastLoaded < this.total && (this.firstLoaded = o, this.onScrollAction(new f(this.rowOffset(o))), this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total), this.onPageAction(new d(this.firstLoaded))), r && o <= this.firstLoaded) {
37
+ const S = Math.floor(this.take * 0.3);
38
+ this.firstLoaded = a(o - S), this.onScrollAction(new f(this.rowOffset(this.firstLoaded))), this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total), this.onPageAction(new d(this.firstLoaded));
39
+ }
40
+ }
41
+ rowOffset(t) {
42
+ return this.rowHeightService ? this.rowHeightService.offset(t) + this.topOffset : 0;
43
+ }
44
+ rowsForHeight(t) {
45
+ return this.rowHeightService ? Math.ceil(t / this.rowHeightService.height(0)) : 0;
46
+ }
47
+ }
48
+ export {
49
+ d as PageAction,
50
+ f as ScrollAction,
51
+ w as ScrollerService
52
+ };