@progress/kendo-react-dateinputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823

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 (121) hide show
  1. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  2. package/dist/es/calendar/components/Calendar.d.ts +4 -4
  3. package/dist/es/calendar/components/Calendar.js +17 -5
  4. package/dist/es/calendar/components/Header.d.ts +1 -0
  5. package/dist/es/calendar/components/Header.js +1 -1
  6. package/dist/es/calendar/components/HorizontalViewList.js +1 -0
  7. package/dist/es/calendar/components/MultiViewCalendar.d.ts +3 -3
  8. package/dist/es/calendar/components/MultiViewCalendar.js +12 -5
  9. package/dist/es/calendar/components/Navigation.d.ts +1 -1
  10. package/dist/es/calendar/components/Navigation.js +9 -4
  11. package/dist/es/calendar/components/TodayCommand.js +4 -2
  12. package/dist/es/calendar/components/View.d.ts +4 -4
  13. package/dist/es/calendar/components/View.js +7 -5
  14. package/dist/es/calendar/components/ViewList.d.ts +3 -3
  15. package/dist/es/calendar/components/ViewList.js +10 -2
  16. package/dist/es/calendar/services/BusViewService.js +1 -1
  17. package/dist/es/calendar/services/CenturyViewService.js +2 -2
  18. package/dist/es/calendar/services/DOMService.js +24 -6
  19. package/dist/es/calendar/services/DecadeViewService.js +2 -2
  20. package/dist/es/calendar/services/MonthViewService.js +2 -2
  21. package/dist/es/calendar/services/NavigationService.js +1 -1
  22. package/dist/es/calendar/services/ScrollSyncService.js +5 -1
  23. package/dist/es/calendar/services/YearViewService.js +2 -2
  24. package/dist/es/calendar/utils/ScrollSync.d.ts +3 -3
  25. package/dist/es/calendar/utils/ScrollSync.js +2 -0
  26. package/dist/es/dateinput/DateInput.d.ts +11 -7
  27. package/dist/es/dateinput/DateInput.js +14 -8
  28. package/dist/es/dateinput/models/kendo-date.js +1 -1
  29. package/dist/es/dateinput/models/mask.js +1 -0
  30. package/dist/es/dateinput/utils.d.ts +1 -1
  31. package/dist/es/datepicker/DatePicker.d.ts +8 -8
  32. package/dist/es/datepicker/DatePicker.js +4 -3
  33. package/dist/es/daterangepicker/DateRangePicker.d.ts +7 -5
  34. package/dist/es/datetimepicker/DateTimePicker.d.ts +7 -7
  35. package/dist/es/datetimepicker/DateTimePicker.js +3 -3
  36. package/dist/es/datetimepicker/DateTimeSelector.d.ts +1 -1
  37. package/dist/es/datetimepicker/DateTimeSelector.js +5 -0
  38. package/dist/es/package-metadata.js +1 -1
  39. package/dist/es/timepicker/TimeList.d.ts +3 -3
  40. package/dist/es/timepicker/TimeList.js +25 -7
  41. package/dist/es/timepicker/TimePart.d.ts +4 -4
  42. package/dist/es/timepicker/TimePart.js +4 -1
  43. package/dist/es/timepicker/TimePicker.d.ts +8 -8
  44. package/dist/es/timepicker/TimePicker.js +4 -3
  45. package/dist/es/timepicker/TimeSelector.d.ts +2 -2
  46. package/dist/es/timepicker/TimeSelector.js +4 -0
  47. package/dist/es/timepicker/services/DOMService.js +2 -0
  48. package/dist/es/timepicker/services/DayPeriodService.js +9 -3
  49. package/dist/es/timepicker/services/HoursService.js +14 -5
  50. package/dist/es/timepicker/services/MinutesService.js +12 -6
  51. package/dist/es/timepicker/services/SecondsService.js +12 -6
  52. package/dist/es/utils.js +9 -5
  53. package/dist/es/virtualization/Virtualization.d.ts +2 -1
  54. package/dist/es/virtualization/Virtualization.js +14 -6
  55. package/dist/es/virtualization/services/RowHeightService.js +9 -5
  56. package/dist/es/virtualization/services/ScrollerService.js +9 -3
  57. package/dist/npm/calendar/components/Calendar.d.ts +4 -4
  58. package/dist/npm/calendar/components/Calendar.js +43 -31
  59. package/dist/npm/calendar/components/CalendarCell.js +1 -1
  60. package/dist/npm/calendar/components/CalendarNavigationItem.js +1 -1
  61. package/dist/npm/calendar/components/CalendarWeekCell.js +1 -1
  62. package/dist/npm/calendar/components/Header.d.ts +1 -0
  63. package/dist/npm/calendar/components/Header.js +3 -3
  64. package/dist/npm/calendar/components/HorizontalViewList.js +3 -2
  65. package/dist/npm/calendar/components/MultiViewCalendar.d.ts +3 -3
  66. package/dist/npm/calendar/components/MultiViewCalendar.js +49 -42
  67. package/dist/npm/calendar/components/Navigation.d.ts +1 -1
  68. package/dist/npm/calendar/components/Navigation.js +13 -8
  69. package/dist/npm/calendar/components/TodayCommand.js +9 -7
  70. package/dist/npm/calendar/components/View.d.ts +4 -4
  71. package/dist/npm/calendar/components/View.js +16 -14
  72. package/dist/npm/calendar/components/ViewList.d.ts +3 -3
  73. package/dist/npm/calendar/components/ViewList.js +19 -11
  74. package/dist/npm/calendar/services/BusViewService.js +1 -1
  75. package/dist/npm/calendar/services/CenturyViewService.js +38 -38
  76. package/dist/npm/calendar/services/DOMService.js +33 -15
  77. package/dist/npm/calendar/services/DecadeViewService.js +32 -32
  78. package/dist/npm/calendar/services/MonthViewService.js +36 -36
  79. package/dist/npm/calendar/services/NavigationService.js +1 -1
  80. package/dist/npm/calendar/services/ScrollSyncService.js +5 -1
  81. package/dist/npm/calendar/services/WeekNamesService.js +1 -1
  82. package/dist/npm/calendar/services/YearViewService.js +33 -33
  83. package/dist/npm/calendar/utils/ScrollSync.d.ts +3 -3
  84. package/dist/npm/calendar/utils/ScrollSync.js +2 -0
  85. package/dist/npm/common/PickerWrap.js +1 -1
  86. package/dist/npm/dateinput/DateInput.d.ts +11 -7
  87. package/dist/npm/dateinput/DateInput.js +32 -26
  88. package/dist/npm/dateinput/models/kendo-date.js +12 -12
  89. package/dist/npm/dateinput/models/mask.js +1 -0
  90. package/dist/npm/dateinput/utils.d.ts +1 -1
  91. package/dist/npm/datepicker/DatePicker.d.ts +8 -8
  92. package/dist/npm/datepicker/DatePicker.js +17 -16
  93. package/dist/npm/daterangepicker/DateRangePicker.d.ts +7 -5
  94. package/dist/npm/daterangepicker/DateRangePicker.js +17 -17
  95. package/dist/npm/datetimepicker/DateTimePicker.d.ts +7 -7
  96. package/dist/npm/datetimepicker/DateTimePicker.js +15 -15
  97. package/dist/npm/datetimepicker/DateTimeSelector.d.ts +1 -1
  98. package/dist/npm/datetimepicker/DateTimeSelector.js +13 -8
  99. package/dist/npm/hooks/usePickerFloatingLabel.js +1 -1
  100. package/dist/npm/package-metadata.js +1 -1
  101. package/dist/npm/timepicker/TimeList.d.ts +3 -3
  102. package/dist/npm/timepicker/TimeList.js +29 -11
  103. package/dist/npm/timepicker/TimePart.d.ts +4 -4
  104. package/dist/npm/timepicker/TimePart.js +14 -11
  105. package/dist/npm/timepicker/TimePicker.d.ts +8 -8
  106. package/dist/npm/timepicker/TimePicker.js +19 -18
  107. package/dist/npm/timepicker/TimeSelector.d.ts +2 -2
  108. package/dist/npm/timepicker/TimeSelector.js +14 -10
  109. package/dist/npm/timepicker/services/DOMService.js +6 -4
  110. package/dist/npm/timepicker/services/DayPeriodService.js +10 -4
  111. package/dist/npm/timepicker/services/HoursService.js +20 -11
  112. package/dist/npm/timepicker/services/MinutesService.js +16 -10
  113. package/dist/npm/timepicker/services/SecondsService.js +16 -10
  114. package/dist/npm/timepicker/utils.js +11 -11
  115. package/dist/npm/utils.js +16 -12
  116. package/dist/npm/virtualization/Virtualization.d.ts +2 -1
  117. package/dist/npm/virtualization/Virtualization.js +16 -8
  118. package/dist/npm/virtualization/services/RowHeightService.js +9 -5
  119. package/dist/npm/virtualization/services/ScrollerService.js +9 -3
  120. package/dist/systemjs/kendo-react-dateinputs.js +1 -1
  121. package/package.json +13 -13
