@progress/kendo-react-dateinputs 8.3.0-develop.6 → 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
|
@@ -7,17 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import { Button as r } from "@progress/kendo-react-buttons";
|
|
10
|
-
import * as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
render() {
|
|
17
|
-
const { view: n, ...t } = this.props;
|
|
18
|
-
return /* @__PURE__ */ e.createElement(r, { type: "button", fillMode: "flat", themeColor: "primary", ...t }, this.props.children);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
10
|
+
import * as o from "react";
|
|
11
|
+
const a = (e) => {
|
|
12
|
+
const { view: l, ...t } = e;
|
|
13
|
+
return /* @__PURE__ */ o.createElement(r, { type: "button", fillMode: "flat", themeColor: "primary", ...t }, e.children);
|
|
14
|
+
};
|
|
21
15
|
export {
|
|
22
|
-
|
|
16
|
+
a as CalendarHeaderTitle
|
|
23
17
|
};
|
|
@@ -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 m=require("react"),c=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 a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=f(m),g=e=>{const{isRangeStart:n,value:t,text:a,...s}=e,r=c.useUnstyled(),i=r&&r.uCalendar,u=d=>{const{onClick:l}=e;l&&l.call(void 0,t,d)};return o.createElement("li",{...s,onClick:u},o.createElement("span",{className:c.classNames(c.uCalendar.navigationMarker({c:i,isRangeStart:n}))},e.children))};exports.CalendarNavigationItem=g;
|
|
@@ -6,24 +6,20 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { classNames as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const { isRangeStart: e, value: t, text: r, ...s } = this.props;
|
|
24
|
-
return /* @__PURE__ */ a.createElement("li", { ...s, onClick: this.handleClick }, /* @__PURE__ */ a.createElement("span", { className: n({ "k-calendar-navigation-marker": e }) }, this.props.children));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import { useUnstyled as m, classNames as d, uCalendar as u } from "@progress/kendo-react-common";
|
|
11
|
+
const v = (e) => {
|
|
12
|
+
const { isRangeStart: l, value: c, text: C, ...s } = e, a = m(), i = a && a.uCalendar, o = (r) => {
|
|
13
|
+
const { onClick: t } = e;
|
|
14
|
+
t && t.call(void 0, c, r);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ n.createElement("li", { ...s, onClick: o }, /* @__PURE__ */ n.createElement("span", { className: d(
|
|
17
|
+
u.navigationMarker({
|
|
18
|
+
c: i,
|
|
19
|
+
isRangeStart: l
|
|
20
|
+
})
|
|
21
|
+
) }, e.children));
|
|
22
|
+
};
|
|
27
23
|
export {
|
|
28
|
-
|
|
24
|
+
v as CalendarNavigationItem
|
|
29
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("@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;
|
|
@@ -6,20 +6,15 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { classNames as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
render() {
|
|
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);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
9
|
+
import * as d from "react";
|
|
10
|
+
import { useUnstyled as m, classNames as C, uCalendar as u } from "@progress/kendo-react-common";
|
|
11
|
+
const f = (e) => {
|
|
12
|
+
const { className: l, firstDate: c, weekDays: n, ...o } = e, r = (t) => {
|
|
13
|
+
const { onClick: a } = e;
|
|
14
|
+
a && t && a.call(void 0, c, n || [], t);
|
|
15
|
+
}, s = m(), i = s && s.uCalendar;
|
|
16
|
+
return /* @__PURE__ */ d.createElement("td", { className: C(u.td({ c: i, isWeek: !0 }), l), ...o, onClick: r }, e.children);
|
|
17
|
+
};
|
|
23
18
|
export {
|
|
24
|
-
|
|
19
|
+
f as CalendarWeekCell
|
|
25
20
|
};
|
|
@@ -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 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;
|
|
@@ -6,73 +6,63 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as e from "react";
|
|
10
10
|
import i from "prop-types";
|
|
11
|
-
import { registerForLocalization as
|
|
12
|
-
import { classNames as
|
|
13
|
-
import { CalendarHeaderTitle as
|
|
14
|
-
import { MIN_DATE as
|
|
15
|
-
const
|
|
11
|
+
import { registerForLocalization as v } from "@progress/kendo-react-intl";
|
|
12
|
+
import { classNames as o, uCalendar as c } from "@progress/kendo-react-common";
|
|
13
|
+
import { CalendarHeaderTitle as f } from "./CalendarHeaderTitle.mjs";
|
|
14
|
+
import { MIN_DATE as T, MAX_DATE as D } from "../../utils.mjs";
|
|
15
|
+
const t = class t extends e.Component {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.getTitle = () => {
|
|
18
18
|
if (!this.props.currentDate)
|
|
19
19
|
return "";
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
}, this.handleTitleClick = (
|
|
23
|
-
this.canMoveUp && this.props.bus.moveUp(this.props.activeView,
|
|
20
|
+
const s = this.rangeLength - 1, a = this.props.service.title(this.props.currentDate), r = this.props.service.addToDate(this.props.currentDate, s);
|
|
21
|
+
return s < 1 || !this.props.service.isInRange(r, this.min, this.max) ? a : `${a} - ${this.props.service.title(r)}`;
|
|
22
|
+
}, this.handleTitleClick = (s) => {
|
|
23
|
+
this.canMoveUp && this.props.bus.moveUp(this.props.activeView, s);
|
|
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 : t.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 : t.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 : t.defaultProps.rangeLength;
|
|
34
34
|
}
|
|
35
35
|
get canMoveUp() {
|
|
36
36
|
return this.props.bus.canMoveUp(this.props.activeView);
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
view: this.props.activeView,
|
|
45
|
-
className: a,
|
|
39
|
+
const { activeView: s, commands: a, unstyled: r } = this.props, n = r && r.uCalendar, p = this.getTitle(), m = o(c.title({ c: n })), h = {
|
|
40
|
+
children: p,
|
|
41
|
+
value: p,
|
|
42
|
+
view: s,
|
|
43
|
+
className: m,
|
|
46
44
|
onClick: this.handleTitleClick,
|
|
47
45
|
disabled: !this.canMoveUp
|
|
48
|
-
},
|
|
49
|
-
headerTitleProps:
|
|
50
|
-
commands:
|
|
51
|
-
},
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: p("k-calendar-header", {
|
|
56
|
-
"k-vstack": this.props.verticalView
|
|
57
|
-
})
|
|
58
|
-
},
|
|
59
|
-
h
|
|
60
|
-
);
|
|
46
|
+
}, d = {
|
|
47
|
+
headerTitleProps: h,
|
|
48
|
+
commands: a
|
|
49
|
+
}, u = this.props.headerTitle ? /* @__PURE__ */ e.createElement(this.props.headerTitle, { ...h }, p) : /* @__PURE__ */ e.createElement(f, { ...h }, p), g = this.props.header ? /* @__PURE__ */ e.createElement(this.props.header, { ...d }) : /* @__PURE__ */ e.createElement(e.Fragment, null, u, /* @__PURE__ */ e.createElement("span", { className: o(c.spacer({ c: n })) }), /* @__PURE__ */ e.createElement("span", { className: o(c.nav({ c: n })) }, this.props.commands));
|
|
50
|
+
return /* @__PURE__ */ e.createElement("div", { className: o(c.header({ c: n, vertical: this.props.verticalView })) }, g);
|
|
61
51
|
}
|
|
62
52
|
};
|
|
63
|
-
|
|
53
|
+
t.propTypes = {
|
|
64
54
|
activeView: i.number.isRequired,
|
|
65
55
|
currentDate: i.instanceOf(Date).isRequired,
|
|
66
56
|
max: i.instanceOf(Date).isRequired,
|
|
67
57
|
min: i.instanceOf(Date).isRequired,
|
|
68
58
|
rangeLength: i.number
|
|
69
|
-
},
|
|
59
|
+
}, t.defaultProps = {
|
|
70
60
|
rangeLength: 1,
|
|
71
|
-
min:
|
|
72
|
-
max:
|
|
61
|
+
min: T,
|
|
62
|
+
max: D
|
|
73
63
|
};
|
|
74
|
-
let
|
|
75
|
-
|
|
64
|
+
let l = t;
|
|
65
|
+
v(l);
|
|
76
66
|
export {
|
|
77
|
-
|
|
67
|
+
l as Header
|
|
78
68
|
};
|
|
@@ -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("react"),r=require("prop-types"),v=require("@progress/kendo-date-math"),T=require("./CalendarNavigationItem.js"),k=require("../../utils.js"),w=require("../../virtualization/Virtualization.js"),h=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,u=class u 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()}`,c={text:i,value:t,isRangeStart:s,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?l.createElement(this.props.navigationItem,{...c,key:o},i):l.createElement(T.CalendarNavigationItem,{...c,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:u.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,c=k.dateInRange(this.props.focusedDate,e,n),d=o?t.skip(c,e):this.state.skip,g=t.total(e,n),x=this.getTake(d,g),D=t.addToDate(e,d),b=t.datesList(D,x);(a!==this.lastView||!v.isEqual(c,this.lastFocus))&&(this.indexToScroll=t.skip(c,e));const S=l.createElement(w.Virtualization,{skip:d,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:this.handleVirtualizationMount,tabIndex:this.props.tabIndex,unstyled:i},l.createElement("ul",{ref:m=>{this.list=m},className:h.classNames(h.uCalendar.ul({c:s}))},b.map(m=>this.buildNavigationItem(m))));return l.createElement("div",{className:h.classNames(h.uCalendar.navigation({c:s}))},l.createElement("span",{className:h.classNames(h.uCalendar.navigationHighlight({c:s}))}),this.props.dom.didCalculate?S:null)}getTake(a,e){return Math.min(e-a,this.take)}};u.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},u.defaultProps={take:C};let f=u;exports.Navigation=f;
|
|
@@ -6,74 +6,76 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { cloneDate as
|
|
12
|
-
import { CalendarNavigationItem as
|
|
13
|
-
import { dateInRange as
|
|
14
|
-
import { Virtualization as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import r from "prop-types";
|
|
11
|
+
import { cloneDate as T, isEqual as V } from "@progress/kendo-date-math";
|
|
12
|
+
import { CalendarNavigationItem as H } from "./CalendarNavigationItem.mjs";
|
|
13
|
+
import { dateInRange as v } from "../../utils.mjs";
|
|
14
|
+
import { Virtualization as S } from "../../virtualization/Virtualization.mjs";
|
|
15
|
+
import { classNames as d, uCalendar as u } from "@progress/kendo-react-common";
|
|
16
|
+
const I = 30, l = class l extends n.Component {
|
|
17
|
+
constructor(o) {
|
|
18
|
+
super(o), this.virtualization = null, this.list = null, this.itemHeight = 0, this.topOffset = 0, this.maxViewHeight = 0, this.bottomOffset = 0, this.handleVirtualizationMount = (t) => {
|
|
18
19
|
if (this.virtualization = t, this.virtualization && this.list) {
|
|
19
20
|
this.list.style.transform = `translateY(${this.topOffset}px)`;
|
|
20
|
-
const i =
|
|
21
|
+
const i = v(this.props.focusedDate, this.props.min, this.props.max), s = this.props.service.skip(i, this.props.min);
|
|
21
22
|
this.virtualization.scrollToIndex(s);
|
|
22
23
|
}
|
|
23
24
|
}, this.buildNavigationItem = (t) => {
|
|
24
|
-
const i = this.props.service.navigationTitle(t), s = this.props.service.isRangeStart(t),
|
|
25
|
+
const i = this.props.service.navigationTitle(t), s = this.props.service.isRangeStart(t), a = `kendo-react-calendar-nav-item-${t.getTime()}`, h = {
|
|
25
26
|
text: i,
|
|
26
27
|
value: t,
|
|
27
28
|
isRangeStart: s,
|
|
28
29
|
view: this.props.activeView,
|
|
29
30
|
onClick: this.handleDateChange
|
|
30
31
|
};
|
|
31
|
-
return this.props.navigationItem ? /* @__PURE__ */
|
|
32
|
+
return this.props.navigationItem ? /* @__PURE__ */ n.createElement(this.props.navigationItem, { ...h, key: a }, i) : /* @__PURE__ */ n.createElement(H, { ...h, key: a }, i);
|
|
32
33
|
}, this.calculateHeights = () => {
|
|
33
34
|
const t = this.props.dom.calendarHeight;
|
|
34
35
|
this.itemHeight = this.props.dom.navigationItemHeight || 1, this.maxViewHeight = this.props.dom.monthViewHeight, this.topOffset = (t - this.itemHeight) / 2, this.bottomOffset = t - this.itemHeight;
|
|
35
36
|
}, this.handleDateChange = (t, i) => {
|
|
36
37
|
const { onChange: s } = this.props;
|
|
37
38
|
if (s && i) {
|
|
38
|
-
const
|
|
39
|
-
value:
|
|
39
|
+
const a = {
|
|
40
|
+
value: T(t),
|
|
40
41
|
target: this,
|
|
41
42
|
nativeEvent: i && i.nativeEvent,
|
|
42
43
|
syntheticEvent: i
|
|
43
44
|
};
|
|
44
|
-
s.call(void 0,
|
|
45
|
+
s.call(void 0, a);
|
|
45
46
|
}
|
|
46
47
|
}, this.handleScrollAction = ({ scrollAction: t, pageAction: i }) => {
|
|
47
48
|
const s = i ? i.skip : this.state.skip;
|
|
48
49
|
if (this.state.skip !== s && this.setState({ skip: s }), this.list && t) {
|
|
49
|
-
const
|
|
50
|
-
this.list.style.transform =
|
|
50
|
+
const a = `translateY(${t.offset}px)`;
|
|
51
|
+
this.list.style.transform = a;
|
|
51
52
|
}
|
|
52
53
|
}, this.lastView = this.props.activeView, this.lastFocus = this.props.focusedDate;
|
|
53
|
-
const e = this.props.service.skip(this.props.focusedDate, this.props.min),
|
|
54
|
+
const e = this.props.service.skip(this.props.focusedDate, this.props.min), p = this.props.service.total(this.props.min, this.props.max);
|
|
54
55
|
this.state = {
|
|
55
|
-
skip: e - this.getTake(e,
|
|
56
|
+
skip: e - this.getTake(e, p) > 0 ? e : 0
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
get take() {
|
|
59
|
-
return this.props.take !== void 0 ? this.props.take :
|
|
60
|
+
return this.props.take !== void 0 ? this.props.take : l.defaultProps.take;
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* @hidden
|
|
63
64
|
*/
|
|
64
|
-
componentDidUpdate(
|
|
65
|
+
componentDidUpdate(o, e) {
|
|
65
66
|
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;
|
|
66
67
|
}
|
|
67
68
|
render() {
|
|
69
|
+
const { activeView: o, min: e, max: p, service: t, unstyled: i } = this.props;
|
|
68
70
|
this.calculateHeights();
|
|
69
|
-
const
|
|
70
|
-
(
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const s = i && i.uCalendar, a = this.lastView !== o, h = v(this.props.focusedDate, e, p), c = a ? t.skip(h, e) : this.state.skip, f = t.total(e, p), k = this.getTake(c, f), x = t.addToDate(e, c), D = t.datesList(x, k);
|
|
72
|
+
(o !== this.lastView || !V(h, this.lastFocus)) && (this.indexToScroll = t.skip(h, e));
|
|
73
|
+
const w = /* @__PURE__ */ n.createElement(
|
|
74
|
+
S,
|
|
73
75
|
{
|
|
74
|
-
skip:
|
|
76
|
+
skip: c,
|
|
75
77
|
take: this.take,
|
|
76
|
-
total:
|
|
78
|
+
total: f,
|
|
77
79
|
itemHeight: this.itemHeight,
|
|
78
80
|
topOffset: this.topOffset,
|
|
79
81
|
bottomOffset: this.bottomOffset,
|
|
@@ -81,37 +83,38 @@ const k = 30, p = class p extends a.Component {
|
|
|
81
83
|
maxScrollDifference: this.maxViewHeight,
|
|
82
84
|
onScrollAction: this.handleScrollAction,
|
|
83
85
|
onMount: this.handleVirtualizationMount,
|
|
84
|
-
tabIndex: this.props.tabIndex
|
|
86
|
+
tabIndex: this.props.tabIndex,
|
|
87
|
+
unstyled: i
|
|
85
88
|
},
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
this.list =
|
|
88
|
-
}, className:
|
|
89
|
+
/* @__PURE__ */ n.createElement("ul", { ref: (m) => {
|
|
90
|
+
this.list = m;
|
|
91
|
+
}, className: d(u.ul({ c: s })) }, D.map((m) => this.buildNavigationItem(m)))
|
|
89
92
|
);
|
|
90
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ n.createElement(
|
|
91
94
|
"div",
|
|
92
95
|
{
|
|
93
|
-
className:
|
|
96
|
+
className: d(u.navigation({ c: s }))
|
|
94
97
|
},
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
this.props.dom.didCalculate ?
|
|
98
|
+
/* @__PURE__ */ n.createElement("span", { className: d(u.navigationHighlight({ c: s })) }),
|
|
99
|
+
this.props.dom.didCalculate ? w : null
|
|
97
100
|
);
|
|
98
101
|
}
|
|
99
|
-
getTake(
|
|
100
|
-
return Math.min(e -
|
|
102
|
+
getTake(o, e) {
|
|
103
|
+
return Math.min(e - o, this.take);
|
|
101
104
|
}
|
|
102
105
|
};
|
|
103
|
-
|
|
104
|
-
activeView:
|
|
105
|
-
focusedDate:
|
|
106
|
-
max:
|
|
107
|
-
min:
|
|
108
|
-
onChange:
|
|
109
|
-
take:
|
|
110
|
-
tabIndex:
|
|
111
|
-
},
|
|
112
|
-
take:
|
|
106
|
+
l.propTypes = {
|
|
107
|
+
activeView: r.number.isRequired,
|
|
108
|
+
focusedDate: r.instanceOf(Date).isRequired,
|
|
109
|
+
max: r.instanceOf(Date).isRequired,
|
|
110
|
+
min: r.instanceOf(Date).isRequired,
|
|
111
|
+
onChange: r.func,
|
|
112
|
+
take: r.number,
|
|
113
|
+
tabIndex: r.number
|
|
114
|
+
}, l.defaultProps = {
|
|
115
|
+
take: I
|
|
113
116
|
};
|
|
114
|
-
let
|
|
117
|
+
let g = l;
|
|
115
118
|
export {
|
|
116
|
-
|
|
119
|
+
g as Navigation
|
|
117
120
|
};
|
|
@@ -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 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;
|
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as r from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { provideLocalizationService as
|
|
12
|
-
import { classNames as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { getDate as
|
|
15
|
-
import { today as
|
|
16
|
-
import { dateInRange as
|
|
17
|
-
const t = class t extends
|
|
11
|
+
import { provideLocalizationService as h, registerForLocalization as u } from "@progress/kendo-react-intl";
|
|
12
|
+
import { classNames as f, uCalendar as g } from "@progress/kendo-react-common";
|
|
13
|
+
import { Button as x } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { getDate as n } from "@progress/kendo-date-math";
|
|
15
|
+
import { today as l, messages as v } from "../../messages/index.mjs";
|
|
16
|
+
import { dateInRange as C, getToday as m, MIN_DATE as k, MAX_DATE as I, isInRange as y } from "../../utils.mjs";
|
|
17
|
+
const t = class t extends r.Component {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments), this.localization = null, this.handleClick = (i) => {
|
|
20
20
|
if (this.todayIsInRange && this.props.onClick) {
|
|
21
21
|
const s = {
|
|
22
22
|
syntheticEvent: i,
|
|
23
23
|
nativeEvent: i.nativeEvent,
|
|
24
|
-
value:
|
|
24
|
+
value: C(m(), this.min, this.max),
|
|
25
25
|
target: this,
|
|
26
26
|
isTodayClick: !0
|
|
27
27
|
};
|
|
@@ -36,27 +36,23 @@ const t = class t extends o.Component {
|
|
|
36
36
|
return this.props.max !== void 0 ? this.props.max : t.defaultProps.max;
|
|
37
37
|
}
|
|
38
38
|
get todayIsInRange() {
|
|
39
|
-
return
|
|
39
|
+
return y(m(), n(this.min), n(this.max));
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
this.
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const { disabled: i, tabIndex: s, unstyled: o } = this.props, p = o && o.uCalendar;
|
|
43
|
+
this.localization = h(this);
|
|
44
|
+
const c = this.localization.toLanguageString(l, v[l]), d = f(g.today({ c: p, disabled: i }));
|
|
45
|
+
return /* @__PURE__ */ r.createElement(
|
|
46
|
+
x,
|
|
45
47
|
{
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
return /* @__PURE__ */ o.createElement(
|
|
50
|
-
d,
|
|
51
|
-
{
|
|
52
|
-
className: s,
|
|
48
|
+
className: d,
|
|
53
49
|
onClick: this.handleClick,
|
|
54
|
-
tabIndex:
|
|
50
|
+
tabIndex: s,
|
|
55
51
|
fillMode: "flat",
|
|
56
52
|
themeColor: "base",
|
|
57
53
|
role: "link"
|
|
58
54
|
},
|
|
59
|
-
|
|
55
|
+
c
|
|
60
56
|
);
|
|
61
57
|
}
|
|
62
58
|
};
|
|
@@ -66,11 +62,11 @@ t.propTypes = {
|
|
|
66
62
|
onClick: e.func,
|
|
67
63
|
disabled: e.bool
|
|
68
64
|
}, t.defaultProps = {
|
|
69
|
-
min:
|
|
70
|
-
max:
|
|
65
|
+
min: k,
|
|
66
|
+
max: I
|
|
71
67
|
};
|
|
72
68
|
let a = t;
|
|
73
|
-
|
|
69
|
+
u(a);
|
|
74
70
|
export {
|
|
75
71
|
a as TodayCommand
|
|
76
72
|
};
|
|
@@ -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 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;
|