@progress/kendo-react-dateinputs 14.4.1 → 14.5.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.d.ts +35 -110
- package/calendar/components/Calendar.js +5 -5
- package/calendar/components/Calendar.mjs +288 -313
- package/calendar/components/CalendarCell.d.ts +1 -10
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +68 -78
- package/calendar/components/Header.d.ts +10 -23
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +41 -55
- package/calendar/components/HorizontalViewList.d.ts +28 -26
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +112 -102
- package/calendar/components/MultiViewCalendar.d.ts +39 -141
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +331 -373
- package/calendar/components/Navigation.d.ts +19 -39
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +95 -107
- package/calendar/components/TodayCommand.d.ts +8 -25
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +44 -61
- package/calendar/components/View.d.ts +11 -42
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +111 -137
- package/calendar/components/ViewList.d.ts +25 -65
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +207 -225
- package/calendar/services/ScrollSyncService.d.ts +4 -4
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/virtualization/Virtualization.d.ts +25 -63
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +163 -168
|
@@ -5,98 +5,88 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { classNames as
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
8
|
+
import * as l from "react";
|
|
9
|
+
import { classNames as S, uCalendar as C } from "@progress/kendo-react-common";
|
|
10
|
+
const A = (a, s) => {
|
|
11
|
+
const n = Object.getOwnPropertyNames(a), r = Object.getOwnPropertyNames(s);
|
|
12
|
+
if (n.length !== r.length)
|
|
13
13
|
return !1;
|
|
14
|
-
for (let
|
|
15
|
-
const o = t
|
|
16
|
-
if (
|
|
14
|
+
for (let t = 0; t < n.length; t++) {
|
|
15
|
+
const o = n[t];
|
|
16
|
+
if (a[o] !== s[o])
|
|
17
17
|
return !1;
|
|
18
18
|
}
|
|
19
19
|
return !0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments), this.handleClick = (e) => {
|
|
24
|
-
const { onClick: t, value: n } = this.props;
|
|
25
|
-
t && t.call(void 0, n, e);
|
|
26
|
-
}, this.handleMouseEnter = () => {
|
|
27
|
-
const { onMouseEnter: e, value: t } = this.props;
|
|
28
|
-
e && e.call(void 0, t);
|
|
29
|
-
}, this.handleMouseLeave = () => {
|
|
30
|
-
const { onMouseLeave: e, value: t } = this.props;
|
|
31
|
-
e && e.call(void 0, t);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
// Manually checking if the component needs an update
|
|
35
|
-
// due to date object being compared by instance
|
|
36
|
-
// and new Date object is created
|
|
37
|
-
// every time and fails the shallow compare of the React.PureComponent.
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
shouldComponentUpdate(e) {
|
|
42
|
-
const { value: t, ...n } = this.props, { value: a, ...o } = e;
|
|
43
|
-
return !((!(t && a) || t.getTime() === a.getTime()) && y(n, o));
|
|
44
|
-
}
|
|
45
|
-
/* eslint-disable max-len */
|
|
46
|
-
render() {
|
|
20
|
+
}, I = l.memo(
|
|
21
|
+
(a) => {
|
|
47
22
|
const {
|
|
48
|
-
className:
|
|
49
|
-
formattedValue:
|
|
50
|
-
isWeekend:
|
|
51
|
-
isFocused:
|
|
23
|
+
className: s,
|
|
24
|
+
formattedValue: n,
|
|
25
|
+
isWeekend: r,
|
|
26
|
+
isFocused: t,
|
|
52
27
|
isInRange: o,
|
|
53
|
-
isSelected:
|
|
28
|
+
isSelected: u,
|
|
54
29
|
isRangeStart: i,
|
|
55
|
-
isRangeMid:
|
|
30
|
+
isRangeMid: N,
|
|
56
31
|
isRangeEnd: c,
|
|
57
|
-
isRangeSplitStart:
|
|
58
|
-
isRangeSplitEnd:
|
|
59
|
-
isToday:
|
|
60
|
-
isDisabled:
|
|
61
|
-
view:
|
|
62
|
-
value:
|
|
63
|
-
isOtherMonth:
|
|
64
|
-
showOtherMonthDays:
|
|
65
|
-
allowReverse:
|
|
66
|
-
unstyled:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
E
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
32
|
+
isRangeSplitStart: y,
|
|
33
|
+
isRangeSplitEnd: k,
|
|
34
|
+
isToday: w,
|
|
35
|
+
isDisabled: O,
|
|
36
|
+
view: D,
|
|
37
|
+
value: d,
|
|
38
|
+
isOtherMonth: e,
|
|
39
|
+
showOtherMonthDays: m,
|
|
40
|
+
allowReverse: g,
|
|
41
|
+
unstyled: p,
|
|
42
|
+
activeRangeEnd: v,
|
|
43
|
+
children: P,
|
|
44
|
+
onClick: E,
|
|
45
|
+
onMouseEnter: f,
|
|
46
|
+
onMouseLeave: h,
|
|
47
|
+
...b
|
|
48
|
+
} = a, x = (q) => {
|
|
49
|
+
E && E(d, q);
|
|
50
|
+
}, L = () => {
|
|
51
|
+
f && f(d);
|
|
52
|
+
}, T = () => {
|
|
53
|
+
h && h(d);
|
|
54
|
+
}, V = v === "end" && c, j = v === "start" && i, R = p && p.uCalendar, M = S(
|
|
55
|
+
C.td({
|
|
56
|
+
c: R,
|
|
57
|
+
rangeStart: !e && !g && i,
|
|
58
|
+
rangeEnd: !e && !g && c,
|
|
59
|
+
rangeMid: !e && N,
|
|
60
|
+
rangeSplitEnd: !e && k,
|
|
61
|
+
rangeSplitStart: !e && y,
|
|
62
|
+
active: j || V,
|
|
63
|
+
focused: t,
|
|
64
|
+
selected: !e && (u || i || c),
|
|
65
|
+
today: !e && w,
|
|
66
|
+
weekend: r,
|
|
67
|
+
disabled: O,
|
|
68
|
+
isOtherMonth: e,
|
|
69
|
+
isEmpty: !m && e
|
|
84
70
|
}),
|
|
85
|
-
|
|
71
|
+
s
|
|
86
72
|
);
|
|
87
|
-
return !
|
|
73
|
+
return !m && e ? /* @__PURE__ */ l.createElement("td", { role: "gridcell", className: M }) : /* @__PURE__ */ l.createElement(
|
|
88
74
|
"td",
|
|
89
75
|
{
|
|
90
|
-
...
|
|
91
|
-
className:
|
|
92
|
-
onClick:
|
|
93
|
-
onMouseEnter:
|
|
94
|
-
onMouseLeave:
|
|
76
|
+
...b,
|
|
77
|
+
className: M,
|
|
78
|
+
onClick: x,
|
|
79
|
+
onMouseEnter: L,
|
|
80
|
+
onMouseLeave: T
|
|
95
81
|
},
|
|
96
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ l.createElement("span", { className: S(C.link({ c: R })) }, P)
|
|
97
83
|
);
|
|
84
|
+
},
|
|
85
|
+
(a, s) => {
|
|
86
|
+
const { value: n, ...r } = a, { value: t, ...o } = s;
|
|
87
|
+
return (!(n && t) || n.getTime() === t.getTime()) && A(r, o);
|
|
98
88
|
}
|
|
99
|
-
|
|
89
|
+
);
|
|
100
90
|
export {
|
|
101
|
-
|
|
91
|
+
I as CalendarCell
|
|
102
92
|
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
8
|
import { DateInputsClassStructure } from '@progress/kendo-react-common';
|
|
10
9
|
import { CalendarHeaderTitleProps } from './CalendarHeaderTitle.js';
|
|
11
10
|
import { BusViewService } from '../services/index.js';
|
|
@@ -19,7 +18,7 @@ export interface HeaderEventArguments {
|
|
|
19
18
|
syntheticEvent: React.SyntheticEvent<any>;
|
|
20
19
|
nativeEvent?: any;
|
|
21
20
|
value: Date;
|
|
22
|
-
target:
|
|
21
|
+
target: any;
|
|
23
22
|
isTodayClick?: boolean;
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
@@ -42,24 +41,12 @@ export interface HeaderProps {
|
|
|
42
41
|
/**
|
|
43
42
|
* @hidden
|
|
44
43
|
*/
|
|
45
|
-
export declare
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
rangeLength: number;
|
|
55
|
-
min: Date;
|
|
56
|
-
max: Date;
|
|
57
|
-
};
|
|
58
|
-
protected get min(): Date;
|
|
59
|
-
protected get max(): Date;
|
|
60
|
-
protected get rangeLength(): number;
|
|
61
|
-
protected get canMoveUp(): boolean;
|
|
62
|
-
render(): React.JSX.Element;
|
|
63
|
-
protected getTitle: () => string;
|
|
64
|
-
private handleTitleClick;
|
|
65
|
-
}
|
|
44
|
+
export declare const headerDefaultProps: {
|
|
45
|
+
rangeLength: number;
|
|
46
|
+
min: Date;
|
|
47
|
+
max: Date;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export declare const Header: (props: HeaderProps) => React.JSX.Element;
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),a=require("@progress/kendo-react-common"),_=require("./CalendarHeaderTitle.js"),T=require("../../utils.js");function q(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const n=q(k),d={rangeLength:1,min:T.MIN_DATE,max:T.MAX_DATE},w=r=>{const{activeView:e,bus:t,currentDate:c,max:h=d.max,min:N=d.min,rangeLength:b=d.rangeLength,service:s,headerTitle:m,header:p,commands:g,verticalView:D,unstyled:f}=r,E=i=>{t.canMoveUp(e)&&t.moveUp(e,i)},H=()=>{if(!c)return"";const i=b-1,v=s.title(c),C=s.addToDate(c,i);return i<1||!s.isInRange(C,N,h)?v:`${v} - ${s.title(C)}`},l=f&&f.uCalendar,M=t.canMoveUp(e),o=H(),P=a.classNames(a.uCalendar.title({c:l})),u={children:o,value:o,view:e,className:P,onClick:E,disabled:!M},y={headerTitleProps:u,commands:g},O=m?n.createElement(m,{...u},o):n.createElement(_.CalendarHeaderTitle,{...u},o),j=p?n.createElement(p,{...y}):n.createElement(n.Fragment,null,O,n.createElement("span",{className:a.classNames(a.uCalendar.spacer({c:l}))}),n.createElement("span",{className:a.classNames(a.uCalendar.nav({c:l}))},g));return n.createElement("div",{className:a.classNames(a.uCalendar.header({c:l,vertical:D}))},j)};exports.Header=w;exports.headerDefaultProps=d;
|
|
@@ -6,62 +6,48 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { MAX_DATE as T, MIN_DATE as D } from "../../utils.mjs";
|
|
14
|
-
const t = class t extends e.Component {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments), this.getTitle = () => {
|
|
17
|
-
if (!this.props.currentDate)
|
|
18
|
-
return "";
|
|
19
|
-
const s = this.rangeLength - 1, a = this.props.service.title(this.props.currentDate), r = this.props.service.addToDate(this.props.currentDate, s);
|
|
20
|
-
return s < 1 || !this.props.service.isInRange(r, this.min, this.max) ? a : `${a} - ${this.props.service.title(r)}`;
|
|
21
|
-
}, this.handleTitleClick = (s) => {
|
|
22
|
-
this.canMoveUp && this.props.bus.moveUp(this.props.activeView, s);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
get min() {
|
|
26
|
-
return this.props.min !== void 0 ? this.props.min : t.defaultProps.min;
|
|
27
|
-
}
|
|
28
|
-
get max() {
|
|
29
|
-
return this.props.max !== void 0 ? this.props.max : t.defaultProps.max;
|
|
30
|
-
}
|
|
31
|
-
get rangeLength() {
|
|
32
|
-
return this.props.rangeLength !== void 0 ? this.props.rangeLength : t.defaultProps.rangeLength;
|
|
33
|
-
}
|
|
34
|
-
get canMoveUp() {
|
|
35
|
-
return this.props.bus.canMoveUp(this.props.activeView);
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
const { activeView: s, commands: a, unstyled: r } = this.props, n = r && r.uCalendar, p = this.getTitle(), m = o(c.title({ c: n })), h = {
|
|
39
|
-
children: p,
|
|
40
|
-
value: p,
|
|
41
|
-
view: s,
|
|
42
|
-
className: m,
|
|
43
|
-
onClick: this.handleTitleClick,
|
|
44
|
-
disabled: !this.canMoveUp
|
|
45
|
-
}, d = {
|
|
46
|
-
headerTitleProps: h,
|
|
47
|
-
commands: a
|
|
48
|
-
}, 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));
|
|
49
|
-
return /* @__PURE__ */ e.createElement("div", { className: o(c.header({ c: n, vertical: this.props.verticalView })) }, g);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
t.propTypes = {
|
|
53
|
-
activeView: i.number.isRequired,
|
|
54
|
-
currentDate: i.instanceOf(Date).isRequired,
|
|
55
|
-
max: i.instanceOf(Date).isRequired,
|
|
56
|
-
min: i.instanceOf(Date).isRequired,
|
|
57
|
-
rangeLength: i.number
|
|
58
|
-
}, t.defaultProps = {
|
|
9
|
+
import { classNames as s, uCalendar as l } from "@progress/kendo-react-common";
|
|
10
|
+
import { CalendarHeaderTitle as L } from "./CalendarHeaderTitle.mjs";
|
|
11
|
+
import { MAX_DATE as P, MIN_DATE as b } from "../../utils.mjs";
|
|
12
|
+
const d = {
|
|
59
13
|
rangeLength: 1,
|
|
60
|
-
min:
|
|
61
|
-
max:
|
|
14
|
+
min: b,
|
|
15
|
+
max: P
|
|
16
|
+
}, _ = (C) => {
|
|
17
|
+
const {
|
|
18
|
+
activeView: t,
|
|
19
|
+
bus: o,
|
|
20
|
+
currentDate: i,
|
|
21
|
+
max: E = d.max,
|
|
22
|
+
min: f = d.min,
|
|
23
|
+
rangeLength: N = d.rangeLength,
|
|
24
|
+
service: a,
|
|
25
|
+
headerTitle: p,
|
|
26
|
+
header: u,
|
|
27
|
+
commands: h,
|
|
28
|
+
verticalView: D,
|
|
29
|
+
unstyled: v
|
|
30
|
+
} = C, x = (c) => {
|
|
31
|
+
o.canMoveUp(t) && o.moveUp(t, c);
|
|
32
|
+
}, H = () => {
|
|
33
|
+
if (!i)
|
|
34
|
+
return "";
|
|
35
|
+
const c = N - 1, T = a.title(i), g = a.addToDate(i, c);
|
|
36
|
+
return c < 1 || !a.isInRange(g, f, E) ? T : `${T} - ${a.title(g)}`;
|
|
37
|
+
}, n = v && v.uCalendar, M = o.canMoveUp(t), r = H(), U = s(l.title({ c: n })), m = {
|
|
38
|
+
children: r,
|
|
39
|
+
value: r,
|
|
40
|
+
view: t,
|
|
41
|
+
className: U,
|
|
42
|
+
onClick: x,
|
|
43
|
+
disabled: !M
|
|
44
|
+
}, k = {
|
|
45
|
+
headerTitleProps: m,
|
|
46
|
+
commands: h
|
|
47
|
+
}, w = p ? /* @__PURE__ */ e.createElement(p, { ...m }, r) : /* @__PURE__ */ e.createElement(L, { ...m }, r), A = u ? /* @__PURE__ */ e.createElement(u, { ...k }) : /* @__PURE__ */ e.createElement(e.Fragment, null, w, /* @__PURE__ */ e.createElement("span", { className: s(l.spacer({ c: n })) }), /* @__PURE__ */ e.createElement("span", { className: s(l.nav({ c: n })) }, h));
|
|
48
|
+
return /* @__PURE__ */ e.createElement("div", { className: s(l.header({ c: n, vertical: D })) }, A);
|
|
62
49
|
};
|
|
63
|
-
let l = t;
|
|
64
|
-
v(l);
|
|
65
50
|
export {
|
|
66
|
-
|
|
51
|
+
_ as Header,
|
|
52
|
+
d as headerDefaultProps
|
|
67
53
|
};
|
|
@@ -12,6 +12,14 @@ import { BusViewService } from '../services/index.js';
|
|
|
12
12
|
import { CalendarViewEnum, ViewService, SelectionRange } from '../models/index.js';
|
|
13
13
|
import { WeekDaysFormat } from '../models/WeekDaysFormat';
|
|
14
14
|
import * as React from 'react';
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export interface HorizontalViewListHandle {
|
|
19
|
+
element: HTMLDivElement | null;
|
|
20
|
+
focusActiveDate: () => void;
|
|
21
|
+
blurActiveDate: () => void;
|
|
22
|
+
}
|
|
15
23
|
/**
|
|
16
24
|
* @hidden
|
|
17
25
|
*/
|
|
@@ -19,7 +27,7 @@ export interface HorizontalViewListEventArguments {
|
|
|
19
27
|
syntheticEvent: React.SyntheticEvent<any>;
|
|
20
28
|
nativeEvent?: any;
|
|
21
29
|
value: Date;
|
|
22
|
-
target:
|
|
30
|
+
target: HorizontalViewListHandle;
|
|
23
31
|
isTodayClick: boolean;
|
|
24
32
|
}
|
|
25
33
|
/**
|
|
@@ -53,28 +61,22 @@ export interface HorizontalViewListProps {
|
|
|
53
61
|
/**
|
|
54
62
|
* @hidden
|
|
55
63
|
*/
|
|
56
|
-
export declare
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
componentDidUpdate(): void;
|
|
76
|
-
render(): React.JSX.Element;
|
|
77
|
-
protected rotateSelectionRange: (selectionRange: SelectionRange) => SelectionRange;
|
|
78
|
-
private handleWeekCellClick;
|
|
79
|
-
private handleDateChange;
|
|
80
|
-
}
|
|
64
|
+
export declare const horizontalViewListDefaultProps: {
|
|
65
|
+
showWeekNumbers: boolean;
|
|
66
|
+
views: number;
|
|
67
|
+
take: number;
|
|
68
|
+
allowReverse: boolean;
|
|
69
|
+
weekDaysFormat: "short";
|
|
70
|
+
min: Date;
|
|
71
|
+
max: Date;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @hidden
|
|
75
|
+
*/
|
|
76
|
+
export type HorizontalViewList = HorizontalViewListHandle;
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
export declare const HorizontalViewList: React.ForwardRefExoticComponent<HorizontalViewListProps & React.RefAttributes<HorizontalViewListHandle | null>> & {
|
|
81
|
+
defaultProps: typeof horizontalViewListDefaultProps;
|
|
82
|
+
};
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),U=require("./View.js"),u=require("../models/CalendarViewEnum.js"),B=require("@progress/kendo-react-common"),K=require("@progress/kendo-date-math"),C=require("../../utils.js");function X(a){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(l,o,i.get?i:{enumerable:!0,get:()=>a[o]})}}return l.default=a,Object.freeze(l)}const t=X(I),D=2,s={showWeekNumbers:!1,views:D,take:D,allowReverse:!0,weekDaysFormat:"short",min:C.MIN_DATE,max:C.MAX_DATE},E=t.forwardRef((a,l)=>{const{showWeekNumbers:o=s.showWeekNumbers,allowReverse:i=s.allowReverse,weekDaysFormat:b=s.weekDaysFormat,min:p=s.min,max:V=s.max,activeView:c,bus:N,cellUID:g,focusedDate:S,onChange:w,onWeekSelect:k,selectionRange:v,service:L,value:T,onCellEnter:q,cell:O,weekCell:z,showOtherMonthDays:A,dates:H,verticalView:h}=a,_=!!(o&&c===u.CalendarViewEnum.month),y=()=>{if(!r.current)return;const e=r.current.querySelector("td.k-focus"),n=r.current.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),n&&n.classList.add("k-focus"),f.current=!0},M=()=>{if(!r.current)return;const e=r.current.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),f.current=!1},W=e=>{if(e.start===null||e.end===null)return e;const n=e.end<e.start;return{start:n?e.end:e.start,end:n?e.start:e.end}},j=(e,n,d)=>{k&&d&&k(e,n,d)},P=(e,n=!1)=>{if(w){const d={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:K.cloneDate(e.value),target:m.current,isTodayClick:n};w(d)}},m=t.useRef(null);t.useImperativeHandle(m,()=>({element:r.current,focusActiveDate:y,blurActiveDate:M})),t.useImperativeHandle(l,()=>m.current);const r=t.useRef(null),f=t.useRef(!1);t.useEffect(()=>{f.current&&y()});const F=i?W(v):v,x=B.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":h,"k-hstack":!h,"k-calendar-monthview":c===u.CalendarViewEnum.month,"k-calendar-yearview":c===u.CalendarViewEnum.year,"k-calendar-decadeview":c===u.CalendarViewEnum.decade,"k-calendar-centuryview":c===u.CalendarViewEnum.century});return t.createElement("div",{ref:r,className:x},H.map(e=>t.createElement("table",{className:"k-calendar-table",key:e.getTime(),role:"grid"},t.createElement(U.View,{bus:N,weekDaysFormat:b,service:L,key:e.getTime(),direction:"horizontal",activeView:c,cellUID:g,viewDate:e,min:p,max:V,focusedDate:S,selectionRange:F,selectedDate:T,showWeekNumbers:_,onChange:P,onWeekSelect:j,onCellEnter:q,cell:O,weekCell:z,showOtherMonthDays:A,allowReverse:i}))))});E.displayName="KendoReactHorizontalViewList";const R=E;R.defaultProps=s;exports.HorizontalViewList=R;exports.horizontalViewListDefaultProps=s;
|