@progress/kendo-react-dateinputs 9.3.1 → 9.4.0-develop.10
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.
- package/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +0 -1
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +12 -13
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +3 -4
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +2 -3
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +8 -9
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +0 -1
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +0 -1
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +0 -1
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +0 -1
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +0 -1
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +0 -1
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +0 -1
- package/calendar/models/CalendarViewEnum.js +1 -1
- package/calendar/models/CalendarViewEnum.mjs +0 -1
- package/calendar/models/NavigationAction.js +1 -1
- package/calendar/models/NavigationAction.mjs +0 -1
- package/calendar/models/SelectionRange.js +1 -1
- package/calendar/models/SelectionRange.mjs +0 -1
- package/calendar/services/BusViewService.js +1 -1
- package/calendar/services/BusViewService.mjs +0 -1
- package/calendar/services/CenturyViewService.js +1 -1
- package/calendar/services/CenturyViewService.mjs +0 -1
- package/calendar/services/DOMService.js +1 -1
- package/calendar/services/DOMService.mjs +0 -1
- package/calendar/services/DecadeViewService.js +1 -1
- package/calendar/services/DecadeViewService.mjs +0 -1
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +0 -1
- package/calendar/services/NavigationService.js +1 -1
- package/calendar/services/NavigationService.mjs +18 -19
- package/calendar/services/ScrollSyncService.js +1 -1
- package/calendar/services/ScrollSyncService.mjs +0 -1
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +5 -6
- package/calendar/services/YearViewService.js +1 -1
- package/calendar/services/YearViewService.mjs +0 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +7 -8
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +7 -8
- package/common/PickerWrap.js +1 -1
- package/common/PickerWrap.mjs +3 -4
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +69 -68
- package/dateinput/dateInputIntl.js +1 -1
- package/dateinput/dateInputIntl.mjs +3 -4
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +4 -5
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +131 -132
- package/datepicker/ToggleButton.js +1 -1
- package/datepicker/ToggleButton.mjs +3 -4
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +0 -1
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +0 -1
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +0 -1
- package/dist/cdn/js/kendo-react-dateinputs.js +8 -1
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +5 -6
- package/index.js +2 -1
- package/messages/index.js +1 -1
- package/messages/index.mjs +5 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +8 -8
- package/timepicker/TimeList.js +1 -1
- package/timepicker/TimeList.mjs +16 -17
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +0 -1
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +0 -1
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +0 -1
- package/timepicker/models/TimePart.js +1 -1
- package/timepicker/models/TimePart.mjs +2 -3
- package/timepicker/services/DOMService.js +1 -1
- package/timepicker/services/DOMService.mjs +0 -1
- package/timepicker/services/DayPeriodService.js +1 -1
- package/timepicker/services/DayPeriodService.mjs +3 -4
- package/timepicker/services/HoursService.js +1 -1
- package/timepicker/services/HoursService.mjs +3 -4
- package/timepicker/services/MinutesService.js +1 -1
- package/timepicker/services/MinutesService.mjs +5 -6
- package/timepicker/services/SecondsService.js +1 -1
- package/timepicker/services/SecondsService.mjs +0 -1
- package/timepicker/utils.js +1 -1
- package/timepicker/utils.mjs +0 -1
- package/utils.js +1 -1
- package/utils.mjs +18 -19
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +0 -1
- package/virtualization/services/ScrollerService.js +1 -1
- package/virtualization/services/ScrollerService.mjs +0 -1
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { isEqual as d, getDate as u } from "@progress/kendo-date-math";
|
|
10
9
|
import { MIDNIGHT_DATE as l } from "../../utils.mjs";
|
|
11
10
|
import { setHours as r, range as I } from "../utils.mjs";
|
|
12
|
-
const a = 24, f = (n) => (t) => t % n,
|
|
11
|
+
const a = 24, f = (n) => (t) => t % n, c = f(a), H = (n, t) => (i) => c(n + i * t), g = (n, t) => c(a + n - t), p = (n) => (t, i) => !i || u(t).getTime() === u(i).getTime() ? t : r(t, n), L = p(0), R = p(a - 1);
|
|
13
12
|
class B {
|
|
14
13
|
constructor(t) {
|
|
15
14
|
this.intl = t, this.boundRange = !1, this.insertUndividedMax = !1, this.min = null, this.max = null, this.step = 0, this.toListItem = null;
|
|
@@ -68,7 +67,7 @@ class B {
|
|
|
68
67
|
}
|
|
69
68
|
countFromMin(t) {
|
|
70
69
|
const [i, s] = this.range(t);
|
|
71
|
-
return Math.floor(
|
|
70
|
+
return Math.floor(g(s, i) / this.step) + 1;
|
|
72
71
|
}
|
|
73
72
|
isMissing(t) {
|
|
74
73
|
return t ? this.selectedIndex(t) !== this.divideByStep(t) : !1;
|
|
@@ -77,7 +76,7 @@ class B {
|
|
|
77
76
|
return this.max !== null && this.isMissing(r(this.max, this.lastHour(t)));
|
|
78
77
|
}
|
|
79
78
|
divideByStep(t) {
|
|
80
|
-
return
|
|
79
|
+
return g(t.getHours(), this.min.getHours()) / this.step;
|
|
81
80
|
}
|
|
82
81
|
lastHour(t) {
|
|
83
82
|
return this.range(t)[1];
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@progress/kendo-date-math"),l=require("../../utils.js"),r=require("../utils.js"),a=60,x=n=>t=>t%n,c=x(a),p=(n,t)=>i=>c(n+i*t),M=(n,t)=>c(a+n-t),d=n=>(t,i)=>!i||t.getHours()===i.getHours()?t:r.setMinutes(t,n),I=d(0),L=d(a-1);class f{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,i){return r.setMinutes(t,i.getMinutes())}configure(t){const{insertUndividedMax:i=this.insertUndividedMax,min:s=this.min,max:h=this.max,part:e,step:o=this.step}=t;this.insertUndividedMax=i,this.toListItem=g=>{const u=r.setMinutes(l.MIDNIGHT_DATE,g);return{text:this.intl.formatDate(u,e.pattern),value:u}},this.min=s,this.max=h,this.step=o}data(t){const[i]=this.range(t),s=p(i,this.step),h=o=>this.toListItem&&this.toListItem(s(o)),e=r.range(0,this.countFromMin(t)).map(h);return this.addLast(e),t&&this.addMissing(e,t),e}isRangeChanged(t,i){return this.min!==null&&this.max!==null&&(!m.isEqual(this.min,t)||!m.isEqual(this.max,i))}limitRange(t,i,s){return[I(t,s),L(i,s)]}total(t){const i=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+i}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastMinute(t)===t.getMinutes()||!this.isMissing(t):!0}addLast(t,i){return this.insertUndividedMax&&this.isLastMissing(i)&&this.toListItem&&t.push(this.toListItem(this.lastMinute(i))),t}addMissing(t,i){if(this.valueInList(i))return t;if(this.toListItem){const s=this.toListItem(i.getMinutes());t.splice(this.selectedIndex(i),0,s)}return t}countFromMin(t){const[i,s]=this.range(t);return Math.floor(M(s,i)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(r.setMinutes(this.max,this.lastMinute(t)))}divideByStep(t){return M(t.getMinutes(),this.min.getMinutes())/this.step}lastMinute(t){return this.range(t)[1]}range(t){const[i,s]=this.limitRange(this.min,this.max,t);return[i.getMinutes(),s.getMinutes()]}}exports.MinutesService=f;
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import { isEqual as u } from "@progress/kendo-date-math";
|
|
8
|
+
import { isEqual as d } from "@progress/kendo-date-math";
|
|
10
9
|
import { MIDNIGHT_DATE as p } from "../../utils.mjs";
|
|
11
10
|
import { setMinutes as r, range as x } from "../utils.mjs";
|
|
12
|
-
const m = 60, l = (n) => (t) => t % n, M = l(m), I = (n, t) => (i) => M(n + i * t),
|
|
11
|
+
const m = 60, l = (n) => (t) => t % n, M = l(m), I = (n, t) => (i) => M(n + i * t), u = (n, t) => M(m + n - t), c = (n) => (t, i) => !i || t.getHours() === i.getHours() ? t : r(t, n), L = c(0), f = c(m - 1);
|
|
13
12
|
class S {
|
|
14
13
|
constructor(t) {
|
|
15
14
|
this.intl = t, this.toListItem = null, this.min = null, this.max = null, this.step = 0, this.insertUndividedMax = !1;
|
|
@@ -38,7 +37,7 @@ class S {
|
|
|
38
37
|
return this.addLast(e), t && this.addMissing(e, t), e;
|
|
39
38
|
}
|
|
40
39
|
isRangeChanged(t, i) {
|
|
41
|
-
return this.min !== null && this.max !== null && (!
|
|
40
|
+
return this.min !== null && this.max !== null && (!d(this.min, t) || !d(this.max, i));
|
|
42
41
|
}
|
|
43
42
|
limitRange(t, i, s) {
|
|
44
43
|
return [L(t, s), f(i, s)];
|
|
@@ -67,7 +66,7 @@ class S {
|
|
|
67
66
|
}
|
|
68
67
|
countFromMin(t) {
|
|
69
68
|
const [i, s] = this.range(t);
|
|
70
|
-
return Math.floor(
|
|
69
|
+
return Math.floor(u(s, i) / this.step) + 1;
|
|
71
70
|
}
|
|
72
71
|
isMissing(t) {
|
|
73
72
|
return t ? this.selectedIndex(t) !== this.divideByStep(t) : !1;
|
|
@@ -76,7 +75,7 @@ class S {
|
|
|
76
75
|
return this.max !== null && this.isMissing(r(this.max, this.lastMinute(t)));
|
|
77
76
|
}
|
|
78
77
|
divideByStep(t) {
|
|
79
|
-
return
|
|
78
|
+
return u(t.getMinutes(), this.min.getMinutes()) / this.step;
|
|
80
79
|
}
|
|
81
80
|
lastMinute(t) {
|
|
82
81
|
return this.range(t)[1];
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-date-math"),l=require("../../utils.js"),r=require("../utils.js"),c=60,S=n=>t=>t%n,g=S(c),x=(n,t)=>s=>g(n+s*t),m=(n,t)=>g(c+n-t),u=n=>(t,s)=>!s||t.getMinutes()===s.getMinutes()&&t.getHours()===s.getHours()?t:r.setSeconds(t,n),p=u(0),I=u(c-1);class L{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,s){return r.setSeconds(t,s.getSeconds())}configure(t){const{insertUndividedMax:s=this.insertUndividedMax,min:i=this.min,max:o=this.max,part:e,step:h=this.step}=t;this.insertUndividedMax=s,this.toListItem=M=>{const d=r.setSeconds(l.MIDNIGHT_DATE,M);return{text:this.intl.formatDate(d,e.pattern),value:d}},this.min=i,this.max=o,this.step=h}data(t){const[s]=this.range(t),i=x(s,this.step),o=h=>this.toListItem&&this.toListItem(i(h)),e=r.range(0,this.countFromMin(t)).map(o);return this.addLast(e),t&&this.addMissing(e,t),e}isRangeChanged(t,s){return this.min!==null&&this.max!==null&&(!a.isEqual(this.min,t)||!a.isEqual(this.max,s))}limitRange(t,s,i){return[p(t,i),I(s,i)]}total(t){const s=this.insertUndividedMax&&this.isLastMissing(t)?1:0,i=this.isMissing(t)?1:0;return this.countFromMin(t)+i+s}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastSecond(t)===t.getSeconds()||!this.isMissing(t):!0}divideByStep(t){return m(t.getSeconds(),this.min.getSeconds())/this.step}addLast(t,s){return this.insertUndividedMax&&this.isLastMissing(s)&&this.toListItem&&t.push(this.toListItem(this.lastSecond(s))),t}addMissing(t,s){if(this.valueInList(s))return t;if(this.toListItem){const i=this.toListItem(s.getSeconds());t.splice(this.selectedIndex(s),0,i)}return t}countFromMin(t){const[s,i]=this.range(t);return Math.floor(m(i,s)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(r.setSeconds(this.max,this.lastSecond(t)))}lastSecond(t){return this.range(t)[1]}range(t){const[s,i]=this.limitRange(this.min,this.max,t);return[s.getSeconds(),i.getSeconds()]}}exports.SecondsService=L;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { isEqual as c } from "@progress/kendo-date-math";
|
|
10
9
|
import { MIDNIGHT_DATE as p } from "../../utils.mjs";
|
|
11
10
|
import { setSeconds as r, range as x } from "../utils.mjs";
|
package/timepicker/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"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;
|
package/timepicker/utils.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { cloneDate as g, addDays as f } from "@progress/kendo-date-math";
|
|
10
9
|
import { TIME_PART as l } from "./models/TimePart.mjs";
|
|
11
10
|
import { setTime as u, MIDNIGHT_DATE as c } from "../utils.mjs";
|
package/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"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,...c)=>o[s]===null?null:(r?t.isRequired:t)(o,s,...c),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,c,a;const f=window,v=!1,R=!1,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 u=r,T=o;return r=o=void 0,s=t.apply(T,u),s}function m(i,u){return I?(f.cancelAnimationFrame(c),f.requestAnimationFrame(i)):setTimeout(i,u)}function p(i){if(I)return f.cancelAnimationFrame(i);clearTimeout(i)}function b(i){return c=m(D,e),v?E():s}function d(i){const u=i-a;return e-u}function M(i){const u=i-a;return a===void 0||u>=e||u<0||R}function D(){const i=Date.now();if(M(i))return A();c=m(D,d(i))}function A(i){return c=void 0,r?E():(r=o=void 0,s)}function h(){c!==void 0&&p(c),r=a=o=c=void 0}function N(){return c===void 0?s:A()}function _(){return c!==void 0}function g(...i){const u=Date.now(),T=M(u);return r=i,o=this,a=u,T&&c===void 0?b():(c===void 0&&(c=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
CHANGED
|
@@ -5,39 +5,38 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { getDate as f, cloneDate as v } from "@progress/kendo-date-math";
|
|
10
9
|
import { EMPTY_SELECTIONRANGE as F } from "./calendar/models/SelectionRange.mjs";
|
|
11
|
-
function W(
|
|
12
|
-
const n = (r, o, s, ...u) => o[s] === null ? null : (r ?
|
|
13
|
-
return
|
|
10
|
+
function W(t) {
|
|
11
|
+
const n = (r, o, s, ...u) => o[s] === null ? null : (r ? t.isRequired : t)(o, s, ...u), e = n.bind(null, !1);
|
|
12
|
+
return e.isRequired = n.bind(null, !0), e;
|
|
14
13
|
}
|
|
15
|
-
const d = (
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
}, X = () => f(/* @__PURE__ */ new Date()), j = (
|
|
19
|
-
const { start:
|
|
20
|
-
return !
|
|
21
|
-
}, z = (
|
|
14
|
+
const d = (t, n, e) => n === void 0 || e === void 0 || n <= t && t <= e ? t : t < n ? n : e, 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, n) => {
|
|
15
|
+
const e = v(t);
|
|
16
|
+
return e.setHours(n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds()), e;
|
|
17
|
+
}, X = () => f(/* @__PURE__ */ new Date()), j = (t, n, e) => !t || !(n && n > t || e && e < t), P = (t, n, e) => t === null || !(n && f(n) > f(t) || e && f(e) < f(t)), Y = (t, n) => {
|
|
18
|
+
const { start: e, end: r } = n || F;
|
|
19
|
+
return !e || !r ? !1 : e < t && t < r;
|
|
20
|
+
}, z = (t, n, e = 1) => {
|
|
22
21
|
const r = [];
|
|
23
|
-
for (let o =
|
|
22
|
+
for (let o = t; o < n; o = o + e)
|
|
24
23
|
r.push(o);
|
|
25
24
|
return r;
|
|
26
|
-
}, B = (
|
|
27
|
-
const o = document.createElement(
|
|
28
|
-
return o.className =
|
|
25
|
+
}, B = (t, n, e) => n.getTime() <= t.getTime() && t.getTime() <= e.getTime(), J = (t, n) => t.slice(n).concat(t.slice(0, n)), K = (t, n, e) => t && (n && t < n ? v(n) : e && t > e ? v(e) : t), Q = (t) => (n, e = "", r = {}) => {
|
|
26
|
+
const o = document.createElement(t);
|
|
27
|
+
return o.className = e, Object.keys(r).map((s) => o.style[s] = r[s]), typeof n == "string" ? o.innerHTML = n || "" : (n || []).forEach((s) => s && o.appendChild(s)), o;
|
|
29
28
|
};
|
|
30
|
-
function U(
|
|
29
|
+
function U(t, n, e = {}) {
|
|
31
30
|
let r, o;
|
|
32
|
-
|
|
31
|
+
e.maxWait;
|
|
33
32
|
let s, u, l;
|
|
34
33
|
const g = window, M = !1, h = !1, D = !n && n !== 0 && typeof g.requestAnimationFrame == "function";
|
|
35
|
-
if (typeof
|
|
34
|
+
if (typeof t != "function")
|
|
36
35
|
throw new TypeError("Expected a function");
|
|
37
36
|
n = +n || 0;
|
|
38
37
|
function I(i) {
|
|
39
38
|
const c = r, m = o;
|
|
40
|
-
return r = o = void 0, s =
|
|
39
|
+
return r = o = void 0, s = t.apply(m, c), s;
|
|
41
40
|
}
|
|
42
41
|
function T(i, c) {
|
|
43
42
|
return D ? (g.cancelAnimationFrame(u), g.requestAnimationFrame(i)) : setTimeout(i, c);
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),s=require("prop-types"),f=require("@progress/kendo-react-common"),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 g=P(w),T=(r,e,t)=>Math.min(Math.abs(e-r),t),C=17,O=10,A={1:r=>e=>e+r,0:r=>e=>e-r},x={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},I={1:r=>e=>e<r,0:r=>e=>e>r},a=class a extends g.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)<O||(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),{start:n,end:l}=this.scrollRange(i,o);if(n===l)return;const S=this.scrollStep(n,l),c=A[o](S),h=x[o](l),u=I[o](c(l)),m=p=>{this.animationInProgress=!0;const d=c(p);this.scrollTo(h(d)),u(d)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(d)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(n)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const o=this.props.scrollDuration||a.defaultProps.scrollDuration;return Math.abs(i-t)/(o/C)},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,S=T(o,t,this.props.maxScrollDifference||0),c=Math.min(t,n);return{start:Math.min(Math.max(c+l*S,0),n),end:c}},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 f.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(g.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:a.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:a.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(){const{total:e,take:t,bottomOffset:i,className:o,tabIndex:n,role:l,children:S,unstyled:c}=this.props,h=c&&c.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const u=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,m=this.direction==="vertical"?{height:`${u}px`}:{width:`${u}px`},p=f.classNames(f.uCalendar.scrollableSelector({c:h}),f.uCalendar.scrollable({c:h,horizontal:this.direction==="horizontal"}),o),d=f.classNames(f.uCalendar.scrollablePlaceholder({c:h,horizontal:this.direction==="horizontal"}));return g.createElement("div",{ref:b=>{this.scrollContainer=b},onScroll:this.handleScroll,className:p,tabIndex:n,role:l},S,g.createElement("div",{style:m,className:d}))}};a.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},a.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let v=a;exports.Virtualization=v;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as u from "react";
|
|
10
9
|
import o from "prop-types";
|
|
11
10
|
import { RowHeightService as b, classNames as v, uCalendar as p } from "@progress/kendo-react-common";
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"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;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const a = (e) => Math.max(e, 0);
|
|
10
9
|
class f {
|
|
11
10
|
constructor(t) {
|