@progress/kendo-react-dateinputs 8.3.0-develop.5 → 8.3.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 +2 -2
- package/calendar/components/Calendar.mjs +123 -115
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +37 -39
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +6 -12
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +15 -19
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +10 -15
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +30 -40
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +52 -49
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +21 -25
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +48 -42
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +99 -94
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +25 -31
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +113 -110
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +22 -23
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +9 -9
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +5 -5
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +95 -90
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +83 -81
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +38 -28
- package/index.d.ts +38 -28
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimeList.js +3 -3
- package/timepicker/TimeList.mjs +83 -81
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +74 -68
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +112 -107
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +66 -59
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +49 -48
|
@@ -5,8 +5,8 @@
|
|
|
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
|
|
8
|
+
"use client";"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 s=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(s,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return s.default=c,Object.freeze(s)}const g=K(M),b=c=>c?c.virtualization:null,y=(c=v.defaultProps.min,s=v.defaultProps.max,t,e)=>e!==void 0?e!==null&&l.isInRange(o.getDate(e),c,s)?e:null:t!==null&&l.isInRange(o.getDate(t),c,s)?t:null,h=class h extends g.Component{constructor(s){super(s),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 i=o.cloneDate(e.value);this.setState({focusedDate:i})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const i=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:i,focusedDate:n}),this.valueDuringOnChange=i;const{onChange:p}=this.props;if(p){const u={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,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:i}=this.props;i&&i.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:i}=this.props;i&&i.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[s.defaultActiveView],this.bottomView,this.topView),focusedDate:l.dateInRange(s.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(){Promise.resolve().then(()=>{r.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new R.ScrollSyncService(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,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:s,unstyled:t,bottomView:e,topView:i,disabled:n,weekNumber:f,mobileMode:p,className:u}=this.props;s&&s(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[i!==void 0?i: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:(s,t,e)=>{const i=s[t],n=s.bottomView;return i&&n&&d.CalendarViewEnum[i]<d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
|
|
9
9
|
${t} can not be smaller than bottomView.
|
|
10
10
|
`):null},bottomView:(s,t,e)=>{const i=s[t],n=s.topView;return i&&n&&d.CalendarViewEnum[i]>d.CalendarViewEnum[n]?new Error(`Invalid prop + ${t} suplied to ${e}.
|
|
11
11
|
${t} can not be bigger than topView.
|
|
12
|
-
`):null}},h.defaultProps={disabled:!1,min:l.MIN_DATE,max:l.MAX_DATE,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let
|
|
12
|
+
`):null}},h.defaultProps={disabled:!1,min:l.MIN_DATE,max:l.MAX_DATE,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let v=h;const C=r.createPropsContext(),E=r.withIdHOC(r.withPropsContext(C,r.withUnstyledHOC(v)));E.displayName="KendoReactCalendar";S.registerForIntl(v);exports.Calendar=E;exports.CalendarPropsContext=C;exports.CalendarWithoutContext=v;
|
|
@@ -6,97 +6,97 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as f from "react";
|
|
10
10
|
import s from "prop-types";
|
|
11
|
-
import { Keys as
|
|
12
|
-
import { cloneDate as
|
|
13
|
-
import { provideIntlService as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
import { ViewList as
|
|
16
|
-
import { Navigation as
|
|
17
|
-
import { CalendarViewEnum as
|
|
18
|
-
import { getToday as
|
|
19
|
-
import { BusViewService as
|
|
20
|
-
import { DOMService as
|
|
21
|
-
import { NavigationService as
|
|
22
|
-
import { ScrollSyncService as
|
|
23
|
-
const
|
|
24
|
-
constructor(
|
|
25
|
-
super(
|
|
11
|
+
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";
|
|
12
|
+
import { cloneDate as D, isEqualDate as y, getDate as c } from "@progress/kendo-date-math";
|
|
13
|
+
import { provideIntlService as R, registerForIntl as _ } from "@progress/kendo-react-intl";
|
|
14
|
+
import { packageMetadata as Y } from "../../package-metadata.mjs";
|
|
15
|
+
import { ViewList as z } from "./ViewList.mjs";
|
|
16
|
+
import { Navigation as H } from "./Navigation.mjs";
|
|
17
|
+
import { CalendarViewEnum as r } from "../models/CalendarViewEnum.mjs";
|
|
18
|
+
import { getToday as x, dateInRange as V, viewInRange as I, MIN_DATE as q, MAX_DATE as X, isInRange as N } from "../../utils.mjs";
|
|
19
|
+
import { BusViewService as j } from "../services/BusViewService.mjs";
|
|
20
|
+
import { DOMService as G } from "../services/DOMService.mjs";
|
|
21
|
+
import { NavigationService as J } from "../services/NavigationService.mjs";
|
|
22
|
+
import { ScrollSyncService as Q } from "../services/ScrollSyncService.mjs";
|
|
23
|
+
const S = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, a = d.defaultProps.max, e, t) => t !== void 0 ? t !== null && N(c(t), u, a) ? t : null : e !== null && N(c(e), u, a) ? e : null, n = class n extends f.Component {
|
|
24
|
+
constructor(a) {
|
|
25
|
+
super(a), 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 = () => {
|
|
26
26
|
this._element && this._element.focus();
|
|
27
27
|
}, this.shouldScroll = () => this.didNavigationChange, this.handleScroll = (t) => {
|
|
28
28
|
this.scrollSyncService && this.scrollSyncService.sync(
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
S(this.Navigation),
|
|
30
|
+
S(this.calendarViewList),
|
|
31
31
|
t
|
|
32
32
|
);
|
|
33
33
|
}, this.handleNavigationChange = (t) => {
|
|
34
34
|
if (this.props.disabled)
|
|
35
35
|
return;
|
|
36
36
|
this.didNavigationChange = !0;
|
|
37
|
-
const
|
|
38
|
-
this.setState({ focusedDate:
|
|
37
|
+
const i = D(t.value);
|
|
38
|
+
this.setState({ focusedDate: i });
|
|
39
39
|
}, this.handleViewChange = ({ view: t }) => {
|
|
40
40
|
this.scrollSyncService && this.scrollSyncService.configure(t), this.setState({ activeView: t });
|
|
41
41
|
}, this.handleDateChange = (t) => {
|
|
42
|
-
const
|
|
42
|
+
const i = D(t.value), o = D(t.value), v = this.bus.canMoveDown(this.state.activeView);
|
|
43
43
|
if (this.props.disabled)
|
|
44
44
|
return;
|
|
45
|
-
if (
|
|
45
|
+
if (v)
|
|
46
46
|
if (t.isTodayClick)
|
|
47
47
|
this.bus.moveToBottom(this.state.activeView);
|
|
48
48
|
else {
|
|
49
|
-
this.bus.moveDown(this.state.activeView, t.syntheticEvent), this.setState({ focusedDate:
|
|
49
|
+
this.bus.moveDown(this.state.activeView, t.syntheticEvent), this.setState({ focusedDate: o });
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
this.setState({ value:
|
|
53
|
-
const { onChange:
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
52
|
+
this.setState({ value: i, focusedDate: o }), this.valueDuringOnChange = i;
|
|
53
|
+
const { onChange: h } = this.props;
|
|
54
|
+
if (h) {
|
|
55
|
+
const l = {
|
|
56
56
|
syntheticEvent: t.syntheticEvent,
|
|
57
57
|
nativeEvent: t.nativeEvent,
|
|
58
|
-
value:
|
|
58
|
+
value: i,
|
|
59
59
|
target: this
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
h.call(void 0, l);
|
|
62
62
|
}
|
|
63
63
|
this.valueDuringOnChange = void 0;
|
|
64
64
|
}, this.handleFocus = (t) => {
|
|
65
65
|
if (this.isActive = !0, !this.calendarViewList)
|
|
66
66
|
return;
|
|
67
67
|
this.calendarViewList.focusActiveDate();
|
|
68
|
-
const { onFocus:
|
|
69
|
-
|
|
68
|
+
const { onFocus: i } = this.props;
|
|
69
|
+
i && i.call(void 0, t);
|
|
70
70
|
}, this.handleBlur = (t) => {
|
|
71
71
|
if (this.isActive = !1, !this.calendarViewList)
|
|
72
72
|
return;
|
|
73
73
|
this.calendarViewList.blurActiveDate();
|
|
74
|
-
const { onBlur:
|
|
75
|
-
|
|
74
|
+
const { onBlur: i } = this.props;
|
|
75
|
+
i && i.call(void 0, t);
|
|
76
76
|
}, this.handleKeyDown = (t) => {
|
|
77
|
-
const { keyCode:
|
|
77
|
+
const { keyCode: o, ctrlKey: v, metaKey: h } = t;
|
|
78
78
|
if (!(!this.focusedDate || !this.service)) {
|
|
79
|
-
if (
|
|
79
|
+
if (o === 84 && this.setState({ focusedDate: x() }), (v || h) && (o === g.left || o === g.right)) {
|
|
80
80
|
if (this.props.disabled)
|
|
81
81
|
return;
|
|
82
82
|
this.didNavigationChange = !0, this.focusedDate.getDate() === 31 && this.focusedDate.setDate(30);
|
|
83
|
-
const
|
|
84
|
-
this.setState({ focusedDate:
|
|
83
|
+
const l = o === g.left ? this.focusedDate.getMonth() - 1 : this.focusedDate.getMonth() + 1, p = new Date(this.focusedDate.setMonth(l)), b = D(p);
|
|
84
|
+
this.setState({ focusedDate: b });
|
|
85
85
|
}
|
|
86
|
-
if (
|
|
87
|
-
if (this.value !== null &&
|
|
88
|
-
const
|
|
89
|
-
|
|
86
|
+
if (o === g.enter) {
|
|
87
|
+
if (this.value !== null && y(this.focusedDate, this.value)) {
|
|
88
|
+
const p = V(this.focusedDate, this.min, this.max);
|
|
89
|
+
S(this.calendarViewList).scrollToIndex(this.service.skip(p, this.min));
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const l = {
|
|
92
92
|
syntheticEvent: t,
|
|
93
93
|
nativeEvent: t.nativeEvent,
|
|
94
94
|
value: this.focusedDate,
|
|
95
95
|
target: this
|
|
96
96
|
};
|
|
97
|
-
this.handleDateChange(
|
|
97
|
+
this.handleDateChange(l);
|
|
98
98
|
} else {
|
|
99
|
-
const
|
|
99
|
+
const l = V(
|
|
100
100
|
this.navigation.move(
|
|
101
101
|
this.focusedDate,
|
|
102
102
|
this.navigation.action(t),
|
|
@@ -107,9 +107,9 @@ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d
|
|
|
107
107
|
this.min,
|
|
108
108
|
this.max
|
|
109
109
|
);
|
|
110
|
-
if (
|
|
110
|
+
if (y(this.focusedDate, l))
|
|
111
111
|
return;
|
|
112
|
-
this.setState({ focusedDate:
|
|
112
|
+
this.setState({ focusedDate: l });
|
|
113
113
|
}
|
|
114
114
|
t.preventDefault();
|
|
115
115
|
}
|
|
@@ -117,26 +117,26 @@ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d
|
|
|
117
117
|
t.preventDefault();
|
|
118
118
|
}, this.handleClick = (t) => {
|
|
119
119
|
this._element && this._element.focus({ preventScroll: !0 });
|
|
120
|
-
},
|
|
121
|
-
const
|
|
120
|
+
}, L(Y);
|
|
121
|
+
const e = k(
|
|
122
122
|
this.min,
|
|
123
123
|
this.max,
|
|
124
|
-
this.props.defaultValue ||
|
|
124
|
+
this.props.defaultValue || n.defaultProps.defaultValue,
|
|
125
125
|
this.props.value
|
|
126
126
|
);
|
|
127
127
|
this.state = {
|
|
128
|
-
value:
|
|
129
|
-
activeView:
|
|
130
|
-
|
|
128
|
+
value: e,
|
|
129
|
+
activeView: I(
|
|
130
|
+
r[a.defaultActiveView],
|
|
131
131
|
this.bottomView,
|
|
132
132
|
this.topView
|
|
133
133
|
),
|
|
134
|
-
focusedDate:
|
|
135
|
-
|
|
134
|
+
focusedDate: V(
|
|
135
|
+
a.focusedDate || e || x(),
|
|
136
136
|
this.min,
|
|
137
137
|
this.max
|
|
138
138
|
)
|
|
139
|
-
}, this.dom = new
|
|
139
|
+
}, this.dom = new G(), this.bus = new j(this.handleViewChange), this.navigation = new J(this.bus), this.oldValue = e;
|
|
140
140
|
}
|
|
141
141
|
get cellUID() {
|
|
142
142
|
return this.props.id + "-cell-uid";
|
|
@@ -157,60 +157,61 @@ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d
|
|
|
157
157
|
return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
158
158
|
}
|
|
159
159
|
get min() {
|
|
160
|
-
return c(this.props.min !== void 0 ? this.props.min :
|
|
160
|
+
return c(this.props.min !== void 0 ? this.props.min : n.defaultProps.min);
|
|
161
161
|
}
|
|
162
162
|
get max() {
|
|
163
|
-
return c(this.props.max !== void 0 ? this.props.max :
|
|
163
|
+
return c(this.props.max !== void 0 ? this.props.max : n.defaultProps.max);
|
|
164
164
|
}
|
|
165
165
|
get bottomView() {
|
|
166
|
-
return
|
|
166
|
+
return r[this.props.bottomView !== void 0 ? this.props.bottomView : n.defaultProps.bottomView];
|
|
167
167
|
}
|
|
168
168
|
get topView() {
|
|
169
|
-
return
|
|
169
|
+
return r[this.props.topView !== void 0 ? this.props.topView : n.defaultProps.topView];
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* @hidden
|
|
173
173
|
*/
|
|
174
174
|
componentDidMount() {
|
|
175
175
|
Promise.resolve().then(() => {
|
|
176
|
-
|
|
176
|
+
C(), this._element && (this.dom.calculateHeights(this._element), this.scrollSyncService = new Q(this.dom), this.scrollSyncService.configure(this.state.activeView), this.forceUpdate());
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
180
|
* @hidden
|
|
181
181
|
*/
|
|
182
|
-
componentDidUpdate(
|
|
183
|
-
|
|
182
|
+
componentDidUpdate(a, e) {
|
|
183
|
+
C(), e.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);
|
|
184
184
|
}
|
|
185
185
|
/**
|
|
186
186
|
* @hidden
|
|
187
187
|
*/
|
|
188
188
|
render() {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
const { _ref: a, unstyled: e, bottomView: t, topView: i, disabled: o, weekNumber: v, mobileMode: h, className: l } = this.props;
|
|
190
|
+
a && a(this);
|
|
191
|
+
const p = e && e.uCalendar, b = this.value !== null && this.oldValue !== null ? !y(this.value, this.oldValue) : this.value !== this.oldValue, E = I(
|
|
191
192
|
this.state.activeView,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
),
|
|
195
|
-
this.focusedDate = c(
|
|
196
|
-
|
|
193
|
+
r[t !== void 0 ? t : n.defaultProps.bottomView],
|
|
194
|
+
r[i !== void 0 ? i : n.defaultProps.topView]
|
|
195
|
+
), w = k(this.min, this.max, this.value, this.value), O = w ? c(w) : null;
|
|
196
|
+
this.focusedDate = c(V(
|
|
197
|
+
b && w !== null ? w : this.state.focusedDate,
|
|
197
198
|
this.min,
|
|
198
199
|
this.max
|
|
199
|
-
)), this.intl =
|
|
200
|
-
const { smoothScroll:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
),
|
|
209
|
-
|
|
200
|
+
)), this.intl = R(this), this.bus.configure(this.bottomView, this.topView), this.service = this.bus.service(E, this.intl);
|
|
201
|
+
const { smoothScroll: P = Number.parseFloat(f.version) < 18 } = this.props, A = B(
|
|
202
|
+
T.wrapper({
|
|
203
|
+
c: p,
|
|
204
|
+
disabled: o,
|
|
205
|
+
weekNumber: v,
|
|
206
|
+
mobileMode: h
|
|
207
|
+
}),
|
|
208
|
+
l
|
|
209
|
+
), M = [this.props.navigation && /* @__PURE__ */ f.createElement(
|
|
210
|
+
H,
|
|
210
211
|
{
|
|
211
212
|
key: 0,
|
|
212
|
-
ref: (
|
|
213
|
-
this.Navigation =
|
|
213
|
+
ref: (m) => {
|
|
214
|
+
this.Navigation = m;
|
|
214
215
|
},
|
|
215
216
|
activeView: this.state.activeView,
|
|
216
217
|
focusedDate: this.focusedDate,
|
|
@@ -221,14 +222,15 @@ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d
|
|
|
221
222
|
service: this.service,
|
|
222
223
|
dom: this.dom,
|
|
223
224
|
navigationItem: this.props.navigationItem,
|
|
224
|
-
tabIndex: this.props.tabIndex
|
|
225
|
+
tabIndex: this.props.tabIndex,
|
|
226
|
+
unstyled: e
|
|
225
227
|
}
|
|
226
|
-
), /* @__PURE__ */
|
|
227
|
-
|
|
228
|
+
), /* @__PURE__ */ f.createElement(
|
|
229
|
+
z,
|
|
228
230
|
{
|
|
229
231
|
key: 1,
|
|
230
|
-
ref: (
|
|
231
|
-
this.calendarViewList =
|
|
232
|
+
ref: (m) => {
|
|
233
|
+
this.calendarViewList = m;
|
|
232
234
|
},
|
|
233
235
|
activeView: this.state.activeView,
|
|
234
236
|
focusedDate: this.focusedDate,
|
|
@@ -241,25 +243,26 @@ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d
|
|
|
241
243
|
cell: this.props.cell,
|
|
242
244
|
weekCell: this.props.weekCell,
|
|
243
245
|
dom: this.dom,
|
|
244
|
-
smoothScroll:
|
|
246
|
+
smoothScroll: P,
|
|
245
247
|
showWeekNumbers: this.props.weekNumber,
|
|
246
248
|
onChange: this.handleDateChange,
|
|
247
|
-
value:
|
|
249
|
+
value: O,
|
|
248
250
|
cellUID: this.cellUID,
|
|
249
251
|
headerTitle: this.props.headerTitle,
|
|
250
252
|
header: this.props.header,
|
|
251
253
|
tabIndex: this.props.tabIndex,
|
|
252
254
|
weekDaysFormat: this.props.weekDaysFormat,
|
|
253
|
-
showOtherMonthDays: this.props.showOtherMonthDays
|
|
255
|
+
showOtherMonthDays: this.props.showOtherMonthDays,
|
|
256
|
+
unstyled: e
|
|
254
257
|
}
|
|
255
258
|
)];
|
|
256
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ f.createElement(
|
|
257
260
|
"div",
|
|
258
261
|
{
|
|
259
|
-
ref: (
|
|
260
|
-
this._element =
|
|
262
|
+
ref: (m) => {
|
|
263
|
+
this._element = m;
|
|
261
264
|
},
|
|
262
|
-
className:
|
|
265
|
+
className: A,
|
|
263
266
|
id: this.props.id || this.id,
|
|
264
267
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
265
268
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
@@ -271,11 +274,11 @@ const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d
|
|
|
271
274
|
onMouseDown: this.handleMouseDown,
|
|
272
275
|
onClick: this.handleClick
|
|
273
276
|
},
|
|
274
|
-
|
|
277
|
+
M
|
|
275
278
|
);
|
|
276
279
|
}
|
|
277
280
|
};
|
|
278
|
-
|
|
281
|
+
n.displayName = "Calendar", n.propTypes = {
|
|
279
282
|
className: s.string,
|
|
280
283
|
defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
|
|
281
284
|
defaultValue: s.instanceOf(Date),
|
|
@@ -295,26 +298,26 @@ r.displayName = "Calendar", r.propTypes = {
|
|
|
295
298
|
tabIndex: s.number,
|
|
296
299
|
value: s.instanceOf(Date),
|
|
297
300
|
weekNumber: s.bool,
|
|
298
|
-
topView: (
|
|
299
|
-
const
|
|
300
|
-
return
|
|
301
|
-
`Invalid prop + ${
|
|
302
|
-
${
|
|
301
|
+
topView: (a, e, t) => {
|
|
302
|
+
const i = a[e], o = a.bottomView;
|
|
303
|
+
return i && o && r[i] < r[o] ? new Error(
|
|
304
|
+
`Invalid prop + ${e} suplied to ${t}.
|
|
305
|
+
${e} can not be smaller than bottomView.
|
|
303
306
|
`
|
|
304
307
|
) : null;
|
|
305
308
|
},
|
|
306
|
-
bottomView: (
|
|
307
|
-
const
|
|
308
|
-
return
|
|
309
|
-
`Invalid prop + ${
|
|
310
|
-
${
|
|
309
|
+
bottomView: (a, e, t) => {
|
|
310
|
+
const i = a[e], o = a.topView;
|
|
311
|
+
return i && o && r[i] > r[o] ? new Error(
|
|
312
|
+
`Invalid prop + ${e} suplied to ${t}.
|
|
313
|
+
${e} can not be bigger than topView.
|
|
311
314
|
`
|
|
312
315
|
) : null;
|
|
313
316
|
}
|
|
314
|
-
},
|
|
317
|
+
}, n.defaultProps = {
|
|
315
318
|
disabled: !1,
|
|
316
|
-
min:
|
|
317
|
-
max:
|
|
319
|
+
min: q,
|
|
320
|
+
max: X,
|
|
318
321
|
weekDaysFormat: "short",
|
|
319
322
|
navigation: !0,
|
|
320
323
|
defaultActiveView: "month",
|
|
@@ -323,12 +326,17 @@ r.displayName = "Calendar", r.propTypes = {
|
|
|
323
326
|
bottomView: "month",
|
|
324
327
|
showOtherMonthDays: !1
|
|
325
328
|
};
|
|
326
|
-
let d =
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
329
|
+
let d = n;
|
|
330
|
+
const Z = F(), W = K(
|
|
331
|
+
U(
|
|
332
|
+
Z,
|
|
333
|
+
$(d)
|
|
334
|
+
)
|
|
335
|
+
);
|
|
336
|
+
W.displayName = "KendoReactCalendar";
|
|
337
|
+
_(d);
|
|
330
338
|
export {
|
|
331
|
-
|
|
332
|
-
|
|
339
|
+
W as Calendar,
|
|
340
|
+
Z as CalendarPropsContext,
|
|
333
341
|
d as CalendarWithoutContext
|
|
334
342
|
};
|
|
@@ -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
|
|
8
|
+
"use client";"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;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
|
-
import { classNames as
|
|
11
|
-
const
|
|
10
|
+
import { classNames as v, uCalendar as E } from "@progress/kendo-react-common";
|
|
11
|
+
const y = (l, e) => {
|
|
12
12
|
const t = Object.getOwnPropertyNames(l), a = Object.getOwnPropertyNames(e);
|
|
13
13
|
if (t.length !== a.length)
|
|
14
14
|
return !1;
|
|
@@ -19,7 +19,7 @@ const N = (l, e) => {
|
|
|
19
19
|
}
|
|
20
20
|
return !0;
|
|
21
21
|
};
|
|
22
|
-
class
|
|
22
|
+
class L extends r.Component {
|
|
23
23
|
constructor() {
|
|
24
24
|
super(...arguments), this.handleClick = (e) => {
|
|
25
25
|
const { onClick: t, value: a } = this.props;
|
|
@@ -41,13 +41,9 @@ class P extends r.Component {
|
|
|
41
41
|
*/
|
|
42
42
|
shouldComponentUpdate(e) {
|
|
43
43
|
const { value: t, ...a } = this.props, { value: n, ...o } = e;
|
|
44
|
-
return !((!(t && n) || t.getTime() === n.getTime()) &&
|
|
44
|
+
return !((!(t && n) || t.getTime() === n.getTime()) && y(a, o));
|
|
45
45
|
}
|
|
46
46
|
/* eslint-disable max-len */
|
|
47
|
-
/**
|
|
48
|
-
* @return
|
|
49
|
-
* Returns a `<td />` element with a `<span className="k-link" />` inside to apply the styles. The text inside is the [`formattedValue`]({% slug api_dateinputs_calendarcellprops %}#toc-formattedvalue) of the `cell`.
|
|
50
|
-
*/
|
|
51
47
|
render() {
|
|
52
48
|
const {
|
|
53
49
|
className: e,
|
|
@@ -57,49 +53,51 @@ class P extends r.Component {
|
|
|
57
53
|
isInRange: o,
|
|
58
54
|
isSelected: d,
|
|
59
55
|
isRangeStart: i,
|
|
60
|
-
isRangeMid:
|
|
56
|
+
isRangeMid: f,
|
|
61
57
|
isRangeEnd: c,
|
|
62
|
-
isRangeSplitStart:
|
|
63
|
-
isRangeSplitEnd:
|
|
64
|
-
isToday:
|
|
65
|
-
isDisabled:
|
|
66
|
-
view:
|
|
67
|
-
value:
|
|
58
|
+
isRangeSplitStart: C,
|
|
59
|
+
isRangeSplitEnd: M,
|
|
60
|
+
isToday: R,
|
|
61
|
+
isDisabled: S,
|
|
62
|
+
view: O,
|
|
63
|
+
value: P,
|
|
68
64
|
isOtherMonth: s,
|
|
69
|
-
showOtherMonthDays:
|
|
70
|
-
allowReverse:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
65
|
+
showOtherMonthDays: p,
|
|
66
|
+
allowReverse: u,
|
|
67
|
+
unstyled: h,
|
|
68
|
+
...N
|
|
69
|
+
} = this.props, w = this.props.activeRangeEnd === "end" && c, k = this.props.activeRangeEnd === "start" && i, m = h && h.uCalendar, g = v(
|
|
70
|
+
E.td({
|
|
71
|
+
c: m,
|
|
72
|
+
rangeStart: !s && !u && i,
|
|
73
|
+
rangeEnd: !s && !u && c,
|
|
74
|
+
rangeMid: !s && f,
|
|
75
|
+
rangeSplitEnd: !s && M,
|
|
76
|
+
rangeSplitStart: !s && C,
|
|
77
|
+
active: k || w,
|
|
78
|
+
focused: n,
|
|
79
|
+
selected: !s && (d || i || c),
|
|
80
|
+
today: !s && R,
|
|
81
|
+
weekend: a,
|
|
82
|
+
disabled: S,
|
|
83
|
+
isOtherMonth: s,
|
|
84
|
+
isEmpty: !p && s
|
|
85
|
+
}),
|
|
88
86
|
e
|
|
89
87
|
);
|
|
90
|
-
return !
|
|
88
|
+
return !p && s ? /* @__PURE__ */ r.createElement("td", { role: "gridcell", className: g }) : /* @__PURE__ */ r.createElement(
|
|
91
89
|
"td",
|
|
92
90
|
{
|
|
93
|
-
...
|
|
94
|
-
className:
|
|
91
|
+
...N,
|
|
92
|
+
className: g,
|
|
95
93
|
onClick: this.handleClick,
|
|
96
94
|
onMouseEnter: this.handleMouseEnter,
|
|
97
95
|
onMouseLeave: this.handleMouseLeave
|
|
98
96
|
},
|
|
99
|
-
/* @__PURE__ */ r.createElement("span", { className:
|
|
97
|
+
/* @__PURE__ */ r.createElement("span", { className: v(E.link({ c: m })) }, this.props.children)
|
|
100
98
|
);
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
export {
|
|
104
|
-
|
|
102
|
+
L as CalendarCell
|
|
105
103
|
};
|
|
@@ -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
|
|
8
|
+
"use client";"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;
|