@progress/kendo-react-dateinputs 9.0.0-develop.1 → 9.0.0-develop.11

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.
Files changed (42) hide show
  1. package/README.md +47 -46
  2. package/calendar/components/Calendar.mjs +57 -60
  3. package/calendar/components/CalendarNavigationItem.mjs +10 -12
  4. package/calendar/components/CalendarWeekCell.mjs +9 -1
  5. package/calendar/components/HorizontalViewList.mjs +8 -11
  6. package/calendar/components/MultiViewCalendar.mjs +13 -8
  7. package/calendar/components/Navigation.mjs +11 -11
  8. package/calendar/components/View.mjs +8 -25
  9. package/common/PickerWrap.mjs +2 -15
  10. package/dateinput/DateInput.js +1 -1
  11. package/dateinput/DateInput.mjs +264 -321
  12. package/dateinput/dateInputIntl.js +8 -0
  13. package/dateinput/dateInputIntl.mjs +20 -0
  14. package/dateinput/utils.js +1 -1
  15. package/dateinput/utils.mjs +4 -27
  16. package/datepicker/DatePicker.js +1 -1
  17. package/datepicker/DatePicker.mjs +104 -82
  18. package/daterangepicker/DateRangePicker.mjs +14 -3
  19. package/datetimepicker/DateTimePicker.js +1 -1
  20. package/datetimepicker/DateTimePicker.mjs +102 -81
  21. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  22. package/hooks/usePickerFloatingLabel.js +1 -1
  23. package/hooks/usePickerFloatingLabel.mjs +6 -11
  24. package/index.d.mts +177 -36
  25. package/index.d.ts +177 -36
  26. package/package-metadata.mjs +1 -1
  27. package/package.json +8 -7
  28. package/timepicker/TimeList.mjs +27 -12
  29. package/timepicker/TimePart.mjs +55 -75
  30. package/timepicker/TimePicker.js +1 -1
  31. package/timepicker/TimePicker.mjs +85 -69
  32. package/timepicker/TimeSelector.js +1 -1
  33. package/timepicker/TimeSelector.mjs +41 -45
  34. package/timepicker/services/DOMService.mjs +7 -4
  35. package/timepicker/services/DayPeriodService.mjs +1 -4
  36. package/timepicker/utils.mjs +3 -15
  37. package/virtualization/Virtualization.js +1 -1
  38. package/virtualization/Virtualization.mjs +3 -13
  39. package/dateinput/models/kendo-date.js +0 -8
  40. package/dateinput/models/kendo-date.mjs +0 -233
  41. package/dateinput/models/mask.js +0 -8
  42. package/dateinput/models/mask.mjs +0 -16
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),e=require("prop-types"),K=require("@progress/kendo-react-popup"),y=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),j=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-intl"),U=require("../package-metadata.js"),l=require("../messages/index.js"),H=require("../dateinput/DateInput.js"),W=require("./TimeSelector.js"),p=require("../utils.js"),f=require("./utils.js"),G=require("../hooks/usePickerFloatingLabel.js"),X=require("@progress/kendo-react-buttons"),Z=require("../common/constants.js"),$=require("../common/AdaptiveMode.js"),J=require("@progress/kendo-react-layout");function Q(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>c[t]})}}return i.default=c,Object.freeze(i)}const r=Q(_),a=class a extends r.Component{constructor(i){super(i),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:t,cancelButton:s,nowButton:o,disabled:u,format:d,steps:h,unstyled:g}=this.props;return r.createElement(W.TimeSelector,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:s,disabled:u,nowButton:o,format:d,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:g})},this.renderPopup=()=>{const{popupClass:t,...s}=this.popupSettings,{unstyled:o}=this.props,u=o&&o.uTimePicker,d=n.classNames(t),h={popupClass:n.uTimePicker.popup({c:u}),show:this.show,animate:this.element!==null,anchor:this.element,className:d,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...s};return this.props.popup?r.createElement(this.props.popup,{...h},this.renderTimeSelector()):r.createElement(K.Popup,{...h},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,s={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(l.toggleClock,l.messages[l.timePickerCancel]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(l.timePickerSet,l.messages[l.timePickerSet]),onApply:o=>this.handleValueChange(o)}};return r.createElement($.AdaptiveMode,{...s},r.createElement(J.ActionSheetContent,{overflowHidden:!0},this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,s)=>t.value!==void 0?t.value:s.value,this.nextShow=(t,s)=>t.show!==void 0?t.show:s.show,this.handleInputValueChange=t=>{const s=this.mergeTime(t.value);this.handleValueChange({...t,value:s})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:y.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:s}=this.props,o=this.state.candidate||this.value;s&&s.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:o,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=t=>{this.setShow(!1)},this.handleIconClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:s,keyCode:o}=t;if(o===n.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}s&&(o===n.Keys.up||o===n.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=o===n.Keys.up,this.setShow(o===n.Keys.down))},n.validatePackage(U.packageMetadata),this.state={value:this.props.defaultValue||a.defaultProps.defaultValue,show:this.props.defaultShow||a.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(n.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?y.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),s=this.normalizeTime(this.max),o=f.isInRange(i,t,s),u=this.props.validationMessage!==void 0,d=(!this.required||this.value!==null)&&o,h=this.props.valid!==void 0?this.props.valid:d;return{customError:u,rangeOverflow:f.isBiggerThanMax(i,s),rangeUnderflow:f.isSmallerThanMin(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Z.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:a.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get popupSettings(){return this.props.popupSettings||a.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:a.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:a.defaultProps.max}get dateInputComp(){return this.props.dateInput||a.defaultProps.dateInput}get localizationService(){return I.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=a.defaultProps.size,rounded:t=a.defaultProps.rounded,fillMode:s=a.defaultProps.fillMode,disabled:o,tabIndex:u,title:d,id:h,className:g,format:M,formatPlaceholder:D,width:O,name:P,steps:k,validationMessage:z,required:q,validityStyles:x,ariaLabelledBy:R,ariaDescribedBy:E,unstyled:v}=this.props,w=v&&v.uTimePicker,S=!this.validityStyles||this.validity.valid,B={disabled:o,format:M,formatPlaceholder:D,id:h,ariaLabelledBy:R,ariaDescribedBy:E,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:P,onChange:this.handleInputValueChange,required:q,steps:k,tabIndex:this.show?-1:u,title:d,valid:this.validity.valid,validationMessage:z,validityStyles:x,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},V=this.localizationService.toLanguageString(l.toggleClock,l.messages[l.toggleClock]),F=this.localizationService.toLanguageString(l.toggleTimeSelector,l.messages[l.toggleTimeSelector]),b=r.createElement(n.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:N,onBlur:A})=>r.createElement(r.Fragment,null,r.createElement("span",{id:this.props.id,ref:L=>{this._element=L},className:n.classNames(n.uTimePicker.wrapper({c:w,size:i,rounded:t,fillMode:s,invalid:!S,required:this.required,disabled:o}),g),onKeyDown:this.handleKeyDown,style:{width:O},onFocus:N,onBlur:A,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...B}),r.createElement(X.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:j.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:F,className:n.classNames(n.uTimePicker.inputButton({c:w})),rounded:null,fillMode:s,"aria-label":V}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(G.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:S,editorDisabled:this.props.disabled,children:b,style:{width:this.props.width}}):b}normalizeTime(i){return p.setTime(p.MIDNIGHT_DATE,i)}setShow(i){const{onOpen:t,onClose:s}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&s&&s.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?p.setTime(this.value,i):i}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};a.displayName="TimePicker",a.propTypes={className:e.string,cancelButton:e.bool,nowButton:e.bool,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"])},a.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:p.MAX_TIME,min:p.MIN_TIME,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:H.DateInput,size:"medium",rounded:"medium",fillMode:"solid"};let m=a;const T=n.createPropsContext(),C=n.withIdHOC(n.withPropsContext(T,n.withUnstyledHOC(m)));C.displayName="KendoReactTimePicker";I.registerForLocalization(m);exports.TimePicker=C;exports.TimePickerPropsContext=T;exports.TimePickerWithoutContext=m;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),e=require("prop-types"),G=require("@progress/kendo-react-popup"),y=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),X=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-intl"),Z=require("../package-metadata.js"),l=require("../messages/index.js"),$=require("../dateinput/DateInput.js"),J=require("./TimeSelector.js"),p=require("../utils.js"),f=require("./utils.js"),Q=require("../hooks/usePickerFloatingLabel.js"),Y=require("@progress/kendo-react-buttons"),ee=require("../common/constants.js"),te=require("../common/AdaptiveMode.js"),ie=require("@progress/kendo-react-layout");function se(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>c[t]})}}return i.default=c,Object.freeze(i)}const r=se(W),a=class a extends r.Component{constructor(i){super(i),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:t,cancelButton:s,nowButton:o,disabled:u,format:d,steps:h,unstyled:g}=this.props;return r.createElement(J.TimeSelector,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:s,disabled:u,nowButton:o,format:d,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:g})},this.renderPopup=()=>{const{popupClass:t,...s}=this.popupSettings,{unstyled:o}=this.props,u=o&&o.uTimePicker,d=n.classNames(t),h={popupClass:n.uTimePicker.popup({c:u}),show:this.show,animate:this.element!==null,anchor:this.element,className:d,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...s};return this.props.popup?r.createElement(this.props.popup,{...h},this.renderTimeSelector()):r.createElement(G.Popup,{...h},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,s={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(l.toggleClock,l.messages[l.timePickerCancel]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(l.timePickerSet,l.messages[l.timePickerSet]),onApply:o=>this.handleValueChange(o)}};return r.createElement(te.AdaptiveMode,{...s},r.createElement(ie.ActionSheetContent,{overflowHidden:!0},this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,s)=>t.value!==void 0?t.value:s.value,this.nextShow=(t,s)=>t.show!==void 0?t.show:s.show,this.handleInputValueChange=t=>{const s=this.mergeTime(t.value);this.handleValueChange({...t,value:s})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:y.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:s}=this.props,o=this.state.candidate||this.value;s&&s.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:o,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=t=>{this.setShow(!1)},this.handleIconClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:s,keyCode:o}=t;if(o===n.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}s&&(o===n.Keys.up||o===n.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=o===n.Keys.up,this.setShow(o===n.Keys.down))},n.validatePackage(Z.packageMetadata),this.state={value:this.props.defaultValue||a.defaultProps.defaultValue,show:this.props.defaultShow||a.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(n.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?y.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),s=this.normalizeTime(this.max),o=f.isInRange(i,t,s),u=this.props.validationMessage!==void 0,d=(!this.required||this.value!==null)&&o,h=this.props.valid!==void 0?this.props.valid:d;return{customError:u,rangeOverflow:f.isBiggerThanMax(i,s),rangeUnderflow:f.isSmallerThanMin(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ee.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:a.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get popupSettings(){return this.props.popupSettings||a.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:a.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:a.defaultProps.max}get dateInputComp(){return this.props.dateInput||a.defaultProps.dateInput}get localizationService(){return I.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=a.defaultProps.size,rounded:t=a.defaultProps.rounded,fillMode:s=a.defaultProps.fillMode,disabled:o,tabIndex:u,title:d,id:h,className:g,format:M,formatPlaceholder:P,width:D,name:O,steps:k,validationMessage:z,required:q,validityStyles:x,ariaLabelledBy:R,ariaDescribedBy:E,unstyled:v,enableMouseWheel:B,autoCorrectParts:V,autoSwitchParts:F,autoSwitchKeys:N,allowCaretMode:A}=this.props,w=v&&v.uTimePicker,S=!this.validityStyles||this.validity.valid,L={disabled:o,format:M,formatPlaceholder:P,id:h,ariaLabelledBy:R,ariaDescribedBy:E,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:O,onChange:this.handleInputValueChange,required:q,steps:k,tabIndex:this.show?-1:u,title:d,valid:this.validity.valid,validationMessage:z,validityStyles:x,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,enableMouseWheel:B,autoCorrectParts:V,autoSwitchParts:F,autoSwitchKeys:N,allowCaretMode:A},_=this.localizationService.toLanguageString(l.toggleClock,l.messages[l.toggleClock]),K=this.localizationService.toLanguageString(l.toggleTimeSelector,l.messages[l.toggleTimeSelector]),b=r.createElement(n.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:j,onBlur:U})=>r.createElement(r.Fragment,null,r.createElement("span",{id:this.props.id,ref:H=>{this._element=H},className:n.classNames(n.uTimePicker.wrapper({c:w,size:i,rounded:t,fillMode:s,invalid:!S,required:this.required,disabled:o}),g),onKeyDown:this.handleKeyDown,style:{width:D},onFocus:j,onBlur:U,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...L}),r.createElement(Y.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:X.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:K,className:n.classNames(n.uTimePicker.inputButton({c:w})),rounded:null,fillMode:s,"aria-label":_}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Q.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:S,editorDisabled:this.props.disabled,children:b,style:{width:this.props.width}}):b}normalizeTime(i){return p.setTime(p.MIDNIGHT_DATE,i)}setShow(i){const{onOpen:t,onClose:s}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&s&&s.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?p.setTime(this.value,i):i}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};a.displayName="TimePicker",a.propTypes={className:e.string,cancelButton:e.bool,nowButton:e.bool,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"])},a.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:p.MAX_TIME,min:p.MIN_TIME,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:$.DateInput,size:"medium",rounded:"medium",fillMode:"solid"};let m=a;const T=n.createPropsContext(),C=n.withIdHOC(n.withPropsContext(T,n.withUnstyledHOC(m)));C.displayName="KendoReactTimePicker";I.registerForLocalization(m);exports.TimePicker=C;exports.TimePickerPropsContext=T;exports.TimePickerWithoutContext=m;
@@ -8,41 +8,41 @@
8
8
  "use client";
