@progress/kendo-react-dateinputs 7.4.0 → 7.5.0-develop.10

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 (37) hide show
  1. package/calendar/components/Calendar.js +2 -2
  2. package/calendar/components/Calendar.mjs +38 -35
  3. package/calendar/components/CalendarHeaderTitle.js +1 -1
  4. package/calendar/components/CalendarHeaderTitle.mjs +1 -1
  5. package/calendar/components/Header.js +1 -1
  6. package/calendar/components/Header.mjs +2 -3
  7. package/calendar/components/HorizontalViewList.js +1 -1
  8. package/calendar/components/HorizontalViewList.mjs +3 -1
  9. package/calendar/components/MultiViewCalendar.js +1 -1
  10. package/calendar/components/MultiViewCalendar.mjs +94 -91
  11. package/calendar/components/TodayCommand.js +1 -1
  12. package/calendar/components/TodayCommand.mjs +3 -1
  13. package/calendar/components/View.js +1 -1
  14. package/calendar/components/View.mjs +6 -6
  15. package/calendar/components/ViewList.js +1 -1
  16. package/calendar/components/ViewList.mjs +42 -42
  17. package/calendar/services/WeekNamesService.js +1 -1
  18. package/calendar/services/WeekNamesService.mjs +5 -5
  19. package/datepicker/DatePicker.js +1 -1
  20. package/datepicker/DatePicker.mjs +0 -1
  21. package/daterangepicker/DateRangePicker.js +1 -1
  22. package/daterangepicker/DateRangePicker.mjs +21 -21
  23. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  24. package/index.d.mts +33 -6
  25. package/index.d.ts +33 -6
  26. package/messages/index.js +1 -1
  27. package/messages/index.mjs +1 -1
  28. package/package-metadata.mjs +1 -1
  29. package/package.json +7 -7
  30. package/timepicker/TimeList.js +6 -6
  31. package/timepicker/TimeList.mjs +52 -60
  32. package/timepicker/TimePart.js +1 -1
  33. package/timepicker/TimePart.mjs +4 -4
  34. package/timepicker/TimePicker.js +1 -1
  35. package/timepicker/TimePicker.mjs +2 -3
  36. package/timepicker/TimeSelector.js +1 -1
  37. package/timepicker/TimeSelector.mjs +6 -6
@@ -7,14 +7,14 @@
7
7
  */
8
8
  "use client";
9
9
  import * as d from "react";
10
- import s from "prop-types";
10
+ import t from "prop-types";
11
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";
12
+ import { Keys as k, classNames as X, createPropsContext as J, withIdHOC as Q, withPropsContext as Z } from "@progress/kendo-react-common";
13
13
  import { isEqualDate as O, cloneDate as u, getDate as f, firstDayOfMonth as W, lastDayOfMonth as ee } from "@progress/kendo-date-math";
14
14
  import { Button as T } from "@progress/kendo-react-buttons";
15
15
  import { chevronRightIcon as M, chevronLeftIcon as N } from "@progress/kendo-svg-icons";
16
16
  import { Action as y } from "../models/NavigationAction.mjs";
17
- import { CalendarViewEnum as I } from "../models/CalendarViewEnum.mjs";
17
+ import { CalendarViewEnum as E } from "../models/CalendarViewEnum.mjs";
18
18
  import { EMPTY_SELECTIONRANGE as Y } from "../models/SelectionRange.mjs";
19
19
  import { Header as te } from "./Header.mjs";
20
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";
@@ -22,29 +22,29 @@ import { prevView as S, messages as B, nextView as L } from "../../messages/inde
22
22
  import { BusViewService as ae } from "../services/BusViewService.mjs";
23
23
  import { NavigationService as ne } from "../services/NavigationService.mjs";
