@progress/kendo-react-dateinputs 14.4.1 → 14.5.0-develop.10

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/calendar/components/Calendar.d.ts +35 -110
  2. package/calendar/components/Calendar.js +5 -5
  3. package/calendar/components/Calendar.mjs +288 -313
  4. package/calendar/components/CalendarCell.d.ts +1 -10
  5. package/calendar/components/CalendarCell.js +1 -1
  6. package/calendar/components/CalendarCell.mjs +68 -78
  7. package/calendar/components/Header.d.ts +10 -23
  8. package/calendar/components/Header.js +1 -1
  9. package/calendar/components/Header.mjs +41 -55
  10. package/calendar/components/HorizontalViewList.d.ts +28 -26
  11. package/calendar/components/HorizontalViewList.js +1 -1
  12. package/calendar/components/HorizontalViewList.mjs +112 -102
  13. package/calendar/components/MultiViewCalendar.d.ts +39 -141
  14. package/calendar/components/MultiViewCalendar.js +1 -1
  15. package/calendar/components/MultiViewCalendar.mjs +331 -373
  16. package/calendar/components/Navigation.d.ts +19 -39
  17. package/calendar/components/Navigation.js +1 -1
  18. package/calendar/components/Navigation.mjs +95 -107
  19. package/calendar/components/TodayCommand.d.ts +8 -25
  20. package/calendar/components/TodayCommand.js +1 -1
  21. package/calendar/components/TodayCommand.mjs +44 -61
  22. package/calendar/components/View.d.ts +11 -42
  23. package/calendar/components/View.js +1 -1
  24. package/calendar/components/View.mjs +111 -137
  25. package/calendar/components/ViewList.d.ts +25 -65
  26. package/calendar/components/ViewList.js +1 -1
  27. package/calendar/components/ViewList.mjs +207 -225
  28. package/calendar/services/ScrollSyncService.d.ts +4 -4
  29. package/dateinput/DateInput.js +1 -1
  30. package/dateinput/DateInput.mjs +55 -55
  31. package/datetimepicker/DateTimeSelector.d.ts +2 -3
  32. package/datetimepicker/DateTimeSelector.js +1 -1
  33. package/datetimepicker/DateTimeSelector.mjs +92 -89
  34. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  35. package/package-metadata.js +1 -1
  36. package/package-metadata.mjs +2 -2
  37. package/package.json +14 -9
  38. package/timepicker/TimePicker.js +1 -1
  39. package/timepicker/TimePicker.mjs +2 -2
  40. package/virtualization/Virtualization.d.ts +25 -63
  41. package/virtualization/Virtualization.js +1 -1
  42. package/virtualization/Virtualization.mjs +163 -168
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1777886224,version:"14.4.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1778664042,version:"14.5.0-develop.10",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
@@ -6,8 +6,8 @@ export const packageMetadata = Object.freeze({
6
6
  productName: 'KendoReact',
7
7
  productCode: 'KENDOUIREACT',
8
8
  productCodes: ['KENDOUIREACT'],
9
- publishDate: 1777886224,
10
- version: '14.4.1',
9
+ publishDate: 1778664042,
10
+ version: '14.5.0-develop.10',
11
11
  licensingDocsUrl:
12
12
  'https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-dateinputs",
3
- "version": "14.4.1",
3
+ "version": "14.5.0-develop.10",
4
4
  "description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -28,13 +28,13 @@
28
28
  "@progress/kendo-date-math": "^1.4.0",
29
29
  "@progress/kendo-licensing": "^1.7.2",
30
30
  "@progress/kendo-dateinputs-common": "^0.4.7",
31
- "@progress/kendo-react-buttons": "14.4.1",
32
- "@progress/kendo-react-common": "14.4.1",
33
- "@progress/kendo-react-intl": "14.4.1",
34
- "@progress/kendo-react-labels": "14.4.1",
35
- "@progress/kendo-react-layout": "14.4.1",
36
- "@progress/kendo-react-popup": "14.4.1",
37
- "@progress/kendo-svg-icons": "^4.0.0",
31
+ "@progress/kendo-react-buttons": "14.5.0-develop.10",
32
+ "@progress/kendo-react-common": "14.5.0-develop.10",
33
+ "@progress/kendo-react-intl": "14.5.0-develop.10",
34
+ "@progress/kendo-react-labels": "14.5.0-develop.10",
35
+ "@progress/kendo-react-layout": "14.5.0-develop.10",
36
+ "@progress/kendo-react-popup": "14.5.0-develop.10",
37
+ "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
38
38
  "react": "^18.0.0 || ^19.0.0",
39
39
  "react-dom": "^18.0.0 || ^19.0.0"
40
40
  },
@@ -89,7 +89,7 @@
89
89
  "package": {
90
90
  "productName": "KendoReact",
91
91
  "productCode": "KENDOUIREACT",
92
- "publishDate": 1777886224,
92
+ "publishDate": 1778664042,
93
93
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
94
94
  }
95
95
  },
