@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
|
@@ -35,6 +35,14 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
35
35
|
__extends(ViewList, _super);
|
|
36
36
|
function ViewList(props) {
|
|
37
37
|
var _this = _super.call(this, props) || this;
|
|
38
|
+
_this.virtualization = null;
|
|
39
|
+
_this.calendarView = null;
|
|
40
|
+
_this.table = null;
|
|
41
|
+
_this.intl = null;
|
|
42
|
+
_this.bottomOffset = 0;
|
|
43
|
+
_this.viewOffset = 0;
|
|
44
|
+
_this.viewHeight = 0;
|
|
45
|
+
_this._element = null;
|
|
38
46
|
_this.isActive = false;
|
|
39
47
|
_this.animateToIndex = true;
|
|
40
48
|
_this.shouldScroll = false;
|
|
@@ -65,8 +73,8 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
65
73
|
_this.handleVirtualizationMount = function (virtualization) {
|
|
66
74
|
_this.virtualization = virtualization;
|
|
67
75
|
if (_this.virtualization && _this.table) {
|
|
68
|
-
_this.table.style.transform = "translateY("
|
|
69
|
-
var viewDate = utils_1.dateInRange(_this.props.focusedDate, _this.props.min, _this.props.max);
|
|
76
|
+
_this.table.style.transform = "translateY(".concat(_this.viewOffset, "px)");
|
|
77
|
+
var viewDate = (0, utils_1.dateInRange)(_this.props.focusedDate, _this.props.min, _this.props.max);
|
|
70
78
|
var indexToScroll = _this.props.service.skip(viewDate, _this.props.min);
|
|
71
79
|
_this.virtualization.scrollToIndex(indexToScroll);
|
|
72
80
|
}
|
|
@@ -106,7 +114,7 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
106
114
|
_this.setState({ index: index, skip: skip });
|
|
107
115
|
}
|
|
108
116
|
if (_this.table && scrollAction) {
|
|
109
|
-
var translate = "translateY("
|
|
117
|
+
var translate = "translateY(".concat(scrollAction.offset, "px)");
|
|
110
118
|
_this.table.style.transform = translate;
|
|
111
119
|
}
|
|
112
120
|
};
|
|
@@ -121,7 +129,7 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
121
129
|
var args = {
|
|
122
130
|
syntheticEvent: event.syntheticEvent,
|
|
123
131
|
nativeEvent: event.nativeEvent,
|
|
124
|
-
value: kendo_date_math_1.cloneDate(event.value),
|
|
132
|
+
value: (0, kendo_date_math_1.cloneDate)(event.value),
|
|
125
133
|
target: _this,
|
|
126
134
|
isTodayClick: isTodayClick
|
|
127
135
|
};
|
|
@@ -145,8 +153,8 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
145
153
|
});
|
|
146
154
|
Object.defineProperty(ViewList.prototype, "weekNames", {
|
|
147
155
|
get: function () {
|
|
148
|
-
this.intl = kendo_react_intl_1.provideIntlService(this);
|
|
149
|
-
var weekNames = utils_1.shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
|
|
156
|
+
this.intl = (0, kendo_react_intl_1.provideIntlService)(this);
|
|
157
|
+
var weekNames = (0, utils_1.shiftWeekNames)(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
|
|
150
158
|
return this.weekNumber ? [''].concat(weekNames) : weekNames;
|
|
151
159
|
},
|
|
152
160
|
enumerable: false,
|
|
@@ -175,7 +183,7 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
175
183
|
});
|
|
176
184
|
Object.defineProperty(ViewList.prototype, "todayIsInRange", {
|
|
177
185
|
get: function () {
|
|
178
|
-
return utils_1.isInRange(utils_1.getToday(), kendo_date_math_1.getDate(this.props.min), kendo_date_math_1.getDate(this.props.max));
|
|
186
|
+
return (0, utils_1.isInRange)((0, utils_1.getToday)(), (0, kendo_date_math_1.getDate)(this.props.min), (0, kendo_date_math_1.getDate)(this.props.max));
|
|
179
187
|
},
|
|
180
188
|
enumerable: false,
|
|
181
189
|
configurable: true
|
|
@@ -196,7 +204,7 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
196
204
|
var _this = this;
|
|
197
205
|
this.calculateHeights();
|
|
198
206
|
var didViewChange = this.lastView !== this.props.activeView;
|
|
199
|
-
var focusedDate = utils_1.dateInRange(this.props.focusedDate, this.props.min, this.props.max);
|
|
207
|
+
var focusedDate = (0, utils_1.dateInRange)(this.props.focusedDate, this.props.min, this.props.max);
|
|
200
208
|
var skip = !didViewChange ? this.state.skip : this.props.service.skip(focusedDate, this.props.min);
|
|
201
209
|
var total = this.props.service.total(this.props.min, this.props.max);
|
|
202
210
|
var take = this.getTake(skip, total);
|
|
@@ -206,13 +214,13 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
206
214
|
var didViewChanged = this.props.activeView !== this.lastView;
|
|
207
215
|
this.animateToIndex = !didViewChanged;
|
|
208
216
|
if (didViewChanged
|
|
209
|
-
|| !kendo_date_math_1.isEqualDate(this.lastFocus, focusedDate)
|
|
217
|
+
|| !(0, kendo_date_math_1.isEqualDate)(this.lastFocus, focusedDate)
|
|
210
218
|
|| this.shouldScroll
|
|
211
219
|
|| (!this.props.shouldScroll || this.props.shouldScroll())) {
|
|
212
220
|
this.indexToScroll = this.props.service.skip(focusedDate, this.props.min);
|
|
213
221
|
}
|
|
214
222
|
this.lastFocus = focusedDate;
|
|
215
|
-
var rootClassNames = kendo_react_common_1.classNames('k-calendar-view k-vstack', {
|
|
223
|
+
var rootClassNames = (0, kendo_react_common_1.classNames)('k-calendar-view k-vstack', {
|
|
216
224
|
'k-calendar-monthview': this.props.activeView === models_1.CalendarViewEnum.month,
|
|
217
225
|
'k-calendar-yearview': this.props.activeView === models_1.CalendarViewEnum.year,
|
|
218
226
|
'k-calendar-decadeview': this.props.activeView === models_1.CalendarViewEnum.decade,
|
|
@@ -249,4 +257,4 @@ var ViewList = /** @class */ (function (_super) {
|
|
|
249
257
|
return ViewList;
|
|
250
258
|
}(React.Component));
|
|
251
259
|
exports.ViewList = ViewList;
|
|
252
|
-
kendo_react_intl_1.registerForIntl(ViewList);
|
|
260
|
+
(0, kendo_react_intl_1.registerForIntl)(ViewList);
|
|
@@ -31,7 +31,7 @@ var BusViewService = /** @class */ (function () {
|
|
|
31
31
|
this.top = top;
|
|
32
32
|
};
|
|
33
33
|
BusViewService.prototype.service = function (view, intl) {
|
|
34
|
-
return new services[""
|
|
34
|
+
return new services["".concat(view)](intl);
|
|
35
35
|
};
|
|
36
36
|
BusViewService.prototype.moveDown = function (view, event) {
|
|
37
37
|
this.move(view, -1, event);
|
|
@@ -10,14 +10,14 @@ var EMPTY_DATA = [[]];
|
|
|
10
10
|
var CELLS_LENGTH = 4;
|
|
11
11
|
var ROWS_LENGTH = 3;
|
|
12
12
|
var ACTIONS = (_a = {},
|
|
13
|
-
_a[models_1.Action.Left] = function (date) { return kendo_date_math_1.addDecades(date, -1); },
|
|
14
|
-
_a[models_1.Action.Up] = function (date) { return kendo_date_math_1.addDecades(date, -5); },
|
|
15
|
-
_a[models_1.Action.Right] = function (date) { return kendo_date_math_1.addDecades(date, 1); },
|
|
16
|
-
_a[models_1.Action.Down] = function (date) { return kendo_date_math_1.addDecades(date, 5); },
|
|
17
|
-
_a[models_1.Action.PrevView] = function (date) { return kendo_date_math_1.addCenturies(date, -1); },
|
|
18
|
-
_a[models_1.Action.NextView] = function (date) { return kendo_date_math_1.addCenturies(date, 1); },
|
|
19
|
-
_a[models_1.Action.FirstInView] = function (date) { return kendo_date_math_1.firstDecadeOfCentury(date); },
|
|
20
|
-
_a[models_1.Action.LastInView] = function (date) { return kendo_date_math_1.lastDecadeOfCentury(date); },
|
|
13
|
+
_a[models_1.Action.Left] = function (date) { return (0, kendo_date_math_1.addDecades)(date, -1); },
|
|
14
|
+
_a[models_1.Action.Up] = function (date) { return (0, kendo_date_math_1.addDecades)(date, -5); },
|
|
15
|
+
_a[models_1.Action.Right] = function (date) { return (0, kendo_date_math_1.addDecades)(date, 1); },
|
|
16
|
+
_a[models_1.Action.Down] = function (date) { return (0, kendo_date_math_1.addDecades)(date, 5); },
|
|
17
|
+
_a[models_1.Action.PrevView] = function (date) { return (0, kendo_date_math_1.addCenturies)(date, -1); },
|
|
18
|
+
_a[models_1.Action.NextView] = function (date) { return (0, kendo_date_math_1.addCenturies)(date, 1); },
|
|
19
|
+
_a[models_1.Action.FirstInView] = function (date) { return (0, kendo_date_math_1.firstDecadeOfCentury)(date); },
|
|
20
|
+
_a[models_1.Action.LastInView] = function (date) { return (0, kendo_date_math_1.lastDecadeOfCentury)(date); },
|
|
21
21
|
_a);
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -26,10 +26,10 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
26
26
|
function CenturyViewService() {
|
|
27
27
|
}
|
|
28
28
|
CenturyViewService.prototype.addToDate = function (min, skip) {
|
|
29
|
-
return kendo_date_math_1.addCenturies(min, skip);
|
|
29
|
+
return (0, kendo_date_math_1.addCenturies)(min, skip);
|
|
30
30
|
};
|
|
31
31
|
CenturyViewService.prototype.datesList = function (start, count) {
|
|
32
|
-
return utils_1.range(0, count).map(function (i) { return kendo_date_math_1.addCenturies(start, i); });
|
|
32
|
+
return (0, utils_1.range)(0, count).map(function (i) { return (0, kendo_date_math_1.addCenturies)(start, i); });
|
|
33
33
|
};
|
|
34
34
|
CenturyViewService.prototype.data = function (options) {
|
|
35
35
|
var _this = this;
|
|
@@ -37,28 +37,28 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
37
37
|
if (!viewDate) {
|
|
38
38
|
return EMPTY_DATA;
|
|
39
39
|
}
|
|
40
|
-
var cells = utils_1.range(0, CELLS_LENGTH);
|
|
41
|
-
var firstDate = kendo_date_math_1.firstDecadeOfCentury(viewDate);
|
|
42
|
-
var lastDate = kendo_date_math_1.lastDecadeOfCentury(viewDate);
|
|
43
|
-
var today = utils_1.getToday();
|
|
44
|
-
return utils_1.range(0, ROWS_LENGTH).map(function (rowOffset) {
|
|
45
|
-
var baseDate = kendo_date_math_1.addDecades(firstDate, rowOffset * CELLS_LENGTH);
|
|
40
|
+
var cells = (0, utils_1.range)(0, CELLS_LENGTH);
|
|
41
|
+
var firstDate = (0, kendo_date_math_1.firstDecadeOfCentury)(viewDate);
|
|
42
|
+
var lastDate = (0, kendo_date_math_1.lastDecadeOfCentury)(viewDate);
|
|
43
|
+
var today = (0, utils_1.getToday)();
|
|
44
|
+
return (0, utils_1.range)(0, ROWS_LENGTH).map(function (rowOffset) {
|
|
45
|
+
var baseDate = (0, kendo_date_math_1.addDecades)(firstDate, rowOffset * CELLS_LENGTH);
|
|
46
46
|
return cells.map(function (cellOffset) {
|
|
47
|
-
var cellDate = _this.normalize(kendo_date_math_1.addDecades(baseDate, cellOffset), min, max);
|
|
47
|
+
var cellDate = _this.normalize((0, kendo_date_math_1.addDecades)(baseDate, cellOffset), min, max);
|
|
48
48
|
var isRangeStart = _this.isEqual(cellDate, selectionRange.start);
|
|
49
49
|
var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);
|
|
50
50
|
var isInMiddle = !isRangeStart && !isRangeEnd;
|
|
51
|
-
var isRangeMid = isInMiddle && utils_1.isInSelectionRange(cellDate, selectionRange);
|
|
51
|
+
var isRangeMid = isInMiddle && (0, utils_1.isInSelectionRange)(cellDate, selectionRange);
|
|
52
52
|
var isSelected = isActiveView && (!Array.isArray(selectedDate)
|
|
53
|
-
? utils_1.isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)
|
|
53
|
+
? (0, utils_1.isInRange)(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)
|
|
54
54
|
: _this.isSelectedFromArray(cellDate, selectedDate, min, max));
|
|
55
|
-
return utils_1.intersects(cellDate, firstDate, lastDate) ? ({
|
|
55
|
+
return (0, utils_1.intersects)(cellDate, firstDate, lastDate) ? ({
|
|
56
56
|
formattedValue: _this.value(cellDate),
|
|
57
|
-
id: ""
|
|
57
|
+
id: "".concat(cellUID).concat(cellDate.getTime()),
|
|
58
58
|
isFocused: _this.isEqual(cellDate, focusedDate),
|
|
59
59
|
isSelected: isSelected,
|
|
60
60
|
isWeekend: false,
|
|
61
|
-
isInRange: utils_1.isInRange(cellDate, min, max),
|
|
61
|
+
isInRange: (0, utils_1.isInRange)(cellDate, min, max),
|
|
62
62
|
isRangeStart: isRangeStart,
|
|
63
63
|
isRangeMid: isRangeMid,
|
|
64
64
|
isRangeEnd: isRangeEnd,
|
|
@@ -75,7 +75,7 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
75
75
|
var _this = this;
|
|
76
76
|
var result = false;
|
|
77
77
|
dates.forEach(function (date) {
|
|
78
|
-
if (utils_1.isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {
|
|
78
|
+
if ((0, utils_1.isInRange)(candidate, min, max) && _this.isEqual(candidate, date)) {
|
|
79
79
|
result = true;
|
|
80
80
|
}
|
|
81
81
|
});
|
|
@@ -86,7 +86,7 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
// TODO: double-check this!
|
|
89
|
-
return kendo_date_math_1.firstYearOfDecade(candidate).getFullYear() === kendo_date_math_1.firstYearOfDecade(expected).getFullYear();
|
|
89
|
+
return (0, kendo_date_math_1.firstYearOfDecade)(candidate).getFullYear() === (0, kendo_date_math_1.firstYearOfDecade)(expected).getFullYear();
|
|
90
90
|
};
|
|
91
91
|
CenturyViewService.prototype.isInArray = function (date, dates) {
|
|
92
92
|
if (!dates.length) {
|
|
@@ -96,13 +96,13 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
96
96
|
return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 99);
|
|
97
97
|
};
|
|
98
98
|
CenturyViewService.prototype.isInRange = function (candidate, min, max) {
|
|
99
|
-
var year = kendo_date_math_1.firstYearOfDecade(candidate).getFullYear();
|
|
100
|
-
var aboveMin = !min || kendo_date_math_1.firstYearOfDecade(min).getFullYear() <= year;
|
|
101
|
-
var belowMax = !max || year <= kendo_date_math_1.firstYearOfDecade(max).getFullYear();
|
|
99
|
+
var year = (0, kendo_date_math_1.firstYearOfDecade)(candidate).getFullYear();
|
|
100
|
+
var aboveMin = !min || (0, kendo_date_math_1.firstYearOfDecade)(min).getFullYear() <= year;
|
|
101
|
+
var belowMax = !max || year <= (0, kendo_date_math_1.firstYearOfDecade)(max).getFullYear();
|
|
102
102
|
return aboveMin && belowMax;
|
|
103
103
|
};
|
|
104
104
|
CenturyViewService.prototype.isInSameView = function (candidate, value) {
|
|
105
|
-
return kendo_date_math_1.durationInCenturies(candidate, value) === 0;
|
|
105
|
+
return (0, kendo_date_math_1.durationInCenturies)(candidate, value) === 0;
|
|
106
106
|
};
|
|
107
107
|
CenturyViewService.prototype.isRangeStart = function (value) {
|
|
108
108
|
return value.getFullYear() % 1000 === 0;
|
|
@@ -115,40 +115,40 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
115
115
|
return modifier(value);
|
|
116
116
|
};
|
|
117
117
|
CenturyViewService.prototype.cellTitle = function (value) {
|
|
118
|
-
return kendo_date_math_1.firstYearOfDecade(value).getFullYear().toString();
|
|
118
|
+
return (0, kendo_date_math_1.firstYearOfDecade)(value).getFullYear().toString();
|
|
119
119
|
};
|
|
120
120
|
CenturyViewService.prototype.navigationTitle = function (value) {
|
|
121
|
-
return value ? kendo_date_math_1.firstDecadeOfCentury(value).getFullYear().toString() : '';
|
|
121
|
+
return value ? (0, kendo_date_math_1.firstDecadeOfCentury)(value).getFullYear().toString() : '';
|
|
122
122
|
};
|
|
123
123
|
CenturyViewService.prototype.title = function (value) {
|
|
124
124
|
if (!value) {
|
|
125
125
|
return '';
|
|
126
126
|
}
|
|
127
|
-
return kendo_date_math_1.firstDecadeOfCentury(value).getFullYear()
|
|
127
|
+
return "".concat((0, kendo_date_math_1.firstDecadeOfCentury)(value).getFullYear(), " - ").concat((0, kendo_date_math_1.lastDecadeOfCentury)(value).getFullYear());
|
|
128
128
|
};
|
|
129
129
|
CenturyViewService.prototype.rowLength = function (_) {
|
|
130
130
|
return CELLS_LENGTH;
|
|
131
131
|
};
|
|
132
132
|
CenturyViewService.prototype.skip = function (value, min) {
|
|
133
|
-
return kendo_date_math_1.durationInCenturies(min, value);
|
|
133
|
+
return (0, kendo_date_math_1.durationInCenturies)(min, value);
|
|
134
134
|
};
|
|
135
135
|
CenturyViewService.prototype.total = function (min, max) {
|
|
136
|
-
return kendo_date_math_1.durationInCenturies(min, max) + 1;
|
|
136
|
+
return (0, kendo_date_math_1.durationInCenturies)(min, max) + 1;
|
|
137
137
|
};
|
|
138
138
|
CenturyViewService.prototype.value = function (current) {
|
|
139
|
-
return current ? kendo_date_math_1.firstYearOfDecade(current).getFullYear().toString() : '';
|
|
139
|
+
return current ? (0, kendo_date_math_1.firstYearOfDecade)(current).getFullYear().toString() : '';
|
|
140
140
|
};
|
|
141
141
|
CenturyViewService.prototype.viewDate = function (date, max, border) {
|
|
142
142
|
if (border === void 0) { border = 1; }
|
|
143
|
-
var renderTwoViews = kendo_date_math_1.durationInCenturies(date, max) < border;
|
|
144
|
-
return renderTwoViews ? kendo_date_math_1.addCenturies(date, -1) : date;
|
|
143
|
+
var renderTwoViews = (0, kendo_date_math_1.durationInCenturies)(date, max) < border;
|
|
144
|
+
return renderTwoViews ? (0, kendo_date_math_1.addCenturies)(date, -1) : date;
|
|
145
145
|
};
|
|
146
146
|
CenturyViewService.prototype.normalize = function (cellDate, min, max) {
|
|
147
147
|
if (cellDate < min && this.isEqual(cellDate, min)) {
|
|
148
|
-
return kendo_date_math_1.cloneDate(min);
|
|
148
|
+
return (0, kendo_date_math_1.cloneDate)(min);
|
|
149
149
|
}
|
|
150
150
|
if (cellDate > max && this.isEqual(cellDate, max)) {
|
|
151
|
-
return kendo_date_math_1.cloneDate(max);
|
|
151
|
+
return (0, kendo_date_math_1.cloneDate)(max);
|
|
152
152
|
}
|
|
153
153
|
return cellDate;
|
|
154
154
|
};
|
|
@@ -9,7 +9,25 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
9
9
|
*/
|
|
10
10
|
var DOMService = /** @class */ (function () {
|
|
11
11
|
function DOMService() {
|
|
12
|
+
// heights
|
|
13
|
+
this.calendarHeight = 0;
|
|
14
|
+
this.headerHeight = 0;
|
|
15
|
+
this.monthViewHeight = 0;
|
|
16
|
+
this.yearViewHeight = 0;
|
|
17
|
+
this.decadeViewHeight = 0;
|
|
18
|
+
this.centuryViewHeight = 0;
|
|
19
|
+
this.navigationItemHeight = 0;
|
|
20
|
+
this.scrollableContentHeight = 0;
|
|
21
|
+
this.scrollableYearContentHeight = 0;
|
|
22
|
+
// widths
|
|
23
|
+
this.calendarWidth = 0;
|
|
24
|
+
this.monthViewWidth = 0;
|
|
25
|
+
this.yearViewWidth = 0;
|
|
26
|
+
this.decadeViewWidth = 0;
|
|
27
|
+
this.centuryViewWidth = 0;
|
|
28
|
+
this.scrollableContentWidth = 0;
|
|
12
29
|
this.didCalculate = false;
|
|
30
|
+
this.hostContainer = null;
|
|
13
31
|
}
|
|
14
32
|
DOMService.prototype.ensureHeights = function () {
|
|
15
33
|
if (this.calendarHeight !== undefined) {
|
|
@@ -22,15 +40,15 @@ var DOMService = /** @class */ (function () {
|
|
|
22
40
|
if (!kendo_react_common_1.canUseDOM) {
|
|
23
41
|
return;
|
|
24
42
|
}
|
|
25
|
-
var div = utils_1.domContainerFactory('div');
|
|
26
|
-
var ul = utils_1.domContainerFactory('ul');
|
|
27
|
-
var li = utils_1.domContainerFactory('li');
|
|
28
|
-
var td = utils_1.domContainerFactory('td');
|
|
29
|
-
var th = utils_1.domContainerFactory('th');
|
|
30
|
-
var tr = utils_1.domContainerFactory('tr');
|
|
31
|
-
var tbody = utils_1.domContainerFactory('tbody');
|
|
32
|
-
var thead = utils_1.domContainerFactory('thead');
|
|
33
|
-
var table = utils_1.domContainerFactory('table');
|
|
43
|
+
var div = (0, utils_1.domContainerFactory)('div');
|
|
44
|
+
var ul = (0, utils_1.domContainerFactory)('ul');
|
|
45
|
+
var li = (0, utils_1.domContainerFactory)('li');
|
|
46
|
+
var td = (0, utils_1.domContainerFactory)('td');
|
|
47
|
+
var th = (0, utils_1.domContainerFactory)('th');
|
|
48
|
+
var tr = (0, utils_1.domContainerFactory)('tr');
|
|
49
|
+
var tbody = (0, utils_1.domContainerFactory)('tbody');
|
|
50
|
+
var thead = (0, utils_1.domContainerFactory)('thead');
|
|
51
|
+
var table = (0, utils_1.domContainerFactory)('table');
|
|
34
52
|
var monthHeader = function () { return (div("\n <span class=\"k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title\">\n <span className=\"k-button-text\">March 2017</span>\n </span>\n <span class=\"k-spacer\"></span>\n <span class=\"k-calendar-nav k-hstack\"><span class=\"k-nav-today\">TODAY</span></span>\n ", 'k-calendar-header k-hstack')); };
|
|
35
53
|
var monthWeekHeader = function () { return (table([
|
|
36
54
|
thead([
|
|
@@ -41,7 +59,7 @@ var DOMService = /** @class */ (function () {
|
|
|
41
59
|
var content = function (rows, cells) {
|
|
42
60
|
if (cells === void 0) { cells = 1; }
|
|
43
61
|
return (table([
|
|
44
|
-
tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td("<span class=\"k-link\">"
|
|
62
|
+
tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td("<span class=\"k-link\">".concat(c, "</span>"), 'k-calendar-td'); }), 'k-calendar-tr'); })), 'k-calendar-tbody')
|
|
45
63
|
], 'k-calendar-table'));
|
|
46
64
|
};
|
|
47
65
|
var scrollable = function (children) { return div(children, 'k-content k-calendar-content k-scrollable'); };
|
|
@@ -83,7 +101,7 @@ var DOMService = /** @class */ (function () {
|
|
|
83
101
|
var getScrollable = function (element) { return element.querySelector('.k-scrollable'); };
|
|
84
102
|
var horizontal = function (element) {
|
|
85
103
|
var scrollableElement = getScrollable(element);
|
|
86
|
-
scrollableElement.className = scrollableElement.className
|
|
104
|
+
scrollableElement.className = "".concat(scrollableElement.className, " k-scrollable-horizontal");
|
|
87
105
|
return element;
|
|
88
106
|
};
|
|
89
107
|
var monthView = viewFactory({ cells: 7, rows: 6 }, 'k-calendar-view k-calendar-monthview k-vstack', true);
|
|
@@ -147,13 +165,13 @@ var DOMService = /** @class */ (function () {
|
|
|
147
165
|
var viewProp = dimension === 'height' ? 'ViewHeight' : 'ViewWidth';
|
|
148
166
|
switch (viewType) {
|
|
149
167
|
case CalendarViewEnum_1.CalendarViewEnum.month:
|
|
150
|
-
return this["month"
|
|
168
|
+
return this["month".concat(viewProp)];
|
|
151
169
|
case CalendarViewEnum_1.CalendarViewEnum.year:
|
|
152
|
-
return this["year"
|
|
170
|
+
return this["year".concat(viewProp)];
|
|
153
171
|
case CalendarViewEnum_1.CalendarViewEnum.decade:
|
|
154
|
-
return this["decade"
|
|
172
|
+
return this["decade".concat(viewProp)];
|
|
155
173
|
case CalendarViewEnum_1.CalendarViewEnum.century:
|
|
156
|
-
return this["century"
|
|
174
|
+
return this["century".concat(viewProp)];
|
|
157
175
|
default:
|
|
158
176
|
return 1;
|
|
159
177
|
}
|
|
@@ -10,14 +10,14 @@ var EMPTY_DATA = [[]];
|
|
|
10
10
|
var CELLS_LENGTH = 4;
|
|
11
11
|
var ROWS_LENGTH = 3;
|
|
12
12
|
var ACTIONS = (_a = {},
|
|
13
|
-
_a[NavigationAction_1.Action.Left] = function (date) { return kendo_date_math_1.addYears(date, -1); },
|
|
14
|
-
_a[NavigationAction_1.Action.Up] = function (date) { return kendo_date_math_1.addYears(date, -5); },
|
|
15
|
-
_a[NavigationAction_1.Action.Right] = function (date) { return kendo_date_math_1.addYears(date, 1); },
|
|
16
|
-
_a[NavigationAction_1.Action.Down] = function (date) { return kendo_date_math_1.addYears(date, 5); },
|
|
17
|
-
_a[NavigationAction_1.Action.PrevView] = function (date) { return kendo_date_math_1.addDecades(date, -1); },
|
|
18
|
-
_a[NavigationAction_1.Action.NextView] = function (date) { return kendo_date_math_1.addDecades(date, 1); },
|
|
19
|
-
_a[NavigationAction_1.Action.FirstInView] = function (date) { return kendo_date_math_1.firstYearOfDecade(date); },
|
|
20
|
-
_a[NavigationAction_1.Action.LastInView] = function (date) { return kendo_date_math_1.lastYearOfDecade(date); },
|
|
13
|
+
_a[NavigationAction_1.Action.Left] = function (date) { return (0, kendo_date_math_1.addYears)(date, -1); },
|
|
14
|
+
_a[NavigationAction_1.Action.Up] = function (date) { return (0, kendo_date_math_1.addYears)(date, -5); },
|
|
15
|
+
_a[NavigationAction_1.Action.Right] = function (date) { return (0, kendo_date_math_1.addYears)(date, 1); },
|
|
16
|
+
_a[NavigationAction_1.Action.Down] = function (date) { return (0, kendo_date_math_1.addYears)(date, 5); },
|
|
17
|
+
_a[NavigationAction_1.Action.PrevView] = function (date) { return (0, kendo_date_math_1.addDecades)(date, -1); },
|
|
18
|
+
_a[NavigationAction_1.Action.NextView] = function (date) { return (0, kendo_date_math_1.addDecades)(date, 1); },
|
|
19
|
+
_a[NavigationAction_1.Action.FirstInView] = function (date) { return (0, kendo_date_math_1.firstYearOfDecade)(date); },
|
|
20
|
+
_a[NavigationAction_1.Action.LastInView] = function (date) { return (0, kendo_date_math_1.lastYearOfDecade)(date); },
|
|
21
21
|
_a);
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -26,10 +26,10 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
26
26
|
function DecadeViewService() {
|
|
27
27
|
}
|
|
28
28
|
DecadeViewService.prototype.addToDate = function (min, skip) {
|
|
29
|
-
return kendo_date_math_1.addDecades(min, skip);
|
|
29
|
+
return (0, kendo_date_math_1.addDecades)(min, skip);
|
|
30
30
|
};
|
|
31
31
|
DecadeViewService.prototype.datesList = function (start, count) {
|
|
32
|
-
return utils_1.range(0, count).map(function (i) { return kendo_date_math_1.addDecades(start, i); });
|
|
32
|
+
return (0, utils_1.range)(0, count).map(function (i) { return (0, kendo_date_math_1.addDecades)(start, i); });
|
|
33
33
|
};
|
|
34
34
|
DecadeViewService.prototype.data = function (options) {
|
|
35
35
|
var _this = this;
|
|
@@ -37,28 +37,28 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
37
37
|
if (!viewDate) {
|
|
38
38
|
return EMPTY_DATA;
|
|
39
39
|
}
|
|
40
|
-
var cells = utils_1.range(0, CELLS_LENGTH);
|
|
41
|
-
var firstDate = kendo_date_math_1.firstYearOfDecade(viewDate);
|
|
42
|
-
var lastDate = kendo_date_math_1.lastYearOfDecade(viewDate);
|
|
43
|
-
var today = utils_1.getToday();
|
|
44
|
-
return utils_1.range(0, ROWS_LENGTH).map(function (rowOffset) {
|
|
45
|
-
var baseDate = kendo_date_math_1.addYears(firstDate, rowOffset * CELLS_LENGTH);
|
|
40
|
+
var cells = (0, utils_1.range)(0, CELLS_LENGTH);
|
|
41
|
+
var firstDate = (0, kendo_date_math_1.firstYearOfDecade)(viewDate);
|
|
42
|
+
var lastDate = (0, kendo_date_math_1.lastYearOfDecade)(viewDate);
|
|
43
|
+
var today = (0, utils_1.getToday)();
|
|
44
|
+
return (0, utils_1.range)(0, ROWS_LENGTH).map(function (rowOffset) {
|
|
45
|
+
var baseDate = (0, kendo_date_math_1.addYears)(firstDate, rowOffset * CELLS_LENGTH);
|
|
46
46
|
return cells.map(function (cellOffset) {
|
|
47
|
-
var cellDate = _this.normalize(kendo_date_math_1.addYears(baseDate, cellOffset), min, max);
|
|
47
|
+
var cellDate = _this.normalize((0, kendo_date_math_1.addYears)(baseDate, cellOffset), min, max);
|
|
48
48
|
var isRangeStart = _this.isEqual(cellDate, selectionRange.start);
|
|
49
49
|
var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);
|
|
50
50
|
var isInMiddle = !isRangeStart && !isRangeEnd;
|
|
51
|
-
var isRangeMid = isInMiddle && utils_1.isInSelectionRange(cellDate, selectionRange);
|
|
51
|
+
var isRangeMid = isInMiddle && (0, utils_1.isInSelectionRange)(cellDate, selectionRange);
|
|
52
52
|
var isSelected = isActiveView && (!Array.isArray(selectedDate)
|
|
53
|
-
? utils_1.isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)
|
|
53
|
+
? (0, utils_1.isInRange)(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)
|
|
54
54
|
: _this.isSelectedFromArray(cellDate, selectedDate, min, max));
|
|
55
|
-
return utils_1.intersects(cellDate, firstDate, lastDate) ? ({
|
|
55
|
+
return (0, utils_1.intersects)(cellDate, firstDate, lastDate) ? ({
|
|
56
56
|
formattedValue: _this.value(cellDate),
|
|
57
|
-
id: ""
|
|
57
|
+
id: "".concat(cellUID).concat(cellDate.getTime()),
|
|
58
58
|
isFocused: _this.isEqual(cellDate, focusedDate),
|
|
59
59
|
isSelected: isSelected,
|
|
60
60
|
isWeekend: false,
|
|
61
|
-
isInRange: utils_1.isInRange(cellDate, min, max),
|
|
61
|
+
isInRange: (0, utils_1.isInRange)(cellDate, min, max),
|
|
62
62
|
isRangeStart: isRangeStart,
|
|
63
63
|
isRangeMid: isRangeMid,
|
|
64
64
|
isRangeEnd: isRangeEnd,
|
|
@@ -75,7 +75,7 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
75
75
|
var _this = this;
|
|
76
76
|
var result = false;
|
|
77
77
|
dates.forEach(function (date) {
|
|
78
|
-
if (utils_1.isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {
|
|
78
|
+
if ((0, utils_1.isInRange)(candidate, min, max) && _this.isEqual(candidate, date)) {
|
|
79
79
|
result = true;
|
|
80
80
|
}
|
|
81
81
|
});
|
|
@@ -104,7 +104,7 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
104
104
|
return value.getFullYear() % 100 === 0;
|
|
105
105
|
};
|
|
106
106
|
DecadeViewService.prototype.isInSameView = function (candidate, value) {
|
|
107
|
-
return kendo_date_math_1.durationInDecades(candidate, value) === 0;
|
|
107
|
+
return (0, kendo_date_math_1.durationInDecades)(candidate, value) === 0;
|
|
108
108
|
};
|
|
109
109
|
DecadeViewService.prototype.move = function (value, action) {
|
|
110
110
|
var modifier = ACTIONS[action];
|
|
@@ -117,37 +117,37 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
117
117
|
return value.getFullYear().toString();
|
|
118
118
|
};
|
|
119
119
|
DecadeViewService.prototype.navigationTitle = function (value) {
|
|
120
|
-
return value ? kendo_date_math_1.firstYearOfDecade(value).getFullYear().toString() : '';
|
|
120
|
+
return value ? (0, kendo_date_math_1.firstYearOfDecade)(value).getFullYear().toString() : '';
|
|
121
121
|
};
|
|
122
122
|
DecadeViewService.prototype.title = function (value) {
|
|
123
123
|
if (!value) {
|
|
124
124
|
return '';
|
|
125
125
|
}
|
|
126
|
-
return kendo_date_math_1.firstYearOfDecade(value).getFullYear()
|
|
126
|
+
return "".concat((0, kendo_date_math_1.firstYearOfDecade)(value).getFullYear(), " - ").concat((0, kendo_date_math_1.lastYearOfDecade)(value).getFullYear());
|
|
127
127
|
};
|
|
128
128
|
DecadeViewService.prototype.rowLength = function (_) {
|
|
129
129
|
return CELLS_LENGTH;
|
|
130
130
|
};
|
|
131
131
|
DecadeViewService.prototype.skip = function (value, min) {
|
|
132
|
-
return kendo_date_math_1.durationInDecades(min, value);
|
|
132
|
+
return (0, kendo_date_math_1.durationInDecades)(min, value);
|
|
133
133
|
};
|
|
134
134
|
DecadeViewService.prototype.total = function (min, max) {
|
|
135
|
-
return kendo_date_math_1.durationInDecades(min, max) + 1;
|
|
135
|
+
return (0, kendo_date_math_1.durationInDecades)(min, max) + 1;
|
|
136
136
|
};
|
|
137
137
|
DecadeViewService.prototype.value = function (current) {
|
|
138
138
|
return current ? current.getFullYear().toString() : '';
|
|
139
139
|
};
|
|
140
140
|
DecadeViewService.prototype.viewDate = function (date, max, border) {
|
|
141
141
|
if (border === void 0) { border = 1; }
|
|
142
|
-
var renderTwoViews = kendo_date_math_1.durationInDecades(date, max) < border;
|
|
143
|
-
return renderTwoViews ? kendo_date_math_1.addDecades(date, -1) : date;
|
|
142
|
+
var renderTwoViews = (0, kendo_date_math_1.durationInDecades)(date, max) < border;
|
|
143
|
+
return renderTwoViews ? (0, kendo_date_math_1.addDecades)(date, -1) : date;
|
|
144
144
|
};
|
|
145
145
|
DecadeViewService.prototype.normalize = function (cellDate, min, max) {
|
|
146
146
|
if (cellDate < min && this.isEqual(cellDate, min)) {
|
|
147
|
-
return kendo_date_math_1.cloneDate(min);
|
|
147
|
+
return (0, kendo_date_math_1.cloneDate)(min);
|
|
148
148
|
}
|
|
149
149
|
if (cellDate > max && this.isEqual(cellDate, max)) {
|
|
150
|
-
return kendo_date_math_1.cloneDate(max);
|
|
150
|
+
return (0, kendo_date_math_1.cloneDate)(max);
|
|
151
151
|
}
|
|
152
152
|
return cellDate;
|
|
153
153
|
};
|