@progress/kendo-react-dateinputs 15.2.0-develop.1 → 15.2.0-develop.3
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 +1 -1
- package/calendar/components/Calendar.mjs +1 -1
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +17 -5
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +29 -29
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +131 -128
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +21 -32
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +66 -66
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +135 -125
- package/calendar/models/WeekDaysFormat.d.ts +1 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +30 -31
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +35 -36
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +21 -20
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +15 -14
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +46 -44
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/timepicker/TimeList.js +2 -2
- package/timepicker/TimeList.mjs +51 -47
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +57 -68
- package/timepicker/TimePicker.d.ts +7 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +20 -17
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +56 -57
|
@@ -6,118 +6,118 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as a from "react";
|
|
9
|
-
import { weekInYear as
|
|
10
|
-
import { useInternationalization as
|
|
11
|
-
import { CalendarCell as
|
|
12
|
-
import { CalendarWeekCell as
|
|
13
|
-
import { CalendarViewEnum as
|
|
14
|
-
import { getToday as
|
|
15
|
-
import { WeekNamesService as
|
|
9
|
+
import { weekInYear as se, cloneDate as p } from "@progress/kendo-date-math";
|
|
10
|
+
import { useInternationalization as ce } from "@progress/kendo-react-intl";
|
|
11
|
+
import { CalendarCell as ie } from "./CalendarCell.mjs";
|
|
12
|
+
import { CalendarWeekCell as me } from "./CalendarWeekCell.mjs";
|
|
13
|
+
import { CalendarViewEnum as S } from "../models/CalendarViewEnum.mjs";
|
|
14
|
+
import { getToday as z, setTime as ue } from "../../utils.mjs";
|
|
15
|
+
import { WeekNamesService as de } from "../services/WeekNamesService.mjs";
|
|
16
16
|
import { classNames as r, uCalendar as s } from "@progress/kendo-react-common";
|
|
17
|
-
const
|
|
17
|
+
const T = (k, f) => {
|
|
18
18
|
const m = f;
|
|
19
19
|
return /* @__PURE__ */ a.createElement("td", { key: k, role: "gridcell", className: r(s.td({ c: m, isEmpty: !0 })) }, " ");
|
|
20
|
-
},
|
|
20
|
+
}, C = {
|
|
21
21
|
direction: "vertical",
|
|
22
|
-
selectedDate:
|
|
22
|
+
selectedDate: z(),
|
|
23
23
|
showWeekNumbers: !1
|
|
24
|
-
},
|
|
24
|
+
}, ye = (k) => {
|
|
25
25
|
const {
|
|
26
26
|
activeRangeEnd: f,
|
|
27
27
|
activeView: m,
|
|
28
|
-
bus:
|
|
29
|
-
cellUID:
|
|
30
|
-
direction:
|
|
31
|
-
focusedDate:
|
|
32
|
-
weekCell:
|
|
33
|
-
max:
|
|
34
|
-
weekDaysFormat:
|
|
35
|
-
min:
|
|
36
|
-
cell:
|
|
37
|
-
onCellEnter:
|
|
38
|
-
onCellLeave:
|
|
39
|
-
onChange:
|
|
40
|
-
onWeekSelect:
|
|
41
|
-
selectedDate:
|
|
42
|
-
selectionRange:
|
|
28
|
+
bus: L,
|
|
29
|
+
cellUID: q,
|
|
30
|
+
direction: x = C.direction,
|
|
31
|
+
focusedDate: O,
|
|
32
|
+
weekCell: D,
|
|
33
|
+
max: P,
|
|
34
|
+
weekDaysFormat: $,
|
|
35
|
+
min: A,
|
|
36
|
+
cell: E,
|
|
37
|
+
onCellEnter: y,
|
|
38
|
+
onCellLeave: v,
|
|
39
|
+
onChange: N,
|
|
40
|
+
onWeekSelect: g,
|
|
41
|
+
selectedDate: B = C.selectedDate,
|
|
42
|
+
selectionRange: F,
|
|
43
43
|
service: w,
|
|
44
|
-
showWeekNumbers:
|
|
45
|
-
showOtherMonthDays:
|
|
46
|
-
viewDate:
|
|
47
|
-
allowReverse:
|
|
44
|
+
showWeekNumbers: H = C.showWeekNumbers,
|
|
45
|
+
showOtherMonthDays: K,
|
|
46
|
+
viewDate: W,
|
|
47
|
+
allowReverse: U,
|
|
48
48
|
unstyled: d
|
|
49
|
-
} = k,
|
|
50
|
-
if (
|
|
49
|
+
} = k, h = x === "horizontal", b = m === S.month, u = !!(H && m === S.month), Y = (e, t) => {
|
|
50
|
+
if (N && t) {
|
|
51
51
|
const l = {
|
|
52
|
-
value:
|
|
52
|
+
value: p(e),
|
|
53
53
|
target: null,
|
|
54
54
|
nativeEvent: t == null ? void 0 : t.nativeEvent,
|
|
55
55
|
syntheticEvent: t
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
N(l);
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, j = (e, t, l) => {
|
|
60
60
|
const o = t.findIndex((n) => (n == null ? void 0 : n.value) === e);
|
|
61
|
-
|
|
62
|
-
}, j = (e) => {
|
|
63
|
-
E && E(h(e));
|
|
61
|
+
g && l && g(e, o, l);
|
|
64
62
|
}, G = (e) => {
|
|
65
|
-
y && y(
|
|
66
|
-
},
|
|
63
|
+
y && y(p(e));
|
|
64
|
+
}, J = (e) => {
|
|
65
|
+
v && v(p(e));
|
|
66
|
+
}, V = ce(), I = new de(V), c = d && d.uCalendar, Q = (e) => u ? se(e, V.firstDay()) : null, X = (e) => {
|
|
67
67
|
if (!u)
|
|
68
68
|
return null;
|
|
69
69
|
let t = 0, l = e[t];
|
|
70
70
|
for (; !l && t < e.length; )
|
|
71
71
|
l = e[++t];
|
|
72
72
|
return l;
|
|
73
|
-
},
|
|
73
|
+
}, M = (e) => {
|
|
74
74
|
const t = X(e);
|
|
75
75
|
return t ? t.value : null;
|
|
76
76
|
}, Z = (e, t) => {
|
|
77
|
-
if (!
|
|
78
|
-
return
|
|
79
|
-
const o =
|
|
77
|
+
if (!M(e))
|
|
78
|
+
return T(`week-cell-${t}`);
|
|
79
|
+
const o = M(e), n = Q(o), i = `kendo-react-calendar-week-cell-${n}`, R = {
|
|
80
80
|
value: n,
|
|
81
81
|
firstDate: o,
|
|
82
82
|
weekDays: e,
|
|
83
83
|
unstyled: d,
|
|
84
|
-
onClick:
|
|
84
|
+
onClick: j
|
|
85
85
|
};
|
|
86
|
-
return
|
|
86
|
+
return D ? /* @__PURE__ */ a.createElement(D, { ...R, key: i }, n) : /* @__PURE__ */ a.createElement(me, { ...R, key: i }, n);
|
|
87
87
|
}, _ = (e) => e.map((t, l) => {
|
|
88
88
|
if (!t)
|
|
89
|
-
return
|
|
90
|
-
const o = { "aria-selected": t.isSelected }, n = `kendo-react-calendar-cell-${t.value.getTime()}`, i = {
|
|
89
|
+
return T(l);
|
|
90
|
+
const o = { "aria-selected": t.isSelected ? !0 : void 0, role: "gridcell" }, n = `kendo-react-calendar-cell-${t.value.getTime()}`, i = {
|
|
91
91
|
...o,
|
|
92
92
|
...t,
|
|
93
93
|
isDisabled: !t.isInRange,
|
|
94
94
|
view: m,
|
|
95
|
-
showOtherMonthDays:
|
|
96
|
-
allowReverse:
|
|
95
|
+
showOtherMonthDays: K,
|
|
96
|
+
allowReverse: U,
|
|
97
97
|
activeRangeEnd: f,
|
|
98
98
|
unstyled: d,
|
|
99
|
-
onClick:
|
|
100
|
-
onMouseEnter:
|
|
101
|
-
onMouseLeave:
|
|
99
|
+
onClick: Y,
|
|
100
|
+
onMouseEnter: G,
|
|
101
|
+
onMouseLeave: J
|
|
102
102
|
};
|
|
103
|
-
return
|
|
104
|
-
}), ee =
|
|
105
|
-
cellUID:
|
|
106
|
-
min:
|
|
107
|
-
max:
|
|
108
|
-
focusedDate:
|
|
109
|
-
isActiveView: !
|
|
110
|
-
selectedDate:
|
|
111
|
-
selectionRange:
|
|
112
|
-
viewDate:
|
|
103
|
+
return E ? /* @__PURE__ */ a.createElement(E, { ...i, key: n }, t.formattedValue) : /* @__PURE__ */ a.createElement(ie, { ...i, key: n }, t.formattedValue);
|
|
104
|
+
}), ee = I.getWeekNames(u, $), te = b && h ? I.getWeekNames(u, "wide") : [], ne = w.rowLength(u), ae = w.title(W), le = z(), oe = ue(W, le), re = w.data({
|
|
105
|
+
cellUID: q,
|
|
106
|
+
min: A,
|
|
107
|
+
max: P,
|
|
108
|
+
focusedDate: O,
|
|
109
|
+
isActiveView: !L.canMoveDown(m),
|
|
110
|
+
selectedDate: B,
|
|
111
|
+
selectionRange: F,
|
|
112
|
+
viewDate: oe
|
|
113
113
|
});
|
|
114
|
-
return /* @__PURE__ */ a.createElement(a.Fragment, null,
|
|
114
|
+
return /* @__PURE__ */ a.createElement(a.Fragment, null, b && h && /* @__PURE__ */ a.createElement("thead", { className: r(s.thead({ c })), role: "rowgroup" }, /* @__PURE__ */ a.createElement("tr", { role: "row", className: r(s.tr({ c })) }, ee.map((e, t) => /* @__PURE__ */ a.createElement("th", { key: e, className: r(s.th({ c })), role: "columnheader", "aria-label": te[t] }, e)))), /* @__PURE__ */ a.createElement("tbody", { className: r(s.tbody({ c })), role: "rowgroup" }, !h && /* @__PURE__ */ a.createElement("tr", { className: r(s.tr({ c })), "aria-hidden": !0, role: "row" }, /* @__PURE__ */ a.createElement("th", { scope: "col", colSpan: ne, className: r(s.caption({ c })) }, ae)), re.map((e, t) => {
|
|
115
115
|
var o, n;
|
|
116
116
|
const l = (n = (o = e.find((i) => i != null)) == null ? void 0 : o.value.getTime()) != null ? n : t;
|
|
117
117
|
return /* @__PURE__ */ a.createElement("tr", { role: "row", className: r(s.tr({ c })), key: l }, u && Z(e, t), _(e));
|
|
118
118
|
})));
|
|
119
119
|
};
|
|
120
120
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
ye as View,
|
|
122
|
+
C as viewDefaultProps
|
|
123
123
|
};
|
|
@@ -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 Ve=require("react"),s=require("@progress/kendo-react-common"),S=require("@progress/kendo-date-math"),De=require("@progress/kendo-react-intl"),Ne=require("../../virtualization/Virtualization.js"),Se=require("./View.js"),Te=require("./Header.js"),Ie=require("../services/WeekNamesService.js"),T=require("../../utils.js"),l=require("../models/CalendarViewEnum.js"),qe=require("./TodayCommand.js");function He(i){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const u in i)if(u!=="default"){const R=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(C,u,R.get?R:{enumerable:!0,get:()=>i[u]})}}return C.default=i,Object.freeze(C)}const t=He(Ve),Oe=5,E={take:Oe,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0},X=t.forwardRef((i,C)=>{const{take:u=E.take,showWeekNumbers:R=E.showWeekNumbers,weekDaysFormat:Z=E.weekDaysFormat,smoothScroll:ee=E.smoothScroll,activeView:n,bus:z,cellUID:M,dom:c,focusedDate:h,max:d,min:a,cell:te,onScroll:ne,onChange:P,service:o,value:ae,weekCell:re,showOtherMonthDays:se,headerTitle:oe,header:ce,shouldScroll:j,tabIndex:w,unstyled:k}=i,b=!!(R&&n===l.CalendarViewEnum.month),le=T.isInRange(T.getToday(),S.getDate(a),S.getDate(d)),A=()=>{if(!f.current)return;const e=f.current.querySelector("td.k-focus"),r=f.current.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),r&&r.classList.add("k-focus"),H.current=!0},ie=()=>{if(!f.current)return;const e=f.current.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),H.current=!1},F=(e,r=!1)=>{if(P){const v={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:S.cloneDate(e.value),target:I.current,isTodayClick:r};P(v)}},ue=e=>{O.current=!0,F(e,!0)},de=({index:e,scrollAction:r,pageAction:v})=>{const N=v?v.skip:void 0;if(fe(y=>{const Q=N!==void 0?N:y.skip;return y.index!==e||y.skip!==Q?{index:e,skip:Q}:y}),p.current&&r){const y=`translateY(${r.offset}px)`;p.current.style.transform=y}},me=e=>{if(m.current=e,m.current&&p.current){const r=-1*c.headerHeight;p.current.style.transform=`translateY(${r}px)`;const v=T.dateInRange(h,a,d),N=o.skip(v,a);m.current.scrollToIndex(N)}},m=t.useRef(null),I=t.useRef(null);t.useImperativeHandle(I,()=>({get element(){return f.current},get virtualization(){return m.current},focusActiveDate:A,blurActiveDate:ie})),t.useImperativeHandle(C,()=>I.current);const f=t.useRef(null),p=t.useRef(null),q=t.useRef(n),_=t.useRef(h),H=t.useRef(!1),B=t.useRef(!0),O=t.useRef(!1),V=t.useRef(void 0),[Y,fe]=t.useState(()=>{const e=o.skip(h,a);return{skip:e,index:e}});t.useEffect(()=>{if(O.current=!1,V.current!==void 0&&m.current){const e=!!(ee&&B.current);m.current[e?"animateToIndex":"scrollToIndex"](V.current)}H.current&&A(),q.current=n,V.current=void 0});const he=De.useInternationalization(),U=new Ie.WeekNamesService(he),we=U.getWeekNames(b,Z),ke=U.getWeekNames(b,"wide"),g=k&&k.uCalendar;let $=0,x=0,L=1;c&&($=(n===l.CalendarViewEnum.month?c.scrollableContentHeight:c.scrollableYearContentHeight)-c.viewHeight(n),x=-1*c.headerHeight,L=c.viewHeight(n)||1);const ge=q.current!==n,D=T.dateInRange(h,a,d),W=ge?o.skip(D,a):Y.skip,K=o.total(a,d),ve=Math.min(K-W,u),ye=o.addToDate(a,W),Ce=o.addToDate(a,Y.index),G=Array.from({length:o.rowLength(b)},(e,r)=>r),J=n!==q.current;B.current=!J,(J||!S.isEqualDate(_.current,D)||O.current||!j||j())&&(V.current=o.skip(D,a)),_.current=D;const pe=s.classNames(s.uCalendar.view({c:g,month:n===l.CalendarViewEnum.month,year:n===l.CalendarViewEnum.year,decade:n===l.CalendarViewEnum.decade,century:n===l.CalendarViewEnum.century})),Ee=t.createElement("table",{className:s.classNames(s.uCalendar.table({c:g})),ref:p,role:"grid",tabIndex:w!=null?w:0,"aria-activedescendant":n===l.CalendarViewEnum.month?M+h.getTime():void 0},t.createElement("colgroup",null,G.map(e=>t.createElement("col",{key:e}))),o.datesList(ye,ve).map(e=>t.createElement(Se.View,{key:e.getTime(),activeView:n,viewDate:e,min:a,max:d,cellUID:M,focusedDate:h,cell:te,selectedDate:ae,showWeekNumbers:b,onChange:F,bus:z,service:o,weekCell:re,showOtherMonthDays:se,unstyled:k}))),Re=n===l.CalendarViewEnum.month?t.createElement("table",{key:"calendar-view-list-weekdays",className:s.classNames(s.uCalendar.table({c:g,weekdays:!0})),role:"table",tabIndex:w},t.createElement("colgroup",null,G.map(e=>t.createElement("col",{key:e}))),t.createElement("thead",{className:s.classNames(s.uCalendar.thead({c:g})),role:"rowgroup"},t.createElement("tr",{className:s.classNames(s.uCalendar.tr({c:g})),role:"row"},we.map((e,r)=>t.createElement("th",{key:e,className:s.classNames(s.uCalendar.th({c:g})),"aria-label":ke[r],role:"columnheader"},e))))):null,be=t.createElement(t.Fragment,null,t.createElement(Te.Header,{key:"calendar-view-list-header",currentDate:Ce,min:a,max:d,activeView:n,bus:z,service:o,headerTitle:oe,header:ce,unstyled:k,commands:t.createElement(qe.TodayCommand,{min:a,max:d,onClick:ue,disabled:!le,tabIndex:w,unstyled:k})}),Re,t.createElement(Ne.Virtualization,{key:"calendar-view-list-content",skip:W,take:u,total:K,itemHeight:L,topOffset:x,bottomOffset:$,scrollOffsetSize:x,maxScrollDifference:L,onScroll:ne,onScrollAction:de,onMount:e=>!m.current&&me(e),tabIndex:w,role:"none",unstyled:k},Ee));return t.createElement("div",{ref:f,className:pe},c.didCalculate?be:null)});X.displayName="KendoReactViewList";const xe=X;exports.ViewList=xe;exports.viewListDefaultProps=E;
|
|
@@ -7,213 +7,223 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import { classNames as p, uCalendar as v } from "@progress/kendo-react-common";
|
|
10
|
-
import { getDate as
|
|
11
|
-
import { useInternationalization as
|
|
12
|
-
import { Virtualization as
|
|
13
|
-
import { View as
|
|
14
|
-
import { Header as
|
|
15
|
-
import { WeekNamesService as
|
|
16
|
-
import { isInRange as
|
|
17
|
-
import { CalendarViewEnum as
|
|
18
|
-
import { TodayCommand as
|
|
19
|
-
const
|
|
20
|
-
take:
|
|
10
|
+
import { getDate as j, isEqualDate as be, cloneDate as Ne } from "@progress/kendo-date-math";
|
|
11
|
+
import { useInternationalization as Ve } from "@progress/kendo-react-intl";
|
|
12
|
+
import { Virtualization as Te } from "../../virtualization/Virtualization.mjs";
|
|
13
|
+
import { View as xe } from "./View.mjs";
|
|
14
|
+
import { Header as Ie } from "./Header.mjs";
|
|
15
|
+
import { WeekNamesService as He } from "../services/WeekNamesService.mjs";
|
|
16
|
+
import { isInRange as Le, getToday as We, dateInRange as G } from "../../utils.mjs";
|
|
17
|
+
import { CalendarViewEnum as c } from "../models/CalendarViewEnum.mjs";
|
|
18
|
+
import { TodayCommand as Oe } from "./TodayCommand.mjs";
|
|
19
|
+
const ze = 5, C = {
|
|
20
|
+
take: ze,
|
|
21
21
|
showWeekNumbers: !1,
|
|
22
22
|
weekDaysFormat: "short",
|
|
23
23
|
smoothScroll: !0
|
|
24
|
-
},
|
|
24
|
+
}, J = t.forwardRef((Q, X) => {
|
|
25
25
|
const {
|
|
26
|
-
take: H =
|
|
27
|
-
showWeekNumbers:
|
|
28
|
-
weekDaysFormat:
|
|
29
|
-
smoothScroll:
|
|
26
|
+
take: H = C.take,
|
|
27
|
+
showWeekNumbers: Z = C.showWeekNumbers,
|
|
28
|
+
weekDaysFormat: ee = C.weekDaysFormat,
|
|
29
|
+
smoothScroll: te = C.smoothScroll,
|
|
30
30
|
activeView: n,
|
|
31
31
|
bus: L,
|
|
32
|
-
cellUID:
|
|
33
|
-
dom:
|
|
32
|
+
cellUID: W,
|
|
33
|
+
dom: s,
|
|
34
34
|
focusedDate: m,
|
|
35
|
-
max:
|
|
35
|
+
max: l,
|
|
36
36
|
min: r,
|
|
37
|
-
cell:
|
|
38
|
-
onScroll:
|
|
39
|
-
onChange:
|
|
40
|
-
service:
|
|
41
|
-
value:
|
|
42
|
-
weekCell:
|
|
37
|
+
cell: ne,
|
|
38
|
+
onScroll: re,
|
|
39
|
+
onChange: O,
|
|
40
|
+
service: a,
|
|
41
|
+
value: oe,
|
|
42
|
+
weekCell: ae,
|
|
43
43
|
showOtherMonthDays: se,
|
|
44
|
-
headerTitle:
|
|
45
|
-
header:
|
|
44
|
+
headerTitle: ce,
|
|
45
|
+
header: le,
|
|
46
46
|
shouldScroll: z,
|
|
47
|
-
tabIndex:
|
|
48
|
-
unstyled:
|
|
49
|
-
} =
|
|
50
|
-
if (!
|
|
47
|
+
tabIndex: d,
|
|
48
|
+
unstyled: f
|
|
49
|
+
} = Q, y = !!(Z && n === c.month), ie = Le(We(), j(r), j(l)), A = () => {
|
|
50
|
+
if (!u.current)
|
|
51
51
|
return;
|
|
52
|
-
const e =
|
|
53
|
-
e && e[0] && e[0].classList.remove("k-focus"),
|
|
54
|
-
},
|
|
55
|
-
if (!
|
|
52
|
+
const e = u.current.querySelector("td.k-focus"), o = u.current.querySelector(".k-state-pending-focus");
|
|
53
|
+
e && e[0] && e[0].classList.remove("k-focus"), o && o.classList.add("k-focus"), N.current = !0;
|
|
54
|
+
}, ue = () => {
|
|
55
|
+
if (!u.current)
|
|
56
56
|
return;
|
|
57
|
-
const e =
|
|
57
|
+
const e = u.current.querySelector("td.k-focus");
|
|
58
58
|
e && e.classList.remove("k-focus"), N.current = !1;
|
|
59
|
-
}, F = (e,
|
|
60
|
-
if (
|
|
59
|
+
}, F = (e, o = !1) => {
|
|
60
|
+
if (O) {
|
|
61
61
|
const k = {
|
|
62
62
|
syntheticEvent: e.syntheticEvent,
|
|
63
63
|
nativeEvent: e.nativeEvent,
|
|
64
|
-
value:
|
|
65
|
-
target:
|
|
66
|
-
isTodayClick:
|
|
64
|
+
value: Ne(e.value),
|
|
65
|
+
target: S.current,
|
|
66
|
+
isTodayClick: o
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
O(k);
|
|
69
69
|
}
|
|
70
|
-
},
|
|
70
|
+
}, me = (e) => {
|
|
71
71
|
V.current = !0, F(e, !0);
|
|
72
|
-
},
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
return w.index !== e || w.skip !==
|
|
77
|
-
}), g.current &&
|
|
78
|
-
const w = `translateY(${
|
|
72
|
+
}, de = ({ index: e, scrollAction: o, pageAction: k }) => {
|
|
73
|
+
const E = k ? k.skip : void 0;
|
|
74
|
+
if (he((w) => {
|
|
75
|
+
const K = E !== void 0 ? E : w.skip;
|
|
76
|
+
return w.index !== e || w.skip !== K ? { index: e, skip: K } : w;
|
|
77
|
+
}), g.current && o) {
|
|
78
|
+
const w = `translateY(${o.offset}px)`;
|
|
79
79
|
g.current.style.transform = w;
|
|
80
80
|
}
|
|
81
81
|
}, fe = (e) => {
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
g.current.style.transform = `translateY(${
|
|
85
|
-
const k =
|
|
86
|
-
|
|
82
|
+
if (i.current = e, i.current && g.current) {
|
|
83
|
+
const o = -1 * s.headerHeight;
|
|
84
|
+
g.current.style.transform = `translateY(${o}px)`;
|
|
85
|
+
const k = G(m, r, l), E = a.skip(k, r);
|
|
86
|
+
i.current.scrollToIndex(E);
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, i = t.useRef(null), S = t.useRef(null);
|
|
89
89
|
t.useImperativeHandle(
|
|
90
|
-
|
|
90
|
+
S,
|
|
91
91
|
() => ({
|
|
92
92
|
get element() {
|
|
93
|
-
return
|
|
93
|
+
return u.current;
|
|
94
94
|
},
|
|
95
95
|
get virtualization() {
|
|
96
|
-
return
|
|
96
|
+
return i.current;
|
|
97
97
|
},
|
|
98
98
|
focusActiveDate: A,
|
|
99
|
-
blurActiveDate:
|
|
99
|
+
blurActiveDate: ue
|
|
100
100
|
})
|
|
101
|
-
), t.useImperativeHandle(
|
|
102
|
-
const
|
|
103
|
-
const e =
|
|
101
|
+
), t.useImperativeHandle(X, () => S.current);
|
|
102
|
+
const u = t.useRef(null), g = t.useRef(null), b = t.useRef(n), q = t.useRef(m), N = t.useRef(!1), M = t.useRef(!0), V = t.useRef(!1), R = t.useRef(void 0), [B, he] = t.useState(() => {
|
|
103
|
+
const e = a.skip(m, r);
|
|
104
104
|
return { skip: e, index: e };
|
|
105
105
|
});
|
|
106
106
|
t.useEffect(() => {
|
|
107
|
-
if (V.current = !1,
|
|
108
|
-
const e = !!(
|
|
109
|
-
|
|
107
|
+
if (V.current = !1, R.current !== void 0 && i.current) {
|
|
108
|
+
const e = !!(te && M.current);
|
|
109
|
+
i.current[e ? "animateToIndex" : "scrollToIndex"](R.current);
|
|
110
110
|
}
|
|
111
|
-
N.current && A(), b.current = n,
|
|
111
|
+
N.current && A(), b.current = n, R.current = void 0;
|
|
112
112
|
});
|
|
113
|
-
const
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
M.current =
|
|
118
|
-
const
|
|
113
|
+
const ke = Ve(), Y = new He(ke), we = Y.getWeekNames(y, ee), pe = Y.getWeekNames(y, "wide"), h = f && f.uCalendar;
|
|
114
|
+
let P = 0, T = 0, x = 1;
|
|
115
|
+
s && (P = (n === c.month ? s.scrollableContentHeight : s.scrollableYearContentHeight) - s.viewHeight(n), T = -1 * s.headerHeight, x = s.viewHeight(n) || 1);
|
|
116
|
+
const ve = b.current !== n, D = G(m, r, l), I = ve ? a.skip(D, r) : B.skip, U = a.total(r, l), ge = Math.min(U - I, H), ye = a.addToDate(r, I), Re = a.addToDate(r, B.index), _ = Array.from({ length: a.rowLength(y) }, (e, o) => o), $ = n !== b.current;
|
|
117
|
+
M.current = !$, ($ || !be(q.current, D) || V.current || !z || z()) && (R.current = a.skip(D, r)), q.current = D;
|
|
118
|
+
const De = p(
|
|
119
119
|
v.view({
|
|
120
120
|
c: h,
|
|
121
|
-
month: n ===
|
|
122
|
-
year: n ===
|
|
123
|
-
decade: n ===
|
|
124
|
-
century: n ===
|
|
121
|
+
month: n === c.month,
|
|
122
|
+
year: n === c.year,
|
|
123
|
+
decade: n === c.decade,
|
|
124
|
+
century: n === c.century
|
|
125
125
|
})
|
|
126
|
-
),
|
|
126
|
+
), Ee = /* @__PURE__ */ t.createElement(
|
|
127
127
|
"table",
|
|
128
128
|
{
|
|
129
129
|
className: p(v.table({ c: h })),
|
|
130
130
|
ref: g,
|
|
131
131
|
role: "grid",
|
|
132
|
-
tabIndex:
|
|
133
|
-
"aria-activedescendant":
|
|
132
|
+
tabIndex: d != null ? d : 0,
|
|
133
|
+
"aria-activedescendant": n === c.month ? W + m.getTime() : void 0
|
|
134
134
|
},
|
|
135
|
-
/* @__PURE__ */ t.createElement("colgroup", null,
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
/* @__PURE__ */ t.createElement("colgroup", null, _.map((e) => /* @__PURE__ */ t.createElement("col", { key: e }))),
|
|
136
|
+
a.datesList(ye, ge).map((e) => /* @__PURE__ */ t.createElement(
|
|
137
|
+
xe,
|
|
138
138
|
{
|
|
139
139
|
key: e.getTime(),
|
|
140
140
|
activeView: n,
|
|
141
141
|
viewDate: e,
|
|
142
142
|
min: r,
|
|
143
|
-
max:
|
|
144
|
-
cellUID:
|
|
143
|
+
max: l,
|
|
144
|
+
cellUID: W,
|
|
145
145
|
focusedDate: m,
|
|
146
|
-
cell:
|
|
147
|
-
selectedDate:
|
|
148
|
-
showWeekNumbers:
|
|
146
|
+
cell: ne,
|
|
147
|
+
selectedDate: oe,
|
|
148
|
+
showWeekNumbers: y,
|
|
149
149
|
onChange: F,
|
|
150
150
|
bus: L,
|
|
151
|
-
service:
|
|
152
|
-
weekCell:
|
|
151
|
+
service: a,
|
|
152
|
+
weekCell: ae,
|
|
153
153
|
showOtherMonthDays: se,
|
|
154
|
-
unstyled:
|
|
154
|
+
unstyled: f
|
|
155
155
|
}
|
|
156
156
|
))
|
|
157
|
-
),
|
|
157
|
+
), Ce = n === c.month ? /* @__PURE__ */ t.createElement(
|
|
158
158
|
"table",
|
|
159
159
|
{
|
|
160
160
|
key: "calendar-view-list-weekdays",
|
|
161
161
|
className: p(v.table({ c: h, weekdays: !0 })),
|
|
162
|
-
role: "
|
|
163
|
-
tabIndex:
|
|
162
|
+
role: "table",
|
|
163
|
+
tabIndex: d
|
|
164
164
|
},
|
|
165
|
-
/* @__PURE__ */ t.createElement("colgroup", null,
|
|
166
|
-
/* @__PURE__ */ t.createElement("thead", { className: p(v.thead({ c: h })) }, /* @__PURE__ */ t.createElement("tr", { className: p(v.tr({ c: h })) },
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
/* @__PURE__ */ t.createElement("colgroup", null, _.map((e) => /* @__PURE__ */ t.createElement("col", { key: e }))),
|
|
166
|
+
/* @__PURE__ */ t.createElement("thead", { className: p(v.thead({ c: h })), role: "rowgroup" }, /* @__PURE__ */ t.createElement("tr", { className: p(v.tr({ c: h })), role: "row" }, we.map((e, o) => /* @__PURE__ */ t.createElement(
|
|
167
|
+
"th",
|
|
168
|
+
{
|
|
169
|
+
key: e,
|
|
170
|
+
className: p(v.th({ c: h })),
|
|
171
|
+
"aria-label": pe[o],
|
|
172
|
+
role: "columnheader"
|
|
173
|
+
},
|
|
174
|
+
e
|
|
175
|
+
))))
|
|
176
|
+
) : null, Se = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
177
|
+
Ie,
|
|
169
178
|
{
|
|
170
179
|
key: "calendar-view-list-header",
|
|
171
|
-
currentDate:
|
|
180
|
+
currentDate: Re,
|
|
172
181
|
min: r,
|
|
173
|
-
max:
|
|
182
|
+
max: l,
|
|
174
183
|
activeView: n,
|
|
175
184
|
bus: L,
|
|
176
|
-
service:
|
|
177
|
-
headerTitle:
|
|
178
|
-
header:
|
|
179
|
-
unstyled:
|
|
185
|
+
service: a,
|
|
186
|
+
headerTitle: ce,
|
|
187
|
+
header: le,
|
|
188
|
+
unstyled: f,
|
|
180
189
|
commands: /* @__PURE__ */ t.createElement(
|
|
181
|
-
|
|
190
|
+
Oe,
|
|
182
191
|
{
|
|
183
192
|
min: r,
|
|
184
|
-
max:
|
|
185
|
-
onClick:
|
|
186
|
-
disabled: !
|
|
187
|
-
tabIndex:
|
|
188
|
-
unstyled:
|
|
193
|
+
max: l,
|
|
194
|
+
onClick: me,
|
|
195
|
+
disabled: !ie,
|
|
196
|
+
tabIndex: d,
|
|
197
|
+
unstyled: f
|
|
189
198
|
}
|
|
190
199
|
)
|
|
191
200
|
}
|
|
192
|
-
),
|
|
193
|
-
|
|
201
|
+
), Ce, /* @__PURE__ */ t.createElement(
|
|
202
|
+
Te,
|
|
194
203
|
{
|
|
195
204
|
key: "calendar-view-list-content",
|
|
196
205
|
skip: I,
|
|
197
206
|
take: H,
|
|
198
|
-
total:
|
|
207
|
+
total: U,
|
|
199
208
|
itemHeight: x,
|
|
200
209
|
topOffset: T,
|
|
201
|
-
bottomOffset:
|
|
210
|
+
bottomOffset: P,
|
|
202
211
|
scrollOffsetSize: T,
|
|
203
212
|
maxScrollDifference: x,
|
|
204
|
-
onScroll:
|
|
205
|
-
onScrollAction:
|
|
206
|
-
onMount: (e) => !
|
|
207
|
-
tabIndex:
|
|
208
|
-
|
|
213
|
+
onScroll: re,
|
|
214
|
+
onScrollAction: de,
|
|
215
|
+
onMount: (e) => !i.current && fe(e),
|
|
216
|
+
tabIndex: d,
|
|
217
|
+
role: "none",
|
|
218
|
+
unstyled: f
|
|
209
219
|
},
|
|
210
|
-
|
|
220
|
+
Ee
|
|
211
221
|
));
|
|
212
|
-
return /* @__PURE__ */ t.createElement("div", { ref:
|
|
222
|
+
return /* @__PURE__ */ t.createElement("div", { ref: u, className: De }, s.didCalculate ? Se : null);
|
|
213
223
|
});
|
|
214
|
-
|
|
215
|
-
const
|
|
224
|
+
J.displayName = "KendoReactViewList";
|
|
225
|
+
const Ke = J;
|
|
216
226
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
227
|
+
Ke as ViewList,
|
|
228
|
+
C as viewListDefaultProps
|
|
219
229
|
};
|
package/common/AdaptiveMode.js
CHANGED
|
@@ -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 h=require("react"),c=require("@progress/kendo-react-layout"),x=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),C=require("@progress/kendo-react-common");function k(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const a=k(h),A=t=>{const{footer:e,id:n,windowWidth:o=0,mobileFilter:s,children:u,navigatable:d,navigatableElements:p,expand:m,animation:b,title:f,subTitle:g,onClose:r}=t,y=()=>a.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:x.checkIcon,onClick:r}),l=C.useAdaptiveModeContext(),v={id:n,navigatable:d||!1,navigatableElements:p||[],expand:m,animation:b!==!1,suffixActions:y(),filter:s,onClose:r,animationStyles:l&&o<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:f,subTitle:g,className:"k-adaptive-actionsheet",position:l&&o<=l.small?"fullscreen":void 0};return a.createElement(c.ActionSheet,{...v},u,e&&a.createElement(c.ActionSheetFooter,null,a.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,type:"button",onClick:e.onCancel},e.cancelText),a.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=A;
|