@@ -80,8 +80,8 @@ export declare class CalendarWithoutContext extends React.Component<CalendarProp
80
80
  tabIndex: PropTypes.Requireable<number>;
81
81
  value: PropTypes.Requireable<Date>;
82
82
  weekNumber: PropTypes.Requireable<boolean>;
83
- topView: (props: CalendarProps, propName: string, componentName: string) => Error;
84
- bottomView: (props: CalendarProps, propName: string, componentName: string) => Error;
83
+ topView: (props: CalendarProps, propName: keyof CalendarProps<any>, componentName: string) => Error | null;
84
+ bottomView: (props: CalendarProps, propName: keyof CalendarProps<any>, componentName: string) => Error | null;
85
85
  };
86
86
  /**
87
87
  * @hidden
@@ -92,13 +92,13 @@ export declare class CalendarWithoutContext extends React.Component<CalendarProp
92
92
  max: Date;
93
93
  navigation: boolean;
94
94
  defaultActiveView: ActiveView;
95
- defaultValue: any;
95
+ defaultValue: null;
96
96
  smoothScroll: boolean;
97
97
  topView: ActiveView;
98
98
  bottomView: ActiveView;
99
99
  };
100
100
  protected dom: DOMService;
101
- protected scrollSyncService: ScrollSyncService;
101
+ protected scrollSyncService: ScrollSyncService | null;
102
102
  private valueDuringOnChange?;
103
103
  private focusedDate;
104
104
  private cellUID;
@@ -53,8 +53,15 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
53
53
  __extends(CalendarWithoutContext, _super);
54
54
  function CalendarWithoutContext(props) {
55
55
  var _this = _super.call(this, props) || this;
56
+ _this.scrollSyncService = null;
57
+ _this.focusedDate = null;
56
58
  _this.cellUID = guid();
57
59
  _this.id = guid();
60
+ _this.Navigation = null;
61
+ _this.calendarViewList = null;
62
+ _this._element = null;
63
+ _this.intl = null;
64
+ _this.service = null;
58
65
  _this.isActive = false;
59
66
  _this.didNavigationChange = false;
60
67
  /**
@@ -82,7 +89,9 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
82
89
  };
83
90
  _this.handleViewChange = function (_a) {
84
91
  var view = _a.view;
85
- _this.scrollSyncService.configure(view);
92
+ if (_this.scrollSyncService) {
93
+ _this.scrollSyncService.configure(view);
94
+ }
86
95
  _this.setState({ activeView: view });
87
96
  };
88
97
  _this.handleDateChange = function (event) {
@@ -140,6 +149,9 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
140
149
  };
141
150
  _this.handleKeyDown = function (event) {
142
151
  var keyCode = event.keyCode;
152
+ if (!_this.focusedDate || !_this.service) {
153
+ return;
154
+ }
143
155
  if (keyCode === Keys.enter) {
144
156
  if (_this.value !== null
145
157
  && isEqualDate(_this.focusedDate, _this.value)) {
@@ -152,7 +164,7 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
152
164
  value: _this.focusedDate,
153
165
  target: _this
154
166
  };
155
- _this.handleDateChange.call(undefined, args);
167
+ _this.handleDateChange(args);
156
168
  }
157
169
  else {
158
170
  var candidate = dateInRange(_this.navigation.move(_this.focusedDate, _this.navigation.action(event), _this.state.activeView, _this.service, event), _this.min, _this.max);
@@ -266,7 +278,7 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
266
278
  * @hidden
267
279
  */
