@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
|
@@ -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
|
};
|
|
@@ -12,14 +12,14 @@ var ROWS_LENGTH = 6;
|
|
|
12
12
|
var SATURDAY = 6;
|
|
13
13
|
var SUNDAY = 0;
|
|
14
14
|
var ACTIONS = (_a = {},
|
|
15
|
-
_a[NavigationAction_1.Action.Left] = function (date) { return kendo_date_math_1.addDays(date, -1); },
|
|
16
|
-
_a[NavigationAction_1.Action.Up] = function (date) { return kendo_date_math_1.addWeeks(date, -1); },
|
|
17
|
-
_a[NavigationAction_1.Action.Right] = function (date) { return kendo_date_math_1.addDays(date, 1); },
|
|
18
|
-
_a[NavigationAction_1.Action.Down] = function (date) { return kendo_date_math_1.addWeeks(date, 1); },
|
|
19
|
-
_a[NavigationAction_1.Action.PrevView] = function (date) { return kendo_date_math_1.addMonths(date, -1); },
|
|
20
|
-
_a[NavigationAction_1.Action.NextView] = function (date) { return kendo_date_math_1.addMonths(date, 1); },
|
|
21
|
-
_a[NavigationAction_1.Action.FirstInView] = function (date) { return kendo_date_math_1.firstDayOfMonth(date); },
|
|
22
|
-
_a[NavigationAction_1.Action.LastInView] = function (date) { return kendo_date_math_1.lastDayOfMonth(date); },
|
|
15
|
+
_a[NavigationAction_1.Action.Left] = function (date) { return (0, kendo_date_math_1.addDays)(date, -1); },
|
|
16
|
+
_a[NavigationAction_1.Action.Up] = function (date) { return (0, kendo_date_math_1.addWeeks)(date, -1); },
|
|
17
|
+
_a[NavigationAction_1.Action.Right] = function (date) { return (0, kendo_date_math_1.addDays)(date, 1); },
|
|
18
|
+
_a[NavigationAction_1.Action.Down] = function (date) { return (0, kendo_date_math_1.addWeeks)(date, 1); },
|
|
19
|
+
_a[NavigationAction_1.Action.PrevView] = function (date) { return (0, kendo_date_math_1.addMonths)(date, -1); },
|
|
20
|
+
_a[NavigationAction_1.Action.NextView] = function (date) { return (0, kendo_date_math_1.addMonths)(date, 1); },
|
|
21
|
+
_a[NavigationAction_1.Action.FirstInView] = function (date) { return (0, kendo_date_math_1.firstDayOfMonth)(date); },
|
|
22
|
+
_a[NavigationAction_1.Action.LastInView] = function (date) { return (0, kendo_date_math_1.lastDayOfMonth)(date); },
|
|
23
23
|
_a);
|
|
24
24
|
/**
|
|
25
25
|
* @hidden
|
|
@@ -29,10 +29,10 @@ var MonthViewService = /** @class */ (function () {
|
|
|
29
29
|
this.intl = intl;
|
|
30
30
|
}
|
|
31
31
|
MonthViewService.prototype.addToDate = function (min, skip) {
|
|
32
|
-
return kendo_date_math_1.addMonths(min, skip);
|
|
32
|
+
return (0, kendo_date_math_1.addMonths)(min, skip);
|
|
33
33
|
};
|
|
34
34
|
MonthViewService.prototype.datesList = function (start, count) {
|
|
35
|
-
return utils_1.range(0, count).map(function (i) { return kendo_date_math_1.addMonths(start, i); });
|
|
35
|
+
return (0, utils_1.range)(0, count).map(function (i) { return (0, kendo_date_math_1.addMonths)(start, i); });
|
|
36
36
|
};
|
|
37
37
|
MonthViewService.prototype.data = function (options) {
|
|
38
38
|
var _this = this;
|
|
@@ -40,16 +40,16 @@ var MonthViewService = /** @class */ (function () {
|
|
|
40
40
|
if (!viewDate) {
|
|
41
41
|
return EMPTY_DATA;
|
|
42
42
|
}
|
|
43
|
-
var firstMonthDate = kendo_date_math_1.firstDayOfMonth(viewDate);
|
|
44
|
-
var lastMonthDate = kendo_date_math_1.lastDayOfMonth(viewDate);
|
|
43
|
+
var firstMonthDate = (0, kendo_date_math_1.firstDayOfMonth)(viewDate);
|
|
44
|
+
var lastMonthDate = (0, kendo_date_math_1.lastDayOfMonth)(viewDate);
|
|
45
45
|
var backward = -1;
|
|
46
|
-
var date = kendo_date_math_1.dayOfWeek(firstMonthDate, this.intl.firstDay(), backward);
|
|
47
|
-
var cells = utils_1.range(0, CELLS_LENGTH);
|
|
48
|
-
var today = utils_1.getToday();
|
|
49
|
-
return utils_1.range(0, ROWS_LENGTH).map(function (rowOffset) {
|
|
50
|
-
var baseDate = kendo_date_math_1.addDays(date, rowOffset * CELLS_LENGTH);
|
|
46
|
+
var date = (0, kendo_date_math_1.dayOfWeek)(firstMonthDate, this.intl.firstDay(), backward);
|
|
47
|
+
var cells = (0, utils_1.range)(0, CELLS_LENGTH);
|
|
48
|
+
var today = (0, utils_1.getToday)();
|
|
49
|
+
return (0, utils_1.range)(0, ROWS_LENGTH).map(function (rowOffset) {
|
|
50
|
+
var baseDate = (0, kendo_date_math_1.addDays)(date, rowOffset * CELLS_LENGTH);
|
|
51
51
|
return cells.map(function (cellOffset) {
|
|
52
|
-
var cellDate = _this.normalize(kendo_date_math_1.addDays(baseDate, cellOffset), min, max);
|
|
52
|
+
var cellDate = _this.normalize((0, kendo_date_math_1.addDays)(baseDate, cellOffset), min, max);
|
|
53
53
|
var otherMonth = cellDate < firstMonthDate || cellDate > lastMonthDate;
|
|
54
54
|
if (otherMonth) {
|
|
55
55
|
return null;
|
|
@@ -57,16 +57,16 @@ var MonthViewService = /** @class */ (function () {
|
|
|
57
57
|
var isRangeStart = _this.isEqual(cellDate, selectionRange.start);
|
|
58
58
|
var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);
|
|
59
59
|
var isInMiddle = !isRangeStart && !isRangeEnd;
|
|
60
|
-
var isRangeMid = isInMiddle && utils_1.isInSelectionRange(cellDate, selectionRange);
|
|
60
|
+
var isRangeMid = isInMiddle && (0, utils_1.isInSelectionRange)(cellDate, selectionRange);
|
|
61
61
|
var isSelected = isActiveView && (!Array.isArray(selectedDate)
|
|
62
|
-
? utils_1.isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)
|
|
62
|
+
? (0, utils_1.isInRange)(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)
|
|
63
63
|
: _this.isSelectedFromArray(cellDate, selectedDate, min, max));
|
|
64
64
|
var cell = {
|
|
65
65
|
formattedValue: _this.value(cellDate),
|
|
66
|
-
id: ""
|
|
66
|
+
id: "".concat(cellUID).concat(cellDate.getTime()),
|
|
67
67
|
isFocused: _this.isEqual(cellDate, focusedDate),
|
|
68
68
|
isSelected: isSelected,
|
|
69
|
-
isInRange: utils_1.isInRange(cellDate, min, max),
|
|
69
|
+
isInRange: (0, utils_1.isInRange)(cellDate, min, max),
|
|
70
70
|
isWeekend: _this.isWeekend(cellDate),
|
|
71
71
|
isRangeStart: isRangeStart,
|
|
72
72
|
isRangeMid: isRangeMid,
|
|
@@ -85,29 +85,29 @@ var MonthViewService = /** @class */ (function () {
|
|
|
85
85
|
if (!candidate || !expected) {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
|
-
return kendo_date_math_1.getDate(candidate).getTime() === kendo_date_math_1.getDate(expected).getTime();
|
|
88
|
+
return (0, kendo_date_math_1.getDate)(candidate).getTime() === (0, kendo_date_math_1.getDate)(expected).getTime();
|
|
89
89
|
};
|
|
90
90
|
MonthViewService.prototype.isSelectedFromArray = function (candidate, dates, min, max) {
|
|
91
91
|
var _this = this;
|
|
92
92
|
var result = false;
|
|
93
93
|
dates.forEach(function (date) {
|
|
94
|
-
if (utils_1.isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {
|
|
94
|
+
if ((0, utils_1.isInRange)(candidate, min, max) && _this.isEqual(candidate, date)) {
|
|
95
95
|
result = true;
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
return result;
|
|
99
99
|
};
|
|
100
100
|
MonthViewService.prototype.isInArray = function (date, dates) {
|
|
101
|
-
return !!dates.length && kendo_date_math_1.firstDayOfMonth(dates[0]) <= date && date <= kendo_date_math_1.lastDayOfMonth(dates[dates.length - 1]);
|
|
101
|
+
return !!dates.length && (0, kendo_date_math_1.firstDayOfMonth)(dates[0]) <= date && date <= (0, kendo_date_math_1.lastDayOfMonth)(dates[dates.length - 1]);
|
|
102
102
|
};
|
|
103
103
|
MonthViewService.prototype.isInRange = function (candidate, min, max) {
|
|
104
|
-
var value = kendo_date_math_1.getDate(candidate);
|
|
105
|
-
var aboveMin = !min || kendo_date_math_1.getDate(min) <= value;
|
|
106
|
-
var belowMax = !max || value <= kendo_date_math_1.getDate(max);
|
|
104
|
+
var value = (0, kendo_date_math_1.getDate)(candidate);
|
|
105
|
+
var aboveMin = !min || (0, kendo_date_math_1.getDate)(min) <= value;
|
|
106
|
+
var belowMax = !max || value <= (0, kendo_date_math_1.getDate)(max);
|
|
107
107
|
return aboveMin && belowMax;
|
|
108
108
|
};
|
|
109
109
|
MonthViewService.prototype.isInSameView = function (candidate, value) {
|
|
110
|
-
return kendo_date_math_1.durationInMonths(candidate, value) === 0;
|
|
110
|
+
return (0, kendo_date_math_1.durationInMonths)(candidate, value) === 0;
|
|
111
111
|
};
|
|
112
112
|
MonthViewService.prototype.isRangeStart = function (value) {
|
|
113
113
|
return !value.getMonth();
|
|
@@ -129,24 +129,24 @@ var MonthViewService = /** @class */ (function () {
|
|
|
129
129
|
return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];
|
|
130
130
|
};
|
|
131
131
|
MonthViewService.prototype.title = function (current) {
|
|
132
|
-
return this.wideMonthNames()[current.getMonth()]
|
|
132
|
+
return "".concat(this.wideMonthNames()[current.getMonth()], " ").concat(current.getFullYear());
|
|
133
133
|
};
|
|
134
134
|
MonthViewService.prototype.rowLength = function (prependCell) {
|
|
135
135
|
return CELLS_LENGTH + (prependCell ? 1 : 0);
|
|
136
136
|
};
|
|
137
137
|
MonthViewService.prototype.skip = function (value, min) {
|
|
138
|
-
return kendo_date_math_1.durationInMonths(min, value);
|
|
138
|
+
return (0, kendo_date_math_1.durationInMonths)(min, value);
|
|
139
139
|
};
|
|
140
140
|
MonthViewService.prototype.total = function (min, max) {
|
|
141
|
-
return kendo_date_math_1.durationInMonths(min, max) + 1;
|
|
141
|
+
return (0, kendo_date_math_1.durationInMonths)(min, max) + 1;
|
|
142
142
|
};
|
|
143
143
|
MonthViewService.prototype.value = function (current) {
|
|
144
144
|
return current ? current.getDate().toString() : '';
|
|
145
145
|
};
|
|
146
146
|
MonthViewService.prototype.viewDate = function (date, max, border) {
|
|
147
147
|
if (border === void 0) { border = 1; }
|
|
148
|
-
var renderTwoViews = kendo_date_math_1.durationInMonths(date, max) < border;
|
|
149
|
-
return renderTwoViews ? kendo_date_math_1.addMonths(date, -1) : date;
|
|
148
|
+
var renderTwoViews = (0, kendo_date_math_1.durationInMonths)(date, max) < border;
|
|
149
|
+
return renderTwoViews ? (0, kendo_date_math_1.addMonths)(date, -1) : date;
|
|
150
150
|
};
|
|
151
151
|
MonthViewService.prototype.isWeekend = function (date) {
|
|
152
152
|
var day = date.getDay();
|
|
@@ -157,10 +157,10 @@ var MonthViewService = /** @class */ (function () {
|
|
|
157
157
|
};
|
|
158
158
|
MonthViewService.prototype.normalize = function (cellDate, min, max) {
|
|
159
159
|
if (cellDate < min && this.isEqual(cellDate, min)) {
|
|
160
|
-
return kendo_date_math_1.getDate(min);
|
|
160
|
+
return (0, kendo_date_math_1.getDate)(min);
|
|
161
161
|
}
|
|
162
162
|
if (cellDate > max && this.isEqual(cellDate, max)) {
|
|
163
|
-
return kendo_date_math_1.getDate(max);
|
|
163
|
+
return (0, kendo_date_math_1.getDate)(max);
|
|
164
164
|
}
|
|
165
165
|
return cellDate;
|
|
166
166
|
};
|
|
@@ -22,7 +22,7 @@ var NavigationService = /** @class */ (function () {
|
|
|
22
22
|
this.bus = bus;
|
|
23
23
|
}
|
|
24
24
|
NavigationService.prototype.action = function (event) {
|
|
25
|
-
var action = ""
|
|
25
|
+
var action = "".concat(event.ctrlKey || event.metaKey ? 'meta+' : '').concat(event.keyCode);
|
|
26
26
|
return KEY_TO_ACTION[action];
|
|
27
27
|
};
|
|
28
28
|
NavigationService.prototype.move = function (value, action, activeView, service, event) {
|
|
@@ -9,6 +9,10 @@ var powerByMagnitude = function (magnitude) { return function (x) { return x * m
|
|
|
9
9
|
var ScrollSyncService = /** @class */ (function () {
|
|
10
10
|
function ScrollSyncService(dom) {
|
|
11
11
|
this.dom = dom;
|
|
12
|
+
this.divideByMagnitude = null;
|
|
13
|
+
this.powerByMagnitude = null;
|
|
14
|
+
this.navigator = null;
|
|
15
|
+
this.view = null;
|
|
12
16
|
this.monthScrolled = false;
|
|
13
17
|
this.navScrolled = false;
|
|
14
18
|
}
|
|
@@ -50,7 +54,7 @@ var ScrollSyncService = /** @class */ (function () {
|
|
|
50
54
|
};
|
|
51
55
|
ScrollSyncService.prototype.calculateScroll = function (component, scrollTop) {
|
|
52
56
|
var modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;
|
|
53
|
-
return modifier(scrollTop);
|
|
57
|
+
return modifier ? modifier(scrollTop) : 0;
|
|
54
58
|
};
|
|
55
59
|
return ScrollSyncService;
|
|
56
60
|
}());
|
|
@@ -11,7 +11,7 @@ var WeekNamesService = /** @class */ (function () {
|
|
|
11
11
|
}
|
|
12
12
|
WeekNamesService.prototype.getWeekNames = function (includeWeekNumber) {
|
|
13
13
|
if (includeWeekNumber === void 0) { includeWeekNumber = false; }
|
|
14
|
-
var weekNames = utils_1.shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
|
|
14
|
+
var weekNames = (0, utils_1.shiftWeekNames)(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
|
|
15
15
|
return includeWeekNumber ? [''].concat(weekNames) : weekNames;
|
|
16
16
|
};
|
|
17
17
|
return WeekNamesService;
|