@progress/kendo-react-dateinputs 7.0.2-develop.2 → 7.0.2-develop.3
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/daterangepicker/DateRangePicker.d.ts +1 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +4 -4
- package/index.js +1 -1
- package/index.mjs +27 -24
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
`);return null},step:function(s,e,t){const i=s[e];if(i!==void 0&&i<=0)throw new Error(`
|
|
19
19
|
Invalid prop '${e}' supplied to ${t}.
|
|
20
20
|
${e} cannot be less than 1.
|
|
21
|
-
`);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool};He.defaultProps={boundRange:!1,max:oe,min:L,step:1,smoothScroll:!0};k.registerForIntl(He);const mt=new RegExp(`${j.hour}|${j.minute}|${j.second}|${j.dayperiod}|literal`),he=class extends r.Component{constructor(s){super(s),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=e=>{Promise.resolve().then(()=>{const t=this.timeLists[0];this.state.activeListIndex===-1&&!this.hasActiveButton()&&t&&t.element&&t.focus(e)})},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const a=t>=1&&i[t-1];return a&&a&&e.type==="literal"?mt.test(a.type||""):mt.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(t=>e===1?t.next:t.prev).map(t=>t&&t.element&&t.element.focus({preventScroll:!0}))},this.listReducer=(e,t,i,a)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:a[i+1]||t,prev:a[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Ft(ue(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.left:e.preventDefault(),this.focusList(0);return;case d.Keys.right:e.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=Yt(Ut(this.props.steps,this.props.min||he.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ui(this.snapTime(l.cloneDate(this.props.value||L)),this.min,this.max)}get intl(){return k.provideIntlService(this)}get min(){return this.snapTime(this.props.min||he.defaultProps.min)}get max(){return this.snapTime(this.props.max||he.defaultProps.max)}get steps(){return this.props.steps||he.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:he.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:s}=this.props;s&&s.call(void 0,this.value)}render(){const{format:s,smoothScroll:e,onNowClick:t,className:i,disabled:a,mobileMode:o,show:h}=this.props;this.snapTime=Yt(Ut(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(s||he.defaultProps.format).filter(this.timeFormatFilter);const u=d.classNames({"k-disabled":a,"k-time-part":o},i);this.timeLists=[];const c=k.provideLocalizationService(this),p=c.toLanguageString(bt,M[bt]);return r.createElement("div",{className:u},r.createElement("div",{className:"k-time-header"},r.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&r.createElement(N.Button,{type:"button",ref:m=>{this._nowButton=m},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:p,"aria-label":p,onClick:t,tabIndex:a?-1:0},c.toLanguageString(wt,M[wt]))),r.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},r.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((m,g)=>m.type!=="literal"?r.createElement("div",{key:g,className:d.classNames("k-time-list-wrapper",{"k-focus":g===this.state.activeListIndex}),role:"presentation",tabIndex:-1},r.createElement("span",{className:"k-title",onMouseDown:f=>{f.preventDefault()}},this.intl.dateFieldName(m)),r.createElement(He,{min:this.min,max:this.max,boundRange:this.boundRange,part:m,step:m.type?this.steps[m.type]:1,smoothScroll:e,ref:f=>{f&&this.timeLists.push(f)},id:g,onFocus:()=>{this.handleListFocus(g)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:o})):r.createElement("div",{key:g,className:"k-time-separator"},m.pattern))))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){const s=d.getActiveElement(document);return this._nowButton&&s===this._nowButton.element}hasSteps(){const s=Object.keys(this.steps);return s.length!==s.reduce((e,t)=>e+this.steps[t],0)}};let pe=he;pe.propTypes={cancelButton:n.bool,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool};pe.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:de,max:oe,steps:{},boundRange:!1};k.registerForIntl(pe);k.registerForLocalization(pe);const Mt=class extends r.Component{constructor(s){super(s),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(e);return;default:return}},this.handleAccept=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),ue());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||Mt.defaultProps.format),this.mergeValue=Wi(qi(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||L,value:this.props.value||Mt.defaultProps.value}}get element(){return this._element}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):null}get intl(){return k.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:s,cancelButton:e,disabled:t,tabIndex:i,className:a,smoothScroll:o,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:g,mobileMode:f}=this.props,v=k.provideLocalizationService(this),C=v.toLanguageString(Je,M[Je]),I=v.toLanguageString(Ne,M[Ne]);return r.createElement("div",{ref:T=>{this._element=T},tabIndex:t?void 0:i||0,className:d.classNames("k-timeselector",a,{"k-disabled":t}),onKeyDown:this.handleKeyDown},r.createElement(pe,{ref:T=>{this.timePart=T},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:s,smoothScroll:o,min:h,max:u,boundRange:c,disabled:t,nowButton:p,steps:m,show:g,mobileMode:f}),this.props.footer&&r.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},e&&r.createElement(N.Button,{type:"button",ref:T=>{this._cancelButton=T},className:"k-time-cancel",onClick:this.handleReject,title:C,"aria-label":C},C),r.createElement(N.Button,{type:"button",ref:T=>{this._acceptButton=T},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,title:I,"aria-label":I},I)))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const s=d.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}};let Te=Mt;Te.propTypes={cancelButton:n.bool,className:n.string,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool};Te.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:de,max:oe,boundRange:!1,footer:!0};k.registerForIntl(Te);k.registerForLocalization(Te);const K=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:a,format:o,steps:h}=this.props;return r.createElement(Te,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:a,nowButton:i,format:o,min:this.min,max:this.max,steps:h,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=d.classNames("k-group k-reset",e),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?r.createElement(this.props.popup,{...a},this.renderTimeSelector()):r.createElement(Qe.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(qe,M[Je]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(Ne,M[Ne]),onApply:i=>this.handleValueChange(i)}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.value||this.state.candidate;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,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=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||K.defaultProps.defaultValue,show:this.props.defaultShow||K.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(d.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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 s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),t=this.normalizeTime(this.max),i=Yi(s,e,t),a=this.props.validationMessage!==void 0,o=(!this.required||this.value!==null)&&i,h=this.props.valid!==void 0?this.props.valid:o;return{customError:a,rangeOverflow:Ki(s,t),rangeUnderflow:$i(s,e),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:K.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:K.defaultProps.required}get popupSettings(){return this.props.popupSettings||K.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:K.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:K.defaultProps.max}get dateInputComp(){return this.props.dateInput||K.defaultProps.dateInput}get localizationService(){return k.provideLocalizationService(this)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=K.defaultProps.size,rounded:e=K.defaultProps.rounded,fillMode:t=K.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:g,steps:f,validationMessage:v,required:C,validityStyles:I,ariaLabelledBy:T,ariaDescribedBy:b}=this.props,E=!this.validityStyles||this.validity.valid,w={disabled:i,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:T,ariaDescribedBy:b,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:g,onChange:this.handleInputValueChange,required:C,steps:f,tabIndex:this.show?-1:a,title:o,valid:this.validity.valid,validationMessage:v,validityStyles:I,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,readonly:this.mobileMode},A=this.localizationService.toLanguageString(qe,M[qe]),O=this.localizationService.toLanguageString(Dt,M[Dt]),P=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:B,onBlur:x})=>r.createElement(r.Fragment,null,r.createElement("div",{id:this.props.id,ref:V=>{this._element=V},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!E,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:B,onBlur:x,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...w}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:J.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:O,className:"k-input-button",rounded:null,"aria-label":A}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:E,editorDisabled:this.props.disabled,children:P,style:{width:this.props.width}}):P}normalizeTime(s){return q(L,s)}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(this.value,s):s}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ee=K;Ee.displayName="TimePicker";Ee.propTypes={className:n.string,cancelButton:n.bool,nowButton:n.bool,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};Ee.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:oe,min:de,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const _s=d.createPropsContext(),Hs=d.withIdHOC(d.withPropsContext(_s,Ee));Hs.displayName="KendoReactTimePicker";k.registerForLocalization(Ee);const Jt=2,Tt=class extends r.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get min(){return this.props.min!==void 0?this.props.min:Tt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Tt.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century});return r.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>r.createElement("table",{className:"k-calendar-table k-content",key:t.getTime(),role:"grid"},r.createElement(Le,{bus:this.props.bus,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let ke=Tt;ke.defaultProps={showWeekNumbers:!1,views:Jt,take:Jt,allowReverse:!0,min:te,max:se};const gt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>t instanceof Date&&!Array.isArray(t)&&F(l.getDate(t),s,e)?l.getDate(t):null,Qt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>Array.isArray(t)?t.filter(i=>F(i,s,e)).map(i=>l.getDate(i)):null,es=s=>typeof s=="object"&&!(s instanceof Date)&&s!==null&&!Array.isArray(s)?s:_,ts=(s,e,t)=>s||e&&e[0]||t&&t.start,vn=(s,e)=>s.start===null&&e===null?"start":s.end===null?"end":"start",ve=class extends r.Component{constructor(s){super(s),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=_,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=c=>({start:c,end:null}),this.rangeWithFocused=(c,p)=>({start:c.start,end:c.end===null&&c.start!==null&&this.isActive?p:c.end}),this.generateRange=(c,p)=>{let{end:m,start:g}=p;const f=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&f?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:g||this.selectedDate,end:c}},this.canNavigate=c=>{if(!this.service)return!1;const p=this.service.move(this.focusedDate,c);return this.min<=p&&p<=this.max||this.service.isInSameView(p,this.min)||this.service.isInSameView(p,this.max)},this.navigate=(c,p)=>{this.calculateFocusFromValue=!1;const m=this.move(c,p);this.setState({navigateDate:m,focusedDate:m})},this.move=(c,p)=>this.clampDate(this.service.move(p,c)),this.clampDate=c=>U(c,this.min,this.max),this.shouldAutoCorrect=(c,p)=>{const{end:m,start:g}=p;return this.activeRange!=="end"?m!==null&&c>m:g!==null&&c<g},this.handleCellEnter=c=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:c}))},this.handleMouseDown=c=>{c.preventDefault()},this.handleClick=c=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=c=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:p}=this.props;p&&p.call(void 0,c)},this.handleBlur=c=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:p}=this.props;p&&p.call(void 0,c)},this.handleTodayClick=c=>{this.todayIsInRange&&this.handleDateChange(c)},this.handlePrevButtonClick=()=>{const c=D.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(c,this.move(c,this.focusedDate));else{const p=this.isInMonth(this.focusedDate,this.dates[1])?this.move(c,this.focusedDate):this.focusedDate;this.navigate(c,p)}},this.handleNextButtonClick=()=>{this.navigate(D.NextView,this.focusedDate)},this.handleKeyDown=c=>{const{keyCode:p}=c;if(p===d.Keys.enter){const m={syntheticEvent:c,nativeEvent:c.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(m)}else{const m=U(this.navigation.move(this.focusedDate,this.navigation.action(c),this.state.activeView,this.service,c),this.min,this.max);if(l.isEqualDate(this.focusedDate,m))return;this.dates&&this.service&&!this.service.isInArray(m,this.dates)&&this.setState({navigateDate:m}),this.calculateFocusFromValue=!1,this.setState({focusedDate:m})}c.preventDefault()},this.handleViewChange=({view:c})=>{this.calculateFocusFromValue=!1,this.setState(p=>({activeView:c,navigateDate:p.focusedDate}))},this.handleDateChange=c=>{const p=l.cloneDate(c.value),m=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(m)if(c.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,c.syntheticEvent),this.setState({focusedDate:p});return}this.calculateFocusFromValue=!0;let g;switch(this.props.mode){case"single":g=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){let v=this.selectedMultiple.slice(),C=-1;v.forEach((I,T)=>{l.isEqualDate(I,c.value)&&(C=T)}),C!==-1?v.splice(C,1):v.push(l.cloneDate(c.value)),g=v.slice()}else this.selectedDate?g=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:g=[l.cloneDate(c.value)];break;case"range":{g=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(c.value):this.generateRange(c.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:g=l.cloneDate(c.value);break}this.valueDuringOnChange=g,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:g,focusedDate:p}),this.valueDuringOnChange=g;const{onChange:f}=this.props;if(f){const v={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:g,target:this};f.call(void 0,v)}this.valueDuringOnChange=void 0};const e=s.value!==void 0?s.value:s.defaultValue||ve.defaultProps.defaultValue,t=gt(this.min,this.max,e),i=Qt(this.min,this.max,e),a=es(e),o=ts(t,i,a),h=$e(S[s.defaultActiveView],this.bottomView,this.topView),u=U(s.focusedDate||o||H(),this.min,this.max);this.state={value:e,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=vn(a,t),this.bus=new Et(this.handleViewChange),this.navigation=new Ot(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||ke.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return l.cloneDate(this._focusedDate)}get min(){return l.getDate(this.props.min!==void 0?this.props.min:ve.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:ve.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ve.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ve.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return F(H(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const s=gt(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&s&&this.selectedDate.getTime()&&s.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||ke.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=k.provideIntlService(this),this.localization=k.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const s=$e(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(s,this.intl),this.selectedDate=gt(this.min,this.max,this.value),this.selectedMultiple=Qt(this.min,this.max,this.value),this.selectedRange=es(this.value);const e=ts(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=U(this.calculateFocusFromValue&&e!==null?e:this.state.focusedDate,this.min,this.max);const t=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),i=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(ft,M[ft]),o=this.localization.toLanguageString(vt,M[vt]),h=!this.canNavigate(D.PrevView),u=!this.canNavigate(D.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==s,g=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),f=this.lastViewsCount!==this.props.views;(!g||m||f)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||ke.defaultProps.views));const v=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:H());return r.createElement("div",{ref:C=>{this._element=C},className:t,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},r.createElement(xe,{key:`.kendo.calendar.header.${v.getTime()}`,activeView:s,currentDate:v,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:r.createElement(r.Fragment,null,r.createElement(N.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?J.chevronRightIcon:J.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),r.createElement(Ie,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),r.createElement(N.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?J.chevronLeftIcon:J.chevronRightIcon,fillMode:"flat",title:o,disabled:u,onClick:this.handleNextButtonClick,...p}))}),r.createElement(ke,{ref:C=>{this.calendarViewList=C},dates:this.dates,activeView:s,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:i,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(s,e){return!!e&&l.firstDayOfMonth(e)<=s&&s<=l.lastDayOfMonth(e)}};let Q=ve;Q.displayName="MultiViewCalendar";Q.propTypes={activeRangeEnd:n.oneOf(["start","end"]),allowReverse:n.bool,bottomView:n.oneOf(["month","year","decade","century"]),className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.oneOfType([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date)),end:ee(n.instanceOf(Date))})]),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),mode:n.oneOf(["single","multiple","range"]),onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,topView:n.oneOf(["month","year","decade","century"]),value:n.oneOfType([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})]),views:(s,e,t)=>{const i=s[e];return i!==void 0&&i<1?new Error(`Invalid prop '${e}' supplied to'${t}'. The '${e}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string};Q.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const As=d.createPropsContext(),Bt=d.withIdHOC(d.withPropsContext(As,Q));Bt.displayName="KendoReactMultiViewCalendar";k.registerForIntl(Q);k.registerForLocalization(Q);const Pe=class extends r.Component{constructor(s){super(s),this._element=null,this._calendar=null,this._startDateInput=r.createRef(),this._endDateInput=r.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(e.value!==void 0?e.value:t.value)||_,this.calculateShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderCalendar=()=>{const e=this.value||_,t={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?r.createElement(this.props.calendar,{...t}):r.createElement(Bt,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:"k-daterangepicker-popup",animate:this._element!==null,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?r.createElement(this.props.popup,{...e},this.renderCalendar()):r.createElement(Qe.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:i=>this.handleCancel(i),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(St,M[St]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(Ct,M[Ct]),onApply:this.handleBlur}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},r.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||(this.setShow(!0),this.mobileMode&&this.setState({currentValue:this.value}));const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:_})});const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:l.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:l.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||_;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?t:this.value.start,end:this.value.start!==null?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e,a=d.getActiveElement(document);t===d.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===d.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0)):t===d.Keys.tab&&this.show&&this._calendar&&this._calendar.element&&this.endDateInput&&this.endDateInput.element&&document&&a===this.endDateInput.element&&(e.preventDefault(),this.focusCalendarElement())},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(Se),this.state={show:this.props.show||this.props.defaultShow||Pe.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Pe.defaultProps.defaultValue,currentValue:_},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||_}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:Pe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Pe.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return k.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=this.value||_,e=this.mobileMode&&this.show?this.state.currentValue:s,t=(this.props.startDateInputSettings||{}).id||this._startInputId,i=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),o=this.localizationService.toLanguageString(Ze,M[Ze]),h=this.localizationService.toLanguageString(Ge,M[Ge]),u=this.localizationService.toLanguageString(Xe,M[Xe]),c={disableSelection:this.mobileMode&&!0,label:o,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.startDateInputSettings,value:e.start,onChange:this.handleStartChange},p={disableSelection:this.mobileMode&&!0,label:h,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.endDateInputSettings,value:e.end,onChange:this.handleEndChange},m=r.createElement(N.Button,{type:"button",className:"k-select",fillMode:"flat",title:k.provideLocalizationService(this).toLanguageString(De,M[De]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":t+" "+i,"aria-label":k.provideLocalizationService(this).toLanguageString(De,M[De])},r.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:J.arrowsSwapIcon}));return r.createElement(r.Fragment,null,r.createElement("span",{ref:g=>{this._element=g},className:a,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onKeyDown:this.handleKeyDown,dir:this.props.dir},this.props.startDateInput?r.createElement(this.props.startDateInput,{...c}):r.createElement(ae,{...c,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?m:u,this.props.endDateInput?r.createElement(this.props.endDateInput,{...p}):r.createElement(ae,{...p,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const s=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&s!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):s!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Oe=Pe;Oe.displayName="DateRangePicker";Oe.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(re.propTypes),focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),onBlur:n.func,onChange:n.func,onFocus:n.func,popupSettings:n.any,show:n.bool,startDateInputSettings:n.any,style:n.any,swapButton:n.any,tabIndex:n.number,dir:n.string,value:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})};Oe.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:_,disabled:!1,format:"d",max:se,min:te,swapButton:!1};const Bs=d.createPropsContext(),zs=d.withIdHOC(d.withPropsContext(Bs,Oe));zs.displayName="KendoReactDateRangePicker";k.registerForLocalization(Oe);class zt extends r.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=t=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(t);const i=this.calendarElement();this.state.tab==="date"&&i&&i.focus(t)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=t=>{if(t==="right"&&this.state.tab==="time"||t==="left"&&this.state.tab==="date")return;const i=t==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:i})},this.dateTimeFooter=()=>{const{cancelButton:t}=this.props,i=this.localizationService.toLanguageString(Re,M[Re]),a=this.localizationService.toLanguageString(Fe,M[Fe]);return r.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched "},t&&r.createElement(N.Button,{type:"button",ref:o=>{this._cancelButton=o},className:"k-time-cancel",onClick:this.handleReject,title:i,"aria-label":i},i),r.createElement(N.Button,{type:"button",themeColor:"primary",ref:o=>{this._acceptButton=o},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,title:a,"aria-label":a},a))},this.handleReject=t=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||L});const i=this.mergeDate(this.props.value,this.props.value||L);if(this.props.onReject){const a={nativeEvent:t.nativeEvent,syntheticEvent:t,target:this,value:i};this.props.onReject.call(void 0,a)}},this.handleAccept=(t,i)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,i||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:a,target:this})},this.handleNowClick=t=>{this.setState({timeValue:ue()}),this.handleAccept(t,ue())},this.handleCalendarValueChange=t=>{t.syntheticEvent.stopPropagation(),this.setState({dateValue:t.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=t=>{this.setState({timeValue:t})},this.handleDateClick=t=>{t.stopPropagation(),this.move("left")},this.handleTimeClick=t=>{t.stopPropagation(),this.move("right")},this.handleKeyDown=t=>{const{keyCode:i,altKey:a}=t;switch(i){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(t);return;case d.Keys.left:if(!a)return;this.move("left");return;case d.Keys.right:if(!a)return;this.move("right");return;default:return}},this.handleTimePartMount=t=>{this.setState({timeValue:t})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||L}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return k.provideLocalizationService(this)}componentDidUpdate(){this.shouldFocusPart&&this.focus({preventScroll:!0}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o,format:h,mobileMode:u,footerActions:c}=this.props,p=d.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":e},"k-datetime-wrap"),m=this.localizationService.toLanguageString(yt,M[yt]),g=this.localizationService.toLanguageString(kt,M[kt]),f={min:t,max:i,weekNumber:a,focusedDate:o,disabled:e||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,mobileMode:u};return r.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},r.createElement("div",{className:"k-datetime-buttongroup"},r.createElement(N.ButtonGroup,{width:"100%"},r.createElement(N.Button,{type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick},m),r.createElement(N.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick},g))),r.createElement("div",{className:"k-datetime-selector"},r.createElement("div",{className:"k-datetime-calendar-wrap",ref:v=>this._calendarWrap=v},this.props.calendar?r.createElement(this.props.calendar,{...f}):r.createElement(tt,{ref:v=>{this._calendar=v},...f})),r.createElement("div",{className:"k-datetime-time-wrap"},r.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},r.createElement(pe,{key:1,onNowClick:this.handleNowClick,disabled:e||this.state.tab!=="time",ref:v=>{this._timePart=v},min:this.minTime||de,max:this.maxTime||oe,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:u})))),c&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return l.isEqualDate(e,t||H())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=d.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?q(t,e):t}mergeDate(e,t){return e?q(e||H(),t):t}}zt.defaultProps={footerActions:!0};k.registerForLocalization(zt);const X=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:a,calendar:o,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return r.createElement(zt,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:u,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:c,format:a,calendar:o,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=k.provideLocalizationService(this).toLanguageString(Re,M[Re]),i=k.provideLocalizationService(this).toLanguageString(Fe,M[Fe]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(o)},applyText:i,onApply:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(o)}}};return r.createElement(st,{...a},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,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.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(Se),this.state={value:this.props.defaultValue||X.defaultProps.defaultValue,show:this.props.defaultShow||X.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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 mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:X.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:X.defaultProps.max}get validity(){const s=as(this.value,this.min,this.max)&&Ft(this.value,this.props.minTime||de,this.props.maxTime||oe),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:X.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:X.defaultProps.required}get dateInputComp(){return this.props.dateInput||X.defaultProps.dateInput}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const s=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),s&&!this.show&&this.shouldFocusDateInput&&s.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=X.defaultProps.size,rounded:e=X.defaultProps.rounded,fillMode:t=X.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:g,width:f,name:v,validationMessage:C,required:I,validityStyles:T,minTime:b,maxTime:E,ariaLabelledBy:w,ariaDescribedBy:A,popup:O=Qe.Popup}=this.props,P=!this.validityStyles||this.validity.valid,B={id:h,ariaLabelledBy:w,ariaDescribedBy:A,format:u,formatPlaceholder:c,disabled:i,title:o,validityStyles:T,validationMessage:C,required:I,min:p,max:m,minTime:b,maxTime:E,name:v,tabIndex:this.show?-1:a,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},x=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:V,onBlur:G})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:Y=>{this._element=Y},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:this.mobileMode?void 0:V,onBlur:G,onClick:this.mobileMode?this.handleDateIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...B}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:J.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:k.provideLocalizationService(this).toLanguageString(ye,M[ye]),className:"k-input-button",rounded:null,"aria-label":k.provideLocalizationService(this).toLanguageString(ye,M[ye])}),r.createElement(O,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:"k-datetime-container k-reset",id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:x,style:{width:this.props.width}}):x}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ve=X;Ve.displayName="DateTimePicker";Ve.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,cancelButton:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};Ve.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const qs=d.createPropsContext(),Ws=d.withIdHOC(d.withPropsContext(qs,Ve));Ws.displayName="KendoReactDateTimePicker";k.registerForLocalization(Ve);exports.Action=D;exports.BusViewService=Et;exports.Calendar=tt;exports.CalendarCell=is;exports.CalendarHeaderTitle=fs;exports.CalendarNavigationItem=ws;exports.CalendarPropsContext=Ds;exports.CalendarViewEnum=S;exports.CalendarWeekCell=ns;exports.CalendarWithoutContext=ne;exports.CenturyViewService=ls;exports.DOMService=ds;exports.DateInput=ae;exports.DateInputPropsContext=ks;exports.DateInputWithoutContext=re;exports.DatePicker=Is;exports.DatePickerPropsContext=xs;exports.DatePickerWithoutContext=Me;exports.DateRangePicker=zs;exports.DateRangePickerPropsContext=Bs;exports.DateRangePickerWithoutContext=Oe;exports.DateTimePicker=Ws;exports.DateTimePickerPropsContext=qs;exports.DateTimePickerWithoutContext=Ve;exports.DayPeriodService=Ms;exports.DecadeViewService=hs;exports.EMPTY_SELECTIONRANGE=_;exports.Header=xe;exports.HorizontalViewList=ke;exports.HoursService=Os;exports.MAX_DATE=se;exports.MAX_TIME=oe;exports.MIN_DATE=te;exports.MIN_TIME=de;exports.MinutesService=Ns;exports.MonthViewService=cs;exports.MultiViewCalendar=Bt;exports.MultiViewCalendarPropsContext=As;exports.MultiViewCalendarWithoutContext=Q;exports.NavigationService=Ot;exports.PickerWrap=Cs;exports.ScrollSyncService=ps;exports.SecondsService=Ls;exports.TimeList=He;exports.TimePart=pe;exports.TimePicker=Hs;exports.TimePickerPropsContext=_s;exports.TimePickerWithoutContext=Ee;exports.TimeSelector=Te;exports.TodayCommand=Ie;exports.ToggleButton=Ss;exports.ViewList=_e;exports.Virtualization=Ce;exports.WeekNamesService=ms;exports.YearViewService=us;exports.dateInputsMessages=M;exports.decreaseValue=be;exports.end=Ge;exports.getNow=ue;exports.getToday=H;exports.increaseValue=we;exports.separator=Xe;exports.start=Ze;exports.swapStartEnd=De;exports.today=Ke;exports.toggleCalendar=je;exports.toggleDateTimeSelector=ye;
|
|
21
|
+
`);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool};He.defaultProps={boundRange:!1,max:oe,min:L,step:1,smoothScroll:!0};k.registerForIntl(He);const mt=new RegExp(`${j.hour}|${j.minute}|${j.second}|${j.dayperiod}|literal`),he=class extends r.Component{constructor(s){super(s),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=e=>{Promise.resolve().then(()=>{const t=this.timeLists[0];this.state.activeListIndex===-1&&!this.hasActiveButton()&&t&&t.element&&t.focus(e)})},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const a=t>=1&&i[t-1];return a&&a&&e.type==="literal"?mt.test(a.type||""):mt.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(t=>e===1?t.next:t.prev).map(t=>t&&t.element&&t.element.focus({preventScroll:!0}))},this.listReducer=(e,t,i,a)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:a[i+1]||t,prev:a[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Ft(ue(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.left:e.preventDefault(),this.focusList(0);return;case d.Keys.right:e.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=Yt(Ut(this.props.steps,this.props.min||he.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ui(this.snapTime(l.cloneDate(this.props.value||L)),this.min,this.max)}get intl(){return k.provideIntlService(this)}get min(){return this.snapTime(this.props.min||he.defaultProps.min)}get max(){return this.snapTime(this.props.max||he.defaultProps.max)}get steps(){return this.props.steps||he.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:he.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:s}=this.props;s&&s.call(void 0,this.value)}render(){const{format:s,smoothScroll:e,onNowClick:t,className:i,disabled:a,mobileMode:o,show:h}=this.props;this.snapTime=Yt(Ut(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(s||he.defaultProps.format).filter(this.timeFormatFilter);const u=d.classNames({"k-disabled":a,"k-time-part":o},i);this.timeLists=[];const c=k.provideLocalizationService(this),p=c.toLanguageString(bt,M[bt]);return r.createElement("div",{className:u},r.createElement("div",{className:"k-time-header"},r.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&r.createElement(N.Button,{type:"button",ref:m=>{this._nowButton=m},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:p,"aria-label":p,onClick:t,tabIndex:a?-1:0},c.toLanguageString(wt,M[wt]))),r.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},r.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((m,g)=>m.type!=="literal"?r.createElement("div",{key:g,className:d.classNames("k-time-list-wrapper",{"k-focus":g===this.state.activeListIndex}),role:"presentation",tabIndex:-1},r.createElement("span",{className:"k-title",onMouseDown:f=>{f.preventDefault()}},this.intl.dateFieldName(m)),r.createElement(He,{min:this.min,max:this.max,boundRange:this.boundRange,part:m,step:m.type?this.steps[m.type]:1,smoothScroll:e,ref:f=>{f&&this.timeLists.push(f)},id:g,onFocus:()=>{this.handleListFocus(g)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:o})):r.createElement("div",{key:g,className:"k-time-separator"},m.pattern))))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){const s=d.getActiveElement(document);return this._nowButton&&s===this._nowButton.element}hasSteps(){const s=Object.keys(this.steps);return s.length!==s.reduce((e,t)=>e+this.steps[t],0)}};let pe=he;pe.propTypes={cancelButton:n.bool,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool};pe.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:de,max:oe,steps:{},boundRange:!1};k.registerForIntl(pe);k.registerForLocalization(pe);const Mt=class extends r.Component{constructor(s){super(s),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(e);return;default:return}},this.handleAccept=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),ue());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||Mt.defaultProps.format),this.mergeValue=Wi(qi(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||L,value:this.props.value||Mt.defaultProps.value}}get element(){return this._element}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):null}get intl(){return k.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:s,cancelButton:e,disabled:t,tabIndex:i,className:a,smoothScroll:o,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:g,mobileMode:f}=this.props,v=k.provideLocalizationService(this),C=v.toLanguageString(Je,M[Je]),I=v.toLanguageString(Ne,M[Ne]);return r.createElement("div",{ref:T=>{this._element=T},tabIndex:t?void 0:i||0,className:d.classNames("k-timeselector",a,{"k-disabled":t}),onKeyDown:this.handleKeyDown},r.createElement(pe,{ref:T=>{this.timePart=T},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:s,smoothScroll:o,min:h,max:u,boundRange:c,disabled:t,nowButton:p,steps:m,show:g,mobileMode:f}),this.props.footer&&r.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},e&&r.createElement(N.Button,{type:"button",ref:T=>{this._cancelButton=T},className:"k-time-cancel",onClick:this.handleReject,title:C,"aria-label":C},C),r.createElement(N.Button,{type:"button",ref:T=>{this._acceptButton=T},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,title:I,"aria-label":I},I)))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const s=d.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}};let Te=Mt;Te.propTypes={cancelButton:n.bool,className:n.string,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool};Te.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:de,max:oe,boundRange:!1,footer:!0};k.registerForIntl(Te);k.registerForLocalization(Te);const K=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:a,format:o,steps:h}=this.props;return r.createElement(Te,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:a,nowButton:i,format:o,min:this.min,max:this.max,steps:h,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=d.classNames("k-group k-reset",e),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?r.createElement(this.props.popup,{...a},this.renderTimeSelector()):r.createElement(Qe.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(qe,M[Je]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(Ne,M[Ne]),onApply:i=>this.handleValueChange(i)}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.value||this.state.candidate;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,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=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||K.defaultProps.defaultValue,show:this.props.defaultShow||K.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(d.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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 s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),t=this.normalizeTime(this.max),i=Yi(s,e,t),a=this.props.validationMessage!==void 0,o=(!this.required||this.value!==null)&&i,h=this.props.valid!==void 0?this.props.valid:o;return{customError:a,rangeOverflow:Ki(s,t),rangeUnderflow:$i(s,e),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:K.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:K.defaultProps.required}get popupSettings(){return this.props.popupSettings||K.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:K.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:K.defaultProps.max}get dateInputComp(){return this.props.dateInput||K.defaultProps.dateInput}get localizationService(){return k.provideLocalizationService(this)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=K.defaultProps.size,rounded:e=K.defaultProps.rounded,fillMode:t=K.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:g,steps:f,validationMessage:v,required:C,validityStyles:I,ariaLabelledBy:T,ariaDescribedBy:b}=this.props,E=!this.validityStyles||this.validity.valid,w={disabled:i,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:T,ariaDescribedBy:b,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:g,onChange:this.handleInputValueChange,required:C,steps:f,tabIndex:this.show?-1:a,title:o,valid:this.validity.valid,validationMessage:v,validityStyles:I,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,readonly:this.mobileMode},A=this.localizationService.toLanguageString(qe,M[qe]),O=this.localizationService.toLanguageString(Dt,M[Dt]),P=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:B,onBlur:x})=>r.createElement(r.Fragment,null,r.createElement("div",{id:this.props.id,ref:V=>{this._element=V},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!E,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:B,onBlur:x,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...w}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:J.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:O,className:"k-input-button",rounded:null,"aria-label":A}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:E,editorDisabled:this.props.disabled,children:P,style:{width:this.props.width}}):P}normalizeTime(s){return q(L,s)}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(this.value,s):s}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ee=K;Ee.displayName="TimePicker";Ee.propTypes={className:n.string,cancelButton:n.bool,nowButton:n.bool,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};Ee.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:oe,min:de,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const _s=d.createPropsContext(),Hs=d.withIdHOC(d.withPropsContext(_s,Ee));Hs.displayName="KendoReactTimePicker";k.registerForLocalization(Ee);const Jt=2,Tt=class extends r.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get min(){return this.props.min!==void 0?this.props.min:Tt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Tt.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century});return r.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>r.createElement("table",{className:"k-calendar-table k-content",key:t.getTime(),role:"grid"},r.createElement(Le,{bus:this.props.bus,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let ke=Tt;ke.defaultProps={showWeekNumbers:!1,views:Jt,take:Jt,allowReverse:!0,min:te,max:se};const gt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>t instanceof Date&&!Array.isArray(t)&&F(l.getDate(t),s,e)?l.getDate(t):null,Qt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>Array.isArray(t)?t.filter(i=>F(i,s,e)).map(i=>l.getDate(i)):null,es=s=>typeof s=="object"&&!(s instanceof Date)&&s!==null&&!Array.isArray(s)?s:_,ts=(s,e,t)=>s||e&&e[0]||t&&t.start,vn=(s,e)=>s.start===null&&e===null?"start":s.end===null?"end":"start",ve=class extends r.Component{constructor(s){super(s),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=_,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=c=>({start:c,end:null}),this.rangeWithFocused=(c,p)=>({start:c.start,end:c.end===null&&c.start!==null&&this.isActive?p:c.end}),this.generateRange=(c,p)=>{let{end:m,start:g}=p;const f=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&f?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:g||this.selectedDate,end:c}},this.canNavigate=c=>{if(!this.service)return!1;const p=this.service.move(this.focusedDate,c);return this.min<=p&&p<=this.max||this.service.isInSameView(p,this.min)||this.service.isInSameView(p,this.max)},this.navigate=(c,p)=>{this.calculateFocusFromValue=!1;const m=this.move(c,p);this.setState({navigateDate:m,focusedDate:m})},this.move=(c,p)=>this.clampDate(this.service.move(p,c)),this.clampDate=c=>U(c,this.min,this.max),this.shouldAutoCorrect=(c,p)=>{const{end:m,start:g}=p;return this.activeRange!=="end"?m!==null&&c>m:g!==null&&c<g},this.handleCellEnter=c=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:c}))},this.handleMouseDown=c=>{c.preventDefault()},this.handleClick=c=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=c=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:p}=this.props;p&&p.call(void 0,c)},this.handleBlur=c=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:p}=this.props;p&&p.call(void 0,c)},this.handleTodayClick=c=>{this.todayIsInRange&&this.handleDateChange(c)},this.handlePrevButtonClick=()=>{const c=D.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(c,this.move(c,this.focusedDate));else{const p=this.isInMonth(this.focusedDate,this.dates[1])?this.move(c,this.focusedDate):this.focusedDate;this.navigate(c,p)}},this.handleNextButtonClick=()=>{this.navigate(D.NextView,this.focusedDate)},this.handleKeyDown=c=>{const{keyCode:p}=c;if(p===d.Keys.enter){const m={syntheticEvent:c,nativeEvent:c.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(m)}else{const m=U(this.navigation.move(this.focusedDate,this.navigation.action(c),this.state.activeView,this.service,c),this.min,this.max);if(l.isEqualDate(this.focusedDate,m))return;this.dates&&this.service&&!this.service.isInArray(m,this.dates)&&this.setState({navigateDate:m}),this.calculateFocusFromValue=!1,this.setState({focusedDate:m})}c.preventDefault()},this.handleViewChange=({view:c})=>{this.calculateFocusFromValue=!1,this.setState(p=>({activeView:c,navigateDate:p.focusedDate}))},this.handleDateChange=c=>{const p=l.cloneDate(c.value),m=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(m)if(c.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,c.syntheticEvent),this.setState({focusedDate:p});return}this.calculateFocusFromValue=!0;let g;switch(this.props.mode){case"single":g=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){let v=this.selectedMultiple.slice(),C=-1;v.forEach((I,T)=>{l.isEqualDate(I,c.value)&&(C=T)}),C!==-1?v.splice(C,1):v.push(l.cloneDate(c.value)),g=v.slice()}else this.selectedDate?g=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:g=[l.cloneDate(c.value)];break;case"range":{g=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(c.value):this.generateRange(c.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:g=l.cloneDate(c.value);break}this.valueDuringOnChange=g,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:g,focusedDate:p}),this.valueDuringOnChange=g;const{onChange:f}=this.props;if(f){const v={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:g,target:this};f.call(void 0,v)}this.valueDuringOnChange=void 0};const e=s.value!==void 0?s.value:s.defaultValue||ve.defaultProps.defaultValue,t=gt(this.min,this.max,e),i=Qt(this.min,this.max,e),a=es(e),o=ts(t,i,a),h=$e(S[s.defaultActiveView],this.bottomView,this.topView),u=U(s.focusedDate||o||H(),this.min,this.max);this.state={value:e,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=vn(a,t),this.bus=new Et(this.handleViewChange),this.navigation=new Ot(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||ke.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return l.cloneDate(this._focusedDate)}get min(){return l.getDate(this.props.min!==void 0?this.props.min:ve.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:ve.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ve.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ve.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return F(H(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const s=gt(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&s&&this.selectedDate.getTime()&&s.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||ke.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=k.provideIntlService(this),this.localization=k.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const s=$e(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(s,this.intl),this.selectedDate=gt(this.min,this.max,this.value),this.selectedMultiple=Qt(this.min,this.max,this.value),this.selectedRange=es(this.value);const e=ts(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=U(this.calculateFocusFromValue&&e!==null?e:this.state.focusedDate,this.min,this.max);const t=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),i=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(ft,M[ft]),o=this.localization.toLanguageString(vt,M[vt]),h=!this.canNavigate(D.PrevView),u=!this.canNavigate(D.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==s,g=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),f=this.lastViewsCount!==this.props.views;(!g||m||f)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||ke.defaultProps.views));const v=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:H());return r.createElement("div",{ref:C=>{this._element=C},className:t,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},r.createElement(xe,{key:`.kendo.calendar.header.${v.getTime()}`,activeView:s,currentDate:v,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:r.createElement(r.Fragment,null,r.createElement(N.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?J.chevronRightIcon:J.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),r.createElement(Ie,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),r.createElement(N.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?J.chevronLeftIcon:J.chevronRightIcon,fillMode:"flat",title:o,disabled:u,onClick:this.handleNextButtonClick,...p}))}),r.createElement(ke,{ref:C=>{this.calendarViewList=C},dates:this.dates,activeView:s,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:i,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(s,e){return!!e&&l.firstDayOfMonth(e)<=s&&s<=l.lastDayOfMonth(e)}};let Q=ve;Q.displayName="MultiViewCalendar";Q.propTypes={activeRangeEnd:n.oneOf(["start","end"]),allowReverse:n.bool,bottomView:n.oneOf(["month","year","decade","century"]),className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.oneOfType([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date)),end:ee(n.instanceOf(Date))})]),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),mode:n.oneOf(["single","multiple","range"]),onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,topView:n.oneOf(["month","year","decade","century"]),value:n.oneOfType([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})]),views:(s,e,t)=>{const i=s[e];return i!==void 0&&i<1?new Error(`Invalid prop '${e}' supplied to'${t}'. The '${e}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string};Q.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const As=d.createPropsContext(),Bt=d.withIdHOC(d.withPropsContext(As,Q));Bt.displayName="KendoReactMultiViewCalendar";k.registerForIntl(Q);k.registerForLocalization(Q);const Pe=class extends r.Component{constructor(s){super(s),this._element=null,this._calendar=null,this._startDateInput=r.createRef(),this._endDateInput=r.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(e.value!==void 0?e.value:t.value)||_,this.calculateShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderCalendar=()=>{const e=this.value||_,t={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?r.createElement(this.props.calendar,{...t}):r.createElement(Bt,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:"k-daterangepicker-popup",animate:this._element!==null,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?r.createElement(this.props.popup,{...e},this.renderCalendar()):r.createElement(Qe.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:i=>this.handleCancel(i),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(St,M[St]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(Ct,M[Ct]),onApply:this.handleBlur}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},r.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:_})});const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:l.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:l.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||_;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?t:this.value.start,end:this.value.start!==null?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;t===d.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===d.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):i&&t===d.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(Se),this.state={show:this.props.show||this.props.defaultShow||Pe.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Pe.defaultProps.defaultValue,currentValue:_},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||_}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:Pe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Pe.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return k.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=this.value||_,e=this.mobileMode&&this.show?this.state.currentValue:s,t=(this.props.startDateInputSettings||{}).id||this._startInputId,i=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),o=this.localizationService.toLanguageString(Ze,M[Ze]),h=this.localizationService.toLanguageString(Ge,M[Ge]),u=this.localizationService.toLanguageString(Xe,M[Xe]),c={disableSelection:this.mobileMode&&!0,label:o,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.startDateInputSettings,value:e.start,onChange:this.handleStartChange},p={disableSelection:this.mobileMode&&!0,label:h,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.endDateInputSettings,value:e.end,onChange:this.handleEndChange},m=r.createElement(N.Button,{type:"button",className:"k-select",fillMode:"flat",title:k.provideLocalizationService(this).toLanguageString(De,M[De]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":t+" "+i,"aria-label":k.provideLocalizationService(this).toLanguageString(De,M[De])},r.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:J.arrowsSwapIcon}));return r.createElement(r.Fragment,null,r.createElement("span",{ref:g=>{this._element=g},className:a,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?r.createElement(this.props.startDateInput,{...c}):r.createElement(ae,{...c,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?m:u,this.props.endDateInput?r.createElement(this.props.endDateInput,{...p}):r.createElement(ae,{...p,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const s=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&s!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):s!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Oe=Pe;Oe.displayName="DateRangePicker";Oe.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(re.propTypes),focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),onBlur:n.func,onChange:n.func,onFocus:n.func,popupSettings:n.any,show:n.bool,startDateInputSettings:n.any,style:n.any,swapButton:n.any,tabIndex:n.number,dir:n.string,value:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})};Oe.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:_,disabled:!1,format:"d",max:se,min:te,swapButton:!1};const Bs=d.createPropsContext(),zs=d.withIdHOC(d.withPropsContext(Bs,Oe));zs.displayName="KendoReactDateRangePicker";k.registerForLocalization(Oe);class zt extends r.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=t=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(t);const i=this.calendarElement();this.state.tab==="date"&&i&&i.focus(t)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=t=>{if(t==="right"&&this.state.tab==="time"||t==="left"&&this.state.tab==="date")return;const i=t==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:i})},this.dateTimeFooter=()=>{const{cancelButton:t}=this.props,i=this.localizationService.toLanguageString(Re,M[Re]),a=this.localizationService.toLanguageString(Fe,M[Fe]);return r.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched "},t&&r.createElement(N.Button,{type:"button",ref:o=>{this._cancelButton=o},className:"k-time-cancel",onClick:this.handleReject,title:i,"aria-label":i},i),r.createElement(N.Button,{type:"button",themeColor:"primary",ref:o=>{this._acceptButton=o},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,title:a,"aria-label":a},a))},this.handleReject=t=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||L});const i=this.mergeDate(this.props.value,this.props.value||L);if(this.props.onReject){const a={nativeEvent:t.nativeEvent,syntheticEvent:t,target:this,value:i};this.props.onReject.call(void 0,a)}},this.handleAccept=(t,i)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,i||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:a,target:this})},this.handleNowClick=t=>{this.setState({timeValue:ue()}),this.handleAccept(t,ue())},this.handleCalendarValueChange=t=>{t.syntheticEvent.stopPropagation(),this.setState({dateValue:t.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=t=>{this.setState({timeValue:t})},this.handleDateClick=t=>{t.stopPropagation(),this.move("left")},this.handleTimeClick=t=>{t.stopPropagation(),this.move("right")},this.handleKeyDown=t=>{const{keyCode:i,altKey:a}=t;switch(i){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(t);return;case d.Keys.left:if(!a)return;this.move("left");return;case d.Keys.right:if(!a)return;this.move("right");return;default:return}},this.handleTimePartMount=t=>{this.setState({timeValue:t})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||L}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return k.provideLocalizationService(this)}componentDidUpdate(){this.shouldFocusPart&&this.focus({preventScroll:!0}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o,format:h,mobileMode:u,footerActions:c}=this.props,p=d.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":e},"k-datetime-wrap"),m=this.localizationService.toLanguageString(yt,M[yt]),g=this.localizationService.toLanguageString(kt,M[kt]),f={min:t,max:i,weekNumber:a,focusedDate:o,disabled:e||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,mobileMode:u};return r.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},r.createElement("div",{className:"k-datetime-buttongroup"},r.createElement(N.ButtonGroup,{width:"100%"},r.createElement(N.Button,{type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick},m),r.createElement(N.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick},g))),r.createElement("div",{className:"k-datetime-selector"},r.createElement("div",{className:"k-datetime-calendar-wrap",ref:v=>this._calendarWrap=v},this.props.calendar?r.createElement(this.props.calendar,{...f}):r.createElement(tt,{ref:v=>{this._calendar=v},...f})),r.createElement("div",{className:"k-datetime-time-wrap"},r.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},r.createElement(pe,{key:1,onNowClick:this.handleNowClick,disabled:e||this.state.tab!=="time",ref:v=>{this._timePart=v},min:this.minTime||de,max:this.maxTime||oe,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:u})))),c&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return l.isEqualDate(e,t||H())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=d.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?q(t,e):t}mergeDate(e,t){return e?q(e||H(),t):t}}zt.defaultProps={footerActions:!0};k.registerForLocalization(zt);const X=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:a,calendar:o,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return r.createElement(zt,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:u,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:c,format:a,calendar:o,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=k.provideLocalizationService(this).toLanguageString(Re,M[Re]),i=k.provideLocalizationService(this).toLanguageString(Fe,M[Fe]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(o)},applyText:i,onApply:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(o)}}};return r.createElement(st,{...a},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,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.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(Se),this.state={value:this.props.defaultValue||X.defaultProps.defaultValue,show:this.props.defaultShow||X.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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 mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:X.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:X.defaultProps.max}get validity(){const s=as(this.value,this.min,this.max)&&Ft(this.value,this.props.minTime||de,this.props.maxTime||oe),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:X.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:X.defaultProps.required}get dateInputComp(){return this.props.dateInput||X.defaultProps.dateInput}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const s=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),s&&!this.show&&this.shouldFocusDateInput&&s.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=X.defaultProps.size,rounded:e=X.defaultProps.rounded,fillMode:t=X.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:g,width:f,name:v,validationMessage:C,required:I,validityStyles:T,minTime:b,maxTime:E,ariaLabelledBy:w,ariaDescribedBy:A,popup:O=Qe.Popup}=this.props,P=!this.validityStyles||this.validity.valid,B={id:h,ariaLabelledBy:w,ariaDescribedBy:A,format:u,formatPlaceholder:c,disabled:i,title:o,validityStyles:T,validationMessage:C,required:I,min:p,max:m,minTime:b,maxTime:E,name:v,tabIndex:this.show?-1:a,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},x=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:V,onBlur:G})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:Y=>{this._element=Y},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:this.mobileMode?void 0:V,onBlur:G,onClick:this.mobileMode?this.handleDateIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...B}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:J.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:k.provideLocalizationService(this).toLanguageString(ye,M[ye]),className:"k-input-button",rounded:null,"aria-label":k.provideLocalizationService(this).toLanguageString(ye,M[ye])}),r.createElement(O,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:"k-datetime-container k-reset",id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:x,style:{width:this.props.width}}):x}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ve=X;Ve.displayName="DateTimePicker";Ve.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,cancelButton:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};Ve.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const qs=d.createPropsContext(),Ws=d.withIdHOC(d.withPropsContext(qs,Ve));Ws.displayName="KendoReactDateTimePicker";k.registerForLocalization(Ve);exports.Action=D;exports.BusViewService=Et;exports.Calendar=tt;exports.CalendarCell=is;exports.CalendarHeaderTitle=fs;exports.CalendarNavigationItem=ws;exports.CalendarPropsContext=Ds;exports.CalendarViewEnum=S;exports.CalendarWeekCell=ns;exports.CalendarWithoutContext=ne;exports.CenturyViewService=ls;exports.DOMService=ds;exports.DateInput=ae;exports.DateInputPropsContext=ks;exports.DateInputWithoutContext=re;exports.DatePicker=Is;exports.DatePickerPropsContext=xs;exports.DatePickerWithoutContext=Me;exports.DateRangePicker=zs;exports.DateRangePickerPropsContext=Bs;exports.DateRangePickerWithoutContext=Oe;exports.DateTimePicker=Ws;exports.DateTimePickerPropsContext=qs;exports.DateTimePickerWithoutContext=Ve;exports.DayPeriodService=Ms;exports.DecadeViewService=hs;exports.EMPTY_SELECTIONRANGE=_;exports.Header=xe;exports.HorizontalViewList=ke;exports.HoursService=Os;exports.MAX_DATE=se;exports.MAX_TIME=oe;exports.MIN_DATE=te;exports.MIN_TIME=de;exports.MinutesService=Ns;exports.MonthViewService=cs;exports.MultiViewCalendar=Bt;exports.MultiViewCalendarPropsContext=As;exports.MultiViewCalendarWithoutContext=Q;exports.NavigationService=Ot;exports.PickerWrap=Cs;exports.ScrollSyncService=ps;exports.SecondsService=Ls;exports.TimeList=He;exports.TimePart=pe;exports.TimePicker=Hs;exports.TimePickerPropsContext=_s;exports.TimePickerWithoutContext=Ee;exports.TimeSelector=Te;exports.TodayCommand=Ie;exports.ToggleButton=Ss;exports.ViewList=_e;exports.Virtualization=Ce;exports.WeekNamesService=ms;exports.YearViewService=us;exports.dateInputsMessages=M;exports.decreaseValue=be;exports.end=Ge;exports.getNow=ue;exports.getToday=H;exports.increaseValue=we;exports.separator=Xe;exports.start=Ze;exports.swapStartEnd=De;exports.today=Ke;exports.toggleCalendar=je;exports.toggleDateTimeSelector=ye;
|
package/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"use client";
|
|
6
6
|
import * as o from "react";
|
|
7
7
|
import n from "prop-types";
|
|
8
|
-
import { classNames as P, canUseDOM as J, createPropsContext as Dt, withIdHOC as yt, withPropsContext as St, Keys as C, validatePackage as Pt, setScrollbarWidth as fs, getActiveElement as
|
|
8
|
+
import { classNames as P, canUseDOM as J, createPropsContext as Dt, withIdHOC as yt, withPropsContext as St, Keys as C, validatePackage as Pt, setScrollbarWidth as fs, getActiveElement as lt, AsyncFocusBlur as we, kendoThemeMaps as mt, noop as Rs, IconWrap as ei } from "@progress/kendo-react-common";
|
|
9
9
|
import { getDate as x, cloneDate as v, addDecades as it, addCenturies as qt, firstDecadeOfCentury as oe, lastDecadeOfCentury as He, firstYearOfDecade as st, durationInCenturies as se, addYears as nt, lastYearOfDecade as Ae, durationInDecades as ie, addDays as Wt, addWeeks as gs, addMonths as $, firstDayOfMonth as fe, lastDayOfMonth as Ot, dayOfWeek as si, durationInMonths as ne, firstMonthOfYear as Ns, lastMonthOfYear as _s, createDate as le, durationInYears as ae, weekInYear as ii, isEqualDate as wt, isEqual as ht } from "@progress/kendo-date-math";
|
|
10
10
|
import { registerForIntl as ft, provideIntlService as ct, registerForLocalization as at, provideLocalizationService as q } from "@progress/kendo-react-intl";
|
|
11
11
|
import { Button as N, ButtonGroup as ni } from "@progress/kendo-react-buttons";
|
|
@@ -17,7 +17,7 @@ const Rt = {
|
|
|
17
17
|
name: "@progress/kendo-react-dateinputs",
|
|
18
18
|
productName: "KendoReact",
|
|
19
19
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
20
|
-
publishDate:
|
|
20
|
+
publishDate: 1702640739,
|
|
21
21
|
version: "",
|
|
22
22
|
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"
|
|
23
23
|
}, pi = (s, t, e) => [
|
|
@@ -2415,7 +2415,7 @@ const X = {
|
|
|
2415
2415
|
this.kendoDate.setValue(e), this.triggerChange(t, i);
|
|
2416
2416
|
}, this.spinnersMouseDown = (t) => {
|
|
2417
2417
|
t.preventDefault();
|
|
2418
|
-
const e =
|
|
2418
|
+
const e = lt(document);
|
|
2419
2419
|
this.element && e !== this.element && this.element.focus({ preventScroll: !0 });
|
|
2420
2420
|
}, this.handlePaste = () => {
|
|
2421
2421
|
this.paste = !0;
|
|
@@ -2441,9 +2441,9 @@ const X = {
|
|
|
2441
2441
|
}, this.elementClick = (t) => {
|
|
2442
2442
|
this.setSelection(this.selectionByIndex(this.selection.start));
|
|
2443
2443
|
}, this.nativeWheel = (t) => {
|
|
2444
|
-
|
|
2444
|
+
lt(document) === this.element && t.preventDefault();
|
|
2445
2445
|
}, this.wheel = (t) => {
|
|
2446
|
-
|
|
2446
|
+
lt(document) === this.element && (t.nativeEvent.deltaY < 0 && this.increasePart(t), t.nativeEvent.deltaY > 0 && this.decreasePart(t));
|
|
2447
2447
|
}, this.increasePart = (t) => {
|
|
2448
2448
|
this.modifyDateSegmentValue(1, t);
|
|
2449
2449
|
}, this.decreasePart = (t) => {
|
|
@@ -2720,7 +2720,7 @@ const X = {
|
|
|
2720
2720
|
}
|
|
2721
2721
|
setSelection(s) {
|
|
2722
2722
|
this._lastSelectedSymbol = this.currentFormat[s.start], window.requestAnimationFrame(() => {
|
|
2723
|
-
const t =
|
|
2723
|
+
const t = lt(document);
|
|
2724
2724
|
this.element && t === this.element && !this.props.disableSelection && this.element.setSelectionRange(s.start, s.end);
|
|
2725
2725
|
});
|
|
2726
2726
|
}
|
|
@@ -3788,7 +3788,7 @@ const ta = 2, Ms = 0.05, ea = 100, sa = 0, Ts = 9, ia = {
|
|
|
3788
3788
|
}, this.handleMouseOver = () => {
|
|
3789
3789
|
if (!this._element)
|
|
3790
3790
|
return;
|
|
3791
|
-
const t =
|
|
3791
|
+
const t = lt(document);
|
|
3792
3792
|
document && t !== this._element && this.props.show && this._element.focus({ preventScroll: !0 });
|
|
3793
3793
|
}, this.handleKeyDown = (t) => {
|
|
3794
3794
|
if (!this.service)
|
|
@@ -4124,7 +4124,7 @@ const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`
|
|
|
4124
4124
|
clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => s());
|
|
4125
4125
|
}
|
|
4126
4126
|
hasActiveButton() {
|
|
4127
|
-
const s =
|
|
4127
|
+
const s = lt(document);
|
|
4128
4128
|
return this._nowButton && s === this._nowButton.element;
|
|
4129
4129
|
}
|
|
4130
4130
|
hasSteps() {
|
|
@@ -4349,7 +4349,7 @@ const ss = class extends o.Component {
|
|
|
4349
4349
|
hasActiveButton() {
|
|
4350
4350
|
if (!this._acceptButton || !this._acceptButton.element)
|
|
4351
4351
|
return !1;
|
|
4352
|
-
const s =
|
|
4352
|
+
const s = lt(document);
|
|
4353
4353
|
return this._acceptButton && s === this._acceptButton.element || this._cancelButton && s === this._cancelButton.element;
|
|
4354
4354
|
}
|
|
4355
4355
|
};
|
|
@@ -4956,7 +4956,7 @@ Bt.defaultProps = {
|
|
|
4956
4956
|
min: ut,
|
|
4957
4957
|
max: dt
|
|
4958
4958
|
};
|
|
4959
|
-
const Le = (s =
|
|
4959
|
+
const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof Date && !Array.isArray(e) && F(x(e), s, t) ? x(e) : null, Vs = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => Array.isArray(e) ? e.filter((i) => F(i, s, t)).map((i) => x(i)) : null, Os = (s) => typeof s == "object" && !(s instanceof Date) && s !== null && !Array.isArray(s) ? s : z, Ps = (s, t, e) => s || t && t[0] || e && e.start, ra = (s, t) => s.start === null && t === null ? "start" : s.end === null ? "end" : "start", Et = class extends o.Component {
|
|
4960
4960
|
constructor(s) {
|
|
4961
4961
|
super(s), this.dates = [], this.selectedDate = null, this.selectedMultiple = null, this.selectedRange = z, this._focusedDate = /* @__PURE__ */ new Date(), this.cellUID = this.props.id + "-cell-uid", this.activeRangeEnd = "start", this._element = null, this.intl = null, this.localization = null, this.service = null, this.calendarViewList = null, this.isActive = !1, this.calculateFocusFromValue = !0, this.focus = () => {
|
|
4962
4962
|
this._element && this._element.focus();
|
|
@@ -5289,9 +5289,9 @@ const Le = (s = lt.defaultProps.min, t = lt.defaultProps.max, e) => e instanceof
|
|
|
5289
5289
|
return !!t && fe(t) <= s && s <= Ot(t);
|
|
5290
5290
|
}
|
|
5291
5291
|
};
|
|
5292
|
-
let
|
|
5293
|
-
|
|
5294
|
-
|
|
5292
|
+
let ot = Et;
|
|
5293
|
+
ot.displayName = "MultiViewCalendar";
|
|
5294
|
+
ot.propTypes = {
|
|
5295
5295
|
activeRangeEnd: n.oneOf(["start", "end"]),
|
|
5296
5296
|
allowReverse: n.bool,
|
|
5297
5297
|
bottomView: n.oneOf(["month", "year", "decade", "century"]),
|
|
@@ -5335,7 +5335,7 @@ lt.propTypes = {
|
|
|
5335
5335
|
weekNumber: n.bool,
|
|
5336
5336
|
dir: n.string
|
|
5337
5337
|
};
|
|
5338
|
-
|
|
5338
|
+
ot.defaultProps = {
|
|
5339
5339
|
disabled: !1,
|
|
5340
5340
|
min: ut,
|
|
5341
5341
|
max: dt,
|
|
@@ -5348,10 +5348,10 @@ lt.defaultProps = {
|
|
|
5348
5348
|
views: 2,
|
|
5349
5349
|
allowReverse: !1
|
|
5350
5350
|
};
|
|
5351
|
-
const oa = Dt(), Qs = yt(St(oa,
|
|
5351
|
+
const oa = Dt(), Qs = yt(St(oa, ot));
|
|
5352
5352
|
Qs.displayName = "KendoReactMultiViewCalendar";
|
|
5353
|
-
ft(
|
|
5354
|
-
at(
|
|
5353
|
+
ft(ot);
|
|
5354
|
+
at(ot);
|
|
5355
5355
|
const zt = class extends o.Component {
|
|
5356
5356
|
constructor(s) {
|
|
5357
5357
|
super(s), this._element = null, this._calendar = null, this._startDateInput = o.createRef(), this._endDateInput = o.createRef(), this.shouldFocusDateInput = !1, this.shouldFocusCalendar = !1, this.focus = () => {
|
|
@@ -5420,9 +5420,11 @@ const zt = class extends o.Component {
|
|
|
5420
5420
|
}, this.handleReverseMouseDown = (t) => {
|
|
5421
5421
|
t.preventDefault();
|
|
5422
5422
|
}, this.handleFocus = (t) => {
|
|
5423
|
-
clearTimeout(this.nextTickId), this.shouldFocusDateInput ||
|
|
5423
|
+
clearTimeout(this.nextTickId), this.shouldFocusDateInput || this.mobileMode && this.setState({ currentValue: this.value });
|
|
5424
5424
|
const { onFocus: e } = this.props;
|
|
5425
5425
|
e && e.call(void 0, t);
|
|
5426
|
+
}, this.handleClick = () => {
|
|
5427
|
+
this.shouldFocusDateInput || this.setShow(!0);
|
|
5426
5428
|
}, this.handleBlur = (t) => {
|
|
5427
5429
|
this.nextTick(() => {
|
|
5428
5430
|
this.setShow(!1);
|
|
@@ -5459,8 +5461,8 @@ const zt = class extends o.Component {
|
|
|
5459
5461
|
const e = this.extractRangeFromValue(t);
|
|
5460
5462
|
this.handleChange(e, t);
|
|
5461
5463
|
}, this.handleKeyDown = (t) => {
|
|
5462
|
-
const { keyCode: e, altKey: i } = t
|
|
5463
|
-
e === C.esc ? (t.preventDefault(), this.shouldFocusDateInput = !0, this.setShow(!1)) : i && e === C.down ? (t.preventDefault(), this.shouldFocusCalendar = !0, this.setShow(!0)
|
|
5464
|
+
const { keyCode: e, altKey: i } = t;
|
|
5465
|
+
e === C.esc ? (t.preventDefault(), this.shouldFocusDateInput = !0, this.setShow(!1)) : i && e === C.down ? (t.preventDefault(), this.shouldFocusCalendar = !0, this.setShow(!0), this.focusCalendarElement()) : i && e === C.up && (t.preventDefault(), this.shouldFocusDateInput = !0, this.setShow(!1));
|
|
5464
5466
|
}, this.handleChange = (t, e) => {
|
|
5465
5467
|
this.setState({ value: t }), this.valueDuringOnChange = t;
|
|
5466
5468
|
const { onChange: i } = this.props;
|
|
@@ -5630,8 +5632,9 @@ const zt = class extends o.Component {
|
|
|
5630
5632
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
5631
5633
|
tabIndex: this.props.tabIndex,
|
|
5632
5634
|
onFocus: this.handleFocus,
|
|
5633
|
-
|
|
5635
|
+
onClick: this.handleClick,
|
|
5634
5636
|
onKeyDown: this.handleKeyDown,
|
|
5637
|
+
onBlur: this.mobileMode ? void 0 : this.handleBlur,
|
|
5635
5638
|
dir: this.props.dir
|
|
5636
5639
|
},
|
|
5637
5640
|
this.props.startDateInput ? /* @__PURE__ */ o.createElement(this.props.startDateInput, { ...h }) : /* @__PURE__ */ o.createElement(
|
|
@@ -5661,7 +5664,7 @@ const zt = class extends o.Component {
|
|
|
5661
5664
|
focusDateInputElement() {
|
|
5662
5665
|
if (!document || !this.startDateInput || !this.startDateInput.element || !this.endDateInput || !this.endDateInput.element)
|
|
5663
5666
|
return;
|
|
5664
|
-
const s =
|
|
5667
|
+
const s = lt(document);
|
|
5665
5668
|
(this.value.start === null || this.value.end !== null) && s !== this.endDateInput.element ? this.startDateInput.element.focus({ preventScroll: !0 }) : s !== this.startDateInput.element && this.endDateInput.element.focus({ preventScroll: !0 });
|
|
5666
5669
|
}
|
|
5667
5670
|
nextTick(s) {
|
|
@@ -5961,7 +5964,7 @@ class ms extends o.Component {
|
|
|
5961
5964
|
hasActiveButton() {
|
|
5962
5965
|
if (!this._acceptButton)
|
|
5963
5966
|
return !1;
|
|
5964
|
-
const t =
|
|
5967
|
+
const t = lt(document);
|
|
5965
5968
|
return this._acceptButton && t === this._acceptButton.element || this._cancelButton && t === this._cancelButton.element;
|
|
5966
5969
|
}
|
|
5967
5970
|
mergeTime(t, e) {
|
|
@@ -6460,7 +6463,7 @@ export {
|
|
|
6460
6463
|
Ai as MonthViewService,
|
|
6461
6464
|
Qs as MultiViewCalendar,
|
|
6462
6465
|
oa as MultiViewCalendarPropsContext,
|
|
6463
|
-
|
|
6466
|
+
ot as MultiViewCalendarWithoutContext,
|
|
6464
6467
|
qs as NavigationService,
|
|
6465
6468
|
Vn as PickerWrap,
|
|
6466
6469
|
Ji as ScrollSyncService,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dateinputs",
|
|
3
|
-
"version": "7.0.2-develop.
|
|
3
|
+
"version": "7.0.2-develop.3",
|
|
4
4
|
"description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-date-math": "^1.4.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-buttons": "7.0.2-develop.
|
|
28
|
-
"@progress/kendo-react-common": "7.0.2-develop.
|
|
29
|
-
"@progress/kendo-react-intl": "7.0.2-develop.
|
|
30
|
-
"@progress/kendo-react-labels": "7.0.2-develop.
|
|
31
|
-
"@progress/kendo-react-layout": "7.0.2-develop.
|
|
32
|
-
"@progress/kendo-react-popup": "7.0.2-develop.
|
|
27
|
+
"@progress/kendo-react-buttons": "7.0.2-develop.3",
|
|
28
|
+
"@progress/kendo-react-common": "7.0.2-develop.3",
|
|
29
|
+
"@progress/kendo-react-intl": "7.0.2-develop.3",
|
|
30
|
+
"@progress/kendo-react-labels": "7.0.2-develop.3",
|
|
31
|
+
"@progress/kendo-react-layout": "7.0.2-develop.3",
|
|
32
|
+
"@progress/kendo-react-popup": "7.0.2-develop.3",
|
|
33
33
|
"@progress/kendo-svg-icons": "^2.0.0",
|
|
34
34
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
35
35
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|