24
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 {
25
+ import { TodayCommand as re } from "./TodayCommand.mjs";
26
+ const I = (o = m.defaultProps.min, i = m.defaultProps.max, a) => a instanceof Date && !Array.isArray(a) && A(f(a), o, i) ? f(a) : null, _ = (o = m.defaultProps.min, i = m.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, le = (o, i) => o.start === null && i === null ? "start" : o.end === null ? "end" : "start", c = class c extends d.Component {
27
27
  constructor(i) {
28
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 = () => {
29
29
  this._element && this._element.focus();
30
- }, this.clampRange = (e) => ({ start: e, end: null }), this.rangeWithFocused = (e, t) => ({
30
+ }, this.clampRange = (e) => ({ start: e, end: null }), this.rangeWithFocused = (e, s) => ({
31
31
  start: e.start,
32
- end: e.end === null && e.start !== null && this.isActive ? t : e.end
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 };
32
+ end: e.end === null && e.start !== null && this.isActive ? s : e.end
33
+ }), this.generateRange = (e, s) => {
34
+ const { end: l, start: r } = s, p = s.start !== null && e.getTime() <= s.start.getTime();
35
+ return !this.props.allowReverse && p ? { start: e, end: this.selectedRange.start } : this.activeRange !== "end" ? { start: e, end: l } : { start: r || this.selectedDate, end: e };
36
36
  }, this.canNavigate = (e) => {
37
37
  if (!this.service)
38
38
  return !1;
39
- const t = this.service.move(this.focusedDate, e);
40
- return this.min <= t && t <= this.max || this.service.isInSameView(t, this.min) || this.service.isInSameView(t, this.max);
41
- }, this.navigate = (e, t) => {
39
+ const s = this.service.move(this.focusedDate, e);
40
+ return this.min <= s && s <= this.max || this.service.isInSameView(s, this.min) || this.service.isInSameView(s, this.max);
41
+ }, this.navigate = (e, s) => {
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, s);
44
+ this.setState({ navigateDate: l, focusedDate: l });
45
+ }, this.move = (e, s) => this.clampDate(this.service.move(s, e)), this.clampDate = (e) => R(e, this.min, this.max), this.shouldAutoCorrect = (e, s) => {
46
+ const { end: l, start: r } = s;
47
+ return this.activeRange !== "end" ? l !== null && e > l : r !== null && e < r;
48
48
  }, this.handleCellEnter = (e) => {
49
49
  this.props.mode === "range" && (this.calculateFocusFromValue = !1, this.setState({
50
50
  focusedDate: e
@@ -57,14 +57,14 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
57
57
  if (this.isActive = !0, !this.calendarViewList)
58
58
  return;
59
59
  this.calendarViewList.focusActiveDate();
60
- const { onFocus: t } = this.props;
61
- t && t.call(void 0, e);
60
+ const { onFocus: s } = this.props;
61
+ s && s.call(void 0, e);
62
62
  }, this.handleBlur = (e) => {
63
63
  if (this.isActive = !1, !this.calendarViewList)
64
64
  return;
65
65
  this.calendarViewList.blurActiveDate();
66
- const { onBlur: t } = this.props;
67
- t && t.call(void 0, e);
66
+ const { onBlur: s } = this.props;
67
+ s && s.call(void 0, e);
68
68
  }, this.handleTodayClick = (e) => {
69
69
  this.todayIsInRange && this.handleDateChange(e);
70
70
  }, this.handlePrevButtonClick = () => {
@@ -72,18 +72,18 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
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 {
75
- const t = this.isInMonth(this.focusedDate, this.dates[1]) ? this.move(e, this.focusedDate) : this.focusedDate;
76
- this.navigate(e, t);
75
+ const s = this.isInMonth(this.focusedDate, this.dates[1]) ? this.move(e, this.focusedDate) : this.focusedDate;
76
+ this.navigate(e, s);
77
77
  }
78
78
  }, this.handleNextButtonClick = () => {
79
79
  this.navigate(y.NextView, this.focusedDate);
80
80
  }, this.handleKeyDown = (e) => {
81
- const { keyCode: r, ctrlKey: l, metaKey: m } = e;
82
- if (r === 84) {
81
+ const { keyCode: l, ctrlKey: r, metaKey: p } = e;
82
+ if (l === 84) {
83
83
  const n = C();
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 ((r || p) && (l === k.left && this.handlePrevButtonClick(), l === k.right && this.handleNextButtonClick()), l === k.enter) {
87
87
  const n = {
88
88
  syntheticEvent: e,
89
89
  nativeEvent: e.nativeEvent,
@@ -109,23 +109,23 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
109
109
  }
110
110
  e.preventDefault();
111
111
  }, this.handleViewChange = ({ view: e }) => {
112
- this.calculateFocusFromValue = !1, this.setState((t) => ({ activeView: e, navigateDate: t.focusedDate }));
112
+ this.calculateFocusFromValue = !1, this.setState((s) => ({ activeView: e, navigateDate: s.focusedDate }));
113
113
  }, this.handleDateChange = (e) => {
114
- const t = u(e.value), r = this.bus.canMoveDown(this.state.activeView);
114
+ const s = u(e.value), l = this.bus.canMoveDown(this.state.activeView);
115
115
  if (this.props.disabled)
116
116
  return;
117
- if (r)
117
+ if (l)
118
118
  if (e.isTodayClick)
119
119
  this.bus.moveToBottom(this.state.activeView);
120
120
  else {
121
- this.bus.moveDown(this.state.activeView, e.syntheticEvent), this.setState({ focusedDate: t, navigateDate: t });
121
+ this.bus.moveDown(this.state.activeView, e.syntheticEvent), this.setState({ focusedDate: s, navigateDate: s });
122
122
  return;
123
123
  }
124
124
  this.calculateFocusFromValue = !0;
125
- let l;
125
+ let r;
126
126
  switch (this.props.mode) {
127
127
  case "single":
128
- l = u(e.value);
128
+ r = u(e.value);
129
129
  break;
130
130
  case "multiple":
131
131
  if (Array.isArray(this.selectedMultiple)) {
@@ -133,33 +133,33 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
133
133
  let v = -1;
134
134
  n.forEach((U, $) => {
135
135
  O(U, e.value) && (v = $);
136
- }), v !== -1 ? n.splice(v, 1) : n.push(u(e.value)), l = n.slice();
136
+ }), v !== -1 ? n.splice(v, 1) : n.push(u(e.value)), r = n.slice();
137
137
  } else
138
- this.selectedDate ? l = [u(this.selectedDate), u(e.value)] : l = [u(e.value)];
138
+ this.selectedDate ? r = [u(this.selectedDate), u(e.value)] : r = [u(e.value)];
139
139
  break;
140
140
  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";
141
+ r = 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
142
  break;
143
143
  }
144
144
  default:
145
- l = u(e.value);
145
+ r = u(e.value);
146
146
  break;
147
147
  }
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) {
148
+ this.valueDuringOnChange = r, e.isTodayClick && this.setState({ navigateDate: s }), this.setState({ value: r, focusedDate: s }), this.valueDuringOnChange = r;
149
+ const { onChange: p } = this.props;
150
+ if (p) {
151
151
  const n = {
152
152
  syntheticEvent: e.syntheticEvent,
153
153
  nativeEvent: e.nativeEvent,
154
- value: l,
154
+ value: r,
155
155
  target: this
156
156
  };
157
- m.call(void 0, n);
157
+ p.call(void 0, n);
158
158
  }
159
159
  this.valueDuringOnChange = void 0;
160
160
  };
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],
161
+ const a = i.value !== void 0 ? i.value : i.defaultValue || c.defaultProps.defaultValue, h = I(this.min, this.max, a), g = _(this.min, this.max, a), b = K(a), F = z(h, g, b), w = P(
162
+ E[i.defaultActiveView],
163
163
  this.bottomView,
164
164
  this.topView
165
165
  ), V = R(
@@ -172,7 +172,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
172
172
  activeView: w,
173
173
  focusedDate: V,
174
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;
175
+ }, this.activeRangeEnd = le(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;
176
176
  }
177
177
  get wrapperID() {
178
178
  return this.props.id + "-wrapper-id";
@@ -205,10 +205,10 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
205
205
  return f(this.props.max !== void 0 ? this.props.max : c.defaultProps.max);
206
206
  }
207
207
  get bottomView() {
208
- return I[this.props.bottomView !== void 0 ? this.props.bottomView : c.defaultProps.bottomView];
208
+ return E[this.props.bottomView !== void 0 ? this.props.bottomView : c.defaultProps.bottomView];
209
209
  }
210
210
  get topView() {
211
- return I[this.props.topView !== void 0 ? this.props.topView : c.defaultProps.topView];
211
+ return E[this.props.topView !== void 0 ? this.props.topView : c.defaultProps.topView];
212
212
  }
213
213
  get activeRange() {
214
214
  return this.props.activeRangeEnd !== void 0 ? this.props.activeRangeEnd : this.activeRangeEnd;
@@ -227,7 +227,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
227
227
  */
228
228
  componentDidUpdate() {
229
229
  this.calendarViewList && (this.isActive ? this.calendarViewList.focusActiveDate : this.calendarViewList.blurActiveDate)();
230
- const i = k(this.min, this.max, this.value);
230
+ const i = I(this.min, this.max, this.value);
231
231
  this.calculateFocusFromValue = !!(this.selectedDate && i && this.selectedDate.getTime() && i.getTime()), this.lastView = this.state.activeView, this.lastViewsCount = this.props.views || x.defaultProps.views;
232
232
  }
233
233
  /**
@@ -236,7 +236,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
236
236
  render() {
237
237
  this.props._ref && this.props._ref(this), this.intl = q(this), this.localization = H(this), this.bus.configure(this.bottomView, this.topView);
238
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);
239
+ this.service = this.bus.service(i, this.intl), this.selectedDate = I(this.min, this.max, this.value), this.selectedMultiple = _(this.min, this.max, this.value), this.selectedRange = K(this.value);
240
240
  const a = z(this.selectedDate, this.selectedMultiple, this.selectedRange);
241
241
  this._focusedDate = R(
242
242
  this.calculateFocusFromValue && a !== null ? a : this.state.focusedDate,
@@ -244,13 +244,13 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
244
244
  this.max
245
245
  );
246
246
  const h = X(
247
- "k-widget k-calendar k-calendar-range",
247
+ "k-calendar k-calendar-range k-calendar-md",
248
248
  {
249
249
  "k-disabled": this.props.disabled
250
250
  },
251
251
  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(
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 }, s = { "aria-disabled": V }, l = this.lastView !== i, r = this.dates && this.isInMonth(this.state.navigateDate, this.dates[0]), p = this.lastViewsCount !== this.props.views;
253
+ (!r || l || p) && (this.dates = this.service.datesList(
254
254
  this.state.navigateDate,
255
255
  this.props.views || x.defaultProps.views
256
256
  ));
@@ -301,7 +301,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
301
301
  ...e
302
302
  }
303
303
  ), /* @__PURE__ */ d.createElement(
304
- le,
304
+ re,
305
305
  {
306
306
  min: this.min,
307
307
  max: this.max,
@@ -319,7 +319,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
319
319
  title: F,
320
320
  disabled: V,
321
321
  onClick: this.handleNextButtonClick,
322
- ...t
322
+ ...s
323
323
  }
324
324
  ))
325
325
  }
@@ -333,6 +333,7 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
333
333
  dates: this.dates,
334
334
  activeView: i,
335
335
  focusedDate: this.focusedDate,
336
+ weekDaysFormat: this.props.weekDaysFormat,
336
337
  min: this.min,
337
338
  max: this.max,
338
339
  bus: this.bus,
@@ -361,38 +362,39 @@ const k = (o = p.defaultProps.min, i = p.defaultProps.max, a) => a instanceof Da
361
362
  }
362
363
  };
363
364
  c.displayName = "MultiViewCalendar", c.propTypes = {
364
- activeRangeEnd: s.oneOf(["start", "end"]),
365
- allowReverse: s.bool,
366
- bottomView: s.oneOf(["month", "year", "decade", "century"]),
367
- className: s.string,
368
- defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
369
- defaultValue: s.oneOfType([
370
- D(s.instanceOf(Date)),
371
- s.arrayOf(s.instanceOf(Date)),
372
- s.shape({
373
- start: D(s.instanceOf(Date)),
374
- end: D(s.instanceOf(Date))
365
+ activeRangeEnd: t.oneOf(["start", "end"]),
366
+ allowReverse: t.bool,
367
+ bottomView: t.oneOf(["month", "year", "decade", "century"]),
368
+ className: t.string,
369
+ defaultActiveView: t.oneOf(["month", "year", "decade", "century"]),
370
+ defaultValue: t.oneOfType([
371
+ D(t.instanceOf(Date)),
372
+ t.arrayOf(t.instanceOf(Date)),
373
+ t.shape({
374
+ start: D(t.instanceOf(Date)),
375
+ end: D(t.instanceOf(Date))
375
376
  })
376
377
  ]),
377
- disabled: s.bool,
378
- focusedDate: s.instanceOf(Date),
379
- id: s.string,
380
- ariaLabelledBy: s.string,
381
- ariaDescribedBy: s.string,
382
- max: s.instanceOf(Date),
383
- min: s.instanceOf(Date),
384
- mode: s.oneOf(["single", "multiple", "range"]),
385
- onBlur: s.func,
386
- onChange: s.func,
387
- onFocus: s.func,
388
- tabIndex: s.number,
389
- topView: s.oneOf(["month", "year", "decade", "century"]),
390
- value: s.oneOfType([
391
- D(s.instanceOf(Date)),
392
- s.arrayOf(s.instanceOf(Date)),
393
- s.shape({
394
- start: D(s.instanceOf(Date).isRequired),
395
- end: D(s.instanceOf(Date).isRequired)
378
+ disabled: t.bool,
379
+ focusedDate: t.instanceOf(Date),
380
+ id: t.string,
381
+ weekDaysFormat: t.oneOf(["narrow", "short", "abbreviated"]),
382
+ ariaLabelledBy: t.string,
383
+ ariaDescribedBy: t.string,
384
+ max: t.instanceOf(Date),
385
+ min: t.instanceOf(Date),
386
+ mode: t.oneOf(["single", "multiple", "range"]),
387
+ onBlur: t.func,
388
+ onChange: t.func,
389
+ onFocus: t.func,
390
+ tabIndex: t.number,
391
+ topView: t.oneOf(["month", "year", "decade", "century"]),
392
+ value: t.oneOfType([
393
+ D(t.instanceOf(Date)),
394
+ t.arrayOf(t.instanceOf(Date)),
395
+ t.shape({
396
+ start: D(t.instanceOf(Date).isRequired),
397
+ end: D(t.instanceOf(Date).isRequired)
396
398
  })
397
399
  ]),
398
400
  views: (i, a, h) => {
@@ -401,8 +403,8 @@ c.displayName = "MultiViewCalendar", c.propTypes = {
401
403
  `Invalid prop '${a}' supplied to'${h}'. The '${a}' property cannot be less than 1'`
402
404
  ) : null;
403
405
  },
404
- weekNumber: s.bool,
405
- dir: s.string
406
+ weekNumber: t.bool,
407
+ dir: t.string
406
408
  }, c.defaultProps = {
407
409
  disabled: !1,
408
410
  min: se,
@@ -411,18 +413,19 @@ c.displayName = "MultiViewCalendar", c.propTypes = {
411
413
  defaultActiveView: "month",
412
414
  defaultValue: null,
413
415
  topView: "century",
416
+ weekDaysFormat: "short",
414
417
  tabIndex: 0,
415
418
  bottomView: "month",
416
419
  views: 2,
417
420
  allowReverse: !1
418
421
  };
419
- let p = c;
420
- const oe = J(), he = Q(Z(oe, p));
422
+ let m = c;
423
+ const oe = J(), he = Q(Z(oe, m));
421
424
  he.displayName = "KendoReactMultiViewCalendar";
422
- j(p);
423
- G(p);
425
+ j(m);
426
+ G(m);
424
427
  export {
425
428
  he as MultiViewCalendar,
426
429
  oe as MultiViewCalendarPropsContext,
427
- p as MultiViewCalendarWithoutContext
430
+ m as MultiViewCalendarWithoutContext
428
431
  };
@@ -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"),a=require("prop-types"),d=require("@progress/kendo-react-intl"),g=require("@progress/kendo-react-common"),m=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=g.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return u.createElement(m.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},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;
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;
@@ -52,7 +52,9 @@ const t = class t extends o.Component {
52
52
  className: s,
53
53
  onClick: this.handleClick,
54
54
  tabIndex: this.props.tabIndex,
55
- fillMode: "flat"
55
+ fillMode: "flat",
56
+ themeColor: "primary",
57
+ role: "link"
56
58
  },
57
59
  i
58
60
  );
@@ -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"}," "),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 v=require("react"),i=require("prop-types"),p=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 y(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=y(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:p.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,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:u.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),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:p.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 d=u;D.registerForIntl(d);exports.View=d;
@@ -8,14 +8,14 @@
8
8
  "use client";
9
9
  import * as s from "react";
10
10
  import r from "prop-types";
11
- import { cloneDate as p, weekInYear as v } from "@progress/kendo-date-math";
12
- import { provideIntlService as D, registerForIntl as w } from "@progress/kendo-react-intl";
11
+ import { cloneDate as p, weekInYear as D } from "@progress/kendo-date-math";
12
+ import { provideIntlService as v, registerForIntl as w } from "@progress/kendo-react-intl";
13
13
  import { CalendarCell as g } from "./CalendarCell.mjs";
14
14
  import { CalendarWeekCell as N } from "./CalendarWeekCell.mjs";
15
15
  import { CalendarViewEnum as u } from "../models/CalendarViewEnum.mjs";
16
16
  import { getToday as d, setTime as b } from "../../utils.mjs";
17
17
  import { WeekNamesService as E } from "../services/WeekNamesService.mjs";
18
- const k = (f) => /* @__PURE__ */ s.createElement("td", { key: f, className: "k-calendar-td" }, " "), c = class c extends s.Component {
18
+ const k = (f) => /* @__PURE__ */ s.createElement("td", { key: f, className: "k-calendar-td k-empty" }, " "), c = class c extends s.Component {
19
19
  constructor() {
20
20
  super(...arguments), this.intl = null, this.weekService = null, this.buildWeekNumber = (t, e) => {
21
21
  if (!this.firstDate(t))
@@ -87,8 +87,8 @@ const k = (f) => /* @__PURE__ */ s.createElement("td", { key: f, className: "k-c
87
87
  return this.props.selectedDate !== void 0 ? this.props.selectedDate : c.defaultProps.selectedDate;
88
88
  }
89
89
  render() {
90
- this.intl = D(this), this.weekService = new E(this.intl);
91
- const t = this.weekService.getWeekNames(this.weekNumber), e = this.props.service.rowLength(this.weekNumber), i = this.props.service.title(this.props.viewDate), n = d(), a = b(this.props.viewDate, n), o = this.props.service.data({
90
+ this.intl = v(this), this.weekService = new E(this.intl);
91
+ const t = this.weekService.getWeekNames(this.weekNumber, this.props.weekDaysFormat), e = this.props.service.rowLength(this.weekNumber), i = this.props.service.title(this.props.viewDate), n = d(), a = b(this.props.viewDate, n), o = this.props.service.data({
92
92
  cellUID: this.props.cellUID,
93
93
  min: this.min,
94
94
  max: this.max,
@@ -124,7 +124,7 @@ const k = (f) => /* @__PURE__ */ s.createElement("td", { key: f, className: "k-c
124
124
  ));
125
125
  }
126
126
  getWeekNumber(t) {
127
- return !this.weekNumber || !this.intl ? null : v(t, this.intl.firstDay());
127
+ return !this.weekNumber || !this.intl ? null : D(t, this.intl.firstDay());
128
128
  }
129
129
  };
130
130
  c.propTypes = {
@@ -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"),r=require("prop-types"),y=require("@progress/kendo-react-common"),d=require("@progress/kendo-date-math"),f=require("@progress/kendo-react-intl"),x=require("../../virtualization/Virtualization.js"),C=require("./View.js"),S=require("./Header.js"),c=require("../../utils.js"),l=require("../models/CalendarViewEnum.js"),E=require("./TodayCommand.js");function T(h){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const e in h)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(h,e);Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:()=>h[e]})}}return o.default=h,Object.freeze(o)}const s=T(V),I=5,p=class p extends s.Component{constructor(o){super(o),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const t=c.dateInRange(this.props.focusedDate,this.props.min,this.props.max),i=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(i)}},this.buildMonthView=(e,t)=>s.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},s.createElement("colgroup",null,e.map((i,a)=>s.createElement("col",{key:a}))),s.createElement("thead",{className:"k-calendar-thead"},s.createElement("tr",{className:"k-calendar-tr"},t.map((i,a)=>s.createElement("th",{key:a,className:"k-calendar-th"},i))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return s.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},s.createElement("colgroup",null,e.map((a,n)=>s.createElement("col",{key:n}))),t.map(a=>s.createElement(C.View,{ref:n=>{this.calendarView||(this.calendarView=n)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell})))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===l.CalendarViewEnum.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const a=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==a)&&this.setState({index:e,skip:a}),this.table&&t){const n=`translateY(${t.offset}px)`;this.table.style.transform=n}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:d.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){this.intl=f.provideIntlService(this);const o=c.shiftWeekNames(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(o):o}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===l.CalendarViewEnum.month)}get take(){return this.props.take!==void 0?this.props.take:p.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return c.isInRange(c.getToday(),d.getDate(this.props.min),d.getDate(this.props.max))}componentDidUpdate(o,e){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const o=this.lastView!==this.props.activeView,e=c.dateInRange(this.props.focusedDate,this.props.min,this.props.max),t=o?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),n=this.props.service.addToDate(this.props.min,t),w=this.props.service.addToDate(this.props.min,this.state.index),m=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),v=this.props.activeView!==this.lastView;this.animateToIndex=!v,(v||!d.isEqualDate(this.lastFocus,e)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(e,this.props.min)),this.lastFocus=e;const k=y.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===l.CalendarViewEnum.month,"k-calendar-yearview":this.props.activeView===l.CalendarViewEnum.year,"k-calendar-decadeview":this.props.activeView===l.CalendarViewEnum.decade,"k-calendar-centuryview":this.props.activeView===l.CalendarViewEnum.century}),b=this.buildDates(m,this.props.service.datesList(n,a)),g=s.createElement(s.Fragment,null,s.createElement(S.Header,{key:"calendar-view-list-header",currentDate:w,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:s.createElement(s.Fragment,null,s.createElement(E.TodayCommand,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===l.CalendarViewEnum.month&&this.buildMonthView(m,this.weekNames),s.createElement(x.Virtualization,{key:"calendar-view-list-content",skip:t,take:this.take,total:i,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:b,tabIndex:this.props.tabIndex}));return s.createElement("div",{ref:D=>{this._element=D},className:k},this.props.dom.didCalculate?g:null)}};p.propTypes={activeView:r.number.isRequired,bottomOffset:r.number,cellUID:r.string.isRequired,focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,showWeekNumbers:r.bool,smoothScroll:r.bool,take:r.number,value:r.instanceOf(Date),viewHeight:r.number,viewOffset:r.number,tabIndex:r.number},p.defaultProps={take:I,showWeekNumbers:!1,smoothScroll:!0};let u=p;f.registerForIntl(u);exports.ViewList=u;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),r=require("prop-types"),y=require("@progress/kendo-react-common"),d=require("@progress/kendo-date-math"),f=require("@progress/kendo-react-intl"),x=require("../../virtualization/Virtualization.js"),S=require("./View.js"),C=require("./Header.js"),E=require("../services/WeekNamesService.js"),c=require("../../utils.js"),l=require("../models/CalendarViewEnum.js"),I=require("./TodayCommand.js");function T(h){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const e in h)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(h,e);Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:()=>h[e]})}}return o.default=h,Object.freeze(o)}const s=T(V),N=5,p=class p extends s.Component{constructor(o){super(o),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.weekService=null,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const t=c.dateInRange(this.props.focusedDate,this.props.min,this.props.max),i=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(i)}},this.buildMonthView=(e,t)=>s.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},s.createElement("colgroup",null,e.map((i,a)=>s.createElement("col",{key:a}))),s.createElement("thead",{className:"k-calendar-thead"},s.createElement("tr",{className:"k-calendar-tr"},t.map((i,a)=>s.createElement("th",{key:a,className:"k-calendar-th"},i))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return s.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},s.createElement("colgroup",null,e.map((a,n)=>s.createElement("col",{key:n}))),t.map(a=>s.createElement(S.View,{ref:n=>{this.calendarView||(this.calendarView=n)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell})))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===l.CalendarViewEnum.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const a=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==a)&&this.setState({index:e,skip:a}),this.table&&t){const n=`translateY(${t.offset}px)`;this.table.style.transform=n}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:d.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){this.intl=f.provideIntlService(this),this.weekService=new E.WeekNamesService(this.intl);const o=this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat),e=c.shiftWeekNames(o,this.intl.firstDay());return this.weekNumber?[""].concat(e):e}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===l.CalendarViewEnum.month)}get take(){return this.props.take!==void 0?this.props.take:p.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return c.isInRange(c.getToday(),d.getDate(this.props.min),d.getDate(this.props.max))}componentDidUpdate(o,e){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const o=this.lastView!==this.props.activeView,e=c.dateInRange(this.props.focusedDate,this.props.min,this.props.max),t=o?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),n=this.props.service.addToDate(this.props.min,t),w=this.props.service.addToDate(this.props.min,this.state.index),m=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),v=this.props.activeView!==this.lastView;this.animateToIndex=!v,(v||!d.isEqualDate(this.lastFocus,e)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(e,this.props.min)),this.lastFocus=e;const k=y.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===l.CalendarViewEnum.month,"k-calendar-yearview":this.props.activeView===l.CalendarViewEnum.year,"k-calendar-decadeview":this.props.activeView===l.CalendarViewEnum.decade,"k-calendar-centuryview":this.props.activeView===l.CalendarViewEnum.century}),b=this.buildDates(m,this.props.service.datesList(n,a)),g=s.createElement(s.Fragment,null,s.createElement(C.Header,{key:"calendar-view-list-header",currentDate:w,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:s.createElement(s.Fragment,null,s.createElement(I.TodayCommand,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===l.CalendarViewEnum.month&&this.buildMonthView(m,this.weekNames),s.createElement(x.Virtualization,{key:"calendar-view-list-content",skip:t,take:this.take,total:i,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:b,tabIndex:this.props.tabIndex}));return s.createElement("div",{ref:D=>{this._element=D},className:k},this.props.dom.didCalculate?g:null)}};p.propTypes={activeView:r.number.isRequired,bottomOffset:r.number,cellUID:r.string.isRequired,focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,showWeekNumbers:r.bool,smoothScroll:r.bool,take:r.number,value:r.instanceOf(Date),viewHeight:r.number,viewOffset:r.number,weekDaysFormat:r.oneOf(["short","abbreviated","narrow"]),tabIndex:r.number},p.defaultProps={take:N,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let u=p;f.registerForIntl(u);exports.ViewList=u;