9
9
  import * as a from "react";
10
10
  import e from "prop-types";
11
- import { Popup as U } from "@progress/kendo-react-popup";
11
+ import { Popup as G } from "@progress/kendo-react-popup";
12
12
  import { cloneDate as y } from "@progress/kendo-date-math";
13
- import { classNames as c, uTimePicker as g, Keys as d, validatePackage as K, canUseDOM as I, AsyncFocusBlur as H, createPropsContext as j, withIdHOC as W, withPropsContext as G, withUnstyledHOC as X } from "@progress/kendo-react-common";
14
- import { clockIcon as Z } from "@progress/kendo-svg-icons";
15
- import { provideLocalizationService as J, registerForLocalization as Q } from "@progress/kendo-react-intl";
16
- import { packageMetadata as Y } from "../package-metadata.mjs";
17
- import { toggleClock as f, messages as u, timePickerCancel as $, timePickerSet as T, toggleTimeSelector as C } from "../messages/index.mjs";
18
- import { DateInput as ee } from "../dateinput/DateInput.mjs";
19
- import { TimeSelector as te } from "./TimeSelector.mjs";
20
- import { MAX_TIME as ie, MIN_TIME as se, setTime as M, MIDNIGHT_DATE as oe } from "../utils.mjs";
21
- import { isInRange as ne, isBiggerThanMax as ae, isSmallerThanMin as le } from "./utils.mjs";
22
- import { PickerFloatingLabel as re } from "../hooks/usePickerFloatingLabel.mjs";
23
- import { Button as he } from "@progress/kendo-react-buttons";
24
- import { MOBILE_MEDIUM_DEVISE as de } from "../common/constants.mjs";
25
- import { AdaptiveMode as ue } from "../common/AdaptiveMode.mjs";
26
- import { ActionSheetContent as pe } from "@progress/kendo-react-layout";
13
+ import { classNames as c, uTimePicker as g, Keys as d, validatePackage as X, canUseDOM as I, AsyncFocusBlur as Z, createPropsContext as J, withIdHOC as Q, withPropsContext as Y, withUnstyledHOC as $ } from "@progress/kendo-react-common";
14
+ import { clockIcon as ee } from "@progress/kendo-svg-icons";
15
+ import { provideLocalizationService as te, registerForLocalization as ie } from "@progress/kendo-react-intl";
16
+ import { packageMetadata as se } from "../package-metadata.mjs";
17
+ import { toggleClock as f, messages as u, timePickerCancel as oe, timePickerSet as C, toggleTimeSelector as T } from "../messages/index.mjs";
18
+ import { DateInput as ne } from "../dateinput/DateInput.mjs";
19
+ import { TimeSelector as ae } from "./TimeSelector.mjs";
20
+ import { MAX_TIME as re, MIN_TIME as le, setTime as M, MIDNIGHT_DATE as he } from "../utils.mjs";
21
+ import { isInRange as de, isBiggerThanMax as ue, isSmallerThanMin as pe } from "./utils.mjs";
22
+ import { PickerFloatingLabel as me } from "../hooks/usePickerFloatingLabel.mjs";
23
+ import { Button as ce } from "@progress/kendo-react-buttons";
24
+ import { MOBILE_MEDIUM_DEVISE as ge } from "../common/constants.mjs";
25
+ import { AdaptiveMode as fe } from "../common/AdaptiveMode.mjs";
26
+ import { ActionSheetContent as ve } from "@progress/kendo-react-layout";
27
27
  const n = class n extends a.Component {
28
28
  constructor(i) {
29
29
  super(i), this._element = null, this._dateInput = a.createRef(), this._timeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
30
30
  this.dateInput && this.dateInput.focus();
31
31
  }, this.renderTimeSelector = () => {
32
- const { smoothScroll: t, cancelButton: s, nowButton: o, disabled: r, format: h, steps: l, unstyled: m } = this.props;
32
+ const { smoothScroll: t, cancelButton: s, nowButton: o, disabled: l, format: h, steps: r, unstyled: m } = this.props;
33
33
  return /* @__PURE__ */ a.createElement(
34
- te,
34
+ ae,
35
35
  {
36
36
  ref: this.setTimeSelectorRef,
37
37
  mobileMode: this.mobileMode,
38
38
  show: this.show,
39
39
  cancelButton: s,
40
- disabled: r,
40
+ disabled: l,
41
41
  nowButton: o,
42
42
  format: h,
43
43
  min: this.min,
44
44
  max: this.max,
45
- steps: l,
45
+ steps: r,
46
46
  smoothScroll: t,
47
47
  value: this.value,
48
48
  footer: !this.mobileMode,
@@ -53,10 +53,8 @@ const n = class n extends a.Component {
53
53
  }
54
54
  );
55
55
  }, this.renderPopup = () => {
56
- const { popupClass: t, ...s } = this.popupSettings, { unstyled: o } = this.props, r = o && o.uTimePicker, h = c(
57
- t
58
- ), l = {
59
- popupClass: g.popup({ c: r }),
56
+ const { popupClass: t, ...s } = this.popupSettings, { unstyled: o } = this.props, l = o && o.uTimePicker, h = c(t), r = {
57
+ popupClass: g.popup({ c: l }),
60
58
  show: this.show,
61
59
  animate: this.element !== null,
62
60
  anchor: this.element,
@@ -72,7 +70,7 @@ const n = class n extends a.Component {
72
70
  },
73
71
  ...s
74
72
  };
75
- return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...l }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(U, { ...l }, this.renderTimeSelector());
73
+ return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...r }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(G, { ...r }, this.renderTimeSelector());
76
74
  }, this.renderAdaptivePopup = () => {
77
75
  const { windowWidth: t = 0 } = this.state, s = {
78
76
  expand: this.show,
@@ -80,13 +78,13 @@ const n = class n extends a.Component {
80
78
  adaptiveTitle: this.props.adaptiveTitle,
81
79
  windowWidth: t,
82
80
  footer: {
83
- cancelText: this.localizationService.toLanguageString(f, u[$]),
81
+ cancelText: this.localizationService.toLanguageString(f, u[oe]),
84
82
  onCancel: this.handleValueReject,
85
- applyText: this.localizationService.toLanguageString(T, u[T]),
83
+ applyText: this.localizationService.toLanguageString(C, u[C]),
86
84
  onApply: (o) => this.handleValueChange(o)
87
85
  }
88
86
  };
89
- return /* @__PURE__ */ a.createElement(ue, { ...s }, /* @__PURE__ */ a.createElement(pe, { overflowHidden: !0 }, this.renderTimeSelector()));
87
+ return /* @__PURE__ */ a.createElement(fe, { ...s }, /* @__PURE__ */ a.createElement(ve, { overflowHidden: !0 }, this.renderTimeSelector()));
90
88
  }, this.setTimeSelectorRef = (t) => {
91
89
  this._timeSelector = t;
92
90
  }, this.nextValue = (t, s) => t.value !== void 0 ? t.value : s.value, this.nextShow = (t, s) => t.show !== void 0 ? t.show : s.show, this.handleInputValueChange = (t) => {
@@ -123,7 +121,7 @@ const n = class n extends a.Component {
123
121
  return;
124
122
  }
125
123
  s && (o === d.up || o === d.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = o === d.up, this.setShow(o === d.down));
126
- }, K(Y), this.state = {
124
+ }, X(se), this.state = {
127
125
  value: this.props.defaultValue || n.defaultProps.defaultValue,
128
126
  show: this.props.defaultShow || n.defaultProps.defaultShow,
129
127
  focused: !1,
@@ -178,12 +176,12 @@ const n = class n extends a.Component {
178
176
  * Represents the validity state into which the TimePicker is set.
179
177
  */
180
178
  get validity() {
181
- const i = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), s = this.normalizeTime(this.max), o = ne(i, t, s), r = this.props.validationMessage !== void 0, h = (!this.required || this.value !== null) && o, l = this.props.valid !== void 0 ? this.props.valid : h;
179
+ const i = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), s = this.normalizeTime(this.max), o = de(i, t, s), l = this.props.validationMessage !== void 0, h = (!this.required || this.value !== null) && o, r = this.props.valid !== void 0 ? this.props.valid : h;
182
180
  return {
183
- customError: r,
184
- rangeOverflow: ae(i, s),
185
- rangeUnderflow: le(i, t),
186
- valid: l,
181
+ customError: l,
182
+ rangeOverflow: ue(i, s),
183
+ rangeUnderflow: pe(i, t),
184
+ valid: r,
187
185
  valueMissing: this.value === null
188
186
  };
189
187
  }
@@ -191,7 +189,7 @@ const n = class n extends a.Component {
191
189
  * The mobile mode of the ComboBox.
192
190
  */
193
191
  get mobileMode() {
194
- return !!(this.state.windowWidth && this.state.windowWidth <= de && this.props.adaptive);
192
+ return !!(this.state.windowWidth && this.state.windowWidth <= ge && this.props.adaptive);
195
193
  }
196
194
  /**
197
195
  * @hidden
@@ -218,7 +216,7 @@ const n = class n extends a.Component {
218
216
  return this.props.dateInput || n.defaultProps.dateInput;
219
217
  }
220
218
  get localizationService() {
221
- return J(this);
219
+ return te(this);
222
220
  }
223
221
  /**
224
222
  * @hidden
@@ -249,9 +247,9 @@ const n = class n extends a.Component {
249
247
  rounded: t = n.defaultProps.rounded,
250
248
  fillMode: s = n.defaultProps.fillMode,
251
249
  disabled: o,
252
- tabIndex: r,
250
+ tabIndex: l,
253
251
  title: h,
254
- id: l,
252
+ id: r,
255
253
  className: m,
256
254
  format: D,
257
255
  formatPlaceholder: O,
@@ -263,12 +261,17 @@ const n = class n extends a.Component {
263
261
  validityStyles: B,
264
262
  ariaLabelledBy: R,
265
263
  ariaDescribedBy: V,
266
- unstyled: v
267
- } = this.props, w = v && v.uTimePicker, S = !this.validityStyles || this.validity.valid, F = {
264
+ unstyled: v,
265
+ enableMouseWheel: F,
266
+ autoCorrectParts: A,
267
+ autoSwitchParts: N,
268
+ autoSwitchKeys: L,
269
+ allowCaretMode: _
270
+ } = this.props, w = v && v.uTimePicker, S = !this.validityStyles || this.validity.valid, q = {
268
271
  disabled: o,
269
272
  format: D,
270
273
  formatPlaceholder: O,
271
- id: l,
274
+ id: r,
272
275
  ariaLabelledBy: R,
273
276
  ariaDescribedBy: V,
274
277
  max: this.normalizeTime(this.max),
@@ -277,7 +280,7 @@ const n = class n extends a.Component {
277
280
  onChange: this.handleInputValueChange,
278
281
  required: k,
279
282
  steps: x,
280
- tabIndex: this.show ? -1 : r,
283
+ tabIndex: this.show ? -1 : l,
281
284
  title: h,
282
285
  valid: this.validity.valid,
283
286
  validationMessage: E,
@@ -290,21 +293,29 @@ const n = class n extends a.Component {
290
293
  size: null,
291
294
  fillMode: null,
292
295
  rounded: null,
293
- readonly: this.mobileMode
294
- }, A = this.localizationService.toLanguageString(f, u[f]), N = this.localizationService.toLanguageString(C, u[C]), b = /* @__PURE__ */ a.createElement(
295
- H,
296
+ readonly: this.mobileMode,
297
+ enableMouseWheel: F,
298
+ autoCorrectParts: A,
299
+ autoSwitchParts: N,
300
+ autoSwitchKeys: L,
301
+ allowCaretMode: _
302
+ }, K = this.localizationService.toLanguageString(f, u[f]), U = this.localizationService.toLanguageString(
303
+ T,
304
+ u[T]
305
+ ), b = /* @__PURE__ */ a.createElement(
306
+ Z,
296
307
  {
297
308
  onFocus: this.handleFocus,
298
309
  onBlur: this.mobileMode ? void 0 : this.handleBlur,
299
310
  onSyncBlur: this.props.onBlur,
300
311
  onSyncFocus: this.props.onFocus
301
312
  },
302
- ({ onFocus: L, onBlur: _ }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
313
+ ({ onFocus: H, onBlur: j }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
303
314
  "span",
304
315
  {
305
316
  id: this.props.id,
306
- ref: (q) => {
307
- this._element = q;
317
+ ref: (W) => {
318
+ this._element = W;
308
319
  },
309
320
  className: c(
310
321
  g.wrapper({
@@ -320,8 +331,8 @@ const n = class n extends a.Component {
320
331
  ),
321
332
  onKeyDown: this.handleKeyDown,
322
333
  style: { width: P },
323
- onFocus: L,
324
- onBlur: _,
334
+ onFocus: H,
335
+ onBlur: j,
325
336
  onClick: this.mobileMode ? this.handleIconClick : void 0
326
337
  },
327
338
  /* @__PURE__ */ a.createElement(
@@ -330,34 +341,34 @@ const n = class n extends a.Component {
330
341
  _ref: this._dateInput,
331
342
  ariaRole: "combobox",
332
343
  ariaControls: this._popupId,
333
- ...F
344
+ ...q
334
345
  }
335
346
  ),
336
347
  /* @__PURE__ */ a.createElement(
337
- he,
348
+ ce,
338
349
  {
339
350
  tabIndex: -1,
340
351
  type: "button",
341
352
  icon: "clock",
342
- svgIcon: Z,
353
+ svgIcon: ee,
343
354
  onMouseDown: this.handleIconMouseDown,
344
355
  onClick: this.mobileMode ? void 0 : this.handleIconClick,
345
- title: N,
356
+ title: U,
346
357
  className: c(g.inputButton({ c: w })),
347
358
  rounded: null,
348
359
  fillMode: s,
349
- "aria-label": A
360
+ "aria-label": K
350
361
  }
351
362
  ),
352
363
  !this.mobileMode && this.renderPopup()
353
364
  ), this.mobileMode && this.renderAdaptivePopup())
354
365
  );
355
366
  return this.props.label ? /* @__PURE__ */ a.createElement(
356
- re,
367
+ me,
357
368
  {
358
369
  dateInput: this._dateInput,
359
370
  label: this.props.label,
360
- editorId: l,
371
+ editorId: r,
361
372
  editorValid: S,
362
373
  editorDisabled: this.props.disabled,
363
374
  children: b,
@@ -366,7 +377,7 @@ const n = class n extends a.Component {
366
377
  ) : b;
367
378
  }
368
379
  normalizeTime(i) {
369
- return M(oe, i);
380
+ return M(he, i);
370
381
  }
371
382
  setShow(i) {
372
383
  const { onOpen: t, onClose: s } = this.props;
@@ -412,7 +423,12 @@ n.displayName = "TimePicker", n.propTypes = {
412
423
  })
413
424
  ]),
414
425
  formatPlaceholder: e.oneOfType([
415
- e.oneOf(["wide", "narrow", "short", "formatPattern"]),
426
+ e.oneOf([
427
+ "wide",
428
+ "narrow",
429
+ "short",
430
+ "formatPattern"
431
+ ]),
416
432
  e.shape({
417
433
  year: e.string,
418
434
  month: e.string,
@@ -456,28 +472,28 @@ n.displayName = "TimePicker", n.propTypes = {
456
472
  defaultValue: null,
457
473
  disabled: !1,
458
474
  format: "t",
459
- max: ie,
460
- min: se,
475
+ max: re,
476
+ min: le,
461
477
  popupSettings: {},
462
478
  tabIndex: 0,
463
479
  steps: {},
464
480
  validityStyles: !0,
465
- dateInput: ee,
481
+ dateInput: ne,
466
482
  size: "medium",
467
483
  rounded: "medium",
468
484
  fillMode: "solid"
469
485
  };
470
486
  let p = n;
471
- const me = j(), ce = W(
472
- G(
473
- me,
474
- X(p)
487
+ const we = J(), Se = Q(
488
+ Y(
489
+ we,
490
+ $(p)
475
491
  )
476
492
  );
477
- ce.displayName = "KendoReactTimePicker";
478
- Q(p);
493
+ Se.displayName = "KendoReactTimePicker";
494
+ ie(p);
479
495
  export {
480
- ce as TimePicker,
481
- me as TimePickerPropsContext,
496
+ Se as TimePicker,
497
+ we as TimePickerPropsContext,
482
498
  p as TimePickerWithoutContext
483
499
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),e=require("prop-types"),g=require("@progress/kendo-date-math"),s=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),y=require("../utils.js"),m=require("./utils.js"),K=require("./TimePart.js"),O=require("@progress/kendo-react-buttons");function x(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return i.default=u,Object.freeze(i)}const l=x(I),c=class c extends l.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:n}=t;switch(n){case s.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:n,shiftKey:o}=t;!o&&n===s.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var p;const{keyCode:n,shiftKey:o}=t;o&&n===s.Keys.tab?(t.preventDefault(),this._acceptButton&&((p=this._acceptButton.element)==null||p.focus({preventScroll:!0}))):n===s.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),this.timePart?this.timePart.value:this.current);this.setState({value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:n}=this.props;n&&n.call(void 0,t)},this.handleNowClick=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),m.getNow());this.setState({current:n,value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:n}=this.props;n&&n.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||c.defaultProps.format),this.mergeValue=m.valueMerger(m.generateGetters(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||y.MIDNIGHT_DATE,value:this.props.value||c.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?g.cloneDate(i):null}get intl(){return f.provideIntlService(this)}get current(){return this.state.current!==null?g.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:n,tabIndex:o,className:p,smoothScroll:P,min:B,max:k,boundRange:N,nowButton:T,steps:S,show:_,mobileMode:C,unstyled:h}=this.props,E=h&&h.uTimePicker,v=h&&h.uTime,D=f.provideLocalizationService(this),b=D.toLanguageString(r.timePickerCancel,r.messages[r.timePickerCancel]),w=D.toLanguageString(r.timePickerSet,r.messages[r.timePickerSet]);return l.createElement("div",{ref:a=>{this._element=a},tabIndex:n?void 0:o||0,className:s.classNames(s.uTimePicker.timeSelector({c:E,mobileMode:C,disabled:n}),p),onKeyDown:this.handleKeyDown},l.createElement(K.TimePart,{ref:a=>{this.timePart=a},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:P,min:B,max:k,boundRange:N,disabled:n,nowButton:T,steps:S,show:_,mobileMode:C,onNowKeyDown:this.handleNowKeyDown,unstyled:h}),this.props.footer&&l.createElement("div",{className:s.classNames(s.uTime.footer({c:v}))},t&&l.createElement(O.Button,{type:"button",ref:a=>{this._cancelButton=a},className:s.classNames(s.uTime.cancel({c:v})),onClick:this.handleReject,title:b,"aria-label":b},b),l.createElement(O.Button,{type:"button",ref:a=>{this._acceptButton=a},className:s.classNames(s.uTime.accept({c:v})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:w,"aria-label":w},w)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=s.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};c.propTypes={cancelButton:e.bool,className:e.string,disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),max:e.instanceOf(Date),min:e.instanceOf(Date),nowButton:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,value:e.instanceOf(Date),show:e.bool},c.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:y.MIN_TIME,max:y.MAX_TIME,boundRange:!1,footer:!0};let d=c;f.registerForIntl(d);f.registerForLocalization(d);exports.TimeSelector=d;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),e=require("prop-types"),g=require("@progress/kendo-date-math"),s=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-intl"),l=require("../messages/index.js"),y=require("../utils.js"),m=require("./utils.js"),K=require("./TimePart.js"),O=require("@progress/kendo-react-buttons");function x(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return i.default=u,Object.freeze(i)}const a=x(I),c=class c extends a.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:n}=t;switch(n){case s.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:n,shiftKey:o}=t;!o&&n===s.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var p;const{keyCode:n,shiftKey:o}=t;o&&n===s.Keys.tab?(t.preventDefault(),this._acceptButton&&((p=this._acceptButton.element)==null||p.focus({preventScroll:!0}))):n===s.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),this.timePart?this.timePart.value:this.current);this.setState({value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:n}=this.props;n&&n.call(void 0,t)},this.handleNowClick=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),m.getNow());this.setState({current:n,value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:n}=this.props;n&&n.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||c.defaultProps.format),this.mergeValue=m.valueMerger(m.generateGetters(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||y.MIDNIGHT_DATE,value:this.props.value||c.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?g.cloneDate(i):null}get intl(){return f.provideIntlService(this)}get current(){return this.state.current!==null?g.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:n,tabIndex:o,className:p,smoothScroll:P,min:B,max:k,boundRange:N,nowButton:T,steps:S,show:E,mobileMode:C,unstyled:h}=this.props,_=h&&h.uTimePicker,v=h&&h.uTime,D=f.provideLocalizationService(this),b=D.toLanguageString(l.timePickerCancel,l.messages[l.timePickerCancel]),w=D.toLanguageString(l.timePickerSet,l.messages[l.timePickerSet]);return a.createElement(a.Fragment,null,a.createElement("div",{ref:r=>{this._element=r},tabIndex:n?void 0:o||0,className:s.classNames(s.uTimePicker.timeSelector({c:_,mobileMode:C,disabled:n}),p),onKeyDown:this.handleKeyDown},a.createElement(K.TimePart,{ref:r=>{this.timePart=r},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:P,min:B,max:k,boundRange:N,disabled:n,nowButton:T,steps:S,show:E,mobileMode:C,onNowKeyDown:this.handleNowKeyDown,unstyled:h})),this.props.footer&&a.createElement("div",{className:s.classNames(s.uTime.footer({c:v}))},t&&a.createElement(O.Button,{type:"button",ref:r=>{this._cancelButton=r},className:s.classNames(s.uTime.cancel({c:v})),onClick:this.handleReject,title:b,"aria-label":b},b),a.createElement(O.Button,{type:"button",ref:r=>{this._acceptButton=r},className:s.classNames(s.uTime.accept({c:v})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:w,"aria-label":w},w)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=s.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};c.propTypes={cancelButton:e.bool,className:e.string,disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),max:e.instanceOf(Date),min:e.instanceOf(Date),nowButton:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,value:e.instanceOf(Date),show:e.bool},c.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:y.MIN_TIME,max:y.MAX_TIME,boundRange:!1,footer:!0};let d=c;f.registerForIntl(d);f.registerForLocalization(d);exports.TimeSelector=d;
@@ -6,17 +6,17 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
9
+ import * as s from "react";
10
10
  import t from "prop-types";
11
11
  import { cloneDate as u } from "@progress/kendo-date-math";
12
- import { Keys as h, classNames as m, uTimePicker as x, uTime as g, getActiveElement as A } from "@progress/kendo-react-common";
13
- import { provideIntlService as K, provideLocalizationService as M, registerForIntl as R, registerForLocalization as F } from "@progress/kendo-react-intl";
12
+ import { Keys as h, classNames as m, uTimePicker as x, uTime as v, getActiveElement as A } from "@progress/kendo-react-common";
13
+ import { provideIntlService as K, provideLocalizationService as M, registerForIntl as F, registerForLocalization as R } from "@progress/kendo-react-intl";
14
14
  import { timePickerCancel as y, messages as B, timePickerSet as D } from "../messages/index.mjs";
15
15
  import { MIDNIGHT_DATE as L, MIN_TIME as j, MAX_TIME as z } from "../utils.mjs";
16
16
  import { getNow as w, valueMerger as V, generateGetters as G } from "./utils.mjs";
17
17
  import { TimePart as H } from "./TimePart.mjs";
18
18
  import { Button as O } from "@progress/kendo-react-buttons";
19
- const r = class r extends a.Component {
19
+ const r = class r extends s.Component {
20
20
  constructor(i) {
21
21
  super(i), this._element = null, this._cancelButton = null, this._acceptButton = null, this.timePart = null, this.focusActiveList = () => {
22
22
  this.timePart && this.timePart.focus({ preventScroll: !0 });
@@ -54,10 +54,7 @@ const r = class r extends a.Component {
54
54
  const { onReject: n } = this.props;
55
55
  n && n.call(void 0, e);
56
56
  }, this.handleNowClick = (e) => {
57
- const n = this.mergeValue(
58
- u(this.value || w()),
59
- w()
60
- );
57
+ const n = this.mergeValue(u(this.value || w()), w());
61
58
  this.setState({
62
59
  current: n,
63
60
  value: n
@@ -121,12 +118,12 @@ const r = class r extends a.Component {
121
118
  show: _,
122
119
  mobileMode: b,
123
120
  unstyled: l
124
- } = this.props, I = l && l.uTimePicker, d = l && l.uTime, C = M(this), f = C.toLanguageString(y, B[y]), v = C.toLanguageString(D, B[D]);
125
- return /* @__PURE__ */ a.createElement(
121
+ } = this.props, I = l && l.uTimePicker, d = l && l.uTime, C = M(this), f = C.toLanguageString(y, B[y]), g = C.toLanguageString(D, B[D]);
122
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
126
123
  "div",
127
124
  {
128
- ref: (s) => {
129
- this._element = s;
125
+ ref: (a) => {
126
+ this._element = a;
130
127
  },
131
128
  tabIndex: n ? void 0 : o || 0,
132
129
  className: m(
@@ -139,11 +136,11 @@ const r = class r extends a.Component {
139
136
  ),
140
137
  onKeyDown: this.handleKeyDown
141
138
  },
142
- /* @__PURE__ */ a.createElement(
139
+ /* @__PURE__ */ s.createElement(
143
140
  H,
144
141
  {
145
- ref: (s) => {
146
- this.timePart = s;
142
+ ref: (a) => {
143
+ this.timePart = a;
147
144
  },
148
145
  value: this.current,
149
146
  onChange: this.handleChange,
@@ -161,37 +158,36 @@ const r = class r extends a.Component {
161
158
  onNowKeyDown: this.handleNowKeyDown,
162
159
  unstyled: l
163
160
  }
164
- ),
165
- this.props.footer && /* @__PURE__ */ a.createElement("div", { className: m(g.footer({ c: d })) }, e && /* @__PURE__ */ a.createElement(
166
- O,
167
- {
168
- type: "button",
169
- ref: (s) => {
170
- this._cancelButton = s;
171
- },
172
- className: m(g.cancel({ c: d })),
173
- onClick: this.handleReject,
174
- title: f,
175
- "aria-label": f
161
+ )
162
+ ), this.props.footer && /* @__PURE__ */ s.createElement("div", { className: m(v.footer({ c: d })) }, e && /* @__PURE__ */ s.createElement(
163
+ O,
164
+ {
165
+ type: "button",
166
+ ref: (a) => {
167
+ this._cancelButton = a;
176
168
  },
177
- f
178
- ), /* @__PURE__ */ a.createElement(
179
- O,
180
- {
181
- type: "button",
182
- ref: (s) => {
183
- this._acceptButton = s;
184
- },
185
- className: m(g.accept({ c: d })),
186
- themeColor: "primary",
187
- onClick: this.handleAccept,
188
- onKeyDown: this.revertToNowButton,
189
- title: v,
190
- "aria-label": v
169
+ className: m(v.cancel({ c: d })),
170
+ onClick: this.handleReject,
171
+ title: f,
172
+ "aria-label": f
173
+ },
174
+ f
175
+ ), /* @__PURE__ */ s.createElement(
176
+ O,
177
+ {
178
+ type: "button",
179
+ ref: (a) => {
180
+ this._acceptButton = a;
191
181
  },
192
- v
193
- ))
194
- );
182
+ className: m(v.accept({ c: d })),
183
+ themeColor: "primary",
184
+ onClick: this.handleAccept,
185
+ onKeyDown: this.revertToNowButton,
186
+ title: g,
187
+ "aria-label": g
188
+ },
189
+ g
190
+ )));
195
191
  }
196
192
  nextTick(i) {
197
193
  clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => i());
@@ -250,8 +246,8 @@ r.propTypes = {
250
246
  footer: !0
251
247
  };
252
248
  let p = r;
253
- R(p);
254
249
  F(p);
250
+ R(p);
255
251
  export {
256
252
  p as TimeSelector
257
253
  };
@@ -18,10 +18,13 @@ class y {
18
18
  calculateHeights(c, n) {
19
19
  if (!C)
20
20
  return;
21
- const t = n && n.uTime, o = s("div"), p = s("span"), u = s("ul"), h = s("li"), m = () => h("<span>02</span>", i(e.li({ c: t }))), d = () => u([m()], i(e.ul({ c: t }))), f = () => o([d()], i(
22
- e.containerSelector({ c: t }),
23
- e.container({ c: t, content: !0, scrollable: !0 })
24
- )), g = o(
21
+ const t = n && n.uTime, o = s("div"), p = s("span"), u = s("ul"), h = s("li"), m = () => h("<span>02</span>", i(e.li({ c: t }))), d = () => u([m()], i(e.ul({ c: t }))), f = () => o(
22
+ [d()],
23
+ i(
24
+ e.containerSelector({ c: t }),
25
+ e.container({ c: t, content: !0, scrollable: !0 })
26
+ )
27
+ ), g = o(
25
28
  [
26
29
  p("minute", i(e.title({ c: t }))),
27
30
  o([f()], i(e.list({ c: t })))
@@ -78,10 +78,7 @@ class H {
78
78
  }
79
79
  normalizedRange() {
80
80
  const t = this.min.getHours(), n = this.max.getHours();
81
- return [
82
- Math.min(t, n),
83
- Math.max(t, n)
84
- ];
81
+ return [Math.min(t, n), Math.max(t, n)];
85
82
  }
86
83
  }
87
84
  export {
@@ -38,29 +38,17 @@ const a = (e) => (t, r) => {
38
38
  }), F = (e, t, r) => {
39
39
  if (!e || !t || !r)
40
40
  return e;
41
- const {
42
- candidateValue: n,
43
- minValue: s,
44
- maxValue: o
45
- } = i(e, t, r);
41
+ const { candidateValue: n, minValue: s, maxValue: o } = i(e, t, r);
46
42
  return n < s ? u(e, t) : n > o ? u(e, r) : e;
47
43
  }, N = (e, t, r) => {
48
44
  if (!e || !t || !r)
49
45
  return !0;
50
- const {
51
- candidateValue: n,
52
- minValue: s,
53
- maxValue: o
54
- } = i(e, t, r);
46
+ const { candidateValue: n, minValue: s, maxValue: o } = i(e, t, r);
55
47
  return s <= n && n <= o;
56
48
  }, P = (e, t, r) => {
57
49
  if (e === null)
58
50
  return !0;
59
- const {
60
- candidateValue: n,
61
- minValue: s,
62
- maxValue: o
63
- } = i(e, t, r);
51
+ const { candidateValue: n, minValue: s, maxValue: o } = i(e, t, r);
64
52
  return s <= n && n <= o;
65
53
  }, v = (e, t) => {
66
54
  if (e === null || t === null)