@progress/kendo-react-dateinputs 10.1.1-develop.1 → 10.2.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),r=require("@progress/kendo-react-layout"),x=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),h=require("@progress/kendo-react-common");function k(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const n=k(y),C=t=>{const{footer:e,windowWidth:a=0,mobileFilter:o,children:s,navigatable:d,navigatableElements:u,expand:b,animation:p,title:m,subTitle:f,onClose:c}=t,g=()=>n.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:x.xIcon,onClick:c}),l=h.useAdaptiveModeContext(),v={navigatable:d||!1,navigatableElements:u||[],expand:b,animation:p!==!1,actions:g(),filter:o,onClose:c,animationStyles:l&&a<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:m,subTitle:f,className:"k-adaptive-actionsheet",position:l&&a<=l.small?"fullscreen":void 0};return n.createElement(r.ActionSheet,{...v},s,e&&n.createElement(r.ActionSheetFooter,{className:"k-actions k-actions-stretched"},n.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),n.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=C;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),r=require("@progress/kendo-react-layout"),x=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),h=require("@progress/kendo-react-common");function k(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const n=k(y),C=t=>{const{footer:e,windowWidth:a=0,mobileFilter:o,children:s,navigatable:d,navigatableElements:u,expand:b,animation:p,title:m,subTitle:f,onClose:c}=t,g=()=>n.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:x.xIcon,onClick:c}),l=h.useAdaptiveModeContext(),v={navigatable:d||!1,navigatableElements:u||[],expand:b,animation:p!==!1,suffixActions:g(),filter:o,onClose:c,animationStyles:l&&a<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:m,subTitle:f,className:"k-adaptive-actionsheet",position:l&&a<=l.small?"fullscreen":void 0};return n.createElement(r.ActionSheet,{...v},s,e&&n.createElement(r.ActionSheetFooter,{className:"k-actions k-actions-stretched"},n.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),n.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=C;
@@ -40,7 +40,7 @@ const I = (i) => {
40
40
  navigatableElements: m || [],
41
41
  expand: d,
42
42
  animation: p !== !1,
43
- actions: x(),
43
+ suffixActions: x(),
44
44
  filter: r,
45
45
  onClose: l,
46
46
  animationStyles: a && n <= a.small ? { top: 0, width: "100%", height: "100%" } : void 0,
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("react"),e=require("prop-types"),tt=require("@progress/kendo-react-popup"),L=require("@progress/kendo-date-math"),u=require("@progress/kendo-react-common"),nt=require("@progress/kendo-svg-icons"),ot=require("../dateinput/DateInput.js"),at=require("../calendar/components/Calendar.js"),a=require("../utils.js"),K=require("../messages/index.js"),rt=require("@progress/kendo-react-intl"),lt=require("./ToggleButton.js"),ut=require("../common/PickerWrap.js"),it=require("../hooks/usePickerFloatingLabel.js"),st=require("@progress/kendo-react-layout"),ct=require("../common/AdaptiveMode.js");function dt(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const f in n)if(f!=="default"){const M=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(h,f,M.get?M:{enumerable:!0,get:()=>n[f]})}}return h.default=n,Object.freeze(h)}const o=dt(et),W=o.forwardRef((n,h)=>{const f=u.useId(n.id),M=rt.useLocalization(),v=u.useAdaptiveModeContext(),{defaultShow:se=l.defaultShow,defaultValue:ce=l.defaultValue,dateInput:de=l.dateInput,calendar:fe=l.calendar,toggleButton:me=l.toggleButton,popup:ge=l.popup,pickerWrap:ft=l.pickerWrap,disabled:w=l.disabled,format:pe=l.format,max:_=l.max,min:E=l.min,popupSettings:y=l.popupSettings,tabIndex:be=l.tabIndex,weekNumber:he=l.weekNumber,validityStyles:j=l.validityStyles,size:T=l.size,rounded:x=l.rounded,fillMode:B=l.fillMode,autoFocus:ve=l.autoFocus,show:H,autoSwitchParts:we,autoSwitchKeys:ye,twoDigitYearMax:ke,ariaLabel:De,adaptive:mt,formatPlaceholder:Ce,adaptiveTitle:Pe,inputAttributes:Oe,validationMessage:U,visited:gt,value:q,touched:pt,modified:bt,_adaptiveMode:ht=v,valid:Y,focusedDate:Me,id:Re,ariaLabelledBy:Ie,...$}=u.usePropsContext(ie,n),A=()=>{if(u.canUseDOM)return D.current&&D.current.ownerDocument||window.document},c=()=>!!(b.windowWidth&&v&&b.windowWidth<=(v==null?void 0:v.medium)&&n.adaptive),m=()=>{const t=R.current!==void 0?R.current:q!==void 0?q:b.value;return t!==null?L.cloneDate(t):null},i=()=>I.current!==void 0?I.current:H!==void 0?H:b.show,Se=()=>de||l.dateInput,_e=()=>me||l.toggleButton,Ee=()=>fe||l.calendar,Te=()=>ge||l.popup,X=()=>n.required!==void 0?n.required:!1,N=()=>{const t=m()||q||null,r=E,s=_,S=a.isInDateRange(t,r,s),F=U!==void 0,V=(!X()||t!=null)&&S,z=Y!==void 0?Y:V;return{customError:F,rangeOverflow:t&&s.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<r.getTime()||!1,valid:z,valueMissing:t===null}},xe=t=>{for(const r of t)O({windowWidth:r.target.clientWidth})},Be=()=>{d.current&&d.current.focus()},Z=t=>{C.current=t},g=t=>{i()!==t&&(O({show:t}),t&&n.onOpen&&n.onOpen.call(void 0,{target:k.current}),!t&&n.onClose&&n.onClose.call(void 0,{target:k.current}))},qe=t=>{const r=m();return r&&t?a.setTime(t,r):t},Ae=t=>{y!=null&&y.onMouseDownOutside&&y.onMouseDownOutside.call(void 0,t)},G=(t,r)=>{O({value:L.cloneDate(t||void 0)}),R.current=t,I.current=!1,c()||(p.current=!0),n.onChange&&n.onChange.call(void 0,{syntheticEvent:r.syntheticEvent,nativeEvent:r.nativeEvent,value:m(),show:i(),target:k.current}),R.current=void 0,I.current=void 0,g(!1)},Ne=t=>{const r=qe(t.value);G(r,t)},J=()=>{const{popupClass:t,...r}=y,s=i(),S=m(),F=S&&L.getDate(S),V=u.classNames(t),z={popupClass:"k-datepicker-popup",show:s,anchor:D.current,className:V,id:ne,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...r,onMouseDownOutside:Ae},le={disabled:w,value:F,min:E,max:_,weekNumber:he,focusedDate:Me,className:c()?"k-calendar-lg":"",navigation:!c(),onChange:Ne},ue=Ee(),Qe=Te();return c()?o.createElement(ue,{_ref:Z,...le}):o.createElement(Qe,{...z},o.createElement(ue,{_ref:Z,...le}))},Q=()=>{O({focused:!1}),g(!1)},Fe=()=>{const{windowWidth:t=0}=b,r={expand:i(),onClose:Q,adaptiveTitle:Pe,windowWidth:t},s=J();return o.createElement(ct.AdaptiveMode,{...r},o.createElement(st.ActionSheetContent,{overflowHidden:!0},s))},Ve=t=>{G(t.value,t)},ze=()=>{O({focused:!0})},Le=()=>{g(!i())},ee=()=>{w||(p.current=!0,g(!i()))},Ke=t=>{t.preventDefault()},We=t=>{const{altKey:r,keyCode:s}=t;if(s===u.Keys.esc&&i()){p.current=!0,g(!1);return}r&&(s===u.Keys.up||s===u.Keys.down)&&(t.preventDefault(),t.stopPropagation(),p.current=s===u.Keys.up,g(s===u.Keys.down))},k=o.useRef(null),D=o.useRef(null),d=o.useRef(null),C=o.useRef(null);o.useImperativeHandle(k,()=>({props:n,get element(){return D.current},get calendar(){return C.current},get dateInput(){return d.current},get name(){return n.name},get show(){return i()},get validity(){return N()},get value(){return m()},get mobileMode(){return c()},togglePopup:Le,focus:Be})),o.useImperativeHandle(h,()=>k.current);const R=o.useRef(void 0),I=o.useRef(void 0),je=o.useRef(null),p=o.useRef(!1),te=o.useRef(!1),P=o.useRef(null),[b,He]=o.useState({value:ce,show:se,focused:!1}),[,Ue]=o.useReducer(t=>t,!0),O=t=>{He(r=>({...r,...t}))};o.useEffect(()=>{C.current&&C.current.element&&i()&&!te.current&&C.current.element.focus({preventScroll:!0}),d.current&&d.current.element&&!i()&&p.current&&d.current.element.focus({preventScroll:!0}),te.current=i(),p.current=!1}),o.useEffect(()=>{var t;return P.current=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(r=>xe(r)),i()&&Ue(),(t=A())!=null&&t.body&&P.current&&P.current.observe(A().body),()=>{var r;clearTimeout(je.current),(r=A())!=null&&r.body&&P.current&&P.current.disconnect()}},[]);const ne=f+"-popup-id",Ye=J(),$e=Se(),Xe=m(),Ze=_e(),Ge=Fe(),oe=!j||N().valid,ae=M.toLanguageString(K.toggleCalendar,K.messages[K.toggleCalendar]),Je={disabled:w,format:pe,formatPlaceholder:Ce,id:Re,ariaLabelledBy:Ie,ariaDescribedBy:n.ariaDescribedBy,ariaLabel:De,max:_,min:E,name:n.name,onChange:Ve,required:n.required,_ref:d,tabIndex:i()?-1:be,title:n.title,valid:N().valid,validationMessage:U,validityStyles:j,value:Xe,label:void 0,placeholder:b.focused?null:n.placeholder,ariaExpanded:i(),size:null,fillMode:null,rounded:null,autoFill:n.autoFill,twoDigitYearMax:ke,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:we,autoSwitchKeys:ye,allowCaretMode:n.allowCaretMode,inputAttributes:Oe},re=o.createElement(u.AsyncFocusBlur,{onFocus:ze,onBlur:c()?void 0:Q,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>o.createElement(o.Fragment,null,o.createElement("span",{...n.label?{}:$,ref:D,className:u.classNames("k-input","k-datepicker",{[`k-input-${u.kendoThemeMaps.sizeMap[T]||T}`]:T,[`k-rounded-${u.kendoThemeMaps.roundedMap[x]||x}`]:x,[`k-input-${B}`]:B,"k-invalid":!oe,"k-required":X(),"k-disabled":w},n.className),onKeyDown:We,style:{width:n.width},onFocus:t.onFocus,onBlur:t.onBlur,onClick:c()?ee:void 0},o.createElement($e,{_ref:d,ariaRole:"combobox",ariaExpanded:i(),ariaControls:ne,autoFocus:ve,...Je}),o.createElement(Ze,{type:"button",icon:"calendar",svgIcon:nt.calendarIcon,title:ae,className:"k-input-button",rounded:null,onClick:c()?void 0:ee,"aria-label":ae,fillMode:B,onMouseDown:Ke}),!c()&&Ye),c()&&Ge));return n.label?o.createElement(it.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:f,editorValid:oe,editorDisabled:w,children:re,style:{width:n.width},...$}):re});W.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:a.nullable(e.string),pattern:a.nullable(e.string),date:a.nullable(e.oneOf(["short","medium","long","full"])),time:a.nullable(e.oneOf(["short","medium","long","full"])),datetime:a.nullable(e.oneOf(["short","medium","long","full"])),era:a.nullable(e.oneOf(["narrow","short","long"])),year:a.nullable(e.oneOf(["numeric","2-digit"])),month:a.nullable(e.oneOf(["numeric","2-digit","narrow","short","long"])),day:a.nullable(e.oneOf(["numeric","2-digit"])),weekday:a.nullable(e.oneOf(["narrow","short","long"])),hour:a.nullable(e.oneOf(["numeric","2-digit"])),hour12:a.nullable(e.bool),minute:a.nullable(e.oneOf(["numeric","2-digit"])),second:a.nullable(e.oneOf(["numeric","2-digit"])),timeZoneName:a.nullable(e.oneOf(["short","long"]))})]),formatPlaceholder:e.oneOfType([a.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:a.nullable(e.string),month:a.nullable(e.string),day:a.nullable(e.string),hour:a.nullable(e.string),minute:a.nullable(e.string),second:a.nullable(e.string)})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:a.nullable(e.bool),appendTo:a.nullable(e.any),popupClass:a.nullable(e.string)}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const l={defaultShow:!1,defaultValue:null,dateInput:ot.DateInput,calendar:at.Calendar,toggleButton:lt.ToggleButton,popup:tt.Popup,pickerWrap:ut.PickerWrap,disabled:!1,format:"d",max:a.MAX_DATE,min:a.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},ie=u.createPropsContext();W.displayName="KendoReactDatePicker";exports.DatePicker=W;exports.DatePickerPropsContext=ie;exports.datePickerDefaultProps=l;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("react"),e=require("prop-types"),tt=require("@progress/kendo-react-popup"),L=require("@progress/kendo-date-math"),u=require("@progress/kendo-react-common"),nt=require("@progress/kendo-svg-icons"),at=require("../dateinput/DateInput.js"),ot=require("../calendar/components/Calendar.js"),o=require("../utils.js"),K=require("../messages/index.js"),rt=require("@progress/kendo-react-intl"),lt=require("./ToggleButton.js"),ut=require("../common/PickerWrap.js"),it=require("../hooks/usePickerFloatingLabel.js"),st=require("@progress/kendo-react-layout"),ct=require("../common/AdaptiveMode.js");function dt(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const f in n)if(f!=="default"){const M=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(h,f,M.get?M:{enumerable:!0,get:()=>n[f]})}}return h.default=n,Object.freeze(h)}const a=dt(et),W=a.forwardRef((n,h)=>{const f=u.useId(n.id),M=rt.useLocalization(),v=u.useAdaptiveModeContext(),{defaultShow:se=l.defaultShow,defaultValue:ce=l.defaultValue,dateInput:de=l.dateInput,calendar:fe=l.calendar,toggleButton:me=l.toggleButton,popup:ge=l.popup,pickerWrap:ft=l.pickerWrap,disabled:w=l.disabled,format:pe=l.format,max:_=l.max,min:E=l.min,popupSettings:y=l.popupSettings,tabIndex:be=l.tabIndex,weekNumber:he=l.weekNumber,validityStyles:j=l.validityStyles,size:T=l.size,rounded:x=l.rounded,fillMode:B=l.fillMode,autoFocus:ve=l.autoFocus,show:U,autoSwitchParts:we,autoSwitchKeys:ye,twoDigitYearMax:ke,ariaLabel:De,adaptive:mt,formatPlaceholder:Ce,adaptiveTitle:Pe,inputAttributes:Oe,validationMessage:H,visited:gt,value:q,touched:pt,modified:bt,_adaptiveMode:ht=v,valid:Y,focusedDate:Me,id:Re,ariaLabelledBy:Ie,...$}=u.usePropsContext(ie,n),A=()=>{if(u.canUseDOM)return D.current&&D.current.ownerDocument||window.document},c=()=>!!(b.windowWidth&&v&&b.windowWidth<=(v==null?void 0:v.medium)&&n.adaptive),m=()=>{const t=R.current!==void 0?R.current:q!==void 0?q:b.value;return t!==null?L.cloneDate(t):null},i=()=>I.current!==void 0?I.current:U!==void 0?U:b.show,Se=()=>de||l.dateInput,_e=()=>me||l.toggleButton,Ee=()=>fe||l.calendar,Te=()=>ge||l.popup,X=()=>n.required!==void 0?n.required:!1,N=()=>{const t=m()||q||null,r=E,s=_,S=o.isInDateRange(t,r,s),F=H!==void 0,V=(!X()||t!=null)&&S,z=Y!==void 0?Y:V;return{customError:F,rangeOverflow:t&&s.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<r.getTime()||!1,valid:z,valueMissing:t===null}},xe=t=>{for(const r of t)O({windowWidth:r.target.clientWidth})},Be=()=>{d.current&&d.current.focus()},Z=t=>{C.current=t},g=t=>{i()!==t&&(O({show:t}),t&&n.onOpen&&n.onOpen.call(void 0,{target:k.current}),!t&&n.onClose&&n.onClose.call(void 0,{target:k.current}))},qe=t=>{const r=m();return r&&t?o.setTime(t,r):t},Ae=t=>{y!=null&&y.onMouseDownOutside&&y.onMouseDownOutside.call(void 0,t)},G=(t,r)=>{O({value:L.cloneDate(t||void 0)}),R.current=t,I.current=!1,c()||(p.current=!0),n.onChange&&n.onChange.call(void 0,{syntheticEvent:r.syntheticEvent,nativeEvent:r.nativeEvent,value:m(),show:i(),target:k.current}),R.current=void 0,I.current=void 0,g(!1)},Ne=t=>{const r=qe(t.value);G(r,t)},J=()=>{const{popupClass:t,...r}=y,s=i(),S=m(),F=S&&L.getDate(S),V=u.classNames(t),z={popupClass:"k-datepicker-popup",show:s,anchor:D.current,className:V,id:ne,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...r,onMouseDownOutside:Ae},le={disabled:w,value:F,min:E,max:_,weekNumber:he,focusedDate:Me,className:c()?"k-calendar-lg":"",navigation:!c(),onChange:Ne},ue=Ee(),Qe=Te();return c()?a.createElement(ue,{_ref:Z,...le}):a.createElement(Qe,{...z},a.createElement(ue,{_ref:Z,...le}))},Q=()=>{O({focused:!1}),g(!1)},Fe=()=>{const{windowWidth:t=0}=b,r={expand:i(),onClose:Q,adaptiveTitle:Pe,windowWidth:t},s=J();return a.createElement(ct.AdaptiveMode,{...r},a.createElement(st.ActionSheetContent,null,s))},Ve=t=>{G(t.value,t)},ze=()=>{O({focused:!0})},Le=()=>{g(!i())},ee=()=>{w||(p.current=!0,g(!i()))},Ke=t=>{t.preventDefault()},We=t=>{const{altKey:r,keyCode:s}=t;if(s===u.Keys.esc&&i()){p.current=!0,g(!1);return}r&&(s===u.Keys.up||s===u.Keys.down)&&(t.preventDefault(),t.stopPropagation(),p.current=s===u.Keys.up,g(s===u.Keys.down))},k=a.useRef(null),D=a.useRef(null),d=a.useRef(null),C=a.useRef(null);a.useImperativeHandle(k,()=>({props:n,get element(){return D.current},get calendar(){return C.current},get dateInput(){return d.current},get name(){return n.name},get show(){return i()},get validity(){return N()},get value(){return m()},get mobileMode(){return c()},togglePopup:Le,focus:Be})),a.useImperativeHandle(h,()=>k.current);const R=a.useRef(void 0),I=a.useRef(void 0),je=a.useRef(null),p=a.useRef(!1),te=a.useRef(!1),P=a.useRef(null),[b,Ue]=a.useState({value:ce,show:se,focused:!1}),[,He]=a.useReducer(t=>t,!0),O=t=>{Ue(r=>({...r,...t}))};a.useEffect(()=>{C.current&&C.current.element&&i()&&!te.current&&C.current.element.focus({preventScroll:!0}),d.current&&d.current.element&&!i()&&p.current&&d.current.element.focus({preventScroll:!0}),te.current=i(),p.current=!1}),a.useEffect(()=>{var t;return P.current=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(r=>xe(r)),i()&&He(),(t=A())!=null&&t.body&&P.current&&P.current.observe(A().body),()=>{var r;clearTimeout(je.current),(r=A())!=null&&r.body&&P.current&&P.current.disconnect()}},[]);const ne=f+"-popup-id",Ye=J(),$e=Se(),Xe=m(),Ze=_e(),Ge=Fe(),ae=!j||N().valid,oe=M.toLanguageString(K.toggleCalendar,K.messages[K.toggleCalendar]),Je={disabled:w,format:pe,formatPlaceholder:Ce,id:Re,ariaLabelledBy:Ie,ariaDescribedBy:n.ariaDescribedBy,ariaLabel:De,max:_,min:E,name:n.name,onChange:Ve,required:n.required,_ref:d,tabIndex:i()?-1:be,title:n.title,valid:N().valid,validationMessage:H,validityStyles:j,value:Xe,label:void 0,placeholder:b.focused?null:n.placeholder,ariaExpanded:i(),size:null,fillMode:null,rounded:null,autoFill:n.autoFill,twoDigitYearMax:ke,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:we,autoSwitchKeys:ye,allowCaretMode:n.allowCaretMode,inputAttributes:Oe},re=a.createElement(u.AsyncFocusBlur,{onFocus:ze,onBlur:c()?void 0:Q,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>a.createElement(a.Fragment,null,a.createElement("span",{...n.label?{}:$,ref:D,className:u.classNames("k-input","k-datepicker",{[`k-input-${u.kendoThemeMaps.sizeMap[T]||T}`]:T,[`k-rounded-${u.kendoThemeMaps.roundedMap[x]||x}`]:x,[`k-input-${B}`]:B,"k-invalid":!ae,"k-required":X(),"k-disabled":w},n.className),onKeyDown:We,style:{width:n.width},onFocus:t.onFocus,onBlur:t.onBlur,onClick:c()?ee:void 0},a.createElement($e,{_ref:d,ariaRole:"combobox",ariaExpanded:i(),ariaControls:ne,autoFocus:ve,...Je}),a.createElement(Ze,{type:"button",icon:"calendar",svgIcon:nt.calendarIcon,title:oe,className:"k-input-button",rounded:null,onClick:c()?void 0:ee,"aria-label":oe,fillMode:B,onMouseDown:Ke}),!c()&&Ye),c()&&Ge));return n.label?a.createElement(it.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:f,editorValid:ae,editorDisabled:w,children:re,style:{width:n.width},...$}):re});W.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:o.nullable(e.string),pattern:o.nullable(e.string),date:o.nullable(e.oneOf(["short","medium","long","full"])),time:o.nullable(e.oneOf(["short","medium","long","full"])),datetime:o.nullable(e.oneOf(["short","medium","long","full"])),era:o.nullable(e.oneOf(["narrow","short","long"])),year:o.nullable(e.oneOf(["numeric","2-digit"])),month:o.nullable(e.oneOf(["numeric","2-digit","narrow","short","long"])),day:o.nullable(e.oneOf(["numeric","2-digit"])),weekday:o.nullable(e.oneOf(["narrow","short","long"])),hour:o.nullable(e.oneOf(["numeric","2-digit"])),hour12:o.nullable(e.bool),minute:o.nullable(e.oneOf(["numeric","2-digit"])),second:o.nullable(e.oneOf(["numeric","2-digit"])),timeZoneName:o.nullable(e.oneOf(["short","long"]))})]),formatPlaceholder:e.oneOfType([o.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:o.nullable(e.string),month:o.nullable(e.string),day:o.nullable(e.string),hour:o.nullable(e.string),minute:o.nullable(e.string),second:o.nullable(e.string)})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:o.nullable(e.bool),appendTo:o.nullable(e.any),popupClass:o.nullable(e.string)}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const l={defaultShow:!1,defaultValue:null,dateInput:at.DateInput,calendar:ot.Calendar,toggleButton:lt.ToggleButton,popup:tt.Popup,pickerWrap:ut.PickerWrap,disabled:!1,format:"d",max:o.MAX_DATE,min:o.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},ie=u.createPropsContext();W.displayName="KendoReactDatePicker";exports.DatePicker=W;exports.DatePickerPropsContext=ie;exports.datePickerDefaultProps=l;
@@ -140,7 +140,7 @@ const ue = o.forwardRef((n, se) => {
140
140
  adaptiveTitle: Me,
141
141
  windowWidth: t
142
142
  }, u = $();
143
- return /* @__PURE__ */ o.createElement(Dt, { ...r }, /* @__PURE__ */ o.createElement(Ct, { overflowHidden: !0 }, u));
143
+ return /* @__PURE__ */ o.createElement(Dt, { ...r }, /* @__PURE__ */ o.createElement(Ct, null, u));
144
144
  }, We = (t) => {
145
145
  Y(t.value, t);
146
146
  }, Ke = () => {
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),t=require("prop-types"),M=require("@progress/kendo-react-popup"),D=require("@progress/kendo-date-math"),o=require("@progress/kendo-react-common"),c=require("@progress/kendo-react-intl"),T=require("@progress/kendo-svg-icons"),x=require("../package-metadata.js"),g=require("../dateinput/DateInput.js"),P=require("../calendar/components/MultiViewCalendar.js"),h=require("../calendar/models/SelectionRange.js"),u=require("../utils.js"),n=require("../messages/index.js"),_=require("@progress/kendo-react-buttons"),A=require("../common/AdaptiveMode.js"),N=require("@progress/kendo-react-layout");function L(d){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(a,e,s.get?s:{enumerable:!0,get:()=>d[e]})}}return a.default=d,Object.freeze(a)}const i=L(O),l=class l extends i.Component{constructor(a){super(a),this._element=null,this._calendar=null,this._startDateInput=i.createRef(),this._endDateInput=i.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.showLicenseWatermark=!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,s)=>(e.value!==void 0?e.value:s.value)||h.EMPTY_SELECTIONRANGE,this.calculateShow=(e,s)=>e.show!==void 0?e.show:s.show,this.renderCalendar=()=>{const e=this.value||h.EMPTY_SELECTIONRANGE,s={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?i.createElement(this.props.calendar,{...s}):i.createElement(P.MultiViewCalendar,{...s,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:o.classNames("k-calendar-container","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?i.createElement(this.props.popup,{...e},this.renderCalendar()):i.createElement(M.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,s={expand:this.show,onClose:r=>this.handleCancel(r),title:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(n.dateRangePickerCancel,n.messages[n.dateRangePickerCancel]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(n.dateRangePickerSet,n.messages[n.dateRangePickerSet]),onApply:this.handleBlur}};return i.createElement(A.AdaptiveMode,{...s},i.createElement(N.ActionSheetContent,{overflowHidden:!0},i.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const s={start:this.value.end,end:this.value.start},r={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(s,r)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:h.EMPTY_SELECTIONRANGE})});const{onCancel:s}=this.props;s&&s.call(void 0,e)},this.handleEndChange=e=>{const s={start:this.value.start,end:D.cloneDate(e.value||void 0)};this.handleChange(s,e)},this.handleStartChange=e=>{const s={start:D.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(s,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||h.EMPTY_SELECTIONRANGE;const s=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?s:this.value.start,end:this.value.start!==null?s:this.value.end}},this.handleCalendarChange=e=>{const s=this.extractRangeFromValue(e);this.handleChange(s,e)},this.handleKeyDown=e=>{const{keyCode:s,altKey:r}=e;s===o.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):r&&s===o.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):r&&s===o.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,s)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:r}=this.props;if(r){const m={syntheticEvent:s.syntheticEvent,nativeEvent:s.nativeEvent,value:this.value,show:this.show,target:this};r.call(void 0,m)}this.valueDuringOnChange=void 0},this.showLicenseWatermark=!o.validatePackage(x.packageMetadata,{component:"DateRangePicker"}),this.state={show:this.props.show||this.props.defaultShow||l.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||l.defaultProps.defaultValue,currentValue:h.EMPTY_SELECTIONRANGE},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)||h.EMPTY_SELECTIONRANGE}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:l.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:l.defaultProps.max}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return c.provideLocalizationService(this)}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((e=this.props._adaptiveMode)==null?void 0:e.medium)&&this.props.adaptive)}componentDidMount(){var a;this.observerResize=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(a=this.document)!=null&&a.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 a;clearTimeout(this.nextTickId),(a=this.document)!=null&&a.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{autoFocus:a,inputAttributes:e}=this.props,s=this.value||h.EMPTY_SELECTIONRANGE,r=this.mobileMode&&this.show?this.state.currentValue:s,m=(this.props.startDateInputSettings||{}).id||this._startInputId,w=(this.props.endDateInputSettings||{}).id||this._endInputId,S=o.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),E=this.localizationService.toLanguageString(n.start,n.messages[n.start]),C=this.localizationService.toLanguageString(n.end,n.messages[n.end]),y=this.localizationService.toLanguageString(n.separator,n.messages[n.separator]),f={disableSelection:this.mobileMode&&!0,label:E,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,clearButton:this.props.clearButton,...this.props.startDateInputSettings,value:r.start,onChange:this.handleStartChange,inputAttributes:this.props.inputAttributes},v={disableSelection:this.mobileMode&&!0,label:C,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,clearButton:this.props.clearButton,...this.props.endDateInputSettings,value:r.end,onChange:this.handleEndChange,inputAttributes:this.props.inputAttributes},R=i.createElement(_.Button,{type:"button",className:"k-select",fillMode:"flat",title:c.provideLocalizationService(this).toLanguageString(n.swapStartEnd,n.messages[n.swapStartEnd]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":m+" "+w,"aria-label":c.provideLocalizationService(this).toLanguageString(n.swapStartEnd,n.messages[n.swapStartEnd])},i.createElement(o.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:T.arrowsSwapIcon}));return i.createElement(i.Fragment,null,i.createElement("span",{ref:k=>{this._element=k},className:S,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?i.createElement(this.props.startDateInput,{...f}):i.createElement(g.DateInput,{...f,autoFocus:a,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?R:y,this.props.endDateInput?i.createElement(this.props.endDateInput,{...v}):i.createElement(g.DateInput,{...v,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&i.createElement(o.WatermarkOverlay,null))}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const a=o.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&a!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):a!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(a){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>a())}setShow(a){const{onOpen:e,onClose:s}=this.props;this.show!==a&&(this.setState({show:a}),a&&e&&e.call(void 0,{target:this}),!a&&s&&s.call(void 0,{target:this}))}calculateMedia(a){for(const e of a)this.setState({windowWidth:e.target.clientWidth})}};l.displayName="DateRangePicker",l.propTypes={allowReverse:t.bool,calendarSettings:t.any,className:t.string,defaultShow:t.bool,defaultValue:t.shape({start:u.nullable(t.instanceOf(Date).isRequired),end:u.nullable(t.instanceOf(Date).isRequired)}),disabled:t.bool,endDateInputSettings:t.shape(g.DateInput.propTypes),focusedDate:t.instanceOf(Date),format:t.oneOfType([t.string,t.shape({skeleton:t.string,pattern:t.string,date:t.oneOf(["short","medium","long","full"]),time:t.oneOf(["short","medium","long","full"]),datetime:t.oneOf(["short","medium","long","full"]),era:t.oneOf(["narrow","short","long"]),year:t.oneOf(["numeric","2-digit"]),month:t.oneOf(["numeric","2-digit","narrow","short","long"]),day:t.oneOf(["numeric","2-digit"]),weekday:t.oneOf(["narrow","short","long"]),hour:t.oneOf(["numeric","2-digit"]),hour12:t.bool,minute:t.oneOf(["numeric","2-digit"]),second:t.oneOf(["numeric","2-digit"]),timeZoneName:t.oneOf(["short","long"])})]),id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,max:t.instanceOf(Date),min:t.instanceOf(Date),onBlur:t.func,onChange:t.func,onFocus:t.func,popupSettings:t.any,show:t.bool,startDateInputSettings:t.any,style:t.any,swapButton:t.any,tabIndex:t.number,dir:t.string,value:t.shape({start:u.nullable(t.instanceOf(Date)),end:u.nullable(t.instanceOf(Date))}),autoFocus:t.bool,inputAttributes:t.object},l.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:h.EMPTY_SELECTIONRANGE,disabled:!1,format:"d",max:u.MAX_DATE,min:u.MIN_DATE,swapButton:!1,autoFocus:!1};let p=l;const b=o.createPropsContext(),I=o.withIdHOC(o.withPropsContext(b,o.withAdaptiveModeContext(p)));I.displayName="KendoReactDateRangePicker";c.registerForLocalization(p);exports.DateRangePicker=I;exports.DateRangePickerPropsContext=b;exports.DateRangePickerWithoutContext=p;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),t=require("prop-types"),M=require("@progress/kendo-react-popup"),D=require("@progress/kendo-date-math"),o=require("@progress/kendo-react-common"),c=require("@progress/kendo-react-intl"),T=require("@progress/kendo-svg-icons"),x=require("../package-metadata.js"),g=require("../dateinput/DateInput.js"),P=require("../calendar/components/MultiViewCalendar.js"),h=require("../calendar/models/SelectionRange.js"),u=require("../utils.js"),n=require("../messages/index.js"),_=require("@progress/kendo-react-buttons"),A=require("../common/AdaptiveMode.js"),N=require("@progress/kendo-react-layout");function L(d){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(a,e,s.get?s:{enumerable:!0,get:()=>d[e]})}}return a.default=d,Object.freeze(a)}const i=L(O),l=class l extends i.Component{constructor(a){super(a),this._element=null,this._calendar=null,this._startDateInput=i.createRef(),this._endDateInput=i.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.showLicenseWatermark=!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,s)=>(e.value!==void 0?e.value:s.value)||h.EMPTY_SELECTIONRANGE,this.calculateShow=(e,s)=>e.show!==void 0?e.show:s.show,this.renderCalendar=()=>{const e=this.value||h.EMPTY_SELECTIONRANGE,s={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?i.createElement(this.props.calendar,{...s}):i.createElement(P.MultiViewCalendar,{...s,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:o.classNames("k-calendar-container","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?i.createElement(this.props.popup,{...e},this.renderCalendar()):i.createElement(M.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,s={expand:this.show,onClose:r=>this.handleCancel(r),title:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(n.dateRangePickerCancel,n.messages[n.dateRangePickerCancel]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(n.dateRangePickerSet,n.messages[n.dateRangePickerSet]),onApply:this.handleBlur}};return i.createElement(A.AdaptiveMode,{...s},i.createElement(N.ActionSheetContent,null,i.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const s={start:this.value.end,end:this.value.start},r={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(s,r)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:h.EMPTY_SELECTIONRANGE})});const{onCancel:s}=this.props;s&&s.call(void 0,e)},this.handleEndChange=e=>{const s={start:this.value.start,end:D.cloneDate(e.value||void 0)};this.handleChange(s,e)},this.handleStartChange=e=>{const s={start:D.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(s,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||h.EMPTY_SELECTIONRANGE;const s=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?s:this.value.start,end:this.value.start!==null?s:this.value.end}},this.handleCalendarChange=e=>{const s=this.extractRangeFromValue(e);this.handleChange(s,e)},this.handleKeyDown=e=>{const{keyCode:s,altKey:r}=e;s===o.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):r&&s===o.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):r&&s===o.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,s)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:r}=this.props;if(r){const m={syntheticEvent:s.syntheticEvent,nativeEvent:s.nativeEvent,value:this.value,show:this.show,target:this};r.call(void 0,m)}this.valueDuringOnChange=void 0},this.showLicenseWatermark=!o.validatePackage(x.packageMetadata,{component:"DateRangePicker"}),this.state={show:this.props.show||this.props.defaultShow||l.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||l.defaultProps.defaultValue,currentValue:h.EMPTY_SELECTIONRANGE},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)||h.EMPTY_SELECTIONRANGE}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:l.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:l.defaultProps.max}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return c.provideLocalizationService(this)}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((e=this.props._adaptiveMode)==null?void 0:e.medium)&&this.props.adaptive)}componentDidMount(){var a;this.observerResize=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(a=this.document)!=null&&a.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 a;clearTimeout(this.nextTickId),(a=this.document)!=null&&a.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{autoFocus:a,inputAttributes:e}=this.props,s=this.value||h.EMPTY_SELECTIONRANGE,r=this.mobileMode&&this.show?this.state.currentValue:s,m=(this.props.startDateInputSettings||{}).id||this._startInputId,w=(this.props.endDateInputSettings||{}).id||this._endInputId,S=o.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),E=this.localizationService.toLanguageString(n.start,n.messages[n.start]),C=this.localizationService.toLanguageString(n.end,n.messages[n.end]),y=this.localizationService.toLanguageString(n.separator,n.messages[n.separator]),f={disableSelection:this.mobileMode&&!0,label:E,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,clearButton:this.props.clearButton,...this.props.startDateInputSettings,value:r.start,onChange:this.handleStartChange,inputAttributes:this.props.inputAttributes},v={disableSelection:this.mobileMode&&!0,label:C,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,clearButton:this.props.clearButton,...this.props.endDateInputSettings,value:r.end,onChange:this.handleEndChange,inputAttributes:this.props.inputAttributes},R=i.createElement(_.Button,{type:"button",className:"k-select",fillMode:"flat",title:c.provideLocalizationService(this).toLanguageString(n.swapStartEnd,n.messages[n.swapStartEnd]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":m+" "+w,"aria-label":c.provideLocalizationService(this).toLanguageString(n.swapStartEnd,n.messages[n.swapStartEnd])},i.createElement(o.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:T.arrowsSwapIcon}));return i.createElement(i.Fragment,null,i.createElement("span",{ref:k=>{this._element=k},className:S,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?i.createElement(this.props.startDateInput,{...f}):i.createElement(g.DateInput,{...f,autoFocus:a,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?R:y,this.props.endDateInput?i.createElement(this.props.endDateInput,{...v}):i.createElement(g.DateInput,{...v,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&i.createElement(o.WatermarkOverlay,null))}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const a=o.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&a!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):a!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(a){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>a())}setShow(a){const{onOpen:e,onClose:s}=this.props;this.show!==a&&(this.setState({show:a}),a&&e&&e.call(void 0,{target:this}),!a&&s&&s.call(void 0,{target:this}))}calculateMedia(a){for(const e of a)this.setState({windowWidth:e.target.clientWidth})}};l.displayName="DateRangePicker",l.propTypes={allowReverse:t.bool,calendarSettings:t.any,className:t.string,defaultShow:t.bool,defaultValue:t.shape({start:u.nullable(t.instanceOf(Date).isRequired),end:u.nullable(t.instanceOf(Date).isRequired)}),disabled:t.bool,endDateInputSettings:t.shape(g.DateInput.propTypes),focusedDate:t.instanceOf(Date),format:t.oneOfType([t.string,t.shape({skeleton:t.string,pattern:t.string,date:t.oneOf(["short","medium","long","full"]),time:t.oneOf(["short","medium","long","full"]),datetime:t.oneOf(["short","medium","long","full"]),era:t.oneOf(["narrow","short","long"]),year:t.oneOf(["numeric","2-digit"]),month:t.oneOf(["numeric","2-digit","narrow","short","long"]),day:t.oneOf(["numeric","2-digit"]),weekday:t.oneOf(["narrow","short","long"]),hour:t.oneOf(["numeric","2-digit"]),hour12:t.bool,minute:t.oneOf(["numeric","2-digit"]),second:t.oneOf(["numeric","2-digit"]),timeZoneName:t.oneOf(["short","long"])})]),id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,max:t.instanceOf(Date),min:t.instanceOf(Date),onBlur:t.func,onChange:t.func,onFocus:t.func,popupSettings:t.any,show:t.bool,startDateInputSettings:t.any,style:t.any,swapButton:t.any,tabIndex:t.number,dir:t.string,value:t.shape({start:u.nullable(t.instanceOf(Date)),end:u.nullable(t.instanceOf(Date))}),autoFocus:t.bool,inputAttributes:t.object},l.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:h.EMPTY_SELECTIONRANGE,disabled:!1,format:"d",max:u.MAX_DATE,min:u.MIN_DATE,swapButton:!1,autoFocus:!1};let p=l;const b=o.createPropsContext(),I=o.withIdHOC(o.withPropsContext(b,o.withAdaptiveModeContext(p)));I.displayName="KendoReactDateRangePicker";c.registerForLocalization(p);exports.DateRangePicker=I;exports.DateRangePickerPropsContext=b;exports.DateRangePickerWithoutContext=p;
@@ -14,9 +14,9 @@ import { provideLocalizationService as m, registerForLocalization as K } from "@
14
14
  import { arrowsSwapIcon as U } from "@progress/kendo-svg-icons";
15
15
  import { packageMetadata as q } from "../package-metadata.mjs";
16
16
  import { DateInput as f } from "../dateinput/DateInput.mjs";
17
- import { MultiViewCalendar as H } from "../calendar/components/MultiViewCalendar.mjs";
17
+ import { MultiViewCalendar as j } from "../calendar/components/MultiViewCalendar.mjs";
18
18
  import { EMPTY_SELECTIONRANGE as r } from "../calendar/models/SelectionRange.mjs";
19
- import { nullable as h, MAX_DATE as j, MIN_DATE as G } from "../utils.mjs";
19
+ import { nullable as h, MAX_DATE as G, MIN_DATE as H } from "../utils.mjs";
20
20
  import { dateRangePickerCancel as I, messages as l, dateRangePickerSet as C, start as S, end as y, separator as E, swapStartEnd as p } from "../messages/index.mjs";
21
21
  import { Button as X } from "@progress/kendo-react-buttons";
22
22
  import { AdaptiveMode as Y } from "../common/AdaptiveMode.mjs";
@@ -44,7 +44,7 @@ const o = class o extends i.Component {
44
44
  dir: this.props.dir,
45
45
  onChange: this.handleCalendarChange
46
46
  };
47
- return this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { ...s }) : /* @__PURE__ */ i.createElement(H, { ...s, ref: this.setCalendarRef });
47
+ return this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { ...s }) : /* @__PURE__ */ i.createElement(j, { ...s, ref: this.setCalendarRef });
48
48
  }, this.renderPopup = () => {
49
49
  const t = {
50
50
  popupClass: D("k-calendar-container", "k-daterangepicker-popup"),
@@ -79,7 +79,7 @@ const o = class o extends i.Component {
79
79
  onApply: this.handleBlur
80
80
  }
81
81
  };
82
- return /* @__PURE__ */ i.createElement(Y, { ...s }, /* @__PURE__ */ i.createElement(Z, { overflowHidden: !0 }, /* @__PURE__ */ i.createElement("div", { className: "k-scrollable-wrap" }, this.renderCalendar())));
82
+ return /* @__PURE__ */ i.createElement(Y, { ...s }, /* @__PURE__ */ i.createElement(Z, null, /* @__PURE__ */ i.createElement("div", { className: "k-scrollable-wrap" }, this.renderCalendar())));
83
83
  }, this.handleReverseClick = (t) => {
84
84
  const s = {
85
85
  start: this.value.end,
@@ -421,8 +421,8 @@ o.displayName = "DateRangePicker", o.propTypes = {
421
421
  defaultValue: r,
422
422
  disabled: !1,
423
423
  format: "d",
424
- max: j,
425
- min: G,
424
+ max: G,
425
+ min: H,
426
426
  swapButton: !1,
427
427
  autoFocus: !1
428
428
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),e=require("prop-types"),J=require("@progress/kendo-react-popup"),T=require("@progress/kendo-date-math"),o=require("@progress/kendo-react-common"),Q=require("@progress/kendo-svg-icons"),ee=require("../dateinput/DateInput.js"),te=require("@progress/kendo-react-buttons"),p=require("../utils.js"),l=require("../messages/index.js"),m=require("@progress/kendo-react-intl"),ie=require("./DateTimeSelector.js"),se=require("../timepicker/utils.js"),oe=require("../hooks/usePickerFloatingLabel.js"),ne=require("../common/AdaptiveMode.js"),ae=require("@progress/kendo-react-layout");function re(h){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>h[t]})}}return i.default=h,Object.freeze(i)}const r=re(G),n=class n extends r.Component{constructor(i){super(i),this._element=null,this._dateInput=r.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const t=this.dateInputElement();t&&t.focus()},this.renderPicker=()=>{const{disabled:t,minTime:s,maxTime:a,format:c,calendar:d,cancelButton:u,weekNumber:v,focusedDate:f,unstyled:w}=this.props;return r.createElement(ie.DateTimeSelector,{ref:b=>{this._dateTimeSelector=b},cancelButton:u,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:t,weekNumber:v,min:this.min,max:this.max,minTime:s,maxTime:a,focusedDate:f,format:c,calendar:d,mobileMode:this.mobileMode,footerActions:!this.mobileMode,unstyled:w})},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,s=m.provideLocalizationService(this).toLanguageString(l.dateTimePickerCancel,l.messages[l.dateTimePickerCancel]),a=m.provideLocalizationService(this).toLanguageString(l.dateTimePickerSet,l.messages[l.dateTimePickerSet]),c={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:s,onCancel:d=>{var u;return(u=this._dateTimeSelector)==null?void 0:u.handleReject(d)},applyText:a,onApply:d=>{var u;return(u=this._dateTimeSelector)==null?void 0:u.handleAccept(d)}}};return r.createElement(ne.AdaptiveMode,{...c},r.createElement(ae.ActionSheetContent,{overflowHidden:!0},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=t=>{this.setState({value:T.cloneDate(t.value||void 0)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.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=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:s,keyCode:a}=t;if(a===o.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}s&&(a===o.Keys.up||a===o.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=a===o.Keys.up,this.setShow(a===o.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),this.state={value:this.props.defaultValue||n.defaultProps.defaultValue,show:this.props.defaultShow||n.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?T.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){var t;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((t=this.props._adaptiveMode)==null?void 0:t.medium)&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get validity(){const i=p.isInDateRange(this.value,this.min,this.max)&&se.isInTimeRange(this.value,this.props.minTime||p.MIN_TIME,this.props.maxTime||p.MAX_TIME),t=this.props.validationMessage!==void 0,s=(!this.required||this.value!==null)&&i,a=this.props.valid!==void 0?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:a,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get dateInputComp(){return this.props.dateInput||n.defaultProps.dateInput}componentDidMount(){var i;this.observerResize=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const i=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),i&&!this.show&&this.shouldFocusDateInput&&i.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=n.defaultProps.size,rounded:t=n.defaultProps.rounded,fillMode:s=n.defaultProps.fillMode,autoFocus:a=n.defaultProps.autoFocus,inputAttributes:c,disabled:d,tabIndex:u,title:v,id:f,format:w,formatPlaceholder:b,min:M,max:k,className:C,width:x,name:q,validationMessage:E,required:F,validityStyles:R,minTime:z,maxTime:A,ariaLabelledBy:B,ariaDescribedBy:N,popup:L=J.Popup,unstyled:y,autoFill:_,twoDigitYearMax:K,enableMouseWheel:j,autoCorrectParts:V,autoSwitchParts:U,autoSwitchKeys:H,allowCaretMode:W}=this.props,D=y&&y.uDateTimePicker,S=!this.validityStyles||this.validity.valid,X={id:f,ariaLabelledBy:B,ariaDescribedBy:N,format:w,formatPlaceholder:b,disabled:d,title:v,validityStyles:R,validationMessage:E,required:F,min:M,max:k,minTime:z,maxTime:A,name:q,tabIndex:this.show?-1:u,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,unstyled:y,autoFill:_,twoDigitYearMax:K,enableMouseWheel:j,autoCorrectParts:V,autoSwitchParts:U,autoSwitchKeys:H,allowCaretMode:W},I=r.createElement(o.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:Y,onBlur:Z})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:$=>{this._element=$},className:o.classNames(o.uDateTimePicker.wrapper({c:D,size:i,fillMode:s,rounded:t,disabled:d,required:this.required,invalid:!S}),C),onKeyDown:this.handleKeyDown,style:{width:x},onFocus:this.mobileMode?void 0:Y,onBlur:Z,onClick:this.mobileMode?this.handleDateIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,ariaHasPopup:"dialog",autoFocus:a,inputAttributes:c,...X}),r.createElement(te.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:Q.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:m.provideLocalizationService(this).toLanguageString(l.toggleDateTimeSelector,l.messages[l.toggleDateTimeSelector]),className:o.classNames(o.uDateTimePicker.inputButton({c:D})),rounded:null,fillMode:s,"aria-label":m.provideLocalizationService(this).toLanguageString(l.toggleDateTimeSelector,l.messages[l.toggleDateTimeSelector])}),r.createElement(L,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:o.classNames(o.uDateTimePicker.popup({c:D})),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(oe.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:f,editorValid:S,editorDisabled:this.props.disabled,children:I,style:{width:this.props.width}}):I}setShow(i){const{onOpen:t,onClose:s}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&s&&s.call(void 0,{target:this}))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};n.displayName="DateTimePicker",n.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,cancelButton:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object},n.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:p.MAX_DATE,min:p.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,cancelButton:!0,dateInput:ee.DateInput,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let g=n;const P=o.createPropsContext(),O=o.withIdHOC(o.withPropsContext(P,o.withUnstyledHOC(o.withAdaptiveModeContext(g))));O.displayName="KendoReactDateTimePicker";m.registerForLocalization(g);exports.DateTimePicker=O;exports.DateTimePickerPropsContext=P;exports.DateTimePickerWithoutContext=g;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),e=require("prop-types"),J=require("@progress/kendo-react-popup"),T=require("@progress/kendo-date-math"),o=require("@progress/kendo-react-common"),Q=require("@progress/kendo-svg-icons"),ee=require("../dateinput/DateInput.js"),te=require("@progress/kendo-react-buttons"),p=require("../utils.js"),l=require("../messages/index.js"),m=require("@progress/kendo-react-intl"),ie=require("./DateTimeSelector.js"),se=require("../timepicker/utils.js"),oe=require("../hooks/usePickerFloatingLabel.js"),ne=require("../common/AdaptiveMode.js"),ae=require("@progress/kendo-react-layout");function re(h){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>h[t]})}}return i.default=h,Object.freeze(i)}const r=re(G),n=class n extends r.Component{constructor(i){super(i),this._element=null,this._dateInput=r.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const t=this.dateInputElement();t&&t.focus()},this.renderPicker=()=>{const{disabled:t,minTime:s,maxTime:a,format:c,calendar:d,cancelButton:u,weekNumber:v,focusedDate:f,unstyled:w}=this.props;return r.createElement(ie.DateTimeSelector,{ref:b=>{this._dateTimeSelector=b},cancelButton:u,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:t,weekNumber:v,min:this.min,max:this.max,minTime:s,maxTime:a,focusedDate:f,format:c,calendar:d,mobileMode:this.mobileMode,footerActions:!this.mobileMode,unstyled:w})},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,s=m.provideLocalizationService(this).toLanguageString(l.dateTimePickerCancel,l.messages[l.dateTimePickerCancel]),a=m.provideLocalizationService(this).toLanguageString(l.dateTimePickerSet,l.messages[l.dateTimePickerSet]),c={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:s,onCancel:d=>{var u;return(u=this._dateTimeSelector)==null?void 0:u.handleReject(d)},applyText:a,onApply:d=>{var u;return(u=this._dateTimeSelector)==null?void 0:u.handleAccept(d)}}};return r.createElement(ne.AdaptiveMode,{...c},r.createElement(ae.ActionSheetContent,null,this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=t=>{this.setState({value:T.cloneDate(t.value||void 0)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.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=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:s,keyCode:a}=t;if(a===o.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}s&&(a===o.Keys.up||a===o.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=a===o.Keys.up,this.setShow(a===o.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),this.state={value:this.props.defaultValue||n.defaultProps.defaultValue,show:this.props.defaultShow||n.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?T.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){var t;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((t=this.props._adaptiveMode)==null?void 0:t.medium)&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get validity(){const i=p.isInDateRange(this.value,this.min,this.max)&&se.isInTimeRange(this.value,this.props.minTime||p.MIN_TIME,this.props.maxTime||p.MAX_TIME),t=this.props.validationMessage!==void 0,s=(!this.required||this.value!==null)&&i,a=this.props.valid!==void 0?this.props.valid:s;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:a,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get dateInputComp(){return this.props.dateInput||n.defaultProps.dateInput}componentDidMount(){var i;this.observerResize=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const i=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),i&&!this.show&&this.shouldFocusDateInput&&i.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=n.defaultProps.size,rounded:t=n.defaultProps.rounded,fillMode:s=n.defaultProps.fillMode,autoFocus:a=n.defaultProps.autoFocus,inputAttributes:c,disabled:d,tabIndex:u,title:v,id:f,format:w,formatPlaceholder:b,min:M,max:k,className:C,width:x,name:q,validationMessage:E,required:F,validityStyles:R,minTime:z,maxTime:A,ariaLabelledBy:B,ariaDescribedBy:N,popup:L=J.Popup,unstyled:y,autoFill:_,twoDigitYearMax:K,enableMouseWheel:j,autoCorrectParts:V,autoSwitchParts:U,autoSwitchKeys:W,allowCaretMode:H}=this.props,D=y&&y.uDateTimePicker,S=!this.validityStyles||this.validity.valid,X={id:f,ariaLabelledBy:B,ariaDescribedBy:N,format:w,formatPlaceholder:b,disabled:d,title:v,validityStyles:R,validationMessage:E,required:F,min:M,max:k,minTime:z,maxTime:A,name:q,tabIndex:this.show?-1:u,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,unstyled:y,autoFill:_,twoDigitYearMax:K,enableMouseWheel:j,autoCorrectParts:V,autoSwitchParts:U,autoSwitchKeys:W,allowCaretMode:H},I=r.createElement(o.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:Y,onBlur:Z})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:$=>{this._element=$},className:o.classNames(o.uDateTimePicker.wrapper({c:D,size:i,fillMode:s,rounded:t,disabled:d,required:this.required,invalid:!S}),C),onKeyDown:this.handleKeyDown,style:{width:x},onFocus:this.mobileMode?void 0:Y,onBlur:Z,onClick:this.mobileMode?this.handleDateIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,ariaHasPopup:"dialog",autoFocus:a,inputAttributes:c,...X}),r.createElement(te.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:Q.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:m.provideLocalizationService(this).toLanguageString(l.toggleDateTimeSelector,l.messages[l.toggleDateTimeSelector]),className:o.classNames(o.uDateTimePicker.inputButton({c:D})),rounded:null,fillMode:s,"aria-label":m.provideLocalizationService(this).toLanguageString(l.toggleDateTimeSelector,l.messages[l.toggleDateTimeSelector])}),r.createElement(L,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:o.classNames(o.uDateTimePicker.popup({c:D})),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(oe.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:f,editorValid:S,editorDisabled:this.props.disabled,children:I,style:{width:this.props.width}}):I}setShow(i){const{onOpen:t,onClose:s}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&s&&s.call(void 0,{target:this}))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};n.displayName="DateTimePicker",n.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,cancelButton:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object},n.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:p.MAX_DATE,min:p.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,cancelButton:!0,dateInput:ee.DateInput,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let g=n;const P=o.createPropsContext(),O=o.withIdHOC(o.withPropsContext(P,o.withUnstyledHOC(o.withAdaptiveModeContext(g))));O.displayName="KendoReactDateTimePicker";m.registerForLocalization(g);exports.DateTimePicker=O;exports.DateTimePickerPropsContext=P;exports.DateTimePickerWithoutContext=g;
@@ -78,7 +78,7 @@ const o = class o extends a.Component {
78
78
  }
79
79
  }
80
80
  };
81
- return /* @__PURE__ */ a.createElement(we, { ...h }, /* @__PURE__ */ a.createElement(be, { overflowHidden: !0 }, this.renderPicker()));
81
+ return /* @__PURE__ */ a.createElement(we, { ...h }, /* @__PURE__ */ a.createElement(be, null, this.renderPicker()));
82
82
  }, this.handleReject = () => {
83
83
  this.shouldFocusDateInput = !0, this.setShow(!1);
84
84
  }, this.handleValueChange = (t) => {