@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.
Files changed (71) hide show
  1. package/calendar/components/Calendar.d.ts +35 -110
  2. package/calendar/components/Calendar.js +5 -5
  3. package/calendar/components/Calendar.mjs +288 -313
  4. package/calendar/components/CalendarCell.d.ts +1 -10
  5. package/calendar/components/CalendarCell.js +1 -1
  6. package/calendar/components/CalendarCell.mjs +68 -78
  7. package/calendar/components/Header.d.ts +11 -24
  8. package/calendar/components/Header.js +1 -1
  9. package/calendar/components/Header.mjs +41 -55
  10. package/calendar/components/HorizontalViewList.d.ts +29 -27
  11. package/calendar/components/HorizontalViewList.js +1 -1
  12. package/calendar/components/HorizontalViewList.mjs +112 -102
  13. package/calendar/components/MultiViewCalendar.d.ts +39 -141
  14. package/calendar/components/MultiViewCalendar.js +1 -1
  15. package/calendar/components/MultiViewCalendar.mjs +331 -373
  16. package/calendar/components/Navigation.d.ts +19 -39
  17. package/calendar/components/Navigation.js +1 -1
  18. package/calendar/components/Navigation.mjs +95 -107
  19. package/calendar/components/TodayCommand.d.ts +8 -25
  20. package/calendar/components/TodayCommand.js +1 -1
  21. package/calendar/components/TodayCommand.mjs +44 -61
  22. package/calendar/components/View.d.ts +12 -43
  23. package/calendar/components/View.js +1 -1
  24. package/calendar/components/View.mjs +111 -137
  25. package/calendar/components/ViewList.d.ts +27 -67
  26. package/calendar/components/ViewList.js +1 -1
  27. package/calendar/components/ViewList.mjs +207 -225
  28. package/calendar/models/CalendarSettings.d.ts +2 -2
  29. package/calendar/models/MultiViewCalendarSettings.d.ts +4 -4
  30. package/calendar/models/ViewService.d.ts +1 -1
  31. package/calendar/models/index.d.ts +7 -7
  32. package/calendar/services/BusViewService.d.ts +1 -1
  33. package/calendar/services/DecadeViewService.d.ts +2 -2
  34. package/calendar/services/MonthViewService.d.ts +2 -2
  35. package/calendar/services/NavigationService.d.ts +1 -1
  36. package/calendar/services/ScrollSyncService.d.ts +4 -4
  37. package/calendar/services/WeekNamesService.d.ts +1 -1
  38. package/calendar/services/YearViewService.d.ts +2 -2
  39. package/dateinput/DateInput.d.ts +1 -1
  40. package/dateinput/models/DateInputSettings.d.ts +2 -2
  41. package/dateinput/models/dateinput-options.d.ts +2 -2
  42. package/dateinput/models/index.d.ts +7 -7
  43. package/dateinput/models/kendo-date.d.ts +1 -1
  44. package/datepicker/models/DatePickerSettings.d.ts +2 -2
  45. package/datepicker/models/index.d.ts +1 -1
  46. package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +1 -1
  47. package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +1 -1
  48. package/daterangepicker/models/DateRangePickerSettings.d.ts +3 -3
  49. package/daterangepicker/models/index.d.ts +4 -4
  50. package/datetimepicker/DateTimePicker.d.ts +1 -1
  51. package/datetimepicker/models/DateTimePickerSettings.d.ts +1 -1
  52. package/datetimepicker/models/index.d.ts +1 -1
  53. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  54. package/index.d.mts +1 -1
  55. package/index.d.ts +1 -1
  56. package/package-metadata.js +1 -1
  57. package/package-metadata.mjs +2 -2
  58. package/package.json +8 -8
  59. package/timepicker/TimePart.d.ts +1 -1
  60. package/timepicker/TimePicker.d.ts +1 -1
  61. package/timepicker/TimeSelector.d.ts +1 -1
  62. package/timepicker/models/ListService.d.ts +2 -2
  63. package/timepicker/models/TimePickerSettings.d.ts +3 -3
  64. package/timepicker/models/index.d.ts +5 -5
  65. package/timepicker/services/DayPeriodService.d.ts +3 -3
  66. package/timepicker/services/HoursService.d.ts +3 -3
  67. package/timepicker/services/MinutesService.d.ts +3 -3
  68. package/timepicker/services/SecondsService.d.ts +3 -3
  69. package/virtualization/Virtualization.d.ts +25 -63
  70. package/virtualization/Virtualization.js +1 -1
  71. package/virtualization/Virtualization.mjs +163 -168
