@progress/kendo-react-dateinputs 7.5.0-develop.9 → 8.0.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 (41) hide show
  1. package/calendar/components/Calendar.js +2 -2
  2. package/calendar/components/Calendar.mjs +46 -40
  3. package/calendar/components/CalendarCell.js +1 -1
  4. package/calendar/components/CalendarCell.mjs +53 -49
  5. package/calendar/components/CalendarWeekCell.js +1 -1
  6. package/calendar/components/CalendarWeekCell.mjs +12 -10
  7. package/calendar/components/Header.js +1 -1
  8. package/calendar/components/Header.mjs +20 -19
  9. package/calendar/components/HorizontalViewList.js +1 -1
  10. package/calendar/components/HorizontalViewList.mjs +37 -29
  11. package/calendar/components/MultiViewCalendar.js +1 -1
  12. package/calendar/components/MultiViewCalendar.mjs +153 -123
  13. package/calendar/components/TodayCommand.js +1 -1
  14. package/calendar/components/TodayCommand.mjs +1 -1
  15. package/calendar/components/View.js +1 -1
  16. package/calendar/components/View.mjs +56 -48
  17. package/calendar/components/ViewList.js +1 -1
  18. package/calendar/components/ViewList.mjs +47 -45
  19. package/calendar/services/MonthViewService.js +1 -1
  20. package/calendar/services/MonthViewService.mjs +14 -16
  21. package/calendar/services/WeekNamesService.js +1 -1
  22. package/calendar/services/WeekNamesService.mjs +5 -5
  23. package/common/ClearButton.js +8 -0
  24. package/common/ClearButton.mjs +41 -0
  25. package/dateinput/DateInput.js +1 -1
  26. package/dateinput/DateInput.mjs +32 -29
  27. package/datepicker/DatePicker.js +1 -1
  28. package/datepicker/DatePicker.mjs +3 -0
  29. package/daterangepicker/DateRangePicker.js +1 -1
  30. package/daterangepicker/DateRangePicker.mjs +6 -4
  31. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  32. package/index.d.mts +80 -7
  33. package/index.d.ts +80 -7
  34. package/messages/index.js +1 -1
  35. package/messages/index.mjs +38 -36
  36. package/package-metadata.mjs +1 -1
  37. package/package.json +8 -8
  38. package/virtualization/Virtualization.js +1 -1
  39. package/virtualization/Virtualization.mjs +5 -6
  40. package/virtualization/services/RowHeightService.js +0 -8
  41. package/virtualization/services/RowHeightService.mjs +0 -50
@@ -6,33 +6,33 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as d from "react";
9
+ import * as p from "react";
10
10
  import s from "prop-types";
