@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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBiggerThanMax = exports.isSmallerThanMin = exports.isInRange = exports.isInTimeRange = exports.timeInRange = exports.range = exports.getNow = exports.setSeconds = exports.setMinutes = exports.setHours = exports.snapTime = exports.valueMerger = exports.generateSnappers = exports.generateGetters = void 0;
|
|
3
4
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
4
5
|
var TimePart_1 = require("./models/TimePart");
|
|
5
6
|
var utils_1 = require("../utils");
|
|
6
7
|
var setter = function (method) { return function (date, value) {
|
|
7
|
-
var clone = kendo_date_math_1.cloneDate(date);
|
|
8
|
+
var clone = (0, kendo_date_math_1.cloneDate)(date);
|
|
8
9
|
clone[method](value);
|
|
9
10
|
return clone;
|
|
10
11
|
}; };
|
|
@@ -47,18 +48,20 @@ exports.generateSnappers = snappersFactory(defaultGetters);
|
|
|
47
48
|
/**
|
|
48
49
|
* @hidden
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
var valueMerger = function (getters) { return function (origin, candidate) {
|
|
51
52
|
origin.setHours.apply(origin, getters.map(function (g) { return g(origin, candidate); }));
|
|
52
53
|
return origin;
|
|
53
54
|
}; };
|
|
55
|
+
exports.valueMerger = valueMerger;
|
|
54
56
|
/**
|
|
55
57
|
* @hidden
|
|
56
58
|
*/
|
|
57
|
-
|
|
58
|
-
var date = kendo_date_math_1.cloneDate(candidate);
|
|
59
|
+
var snapTime = function (snappers) { return function (candidate) {
|
|
60
|
+
var date = (0, kendo_date_math_1.cloneDate)(candidate);
|
|
59
61
|
date.setHours.apply(date, snappers.map(function (s) { return s(date); }));
|
|
60
62
|
return date;
|
|
61
63
|
}; };
|
|
64
|
+
exports.snapTime = snapTime;
|
|
62
65
|
/**
|
|
63
66
|
* @hidden
|
|
64
67
|
*/
|
|
@@ -74,11 +77,12 @@ exports.setSeconds = setter('setSeconds');
|
|
|
74
77
|
/**
|
|
75
78
|
* @hidden
|
|
76
79
|
*/
|
|
77
|
-
|
|
80
|
+
var getNow = function () { return new Date(); };
|
|
81
|
+
exports.getNow = getNow;
|
|
78
82
|
/**
|
|
79
83
|
* @hidden
|
|
80
84
|
*/
|
|
81
|
-
|
|
85
|
+
var range = function (start, end, step) {
|
|
82
86
|
if (step === void 0) { step = 1; }
|
|
83
87
|
var result = [];
|
|
84
88
|
for (var i = start; i < end; i = i + step) {
|
|
@@ -86,66 +90,72 @@ exports.range = function (start, end, step) {
|
|
|
86
90
|
}
|
|
87
91
|
return result;
|
|
88
92
|
};
|
|
93
|
+
exports.range = range;
|
|
89
94
|
var normalizeTimes = function (candidate, min, max) { return ({
|
|
90
|
-
candidateValue: utils_1.setTime(utils_1.MIDNIGHT_DATE, candidate),
|
|
91
|
-
maxValue: kendo_date_math_1.addDays(utils_1.setTime(utils_1.MIDNIGHT_DATE, max), min.getHours() < max.getHours() ? 0 : 1),
|
|
92
|
-
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)
|
|
93
98
|
}); };
|
|
94
99
|
/**
|
|
95
100
|
* @hidden
|
|
96
101
|
*/
|
|
97
|
-
|
|
102
|
+
var timeInRange = function (candidate, min, max) {
|
|
98
103
|
if (!candidate || !min || !max) {
|
|
99
104
|
return candidate;
|
|
100
105
|
}
|
|
101
106
|
var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;
|
|
102
107
|
if (candidateValue < minValue) {
|
|
103
|
-
return utils_1.setTime(candidate, min);
|
|
108
|
+
return (0, utils_1.setTime)(candidate, min);
|
|
104
109
|
}
|
|
105
110
|
if (candidateValue > maxValue) {
|
|
106
|
-
return utils_1.setTime(candidate, max);
|
|
111
|
+
return (0, utils_1.setTime)(candidate, max);
|
|
107
112
|
}
|
|
108
113
|
return candidate;
|
|
109
114
|
};
|
|
115
|
+
exports.timeInRange = timeInRange;
|
|
110
116
|
/**
|
|
111
117
|
* @hidden
|
|
112
118
|
*/
|
|
113
|
-
|
|
119
|
+
var isInTimeRange = function (candidate, min, max) {
|
|
114
120
|
if (!candidate || !min || !max) {
|
|
115
121
|
return true;
|
|
116
122
|
}
|
|
117
123
|
var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;
|
|
118
124
|
return minValue <= candidateValue && candidateValue <= maxValue;
|
|
119
125
|
};
|
|
126
|
+
exports.isInTimeRange = isInTimeRange;
|
|
120
127
|
/**
|
|
121
128
|
* @hidden
|
|
122
129
|
*/
|
|
123
|
-
|
|
130
|
+
var isInRange = function (candidate, min, max) {
|
|
124
131
|
if (candidate === null) {
|
|
125
132
|
return true;
|
|
126
133
|
}
|
|
127
134
|
var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;
|
|
128
135
|
return minValue <= candidateValue && candidateValue <= maxValue;
|
|
129
136
|
};
|
|
137
|
+
exports.isInRange = isInRange;
|
|
130
138
|
/**
|
|
131
139
|
* @hidden
|
|
132
140
|
*/
|
|
133
|
-
|
|
141
|
+
var isSmallerThanMin = function (val, min) {
|
|
134
142
|
if (val === null || min === null) {
|
|
135
143
|
return false;
|
|
136
144
|
}
|
|
137
|
-
var normalizedValue = utils_1.setTime(utils_1.MIDNIGHT_DATE, val);
|
|
138
|
-
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);
|
|
139
147
|
return normalizedValue.getTime() < normalizedMin.getHours();
|
|
140
148
|
};
|
|
149
|
+
exports.isSmallerThanMin = isSmallerThanMin;
|
|
141
150
|
/**
|
|
142
151
|
* @hidden
|
|
143
152
|
*/
|
|
144
|
-
|
|
153
|
+
var isBiggerThanMax = function (val, max) {
|
|
145
154
|
if (val === null || max === null) {
|
|
146
155
|
return false;
|
|
147
156
|
}
|
|
148
|
-
var normalizedValue = utils_1.setTime(utils_1.MIDNIGHT_DATE, val);
|
|
149
|
-
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);
|
|
150
159
|
return normalizedMax.getTime() < normalizedValue.getHours();
|
|
151
160
|
};
|
|
161
|
+
exports.isBiggerThanMax = isBiggerThanMax;
|
package/dist/npm/utils.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const isInRange: (candidate: Date, min: Date, max: Date) => boole
|
|
|
51
51
|
/**
|
|
52
52
|
* @hidden
|
|
53
53
|
*/
|
|
54
|
-
export declare const isInDateRange: (candidate: Date, min: Date, max: Date) => boolean;
|
|
54
|
+
export declare const isInDateRange: (candidate: Date | null, min: Date, max: Date) => boolean;
|
|
55
55
|
/**
|
|
56
56
|
* @hidden
|
|
57
57
|
*/
|
package/dist/npm/utils.js
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
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));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
13
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
4
14
|
var kendo_date_math_2 = require("@progress/kendo-date-math");
|
|
5
15
|
var SelectionRange_1 = require("./calendar/models/SelectionRange");
|
|
6
16
|
/**
|
|
7
17
|
* @hidden
|
|
8
18
|
*/
|
|
9
|
-
|
|
19
|
+
var isEqualRange = function (initial, updated) {
|
|
10
20
|
var _a = initial || SelectionRange_1.EMPTY_SELECTIONRANGE, initialStart = _a.start, initialEnd = _a.end;
|
|
11
21
|
var _b = updated || SelectionRange_1.EMPTY_SELECTIONRANGE, updatedStart = _b.start, updatedEnd = _b.end;
|
|
12
22
|
if (initialStart === null || initialEnd === null || updatedStart === null || updatedEnd === null) {
|
|
13
23
|
return false;
|
|
14
24
|
}
|
|
15
|
-
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);
|
|
16
26
|
};
|
|
27
|
+
exports.isEqualRange = isEqualRange;
|
|
17
28
|
// Polyfill for PropTypes.null
|
|
18
29
|
/**
|
|
19
30
|
* @hidden
|
|
@@ -28,7 +39,7 @@ function nullable(subRequirement) {
|
|
|
28
39
|
return null;
|
|
29
40
|
}
|
|
30
41
|
var sub = required ? subRequirement.isRequired : subRequirement;
|
|
31
|
-
return sub.apply(void 0, [props, key]
|
|
42
|
+
return sub.apply(void 0, __spreadArray([props, key], rest, false));
|
|
32
43
|
};
|
|
33
44
|
var fn = check.bind(null, false);
|
|
34
45
|
fn.isRequired = check.bind(null, true);
|
|
@@ -38,7 +49,7 @@ exports.nullable = nullable;
|
|
|
38
49
|
/**
|
|
39
50
|
* @hidden
|
|
40
51
|
*/
|
|
41
|
-
|
|
52
|
+
var viewInRange = function (candidate, min, max) {
|
|
42
53
|
if (min === undefined || max === undefined) {
|
|
43
54
|
return candidate;
|
|
44
55
|
}
|
|
@@ -48,6 +59,7 @@ exports.viewInRange = function (candidate, min, max) {
|
|
|
48
59
|
? min
|
|
49
60
|
: max;
|
|
50
61
|
};
|
|
62
|
+
exports.viewInRange = viewInRange;
|
|
51
63
|
/**
|
|
52
64
|
* @hidden
|
|
53
65
|
*/
|
|
@@ -72,43 +84,49 @@ var isSet = function (value) { return value !== null && value !== undefined; };
|
|
|
72
84
|
/**
|
|
73
85
|
* @hidden
|
|
74
86
|
*/
|
|
75
|
-
|
|
87
|
+
var isValidRange = function (min, max) { return (!isSet(min) || !isSet(max) || min <= max); };
|
|
88
|
+
exports.isValidRange = isValidRange;
|
|
76
89
|
/**
|
|
77
90
|
* @hidden
|
|
78
91
|
*/
|
|
79
|
-
|
|
80
|
-
var date = kendo_date_math_1.cloneDate(origin);
|
|
92
|
+
var setTime = function (origin, candidate) {
|
|
93
|
+
var date = (0, kendo_date_math_1.cloneDate)(origin);
|
|
81
94
|
date.setHours(candidate.getHours(), candidate.getMinutes(), candidate.getSeconds(), candidate.getMilliseconds());
|
|
82
95
|
return date;
|
|
83
96
|
};
|
|
97
|
+
exports.setTime = setTime;
|
|
84
98
|
/**
|
|
85
99
|
* @hidden
|
|
86
100
|
*/
|
|
87
|
-
|
|
101
|
+
var getToday = function () { return (0, kendo_date_math_2.getDate)(new Date()); };
|
|
102
|
+
exports.getToday = getToday;
|
|
88
103
|
/**
|
|
89
104
|
* @hidden
|
|
90
105
|
*/
|
|
91
|
-
|
|
106
|
+
var isInRange = function (candidate, min, max) { return (!candidate || !((min && min > candidate) || (max && max < candidate))); };
|
|
107
|
+
exports.isInRange = isInRange;
|
|
92
108
|
/**
|
|
93
109
|
* @hidden
|
|
94
110
|
*/
|
|
95
|
-
|
|
96
|
-
|| !((min && kendo_date_math_2.getDate(min) > kendo_date_math_2.getDate(candidate))
|
|
97
|
-
|| (max && kendo_date_math_2.getDate(max) < kendo_date_math_2.getDate(candidate)))); };
|
|
111
|
+
var isInDateRange = function (candidate, min, max) { return (candidate === null
|
|
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)))); };
|
|
114
|
+
exports.isInDateRange = isInDateRange;
|
|
98
115
|
/**
|
|
99
116
|
* @hidden
|
|
100
117
|
*/
|
|
101
|
-
|
|
118
|
+
var isInSelectionRange = function (value, selectionRange) {
|
|
102
119
|
var _a = selectionRange || SelectionRange_1.EMPTY_SELECTIONRANGE, start = _a.start, end = _a.end;
|
|
103
120
|
if (!start || !end) {
|
|
104
121
|
return false;
|
|
105
122
|
}
|
|
106
123
|
return start < value && value < end;
|
|
107
124
|
};
|
|
125
|
+
exports.isInSelectionRange = isInSelectionRange;
|
|
108
126
|
/**
|
|
109
127
|
* @hidden
|
|
110
128
|
*/
|
|
111
|
-
|
|
129
|
+
var range = function (start, end, step) {
|
|
112
130
|
if (step === void 0) { step = 1; }
|
|
113
131
|
var result = [];
|
|
114
132
|
for (var i = start; i < end; i = i + step) {
|
|
@@ -116,35 +134,39 @@ exports.range = function (start, end, step) {
|
|
|
116
134
|
}
|
|
117
135
|
return result;
|
|
118
136
|
};
|
|
137
|
+
exports.range = range;
|
|
119
138
|
/**
|
|
120
139
|
* @hidden
|
|
121
140
|
*/
|
|
122
|
-
|
|
141
|
+
var intersects = function (date, min, max) {
|
|
123
142
|
return min.getTime() <= date.getTime() && date.getTime() <= max.getTime();
|
|
124
143
|
};
|
|
144
|
+
exports.intersects = intersects;
|
|
125
145
|
/**
|
|
126
146
|
* @hidden
|
|
127
147
|
*/
|
|
128
|
-
|
|
148
|
+
var shiftWeekNames = function (names, offset) { return (names.slice(offset).concat(names.slice(0, offset))); };
|
|
149
|
+
exports.shiftWeekNames = shiftWeekNames;
|
|
129
150
|
/**
|
|
130
151
|
* @hidden
|
|
131
152
|
*/
|
|
132
|
-
|
|
153
|
+
var dateInRange = function (candidate, min, max) {
|
|
133
154
|
if (!candidate) {
|
|
134
155
|
return candidate;
|
|
135
156
|
}
|
|
136
157
|
if (min && candidate < min) {
|
|
137
|
-
return kendo_date_math_1.cloneDate(min);
|
|
158
|
+
return (0, kendo_date_math_1.cloneDate)(min);
|
|
138
159
|
}
|
|
139
160
|
if (max && candidate > max) {
|
|
140
|
-
return kendo_date_math_1.cloneDate(max);
|
|
161
|
+
return (0, kendo_date_math_1.cloneDate)(max);
|
|
141
162
|
}
|
|
142
163
|
return candidate;
|
|
143
164
|
};
|
|
165
|
+
exports.dateInRange = dateInRange;
|
|
144
166
|
/**
|
|
145
167
|
* @hidden
|
|
146
168
|
*/
|
|
147
|
-
|
|
169
|
+
var domContainerFactory = function (type) { return function (children, classes, styles) {
|
|
148
170
|
if (classes === void 0) { classes = ''; }
|
|
149
171
|
if (styles === void 0) { styles = {}; }
|
|
150
172
|
var container = document.createElement(type);
|
|
@@ -158,3 +180,4 @@ exports.domContainerFactory = function (type) { return function (children, class
|
|
|
158
180
|
}
|
|
159
181
|
return container;
|
|
160
182
|
}; };
|
|
183
|
+
exports.domContainerFactory = domContainerFactory;
|
|
@@ -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
|
|
@@ -68,7 +69,7 @@ export declare class Virtualization extends React.Component<VirtualizationProps,
|
|
|
68
69
|
role: PropTypes.Requireable<string>;
|
|
69
70
|
};
|
|
70
71
|
static defaultProps: {
|
|
71
|
-
direction:
|
|
72
|
+
direction: Direction;
|
|
72
73
|
forceScroll: boolean;
|
|
73
74
|
scrollOffsetSize: number;
|
|
74
75
|
maxScrollDifference: number;
|
|
@@ -85,12 +86,12 @@ export declare class Virtualization extends React.Component<VirtualizationProps,
|
|
|
85
86
|
private lastTake;
|
|
86
87
|
private animationInProgress;
|
|
87
88
|
private scrollToIndexTimeout;
|
|
88
|
-
|
|
89
|
-
protected
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
protected
|
|
93
|
-
protected
|
|
89
|
+
get element(): HTMLDivElement | null;
|
|
90
|
+
protected get containerOffsetSize(): number;
|
|
91
|
+
get containerScrollSize(): number;
|
|
92
|
+
get containerScrollPosition(): number;
|
|
93
|
+
protected get direction(): Direction;
|
|
94
|
+
protected get scrollOffsetSize(): number;
|
|
94
95
|
constructor(props: VirtualizationProps);
|
|
95
96
|
activeIndex(): number;
|
|
96
97
|
itemIndex(offset: number): number;
|
|
@@ -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;
|
|
@@ -3,17 +3,20 @@ 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
17
|
var _a, _b, _c;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.Virtualization = exports.ScrollDirection = void 0;
|
|
17
20
|
var React = require("react");
|
|
18
21
|
var PropTypes = require("prop-types");
|
|
19
22
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -49,7 +52,13 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
49
52
|
__extends(Virtualization, _super);
|
|
50
53
|
function Virtualization(props) {
|
|
51
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;
|
|
52
60
|
_this.animationInProgress = false;
|
|
61
|
+
_this.scrollToIndexTimeout = 0;
|
|
53
62
|
_this.scrollTo = function (value) {
|
|
54
63
|
var scrollProperty = _this.direction === 'vertical' ? 'scrollTop' : 'scrollLeft';
|
|
55
64
|
if (!_this.scrollContainer) {
|
|
@@ -66,7 +75,9 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
66
75
|
}
|
|
67
76
|
_this.scrollToIndexTimeout = window.requestAnimationFrame(function () {
|
|
68
77
|
_this.animationInProgress = false;
|
|
69
|
-
|
|
78
|
+
if (_this.rowHeightService) {
|
|
79
|
+
_this.scrollTo(_this.rowHeightService.offset(index));
|
|
80
|
+
}
|
|
70
81
|
});
|
|
71
82
|
};
|
|
72
83
|
_this.animateToIndex = function (index) {
|
|
@@ -106,12 +117,12 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
106
117
|
};
|
|
107
118
|
_this.scrollRange = function (indexOffset, direction) {
|
|
108
119
|
var containerScroll = _this.containerScrollPosition;
|
|
109
|
-
if (parseInt(""
|
|
120
|
+
if (parseInt("".concat(indexOffset), 10) === parseInt("".concat(containerScroll), 10)) {
|
|
110
121
|
return { start: indexOffset, end: indexOffset };
|
|
111
122
|
}
|
|
112
123
|
var maxScroll = _this.containerMaxScroll();
|
|
113
124
|
var sign = direction === ScrollDirection.Backward ? 1 : -1;
|
|
114
|
-
var difference = differenceToScroll(containerScroll, indexOffset, _this.props.maxScrollDifference);
|
|
125
|
+
var difference = differenceToScroll(containerScroll, indexOffset, _this.props.maxScrollDifference || 0);
|
|
115
126
|
var end = Math.min(indexOffset, maxScroll);
|
|
116
127
|
var start = Math.min(Math.max(end + (sign * difference), 0), maxScroll);
|
|
117
128
|
return { start: start, end: end };
|
|
@@ -179,35 +190,35 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
179
190
|
get: function () {
|
|
180
191
|
return this.scrollContainer;
|
|
181
192
|
},
|
|
182
|
-
enumerable:
|
|
193
|
+
enumerable: false,
|
|
183
194
|
configurable: true
|
|
184
195
|
});
|
|
185
196
|
Object.defineProperty(Virtualization.prototype, "containerOffsetSize", {
|
|
186
197
|
get: function () {
|
|
187
198
|
return this.getContainerProperty(this.direction === 'vertical' ? 'offsetHeight' : 'offsetWidth');
|
|
188
199
|
},
|
|
189
|
-
enumerable:
|
|
200
|
+
enumerable: false,
|
|
190
201
|
configurable: true
|
|
191
202
|
});
|
|
192
203
|
Object.defineProperty(Virtualization.prototype, "containerScrollSize", {
|
|
193
204
|
get: function () {
|
|
194
205
|
return this.getContainerProperty(this.direction === 'vertical' ? 'scrollHeight' : 'scrollWidth');
|
|
195
206
|
},
|
|
196
|
-
enumerable:
|
|
207
|
+
enumerable: false,
|
|
197
208
|
configurable: true
|
|
198
209
|
});
|
|
199
210
|
Object.defineProperty(Virtualization.prototype, "containerScrollPosition", {
|
|
200
211
|
get: function () {
|
|
201
212
|
return this.getContainerProperty(this.direction === 'vertical' ? 'scrollTop' : 'scrollLeft');
|
|
202
213
|
},
|
|
203
|
-
enumerable:
|
|
214
|
+
enumerable: false,
|
|
204
215
|
configurable: true
|
|
205
216
|
});
|
|
206
217
|
Object.defineProperty(Virtualization.prototype, "direction", {
|
|
207
218
|
get: function () {
|
|
208
219
|
return this.props.direction !== undefined ? this.props.direction : Virtualization.defaultProps.direction;
|
|
209
220
|
},
|
|
210
|
-
enumerable:
|
|
221
|
+
enumerable: false,
|
|
211
222
|
configurable: true
|
|
212
223
|
});
|
|
213
224
|
Object.defineProperty(Virtualization.prototype, "scrollOffsetSize", {
|
|
@@ -215,7 +226,7 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
215
226
|
return this.props.scrollOffsetSize !== undefined
|
|
216
227
|
? this.props.scrollOffsetSize : Virtualization.defaultProps.scrollOffsetSize;
|
|
217
228
|
},
|
|
218
|
-
enumerable:
|
|
229
|
+
enumerable: false,
|
|
219
230
|
configurable: true
|
|
220
231
|
});
|
|
221
232
|
Virtualization.prototype.activeIndex = function () {
|
|
@@ -265,14 +276,14 @@ var Virtualization = /** @class */ (function (_super) {
|
|
|
265
276
|
this.lastDirection = this.direction;
|
|
266
277
|
this.lastTake = this.props.take;
|
|
267
278
|
}
|
|
268
|
-
var vertexLength = ""
|
|
279
|
+
var vertexLength = "".concat((this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + this.props.bottomOffset);
|
|
269
280
|
var placeholderStyle = this.direction === 'vertical'
|
|
270
|
-
? { height: vertexLength
|
|
271
|
-
: { width: vertexLength
|
|
272
|
-
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', {
|
|
273
284
|
'k-scrollable-horizontal': this.direction === 'horizontal'
|
|
274
285
|
}, this.props.className);
|
|
275
|
-
var scrollableClassNames = kendo_react_common_1.classNames('k-scrollable-placeholder', {
|
|
286
|
+
var scrollableClassNames = (0, kendo_react_common_1.classNames)('k-scrollable-placeholder', {
|
|
276
287
|
'k-scrollable-horizontal-placeholder': this.direction === 'horizontal'
|
|
277
288
|
});
|
|
278
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,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
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));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RowHeightService = void 0;
|
|
3
13
|
/**
|
|
4
14
|
* @hidden
|
|
5
15
|
*/
|
|
6
|
-
var update = function (arr, idx, value) { return (arr.slice(0, idx + 1)
|
|
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)); };
|
|
7
17
|
/**
|
|
8
18
|
* @hidden
|
|
9
19
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScrollerService = exports.PageAction = exports.ScrollAction = void 0;
|
|
3
4
|
var normalize = function (x) { return Math.max(x, 0); };
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
@@ -28,7 +29,13 @@ var ScrollerService = /** @class */ (function () {
|
|
|
28
29
|
function ScrollerService(onScrollAction, onPageAction) {
|
|
29
30
|
this.onScrollAction = onScrollAction;
|
|
30
31
|
this.onPageAction = onPageAction;
|
|
32
|
+
this.direction = 'vertical';
|
|
31
33
|
this.firstLoaded = 0;
|
|
34
|
+
this.lastLoaded = 0;
|
|
35
|
+
this.lastScrollTop = 0;
|
|
36
|
+
this.take = 0;
|
|
37
|
+
this.total = 0;
|
|
38
|
+
this.rowHeightService = null;
|
|
32
39
|
this.bottomOffset = 0;
|
|
33
40
|
this.topOffset = 0;
|
|
34
41
|
}
|
|
@@ -54,7 +61,7 @@ var ScrollerService = /** @class */ (function () {
|
|
|
54
61
|
var scrollLeft = _a.scrollLeft, scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight, offsetWidth = _a.offsetWidth;
|
|
55
62
|
var scrollPosition = this.direction === 'vertical' ? scrollTop : scrollLeft;
|
|
56
63
|
var offsetSize = this.direction === 'vertical' ? offsetHeight : offsetWidth;
|
|
57
|
-
if (this.lastScrollTop === scrollPosition) {
|
|
64
|
+
if (this.lastScrollTop === scrollPosition || !this.rowHeightService) {
|
|
58
65
|
return;
|
|
59
66
|
}
|
|
60
67
|
var up = this.lastScrollTop >= scrollPosition;
|
|
@@ -76,10 +83,10 @@ var ScrollerService = /** @class */ (function () {
|
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
85
|
ScrollerService.prototype.rowOffset = function (index) {
|
|
79
|
-
return this.rowHeightService.offset(index) + this.topOffset;
|
|
86
|
+
return this.rowHeightService ? this.rowHeightService.offset(index) + this.topOffset : 0;
|
|
80
87
|
};
|
|
81
88
|
ScrollerService.prototype.rowsForHeight = function (height) {
|
|
82
|
-
return Math.ceil(height / this.rowHeightService.height(0));
|
|
89
|
+
return this.rowHeightService ? Math.ceil(height / this.rowHeightService.height(0)) : 0;
|
|
83
90
|
};
|
|
84
91
|
return ScrollerService;
|
|
85
92
|
}());
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScrollerService = exports.ScrollAction = exports.RowHeightService = exports.PageAction = void 0;
|
|
3
4
|
var RowHeightService_1 = require("./RowHeightService");
|
|
4
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "RowHeightService", { enumerable: true, get: function () { return RowHeightService_1.RowHeightService; } });
|
|
5
6
|
var ScrollerService_1 = require("./ScrollerService");
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
8
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "PageAction", { enumerable: true, get: function () { return ScrollerService_1.PageAction; } });
|
|
8
|
+
Object.defineProperty(exports, "ScrollAction", { enumerable: true, get: function () { return ScrollerService_1.ScrollAction; } });
|
|
9
|
+
Object.defineProperty(exports, "ScrollerService", { enumerable: true, get: function () { return ScrollerService_1.ScrollerService; } });
|