@progress/kendo-react-dateinputs 15.1.1-develop.3 → 15.2.0-develop.2
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 +1 -1
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +17 -5
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +29 -29
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +131 -128
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +21 -32
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +66 -66
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +135 -125
- package/calendar/models/WeekDaysFormat.d.ts +1 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +30 -31
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +35 -36
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +184 -183
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +61 -63
- package/datetimepicker/DateTimePicker.d.ts +1 -0
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +117 -118
- package/datetimepicker/models/DateTimePickerSettings.d.ts +7 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +46 -44
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/timepicker/TimeList.js +2 -2
- package/timepicker/TimeList.mjs +51 -47
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +57 -68
- package/timepicker/TimePicker.d.ts +8 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +122 -118
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +56 -57
- package/timepicker/models/TimePickerSettings.d.ts +7 -0
package/messages/index.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ export declare const clear = "dateinput.clear";
|
|
|
29
29
|
* @hidden
|
|
30
30
|
*/
|
|
31
31
|
export declare const today = "calendar.today";
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
export declare const titleAriaLabel = "calendar.titleAriaLabel";
|
|
32
36
|
/**
|
|
33
37
|
* @hidden
|
|
34
38
|
*/
|
|
@@ -154,4 +158,5 @@ export declare const messages: {
|
|
|
154
158
|
"datetimepicker.selectDateAndTime": string;
|
|
155
159
|
"daterangepicker.selectStartDate": string;
|
|
156
160
|
"daterangepicker.selectEndDate": string;
|
|
161
|
+
"calendar.titleAriaLabel": string;
|
|
157
162
|
};
|
package/messages/index.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="multiviewcalendar.prevView",t="multiviewcalendar.nextView",a="dateinput.increment",c="dateinput.decrement",i="dateinput.clear",
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="multiviewcalendar.prevView",t="multiviewcalendar.nextView",a="dateinput.increment",c="dateinput.decrement",i="dateinput.clear",r="calendar.today",n="calendar.titleAriaLabel",l="datepicker.toggleCalendar",o="datepicker.selectDate",s="daterangepicker.swapStartEnd",d="daterangepicker.start",g="daterangepicker.selectStartDate",m="daterangepicker.selectEndDate",k="daterangepicker.end",p="daterangepicker.separator",S="datetimepicker.toggleDateTimeSelector",T="datetimepicker.selectDateAndTime",w="timepicker.now",D="timepicker.selectNow",u="timepicker.cancel",v="timepicker.set",C="timepicker.toggleTimeSelector",P="timepicker.toggleClock",V="timepicker.selectTime",E="datetimepicker.date",N="datetimepicker.time",y="datetimepicker.cancel",A="datetimepicker.set",b="daterangepicker.cancel",x="daterangepicker.set",R={[r]:"Today",[w]:"NOW",[v]:"Set",[u]:"Cancel",[E]:"Date",[N]:"Time",[y]:"Cancel",[A]:"Set",[b]:"Cancel",[x]:"Set",[d]:"Start",[k]:"End",[p]:" ",[D]:"Select Now",[C]:"Toggle TimeSelector",[P]:"Toggle Clock",[V]:"Select time",[a]:"Increase value",[c]:"Decrease value",[i]:"clear",[l]:"Toggle calendar",[o]:"Select date",[e]:"Navigate to previous view",[t]:"Navigate to next view",[s]:"Swap start and end values",[S]:"Toggle date-time selector",[T]:"Select date and time",[g]:"Start date",[m]:"End date",[n]:"Navigate to parent view:"};exports.clear=i;exports.date=E;exports.dateRangePickerCancel=b;exports.dateRangePickerSet=x;exports.dateTimePickerCancel=y;exports.dateTimePickerSet=A;exports.decreaseValue=c;exports.end=k;exports.increaseValue=a;exports.messages=R;exports.nextView=t;exports.now=w;exports.prevView=e;exports.selectDate=o;exports.selectDateAndTime=T;exports.selectEndDate=m;exports.selectNow=D;exports.selectStartDate=g;exports.selectTime=V;exports.separator=p;exports.start=d;exports.swapStartEnd=s;exports.time=N;exports.timePickerCancel=u;exports.timePickerSet=v;exports.titleAriaLabel=n;exports.today=r;exports.toggleCalendar=l;exports.toggleClock=P;exports.toggleDateTimeSelector=S;exports.toggleTimeSelector=C;
|
package/messages/index.mjs
CHANGED
|
@@ -5,66 +5,68 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
const e = "multiviewcalendar.prevView", t = "multiviewcalendar.nextView", a = "dateinput.increment", c = "dateinput.decrement",
|
|
9
|
-
[
|
|
8
|
+
const e = "multiviewcalendar.prevView", t = "multiviewcalendar.nextView", a = "dateinput.increment", c = "dateinput.decrement", i = "dateinput.clear", n = "calendar.today", r = "calendar.titleAriaLabel", l = "datepicker.toggleCalendar", o = "datepicker.selectDate", s = "daterangepicker.swapStartEnd", d = "daterangepicker.start", g = "daterangepicker.selectStartDate", m = "daterangepicker.selectEndDate", p = "daterangepicker.end", k = "daterangepicker.separator", S = "datetimepicker.toggleDateTimeSelector", w = "datetimepicker.selectDateAndTime", T = "timepicker.now", v = "timepicker.selectNow", D = "timepicker.cancel", u = "timepicker.set", C = "timepicker.toggleTimeSelector", N = "timepicker.toggleClock", E = "timepicker.selectTime", P = "datetimepicker.date", V = "datetimepicker.time", x = "datetimepicker.cancel", A = "datetimepicker.set", y = "daterangepicker.cancel", b = "daterangepicker.set", L = {
|
|
9
|
+
[n]: "Today",
|
|
10
10
|
[T]: "NOW",
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[x]: "Set",
|
|
17
|
-
[y]: "Cancel",
|
|
11
|
+
[u]: "Set",
|
|
12
|
+
[D]: "Cancel",
|
|
13
|
+
[P]: "Date",
|
|
14
|
+
[V]: "Time",
|
|
15
|
+
[x]: "Cancel",
|
|
18
16
|
[A]: "Set",
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
17
|
+
[y]: "Cancel",
|
|
18
|
+
[b]: "Set",
|
|
19
|
+
[d]: "Start",
|
|
20
|
+
[p]: "End",
|
|
21
|
+
[k]: " ",
|
|
22
|
+
[v]: "Select Now",
|
|
23
|
+
[C]: "Toggle TimeSelector",
|
|
24
|
+
[N]: "Toggle Clock",
|
|
25
25
|
[E]: "Select time",
|
|
26
26
|
[a]: "Increase value",
|
|
27
27
|
[c]: "Decrease value",
|
|
28
|
-
[
|
|
29
|
-
[
|
|
28
|
+
[i]: "clear",
|
|
29
|
+
[l]: "Toggle calendar",
|
|
30
30
|
[o]: "Select date",
|
|
31
31
|
[e]: "Navigate to previous view",
|
|
32
32
|
[t]: "Navigate to next view",
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
33
|
+
[s]: "Swap start and end values",
|
|
34
|
+
[S]: "Toggle date-time selector",
|
|
35
|
+
[w]: "Select date and time",
|
|
36
|
+
[g]: "Start date",
|
|
37
|
+
[m]: "End date",
|
|
38
|
+
[r]: "Navigate to parent view:"
|
|
38
39
|
};
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
i as clear,
|
|
42
|
+
P as date,
|
|
42
43
|
y as dateRangePickerCancel,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
b as dateRangePickerSet,
|
|
45
|
+
x as dateTimePickerCancel,
|
|
46
|
+
A as dateTimePickerSet,
|
|
46
47
|
c as decreaseValue,
|
|
47
|
-
|
|
48
|
+
p as end,
|
|
48
49
|
a as increaseValue,
|
|
49
|
-
|
|
50
|
+
L as messages,
|
|
50
51
|
t as nextView,
|
|
51
52
|
T as now,
|
|
52
53
|
e as prevView,
|
|
53
54
|
o as selectDate,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
w as selectDateAndTime,
|
|
56
|
+
m as selectEndDate,
|
|
57
|
+
v as selectNow,
|
|
58
|
+
g as selectStartDate,
|
|
58
59
|
E as selectTime,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
k as separator,
|
|
61
|
+
d as start,
|
|
62
|
+
s as swapStartEnd,
|
|
63
|
+
V as time,
|
|
64
|
+
D as timePickerCancel,
|
|
65
|
+
u as timePickerSet,
|
|
66
|
+
r as titleAriaLabel,
|
|
67
|
+
n as today,
|
|
68
|
+
l as toggleCalendar,
|
|
69
|
+
N as toggleClock,
|
|
70
|
+
S as toggleDateTimeSelector,
|
|
71
|
+
C as toggleTimeSelector
|
|
70
72
|
};
|
package/package-metadata.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1785412080,version:"15.2.0-develop.2",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;
|
package/package-metadata.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export const packageMetadata = Object.freeze({
|
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCode: 'KENDOUIREACT',
|
|
8
8
|
productCodes: ['KENDOUIREACT'],
|
|
9
|
-
publishDate:
|
|
10
|
-
version: '15.
|
|
9
|
+
publishDate: 1785412080,
|
|
10
|
+
version: '15.2.0-develop.2',
|
|
11
11
|
licensingDocsUrl:
|
|
12
12
|
'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'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dateinputs",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.2.0-develop.2",
|
|
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",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-date-math": "^1.4.0",
|
|
29
29
|
"@progress/kendo-licensing": "^1.7.2",
|
|
30
|
-
"@progress/kendo-dateinputs-common": "^0.4.
|
|
31
|
-
"@progress/kendo-react-buttons": "15.
|
|
32
|
-
"@progress/kendo-react-common": "15.
|
|
33
|
-
"@progress/kendo-react-intl": "15.
|
|
34
|
-
"@progress/kendo-react-labels": "15.
|
|
35
|
-
"@progress/kendo-react-layout": "15.
|
|
36
|
-
"@progress/kendo-react-popup": "15.
|
|
30
|
+
"@progress/kendo-dateinputs-common": "^0.4.11",
|
|
31
|
+
"@progress/kendo-react-buttons": "15.2.0-develop.2",
|
|
32
|
+
"@progress/kendo-react-common": "15.2.0-develop.2",
|
|
33
|
+
"@progress/kendo-react-intl": "15.2.0-develop.2",
|
|
34
|
+
"@progress/kendo-react-labels": "15.2.0-develop.2",
|
|
35
|
+
"@progress/kendo-react-layout": "15.2.0-develop.2",
|
|
36
|
+
"@progress/kendo-react-popup": "15.2.0-develop.2",
|
|
37
37
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
38
38
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
39
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"package": {
|
|
90
90
|
"productName": "KendoReact",
|
|
91
91
|
"productCode": "KENDOUIREACT",
|
|
92
|
-
"publishDate":
|
|
92
|
+
"publishDate": 1785412080,
|
|
93
93
|
"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"
|
|
94
94
|
}
|
|
95
95
|
},
|
package/timepicker/TimeList.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react"),d=require("prop-types"),T=require("@progress/kendo-date-math"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react"),d=require("prop-types"),T=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),O=require("@progress/kendo-react-intl"),x=require("../virtualization/Virtualization.js"),p=require("./models/TimePart.js"),M=require("./services/DayPeriodService.js"),I=require("./services/DOMService.js"),D=require("./services/HoursService.js"),E=require("./services/MinutesService.js"),_=require("./services/SecondsService.js"),v=require("../utils.js");function P(o){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>o[e]})}}return i.default=o,Object.freeze(i)}const l=P(H),R=2,b=.05,C=100,w=0,S=9,N={[n.Keys.end]:(o,i)=>o[o.length-1],[n.Keys.home]:(o,i)=>o[0],[n.Keys.up]:(o,i)=>o[i-1],[n.Keys.down]:(o,i)=>o[i+1]},g={[p.TIME_PART.dayperiod]:M.DayPeriodService,[p.TIME_PART.hour]:D.HoursService,[p.TIME_PART.minute]:E.MinutesService,[p.TIME_PART.second]:_.SecondsService},h=class h extends l.Component{constructor(i){super(i),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=e=>{Promise.resolve().then(()=>{this.element&&this.element.focus(e)})},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const s=this.service.selectedIndex(this.props.value),t=this.virtualization.activeIndex(),r=this.virtualization.itemOffset(t),a=Math.abs(Math.ceil(e)-r);if(s===t&&a<R)return r;const c=s>t;return c&&a>=this.bottomThreshold||!c&&a>this.topThreshold?this.virtualization.itemOffset(t+1):r},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+=S,this.bottomOffset+=S*2),this.topThreshold=this.itemHeight*b,this.bottomThreshold=this.itemHeight*(1-b))},this.configureServices=({min:e,max:s,value:t}=this.props)=>{if(this.service){const[r,a]=this.service.limitRange(e||this.min,s||this.max,t||this.props.value);this.service.configure(this.serviceSettings({min:r,max:a}))}},this.serviceSettings=e=>{const s={boundRange:this.props.boundRange||h.defaultProps.boundRange,insertUndividedMax:!1,min:T.cloneDate(this.min),max:T.cloneDate(this.max),part:this.props.part,step:this.step},t=Object.assign({},s,e);return t.boundRange=t.part.type!=="hour"||this.props.boundRange||h.defaultProps.boundRange,t},this.handleScrollAction=({target:e,animationInProgress:s})=>{if(!(!this.virtualization||!this.service)&&e&&!s){this.animateToIndex=!1;const t=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),r=this.service.data(this.props.value)[t];this.handleChange(r)}},this.handleFocus=e=>{const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleBlur=e=>{const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=n.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:s}=e;(s===n.Keys.down||s===n.Keys.up||s===n.Keys.end||s===n.Keys.home)&&e.preventDefault();const r=(N[e.keyCode]||n.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));r&&this.handleChange(r)},this.handleChange=v.debounce(e=>{if(!this.service)return;const s=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===s.getTime())return;const{onChange:t}=this.props;t&&t.call(void 0,s)},C),this.dom=new I.DOMService}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||h.defaultProps.min}get max(){return this.props.max||h.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):h.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{const{unstyled:i}=this.props;this._element&&(this.dom.calculateHeights(this._element,i),this.lastMeasuredHeight=this._element.clientHeight,this.forceUpdate())})}componentDidUpdate(i){var s;if(!this.virtualization||!this.service)return;if(this._element){const t=this._element.clientHeight,r=this.lastMeasuredHeight!==void 0&&Math.abs(t-this.lastMeasuredHeight)>1,a=this.props.mobileMode!==i.mobileMode;if(r||a){const{unstyled:c}=this.props;this.dom.calculateHeights(this._element,c),this.calculateHeights(),this.lastMeasuredHeight=t,this.animateToIndex=!1,this.forceUpdate();return}(s=this.lastMeasuredHeight)!=null||(this.lastMeasuredHeight=t)}const e=this.service.selectedIndex(this.props.value);if(this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0,!this.topOffset&&this._element){const{unstyled:t}=this.props;this.dom.calculateHeights(this._element,t)}}render(){const{part:i,value:e,unstyled:s}=this.props;if(!i.type||!g[i.type])return;const t=s&&s.uTime;this.calculateHeights(),this.intl=O.provideIntlService(this),this.service=new g[i.type](this.intl),this.configureServices();const r=this.service.data(e),a="translateY("+this.topOffset+"px)",c=this.service.total(e),f=l.createElement(l.Fragment,null,l.createElement("ul",{style:{transform:a,msTransform:a},className:n.classNames(n.uTime.ul({c:t})),role:"none"},r.map((u,y)=>l.createElement("li",{key:y,className:n.classNames(n.uTime.li({c:t})),role:"option","aria-selected":!1,onClick:()=>{this.handleChange(u)}},l.createElement("span",null,u.text)))),l.createElement("div",{className:n.classNames(n.uTime.scrollablePlaceholder({c:t}))}));return l.createElement("div",{className:n.classNames(n.uTime.list({c:t})),id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,role:"listbox","aria-label":this.intl.dateFieldName(i),ref:u=>{this._element=u},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?l.createElement(x.Virtualization,{bottomOffset:this.bottomOffset,children:f,className:n.classNames(n.uTime.containerSelector({c:t}),n.uTime.container({c:t})),itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:u=>{this.virtualization=u},skip:w,tabIndex:-1,take:c,topOffset:this.topOffset,total:c,unstyled:s}):l.createElement("div",{className:n.classNames(n.uTime.containerSelector({c:t}),n.uTime.container({c:t,content:!0,scrollable:!0}))},f))}};h.propTypes={id:d.number,max:d.instanceOf(Date),min:d.instanceOf(Date),part:function(i,e,s){const t=i[e];if(!t||!g[t.type])throw new Error(`
|
|
9
9
|
Invalid prop '${e}' supplied to ${s}.
|
|
10
10
|
Supported part types are hour|minute|second|dayperiod.
|
|
11
|
-
`);return null},step:function(
|
|
11
|
+
`);return null},step:function(i,e,s){const t=i[e];if(t!==void 0&&t<=0)throw new Error(`
|
|
12
12
|
Invalid prop '${e}' supplied to ${s}.
|
|
13
13
|
${e} cannot be less than 1.
|
|
14
14
|
`);return null},value:d.instanceOf(Date),smoothScroll:d.bool,show:d.bool},h.defaultProps={boundRange:!1,max:v.MAX_TIME,min:v.MIDNIGHT_DATE,step:1,smoothScroll:!0};let m=h;O.registerForIntl(m);exports.TimeList=m;
|
package/timepicker/TimeList.mjs
CHANGED
|
@@ -17,64 +17,64 @@ import { DOMService as _ } from "./services/DOMService.mjs";
|
|
|
17
17
|
import { HoursService as C } from "./services/HoursService.mjs";
|
|
18
18
|
import { MinutesService as w } from "./services/MinutesService.mjs";
|
|
19
19
|
import { SecondsService as R } from "./services/SecondsService.mjs";
|
|
20
|
-
import { debounce as P, MIDNIGHT_DATE as z, MAX_TIME as
|
|
21
|
-
const
|
|
22
|
-
[c.end]: (a,
|
|
23
|
-
[c.home]: (a,
|
|
24
|
-
[c.up]: (a,
|
|
25
|
-
[c.down]: (a,
|
|
20
|
+
import { debounce as P, MIDNIGHT_DATE as z, MAX_TIME as F } from "../utils.mjs";
|
|
21
|
+
const N = 2, b = 0.05, A = 100, k = 0, O = 9, B = {
|
|
22
|
+
[c.end]: (a, s) => a[a.length - 1],
|
|
23
|
+
[c.home]: (a, s) => a[0],
|
|
24
|
+
[c.up]: (a, s) => a[s - 1],
|
|
25
|
+
[c.down]: (a, s) => a[s + 1]
|
|
26
26
|
}, g = {
|
|
27
27
|
[f.dayperiod]: D,
|
|
28
28
|
[f.hour]: C,
|
|
29
29
|
[f.minute]: w,
|
|
30
30
|
[f.second]: R
|
|
31
31
|
}, h = class h extends r.Component {
|
|
32
|
-
constructor(
|
|
33
|
-
super(
|
|
32
|
+
constructor(s) {
|
|
33
|
+
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 = (e) => {
|
|
34
34
|
Promise.resolve().then(() => {
|
|
35
35
|
this.element && this.element.focus(e);
|
|
36
36
|
});
|
|
37
37
|
}, this.itemOffset = (e) => {
|
|
38
38
|
if (!this.virtualization || !this.service)
|
|
39
39
|
return -1;
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
40
|
+
const i = this.service.selectedIndex(this.props.value), t = this.virtualization.activeIndex(), o = this.virtualization.itemOffset(t), n = Math.abs(Math.ceil(e) - o);
|
|
41
|
+
if (i === t && n < N)
|
|
42
42
|
return o;
|
|
43
|
-
const p =
|
|
43
|
+
const p = i > t;
|
|
44
44
|
return p && n >= this.bottomThreshold || !p && n > this.topThreshold ? this.virtualization.itemOffset(t + 1) : o;
|
|
45
45
|
}, this.calculateHeights = () => {
|
|
46
46
|
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 * b, this.bottomThreshold = this.itemHeight * (1 - b));
|
|
47
|
-
}, this.configureServices = ({ min: e, max:
|
|
47
|
+
}, this.configureServices = ({ min: e, max: i, value: t } = this.props) => {
|
|
48
48
|
if (this.service) {
|
|
49
49
|
const [o, n] = this.service.limitRange(
|
|
50
50
|
e || this.min,
|
|
51
|
-
|
|
51
|
+
i || this.max,
|
|
52
52
|
t || this.props.value
|
|
53
53
|
);
|
|
54
54
|
this.service.configure(this.serviceSettings({ min: o, max: n }));
|
|
55
55
|
}
|
|
56
56
|
}, this.serviceSettings = (e) => {
|
|
57
|
-
const
|
|
57
|
+
const i = {
|
|
58
58
|
boundRange: this.props.boundRange || h.defaultProps.boundRange,
|
|
59
59
|
insertUndividedMax: !1,
|
|
60
60
|
min: H(this.min),
|
|
61
61
|
max: H(this.max),
|
|
62
62
|
part: this.props.part,
|
|
63
63
|
step: this.step
|
|
64
|
-
}, t = Object.assign({},
|
|
64
|
+
}, t = Object.assign({}, i, e);
|
|
65
65
|
return t.boundRange = t.part.type !== "hour" || this.props.boundRange || h.defaultProps.boundRange, t;
|
|
66
|
-
}, this.handleScrollAction = ({ target: e, animationInProgress:
|
|
67
|
-
if (!(!this.virtualization || !this.service) && e && !
|
|
66
|
+
}, this.handleScrollAction = ({ target: e, animationInProgress: i }) => {
|
|
67
|
+
if (!(!this.virtualization || !this.service) && e && !i) {
|
|
68
68
|
this.animateToIndex = !1;
|
|
69
69
|
const t = this.virtualization.itemIndex(this.itemOffset(e.scrollTop)), o = this.service.data(this.props.value)[t];
|
|
70
70
|
this.handleChange(o);
|
|
71
71
|
}
|
|
72
72
|
}, this.handleFocus = (e) => {
|
|
73
|
-
const { onFocus:
|
|
74
|
-
|
|
73
|
+
const { onFocus: i } = this.props;
|
|
74
|
+
i && i.call(void 0, e);
|
|
75
75
|
}, this.handleBlur = (e) => {
|
|
76
|
-
const { onBlur:
|
|
77
|
-
|
|
76
|
+
const { onBlur: i } = this.props;
|
|
77
|
+
i && i.call(void 0, e);
|
|
78
78
|
}, this.handleMouseOver = () => {
|
|
79
79
|
if (!this._element)
|
|
80
80
|
return;
|
|
@@ -83,19 +83,19 @@ const F = 2, b = 0.05, N = 100, k = 0, O = 9, B = {
|
|
|
83
83
|
}, this.handleKeyDown = (e) => {
|
|
84
84
|
if (!this.service)
|
|
85
85
|
return;
|
|
86
|
-
const { keyCode:
|
|
87
|
-
(
|
|
86
|
+
const { keyCode: i } = e;
|
|
87
|
+
(i === c.down || i === c.up || i === c.end || i === c.home) && e.preventDefault();
|
|
88
88
|
const o = (B[e.keyCode] || I)(this.service.data(this.props.value), this.service.selectedIndex(this.props.value));
|
|
89
89
|
o && this.handleChange(o);
|
|
90
90
|
}, this.handleChange = P((e) => {
|
|
91
91
|
if (!this.service)
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
if (this.props.value.getTime() ===
|
|
93
|
+
const i = this.service.apply(this.props.value, e.value);
|
|
94
|
+
if (this.props.value.getTime() === i.getTime())
|
|
95
95
|
return;
|
|
96
96
|
const { onChange: t } = this.props;
|
|
97
|
-
t && t.call(void 0,
|
|
98
|
-
},
|
|
97
|
+
t && t.call(void 0, i);
|
|
98
|
+
}, A), this.dom = new _();
|
|
99
99
|
}
|
|
100
100
|
get element() {
|
|
101
101
|
return this._element;
|
|
@@ -117,25 +117,25 @@ const F = 2, b = 0.05, N = 100, k = 0, O = 9, B = {
|
|
|
117
117
|
*/
|
|
118
118
|
componentDidMount() {
|
|
119
119
|
Promise.resolve().then(() => {
|
|
120
|
-
const { unstyled:
|
|
121
|
-
this._element && (this.dom.calculateHeights(this._element,
|
|
120
|
+
const { unstyled: s } = this.props;
|
|
121
|
+
this._element && (this.dom.calculateHeights(this._element, s), this.lastMeasuredHeight = this._element.clientHeight, this.forceUpdate());
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* @hidden
|
|
126
126
|
*/
|
|
127
|
-
componentDidUpdate(
|
|
128
|
-
var
|
|
127
|
+
componentDidUpdate(s) {
|
|
128
|
+
var i;
|
|
129
129
|
if (!this.virtualization || !this.service)
|
|
130
130
|
return;
|
|
131
131
|
if (this._element) {
|
|
132
|
-
const t = this._element.clientHeight, o = this.lastMeasuredHeight !== void 0 && Math.abs(t - this.lastMeasuredHeight) > 1, n = this.props.mobileMode !==
|
|
132
|
+
const t = this._element.clientHeight, o = this.lastMeasuredHeight !== void 0 && Math.abs(t - this.lastMeasuredHeight) > 1, n = this.props.mobileMode !== s.mobileMode;
|
|
133
133
|
if (o || n) {
|
|
134
134
|
const { unstyled: p } = this.props;
|
|
135
135
|
this.dom.calculateHeights(this._element, p), this.calculateHeights(), this.lastMeasuredHeight = t, this.animateToIndex = !1, this.forceUpdate();
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
(
|
|
138
|
+
(i = this.lastMeasuredHeight) != null || (this.lastMeasuredHeight = t);
|
|
139
139
|
}
|
|
140
140
|
const e = this.service.selectedIndex(this.props.value);
|
|
141
141
|
if (this.virtualization[this.animate ? "animateToIndex" : "scrollToIndex"](e), this.animateToIndex = !0, !this.topOffset && this._element) {
|
|
@@ -147,22 +147,25 @@ const F = 2, b = 0.05, N = 100, k = 0, O = 9, B = {
|
|
|
147
147
|
* @hidden
|
|
148
148
|
*/
|
|
149
149
|
render() {
|
|
150
|
-
const { part:
|
|
151
|
-
if (!
|
|
150
|
+
const { part: s, value: e, unstyled: i } = this.props;
|
|
151
|
+
if (!s.type || !g[s.type])
|
|
152
152
|
return;
|
|
153
|
-
const t =
|
|
154
|
-
this.calculateHeights(), this.intl = M(this), this.service = new g[
|
|
153
|
+
const t = i && i.uTime;
|
|
154
|
+
this.calculateHeights(), this.intl = M(this), this.service = new g[s.type](this.intl), this.configureServices();
|
|
155
155
|
const o = this.service.data(e), n = "translateY(" + this.topOffset + "px)", p = this.service.total(e), v = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
156
156
|
"ul",
|
|
157
157
|
{
|
|
158
158
|
style: { transform: n, msTransform: n },
|
|
159
|
-
className: u(l.ul({ c: t }))
|
|
159
|
+
className: u(l.ul({ c: t })),
|
|
160
|
+
role: "none"
|
|
160
161
|
},
|
|
161
162
|
o.map((m, T) => /* @__PURE__ */ r.createElement(
|
|
162
163
|
"li",
|
|
163
164
|
{
|
|
164
165
|
key: T,
|
|
165
166
|
className: u(l.li({ c: t })),
|
|
167
|
+
role: "option",
|
|
168
|
+
"aria-selected": !1,
|
|
166
169
|
onClick: () => {
|
|
167
170
|
this.handleChange(m);
|
|
168
171
|
}
|
|
@@ -176,6 +179,8 @@ const F = 2, b = 0.05, N = 100, k = 0, O = 9, B = {
|
|
|
176
179
|
className: u(l.list({ c: t })),
|
|
177
180
|
id: String(this.props.id || ""),
|
|
178
181
|
tabIndex: this.props.disabled ? -1 : 0,
|
|
182
|
+
role: "listbox",
|
|
183
|
+
"aria-label": this.intl.dateFieldName(s),
|
|
179
184
|
ref: (m) => {
|
|
180
185
|
this._element = m;
|
|
181
186
|
},
|
|
@@ -199,13 +204,12 @@ const F = 2, b = 0.05, N = 100, k = 0, O = 9, B = {
|
|
|
199
204
|
ref: (m) => {
|
|
200
205
|
this.virtualization = m;
|
|
201
206
|
},
|
|
202
|
-
role: "presentation",
|
|
203
207
|
skip: k,
|
|
204
208
|
tabIndex: -1,
|
|
205
209
|
take: p,
|
|
206
210
|
topOffset: this.topOffset,
|
|
207
211
|
total: p,
|
|
208
|
-
unstyled:
|
|
212
|
+
unstyled: i
|
|
209
213
|
}
|
|
210
214
|
) : /* @__PURE__ */ r.createElement(
|
|
211
215
|
"div",
|
|
@@ -224,20 +228,20 @@ h.propTypes = {
|
|
|
224
228
|
id: d.number,
|
|
225
229
|
max: d.instanceOf(Date),
|
|
226
230
|
min: d.instanceOf(Date),
|
|
227
|
-
part: function(
|
|
228
|
-
const t =
|
|
231
|
+
part: function(s, e, i) {
|
|
232
|
+
const t = s[e];
|
|
229
233
|
if (!t || !g[t.type])
|
|
230
234
|
throw new Error(`
|
|
231
|
-
Invalid prop '${e}' supplied to ${
|
|
235
|
+
Invalid prop '${e}' supplied to ${i}.
|
|
232
236
|
Supported part types are hour|minute|second|dayperiod.
|
|
233
237
|
`);
|
|
234
238
|
return null;
|
|
235
239
|
},
|
|
236
|
-
step: function(
|
|
237
|
-
const t =
|
|
240
|
+
step: function(s, e, i) {
|
|
241
|
+
const t = s[e];
|
|
238
242
|
if (t !== void 0 && t <= 0)
|
|
239
243
|
throw new Error(`
|
|
240
|
-
Invalid prop '${e}' supplied to ${
|
|
244
|
+
Invalid prop '${e}' supplied to ${i}.
|
|
241
245
|
${e} cannot be less than 1.
|
|
242
246
|
`);
|
|
243
247
|
return null;
|
|
@@ -247,7 +251,7 @@ h.propTypes = {
|
|
|
247
251
|
show: d.bool
|
|
248
252
|
}, h.defaultProps = {
|
|
249
253
|
boundRange: !1,
|
|
250
|
-
max:
|
|
254
|
+
max: F,
|
|
251
255
|
min: z,
|
|
252
256
|
step: 1,
|
|
253
257
|
smoothScroll: !0
|
package/timepicker/TimePart.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),e=require("prop-types"),O=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),v=require("@progress/kendo-react-intl"),h=require("../messages/index.js"),B=require("./TimeList.js"),b=require("../utils.js"),T=require("./models/TimePart.js"),m=require("./utils.js"),D=require("@progress/kendo-react-buttons");function E(d){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const s in d)if(s!=="default"){const t=Object.getOwnPropertyDescriptor(d,s);Object.defineProperty(i,s,t.get?t:{enumerable:!0,get:()=>d[s]})}}return i.default=d,Object.freeze(i)}const o=E(R),y=new RegExp(`${T.TIME_PART.hour}|${T.TIME_PART.minute}|${T.TIME_PART.second}|${T.TIME_PART.dayperiod}|literal`),r=class r extends o.Component{constructor(i){super(i),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 a=this.timeLists[0];!t&&this.state.activeListIndex===-1&&!this.hasActiveButton()&&a&&a.element&&a.focus(s)})},this.timeFormatReducer=(s,t)=>s+t.pattern,this.timeFormatFilter=(s,t,a)=>{const l=t>=1&&a[t-1];return l&&l&&s.type==="literal"?y.test(l.type||""):y.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,a,l)=>s.length||t.props.id!==this.state.activeListIndex?s:[{next:l[a+1]||t,prev:l[a-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&m.isInTimeRange(m.getNow(),this.min,this.max),this.handleKeyDown=s=>{const{keyCode:t}=s;switch(t){case n.Keys.left:s.preventDefault(),this.focusList(0);return;case n.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=m.snapTime(m.generateSnappers(this.props.steps,this.props.min||r.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return m.timeInRange(this.snapTime(O.cloneDate(this.props.value||b.MIDNIGHT_DATE)),this.min,this.max)}get intl(){return v.provideIntlService(this)}get min(){return this.snapTime(this.props.min||r.defaultProps.min)}get max(){return this.snapTime(this.props.max||r.defaultProps.max)}get steps(){return this.props.steps||r.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:r.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this.value)}render(){const{format:i,smoothScroll:s,onNowClick:t,disabled:a,mobileMode:l,show:N,onNowKeyDown:L,unstyled:w}=this.props,u=w&&w.uTime;this.snapTime=m.snapTime(m.generateSnappers(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(i||r.defaultProps.format).filter(this.timeFormatFilter),this.timeLists=[];const I=v.provideLocalizationService(this),x=I.toLanguageString(h.selectNow,h.messages[h.selectNow]);return o.createElement(o.Fragment,null,o.createElement("div",{className:n.classNames(n.uTime.header({c:u}))},o.createElement("span",{className:n.classNames(n.uTime.title({c:u}))},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&o.createElement(D.Button,{type:"button",ref:c=>{this._nowButton=c},size:l?"large":void 0,className:n.classNames(n.uTime.now({c:u})),fillMode:"flat",title:x,onKeyDown:L,onClick:t,tabIndex:a?-1:0},I.toLanguageString(h.now,h.messages[h.now]))),o.createElement("div",{className:n.classNames(n.uTime.listContainer({c:u})),onKeyDown:this.handleKeyDown},o.createElement("span",{className:n.classNames(n.uTime.highlight({c:u}))}),this.dateFormatParts.map((c,p)=>c.type!=="literal"?o.createElement("div",{key:p,className:n.classNames(n.uTime.listWrapper({c:u,focused:p===this.state.activeListIndex})),tabIndex:-1},o.createElement("span",{className:n.classNames(n.uTime.title({c:u})),onMouseDown:g=>{g.preventDefault()}},this.intl.dateFieldName(c)),o.createElement(B.TimeList,{min:this.min,max:this.max,boundRange:this.boundRange,part:c,step:c.type?this.steps[c.type]:1,smoothScroll:s,ref:g=>{g&&this.timeLists.push(g)},id:p,onFocus:()=>{this.handleListFocus(p)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:N,mobileMode:l,unstyled:w})):o.createElement("div",{key:p,className:n.classNames(n.uTime.separator({c:u}))},c.pattern))))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){const i=n.getActiveElement(document);return this._nowButton&&i===this._nowButton.element}hasSteps(){const i=Object.keys(this.steps);return i.length!==i.reduce((s,t)=>s+this.steps[t],0)}};r.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},r.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:b.MIN_TIME,max:b.MAX_TIME,steps:{},boundRange:!1};let f=r;v.registerForIntl(f);v.registerForLocalization(f);exports.TimePart=f;
|