@progress/kendo-react-dateinputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206061009
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.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.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/dateinput/DateInput.d.ts +11 -7
- package/dist/es/dateinput/DateInput.js +14 -8
- package/dist/es/dateinput/models/mask.js +1 -0
- package/dist/es/datepicker/DatePicker.d.ts +8 -8
- package/dist/es/datepicker/DatePicker.js +4 -3
- package/dist/es/daterangepicker/DateRangePicker.d.ts +3 -3
- 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 +3 -3
- package/dist/es/timepicker/TimePart.js +4 -1
- package/dist/es/timepicker/TimePicker.d.ts +7 -7
- 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 +1 -0
- package/dist/es/virtualization/Virtualization.js +13 -5
- 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.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.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/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 +11 -11
- package/dist/npm/dateinput/models/mask.js +1 -0
- package/dist/npm/datepicker/DatePicker.d.ts +8 -8
- package/dist/npm/datepicker/DatePicker.js +17 -16
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +3 -3
- 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 +3 -3
- package/dist/npm/timepicker/TimePart.js +14 -11
- package/dist/npm/timepicker/TimePicker.d.ts +7 -7
- 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 +1 -0
- package/dist/npm/virtualization/Virtualization.js +15 -7
- 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
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
|
};
|
|
@@ -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,7 +117,7 @@ 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();
|
|
@@ -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
|
}());
|