@progress/kendo-react-dateinputs 7.0.3-develop.10 → 7.0.3-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.
|
@@ -6,7 +6,7 @@ import { DateInputFormatPlaceholder } from '../../dateinput/models/format-placeh
|
|
|
6
6
|
import { DateInputsPopupSettings } from '../../PopupSettings';
|
|
7
7
|
import { CalendarProps } from '../../calendar/components/Calendar';
|
|
8
8
|
import { PopupProps } from '@progress/kendo-react-popup';
|
|
9
|
-
import { DateInputProps } from '../..';
|
|
9
|
+
import { DateInputProps, MultiViewCalendarProps } from '../..';
|
|
10
10
|
import { DateFormatOptions } from '@progress/kendo-react-intl';
|
|
11
11
|
import { ToggleButtonProps } from '../ToggleButton';
|
|
12
12
|
import { PickerWrapProps } from '../../common/PickerWrap';
|
|
@@ -27,7 +27,7 @@ export interface DatePickerSettings {
|
|
|
27
27
|
* Enables the customization or the override of the default Calendar which is rendered by the DatePicker
|
|
28
28
|
* ([see example]({% slug custom_rendering_datepicker %}#toc-customizing-the-calendar)).
|
|
29
29
|
*/
|
|
30
|
-
calendar?: React.ComponentType<CalendarProps<any>>;
|
|
30
|
+
calendar?: React.ComponentType<CalendarProps<any>> | React.ComponentType<MultiViewCalendarProps<any>>;
|
|
31
31
|
/**
|
|
32
32
|
* Enables the customization or the override of the default Popup which is rendered by the DatePicker
|
|
33
33
|
* ([see example]({% slug custom_rendering_datepicker %}#toc-customizing-the-popup)).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
(function(p,Ft){typeof exports=="object"&&typeof module<"u"?Ft(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-react-popup","@progress/kendo-react-layout"],Ft):(p=typeof globalThis<"u"?globalThis:p||self,Ft(p.KendoReactDateinputs={},p.React,p.PropTypes,p.KendoReactCommon,p.KendoDateMath,p.KendoReactIntl,p.KendoReactButtons,p.KendoSvgIcons,p.KendoReactLabels,p.KendoReactPopup,p.KendoReactLayout))})(this,function(p,Ft,n,d,l,x,L,J,Ye,Wt,ht){"use strict";"use client";function Ti(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const o=Ti(Ft),ft={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",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"},ji=(i,t,e)=>[...i.slice(0,t+1),...i.slice(t+1).map(s=>s+e)];class Zi{constructor(t=0,e,s){this.total=t,this.rowHeight=e,this.detailRowHeight=s,this.offsets=[],this.heights=[];let a=0;for(let r=0;r<t;r++)this.offsets.push(a),a+=e,this.heights.push(e)}height(t){return this.heights[t]}expandDetail(t){this.height(t)===this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight)}collapseDetail(t){this.height(t)>this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight*-1)}index(t){for(let e=0;e<this.offsets.length;e++){if(t===this.offsets[e])return e;if(t<this.offsets[e])return e-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){return this.heights.reduce((t,e)=>t+e,0)}updateRowHeight(t,e){this.heights[t]+=e,this.offsets=ji(this.offsets,t,e)}}const Kt=i=>Math.max(i,0);class re{constructor(t){this.offset=t}}class le{constructor(t){this.skip=t}}class Gi{constructor(t,e){this.onScrollAction=t,this.onPageAction=e,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(t,e,s,a,r=0,h=0,u="vertical"){this.rowHeightService=t,this.firstLoaded=e,this.lastLoaded=e+s,this.take=s,this.total=a,this.lastScrollTop=0,this.topOffset=r,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(r),m=Kt(e-c);this.onScrollAction(new re(this.rowOffset(m))),this.onPageAction(new le(m))}onScroll({scrollLeft:t,scrollTop:e,offsetHeight:s,offsetWidth:a}){const r=this.direction==="vertical"?e:t,h=this.direction==="vertical"?s:a;if(this.lastScrollTop===r||!this.rowHeightService)return;const u=this.lastScrollTop>=r;this.lastScrollTop=r;const c=this.rowHeightService.index(Kt(r-this.topOffset)),m=this.rowHeightService.index(Kt(r+h-this.bottomOffset));if(!u&&m>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new re(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new le(this.firstLoaded))),u&&c<=this.firstLoaded){const f=Math.floor(this.take*.3);this.firstLoaded=Kt(c-f),this.onScrollAction(new re(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new le(this.firstLoaded))}}rowOffset(t){return this.rowHeightService?this.rowHeightService.offset(t)+this.topOffset:0}rowsForHeight(t){return this.rowHeightService?Math.ceil(t/this.rowHeightService.height(0)):0}}const Xi=(i,t,e)=>Math.min(Math.abs(t-i),e),Ji=17,Qi=10,Pi={[1]:i=>t=>t+i,[0]:i=>t=>t-i},ts={[1]:i=>t=>Math.min(t,i),[0]:i=>t=>Math.max(t,i)},es={[1]:i=>t=>t<i,[0]:i=>t=>t>i},Ut=class extends o.Component{constructor(i){super(i),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 e=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const s=this.scrollContainer[e];this.restrictScroll&&e==="scrollTop"&&(!Number.isInteger(s)||!Number.isInteger(t))&&Math.abs(s-t)<Qi||(this.scrollContainer[e]=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 e=this.rowHeightService.offset(t),s=this.getContainerScrollDirection(e);let{start:a,end:r}=this.scrollRange(e,s);if(a===r)return;const h=this.scrollStep(a,r),u=Pi[s](h),c=ts[s](r),m=es[s](u(r)),f=g=>{this.animationInProgress=!0;const w=u(g);this.scrollTo(c(w)),m(w)?this.cancelAnimation=window.requestAnimationFrame(()=>{f(w)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{f(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,e)=>{const s=this.props.scrollDuration||Ut.defaultProps.scrollDuration;return Math.abs(e-t)/(s/Ji)},this.scrollRange=(t,e)=>{const s=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${s}`,10))return{start:t,end:t};const a=this.containerMaxScroll(),r=e===0?1:-1,h=Xi(s,t,this.props.maxScrollDifference||0),u=Math.min(t,a);return{start:Math.min(Math.max(u+r*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const e=this.direction==="vertical"?t.itemHeight:t.itemWidth;e!==void 0&&(this.rowHeightService=new Zi(t.total,e,0),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 e=t.target;this.scrollerService.onScroll({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,offsetHeight:e.offsetHeight,offsetWidth:e.offsetWidth});const s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,r={index:s,target:e,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),a&&a.call(void 0,r),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new Gi(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(o.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:Ut.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Ut.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(i){return this.rowHeightService?this.rowHeightService.index(i):0}itemOffset(i){return this.rowHeightService?this.rowHeightService.offset(i):0}isIndexVisible(i){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,e=t+this.containerOffsetSize,s=this.rowHeightService.offset(i),a=s+this.rowHeightService.height(i);return s>=t&&a<=e}isListScrolled(i){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(i):!1}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const i=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${i}px`}:{width:`${i}px`},e=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),s=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return o.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:e,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,o.createElement("div",{style:t,className:s}))}};let gt=Ut;gt.propTypes={bottomOffset:n.number.isRequired,className:n.string,direction:n.oneOf(["horizontal","vertical"]),forceScroll:n.bool,itemHeight:n.number,itemWidth:n.number,maxScrollDifference:n.number,onScroll:n.func,onScrollAction:n.func,scrollDuration:n.number,scrollOffsetSize:n.number,skip:n.number.isRequired,tabIndex:n.number,take:n.number.isRequired,topOffset:n.number.isRequired,total:n.number.isRequired,role:n.string},gt.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const is=(i,t)=>{const e=Object.getOwnPropertyNames(i),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let a=0;a<e.length;a++){const r=e[a];if(i[r]!==t[r])return!1}return!0};class $e extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:a,...r}=t;return!((!(e&&a)||e.getTime()===a.getTime())&&is(s,r))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:a,isInRange:r,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:m,isRangeSplitStart:f,isRangeSplitEnd:g,isToday:w,isDisabled:v,view:E,value:V,...N}=this.props,S=this.props.activeRangeEnd==="end"&&m,y=this.props.activeRangeEnd==="start"&&u,b=d.classNames("k-calendar-td",{"k-range-end":m,"k-range-mid":c,"k-range-split-end":g,"k-range-split-start":f,"k-range-start":u,"k-active":y||S,"k-state-pending-focus":a,"k-selected":h||u||m,"k-today":w,"k-weekend":s,"k-disabled":v},t);return o.createElement("td",{...N,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o.createElement("span",{className:"k-link"},this.props.children))}}class Te extends o.Component{render(){const{className:t,firstDate:e,...s}=this.props;return o.createElement("td",{className:d.classNames("k-calendar-td",t),...s},this.props.children)}}var D=(i=>(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i[i.PrevView=4]="PrevView",i[i.NextView=5]="NextView",i[i.FirstInView=6]="FirstInView",i[i.LastInView=7]="LastInView",i[i.LowerView=8]="LowerView",i[i.UpperView=9]="UpperView",i))(D||{}),C=(i=>(i[i.month=0]="month",i[i.year=1]="year",i[i.decade=2]="decade",i[i.century=3]="century",i))(C||{});const q={start:null,end:null};function et(i){const t=(s,a,r,...h)=>a[r]===null?null:(s?i.isRequired:i)(a,r,...h),e=t.bind(null,!1);return e.isRequired=t.bind(null,!0),e}const Yt=(i,t,e)=>t===void 0||e===void 0||t<=i&&i<=e?i:i<t?t:e,B=new Date(1980,0,1),it=new Date(1900,0,1),st=new Date(2099,11,31),ct=new Date(1980,0,1),nt=new Date(1980,0,1,23,59,59),R=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e},z=()=>l.getDate(new Date),A=(i,t,e)=>!i||!(t&&t>i||e&&e<i),je=(i,t,e)=>i===null||!(t&&l.getDate(t)>l.getDate(i)||e&&l.getDate(e)<l.getDate(i)),$t=(i,t)=>{const{start:e,end:s}=t||q;return!e||!s?!1:e<i&&i<s},T=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Ze=(i,t,e)=>t.getTime()<=i.getTime()&&i.getTime()<=e.getTime(),Ge=(i,t)=>i.slice(t).concat(i.slice(0,t)),Y=(i,t,e)=>i&&(t&&i<t?l.cloneDate(t):e&&i>e?l.cloneDate(e):i),$=i=>(t,e="",s={})=>{const a=document.createElement(i);return a.className=e,Object.keys(s).map(r=>a.style[r]=s[r]),typeof t=="string"?a.innerHTML=t||"":(t||[]).forEach(r=>r&&a.appendChild(r)),a};function ss(i,t,e={}){let s,a;e.maxWait;let r,h,u;const c=window;let m=!1,f=!1;const g=!t&&t!==0&&typeof c.requestAnimationFrame=="function";if(typeof i!="function")throw new TypeError("Expected a function");t=+t||0;function w(O){const _=s,tt=a;return s=a=void 0,r=i.apply(tt,_),r}function v(O,_){return g?(c.cancelAnimationFrame(h),c.requestAnimationFrame(O)):setTimeout(O,_)}function E(O){if(g)return c.cancelAnimationFrame(O);clearTimeout(O)}function V(O){return h=v(y,t),m?w():r}function N(O){const _=O-u;return t-_}function S(O){const _=O-u;return u===void 0||_>=t||_<0||f}function y(){const O=Date.now();if(S(O))return b();h=v(y,N(O))}function b(O){return h=void 0,s?w():(s=a=void 0,r)}function K(){h!==void 0&&E(h),s=u=a=h=void 0}function M(){return h===void 0?r:b()}function F(){return h!==void 0}function U(...O){const _=Date.now(),tt=S(_);return s=O,a=this,u=_,tt&&h===void 0?V():(h===void 0&&(h=v(y,t)),r)}return U.cancel=K,U.flush=M,U.pending=F,U}const ns=[[]],oe=4,as=3,rs={[D.Left]:i=>l.addDecades(i,-1),[D.Up]:i=>l.addDecades(i,-5),[D.Right]:i=>l.addDecades(i,1),[D.Down]:i=>l.addDecades(i,5),[D.PrevView]:i=>l.addCenturies(i,-1),[D.NextView]:i=>l.addCenturies(i,1),[D.FirstInView]:i=>l.firstDecadeOfCentury(i),[D.LastInView]:i=>l.lastDecadeOfCentury(i)};class Xe{addToDate(t,e){return l.addCenturies(t,e)}datesList(t,e){return T(0,e).map(s=>l.addCenturies(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return ns;const f=T(0,oe),g=l.firstDecadeOfCentury(m),w=l.lastDecadeOfCentury(m),v=z();return T(0,as).map(E=>{const V=l.addDecades(g,E*oe);return f.map(N=>{const S=this.normalize(l.addDecades(V,N),h,r),y=this.isEqual(S,c.start),b=this.isEqual(S,c.end),M=!y&&!b&&$t(S,c),F=a&&(Array.isArray(u)?this.isSelectedFromArray(S,u,h,r):A(u,h,r)&&this.isEqual(S,u));return Ze(S,g,w)?{formattedValue:this.value(S),id:`${e}${S.getTime()}`,isFocused:this.isEqual(S,s),isSelected:F,isWeekend:!1,isInRange:A(S,h,r),isRangeStart:y,isRangeMid:M,isRangeEnd:b,isRangeSplitEnd:M&&this.isEqual(S,w),isRangeSplitStart:M&&this.isEqual(S,g),isToday:this.isEqual(S,v),title:this.cellTitle(S),value:S}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:l.firstYearOfDecade(t).getFullYear()===l.firstYearOfDecade(e).getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+99}isInRange(t,e,s){const a=l.firstYearOfDecade(t).getFullYear(),r=!e||l.firstYearOfDecade(e).getFullYear()<=a,h=!s||a<=l.firstYearOfDecade(s).getFullYear();return r&&h}isInSameView(t,e){return l.durationInCenturies(t,e)===0}isRangeStart(t){return t.getFullYear()%1e3===0}move(t,e){const s=rs[e];return s?s(t):t}cellTitle(t){return l.firstYearOfDecade(t).getFullYear().toString()}navigationTitle(t){return t?l.firstDecadeOfCentury(t).getFullYear().toString():""}title(t){return t?`${l.firstDecadeOfCentury(t).getFullYear()} - ${l.lastDecadeOfCentury(t).getFullYear()}`:""}rowLength(t){return oe}skip(t,e){return l.durationInCenturies(e,t)}total(t,e){return l.durationInCenturies(t,e)+1}value(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInCenturies(t,e)<s?l.addCenturies(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const ls=[[]],he=4,os=3,hs={[D.Left]:i=>l.addYears(i,-1),[D.Up]:i=>l.addYears(i,-5),[D.Right]:i=>l.addYears(i,1),[D.Down]:i=>l.addYears(i,5),[D.PrevView]:i=>l.addDecades(i,-1),[D.NextView]:i=>l.addDecades(i,1),[D.FirstInView]:i=>l.firstYearOfDecade(i),[D.LastInView]:i=>l.lastYearOfDecade(i)};class Je{addToDate(t,e){return l.addDecades(t,e)}datesList(t,e){return T(0,e).map(s=>l.addDecades(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return ls;const f=T(0,he),g=l.firstYearOfDecade(m),w=l.lastYearOfDecade(m),v=z();return T(0,os).map(E=>{const V=l.addYears(g,E*he);return f.map(N=>{const S=this.normalize(l.addYears(V,N),h,r),y=this.isEqual(S,c.start),b=this.isEqual(S,c.end),M=!y&&!b&&$t(S,c),F=a&&(Array.isArray(u)?this.isSelectedFromArray(S,u,h,r):A(u,h,r)&&this.isEqual(S,u));return Ze(S,g,w)?{formattedValue:this.value(S),id:`${e}${S.getTime()}`,isFocused:this.isEqual(S,s),isSelected:F,isWeekend:!1,isInRange:A(S,h,r),isRangeStart:y,isRangeMid:M,isRangeEnd:b,isRangeSplitEnd:M&&this.isEqual(S,w),isRangeSplitStart:M&&this.isEqual(S,g),isToday:this.isEqual(S,v),title:this.cellTitle(S),value:S}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+9}isInRange(t,e,s){const a=t.getFullYear(),r=!e||e.getFullYear()<=a,h=!s||a<=s.getFullYear();return r&&h}isRangeStart(t){return t.getFullYear()%100===0}isInSameView(t,e){return l.durationInDecades(t,e)===0}move(t,e){const s=hs[e];return s?s(t):t}cellTitle(t){return t.getFullYear().toString()}navigationTitle(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}title(t){return t?`${l.firstYearOfDecade(t).getFullYear()} - ${l.lastYearOfDecade(t).getFullYear()}`:""}rowLength(t){return he}skip(t,e){return l.durationInDecades(e,t)}total(t,e){return l.durationInDecades(t,e)+1}value(t){return t?t.getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInDecades(t,e)<s?l.addDecades(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const cs=[[]],ce=7,us=6,ds=6,ms=0,ps={[D.Left]:i=>l.addDays(i,-1),[D.Up]:i=>l.addWeeks(i,-1),[D.Right]:i=>l.addDays(i,1),[D.Down]:i=>l.addWeeks(i,1),[D.PrevView]:i=>l.addMonths(i,-1),[D.NextView]:i=>l.addMonths(i,1),[D.FirstInView]:i=>l.firstDayOfMonth(i),[D.LastInView]:i=>l.lastDayOfMonth(i)};class Qe{constructor(t){this.intl=t}addToDate(t,e){return l.addMonths(t,e)}datesList(t,e){return T(0,e).map(s=>l.addMonths(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return cs;const f=l.firstDayOfMonth(m),g=l.lastDayOfMonth(m),w=-1,v=l.dayOfWeek(f,this.intl.firstDay(),w),E=T(0,ce),V=z();return T(0,us).map(N=>{const S=l.addDays(v,N*ce);return E.map(y=>{const b=this.normalize(l.addDays(S,y),h,r);if(b<f||b>g)return null;const M=this.isEqual(b,c.start),F=this.isEqual(b,c.end),O=!M&&!F&&$t(b,c),_=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):A(u,h,r)&&this.isEqual(b,u));return{formattedValue:this.value(b),id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:_,isInRange:A(b,h,r),isWeekend:this.isWeekend(b),isRangeStart:M,isRangeMid:O,isRangeEnd:F,isRangeSplitStart:O&&this.isEqual(b,f),isRangeSplitEnd:O&&this.isEqual(b,g),isToday:this.isEqual(b,V),title:this.cellTitle(b),value:b}})})}isEqual(t,e){return!t||!e?!1:l.getDate(t).getTime()===l.getDate(e).getTime()}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isInArray(t,e){return!!e.length&&l.firstDayOfMonth(e[0])<=t&&t<=l.lastDayOfMonth(e[e.length-1])}isInRange(t,e,s){const a=l.getDate(t),r=!e||l.getDate(e)<=a,h=!s||a<=l.getDate(s);return r&&h}isInSameView(t,e){return l.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const s=ps[e];return s?s(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return ce+(t?1:0)}skip(t,e){return l.durationInMonths(e,t)}total(t,e){return l.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,s=1){return l.durationInMonths(t,e)<s?l.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===ds||e===ms}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.getDate(e):t>s&&this.isEqual(t,s)?l.getDate(s):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fs=[[]],ue=4,gs=3,vs=i=>i>4?-5:i<2?-2:-7,ws=i=>i<7?5:i<10?7:2,bs={[D.Left]:i=>l.addMonths(i,-1),[D.Up]:i=>l.addMonths(i,vs(i.getMonth())),[D.Right]:i=>l.addMonths(i,1),[D.Down]:i=>l.addMonths(i,ws(i.getMonth())),[D.PrevView]:i=>l.addYears(i,-1),[D.NextView]:i=>l.addYears(i,1),[D.FirstInView]:i=>l.firstMonthOfYear(i),[D.LastInView]:i=>l.lastMonthOfYear(i)};class Pe{constructor(t){this._intl=t}addToDate(t,e){return l.addYears(t,e)}datesList(t,e){return T(0,e).map(s=>l.addYears(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return fs;const f=this.abbrMonthNames(),g=l.firstMonthOfYear(m),w=l.lastMonthOfYear(m),v=g.getFullYear(),E=T(0,ue),V=z();return T(0,gs).map(N=>{const S=l.addMonths(g,N*ue);return E.map(y=>{const b=this.normalize(l.addMonths(S,y),h,r);if(v<b.getFullYear())return null;const M=this.isEqual(b,c.start),F=this.isEqual(b,c.end),O=!M&&!F&&$t(b,c),_=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):A(u,h,r)&&this.isEqual(b,u));return{formattedValue:f[b.getMonth()],id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:_,isInRange:A(b,h,r),isWeekend:!1,isRangeStart:M,isRangeMid:O,isRangeEnd:F,isRangeSplitEnd:O&&this.isEqual(b,w),isRangeSplitStart:O&&this.isEqual(b,g),isToday:this.isEqual(b,V),title:this.cellTitle(b),value:b}})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()}isInRange(t,e,s){const a=l.createDate(t.getFullYear(),t.getMonth(),1),r=!e||l.createDate(e.getFullYear(),e.getMonth(),1)<=a,h=!s||a<=l.createDate(s.getFullYear(),s.getMonth(),1);return r&&h}isInSameView(t,e){return l.durationInYears(t,e)===0}isRangeStart(t){return t.getFullYear()%10===0}move(t,e){const s=bs[e];return s?s(t):t}cellTitle(t){return`${t.getFullYear()} ${this.value(t)}`}navigationTitle(t){return this.title(t)}title(t){return t?t.getFullYear().toString():""}rowLength(t){return ue}skip(t,e){return l.durationInYears(e,t)}total(t,e){return l.durationInYears(t,e)+1}value(t){return t?this.abbrMonthNames()[t.getMonth()]:""}viewDate(t,e,s=1){return l.durationInYears(t,e)<s?l.addYears(t,-1):t}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const Ss={[C.month]:Qe,[C.year]:Pe,[C.decade]:Je,[C.century]:Xe},Ds=(i,t)=>{const e=C[C[i+t]];return e!==void 0?e:i};class de{constructor(t){this.bottom=C.month,this.top=C.century,this.onViewChanged=t}configure(t,e){this.bottom=t,this.top=e}service(t,e){return new Ss[`${t}`](e)}moveDown(t,e){this.move(t,-1,e)}moveUp(t,e){this.move(t,1,e)}moveToBottom(t){t!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(t){return this.bottom<t}canMoveUp(t){return t<this.top}clamp(t){return t<this.bottom?this.bottom:t>this.top?this.top:t}move(t,e,s){const a=this.clamp(Ds(t,e));a!==t&&this.onViewChanged({view:a},s)}}let ti=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=$("div"),s=$("ul"),a=$("li"),r=$("td"),h=$("th"),u=$("tr"),c=$("tbody"),m=$("thead"),f=$("table"),g=()=>e(`
|
|
5
|
+
(function(p,Ft){typeof exports=="object"&&typeof module!="undefined"?Ft(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-react-popup","@progress/kendo-react-layout"],Ft):(p=typeof globalThis!="undefined"?globalThis:p||self,Ft(p.KendoReactDateinputs={},p.React,p.PropTypes,p.KendoReactCommon,p.KendoDateMath,p.KendoReactIntl,p.KendoReactButtons,p.KendoSvgIcons,p.KendoReactLabels,p.KendoReactPopup,p.KendoReactLayout))})(this,function(p,Ft,n,d,l,x,L,J,Ye,Wt,ht){"use strict";"use client";function Ti(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const o=Ti(Ft),ft={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",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"},ji=(i,t,e)=>[...i.slice(0,t+1),...i.slice(t+1).map(s=>s+e)];class Zi{constructor(t=0,e,s){this.total=t,this.rowHeight=e,this.detailRowHeight=s,this.offsets=[],this.heights=[];let a=0;for(let r=0;r<t;r++)this.offsets.push(a),a+=e,this.heights.push(e)}height(t){return this.heights[t]}expandDetail(t){this.height(t)===this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight)}collapseDetail(t){this.height(t)>this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight*-1)}index(t){for(let e=0;e<this.offsets.length;e++){if(t===this.offsets[e])return e;if(t<this.offsets[e])return e-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){return this.heights.reduce((t,e)=>t+e,0)}updateRowHeight(t,e){this.heights[t]+=e,this.offsets=ji(this.offsets,t,e)}}const Kt=i=>Math.max(i,0);class re{constructor(t){this.offset=t}}class le{constructor(t){this.skip=t}}class Gi{constructor(t,e){this.onScrollAction=t,this.onPageAction=e,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(t,e,s,a,r=0,h=0,u="vertical"){this.rowHeightService=t,this.firstLoaded=e,this.lastLoaded=e+s,this.take=s,this.total=a,this.lastScrollTop=0,this.topOffset=r,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(r),m=Kt(e-c);this.onScrollAction(new re(this.rowOffset(m))),this.onPageAction(new le(m))}onScroll({scrollLeft:t,scrollTop:e,offsetHeight:s,offsetWidth:a}){const r=this.direction==="vertical"?e:t,h=this.direction==="vertical"?s:a;if(this.lastScrollTop===r||!this.rowHeightService)return;const u=this.lastScrollTop>=r;this.lastScrollTop=r;const c=this.rowHeightService.index(Kt(r-this.topOffset)),m=this.rowHeightService.index(Kt(r+h-this.bottomOffset));if(!u&&m>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new re(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new le(this.firstLoaded))),u&&c<=this.firstLoaded){const f=Math.floor(this.take*.3);this.firstLoaded=Kt(c-f),this.onScrollAction(new re(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new le(this.firstLoaded))}}rowOffset(t){return this.rowHeightService?this.rowHeightService.offset(t)+this.topOffset:0}rowsForHeight(t){return this.rowHeightService?Math.ceil(t/this.rowHeightService.height(0)):0}}const Xi=(i,t,e)=>Math.min(Math.abs(t-i),e),Ji=17,Qi=10,Pi={[1]:i=>t=>t+i,[0]:i=>t=>t-i},ts={[1]:i=>t=>Math.min(t,i),[0]:i=>t=>Math.max(t,i)},es={[1]:i=>t=>t<i,[0]:i=>t=>t>i},Ut=class extends o.Component{constructor(i){super(i),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 e=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const s=this.scrollContainer[e];this.restrictScroll&&e==="scrollTop"&&(!Number.isInteger(s)||!Number.isInteger(t))&&Math.abs(s-t)<Qi||(this.scrollContainer[e]=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 e=this.rowHeightService.offset(t),s=this.getContainerScrollDirection(e);let{start:a,end:r}=this.scrollRange(e,s);if(a===r)return;const h=this.scrollStep(a,r),u=Pi[s](h),c=ts[s](r),m=es[s](u(r)),f=g=>{this.animationInProgress=!0;const w=u(g);this.scrollTo(c(w)),m(w)?this.cancelAnimation=window.requestAnimationFrame(()=>{f(w)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{f(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,e)=>{const s=this.props.scrollDuration||Ut.defaultProps.scrollDuration;return Math.abs(e-t)/(s/Ji)},this.scrollRange=(t,e)=>{const s=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${s}`,10))return{start:t,end:t};const a=this.containerMaxScroll(),r=e===0?1:-1,h=Xi(s,t,this.props.maxScrollDifference||0),u=Math.min(t,a);return{start:Math.min(Math.max(u+r*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const e=this.direction==="vertical"?t.itemHeight:t.itemWidth;e!==void 0&&(this.rowHeightService=new Zi(t.total,e,0),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 e=t.target;this.scrollerService.onScroll({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,offsetHeight:e.offsetHeight,offsetWidth:e.offsetWidth});const s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,r={index:s,target:e,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),a&&a.call(void 0,r),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new Gi(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(o.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:Ut.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Ut.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(i){return this.rowHeightService?this.rowHeightService.index(i):0}itemOffset(i){return this.rowHeightService?this.rowHeightService.offset(i):0}isIndexVisible(i){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,e=t+this.containerOffsetSize,s=this.rowHeightService.offset(i),a=s+this.rowHeightService.height(i);return s>=t&&a<=e}isListScrolled(i){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(i):!1}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const i=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${i}px`}:{width:`${i}px`},e=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),s=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return o.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:e,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,o.createElement("div",{style:t,className:s}))}};let gt=Ut;gt.propTypes={bottomOffset:n.number.isRequired,className:n.string,direction:n.oneOf(["horizontal","vertical"]),forceScroll:n.bool,itemHeight:n.number,itemWidth:n.number,maxScrollDifference:n.number,onScroll:n.func,onScrollAction:n.func,scrollDuration:n.number,scrollOffsetSize:n.number,skip:n.number.isRequired,tabIndex:n.number,take:n.number.isRequired,topOffset:n.number.isRequired,total:n.number.isRequired,role:n.string},gt.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const is=(i,t)=>{const e=Object.getOwnPropertyNames(i),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let a=0;a<e.length;a++){const r=e[a];if(i[r]!==t[r])return!1}return!0};class $e extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:a,...r}=t;return!((!(e&&a)||e.getTime()===a.getTime())&&is(s,r))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:a,isInRange:r,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:m,isRangeSplitStart:f,isRangeSplitEnd:g,isToday:w,isDisabled:v,view:E,value:V,...N}=this.props,S=this.props.activeRangeEnd==="end"&&m,y=this.props.activeRangeEnd==="start"&&u,b=d.classNames("k-calendar-td",{"k-range-end":m,"k-range-mid":c,"k-range-split-end":g,"k-range-split-start":f,"k-range-start":u,"k-active":y||S,"k-state-pending-focus":a,"k-selected":h||u||m,"k-today":w,"k-weekend":s,"k-disabled":v},t);return o.createElement("td",{...N,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o.createElement("span",{className:"k-link"},this.props.children))}}class Te extends o.Component{render(){const{className:t,firstDate:e,...s}=this.props;return o.createElement("td",{className:d.classNames("k-calendar-td",t),...s},this.props.children)}}var D=(i=>(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i[i.PrevView=4]="PrevView",i[i.NextView=5]="NextView",i[i.FirstInView=6]="FirstInView",i[i.LastInView=7]="LastInView",i[i.LowerView=8]="LowerView",i[i.UpperView=9]="UpperView",i))(D||{}),C=(i=>(i[i.month=0]="month",i[i.year=1]="year",i[i.decade=2]="decade",i[i.century=3]="century",i))(C||{});const q={start:null,end:null};function et(i){const t=(s,a,r,...h)=>a[r]===null?null:(s?i.isRequired:i)(a,r,...h),e=t.bind(null,!1);return e.isRequired=t.bind(null,!0),e}const Yt=(i,t,e)=>t===void 0||e===void 0||t<=i&&i<=e?i:i<t?t:e,B=new Date(1980,0,1),it=new Date(1900,0,1),st=new Date(2099,11,31),ct=new Date(1980,0,1),nt=new Date(1980,0,1,23,59,59),R=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e},z=()=>l.getDate(new Date),A=(i,t,e)=>!i||!(t&&t>i||e&&e<i),je=(i,t,e)=>i===null||!(t&&l.getDate(t)>l.getDate(i)||e&&l.getDate(e)<l.getDate(i)),$t=(i,t)=>{const{start:e,end:s}=t||q;return!e||!s?!1:e<i&&i<s},T=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Ze=(i,t,e)=>t.getTime()<=i.getTime()&&i.getTime()<=e.getTime(),Ge=(i,t)=>i.slice(t).concat(i.slice(0,t)),Y=(i,t,e)=>i&&(t&&i<t?l.cloneDate(t):e&&i>e?l.cloneDate(e):i),$=i=>(t,e="",s={})=>{const a=document.createElement(i);return a.className=e,Object.keys(s).map(r=>a.style[r]=s[r]),typeof t=="string"?a.innerHTML=t||"":(t||[]).forEach(r=>r&&a.appendChild(r)),a};function ss(i,t,e={}){let s,a;e.maxWait;let r,h,u;const c=window;let m=!1,f=!1;const g=!t&&t!==0&&typeof c.requestAnimationFrame=="function";if(typeof i!="function")throw new TypeError("Expected a function");t=+t||0;function w(O){const _=s,tt=a;return s=a=void 0,r=i.apply(tt,_),r}function v(O,_){return g?(c.cancelAnimationFrame(h),c.requestAnimationFrame(O)):setTimeout(O,_)}function E(O){if(g)return c.cancelAnimationFrame(O);clearTimeout(O)}function V(O){return h=v(y,t),m?w():r}function N(O){const _=O-u;return t-_}function S(O){const _=O-u;return u===void 0||_>=t||_<0||f}function y(){const O=Date.now();if(S(O))return b();h=v(y,N(O))}function b(O){return h=void 0,s?w():(s=a=void 0,r)}function K(){h!==void 0&&E(h),s=u=a=h=void 0}function M(){return h===void 0?r:b()}function F(){return h!==void 0}function U(...O){const _=Date.now(),tt=S(_);return s=O,a=this,u=_,tt&&h===void 0?V():(h===void 0&&(h=v(y,t)),r)}return U.cancel=K,U.flush=M,U.pending=F,U}const ns=[[]],oe=4,as=3,rs={[D.Left]:i=>l.addDecades(i,-1),[D.Up]:i=>l.addDecades(i,-5),[D.Right]:i=>l.addDecades(i,1),[D.Down]:i=>l.addDecades(i,5),[D.PrevView]:i=>l.addCenturies(i,-1),[D.NextView]:i=>l.addCenturies(i,1),[D.FirstInView]:i=>l.firstDecadeOfCentury(i),[D.LastInView]:i=>l.lastDecadeOfCentury(i)};class Xe{addToDate(t,e){return l.addCenturies(t,e)}datesList(t,e){return T(0,e).map(s=>l.addCenturies(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return ns;const f=T(0,oe),g=l.firstDecadeOfCentury(m),w=l.lastDecadeOfCentury(m),v=z();return T(0,as).map(E=>{const V=l.addDecades(g,E*oe);return f.map(N=>{const S=this.normalize(l.addDecades(V,N),h,r),y=this.isEqual(S,c.start),b=this.isEqual(S,c.end),M=!y&&!b&&$t(S,c),F=a&&(Array.isArray(u)?this.isSelectedFromArray(S,u,h,r):A(u,h,r)&&this.isEqual(S,u));return Ze(S,g,w)?{formattedValue:this.value(S),id:`${e}${S.getTime()}`,isFocused:this.isEqual(S,s),isSelected:F,isWeekend:!1,isInRange:A(S,h,r),isRangeStart:y,isRangeMid:M,isRangeEnd:b,isRangeSplitEnd:M&&this.isEqual(S,w),isRangeSplitStart:M&&this.isEqual(S,g),isToday:this.isEqual(S,v),title:this.cellTitle(S),value:S}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:l.firstYearOfDecade(t).getFullYear()===l.firstYearOfDecade(e).getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+99}isInRange(t,e,s){const a=l.firstYearOfDecade(t).getFullYear(),r=!e||l.firstYearOfDecade(e).getFullYear()<=a,h=!s||a<=l.firstYearOfDecade(s).getFullYear();return r&&h}isInSameView(t,e){return l.durationInCenturies(t,e)===0}isRangeStart(t){return t.getFullYear()%1e3===0}move(t,e){const s=rs[e];return s?s(t):t}cellTitle(t){return l.firstYearOfDecade(t).getFullYear().toString()}navigationTitle(t){return t?l.firstDecadeOfCentury(t).getFullYear().toString():""}title(t){return t?`${l.firstDecadeOfCentury(t).getFullYear()} - ${l.lastDecadeOfCentury(t).getFullYear()}`:""}rowLength(t){return oe}skip(t,e){return l.durationInCenturies(e,t)}total(t,e){return l.durationInCenturies(t,e)+1}value(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInCenturies(t,e)<s?l.addCenturies(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const ls=[[]],he=4,os=3,hs={[D.Left]:i=>l.addYears(i,-1),[D.Up]:i=>l.addYears(i,-5),[D.Right]:i=>l.addYears(i,1),[D.Down]:i=>l.addYears(i,5),[D.PrevView]:i=>l.addDecades(i,-1),[D.NextView]:i=>l.addDecades(i,1),[D.FirstInView]:i=>l.firstYearOfDecade(i),[D.LastInView]:i=>l.lastYearOfDecade(i)};class Je{addToDate(t,e){return l.addDecades(t,e)}datesList(t,e){return T(0,e).map(s=>l.addDecades(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return ls;const f=T(0,he),g=l.firstYearOfDecade(m),w=l.lastYearOfDecade(m),v=z();return T(0,os).map(E=>{const V=l.addYears(g,E*he);return f.map(N=>{const S=this.normalize(l.addYears(V,N),h,r),y=this.isEqual(S,c.start),b=this.isEqual(S,c.end),M=!y&&!b&&$t(S,c),F=a&&(Array.isArray(u)?this.isSelectedFromArray(S,u,h,r):A(u,h,r)&&this.isEqual(S,u));return Ze(S,g,w)?{formattedValue:this.value(S),id:`${e}${S.getTime()}`,isFocused:this.isEqual(S,s),isSelected:F,isWeekend:!1,isInRange:A(S,h,r),isRangeStart:y,isRangeMid:M,isRangeEnd:b,isRangeSplitEnd:M&&this.isEqual(S,w),isRangeSplitStart:M&&this.isEqual(S,g),isToday:this.isEqual(S,v),title:this.cellTitle(S),value:S}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+9}isInRange(t,e,s){const a=t.getFullYear(),r=!e||e.getFullYear()<=a,h=!s||a<=s.getFullYear();return r&&h}isRangeStart(t){return t.getFullYear()%100===0}isInSameView(t,e){return l.durationInDecades(t,e)===0}move(t,e){const s=hs[e];return s?s(t):t}cellTitle(t){return t.getFullYear().toString()}navigationTitle(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}title(t){return t?`${l.firstYearOfDecade(t).getFullYear()} - ${l.lastYearOfDecade(t).getFullYear()}`:""}rowLength(t){return he}skip(t,e){return l.durationInDecades(e,t)}total(t,e){return l.durationInDecades(t,e)+1}value(t){return t?t.getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInDecades(t,e)<s?l.addDecades(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const cs=[[]],ce=7,us=6,ds=6,ms=0,ps={[D.Left]:i=>l.addDays(i,-1),[D.Up]:i=>l.addWeeks(i,-1),[D.Right]:i=>l.addDays(i,1),[D.Down]:i=>l.addWeeks(i,1),[D.PrevView]:i=>l.addMonths(i,-1),[D.NextView]:i=>l.addMonths(i,1),[D.FirstInView]:i=>l.firstDayOfMonth(i),[D.LastInView]:i=>l.lastDayOfMonth(i)};class Qe{constructor(t){this.intl=t}addToDate(t,e){return l.addMonths(t,e)}datesList(t,e){return T(0,e).map(s=>l.addMonths(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return cs;const f=l.firstDayOfMonth(m),g=l.lastDayOfMonth(m),w=-1,v=l.dayOfWeek(f,this.intl.firstDay(),w),E=T(0,ce),V=z();return T(0,us).map(N=>{const S=l.addDays(v,N*ce);return E.map(y=>{const b=this.normalize(l.addDays(S,y),h,r);if(b<f||b>g)return null;const M=this.isEqual(b,c.start),F=this.isEqual(b,c.end),O=!M&&!F&&$t(b,c),_=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):A(u,h,r)&&this.isEqual(b,u));return{formattedValue:this.value(b),id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:_,isInRange:A(b,h,r),isWeekend:this.isWeekend(b),isRangeStart:M,isRangeMid:O,isRangeEnd:F,isRangeSplitStart:O&&this.isEqual(b,f),isRangeSplitEnd:O&&this.isEqual(b,g),isToday:this.isEqual(b,V),title:this.cellTitle(b),value:b}})})}isEqual(t,e){return!t||!e?!1:l.getDate(t).getTime()===l.getDate(e).getTime()}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isInArray(t,e){return!!e.length&&l.firstDayOfMonth(e[0])<=t&&t<=l.lastDayOfMonth(e[e.length-1])}isInRange(t,e,s){const a=l.getDate(t),r=!e||l.getDate(e)<=a,h=!s||a<=l.getDate(s);return r&&h}isInSameView(t,e){return l.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const s=ps[e];return s?s(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return ce+(t?1:0)}skip(t,e){return l.durationInMonths(e,t)}total(t,e){return l.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,s=1){return l.durationInMonths(t,e)<s?l.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===ds||e===ms}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.getDate(e):t>s&&this.isEqual(t,s)?l.getDate(s):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fs=[[]],ue=4,gs=3,vs=i=>i>4?-5:i<2?-2:-7,ws=i=>i<7?5:i<10?7:2,bs={[D.Left]:i=>l.addMonths(i,-1),[D.Up]:i=>l.addMonths(i,vs(i.getMonth())),[D.Right]:i=>l.addMonths(i,1),[D.Down]:i=>l.addMonths(i,ws(i.getMonth())),[D.PrevView]:i=>l.addYears(i,-1),[D.NextView]:i=>l.addYears(i,1),[D.FirstInView]:i=>l.firstMonthOfYear(i),[D.LastInView]:i=>l.lastMonthOfYear(i)};class Pe{constructor(t){this._intl=t}addToDate(t,e){return l.addYears(t,e)}datesList(t,e){return T(0,e).map(s=>l.addYears(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return fs;const f=this.abbrMonthNames(),g=l.firstMonthOfYear(m),w=l.lastMonthOfYear(m),v=g.getFullYear(),E=T(0,ue),V=z();return T(0,gs).map(N=>{const S=l.addMonths(g,N*ue);return E.map(y=>{const b=this.normalize(l.addMonths(S,y),h,r);if(v<b.getFullYear())return null;const M=this.isEqual(b,c.start),F=this.isEqual(b,c.end),O=!M&&!F&&$t(b,c),_=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):A(u,h,r)&&this.isEqual(b,u));return{formattedValue:f[b.getMonth()],id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:_,isInRange:A(b,h,r),isWeekend:!1,isRangeStart:M,isRangeMid:O,isRangeEnd:F,isRangeSplitEnd:O&&this.isEqual(b,w),isRangeSplitStart:O&&this.isEqual(b,g),isToday:this.isEqual(b,V),title:this.cellTitle(b),value:b}})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()}isInRange(t,e,s){const a=l.createDate(t.getFullYear(),t.getMonth(),1),r=!e||l.createDate(e.getFullYear(),e.getMonth(),1)<=a,h=!s||a<=l.createDate(s.getFullYear(),s.getMonth(),1);return r&&h}isInSameView(t,e){return l.durationInYears(t,e)===0}isRangeStart(t){return t.getFullYear()%10===0}move(t,e){const s=bs[e];return s?s(t):t}cellTitle(t){return`${t.getFullYear()} ${this.value(t)}`}navigationTitle(t){return this.title(t)}title(t){return t?t.getFullYear().toString():""}rowLength(t){return ue}skip(t,e){return l.durationInYears(e,t)}total(t,e){return l.durationInYears(t,e)+1}value(t){return t?this.abbrMonthNames()[t.getMonth()]:""}viewDate(t,e,s=1){return l.durationInYears(t,e)<s?l.addYears(t,-1):t}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const Ss={[C.month]:Qe,[C.year]:Pe,[C.decade]:Je,[C.century]:Xe},Ds=(i,t)=>{const e=C[C[i+t]];return e!==void 0?e:i};class de{constructor(t){this.bottom=C.month,this.top=C.century,this.onViewChanged=t}configure(t,e){this.bottom=t,this.top=e}service(t,e){return new Ss[`${t}`](e)}moveDown(t,e){this.move(t,-1,e)}moveUp(t,e){this.move(t,1,e)}moveToBottom(t){t!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(t){return this.bottom<t}canMoveUp(t){return t<this.top}clamp(t){return t<this.bottom?this.bottom:t>this.top?this.top:t}move(t,e,s){const a=this.clamp(Ds(t,e));a!==t&&this.onViewChanged({view:a},s)}}let ti=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=$("div"),s=$("ul"),a=$("li"),r=$("td"),h=$("th"),u=$("tr"),c=$("tbody"),m=$("thead"),f=$("table"),g=()=>e(`
|
|
6
6
|
<span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">
|
|
7
7
|
<span className="k-button-text">March 2017</span>
|
|
8
8
|
</span>
|
package/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ const Rt = {
|
|
|
17
17
|
name: "@progress/kendo-react-dateinputs",
|
|
18
18
|
productName: "KendoReact",
|
|
19
19
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
20
|
-
publishDate:
|
|
20
|
+
publishDate: 1705077059,
|
|
21
21
|
version: "",
|
|
22
22
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
23
23
|
}, pi = (s, t, e) => [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dateinputs",
|
|
3
|
-
"version": "7.0.3-develop.
|
|
3
|
+
"version": "7.0.3-develop.11",
|
|
4
4
|
"description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-date-math": "^1.4.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-buttons": "7.0.3-develop.
|
|
28
|
-
"@progress/kendo-react-common": "7.0.3-develop.
|
|
29
|
-
"@progress/kendo-react-intl": "7.0.3-develop.
|
|
30
|
-
"@progress/kendo-react-labels": "7.0.3-develop.
|
|
31
|
-
"@progress/kendo-react-layout": "7.0.3-develop.
|
|
32
|
-
"@progress/kendo-react-popup": "7.0.3-develop.
|
|
27
|
+
"@progress/kendo-react-buttons": "7.0.3-develop.11",
|
|
28
|
+
"@progress/kendo-react-common": "7.0.3-develop.11",
|
|
29
|
+
"@progress/kendo-react-intl": "7.0.3-develop.11",
|
|
30
|
+
"@progress/kendo-react-labels": "7.0.3-develop.11",
|
|
31
|
+
"@progress/kendo-react-layout": "7.0.3-develop.11",
|
|
32
|
+
"@progress/kendo-react-popup": "7.0.3-develop.11",
|
|
33
33
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
34
34
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
35
35
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|