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

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 (110) 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.js +9 -4
  10. package/dist/es/calendar/components/TodayCommand.js +4 -2
  11. package/dist/es/calendar/components/View.d.ts +4 -4
  12. package/dist/es/calendar/components/View.js +7 -5
  13. package/dist/es/calendar/components/ViewList.js +10 -2
  14. package/dist/es/calendar/services/BusViewService.js +1 -1
  15. package/dist/es/calendar/services/CenturyViewService.js +2 -2
  16. package/dist/es/calendar/services/DOMService.js +24 -6
  17. package/dist/es/calendar/services/DecadeViewService.js +2 -2
  18. package/dist/es/calendar/services/MonthViewService.js +2 -2
  19. package/dist/es/calendar/services/NavigationService.js +1 -1
  20. package/dist/es/calendar/services/ScrollSyncService.js +5 -1
  21. package/dist/es/calendar/services/YearViewService.js +2 -2
  22. package/dist/es/dateinput/DateInput.d.ts +11 -7
  23. package/dist/es/dateinput/DateInput.js +14 -8
  24. package/dist/es/dateinput/models/mask.js +1 -0
  25. package/dist/es/datepicker/DatePicker.d.ts +8 -8
  26. package/dist/es/datepicker/DatePicker.js +4 -3
  27. package/dist/es/daterangepicker/DateRangePicker.d.ts +3 -3
  28. package/dist/es/datetimepicker/DateTimePicker.d.ts +7 -7
  29. package/dist/es/datetimepicker/DateTimePicker.js +3 -3
  30. package/dist/es/datetimepicker/DateTimeSelector.d.ts +1 -1
  31. package/dist/es/datetimepicker/DateTimeSelector.js +5 -0
  32. package/dist/es/package-metadata.js +1 -1
  33. package/dist/es/timepicker/TimeList.d.ts +3 -3
  34. package/dist/es/timepicker/TimeList.js +25 -7
  35. package/dist/es/timepicker/TimePart.d.ts +3 -3
  36. package/dist/es/timepicker/TimePart.js +4 -1
  37. package/dist/es/timepicker/TimePicker.d.ts +7 -7
  38. package/dist/es/timepicker/TimePicker.js +4 -3
  39. package/dist/es/timepicker/TimeSelector.d.ts +2 -2
  40. package/dist/es/timepicker/TimeSelector.js +4 -0
  41. package/dist/es/timepicker/services/DOMService.js +2 -0
  42. package/dist/es/timepicker/services/DayPeriodService.js +9 -3
  43. package/dist/es/timepicker/services/HoursService.js +14 -5
  44. package/dist/es/timepicker/services/MinutesService.js +12 -6
  45. package/dist/es/timepicker/services/SecondsService.js +12 -6
  46. package/dist/es/utils.js +9 -5
  47. package/dist/es/virtualization/Virtualization.d.ts +1 -0
  48. package/dist/es/virtualization/Virtualization.js +13 -5
  49. package/dist/es/virtualization/services/RowHeightService.js +9 -5
  50. package/dist/es/virtualization/services/ScrollerService.js +9 -3
  51. package/dist/npm/calendar/components/Calendar.d.ts +4 -4
  52. package/dist/npm/calendar/components/Calendar.js +43 -31
  53. package/dist/npm/calendar/components/CalendarCell.js +1 -1
  54. package/dist/npm/calendar/components/CalendarNavigationItem.js +1 -1
  55. package/dist/npm/calendar/components/CalendarWeekCell.js +1 -1
  56. package/dist/npm/calendar/components/Header.d.ts +1 -0
  57. package/dist/npm/calendar/components/Header.js +3 -3
  58. package/dist/npm/calendar/components/HorizontalViewList.js +3 -2
  59. package/dist/npm/calendar/components/MultiViewCalendar.d.ts +3 -3
  60. package/dist/npm/calendar/components/MultiViewCalendar.js +49 -42
  61. package/dist/npm/calendar/components/Navigation.js +13 -8
  62. package/dist/npm/calendar/components/TodayCommand.js +9 -7
  63. package/dist/npm/calendar/components/View.d.ts +4 -4
  64. package/dist/npm/calendar/components/View.js +16 -14
  65. package/dist/npm/calendar/components/ViewList.js +19 -11
  66. package/dist/npm/calendar/services/BusViewService.js +1 -1
  67. package/dist/npm/calendar/services/CenturyViewService.js +38 -38
  68. package/dist/npm/calendar/services/DOMService.js +33 -15
  69. package/dist/npm/calendar/services/DecadeViewService.js +32 -32
  70. package/dist/npm/calendar/services/MonthViewService.js +36 -36
  71. package/dist/npm/calendar/services/NavigationService.js +1 -1
  72. package/dist/npm/calendar/services/ScrollSyncService.js +5 -1
  73. package/dist/npm/calendar/services/WeekNamesService.js +1 -1
  74. package/dist/npm/calendar/services/YearViewService.js +33 -33
  75. package/dist/npm/common/PickerWrap.js +1 -1
  76. package/dist/npm/dateinput/DateInput.d.ts +11 -7
  77. package/dist/npm/dateinput/DateInput.js +32 -26
  78. package/dist/npm/dateinput/models/kendo-date.js +11 -11
  79. package/dist/npm/dateinput/models/mask.js +1 -0
  80. package/dist/npm/datepicker/DatePicker.d.ts +8 -8
  81. package/dist/npm/datepicker/DatePicker.js +17 -16
  82. package/dist/npm/daterangepicker/DateRangePicker.d.ts +3 -3
  83. package/dist/npm/daterangepicker/DateRangePicker.js +17 -17
  84. package/dist/npm/datetimepicker/DateTimePicker.d.ts +7 -7
  85. package/dist/npm/datetimepicker/DateTimePicker.js +15 -15
  86. package/dist/npm/datetimepicker/DateTimeSelector.d.ts +1 -1
  87. package/dist/npm/datetimepicker/DateTimeSelector.js +13 -8
  88. package/dist/npm/hooks/usePickerFloatingLabel.js +1 -1
  89. package/dist/npm/package-metadata.js +1 -1
  90. package/dist/npm/timepicker/TimeList.d.ts +3 -3
  91. package/dist/npm/timepicker/TimeList.js +29 -11
  92. package/dist/npm/timepicker/TimePart.d.ts +3 -3
  93. package/dist/npm/timepicker/TimePart.js +14 -11
  94. package/dist/npm/timepicker/TimePicker.d.ts +7 -7
  95. package/dist/npm/timepicker/TimePicker.js +19 -18
  96. package/dist/npm/timepicker/TimeSelector.d.ts +2 -2
  97. package/dist/npm/timepicker/TimeSelector.js +14 -10
  98. package/dist/npm/timepicker/services/DOMService.js +6 -4
  99. package/dist/npm/timepicker/services/DayPeriodService.js +10 -4
  100. package/dist/npm/timepicker/services/HoursService.js +20 -11
  101. package/dist/npm/timepicker/services/MinutesService.js +16 -10
  102. package/dist/npm/timepicker/services/SecondsService.js +16 -10
  103. package/dist/npm/timepicker/utils.js +11 -11
  104. package/dist/npm/utils.js +16 -12
  105. package/dist/npm/virtualization/Virtualization.d.ts +1 -0
  106. package/dist/npm/virtualization/Virtualization.js +15 -7
  107. package/dist/npm/virtualization/services/RowHeightService.js +9 -5
  108. package/dist/npm/virtualization/services/ScrollerService.js +9 -3
  109. package/dist/systemjs/kendo-react-dateinputs.js +1 -1
  110. package/package.json +13 -13