11
- import { provideIntlService as q, provideLocalizationService as H, registerForIntl as j, registerForLocalization as G } from "@progress/kendo-react-intl";
12
- import { Keys as E, classNames as X, createPropsContext as J, withIdHOC as Q, withPropsContext as Z } from "@progress/kendo-react-common";
13
- import { isEqualDate as O, cloneDate as u, getDate as f, firstDayOfMonth as W, lastDayOfMonth as ee } from "@progress/kendo-date-math";
14
- import { Button as T } from "@progress/kendo-react-buttons";
15
- import { chevronRightIcon as M, chevronLeftIcon as N } from "@progress/kendo-svg-icons";
16
- import { Action as y } from "../models/NavigationAction.mjs";
17
- import { CalendarViewEnum as I } from "../models/CalendarViewEnum.mjs";
18
- import { EMPTY_SELECTIONRANGE as Y } from "../models/SelectionRange.mjs";
19
- import { Header as te } from "./Header.mjs";
20
- import { dateInRange as R, getToday as C, viewInRange as P, nullable as D, MIN_DATE as se, MAX_DATE as ie, isInRange as A } from "../../utils.mjs";
21
- import { prevView as S, messages as B, nextView as L } from "../../messages/index.mjs";
22
- import { BusViewService as ae } from "../services/BusViewService.mjs";
23
- import { NavigationService as ne } from "../services/NavigationService.mjs";
24
- import { HorizontalViewList as x } from "./HorizontalViewList.mjs";
25
- import { TodayCommand as le } from "./TodayCommand.mjs";
26
- const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Date && !Array.isArray(a) && A(f(a), o, i) ? f(a) : null, _ = (o = p.defaultProps.min, i = p.defaultProps.max, a) => Array.isArray(a) ? a.filter((h) => A(h, o, i)).map((h) => f(h)) : null, K = (o) => typeof o == "object" && !(o instanceof Date) && o !== null && !Array.isArray(o) ? o : Y, z = (o, i, a) => o || i && i[0] || a && a.start, re = (o, i) => o.start === null && i === null ? "start" : o.end === null ? "end" : "start", c = class c extends d.Component {
11
+ import { provideIntlService as j, provideLocalizationService as G, registerForIntl as X, registerForLocalization as q } from "@progress/kendo-react-intl";
12
+ import { Keys as O, classNames as J, createPropsContext as Q, withIdHOC as Z, withPropsContext as ee } from "@progress/kendo-react-common";
13
+ import { isEqualDate as N, addDays as A, cloneDate as m, getDate as g, firstDayOfMonth as te, lastDayOfMonth as se } from "@progress/kendo-date-math";
14
+ import { Button as P } from "@progress/kendo-react-buttons";
15
+ import { chevronRightIcon as B, chevronLeftIcon as L } from "@progress/kendo-svg-icons";
16
+ import { Action as C } from "../models/NavigationAction.mjs";
17
+ import { CalendarViewEnum as M } from "../models/CalendarViewEnum.mjs";
18
+ import { EMPTY_SELECTIONRANGE as W } from "../models/SelectionRange.mjs";
19
+ import { Header as ie } from "./Header.mjs";
20
+ import { dateInRange as F, getToday as k, viewInRange as _, nullable as w, MIN_DATE as ae, MAX_DATE as ne, isInRange as T } from "../../utils.mjs";
21
+ import { prevView as K, messages as Y, nextView as z } from "../../messages/index.mjs";
22
+ import { BusViewService as oe } from "../services/BusViewService.mjs";
23
+ import { NavigationService as le } from "../services/NavigationService.mjs";
24
+ import { HorizontalViewList as E } from "./HorizontalViewList.mjs";
25
+ import { TodayCommand as re } from "./TodayCommand.mjs";
26
+ const S = (r = v.defaultProps.min, i = v.defaultProps.max, a) => a instanceof Date && !Array.isArray(a) && T(g(a), r, i) ? g(a) : null, U = (r = v.defaultProps.min, i = v.defaultProps.max, a) => Array.isArray(a) ? a.filter((c) => T(c, r, i)).map((c) => g(c)) : null, $ = (r) => typeof r == "object" && !(r instanceof Date) && r !== null && !Array.isArray(r) ? r : W, H = (r, i, a) => r || i && i[0] || a && a.start, he = (r, i) => r.start === null && i === null ? "start" : r.end === null ? "end" : "start", d = class d extends p.Component {
27
27
  constructor(i) {
28
- super(i), this.dates = [], this.selectedDate = null, this.selectedMultiple = null, this.selectedRange = Y, this._focusedDate = /* @__PURE__ */ new Date(), this.cellUID = this.props.id + "-cell-uid", this.activeRangeEnd = "start", this._element = null, this.intl = null, this.localization = null, this.service = null, this.calendarViewList = null, this.isActive = !1, this.calculateFocusFromValue = !0, this.focus = () => {
28
+ super(i), this.dates = [], this.selectedDate = null, this.selectedMultiple = null, this.selectedRange = W, this._focusedDate = /* @__PURE__ */ new Date(), this.cellUID = this.props.id + "-cell-uid", this.activeRangeEnd = "start", this._element = null, this.intl = null, this.localization = null, this.service = null, this.calendarViewList = null, this.isActive = !1, this.calculateFocusFromValue = !0, this.focus = () => {
29
29
  this._element && this._element.focus();
30
30
  }, this.clampRange = (e) => ({ start: e, end: null }), this.rangeWithFocused = (e, t) => ({
31
31
  start: e.start,
32
32
  end: e.end === null && e.start !== null && this.isActive ? t : e.end
33
33
  }), this.generateRange = (e, t) => {
34
- const { end: r, start: l } = t, m = t.start !== null && e.getTime() <= t.start.getTime();
35
- return !this.props.allowReverse && m ? { start: e, end: this.selectedRange.start } : this.activeRange !== "end" ? { start: e, end: r } : { start: l || this.selectedDate, end: e };
34
+ const { end: l, start: o } = t, h = t.start !== null && e.getTime() <= t.start.getTime();
35
+ return !this.props.allowReverse && h ? { start: e, end: this.selectedRange.start } : this.activeRange !== "end" ? { start: e, end: l } : { start: o || this.selectedDate, end: e };
36
36
  }, this.canNavigate = (e) => {
37
37
  if (!this.service)
38
38
  return !1;
@@ -40,11 +40,11 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
40
40
  return this.min <= t && t <= this.max || this.service.isInSameView(t, this.min) || this.service.isInSameView(t, this.max);
41
41
  }, this.navigate = (e, t) => {
42
42
  this.calculateFocusFromValue = !1;
43
- const r = this.move(e, t);
44
- this.setState({ navigateDate: r, focusedDate: r });
45
- }, this.move = (e, t) => this.clampDate(this.service.move(t, e)), this.clampDate = (e) => R(e, this.min, this.max), this.shouldAutoCorrect = (e, t) => {
46
- const { end: r, start: l } = t;
47
- return this.activeRange !== "end" ? r !== null && e > r : l !== null && e < l;
43
+ const l = this.move(e, t);
44
+ this.setState({ navigateDate: l, focusedDate: l });
45
+ }, this.move = (e, t) => this.clampDate(this.service.move(t, e)), this.clampDate = (e) => F(e, this.min, this.max), this.shouldAutoCorrect = (e, t) => {
46
+ const { end: l, start: o } = t;
47
+ return this.activeRange !== "end" ? l !== null && e > l : o !== null && e < o;
48
48
  }, this.handleCellEnter = (e) => {
49
49
  this.props.mode === "range" && (this.calculateFocusFromValue = !1, this.setState({
50
50
  focusedDate: e
@@ -68,7 +68,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
68
68
  }, this.handleTodayClick = (e) => {
69
69
  this.todayIsInRange && this.handleDateChange(e);
70
70
  }, this.handlePrevButtonClick = () => {
71
- const e = y.PrevView;
71
+ const e = C.PrevView;
72
72
  if (this.state.activeView > 0 && this.focusedDate.getFullYear() > this.dates[0].getFullYear())
73
73
  this.navigate(e, this.move(e, this.focusedDate));
74
74
  else {
@@ -76,14 +76,14 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
76
76
  this.navigate(e, t);
77
77
  }
78
78
  }, this.handleNextButtonClick = () => {
79
- this.navigate(y.NextView, this.focusedDate);
79
+ this.navigate(C.NextView, this.focusedDate);
80
80
  }, this.handleKeyDown = (e) => {
81
- const { keyCode: r, ctrlKey: l, metaKey: m } = e;
82
- if (r === 84) {
83
- const n = C();
81
+ const { keyCode: l, ctrlKey: o, metaKey: h } = e;
82
+ if (l === 84) {
83
+ const n = k();
84
84
  this.calculateFocusFromValue = !1, this.setState({ focusedDate: n, navigateDate: n });
85
85
  }
86
- if ((l || m) && (r === E.left && this.handlePrevButtonClick(), r === E.right && this.handleNextButtonClick()), r === E.enter) {
86
+ if ((o || h) && (l === O.left && this.handlePrevButtonClick(), l === O.right && this.handleNextButtonClick()), l === O.enter) {
87
87
  const n = {
88
88
  syntheticEvent: e,
89
89
  nativeEvent: e.nativeEvent,
@@ -92,7 +92,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
92
92
  };
93
93
  this.handleDateChange(n);
94
94
  } else {
95
- const n = R(
95
+ const n = F(
96
96
  this.navigation.move(
97
97
  this.focusedDate,
98
98
  this.navigation.action(e),
@@ -103,18 +103,40 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
103
103
  this.min,
104
104
  this.max
105
105
  );
106
- if (O(this.focusedDate, n))
106
+ if (N(this.focusedDate, n))
107
107
  return;
108
108
  this.dates && this.service && !this.service.isInArray(n, this.dates) && this.setState({ navigateDate: n }), this.calculateFocusFromValue = !1, this.setState({ focusedDate: n });
109
109
  }
110
110
  e.preventDefault();
111
111
  }, this.handleViewChange = ({ view: e }) => {
112
112
  this.calculateFocusFromValue = !1, this.setState((t) => ({ activeView: e, navigateDate: t.focusedDate }));
113
+ }, this.handleWeekSelection = (e, t, l) => {
114
+ if (this.props.mode === "single")
115
+ return;
116
+ const o = 0, h = 6, n = t === o ? e : A(e, -t), u = t === h ? e : A(e, h - t);
117
+ let f = null;
118
+ if (this.props.mode === "multiple") {
119
+ f = [];
120
+ for (let y = o; y <= h; y++)
121
+ f.push(A(n, y));
122
+ this.setState({ value: f, focusedDate: e });
123
+ }
124
+ this.props.mode === "range" && (f = { start: n, end: u }, this.setState({ value: f, focusedDate: e }));
125
+ const { onChange: x } = this.props;
126
+ if (x) {
127
+ const y = {
128
+ syntheticEvent: l,
129
+ nativeEvent: l.nativeEvent,
130
+ value: f,
131
+ target: this
132
+ };
133
+ x.call(void 0, y);
134
+ }
113
135
  }, this.handleDateChange = (e) => {
114
- const t = u(e.value), r = this.bus.canMoveDown(this.state.activeView);
136
+ const t = m(e.value), l = this.bus.canMoveDown(this.state.activeView);
115
137
  if (this.props.disabled)
116
138
  return;
117
- if (r)
139
+ if (l)
118
140
  if (e.isTodayClick)
119
141
  this.bus.moveToBottom(this.state.activeView);
120
142
  else {
@@ -122,57 +144,57 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
122
144
  return;
123
145
  }
124
146
  this.calculateFocusFromValue = !0;
125
- let l;
147
+ let o;
126
148
  switch (this.props.mode) {
127
149
  case "single":
128
- l = u(e.value);
150
+ o = m(e.value);
129
151
  break;
130
152
  case "multiple":
131
153
  if (Array.isArray(this.selectedMultiple)) {
132
154
  const n = this.selectedMultiple.slice();
133
- let v = -1;
134
- n.forEach((U, $) => {
135
- O(U, e.value) && (v = $);
136
- }), v !== -1 ? n.splice(v, 1) : n.push(u(e.value)), l = n.slice();
155
+ let u = -1;
156
+ n.forEach((f, x) => {
157
+ N(f, e.value) && (u = x);
158
+ }), u !== -1 ? n.splice(u, 1) : n.push(m(e.value)), o = n.slice();
137
159
  } else
138
- this.selectedDate ? l = [u(this.selectedDate), u(e.value)] : l = [u(e.value)];
160
+ this.selectedDate ? o = [m(this.selectedDate), m(e.value)] : o = [m(e.value)];
139
161
  break;
140
162
  case "range": {
141
- l = this.selectedRange.start !== null && this.selectedRange.end !== null && this.activeRange === "start" ? this.clampRange(e.value) : this.generateRange(e.value, this.selectedRange), this.activeRangeEnd = this.activeRange !== "end" ? "end" : "start";
163
+ o = this.selectedRange.start !== null && this.selectedRange.end !== null && this.activeRange === "start" ? this.clampRange(e.value) : this.generateRange(e.value, this.selectedRange), this.activeRangeEnd = this.activeRange !== "end" ? "end" : "start";
142
164
  break;
143
165
  }
144
166
  default:
145
- l = u(e.value);
167
+ o = m(e.value);
146
168
  break;
147
169
  }
148
- this.valueDuringOnChange = l, e.isTodayClick && this.setState({ navigateDate: t }), this.setState({ value: l, focusedDate: t }), this.valueDuringOnChange = l;
149
- const { onChange: m } = this.props;
150
- if (m) {
170
+ this.valueDuringOnChange = o, e.isTodayClick && this.setState({ navigateDate: t }), this.setState({ value: o, focusedDate: t }), this.valueDuringOnChange = o;
171
+ const { onChange: h } = this.props;
172
+ if (h) {
151
173
  const n = {
152
174
  syntheticEvent: e.syntheticEvent,
153
175
  nativeEvent: e.nativeEvent,
154
- value: l,
176
+ value: o,
155
177
  target: this
156
178
  };
157
- m.call(void 0, n);
179
+ h.call(void 0, n);
158
180
  }
159
181
  this.valueDuringOnChange = void 0;
160
182
  };
161
- const a = i.value !== void 0 ? i.value : i.defaultValue || c.defaultProps.defaultValue, h = k(this.min, this.max, a), g = _(this.min, this.max, a), b = K(a), F = z(h, g, b), w = P(
162
- I[i.defaultActiveView],
183
+ const a = i.value !== void 0 ? i.value : i.defaultValue || d.defaultProps.defaultValue, c = S(this.min, this.max, a), D = U(this.min, this.max, a), R = $(a), I = H(c, D, R), V = _(
184
+ M[i.defaultActiveView],
163
185
  this.bottomView,
164
186
  this.topView
165
- ), V = R(
166
- i.focusedDate || F || C(),
187
+ ), b = F(
188
+ i.focusedDate || I || k(),
167
189
  this.min,
168
190
  this.max
169
191
  );
170
192
  this.state = {
171
193
  value: a,
172
- activeView: w,
173
- focusedDate: V,
174
- navigateDate: V
175
- }, this.activeRangeEnd = re(b, h), this.bus = new ae(this.handleViewChange), this.navigation = new ne(this.bus), this.calculateFocusFromValue = !1, this.lastView = w, this.lastViewsCount = this.props.views || x.defaultProps.views;
194
+ activeView: V,
195
+ focusedDate: b,
196
+ navigateDate: b
197
+ }, this.activeRangeEnd = he(R, c), this.bus = new oe(this.handleViewChange), this.navigation = new le(this.bus), this.calculateFocusFromValue = !1, this.lastView = V, this.lastViewsCount = this.props.views || E.defaultProps.views;
176
198
  }
177
199
  get wrapperID() {
178
200
  return this.props.id + "-wrapper-id";
@@ -196,25 +218,25 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
196
218
  * Gets the current focused date of the MultiViewCalendar.
197
219
  */
198
220
  get focusedDate() {
199
- return u(this._focusedDate);
221
+ return m(this._focusedDate);
200
222
  }
201
223
  get min() {
202
- return f(this.props.min !== void 0 ? this.props.min : c.defaultProps.min);
224
+ return g(this.props.min !== void 0 ? this.props.min : d.defaultProps.min);
203
225
  }
204
226
  get max() {
205
- return f(this.props.max !== void 0 ? this.props.max : c.defaultProps.max);
227
+ return g(this.props.max !== void 0 ? this.props.max : d.defaultProps.max);
206
228
  }
207
229
  get bottomView() {
208
- return I[this.props.bottomView !== void 0 ? this.props.bottomView : c.defaultProps.bottomView];
230
+ return M[this.props.bottomView !== void 0 ? this.props.bottomView : d.defaultProps.bottomView];
209
231
  }
210
232
  get topView() {
211
- return I[this.props.topView !== void 0 ? this.props.topView : c.defaultProps.topView];
233
+ return M[this.props.topView !== void 0 ? this.props.topView : d.defaultProps.topView];
212
234
  }
213
235
  get activeRange() {
214
236
  return this.props.activeRangeEnd !== void 0 ? this.props.activeRangeEnd : this.activeRangeEnd;
215
237
  }
216
238
  get todayIsInRange() {
217
- return A(C(), f(this.min), f(this.max));
239
+ return T(k(), g(this.min), g(this.max));
218
240
  }
219
241
  /**
220
242
  * @hidden
@@ -227,41 +249,41 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
227
249
  */
228
250
  componentDidUpdate() {
229
251
  this.calendarViewList && (this.isActive ? this.calendarViewList.focusActiveDate : this.calendarViewList.blurActiveDate)();
230
- const i = k(this.min, this.max, this.value);
231
- this.calculateFocusFromValue = !!(this.selectedDate && i && this.selectedDate.getTime() && i.getTime()), this.lastView = this.state.activeView, this.lastViewsCount = this.props.views || x.defaultProps.views;
252
+ const i = S(this.min, this.max, this.value);
253
+ this.calculateFocusFromValue = !!(this.selectedDate && i && this.selectedDate.getTime() && i.getTime()), this.lastView = this.state.activeView, this.lastViewsCount = this.props.views || E.defaultProps.views;
232
254
  }
233
255
  /**
234
256
  * @hidden
235
257
  */
236
258
  render() {
237
- this.props._ref && this.props._ref(this), this.intl = q(this), this.localization = H(this), this.bus.configure(this.bottomView, this.topView);
238
- const i = P(this.state.activeView, this.bottomView, this.topView);
239
- this.service = this.bus.service(i, this.intl), this.selectedDate = k(this.min, this.max, this.value), this.selectedMultiple = _(this.min, this.max, this.value), this.selectedRange = K(this.value);
240
- const a = z(this.selectedDate, this.selectedMultiple, this.selectedRange);
241
- this._focusedDate = R(
259
+ this.props._ref && this.props._ref(this), this.intl = j(this), this.localization = G(this), this.bus.configure(this.bottomView, this.topView);
260
+ const i = _(this.state.activeView, this.bottomView, this.topView);
261
+ this.service = this.bus.service(i, this.intl), this.selectedDate = S(this.min, this.max, this.value), this.selectedMultiple = U(this.min, this.max, this.value), this.selectedRange = $(this.value);
262
+ const a = H(this.selectedDate, this.selectedMultiple, this.selectedRange);
263
+ this._focusedDate = F(
242
264
  this.calculateFocusFromValue && a !== null ? a : this.state.focusedDate,
243
265
  this.min,
244
266
  this.max
245
267
  );
246
- const h = X(
268
+ const c = J(
247
269
  "k-calendar k-calendar-range k-calendar-md",
248
270
  {
249
271
  "k-disabled": this.props.disabled
250
272
  },
251
273
  this.props.className
252
- ), g = this.rangeWithFocused(this.selectedRange, this.focusedDate), b = this.localization.toLanguageString(S, B[S]), F = this.localization.toLanguageString(L, B[L]), w = !this.canNavigate(y.PrevView), V = !this.canNavigate(y.NextView), e = { "aria-disabled": w }, t = { "aria-disabled": V }, r = this.lastView !== i, l = this.dates && this.isInMonth(this.state.navigateDate, this.dates[0]), m = this.lastViewsCount !== this.props.views;
253
- (!l || r || m) && (this.dates = this.service.datesList(
274
+ ), D = this.rangeWithFocused(this.selectedRange, this.focusedDate), R = this.localization.toLanguageString(K, Y[K]), I = this.localization.toLanguageString(z, Y[z]), V = !this.canNavigate(C.PrevView), b = !this.canNavigate(C.NextView), e = { "aria-disabled": V }, t = { "aria-disabled": b }, l = this.lastView !== i, o = this.dates && this.isInMonth(this.state.navigateDate, this.dates[0]), h = this.lastViewsCount !== this.props.views;
275
+ (!o || l || h) && (this.dates = this.service.datesList(
254
276
  this.state.navigateDate,
255
- this.props.views || x.defaultProps.views
277
+ this.props.views || E.defaultProps.views
256
278
  ));
257
- const n = u(this.dates && this.dates[0] ? this.dates[0] : C());
258
- return /* @__PURE__ */ d.createElement(
279
+ const n = m(this.dates && this.dates[0] ? this.dates[0] : k());
280
+ return /* @__PURE__ */ p.createElement(
259
281
  "div",
260
282
  {
261
- ref: (v) => {
262
- this._element = v;
283
+ ref: (u) => {
284
+ this._element = u;
263
285
  },
264
- className: h,
286
+ className: c,
265
287
  id: this.props.id || this.wrapperID,
266
288
  "aria-labelledby": this.props.ariaLabelledBy,
267
289
  "aria-describedby": this.props.ariaDescribedBy,
@@ -274,8 +296,8 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
274
296
  "aria-disabled": this.props.disabled,
275
297
  dir: this.props.dir
276
298
  },
277
- /* @__PURE__ */ d.createElement(
278
- te,
299
+ /* @__PURE__ */ p.createElement(
300
+ ie,
279
301
  {
280
302
  key: `.kendo.calendar.header.${n.getTime()}`,
281
303
  activeView: i,
@@ -287,67 +309,71 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
287
309
  service: this.service,
288
310
  headerTitle: this.props.headerTitle,
289
311
  verticalView: this.props.mobileMode,
290
- commands: /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(
291
- T,
312
+ commands: /* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement(
313
+ P,
292
314
  {
293
315
  type: "button",
294
316
  className: "k-calendar-nav-prev",
295
317
  icon: this.isRtl ? "chevron-right" : "chevron-left",
296
- svgIcon: this.isRtl ? M : N,
318
+ svgIcon: this.isRtl ? B : L,
297
319
  fillMode: "flat",
298
- title: b,
299
- disabled: w,
320
+ title: R,
321
+ disabled: V,
300
322
  onClick: this.handlePrevButtonClick,
301
323
  ...e
302
324
  }
303
- ), /* @__PURE__ */ d.createElement(
304
- le,
325
+ ), /* @__PURE__ */ p.createElement(
326
+ re,
305
327
  {
306
328
  min: this.min,
307
329
  max: this.max,
308
330
  onClick: this.handleTodayClick,
309
331
  disabled: !this.todayIsInRange
310
332
  }
311
- ), /* @__PURE__ */ d.createElement(
312
- T,
333
+ ), /* @__PURE__ */ p.createElement(
334
+ P,
313
335
  {
314
336
  type: "button",
315
337
  className: "k-calendar-nav-next",
316
338
  icon: this.isRtl ? "chevron-left" : "chevron-right",
317
- svgIcon: this.isRtl ? N : M,
339
+ svgIcon: this.isRtl ? L : B,
318
340
  fillMode: "flat",
319
- title: F,
320
- disabled: V,
341
+ title: I,
342
+ disabled: b,
321
343
  onClick: this.handleNextButtonClick,
322
344
  ...t
323
345
  }
324
346
  ))
325
347
  }
326
348
  ),
327
- /* @__PURE__ */ d.createElement(
328
- x,
349
+ /* @__PURE__ */ p.createElement(
350
+ E,
329
351
  {
330
- ref: (v) => {
331
- this.calendarViewList = v;
352
+ ref: (u) => {
353
+ this.calendarViewList = u;
332
354
  },
333
355
  dates: this.dates,
334
356
  activeView: i,
335
357
  focusedDate: this.focusedDate,
358
+ weekDaysFormat: this.props.weekDaysFormat,
336
359
  min: this.min,
337
360
  max: this.max,
338
361
  bus: this.bus,
339
362
  service: this.service,
340
- selectionRange: g,
363
+ selectionRange: D,
341
364
  value: this.selectedMultiple || this.selectedDate,
342
365
  cellUID: this.cellUID,
343
366
  views: this.props.views,
344
367
  onChange: this.handleDateChange,
368
+ onWeekSelect: this.handleWeekSelection,
345
369
  showWeekNumbers: this.props.weekNumber,
346
370
  onCellEnter: this.handleCellEnter,
347
371
  cell: this.props.cell,
348
372
  weekCell: this.props.weekCell,
349
373
  headerTitle: this.props.headerTitle,
350
- verticalView: this.props.mobileMode
374
+ verticalView: this.props.mobileMode,
375
+ showOtherMonthDays: this.props.showOtherMonthDays,
376
+ allowReverse: this.props.allowReverse
351
377
  }
352
378
  )
353
379
  );
@@ -357,26 +383,27 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
357
383
  // && this.max > list[Math.max(0, (this.props.views || MultiViewCalendarWithoutContext.defaultProps.views) - 1)];
358
384
  // };
359
385
  isInMonth(i, a) {
360
- return !!a && W(a) <= i && i <= ee(a);
386
+ return !!a && te(a) <= i && i <= se(a);
361
387
  }
362
388
  };
363
- c.displayName = "MultiViewCalendar", c.propTypes = {
389
+ d.displayName = "MultiViewCalendar", d.propTypes = {
364
390
  activeRangeEnd: s.oneOf(["start", "end"]),
365
391
  allowReverse: s.bool,
366
392
  bottomView: s.oneOf(["month", "year", "decade", "century"]),
367
393
  className: s.string,
368
394
  defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
369
395
  defaultValue: s.oneOfType([
370
- D(s.instanceOf(Date)),
396
+ w(s.instanceOf(Date)),
371
397
  s.arrayOf(s.instanceOf(Date)),
372
398
  s.shape({
373
- start: D(s.instanceOf(Date)),
374
- end: D(s.instanceOf(Date))
399
+ start: w(s.instanceOf(Date)),
400
+ end: w(s.instanceOf(Date))
375
401
  })
376
402
  ]),
377
403
  disabled: s.bool,
378
404
  focusedDate: s.instanceOf(Date),
379
405
  id: s.string,
406
+ weekDaysFormat: s.oneOf(["narrow", "short", "abbreviated"]),
380
407
  ariaLabelledBy: s.string,
381
408
  ariaDescribedBy: s.string,
382
409
  max: s.instanceOf(Date),
@@ -388,41 +415,44 @@ c.displayName = "MultiViewCalendar", c.propTypes = {
388
415
  tabIndex: s.number,
389
416
  topView: s.oneOf(["month", "year", "decade", "century"]),
390
417
  value: s.oneOfType([
391
- D(s.instanceOf(Date)),
418
+ w(s.instanceOf(Date)),
392
419
  s.arrayOf(s.instanceOf(Date)),
393
420
  s.shape({
394
- start: D(s.instanceOf(Date).isRequired),
395
- end: D(s.instanceOf(Date).isRequired)
421
+ start: w(s.instanceOf(Date).isRequired),
422
+ end: w(s.instanceOf(Date).isRequired)
396
423
  })
397
424
  ]),
398
- views: (i, a, h) => {
399
- const g = i[a];
400
- return g !== void 0 && g < 1 ? new Error(
401
- `Invalid prop '${a}' supplied to'${h}'. The '${a}' property cannot be less than 1'`
425
+ views: (i, a, c) => {
426
+ const D = i[a];
427
+ return D !== void 0 && D < 1 ? new Error(
428
+ `Invalid prop '${a}' supplied to'${c}'. The '${a}' property cannot be less than 1'`
402
429
  ) : null;
403
430
  },
404
431
  weekNumber: s.bool,
432
+ showOtherMonthDays: s.bool,
405
433
  dir: s.string
406
- }, c.defaultProps = {
434
+ }, d.defaultProps = {
407
435
  disabled: !1,
408
- min: se,
409
- max: ie,
436
+ min: ae,
437
+ max: ne,
410
438
  navigation: !0,
411
439
  defaultActiveView: "month",
412
440
  defaultValue: null,
413
441
  topView: "century",
442
+ weekDaysFormat: "short",
414
443
  tabIndex: 0,
415
444
  bottomView: "month",
416
445
  views: 2,
417
- allowReverse: !1
446
+ allowReverse: !1,
447
+ showOtherMonthDays: !1
418
448
  };
419
- let p = c;
420
- const oe = J(), he = Q(Z(oe, p));
421
- he.displayName = "KendoReactMultiViewCalendar";
422
- j(p);
423
- G(p);
449
+ let v = d;
450
+ const ce = Q(), de = Z(ee(ce, v));
451
+ de.displayName = "KendoReactMultiViewCalendar";
452
+ X(v);
453
+ q(v);
424
454
  export {
425
- he as MultiViewCalendar,
426
- oe as MultiViewCalendarPropsContext,
427
- p as MultiViewCalendarWithoutContext
455
+ de as MultiViewCalendar,
456
+ ce as MultiViewCalendarPropsContext,
457
+ v as MultiViewCalendarWithoutContext
428
458
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),s=require("prop-types"),d=require("@progress/kendo-react-intl"),m=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-date-math"),r=require("../../messages/index.js"),i=require("../../utils.js");function h(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const u=h(p),n=class n extends u.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:i.dateInRange(i.getToday(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get todayIsInRange(){return i.isInRange(i.getToday(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=d.provideLocalizationService(this);const e=this.localization.toLanguageString(r.today,r.messages[r.today]),t=m.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return u.createElement(g.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat",themeColor:"primary",role:"link"},e)}};n.propTypes={max:s.instanceOf(Date).isRequired,min:s.instanceOf(Date).isRequired,onClick:s.func,disabled:s.bool},n.defaultProps={min:i.MIN_DATE,max:i.MAX_DATE};let o=n;d.registerForLocalization(o);exports.TodayCommand=o;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),a=require("prop-types"),d=require("@progress/kendo-react-intl"),m=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-date-math"),r=require("../../messages/index.js"),i=require("../../utils.js");function h(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const u=h(p),n=class n extends u.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:i.dateInRange(i.getToday(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get todayIsInRange(){return i.isInRange(i.getToday(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=d.provideLocalizationService(this);const e=this.localization.toLanguageString(r.today,r.messages[r.today]),t=m.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return u.createElement(g.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat",themeColor:"base",role:"link"},e)}};n.propTypes={max:a.instanceOf(Date).isRequired,min:a.instanceOf(Date).isRequired,onClick:a.func,disabled:a.bool},n.defaultProps={min:i.MIN_DATE,max:i.MAX_DATE};let o=n;d.registerForLocalization(o);exports.TodayCommand=o;
@@ -53,7 +53,7 @@ const t = class t extends o.Component {
53
53
  onClick: this.handleClick,
54
54
  tabIndex: this.props.tabIndex,
55
55
  fillMode: "flat",
56
- themeColor: "primary",
56
+ themeColor: "base",
57
57
  role: "link"
58
58
  },
59
59
  i
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),i=require("prop-types"),d=require("@progress/kendo-date-math"),D=require("@progress/kendo-react-intl"),w=require("./CalendarCell.js"),g=require("./CalendarWeekCell.js"),k=require("../models/CalendarViewEnum.js"),m=require("../../utils.js"),b=require("../services/WeekNamesService.js");function N(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const e in l)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(l,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>l[e]})}}return t.default=l,Object.freeze(t)}const s=N(v),f=l=>s.createElement("td",{key:l,className:"k-calendar-td k-empty"}," "),u=class u extends s.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(t,e)=>{if(!this.firstDate(t))return f(`week-cell-${e}`);const n=this.firstDate(t),a=this.getWeekNumber(n),o=`kendo-react-calendar-week-cell-${a}`,c={className:"k-alt",value:a,firstDate:n};return this.props.weekCell?s.createElement(this.props.weekCell,{...c,key:o},a):s.createElement(g.CalendarWeekCell,{...c,key:o},a)},this.buildRow=t=>t.map((e,r)=>{if(!e)return f(r);const n={"aria-selected":e.isSelected},a=`kendo-react-calendar-cell-${e.value.getTime()}`,o={...n,...e,isDisabled:!e.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?s.createElement(this.props.cell,{...o,key:a},e.formattedValue):s.createElement(w.CalendarCell,{...o,key:a},e.formattedValue)}),this.firstDate=t=>{const e=this.firstWeekDateContext(t);return e?e.value:null},this.firstWeekDateContext=t=>{if(!this.weekNumber)return null;let e=0,r=t[e];for(;!r&&e<t.length;)r=t[++e];return r},this.handleClick=(t,e)=>{const{onChange:r}=this.props;if(r&&e){const n={value:d.cloneDate(t),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};r.call(void 0,n)}},this.handleMouseEnter=t=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,d.cloneDate(t))},this.handleMouseLeave=t=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,d.cloneDate(t))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===k.CalendarViewEnum.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===k.CalendarViewEnum.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:u.defaultProps.selectedDate}render(){this.intl=D.provideIntlService(this),this.weekService=new b.WeekNamesService(this.intl);const t=this.weekService.getWeekNames(this.weekNumber),e=this.props.service.rowLength(this.weekNumber),r=this.props.service.title(this.props.viewDate),n=m.getToday(),a=m.setTime(this.props.viewDate,n),o=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return s.createElement(s.Fragment,null,this.isMonthView&&this.isHorizontal&&s.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},s.createElement("tr",{role:"row",className:"k-calendar-tr"},t.map((c,h)=>s.createElement("th",{key:h,className:"k-calendar-th"},c)))),s.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&s.createElement("tr",{role:"presentation",className:"k-calendar-tr"},s.createElement("th",{scope:"col",colSpan:e,className:"k-calendar-caption"},r)),o.map((c,h)=>s.createElement("tr",{role:"row",className:"k-calendar-tr",key:h},this.weekNumber&&this.buildWeekNumber(c,h),this.buildRow(c)))))}getWeekNumber(t){return!this.weekNumber||!this.intl?null:d.weekInYear(t,this.intl.firstDay())}};u.propTypes={activeRangeEnd:i.oneOf(["start","end",null]),activeView:i.number.isRequired,cellUID:i.string.isRequired,direction:i.oneOf(["horizontal","vertical"]),focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,selectedDate:i.oneOfType([i.instanceOf(Date),i.arrayOf(i.instanceOf(Date))]),showWeekNumbers:i.bool,viewDate:i.instanceOf(Date).isRequired},u.defaultProps={direction:"vertical",selectedDate:m.getToday(),showWeekNumbers:!1};let p=u;D.registerForIntl(p);exports.View=p;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),r=require("prop-types"),p=require("@progress/kendo-date-math"),D=require("@progress/kendo-react-intl"),v=require("./CalendarCell.js"),g=require("./CalendarWeekCell.js"),k=require("../models/CalendarViewEnum.js"),m=require("../../utils.js"),b=require("../services/WeekNamesService.js");function y(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const i=y(w),f=o=>i.createElement("td",{key:o,className:"k-calendar-td k-empty"}," "),h=class h extends i.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(t,e)=>{if(!this.firstDate(t))return f(`week-cell-${e}`);const a=this.firstDate(t),n=this.getWeekNumber(a),l=`kendo-react-calendar-week-cell-${n}`,c={className:"k-alt",value:n,firstDate:a,weekDays:t,onClick:this.handleWeekCellClick};return this.props.weekCell?i.createElement(this.props.weekCell,{...c,key:l},n):i.createElement(g.CalendarWeekCell,{...c,key:l},n)},this.buildRow=t=>t.map((e,s)=>{if(!e)return f(s);const a={"aria-selected":e.isSelected},n=`kendo-react-calendar-cell-${e.value.getTime()}`,l={...a,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?i.createElement(this.props.cell,{...l,key:n},e.formattedValue):i.createElement(v.CalendarCell,{...l,key:n},e.formattedValue)}),this.firstDate=t=>{const e=this.firstWeekDateContext(t);return e?e.value:null},this.firstWeekDateContext=t=>{if(!this.weekNumber)return null;let e=0,s=t[e];for(;!s&&e<t.length;)s=t[++e];return s},this.handleClick=(t,e)=>{const{onChange:s}=this.props;if(s&&e){const a={value:p.cloneDate(t),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};s.call(void 0,a)}},this.handleWeekCellClick=(t,e,s)=>{const{onWeekSelect:a}=this.props,n=e.findIndex(l=>l&&l.value===t);a&&s&&a.call(void 0,t,n,s)},this.handleMouseEnter=t=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,p.cloneDate(t))},this.handleMouseLeave=t=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,p.cloneDate(t))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===k.CalendarViewEnum.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===k.CalendarViewEnum.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:h.defaultProps.selectedDate}render(){this.intl=D.provideIntlService(this),this.weekService=new b.WeekNamesService(this.intl);const t=this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat),e=this.props.service.rowLength(this.weekNumber),s=this.props.service.title(this.props.viewDate),a=m.getToday(),n=m.setTime(this.props.viewDate,a),l=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:n});return i.createElement(i.Fragment,null,this.isMonthView&&this.isHorizontal&&i.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},i.createElement("tr",{role:"row",className:"k-calendar-tr"},t.map((c,u)=>i.createElement("th",{key:u,className:"k-calendar-th"},c)))),i.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&i.createElement("tr",{role:"presentation",className:"k-calendar-tr"},i.createElement("th",{scope:"col",colSpan:e,className:"k-calendar-caption"},s)),l.map((c,u)=>i.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(c,u),this.buildRow(c)))))}getWeekNumber(t){return!this.weekNumber||!this.intl?null:p.weekInYear(t,this.intl.firstDay())}};h.propTypes={activeRangeEnd:r.oneOf(["start","end",null]),activeView:r.number.isRequired,cellUID:r.string.isRequired,direction:r.oneOf(["horizontal","vertical"]),focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,selectedDate:r.oneOfType([r.instanceOf(Date),r.arrayOf(r.instanceOf(Date))]),showWeekNumbers:r.bool,showOtherMonthDays:r.bool,viewDate:r.instanceOf(Date).isRequired},h.defaultProps={direction:"vertical",selectedDate:m.getToday(),showWeekNumbers:!1};let d=h;D.registerForIntl(d);exports.View=d;