@progress/kendo-angular-dateinputs 21.4.1 → 22.0.0-develop.1

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.
Files changed (141) hide show
  1. package/calendar/localization/calendar-messages.d.ts +1 -1
  2. package/calendar/localization/multiview-calendar-messages.d.ts +1 -1
  3. package/dateinput/localization/messages.d.ts +1 -1
  4. package/datepicker/localization/messages.d.ts +1 -1
  5. package/daterange/date-range-input.d.ts +1 -1
  6. package/daterange/localization/messages.d.ts +1 -1
  7. package/datetimepicker/localization/messages.d.ts +1 -1
  8. package/fesm2022/progress-kendo-angular-dateinputs.mjs +262 -262
  9. package/package.json +15 -23
  10. package/timepicker/localization/messages.d.ts +1 -1
  11. package/esm2022/calendar/calendar.component.mjs +0 -1711
  12. package/esm2022/calendar/calendar.module.mjs +0 -91
  13. package/esm2022/calendar/calendars.module.mjs +0 -87
  14. package/esm2022/calendar/footer.component.mjs +0 -77
  15. package/esm2022/calendar/for.directive.mjs +0 -116
  16. package/esm2022/calendar/header.component.mjs +0 -367
  17. package/esm2022/calendar/horizontal-view-list.component.mjs +0 -580
  18. package/esm2022/calendar/localization/calendar-custom-messages.component.mjs +0 -51
  19. package/esm2022/calendar/localization/calendar-localized-messages.directive.mjs +0 -39
  20. package/esm2022/calendar/localization/calendar-messages.mjs +0 -45
  21. package/esm2022/calendar/localization/multiview-calendar-custom-messages.component.mjs +0 -51
  22. package/esm2022/calendar/localization/multiview-calendar-localized-messages.directive.mjs +0 -39
  23. package/esm2022/calendar/localization/multiview-calendar-messages.mjs +0 -45
  24. package/esm2022/calendar/models/cell-context.interface.mjs +0 -5
  25. package/esm2022/calendar/models/navigation-action.enum.mjs +0 -20
  26. package/esm2022/calendar/models/orientation.mjs +0 -5
  27. package/esm2022/calendar/models/row-length-options.interface.mjs +0 -5
  28. package/esm2022/calendar/models/scrollable.interface.mjs +0 -5
  29. package/esm2022/calendar/models/selection-range-end.type.mjs +0 -5
  30. package/esm2022/calendar/models/selection-range.interface.mjs +0 -10
  31. package/esm2022/calendar/models/selection.mjs +0 -50
  32. package/esm2022/calendar/models/type.mjs +0 -5
  33. package/esm2022/calendar/models/view-service.interface.mjs +0 -5
  34. package/esm2022/calendar/models/view.enum.mjs +0 -16
  35. package/esm2022/calendar/models/view.type.mjs +0 -5
  36. package/esm2022/calendar/multiview-calendar.component.mjs +0 -1564
  37. package/esm2022/calendar/multiview-calendar.module.mjs +0 -89
  38. package/esm2022/calendar/navigation.component.mjs +0 -230
  39. package/esm2022/calendar/services/bus-view.service.mjs +0 -83
  40. package/esm2022/calendar/services/century-view.service.mjs +0 -219
  41. package/esm2022/calendar/services/decade-view.service.mjs +0 -217
  42. package/esm2022/calendar/services/disabled-dates.service.mjs +0 -66
  43. package/esm2022/calendar/services/dom.service.mjs +0 -203
  44. package/esm2022/calendar/services/month-view.service.mjs +0 -223
  45. package/esm2022/calendar/services/navigation.service.mjs +0 -60
  46. package/esm2022/calendar/services/scroll-sync.service.mjs +0 -89
  47. package/esm2022/calendar/services/selection.service.mjs +0 -62
  48. package/esm2022/calendar/services/weeknames.service.mjs +0 -33
  49. package/esm2022/calendar/services/year-view.service.mjs +0 -204
  50. package/esm2022/calendar/templates/cell-template.directive.mjs +0 -45
  51. package/esm2022/calendar/templates/century-cell-template.directive.mjs +0 -43
  52. package/esm2022/calendar/templates/decade-cell-template.directive.mjs +0 -43
  53. package/esm2022/calendar/templates/footer-template.directive.mjs +0 -44
  54. package/esm2022/calendar/templates/header-template.directive.mjs +0 -47
  55. package/esm2022/calendar/templates/header-title-template.directive.mjs +0 -43
  56. package/esm2022/calendar/templates/month-cell-template.directive.mjs +0 -43
  57. package/esm2022/calendar/templates/navigation-item-template.directive.mjs +0 -43
  58. package/esm2022/calendar/templates/weeknumber-cell-template.directive.mjs +0 -43
  59. package/esm2022/calendar/templates/year-cell-template.directive.mjs +0 -43
  60. package/esm2022/calendar/view-list.component.mjs +0 -497
  61. package/esm2022/calendar/view.component.mjs +0 -432
  62. package/esm2022/common/dom-queries.mjs +0 -24
  63. package/esm2022/common/models/fillmode.mjs +0 -5
  64. package/esm2022/common/models/rounded.mjs +0 -5
  65. package/esm2022/common/models/size.mjs +0 -5
  66. package/esm2022/common/models/week-days-format.mjs +0 -5
  67. package/esm2022/common/picker.service.mjs +0 -17
  68. package/esm2022/common/utils.mjs +0 -70
  69. package/esm2022/dateinput/arrow.enum.mjs +0 -13
  70. package/esm2022/dateinput/dateinput.component.mjs +0 -1196
  71. package/esm2022/dateinput/dateinput.module.mjs +0 -45
  72. package/esm2022/dateinput/localization/dateinput-custom-messages.component.mjs +0 -60
  73. package/esm2022/dateinput/localization/dateinput-localized-messages.directive.mjs +0 -39
  74. package/esm2022/dateinput/localization/messages.mjs +0 -39
  75. package/esm2022/dateinput/models/format-placeholder.model.mjs +0 -5
  76. package/esm2022/dateinput/models/format-settings.model.mjs +0 -5
  77. package/esm2022/dateinput/models/incremental-steps.model.mjs +0 -5
  78. package/esm2022/dateinputs.module.mjs +0 -136
  79. package/esm2022/datepicker/datepicker.component.mjs +0 -1758
  80. package/esm2022/datepicker/datepicker.module.mjs +0 -83
  81. package/esm2022/datepicker/localization/datepicker-custom-messages.component.mjs +0 -53
  82. package/esm2022/datepicker/localization/datepicker-localized-messages.directive.mjs +0 -39
  83. package/esm2022/datepicker/localization/messages.mjs +0 -63
  84. package/esm2022/daterange/auto-correct-on.type.mjs +0 -5
  85. package/esm2022/daterange/date-range-end-input.directive.mjs +0 -105
  86. package/esm2022/daterange/date-range-input.mjs +0 -138
  87. package/esm2022/daterange/date-range-popup-template.directive.mjs +0 -36
  88. package/esm2022/daterange/date-range-popup.component.mjs +0 -1051
  89. package/esm2022/daterange/date-range-selection.directive.mjs +0 -223
  90. package/esm2022/daterange/date-range-start-input.directive.mjs +0 -109
  91. package/esm2022/daterange/date-range.component.mjs +0 -116
  92. package/esm2022/daterange/date-range.module.mjs +0 -103
  93. package/esm2022/daterange/date-range.service.mjs +0 -225
  94. package/esm2022/daterange/localization/daterange-popup-custom-messages.component.mjs +0 -43
  95. package/esm2022/daterange/localization/daterange-popup-localized-messages.directive.mjs +0 -39
  96. package/esm2022/daterange/localization/messages.mjs +0 -51
  97. package/esm2022/datetimepicker/datetimepicker.component.mjs +0 -2505
  98. package/esm2022/datetimepicker/datetimepicker.module.mjs +0 -106
  99. package/esm2022/datetimepicker/localization/datetimepicker-custom-messages.component.mjs +0 -52
  100. package/esm2022/datetimepicker/localization/localized-messages.directive.mjs +0 -39
  101. package/esm2022/datetimepicker/localization/messages.mjs +0 -153
  102. package/esm2022/datetimepicker/models/active-tab.type.mjs +0 -5
  103. package/esm2022/defaults.mjs +0 -24
  104. package/esm2022/directives.mjs +0 -146
  105. package/esm2022/index.mjs +0 -78
  106. package/esm2022/package-metadata.mjs +0 -16
  107. package/esm2022/popup-settings.model.mjs +0 -5
  108. package/esm2022/preventable-event.mjs +0 -27
  109. package/esm2022/progress-kendo-angular-dateinputs.mjs +0 -8
  110. package/esm2022/timepicker/localization/messages.mjs +0 -105
  111. package/esm2022/timepicker/localization/timepicker-custom-messages.component.mjs +0 -54
  112. package/esm2022/timepicker/localization/timepicker-localized-messages.directive.mjs +0 -39
  113. package/esm2022/timepicker/localization/timeselector-custom-messages.component.mjs +0 -45
  114. package/esm2022/timepicker/localization/timeselector-localized-messages.directive.mjs +0 -39
  115. package/esm2022/timepicker/models/incremental-steps.model.mjs +0 -5
  116. package/esm2022/timepicker/models/list-item.interface.mjs +0 -5
  117. package/esm2022/timepicker/models/list-service-settings.mjs +0 -5
  118. package/esm2022/timepicker/models/list-service.interface.mjs +0 -5
  119. package/esm2022/timepicker/models/time-part.default.mjs +0 -14
  120. package/esm2022/timepicker/services/dayperiod.service.mjs +0 -131
  121. package/esm2022/timepicker/services/dom.service.mjs +0 -126
  122. package/esm2022/timepicker/services/hours.service.mjs +0 -130
  123. package/esm2022/timepicker/services/milliseconds.service.mjs +0 -131
  124. package/esm2022/timepicker/services/minutes.service.mjs +0 -128
  125. package/esm2022/timepicker/services/seconds.service.mjs +0 -128
  126. package/esm2022/timepicker/timelist.component.mjs +0 -388
  127. package/esm2022/timepicker/timepicker.component.mjs +0 -1598
  128. package/esm2022/timepicker/timepicker.module.mjs +0 -71
  129. package/esm2022/timepicker/timeselector.component.mjs +0 -728
  130. package/esm2022/timepicker/util.mjs +0 -70
  131. package/esm2022/util.mjs +0 -406
  132. package/esm2022/validators/disabled-date.validator.mjs +0 -18
  133. package/esm2022/validators/disabled-dates-range.validator.mjs +0 -26
  134. package/esm2022/validators/incomplete-date.validator.mjs +0 -18
  135. package/esm2022/validators/max.validator.mjs +0 -21
  136. package/esm2022/validators/min.validator.mjs +0 -21
  137. package/esm2022/validators/time-range.validator.mjs +0 -23
  138. package/esm2022/virtualization/models/scrollable.interface.mjs +0 -5
  139. package/esm2022/virtualization/services/row-height.service.mjs +0 -73
  140. package/esm2022/virtualization/services/scroller.service.mjs +0 -109
  141. package/esm2022/virtualization/virtualization.component.mjs +0 -324
