@progress/kendo-react-dateinputs 9.4.0-develop.6 → 9.4.0-develop.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +0 -1
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +12 -13
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +3 -4
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +2 -3
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +8 -9
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +0 -1
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +0 -1
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +0 -1
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +0 -1
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +0 -1
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +0 -1
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +0 -1
- package/calendar/models/CalendarViewEnum.js +1 -1
- package/calendar/models/CalendarViewEnum.mjs +0 -1
- package/calendar/models/NavigationAction.js +1 -1
- package/calendar/models/NavigationAction.mjs +0 -1
- package/calendar/models/SelectionRange.js +1 -1
- package/calendar/models/SelectionRange.mjs +0 -1
- package/calendar/services/BusViewService.js +1 -1
- package/calendar/services/BusViewService.mjs +0 -1
- package/calendar/services/CenturyViewService.js +1 -1
- package/calendar/services/CenturyViewService.mjs +0 -1
- package/calendar/services/DOMService.js +1 -1
- package/calendar/services/DOMService.mjs +0 -1
- package/calendar/services/DecadeViewService.js +1 -1
- package/calendar/services/DecadeViewService.mjs +0 -1
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +0 -1
- package/calendar/services/NavigationService.js +1 -1
- package/calendar/services/NavigationService.mjs +18 -19
- package/calendar/services/ScrollSyncService.js +1 -1
- package/calendar/services/ScrollSyncService.mjs +0 -1
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +5 -6
- package/calendar/services/YearViewService.js +1 -1
- package/calendar/services/YearViewService.mjs +0 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +7 -8
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +7 -8
- package/common/PickerWrap.js +1 -1
- package/common/PickerWrap.mjs +3 -4
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +0 -1
- package/dateinput/dateInputIntl.js +1 -1
- package/dateinput/dateInputIntl.mjs +3 -4
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +4 -5
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +0 -1
- package/datepicker/ToggleButton.js +1 -1
- package/datepicker/ToggleButton.mjs +3 -4
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +0 -1
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +0 -1
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +0 -1
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +5 -6
- package/index.js +2 -1
- package/messages/index.js +1 -1
- package/messages/index.mjs +5 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +8 -8
- package/timepicker/TimeList.js +1 -1
- package/timepicker/TimeList.mjs +16 -17
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +0 -1
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +0 -1
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +0 -1
- package/timepicker/models/TimePart.js +1 -1
- package/timepicker/models/TimePart.mjs +2 -3
- package/timepicker/services/DOMService.js +1 -1
- package/timepicker/services/DOMService.mjs +0 -1
- package/timepicker/services/DayPeriodService.js +1 -1
- package/timepicker/services/DayPeriodService.mjs +3 -4
- package/timepicker/services/HoursService.js +1 -1
- package/timepicker/services/HoursService.mjs +3 -4
- package/timepicker/services/MinutesService.js +1 -1
- package/timepicker/services/MinutesService.mjs +5 -6
- package/timepicker/services/SecondsService.js +1 -1
- package/timepicker/services/SecondsService.mjs +0 -1
- package/timepicker/utils.js +1 -1
- package/timepicker/utils.mjs +0 -1
- package/utils.js +1 -1
- package/utils.mjs +18 -19
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +0 -1
- package/virtualization/services/ScrollerService.js +1 -1
- package/virtualization/services/ScrollerService.mjs +0 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),a=require("prop-types"),r=require("@progress/kendo-react-common"),o=require("@progress/kendo-date-math"),S=require("@progress/kendo-react-intl"),P=require("../../package-metadata.js"),q=require("./ViewList.js"),A=require("./Navigation.js"),d=require("../models/CalendarViewEnum.js"),l=require("../../utils.js"),L=require("../services/BusViewService.js"),T=require("../services/DOMService.js"),B=require("../services/NavigationService.js"),R=require("../services/ScrollSyncService.js");function K(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return i.default=c,Object.freeze(i)}const g=K(M),b=c=>c?c.virtualization:null,y=(c=v.defaultProps.min,i=v.defaultProps.max,t,e)=>e!==void 0?e!==null&&l.isInRange(o.getDate(e),c,i)?e:null:t!==null&&l.isInRange(o.getDate(t),c,i)?t:null,h=class h extends g.Component{constructor(i){super(i),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(b(this.Navigation),b(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const s=o.cloneDate(e.value);this.setState({focusedDate:s})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const s=o.cloneDate(e.value),n=o.cloneDate(e.value),f=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(f)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:n});return}this.setState({value:s,focusedDate:n}),this.valueDuringOnChange=s;const{onChange:p}=this.props;if(p){const u={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};p.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:n,ctrlKey:f,metaKey:p}=e;if(!(!this.focusedDate||!this.service)){if(n===84&&this.setState({focusedDate:l.getToday()}),(f||p)&&(n===r.Keys.left||n===r.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const u=n===r.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,m=new Date(this.focusedDate.setMonth(u)),V=o.cloneDate(m);this.setState({focusedDate:V})}if(n===r.Keys.enter){if(this.value!==null&&o.isEqualDate(this.focusedDate,this.value)){const m=l.dateInRange(this.focusedDate,this.min,this.max);b(this.calendarViewList).scrollToIndex(this.service.skip(m,this.min))}const u={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(u)}else{const u=l.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(o.isEqualDate(this.focusedDate,u))return;this.setState({focusedDate:u})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},r.validatePackage(P.packageMetadata);const t=y(this.min,this.max,this.props.defaultValue||h.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:l.viewInRange(d.CalendarViewEnum[i.defaultActiveView],this.bottomView,this.topView),focusedDate:l.dateInRange(i.focusedDate||t||l.getToday(),this.min,this.max)},this.dom=new T.DOMService,this.bus=new L.BusViewService(this.handleViewChange),this.navigation=new B.NavigationService(this.bus),this.oldValue=t}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get min(){return o.getDate(this.props.min!==void 0?this.props.min:h.defaultProps.min)}get max(){return o.getDate(this.props.max!==void 0?this.props.max:h.defaultProps.max)}get bottomView(){return d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:h.defaultProps.bottomView]}get topView(){return d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:h.defaultProps.topView]}componentDidMount(){const{unstyled:i}=this.props;Promise.resolve().then(()=>{r.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element,i),this.scrollSyncService=new R.ScrollSyncService(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(i,t){r.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){const{_ref:i,unstyled:t,bottomView:e,topView:s,disabled:n,weekNumber:f,mobileMode:p,className:u}=this.props;i&&i(this);const m=t&&t.uCalendar,V=this.value!==null&&this.oldValue!==null?!o.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,I=l.viewInRange(this.state.activeView,d.CalendarViewEnum[e!==void 0?e:h.defaultProps.bottomView],d.CalendarViewEnum[s!==void 0?s:h.defaultProps.topView]),D=y(this.min,this.max,this.value,this.value),O=D?o.getDate(D):null;this.focusedDate=o.getDate(l.dateInRange(V&&D!==null?D:this.state.focusedDate,this.min,this.max)),this.intl=S.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(I,this.intl);const{smoothScroll:k=Number.parseFloat(g.version)<18}=this.props,x=r.classNames(r.uCalendar.wrapper({c:m,disabled:n,weekNumber:f,mobileMode:p}),u),N=[this.props.navigation&&g.createElement(A.Navigation,{key:0,ref:w=>{this.Navigation=w},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex,unstyled:t}),g.createElement(q.ViewList,{key:1,ref:w=>{this.calendarViewList=w},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:k,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:O,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:t})];return g.createElement("div",{ref:w=>{this._element=w},className:x,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},N)}};h.displayName="Calendar",h.propTypes={className:a.string,defaultActiveView:a.oneOf(["month","year","decade","century"]),defaultValue:a.instanceOf(Date),disabled:a.bool,focusedDate:a.instanceOf(Date),id:a.string,ariaLabelledBy:a.string,ariaDescribedBy:a.string,weekDaysFormat:a.oneOf(["short","abbreviated","narrow"]),max:a.instanceOf(Date),min:a.instanceOf(Date),navigation:a.bool,smoothScroll:a.bool,onBlur:a.func,onChange:a.func,onFocus:a.func,tabIndex:a.number,value:a.instanceOf(Date),weekNumber:a.bool,topView:(i,t,e)=>{const s=i[t],n=i.bottomView;return s&&n&&d.CalendarViewEnum[s]<d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
|
|
9
9
|
${t} can not be smaller than bottomView.
|
|
10
10
|
`):null},bottomView:(i,t,e)=>{const s=i[t],n=i.topView;return s&&n&&d.CalendarViewEnum[s]>d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
|
|
11
11
|
${t} can not be bigger than topView.
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as f from "react";
|
|
10
9
|
import s from "prop-types";
|
|
11
10
|
import { Keys as g, validatePackage as L, setScrollbarWidth as C, classNames as B, uCalendar as T, createPropsContext as F, withIdHOC as K, withPropsContext as U, withUnstyledHOC as $ } from "@progress/kendo-react-common";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),l=require("@progress/kendo-react-common");function N(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const i=N(R),k=(a,t)=>{const e=Object.getOwnPropertyNames(a),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let r=0;r<e.length;r++){const o=e[r];if(a[o]!==t[o])return!1}return!0};class w extends i.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:r,...o}=t;return!((!(e&&r)||e.getTime()===r.getTime())&&k(s,o))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:r,isInRange:o,isSelected:u,isRangeStart:c,isRangeMid:f,isRangeEnd:d,isRangeSplitStart:E,isRangeSplitEnd:C,isToday:M,isDisabled:S,view:P,value:j,isOtherMonth:n,showOtherMonthDays:p,allowReverse:h,unstyled:g,...b}=this.props,y=this.props.activeRangeEnd==="end"&&d,O=this.props.activeRangeEnd==="start"&&c,m=g&&g.uCalendar,v=l.classNames(l.uCalendar.td({c:m,rangeStart:!n&&!h&&c,rangeEnd:!n&&!h&&d,rangeMid:!n&&f,rangeSplitEnd:!n&&C,rangeSplitStart:!n&&E,active:O||y,focused:r,selected:!n&&(u||c||d),today:!n&&M,weekend:s,disabled:S,isOtherMonth:n,isEmpty:!p&&n}),t);return!p&&n?i.createElement("td",{role:"gridcell",className:v}):i.createElement("td",{...b,className:v,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},i.createElement("span",{className:l.classNames(l.uCalendar.link({c:m}))},this.props.children))}}exports.CalendarCell=w;
|
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as r from "react";
|
|
10
9
|
import { classNames as v, uCalendar as E } from "@progress/kendo-react-common";
|
|
11
10
|
const y = (l, e) => {
|
|
12
|
-
const t = Object.getOwnPropertyNames(l),
|
|
13
|
-
if (t.length !==
|
|
11
|
+
const t = Object.getOwnPropertyNames(l), n = Object.getOwnPropertyNames(e);
|
|
12
|
+
if (t.length !== n.length)
|
|
14
13
|
return !1;
|
|
15
|
-
for (let
|
|
16
|
-
const o = t[
|
|
14
|
+
for (let a = 0; a < t.length; a++) {
|
|
15
|
+
const o = t[a];
|
|
17
16
|
if (l[o] !== e[o])
|
|
18
17
|
return !1;
|
|
19
18
|
}
|
|
@@ -22,8 +21,8 @@ const y = (l, e) => {
|
|
|
22
21
|
class L extends r.Component {
|
|
23
22
|
constructor() {
|
|
24
23
|
super(...arguments), this.handleClick = (e) => {
|
|
25
|
-
const { onClick: t, value:
|
|
26
|
-
t && t.call(void 0,
|
|
24
|
+
const { onClick: t, value: n } = this.props;
|
|
25
|
+
t && t.call(void 0, n, e);
|
|
27
26
|
}, this.handleMouseEnter = () => {
|
|
28
27
|
const { onMouseEnter: e, value: t } = this.props;
|
|
29
28
|
e && e.call(void 0, t);
|
|
@@ -40,16 +39,16 @@ class L extends r.Component {
|
|
|
40
39
|
* @hidden
|
|
41
40
|
*/
|
|
42
41
|
shouldComponentUpdate(e) {
|
|
43
|
-
const { value: t, ...
|
|
44
|
-
return !((!(t &&
|
|
42
|
+
const { value: t, ...n } = this.props, { value: a, ...o } = e;
|
|
43
|
+
return !((!(t && a) || t.getTime() === a.getTime()) && y(n, o));
|
|
45
44
|
}
|
|
46
45
|
/* eslint-disable max-len */
|
|
47
46
|
render() {
|
|
48
47
|
const {
|
|
49
48
|
className: e,
|
|
50
49
|
formattedValue: t,
|
|
51
|
-
isWeekend:
|
|
52
|
-
isFocused:
|
|
50
|
+
isWeekend: n,
|
|
51
|
+
isFocused: a,
|
|
53
52
|
isInRange: o,
|
|
54
53
|
isSelected: d,
|
|
55
54
|
isRangeStart: i,
|
|
@@ -75,10 +74,10 @@ class L extends r.Component {
|
|
|
75
74
|
rangeSplitEnd: !s && M,
|
|
76
75
|
rangeSplitStart: !s && C,
|
|
77
76
|
active: k || w,
|
|
78
|
-
focused:
|
|
77
|
+
focused: a,
|
|
79
78
|
selected: !s && (d || i || c),
|
|
80
79
|
today: !s && R,
|
|
81
|
-
weekend:
|
|
80
|
+
weekend: n,
|
|
82
81
|
disabled: S,
|
|
83
82
|
isOtherMonth: s,
|
|
84
83
|
isEmpty: !p && s
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@progress/kendo-react-buttons"),a=require("react");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const l=c(a),i=e=>{const{view:r,...t}=e;return l.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...t},e.children)};exports.CalendarHeaderTitle=i;
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { Button as r } from "@progress/kendo-react-buttons";
|
|
10
9
|
import * as o from "react";
|
|
11
|
-
const
|
|
12
|
-
const { view:
|
|
10
|
+
const n = (e) => {
|
|
11
|
+
const { view: a, ...t } = e;
|
|
13
12
|
return /* @__PURE__ */ o.createElement(r, { type: "button", fillMode: "flat", themeColor: "primary", ...t }, e.children);
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
n as CalendarHeaderTitle
|
|
17
16
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),n=require("@progress/kendo-react-common");function f(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const s=f(m),g=e=>{const{isRangeStart:a,value:t,text:c,view:C,...i}=e,l=n.useUnstyled(),r=l&&l.uCalendar,u=d=>{const{onClick:o}=e;o&&o.call(void 0,t,d)};return s.createElement("li",{...i,onClick:u,className:n.classNames(n.uCalendar.li({c:r}))},s.createElement("span",{className:n.classNames(n.uCalendar.navigationMarker({c:r,isRangeStart:a}))},e.children))};exports.CalendarNavigationItem=g;
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as l from "react";
|
|
10
|
-
import { useUnstyled as
|
|
9
|
+
import { useUnstyled as C, classNames as c, uCalendar as s } from "@progress/kendo-react-common";
|
|
11
10
|
const N = (e) => {
|
|
12
|
-
const { isRangeStart: i, value: o, text:
|
|
11
|
+
const { isRangeStart: i, value: o, text: u, view: v, ...r } = e, a = C(), t = a && a.uCalendar, m = (d) => {
|
|
13
12
|
const { onClick: n } = e;
|
|
14
13
|
n && n.call(void 0, o, d);
|
|
15
14
|
};
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("@progress/kendo-react-common");function f(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const m=f(d),C=e=>{const{className:n,firstDate:t,weekDays:c,...o}=e,i=r=>{const{onClick:s}=e;s&&r&&s.call(void 0,t,c||[],r)},l=a.useUnstyled(),u=l&&l.uCalendar;return m.createElement("td",{className:a.classNames(a.uCalendar.td({c:u,isWeek:!0}),n),...o,onClick:i},e.children)};exports.CalendarWeekCell=C;
|
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import { useUnstyled as m, classNames as C, uCalendar as u } from "@progress/kendo-react-common";
|
|
8
|
+
import * as i from "react";
|
|
9
|
+
import { useUnstyled as m, classNames as C, uCalendar as k } from "@progress/kendo-react-common";
|
|
11
10
|
const f = (e) => {
|
|
12
|
-
const { className: l, firstDate: c, weekDays: n, ...o } = e, r = (
|
|
13
|
-
const { onClick:
|
|
14
|
-
|
|
15
|
-
}, s = m(),
|
|
16
|
-
return /* @__PURE__ */
|
|
11
|
+
const { className: l, firstDate: c, weekDays: n, ...o } = e, r = (a) => {
|
|
12
|
+
const { onClick: t } = e;
|
|
13
|
+
t && a && t.call(void 0, c, n || [], a);
|
|
14
|
+
}, s = m(), d = s && s.uCalendar;
|
|
15
|
+
return /* @__PURE__ */ i.createElement(
|
|
17
16
|
"td",
|
|
18
17
|
{
|
|
19
|
-
className: C(
|
|
18
|
+
className: C(k.td({ c: d, isWeek: !0 }), l),
|
|
20
19
|
...o,
|
|
21
20
|
onClick: r
|
|
22
21
|
},
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),c=require("prop-types"),T=require("@progress/kendo-react-intl"),a=require("@progress/kendo-react-common"),C=require("./CalendarHeaderTitle.js"),h=require("../../utils.js");function b(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const s=b(f),n=class n extends s.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),r=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(r,this.min,this.max)?t:`${t} - ${this.props.service.title(r)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:n.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const{activeView:e,commands:t,unstyled:r}=this.props,o=r&&r.uCalendar,p=this.getTitle(),d=a.classNames(a.uCalendar.title({c:o})),u={children:p,value:p,view:e,className:d,onClick:this.handleTitleClick,disabled:!this.canMoveUp},m={headerTitleProps:u,commands:t},g=this.props.headerTitle?s.createElement(this.props.headerTitle,{...u},p):s.createElement(C.CalendarHeaderTitle,{...u},p),v=this.props.header?s.createElement(this.props.header,{...m}):s.createElement(s.Fragment,null,g,s.createElement("span",{className:a.classNames(a.uCalendar.spacer({c:o}))}),s.createElement("span",{className:a.classNames(a.uCalendar.nav({c:o}))},this.props.commands));return s.createElement("div",{className:a.classNames(a.uCalendar.header({c:o,vertical:this.props.verticalView}))},v)}};n.propTypes={activeView:c.number.isRequired,currentDate:c.instanceOf(Date).isRequired,max:c.instanceOf(Date).isRequired,min:c.instanceOf(Date).isRequired,rangeLength:c.number},n.defaultProps={rangeLength:1,min:h.MIN_DATE,max:h.MAX_DATE};let l=n;T.registerForLocalization(l);exports.Header=l;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as e from "react";
|
|
10
9
|
import i from "prop-types";
|
|
11
10
|
import { registerForLocalization as v } from "@progress/kendo-react-intl";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),m=require("./View.js"),a=require("../models/CalendarViewEnum.js"),d=require("@progress/kendo-react-common"),v=require("@progress/kendo-date-math"),h=require("../../utils.js");function f(i){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>i[e]})}}return s.default=i,Object.freeze(s)}const l=f(u),p=2,n=class n extends l.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleWeekCellClick=(e,t,r)=>{const{onWeekSelect:o}=this.props;o&&r&&o.call(void 0,e,t,r)},this.handleDateChange=(e,t=!1)=>{const{onChange:r}=this.props;if(r){const o={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:v.cloneDate(e.value),target:this,isTodayClick:t};r.call(void 0,o)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===a.CalendarViewEnum.month)}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===a.CalendarViewEnum.month,"k-calendar-yearview":this.props.activeView===a.CalendarViewEnum.year,"k-calendar-decadeview":this.props.activeView===a.CalendarViewEnum.decade,"k-calendar-centuryview":this.props.activeView===a.CalendarViewEnum.century});return l.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>l.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},l.createElement(m.View,{bus:this.props.bus,weekDaysFormat:this.props.weekDaysFormat,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onWeekSelect:this.handleWeekCellClick,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}))))}};n.defaultProps={showWeekNumbers:!1,views:p,take:p,allowReverse:!0,weekDaysFormat:"short",min:h.MIN_DATE,max:h.MAX_DATE};let c=n;exports.HorizontalViewList=c;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as o from "react";
|
|
10
9
|
import { View as h } from "./View.mjs";
|
|
11
10
|
import { CalendarViewEnum as i } from "../models/CalendarViewEnum.mjs";
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),s=require("prop-types"),F=require("@progress/kendo-react-intl"),D=require("@progress/kendo-react-common"),o=require("@progress/kendo-date-math"),S=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-svg-icons"),I=require("../models/NavigationAction.js"),M=require("../models/CalendarViewEnum.js"),L=require("../models/SelectionRange.js"),K=require("./Header.js"),r=require("../../utils.js"),V=require("../../messages/index.js"),z=require("../services/BusViewService.js"),H=require("../services/NavigationService.js"),E=require("./HorizontalViewList.js"),Y=require("./TodayCommand.js");function j(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const a in c)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(c,a);Object.defineProperty(i,a,d.get?d:{enumerable:!0,get:()=>c[a]})}}return i.default=c,Object.freeze(i)}const g=j(_),A=(c=v.defaultProps.min,i=v.defaultProps.max,a)=>a instanceof Date&&!Array.isArray(a)&&r.isInRange(o.getDate(a),c,i)?o.getDate(a):null,T=(c=v.defaultProps.min,i=v.defaultProps.max,a)=>Array.isArray(a)?a.filter(d=>r.isInRange(d,c,i)).map(d=>o.getDate(d)):null,N=c=>typeof c=="object"&&!(c instanceof Date)&&c!==null&&!Array.isArray(c)?c:L.EMPTY_SELECTIONRANGE,P=(c,i,a)=>c||i&&i[0]||a&&a.start,U=(c,i)=>c.start===null&&i===null?"start":c.end===null?"end":"start",p=class p extends g.Component{constructor(i){super(i),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=L.EMPTY_SELECTIONRANGE,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=e=>({start:e,end:null}),this.rangeWithFocused=(e,t)=>({start:e.start,end:e.end===null&&e.start!==null&&this.isActive?t:e.end}),this.generateRange=(e,t)=>{const{end:h,start:l}=t,u=t.start!==null&&e.getTime()<=t.start.getTime();return!this.props.allowReverse&&u?{start:e,end:this.selectedRange.start}:this.activeRange!=="end"?{start:e,end:h}:{start:l||this.selectedDate,end:e}},this.canNavigate=e=>{if(!this.service)return!1;const t=this.service.move(this.focusedDate,e);return this.min<=t&&t<=this.max||this.service.isInSameView(t,this.min)||this.service.isInSameView(t,this.max)},this.navigate=(e,t)=>{this.calculateFocusFromValue=!1;const h=this.move(e,t);this.setState({navigateDate:h,focusedDate:h})},this.move=(e,t)=>this.clampDate(this.service.move(t,e)),this.clampDate=e=>r.dateInRange(e,this.min,this.max),this.shouldAutoCorrect=(e,t)=>{const{end:h,start:l}=t;return this.activeRange!=="end"?h!==null&&e>h:l!==null&&e<l},this.handleCellEnter=e=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:e}))},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleTodayClick=e=>{this.todayIsInRange&&this.handleDateChange(e)},this.handlePrevButtonClick=()=>{const e=I.Action.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(e,this.move(e,this.focusedDate));else{const t=this.isInMonth(this.focusedDate,this.dates[1])?this.move(e,this.focusedDate):this.focusedDate;this.navigate(e,t)}},this.handleNextButtonClick=()=>{this.navigate(I.Action.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:h,ctrlKey:l,metaKey:u}=e;if(h===84){const n=r.getToday();this.calculateFocusFromValue=!1,this.setState({focusedDate:n,navigateDate:n})}if((l||u)&&(h===D.Keys.left&&this.handlePrevButtonClick(),h===D.Keys.right&&this.handleNextButtonClick()),h===D.Keys.enter){const n={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(n)}else{const n=r.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(o.isEqualDate(this.focusedDate,n))return;this.dates&&this.service&&!this.service.isInArray(n,this.dates)&&this.setState({navigateDate:n}),this.calculateFocusFromValue=!1,this.setState({focusedDate:n})}e.preventDefault()},this.handleViewChange=({view:e})=>{this.calculateFocusFromValue=!1,this.setState(t=>({activeView:e,navigateDate:t.focusedDate}))},this.handleWeekSelection=(e,t,h)=>{if(this.props.mode==="single")return;const l=0,u=6,n=t===l?e:o.addDays(e,-t),m=t===u?e:o.addDays(e,u-t);let f=null;if(this.props.mode==="multiple"){f=[];for(let R=l;R<=u;R++)f.push(o.addDays(n,R));this.setState({value:f,focusedDate:e})}this.props.mode==="range"&&(f={start:n,end:m},this.setState({value:f,focusedDate:e}));const{onChange:x}=this.props;if(x){const R={syntheticEvent:h,nativeEvent:h.nativeEvent,value:f,target:this};x.call(void 0,R)}},this.handleDateChange=e=>{const t=o.cloneDate(e.value),h=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(h)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:t,navigateDate:t});return}this.calculateFocusFromValue=!0;let l;switch(this.props.mode){case"single":l=o.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const n=this.selectedMultiple.slice();let m=-1;n.forEach((f,x)=>{o.isEqualDate(f,e.value)&&(m=x)}),m!==-1?n.splice(m,1):n.push(o.cloneDate(e.value)),l=n.slice()}else this.selectedDate?l=[o.cloneDate(this.selectedDate),o.cloneDate(e.value)]:l=[o.cloneDate(e.value)];break;case"range":{l=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(e.value):this.generateRange(e.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:l=o.cloneDate(e.value);break}this.valueDuringOnChange=l,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:l,focusedDate:t}),this.valueDuringOnChange=l;const{onChange:u}=this.props;if(u){const n={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l,target:this};u.call(void 0,n)}this.valueDuringOnChange=void 0};const a=i.value!==void 0?i.value:i.defaultValue||p.defaultProps.defaultValue,d=A(this.min,this.max,a),w=T(this.min,this.max,a),C=N(a),O=P(d,w,C),b=r.viewInRange(M.CalendarViewEnum[i.defaultActiveView],this.bottomView,this.topView),y=r.dateInRange(i.focusedDate||O||r.getToday(),this.min,this.max);this.state={value:a,activeView:b,focusedDate:y,navigateDate:y},this.activeRangeEnd=U(C,d),this.bus=new z.BusViewService(this.handleViewChange),this.navigation=new H.NavigationService(this.bus),this.calculateFocusFromValue=!1,this.lastView=b,this.lastViewsCount=this.props.views||E.HorizontalViewList.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return o.cloneDate(this._focusedDate)}get min(){return o.getDate(this.props.min!==void 0?this.props.min:p.defaultProps.min)}get max(){return o.getDate(this.props.max!==void 0?this.props.max:p.defaultProps.max)}get bottomView(){return M.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:p.defaultProps.bottomView]}get topView(){return M.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:p.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return r.isInRange(r.getToday(),o.getDate(this.min),o.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const i=A(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&i&&this.selectedDate.getTime()&&i.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||E.HorizontalViewList.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=F.provideIntlService(this),this.localization=F.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const i=r.viewInRange(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(i,this.intl),this.selectedDate=A(this.min,this.max,this.value),this.selectedMultiple=T(this.min,this.max,this.value),this.selectedRange=N(this.value);const a=P(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=r.dateInRange(this.calculateFocusFromValue&&a!==null?a:this.state.focusedDate,this.min,this.max);const d=D.classNames("k-calendar k-calendar-range k-calendar-md",{"k-disabled":this.props.disabled},this.props.className),w=this.rangeWithFocused(this.selectedRange,this.focusedDate),C=this.localization.toLanguageString(V.prevView,V.messages[V.prevView]),O=this.localization.toLanguageString(V.nextView,V.messages[V.nextView]),b=!this.canNavigate(I.Action.PrevView),y=!this.canNavigate(I.Action.NextView),e={"aria-disabled":b},t={"aria-disabled":y},h=this.lastView!==i,l=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),u=this.lastViewsCount!==this.props.views;(!l||h||u)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||E.HorizontalViewList.defaultProps.views));const n=o.cloneDate(this.dates&&this.dates[0]?this.dates[0]:r.getToday());return g.createElement("div",{ref:m=>{this._element=m},className:d,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},g.createElement(K.Header,{key:`.kendo.calendar.header.${n.getTime()}`,activeView:i,currentDate:n,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:g.createElement(g.Fragment,null,g.createElement(S.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?k.chevronRightIcon:k.chevronLeftIcon,fillMode:"flat",title:C,disabled:b,onClick:this.handlePrevButtonClick,...e}),g.createElement(Y.TodayCommand,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),g.createElement(S.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?k.chevronLeftIcon:k.chevronRightIcon,fillMode:"flat",title:O,disabled:y,onClick:this.handleNextButtonClick,...t}))}),g.createElement(E.HorizontalViewList,{ref:m=>{this.calendarViewList=m},dates:this.dates,activeView:i,focusedDate:this.focusedDate,weekDaysFormat:this.props.weekDaysFormat,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:w,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,onWeekSelect:this.handleWeekSelection,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}))}isInMonth(i,a){return!!a&&o.firstDayOfMonth(a)<=i&&i<=o.lastDayOfMonth(a)}};p.displayName="MultiViewCalendar",p.propTypes={activeRangeEnd:s.oneOf(["start","end"]),allowReverse:s.bool,bottomView:s.oneOf(["month","year","decade","century"]),className:s.string,defaultActiveView:s.oneOf(["month","year","decade","century"]),defaultValue:s.oneOfType([r.nullable(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:r.nullable(s.instanceOf(Date)),end:r.nullable(s.instanceOf(Date))})]),disabled:s.bool,focusedDate:s.instanceOf(Date),id:s.string,weekDaysFormat:s.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,max:s.instanceOf(Date),min:s.instanceOf(Date),mode:s.oneOf(["single","multiple","range"]),onBlur:s.func,onChange:s.func,onFocus:s.func,tabIndex:s.number,topView:s.oneOf(["month","year","decade","century"]),value:s.oneOfType([r.nullable(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:r.nullable(s.instanceOf(Date).isRequired),end:r.nullable(s.instanceOf(Date).isRequired)})]),views:(i,a,d)=>{const w=i[a];return w!==void 0&&w<1?new Error(`Invalid prop '${a}' supplied to'${d}'. The '${a}' property cannot be less than 1'`):null},weekNumber:s.bool,showOtherMonthDays:s.bool,dir:s.string},p.defaultProps={disabled:!1,min:r.MIN_DATE,max:r.MAX_DATE,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let v=p;const B=D.createPropsContext(),q=D.withIdHOC(D.withPropsContext(B,v));q.displayName="KendoReactMultiViewCalendar";F.registerForIntl(v);F.registerForLocalization(v);exports.MultiViewCalendar=q;exports.MultiViewCalendarPropsContext=B;exports.MultiViewCalendarWithoutContext=v;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),s=require("prop-types"),F=require("@progress/kendo-react-intl"),D=require("@progress/kendo-react-common"),o=require("@progress/kendo-date-math"),S=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-svg-icons"),I=require("../models/NavigationAction.js"),M=require("../models/CalendarViewEnum.js"),L=require("../models/SelectionRange.js"),K=require("./Header.js"),r=require("../../utils.js"),V=require("../../messages/index.js"),z=require("../services/BusViewService.js"),H=require("../services/NavigationService.js"),E=require("./HorizontalViewList.js"),Y=require("./TodayCommand.js");function j(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const a in c)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(c,a);Object.defineProperty(i,a,d.get?d:{enumerable:!0,get:()=>c[a]})}}return i.default=c,Object.freeze(i)}const g=j(_),A=(c=v.defaultProps.min,i=v.defaultProps.max,a)=>a instanceof Date&&!Array.isArray(a)&&r.isInRange(o.getDate(a),c,i)?o.getDate(a):null,T=(c=v.defaultProps.min,i=v.defaultProps.max,a)=>Array.isArray(a)?a.filter(d=>r.isInRange(d,c,i)).map(d=>o.getDate(d)):null,N=c=>typeof c=="object"&&!(c instanceof Date)&&c!==null&&!Array.isArray(c)?c:L.EMPTY_SELECTIONRANGE,P=(c,i,a)=>c||i&&i[0]||a&&a.start,U=(c,i)=>c.start===null&&i===null?"start":c.end===null?"end":"start",p=class p extends g.Component{constructor(i){super(i),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=L.EMPTY_SELECTIONRANGE,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=e=>({start:e,end:null}),this.rangeWithFocused=(e,t)=>({start:e.start,end:e.end===null&&e.start!==null&&this.isActive?t:e.end}),this.generateRange=(e,t)=>{const{end:h,start:l}=t,u=t.start!==null&&e.getTime()<=t.start.getTime();return!this.props.allowReverse&&u?{start:e,end:this.selectedRange.start}:this.activeRange!=="end"?{start:e,end:h}:{start:l||this.selectedDate,end:e}},this.canNavigate=e=>{if(!this.service)return!1;const t=this.service.move(this.focusedDate,e);return this.min<=t&&t<=this.max||this.service.isInSameView(t,this.min)||this.service.isInSameView(t,this.max)},this.navigate=(e,t)=>{this.calculateFocusFromValue=!1;const h=this.move(e,t);this.setState({navigateDate:h,focusedDate:h})},this.move=(e,t)=>this.clampDate(this.service.move(t,e)),this.clampDate=e=>r.dateInRange(e,this.min,this.max),this.shouldAutoCorrect=(e,t)=>{const{end:h,start:l}=t;return this.activeRange!=="end"?h!==null&&e>h:l!==null&&e<l},this.handleCellEnter=e=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:e}))},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleTodayClick=e=>{this.todayIsInRange&&this.handleDateChange(e)},this.handlePrevButtonClick=()=>{const e=I.Action.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(e,this.move(e,this.focusedDate));else{const t=this.isInMonth(this.focusedDate,this.dates[1])?this.move(e,this.focusedDate):this.focusedDate;this.navigate(e,t)}},this.handleNextButtonClick=()=>{this.navigate(I.Action.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:h,ctrlKey:l,metaKey:u}=e;if(h===84){const n=r.getToday();this.calculateFocusFromValue=!1,this.setState({focusedDate:n,navigateDate:n})}if((l||u)&&(h===D.Keys.left&&this.handlePrevButtonClick(),h===D.Keys.right&&this.handleNextButtonClick()),h===D.Keys.enter){const n={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(n)}else{const n=r.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(o.isEqualDate(this.focusedDate,n))return;this.dates&&this.service&&!this.service.isInArray(n,this.dates)&&this.setState({navigateDate:n}),this.calculateFocusFromValue=!1,this.setState({focusedDate:n})}e.preventDefault()},this.handleViewChange=({view:e})=>{this.calculateFocusFromValue=!1,this.setState(t=>({activeView:e,navigateDate:t.focusedDate}))},this.handleWeekSelection=(e,t,h)=>{if(this.props.mode==="single")return;const l=0,u=6,n=t===l?e:o.addDays(e,-t),m=t===u?e:o.addDays(e,u-t);let f=null;if(this.props.mode==="multiple"){f=[];for(let R=l;R<=u;R++)f.push(o.addDays(n,R));this.setState({value:f,focusedDate:e})}this.props.mode==="range"&&(f={start:n,end:m},this.setState({value:f,focusedDate:e}));const{onChange:x}=this.props;if(x){const R={syntheticEvent:h,nativeEvent:h.nativeEvent,value:f,target:this};x.call(void 0,R)}},this.handleDateChange=e=>{const t=o.cloneDate(e.value),h=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(h)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:t,navigateDate:t});return}this.calculateFocusFromValue=!0;let l;switch(this.props.mode){case"single":l=o.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const n=this.selectedMultiple.slice();let m=-1;n.forEach((f,x)=>{o.isEqualDate(f,e.value)&&(m=x)}),m!==-1?n.splice(m,1):n.push(o.cloneDate(e.value)),l=n.slice()}else this.selectedDate?l=[o.cloneDate(this.selectedDate),o.cloneDate(e.value)]:l=[o.cloneDate(e.value)];break;case"range":{l=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(e.value):this.generateRange(e.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:l=o.cloneDate(e.value);break}this.valueDuringOnChange=l,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:l,focusedDate:t}),this.valueDuringOnChange=l;const{onChange:u}=this.props;if(u){const n={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l,target:this};u.call(void 0,n)}this.valueDuringOnChange=void 0};const a=i.value!==void 0?i.value:i.defaultValue||p.defaultProps.defaultValue,d=A(this.min,this.max,a),w=T(this.min,this.max,a),C=N(a),O=P(d,w,C),b=r.viewInRange(M.CalendarViewEnum[i.defaultActiveView],this.bottomView,this.topView),y=r.dateInRange(i.focusedDate||O||r.getToday(),this.min,this.max);this.state={value:a,activeView:b,focusedDate:y,navigateDate:y},this.activeRangeEnd=U(C,d),this.bus=new z.BusViewService(this.handleViewChange),this.navigation=new H.NavigationService(this.bus),this.calculateFocusFromValue=!1,this.lastView=b,this.lastViewsCount=this.props.views||E.HorizontalViewList.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return o.cloneDate(this._focusedDate)}get min(){return o.getDate(this.props.min!==void 0?this.props.min:p.defaultProps.min)}get max(){return o.getDate(this.props.max!==void 0?this.props.max:p.defaultProps.max)}get bottomView(){return M.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:p.defaultProps.bottomView]}get topView(){return M.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:p.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return r.isInRange(r.getToday(),o.getDate(this.min),o.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const i=A(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&i&&this.selectedDate.getTime()&&i.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||E.HorizontalViewList.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=F.provideIntlService(this),this.localization=F.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const i=r.viewInRange(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(i,this.intl),this.selectedDate=A(this.min,this.max,this.value),this.selectedMultiple=T(this.min,this.max,this.value),this.selectedRange=N(this.value);const a=P(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=r.dateInRange(this.calculateFocusFromValue&&a!==null?a:this.state.focusedDate,this.min,this.max);const d=D.classNames("k-calendar k-calendar-range k-calendar-md",{"k-disabled":this.props.disabled},this.props.className),w=this.rangeWithFocused(this.selectedRange,this.focusedDate),C=this.localization.toLanguageString(V.prevView,V.messages[V.prevView]),O=this.localization.toLanguageString(V.nextView,V.messages[V.nextView]),b=!this.canNavigate(I.Action.PrevView),y=!this.canNavigate(I.Action.NextView),e={"aria-disabled":b},t={"aria-disabled":y},h=this.lastView!==i,l=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),u=this.lastViewsCount!==this.props.views;(!l||h||u)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||E.HorizontalViewList.defaultProps.views));const n=o.cloneDate(this.dates&&this.dates[0]?this.dates[0]:r.getToday());return g.createElement("div",{ref:m=>{this._element=m},className:d,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},g.createElement(K.Header,{key:`.kendo.calendar.header.${n.getTime()}`,activeView:i,currentDate:n,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:g.createElement(g.Fragment,null,g.createElement(S.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?k.chevronRightIcon:k.chevronLeftIcon,fillMode:"flat",title:C,disabled:b,onClick:this.handlePrevButtonClick,...e}),g.createElement(Y.TodayCommand,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),g.createElement(S.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?k.chevronLeftIcon:k.chevronRightIcon,fillMode:"flat",title:O,disabled:y,onClick:this.handleNextButtonClick,...t}))}),g.createElement(E.HorizontalViewList,{ref:m=>{this.calendarViewList=m},dates:this.dates,activeView:i,focusedDate:this.focusedDate,weekDaysFormat:this.props.weekDaysFormat,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:w,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,onWeekSelect:this.handleWeekSelection,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}))}isInMonth(i,a){return!!a&&o.firstDayOfMonth(a)<=i&&i<=o.lastDayOfMonth(a)}};p.displayName="MultiViewCalendar",p.propTypes={activeRangeEnd:s.oneOf(["start","end"]),allowReverse:s.bool,bottomView:s.oneOf(["month","year","decade","century"]),className:s.string,defaultActiveView:s.oneOf(["month","year","decade","century"]),defaultValue:s.oneOfType([r.nullable(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:r.nullable(s.instanceOf(Date)),end:r.nullable(s.instanceOf(Date))})]),disabled:s.bool,focusedDate:s.instanceOf(Date),id:s.string,weekDaysFormat:s.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,max:s.instanceOf(Date),min:s.instanceOf(Date),mode:s.oneOf(["single","multiple","range"]),onBlur:s.func,onChange:s.func,onFocus:s.func,tabIndex:s.number,topView:s.oneOf(["month","year","decade","century"]),value:s.oneOfType([r.nullable(s.instanceOf(Date)),s.arrayOf(s.instanceOf(Date)),s.shape({start:r.nullable(s.instanceOf(Date).isRequired),end:r.nullable(s.instanceOf(Date).isRequired)})]),views:(i,a,d)=>{const w=i[a];return w!==void 0&&w<1?new Error(`Invalid prop '${a}' supplied to'${d}'. The '${a}' property cannot be less than 1'`):null},weekNumber:s.bool,showOtherMonthDays:s.bool,dir:s.string},p.defaultProps={disabled:!1,min:r.MIN_DATE,max:r.MAX_DATE,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let v=p;const B=D.createPropsContext(),q=D.withIdHOC(D.withPropsContext(B,v));q.displayName="KendoReactMultiViewCalendar";F.registerForIntl(v);F.registerForLocalization(v);exports.MultiViewCalendar=q;exports.MultiViewCalendarPropsContext=B;exports.MultiViewCalendarWithoutContext=v;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as p from "react";
|
|
10
9
|
import s from "prop-types";
|
|
11
10
|
import { provideIntlService as j, provideLocalizationService as G, registerForIntl as X, registerForLocalization as q } from "@progress/kendo-react-intl";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),r=require("prop-types"),v=require("@progress/kendo-date-math"),T=require("./CalendarNavigationItem.js"),k=require("../../utils.js"),w=require("../../virtualization/Virtualization.js"),c=require("@progress/kendo-react-common");function V(p){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const e in p)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(a,e,n.get?n:{enumerable:!0,get:()=>p[e]})}}return a.default=p,Object.freeze(a)}const l=V(O),C=30,d=class d extends l.Component{constructor(a){super(a),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=t=>{if(this.virtualization=t,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const i=k.dateInRange(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(i,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildNavigationItem=t=>{const i=this.props.service.navigationTitle(t),s=this.props.service.isRangeStart(t),o=`kendo-react-calendar-nav-item-${t.getTime()}`,h={text:i,value:t,isRangeStart:s,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?l.createElement(this.props.navigationItem,{...h,key:o},i):l.createElement(T.CalendarNavigationItem,{...h,key:o},i)},this.calculateHeights=()=>{const t=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(t-this.itemHeight)/2,this.bottomOffset=t-this.itemHeight},this.handleDateChange=(t,i)=>{const{onChange:s}=this.props;if(s&&i){const o={value:v.cloneDate(t),target:this,nativeEvent:i&&i.nativeEvent,syntheticEvent:i};s.call(void 0,o)}},this.handleScrollAction=({scrollAction:t,pageAction:i})=>{const s=i?i.skip:this.state.skip;if(this.state.skip!==s&&this.setState({skip:s}),this.list&&t){const o=`translateY(${t.offset}px)`;this.list.style.transform=o}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const e=this.props.service.skip(this.props.focusedDate,this.props.min),n=this.props.service.total(this.props.min,this.props.max);this.state={skip:e-this.getTake(e,n)>0?e:0}}get take(){return this.props.take!==void 0?this.props.take:d.defaultProps.take}componentDidUpdate(a,e){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){const{activeView:a,min:e,max:n,service:t,unstyled:i}=this.props;this.calculateHeights();const s=i&&i.uCalendar,o=this.lastView!==a,h=k.dateInRange(this.props.focusedDate,e,n),m=o?t.skip(h,e):this.state.skip,g=t.total(e,n),x=this.getTake(m,g),D=t.addToDate(e,m),b=t.datesList(D,x);(a!==this.lastView||!v.isEqual(h,this.lastFocus))&&(this.indexToScroll=t.skip(h,e));const S=l.createElement(w.Virtualization,{skip:m,take:this.take,total:g,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:u=>!this.virtualization&&this.handleVirtualizationMount(u),tabIndex:this.props.tabIndex,unstyled:i},l.createElement("ul",{ref:u=>{this.list=u},className:c.classNames(c.uCalendar.ul({c:s}))},b.map(u=>this.buildNavigationItem(u))));return l.createElement("div",{className:c.classNames(c.uCalendar.navigation({c:s}))},l.createElement("span",{className:c.classNames(c.uCalendar.navigationHighlight({c:s}))}),this.props.dom.didCalculate?S:null)}getTake(a,e){return Math.min(e-a,this.take)}};d.propTypes={activeView:r.number.isRequired,focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,take:r.number,tabIndex:r.number},d.defaultProps={take:C};let f=d;exports.Navigation=f;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as n from "react";
|
|
10
9
|
import r from "prop-types";
|
|
11
10
|
import { cloneDate as T, isEqual as V } from "@progress/kendo-date-math";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),o=require("prop-types"),p=require("@progress/kendo-react-intl"),l=require("@progress/kendo-react-common"),y=require("@progress/kendo-react-buttons"),u=require("@progress/kendo-date-math"),c=require("../../messages/index.js"),n=require("../../utils.js");function b(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const d=b(f),s=class s extends d.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:n.dateInRange(n.getToday(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:s.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:s.defaultProps.max}get todayIsInRange(){return n.isInRange(n.getToday(),u.getDate(this.min),u.getDate(this.max))}render(){const{disabled:e,tabIndex:t,unstyled:a}=this.props,m=a&&a.uCalendar;this.localization=p.provideLocalizationService(this);const g=this.localization.toLanguageString(c.today,c.messages[c.today]),h=l.classNames(l.uCalendar.today({c:m,disabled:e}));return d.createElement(y.Button,{className:h,onClick:this.handleClick,tabIndex:t,fillMode:"flat",themeColor:"base",role:"link"},g)}};s.propTypes={max:o.instanceOf(Date).isRequired,min:o.instanceOf(Date).isRequired,onClick:o.func,disabled:o.bool},s.defaultProps={min:n.MIN_DATE,max:n.MAX_DATE};let r=s;p.registerForLocalization(r);exports.TodayCommand=r;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as r from "react";
|
|
10
9
|
import e from "prop-types";
|
|
11
10
|
import { provideLocalizationService as h, registerForLocalization as u } from "@progress/kendo-react-intl";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),r=require("prop-types"),k=require("@progress/kendo-date-math"),y=require("@progress/kendo-react-intl"),R=require("./CalendarCell.js"),M=require("./CalendarWeekCell.js"),v=require("../models/CalendarViewEnum.js"),w=require("../../utils.js"),S=require("../services/WeekNamesService.js"),a=require("@progress/kendo-react-common");function V(c){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>c[e]})}}return t.default=c,Object.freeze(t)}const n=V(W),C=(c,t)=>{const e=t;return n.createElement("td",{key:c,role:"gridcell",className:a.classNames(a.uCalendar.td({c:e,isEmpty:!0}))}," ")},h=class h extends n.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(t,e)=>{if(!this.firstDate(t))return C(`week-cell-${e}`);const i=this.firstDate(t),l=this.getWeekNumber(i),o=`kendo-react-calendar-week-cell-${l}`,d={value:l,firstDate:i,weekDays:t,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?n.createElement(this.props.weekCell,{...d,key:o},l):n.createElement(M.CalendarWeekCell,{...d,key:o},l)},this.buildRow=t=>t.map((e,s)=>{if(!e)return C(s);const i={"aria-selected":e.isSelected},l=`kendo-react-calendar-cell-${e.value.getTime()}`,o={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,unstyled:this.props.unstyled,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?n.createElement(this.props.cell,{...o,key:l},e.formattedValue):n.createElement(R.CalendarCell,{...o,key:l},e.formattedValue)}),this.firstDate=t=>{const e=this.firstWeekDateContext(t);return e?e.value:null},this.firstWeekDateContext=t=>{if(!this.weekNumber)return null;let e=0,s=t[e];for(;!s&&e<t.length;)s=t[++e];return s},this.handleClick=(t,e)=>{const{onChange:s}=this.props;if(s&&e){const i={value:k.cloneDate(t),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};s.call(void 0,i)}},this.handleWeekCellClick=(t,e,s)=>{const{onWeekSelect:i}=this.props,l=e.findIndex(o=>o&&o.value===t);i&&s&&i.call(void 0,t,l,s)},this.handleMouseEnter=t=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,k.cloneDate(t))},this.handleMouseLeave=t=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,k.cloneDate(t))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===v.CalendarViewEnum.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===v.CalendarViewEnum.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:h.defaultProps.selectedDate}render(){const{service:t,weekDaysFormat:e,cellUID:s,focusedDate:i,bus:l,activeView:o,selectionRange:d,unstyled:D}=this.props,u=D&&D.uCalendar;this.intl=y.provideIntlService(this),this.weekService=new S.WeekNamesService(this.intl);const g=this.weekService.getWeekNames(this.weekNumber,e),N=t.rowLength(this.weekNumber),b=t.title(this.props.viewDate),E=w.getToday(),O=w.setTime(this.props.viewDate,E),q=t.data({cellUID:s,min:this.min,max:this.max,focusedDate:i,isActiveView:!l.canMoveDown(o),selectedDate:this.selectedDate,selectionRange:d,viewDate:O});return n.createElement(n.Fragment,null,this.isMonthView&&this.isHorizontal&&n.createElement("thead",{role:"rowgroup",className:a.classNames(a.uCalendar.thead({c:u}))},n.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u}))},g.map((m,p)=>n.createElement("th",{key:p,className:a.classNames(a.uCalendar.th({c:u}))},m)))),n.createElement("tbody",{role:"rowgroup",className:a.classNames(a.uCalendar.tbody({c:u}))},!this.isHorizontal&&n.createElement("tr",{role:"presentation",className:a.classNames(a.uCalendar.tr({c:u}))},n.createElement("th",{scope:"col",colSpan:N,className:a.classNames(a.uCalendar.caption({c:u}))},b)),q.map((m,p)=>n.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u})),key:p},this.weekNumber&&this.buildWeekNumber(m,p),this.buildRow(m)))))}getWeekNumber(t){return!this.weekNumber||!this.intl?null:k.weekInYear(t,this.intl.firstDay())}};h.propTypes={activeRangeEnd:r.oneOf(["start","end",null]),activeView:r.number.isRequired,cellUID:r.string.isRequired,direction:r.oneOf(["horizontal","vertical"]),focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,selectedDate:r.oneOfType([r.instanceOf(Date),r.arrayOf(r.instanceOf(Date))]),showWeekNumbers:r.bool,showOtherMonthDays:r.bool,viewDate:r.instanceOf(Date).isRequired},h.defaultProps={direction:"vertical",selectedDate:w.getToday(),showWeekNumbers:!1};let f=h;y.registerForIntl(f);exports.View=f;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as i from "react";
|
|
10
9
|
import s from "prop-types";
|
|
11
10
|
import { cloneDate as k, weekInYear as R } from "@progress/kendo-date-math";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),m=require("@progress/kendo-date-math"),C=require("@progress/kendo-react-intl"),N=require("../../virtualization/Virtualization.js"),O=require("./View.js"),q=require("./Header.js"),H=require("../services/WeekNamesService.js"),f=require("../../utils.js"),p=require("../models/CalendarViewEnum.js"),R=require("./TodayCommand.js");function z(d){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(r,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return r.default=d,Object.freeze(r)}const a=z(T),_=5,u=class u extends a.Component{constructor(r){super(r),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.weekService=null,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const t=f.dateInRange(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildMonthView=(e,t)=>{const{unstyled:s}=this.props,i=s&&s.uCalendar;return a.createElement("table",{key:"calendar-view-list-weekdays",className:n.classNames(n.uCalendar.table({c:i,weekdays:!0})),role:"grid",tabIndex:this.props.tabIndex},a.createElement("colgroup",null,e.map((h,l)=>a.createElement("col",{key:l}))),a.createElement("thead",{className:n.classNames(n.uCalendar.thead({c:i}))},a.createElement("tr",{className:n.classNames(n.uCalendar.tr({c:i}))},t.map((h,l)=>a.createElement("th",{key:l,className:n.classNames(n.uCalendar.th({c:i}))},h)))))},this.buildDates=(e,t)=>{const s=this.props.cellUID,{unstyled:i}=this.props,h=i&&i.uCalendar;return a.createElement("table",{className:n.classNames(n.uCalendar.table({c:h})),ref:l=>this.table=l,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":s+this.props.focusedDate.getTime()},a.createElement("colgroup",null,e.map((l,c)=>a.createElement("col",{key:c}))),t.map(l=>a.createElement(O.View,{ref:c=>{this.calendarView||(this.calendarView=c)},key:l.getTime(),activeView:this.props.activeView,viewDate:l,min:this.props.min,max:this.props.max,cellUID:s,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:i})))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===p.CalendarViewEnum.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:s})=>{const i=s?s.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==i)&&this.setState({index:e,skip:i}),this.table&&t){const h=`translateY(${t.offset}px)`;this.table.style.transform=h}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:s}=this.props;if(s){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:m.cloneDate(e.value),target:this,isTodayClick:t};s.call(void 0,i)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){return this.intl=C.provideIntlService(this),this.weekService=new H.WeekNamesService(this.intl),this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat)}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===p.CalendarViewEnum.month)}get take(){return this.props.take!==void 0?this.props.take:u.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return f.isInRange(f.getToday(),m.getDate(this.props.min),m.getDate(this.props.max))}componentDidUpdate(r,e){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){const{activeView:r,min:e,max:t,service:s,unstyled:i}=this.props,h=i&&i.uCalendar;this.calculateHeights();const l=this.lastView!==r,c=f.dateInRange(this.props.focusedDate,e,t),w=l?s.skip(c,e):this.state.skip,b=s.total(e,t),y=this.getTake(w,b),x=s.addToDate(e,w),S=s.addToDate(e,this.state.index),g=new Array(s.rowLength(this.weekNumber)).fill(""),D=r!==this.lastView;this.animateToIndex=!D,(D||!m.isEqualDate(this.lastFocus,c)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(c,this.props.min)),this.lastFocus=c;const V=n.classNames(n.uCalendar.view({c:h,month:r===p.CalendarViewEnum.month,year:r===p.CalendarViewEnum.year,decade:r===p.CalendarViewEnum.decade,century:r===p.CalendarViewEnum.century})),E=this.buildDates(g,s.datesList(x,y)),I=a.createElement(a.Fragment,null,a.createElement(q.Header,{key:"calendar-view-list-header",currentDate:S,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,header:this.props.header,unstyled:i,commands:a.createElement(R.TodayCommand,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex,unstyled:i})}),this.props.activeView===p.CalendarViewEnum.month&&this.buildMonthView(g,this.weekNames),a.createElement(N.Virtualization,{key:"calendar-view-list-content",skip:w,take:this.take,total:b,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:k=>!this.virtualization&&this.handleVirtualizationMount(k),children:E,tabIndex:this.props.tabIndex,unstyled:i}));return a.createElement("div",{ref:k=>{this._element=k},className:V},this.props.dom.didCalculate?I:null)}};u.propTypes={activeView:o.number.isRequired,bottomOffset:o.number,cellUID:o.string.isRequired,focusedDate:o.instanceOf(Date).isRequired,max:o.instanceOf(Date).isRequired,min:o.instanceOf(Date).isRequired,onChange:o.func,showWeekNumbers:o.bool,smoothScroll:o.bool,take:o.number,value:o.instanceOf(Date),viewHeight:o.number,viewOffset:o.number,weekDaysFormat:o.oneOf(["short","abbreviated","narrow"]),tabIndex:o.number},u.defaultProps={take:_,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let v=u;C.registerForIntl(v);exports.ViewList=v;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
import * as a from "react";
|
|
10
9
|
import o from "prop-types";
|
|
11
10
|
import { classNames as p, uCalendar as m } from "@progress/kendo-react-common";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var c=(t=>(t[t.month=0]="month",t[t.year=1]="year",t[t.decade=2]="decade",t[t.century=3]="century",t))(c||{});exports.CalendarViewEnum=c;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
var c = /* @__PURE__ */ ((t) => (t[t.month = 0] = "month", t[t.year = 1] = "year", t[t.decade = 2] = "decade", t[t.century = 3] = "century", t))(c || {});
|
|
10
9
|
export {
|
|
11
10
|
c as CalendarViewEnum
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var w=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.PrevView=4]="PrevView",e[e.NextView=5]="NextView",e[e.FirstInView=6]="FirstInView",e[e.LastInView=7]="LastInView",e[e.LowerView=8]="LowerView",e[e.UpperView=9]="UpperView",e))(w||{});exports.Action=w;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
var w = /* @__PURE__ */ ((e) => (e[e.Left = 0] = "Left", e[e.Right = 1] = "Right", e[e.Up = 2] = "Up", e[e.Down = 3] = "Down", e[e.PrevView = 4] = "PrevView", e[e.NextView = 5] = "NextView", e[e.FirstInView = 6] = "FirstInView", e[e.LastInView = 7] = "LastInView", e[e.LowerView = 8] = "LowerView", e[e.UpperView = 9] = "UpperView", e))(w || {});
|
|
10
9
|
export {
|
|
11
10
|
w as Action
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={start:null,end:null};exports.EMPTY_SELECTIONRANGE=t;
|
|
@@ -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
|
-
"use client";
|
|
9
8
|
const l = { start: null, end: null };
|
|
10
9
|
export {
|
|
11
10
|
l as EMPTY_SELECTIONRANGE
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./CenturyViewService.js"),c=require("./DecadeViewService.js"),s=require("./MonthViewService.js"),u=require("./YearViewService.js"),i=require("../models/CalendarViewEnum.js"),m={[i.CalendarViewEnum.month]:s.MonthViewService,[i.CalendarViewEnum.year]:u.YearViewService,[i.CalendarViewEnum.decade]:c.DecadeViewService,[i.CalendarViewEnum.century]:a.CenturyViewService},h=(r,e)=>{const t=i.CalendarViewEnum[i.CalendarViewEnum[r+e]];return t!==void 0?t:r};class w{constructor(e){this.bottom=i.CalendarViewEnum.month,this.top=i.CalendarViewEnum.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new m[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,o){const n=this.clamp(h(e,t));n!==e&&this.onViewChanged({view:n},o)}}exports.BusViewService=w;
|