268
280
  CalendarWithoutContext.prototype.componentDidUpdate = function (_, prevState) {
269
- if (prevState.activeView !== this.state.activeView) {
281
+ if (prevState.activeView !== this.state.activeView && this.scrollSyncService) {
270
282
  this.scrollSyncService.configure(this.state.activeView);
271
283
  }
272
284
  if (this.calendarViewList) {
@@ -340,7 +352,7 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
340
352
  var prop = props[propName];
341
353
  var bottomView = props.bottomView;
342
354
  if (prop && bottomView && CalendarViewEnum[prop] < CalendarViewEnum[bottomView]) {
343
- return new Error("Invalid prop + " + propName + " suplied to " + componentName + ".\n " + propName + " can not be smaller than bottomView.\n ");
355
+ return new Error("Invalid prop + ".concat(propName, " suplied to ").concat(componentName, ".\n ").concat(propName, " can not be smaller than bottomView.\n "));
344
356
  }
345
357
  return null;
346
358
  },
@@ -348,7 +360,7 @@ var CalendarWithoutContext = /** @class */ (function (_super) {
348
360
  var prop = props[propName];
349
361
  var topView = props.topView;
350
362
  if (prop && topView && CalendarViewEnum[prop] > CalendarViewEnum[topView]) {
351
- return new Error("Invalid prop + " + propName + " suplied to " + componentName + ".\n " + propName + " can not be bigger than topView.\n ");
363
+ return new Error("Invalid prop + ".concat(propName, " suplied to ").concat(componentName, ".\n ").concat(propName, " can not be bigger than topView.\n "));
352
364
  }
353
365
  return null;
354
366
  }
@@ -11,6 +11,7 @@ export interface HeaderEventArguments {
11
11
  nativeEvent?: any;
12
12
  value: Date;
13
13
  target: Header;
14
+ isTodayClick?: boolean;
14
15
  }
15
16
  /**
16
17
  * @hidden
@@ -47,7 +47,7 @@ var Header = /** @class */ (function (_super) {
47
47
  if (take < 1 || !_this.props.service.isInRange(nextDate, _this.min, _this.max)) {
48
48
  return title;
49
49
  }
50
- return title + " - " + _this.props.service.title(nextDate);
50
+ return "".concat(title, " - ").concat(_this.props.service.title(nextDate));
51
51
  };
52
52
  _this.handleTitleClick = function (event) {
53
53
  if (!_this.canMoveUp) {
@@ -27,6 +27,7 @@ var HorizontalViewList = /** @class */ (function (_super) {
27
27
  __extends(HorizontalViewList, _super);
28
28
  function HorizontalViewList(props) {
29
29
  var _this = _super.call(this, props) || this;
30
+ _this._element = null;
30
31
  _this.isActive = false;
31
32
  _this.focusActiveDate = function () {
32
33
  if (!_this._element) {
@@ -62,14 +62,14 @@ export declare class MultiViewCalendarWithoutContext extends React.Component<Mul
62
62
  ariaDescribedBy: PropTypes.Requireable<string>;
63
63
  max: PropTypes.Requireable<Date>;
64
64
  min: PropTypes.Requireable<Date>;
65
- mode: PropTypes.Requireable<"range" | "multiple" | "single">;
65
+ mode: PropTypes.Requireable<"multiple" | "range" | "single">;
66
66
  onBlur: PropTypes.Requireable<(...args: any[]) => any>;
67
67
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
68
68
  onFocus: PropTypes.Requireable<(...args: any[]) => any>;
69
69
  tabIndex: PropTypes.Requireable<number>;
70
70
  topView: PropTypes.Requireable<ActiveView>;
71
71
  value: PropTypes.Requireable<any>;
72
- views: (props: any, propName: any, componentName: any) => Error;
72
+ views: (props: MultiViewCalendarProps, propName: keyof MultiViewCalendarProps<any>, componentName: string) => Error | null;
73
73
  weekNumber: PropTypes.Requireable<boolean>;
74
74
  };
75
75
  /**
@@ -81,7 +81,7 @@ export declare class MultiViewCalendarWithoutContext extends React.Component<Mul
81
81
  max: Date;
82
82
  navigation: boolean;
83
83
  defaultActiveView: ActiveView;
84
- defaultValue: any;
84
+ defaultValue: null;
85
85
  topView: ActiveView;
86
86
  tabIndex: number;
87
87
  bottomView: ActiveView;
@@ -72,12 +72,19 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
72
72
  __extends(MultiViewCalendarWithoutContext, _super);
73
73
  function MultiViewCalendarWithoutContext(props) {
74
74
  var _this = _super.call(this, props) || this;
75
+ _this.dates = [];
75
76
  _this.selectedDate = null;
76
77
  _this.selectedMultiple = null;
77
78
  _this.selectedRange = EMPTY_SELECTIONRANGE;
79
+ _this._focusedDate = new Date();
78
80
  _this.cellUID = guid();
79
81
  _this.activeRangeEnd = 'start';
82
+ _this._element = null;
83
+ _this.intl = null;
84
+ _this.localization = null;
85
+ _this.service = null;
80
86
  _this.wrapperID = guid();
87
+ _this.calendarViewList = null;
81
88
  _this.isActive = false;
82
89
  _this.calculateFocusFromValue = true;
83
90
  /**
@@ -181,7 +188,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
181
188
  if (!_this.todayIsInRange) {
182
189
  return;
183
190
  }
184
- _this.handleDateChange.call(undefined, event, true);
191
+ _this.handleDateChange(event);
185
192
  };
186
193
  _this.handlePrevButtonClick = function () {
187
194
  _this.navigate(Action.PrevView);
@@ -198,7 +205,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
198
205
  value: _this.focusedDate,
199
206
  target: _this
200
207
  };
201
- _this.handleDateChange.call(undefined, args);
208
+ _this.handleDateChange(args);
202
209
  }
203
210
  else {
204
211
  var candidate = dateInRange(_this.navigation.move(_this.focusedDate, _this.navigation.action(event), _this.state.activeView, _this.service, event), _this.min, _this.max);
@@ -458,7 +465,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
458
465
  }
459
466
  var activeDate = cloneDate(this.dates && this.dates[0] ? this.dates[0] : getToday());
460
467
  return (React.createElement("div", __assign({ ref: function (el) { _this._element = el; }, className: wrapperClassName, id: this.props.id || this.wrapperID, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, role: 'grid', tabIndex: !this.props.disabled ? this.props.tabIndex : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, onClick: this.handleClick, onKeyDown: this.handleKeyDown }, wrapperAria),
461
- React.createElement(Header, { key: ".kendo.calendar.header." + activeDate.getTime(), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
468
+ React.createElement(Header, { key: ".kendo.calendar.header.".concat(activeDate.getTime()), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
462
469
  React.createElement(Button, __assign({ type: "button", className: "k-nav-prev", icon: "arrow-chevron-left", fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
463
470
  React.createElement(TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
464
471
  React.createElement(Button, __assign({ type: "button", className: "k-nav-next", icon: "arrow-chevron-right", fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
@@ -509,8 +516,8 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
509
516
  views: function (props, propName, componentName) {
510
517
  var views = props[propName];
511
518
  if (views !== undefined && views < 1) {
512
- return new Error("Invalid prop '" + propName + "' supplied to" +
513
- ("'" + componentName + "'. The '" + propName + "' property cannot be less than 1'"));
519
+ return new Error("Invalid prop '".concat(propName, "' supplied to") +
520
+ "'".concat(componentName, "'. The '").concat(propName, "' property cannot be less than 1'"));
514
521
  }
515
522
  return null;
516
523
  },
@@ -65,7 +65,7 @@ export declare class Navigation extends React.Component<NavigationProps, Navigat
65
65
  */
66
66
  componentDidUpdate(_prevProps: NavigationProps, _prevState: NavigationState): void;
67
67
  render(): JSX.Element;
68
- protected handleVirtualizationMount: (virtualization: any) => void;
68
+ protected handleVirtualizationMount: (virtualization: Virtualization) => void;
69
69
  protected buildNavigationItem: (date: Date) => React.ReactNode;
70
70
  protected calculateHeights: () => void;
71
71
  protected getTake(skip: number, total: number): number;
@@ -38,11 +38,16 @@ var Navigation = /** @class */ (function (_super) {
38
38
  __extends(Navigation, _super);
39
39
  function Navigation(props) {
40
40
  var _this = _super.call(this, props) || this;
41
+ _this.virtualization = null;
42
+ _this.list = null;
43
+ _this.itemHeight = 0;
41
44
  _this.topOffset = 0;
45
+ _this.maxViewHeight = 0;
46
+ _this.bottomOffset = 0;
42
47
  _this.handleVirtualizationMount = function (virtualization) {
43
48
  _this.virtualization = virtualization;
44
49
  if (_this.virtualization && _this.list) {
45
- _this.list.style.transform = "translateY(" + _this.topOffset + "px)";
50
+ _this.list.style.transform = "translateY(".concat(_this.topOffset, "px)");
46
51
  var viewDate = dateInRange(_this.props.focusedDate, _this.props.min, _this.props.max);
47
52
  var indexToScroll = _this.props.service.skip(viewDate, _this.props.min);
48
53
  _this.virtualization.scrollToIndex(indexToScroll);
@@ -51,7 +56,7 @@ var Navigation = /** @class */ (function (_super) {
51
56
  _this.buildNavigationItem = function (date) {
52
57
  var text = _this.props.service.navigationTitle(date);
53
58
  var isRangeStart = _this.props.service.isRangeStart(date);
54
- var uniqueID = "kendo-react-calendar-nav-item-" + date.getTime();
59
+ var uniqueID = "kendo-react-calendar-nav-item-".concat(date.getTime());
55
60
  var navigationItemProps = {
56
61
  text: text,
57
62
  value: date,
@@ -72,7 +77,7 @@ var Navigation = /** @class */ (function (_super) {
72
77
  };
73
78
  _this.handleDateChange = function (value, event) {
74
79
  var onChange = _this.props.onChange;
75
- if (onChange) {
80
+ if (onChange && event) {
76
81
  var args = {
77
82
  value: cloneDate(value),
78
83
  target: _this,
@@ -89,7 +94,7 @@ var Navigation = /** @class */ (function (_super) {
89
94
  _this.setState({ skip: skip });
90
95
  }
91
96
  if (_this.list && scrollAction) {
92
- var translate = "translateY(" + scrollAction.offset + "px)";
97
+ var translate = "translateY(".concat(scrollAction.offset, "px)");
93
98
  _this.list.style.transform = translate;
94
99
  }
95
100
  };
@@ -25,18 +25,20 @@ var TodayCommand = /** @class */ (function (_super) {
25
25
  __extends(TodayCommand, _super);
26
26
  function TodayCommand() {
27
27
  var _this = _super !== null && _super.apply(this, arguments) || this;
28
+ _this.localization = null;
28
29
  _this.handleClick = function (syntheticEvent) {
29
30
  if (!_this.todayIsInRange) {
30
31
  return;
31
32
  }
32
33
  if (_this.props.onClick) {
33
- _this.props.onClick.call(undefined, {
34
+ var event_1 = {
34
35
  syntheticEvent: syntheticEvent,
35
36
  nativeEvent: syntheticEvent.nativeEvent,
36
37
  value: dateInRange(getToday(), _this.min, _this.max),
37
38
  target: _this,
38
39
  isTodayClick: true
39
- });
40
+ };
41
+ _this.props.onClick.call(undefined, event_1);
40
42
  }
41
43
  };
42
44
  return _this;
@@ -34,7 +34,7 @@ export interface ViewProps {
34
34
  max: Date;
35
35
  min: Date;
36
36
  cell?: React.ComponentType<CalendarCellProps>;
37
- onCellEnter?: (date: Date | null) => void;
37
+ onCellEnter?: (date: Date) => void;
38
38
  onCellLeave?: (date: Date | null) => void;
39
39
  onChange?: (event: ViewEventArguments) => void;
40
40
  selectedDate: Date | Date[] | null;
@@ -48,7 +48,7 @@ export interface ViewProps {
48
48
  */
49
49
  export declare class View extends React.Component<ViewProps, {}> {
50
50
  static propTypes: {
51
- activeRangeEnd: PropTypes.Requireable<string>;
51
+ activeRangeEnd: PropTypes.Requireable<string | null>;
52
52
  activeView: PropTypes.Validator<number>;
53
53
  cellUID: PropTypes.Validator<string>;
54
54
  direction: PropTypes.Requireable<string>;
@@ -56,7 +56,7 @@ export declare class View extends React.Component<ViewProps, {}> {
56
56
  max: PropTypes.Validator<Date>;
57
57
  min: PropTypes.Validator<Date>;
58
58
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
59
- selectedDate: PropTypes.Requireable<Date | Date[]>;
59
+ selectedDate: PropTypes.Requireable<Date | (Date | null | undefined)[]>;
60
60
  showWeekNumbers: PropTypes.Requireable<boolean>;
61
61
  viewDate: PropTypes.Validator<Date>;
62
62
  };
@@ -77,7 +77,7 @@ export declare class View extends React.Component<ViewProps, {}> {
77
77
  protected buildWeekNumber: (row: any, idx: number) => JSX.Element;
78
78
  protected buildRow: (row: any) => any;
79
79
  protected getWeekNumber(date: Date): number | null;
80
- protected firstDate: (row: any) => Date;
80
+ protected firstDate: (row: any) => Date | null;
81
81
  protected firstWeekDateContext: (rowCtx: CellContext[]) => CellContext | null;
82
82
  private handleClick;
83
83
  private handleMouseEnter;
@@ -44,14 +44,16 @@ var View = /** @class */ (function (_super) {
44
44
  __extends(View, _super);
45
45
  function View() {
46
46
  var _this = _super !== null && _super.apply(this, arguments) || this;
47
+ _this.intl = null;
48
+ _this.weekService = null;
47
49
  _this.buildWeekNumber = function (row, idx) {
48
50
  var firstDayOfWeek = _this.firstDate(row);
49
51
  if (!firstDayOfWeek) {
50
- return emptyCell("week-cell-" + idx);
52
+ return emptyCell("week-cell-".concat(idx));
51
53
  }
52
54
  var firstDate = _this.firstDate(row);
53
55
  var weekCellValue = _this.getWeekNumber(firstDate);
54
- var uniqueID = "kendo-react-calendar-week-cell-" + weekCellValue;
56
+ var uniqueID = "kendo-react-calendar-week-cell-".concat(weekCellValue);
55
57
  var cellProps = {
56
58
  className: 'k-alt',
57
59
  value: weekCellValue,
@@ -67,7 +69,7 @@ var View = /** @class */ (function (_super) {
67
69
  return emptyCell(idx);
68
70
  }
69
71
  var aria = { 'aria-selected': cell.isSelected };
70
- var uniqueID = "kendo-react-calendar-cell-" + cell.value.getTime();
72
+ var uniqueID = "kendo-react-calendar-cell-".concat(cell.value.getTime());
71
73
  var cellProps = __assign(__assign(__assign({}, aria), cell), { isDisabled: !cell.isInRange, view: _this.props.activeView, onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave });
72
74
  return _this.props.cell
73
75
  ? (React.createElement(_this.props.cell, __assign({}, cellProps, { key: uniqueID }), cell.formattedValue))
@@ -91,7 +93,7 @@ var View = /** @class */ (function (_super) {
91
93
  };
92
94
  _this.handleClick = function (value, event) {
93
95
  var onChange = _this.props.onChange;
94
- if (onChange) {
96
+ if (onChange && event) {
95
97
  var args = {
96
98
  value: cloneDate(value),
97
99
  target: _this,
@@ -189,7 +191,7 @@ var View = /** @class */ (function (_super) {
189
191
  }))));
190
192
  };
191
193
  View.prototype.getWeekNumber = function (date) {
192
- if (!this.weekNumber) {
194
+ if (!this.weekNumber || !this.intl) {
193
195
  return null;
194
196
  }
195
197
  return weekInYear(date, this.intl.firstDay());
@@ -98,9 +98,9 @@ export declare class ViewList extends React.Component<ViewListProps, ViewListSta
98
98
  focusActiveDate: () => void;
99
99
  blurActiveDate: () => void;
100
100
  render(): JSX.Element;
101
- protected handleVirtualizationMount: (virtualization: any) => void;
102
- protected buildMonthView: (cols: any, weekNames: any) => JSX.Element;
103
- protected buildDates: (cols: any, dates: Date[]) => JSX.Element;
101
+ protected handleVirtualizationMount: (virtualization: Virtualization) => void;
102
+ protected buildMonthView: (cols: any[], weekNames: any[]) => JSX.Element;
103
+ protected buildDates: (cols: any[], dates: Date[]) => JSX.Element;
104
104
  protected calculateHeights: () => void;
105
105
  protected getTake: (skip: number, total: number) => number;
106
106
  private handleScrollAction;
@@ -32,6 +32,14 @@ var ViewList = /** @class */ (function (_super) {
32
32
  __extends(ViewList, _super);
33
33
  function ViewList(props) {
34
34
  var _this = _super.call(this, props) || this;
35
+ _this.virtualization = null;
36
+ _this.calendarView = null;
37
+ _this.table = null;
38
+ _this.intl = null;
39
+ _this.bottomOffset = 0;
40
+ _this.viewOffset = 0;
41
+ _this.viewHeight = 0;
42
+ _this._element = null;
35
43
  _this.isActive = false;
36
44
  _this.animateToIndex = true;
37
45
  _this.shouldScroll = false;
@@ -62,7 +70,7 @@ var ViewList = /** @class */ (function (_super) {
62
70
  _this.handleVirtualizationMount = function (virtualization) {
63
71
  _this.virtualization = virtualization;
64
72
  if (_this.virtualization && _this.table) {
65
- _this.table.style.transform = "translateY(" + _this.viewOffset + "px)";
73
+ _this.table.style.transform = "translateY(".concat(_this.viewOffset, "px)");
66
74
  var viewDate = dateInRange(_this.props.focusedDate, _this.props.min, _this.props.max);
67
75
  var indexToScroll = _this.props.service.skip(viewDate, _this.props.min);
68
76
  _this.virtualization.scrollToIndex(indexToScroll);
@@ -103,7 +111,7 @@ var ViewList = /** @class */ (function (_super) {
103
111
  _this.setState({ index: index, skip: skip });
104
112
  }
105
113
  if (_this.table && scrollAction) {
106
- var translate = "translateY(" + scrollAction.offset + "px)";
114
+ var translate = "translateY(".concat(scrollAction.offset, "px)");
107
115
  _this.table.style.transform = translate;
108
116
  }
109
117
  };
@@ -28,7 +28,7 @@ var BusViewService = /** @class */ (function () {
28
28
  this.top = top;
29
29
  };
30
30
  BusViewService.prototype.service = function (view, intl) {
31
- return new services["" + view](intl);
31
+ return new services["".concat(view)](intl);
32
32
  };
33
33
  BusViewService.prototype.moveDown = function (view, event) {
34
34
  this.move(view, -1, event);
@@ -51,7 +51,7 @@ var CenturyViewService = /** @class */ (function () {
51
51
  : _this.isSelectedFromArray(cellDate, selectedDate, min, max));
52
52
  return intersects(cellDate, firstDate, lastDate) ? ({
53
53
  formattedValue: _this.value(cellDate),
54
- id: "" + cellUID + cellDate.getTime(),
54
+ id: "".concat(cellUID).concat(cellDate.getTime()),
55
55
  isFocused: _this.isEqual(cellDate, focusedDate),
56
56
  isSelected: isSelected,
57
57
  isWeekend: false,
@@ -121,7 +121,7 @@ var CenturyViewService = /** @class */ (function () {
121
121
  if (!value) {
122
122
  return '';
123
123
  }
124
- return firstDecadeOfCentury(value).getFullYear() + " - " + lastDecadeOfCentury(value).getFullYear();
124
+ return "".concat(firstDecadeOfCentury(value).getFullYear(), " - ").concat(lastDecadeOfCentury(value).getFullYear());
125
125
  };
126
126
  CenturyViewService.prototype.rowLength = function (_) {
127
127
  return CELLS_LENGTH;
@@ -6,7 +6,25 @@ import { canUseDOM } from '@progress/kendo-react-common';
6
6
  */
7
7
  var DOMService = /** @class */ (function () {
8
8
  function DOMService() {
9
+ // heights
10
+ this.calendarHeight = 0;
11
+ this.headerHeight = 0;
12
+ this.monthViewHeight = 0;
13
+ this.yearViewHeight = 0;
14
+ this.decadeViewHeight = 0;
15
+ this.centuryViewHeight = 0;
16
+ this.navigationItemHeight = 0;
17
+ this.scrollableContentHeight = 0;
18
+ this.scrollableYearContentHeight = 0;
19
+ // widths
20
+ this.calendarWidth = 0;
21
+ this.monthViewWidth = 0;
22
+ this.yearViewWidth = 0;
23
+ this.decadeViewWidth = 0;
24
+ this.centuryViewWidth = 0;
25
+ this.scrollableContentWidth = 0;
9
26
  this.didCalculate = false;
27
+ this.hostContainer = null;
10
28
  }
11
29
  DOMService.prototype.ensureHeights = function () {
12
30
  if (this.calendarHeight !== undefined) {
@@ -38,7 +56,7 @@ var DOMService = /** @class */ (function () {
38
56
  var content = function (rows, cells) {
39
57
  if (cells === void 0) { cells = 1; }
40
58
  return (table([
41
- tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td("<span class=\"k-link\">" + c + "</span>", 'k-calendar-td'); }), 'k-calendar-tr'); })), 'k-calendar-tbody')
59
+ tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td("<span class=\"k-link\">".concat(c, "</span>"), 'k-calendar-td'); }), 'k-calendar-tr'); })), 'k-calendar-tbody')
42
60
  ], 'k-calendar-table'));
43
61
  };
44
62
  var scrollable = function (children) { return div(children, 'k-content k-calendar-content k-scrollable'); };
@@ -80,7 +98,7 @@ var DOMService = /** @class */ (function () {
80
98
  var getScrollable = function (element) { return element.querySelector('.k-scrollable'); };
81
99
  var horizontal = function (element) {
82
100
  var scrollableElement = getScrollable(element);
83
- scrollableElement.className = scrollableElement.className + " k-scrollable-horizontal";
101
+ scrollableElement.className = "".concat(scrollableElement.className, " k-scrollable-horizontal");
84
102
  return element;
85
103
  };
86
104
  var monthView = viewFactory({ cells: 7, rows: 6 }, 'k-calendar-view k-calendar-monthview k-vstack', true);
@@ -144,13 +162,13 @@ var DOMService = /** @class */ (function () {
144
162
  var viewProp = dimension === 'height' ? 'ViewHeight' : 'ViewWidth';
145
163
  switch (viewType) {
146
164
  case CalendarViewEnum.month:
147
- return this["month" + viewProp];
165
+ return this["month".concat(viewProp)];
148
166
  case CalendarViewEnum.year:
149
- return this["year" + viewProp];
167
+ return this["year".concat(viewProp)];
150
168
  case CalendarViewEnum.decade:
151
- return this["decade" + viewProp];
169
+ return this["decade".concat(viewProp)];
152
170
  case CalendarViewEnum.century:
153
- return this["century" + viewProp];
171
+ return this["century".concat(viewProp)];
154
172
  default:
155
173
  return 1;
156
174
  }
@@ -51,7 +51,7 @@ var DecadeViewService = /** @class */ (function () {
51
51
  : _this.isSelectedFromArray(cellDate, selectedDate, min, max));
52
52
  return intersects(cellDate, firstDate, lastDate) ? ({
53
53
  formattedValue: _this.value(cellDate),
54
- id: "" + cellUID + cellDate.getTime(),
54
+ id: "".concat(cellUID).concat(cellDate.getTime()),
55
55
  isFocused: _this.isEqual(cellDate, focusedDate),
56
56
  isSelected: isSelected,
57
57
  isWeekend: false,
@@ -120,7 +120,7 @@ var DecadeViewService = /** @class */ (function () {
120
120
  if (!value) {
121
121
  return '';
122
122
  }
123
- return firstYearOfDecade(value).getFullYear() + " - " + lastYearOfDecade(value).getFullYear();
123
+ return "".concat(firstYearOfDecade(value).getFullYear(), " - ").concat(lastYearOfDecade(value).getFullYear());
124
124
  };
125
125
  DecadeViewService.prototype.rowLength = function (_) {
126
126
  return CELLS_LENGTH;
@@ -60,7 +60,7 @@ var MonthViewService = /** @class */ (function () {
60
60
  : _this.isSelectedFromArray(cellDate, selectedDate, min, max));
61
61
  var cell = {
62
62
  formattedValue: _this.value(cellDate),
63
- id: "" + cellUID + cellDate.getTime(),
63
+ id: "".concat(cellUID).concat(cellDate.getTime()),
64
64
  isFocused: _this.isEqual(cellDate, focusedDate),
65
65
  isSelected: isSelected,
66
66
  isInRange: isInRange(cellDate, min, max),
@@ -126,7 +126,7 @@ var MonthViewService = /** @class */ (function () {
126
126
  return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];
127
127
  };
128
128
  MonthViewService.prototype.title = function (current) {
129
- return this.wideMonthNames()[current.getMonth()] + " " + current.getFullYear();
129
+ return "".concat(this.wideMonthNames()[current.getMonth()], " ").concat(current.getFullYear());
130
130
  };
131
131
  MonthViewService.prototype.rowLength = function (prependCell) {
132
132
  return CELLS_LENGTH + (prependCell ? 1 : 0);
@@ -19,7 +19,7 @@ var NavigationService = /** @class */ (function () {
19
19
  this.bus = bus;
20
20
  }
21
21
  NavigationService.prototype.action = function (event) {
22
- var action = "" + (event.ctrlKey || event.metaKey ? 'meta+' : '') + event.keyCode;
22
+ var action = "".concat(event.ctrlKey || event.metaKey ? 'meta+' : '').concat(event.keyCode);
23
23
  return KEY_TO_ACTION[action];
24
24
  };
25
25
  NavigationService.prototype.move = function (value, action, activeView, service, event) {
@@ -6,6 +6,10 @@ var powerByMagnitude = function (magnitude) { return function (x) { return x * m
6
6
  var ScrollSyncService = /** @class */ (function () {
7
7
  function ScrollSyncService(dom) {
8
8
  this.dom = dom;
9
+ this.divideByMagnitude = null;
10
+ this.powerByMagnitude = null;
11
+ this.navigator = null;
12
+ this.view = null;
9
13
  this.monthScrolled = false;
10
14
  this.navScrolled = false;
11
15
  }
@@ -47,7 +51,7 @@ var ScrollSyncService = /** @class */ (function () {
47
51
  };
48
52
  ScrollSyncService.prototype.calculateScroll = function (component, scrollTop) {
49
53
  var modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;
50
- return modifier(scrollTop);
54
+ return modifier ? modifier(scrollTop) : 0;
51
55
  };
52
56
  return ScrollSyncService;
53
57
  }());
@@ -77,7 +77,7 @@ var YearViewService = /** @class */ (function () {
77
77
  : _this.isSelectedFromArray(cellDate, selectedDate, min, max));
78
78
  return {
79
79
  formattedValue: months[cellDate.getMonth()],
80
- id: "" + cellUID + cellDate.getTime(),
80
+ id: "".concat(cellUID).concat(cellDate.getTime()),
81
81
  isFocused: _this.isEqual(cellDate, focusedDate),
82
82
  isSelected: isSelected,
83
83
  isInRange: isInRange(cellDate, min, max),
@@ -138,7 +138,7 @@ var YearViewService = /** @class */ (function () {
138
138
  return modifier(value);
139
139
  };
140
140
  YearViewService.prototype.cellTitle = function (value) {
141
- return value.getFullYear() + " " + this.value(value);
141
+ return "".concat(value.getFullYear(), " ").concat(this.value(value));
142
142
  };
143
143
  YearViewService.prototype.navigationTitle = function (value) {
144
144
  return this.title(value);
@@ -4,9 +4,9 @@
4
4
  export default class ScrollSync {
5
5
  private scrollDetails;
6
6
  private scrollNavigation;
7
- areDetailsSynced: any;
8
- isNavigationSynced: any;
9
- magnitude: any;
7
+ areDetailsSynced: boolean;
8
+ isNavigationSynced: boolean;
9
+ magnitude: number;
10
10
  constructor(detailsMonthHeight: number, navigationMonthHeight: number, scrollDetails: (scrollTo: number) => void, scrollNavigation: (scrollTo: number) => void);
11
11
  syncDetails(navigationScrollTop: number): void;
12
12
  syncNavigation(detailsScrollTop: number): void;
@@ -5,6 +5,8 @@ var ScrollSync = /** @class */ (function () {
5
5
  function ScrollSync(detailsMonthHeight, navigationMonthHeight, scrollDetails, scrollNavigation) {
6
6
  this.scrollDetails = scrollDetails;
7
7
  this.scrollNavigation = scrollNavigation;
8
+ this.areDetailsSynced = false;
9
+ this.isNavigationSynced = false;
8
10
  this.magnitude = Math.max(detailsMonthHeight / navigationMonthHeight, 1);
9
11
  }
10
12
  ScrollSync.prototype.syncDetails = function (navigationScrollTop) {