@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.
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/dist/es/calendar/components/Calendar.d.ts +4 -4
- package/dist/es/calendar/components/Calendar.js +17 -5
- package/dist/es/calendar/components/Header.d.ts +1 -0
- package/dist/es/calendar/components/Header.js +1 -1
- package/dist/es/calendar/components/HorizontalViewList.js +1 -0
- package/dist/es/calendar/components/MultiViewCalendar.d.ts +3 -3
- package/dist/es/calendar/components/MultiViewCalendar.js +12 -5
- package/dist/es/calendar/components/Navigation.d.ts +1 -1
- package/dist/es/calendar/components/Navigation.js +9 -4
- package/dist/es/calendar/components/TodayCommand.js +4 -2
- package/dist/es/calendar/components/View.d.ts +4 -4
- package/dist/es/calendar/components/View.js +7 -5
- package/dist/es/calendar/components/ViewList.d.ts +3 -3
- package/dist/es/calendar/components/ViewList.js +10 -2
- 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 +11 -7
- package/dist/es/dateinput/DateInput.js +14 -8
- package/dist/es/dateinput/models/kendo-date.js +1 -1
- package/dist/es/dateinput/models/mask.js +1 -0
- package/dist/es/dateinput/utils.d.ts +1 -1
- package/dist/es/datepicker/DatePicker.d.ts +8 -8
- package/dist/es/datepicker/DatePicker.js +4 -3
- package/dist/es/daterangepicker/DateRangePicker.d.ts +7 -5
- package/dist/es/datetimepicker/DateTimePicker.d.ts +7 -7
- package/dist/es/datetimepicker/DateTimePicker.js +3 -3
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +1 -1
- package/dist/es/datetimepicker/DateTimeSelector.js +5 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.d.ts +3 -3
- package/dist/es/timepicker/TimeList.js +25 -7
- package/dist/es/timepicker/TimePart.d.ts +4 -4
- package/dist/es/timepicker/TimePart.js +4 -1
- package/dist/es/timepicker/TimePicker.d.ts +8 -8
- package/dist/es/timepicker/TimePicker.js +4 -3
- package/dist/es/timepicker/TimeSelector.d.ts +2 -2
- package/dist/es/timepicker/TimeSelector.js +4 -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/utils.js +9 -5
- package/dist/es/virtualization/Virtualization.d.ts +2 -1
- package/dist/es/virtualization/Virtualization.js +14 -6
- package/dist/es/virtualization/services/RowHeightService.js +9 -5
- package/dist/es/virtualization/services/ScrollerService.js +9 -3
- package/dist/npm/calendar/components/Calendar.d.ts +4 -4
- package/dist/npm/calendar/components/Calendar.js +43 -31
- package/dist/npm/calendar/components/CalendarCell.js +1 -1
- package/dist/npm/calendar/components/CalendarNavigationItem.js +1 -1
- package/dist/npm/calendar/components/CalendarWeekCell.js +1 -1
- package/dist/npm/calendar/components/Header.d.ts +1 -0
- package/dist/npm/calendar/components/Header.js +3 -3
- package/dist/npm/calendar/components/HorizontalViewList.js +3 -2
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +3 -3
- package/dist/npm/calendar/components/MultiViewCalendar.js +49 -42
- package/dist/npm/calendar/components/Navigation.d.ts +1 -1
- package/dist/npm/calendar/components/Navigation.js +13 -8
- package/dist/npm/calendar/components/TodayCommand.js +9 -7
- package/dist/npm/calendar/components/View.d.ts +4 -4
- package/dist/npm/calendar/components/View.js +16 -14
- package/dist/npm/calendar/components/ViewList.d.ts +3 -3
- package/dist/npm/calendar/components/ViewList.js +19 -11
- package/dist/npm/calendar/services/BusViewService.js +1 -1
- package/dist/npm/calendar/services/CenturyViewService.js +38 -38
- package/dist/npm/calendar/services/DOMService.js +33 -15
- package/dist/npm/calendar/services/DecadeViewService.js +32 -32
- package/dist/npm/calendar/services/MonthViewService.js +36 -36
- package/dist/npm/calendar/services/NavigationService.js +1 -1
- package/dist/npm/calendar/services/ScrollSyncService.js +5 -1
- package/dist/npm/calendar/services/WeekNamesService.js +1 -1
- package/dist/npm/calendar/services/YearViewService.js +33 -33
- 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 +1 -1
- package/dist/npm/dateinput/DateInput.d.ts +11 -7
- package/dist/npm/dateinput/DateInput.js +32 -26
- package/dist/npm/dateinput/models/kendo-date.js +12 -12
- package/dist/npm/dateinput/models/mask.js +1 -0
- package/dist/npm/dateinput/utils.d.ts +1 -1
- package/dist/npm/datepicker/DatePicker.d.ts +8 -8
- package/dist/npm/datepicker/DatePicker.js +17 -16
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +7 -5
- package/dist/npm/daterangepicker/DateRangePicker.js +17 -17
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +7 -7
- package/dist/npm/datetimepicker/DateTimePicker.js +15 -15
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +1 -1
- package/dist/npm/datetimepicker/DateTimeSelector.js +13 -8
- package/dist/npm/hooks/usePickerFloatingLabel.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.d.ts +3 -3
- package/dist/npm/timepicker/TimeList.js +29 -11
- package/dist/npm/timepicker/TimePart.d.ts +4 -4
- package/dist/npm/timepicker/TimePart.js +14 -11
- package/dist/npm/timepicker/TimePicker.d.ts +8 -8
- package/dist/npm/timepicker/TimePicker.js +19 -18
- package/dist/npm/timepicker/TimeSelector.d.ts +2 -2
- package/dist/npm/timepicker/TimeSelector.js +14 -10
- package/dist/npm/timepicker/services/DOMService.js +6 -4
- package/dist/npm/timepicker/services/DayPeriodService.js +10 -4
- package/dist/npm/timepicker/services/HoursService.js +20 -11
- package/dist/npm/timepicker/services/MinutesService.js +16 -10
- package/dist/npm/timepicker/services/SecondsService.js +16 -10
- package/dist/npm/timepicker/utils.js +11 -11
- package/dist/npm/utils.js +16 -12
- package/dist/npm/virtualization/Virtualization.d.ts +2 -1
- package/dist/npm/virtualization/Virtualization.js +16 -8
- package/dist/npm/virtualization/services/RowHeightService.js +9 -5
- package/dist/npm/virtualization/services/ScrollerService.js +9 -3
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
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
|
-
|
|
88
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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;
|
package/dist/npm/utils.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
-
for (var i = 0,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6
10
|
};
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
12
|
exports.domContainerFactory = exports.dateInRange = exports.shiftWeekNames = exports.intersects = exports.range = exports.isInSelectionRange = exports.isInDateRange = exports.isInRange = exports.getToday = exports.setTime = exports.isValidRange = exports.MAX_TIME = exports.MIN_TIME = exports.MAX_DATE = exports.MIN_DATE = exports.MIDNIGHT_DATE = exports.viewInRange = exports.nullable = exports.isEqualRange = void 0;
|
|
@@ -18,7 +22,7 @@ var isEqualRange = function (initial, updated) {
|
|
|
18
22
|
if (initialStart === null || initialEnd === null || updatedStart === null || updatedEnd === null) {
|
|
19
23
|
return false;
|
|
20
24
|
}
|
|
21
|
-
return kendo_date_math_1.isEqual(initialStart, updatedStart) && kendo_date_math_1.isEqual(initialEnd, updatedEnd);
|
|
25
|
+
return (0, kendo_date_math_1.isEqual)(initialStart, updatedStart) && (0, kendo_date_math_1.isEqual)(initialEnd, updatedEnd);
|
|
22
26
|
};
|
|
23
27
|
exports.isEqualRange = isEqualRange;
|
|
24
28
|
// Polyfill for PropTypes.null
|
|
@@ -35,7 +39,7 @@ function nullable(subRequirement) {
|
|
|
35
39
|
return null;
|
|
36
40
|
}
|
|
37
41
|
var sub = required ? subRequirement.isRequired : subRequirement;
|
|
38
|
-
return sub.apply(void 0, __spreadArray([props, key], rest));
|
|
42
|
+
return sub.apply(void 0, __spreadArray([props, key], rest, false));
|
|
39
43
|
};
|
|
40
44
|
var fn = check.bind(null, false);
|
|
41
45
|
fn.isRequired = check.bind(null, true);
|
|
@@ -86,7 +90,7 @@ exports.isValidRange = isValidRange;
|
|
|
86
90
|
* @hidden
|
|
87
91
|
*/
|
|
88
92
|
var setTime = function (origin, candidate) {
|
|
89
|
-
var date = kendo_date_math_1.cloneDate(origin);
|
|
93
|
+
var date = (0, kendo_date_math_1.cloneDate)(origin);
|
|
90
94
|
date.setHours(candidate.getHours(), candidate.getMinutes(), candidate.getSeconds(), candidate.getMilliseconds());
|
|
91
95
|
return date;
|
|
92
96
|
};
|
|
@@ -94,7 +98,7 @@ exports.setTime = setTime;
|
|
|
94
98
|
/**
|
|
95
99
|
* @hidden
|
|
96
100
|
*/
|
|
97
|
-
var getToday = function () { return kendo_date_math_2.getDate(new Date()); };
|
|
101
|
+
var getToday = function () { return (0, kendo_date_math_2.getDate)(new Date()); };
|
|
98
102
|
exports.getToday = getToday;
|
|
99
103
|
/**
|
|
100
104
|
* @hidden
|
|
@@ -105,8 +109,8 @@ exports.isInRange = isInRange;
|
|
|
105
109
|
* @hidden
|
|
106
110
|
*/
|
|
107
111
|
var isInDateRange = function (candidate, min, max) { return (candidate === null
|
|
108
|
-
|| !((min && kendo_date_math_2.getDate(min) > kendo_date_math_2.getDate(candidate))
|
|
109
|
-
|| (max && kendo_date_math_2.getDate(max) < kendo_date_math_2.getDate(candidate)))); };
|
|
112
|
+
|| !((min && (0, kendo_date_math_2.getDate)(min) > (0, kendo_date_math_2.getDate)(candidate))
|
|
113
|
+
|| (max && (0, kendo_date_math_2.getDate)(max) < (0, kendo_date_math_2.getDate)(candidate)))); };
|
|
110
114
|
exports.isInDateRange = isInDateRange;
|
|
111
115
|
/**
|
|
112
116
|
* @hidden
|
|
@@ -151,10 +155,10 @@ var dateInRange = function (candidate, min, max) {
|
|
|
151
155
|
return candidate;
|
|
152
156
|
}
|
|
153
157
|
if (min && candidate < min) {
|
|
154
|
-
return kendo_date_math_1.cloneDate(min);
|
|
158
|
+
return (0, kendo_date_math_1.cloneDate)(min);
|
|
155
159
|
}
|
|
156
160
|
if (max && candidate > max) {
|
|
157
|
-
return kendo_date_math_1.cloneDate(max);
|
|
161
|
+
return (0, kendo_date_math_1.cloneDate)(max);
|
|
158
162
|
}
|
|
159
163
|
return candidate;
|
|
160
164
|
};
|
|
@@ -43,6 +43,7 @@ export interface VirtualizationProps {
|
|
|
43
43
|
topOffset: number;
|
|
44
44
|
total: number;
|
|
45
45
|
role?: string;
|
|
46
|
+
children?: React.ReactNode;
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
49
|
* @hidden
|
|
@@ -108,7 +109,7 @@ export declare class Virtualization extends React.Component<VirtualizationProps,
|
|
|
108
109
|
protected containerMaxScroll: () => number;
|
|
109
110
|
protected getContainerScrollDirection: (indexOffset: number) => ScrollDirection;
|
|
110
111
|
protected initServices: (props?: VirtualizationProps) => void;
|
|
111
|
-
protected getContainerProperty: (propertyName:
|
|
112
|
+
protected getContainerProperty: (propertyName: 'offsetHeight' | 'offsetWidth' | 'scrollHeight' | 'scrollWidth' | 'scrollTop' | 'scrollLeft') => number;
|
|
112
113
|
private handleScroll;
|
|
113
114
|
private handleScrollAction;
|
|
114
115
|
private handlePageAction;
|
|
@@ -52,7 +52,13 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
52
52
|
__extends(Virtualization, _super);
|
|
53
53
|
function Virtualization(props) {
|
|
54
54
|
var _this = _super.call(this, props) || this;
|
|
55
|
+
_this.rowHeightService = null;
|
|
56
|
+
_this.scrollContainer = null;
|
|
57
|
+
_this.lastDirection = null;
|
|
58
|
+
_this.lastTotal = 0;
|
|
59
|
+
_this.lastTake = 0;
|
|
55
60
|
_this.animationInProgress = false;
|
|
61
|
+
_this.scrollToIndexTimeout = 0;
|
|
56
62
|
_this.scrollTo = function (value) {
|
|
57
63
|
var scrollProperty = _this.direction === 'vertical' ? 'scrollTop' : 'scrollLeft';
|
|
58
64
|
if (!_this.scrollContainer) {
|
|
@@ -69,7 +75,9 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
69
75
|
}
|
|
70
76
|
_this.scrollToIndexTimeout = window.requestAnimationFrame(function () {
|
|
71
77
|
_this.animationInProgress = false;
|
|
72
|
-
|
|
78
|
+
if (_this.rowHeightService) {
|
|
79
|
+
_this.scrollTo(_this.rowHeightService.offset(index));
|
|
80
|
+
}
|
|
73
81
|
});
|
|
74
82
|
};
|
|
75
83
|
_this.animateToIndex = function (index) {
|
|
@@ -109,12 +117,12 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
109
117
|
};
|
|
110
118
|
_this.scrollRange = function (indexOffset, direction) {
|
|
111
119
|
var containerScroll = _this.containerScrollPosition;
|
|
112
|
-
if (parseInt(""
|
|
120
|
+
if (parseInt("".concat(indexOffset), 10) === parseInt("".concat(containerScroll), 10)) {
|
|
113
121
|
return { start: indexOffset, end: indexOffset };
|
|
114
122
|
}
|
|
115
123
|
var maxScroll = _this.containerMaxScroll();
|
|
116
124
|
var sign = direction === ScrollDirection.Backward ? 1 : -1;
|
|
117
|
-
var difference = differenceToScroll(containerScroll, indexOffset, _this.props.maxScrollDifference);
|
|
125
|
+
var difference = differenceToScroll(containerScroll, indexOffset, _this.props.maxScrollDifference || 0);
|
|
118
126
|
var end = Math.min(indexOffset, maxScroll);
|
|
119
127
|
var start = Math.min(Math.max(end + (sign * difference), 0), maxScroll);
|
|
120
128
|
return { start: start, end: end };
|
|
@@ -268,14 +276,14 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
268
276
|
this.lastDirection = this.direction;
|
|
269
277
|
this.lastTake = this.props.take;
|
|
270
278
|
}
|
|
271
|
-
var vertexLength = ""
|
|
279
|
+
var vertexLength = "".concat((this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + this.props.bottomOffset);
|
|
272
280
|
var placeholderStyle = this.direction === 'vertical'
|
|
273
|
-
? { height: vertexLength
|
|
274
|
-
: { width: vertexLength
|
|
275
|
-
var rootClassNames = kendo_react_common_1.classNames('k-content k-calendar-content k-scrollable', {
|
|
281
|
+
? { height: "".concat(vertexLength, "px") }
|
|
282
|
+
: { width: "".concat(vertexLength, "px") };
|
|
283
|
+
var rootClassNames = (0, kendo_react_common_1.classNames)('k-content k-calendar-content k-scrollable', {
|
|
276
284
|
'k-scrollable-horizontal': this.direction === 'horizontal'
|
|
277
285
|
}, this.props.className);
|
|
278
|
-
var scrollableClassNames = kendo_react_common_1.classNames('k-scrollable-placeholder', {
|
|
286
|
+
var scrollableClassNames = (0, kendo_react_common_1.classNames)('k-scrollable-placeholder', {
|
|
279
287
|
'k-scrollable-horizontal-placeholder': this.direction === 'horizontal'
|
|
280
288
|
});
|
|
281
289
|
return (React.createElement("div", { ref: function (el) { _this.scrollContainer = el; }, onScroll: this.handleScroll, className: rootClassNames, tabIndex: this.props.tabIndex, role: this.props.role },
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
-
for (var i = 0,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6
10
|
};
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
12
|
exports.RowHeightService = void 0;
|
|
9
13
|
/**
|
|
10
14
|
* @hidden
|
|
11
15
|
*/
|
|
12
|
-
var update = function (arr, idx, value) { return (__spreadArray(__spreadArray([], arr.slice(0, idx + 1)), (arr.slice(idx + 1).map(function (x) { return x + value; })))); };
|
|
16
|
+
var update = function (arr, idx, value) { return (__spreadArray(__spreadArray([], arr.slice(0, idx + 1), true), (arr.slice(idx + 1).map(function (x) { return x + value; })), true)); };
|
|
13
17
|
/**
|
|
14
18
|
* @hidden
|
|
15
19
|
*/
|
|
@@ -29,7 +29,13 @@ var ScrollerService = /** @class */ (function () {
|
|
|
29
29
|
function ScrollerService(onScrollAction, onPageAction) {
|
|
30
30
|
this.onScrollAction = onScrollAction;
|
|
31
31
|
this.onPageAction = onPageAction;
|
|
32
|
+
this.direction = 'vertical';
|
|
32
33
|
this.firstLoaded = 0;
|
|
34
|
+
this.lastLoaded = 0;
|
|
35
|
+
this.lastScrollTop = 0;
|
|
36
|
+
this.take = 0;
|
|
37
|
+
this.total = 0;
|
|
38
|
+
this.rowHeightService = null;
|
|
33
39
|
this.bottomOffset = 0;
|
|
34
40
|
this.topOffset = 0;
|
|
35
41
|
}
|
|
@@ -55,7 +61,7 @@ var ScrollerService = /** @class */ (function () {
|
|
|
55
61
|
var scrollLeft = _a.scrollLeft, scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight, offsetWidth = _a.offsetWidth;
|
|
56
62
|
var scrollPosition = this.direction === 'vertical' ? scrollTop : scrollLeft;
|
|
57
63
|
var offsetSize = this.direction === 'vertical' ? offsetHeight : offsetWidth;
|
|
58
|
-
if (this.lastScrollTop === scrollPosition) {
|
|
64
|
+
if (this.lastScrollTop === scrollPosition || !this.rowHeightService) {
|
|
59
65
|
return;
|
|
60
66
|
}
|
|
61
67
|
var up = this.lastScrollTop >= scrollPosition;
|
|
@@ -77,10 +83,10 @@ var ScrollerService = /** @class */ (function () {
|
|
|
77
83
|
}
|
|
78
84
|
};
|
|
79
85
|
ScrollerService.prototype.rowOffset = function (index) {
|
|
80
|
-
return this.rowHeightService.offset(index) + this.topOffset;
|
|
86
|
+
return this.rowHeightService ? this.rowHeightService.offset(index) + this.topOffset : 0;
|
|
81
87
|
};
|
|
82
88
|
ScrollerService.prototype.rowsForHeight = function (height) {
|
|
83
|
-
return Math.ceil(height / this.rowHeightService.height(0));
|
|
89
|
+
return this.rowHeightService ? Math.ceil(height / this.rowHeightService.height(0)) : 0;
|
|
84
90
|
};
|
|
85
91
|
return ScrollerService;
|
|
86
92
|
}());
|