@progress/kendo-react-dateinputs 11.0.0-develop.5 → 11.0.0-develop.7
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/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +88 -86
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +60 -52
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +0 -1
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +49 -48
- package/utils.js +1 -1
- package/utils.mjs +3 -1
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={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1746436872,version:"11.0.0-develop.7",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
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "11.0.0-develop.
|
|
13
|
+
publishDate: 1746436872,
|
|
14
|
+
version: "11.0.0-develop.7",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dateinputs",
|
|
3
|
-
"version": "11.0.0-develop.
|
|
3
|
+
"version": "11.0.0-develop.7",
|
|
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",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"@progress/kendo-date-math": "^1.4.0",
|
|
29
29
|
"@progress/kendo-licensing": "^1.5.1",
|
|
30
30
|
"@progress/kendo-dateinputs-common": "^0.4.0",
|
|
31
|
-
"@progress/kendo-react-buttons": "11.0.0-develop.
|
|
32
|
-
"@progress/kendo-react-common": "11.0.0-develop.
|
|
33
|
-
"@progress/kendo-react-intl": "11.0.0-develop.
|
|
34
|
-
"@progress/kendo-react-labels": "11.0.0-develop.
|
|
35
|
-
"@progress/kendo-react-layout": "11.0.0-develop.
|
|
36
|
-
"@progress/kendo-react-popup": "11.0.0-develop.
|
|
31
|
+
"@progress/kendo-react-buttons": "11.0.0-develop.7",
|
|
32
|
+
"@progress/kendo-react-common": "11.0.0-develop.7",
|
|
33
|
+
"@progress/kendo-react-intl": "11.0.0-develop.7",
|
|
34
|
+
"@progress/kendo-react-labels": "11.0.0-develop.7",
|
|
35
|
+
"@progress/kendo-react-layout": "11.0.0-develop.7",
|
|
36
|
+
"@progress/kendo-react-popup": "11.0.0-develop.7",
|
|
37
37
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
38
38
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
39
39
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"package": {
|
|
70
70
|
"productName": "KendoReact",
|
|
71
71
|
"productCode": "KENDOUIREACT",
|
|
72
|
-
"publishDate":
|
|
72
|
+
"publishDate": 1746436872,
|
|
73
73
|
"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"
|
|
74
74
|
}
|
|
75
75
|
},
|
package/timepicker/TimePicker.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 G=require("react"),e=require("prop-types"),X=require("@progress/kendo-react-popup"),y=require("@progress/kendo-date-math"),o=require("@progress/kendo-react-common"),Z=require("@progress/kendo-svg-icons"),T=require("@progress/kendo-react-intl"),$=require("../package-metadata.js"),l=require("../messages/index.js"),J=require("../dateinput/DateInput.js"),Q=require("./TimeSelector.js"),c=require("../utils.js"),f=require("./utils.js"),Y=require("../hooks/usePickerFloatingLabel.js"),ee=require("@progress/kendo-react-buttons"),te=require("../common/AdaptiveMode.js"),ie=require("@progress/kendo-react-layout");function se(p){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>p[t]})}}return i.default=p,Object.freeze(i)}const a=se(G),r=class r extends a.Component{constructor(i){super(i),this._element=null,this._dateInput=a.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.showLicenseWatermark=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:t,cancelButton:s,nowButton:n,disabled:u,format:d,steps:h,unstyled:g}=this.props;return a.createElement(Q.TimeSelector,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:s,disabled:u,nowButton:n,format:d,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:g})},this.renderPopup=()=>{const{popupClass:t,...s}=this.popupSettings,{unstyled:n}=this.props,u=n&&n.uTimePicker,d=o.classNames(t),h={popupClass:o.uTimePicker.popup({c:u}),show:this.show,animate:this.element!==null,anchor:this.element,className:d,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...s};return this.props.popup?a.createElement(this.props.popup,{...h},this.renderTimeSelector()):a.createElement(X.Popup,{...h},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,s={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(l.toggleClock,l.messages[l.timePickerCancel]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(l.timePickerSet,l.messages[l.timePickerSet]),onApply:n=>this.handleValueChange(n)}};return a.createElement(te.AdaptiveMode,{...s},a.createElement(ie.ActionSheetContent,null,this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,s)=>t.value!==void 0?t.value:s.value,this.nextShow=(t,s)=>t.show!==void 0?t.show:s.show,this.handleInputValueChange=t=>{const s=this.mergeTime(t.value);this.handleValueChange({...t,value:s})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:y.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:s}=this.props,n=this.state.candidate||this.value;s&&s.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:n,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=t=>{this.setShow(!1)},this.handleClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:s,keyCode:n}=t;if(n===o.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}s&&(n===o.Keys.up||n===o.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=n===o.Keys.up,this.setShow(n===o.Keys.down))},this.showLicenseWatermark=!o.validatePackage($.packageMetadata,{component:"TimePicker"}),this.state={value:this.props.defaultValue||r.defaultProps.defaultValue,show:this.props.defaultShow||r.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?y.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),s=this.normalizeTime(this.max),n=f.isInRange(i,t,s),u=this.props.validationMessage!==void 0,d=(!this.required||this.value!==null)&&n,h=this.props.valid!==void 0?this.props.valid:d;return{customError:u,rangeOverflow:f.isBiggerThanMax(i,s),rangeUnderflow:f.isSmallerThanMin(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){var t;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((t=this.props._adaptiveMode)==null?void 0:t.medium)&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:r.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get popupSettings(){return this.props.popupSettings||r.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:r.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:r.defaultProps.max}get dateInputComp(){return this.props.dateInput||r.defaultProps.dateInput}get localizationService(){return T.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow&&this._timeSelector.focusActiveList(),this.mobileMode&&this.show&&!this.prevShow&&setTimeout(()=>{this._timeSelector&&this._timeSelector.focusActiveList()},300),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=r.defaultProps.size,rounded:t=r.defaultProps.rounded,fillMode:s=r.defaultProps.fillMode,disabled:n,tabIndex:u,title:d,id:h,className:g,format:M,formatPlaceholder:P,width:O,name:k,steps:D,validationMessage:z,required:x,validityStyles:q,ariaLabelledBy:R,ariaDescribedBy:E,unstyled:v,enableMouseWheel:B,autoCorrectParts:A,autoSwitchParts:F,autoSwitchKeys:V,allowCaretMode:L,inputAttributes:N}=this.props,w=v&&v.uTimePicker,b=!this.validityStyles||this.validity.valid,_={disabled:n,format:M,formatPlaceholder:P,id:h,ariaLabelledBy:R,ariaDescribedBy:E,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:k,onChange:this.handleInputValueChange,required:x,steps:D,tabIndex:this.show?-1:u,title:d,valid:this.validity.valid,validationMessage:z,validityStyles:q,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,enableMouseWheel:B,autoCorrectParts:A,autoSwitchParts:F,autoSwitchKeys:V,allowCaretMode:L,inputAttributes:N},K=this.localizationService.toLanguageString(l.toggleClock,l.messages[l.toggleClock]),j=this.localizationService.toLanguageString(l.toggleTimeSelector,l.messages[l.toggleTimeSelector]),S=a.createElement(o.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:W,onBlur:U})=>a.createElement(a.Fragment,null,a.createElement("span",{id:this.props.id,ref:H=>{this._element=H},className:o.classNames(o.uTimePicker.wrapper({c:w,size:i,rounded:t,fillMode:s,invalid:!b,required:this.required,disabled:n}),g),onKeyDown:this.handleKeyDown,style:{width:O},onFocus:this.mobileMode?this.handleClick:W,onBlur:U,onClick:this.mobileMode?this.handleClick:void 0},a.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,..._}),a.createElement(ee.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:Z.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:j,className:o.classNames(o.uTimePicker.inputButton({c:w})),rounded:null,fillMode:s,"aria-label":K}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&a.createElement(o.WatermarkOverlay,null)));return this.props.label?a.createElement(Y.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:b,editorDisabled:this.props.disabled,children:S,style:{width:this.props.width}}):S}normalizeTime(i){return c.setTime(c.MIDNIGHT_DATE,i)}setShow(i){const{onOpen:t,onClose:s}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&s&&s.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?c.setTime(this.value,i):i}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};r.displayName="TimePicker",r.propTypes={className:e.string,cancelButton:e.bool,nowButton:e.bool,defaultShow:e.bool,defaultValue:e.instanceOf(Date),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"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),inputAttributes:e.object},r.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:c.MAX_TIME,min:c.MIN_TIME,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:J.DateInput,size:"medium",rounded:"medium",fillMode:"solid"};let m=r;const C=o.createPropsContext(),I=o.withIdHOC(o.withPropsContext(C,o.withUnstyledHOC(o.withAdaptiveModeContext(m))));I.displayName="KendoReactTimePicker";T.registerForLocalization(m);exports.TimePicker=I;exports.TimePickerPropsContext=C;exports.TimePickerWithoutContext=m;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),e=require("prop-types"),X=require("@progress/kendo-react-popup"),y=require("@progress/kendo-date-math"),o=require("@progress/kendo-react-common"),Z=require("@progress/kendo-svg-icons"),T=require("@progress/kendo-react-intl"),$=require("../package-metadata.js"),l=require("../messages/index.js"),J=require("../dateinput/DateInput.js"),Q=require("./TimeSelector.js"),c=require("../utils.js"),f=require("./utils.js"),Y=require("../hooks/usePickerFloatingLabel.js"),ee=require("@progress/kendo-react-buttons"),te=require("../common/AdaptiveMode.js"),ie=require("@progress/kendo-react-layout");function se(p){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>p[t]})}}return i.default=p,Object.freeze(i)}const a=se(G),r=class r extends a.Component{constructor(i){super(i),this._element=null,this._dateInput=a.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.showLicenseWatermark=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:t,cancelButton:s,nowButton:n,disabled:u,format:d,steps:h,unstyled:g}=this.props;return a.createElement(Q.TimeSelector,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:s,disabled:u,nowButton:n,format:d,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:g})},this.renderPopup=()=>{const{popupClass:t,...s}=this.popupSettings,{unstyled:n}=this.props,u=n&&n.uTimePicker,d=o.classNames(t),h={popupClass:o.uTimePicker.popup({c:u}),show:this.show,animate:this.element!==null,anchor:this.element,className:d,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...s};return this.props.popup?a.createElement(this.props.popup,{...h},this.renderTimeSelector()):a.createElement(X.Popup,{...h},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,s={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(l.toggleClock,l.messages[l.timePickerCancel]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(l.timePickerSet,l.messages[l.timePickerSet]),onApply:n=>this.handleValueChange(n)}};return a.createElement(te.AdaptiveMode,{...s},a.createElement(ie.ActionSheetContent,null,this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,s)=>t.value!==void 0?t.value:s.value,this.nextShow=(t,s)=>t.show!==void 0?t.show:s.show,this.handleInputValueChange=t=>{const s=this.mergeTime(t.value);this.handleValueChange({...t,value:s})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:y.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:s}=this.props,n=this.state.candidate||this.value;s&&s.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:n,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=t=>{this.setShow(!1)},this.handleClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:s,keyCode:n}=t;if(n===o.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}s&&(n===o.Keys.up||n===o.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=n===o.Keys.up,this.setShow(n===o.Keys.down))},this.showLicenseWatermark=!o.validatePackage($.packageMetadata,{component:"TimePicker"}),this.state={value:this.props.defaultValue||r.defaultProps.defaultValue,show:this.props.defaultShow||r.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?y.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),s=this.normalizeTime(this.max),n=f.isInRange(i,t,s),u=this.props.validationMessage!==void 0,d=(!this.required||this.value!==null)&&n,h=this.props.valid!==void 0?this.props.valid:d;return{customError:u,rangeOverflow:f.isBiggerThanMax(i,s),rangeUnderflow:f.isSmallerThanMin(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){var t;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((t=this.props._adaptiveMode)==null?void 0:t.medium)&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:r.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get popupSettings(){return this.props.popupSettings||r.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:r.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:r.defaultProps.max}get dateInputComp(){return this.props.dateInput||r.defaultProps.dateInput}get localizationService(){return T.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow&&this._timeSelector.focusActiveList(),this.mobileMode&&this.show&&!this.prevShow&&setTimeout(()=>{this._timeSelector&&this._timeSelector.focusActiveList()},300),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=r.defaultProps.size,rounded:t=r.defaultProps.rounded,fillMode:s=r.defaultProps.fillMode,disabled:n,tabIndex:u,title:d,id:h,className:g,format:M,formatPlaceholder:P,width:O,name:k,steps:D,validationMessage:z,required:x,validityStyles:q,ariaLabelledBy:R,ariaDescribedBy:E,unstyled:v,enableMouseWheel:B,autoCorrectParts:A,autoSwitchParts:F,autoSwitchKeys:V,allowCaretMode:L,inputAttributes:N}=this.props,w=v&&v.uTimePicker,b=!this.validityStyles||this.validity.valid,_={disabled:n,format:M,formatPlaceholder:P,id:h,ariaLabelledBy:R,ariaDescribedBy:E,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:k,onChange:this.handleInputValueChange,required:x,steps:D,tabIndex:this.show?-1:u,title:d,valid:this.validity.valid,validationMessage:z,validityStyles:q,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,enableMouseWheel:B,autoCorrectParts:A,autoSwitchParts:F,autoSwitchKeys:V,allowCaretMode:L,inputAttributes:N},K=this.localizationService.toLanguageString(l.toggleClock,l.messages[l.toggleClock]),j=this.localizationService.toLanguageString(l.toggleTimeSelector,l.messages[l.toggleTimeSelector]),S=a.createElement(o.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:W,onBlur:U})=>a.createElement(a.Fragment,null,a.createElement("span",{ref:H=>{this._element=H},className:o.classNames(o.uTimePicker.wrapper({c:w,size:i,rounded:t,fillMode:s,invalid:!b,required:this.required,disabled:n}),g),onKeyDown:this.handleKeyDown,style:{width:O},onFocus:this.mobileMode?this.handleClick:W,onBlur:U,onClick:this.mobileMode?this.handleClick:void 0},a.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,..._}),a.createElement(ee.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:Z.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:j,className:o.classNames(o.uTimePicker.inputButton({c:w})),rounded:null,fillMode:s,"aria-label":K}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&a.createElement(o.WatermarkOverlay,null)));return this.props.label?a.createElement(Y.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:b,editorDisabled:this.props.disabled,children:S,style:{width:this.props.width}}):S}normalizeTime(i){return c.setTime(c.MIDNIGHT_DATE,i)}setShow(i){const{onOpen:t,onClose:s}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&s&&s.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?c.setTime(this.value,i):i}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};r.displayName="TimePicker",r.propTypes={className:e.string,cancelButton:e.bool,nowButton:e.bool,defaultShow:e.bool,defaultValue:e.instanceOf(Date),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"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),inputAttributes:e.object},r.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:c.MAX_TIME,min:c.MIN_TIME,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:J.DateInput,size:"medium",rounded:"medium",fillMode:"solid"};let m=r;const C=o.createPropsContext(),I=o.withIdHOC(o.withPropsContext(C,o.withUnstyledHOC(o.withAdaptiveModeContext(m))));I.displayName="KendoReactTimePicker";T.registerForLocalization(m);exports.TimePicker=I;exports.TimePickerPropsContext=C;exports.TimePickerWithoutContext=m;
|
|
@@ -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 I=require("react"),e=require("prop-types"),g=require("@progress/kendo-date-math"),s=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-intl"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),e=require("prop-types"),g=require("@progress/kendo-date-math"),s=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),y=require("../utils.js"),m=require("./utils.js"),K=require("./TimePart.js"),O=require("@progress/kendo-react-buttons");function x(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return i.default=u,Object.freeze(i)}const l=x(I),c=class c extends l.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:n}=t;switch(n){case s.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:n,shiftKey:o}=t;!o&&n===s.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var p;const{keyCode:n,shiftKey:o}=t;o&&n===s.Keys.tab?(t.preventDefault(),this._acceptButton&&((p=this._acceptButton.element)==null||p.focus({preventScroll:!0}))):n===s.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),this.timePart?this.timePart.value:this.current);this.setState({value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:n}=this.props;n&&n.call(void 0,t)},this.handleNowClick=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),m.getNow());this.setState({current:n,value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:n}=this.props;n&&n.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||c.defaultProps.format),this.mergeValue=m.valueMerger(m.generateGetters(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||y.MIDNIGHT_DATE,value:this.props.value||c.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?g.cloneDate(i):null}get intl(){return f.provideIntlService(this)}get current(){return this.state.current!==null?g.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:n,tabIndex:o,className:p,smoothScroll:P,min:B,max:k,boundRange:N,nowButton:T,steps:S,show:_,mobileMode:C,unstyled:h}=this.props,E=h&&h.uTimePicker,v=h&&h.uTime,D=f.provideLocalizationService(this),b=D.toLanguageString(r.timePickerCancel,r.messages[r.timePickerCancel]),w=D.toLanguageString(r.timePickerSet,r.messages[r.timePickerSet]);return l.createElement("div",{ref:a=>{this._element=a},tabIndex:n?void 0:o||0,className:s.classNames(s.uTimePicker.timeSelector({c:E,mobileMode:C,disabled:n}),p),onKeyDown:this.handleKeyDown},l.createElement(K.TimePart,{ref:a=>{this.timePart=a},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:P,min:B,max:k,boundRange:N,disabled:n,nowButton:T,steps:S,show:_,mobileMode:C,onNowKeyDown:this.handleNowKeyDown,unstyled:h}),this.props.footer&&l.createElement("div",{className:s.classNames(s.uTime.footer({c:v}))},t&&l.createElement(O.Button,{type:"button",ref:a=>{this._cancelButton=a},className:s.classNames(s.uTime.cancel({c:v})),onClick:this.handleReject,title:b,"aria-label":b},b),l.createElement(O.Button,{type:"button",ref:a=>{this._acceptButton=a},className:s.classNames(s.uTime.accept({c:v})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:w,"aria-label":w},w)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=s.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};c.propTypes={cancelButton:e.bool,className:e.string,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},c.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:y.MIN_TIME,max:y.MAX_TIME,boundRange:!1,footer:!0};let d=c;f.registerForIntl(d);f.registerForLocalization(d);exports.TimeSelector=d;
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as a from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
|
-
import { cloneDate as
|
|
11
|
-
import { Keys as
|
|
12
|
-
import { provideIntlService as K, provideLocalizationService as M, registerForIntl as
|
|
10
|
+
import { cloneDate as h } from "@progress/kendo-date-math";
|
|
11
|
+
import { Keys as u, classNames as m, uTimePicker as x, uTime as g, getActiveElement as A } from "@progress/kendo-react-common";
|
|
12
|
+
import { provideIntlService as K, provideLocalizationService as M, registerForIntl as R, registerForLocalization as F } from "@progress/kendo-react-intl";
|
|
13
13
|
import { timePickerCancel as y, messages as B, timePickerSet as D } from "../messages/index.mjs";
|
|
14
14
|
import { MIDNIGHT_DATE as L, MIN_TIME as j, MAX_TIME as z } from "../utils.mjs";
|
|
15
15
|
import { getNow as w, valueMerger as V, generateGetters as G } from "./utils.mjs";
|
|
16
16
|
import { TimePart as H } from "./TimePart.mjs";
|
|
17
17
|
import { Button as O } from "@progress/kendo-react-buttons";
|
|
18
|
-
const r = class r extends
|
|
18
|
+
const r = class r extends a.Component {
|
|
19
19
|
constructor(i) {
|
|
20
20
|
super(i), this._element = null, this._cancelButton = null, this._acceptButton = null, this.timePart = null, this.focusActiveList = () => {
|
|
21
21
|
this.timePart && this.timePart.focus({ preventScroll: !0 });
|
|
22
22
|
}, this.handleKeyDown = (e) => {
|
|
23
23
|
const { keyCode: n } = e;
|
|
24
24
|
switch (n) {
|
|
25
|
-
case
|
|
25
|
+
case u.enter:
|
|
26
26
|
this.hasActiveButton() || this.handleAccept(e);
|
|
27
27
|
return;
|
|
28
28
|
default:
|
|
@@ -30,14 +30,14 @@ const r = class r extends s.Component {
|
|
|
30
30
|
}
|
|
31
31
|
}, this.revertToNowButton = (e) => {
|
|
32
32
|
const { keyCode: n, shiftKey: o } = e;
|
|
33
|
-
!o && n ===
|
|
33
|
+
!o && n === u.tab && (e.preventDefault(), this.props.nowButton !== !1 ? this.timePart && this.timePart.focus({ preventScroll: !0 }, !0) : this.timePart && this.timePart.focus({ preventScroll: !0 }));
|
|
34
34
|
}, this.handleNowKeyDown = (e) => {
|
|
35
35
|
var c;
|
|
36
36
|
const { keyCode: n, shiftKey: o } = e;
|
|
37
|
-
o && n ===
|
|
37
|
+
o && n === u.tab ? (e.preventDefault(), this._acceptButton && ((c = this._acceptButton.element) == null || c.focus({ preventScroll: !0 }))) : n === u.enter && (e.stopPropagation(), this.handleNowClick(e));
|
|
38
38
|
}, this.handleAccept = (e) => {
|
|
39
39
|
const n = this.mergeValue(
|
|
40
|
-
|
|
40
|
+
h(this.value || w()),
|
|
41
41
|
this.timePart ? this.timePart.value : this.current
|
|
42
42
|
);
|
|
43
43
|
this.setState({ value: n }), this.valueDuringOnChange = n;
|
|
@@ -53,7 +53,7 @@ const r = class r extends s.Component {
|
|
|
53
53
|
const { onReject: n } = this.props;
|
|
54
54
|
n && n.call(void 0, e);
|
|
55
55
|
}, this.handleNowClick = (e) => {
|
|
56
|
-
const n = this.mergeValue(
|
|
56
|
+
const n = this.mergeValue(h(this.value || w()), w());
|
|
57
57
|
this.setState({
|
|
58
58
|
current: n,
|
|
59
59
|
value: n
|
|
@@ -84,13 +84,13 @@ const r = class r extends s.Component {
|
|
|
84
84
|
}
|
|
85
85
|
get value() {
|
|
86
86
|
const i = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
87
|
-
return i !== null ?
|
|
87
|
+
return i !== null ? h(i) : null;
|
|
88
88
|
}
|
|
89
89
|
get intl() {
|
|
90
90
|
return K(this);
|
|
91
91
|
}
|
|
92
92
|
get current() {
|
|
93
|
-
return this.state.current !== null ?
|
|
93
|
+
return this.state.current !== null ? h(this.state.current) : null;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* @hidden
|
|
@@ -117,12 +117,12 @@ const r = class r extends s.Component {
|
|
|
117
117
|
show: _,
|
|
118
118
|
mobileMode: b,
|
|
119
119
|
unstyled: l
|
|
120
|
-
} = this.props, I = l && l.uTimePicker, d = l && l.uTime, C = M(this), f = C.toLanguageString(y, B[y]),
|
|
121
|
-
return /* @__PURE__ */
|
|
120
|
+
} = this.props, I = l && l.uTimePicker, d = l && l.uTime, C = M(this), f = C.toLanguageString(y, B[y]), v = C.toLanguageString(D, B[D]);
|
|
121
|
+
return /* @__PURE__ */ a.createElement(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
|
-
ref: (
|
|
125
|
-
this._element =
|
|
124
|
+
ref: (s) => {
|
|
125
|
+
this._element = s;
|
|
126
126
|
},
|
|
127
127
|
tabIndex: n ? void 0 : o || 0,
|
|
128
128
|
className: m(
|
|
@@ -135,11 +135,11 @@ const r = class r extends s.Component {
|
|
|
135
135
|
),
|
|
136
136
|
onKeyDown: this.handleKeyDown
|
|
137
137
|
},
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ a.createElement(
|
|
139
139
|
H,
|
|
140
140
|
{
|
|
141
|
-
ref: (
|
|
142
|
-
this.timePart =
|
|
141
|
+
ref: (s) => {
|
|
142
|
+
this.timePart = s;
|
|
143
143
|
},
|
|
144
144
|
value: this.current,
|
|
145
145
|
onChange: this.handleChange,
|
|
@@ -157,36 +157,37 @@ const r = class r extends s.Component {
|
|
|
157
157
|
onNowKeyDown: this.handleNowKeyDown,
|
|
158
158
|
unstyled: l
|
|
159
159
|
}
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
),
|
|
161
|
+
this.props.footer && /* @__PURE__ */ a.createElement("div", { className: m(g.footer({ c: d })) }, e && /* @__PURE__ */ a.createElement(
|
|
162
|
+
O,
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
ref: (s) => {
|
|
166
|
+
this._cancelButton = s;
|
|
167
|
+
},
|
|
168
|
+
className: m(g.cancel({ c: d })),
|
|
169
|
+
onClick: this.handleReject,
|
|
170
|
+
title: f,
|
|
171
|
+
"aria-label": f
|
|
167
172
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.
|
|
173
|
+
f
|
|
174
|
+
), /* @__PURE__ */ a.createElement(
|
|
175
|
+
O,
|
|
176
|
+
{
|
|
177
|
+
type: "button",
|
|
178
|
+
ref: (s) => {
|
|
179
|
+
this._acceptButton = s;
|
|
180
|
+
},
|
|
181
|
+
className: m(g.accept({ c: d })),
|
|
182
|
+
themeColor: "primary",
|
|
183
|
+
onClick: this.handleAccept,
|
|
184
|
+
onKeyDown: this.revertToNowButton,
|
|
185
|
+
title: v,
|
|
186
|
+
"aria-label": v
|
|
180
187
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
onKeyDown: this.revertToNowButton,
|
|
185
|
-
title: g,
|
|
186
|
-
"aria-label": g
|
|
187
|
-
},
|
|
188
|
-
g
|
|
189
|
-
)));
|
|
188
|
+
v
|
|
189
|
+
))
|
|
190
|
+
);
|
|
190
191
|
}
|
|
191
192
|
nextTick(i) {
|
|
192
193
|
clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => i());
|
|
@@ -245,8 +246,8 @@ r.propTypes = {
|
|
|
245
246
|
footer: !0
|
|
246
247
|
};
|
|
247
248
|
let p = r;
|
|
248
|
-
F(p);
|
|
249
249
|
R(p);
|
|
250
|
+
F(p);
|
|
250
251
|
export {
|
|
251
252
|
p as TimeSelector
|
|
252
253
|
};
|
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 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).
|
|
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).forEach(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 D(i,u){return I?(f.cancelAnimationFrame(c),f.requestAnimationFrame(i)):setTimeout(i,u)}function h(i){if(I)return f.cancelAnimationFrame(i);clearTimeout(i)}function b(i){return c=D(m,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 m(){const i=Date.now();if(M(i))return A();c=D(m,d(i))}function A(i){return c=void 0,r?E():(r=o=void 0,s)}function p(){c!==void 0&&h(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=D(m,e)),s)}return g.cancel=p,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
|
@@ -24,7 +24,9 @@ const d = (t, n, e) => n === void 0 || e === void 0 || n <= t && t <= e ? t : t
|
|
|
24
24
|
return r;
|
|
25
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
26
|
const o = document.createElement(t);
|
|
27
|
-
return o.className = e, Object.keys(r).
|
|
27
|
+
return o.className = e, Object.keys(r).forEach((s) => {
|
|
28
|
+
o.style[s] = r[s];
|
|
29
|
+
}), typeof n == "string" ? o.innerHTML = n || "" : (n || []).forEach((s) => s && o.appendChild(s)), o;
|
|
28
30
|
};
|
|
29
31
|
function U(t, n, e = {}) {
|
|
30
32
|
let r, o;
|