@progress/kendo-react-dateinputs 7.5.0-develop.9 → 8.0.0-develop.1
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 +46 -40
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +53 -49
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +12 -10
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +20 -19
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +37 -29
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +153 -123
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +1 -1
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +56 -48
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +47 -45
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +14 -16
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +5 -5
- package/common/ClearButton.js +8 -0
- package/common/ClearButton.mjs +41 -0
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +32 -29
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +3 -0
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +6 -4
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +80 -7
- package/index.d.ts +80 -7
- package/messages/index.js +1 -1
- package/messages/index.mjs +38 -36
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +5 -6
- package/virtualization/services/RowHeightService.js +0 -8
- package/virtualization/services/RowHeightService.mjs +0 -50
|
@@ -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 C=require("react"),a=require("prop-types"),u=require("@progress/kendo-react-common"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),a=require("prop-types"),u=require("@progress/kendo-react-common"),r=require("@progress/kendo-date-math"),V=require("@progress/kendo-react-intl"),k=require("../../package-metadata.js"),E=require("./ViewList.js"),I=require("./Navigation.js"),d=require("../models/CalendarViewEnum.js"),l=require("../../utils.js"),x=require("../services/BusViewService.js"),N=require("../services/DOMService.js"),O=require("../services/NavigationService.js"),M=require("../services/ScrollSyncService.js");function P(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 m=P(C),g=c=>c?c.virtualization:null,D=(c=p.defaultProps.min,s=p.defaultProps.max,t,e)=>e!==void 0?e!==null&&l.isInRange(r.getDate(e),c,s)?e:null:t!==null&&l.isInRange(r.getDate(t),c,s)?t:null,h=class h extends m.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(g(this.Navigation),g(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const i=r.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=r.cloneDate(e.value),n=r.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:v}=this.props;if(v){const o={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,target:this};v.call(void 0,o)}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:v}=e;if(!(!this.focusedDate||!this.service)){if(n===84&&this.setState({focusedDate:l.getToday()}),(f||v)&&(n===u.Keys.left||n===u.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const o=n===u.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,w=new Date(this.focusedDate.setMonth(o)),S=r.cloneDate(w);this.setState({focusedDate:S})}if(n===u.Keys.enter){if(this.value!==null&&r.isEqualDate(this.focusedDate,this.value)){const w=l.dateInRange(this.focusedDate,this.min,this.max);g(this.calendarViewList).scrollToIndex(this.service.skip(w,this.min))}const o={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(o)}else{const o=l.dateInRange(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(r.isEqualDate(this.focusedDate,o))return;this.setState({focusedDate:o})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},u.validatePackage(k.packageMetadata);const t=D(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 N.DOMService,this.bus=new x.BusViewService(this.handleViewChange),this.navigation=new O.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 r.getDate(this.props.min!==void 0?this.props.min:h.defaultProps.min)}get max(){return r.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(()=>{u.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new M.ScrollSyncService(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,t){u.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(){this.props._ref&&this.props._ref(this);const s=this.value!==null&&this.oldValue!==null?!r.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,t=l.viewInRange(this.state.activeView,d.CalendarViewEnum[this.props.bottomView!==void 0?this.props.bottomView:h.defaultProps.bottomView],d.CalendarViewEnum[this.props.topView!==void 0?this.props.topView:h.defaultProps.topView]),e=D(this.min,this.max,this.value,this.value),i=e?r.getDate(e):null;this.focusedDate=r.getDate(l.dateInRange(s&&e!==null?e:this.state.focusedDate,this.min,this.max)),this.intl=V.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(t,this.intl);const{smoothScroll:n=Number.parseFloat(m.version)<18}=this.props,f=u.classNames("k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber},this.props.mobileMode?"k-calendar-lg":"k-calendar-md",this.props.className),v=[this.props.navigation&&m.createElement(I.Navigation,{key:0,ref:o=>{this.Navigation=o},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}),m.createElement(E.ViewList,{key:1,ref:o=>{this.calendarViewList=o},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:n,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:i,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays})];return m.createElement("div",{ref:o=>{this._element=o},className:f,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},v)}};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:
|
|
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 p=h;const b=u.createPropsContext(),y=u.withIdHOC(u.withPropsContext(b,p));y.displayName="KendoReactCalendar";V.registerForIntl(p);exports.Calendar=y;exports.CalendarPropsContext=b;exports.CalendarWithoutContext=p;
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as v from "react";
|
|
10
10
|
import s from "prop-types";
|
|
11
|
-
import { Keys as m, validatePackage as I, setScrollbarWidth as b, classNames as N, createPropsContext as E, withIdHOC as
|
|
11
|
+
import { Keys as m, validatePackage as I, setScrollbarWidth as b, classNames as N, createPropsContext as E, withIdHOC as O, withPropsContext as P } from "@progress/kendo-react-common";
|
|
12
12
|
import { cloneDate as f, isEqualDate as D, getDate as c } from "@progress/kendo-date-math";
|
|
13
|
-
import { provideIntlService as
|
|
14
|
-
import { packageMetadata as
|
|
13
|
+
import { provideIntlService as A, registerForIntl as M } from "@progress/kendo-react-intl";
|
|
14
|
+
import { packageMetadata as L } from "../../package-metadata.mjs";
|
|
15
15
|
import { ViewList as B } from "./ViewList.mjs";
|
|
16
16
|
import { Navigation as T } from "./Navigation.mjs";
|
|
17
|
-
import { CalendarViewEnum as
|
|
18
|
-
import { getToday as
|
|
17
|
+
import { CalendarViewEnum as h } from "../models/CalendarViewEnum.mjs";
|
|
18
|
+
import { getToday as y, dateInRange as w, viewInRange as S, MIN_DATE as F, MAX_DATE as K, isInRange as C } from "../../utils.mjs";
|
|
19
19
|
import { BusViewService as _ } from "../services/BusViewService.mjs";
|
|
20
20
|
import { DOMService as $ } from "../services/DOMService.mjs";
|
|
21
21
|
import { NavigationService as R } from "../services/NavigationService.mjs";
|
|
22
22
|
import { ScrollSyncService as U } from "../services/ScrollSyncService.mjs";
|
|
23
|
-
const V = (u) => u ? u.virtualization : null,
|
|
23
|
+
const V = (u) => u ? u.virtualization : null, k = (u = d.defaultProps.min, o = d.defaultProps.max, i, t) => t !== void 0 ? t !== null && C(c(t), u, o) ? t : null : i !== null && C(c(i), u, o) ? i : null, r = class r extends v.Component {
|
|
24
24
|
constructor(o) {
|
|
25
25
|
super(o), 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();
|
|
@@ -50,15 +50,15 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
this.setState({ value: e, focusedDate: a }), this.valueDuringOnChange = e;
|
|
53
|
-
const { onChange:
|
|
54
|
-
if (
|
|
53
|
+
const { onChange: l } = this.props;
|
|
54
|
+
if (l) {
|
|
55
55
|
const n = {
|
|
56
56
|
syntheticEvent: t.syntheticEvent,
|
|
57
57
|
nativeEvent: t.nativeEvent,
|
|
58
58
|
value: e,
|
|
59
59
|
target: this
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
l.call(void 0, n);
|
|
62
62
|
}
|
|
63
63
|
this.valueDuringOnChange = void 0;
|
|
64
64
|
}, this.handleFocus = (t) => {
|
|
@@ -74,14 +74,14 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
|
|
|
74
74
|
const { onBlur: e } = this.props;
|
|
75
75
|
e && e.call(void 0, t);
|
|
76
76
|
}, this.handleKeyDown = (t) => {
|
|
77
|
-
const { keyCode: a, ctrlKey: p, metaKey:
|
|
77
|
+
const { keyCode: a, ctrlKey: p, metaKey: l } = t;
|
|
78
78
|
if (!(!this.focusedDate || !this.service)) {
|
|
79
|
-
if (a === 84 && this.setState({ focusedDate:
|
|
79
|
+
if (a === 84 && this.setState({ focusedDate: y() }), (p || l) && (a === m.left || a === m.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 n = a === m.left ? this.focusedDate.getMonth() - 1 : this.focusedDate.getMonth() + 1, g = new Date(this.focusedDate.setMonth(n)),
|
|
84
|
-
this.setState({ focusedDate:
|
|
83
|
+
const n = a === m.left ? this.focusedDate.getMonth() - 1 : this.focusedDate.getMonth() + 1, g = new Date(this.focusedDate.setMonth(n)), x = f(g);
|
|
84
|
+
this.setState({ focusedDate: x });
|
|
85
85
|
}
|
|
86
86
|
if (a === m.enter) {
|
|
87
87
|
if (this.value !== null && D(this.focusedDate, this.value)) {
|
|
@@ -117,22 +117,22 @@ const V = (u) => u ? u.virtualization : null, x = (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
|
-
}, I(
|
|
121
|
-
const i =
|
|
120
|
+
}, I(L);
|
|
121
|
+
const i = k(
|
|
122
122
|
this.min,
|
|
123
123
|
this.max,
|
|
124
|
-
this.props.defaultValue ||
|
|
124
|
+
this.props.defaultValue || r.defaultProps.defaultValue,
|
|
125
125
|
this.props.value
|
|
126
126
|
);
|
|
127
127
|
this.state = {
|
|
128
128
|
value: i,
|
|
129
|
-
activeView:
|
|
130
|
-
|
|
129
|
+
activeView: S(
|
|
130
|
+
h[o.defaultActiveView],
|
|
131
131
|
this.bottomView,
|
|
132
132
|
this.topView
|
|
133
133
|
),
|
|
134
134
|
focusedDate: w(
|
|
135
|
-
o.focusedDate || i ||
|
|
135
|
+
o.focusedDate || i || y(),
|
|
136
136
|
this.min,
|
|
137
137
|
this.max
|
|
138
138
|
)
|
|
@@ -157,16 +157,16 @@ const V = (u) => u ? u.virtualization : null, x = (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 : r.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 : r.defaultProps.max);
|
|
164
164
|
}
|
|
165
165
|
get bottomView() {
|
|
166
|
-
return
|
|
166
|
+
return h[this.props.bottomView !== void 0 ? this.props.bottomView : r.defaultProps.bottomView];
|
|
167
167
|
}
|
|
168
168
|
get topView() {
|
|
169
|
-
return
|
|
169
|
+
return h[this.props.topView !== void 0 ? this.props.topView : r.defaultProps.topView];
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* @hidden
|
|
@@ -187,16 +187,16 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
|
|
|
187
187
|
*/
|
|
188
188
|
render() {
|
|
189
189
|
this.props._ref && this.props._ref(this);
|
|
190
|
-
const o = this.value !== null && this.oldValue !== null ? !D(this.value, this.oldValue) : this.value !== this.oldValue, i =
|
|
190
|
+
const o = this.value !== null && this.oldValue !== null ? !D(this.value, this.oldValue) : this.value !== this.oldValue, i = S(
|
|
191
191
|
this.state.activeView,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
), t =
|
|
192
|
+
h[this.props.bottomView !== void 0 ? this.props.bottomView : r.defaultProps.bottomView],
|
|
193
|
+
h[this.props.topView !== void 0 ? this.props.topView : r.defaultProps.topView]
|
|
194
|
+
), t = k(this.min, this.max, this.value, this.value), e = t ? c(t) : null;
|
|
195
195
|
this.focusedDate = c(w(
|
|
196
196
|
o && t !== null ? t : this.state.focusedDate,
|
|
197
197
|
this.min,
|
|
198
198
|
this.max
|
|
199
|
-
)), this.intl =
|
|
199
|
+
)), this.intl = A(this), this.bus.configure(this.bottomView, this.topView), this.service = this.bus.service(i, this.intl);
|
|
200
200
|
const { smoothScroll: a = Number.parseFloat(v.version) < 18 } = this.props, p = N(
|
|
201
201
|
"k-calendar k-calendar-infinite",
|
|
202
202
|
{
|
|
@@ -205,7 +205,7 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
|
|
|
205
205
|
},
|
|
206
206
|
this.props.mobileMode ? "k-calendar-lg" : "k-calendar-md",
|
|
207
207
|
this.props.className
|
|
208
|
-
),
|
|
208
|
+
), l = [this.props.navigation && /* @__PURE__ */ v.createElement(
|
|
209
209
|
T,
|
|
210
210
|
{
|
|
211
211
|
key: 0,
|
|
@@ -247,7 +247,10 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
|
|
|
247
247
|
value: e,
|
|
248
248
|
cellUID: this.cellUID,
|
|
249
249
|
headerTitle: this.props.headerTitle,
|
|
250
|
-
|
|
250
|
+
header: this.props.header,
|
|
251
|
+
tabIndex: this.props.tabIndex,
|
|
252
|
+
weekDaysFormat: this.props.weekDaysFormat,
|
|
253
|
+
showOtherMonthDays: this.props.showOtherMonthDays
|
|
251
254
|
}
|
|
252
255
|
)];
|
|
253
256
|
return /* @__PURE__ */ v.createElement(
|
|
@@ -268,11 +271,11 @@ const V = (u) => u ? u.virtualization : null, x = (u = d.defaultProps.min, o = d
|
|
|
268
271
|
onMouseDown: this.handleMouseDown,
|
|
269
272
|
onClick: this.handleClick
|
|
270
273
|
},
|
|
271
|
-
|
|
274
|
+
l
|
|
272
275
|
);
|
|
273
276
|
}
|
|
274
277
|
};
|
|
275
|
-
|
|
278
|
+
r.displayName = "Calendar", r.propTypes = {
|
|
276
279
|
className: s.string,
|
|
277
280
|
defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
|
|
278
281
|
defaultValue: s.instanceOf(Date),
|
|
@@ -281,6 +284,7 @@ l.displayName = "Calendar", l.propTypes = {
|
|
|
281
284
|
id: s.string,
|
|
282
285
|
ariaLabelledBy: s.string,
|
|
283
286
|
ariaDescribedBy: s.string,
|
|
287
|
+
weekDaysFormat: s.oneOf(["short", "abbreviated", "narrow"]),
|
|
284
288
|
max: s.instanceOf(Date),
|
|
285
289
|
min: s.instanceOf(Date),
|
|
286
290
|
navigation: s.bool,
|
|
@@ -293,7 +297,7 @@ l.displayName = "Calendar", l.propTypes = {
|
|
|
293
297
|
weekNumber: s.bool,
|
|
294
298
|
topView: (o, i, t) => {
|
|
295
299
|
const e = o[i], a = o.bottomView;
|
|
296
|
-
return e && a &&
|
|
300
|
+
return e && a && h[e] < h[a] ? new Error(
|
|
297
301
|
`Invalid prop + ${i} suplied to ${t}.
|
|
298
302
|
${i} can not be smaller than bottomView.
|
|
299
303
|
`
|
|
@@ -301,24 +305,26 @@ l.displayName = "Calendar", l.propTypes = {
|
|
|
301
305
|
},
|
|
302
306
|
bottomView: (o, i, t) => {
|
|
303
307
|
const e = o[i], a = o.topView;
|
|
304
|
-
return e && a &&
|
|
308
|
+
return e && a && h[e] > h[a] ? new Error(
|
|
305
309
|
`Invalid prop + ${i} suplied to ${t}.
|
|
306
310
|
${i} can not be bigger than topView.
|
|
307
311
|
`
|
|
308
312
|
) : null;
|
|
309
313
|
}
|
|
310
|
-
},
|
|
314
|
+
}, r.defaultProps = {
|
|
311
315
|
disabled: !1,
|
|
312
|
-
min:
|
|
313
|
-
max:
|
|
316
|
+
min: F,
|
|
317
|
+
max: K,
|
|
318
|
+
weekDaysFormat: "short",
|
|
314
319
|
navigation: !0,
|
|
315
320
|
defaultActiveView: "month",
|
|
316
321
|
defaultValue: null,
|
|
317
322
|
topView: "century",
|
|
318
|
-
bottomView: "month"
|
|
323
|
+
bottomView: "month",
|
|
324
|
+
showOtherMonthDays: !1
|
|
319
325
|
};
|
|
320
|
-
let d =
|
|
321
|
-
const Y = E(), z = P(
|
|
326
|
+
let d = r;
|
|
327
|
+
const Y = E(), z = O(P(Y, d));
|
|
322
328
|
z.displayName = "KendoReactCalendar";
|
|
323
329
|
M(d);
|
|
324
330
|
export {
|
|
@@ -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 C=require("react"),O=require("@progress/kendo-react-common");function R(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const l=R(C),y=(n,t)=>{const e=Object.getOwnPropertyNames(n),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let r=0;r<e.length;r++){const o=e[r];if(n[o]!==t[o])return!1}return!0};class N extends l.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())&&y(s,o))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:r,isInRange:o,isSelected:d,isRangeStart:i,isRangeMid:p,isRangeEnd:c,isRangeSplitStart:h,isRangeSplitEnd:g,isToday:m,isDisabled:k,view:S,value:w,isOtherMonth:a,showOtherMonthDays:v,allowReverse:u,...f}=this.props,E=this.props.activeRangeEnd==="end"&&c,M=this.props.activeRangeEnd==="start"&&i,b=O.classNames("k-calendar-td",{"k-range-start":!a&&!u&&i,"k-range-end":!a&&!u&&c,"k-range-mid":!a&&p,"k-range-split-end":!a&&g,"k-range-split-start":!a&&h,"k-active":M||E,"k-state-pending-focus":r,"k-selected":!a&&(d||i||c),"k-today":!a&&m,"k-weekend":s,"k-disabled":k,"k-other-month":a},t);return!v&&a?l.createElement("td",{role:"gridcell",className:"k-empty k-calendar-td"}):l.createElement("td",{...f,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},l.createElement("span",{className:"k-link"},this.props.children))}}exports.CalendarCell=N;
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { classNames as
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
9
|
+
import * as r from "react";
|
|
10
|
+
import { classNames as C } from "@progress/kendo-react-common";
|
|
11
|
+
const N = (l, e) => {
|
|
12
|
+
const t = Object.getOwnPropertyNames(l), a = Object.getOwnPropertyNames(e);
|
|
13
|
+
if (t.length !== a.length)
|
|
14
14
|
return !1;
|
|
15
|
-
for (let
|
|
16
|
-
const
|
|
17
|
-
if (o
|
|
15
|
+
for (let n = 0; n < t.length; n++) {
|
|
16
|
+
const o = t[n];
|
|
17
|
+
if (l[o] !== e[o])
|
|
18
18
|
return !1;
|
|
19
19
|
}
|
|
20
20
|
return !0;
|
|
21
21
|
};
|
|
22
|
-
class
|
|
22
|
+
class P extends r.Component {
|
|
23
23
|
constructor() {
|
|
24
24
|
super(...arguments), this.handleClick = (e) => {
|
|
25
|
-
const { onClick:
|
|
26
|
-
|
|
25
|
+
const { onClick: t, value: a } = this.props;
|
|
26
|
+
t && t.call(void 0, a, e);
|
|
27
27
|
}, this.handleMouseEnter = () => {
|
|
28
|
-
const { onMouseEnter: e, value:
|
|
29
|
-
e && e.call(void 0,
|
|
28
|
+
const { onMouseEnter: e, value: t } = this.props;
|
|
29
|
+
e && e.call(void 0, t);
|
|
30
30
|
}, this.handleMouseLeave = () => {
|
|
31
|
-
const { onMouseLeave: e, value:
|
|
32
|
-
e && e.call(void 0,
|
|
31
|
+
const { onMouseLeave: e, value: t } = this.props;
|
|
32
|
+
e && e.call(void 0, t);
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
// Manually checking if the component needs an update
|
|
@@ -40,8 +40,8 @@ class w extends l.Component {
|
|
|
40
40
|
* @hidden
|
|
41
41
|
*/
|
|
42
42
|
shouldComponentUpdate(e) {
|
|
43
|
-
const { value:
|
|
44
|
-
return !((!(
|
|
43
|
+
const { value: t, ...a } = this.props, { value: n, ...o } = e;
|
|
44
|
+
return !((!(t && n) || t.getTime() === n.getTime()) && N(a, o));
|
|
45
45
|
}
|
|
46
46
|
/* eslint-disable max-len */
|
|
47
47
|
/**
|
|
@@ -51,51 +51,55 @@ class w extends l.Component {
|
|
|
51
51
|
render() {
|
|
52
52
|
const {
|
|
53
53
|
className: e,
|
|
54
|
-
formattedValue:
|
|
55
|
-
isWeekend:
|
|
56
|
-
isFocused:
|
|
57
|
-
isInRange:
|
|
58
|
-
isSelected:
|
|
59
|
-
isRangeStart:
|
|
60
|
-
isRangeMid:
|
|
61
|
-
isRangeEnd:
|
|
62
|
-
isRangeSplitStart:
|
|
63
|
-
isRangeSplitEnd:
|
|
64
|
-
isToday:
|
|
65
|
-
isDisabled:
|
|
66
|
-
view:
|
|
67
|
-
value:
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
formattedValue: t,
|
|
55
|
+
isWeekend: a,
|
|
56
|
+
isFocused: n,
|
|
57
|
+
isInRange: o,
|
|
58
|
+
isSelected: d,
|
|
59
|
+
isRangeStart: i,
|
|
60
|
+
isRangeMid: u,
|
|
61
|
+
isRangeEnd: c,
|
|
62
|
+
isRangeSplitStart: h,
|
|
63
|
+
isRangeSplitEnd: m,
|
|
64
|
+
isToday: g,
|
|
65
|
+
isDisabled: k,
|
|
66
|
+
view: w,
|
|
67
|
+
value: y,
|
|
68
|
+
isOtherMonth: s,
|
|
69
|
+
showOtherMonthDays: v,
|
|
70
|
+
allowReverse: p,
|
|
71
|
+
...E
|
|
72
|
+
} = this.props, f = this.props.activeRangeEnd === "end" && c, M = this.props.activeRangeEnd === "start" && i, R = C(
|
|
70
73
|
"k-calendar-td",
|
|
71
74
|
{
|
|
72
|
-
"k-range-
|
|
73
|
-
"k-range-
|
|
74
|
-
"k-range-
|
|
75
|
-
"k-range-split-
|
|
76
|
-
"k-range-start":
|
|
77
|
-
"k-active":
|
|
78
|
-
"k-state-pending-focus":
|
|
79
|
-
"k-selected":
|
|
80
|
-
"k-today":
|
|
81
|
-
"k-weekend":
|
|
82
|
-
"k-disabled":
|
|
75
|
+
"k-range-start": !s && !p && i,
|
|
76
|
+
"k-range-end": !s && !p && c,
|
|
77
|
+
"k-range-mid": !s && u,
|
|
78
|
+
"k-range-split-end": !s && m,
|
|
79
|
+
"k-range-split-start": !s && h,
|
|
80
|
+
"k-active": M || f,
|
|
81
|
+
"k-state-pending-focus": n,
|
|
82
|
+
"k-selected": !s && (d || i || c),
|
|
83
|
+
"k-today": !s && g,
|
|
84
|
+
"k-weekend": a,
|
|
85
|
+
"k-disabled": k,
|
|
86
|
+
"k-other-month": s
|
|
83
87
|
},
|
|
84
88
|
e
|
|
85
89
|
);
|
|
86
|
-
return /* @__PURE__ */
|
|
90
|
+
return !v && s ? /* @__PURE__ */ r.createElement("td", { role: "gridcell", className: "k-empty k-calendar-td" }) : /* @__PURE__ */ r.createElement(
|
|
87
91
|
"td",
|
|
88
92
|
{
|
|
89
|
-
...
|
|
90
|
-
className:
|
|
93
|
+
...E,
|
|
94
|
+
className: R,
|
|
91
95
|
onClick: this.handleClick,
|
|
92
96
|
onMouseEnter: this.handleMouseEnter,
|
|
93
97
|
onMouseLeave: this.handleMouseLeave
|
|
94
98
|
},
|
|
95
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ r.createElement("span", { className: "k-link" }, this.props.children)
|
|
96
100
|
);
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
export {
|
|
100
|
-
|
|
104
|
+
P as CalendarCell
|
|
101
105
|
};
|
|
@@ -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 c=require("react"),o=require("@progress/kendo-react-common");function
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=require("@progress/kendo-react-common");function l(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const a=l(c);class i extends a.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,firstDate:n,weekDays:s}=this.props;t&&e&&t.call(void 0,n,s||[],e)}}render(){const{className:e,firstDate:t,weekDays:n,...s}=this.props;return a.createElement("td",{className:o.classNames("k-calendar-td",e),...s,onClick:this.handleClick},this.props.children)}}exports.CalendarWeekCell=i;
|
|
@@ -6,18 +6,20 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { classNames as
|
|
11
|
-
class
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import { classNames as l } from "@progress/kendo-react-common";
|
|
11
|
+
class i extends a.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.handleClick = (e) => {
|
|
14
|
+
const { onClick: s, firstDate: r, weekDays: t } = this.props;
|
|
15
|
+
s && e && s.call(void 0, r, t || [], e);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
16
18
|
render() {
|
|
17
|
-
const { className:
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
const { className: e, firstDate: s, weekDays: r, ...t } = this.props;
|
|
20
|
+
return /* @__PURE__ */ a.createElement("td", { className: l("k-calendar-td", e), ...t, onClick: this.handleClick }, this.props.children);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
export {
|
|
22
|
-
|
|
24
|
+
i as CalendarWeekCell
|
|
23
25
|
};
|
|
@@ -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 d=require("react"),a=require("prop-types"),m=require("@progress/kendo-react-intl"),c=require("@progress/kendo-react-common"),g=require("./CalendarHeaderTitle.js"),p=require("../../utils.js");function v(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const s=v(d),i=class i 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:i.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:i.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:i.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const e=this.getTitle(),t=c.classNames("k-calendar-title"),r={children:e,value:e,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},l={headerTitleProps:r,commands:this.props.commands},h=this.props.headerTitle?s.createElement(this.props.headerTitle,{...r},e):s.createElement(g.CalendarHeaderTitle,{...r},e),u=this.props.header?s.createElement(this.props.header,{...l}):s.createElement(s.Fragment,null,h,s.createElement("span",{className:"k-spacer"}),s.createElement("span",{className:"k-calendar-nav"},this.props.commands));return s.createElement("div",{className:c.classNames("k-calendar-header",{"k-vstack":this.props.verticalView})},u)}};i.propTypes={activeView:a.number.isRequired,currentDate:a.instanceOf(Date).isRequired,max:a.instanceOf(Date).isRequired,min:a.instanceOf(Date).isRequired,rangeLength:a.number},i.defaultProps={rangeLength:1,min:p.MIN_DATE,max:p.MAX_DATE};let o=i;m.registerForLocalization(o);exports.Header=o;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as t from "react";
|
|
10
10
|
import i from "prop-types";
|
|
11
|
-
import { registerForLocalization as
|
|
11
|
+
import { registerForLocalization as m } from "@progress/kendo-react-intl";
|
|
12
12
|
import { classNames as p } from "@progress/kendo-react-common";
|
|
13
|
-
import { CalendarHeaderTitle as
|
|
14
|
-
import { MIN_DATE as
|
|
15
|
-
const
|
|
13
|
+
import { CalendarHeaderTitle as l } from "./CalendarHeaderTitle.mjs";
|
|
14
|
+
import { MIN_DATE as d, MAX_DATE as u } from "../../utils.mjs";
|
|
15
|
+
const s = class s extends t.Component {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.getTitle = () => {
|
|
18
18
|
if (!this.props.currentDate)
|
|
@@ -24,13 +24,13 @@ const t = class t extends s.Component {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
get min() {
|
|
27
|
-
return this.props.min !== void 0 ? this.props.min :
|
|
27
|
+
return this.props.min !== void 0 ? this.props.min : s.defaultProps.min;
|
|
28
28
|
}
|
|
29
29
|
get max() {
|
|
30
|
-
return this.props.max !== void 0 ? this.props.max :
|
|
30
|
+
return this.props.max !== void 0 ? this.props.max : s.defaultProps.max;
|
|
31
31
|
}
|
|
32
32
|
get rangeLength() {
|
|
33
|
-
return this.props.rangeLength !== void 0 ? this.props.rangeLength :
|
|
33
|
+
return this.props.rangeLength !== void 0 ? this.props.rangeLength : s.defaultProps.rangeLength;
|
|
34
34
|
}
|
|
35
35
|
get canMoveUp() {
|
|
36
36
|
return this.props.bus.canMoveUp(this.props.activeView);
|
|
@@ -45,33 +45,34 @@ const t = class t extends s.Component {
|
|
|
45
45
|
className: a,
|
|
46
46
|
onClick: this.handleTitleClick,
|
|
47
47
|
disabled: !this.canMoveUp
|
|
48
|
-
}, o =
|
|
49
|
-
|
|
48
|
+
}, o = {
|
|
49
|
+
headerTitleProps: r,
|
|
50
|
+
commands: this.props.commands
|
|
51
|
+
}, c = this.props.headerTitle ? /* @__PURE__ */ t.createElement(this.props.headerTitle, { ...r }, e) : /* @__PURE__ */ t.createElement(l, { ...r }, e), h = this.props.header ? /* @__PURE__ */ t.createElement(this.props.header, { ...o }) : /* @__PURE__ */ t.createElement(t.Fragment, null, c, /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("span", { className: "k-calendar-nav" }, this.props.commands));
|
|
52
|
+
return /* @__PURE__ */ t.createElement(
|
|
50
53
|
"div",
|
|
51
54
|
{
|
|
52
55
|
className: p("k-calendar-header", {
|
|
53
56
|
"k-vstack": this.props.verticalView
|
|
54
57
|
})
|
|
55
58
|
},
|
|
56
|
-
|
|
57
|
-
/* @__PURE__ */ s.createElement("span", { className: "k-spacer" }),
|
|
58
|
-
/* @__PURE__ */ s.createElement("span", { className: "k-calendar-nav" }, this.props.commands)
|
|
59
|
+
h
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
|
-
|
|
63
|
+
s.propTypes = {
|
|
63
64
|
activeView: i.number.isRequired,
|
|
64
65
|
currentDate: i.instanceOf(Date).isRequired,
|
|
65
66
|
max: i.instanceOf(Date).isRequired,
|
|
66
67
|
min: i.instanceOf(Date).isRequired,
|
|
67
68
|
rangeLength: i.number
|
|
68
|
-
},
|
|
69
|
+
}, s.defaultProps = {
|
|
69
70
|
rangeLength: 1,
|
|
70
|
-
min:
|
|
71
|
-
max:
|
|
71
|
+
min: d,
|
|
72
|
+
max: u
|
|
72
73
|
};
|
|
73
|
-
let n =
|
|
74
|
-
|
|
74
|
+
let n = s;
|
|
75
|
+
m(n);
|
|
75
76
|
export {
|
|
76
77
|
n as Header
|
|
77
78
|
};
|
|
@@ -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 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;
|