@@ -5,334 +5,309 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as f from "react";
9
- import s from "prop-types";
10
- import { withIdHOC as L, withPropsContext as B, withUnstyledHOC as T, createPropsContext as F, Keys as D, setScrollbarWidth as C, classNames as K, uCalendar as U } from "@progress/kendo-react-common";
11
- import { cloneDate as g, isEqualDate as y, getDate as c } from "@progress/kendo-date-math";
12
- import { provideIntlService as $, registerForIntl as R } from "@progress/kendo-react-intl";
13
- import { ViewList as _ } from "./ViewList.mjs";
14
- import { Navigation as Y } from "./Navigation.mjs";
15
- import { CalendarViewEnum as r } from "../models/CalendarViewEnum.mjs";
16
- import { getToday as x, dateInRange as V, viewInRange as I, MAX_DATE as z, MIN_DATE as H, isInRange as N } from "../../utils.mjs";
17
- import { BusViewService as q } from "../services/BusViewService.mjs";
18
- import { DOMService as X } from "../services/DOMService.mjs";
19
- import { NavigationService as j } from "../services/NavigationService.mjs";
20
- import { ScrollSyncService as G } from "../services/ScrollSyncService.mjs";
21
- const S = (u) => u ? u.virtualization : null, E = (u = d.defaultProps.min, a = d.defaultProps.max, e, t) => t !== void 0 ? t !== null && N(c(t), u, a) ? t : null : e !== null && N(c(e), u, a) ? e : null, n = class n extends f.Component {
22
- constructor(a) {
23
- super(a), this.scrollSyncService = null, this.focusedDate = null, this.Navigation = null, this.calendarViewList = null, this._element = null, this.intl = null, this.service = null, this.isActive = !1, this.didNavigationChange = !1, this.focus = () => {
24
- this._element && this._element.focus();
25
- }, this.shouldScroll = () => this.didNavigationChange, this.handleScroll = (t) => {
26
- this.scrollSyncService && this.scrollSyncService.sync(
27
- S(this.Navigation),
28
- S(this.calendarViewList),
29
- t
30
- );
31
- }, this.handleNavigationChange = (t) => {
32
- if (this.props.disabled)
33
- return;
34
- this.didNavigationChange = !0;
35
- const i = g(t.value);
36
- this.setState({ focusedDate: i });
37
- }, this.handleViewChange = ({ view: t }) => {
38
- this.scrollSyncService && this.scrollSyncService.configure(t), this.setState({ activeView: t });
39
- }, this.handleDateChange = (t) => {
40
- const i = g(t.value), o = g(t.value), v = this.bus.canMoveDown(this.state.activeView);
41
- if (this.props.disabled)
42
- return;
43
- if (v)
44
- if (t.isTodayClick)
45
- this.bus.moveToBottom(this.state.activeView);
8
+ import * as t from "react";
9
+ import n from "prop-types";
10
+ import { usePropsContext as Xe, useUnstyled as je, useId as Ge, setScrollbarWidth as re, classNames as Je, uCalendar as Qe, createPropsContext as Ze, Keys as N } from "@progress/kendo-react-common";
11
+ import { getDate as C, isEqualDate as H, cloneDate as I } from "@progress/kendo-date-math";
12
+ import { useInternationalization as et } from "@progress/kendo-react-intl";
13
+ import { ViewList as tt } from "./ViewList.mjs";
14
+ import { Navigation as nt } from "./Navigation.mjs";
15
+ import { CalendarViewEnum as y } from "../models/CalendarViewEnum.mjs";
16
+ import { MIN_DATE as rt, MAX_DATE as ot, dateInRange as B, getToday as oe, viewInRange as ae, isInRange as ce } from "../../utils.mjs";
17
+ import { BusViewService as at } from "../services/BusViewService.mjs";
18
+ import { DOMService as ct } from "../services/DOMService.mjs";
19
+ import { NavigationService as it } from "../services/NavigationService.mjs";
20
+ import { ScrollSyncService as st } from "../services/ScrollSyncService.mjs";
21
+ const W = (r) => r ? r.virtualization : null, ie = (r, o, a = i.min, u = i.max) => o !== void 0 ? o !== null && ce(C(o), a, u) ? o : null : r !== null && ce(C(r), a, u) ? r : null, i = {
22
+ disabled: !1,
23
+ min: rt,
24
+ max: ot,
25
+ weekDaysFormat: "short",
26
+ navigation: !0,
27
+ defaultActiveView: "month",
28
+ defaultValue: null,
29
+ topView: "century",
30
+ bottomView: "month",
31
+ showOtherMonthDays: !1
32
+ }, ut = Ze(), T = t.forwardRef((r, o) => {
33
+ const a = Xe(ut, r), u = je(), v = Ge(a.id), se = et(), {
34
+ disabled: R = i.disabled,
35
+ min: ue = i.min,
36
+ max: le = i.max,
37
+ weekDaysFormat: fe = i.weekDaysFormat,
38
+ navigation: de = i.navigation,
39
+ defaultActiveView: me = i.defaultActiveView,
40
+ defaultValue: ve = i.defaultValue,
41
+ topView: we = i.topView,
42
+ bottomView: De = i.bottomView,
43
+ showOtherMonthDays: he = i.showOtherMonthDays,
44
+ _ref: q,
45
+ unstyled: ge,
46
+ className: pe,
47
+ weekNumber: X,
48
+ mobileMode: be,
49
+ focusedDate: Ve,
50
+ value: F,
51
+ onChange: j,
52
+ onFocus: G,
53
+ onBlur: J,
54
+ cell: ye,
55
+ weekCell: Re,
56
+ headerTitle: Ce,
57
+ header: Ee,
58
+ tabIndex: K,
59
+ navigationItem: Se,
60
+ ariaLabelledBy: Ie,
61
+ ariaDescribedBy: ke
62
+ } = a, E = ge || u, d = C(ue), w = C(le), _ = y[De], $ = y[we], xe = v + "-cell-uid", Pe = a.id || v + "-id", Ae = ({ view: e }) => {
63
+ h.current && h.current.configure(e), V({ activeView: e });
64
+ }, Me = () => M.current, Q = (e) => {
65
+ h.current && h.current.sync(
66
+ W(ee.current),
67
+ W(s.current),
68
+ e
69
+ );
70
+ }, Oe = (e) => {
71
+ if (R)
72
+ return;
73
+ M.current = !0;
74
+ const g = I(e.value);
75
+ V({ focusedDate: g });
76
+ }, Z = (e) => {
77
+ const g = I(e.value), p = I(e.value), L = b.current.canMoveDown(l.activeView);
78
+ if (!R) {
79
+ if (L)
80
+ if (e.isTodayClick)
81
+ b.current.moveToBottom(l.activeView);
46
82
  else {
47
- this.bus.moveDown(this.state.activeView, t.syntheticEvent), this.setState({ focusedDate: o });
83
+ b.current.moveDown(l.activeView, e.syntheticEvent), V({ focusedDate: p });
48
84
  return;
49
85
  }
50
- this.setState({ value: i, focusedDate: o }), this.valueDuringOnChange = i;
51
- const { onChange: h } = this.props;
52
- if (h) {
53
- const l = {
54
- syntheticEvent: t.syntheticEvent,
55
- nativeEvent: t.nativeEvent,
56
- value: i,
57
- target: this
86
+ if (V({ value: g, focusedDate: p }), x.current = g, j) {
87
+ const U = {
88
+ syntheticEvent: e.syntheticEvent,
89
+ nativeEvent: e.nativeEvent,
90
+ value: g,
91
+ target: z.current
58
92
  };
59
- h.call(void 0, l);
93
+ j(U);
60
94
  }
61
- this.valueDuringOnChange = void 0;
62
- }, this.handleFocus = (t) => {
63
- if (this.isActive = !0, !this.calendarViewList)
64
- return;
65
- this.calendarViewList.focusActiveDate();
66
- const { onFocus: i } = this.props;
67
- i && i.call(void 0, t);
68
- }, this.handleBlur = (t) => {
69
- if (this.isActive = !1, !this.calendarViewList)
70
- return;
71
- this.calendarViewList.blurActiveDate();
72
- const { onBlur: i } = this.props;
73
- i && i.call(void 0, t);
74
- }, this.handleKeyDown = (t) => {
75
- const { keyCode: o, ctrlKey: v, metaKey: h } = t;
76
- if (!(!this.focusedDate || !this.service)) {
77
- if (o === 84 && this.setState({ focusedDate: x() }), (v || h) && (o === D.left || o === D.right)) {
78
- if (this.props.disabled)
79
- return;
80
- this.didNavigationChange = !0, this.focusedDate.getDate() === 31 && this.focusedDate.setDate(30);
81
- const l = o === D.left ? this.focusedDate.getMonth() - 1 : this.focusedDate.getMonth() + 1, p = new Date(this.focusedDate.setMonth(l)), b = g(p);
82
- this.setState({ focusedDate: b });
83
- }
84
- if (o === D.enter) {
85
- if (this.value !== null && y(this.focusedDate, this.value)) {
86
- const p = V(this.focusedDate, this.min, this.max);
87
- S(this.calendarViewList).scrollToIndex(this.service.skip(p, this.min));
88
- }
89
- const l = {
90
- syntheticEvent: t,
91
- nativeEvent: t.nativeEvent,
92
- value: this.focusedDate,
93
- target: this
94
- };
95
- this.handleDateChange(l);
96
- } else {
97
- const l = V(
98
- this.navigation.move(
99
- this.focusedDate,
100
- this.navigation.action(t),
101
- this.state.activeView,
102
- this.service,
103
- t
104
- ),
105
- this.min,
106
- this.max
107
- );
108
- if (y(this.focusedDate, l))
109
- return;
110
- this.setState({ focusedDate: l });
95
+ x.current = void 0;
96
+ }
97
+ }, Ne = (e) => {
98
+ P.current = !0, s.current && (s.current.focusActiveDate(), G && G(e));
99
+ }, Be = (e) => {
100
+ P.current = !1, s.current && (s.current.blurActiveDate(), J && J(e));
101
+ }, Te = (e) => {
102
+ const { keyCode: p, ctrlKey: L, metaKey: U } = e;
103
+ if (!(!m || !S)) {
104
+ if (p === 84 && V({ focusedDate: oe() }), (L || U) && (p === N.left || p === N.right)) {
105
+ if (R)
106
+ return;
107
+ M.current = !0;
108
+ const f = I(m);
109
+ f.getDate() === 31 && f.setDate(30);
110
+ const Y = p === N.left ? f.getMonth() - 1 : f.getMonth() + 1, qe = new Date(f.setMonth(Y));
111
+ V({ focusedDate: I(qe) });
112
+ }
113
+ if (p === N.enter) {
114
+ if (c !== null && H(m, c)) {
115
+ const Y = B(m, d, w);
116
+ W(s.current).scrollToIndex(S.skip(Y, d));
111
117
  }
112
- t.preventDefault();
118
+ const f = {
119
+ syntheticEvent: e,
120
+ nativeEvent: e.nativeEvent,
121
+ value: m,
122
+ target: s.current
123
+ };
124
+ Z(f);
125
+ } else {
126
+ const f = B(
127
+ te.current.move(
128
+ m,
129
+ te.current.action(e),
130
+ l.activeView,
131
+ S,
132
+ e
133
+ ),
134
+ d,
135
+ w
136
+ );
137
+ if (H(m, f))
138
+ return;
139
+ V({ focusedDate: f });
113
140
  }
114
- }, this.handleMouseDown = (t) => {
115
- t.preventDefault();
116
- }, this.handleClick = (t) => {
117
- this._element && this._element.focus({ preventScroll: !0 });
118
- };
119
- const e = E(
120
- this.min,
121
- this.max,
122
- this.props.defaultValue || n.defaultProps.defaultValue,
123
- this.props.value
124
- );
125
- this.state = {
141
+ e.preventDefault();
142
+ }
143
+ }, Fe = (e) => {
144
+ e.preventDefault();
145
+ }, Ke = (e) => {
146
+ D.current && D.current.focus({ preventScroll: !0 });
147
+ }, z = t.useRef(null);
148
+ t.useImperativeHandle(
149
+ z,
150
+ () => ({
151
+ get element() {
152
+ return D.current;
153
+ },
154
+ get value() {
155
+ return c;
156
+ },
157
+ get props() {
158
+ return a;
159
+ },
160
+ focus: () => {
161
+ var e;
162
+ return (e = D.current) == null ? void 0 : e.focus();
163
+ }
164
+ })
165
+ ), t.useImperativeHandle(o, () => z.current);
166
+ const D = t.useRef(null), ee = t.useRef(null), s = t.useRef(null), k = t.useRef(new ct()), b = t.useRef(new at(Ae)), te = t.useRef(new it(b.current)), h = t.useRef(null), x = t.useRef(void 0), P = t.useRef(!1), A = t.useRef(null), M = t.useRef(!1), [l, _e] = t.useState(() => {
167
+ const e = ie(ve, F, d, w);
168
+ return {
126
169
  value: e,
127
- activeView: I(
128
- r[a.defaultActiveView],
129
- this.bottomView,
130
- this.topView
131
- ),
132
- focusedDate: V(a.focusedDate || e || x(), this.min, this.max)
133
- }, this.dom = new X(), this.bus = new q(this.handleViewChange), this.navigation = new j(this.bus), this.oldValue = e;
134
- }
135
- get cellUID() {
136
- return this.props.id + "-cell-uid";
137
- }
138
- get id() {
139
- return this.props.id + "-id";
140
- }
141
- /**
142
- * Gets the wrapping element of the Calendar.
143
- */
144
- get element() {
145
- return this._element;
146
- }
147
- /**
148
- * Gets the value of the Calendar.
149
- */
150
- get value() {
151
- return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
152
- }
153
- get min() {
154
- return c(this.props.min !== void 0 ? this.props.min : n.defaultProps.min);
155
- }
156
- get max() {
157
- return c(this.props.max !== void 0 ? this.props.max : n.defaultProps.max);
158
- }
159
- get bottomView() {
160
- return r[this.props.bottomView !== void 0 ? this.props.bottomView : n.defaultProps.bottomView];
161
- }
162
- get topView() {
163
- return r[this.props.topView !== void 0 ? this.props.topView : n.defaultProps.topView];
164
- }
165
- /**
166
- * @hidden
167
- */
168
- componentDidMount() {
169
- const { unstyled: a } = this.props;
170
+ activeView: ae(y[me], _, $),
171
+ focusedDate: B(Ve || e || oe(), d, w)
172
+ };
173
+ }), V = (e) => {
174
+ _e((g) => ({ ...g, ...e }));
175
+ }, [, $e] = t.useReducer((e) => e + 1, 0);
176
+ t.useEffect(() => {
170
177
  Promise.resolve().then(() => {
171
- C(), this._element && (this.dom.calculateHeights(this._element, a), this.scrollSyncService = new G(this.dom), this.scrollSyncService.configure(this.state.activeView), this.forceUpdate());
178
+ re(), D.current && (k.current.calculateHeights(D.current, E), h.current = new st(k.current), h.current.configure(l.activeView), $e());
172
179
  });
173
- }
174
- /**
175
- * @hidden
176
- */
177
- componentDidUpdate(a, e) {
178
- C(), e.activeView !== this.state.activeView && this.scrollSyncService && this.scrollSyncService.configure(this.state.activeView), this.calendarViewList && (this.isActive ? this.calendarViewList.focusActiveDate : this.calendarViewList.blurActiveDate)(), this.didNavigationChange = !1, this.isActive && (this.oldValue = this.value);
179
- }
180
- /**
181
- * @hidden
182
- */
183
- render() {
184
- const { _ref: a, unstyled: e, bottomView: t, topView: i, disabled: o, weekNumber: v, mobileMode: h, className: l } = this.props;
185
- a && a(this);
186
- const p = e && e.uCalendar, b = this.value !== null && this.oldValue !== null ? !y(this.value, this.oldValue) : this.value !== this.oldValue, O = I(
187
- this.state.activeView,
188
- r[t !== void 0 ? t : n.defaultProps.bottomView],
189
- r[i !== void 0 ? i : n.defaultProps.topView]
190
- ), w = E(this.min, this.max, this.value, this.value), k = w ? c(w) : null;
191
- this.focusedDate = c(
192
- V(b && w !== null ? w : this.state.focusedDate, this.min, this.max)
193
- ), this.intl = $(this), this.bus.configure(this.bottomView, this.topView), this.service = this.bus.service(O, this.intl);
194
- const { smoothScroll: A = Number.parseFloat(f.version) < 18 } = this.props, P = K(
195
- U.wrapper({
196
- c: p,
197
- disabled: o,
198
- weekNumber: v,
199
- mobileMode: h
200
- }),
201
- l
202
- ), M = [
203
- this.props.navigation && /* @__PURE__ */ f.createElement(
204
- Y,
205
- {
206
- key: 0,
207
- ref: (m) => {
208
- this.Navigation = m;
209
- },
210
- activeView: this.state.activeView,
211
- focusedDate: this.focusedDate,
212
- min: this.min,
213
- max: this.max,
214
- onScroll: this.handleScroll,
215
- onChange: this.handleNavigationChange,
216
- service: this.service,
217
- dom: this.dom,
218
- navigationItem: this.props.navigationItem,
219
- tabIndex: this.props.tabIndex,
220
- unstyled: e
221
- }
222
- ),
223
- /* @__PURE__ */ f.createElement(
224
- _,
225
- {
226
- key: 1,
227
- ref: (m) => {
228
- this.calendarViewList = m;
229
- },
230
- activeView: this.state.activeView,
231
- focusedDate: this.focusedDate,
232
- min: this.min,
233
- max: this.max,
234
- bus: this.bus,
235
- shouldScroll: this.shouldScroll,
236
- onScroll: this.handleScroll,
237
- service: this.service,
238
- cell: this.props.cell,
239
- weekCell: this.props.weekCell,
240
- dom: this.dom,
241
- smoothScroll: A,
242
- showWeekNumbers: this.props.weekNumber,
243
- onChange: this.handleDateChange,
244
- value: k,
245
- cellUID: this.cellUID,
246
- headerTitle: this.props.headerTitle,
247
- header: this.props.header,
248
- tabIndex: this.props.tabIndex,
249
- weekDaysFormat: this.props.weekDaysFormat,
250
- showOtherMonthDays: this.props.showOtherMonthDays,
251
- unstyled: e
252
- }
253
- )
254
- ];
255
- return /* @__PURE__ */ f.createElement(
256
- "div",
180
+ }, []), t.useEffect(() => {
181
+ re(), h.current && h.current.configure(ne), s.current && (P.current ? s.current.focusActiveDate : s.current.blurActiveDate)(), M.current = !1, P.current && (A.current = c);
182
+ });
183
+ let c;
184
+ x.current !== void 0 ? c = x.current : F !== void 0 ? c = F : c = l.value;
185
+ const ze = E && E.uCalendar, Le = c !== null && A.current !== null ? !H(c, A.current) : c !== A.current, ne = ae(l.activeView, _, $), O = ie(c, c, d, w), Ue = O ? C(O) : null, m = C(
186
+ B(Le && O !== null ? O : l.focusedDate, d, w)
187
+ );
188
+ b.current.configure(_, $);
189
+ const S = b.current.service(ne, se), { smoothScroll: Ye = Number.parseFloat(t.version) < 18 } = a, He = Je(
190
+ Qe.wrapper({
191
+ c: ze,
192
+ disabled: R,
193
+ weekNumber: X,
194
+ mobileMode: be
195
+ }),
196
+ pe
197
+ );
198
+ t.useEffect(() => {
199
+ q && q({ element: D.current });
200
+ });
201
+ const We = [
202
+ de && /* @__PURE__ */ t.createElement(
203
+ nt,
257
204
  {
258
- ref: (m) => {
259
- this._element = m;
260
- },
261
- className: P,
262
- id: this.props.id || this.id,
263
- "aria-labelledby": this.props.ariaLabelledBy,
264
- "aria-describedby": this.props.ariaDescribedBy,
265
- "aria-disabled": this.props.disabled,
266
- tabIndex: this.props.disabled ? void 0 : this.props.tabIndex || 0,
267
- onFocus: this.handleFocus,
268
- onBlur: this.handleBlur,
269
- onKeyDown: this.handleKeyDown,
270
- onMouseDown: this.handleMouseDown,
271
- onClick: this.handleClick
272
- },
273
- M
274
- );
275
- }
276
- };
277
- n.displayName = "Calendar", n.propTypes = {
278
- className: s.string,
279
- defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
280
- defaultValue: s.instanceOf(Date),
281
- disabled: s.bool,
282
- focusedDate: s.instanceOf(Date),
283
- id: s.string,
284
- ariaLabelledBy: s.string,
285
- ariaDescribedBy: s.string,
286
- weekDaysFormat: s.oneOf(["short", "abbreviated", "narrow"]),
287
- max: s.instanceOf(Date),
288
- min: s.instanceOf(Date),
289
- navigation: s.bool,
290
- smoothScroll: s.bool,
291
- onBlur: s.func,
292
- onChange: s.func,
293
- onFocus: s.func,
294
- tabIndex: s.number,
295
- value: s.instanceOf(Date),
296
- weekNumber: s.bool,
297
- topView: (a, e, t) => {
298
- const i = a[e], o = a.bottomView;
299
- return i && o && r[i] < r[o] ? new Error(
300
- `Invalid prop + ${e} suplied to ${t}.
301
- ${e} can not be smaller than bottomView.
302
- `
205
+ key: 0,
206
+ ref: ee,
207
+ activeView: l.activeView,
208
+ focusedDate: m,
209
+ min: d,
210
+ max: w,
211
+ onScroll: Q,
212
+ onChange: Oe,
213
+ service: S,
214
+ dom: k.current,
215
+ navigationItem: Se,
216
+ tabIndex: K,
217
+ unstyled: E
218
+ }
219
+ ),
220
+ /* @__PURE__ */ t.createElement(
221
+ tt,
222
+ {
223
+ key: 1,
224
+ ref: s,
225
+ activeView: l.activeView,
226
+ focusedDate: m,
227
+ min: d,
228
+ max: w,
229
+ bus: b.current,
230
+ shouldScroll: Me,
231
+ onScroll: Q,
232
+ service: S,
233
+ cell: ye,
234
+ weekCell: Re,
235
+ dom: k.current,
236
+ smoothScroll: Ye,
237
+ showWeekNumbers: X,
238
+ onChange: Z,
239
+ value: Ue,
240
+ cellUID: xe,
241
+ headerTitle: Ce,
242
+ header: Ee,
243
+ tabIndex: K,
244
+ weekDaysFormat: fe,
245
+ showOtherMonthDays: he,
246
+ unstyled: E
247
+ }
248
+ )
249
+ ];
250
+ return /* @__PURE__ */ t.createElement(
251
+ "div",
252
+ {
253
+ ref: D,
254
+ className: He,
255
+ id: Pe,
256
+ "aria-labelledby": Ie,
257
+ "aria-describedby": ke,
258
+ "aria-disabled": R,
259
+ tabIndex: R ? void 0 : K || 0,
260
+ onFocus: Ne,
261
+ onBlur: Be,
262
+ onKeyDown: Te,
263
+ onMouseDown: Fe,
264
+ onClick: Ke
265
+ },
266
+ We
267
+ );
268
+ });
269
+ T.propTypes = {
270
+ className: n.string,
271
+ defaultActiveView: n.oneOf(["month", "year", "decade", "century"]),
272
+ defaultValue: n.instanceOf(Date),
273
+ disabled: n.bool,
274
+ focusedDate: n.instanceOf(Date),
275
+ id: n.string,
276
+ ariaLabelledBy: n.string,
277
+ ariaDescribedBy: n.string,
278
+ weekDaysFormat: n.oneOf(["short", "abbreviated", "narrow"]),
279
+ max: n.instanceOf(Date),
280
+ min: n.instanceOf(Date),
281
+ navigation: n.bool,
282
+ smoothScroll: n.bool,
283
+ onBlur: n.func,
284
+ onChange: n.func,
285
+ onFocus: n.func,
286
+ tabIndex: n.number,
287
+ value: n.instanceOf(Date),
288
+ weekNumber: n.bool,
289
+ topView: (r, o, a) => {
290
+ const u = r[o], v = r.bottomView;
291
+ return u && v && y[u] < y[v] ? new Error(
292
+ `Invalid prop + ${o} suplied to ${a}.
293
+ ${o} can not be smaller than bottomView.
294
+ `
303
295
  ) : null;
304
296
  },
305
- bottomView: (a, e, t) => {
306
- const i = a[e], o = a.topView;
307
- return i && o && r[i] > r[o] ? new Error(
308
- `Invalid prop + ${e} suplied to ${t}.
309
- ${e} can not be bigger than topView.
310
- `
297
+ bottomView: (r, o, a) => {
298
+ const u = r[o], v = r.topView;
299
+ return u && v && y[u] > y[v] ? new Error(
300
+ `Invalid prop + ${o} suplied to ${a}.
301
+ ${o} can not be bigger than topView.
302
+ `
311
303
  ) : null;
312
304
  }
313
- }, n.defaultProps = {
314
- disabled: !1,
315
- min: H,
316
- max: z,
317
- weekDaysFormat: "short",
318
- navigation: !0,
319
- defaultActiveView: "month",
320
- defaultValue: null,
321
- topView: "century",
322
- bottomView: "month",
323
- showOtherMonthDays: !1
324
305
  };
325
- let d = n;
326
- const J = F(), Q = L(
327
- B(
328
- J,
329
- T(d)
330
- )
331
- );
332
- Q.displayName = "KendoReactCalendar";
333
- R(d);
306
+ T.displayName = "KendoReactCalendar";
307
+ const yt = T, Rt = T;
334
308
  export {
335
- Q as Calendar,
336
- J as CalendarPropsContext,
337
- d as CalendarWithoutContext
309
+ Rt as Calendar,
310
+ ut as CalendarPropsContext,
311
+ yt as CalendarWithoutContext,
312
+ i as calendarDefaultProps
338
313
  };
@@ -59,13 +59,4 @@ export interface CalendarCellProps extends CellContext {
59
59
  * * [Customizing the cells inside the Calendar view](https://www.telerik.com/kendo-react-ui/components/dateinputs/calendar/custom-rendering#toc-cells-inside-the-view)
60
60
  * * [Customizing the cells inside the MultiViewCalendar view](https://www.telerik.com/kendo-react-ui/components/dateinputs/multiviewcalendar/custom-rendering#toc-cells-inside-the-view)
61
61
  */
62
- export declare class CalendarCell extends React.Component<CalendarCellProps> {
63
- /**
64
- * @hidden
65
- */
66
- shouldComponentUpdate(nextProps: CalendarCellProps): boolean;
67
- render(): React.JSX.Element;
68
- private handleClick;
69
- private handleMouseEnter;
70
- private handleMouseLeave;
71
- }
62
+ export declare const CalendarCell: React.NamedExoticComponent<CalendarCellProps>;
@@ -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 R=require("react"),l=require("@progress/kendo-react-common");function N(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const i=N(R),k=(a,t)=>{const e=Object.getOwnPropertyNames(a),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let r=0;r<e.length;r++){const o=e[r];if(a[o]!==t[o])return!1}return!0};class w extends i.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:r,...o}=t;return!((!(e&&r)||e.getTime()===r.getTime())&&k(s,o))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:r,isInRange:o,isSelected:u,isRangeStart:c,isRangeMid:f,isRangeEnd:d,isRangeSplitStart:E,isRangeSplitEnd:C,isToday:M,isDisabled:S,view:P,value:j,isOtherMonth:n,showOtherMonthDays:p,allowReverse:h,unstyled:g,...b}=this.props,y=this.props.activeRangeEnd==="end"&&d,O=this.props.activeRangeEnd==="start"&&c,m=g&&g.uCalendar,v=l.classNames(l.uCalendar.td({c:m,rangeStart:!n&&!h&&c,rangeEnd:!n&&!h&&d,rangeMid:!n&&f,rangeSplitEnd:!n&&C,rangeSplitStart:!n&&E,active:O||y,focused:r,selected:!n&&(u||c||d),today:!n&&M,weekend:s,disabled:S,isOtherMonth:n,isEmpty:!p&&n}),t);return!p&&n?i.createElement("td",{role:"gridcell",className:v}):i.createElement("td",{...b,className:v,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},i.createElement("span",{className:l.classNames(l.uCalendar.link({c:m}))},this.props.children))}}exports.CalendarCell=w;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),l=require("@progress/kendo-react-common");function _(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=_(V),x=(e,n)=>{const t=Object.getOwnPropertyNames(e),s=Object.getOwnPropertyNames(n);if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++){const o=t[r];if(e[o]!==n[o])return!1}return!0},A=c.memo(e=>{const{className:n,formattedValue:t,isWeekend:s,isFocused:r,isInRange:o,isSelected:g,isRangeStart:i,isRangeMid:b,isRangeEnd:u,isRangeSplitStart:y,isRangeSplitEnd:M,isToday:O,isDisabled:N,view:z,value:d,isOtherMonth:a,showOtherMonthDays:m,allowReverse:p,unstyled:f,activeRangeEnd:v,children:k,onClick:E,onMouseEnter:S,onMouseLeave:h,...P}=e,j=L=>{E&&E(d,L)},w=()=>{S&&S(d)},T=()=>{h&&h(d)},q=v==="end"&&u,D=v==="start"&&i,C=f&&f.uCalendar,R=l.classNames(l.uCalendar.td({c:C,rangeStart:!a&&!p&&i,rangeEnd:!a&&!p&&u,rangeMid:!a&&b,rangeSplitEnd:!a&&M,rangeSplitStart:!a&&y,active:D||q,focused:r,selected:!a&&(g||i||u),today:!a&&O,weekend:s,disabled:N,isOtherMonth:a,isEmpty:!m&&a}),n);return!m&&a?c.createElement("td",{role:"gridcell",className:R}):c.createElement("td",{...P,className:R,onClick:j,onMouseEnter:w,onMouseLeave:T},c.createElement("span",{className:l.classNames(l.uCalendar.link({c:C}))},k))},(e,n)=>{const{value:t,...s}=e,{value:r,...o}=n;return(!(t&&r)||t.getTime()===r.getTime())&&x(s,o)});exports.CalendarCell=A;