@@ -58,11 +58,12 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
58
58
  __extends(TimePickerWithoutContext, _super);
59
59
  function TimePickerWithoutContext(props) {
60
60
  var _this = _super.call(this, props) || this;
61
- _this._popupId = kendo_react_common_1.guid();
61
+ _this._popupId = (0, kendo_react_common_1.guid)();
62
62
  _this._element = null;
63
63
  _this._dateInput = React.createRef();
64
64
  _this._timeSelector = null;
65
65
  _this.shouldFocusDateInput = false;
66
+ _this.prevShow = false;
66
67
  /**
67
68
  * @hidden
68
69
  */
@@ -90,7 +91,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
90
91
  };
91
92
  _this.handleValueChange = function (event) {
92
93
  _this.setState({
93
- value: kendo_date_math_1.cloneDate(event.value),
94
+ value: (0, kendo_date_math_1.cloneDate)(event.value),
94
95
  show: false
95
96
  });
96
97
  _this.valueDuringOnChange = event.value;
@@ -143,7 +144,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
143
144
  _this.setShow(keyCode === kendo_react_common_1.Keys.down);
144
145
  }
145
146
  };
146
- kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
147
+ (0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
147
148
  _this.state = {
148
149
  value: _this.props.defaultValue || TimePickerWithoutContext.defaultProps.defaultValue,
149
150
  show: _this.props.defaultShow || TimePickerWithoutContext.defaultProps.defaultShow,
@@ -194,7 +195,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
194
195
  : this.props.value !== undefined
195
196
  ? this.props.value
196
197
  : this.state.value;
197
- return (value !== null) ? kendo_date_math_1.cloneDate(value) : null;
198
+ return (value !== null) ? (0, kendo_date_math_1.cloneDate)(value) : null;
198
199
  },
199
200
  enumerable: false,
200
201
  configurable: true
@@ -231,14 +232,14 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
231
232
  var value = this.value && this.normalizeTime(this.value);
232
233
  var min = this.normalizeTime(this.min);
233
234
  var max = this.normalizeTime(this.max);
234
- var inRange = utils_2.isInRange(value, min, max);
235
+ var inRange = (0, utils_2.isInRange)(value, min, max);
235
236
  var customError = this.props.validationMessage !== undefined;
236
237
  var isValid = (!this.required || this.value !== null) && inRange;
237
238
  var valid = this.props.valid !== undefined ? this.props.valid : isValid;
238
239
  return {
239
240
  customError: customError,
240
- rangeOverflow: utils_2.isBiggerThanMax(value, max),
241
- rangeUnderflow: utils_2.isSmallerThanMin(value, min),
241
+ rangeOverflow: (0, utils_2.isBiggerThanMax)(value, max),
242
+ rangeUnderflow: (0, utils_2.isSmallerThanMin)(value, min),
242
243
  valid: valid,
243
244
  valueMissing: this.value === null
244
245
  };
@@ -331,7 +332,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
331
332
  var _a = this.props, _b = _a.size, size = _b === void 0 ? TimePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? TimePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? TimePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, className = _a.className, format = _a.format, formatPlaceholder = _a.formatPlaceholder, smoothScroll = _a.smoothScroll, width = _a.width, name = _a.name, steps = _a.steps, cancelButton = _a.cancelButton, nowButton = _a.nowButton, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy;
332
333
  var _e = this.popupSettings, popupClass = _e.popupClass, otherPopupSettings = __rest(_e, ["popupClass"]);
333
334
  var isValid = !this.validityStyles || this.validity.valid;
334
- var popupClassNames = kendo_react_common_1.classNames('k-group k-reset', popupClass);
335
+ var popupClassNames = (0, kendo_react_common_1.classNames)('k-group k-reset', popupClass);
335
336
  var dateInputProps = {
336
337
  disabled: disabled,
337
338
  format: format,
@@ -367,17 +368,17 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
367
368
  vertical: 'top'
368
369
  } }, otherPopupSettings);
