@progress/kendo-react-dateinputs 5.4.0-dev.202205250548 → 5.4.0-dev.202206081230
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.
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/dist/es/PopupSettings.js +1 -0
- package/dist/es/calendar/components/Calendar.d.ts +10 -10
- package/dist/es/calendar/components/Calendar.js +26 -12
- package/dist/es/calendar/components/CalendarCell.js +7 -3
- package/dist/es/calendar/components/CalendarHeaderTitle.js +7 -3
- package/dist/es/calendar/components/CalendarNavigationItem.js +7 -3
- package/dist/es/calendar/components/CalendarWeekCell.js +7 -3
- package/dist/es/calendar/components/Header.d.ts +5 -4
- package/dist/es/calendar/components/Header.js +8 -6
- package/dist/es/calendar/components/HorizontalViewList.d.ts +4 -4
- package/dist/es/calendar/components/HorizontalViewList.js +8 -5
- package/dist/es/calendar/components/MultiViewCalendar.d.ts +13 -13
- package/dist/es/calendar/components/MultiViewCalendar.js +24 -15
- package/dist/es/calendar/components/Navigation.d.ts +2 -2
- package/dist/es/calendar/components/Navigation.js +13 -6
- package/dist/es/calendar/components/TodayCommand.d.ts +3 -3
- package/dist/es/calendar/components/TodayCommand.js +10 -6
- package/dist/es/calendar/components/View.d.ts +11 -11
- package/dist/es/calendar/components/View.js +17 -13
- package/dist/es/calendar/components/ViewList.d.ts +9 -9
- package/dist/es/calendar/components/ViewList.js +19 -9
- package/dist/es/calendar/models/ActiveView.js +1 -0
- package/dist/es/calendar/models/CalendarSettings.js +1 -0
- package/dist/es/calendar/models/CellContext.js +1 -0
- package/dist/es/calendar/models/MultiViewCalendarMode.js +1 -0
- package/dist/es/calendar/models/MultiViewCalendarSettings.js +1 -0
- package/dist/es/calendar/models/SelectionRangeEnd.js +1 -0
- package/dist/es/calendar/models/ViewService.js +1 -0
- package/dist/es/calendar/services/BusViewService.js +1 -1
- package/dist/es/calendar/services/CenturyViewService.js +2 -2
- package/dist/es/calendar/services/DOMService.js +24 -6
- package/dist/es/calendar/services/DecadeViewService.js +2 -2
- package/dist/es/calendar/services/MonthViewService.js +2 -2
- package/dist/es/calendar/services/NavigationService.js +1 -1
- package/dist/es/calendar/services/ScrollSyncService.js +5 -1
- package/dist/es/calendar/services/YearViewService.js +2 -2
- package/dist/es/calendar/utils/ScrollSync.d.ts +3 -3
- package/dist/es/calendar/utils/ScrollSync.js +2 -0
- package/dist/es/dateinput/DateInput.d.ts +24 -20
- package/dist/es/dateinput/DateInput.js +32 -19
- package/dist/es/dateinput/models/DateInputSettings.js +1 -0
- package/dist/es/dateinput/models/format-placeholder.js +1 -0
- package/dist/es/dateinput/models/incremental-steps.js +1 -0
- package/dist/es/dateinput/models/kendo-date.d.ts +2 -2
- package/dist/es/dateinput/models/kendo-date.js +3 -3
- package/dist/es/dateinput/models/mask.js +1 -0
- package/dist/es/dateinput/models/selection.js +1 -0
- package/dist/es/dateinput/utils.d.ts +2 -2
- package/dist/es/datepicker/DatePicker.d.ts +25 -25
- package/dist/es/datepicker/DatePicker.js +28 -23
- package/dist/es/datepicker/models/DatePickerSettings.js +1 -0
- package/dist/es/datepicker/models/index.js +1 -0
- package/dist/es/daterangepicker/DateRangePicker.d.ts +16 -14
- package/dist/es/daterangepicker/DateRangePicker.js +16 -14
- package/dist/es/daterangepicker/models/DateRangePickerCalendarSettings.js +1 -0
- package/dist/es/daterangepicker/models/DateRangePickerDateInputSettings.js +1 -0
- package/dist/es/daterangepicker/models/DateRangePickerPopupSettings.js +1 -0
- package/dist/es/daterangepicker/models/DateRangePickerSettings.js +1 -0
- package/dist/es/daterangepicker/models/index.js +1 -0
- package/dist/es/datetimepicker/DateTimePicker.d.ts +19 -19
- package/dist/es/datetimepicker/DateTimePicker.js +33 -18
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +7 -7
- package/dist/es/datetimepicker/DateTimeSelector.js +17 -7
- package/dist/es/datetimepicker/models/DateTimePickerSettings.js +1 -0
- package/dist/es/datetimepicker/models/index.js +1 -0
- package/dist/es/hooks/usePickerFloatingLabel.d.ts +1 -1
- package/dist/es/messages/index.d.ts +21 -21
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.d.ts +8 -8
- package/dist/es/timepicker/TimeList.js +33 -13
- package/dist/es/timepicker/TimePart.d.ts +11 -11
- package/dist/es/timepicker/TimePart.js +14 -9
- package/dist/es/timepicker/TimePicker.d.ts +23 -23
- package/dist/es/timepicker/TimePicker.js +27 -22
- package/dist/es/timepicker/TimeSelector.d.ts +6 -6
- package/dist/es/timepicker/TimeSelector.js +11 -5
- package/dist/es/timepicker/models/IncrementalSteps.js +1 -0
- package/dist/es/timepicker/models/ListItem.js +1 -0
- package/dist/es/timepicker/models/ListService.js +1 -0
- package/dist/es/timepicker/models/ListServiceSettings.js +1 -0
- package/dist/es/timepicker/models/TimePickerSettings.js +1 -0
- package/dist/es/timepicker/services/DOMService.js +2 -0
- package/dist/es/timepicker/services/DayPeriodService.js +9 -3
- package/dist/es/timepicker/services/HoursService.js +14 -5
- package/dist/es/timepicker/services/MinutesService.js +12 -6
- package/dist/es/timepicker/services/SecondsService.js +12 -6
- package/dist/es/timepicker/utils.d.ts +4 -4
- package/dist/es/utils.d.ts +1 -1
- package/dist/es/utils.js +10 -1
- package/dist/es/virtualization/Virtualization.d.ts +9 -8
- package/dist/es/virtualization/Virtualization.js +23 -13
- package/dist/es/virtualization/services/RowHeightService.js +10 -1
- package/dist/es/virtualization/services/ScrollerService.js +9 -3
- package/dist/npm/calendar/components/Calendar.d.ts +10 -10
- package/dist/npm/calendar/components/Calendar.js +53 -38
- package/dist/npm/calendar/components/CalendarCell.js +9 -4
- package/dist/npm/calendar/components/CalendarHeaderTitle.js +8 -3
- package/dist/npm/calendar/components/CalendarNavigationItem.js +9 -4
- package/dist/npm/calendar/components/CalendarWeekCell.js +9 -4
- package/dist/npm/calendar/components/Header.d.ts +5 -4
- package/dist/npm/calendar/components/Header.js +11 -8
- package/dist/npm/calendar/components/HorizontalViewList.d.ts +4 -4
- package/dist/npm/calendar/components/HorizontalViewList.js +11 -7
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +13 -13
- package/dist/npm/calendar/components/MultiViewCalendar.js +62 -52
- package/dist/npm/calendar/components/Navigation.d.ts +2 -2
- package/dist/npm/calendar/components/Navigation.js +18 -10
- package/dist/npm/calendar/components/TodayCommand.d.ts +3 -3
- package/dist/npm/calendar/components/TodayCommand.js +16 -11
- package/dist/npm/calendar/components/View.d.ts +11 -11
- package/dist/npm/calendar/components/View.js +27 -22
- package/dist/npm/calendar/components/ViewList.d.ts +9 -9
- package/dist/npm/calendar/components/ViewList.js +29 -18
- package/dist/npm/calendar/models/CalendarViewEnum.js +1 -0
- package/dist/npm/calendar/models/NavigationAction.js +1 -0
- package/dist/npm/calendar/models/SelectionRange.js +1 -0
- package/dist/npm/calendar/models/index.js +4 -3
- package/dist/npm/calendar/services/BusViewService.js +3 -2
- package/dist/npm/calendar/services/CenturyViewService.js +40 -39
- package/dist/npm/calendar/services/DOMService.js +34 -15
- package/dist/npm/calendar/services/DecadeViewService.js +34 -33
- package/dist/npm/calendar/services/MonthViewService.js +38 -37
- package/dist/npm/calendar/services/NavigationService.js +2 -1
- package/dist/npm/calendar/services/ScrollSyncService.js +6 -1
- package/dist/npm/calendar/services/WeekNamesService.js +2 -1
- package/dist/npm/calendar/services/YearViewService.js +35 -34
- package/dist/npm/calendar/services/index.js +10 -9
- package/dist/npm/calendar/utils/ScrollSync.d.ts +3 -3
- package/dist/npm/calendar/utils/ScrollSync.js +2 -0
- package/dist/npm/common/PickerWrap.js +2 -1
- package/dist/npm/dateinput/DateInput.d.ts +24 -20
- package/dist/npm/dateinput/DateInput.js +51 -37
- package/dist/npm/dateinput/models/index.js +3 -2
- package/dist/npm/dateinput/models/kendo-date.d.ts +2 -2
- package/dist/npm/dateinput/models/kendo-date.js +15 -14
- package/dist/npm/dateinput/models/mask.js +2 -0
- package/dist/npm/dateinput/utils.d.ts +2 -2
- package/dist/npm/dateinput/utils.js +9 -4
- package/dist/npm/datepicker/DatePicker.d.ts +25 -25
- package/dist/npm/datepicker/DatePicker.js +42 -36
- package/dist/npm/datepicker/ToggleButton.js +1 -0
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +16 -14
- package/dist/npm/daterangepicker/DateRangePicker.js +34 -31
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +19 -19
- package/dist/npm/datetimepicker/DateTimePicker.js +46 -30
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +7 -7
- package/dist/npm/datetimepicker/DateTimeSelector.js +26 -15
- package/dist/npm/defaults.js +1 -0
- package/dist/npm/hooks/usePickerFloatingLabel.d.ts +1 -1
- package/dist/npm/hooks/usePickerFloatingLabel.js +6 -3
- package/dist/npm/main.js +22 -21
- package/dist/npm/messages/index.d.ts +21 -21
- package/dist/npm/messages/index.js +2 -1
- package/dist/npm/package-metadata.js +2 -1
- package/dist/npm/timepicker/TimeList.d.ts +8 -8
- package/dist/npm/timepicker/TimeList.js +39 -18
- package/dist/npm/timepicker/TimePart.d.ts +11 -11
- package/dist/npm/timepicker/TimePart.js +25 -19
- package/dist/npm/timepicker/TimePicker.d.ts +23 -23
- package/dist/npm/timepicker/TimePicker.js +43 -37
- package/dist/npm/timepicker/TimeSelector.d.ts +6 -6
- package/dist/npm/timepicker/TimeSelector.js +22 -15
- package/dist/npm/timepicker/models/TimePart.js +1 -0
- package/dist/npm/timepicker/models/index.js +2 -1
- package/dist/npm/timepicker/services/DOMService.js +7 -4
- package/dist/npm/timepicker/services/DayPeriodService.js +11 -4
- package/dist/npm/timepicker/services/HoursService.js +21 -11
- package/dist/npm/timepicker/services/MinutesService.js +17 -10
- package/dist/npm/timepicker/services/SecondsService.js +17 -10
- package/dist/npm/timepicker/services/index.js +6 -5
- package/dist/npm/timepicker/utils.d.ts +4 -4
- package/dist/npm/timepicker/utils.js +30 -20
- package/dist/npm/utils.d.ts +1 -1
- package/dist/npm/utils.js +43 -20
- package/dist/npm/virtualization/Virtualization.d.ts +9 -8
- package/dist/npm/virtualization/Virtualization.js +27 -16
- package/dist/npm/virtualization/services/RowHeightService.js +11 -1
- package/dist/npm/virtualization/services/ScrollerService.js +10 -3
- package/dist/npm/virtualization/services/index.js +5 -4
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.MultiViewCalendar = exports.MultiViewCalendarPropsContext = exports.MultiViewCalendarWithoutContext = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var PropTypes = require("prop-types");
|
|
29
32
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
@@ -41,15 +44,15 @@ var TodayCommand_1 = require("./TodayCommand");
|
|
|
41
44
|
var extractDateFromValue = function (min, max, value) {
|
|
42
45
|
if (min === void 0) { min = MultiViewCalendarWithoutContext.defaultProps.min; }
|
|
43
46
|
if (max === void 0) { max = MultiViewCalendarWithoutContext.defaultProps.max; }
|
|
44
|
-
return value instanceof Date && !Array.isArray(value) && utils_1.isInRange(kendo_date_math_1.getDate(value), min, max)
|
|
45
|
-
? kendo_date_math_1.getDate(value)
|
|
47
|
+
return value instanceof Date && !Array.isArray(value) && (0, utils_1.isInRange)((0, kendo_date_math_1.getDate)(value), min, max)
|
|
48
|
+
? (0, kendo_date_math_1.getDate)(value)
|
|
46
49
|
: null;
|
|
47
50
|
};
|
|
48
51
|
var extractMultipleFromValue = function (min, max, value) {
|
|
49
52
|
if (min === void 0) { min = MultiViewCalendarWithoutContext.defaultProps.min; }
|
|
50
53
|
if (max === void 0) { max = MultiViewCalendarWithoutContext.defaultProps.max; }
|
|
51
54
|
return Array.isArray(value)
|
|
52
|
-
? value.filter(function (date) { return utils_1.isInRange(date, min, max); }).map(function (date) { return kendo_date_math_1.getDate(date); })
|
|
55
|
+
? value.filter(function (date) { return (0, utils_1.isInRange)(date, min, max); }).map(function (date) { return (0, kendo_date_math_1.getDate)(date); })
|
|
53
56
|
: null;
|
|
54
57
|
};
|
|
55
58
|
var extractRangeFromValue = function (value) {
|
|
@@ -72,12 +75,19 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
72
75
|
__extends(MultiViewCalendarWithoutContext, _super);
|
|
73
76
|
function MultiViewCalendarWithoutContext(props) {
|
|
74
77
|
var _this = _super.call(this, props) || this;
|
|
78
|
+
_this.dates = [];
|
|
75
79
|
_this.selectedDate = null;
|
|
76
80
|
_this.selectedMultiple = null;
|
|
77
81
|
_this.selectedRange = models_1.EMPTY_SELECTIONRANGE;
|
|
78
|
-
_this.
|
|
82
|
+
_this._focusedDate = new Date();
|
|
83
|
+
_this.cellUID = (0, kendo_react_common_1.guid)();
|
|
79
84
|
_this.activeRangeEnd = 'start';
|
|
80
|
-
_this.
|
|
85
|
+
_this._element = null;
|
|
86
|
+
_this.intl = null;
|
|
87
|
+
_this.localization = null;
|
|
88
|
+
_this.service = null;
|
|
89
|
+
_this.wrapperID = (0, kendo_react_common_1.guid)();
|
|
90
|
+
_this.calendarViewList = null;
|
|
81
91
|
_this.isActive = false;
|
|
82
92
|
_this.calculateFocusFromValue = true;
|
|
83
93
|
/**
|
|
@@ -127,7 +137,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
127
137
|
return _this.clampDate(_this.service.move(_this.focusedDate, action));
|
|
128
138
|
};
|
|
129
139
|
_this.clampDate = function (value) {
|
|
130
|
-
return utils_1.dateInRange(value, _this.min, _this.max);
|
|
140
|
+
return (0, utils_1.dateInRange)(value, _this.min, _this.max);
|
|
131
141
|
};
|
|
132
142
|
_this.shouldAutoCorrect = function (candidate, value) {
|
|
133
143
|
var end = value.end, start = value.start;
|
|
@@ -181,7 +191,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
181
191
|
if (!_this.todayIsInRange) {
|
|
182
192
|
return;
|
|
183
193
|
}
|
|
184
|
-
_this.handleDateChange
|
|
194
|
+
_this.handleDateChange(event);
|
|
185
195
|
};
|
|
186
196
|
_this.handlePrevButtonClick = function () {
|
|
187
197
|
_this.navigate(models_1.Action.PrevView);
|
|
@@ -198,11 +208,11 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
198
208
|
value: _this.focusedDate,
|
|
199
209
|
target: _this
|
|
200
210
|
};
|
|
201
|
-
_this.handleDateChange
|
|
211
|
+
_this.handleDateChange(args);
|
|
202
212
|
}
|
|
203
213
|
else {
|
|
204
|
-
var candidate = utils_1.dateInRange(_this.navigation.move(_this.focusedDate, _this.navigation.action(event), _this.state.activeView, _this.service, event), _this.min, _this.max);
|
|
205
|
-
if (kendo_date_math_1.isEqualDate(_this.focusedDate, candidate)) {
|
|
214
|
+
var candidate = (0, utils_1.dateInRange)(_this.navigation.move(_this.focusedDate, _this.navigation.action(event), _this.state.activeView, _this.service, event), _this.min, _this.max);
|
|
215
|
+
if ((0, kendo_date_math_1.isEqualDate)(_this.focusedDate, candidate)) {
|
|
206
216
|
return;
|
|
207
217
|
}
|
|
208
218
|
_this.calculateFocusFromValue = false;
|
|
@@ -216,7 +226,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
216
226
|
_this.setState({ activeView: view });
|
|
217
227
|
};
|
|
218
228
|
_this.handleDateChange = function (event) {
|
|
219
|
-
var focusedDate = kendo_date_math_1.cloneDate(event.value);
|
|
229
|
+
var focusedDate = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
220
230
|
var canNavigateDown = _this.bus.canMoveDown(_this.state.activeView);
|
|
221
231
|
if (_this.props.disabled) {
|
|
222
232
|
return;
|
|
@@ -235,28 +245,28 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
235
245
|
var value;
|
|
236
246
|
switch (_this.props.mode) {
|
|
237
247
|
case 'single':
|
|
238
|
-
value = kendo_date_math_1.cloneDate(event.value);
|
|
248
|
+
value = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
239
249
|
break;
|
|
240
250
|
case 'multiple':
|
|
241
251
|
if (Array.isArray(_this.selectedMultiple)) {
|
|
242
252
|
var result = _this.selectedMultiple.slice();
|
|
243
253
|
var index_1 = -1;
|
|
244
254
|
result.forEach(function (date, idx) {
|
|
245
|
-
if (kendo_date_math_1.isEqualDate(date, event.value)) {
|
|
255
|
+
if ((0, kendo_date_math_1.isEqualDate)(date, event.value)) {
|
|
246
256
|
index_1 = idx;
|
|
247
257
|
}
|
|
248
258
|
});
|
|
249
259
|
index_1 !== -1
|
|
250
260
|
? result.splice(index_1, 1)
|
|
251
|
-
: result.push(kendo_date_math_1.cloneDate(event.value));
|
|
261
|
+
: result.push((0, kendo_date_math_1.cloneDate)(event.value));
|
|
252
262
|
value = result.slice();
|
|
253
263
|
}
|
|
254
264
|
else {
|
|
255
265
|
if (_this.selectedDate) {
|
|
256
|
-
value = [kendo_date_math_1.cloneDate(_this.selectedDate), kendo_date_math_1.cloneDate(event.value)];
|
|
266
|
+
value = [(0, kendo_date_math_1.cloneDate)(_this.selectedDate), (0, kendo_date_math_1.cloneDate)(event.value)];
|
|
257
267
|
}
|
|
258
268
|
else {
|
|
259
|
-
value = [kendo_date_math_1.cloneDate(event.value)];
|
|
269
|
+
value = [(0, kendo_date_math_1.cloneDate)(event.value)];
|
|
260
270
|
}
|
|
261
271
|
}
|
|
262
272
|
break;
|
|
@@ -270,7 +280,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
270
280
|
_this.activeRangeEnd = _this.activeRange !== 'end' ? 'end' : 'start';
|
|
271
281
|
break;
|
|
272
282
|
default:
|
|
273
|
-
value = kendo_date_math_1.cloneDate(event.value);
|
|
283
|
+
value = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
274
284
|
break;
|
|
275
285
|
}
|
|
276
286
|
_this.valueDuringOnChange = value;
|
|
@@ -295,8 +305,8 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
295
305
|
var selectedMultiple = extractMultipleFromValue(_this.min, _this.max, value);
|
|
296
306
|
var selectedRange = extractRangeFromValue(value);
|
|
297
307
|
var calculatedFocus = extractFocusedDate(selectedDate, selectedMultiple, selectedRange);
|
|
298
|
-
var activeView = utils_1.viewInRange(models_1.CalendarViewEnum[props.defaultActiveView], _this.bottomView, _this.topView);
|
|
299
|
-
var focusedDate = utils_1.dateInRange(props.focusedDate || calculatedFocus || utils_1.getToday(), _this.min, _this.max);
|
|
308
|
+
var activeView = (0, utils_1.viewInRange)(models_1.CalendarViewEnum[props.defaultActiveView], _this.bottomView, _this.topView);
|
|
309
|
+
var focusedDate = (0, utils_1.dateInRange)(props.focusedDate || calculatedFocus || (0, utils_1.getToday)(), _this.min, _this.max);
|
|
300
310
|
_this.state = {
|
|
301
311
|
value: value,
|
|
302
312
|
activeView: activeView,
|
|
@@ -317,7 +327,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
317
327
|
get: function () {
|
|
318
328
|
return this._element;
|
|
319
329
|
},
|
|
320
|
-
enumerable:
|
|
330
|
+
enumerable: false,
|
|
321
331
|
configurable: true
|
|
322
332
|
});
|
|
323
333
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "value", {
|
|
@@ -331,7 +341,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
331
341
|
? this.props.value
|
|
332
342
|
: this.state.value;
|
|
333
343
|
},
|
|
334
|
-
enumerable:
|
|
344
|
+
enumerable: false,
|
|
335
345
|
configurable: true
|
|
336
346
|
});
|
|
337
347
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "focusedDate", {
|
|
@@ -339,27 +349,27 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
339
349
|
* Gets the current focused date of the MultiViewCalendar.
|
|
340
350
|
*/
|
|
341
351
|
get: function () {
|
|
342
|
-
return kendo_date_math_1.cloneDate(this._focusedDate);
|
|
352
|
+
return (0, kendo_date_math_1.cloneDate)(this._focusedDate);
|
|
343
353
|
},
|
|
344
|
-
enumerable:
|
|
354
|
+
enumerable: false,
|
|
345
355
|
configurable: true
|
|
346
356
|
});
|
|
347
357
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "min", {
|
|
348
358
|
get: function () {
|
|
349
|
-
return kendo_date_math_1.getDate(this.props.min !== undefined
|
|
359
|
+
return (0, kendo_date_math_1.getDate)(this.props.min !== undefined
|
|
350
360
|
? this.props.min
|
|
351
361
|
: MultiViewCalendarWithoutContext.defaultProps.min);
|
|
352
362
|
},
|
|
353
|
-
enumerable:
|
|
363
|
+
enumerable: false,
|
|
354
364
|
configurable: true
|
|
355
365
|
});
|
|
356
366
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "max", {
|
|
357
367
|
get: function () {
|
|
358
|
-
return kendo_date_math_1.getDate(this.props.max !== undefined
|
|
368
|
+
return (0, kendo_date_math_1.getDate)(this.props.max !== undefined
|
|
359
369
|
? this.props.max
|
|
360
370
|
: MultiViewCalendarWithoutContext.defaultProps.max);
|
|
361
371
|
},
|
|
362
|
-
enumerable:
|
|
372
|
+
enumerable: false,
|
|
363
373
|
configurable: true
|
|
364
374
|
});
|
|
365
375
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "bottomView", {
|
|
@@ -368,7 +378,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
368
378
|
? this.props.bottomView
|
|
369
379
|
: MultiViewCalendarWithoutContext.defaultProps.bottomView];
|
|
370
380
|
},
|
|
371
|
-
enumerable:
|
|
381
|
+
enumerable: false,
|
|
372
382
|
configurable: true
|
|
373
383
|
});
|
|
374
384
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "topView", {
|
|
@@ -377,7 +387,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
377
387
|
? this.props.topView
|
|
378
388
|
: MultiViewCalendarWithoutContext.defaultProps.topView];
|
|
379
389
|
},
|
|
380
|
-
enumerable:
|
|
390
|
+
enumerable: false,
|
|
381
391
|
configurable: true
|
|
382
392
|
});
|
|
383
393
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "activeRange", {
|
|
@@ -386,14 +396,14 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
386
396
|
? this.props.activeRangeEnd
|
|
387
397
|
: this.activeRangeEnd;
|
|
388
398
|
},
|
|
389
|
-
enumerable:
|
|
399
|
+
enumerable: false,
|
|
390
400
|
configurable: true
|
|
391
401
|
});
|
|
392
402
|
Object.defineProperty(MultiViewCalendarWithoutContext.prototype, "todayIsInRange", {
|
|
393
403
|
get: function () {
|
|
394
|
-
return utils_1.isInRange(utils_1.getToday(), kendo_date_math_1.getDate(this.min), kendo_date_math_1.getDate(this.max));
|
|
404
|
+
return (0, utils_1.isInRange)((0, utils_1.getToday)(), (0, kendo_date_math_1.getDate)(this.min), (0, kendo_date_math_1.getDate)(this.max));
|
|
395
405
|
},
|
|
396
|
-
enumerable:
|
|
406
|
+
enumerable: false,
|
|
397
407
|
configurable: true
|
|
398
408
|
});
|
|
399
409
|
/**
|
|
@@ -424,19 +434,19 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
424
434
|
if (this.props._ref) {
|
|
425
435
|
this.props._ref(this);
|
|
426
436
|
}
|
|
427
|
-
this.intl = kendo_react_intl_1.provideIntlService(this);
|
|
428
|
-
this.localization = kendo_react_intl_1.provideLocalizationService(this);
|
|
437
|
+
this.intl = (0, kendo_react_intl_1.provideIntlService)(this);
|
|
438
|
+
this.localization = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
429
439
|
this.bus.configure(this.bottomView, this.topView);
|
|
430
|
-
var activeView = utils_1.viewInRange(this.state.activeView, this.bottomView, this.topView);
|
|
440
|
+
var activeView = (0, utils_1.viewInRange)(this.state.activeView, this.bottomView, this.topView);
|
|
431
441
|
this.service = this.bus.service(activeView, this.intl);
|
|
432
442
|
this.selectedDate = extractDateFromValue(this.min, this.max, this.value);
|
|
433
443
|
this.selectedMultiple = extractMultipleFromValue(this.min, this.max, this.value);
|
|
434
444
|
this.selectedRange = extractRangeFromValue(this.value);
|
|
435
445
|
var calculatedFocus = extractFocusedDate(this.selectedDate, this.selectedMultiple, this.selectedRange);
|
|
436
|
-
this._focusedDate = utils_1.dateInRange(this.calculateFocusFromValue && calculatedFocus !== null
|
|
446
|
+
this._focusedDate = (0, utils_1.dateInRange)(this.calculateFocusFromValue && calculatedFocus !== null
|
|
437
447
|
? calculatedFocus
|
|
438
448
|
: this.state.focusedDate, this.min, this.max);
|
|
439
|
-
var wrapperClassName = kendo_react_common_1.classNames('k-widget k-calendar k-calendar-range', {
|
|
449
|
+
var wrapperClassName = (0, kendo_react_common_1.classNames)('k-widget k-calendar k-calendar-range', {
|
|
440
450
|
'k-disabled': this.props.disabled
|
|
441
451
|
}, this.props.className);
|
|
442
452
|
var visualizedRange = this.rangeWithFocused(this.selectedRange, this.focusedDate);
|
|
@@ -456,9 +466,9 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
456
466
|
if (!isDateInList || didViewChange || didViewsCountChange) {
|
|
457
467
|
this.dates = this.service.datesList(this.focusedDate, this.props.views || HorizontalViewList_1.HorizontalViewList.defaultProps.views);
|
|
458
468
|
}
|
|
459
|
-
var activeDate = kendo_date_math_1.cloneDate(this.dates && this.dates[0] ? this.dates[0] : utils_1.getToday());
|
|
469
|
+
var activeDate = (0, kendo_date_math_1.cloneDate)(this.dates && this.dates[0] ? this.dates[0] : (0, utils_1.getToday)());
|
|
460
470
|
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_1.Header, { key: ".kendo.calendar.header."
|
|
471
|
+
React.createElement(Header_1.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
472
|
React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-nav-prev", icon: "arrow-chevron-left", fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
|
|
463
473
|
React.createElement(TodayCommand_1.TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
|
|
464
474
|
React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-nav-next", icon: "arrow-chevron-right", fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
|
|
@@ -478,11 +488,11 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
478
488
|
className: PropTypes.string,
|
|
479
489
|
defaultActiveView: PropTypes.oneOf(['month', 'year', 'decade', 'century']),
|
|
480
490
|
defaultValue: PropTypes.oneOfType([
|
|
481
|
-
utils_1.nullable(PropTypes.instanceOf(Date)),
|
|
491
|
+
(0, utils_1.nullable)(PropTypes.instanceOf(Date)),
|
|
482
492
|
PropTypes.arrayOf(PropTypes.instanceOf(Date)),
|
|
483
493
|
PropTypes.shape({
|
|
484
|
-
start: utils_1.nullable(PropTypes.instanceOf(Date)),
|
|
485
|
-
end: utils_1.nullable(PropTypes.instanceOf(Date))
|
|
494
|
+
start: (0, utils_1.nullable)(PropTypes.instanceOf(Date)),
|
|
495
|
+
end: (0, utils_1.nullable)(PropTypes.instanceOf(Date))
|
|
486
496
|
})
|
|
487
497
|
]),
|
|
488
498
|
disabled: PropTypes.bool,
|
|
@@ -499,18 +509,18 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
499
509
|
tabIndex: PropTypes.number,
|
|
500
510
|
topView: PropTypes.oneOf(['month', 'year', 'decade', 'century']),
|
|
501
511
|
value: PropTypes.oneOfType([
|
|
502
|
-
utils_1.nullable(PropTypes.instanceOf(Date)),
|
|
512
|
+
(0, utils_1.nullable)(PropTypes.instanceOf(Date)),
|
|
503
513
|
PropTypes.arrayOf(PropTypes.instanceOf(Date)),
|
|
504
514
|
PropTypes.shape({
|
|
505
|
-
start: utils_1.nullable(PropTypes.instanceOf(Date).isRequired),
|
|
506
|
-
end: utils_1.nullable(PropTypes.instanceOf(Date).isRequired)
|
|
515
|
+
start: (0, utils_1.nullable)(PropTypes.instanceOf(Date).isRequired),
|
|
516
|
+
end: (0, utils_1.nullable)(PropTypes.instanceOf(Date).isRequired)
|
|
507
517
|
})
|
|
508
518
|
]),
|
|
509
519
|
views: function (props, propName, componentName) {
|
|
510
520
|
var views = props[propName];
|
|
511
521
|
if (views !== undefined && views < 1) {
|
|
512
|
-
return new Error("Invalid prop '"
|
|
513
|
-
|
|
522
|
+
return new Error("Invalid prop '".concat(propName, "' supplied to") +
|
|
523
|
+
"'".concat(componentName, "'. The '").concat(propName, "' property cannot be less than 1'"));
|
|
514
524
|
}
|
|
515
525
|
return null;
|
|
516
526
|
},
|
|
@@ -541,7 +551,7 @@ exports.MultiViewCalendarWithoutContext = MultiViewCalendarWithoutContext;
|
|
|
541
551
|
*
|
|
542
552
|
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
543
553
|
*/
|
|
544
|
-
exports.MultiViewCalendarPropsContext = kendo_react_common_1.createPropsContext();
|
|
554
|
+
exports.MultiViewCalendarPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
545
555
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
546
556
|
/**
|
|
547
557
|
* Represents the KendoReact MultiViewCalendar Component.
|
|
@@ -549,7 +559,7 @@ exports.MultiViewCalendarPropsContext = kendo_react_common_1.createPropsContext(
|
|
|
549
559
|
* Accepts properties of type [MultiViewCalendarProps]({% slug api_dateinputs_multiviewcalendarprops %}).
|
|
550
560
|
* Obtaining the `ref` returns an object of type [MultiViewCalendarHandle]({% slug api_dateinputs_multiviewcalendarhandle %}).
|
|
551
561
|
*/
|
|
552
|
-
exports.MultiViewCalendar = kendo_react_common_1.withPropsContext(exports.MultiViewCalendarPropsContext, MultiViewCalendarWithoutContext);
|
|
562
|
+
exports.MultiViewCalendar = (0, kendo_react_common_1.withPropsContext)(exports.MultiViewCalendarPropsContext, MultiViewCalendarWithoutContext);
|
|
553
563
|
exports.MultiViewCalendar.displayName = 'KendoReactMultiViewCalendar';
|
|
554
|
-
kendo_react_intl_1.registerForIntl(MultiViewCalendarWithoutContext);
|
|
555
|
-
kendo_react_intl_1.registerForLocalization(MultiViewCalendarWithoutContext);
|
|
564
|
+
(0, kendo_react_intl_1.registerForIntl)(MultiViewCalendarWithoutContext);
|
|
565
|
+
(0, kendo_react_intl_1.registerForLocalization)(MultiViewCalendarWithoutContext);
|
|
@@ -58,14 +58,14 @@ export declare class Navigation extends React.Component<NavigationProps, Navigat
|
|
|
58
58
|
private lastView;
|
|
59
59
|
private indexToScroll?;
|
|
60
60
|
private lastFocus;
|
|
61
|
-
protected
|
|
61
|
+
protected get take(): number;
|
|
62
62
|
constructor(props: NavigationProps);
|
|
63
63
|
/**
|
|
64
64
|
* @hidden
|
|
65
65
|
*/
|
|
66
66
|
componentDidUpdate(_prevProps: NavigationProps, _prevState: NavigationState): void;
|
|
67
67
|
render(): JSX.Element;
|
|
68
|
-
protected handleVirtualizationMount: (virtualization:
|
|
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;
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Navigation = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var PropTypes = require("prop-types");
|
|
29
32
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
@@ -38,12 +41,17 @@ var Navigation = /** @class */ (function (_super) {
|
|
|
38
41
|
__extends(Navigation, _super);
|
|
39
42
|
function Navigation(props) {
|
|
40
43
|
var _this = _super.call(this, props) || this;
|
|
44
|
+
_this.virtualization = null;
|
|
45
|
+
_this.list = null;
|
|
46
|
+
_this.itemHeight = 0;
|
|
41
47
|
_this.topOffset = 0;
|
|
48
|
+
_this.maxViewHeight = 0;
|
|
49
|
+
_this.bottomOffset = 0;
|
|
42
50
|
_this.handleVirtualizationMount = function (virtualization) {
|
|
43
51
|
_this.virtualization = virtualization;
|
|
44
52
|
if (_this.virtualization && _this.list) {
|
|
45
|
-
_this.list.style.transform = "translateY("
|
|
46
|
-
var viewDate = utils_1.dateInRange(_this.props.focusedDate, _this.props.min, _this.props.max);
|
|
53
|
+
_this.list.style.transform = "translateY(".concat(_this.topOffset, "px)");
|
|
54
|
+
var viewDate = (0, utils_1.dateInRange)(_this.props.focusedDate, _this.props.min, _this.props.max);
|
|
47
55
|
var indexToScroll = _this.props.service.skip(viewDate, _this.props.min);
|
|
48
56
|
_this.virtualization.scrollToIndex(indexToScroll);
|
|
49
57
|
}
|
|
@@ -51,7 +59,7 @@ var Navigation = /** @class */ (function (_super) {
|
|
|
51
59
|
_this.buildNavigationItem = function (date) {
|
|
52
60
|
var text = _this.props.service.navigationTitle(date);
|
|
53
61
|
var isRangeStart = _this.props.service.isRangeStart(date);
|
|
54
|
-
var uniqueID = "kendo-react-calendar-nav-item-"
|
|
62
|
+
var uniqueID = "kendo-react-calendar-nav-item-".concat(date.getTime());
|
|
55
63
|
var navigationItemProps = {
|
|
56
64
|
text: text,
|
|
57
65
|
value: date,
|
|
@@ -72,9 +80,9 @@ var Navigation = /** @class */ (function (_super) {
|
|
|
72
80
|
};
|
|
73
81
|
_this.handleDateChange = function (value, event) {
|
|
74
82
|
var onChange = _this.props.onChange;
|
|
75
|
-
if (onChange) {
|
|
83
|
+
if (onChange && event) {
|
|
76
84
|
var args = {
|
|
77
|
-
value: kendo_date_math_1.cloneDate(value),
|
|
85
|
+
value: (0, kendo_date_math_1.cloneDate)(value),
|
|
78
86
|
target: _this,
|
|
79
87
|
nativeEvent: event && event.nativeEvent,
|
|
80
88
|
syntheticEvent: event
|
|
@@ -89,7 +97,7 @@ var Navigation = /** @class */ (function (_super) {
|
|
|
89
97
|
_this.setState({ skip: skip });
|
|
90
98
|
}
|
|
91
99
|
if (_this.list && scrollAction) {
|
|
92
|
-
var translate = "translateY("
|
|
100
|
+
var translate = "translateY(".concat(scrollAction.offset, "px)");
|
|
93
101
|
_this.list.style.transform = translate;
|
|
94
102
|
}
|
|
95
103
|
};
|
|
@@ -108,7 +116,7 @@ var Navigation = /** @class */ (function (_super) {
|
|
|
108
116
|
? this.props.take
|
|
109
117
|
: Navigation.defaultProps.take;
|
|
110
118
|
},
|
|
111
|
-
enumerable:
|
|
119
|
+
enumerable: false,
|
|
112
120
|
configurable: true
|
|
113
121
|
});
|
|
114
122
|
/**
|
|
@@ -126,14 +134,14 @@ var Navigation = /** @class */ (function (_super) {
|
|
|
126
134
|
var _this = this;
|
|
127
135
|
this.calculateHeights();
|
|
128
136
|
var didViewChange = this.lastView !== this.props.activeView;
|
|
129
|
-
var focusedDate = utils_1.dateInRange(this.props.focusedDate, this.props.min, this.props.max);
|
|
137
|
+
var focusedDate = (0, utils_1.dateInRange)(this.props.focusedDate, this.props.min, this.props.max);
|
|
130
138
|
var skip = !didViewChange ? this.state.skip : this.props.service.skip(focusedDate, this.props.min);
|
|
131
139
|
var total = this.props.service.total(this.props.min, this.props.max);
|
|
132
140
|
var take = this.getTake(skip, total);
|
|
133
141
|
var viewDate = this.props.service.addToDate(this.props.min, skip);
|
|
134
142
|
var dates = this.props.service.datesList(viewDate, take);
|
|
135
143
|
if (this.props.activeView !== this.lastView
|
|
136
|
-
|| !kendo_date_math_1.isEqual(focusedDate, this.lastFocus)) {
|
|
144
|
+
|| !(0, kendo_date_math_1.isEqual)(focusedDate, this.lastFocus)) {
|
|
137
145
|
this.indexToScroll = this.props.service.skip(focusedDate, this.props.min);
|
|
138
146
|
}
|
|
139
147
|
var navigationBody = (React.createElement(Virtualization_1.Virtualization, { skip: skip, take: this.take, total: total, itemHeight: this.itemHeight, topOffset: this.topOffset, bottomOffset: this.bottomOffset, onScroll: this.props.onScroll, maxScrollDifference: this.maxViewHeight, onScrollAction: this.handleScrollAction, onMount: this.handleVirtualizationMount },
|
|
@@ -21,10 +21,10 @@ export declare class TodayCommand extends React.Component<TodayCommandProps> {
|
|
|
21
21
|
min: Date;
|
|
22
22
|
max: Date;
|
|
23
23
|
};
|
|
24
|
-
protected
|
|
25
|
-
protected
|
|
24
|
+
protected get min(): Date;
|
|
25
|
+
protected get max(): Date;
|
|
26
26
|
private localization;
|
|
27
|
-
protected
|
|
27
|
+
protected get todayIsInRange(): boolean;
|
|
28
28
|
private handleClick;
|
|
29
29
|
render(): JSX.Element;
|
|
30
30
|
}
|
|
@@ -3,16 +3,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
15
|
};
|
|
14
16
|
})();
|
|
15
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TodayCommand = void 0;
|
|
16
19
|
var React = require("react");
|
|
17
20
|
var PropTypes = require("prop-types");
|
|
18
21
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
@@ -25,18 +28,20 @@ var TodayCommand = /** @class */ (function (_super) {
|
|
|
25
28
|
__extends(TodayCommand, _super);
|
|
26
29
|
function TodayCommand() {
|
|
27
30
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
_this.localization = null;
|
|
28
32
|
_this.handleClick = function (syntheticEvent) {
|
|
29
33
|
if (!_this.todayIsInRange) {
|
|
30
34
|
return;
|
|
31
35
|
}
|
|
32
36
|
if (_this.props.onClick) {
|
|
33
|
-
|
|
37
|
+
var event_1 = {
|
|
34
38
|
syntheticEvent: syntheticEvent,
|
|
35
39
|
nativeEvent: syntheticEvent.nativeEvent,
|
|
36
|
-
value: utils_1.dateInRange(utils_1.getToday(), _this.min, _this.max),
|
|
40
|
+
value: (0, utils_1.dateInRange)((0, utils_1.getToday)(), _this.min, _this.max),
|
|
37
41
|
target: _this,
|
|
38
42
|
isTodayClick: true
|
|
39
|
-
}
|
|
43
|
+
};
|
|
44
|
+
_this.props.onClick.call(undefined, event_1);
|
|
40
45
|
}
|
|
41
46
|
};
|
|
42
47
|
return _this;
|
|
@@ -47,7 +52,7 @@ var TodayCommand = /** @class */ (function (_super) {
|
|
|
47
52
|
? this.props.min
|
|
48
53
|
: TodayCommand.defaultProps.min;
|
|
49
54
|
},
|
|
50
|
-
enumerable:
|
|
55
|
+
enumerable: false,
|
|
51
56
|
configurable: true
|
|
52
57
|
});
|
|
53
58
|
Object.defineProperty(TodayCommand.prototype, "max", {
|
|
@@ -56,20 +61,20 @@ var TodayCommand = /** @class */ (function (_super) {
|
|
|
56
61
|
? this.props.max
|
|
57
62
|
: TodayCommand.defaultProps.max;
|
|
58
63
|
},
|
|
59
|
-
enumerable:
|
|
64
|
+
enumerable: false,
|
|
60
65
|
configurable: true
|
|
61
66
|
});
|
|
62
67
|
Object.defineProperty(TodayCommand.prototype, "todayIsInRange", {
|
|
63
68
|
get: function () {
|
|
64
|
-
return utils_1.isInRange(utils_1.getToday(), kendo_date_math_1.getDate(this.min), kendo_date_math_1.getDate(this.max));
|
|
69
|
+
return (0, utils_1.isInRange)((0, utils_1.getToday)(), (0, kendo_date_math_1.getDate)(this.min), (0, kendo_date_math_1.getDate)(this.max));
|
|
65
70
|
},
|
|
66
|
-
enumerable:
|
|
71
|
+
enumerable: false,
|
|
67
72
|
configurable: true
|
|
68
73
|
});
|
|
69
74
|
TodayCommand.prototype.render = function () {
|
|
70
|
-
this.localization = kendo_react_intl_1.provideLocalizationService(this);
|
|
75
|
+
this.localization = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
71
76
|
var todayMessage = this.localization.toLanguageString(messages_1.today, messages_1.messages[messages_1.today]);
|
|
72
|
-
var todayClassNames = kendo_react_common_1.classNames('k-nav-today', {
|
|
77
|
+
var todayClassNames = (0, kendo_react_common_1.classNames)('k-nav-today', {
|
|
73
78
|
'k-disabled': this.props.disabled
|
|
74
79
|
});
|
|
75
80
|
return (React.createElement("span", { className: todayClassNames, onClick: this.handleClick }, todayMessage));
|
|
@@ -87,4 +92,4 @@ var TodayCommand = /** @class */ (function (_super) {
|
|
|
87
92
|
return TodayCommand;
|
|
88
93
|
}(React.Component));
|
|
89
94
|
exports.TodayCommand = TodayCommand;
|
|
90
|
-
kendo_react_intl_1.registerForLocalization(TodayCommand);
|
|
95
|
+
(0, kendo_react_intl_1.registerForLocalization)(TodayCommand);
|
|
@@ -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
|
|
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
|
};
|
|
@@ -67,18 +67,18 @@ export declare class View extends React.Component<ViewProps, {}> {
|
|
|
67
67
|
};
|
|
68
68
|
private intl;
|
|
69
69
|
private weekService;
|
|
70
|
-
protected
|
|
71
|
-
protected
|
|
72
|
-
protected
|
|
73
|
-
protected
|
|
74
|
-
protected
|
|
75
|
-
protected
|
|
70
|
+
protected get min(): Date;
|
|
71
|
+
protected get max(): Date;
|
|
72
|
+
protected get isHorizontal(): boolean;
|
|
73
|
+
protected get isMonthView(): boolean;
|
|
74
|
+
protected get weekNumber(): boolean;
|
|
75
|
+
protected get selectedDate(): Date | Date[] | null;
|
|
76
76
|
render(): JSX.Element;
|
|
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;
|
|
81
|
-
protected firstWeekDateContext: (rowCtx: CellContext[]) => CellContext;
|
|
80
|
+
protected firstDate: (row: any) => Date | null;
|
|
81
|
+
protected firstWeekDateContext: (rowCtx: CellContext[]) => CellContext | null;
|
|
82
82
|
private handleClick;
|
|
83
83
|
private handleMouseEnter;
|
|
84
84
|
private handleMouseLeave;
|