@progress/kendo-react-dateinputs 14.4.1-develop.9 → 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 +11 -24
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +41 -55
- package/calendar/components/HorizontalViewList.d.ts +29 -27
- 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 +12 -43
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +111 -137
- package/calendar/components/ViewList.d.ts +27 -67
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +207 -225
- package/calendar/models/CalendarSettings.d.ts +2 -2
- package/calendar/models/MultiViewCalendarSettings.d.ts +4 -4
- package/calendar/models/ViewService.d.ts +1 -1
- package/calendar/models/index.d.ts +7 -7
- package/calendar/services/BusViewService.d.ts +1 -1
- package/calendar/services/DecadeViewService.d.ts +2 -2
- package/calendar/services/MonthViewService.d.ts +2 -2
- package/calendar/services/NavigationService.d.ts +1 -1
- package/calendar/services/ScrollSyncService.d.ts +4 -4
- package/calendar/services/WeekNamesService.d.ts +1 -1
- package/calendar/services/YearViewService.d.ts +2 -2
- package/dateinput/DateInput.d.ts +1 -1
- package/dateinput/models/DateInputSettings.d.ts +2 -2
- package/dateinput/models/dateinput-options.d.ts +2 -2
- package/dateinput/models/index.d.ts +7 -7
- package/dateinput/models/kendo-date.d.ts +1 -1
- package/datepicker/models/DatePickerSettings.d.ts +2 -2
- package/datepicker/models/index.d.ts +1 -1
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +1 -1
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +1 -1
- package/daterangepicker/models/DateRangePickerSettings.d.ts +3 -3
- package/daterangepicker/models/index.d.ts +4 -4
- package/datetimepicker/DateTimePicker.d.ts +1 -1
- package/datetimepicker/models/DateTimePickerSettings.d.ts +1 -1
- package/datetimepicker/models/index.d.ts +1 -1
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePart.d.ts +1 -1
- package/timepicker/TimePicker.d.ts +1 -1
- package/timepicker/TimeSelector.d.ts +1 -1
- package/timepicker/models/ListService.d.ts +2 -2
- package/timepicker/models/TimePickerSettings.d.ts +3 -3
- package/timepicker/models/index.d.ts +5 -5
- package/timepicker/services/DayPeriodService.d.ts +3 -3
- package/timepicker/services/HoursService.d.ts +3 -3
- package/timepicker/services/MinutesService.d.ts +3 -3
- package/timepicker/services/SecondsService.d.ts +3 -3
- package/virtualization/Virtualization.d.ts +25 -63
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +163 -168
|
@@ -5,171 +5,170 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as n from "react";
|
|
9
9
|
import o from "prop-types";
|
|
10
|
-
import {
|
|
11
|
-
import { ScrollerService as
|
|
12
|
-
const
|
|
13
|
-
1: (
|
|
14
|
-
0: (
|
|
15
|
-
},
|
|
16
|
-
1: (
|
|
17
|
-
0: (
|
|
18
|
-
},
|
|
19
|
-
1: (
|
|
20
|
-
0: (
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return { start: Math.min(Math.max(c + l * f, 0), n), end: c };
|
|
59
|
-
}, this.containerMaxScroll = () => this.containerScrollSize - this.containerOffsetSize, this.getContainerScrollDirection = (t) => t < this.containerScrollPosition ? 0 : 1, this.initServices = (t = this.props) => {
|
|
60
|
-
const e = this.direction === "vertical" ? t.itemHeight : t.itemWidth;
|
|
61
|
-
e !== void 0 && (this.rowHeightService = new b(t.total, e), this.scrollerService.create(
|
|
62
|
-
this.rowHeightService,
|
|
63
|
-
t.skip,
|
|
64
|
-
t.take,
|
|
65
|
-
t.total,
|
|
66
|
-
t.topOffset,
|
|
67
|
-
this.scrollOffsetSize,
|
|
68
|
-
this.direction
|
|
69
|
-
));
|
|
70
|
-
}, this.getContainerProperty = (t) => this.scrollContainer ? this.scrollContainer[t] : 0, this.handleScroll = (t) => {
|
|
71
|
-
if (!this.scrollContainer || !this.rowHeightService)
|
|
72
|
-
return;
|
|
73
|
-
const e = t.target;
|
|
74
|
-
this.scrollerService.onScroll({
|
|
75
|
-
scrollLeft: e.scrollLeft,
|
|
76
|
-
scrollTop: e.scrollTop,
|
|
77
|
-
offsetHeight: e.offsetHeight,
|
|
78
|
-
offsetWidth: e.offsetWidth
|
|
79
|
-
});
|
|
80
|
-
const r = this.rowHeightService.index(this.containerScrollPosition - this.props.topOffset), { onScrollAction: n } = this.props, l = {
|
|
81
|
-
index: r,
|
|
82
|
-
target: e,
|
|
83
|
-
scrollAction: this.scrollAction,
|
|
84
|
-
pageAction: this.pageAction,
|
|
85
|
-
animationInProgress: this.animationInProgress
|
|
86
|
-
};
|
|
87
|
-
this.props.onScroll && this.props.onScroll.call(void 0, t), n && n.call(void 0, l), this.scrollAction = void 0, this.pageAction = void 0;
|
|
88
|
-
}, this.handleScrollAction = (t) => {
|
|
89
|
-
this.scrollAction = t;
|
|
90
|
-
}, this.handlePageAction = (t) => {
|
|
91
|
-
this.pageAction = t;
|
|
92
|
-
}, this.scrollerService = new P(this.handleScrollAction, this.handlePageAction), this.restrictScroll = Number.parseFloat(u.version) > 17;
|
|
93
|
-
}
|
|
94
|
-
get element() {
|
|
95
|
-
return this.scrollContainer;
|
|
96
|
-
}
|
|
97
|
-
get containerOffsetSize() {
|
|
98
|
-
return this.getContainerProperty(this.direction === "vertical" ? "offsetHeight" : "offsetWidth");
|
|
99
|
-
}
|
|
100
|
-
get containerScrollSize() {
|
|
101
|
-
return this.getContainerProperty(this.direction === "vertical" ? "scrollHeight" : "scrollWidth");
|
|
102
|
-
}
|
|
103
|
-
get containerScrollPosition() {
|
|
104
|
-
return this.getContainerProperty(this.direction === "vertical" ? "scrollTop" : "scrollLeft");
|
|
105
|
-
}
|
|
106
|
-
get direction() {
|
|
107
|
-
return this.props.direction !== void 0 ? this.props.direction : a.defaultProps.direction;
|
|
108
|
-
}
|
|
109
|
-
get scrollOffsetSize() {
|
|
110
|
-
return this.props.scrollOffsetSize !== void 0 ? this.props.scrollOffsetSize : a.defaultProps.scrollOffsetSize;
|
|
111
|
-
}
|
|
112
|
-
activeIndex() {
|
|
113
|
-
return this.itemIndex(Math.ceil(this.containerScrollPosition));
|
|
114
|
-
}
|
|
115
|
-
itemIndex(i) {
|
|
116
|
-
return this.rowHeightService ? this.rowHeightService.index(i) : 0;
|
|
117
|
-
}
|
|
118
|
-
itemOffset(i) {
|
|
119
|
-
return this.rowHeightService ? this.rowHeightService.offset(i) : 0;
|
|
120
|
-
}
|
|
121
|
-
isIndexVisible(i) {
|
|
122
|
-
if (!this.rowHeightService)
|
|
10
|
+
import { classNames as K, uCalendar as D, RowHeightService as ze } from "@progress/kendo-react-common";
|
|
11
|
+
import { ScrollerService as Ie } from "./services/ScrollerService.mjs";
|
|
12
|
+
const Ne = (c, s, i) => Math.min(Math.abs(s - c), i), Me = 17, Ae = 10, De = {
|
|
13
|
+
1: (c) => (s) => s + c,
|
|
14
|
+
0: (c) => (s) => s - c
|
|
15
|
+
}, Ce = {
|
|
16
|
+
1: (c) => (s) => Math.min(s, c),
|
|
17
|
+
0: (c) => (s) => Math.max(s, c)
|
|
18
|
+
}, He = {
|
|
19
|
+
1: (c) => (s) => s < c,
|
|
20
|
+
0: (c) => (s) => s > c
|
|
21
|
+
}, h = {
|
|
22
|
+
direction: "vertical",
|
|
23
|
+
scrollOffsetSize: 0,
|
|
24
|
+
maxScrollDifference: 100,
|
|
25
|
+
scrollDuration: 100
|
|
26
|
+
}, C = n.forwardRef((c, s) => {
|
|
27
|
+
const {
|
|
28
|
+
direction: i = h.direction,
|
|
29
|
+
scrollOffsetSize: U = h.scrollOffsetSize,
|
|
30
|
+
maxScrollDifference: j = h.maxScrollDifference,
|
|
31
|
+
scrollDuration: G = h.scrollDuration,
|
|
32
|
+
bottomOffset: H,
|
|
33
|
+
className: J,
|
|
34
|
+
tabIndex: Q,
|
|
35
|
+
role: X,
|
|
36
|
+
children: Y,
|
|
37
|
+
unstyled: b,
|
|
38
|
+
total: S,
|
|
39
|
+
take: v,
|
|
40
|
+
skip: Z,
|
|
41
|
+
topOffset: P,
|
|
42
|
+
itemHeight: ee,
|
|
43
|
+
itemWidth: re,
|
|
44
|
+
onMount: O,
|
|
45
|
+
onScroll: L,
|
|
46
|
+
onScrollAction: q
|
|
47
|
+
} = c, T = (e) => u.current ? u.current[e] : 0, y = () => T(i === "vertical" ? "offsetHeight" : "offsetWidth"), w = () => T(i === "vertical" ? "scrollHeight" : "scrollWidth"), m = () => T(i === "vertical" ? "scrollTop" : "scrollLeft"), te = () => w() - y(), ne = (e) => e < m() ? 0 : 1, oe = (e, t) => {
|
|
48
|
+
const l = G || h.scrollDuration;
|
|
49
|
+
return Math.abs(t - e) / (l / Me);
|
|
50
|
+
}, ce = (e, t) => {
|
|
51
|
+
const l = m();
|
|
52
|
+
if (Number.parseInt(`${e}`, 10) === Number.parseInt(`${l}`, 10))
|
|
53
|
+
return { start: e, end: e };
|
|
54
|
+
const a = te(), f = t === 0 ? 1 : -1, M = Ne(l, e, j || 0), d = Math.min(e, a);
|
|
55
|
+
return { start: Math.min(Math.max(d + f * M, 0), a), end: d };
|
|
56
|
+
}, V = (e) => r.current ? r.current.index(e) : 0, se = (e) => r.current ? r.current.offset(e) : 0, le = () => V(Math.ceil(m())), ie = (e) => {
|
|
57
|
+
if (!r.current)
|
|
123
58
|
return !1;
|
|
124
|
-
const t =
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
59
|
+
const t = m(), l = t + y(), a = r.current.offset(e), f = a + r.current.height(e);
|
|
60
|
+
return a >= t && f <= l;
|
|
61
|
+
}, ae = (e) => r.current ? m() !== r.current.offset(e) : !1, p = (e) => {
|
|
62
|
+
const t = i === "vertical" ? "scrollTop" : "scrollLeft";
|
|
63
|
+
if (!u.current)
|
|
64
|
+
return;
|
|
65
|
+
const l = u.current[t];
|
|
66
|
+
Re.current && t === "scrollTop" && (!Number.isInteger(l) || !Number.isInteger(e)) && Math.abs(l - e) < Ae || (u.current[t] = e);
|
|
67
|
+
}, ue = (e) => {
|
|
68
|
+
g.current = !1, r.current && p(r.current.offset(e));
|
|
69
|
+
}, fe = (e) => {
|
|
70
|
+
if (!r.current || !globalThis)
|
|
71
|
+
return;
|
|
72
|
+
globalThis.cancelAnimationFrame(x.current);
|
|
73
|
+
const t = r.current.offset(e), l = ne(t), { start: a, end: f } = ce(t, l);
|
|
74
|
+
if (a === f)
|
|
75
|
+
return;
|
|
76
|
+
const M = oe(a, f), d = De[l](M), _ = Ce[l](f), Te = He[l](d(f)), B = (xe) => {
|
|
77
|
+
g.current = !0;
|
|
78
|
+
const A = d(xe);
|
|
79
|
+
p(_(A)), Te(A) ? x.current = globalThis.requestAnimationFrame(() => {
|
|
80
|
+
B(A);
|
|
81
|
+
}) : g.current = !1;
|
|
82
|
+
};
|
|
83
|
+
x.current = globalThis.requestAnimationFrame(() => {
|
|
84
|
+
B(a);
|
|
85
|
+
});
|
|
86
|
+
}, me = () => {
|
|
87
|
+
r.current && p(r.current.totalHeight() + H);
|
|
88
|
+
}, de = (e) => {
|
|
89
|
+
z.current = e;
|
|
90
|
+
}, he = (e) => {
|
|
91
|
+
I.current = e;
|
|
92
|
+
}, Se = (e) => {
|
|
93
|
+
if (!u.current || !r.current)
|
|
94
|
+
return;
|
|
95
|
+
const t = e.target;
|
|
96
|
+
W.current.onScroll({
|
|
97
|
+
scrollLeft: t.scrollLeft,
|
|
98
|
+
scrollTop: t.scrollTop,
|
|
99
|
+
offsetHeight: t.offsetHeight,
|
|
100
|
+
offsetWidth: t.offsetWidth
|
|
101
|
+
});
|
|
102
|
+
const a = {
|
|
103
|
+
index: r.current.index(m() - P),
|
|
104
|
+
target: t,
|
|
105
|
+
scrollAction: z.current,
|
|
106
|
+
pageAction: I.current,
|
|
107
|
+
animationInProgress: g.current
|
|
108
|
+
};
|
|
109
|
+
L && L(e), q && q(a), z.current = void 0, I.current = void 0;
|
|
110
|
+
}, pe = () => {
|
|
111
|
+
const e = i === "vertical" ? ee : re;
|
|
112
|
+
e !== void 0 && (r.current = new ze(S, e), W.current.create(
|
|
113
|
+
r.current,
|
|
114
|
+
Z,
|
|
115
|
+
v,
|
|
116
|
+
S,
|
|
117
|
+
P,
|
|
118
|
+
U,
|
|
119
|
+
i
|
|
120
|
+
));
|
|
121
|
+
}, R = n.useRef(null), u = n.useRef(null), W = n.useRef(new Ie(de, he)), r = n.useRef(null), x = n.useRef(0), g = n.useRef(!1), Re = n.useRef(Number.parseFloat(n.version) > 17), z = n.useRef(void 0), I = n.useRef(void 0), k = n.useRef(0), E = n.useRef(0), F = n.useRef(null);
|
|
122
|
+
n.useImperativeHandle(R, () => ({
|
|
123
|
+
element: u.current,
|
|
124
|
+
containerScrollSize: w(),
|
|
125
|
+
containerScrollPosition: m(),
|
|
126
|
+
activeIndex: le,
|
|
127
|
+
scrollTo: p,
|
|
128
|
+
scrollToIndex: ue,
|
|
129
|
+
animateToIndex: fe,
|
|
130
|
+
scrollToBottom: me,
|
|
131
|
+
isIndexVisible: ie,
|
|
132
|
+
isListScrolled: ae,
|
|
133
|
+
itemIndex: V,
|
|
134
|
+
itemOffset: se
|
|
135
|
+
})), n.useImperativeHandle(s, () => R.current), n.useEffect(() => {
|
|
136
|
+
O && R.current && O(R.current);
|
|
137
|
+
}, []);
|
|
138
|
+
const N = b == null ? void 0 : b.uCalendar;
|
|
139
|
+
(k.current !== S || F.current !== i || E.current !== v) && (pe(), k.current = S, F.current = i, E.current = v);
|
|
140
|
+
const $ = `${(r.current ? r.current.totalHeight() : 0) + H}`, ge = i === "vertical" ? { height: `${$}px` } : { width: `${$}px` }, be = K(
|
|
141
|
+
D.scrollableSelector({
|
|
142
|
+
c: N
|
|
143
|
+
}),
|
|
144
|
+
D.scrollable({
|
|
145
|
+
c: N,
|
|
146
|
+
horizontal: i === "horizontal"
|
|
147
|
+
}),
|
|
148
|
+
J
|
|
149
|
+
), ve = K(
|
|
150
|
+
D.scrollablePlaceholder({
|
|
151
|
+
c: N,
|
|
152
|
+
horizontal: i === "horizontal"
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
return /* @__PURE__ */ n.createElement(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
ref: u,
|
|
159
|
+
onScroll: Se,
|
|
160
|
+
className: be,
|
|
161
|
+
tabIndex: Q,
|
|
162
|
+
role: X
|
|
163
|
+
},
|
|
164
|
+
Y,
|
|
165
|
+
/* @__PURE__ */ n.createElement("div", { style: ge, className: ve })
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
C.propTypes = {
|
|
169
169
|
bottomOffset: o.number.isRequired,
|
|
170
170
|
className: o.string,
|
|
171
171
|
direction: o.oneOf(["horizontal", "vertical"]),
|
|
172
|
-
forceScroll: o.bool,
|
|
173
172
|
itemHeight: o.number,
|
|
174
173
|
itemWidth: o.number,
|
|
175
174
|
maxScrollDifference: o.number,
|
|
@@ -183,14 +182,10 @@ a.propTypes = {
|
|
|
183
182
|
topOffset: o.number.isRequired,
|
|
184
183
|
total: o.number.isRequired,
|
|
185
184
|
role: o.string
|
|
186
|
-
}, a.defaultProps = {
|
|
187
|
-
direction: "vertical",
|
|
188
|
-
forceScroll: !1,
|
|
189
|
-
scrollOffsetSize: 0,
|
|
190
|
-
maxScrollDifference: 100,
|
|
191
|
-
scrollDuration: 100
|
|
192
185
|
};
|
|
193
|
-
|
|
186
|
+
C.displayName = "KendoReactVirtualization";
|
|
187
|
+
const qe = C;
|
|
194
188
|
export {
|
|
195
|
-
|
|
189
|
+
qe as Virtualization,
|
|
190
|
+
h as virtualizationDefaultProps
|
|
196
191
|
};
|