369
370
  var timeSelector = (React.createElement(TimeSelector_1.TimeSelector, { ref: this.setTimeSelectorRef, show: this.show, cancelButton: cancelButton, disabled: disabled, nowButton: nowButton, format: format, min: this.min, max: this.max, steps: steps, smoothScroll: smoothScroll, value: this.value, onChange: this.handleValueChange, onReject: this.handleValueReject }));
370
- var localizationService = kendo_react_intl_1.provideLocalizationService(this);
371
+ var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
371
372
  var toggleClockMessage = localizationService.toLanguageString(messages_1.toggleClock, messages_1.messages[messages_1.toggleClock]);
372
373
  var toggleTimeMessage = localizationService
373
374
  .toLanguageString(messages_1.toggleTimeSelector, messages_1.messages[messages_1.toggleTimeSelector]);
374
375
  var timepicker = (React.createElement(kendo_react_common_1.AsyncFocusBlur, { onFocus: this.handleFocus, onBlur: this.handleBlur, onSyncBlur: this.props.onBlur, onSyncFocus: this.props.onFocus }, function (_a) {
375
376
  var _b;
376
377
  var onFocus = _a.onFocus, onBlur = _a.onBlur;
377
- return (React.createElement("div", { ref: function (span) { _this._element = span; }, className: kendo_react_common_1.classNames('k-input', 'k-timepicker', (_b = {},
378
- _b["k-input-" + (kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
379
- _b["k-rounded-" + (kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
380
- _b["k-input-" + fillMode] = fillMode,
378
+ return (React.createElement("div", { ref: function (span) { _this._element = span; }, className: (0, kendo_react_common_1.classNames)('k-input', 'k-timepicker', (_b = {},
379
+ _b["k-input-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
380
+ _b["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
381
+ _b["k-input-".concat(fillMode)] = fillMode,
381
382
  _b['k-invalid'] = !isValid,
382
383
  _b['k-required'] = _this.required,
383
384
  _b['k-disabled'] = _this.props.disabled,
@@ -396,7 +397,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
396
397
  : timepicker;
397
398
  };
398
399
  TimePickerWithoutContext.prototype.normalizeTime = function (date) {
399
- return utils_1.setTime(utils_1.MIDNIGHT_DATE, date);
400
+ return (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, date);
400
401
  };
401
402
  TimePickerWithoutContext.prototype.setShow = function (show) {
402
403
  if (this.show === show) {
@@ -405,7 +406,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
405
406
  this.setState({ show: show });
406
407
  };
407
408
  TimePickerWithoutContext.prototype.mergeTime = function (value) {
408
- return this.value && value ? utils_1.setTime(this.value, value) : value;
409
+ return this.value && value ? (0, utils_1.setTime)(this.value, value) : value;
409
410
  };
410
411
  /**
411
412
  * @hidden
@@ -511,7 +512,7 @@ exports.TimePickerWithoutContext = TimePickerWithoutContext;
511
512
  *
512
513
  * For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
513
514
  */
514
- exports.TimePickerPropsContext = kendo_react_common_1.createPropsContext();
515
+ exports.TimePickerPropsContext = (0, kendo_react_common_1.createPropsContext)();
515
516
  /* eslint-disable @typescript-eslint/no-redeclare */
516
517
  /**
517
518
  * Represents the KendoReact TimePicker Component.
@@ -519,6 +520,6 @@ exports.TimePickerPropsContext = kendo_react_common_1.createPropsContext();
519
520
  * Accepts properties of type [TimePicker]({% slug api_dateinputs_timepickerprops %}).
520
521
  * Obtaining the `ref` returns an object of type [TimePickerHandle]({% slug api_dateinputs_timepickerhandle %}).
521
522
  */
522
- exports.TimePicker = kendo_react_common_1.withPropsContext(exports.TimePickerPropsContext, TimePickerWithoutContext);
523
+ exports.TimePicker = (0, kendo_react_common_1.withPropsContext)(exports.TimePickerPropsContext, TimePickerWithoutContext);
523
524
  exports.TimePicker.displayName = 'KendoReactTimePicker';
524
- kendo_react_intl_1.registerForLocalization(TimePickerWithoutContext);
525
+ (0, kendo_react_intl_1.registerForLocalization)(TimePickerWithoutContext);
@@ -84,7 +84,7 @@ export declare class TimeSelector extends React.Component<TimeSelectorProps, Tim
84
84
  show: PropTypes.Requireable<boolean>;
85
85
  };
86
86
  static defaultProps: {
87
- value: any;
87
+ value: null;
88
88
  disabled: boolean;
89
89
  cancelButton: boolean;
90
90
  format: string;
@@ -119,7 +119,7 @@ export declare class TimeSelector extends React.Component<TimeSelectorProps, Tim
119
119
  render(): JSX.Element;
120
120
  focusActiveList: () => void;
121
121
  protected nextTick(f: () => any): void;
122
- protected hasActiveButton(): boolean;
122
+ protected hasActiveButton(): boolean | null;
123
123
  private handleKeyDown;
124
124
  private handleAccept;
125
125
  private handleReject;
@@ -52,6 +52,10 @@ var TimeSelector = /** @class */ (function (_super) {
52
52
  __extends(TimeSelector, _super);
53
53
  function TimeSelector(props) {
54
54
  var _this = _super.call(this, props) || this;
55
+ _this._element = null;
56
+ _this._cancelButton = null;
57
+ _this._acceptButton = null;
58
+ _this.timePart = null;
55
59
  _this.focusActiveList = function () {
56
60
  if (!_this.timePart) {
57
61
  return;
@@ -71,7 +75,7 @@ var TimeSelector = /** @class */ (function (_super) {
71
75
  }
72
76
  };
73
77
  _this.handleAccept = function (event) {
74
- var value = _this.mergeValue(kendo_date_math_1.cloneDate(_this.value || utils_2.getNow()), _this.timePart ? _this.timePart.value : _this.current);
78
+ var value = _this.mergeValue((0, kendo_date_math_1.cloneDate)(_this.value || (0, utils_2.getNow)()), _this.timePart ? _this.timePart.value : _this.current);
75
79
  _this.setState({ value: value });
76
80
  _this.valueDuringOnChange = value;
77
81
  var onChange = _this.props.onChange;
@@ -93,7 +97,7 @@ var TimeSelector = /** @class */ (function (_super) {
93
97
  }
94
98
  };
95
99
  _this.handleNowClick = function (event) {
96
- var now = _this.mergeValue(kendo_date_math_1.cloneDate(_this.value || utils_2.getNow()), utils_2.getNow());
100
+ var now = _this.mergeValue((0, kendo_date_math_1.cloneDate)(_this.value || (0, utils_2.getNow)()), (0, utils_2.getNow)());
97
101
  _this.setState({
98
102
  current: now,
99
103
  value: now
@@ -114,7 +118,7 @@ var TimeSelector = /** @class */ (function (_super) {
114
118
  _this.setState({ current: candidate });
115
119
  };
116
120
  _this.dateFormatParts = _this.intl.splitDateFormat(_this.props.format || TimeSelector.defaultProps.format);
117
- _this.mergeValue = utils_2.valueMerger(utils_2.generateGetters(_this.dateFormatParts));
121
+ _this.mergeValue = (0, utils_2.valueMerger)((0, utils_2.generateGetters)(_this.dateFormatParts));
118
122
  _this.hasActiveButton = _this.hasActiveButton.bind(_this);
119
123
  _this.state = {
120
124
  current: _this.props.value || utils_1.MIDNIGHT_DATE,
@@ -140,7 +144,7 @@ var TimeSelector = /** @class */ (function (_super) {
140
144
  ? this.props.value
141
145
  : this.state.value;
142
146
  return (value !== null)
143
- ? kendo_date_math_1.cloneDate(value)
147
+ ? (0, kendo_date_math_1.cloneDate)(value)
144
148
  : null;
145
149
  },
146
150
  enumerable: false,
@@ -148,7 +152,7 @@ var TimeSelector = /** @class */ (function (_super) {
148
152
  });
149
153
  Object.defineProperty(TimeSelector.prototype, "intl", {
150
154
  get: function () {
151
- return kendo_react_intl_1.provideIntlService(this);
155
+ return (0, kendo_react_intl_1.provideIntlService)(this);
152
156
  },
153
157
  enumerable: false,
154
158
  configurable: true
@@ -156,7 +160,7 @@ var TimeSelector = /** @class */ (function (_super) {
156
160
  Object.defineProperty(TimeSelector.prototype, "current", {
157
161
  get: function () {
158
162
  return this.state.current !== null
159
- ? kendo_date_math_1.cloneDate(this.state.current)
163
+ ? (0, kendo_date_math_1.cloneDate)(this.state.current)
160
164
  : null;
161
165
  },
162
166
  enumerable: false,
@@ -174,10 +178,10 @@ var TimeSelector = /** @class */ (function (_super) {
174
178
  TimeSelector.prototype.render = function () {
175
179
  var _this = this;
176
180
  var _a = this.props, format = _a.format, cancelButton = _a.cancelButton, disabled = _a.disabled, tabIndex = _a.tabIndex, className = _a.className, smoothScroll = _a.smoothScroll, min = _a.min, max = _a.max, boundRange = _a.boundRange, nowButton = _a.nowButton, steps = _a.steps;
177
- var localizationService = kendo_react_intl_1.provideLocalizationService(this);
181
+ var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
178
182
  var cancelMessage = localizationService.toLanguageString(messages_1.timePickerCancel, messages_1.messages[messages_1.timePickerCancel]);
179
183
  var setMessage = localizationService.toLanguageString(messages_1.timePickerSet, messages_1.messages[messages_1.timePickerSet]);
180
- return (React.createElement("div", { ref: function (el) { _this._element = el; }, tabIndex: !disabled ? tabIndex || 0 : undefined, className: kendo_react_common_1.classNames('k-timeselector k-reset', className, {
184
+ return (React.createElement("div", { ref: function (el) { _this._element = el; }, tabIndex: !disabled ? tabIndex || 0 : undefined, className: (0, kendo_react_common_1.classNames)('k-timeselector k-reset', className, {
181
185
  'k-disabled': disabled
182
186
  }), onKeyDown: this.handleKeyDown },
183
187
  React.createElement(TimePart_1.TimePart, { ref: function (el) { _this.timePart = el; }, value: this.current, onChange: this.handleChange, onNowClick: this.handleNowClick, format: format, smoothScroll: smoothScroll, min: min, max: max, boundRange: boundRange, disabled: disabled, nowButton: nowButton, steps: steps, show: this.props.show }),
@@ -248,5 +252,5 @@ var TimeSelector = /** @class */ (function (_super) {
248
252
  return TimeSelector;
249
253
  }(React.Component));
250
254
  exports.TimeSelector = TimeSelector;
251
- kendo_react_intl_1.registerForIntl(TimeSelector);
252
- kendo_react_intl_1.registerForLocalization(TimeSelector);
255
+ (0, kendo_react_intl_1.registerForIntl)(TimeSelector);
256
+ (0, kendo_react_intl_1.registerForLocalization)(TimeSelector);
@@ -8,6 +8,8 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
8
8
  */
9
9
  var DOMService = /** @class */ (function () {
10
10
  function DOMService() {
11
+ this.itemHeight = 0;
12
+ this.timeListHeight = 0;
11
13
  this.didCalculate = false;
12
14
  }
13
15
  DOMService.prototype.ensureHeights = function () {
@@ -20,10 +22,10 @@ var DOMService = /** @class */ (function () {
20
22
  if (!kendo_react_common_1.canUseDOM) {
21
23
  return;
22
24
  }
23
- var div = utils_1.domContainerFactory('div');
24
- var span = utils_1.domContainerFactory('span');
25
- var ul = utils_1.domContainerFactory('ul');
26
- var li = utils_1.domContainerFactory('li');
25
+ var div = (0, utils_1.domContainerFactory)('div');
26
+ var span = (0, utils_1.domContainerFactory)('span');
27
+ var ul = (0, utils_1.domContainerFactory)('ul');
28
+ var li = (0, utils_1.domContainerFactory)('li');
27
29
  var listItem = function () { return li('<span>02</span>', 'k-item'); };
28
30
  var list = function () { return ul([listItem()], 'k-reset'); };
29
31
  var scrollable = function () { return (div([list()], 'k-content k-calendar-content k-scrollable k-time-container')); };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DayPeriodService = void 0;
4
4
  var kendo_date_math_1 = require("@progress/kendo-date-math");
5
5
  var setHours = function (date, hours) {
6
- var clone = kendo_date_math_1.cloneDate(date);
6
+ var clone = (0, kendo_date_math_1.cloneDate)(date);
7
7
  clone.setHours(hours);
8
8
  return clone;
9
9
  };
@@ -17,6 +17,9 @@ var inReverseRange = function (value, min, max) { return ((!min && !max) || valu
17
17
  var DayPeriodService = /** @class */ (function () {
18
18
  function DayPeriodService(intl) {
19
19
  this.intl = intl;
20
+ this.min = null;
21
+ this.max = null;
22
+ this.part = null;
20
23
  }
21
24
  /**
22
25
  * @hidden
@@ -45,8 +48,8 @@ var DayPeriodService = /** @class */ (function () {
45
48
  * @hidden
46
49
  */
47
50
  DayPeriodService.prototype.data = function (_) {
48
- var names = this.part.names;
49
- if (!names) {
51
+ var names = this.part && this.part.names;
52
+ if (!names || !this.min) {
50
53
  return [];
51
54
  }
52
55
  var data = [];
@@ -89,7 +92,7 @@ var DayPeriodService = /** @class */ (function () {
89
92
  * @hidden
90
93
  */
91
94
  DayPeriodService.prototype.selectedIndex = function (value) {
92
- if (!this.valueInList(value)) {
95
+ if (!this.valueInList(value) || !this.min) {
93
96
  return -1;
94
97
  }
95
98
  var index = Math.floor(value.getHours() / 12);
@@ -99,6 +102,9 @@ var DayPeriodService = /** @class */ (function () {
99
102
  * @hidden
100
103
  */
101
104
  DayPeriodService.prototype.valueInList = function (value) {
105
+ if (!this.min || !this.max) {
106
+ return false;
107
+ }
102
108
  var reverse = this.min.getHours() !== this.normalizedRange()[0];
103
109
  var isInRange = reverse ? inReverseRange : inRange;
104
110
  return isInRange(value.getHours(), this.min.getHours(), this.max.getHours());
@@ -10,8 +10,8 @@ var clamp = clampToRange(HOURS_IN_DAY);
10
10
  var stepper = function (start, step) { return function (idx) { return clamp(start + (idx * step)); }; };
11
11
  var distanceFromMin = function (value, min) { return clamp(HOURS_IN_DAY + value - min); };
12
12
  var limit = function (borderValue) { return function (barrier, value) {
13
- var useBarrier = !value || kendo_date_math_1.getDate(barrier).getTime() === kendo_date_math_1.getDate(value).getTime();
14
- return useBarrier ? barrier : utils_2.setHours(barrier, borderValue);
13
+ var useBarrier = !value || (0, kendo_date_math_1.getDate)(barrier).getTime() === (0, kendo_date_math_1.getDate)(value).getTime();
14
+ return useBarrier ? barrier : (0, utils_2.setHours)(barrier, borderValue);
15
15
  }; };
16
16
  var limitDown = limit(0);
17
17
  var limitUp = limit(HOURS_IN_DAY - 1);
@@ -23,9 +23,13 @@ var HoursService = /** @class */ (function () {
23
23
  this.intl = intl;
24
24
  this.boundRange = false;
25
25
  this.insertUndividedMax = false;
26
+ this.min = null;
27
+ this.max = null;
28
+ this.step = 0;
29
+ this.toListItem = null;
26
30
  }
27
31
  HoursService.prototype.apply = function (value, candidate) {
28
- return utils_2.setHours(value, candidate.getHours());
32
+ return (0, utils_2.setHours)(value, candidate.getHours());
29
33
  };
30
34
  HoursService.prototype.configure = function (settings) {
31
35
  var _this = this;
@@ -33,7 +37,7 @@ var HoursService = /** @class */ (function () {
33
37
  this.boundRange = boundRange;
34
38
  this.insertUndividedMax = insertUndividedMax;
35
39
  this.toListItem = function (hour) {
36
- var date = utils_2.setHours(utils_1.MIDNIGHT_DATE, hour);
40
+ var date = (0, utils_2.setHours)(utils_1.MIDNIGHT_DATE, hour);
37
41
  return {
38
42
  text: _this.intl.formatDate(date, part.pattern),
39
43
  value: date
@@ -47,8 +51,8 @@ var HoursService = /** @class */ (function () {
47
51
  var _this = this;
48
52
  var min = this.range(selectedValue)[0];
49
53
  var getHour = stepper(min, this.step);
50
- var convertToItem = function (idx) { return (_this.toListItem(getHour(idx))); };
51
- var data = utils_2.range(0, this.countFromMin(selectedValue)).map(convertToItem);
54
+ var convertToItem = function (idx) { return (_this.toListItem && _this.toListItem(getHour(idx))); };
55
+ var data = (0, utils_2.range)(0, this.countFromMin(selectedValue)).map(convertToItem);
52
56
  this.addLast(data);
53
57
  if (selectedValue) {
54
58
  this.addMissing(data, selectedValue);
@@ -56,7 +60,10 @@ var HoursService = /** @class */ (function () {
56
60
  return data;
57
61
  };
58
62
  HoursService.prototype.isRangeChanged = function (min, max) {
59
- return !kendo_date_math_1.isEqual(this.min, min) || !kendo_date_math_1.isEqual(this.max, max);
63
+ if (!this.min || !this.max) {
64
+ return false;
65
+ }
66
+ return !(0, kendo_date_math_1.isEqual)(this.min, min) || !(0, kendo_date_math_1.isEqual)(this.max, max);
60
67
  };
61
68
  HoursService.prototype.limitRange = function (min, max, value) {
62
69
  return this.boundRange ? [limitDown(min, value), limitUp(max, value)] : [min, max];
@@ -77,7 +84,7 @@ var HoursService = /** @class */ (function () {
77
84
  return matchMax || !this.isMissing(value);
78
85
  };
79
86
  HoursService.prototype.addLast = function (data, value) {
80
- if (this.insertUndividedMax && this.isLastMissing(value)) {
87
+ if (this.insertUndividedMax && this.isLastMissing(value) && this.toListItem) {
81
88
  data.push(this.toListItem(this.lastHour(value)));
82
89
  }
83
90
  return data;
@@ -86,8 +93,10 @@ var HoursService = /** @class */ (function () {
86
93
  if (this.valueInList(value)) {
87
94
  return data;
88
95
  }
89
- var missingItem = this.toListItem(value.getHours());
90
- data.splice(this.selectedIndex(value), 0, missingItem);
96
+ if (this.toListItem) {
97
+ var missingItem = this.toListItem(value.getHours());
98
+ data.splice(this.selectedIndex(value), 0, missingItem);
99
+ }
91
100
  return data;
92
101
  };
93
102
  HoursService.prototype.countFromMin = function (value) {
@@ -101,7 +110,7 @@ var HoursService = /** @class */ (function () {
101
110
  return this.selectedIndex(value) !== this.divideByStep(value);
102
111
  };
103
112
  HoursService.prototype.isLastMissing = function (value) {
104
- return this.isMissing(utils_2.setHours(this.max, this.lastHour(value)));
113
+ return this.max !== null && this.isMissing((0, utils_2.setHours)(this.max, this.lastHour(value)));
105
114
  };
106
115
  HoursService.prototype.divideByStep = function (value) {
107
116
  return distanceFromMin(value.getHours(), this.min.getHours()) / this.step;
@@ -11,7 +11,7 @@ var stepper = function (start, step) { return function (idx) { return clamp(star
11
11
  var distanceFromMin = function (value, min) { return clamp(MINUTES_IN_HOUR + value - min); };
12
12
  var limit = function (borderValue) { return function (barrier, value) {
13
13
  var useBarrier = !value || barrier.getHours() === value.getHours();
14
- return useBarrier ? barrier : utils_2.setMinutes(barrier, borderValue);
14
+ return useBarrier ? barrier : (0, utils_2.setMinutes)(barrier, borderValue);
15
15
  }; };
16
16
  var limitDown = limit(0);
17
17
  var limitUp = limit(MINUTES_IN_HOUR - 1);
@@ -21,17 +21,21 @@ var limitUp = limit(MINUTES_IN_HOUR - 1);
21
21
  var MinutesService = /** @class */ (function () {
22
22
  function MinutesService(intl) {
23
23
  this.intl = intl;
24
+ this.toListItem = null;
25
+ this.min = null;
26
+ this.max = null;
27
+ this.step = 0;
24
28
  this.insertUndividedMax = false;
25
29
  }
26
30
  MinutesService.prototype.apply = function (value, candidate) {
27
- return utils_2.setMinutes(value, candidate.getMinutes());
31
+ return (0, utils_2.setMinutes)(value, candidate.getMinutes());
28
32
  };
29
33
  MinutesService.prototype.configure = function (settings) {
30
34
  var _this = this;
31
35
  var _a = settings.insertUndividedMax, insertUndividedMax = _a === void 0 ? this.insertUndividedMax : _a, _b = settings.min, min = _b === void 0 ? this.min : _b, _c = settings.max, max = _c === void 0 ? this.max : _c, part = settings.part, _d = settings.step, step = _d === void 0 ? this.step : _d;
32
36
  this.insertUndividedMax = insertUndividedMax;
33
37
  this.toListItem = function (minute) {
34
- var date = utils_2.setMinutes(utils_1.MIDNIGHT_DATE, minute);
38
+ var date = (0, utils_2.setMinutes)(utils_1.MIDNIGHT_DATE, minute);
35
39
  return {
36
40
  text: _this.intl.formatDate(date, part.pattern),
37
41
  value: date
@@ -45,8 +49,8 @@ var MinutesService = /** @class */ (function () {
45
49
  var _this = this;
46
50
  var min = this.range(selectedValue)[0];
47
51
  var getMinute = stepper(min, this.step);
48
- var convertToItem = function (idx) { return (_this.toListItem(getMinute(idx))); };
49
- var data = utils_2.range(0, this.countFromMin(selectedValue)).map(convertToItem);
52
+ var convertToItem = function (idx) { return (_this.toListItem && _this.toListItem(getMinute(idx))); };
53
+ var data = (0, utils_2.range)(0, this.countFromMin(selectedValue)).map(convertToItem);
50
54
  this.addLast(data);
51
55
  if (selectedValue) {
52
56
  this.addMissing(data, selectedValue);
@@ -54,7 +58,7 @@ var MinutesService = /** @class */ (function () {
54
58
  return data;
55
59
  };
56
60
  MinutesService.prototype.isRangeChanged = function (min, max) {
57
- return !kendo_date_math_1.isEqual(this.min, min) || !kendo_date_math_1.isEqual(this.max, max);
61
+ return (this.min !== null && this.max !== null) && (!(0, kendo_date_math_1.isEqual)(this.min, min) || !(0, kendo_date_math_1.isEqual)(this.max, max));
58
62
  };
59
63
  MinutesService.prototype.limitRange = function (min, max, value) {
60
64
  return [limitDown(min, value), limitUp(max, value)];
@@ -75,7 +79,7 @@ var MinutesService = /** @class */ (function () {
75
79
  return matchMax || !this.isMissing(value);
76
80
  };
77
81
  MinutesService.prototype.addLast = function (data, value) {
78
- if (this.insertUndividedMax && this.isLastMissing(value)) {
82
+ if (this.insertUndividedMax && this.isLastMissing(value) && this.toListItem) {
79
83
  data.push(this.toListItem(this.lastMinute(value)));
80
84
  }
81
85
  return data;
@@ -84,8 +88,10 @@ var MinutesService = /** @class */ (function () {
84
88
  if (this.valueInList(value)) {
85
89
  return data;
86
90
  }
87
- var missingItem = this.toListItem(value.getMinutes());
88
- data.splice(this.selectedIndex(value), 0, missingItem);
91
+ if (this.toListItem) {
92
+ var missingItem = this.toListItem(value.getMinutes());
93
+ data.splice(this.selectedIndex(value), 0, missingItem);
94
+ }
89
95
  return data;
90
96
  };
91
97
  MinutesService.prototype.countFromMin = function (value) {
@@ -99,7 +105,7 @@ var MinutesService = /** @class */ (function () {
99
105
  return this.selectedIndex(value) !== this.divideByStep(value);
100
106
  };
101
107
  MinutesService.prototype.isLastMissing = function (value) {
102
- return this.isMissing(utils_2.setMinutes(this.max, this.lastMinute(value)));
108
+ return this.max !== null && this.isMissing((0, utils_2.setMinutes)(this.max, this.lastMinute(value)));
103
109
  };
104
110
  MinutesService.prototype.divideByStep = function (value) {
105
111
  return distanceFromMin(value.getMinutes(), this.min.getMinutes()) / this.step;
@@ -12,7 +12,7 @@ var distanceFromMin = function (value, min) { return clamp(SECONDS_IN_HOUR + val
12
12
  var limit = function (borderValue) { return function (barrier, value) {
13
13
  var useBarrier = !value ||
14
14
  (barrier.getMinutes() === value.getMinutes() && barrier.getHours() === value.getHours());
15
- return useBarrier ? barrier : utils_2.setSeconds(barrier, borderValue);
15
+ return useBarrier ? barrier : (0, utils_2.setSeconds)(barrier, borderValue);
16
16
  }; };
17
17
  var limitDown = limit(0);
18
18
  var limitUp = limit(SECONDS_IN_HOUR - 1);
@@ -22,17 +22,21 @@ var limitUp = limit(SECONDS_IN_HOUR - 1);
22
22
  var SecondsService = /** @class */ (function () {
23
23
  function SecondsService(intl) {
24
24
  this.intl = intl;
25
+ this.toListItem = null;
26
+ this.min = null;
27
+ this.max = null;
28
+ this.step = 0;
25
29
  this.insertUndividedMax = false;
26
30
  }
27
31
  SecondsService.prototype.apply = function (value, candidate) {
28
- return utils_2.setSeconds(value, candidate.getSeconds());
32
+ return (0, utils_2.setSeconds)(value, candidate.getSeconds());
29
33
  };
30
34
  SecondsService.prototype.configure = function (settings) {
31
35
  var _this = this;
32
36
  var _a = settings.insertUndividedMax, insertUndividedMax = _a === void 0 ? this.insertUndividedMax : _a, _b = settings.min, min = _b === void 0 ? this.min : _b, _c = settings.max, max = _c === void 0 ? this.max : _c, part = settings.part, _d = settings.step, step = _d === void 0 ? this.step : _d;
33
37
  this.insertUndividedMax = insertUndividedMax;
34
38
  this.toListItem = function (minute) {
35
- var date = utils_2.setSeconds(utils_1.MIDNIGHT_DATE, minute);
39
+ var date = (0, utils_2.setSeconds)(utils_1.MIDNIGHT_DATE, minute);
36
40
  return {
37
41
  text: _this.intl.formatDate(date, part.pattern),
38
42
  value: date
@@ -46,8 +50,8 @@ var SecondsService = /** @class */ (function () {
46
50
  var _this = this;
47
51
  var min = this.range(selectedValue)[0];
48
52
  var getSecond = stepper(min, this.step);
49
- var convertToItem = function (idx) { return (_this.toListItem(getSecond(idx))); };
50
- var data = utils_2.range(0, this.countFromMin(selectedValue)).map(convertToItem);
53
+ var convertToItem = function (idx) { return (_this.toListItem && _this.toListItem(getSecond(idx))); };
54
+ var data = (0, utils_2.range)(0, this.countFromMin(selectedValue)).map(convertToItem);
51
55
  this.addLast(data);
52
56
  if (selectedValue) {
53
57
  this.addMissing(data, selectedValue);
@@ -55,7 +59,7 @@ var SecondsService = /** @class */ (function () {
55
59
  return data;
56
60
  };
57
61
  SecondsService.prototype.isRangeChanged = function (min, max) {
58
- return !kendo_date_math_1.isEqual(this.min, min) || !kendo_date_math_1.isEqual(this.max, max);
62
+ return this.min !== null && this.max !== null && (!(0, kendo_date_math_1.isEqual)(this.min, min) || !(0, kendo_date_math_1.isEqual)(this.max, max));
59
63
  };
60
64
  SecondsService.prototype.limitRange = function (min, max, value) {
61
65
  return [limitDown(min, value), limitUp(max, value)];
@@ -79,7 +83,7 @@ var SecondsService = /** @class */ (function () {
79
83
  return distanceFromMin(value.getSeconds(), this.min.getSeconds()) / this.step;
80
84
  };
81
85
  SecondsService.prototype.addLast = function (data, value) {
82
- if (this.insertUndividedMax && this.isLastMissing(value)) {
86
+ if (this.insertUndividedMax && this.isLastMissing(value) && this.toListItem) {
83
87
  data.push(this.toListItem(this.lastSecond(value)));
84
88
  }
85
89
  return data;
@@ -88,8 +92,10 @@ var SecondsService = /** @class */ (function () {
88
92
  if (this.valueInList(value)) {
89
93
  return data;
90
94
  }
91
- var missingItem = this.toListItem(value.getSeconds());
92
- data.splice(this.selectedIndex(value), 0, missingItem);
95
+ if (this.toListItem) {
96
+ var missingItem = this.toListItem(value.getSeconds());
97
+ data.splice(this.selectedIndex(value), 0, missingItem);
98
+ }
93
99
  return data;
94
100
  };
95
101
  SecondsService.prototype.countFromMin = function (value) {
@@ -103,7 +109,7 @@ var SecondsService = /** @class */ (function () {
103
109
  return this.selectedIndex(value) !== this.divideByStep(value);
104
110
  };
105
111
  SecondsService.prototype.isLastMissing = function (value) {
106
- return this.isMissing(utils_2.setSeconds(this.max, this.lastSecond(value)));
112
+ return this.max !== null && this.isMissing((0, utils_2.setSeconds)(this.max, this.lastSecond(value)));
107
113
  };
108
114
  SecondsService.prototype.lastSecond = function (value) {
109
115
  return this.range(value)[1];
@@ -5,7 +5,7 @@ var kendo_date_math_1 = require("@progress/kendo-date-math");
5
5
  var TimePart_1 = require("./models/TimePart");
6
6
  var utils_1 = require("../utils");
7
7
  var setter = function (method) { return function (date, value) {
8
- var clone = kendo_date_math_1.cloneDate(date);
8
+ var clone = (0, kendo_date_math_1.cloneDate)(date);
9
9
  clone[method](value);
10
10
  return clone;
11
11
  }; };
@@ -57,7 +57,7 @@ exports.valueMerger = valueMerger;
57
57
  * @hidden
58
58
  */
59
59
  var snapTime = function (snappers) { return function (candidate) {
60
- var date = kendo_date_math_1.cloneDate(candidate);
60
+ var date = (0, kendo_date_math_1.cloneDate)(candidate);
61
61
  date.setHours.apply(date, snappers.map(function (s) { return s(date); }));
62
62
  return date;
63
63
  }; };
@@ -92,9 +92,9 @@ var range = function (start, end, step) {
92
92
  };
93
93
  exports.range = range;
94
94
  var normalizeTimes = function (candidate, min, max) { return ({
95
- candidateValue: utils_1.setTime(utils_1.MIDNIGHT_DATE, candidate),
96
- maxValue: kendo_date_math_1.addDays(utils_1.setTime(utils_1.MIDNIGHT_DATE, max), min.getHours() < max.getHours() ? 0 : 1),
97
- minValue: utils_1.setTime(utils_1.MIDNIGHT_DATE, min)
95
+ candidateValue: (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, candidate),
96
+ maxValue: (0, kendo_date_math_1.addDays)((0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, max), min.getHours() < max.getHours() ? 0 : 1),
97
+ minValue: (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, min)
98
98
  }); };
99
99
  /**
100
100
  * @hidden
@@ -105,10 +105,10 @@ var timeInRange = function (candidate, min, max) {
105
105
  }
106
106
  var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;
107
107
  if (candidateValue < minValue) {
108
- return utils_1.setTime(candidate, min);
108
+ return (0, utils_1.setTime)(candidate, min);
109
109
  }
110
110
  if (candidateValue > maxValue) {
111
- return utils_1.setTime(candidate, max);
111
+ return (0, utils_1.setTime)(candidate, max);
112
112
  }
113
113
  return candidate;
114
114
  };
@@ -142,8 +142,8 @@ var isSmallerThanMin = function (val, min) {
142
142
  if (val === null || min === null) {
143
143
  return false;
144
144
  }
145
- var normalizedValue = utils_1.setTime(utils_1.MIDNIGHT_DATE, val);
146
- var normalizedMin = utils_1.setTime(utils_1.MIDNIGHT_DATE, min);
145
+ var normalizedValue = (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, val);
146
+ var normalizedMin = (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, min);
147
147
  return normalizedValue.getTime() < normalizedMin.getHours();
148
148
  };
149
149
  exports.isSmallerThanMin = isSmallerThanMin;
@@ -154,8 +154,8 @@ var isBiggerThanMax = function (val, max) {
154
154
  if (val === null || max === null) {
155
155
  return false;
156
156
  }
157
- var normalizedValue = utils_1.setTime(utils_1.MIDNIGHT_DATE, val);
158
- var normalizedMax = utils_1.setTime(utils_1.MIDNIGHT_DATE, max);
157
+ var normalizedValue = (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, val);
158
+ var normalizedMax = (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, max);
159
159
  return normalizedMax.getTime() < normalizedValue.getHours();
160
160
  };
161
161
  exports.isBiggerThanMax = isBiggerThanMax;