@@ -99,5 +99,10 @@
99
99
  },
100
100
  "publishConfig": {
101
101
  "access": "public"
102
+ },
103
+ "peerDependenciesMeta": {
104
+ "@progress/kendo-svg-icons": {
105
+ "optional": true
106
+ }
102
107
  }
103
108
  }
@@ -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 X=require("react"),t=require("prop-types"),Z=require("@progress/kendo-react-popup"),y=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),$=require("@progress/kendo-svg-icons"),P=require("@progress/kendo-react-intl"),T=require("../package-metadata.js"),l=require("../messages/index.js"),J=require("../dateinput/DateInput.js"),Q=require("./TimeSelector.js"),p=require("../utils.js"),g=require("./utils.js"),Y=require("../hooks/usePickerFloatingLabel.js"),ee=require("@progress/kendo-react-buttons"),te=require("../common/AdaptiveMode.js"),ie=require("@progress/kendo-react-layout");function se(c){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:()=>c[e]})}}return s.default=c,Object.freeze(s)}const a=se(X),r=class r extends a.Component{constructor(s){super(s),this._element=null,this._dateInput=a.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.showLicenseWatermark=!1,this.handleKendoPasteValue=e=>{if(e instanceof Date&&!isNaN(e.getTime())){this.applyKendoPasteTime(e);return}const i=e!=null?String(e):"";if(!i)return;const o=new Date(i);isNaN(o.getTime())||this.applyKendoPasteTime(o)},this.applyKendoPasteTime=e=>{const i=this.normalizeTime(e);if(!g.isInRange(i,this.min,this.max))return;const o=new Event("change",{bubbles:!0}),h={target:this._element,currentTarget:this._element,nativeEvent:o};this.handleValueChange({syntheticEvent:h,nativeEvent:o,value:i})},this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:i,nowButton:o,disabled:h,format:d,steps:u,unstyled:f}=this.props;return a.createElement(Q.TimeSelector,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:i,disabled:h,nowButton:o,format:d,min:this.min,max:this.max,steps:u,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:f})},this.renderPopup=()=>{const{popupClass:e,...i}=this.popupSettings,{unstyled:o}=this.props,h=o&&o.uTimePicker,d=n.classNames(e),u={popupClass:n.uTimePicker.popup({c:h}),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"},...i};return this.props.popup?a.createElement(this.props.popup,{...u},this.renderTimeSelector()):a.createElement(Z.Popup,{...u},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,i={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:e,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 a.createElement(te.AdaptiveMode,{...i},a.createElement(ie.ActionSheetContent,null,this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,i)=>e.value!==void 0?e.value:i.value,this.nextShow=(e,i)=>e.show!==void 0?e.show:i.show,this.handleInputValueChange=e=>{const i=this.mergeTime(e.value);this.handleValueChange({...e,value:i})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:y.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props,o=this.state.candidate||this.value;i&&i.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.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=e=>{this.setShow(!1)},this.handleClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:i,keyCode:o}=e;if(o===n.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}i&&(o===n.Keys.up||o===n.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=o===n.Keys.up,this.setShow(o===n.Keys.down))},this.showLicenseWatermark=!n.validatePackage(T.packageMetadata,{component:"TimePicker"}),this.licenseMessage=n.getLicenseMessage(T.packageMetadata),this.state={value:this.props.defaultValue||r.defaultProps.defaultValue,show:this.props.defaultShow||r.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?y.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),i=this.normalizeTime(this.max),o=g.isInRange(s,e,i),h=this.props.validationMessage!==void 0,d=(!this.required||this.value!==null)&&o,u=this.props.valid!==void 0?this.props.valid:d;return{customError:h,rangeOverflow:g.isBiggerThanMax(s,i),rangeUnderflow:g.isSmallerThanMin(s,e),valid:u,valueMissing:this.value===null}}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)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:r.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get popupSettings(){return this.props.popupSettings||r.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:r.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:r.defaultProps.max}get dateInputComp(){return this.props.dateInput||r.defaultProps.dateInput}get localizationService(){return P.provideLocalizationService(this)}componentDidMount(){var e;this.observerResize=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(e=this.document)!=null&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body);const s=this.props.name||this.props.id;this.KendoPasteSubscription=n.subscribeToKendoPaste(this._element,{fieldName:s,onValueChange:i=>{this.handleKendoPasteValue(i)}})}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow&&this._timeSelector.focusActiveList(),this.mobileMode&&this.show&&!this.prevShow&&setTimeout(()=>{this._timeSelector&&this._timeSelector.focusActiveList()},300),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s,e;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect(),(e=this.KendoPasteSubscription)==null||e.unsubscribe()}render(){const{size:s=r.defaultProps.size,rounded:e=r.defaultProps.rounded,fillMode:i=r.defaultProps.fillMode,disabled:o,tabIndex:h,title:d,id:u,className:f,format:I,formatPlaceholder:k,width:D,name:O,steps:z,validationMessage:x,required:R,validityStyles:q,ariaLabelledBy:E,ariaDescribedBy:N,unstyled:v,enableMouseWheel:B,autoCorrectParts:K,autoSwitchParts:V,autoSwitchKeys:A,allowCaretMode:F,inputAttributes:_}=this.props,b=v&&v.uTimePicker,w=!this.validityStyles||this.validity.valid,L={disabled:o,format:I,formatPlaceholder:k,id:u,ariaLabelledBy:E,ariaDescribedBy:N,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:O,onChange:this.handleInputValueChange,required:R,steps:z,tabIndex:this.show?-1:h,title:d,valid:this.validity.valid,validationMessage:x,validityStyles:q,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,enableMouseWheel:B,autoCorrectParts:K,autoSwitchParts:V,autoSwitchKeys:A,allowCaretMode:F,inputAttributes:_},j=this.localizationService.toLanguageString(l.toggleClock,l.messages[l.toggleClock]),W=this.localizationService.toLanguageString(l.toggleTimeSelector,l.messages[l.toggleTimeSelector]),S=a.createElement(n.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:U,onBlur:H})=>a.createElement(a.Fragment,null,a.createElement("span",{ref:G=>{this._element=G},className:n.classNames(n.uTimePicker.wrapper({c:b,size:s,rounded:e,fillMode:i,invalid:!w,required:this.required,disabled:o}),f),onKeyDown:this.handleKeyDown,style:{width:D},onFocus:this.mobileMode?this.handleClick:U,onBlur:H,onClick:this.mobileMode?this.handleClick:void 0},a.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this.show?this._popupId:void 0,...L}),a.createElement(ee.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:$.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:W,className:n.classNames(n.uTimePicker.inputButton({c:b})),fillMode:i,"aria-label":j}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&a.createElement(n.WatermarkOverlay,{message:this.licenseMessage})));return this.props.label?a.createElement(Y.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:u,editorValid:w,editorDisabled:this.props.disabled,children:S,style:{width:this.props.width}}):S}normalizeTime(s){return p.setTime(p.MIDNIGHT_DATE,s)}setShow(s){const{onOpen:e,onClose:i}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&i&&i.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?p.setTime(this.value,s):s}calculateMedia(s){for(const e of s)this.setState({windowWidth:e.target.clientWidth})}};r.displayName="TimePicker",r.propTypes={className:t.string,cancelButton:t.bool,nowButton:t.bool,defaultShow:t.bool,defaultValue:t.instanceOf(Date),disabled:t.bool,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"])})]),formatPlaceholder:t.oneOfType([t.oneOf(["wide","narrow","short","formatPattern"]),t.shape({year:t.string,month:t.string,day:t.string,hour:t.string,minute:t.string,second:t.string})]),id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,min:t.instanceOf(Date),max:t.instanceOf(Date),name:t.string,popupSettings:t.shape({animate:t.bool,appendTo:t.any,popupClass:t.string}),show:t.bool,steps:t.shape({hour:t.number,minute:t.number,second:t.number}),smoothScroll:t.bool,tabIndex:t.number,title:t.string,value:t.instanceOf(Date),width:t.oneOfType([t.number,t.string]),validationMessage:t.string,required:t.bool,validate:t.bool,valid:t.bool,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object},r.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:p.MAX_TIME,min:p.MIN_TIME,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:J.DateInput,size:void 0,rounded:void 0,fillMode:void 0};let m=r;const C=n.createPropsContext(),M=n.withIdHOC(n.withPropsContext(C,n.withUnstyledHOC(n.withAdaptiveModeContext(m))));M.displayName="KendoReactTimePicker";P.registerForLocalization(m);exports.TimePicker=M;exports.TimePickerPropsContext=C;exports.TimePickerWithoutContext=m;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),t=require("prop-types"),Z=require("@progress/kendo-react-popup"),y=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),$=require("@progress/kendo-svg-icons"),P=require("@progress/kendo-react-intl"),T=require("../package-metadata.js"),l=require("../messages/index.js"),J=require("../dateinput/DateInput.js"),Q=require("./TimeSelector.js"),p=require("../utils.js"),g=require("./utils.js"),Y=require("../hooks/usePickerFloatingLabel.js"),ee=require("@progress/kendo-react-buttons"),te=require("../common/AdaptiveMode.js"),ie=require("@progress/kendo-react-layout");function se(c){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:()=>c[e]})}}return s.default=c,Object.freeze(s)}const a=se(X),r=class r extends a.Component{constructor(s){super(s),this._element=null,this._dateInput=a.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.showLicenseWatermark=!1,this.handleKendoPasteValue=e=>{if(e instanceof Date&&!isNaN(e.getTime())){this.applyKendoPasteTime(e);return}const i=e!=null?String(e):"";if(!i)return;const o=new Date(i);isNaN(o.getTime())||this.applyKendoPasteTime(o)},this.applyKendoPasteTime=e=>{const i=this.normalizeTime(e);if(!g.isInRange(i,this.min,this.max))return;const o=new Event("change",{bubbles:!0}),h={target:this._element,currentTarget:this._element,nativeEvent:o};this.handleValueChange({syntheticEvent:h,nativeEvent:o,value:i})},this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:i,nowButton:o,disabled:h,format:d,steps:u,unstyled:f}=this.props;return a.createElement(Q.TimeSelector,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:i,disabled:h,nowButton:o,format:d,min:this.min,max:this.max,steps:u,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:f})},this.renderPopup=()=>{const{popupClass:e,...i}=this.popupSettings,{unstyled:o}=this.props,h=o&&o.uTimePicker,d=n.classNames(e),u={popupClass:n.uTimePicker.popup({c:h}),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"},...i};return this.props.popup?a.createElement(this.props.popup,{...u},this.renderTimeSelector()):a.createElement(Z.Popup,{...u},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,i={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:e,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 a.createElement(te.AdaptiveMode,{...i},a.createElement(ie.ActionSheetContent,null,this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,i)=>e.value!==void 0?e.value:i.value,this.nextShow=(e,i)=>e.show!==void 0?e.show:i.show,this.handleInputValueChange=e=>{const i=this.mergeTime(e.value);this.handleValueChange({...e,value:i})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:y.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props,o=this.valueDuringOnChange!==void 0?this.value:this.state.candidate||this.value;i&&i.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:o,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setState({candidate:null}),this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=e=>{this.setShow(!1)},this.handleClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:i,keyCode:o}=e;if(o===n.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}i&&(o===n.Keys.up||o===n.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=o===n.Keys.up,this.setShow(o===n.Keys.down))},this.showLicenseWatermark=!n.validatePackage(T.packageMetadata,{component:"TimePicker"}),this.licenseMessage=n.getLicenseMessage(T.packageMetadata),this.state={value:this.props.defaultValue||r.defaultProps.defaultValue,show:this.props.defaultShow||r.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?y.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),i=this.normalizeTime(this.max),o=g.isInRange(s,e,i),h=this.props.validationMessage!==void 0,d=(!this.required||this.value!==null)&&o,u=this.props.valid!==void 0?this.props.valid:d;return{customError:h,rangeOverflow:g.isBiggerThanMax(s,i),rangeUnderflow:g.isSmallerThanMin(s,e),valid:u,valueMissing:this.value===null}}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)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:r.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get popupSettings(){return this.props.popupSettings||r.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:r.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:r.defaultProps.max}get dateInputComp(){return this.props.dateInput||r.defaultProps.dateInput}get localizationService(){return P.provideLocalizationService(this)}componentDidMount(){var e;this.observerResize=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(e=this.document)!=null&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body);const s=this.props.name||this.props.id;this.KendoPasteSubscription=n.subscribeToKendoPaste(this._element,{fieldName:s,onValueChange:i=>{this.handleKendoPasteValue(i)}})}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow&&this._timeSelector.focusActiveList(),this.mobileMode&&this.show&&!this.prevShow&&setTimeout(()=>{this._timeSelector&&this._timeSelector.focusActiveList()},300),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s,e;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect(),(e=this.KendoPasteSubscription)==null||e.unsubscribe()}render(){const{size:s=r.defaultProps.size,rounded:e=r.defaultProps.rounded,fillMode:i=r.defaultProps.fillMode,disabled:o,tabIndex:h,title:d,id:u,className:f,format:I,formatPlaceholder:D,width:O,name:k,steps:z,validationMessage:x,required:R,validityStyles:q,ariaLabelledBy:E,ariaDescribedBy:N,unstyled:v,enableMouseWheel:B,autoCorrectParts:K,autoSwitchParts:V,autoSwitchKeys:A,allowCaretMode:F,inputAttributes:_}=this.props,b=v&&v.uTimePicker,w=!this.validityStyles||this.validity.valid,L={disabled:o,format:I,formatPlaceholder:D,id:u,ariaLabelledBy:E,ariaDescribedBy:N,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:k,onChange:this.handleInputValueChange,required:R,steps:z,tabIndex:this.show?-1:h,title:d,valid:this.validity.valid,validationMessage:x,validityStyles:q,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,enableMouseWheel:B,autoCorrectParts:K,autoSwitchParts:V,autoSwitchKeys:A,allowCaretMode:F,inputAttributes:_},j=this.localizationService.toLanguageString(l.toggleClock,l.messages[l.toggleClock]),W=this.localizationService.toLanguageString(l.toggleTimeSelector,l.messages[l.toggleTimeSelector]),S=a.createElement(n.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:U,onBlur:H})=>a.createElement(a.Fragment,null,a.createElement("span",{ref:G=>{this._element=G},className:n.classNames(n.uTimePicker.wrapper({c:b,size:s,rounded:e,fillMode:i,invalid:!w,required:this.required,disabled:o}),f),onKeyDown:this.handleKeyDown,style:{width:O},onFocus:this.mobileMode?this.handleClick:U,onBlur:H,onClick:this.mobileMode?this.handleClick:void 0},a.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this.show?this._popupId:void 0,...L}),a.createElement(ee.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:$.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:W,className:n.classNames(n.uTimePicker.inputButton({c:b})),fillMode:i,"aria-label":j}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&a.createElement(n.WatermarkOverlay,{message:this.licenseMessage})));return this.props.label?a.createElement(Y.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:u,editorValid:w,editorDisabled:this.props.disabled,children:S,style:{width:this.props.width}}):S}normalizeTime(s){return p.setTime(p.MIDNIGHT_DATE,s)}setShow(s){const{onOpen:e,onClose:i}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&i&&i.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?p.setTime(this.value,s):s}calculateMedia(s){for(const e of s)this.setState({windowWidth:e.target.clientWidth})}};r.displayName="TimePicker",r.propTypes={className:t.string,cancelButton:t.bool,nowButton:t.bool,defaultShow:t.bool,defaultValue:t.instanceOf(Date),disabled:t.bool,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"])})]),formatPlaceholder:t.oneOfType([t.oneOf(["wide","narrow","short","formatPattern"]),t.shape({year:t.string,month:t.string,day:t.string,hour:t.string,minute:t.string,second:t.string})]),id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,min:t.instanceOf(Date),max:t.instanceOf(Date),name:t.string,popupSettings:t.shape({animate:t.bool,appendTo:t.any,popupClass:t.string}),show:t.bool,steps:t.shape({hour:t.number,minute:t.number,second:t.number}),smoothScroll:t.bool,tabIndex:t.number,title:t.string,value:t.instanceOf(Date),width:t.oneOfType([t.number,t.string]),validationMessage:t.string,required:t.bool,validate:t.bool,valid:t.bool,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object},r.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:p.MAX_TIME,min:p.MIN_TIME,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:J.DateInput,size:void 0,rounded:void 0,fillMode:void 0};let m=r;const C=n.createPropsContext(),M=n.withIdHOC(n.withPropsContext(C,n.withUnstyledHOC(n.withAdaptiveModeContext(m))));M.displayName="KendoReactTimePicker";P.registerForLocalization(m);exports.TimePicker=M;exports.TimePickerPropsContext=C;exports.TimePickerWithoutContext=m;
@@ -119,14 +119,14 @@ const a = class a extends n.Component {
119
119
  this.setState({
120
120
  value: y(t.value || this.state.candidate)
121
121
  }), this.valueDuringOnChange = t.value, this.showDuringOnChange = !1, this.mobileMode || (this.shouldFocusDateInput = !0);
122
- const { onChange: i } = this.props, o = this.state.candidate || this.value;
122
+ const { onChange: i } = this.props, o = this.valueDuringOnChange !== void 0 ? this.value : this.state.candidate || this.value;
123
123
  i && i.call(void 0, {
124
124
  syntheticEvent: t.syntheticEvent,
125
125
  nativeEvent: t.nativeEvent,
126
126
  value: o,
127
127
  show: this.show,
128
128
  target: this
129
- }), this.valueDuringOnChange = void 0, this.showDuringOnChange = void 0, this.setShow(!1);
129
+ }), this.valueDuringOnChange = void 0, this.showDuringOnChange = void 0, this.setState({ candidate: null }), this.setShow(!1);
130
130
  }, this.handleFocus = () => {
131
131
  this.setState({ focused: !0 });
132
132
  }, this.handleBlur = () => {
@@ -5,7 +5,6 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { default as PropTypes } from 'prop-types';
9
8
  import { DateInputsClassStructure } from '@progress/kendo-react-common';
10
9
  import { ScrollAction, PageAction } from './services/index.js';
11
10
  import * as React from 'react';
@@ -57,69 +56,32 @@ export interface VirtualizationProps {
57
56
  /**
58
57
  * @hidden
59
58
  */
60
- export declare class Virtualization extends React.Component<VirtualizationProps, {}> {
61
- static propTypes: {
62
- bottomOffset: PropTypes.Validator<number>;
63
- className: PropTypes.Requireable<string>;
64
- direction: PropTypes.Requireable<string>;
65
- forceScroll: PropTypes.Requireable<boolean>;
66
- itemHeight: PropTypes.Requireable<number>;
67
- itemWidth: PropTypes.Requireable<number>;
68
- maxScrollDifference: PropTypes.Requireable<number>;
69
- onScroll: PropTypes.Requireable<(...args: any[]) => any>;
70
- onScrollAction: PropTypes.Requireable<(...args: any[]) => any>;
71
- scrollDuration: PropTypes.Requireable<number>;
72
- scrollOffsetSize: PropTypes.Requireable<number>;
73
- skip: PropTypes.Validator<number>;
74
- tabIndex: PropTypes.Requireable<number>;
75
- take: PropTypes.Validator<number>;
76
- topOffset: PropTypes.Validator<number>;
77
- total: PropTypes.Validator<number>;
78
- role: PropTypes.Requireable<string>;
79
- };
80
- static defaultProps: {
81
- direction: Direction;
82
- forceScroll: boolean;
83
- scrollOffsetSize: number;
84
- maxScrollDifference: number;
85
- scrollDuration: number;
86
- };
87
- private cancelAnimation;
88
- private rowHeightService;
89
- private scrollerService;
90
- private scrollContainer;
91
- private scrollAction?;
92
- private pageAction?;
93
- private lastDirection;
94
- private lastTotal;
95
- private lastTake;
96
- private animationInProgress;
97
- private restrictScroll;
98
- get element(): HTMLDivElement | null;
99
- protected get containerOffsetSize(): number;
100
- get containerScrollSize(): number;
101
- get containerScrollPosition(): number;
102
- protected get direction(): Direction;
103
- protected get scrollOffsetSize(): number;
104
- constructor(props: VirtualizationProps);
59
+ export interface VirtualizationHandle {
60
+ element: HTMLDivElement | null;
61
+ containerScrollSize: number;
62
+ containerScrollPosition: number;
105
63
  activeIndex(): number;
106
- itemIndex(offset: number): number;
107
- itemOffset(index: number): number;
64
+ scrollTo(value: number): void;
65
+ scrollToIndex(index: number): void;
66
+ animateToIndex(index: number): void;
67
+ scrollToBottom(): void;
108
68
  isIndexVisible(index: number): boolean;
109
69
  isListScrolled(index: number): boolean;
110
- scrollTo: (value: number) => void;
111
- scrollToIndex: (index: number) => void;
112
- animateToIndex: (index: number) => void;
113
- scrollToBottom: () => void;
114
- componentDidMount(): void;
115
- render(): React.JSX.Element;
116
- protected scrollStep: (start: number, end: number) => number;
117
- protected scrollRange: (indexOffset: number, direction: ScrollDirection) => any;
118
- protected containerMaxScroll: () => number;
119
- protected getContainerScrollDirection: (indexOffset: number) => ScrollDirection;
120
- protected initServices: (props?: VirtualizationProps) => void;
121
- protected getContainerProperty: (propertyName: 'offsetHeight' | 'offsetWidth' | 'scrollHeight' | 'scrollWidth' | 'scrollTop' | 'scrollLeft') => number;
122
- private handleScroll;
123
- private handleScrollAction;
124
- private handlePageAction;
70
+ itemIndex(offset: number): number;
71
+ itemOffset(index: number): number;
125
72
  }
73
+ /**
74
+ * The default props of the Virtualization component.
75
+ *
76
+ * @hidden
77
+ */
78
+ export declare const virtualizationDefaultProps: {
79
+ direction: Direction;
80
+ scrollOffsetSize: number;
81
+ maxScrollDifference: number;
82
+ scrollDuration: number;
83
+ };
84
+ /**
85
+ * @hidden
86
+ */
87
+ export declare const Virtualization: React.ForwardRefExoticComponent<VirtualizationProps & React.RefAttributes<VirtualizationHandle | null>>;
@@ -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 w=require("react"),s=require("prop-types"),f=require("@progress/kendo-react-common"),H=require("./services/ScrollerService.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const g=P(w),T=(r,e,t)=>Math.min(Math.abs(e-r),t),C=17,O=10,A={1:r=>e=>e+r,0:r=>e=>e-r},x={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},I={1:r=>e=>e<r,0:r=>e=>e>r},a=class a extends g.Component{constructor(e){super(e),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const i=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const o=this.scrollContainer[i];this.restrictScroll&&i==="scrollTop"&&(!Number.isInteger(o)||!Number.isInteger(t))&&Math.abs(o-t)<O||(this.scrollContainer[i]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const i=this.rowHeightService.offset(t),o=this.getContainerScrollDirection(i),{start:n,end:l}=this.scrollRange(i,o);if(n===l)return;const S=this.scrollStep(n,l),c=A[o](S),h=x[o](l),u=I[o](c(l)),m=p=>{this.animationInProgress=!0;const d=c(p);this.scrollTo(h(d)),u(d)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(d)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(n)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const o=this.props.scrollDuration||a.defaultProps.scrollDuration;return Math.abs(i-t)/(o/C)},this.scrollRange=(t,i)=>{const o=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${o}`,10))return{start:t,end:t};const n=this.containerMaxScroll(),l=i===0?1:-1,S=T(o,t,this.props.maxScrollDifference||0),c=Math.min(t,n);return{start:Math.min(Math.max(c+l*S,0),n),end:c}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const i=this.direction==="vertical"?t.itemHeight:t.itemWidth;i!==void 0&&(this.rowHeightService=new f.RowHeightService(t.total,i),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const i=t.target;this.scrollerService.onScroll({scrollLeft:i.scrollLeft,scrollTop:i.scrollTop,offsetHeight:i.offsetHeight,offsetWidth:i.offsetWidth});const o=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:n}=this.props,l={index:o,target:i,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),n&&n.call(void 0,l),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new H.ScrollerService(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(g.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:a.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:a.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,o=this.rowHeightService.offset(e),n=o+this.rowHeightService.height(e);return o>=t&&n<=i}isListScrolled(e){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(e):!1}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){const{total:e,take:t,bottomOffset:i,className:o,tabIndex:n,role:l,children:S,unstyled:c}=this.props,h=c&&c.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const u=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,m=this.direction==="vertical"?{height:`${u}px`}:{width:`${u}px`},p=f.classNames(f.uCalendar.scrollableSelector({c:h}),f.uCalendar.scrollable({c:h,horizontal:this.direction==="horizontal"}),o),d=f.classNames(f.uCalendar.scrollablePlaceholder({c:h,horizontal:this.direction==="horizontal"}));return g.createElement("div",{ref:b=>{this.scrollContainer=b},onScroll:this.handleScroll,className:p,tabIndex:n,role:l},S,g.createElement("div",{style:m,className:d}))}};a.propTypes={bottomOffset:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},a.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let v=a;exports.Virtualization=v;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("react"),l=require("prop-types"),d=require("@progress/kendo-react-common"),xe=require("./services/ScrollerService.js");function Ne(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const g=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,g.get?g:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const c=Ne(ze),De=(t,n,s)=>Math.min(Math.abs(n-t),s),Ie=17,Me=10,Ce={1:t=>n=>n+t,0:t=>n=>n-t},Oe={1:t=>n=>Math.min(n,t),0:t=>n=>Math.max(n,t)},Pe={1:t=>n=>n<t,0:t=>n=>n>t},S={direction:"vertical",scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100},P=c.forwardRef((t,n)=>{const{direction:s=S.direction,scrollOffsetSize:g=S.scrollOffsetSize,maxScrollDifference:K=S.maxScrollDifference,scrollDuration:U=S.scrollDuration,bottomOffset:A,className:G,tabIndex:J,role:Q,children:X,unstyled:T,total:b,take:z,skip:Y,topOffset:y,itemHeight:Z,itemWidth:ee,onMount:H,onScroll:q,onScrollAction:L}=t,x=e=>u.current?u.current[e]:0,k=()=>x(s==="vertical"?"offsetHeight":"offsetWidth"),w=()=>x(s==="vertical"?"scrollHeight":"scrollWidth"),m=()=>x(s==="vertical"?"scrollTop":"scrollLeft"),te=()=>w()-k(),re=e=>e<m()?0:1,ne=(e,o)=>{const i=U||S.scrollDuration;return Math.abs(o-e)/(i/Ie)},oe=(e,o)=>{const i=m();if(Number.parseInt(`${e}`,10)===Number.parseInt(`${i}`,10))return{start:e,end:e};const a=te(),f=o===0?1:-1,C=De(i,e,K||0),h=Math.min(e,a);return{start:Math.min(Math.max(h+f*C,0),a),end:h}},V=e=>r.current?r.current.index(e):0,ce=e=>r.current?r.current.offset(e):0,se=()=>V(Math.ceil(m())),le=e=>{if(!r.current)return!1;const o=m(),i=o+k(),a=r.current.offset(e),f=a+r.current.height(e);return a>=o&&f<=i},ie=e=>r.current?m()!==r.current.offset(e):!1,p=e=>{const o=s==="vertical"?"scrollTop":"scrollLeft";if(!u.current)return;const i=u.current[o];ge.current&&o==="scrollTop"&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<Me||(u.current[o]=e)},ae=e=>{v.current=!1,r.current&&p(r.current.offset(e))},ue=e=>{if(!r.current||!globalThis)return;globalThis.cancelAnimationFrame(N.current);const o=r.current.offset(e),i=re(o),{start:a,end:f}=oe(o,i);if(a===f)return;const C=ne(a,f),h=Ce[i](C),$=Oe[i](f),ve=Pe[i](h(f)),B=Te=>{v.current=!0;const O=h(Te);p($(O)),ve(O)?N.current=globalThis.requestAnimationFrame(()=>{B(O)}):v.current=!1};N.current=globalThis.requestAnimationFrame(()=>{B(a)})},fe=()=>{r.current&&p(r.current.totalHeight()+A)},me=e=>{D.current=e},de=e=>{I.current=e},Se=e=>{if(!u.current||!r.current)return;const o=e.target;W.current.onScroll({scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,offsetHeight:o.offsetHeight,offsetWidth:o.offsetWidth});const a={index:r.current.index(m()-y),target:o,scrollAction:D.current,pageAction:I.current,animationInProgress:v.current};q&&q(e),L&&L(a),D.current=void 0,I.current=void 0},he=()=>{const e=s==="vertical"?Z:ee;e!==void 0&&(r.current=new d.RowHeightService(b,e),W.current.create(r.current,Y,z,b,y,g,s))},R=c.useRef(null),u=c.useRef(null),W=c.useRef(new xe.ScrollerService(me,de)),r=c.useRef(null),N=c.useRef(0),v=c.useRef(!1),ge=c.useRef(Number.parseFloat(c.version)>17),D=c.useRef(void 0),I=c.useRef(void 0),_=c.useRef(0),j=c.useRef(0),E=c.useRef(null);c.useImperativeHandle(R,()=>({element:u.current,containerScrollSize:w(),containerScrollPosition:m(),activeIndex:se,scrollTo:p,scrollToIndex:ae,animateToIndex:ue,scrollToBottom:fe,isIndexVisible:le,isListScrolled:ie,itemIndex:V,itemOffset:ce})),c.useImperativeHandle(n,()=>R.current),c.useEffect(()=>{H&&R.current&&H(R.current)},[]);const M=T==null?void 0:T.uCalendar;(_.current!==b||E.current!==s||j.current!==z)&&(he(),_.current=b,E.current=s,j.current=z);const F=`${(r.current?r.current.totalHeight():0)+A}`,be=s==="vertical"?{height:`${F}px`}:{width:`${F}px`},pe=d.classNames(d.uCalendar.scrollableSelector({c:M}),d.uCalendar.scrollable({c:M,horizontal:s==="horizontal"}),G),Re=d.classNames(d.uCalendar.scrollablePlaceholder({c:M,horizontal:s==="horizontal"}));return c.createElement("div",{ref:u,onScroll:Se,className:pe,tabIndex:J,role:Q},X,c.createElement("div",{style:be,className:Re}))});P.propTypes={bottomOffset:l.number.isRequired,className:l.string,direction:l.oneOf(["horizontal","vertical"]),itemHeight:l.number,itemWidth:l.number,maxScrollDifference:l.number,onScroll:l.func,onScrollAction:l.func,scrollDuration:l.number,scrollOffsetSize:l.number,skip:l.number.isRequired,tabIndex:l.number,take:l.number.isRequired,topOffset:l.number.isRequired,total:l.number.isRequired,role:l.string};P.displayName="KendoReactVirtualization";const Ae=P;exports.Virtualization=Ae;exports.virtualizationDefaultProps=S;