@@ -1,223 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable } from '@angular/core';
6
- import { IntlService } from '@progress/kendo-angular-intl';
7
- import { addDays, addWeeks, addMonths, cloneDate, dayOfWeek, durationInMonths, getDate, firstDayOfMonth, lastDayOfMonth, createDate } from '@progress/kendo-date-math';
8
- import { Action } from '../models/navigation-action.enum';
9
- import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
10
- import { getToday, isInSelectionRange, range } from '../../util';
11
- import { isPresent } from '../../common/utils';
12
- import * as i0 from "@angular/core";
13
- import * as i1 from "@progress/kendo-angular-intl";
14
- const EMPTY_DATA = [[]];
15
- const CELLS_LENGTH = 7;
16
- const ROWS_LENGTH = 6;
17
- const ACTIONS = {
18
- [Action.Left]: (date) => addDays(date, -1),
19
- [Action.Up]: (date) => addWeeks(date, -1),
20
- [Action.Right]: (date) => addDays(date, 1),
21
- [Action.Down]: (date) => addWeeks(date, 1),
22
- [Action.PrevView]: (date) => addMonths(date, -1),
23
- [Action.NextView]: (date) => addMonths(date, 1),
24
- [Action.FirstInView]: (date) => firstDayOfMonth(date),
25
- [Action.LastInView]: (date) => lastDayOfMonth(date)
26
- };
27
- /**
28
- * @hidden
29
- */
30
- export class MonthViewService {
31
- _intlService;
32
- constructor(_intlService) {
33
- this._intlService = _intlService;
34
- }
35
- addToDate(min, skip) {
36
- return addMonths(min, skip);
37
- }
38
- datesList(start, count) {
39
- return range(0, count).map(i => addMonths(start, i));
40
- }
41
- data(options) {
42
- const { cellUID, focusedDate, isActiveView, max, min, selectedDates, selectionRange = EMPTY_SELECTIONRANGE, viewDate, isDateDisabled = () => false, allowReverse } = options;
43
- if (!viewDate) {
44
- return EMPTY_DATA;
45
- }
46
- const firstMonthDate = firstDayOfMonth(viewDate);
47
- const firstMonthDay = getDate(firstMonthDate);
48
- const lastMonthDate = lastDayOfMonth(viewDate);
49
- const lastMonthDay = getDate(lastMonthDate);
50
- const backward = -1;
51
- const date = dayOfWeek(firstMonthDate, this._intlService.firstDay(), backward);
52
- const cells = range(0, CELLS_LENGTH);
53
- const today = getToday();
54
- return range(0, ROWS_LENGTH).map(rowOffset => {
55
- const baseDate = addDays(date, rowOffset * CELLS_LENGTH);
56
- return cells.map(cellOffset => {
57
- const cellDate = this.normalize(addDays(baseDate, cellOffset), min, max);
58
- const cellDay = getDate(cellDate);
59
- const otherMonth = cellDay < firstMonthDay || cellDay > lastMonthDay;
60
- const outOfRange = cellDate < min || cellDate > max;
61
- if (outOfRange) {
62
- return null;
63
- }
64
- let isRangeStart = false;
65
- let isRangeEnd = false;
66
- if (allowReverse) {
67
- if ((this.isEqual(cellDate, selectionRange.start) && selectionRange.start <= selectionRange.end) ||
68
- (this.isEqual(cellDate, selectionRange.end) && selectionRange.end <= selectionRange.start)) {
69
- isRangeStart = true;
70
- }
71
- if ((this.isEqual(cellDate, selectionRange.start) && selectionRange.start >= selectionRange.end) ||
72
- (this.isEqual(cellDate, selectionRange.end) && selectionRange.end >= selectionRange.start)) {
73
- isRangeEnd = true;
74
- }
75
- }
76
- else {
77
- isRangeStart = this.isEqual(cellDate, selectionRange.start);
78
- isRangeEnd = this.isEqual(cellDate, selectionRange.end);
79
- }
80
- const isInMiddle = !isRangeStart && !isRangeEnd;
81
- let isRangeMid;
82
- if (allowReverse) {
83
- isRangeMid = isInMiddle && (isInSelectionRange(cellDate, selectionRange) || isInSelectionRange(cellDate, { start: selectionRange.end, end: selectionRange.start }));
84
- }
85
- else {
86
- isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);
87
- }
88
- return {
89
- formattedValue: this.value(cellDate),
90
- id: `${cellUID}${otherMonth ? cellDate.getTime() + '1' : cellDate.getTime()}`,
91
- isFocused: this.isEqual(cellDate, focusedDate),
92
- isSelected: isActiveView && selectedDates.some(date => this.isEqual(cellDate, date)),
93
- isWeekend: this.isWeekend(cellDate),
94
- isRangeStart: isRangeStart,
95
- isRangeMid: isRangeMid,
96
- isRangeEnd: isRangeEnd,
97
- isRangeSplitStart: isRangeMid && this.isEqual(cellDate, firstMonthDate),
98
- isRangeSplitEnd: isRangeMid && this.isEqual(cellDate, lastMonthDate),
99
- isToday: this.isEqual(cellDate, today),
100
- title: this.cellTitle(cellDate),
101
- value: cellDate,
102
- isDisabled: isDateDisabled(cellDate),
103
- isOtherMonth: otherMonth,
104
- allowReverse: allowReverse
105
- };
106
- });
107
- });
108
- }
109
- isEqual(candidate, expected) {
110
- if (!candidate || !expected) {
111
- return false;
112
- }
113
- return getDate(candidate).getTime() === getDate(expected).getTime();
114
- }
115
- isInArray(date, dates) {
116
- if (dates.length === 0) {
117
- return false;
118
- }
119
- const lowerBound = this.beginningOfPeriod(dates[0]);
120
- const upperBound = this.beginningOfPeriod(addMonths(dates[dates.length - 1], 1));
121
- return lowerBound <= date && date < upperBound;
122
- }
123
- isInRange(candidate, min, max) {
124
- const value = getDate(candidate);
125
- const aboveMin = !min || getDate(min) <= value;
126
- const belowMax = !max || value <= getDate(max);
127
- return aboveMin && belowMax;
128
- }
129
- beginningOfPeriod(date) {
130
- if (!date) {
131
- return date;
132
- }
133
- return createDate(date.getFullYear(), date.getMonth(), 1);
134
- }
135
- lastDayOfPeriod(date) {
136
- return lastDayOfMonth(date);
137
- }
138
- isRangeStart(value) {
139
- return !value.getMonth();
140
- }
141
- move(value, action) {
142
- const modifier = ACTIONS[action];
143
- if (!modifier) {
144
- return value;
145
- }
146
- return modifier(value);
147
- }
148
- cellTitle(value) {
149
- return this._intlService.formatDate(value, 'D');
150
- }
151
- navigationTitle(value) {
152
- if (!value) {
153
- return '';
154
- }
155
- return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];
156
- }
157
- title(current) {
158
- return `${this.wideMonthNames()[current.getMonth()]} ${current.getFullYear()}`;
159
- }
160
- rowLength(options = {}) {
161
- return CELLS_LENGTH + (options.prependCell ? 1 : 0);
162
- }
163
- skip(value, min) {
164
- return durationInMonths(min, value);
165
- }
166
- total(min, max) {
167
- return durationInMonths(min, max) + 1;
168
- }
169
- value(current) {
170
- return current ? current.getDate().toString() : "";
171
- }
172
- viewDate(date, max, viewsCount = 1) {
173
- const viewsInRange = this.total(date, max);
174
- if (viewsInRange < viewsCount) {
175
- const monthsToSubtract = viewsCount - viewsInRange;
176
- return addMonths(date, -1 * monthsToSubtract);
177
- }
178
- return date;
179
- }
180
- isWeekend(date) {
181
- const { start, end } = this._intlService.weekendRange();
182
- const day = date.getDay();
183
- if (end < start) {
184
- return day <= end || start <= day;
185
- }
186
- return start <= day && day <= end;
187
- }
188
- dateRange = (start, end) => {
189
- if (!isPresent(start) || !isPresent(end)) {
190
- return [];
191
- }
192
- const result = [];
193
- let current = start;
194
- while (current <= end) {
195
- result.push(current);
196
- current = addDays(current, 1);
197
- }
198
- return result;
199
- };
200
- abbrMonthNames() {
201
- return this._intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' });
202
- }
203
- normalize(cellDate, min, max) {
204
- if (cellDate < min && this.isEqual(cellDate, min)) {
205
- return cloneDate(min);
206
- }
207
- if (cellDate > max && this.isEqual(cellDate, max)) {
208
- return cloneDate(max);
209
- }
210
- return cellDate;
211
- }
212
- wideMonthNames() {
213
- return this._intlService.dateFormatNames({ nameType: 'wide', type: 'months' });
214
- }
215
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MonthViewService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
216
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MonthViewService, providedIn: 'root' });
217
- }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MonthViewService, decorators: [{
219
- type: Injectable,
220
- args: [{
221
- providedIn: 'root'
222
- }]
223
- }], ctorParameters: () => [{ type: i1.IntlService }] });
@@ -1,60 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable } from '@angular/core';
6
- import { Action } from '../models/navigation-action.enum';
7
- import { BusViewService } from '../services/bus-view.service';
8
- import { normalizeKeys } from '@progress/kendo-angular-common';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "../services/bus-view.service";
11
- const KEY_TO_ACTION = {
12
- 'PageUp': Action.PrevView,
13
- 'PageDown': Action.NextView,
14
- 'End': Action.LastInView,
15
- 'Home': Action.FirstInView,
16
- 'ArrowLeft': Action.Left,
17
- 'ArrowUp': Action.Up,
18
- 'ArrowRight': Action.Right,
19
- 'ArrowDown': Action.Down,
20
- 'meta+ArrowUp': Action.UpperView,
21
- 'meta+ArrowDown': Action.LowerView
22
- };
23
- /**
24
- * @hidden
25
- */
26
- export class NavigationService {
27
- bus;
28
- constructor(bus) {
29
- this.bus = bus;
30
- }
31
- action(event) {
32
- // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
33
- const code = normalizeKeys(event);
34
- const action = `${event.ctrlKey || event.metaKey ? 'meta+' : ''}${code}`;
35
- return KEY_TO_ACTION[action];
36
- }
37
- move(value, action, activeView) {
38
- const service = this.bus.service(activeView);
39
- if (!service) {
40
- return value;
41
- }
42
- if (action === Action.UpperView && this.bus.canMoveUp(activeView)) {
43
- this.bus.moveUp(activeView);
44
- return value;
45
- }
46
- if (action === Action.LowerView && this.bus.canMoveDown(activeView)) {
47
- this.bus.moveDown(activeView);
48
- return value;
49
- }
50
- return service.move(value, action);
51
- }
52
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, deps: [{ token: i1.BusViewService }], target: i0.ɵɵFactoryTarget.Injectable });
53
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, providedIn: 'root' });
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, decorators: [{
56
- type: Injectable,
57
- args: [{
58
- providedIn: 'root'
59
- }]
60
- }], ctorParameters: () => [{ type: i1.BusViewService }] });
@@ -1,89 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable, NgZone } from '@angular/core';
6
- import { CalendarDOMService } from './dom.service';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "./dom.service";
9
- const divideByMagnitude = (magnitude) => x => Math.floor(x / magnitude);
10
- const powerByMagnitude = (magnitude) => x => x * magnitude;
11
- /**
12
- * @hidden
13
- */
14
- export class ScrollSyncService {
15
- dom;
16
- zone;
17
- divideByMagnitude;
18
- powerByMagnitude;
19
- navSubscription;
20
- viewSubscription;
21
- navigator;
22
- view;
23
- constructor(dom, zone) {
24
- this.dom = dom;
25
- this.zone = zone;
26
- }
27
- configure(activeView) {
28
- const magnitude = Math.max(this.dom.viewHeight(activeView) / this.dom.navigationItemHeight, 1);
29
- this.divideByMagnitude = divideByMagnitude(magnitude);
30
- this.powerByMagnitude = powerByMagnitude(magnitude);
31
- }
32
- sync(navigator, view) {
33
- this.unsubscribe();
34
- if (!navigator || !view) {
35
- return;
36
- }
37
- this.navigator = navigator;
38
- this.view = view;
39
- this.zone.runOutsideAngular(() => {
40
- let navScrolled, monthScrolled;
41
- this.navSubscription = navigator.scroll$()
42
- .subscribe((e) => {
43
- if (monthScrolled) {
44
- monthScrolled = false;
45
- return;
46
- }
47
- navScrolled = true;
48
- this.scrollSiblingOf(e.target);
49
- });
50
- this.viewSubscription = view.scroll$()
51
- .subscribe((e) => {
52
- if (navScrolled) {
53
- navScrolled = false;
54
- return;
55
- }
56
- monthScrolled = true;
57
- this.scrollSiblingOf(e.target);
58
- });
59
- });
60
- }
61
- scrollSiblingOf(scrolledElement) {
62
- const component = this.siblingComponent(scrolledElement);
63
- const scrollTop = this.calculateScroll(component, scrolledElement.scrollTop);
64
- component.scrollTo(scrollTop);
65
- }
66
- siblingComponent(scrollableElement) {
67
- return this.navigator.container.nativeElement === scrollableElement ? this.view : this.navigator;
68
- }
69
- calculateScroll(component, scrollTop) {
70
- const modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;
71
- return modifier(scrollTop);
72
- }
73
- destroy() {
74
- this.unsubscribe();
75
- }
76
- unsubscribe() {
77
- if (this.navSubscription) {
78
- this.navSubscription.unsubscribe();
79
- }
80
- if (this.viewSubscription) {
81
- this.viewSubscription.unsubscribe();
82
- }
83
- }
84
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollSyncService, deps: [{ token: i1.CalendarDOMService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
85
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollSyncService });
86
- }
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollSyncService, decorators: [{
88
- type: Injectable
89
- }], ctorParameters: () => [{ type: i1.CalendarDOMService }, { type: i0.NgZone }] });
@@ -1,62 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable } from '@angular/core';
6
- import { isEqual } from '@progress/kendo-date-math';
7
- import { last, sortDates } from '../../util';
8
- import { BusViewService } from './bus-view.service';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "./bus-view.service";
11
- /**
12
- * @hidden
13
- */
14
- export class SelectionService {
15
- bus;
16
- constructor(bus) {
17
- this.bus = bus;
18
- }
19
- lastClicked;
20
- performSelection(args) {
21
- /* eslint prefer-const: ["error", {"destructuring": "all"}] */
22
- let { date, modifiers, selectionMode, activeViewEnum, rangePivot } = args;
23
- let selectedDates = args.selectedDates.slice();
24
- if (selectionMode === 'multiple') {
25
- if (modifiers.ctrlKey || modifiers.metaKey) {
26
- if (this.isDateSelected(selectedDates, date)) {
27
- selectedDates = selectedDates.filter(item => !isEqual(item, date));
28
- }
29
- else {
30
- selectedDates.push(date);
31
- }
32
- rangePivot = date;
33
- }
34
- else if (modifiers.shiftKey) {
35
- const [start, end] = sortDates([rangePivot || date, date]);
36
- selectedDates = this.bus.service(activeViewEnum).dateRange(start, end);
37
- rangePivot = date > selectedDates[0] ? selectedDates[0] : last(selectedDates);
38
- if (modifiers.anyArrow) {
39
- const [start, end] = sortDates([this.lastClicked || date, date]);
40
- selectedDates = this.bus.service(0).dateRange(start, end);
41
- }
42
- }
43
- else {
44
- selectedDates = [date];
45
- rangePivot = date;
46
- }
47
- }
48
- else {
49
- selectedDates = [date];
50
- rangePivot = date;
51
- }
52
- return { selectedDates, rangePivot };
53
- }
54
- isDateSelected(selectedDates, date) {
55
- return selectedDates.some(item => isEqual(item, date));
56
- }
57
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectionService, deps: [{ token: i1.BusViewService }], target: i0.ɵɵFactoryTarget.Injectable });
58
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectionService });
59
- }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectionService, decorators: [{
61
- type: Injectable
62
- }], ctorParameters: () => [{ type: i1.BusViewService }] });
@@ -1,33 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable } from '@angular/core';
6
- import { IntlService } from '@progress/kendo-angular-intl';
7
- import { shiftWeekNames } from '../../util';
8
- import * as i0 from "@angular/core";
9
- import * as i1 from "@progress/kendo-angular-intl";
10
- /**
11
- * @hidden
12
- * @deprecated
13
- *
14
- * This service is deprecated and will be removed in a future major version release.
15
- */
16
- export class WeekNamesService {
17
- intl;
18
- constructor(intl) {
19
- this.intl = intl;
20
- }
21
- getWeekNames(includeWeekNumber = false, nameType) {
22
- const weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: nameType, type: 'days' }), this.intl.firstDay());
23
- return includeWeekNumber ? [''].concat(weekNames) : weekNames;
24
- }
25
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeekNamesService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
26
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeekNamesService, providedIn: 'root' });
27
- }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeekNamesService, decorators: [{
29
- type: Injectable,
30
- args: [{
31
- providedIn: 'root'
32
- }]
33
- }], ctorParameters: () => [{ type: i1.IntlService }] });
@@ -1,204 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable } from '@angular/core';
6
- import { IntlService } from '@progress/kendo-angular-intl';
7
- import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastDayOfMonth, lastMonthOfYear } from '@progress/kendo-date-math';
8
- import { Action } from '../models/navigation-action.enum';
9
- import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
10
- import { getToday, isInSelectionRange, range } from '../../util';
11
- import { isPresent } from '../../common/utils';
12
- import * as i0 from "@angular/core";
13
- import * as i1 from "@progress/kendo-angular-intl";
14
- const EMPTY_DATA = [[]];
15
- const CELLS_LENGTH = 4;
16
- const ROWS_LENGTH = 3;
17
- const ACTIONS = {
18
- [Action.Left]: (date) => addMonths(date, -1),
19
- [Action.Up]: (date) => addMonths(date, -4),
20
- [Action.Right]: (date) => addMonths(date, 1),
21
- [Action.Down]: (date) => addMonths(date, 4),
22
- [Action.PrevView]: (date) => addYears(date, -1),
23
- [Action.NextView]: (date) => addYears(date, 1),
24
- [Action.FirstInView]: (date) => firstMonthOfYear(date),
25
- [Action.LastInView]: (date) => lastMonthOfYear(date)
26
- };
27
- /**
28
- * @hidden
29
- */
30
- export class YearViewService {
31
- _intlService;
32
- constructor(_intlService) {
33
- this._intlService = _intlService;
34
- }
35
- addToDate(min, skip) {
36
- return addYears(min, skip);
37
- }
38
- datesList(start, count) {
39
- return range(0, count).map(i => addYears(start, i));
40
- }
41
- data(options) {
42
- const { cellUID, focusedDate, isActiveView, max, min, selectedDates, selectionRange = EMPTY_SELECTIONRANGE, viewDate, allowReverse } = options;
43
- if (!viewDate) {
44
- return EMPTY_DATA;
45
- }
46
- const months = this.abbrMonthNames();
47
- const firstDate = firstMonthOfYear(viewDate);
48
- const lastDate = lastMonthOfYear(viewDate);
49
- const currentYear = firstDate.getFullYear();
50
- const cells = range(0, CELLS_LENGTH);
51
- const today = getToday();
52
- return range(0, ROWS_LENGTH).map(rowOffset => {
53
- const baseDate = addMonths(firstDate, rowOffset * CELLS_LENGTH);
54
- return cells.map(cellOffset => {
55
- const cellDate = this.normalize(addMonths(baseDate, cellOffset), min, max);
56
- const changedYear = currentYear < cellDate.getFullYear();
57
- if (!this.isInRange(cellDate, min, max) || changedYear) {
58
- return null;
59
- }
60
- let isRangeStart = false;
61
- let isRangeEnd = false;
62
- if (allowReverse) {
63
- if ((this.isEqual(cellDate, selectionRange.start) && selectionRange.start <= selectionRange.end) ||
64
- (this.isEqual(cellDate, selectionRange.end) && selectionRange.end <= selectionRange.start)) {
65
- isRangeStart = true;
66
- }
67
- if ((this.isEqual(cellDate, selectionRange.start) && selectionRange.start >= selectionRange.end) ||
68
- (this.isEqual(cellDate, selectionRange.end) && selectionRange.end >= selectionRange.start)) {
69
- isRangeEnd = true;
70
- }
71
- }
72
- else {
73
- isRangeStart = this.isEqual(cellDate, selectionRange.start);
74
- isRangeEnd = this.isEqual(cellDate, selectionRange.end);
75
- }
76
- const isInMiddle = !isRangeStart && !isRangeEnd;
77
- let isRangeMid;
78
- if (allowReverse) {
79
- isRangeMid = isInMiddle && (isInSelectionRange(cellDate, selectionRange) || isInSelectionRange(cellDate, { start: selectionRange.end, end: selectionRange.start }));
80
- }
81
- else {
82
- isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);
83
- }
84
- return {
85
- formattedValue: months[cellDate.getMonth()],
86
- id: `${cellUID}${cellDate.getTime()}`,
87
- isFocused: this.isEqual(cellDate, focusedDate),
88
- isSelected: isActiveView && selectedDates.some(date => this.isEqual(cellDate, date)),
89
- isWeekend: false,
90
- isRangeStart: isRangeStart,
91
- isRangeMid: isRangeMid,
92
- isRangeEnd: isRangeEnd,
93
- isRangeSplitEnd: isRangeMid && this.isEqual(cellDate, lastDate),
94
- isRangeSplitStart: isRangeMid && this.isEqual(cellDate, firstDate),
95
- isToday: this.isEqual(cellDate, today),
96
- title: this.cellTitle(cellDate),
97
- value: cellDate,
98
- allowReverse: allowReverse
99
- };
100
- });
101
- });
102
- }
103
- isEqual(candidate, expected) {
104
- if (!candidate || !expected) {
105
- return false;
106
- }
107
- return candidate.getFullYear() === expected.getFullYear() &&
108
- candidate.getMonth() === expected.getMonth();
109
- }
110
- isInArray(date, dates) {
111
- if (!dates.length) {
112
- return false;
113
- }
114
- const year = date.getFullYear();
115
- return dates[0].getFullYear() <= year && year <= dates[dates.length - 1].getFullYear();
116
- }
117
- isInRange(candidate, min, max) {
118
- const candidateValue = createDate(candidate.getFullYear(), candidate.getMonth(), 1);
119
- const aboveMin = !min || createDate(min.getFullYear(), min.getMonth(), 1) <= candidateValue;
120
- const belowMax = !max || candidateValue <= createDate(max.getFullYear(), max.getMonth(), 1);
121
- return aboveMin && belowMax;
122
- }
123
- beginningOfPeriod(date) {
124
- if (!date) {
125
- return date;
126
- }
127
- return createDate(date.getFullYear(), 0, 1);
128
- }
129
- lastDayOfPeriod(date) {
130
- const month = lastMonthOfYear(date);
131
- return lastDayOfMonth(month);
132
- }
133
- isRangeStart(value) {
134
- return value.getFullYear() % 10 === 0;
135
- }
136
- move(value, action) {
137
- const modifier = ACTIONS[action];
138
- if (!modifier) {
139
- return value;
140
- }
141
- return modifier(value);
142
- }
143
- cellTitle(value) {
144
- return `${value.getFullYear()} ${this.value(value)}`;
145
- }
146
- navigationTitle(value) {
147
- return this.title(value);
148
- }
149
- title(current) {
150
- return current ? current.getFullYear().toString() : '';
151
- }
152
- rowLength() {
153
- return CELLS_LENGTH;
154
- }
155
- skip(value, min) {
156
- return durationInYears(min, value);
157
- }
158
- total(min, max) {
159
- return durationInYears(min, max) + 1;
160
- }
161
- value(current) {
162
- return current ? this.abbrMonthNames()[current.getMonth()] : '';
163
- }
164
- viewDate(date, max, viewsCount = 1) {
165
- const viewsInRange = this.total(date, max);
166
- if (viewsInRange < viewsCount) {
167
- const yearsToSubtract = viewsCount - viewsInRange;
168
- return addYears(date, -1 * yearsToSubtract);
169
- }
170
- return date;
171
- }
172
- dateRange = (start, end) => {
173
- if (!isPresent(start) || !isPresent(end)) {
174
- return [];
175
- }
176
- const result = [];
177
- let current = start;
178
- while (current <= end) {
179
- result.push(current);
180
- current = addMonths(current, 1);
181
- }
182
- return result;
183
- };
184
- abbrMonthNames() {
185
- return this._intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' });
186
- }
187
- normalize(cellDate, min, max) {
188
- if (cellDate < min && this.isEqual(cellDate, min)) {
189
- return cloneDate(min);
190
- }
191
- if (cellDate > max && this.isEqual(cellDate, max)) {
192
- return cloneDate(max);
193
- }
194
- return cellDate;
195
- }
196
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: YearViewService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
197
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: YearViewService, providedIn: 'root' });
198
- }
199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: YearViewService, decorators: [{
200
- type: Injectable,
201
- args: [{
202
- providedIn: 'root'
203
- }]
204
- }], ctorParameters: () => [{ type: i1.IntlService }] });