@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,13 +5,18 @@
|
|
|
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 { CalendarNavigationItemProps } from './CalendarNavigationItem.js';
|
|
10
9
|
import { DOMService } from '../services/index.js';
|
|
11
|
-
import {
|
|
10
|
+
import { VirtualizationHandle } from '../../virtualization/Virtualization.js';
|
|
12
11
|
import { CalendarViewEnum, ViewService } from '../models/index.js';
|
|
13
12
|
import { DateInputsClassStructure } from '@progress/kendo-react-common';
|
|
14
13
|
import * as React from 'react';
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export interface NavigationHandle {
|
|
18
|
+
virtualization: VirtualizationHandle | null;
|
|
19
|
+
}
|
|
15
20
|
/**
|
|
16
21
|
* @hidden
|
|
17
22
|
*/
|
|
@@ -19,7 +24,7 @@ export interface NavigationEventArguments {
|
|
|
19
24
|
syntheticEvent: React.SyntheticEvent<any>;
|
|
20
25
|
nativeEvent?: any;
|
|
21
26
|
value: Date;
|
|
22
|
-
target:
|
|
27
|
+
target: NavigationHandle;
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* @hidden
|
|
@@ -47,39 +52,14 @@ export interface NavigationState {
|
|
|
47
52
|
/**
|
|
48
53
|
* @hidden
|
|
49
54
|
*/
|
|
50
|
-
export declare
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
take: number;
|
|
62
|
-
};
|
|
63
|
-
virtualization: Virtualization | null;
|
|
64
|
-
private list;
|
|
65
|
-
private itemHeight;
|
|
66
|
-
private topOffset;
|
|
67
|
-
private maxViewHeight;
|
|
68
|
-
private bottomOffset;
|
|
69
|
-
private lastView;
|
|
70
|
-
private indexToScroll?;
|
|
71
|
-
private lastFocus;
|
|
72
|
-
protected get take(): number;
|
|
73
|
-
constructor(props: NavigationProps);
|
|
74
|
-
/**
|
|
75
|
-
* @hidden
|
|
76
|
-
*/
|
|
77
|
-
componentDidUpdate(_prevProps: NavigationProps, _prevState: NavigationState): void;
|
|
78
|
-
render(): React.JSX.Element;
|
|
79
|
-
protected handleVirtualizationMount: (virtualization: Virtualization) => void;
|
|
80
|
-
protected buildNavigationItem: (date: Date) => React.ReactNode;
|
|
81
|
-
protected calculateHeights: () => void;
|
|
82
|
-
protected getTake(skip: number, total: number): number;
|
|
83
|
-
private handleDateChange;
|
|
84
|
-
private handleScrollAction;
|
|
85
|
-
}
|
|
55
|
+
export declare const navigationDefaultProps: {
|
|
56
|
+
take: number;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
export type Navigation = NavigationHandle;
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
export declare const Navigation: React.ForwardRefExoticComponent<NavigationProps & React.RefAttributes<NavigationHandle | null>>;
|
|
@@ -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 X=require("react"),x=require("@progress/kendo-date-math"),Z=require("./CalendarNavigationItem.js"),O=require("../../utils.js"),tt=require("../../virtualization/Virtualization.js"),m=require("@progress/kendo-react-common");function et(l){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const c in l)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(l,c);Object.defineProperty(f,c,r.get?r:{enumerable:!0,get:()=>l[c]})}}return f.default=l,Object.freeze(f)}const e=et(X),nt=30,V={take:nt},q=e.forwardRef((l,f)=>{const{take:c=V.take,activeView:r,dom:d,focusedDate:g,max:p,min:o,onScroll:M,onChange:H,service:i,navigationItem:T,tabIndex:z,unstyled:R}=l,P=(t,n)=>{if(H&&n){const a={value:x.cloneDate(t),target:I.current,nativeEvent:n==null?void 0:n.nativeEvent,syntheticEvent:n};H(a)}},j=({scrollAction:t,pageAction:n})=>{const a=n?n.skip:void 0;if(a!==void 0&&B(s=>s.skip!==a?{skip:a}:s),v.current&&t){const s=`translateY(${t.offset}px)`;v.current.style.transform=s}},_=t=>{if(u.current=t,u.current&&v.current){const n=d.calendarHeight,a=d.navigationItemHeight||1,s=(n-a)/2;v.current.style.transform=`translateY(${s}px)`;const h=O.dateInRange(g,o,p),W=i.skip(h,o);u.current.scrollToIndex(W)}},$=t=>{const n=i.navigationTitle(t),a=i.isRangeStart(t),s=`kendo-react-calendar-nav-item-${t.getTime()}`,h={text:n,value:t,isRangeStart:a,view:r,onClick:P};return T?e.createElement(T,{...h,key:s},n):e.createElement(Z.CalendarNavigationItem,{...h,key:s},n)},u=e.useRef(null),I=e.useRef(null);e.useImperativeHandle(I,()=>({get virtualization(){return u.current}})),e.useImperativeHandle(f,()=>I.current);const v=e.useRef(null),N=e.useRef(r),E=e.useRef(g),k=e.useRef(void 0),[Y,B]=e.useState(()=>{const t=i.skip(g,o),n=i.total(o,p),a=Math.min(n-t,c);return{skip:t-a>0?t:0}});e.useEffect(()=>{k.current!==void 0&&u.current&&u.current.scrollToIndex(k.current),N.current=r,E.current=g,k.current=void 0});const b=d.calendarHeight,C=d.navigationItemHeight||1,F=d.monthViewHeight,K=(b-C)/2,L=b-C,S=R&&R.uCalendar,U=N.current!==r,D=O.dateInRange(g,o,p),y=U?i.skip(D,o):Y.skip,w=i.total(o,p),A=Math.min(w-y,c),G=i.addToDate(o,y),J=i.datesList(G,A);(r!==N.current||!x.isEqual(D,E.current))&&(k.current=i.skip(D,o));const Q=e.createElement(tt.Virtualization,{skip:y,take:c,total:w,itemHeight:C,topOffset:K,bottomOffset:L,onScroll:M,maxScrollDifference:F,onScrollAction:j,onMount:t=>!u.current&&_(t),tabIndex:z,unstyled:R},e.createElement("ul",{ref:v,className:m.classNames(m.uCalendar.ul({c:S}))},J.map(t=>$(t))));return e.createElement("div",{className:m.classNames(m.uCalendar.navigation({c:S}))},e.createElement("span",{className:m.classNames(m.uCalendar.navigationHighlight({c:S}))}),d.didCalculate?Q:null)});q.displayName="KendoReactNavigation";const at=q;exports.Navigation=at;exports.navigationDefaultProps=V;
|
|
@@ -5,115 +5,103 @@
|
|
|
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
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { isEqual as W, cloneDate as X } from "@progress/kendo-date-math";
|
|
10
|
+
import { CalendarNavigationItem as Z } from "./CalendarNavigationItem.mjs";
|
|
11
|
+
import { dateInRange as y } from "../../utils.mjs";
|
|
12
|
+
import { Virtualization as tt } from "../../virtualization/Virtualization.mjs";
|
|
13
|
+
import { classNames as C, uCalendar as E } from "@progress/kendo-react-common";
|
|
14
|
+
const et = 30, nt = {
|
|
15
|
+
take: et
|
|
16
|
+
}, V = e.forwardRef((M, z) => {
|
|
17
|
+
const {
|
|
18
|
+
take: p = nt.take,
|
|
19
|
+
activeView: l,
|
|
20
|
+
dom: c,
|
|
21
|
+
focusedDate: u,
|
|
22
|
+
max: f,
|
|
23
|
+
min: i,
|
|
24
|
+
onScroll: O,
|
|
25
|
+
onChange: N,
|
|
26
|
+
service: o,
|
|
27
|
+
navigationItem: S,
|
|
28
|
+
tabIndex: b,
|
|
29
|
+
unstyled: v
|
|
30
|
+
} = M, $ = (t, n) => {
|
|
31
|
+
if (N && n) {
|
|
32
|
+
const a = {
|
|
33
|
+
value: X(t),
|
|
34
|
+
target: h.current,
|
|
35
|
+
nativeEvent: n == null ? void 0 : n.nativeEvent,
|
|
36
|
+
syntheticEvent: n
|
|
30
37
|
};
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
N(a);
|
|
39
|
+
}
|
|
40
|
+
}, q = ({ scrollAction: t, pageAction: n }) => {
|
|
41
|
+
const a = n ? n.skip : void 0;
|
|
42
|
+
if (a !== void 0 && F((s) => s.skip !== a ? { skip: a } : s), m.current && t) {
|
|
43
|
+
const s = `translateY(${t.offset}px)`;
|
|
44
|
+
m.current.style.transform = s;
|
|
45
|
+
}
|
|
46
|
+
}, P = (t) => {
|
|
47
|
+
if (r.current = t, r.current && m.current) {
|
|
48
|
+
const n = c.calendarHeight, a = c.navigationItemHeight || 1, s = (n - a) / 2;
|
|
49
|
+
m.current.style.transform = `translateY(${s}px)`;
|
|
50
|
+
const g = y(u, i, f), Q = o.skip(g, i);
|
|
51
|
+
r.current.scrollToIndex(Q);
|
|
52
|
+
}
|
|
53
|
+
}, Y = (t) => {
|
|
54
|
+
const n = o.navigationTitle(t), a = o.isRangeStart(t), s = `kendo-react-calendar-nav-item-${t.getTime()}`, g = {
|
|
55
|
+
text: n,
|
|
56
|
+
value: t,
|
|
57
|
+
isRangeStart: a,
|
|
58
|
+
view: l,
|
|
59
|
+
onClick: $
|
|
60
|
+
};
|
|
61
|
+
return S ? /* @__PURE__ */ e.createElement(S, { ...g, key: s }, n) : /* @__PURE__ */ e.createElement(Z, { ...g, key: s }, n);
|
|
62
|
+
}, r = e.useRef(null), h = e.useRef(null);
|
|
63
|
+
e.useImperativeHandle(
|
|
64
|
+
h,
|
|
65
|
+
() => ({
|
|
66
|
+
get virtualization() {
|
|
67
|
+
return r.current;
|
|
51
68
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
})
|
|
70
|
+
), e.useImperativeHandle(z, () => h.current);
|
|
71
|
+
const m = e.useRef(null), k = e.useRef(l), T = e.useRef(u), d = e.useRef(void 0), [B, F] = e.useState(() => {
|
|
72
|
+
const t = o.skip(u, i), n = o.total(i, f), a = Math.min(n - t, p);
|
|
73
|
+
return {
|
|
74
|
+
skip: t - a > 0 ? t : 0
|
|
56
75
|
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
tabIndex: this.props.tabIndex,
|
|
86
|
-
unstyled: i
|
|
87
|
-
},
|
|
88
|
-
/* @__PURE__ */ n.createElement(
|
|
89
|
-
"ul",
|
|
90
|
-
{
|
|
91
|
-
ref: (l) => {
|
|
92
|
-
this.list = l;
|
|
93
|
-
},
|
|
94
|
-
className: d(u.ul({ c: s }))
|
|
95
|
-
},
|
|
96
|
-
D.map((l) => this.buildNavigationItem(l))
|
|
97
|
-
)
|
|
98
|
-
);
|
|
99
|
-
return /* @__PURE__ */ n.createElement("div", { className: d(u.navigation({ c: s })) }, /* @__PURE__ */ n.createElement("span", { className: d(u.navigationHighlight({ c: s })) }), this.props.dom.didCalculate ? w : null);
|
|
100
|
-
}
|
|
101
|
-
getTake(o, e) {
|
|
102
|
-
return Math.min(e - o, this.take);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
p.propTypes = {
|
|
106
|
-
activeView: r.number.isRequired,
|
|
107
|
-
focusedDate: r.instanceOf(Date).isRequired,
|
|
108
|
-
max: r.instanceOf(Date).isRequired,
|
|
109
|
-
min: r.instanceOf(Date).isRequired,
|
|
110
|
-
onChange: r.func,
|
|
111
|
-
take: r.number,
|
|
112
|
-
tabIndex: r.number
|
|
113
|
-
}, p.defaultProps = {
|
|
114
|
-
take: I
|
|
115
|
-
};
|
|
116
|
-
let g = p;
|
|
76
|
+
});
|
|
77
|
+
e.useEffect(() => {
|
|
78
|
+
d.current !== void 0 && r.current && r.current.scrollToIndex(d.current), k.current = l, T.current = u, d.current = void 0;
|
|
79
|
+
});
|
|
80
|
+
const w = c.calendarHeight, R = c.navigationItemHeight || 1, K = c.monthViewHeight, L = (w - R) / 2, U = w - R, I = v && v.uCalendar, _ = k.current !== l, H = y(u, i, f), x = _ ? o.skip(H, i) : B.skip, D = o.total(i, f), j = Math.min(D - x, p), A = o.addToDate(i, x), G = o.datesList(A, j);
|
|
81
|
+
(l !== k.current || !W(H, T.current)) && (d.current = o.skip(H, i));
|
|
82
|
+
const J = /* @__PURE__ */ e.createElement(
|
|
83
|
+
tt,
|
|
84
|
+
{
|
|
85
|
+
skip: x,
|
|
86
|
+
take: p,
|
|
87
|
+
total: D,
|
|
88
|
+
itemHeight: R,
|
|
89
|
+
topOffset: L,
|
|
90
|
+
bottomOffset: U,
|
|
91
|
+
onScroll: O,
|
|
92
|
+
maxScrollDifference: K,
|
|
93
|
+
onScrollAction: q,
|
|
94
|
+
onMount: (t) => !r.current && P(t),
|
|
95
|
+
tabIndex: b,
|
|
96
|
+
unstyled: v
|
|
97
|
+
},
|
|
98
|
+
/* @__PURE__ */ e.createElement("ul", { ref: m, className: C(E.ul({ c: I })) }, G.map((t) => Y(t)))
|
|
99
|
+
);
|
|
100
|
+
return /* @__PURE__ */ e.createElement("div", { className: C(E.navigation({ c: I })) }, /* @__PURE__ */ e.createElement("span", { className: C(E.navigationHighlight({ c: I })) }), c.didCalculate ? J : null);
|
|
101
|
+
});
|
|
102
|
+
V.displayName = "KendoReactNavigation";
|
|
103
|
+
const ct = V;
|
|
117
104
|
export {
|
|
118
|
-
|
|
105
|
+
ct as Navigation,
|
|
106
|
+
nt as navigationDefaultProps
|
|
119
107
|
};
|
|
@@ -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 { HeaderEventArguments } from './Header.js';
|
|
11
10
|
import * as React from 'react';
|
|
@@ -20,27 +19,11 @@ export interface TodayCommandProps {
|
|
|
20
19
|
tabIndex?: number;
|
|
21
20
|
unstyled?: DateInputsClassStructure;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* The default props for the TodayCommand component.
|
|
35
|
-
*/
|
|
36
|
-
static defaultProps: {
|
|
37
|
-
min: Date;
|
|
38
|
-
max: Date;
|
|
39
|
-
};
|
|
40
|
-
protected get min(): Date;
|
|
41
|
-
protected get max(): Date;
|
|
42
|
-
private localization;
|
|
43
|
-
protected get todayIsInRange(): boolean;
|
|
44
|
-
private handleClick;
|
|
45
|
-
render(): React.JSX.Element;
|
|
46
|
-
}
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export declare const todayCommandDefaultProps: {
|
|
26
|
+
min: Date;
|
|
27
|
+
max: Date;
|
|
28
|
+
};
|
|
29
|
+
export declare const TodayCommand: (props: TodayCommandProps) => 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 p=require("react"),D=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),I=require("@progress/kendo-react-buttons"),d=require("@progress/kendo-date-math"),s=require("../../messages/index.js"),n=require("../../utils.js");function R(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const T=R(p),c={min:n.MIN_DATE,max:n.MAX_DATE},q=e=>{const{min:a=c.min,max:t=c.max,onClick:o,disabled:u,tabIndex:m,unstyled:r}=e,g=l=>{if(n.isInRange(n.getToday(),d.getDate(a),d.getDate(t))&&o){const k={syntheticEvent:l,nativeEvent:l.nativeEvent,value:n.dateInRange(n.getToday(),a,t),target:null,isTodayClick:!0};o(k)}},y=D.useLocalization(),f=r&&r.uCalendar,C=y.toLanguageString(s.today,s.messages[s.today]),b=i.classNames(i.uCalendar.today({c:f,disabled:u}));return T.createElement(I.Button,{className:b,onClick:g,tabIndex:m,fillMode:"flat",themeColor:"base",role:"link"},C)};exports.TodayCommand=q;exports.todayCommandDefaultProps=c;
|
|
@@ -5,67 +5,50 @@
|
|
|
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
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
fillMode: "flat",
|
|
51
|
-
themeColor: "base",
|
|
52
|
-
role: "link"
|
|
53
|
-
},
|
|
54
|
-
c
|
|
55
|
-
);
|
|
56
|
-
}
|
|
8
|
+
import * as I from "react";
|
|
9
|
+
import { useLocalization as k } from "@progress/kendo-react-intl";
|
|
10
|
+
import { classNames as v, uCalendar as x } from "@progress/kendo-react-common";
|
|
11
|
+
import { Button as R } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { getDate as s } from "@progress/kendo-date-math";
|
|
13
|
+
import { today as m, messages as T } from "../../messages/index.mjs";
|
|
14
|
+
import { MIN_DATE as D, MAX_DATE as E, isInRange as M, getToday as r, dateInRange as N } from "../../utils.mjs";
|
|
15
|
+
const i = {
|
|
16
|
+
min: D,
|
|
17
|
+
max: E
|
|
18
|
+
}, P = (l) => {
|
|
19
|
+
const {
|
|
20
|
+
min: a = i.min,
|
|
21
|
+
max: o = i.max,
|
|
22
|
+
onClick: t,
|
|
23
|
+
disabled: c,
|
|
24
|
+
tabIndex: d,
|
|
25
|
+
unstyled: e
|
|
26
|
+
} = l, f = (n) => {
|
|
27
|
+
if (M(r(), s(a), s(o)) && t) {
|
|
28
|
+
const p = {
|
|
29
|
+
syntheticEvent: n,
|
|
30
|
+
nativeEvent: n.nativeEvent,
|
|
31
|
+
value: N(r(), a, o),
|
|
32
|
+
target: null,
|
|
33
|
+
isTodayClick: !0
|
|
34
|
+
};
|
|
35
|
+
t(p);
|
|
36
|
+
}
|
|
37
|
+
}, g = k(), u = e && e.uCalendar, C = g.toLanguageString(m, T[m]), y = v(x.today({ c: u, disabled: c }));
|
|
38
|
+
return /* @__PURE__ */ I.createElement(
|
|
39
|
+
R,
|
|
40
|
+
{
|
|
41
|
+
className: y,
|
|
42
|
+
onClick: f,
|
|
43
|
+
tabIndex: d,
|
|
44
|
+
fillMode: "flat",
|
|
45
|
+
themeColor: "base",
|
|
46
|
+
role: "link"
|
|
47
|
+
},
|
|
48
|
+
C
|
|
49
|
+
);
|
|
57
50
|
};
|
|
58
|
-
t.propTypes = {
|
|
59
|
-
max: e.instanceOf(Date).isRequired,
|
|
60
|
-
min: e.instanceOf(Date).isRequired,
|
|
61
|
-
onClick: e.func,
|
|
62
|
-
disabled: e.bool
|
|
63
|
-
}, t.defaultProps = {
|
|
64
|
-
min: I,
|
|
65
|
-
max: k
|
|
66
|
-
};
|
|
67
|
-
let a = t;
|
|
68
|
-
u(a);
|
|
69
51
|
export {
|
|
70
|
-
|
|
52
|
+
P as TodayCommand,
|
|
53
|
+
i as todayCommandDefaultProps
|
|
71
54
|
};
|
|
@@ -5,10 +5,9 @@
|
|
|
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 { CalendarCellProps } from './CalendarCell.js';
|
|
10
9
|
import { CalendarWeekCellProps } from './CalendarWeekCell.js';
|
|
11
|
-
import { CalendarViewEnum,
|
|
10
|
+
import { CalendarViewEnum, SelectionRange, SelectionRangeEnd, ViewService } from '../models/index.js';
|
|
12
11
|
import { BusViewService } from '../services/index.js';
|
|
13
12
|
import { WeekDaysFormat } from '../models/WeekDaysFormat';
|
|
14
13
|
import { DateInputsClassStructure } from '@progress/kendo-react-common';
|
|
@@ -20,7 +19,7 @@ export interface ViewEventArguments {
|
|
|
20
19
|
syntheticEvent: React.SyntheticEvent<any>;
|
|
21
20
|
nativeEvent?: any;
|
|
22
21
|
value: Date;
|
|
23
|
-
target:
|
|
22
|
+
target: any;
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
25
|
* @hidden
|
|
@@ -60,42 +59,12 @@ export interface ViewProps {
|
|
|
60
59
|
/**
|
|
61
60
|
* @hidden
|
|
62
61
|
*/
|
|
63
|
-
export declare
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
|
-
selectedDate: PropTypes.Requireable<NonNullable<Date | (Date | null | undefined)[] | null | undefined>>;
|
|
74
|
-
showWeekNumbers: PropTypes.Requireable<boolean>;
|
|
75
|
-
showOtherMonthDays: PropTypes.Requireable<boolean>;
|
|
76
|
-
viewDate: PropTypes.Validator<Date>;
|
|
77
|
-
};
|
|
78
|
-
static defaultProps: {
|
|
79
|
-
direction: string;
|
|
80
|
-
selectedDate: Date;
|
|
81
|
-
showWeekNumbers: boolean;
|
|
82
|
-
};
|
|
83
|
-
private intl;
|
|
84
|
-
private weekService;
|
|
85
|
-
protected get min(): Date;
|
|
86
|
-
protected get max(): Date;
|
|
87
|
-
protected get isHorizontal(): boolean;
|
|
88
|
-
protected get isMonthView(): boolean;
|
|
89
|
-
protected get weekNumber(): boolean;
|
|
90
|
-
protected get selectedDate(): Date | Date[] | null;
|
|
91
|
-
render(): React.JSX.Element;
|
|
92
|
-
protected buildWeekNumber: (row: any, idx: number) => React.JSX.Element;
|
|
93
|
-
protected buildRow: (row: any) => any;
|
|
94
|
-
protected getWeekNumber(date: Date): number | null;
|
|
95
|
-
protected firstDate: (row: any) => Date | null;
|
|
96
|
-
protected firstWeekDateContext: (rowCtx: CellContext[]) => CellContext | null;
|
|
97
|
-
private handleClick;
|
|
98
|
-
private handleWeekCellClick;
|
|
99
|
-
private handleMouseEnter;
|
|
100
|
-
private handleMouseLeave;
|
|
101
|
-
}
|
|
62
|
+
export declare const viewDefaultProps: {
|
|
63
|
+
direction: "vertical";
|
|
64
|
+
selectedDate: Date;
|
|
65
|
+
showWeekNumbers: boolean;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
export declare const View: (props: ViewProps) => 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 se=require("react"),f=require("@progress/kendo-date-math"),ce=require("@progress/kendo-react-intl"),re=require("./CalendarCell.js"),oe=require("./CalendarWeekCell.js"),S=require("../models/CalendarViewEnum.js"),y=require("../../utils.js"),ie=require("../services/WeekNamesService.js"),a=require("@progress/kendo-react-common");function ue(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const c in r)if(c!=="default"){const k=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(i,c,k.get?k:{enumerable:!0,get:()=>r[c]})}}return i.default=r,Object.freeze(i)}const l=ue(se),O=(r,i)=>{const c=i;return l.createElement("td",{key:r,role:"gridcell",className:a.classNames(a.uCalendar.td({c,isEmpty:!0}))}," ")},w={direction:"vertical",selectedDate:y.getToday(),showWeekNumbers:!1},me=r=>{const{activeRangeEnd:i,activeView:c,bus:k,cellUID:R,direction:I=w.direction,focusedDate:T,weekCell:N,max:P,weekDaysFormat:j,min:z,cell:h,onCellEnter:E,onCellLeave:v,onChange:g,onWeekSelect:p,selectedDate:L=w.selectedDate,selectionRange:_,service:D,showWeekNumbers:$=w.showWeekNumbers,showOtherMonthDays:x,viewDate:b,allowReverse:A,unstyled:C}=r,W=I==="horizontal",B=c===S.CalendarViewEnum.month,d=!!($&&c===S.CalendarViewEnum.month),F=(e,t)=>{if(g&&t){const s={value:f.cloneDate(e),target:null,nativeEvent:t==null?void 0:t.nativeEvent,syntheticEvent:t};g(s)}},H=(e,t,s)=>{const o=t.findIndex(n=>(n==null?void 0:n.value)===e);p&&s&&p(e,o,s)},K=e=>{E&&E(f.cloneDate(e))},U=e=>{v&&v(f.cloneDate(e))},V=ce.useInternationalization(),Y=new ie.WeekNamesService(V),u=C&&C.uCalendar,G=e=>d?f.weekInYear(e,V.firstDay()):null,J=e=>{if(!d)return null;let t=0,s=e[t];for(;!s&&t<e.length;)s=e[++t];return s},q=e=>{const t=J(e);return t?t.value:null},Q=(e,t)=>{if(!q(e))return O(`week-cell-${t}`);const o=q(e),n=G(o),m=`kendo-react-calendar-week-cell-${n}`,M={value:n,firstDate:o,weekDays:e,unstyled:C,onClick:H};return N?l.createElement(N,{...M,key:m},n):l.createElement(oe.CalendarWeekCell,{...M,key:m},n)},X=e=>e.map((t,s)=>{if(!t)return O(s);const o={"aria-selected":t.isSelected},n=`kendo-react-calendar-cell-${t.value.getTime()}`,m={...o,...t,isDisabled:!t.isInRange,view:c,showOtherMonthDays:x,allowReverse:A,activeRangeEnd:i,unstyled:C,onClick:F,onMouseEnter:K,onMouseLeave:U};return h?l.createElement(h,{...m,key:n},t.formattedValue):l.createElement(re.CalendarCell,{...m,key:n},t.formattedValue)}),Z=Y.getWeekNames(d,j),ee=D.rowLength(d),te=D.title(b),ae=y.getToday(),ne=y.setTime(b,ae),le=D.data({cellUID:R,min:z,max:P,focusedDate:T,isActiveView:!k.canMoveDown(c),selectedDate:L,selectionRange:_,viewDate:ne});return l.createElement(l.Fragment,null,B&&W&&l.createElement("thead",{className:a.classNames(a.uCalendar.thead({c:u}))},l.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u}))},Z.map(e=>l.createElement("th",{key:e,className:a.classNames(a.uCalendar.th({c:u}))},e)))),l.createElement("tbody",{className:a.classNames(a.uCalendar.tbody({c:u}))},!W&&l.createElement("tr",{className:a.classNames(a.uCalendar.tr({c:u}))},l.createElement("th",{scope:"col",colSpan:ee,className:a.classNames(a.uCalendar.caption({c:u}))},te)),le.map((e,t)=>{var o,n;const s=(n=(o=e.find(m=>m!=null))==null?void 0:o.value.getTime())!=null?n:t;return l.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u})),key:s},d&&Q(e,t),X(e))})))};exports.View=me;exports.viewDefaultProps=w;
|