@progress/kendo-angular-scheduler 21.4.1-develop.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 (197) hide show
  1. package/editing/recurrence/localization/messages.d.ts +1 -1
  2. package/editing/resource-editor-base.d.ts +1 -1
  3. package/editing-directives/editing-directive-base.d.ts +1 -1
  4. package/fesm2022/progress-kendo-angular-scheduler.mjs +313 -313
  5. package/localization/messages.d.ts +1 -1
  6. package/package.json +20 -28
  7. package/schematics/ngAdd/index.js +3 -3
  8. package/views/common/base-view.d.ts +1 -1
  9. package/views/common/configuration-view-base.d.ts +1 -1
  10. package/views/day-time/day-time-view-base.d.ts +1 -1
  11. package/views/day-time/day-time-view.component.d.ts +1 -1
  12. package/views/multi-day/multi-day-view-base.d.ts +1 -1
  13. package/views/timeline/timeline-base.d.ts +1 -1
  14. package/views/view-items/base-slot.directive.d.ts +1 -1
  15. package/views/view-items/base-view-item.d.ts +1 -1
  16. package/esm2022/common/constants.mjs +0 -8
  17. package/esm2022/common/default-model-fields.mjs +0 -20
  18. package/esm2022/common/dom-queries.mjs +0 -107
  19. package/esm2022/common/modifiers.mjs +0 -31
  20. package/esm2022/common/util.mjs +0 -227
  21. package/esm2022/data-binding.directive.mjs +0 -162
  22. package/esm2022/directives.mjs +0 -136
  23. package/esm2022/editing/date-time-picker.component.mjs +0 -190
  24. package/esm2022/editing/dialogs.service.mjs +0 -96
  25. package/esm2022/editing/edit-dialog-template.directive.mjs +0 -53
  26. package/esm2022/editing/edit-dialog.component.mjs +0 -679
  27. package/esm2022/editing/edit.service.mjs +0 -107
  28. package/esm2022/editing/local-data-changes.service.mjs +0 -18
  29. package/esm2022/editing/recurrence/end-rule-radio-button.directive.mjs +0 -77
  30. package/esm2022/editing/recurrence/localization/custom-messages.component.mjs +0 -44
  31. package/esm2022/editing/recurrence/localization/localized-messages.directive.mjs +0 -39
  32. package/esm2022/editing/recurrence/localization/messages.mjs +0 -239
  33. package/esm2022/editing/recurrence/localization/recurrence-localization.service.mjs +0 -47
  34. package/esm2022/editing/recurrence/recurrence-editor.component.mjs +0 -497
  35. package/esm2022/editing/recurrence/recurrence-end-rule-editor.component.mjs +0 -334
  36. package/esm2022/editing/recurrence/recurrence-frequency-editor.component.mjs +0 -105
  37. package/esm2022/editing/recurrence/recurrence-interval-editor.component.mjs +0 -169
  38. package/esm2022/editing/recurrence/recurrence-monthly-yearly-editor.component.mjs +0 -468
  39. package/esm2022/editing/recurrence/recurrence-weekday-rule-editor.component.mjs +0 -138
  40. package/esm2022/editing/recurrence/recurrence.service.mjs +0 -254
  41. package/esm2022/editing/recurrence/repeat-on-radio-button.directive.mjs +0 -81
  42. package/esm2022/editing/resource-editor-base.mjs +0 -59
  43. package/esm2022/editing/resource-multiple-editor.component.mjs +0 -101
  44. package/esm2022/editing/resource-single-editor.component.mjs +0 -82
  45. package/esm2022/editing/timezone-editor.component.mjs +0 -193
  46. package/esm2022/editing-directives/base-edit.service.mjs +0 -320
  47. package/esm2022/editing-directives/edit-service.interface.mjs +0 -5
  48. package/esm2022/editing-directives/editing-directive-base.mjs +0 -242
  49. package/esm2022/editing-directives/local-edit.service.mjs +0 -122
  50. package/esm2022/editing-directives/reactive-editing.directive.mjs +0 -132
  51. package/esm2022/editing-directives/utils.mjs +0 -107
  52. package/esm2022/events/add-event.mjs +0 -26
  53. package/esm2022/events/cancel-event.mjs +0 -14
  54. package/esm2022/events/create-event.mjs +0 -40
  55. package/esm2022/events/date-change-event.mjs +0 -29
  56. package/esm2022/events/drag-end-event.mjs +0 -46
  57. package/esm2022/events/drag-event.mjs +0 -54
  58. package/esm2022/events/drag-start-event.mjs +0 -30
  59. package/esm2022/events/edit-event-base.mjs +0 -32
  60. package/esm2022/events/edit-event.mjs +0 -30
  61. package/esm2022/events/event-click-event.mjs +0 -32
  62. package/esm2022/events/event-keydown-event.mjs +0 -28
  63. package/esm2022/events/more-events-click.mjs +0 -24
  64. package/esm2022/events/navigate-event.mjs +0 -26
  65. package/esm2022/events/preventable-event.mjs +0 -28
  66. package/esm2022/events/remove-event.mjs +0 -30
  67. package/esm2022/events/resize-end-event.mjs +0 -38
  68. package/esm2022/events/resize-event.mjs +0 -46
  69. package/esm2022/events/resize-start-event.mjs +0 -30
  70. package/esm2022/events/save-event.mjs +0 -18
  71. package/esm2022/events/slot-click-event.mjs +0 -44
  72. package/esm2022/events/slot-drag-end-event.mjs +0 -10
  73. package/esm2022/events/slot-drag-event.mjs +0 -40
  74. package/esm2022/events/slot-drag-start-event.mjs +0 -44
  75. package/esm2022/events/view-event-map.mjs +0 -35
  76. package/esm2022/events.mjs +0 -27
  77. package/esm2022/index.mjs +0 -83
  78. package/esm2022/loading.component.mjs +0 -52
  79. package/esm2022/localization/custom-messages.component.mjs +0 -56
  80. package/esm2022/localization/localized-messages.directive.mjs +0 -39
  81. package/esm2022/localization/messages.mjs +0 -614
  82. package/esm2022/localization/scheduler-localization.service.mjs +0 -31
  83. package/esm2022/navigation/focus-position.interface.mjs +0 -5
  84. package/esm2022/navigation/focus.service.mjs +0 -202
  85. package/esm2022/navigation/focusable-element.interface.mjs +0 -5
  86. package/esm2022/navigation/focusable.directive.mjs +0 -98
  87. package/esm2022/navigation/shortcuts.directive.mjs +0 -239
  88. package/esm2022/navigation.mjs +0 -6
  89. package/esm2022/package-metadata.mjs +0 -16
  90. package/esm2022/pdf/pdf-command.directive.mjs +0 -96
  91. package/esm2022/pdf/pdf-export-event.mjs +0 -10
  92. package/esm2022/pdf/pdf.component.mjs +0 -241
  93. package/esm2022/pdf/pdf.module.mjs +0 -42
  94. package/esm2022/pdf/pdf.service.mjs +0 -36
  95. package/esm2022/progress-kendo-angular-scheduler.mjs +0 -8
  96. package/esm2022/scheduler.component.mjs +0 -1981
  97. package/esm2022/scheduler.module.mjs +0 -138
  98. package/esm2022/toolbar/navigation.component.mjs +0 -391
  99. package/esm2022/toolbar/toolbar-context.mjs +0 -5
  100. package/esm2022/toolbar/toolbar-template.directive.mjs +0 -50
  101. package/esm2022/toolbar/toolbar.component.mjs +0 -168
  102. package/esm2022/toolbar/toolbar.service.mjs +0 -46
  103. package/esm2022/toolbar/view-selector.component.mjs +0 -181
  104. package/esm2022/types/actions.mjs +0 -5
  105. package/esm2022/types/create-form-group-args.interface.mjs +0 -5
  106. package/esm2022/types/crud-operation.enum.mjs +0 -18
  107. package/esm2022/types/current-time-settings.interface.mjs +0 -5
  108. package/esm2022/types/date-range.interface.mjs +0 -5
  109. package/esm2022/types/datepicker-options.interface.mjs +0 -5
  110. package/esm2022/types/edit-event-args.interface.mjs +0 -5
  111. package/esm2022/types/edit-mode.enum.mjs +0 -23
  112. package/esm2022/types/editable-settings.interface.mjs +0 -5
  113. package/esm2022/types/event-style-args.interface.mjs +0 -5
  114. package/esm2022/types/focusable-container.mjs +0 -5
  115. package/esm2022/types/group.interface.mjs +0 -5
  116. package/esm2022/types/numeric-options.interface.mjs +0 -5
  117. package/esm2022/types/ongoing-events-settings.interface.mjs +0 -5
  118. package/esm2022/types/resource.interface.mjs +0 -5
  119. package/esm2022/types/scheduler-event.mjs +0 -5
  120. package/esm2022/types/scheduler-model-fields.interface.mjs +0 -5
  121. package/esm2022/types/scheduler-slot.interface.mjs +0 -5
  122. package/esm2022/types/scheduler-view.mjs +0 -9
  123. package/esm2022/types/slot-class-args.interface.mjs +0 -5
  124. package/esm2022/types/slot-selection.mjs +0 -35
  125. package/esm2022/types/view-item.interface.mjs +0 -5
  126. package/esm2022/types.mjs +0 -12
  127. package/esm2022/views/agenda/agenda-header-item.component.mjs +0 -85
  128. package/esm2022/views/agenda/agenda-header.component.mjs +0 -75
  129. package/esm2022/views/agenda/agenda-task-item.component.mjs +0 -137
  130. package/esm2022/views/agenda/agenda-view-internal.component.mjs +0 -424
  131. package/esm2022/views/agenda/agenda-view-list.component.mjs +0 -256
  132. package/esm2022/views/agenda/agenda-view.component.mjs +0 -130
  133. package/esm2022/views/agenda/tasks.collection.mjs +0 -96
  134. package/esm2022/views/agenda/utils.mjs +0 -176
  135. package/esm2022/views/common/base-view.mjs +0 -1099
  136. package/esm2022/views/common/configuration-view-base.mjs +0 -164
  137. package/esm2022/views/common/dom-events.service.mjs +0 -22
  138. package/esm2022/views/common/hint-container.component.mjs +0 -41
  139. package/esm2022/views/common/repeat.pipe.mjs +0 -36
  140. package/esm2022/views/common/resize-hint.component.mjs +0 -97
  141. package/esm2022/views/common/resource-iterator.pipe.mjs +0 -49
  142. package/esm2022/views/common/scheduler-task.mjs +0 -5
  143. package/esm2022/views/common/slot-selectable.directive.mjs +0 -137
  144. package/esm2022/views/common/view-footer.component.mjs +0 -103
  145. package/esm2022/views/common/work-hours-footer.directive.mjs +0 -45
  146. package/esm2022/views/constants.mjs +0 -31
  147. package/esm2022/views/day-time/day-time-slot.service.mjs +0 -633
  148. package/esm2022/views/day-time/day-time-view-base.mjs +0 -244
  149. package/esm2022/views/day-time/day-time-view-item.component.mjs +0 -216
  150. package/esm2022/views/day-time/day-time-view.component.mjs +0 -437
  151. package/esm2022/views/day-time/event-slot.directive.mjs +0 -138
  152. package/esm2022/views/day-time/utils.mjs +0 -32
  153. package/esm2022/views/month/month-slot.component.mjs +0 -166
  154. package/esm2022/views/month/month-slot.service.mjs +0 -404
  155. package/esm2022/views/month/month-view-item.component.mjs +0 -161
  156. package/esm2022/views/month/month-view-renderer.component.mjs +0 -683
  157. package/esm2022/views/month/month-view.component.mjs +0 -203
  158. package/esm2022/views/month/multi-week-view.component.mjs +0 -202
  159. package/esm2022/views/month/utils.mjs +0 -107
  160. package/esm2022/views/multi-day/day-view.component.mjs +0 -186
  161. package/esm2022/views/multi-day/multi-day-view-base.mjs +0 -55
  162. package/esm2022/views/multi-day/multi-day-view-renderer.component.mjs +0 -1002
  163. package/esm2022/views/multi-day/multi-day-view.component.mjs +0 -197
  164. package/esm2022/views/multi-day/utils.mjs +0 -63
  165. package/esm2022/views/multi-day/week-view.component.mjs +0 -189
  166. package/esm2022/views/multi-day/work-week-view.component.mjs +0 -172
  167. package/esm2022/views/scheduler-view.directive.mjs +0 -65
  168. package/esm2022/views/templates/agenda-date-template.directive.mjs +0 -41
  169. package/esm2022/views/templates/agenda-time-template.directive.mjs +0 -46
  170. package/esm2022/views/templates/all-day-event-template.directive.mjs +0 -42
  171. package/esm2022/views/templates/all-day-slot-template.directive.mjs +0 -42
  172. package/esm2022/views/templates/date-header-template.directive.mjs +0 -42
  173. package/esm2022/views/templates/event-template.directive.mjs +0 -42
  174. package/esm2022/views/templates/group-header-template.directive.mjs +0 -42
  175. package/esm2022/views/templates/major-time-header-template.directive.mjs +0 -41
  176. package/esm2022/views/templates/minor-time-header-template.directive.mjs +0 -41
  177. package/esm2022/views/templates/month-day-slot-template.directive.mjs +0 -42
  178. package/esm2022/views/templates/multi-week-day-slot-template.directive.mjs +0 -42
  179. package/esm2022/views/templates/time-slot-template.directive.mjs +0 -43
  180. package/esm2022/views/templates.mjs +0 -16
  181. package/esm2022/views/timeline/timeline-base.mjs +0 -39
  182. package/esm2022/views/timeline/timeline-month-view.component.mjs +0 -211
  183. package/esm2022/views/timeline/timeline-multi-day-view.component.mjs +0 -649
  184. package/esm2022/views/timeline/timeline-view.component.mjs +0 -189
  185. package/esm2022/views/timeline/timeline-week-view.component.mjs +0 -181
  186. package/esm2022/views/timeline/utils.mjs +0 -60
  187. package/esm2022/views/utils.mjs +0 -373
  188. package/esm2022/views/view-context.service.mjs +0 -111
  189. package/esm2022/views/view-items/base-slot.directive.mjs +0 -104
  190. package/esm2022/views/view-items/base-slot.service.mjs +0 -82
  191. package/esm2022/views/view-items/base-view-item.mjs +0 -194
  192. package/esm2022/views/view-items/item-map.mjs +0 -38
  193. package/esm2022/views/view-items/types.mjs +0 -5
  194. package/esm2022/views/view-state.service.mjs +0 -144
  195. package/esm2022/views/year/utils.mjs +0 -60
  196. package/esm2022/views/year/year-view-internal.component.mjs +0 -471
  197. package/esm2022/views/year/year-view.component.mjs +0 -136
@@ -1,194 +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 { ElementRef, Input, HostBinding, Renderer2, TemplateRef, Directive } from '@angular/core';
6
- import { anyChanged } from '@progress/kendo-angular-common';
7
- import { LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { Subscription } from 'rxjs';
9
- import { BaseSlotService } from './base-slot.service';
10
- import { isRecurrence, isRecurrenceException, formatEventTime } from '../utils';
11
- import { FocusService } from '../../navigation';
12
- import { toLocalDate } from '@progress/kendo-date-math';
13
- import { caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
14
- import { IntlService } from '@progress/kendo-angular-intl';
15
- import * as i0 from "@angular/core";
16
- import * as i1 from "./base-slot.service";
17
- import * as i2 from "@progress/kendo-angular-l10n";
18
- import * as i3 from "../../navigation";
19
- import * as i4 from "@progress/kendo-angular-intl";
20
- /**
21
- * @hidden
22
- */
23
- export class BaseViewItem {
24
- slotService;
25
- localization;
26
- focusService;
27
- element;
28
- renderer;
29
- intl;
30
- item;
31
- resourceIndex;
32
- rangeIndex;
33
- index;
34
- eventTemplate;
35
- editable;
36
- dragHint;
37
- resources;
38
- className = true;
39
- get taskIndex() {
40
- return this.item.index;
41
- }
42
- get touchAction() {
43
- return this.editable && this.editable.drag !== false ? 'none' : null;
44
- }
45
- get eventTitle() {
46
- const startTime = toLocalDate(this.item.startTime);
47
- const endTime = toLocalDate(this.item.endTime);
48
- const time = formatEventTime(startTime, endTime, this.item.isAllDay, this.intl.localeId);
49
- return `${time}, ${this.item.event.title}`;
50
- }
51
- get deleteMessage() {
52
- return this.localization.get('deleteTitle');
53
- }
54
- get resizable() {
55
- return this.editable && this.editable.resize !== false;
56
- }
57
- get removable() {
58
- return this.editable && this.editable.remove !== false;
59
- }
60
- caretAltLeftIcon = caretAltLeftIcon;
61
- caretAltRightIcon = caretAltRightIcon;
62
- rect;
63
- subs = new Subscription();
64
- constructor(slotService, localization, focusService, element, renderer, intl) {
65
- this.slotService = slotService;
66
- this.localization = localization;
67
- this.focusService = focusService;
68
- this.element = element;
69
- this.renderer = renderer;
70
- this.intl = intl;
71
- }
72
- get isRecurrence() {
73
- return isRecurrence(this.item);
74
- }
75
- get isRecurrenceException() {
76
- return isRecurrenceException(this.item);
77
- }
78
- get nativeElement() {
79
- if (this.element) {
80
- return this.element.nativeElement;
81
- }
82
- }
83
- setStyles(styles) {
84
- const element = this.nativeElement;
85
- if (element) {
86
- for (const name in styles) {
87
- if (styles.hasOwnProperty(name)) {
88
- this.renderer.setStyle(element, name, styles[name]);
89
- }
90
- }
91
- }
92
- }
93
- toggle(visible) {
94
- this.setStyles({ display: visible ? null : 'none' });
95
- }
96
- reflow() {
97
- const rect = this.rect;
98
- if (rect) {
99
- this.setStyles({
100
- left: !this.localization.rtl ? `${rect.left}px` : '',
101
- right: this.localization.rtl ? `${rect.left}px` : '',
102
- top: `${rect.top}px`,
103
- width: `${rect.width}px`,
104
- height: `${rect.height}px`
105
- });
106
- }
107
- }
108
- ngOnInit() {
109
- if (this.dragHint) {
110
- return;
111
- }
112
- this.subs.add(this.slotService.slotsChange.subscribe(() => {
113
- this.rect = null;
114
- this.setStyles({
115
- left: 0,
116
- });
117
- const slotId = { index: this.index, resourceIndex: this.resourceIndex, rangeIndex: this.rangeIndex };
118
- this.slotService.unregisterItem(this, slotId);
119
- if (this.resourceIndex >= 0) {
120
- this.slotService.registerItem(this);
121
- }
122
- }));
123
- }
124
- ngOnChanges(changes) {
125
- if (this.dragHint) {
126
- return;
127
- }
128
- if (anyChanged(['index', 'resourceIndex', 'rangeIndex'], changes)) {
129
- const { resourceIndex, index, rangeIndex } = changes;
130
- const previousResourceIndex = resourceIndex ? resourceIndex.previousValue : this.resourceIndex;
131
- const previousIndex = index ? index.previousValue : this.index;
132
- const previousRangeIndex = rangeIndex ? rangeIndex.previousValue : this.rangeIndex;
133
- const slotId = {
134
- index: previousIndex,
135
- resourceIndex: previousResourceIndex,
136
- rangeIndex: previousRangeIndex
137
- };
138
- this.slotService.unregisterItem(this, slotId);
139
- if (this.resourceIndex >= 0) {
140
- this.slotService.registerItem(this);
141
- this.toggle(true);
142
- }
143
- else {
144
- this.toggle(false);
145
- }
146
- }
147
- }
148
- ngOnDestroy() {
149
- if (this.dragHint) {
150
- return;
151
- }
152
- this.slotService.unregisterItem(this);
153
- this.subs.unsubscribe();
154
- }
155
- get arrowIcons() {
156
- return !this.localization.rtl ? ['caret-alt-left', 'caret-alt-right'] : ['caret-alt-right', 'caret-alt-left'];
157
- }
158
- get arrowSVGIcons() {
159
- return !this.localization.rtl ? [this.caretAltLeftIcon, this.caretAltRightIcon] : [this.caretAltRightIcon, this.caretAltLeftIcon];
160
- }
161
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BaseViewItem, deps: [{ token: i1.BaseSlotService }, { token: i2.LocalizationService }, { token: i3.FocusService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i4.IntlService }], target: i0.ɵɵFactoryTarget.Directive });
162
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: BaseViewItem, inputs: { item: "item", resourceIndex: "resourceIndex", rangeIndex: "rangeIndex", index: "index", eventTemplate: "eventTemplate", editable: "editable", dragHint: "dragHint", resources: "resources" }, host: { properties: { "class.k-event": "this.className", "attr.data-task-index": "this.taskIndex", "style.touch-action": "this.touchAction", "attr.aria-label": "this.eventTitle" } }, usesOnChanges: true, ngImport: i0 });
163
- }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BaseViewItem, decorators: [{
165
- type: Directive
166
- }], ctorParameters: () => [{ type: i1.BaseSlotService }, { type: i2.LocalizationService }, { type: i3.FocusService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i4.IntlService }], propDecorators: { item: [{
167
- type: Input
168
- }], resourceIndex: [{
169
- type: Input
170
- }], rangeIndex: [{
171
- type: Input
172
- }], index: [{
173
- type: Input
174
- }], eventTemplate: [{
175
- type: Input
176
- }], editable: [{
177
- type: Input
178
- }], dragHint: [{
179
- type: Input
180
- }], resources: [{
181
- type: Input
182
- }], className: [{
183
- type: HostBinding,
184
- args: ['class.k-event']
185
- }], taskIndex: [{
186
- type: HostBinding,
187
- args: ['attr.data-task-index']
188
- }], touchAction: [{
189
- type: HostBinding,
190
- args: ['style.touch-action']
191
- }], eventTitle: [{
192
- type: HostBinding,
193
- args: ['attr.aria-label']
194
- }] } });
@@ -1,38 +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
- /**
6
- * @hidden
7
- */
8
- export class ItemMap {
9
- count = 0;
10
- items = {};
11
- get first() {
12
- if (this.count > 0) {
13
- return this.items[Object.keys(this.items)[0]];
14
- }
15
- }
16
- get last() {
17
- if (this.count > 0) {
18
- const keys = Object.keys(this.items);
19
- return this.items[keys[keys.length - 1]];
20
- }
21
- }
22
- addItem(index, item) {
23
- if (!this.items[index]) {
24
- this.count++;
25
- }
26
- this.items[index] = item;
27
- }
28
- removeItem(index, item) {
29
- const current = this.items[index];
30
- if (current === item) {
31
- delete this.items[index];
32
- this.count--;
33
- }
34
- }
35
- toArray() {
36
- return Object.keys(this.items).map(index => this.items[index]);
37
- }
38
- }
@@ -1,5 +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
- export {};
@@ -1,144 +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 { BehaviorSubject, Subject } from 'rxjs';
7
- import * as i0 from "@angular/core";
8
- const emptyDateRange = () => ({
9
- start: new Date(0),
10
- end: new Date(0),
11
- text: '',
12
- shortText: ''
13
- });
14
- /**
15
- * A service for publishing the view state and actions to the Scheduler.
16
- */
17
- export class ViewStateService {
18
- /**
19
- * Represents a stream that publishes the visible date range for the current view to the Scheduler.
20
- */
21
- dateRange;
22
- /**
23
- * Represents a stream that publishes changes to the selected date, which initiate from the view.
24
- */
25
- nextDate;
26
- /**
27
- * Represents a stream for navigating from the current view to another view.
28
- */
29
- navigate;
30
- /**
31
- * Represents a stream that publishes events for navigation between views.
32
- */
33
- viewEvent;
34
- /**
35
- * Represents a stream that indicates when the view layout finishes.
36
- */
37
- layoutEnd;
38
- /**
39
- * Represents a stream that indicates when the view options change.
40
- */
41
- optionsChange;
42
- /**
43
- * Represents a stream that indicates when the user starts a new slot selection.
44
- */
45
- slotSelectionStart;
46
- /**
47
- * Represents a stream that indicates when the user drags over a different slot during selection.
48
- */
49
- slotSelectionDrag;
50
- /**
51
- * Represents a stream that indicates when the user finishes making a slot selection.
52
- */
53
- slotSelectionEnd;
54
- /**
55
- * @hidden
56
- */
57
- toggleWorkHours = new Subject();
58
- /**
59
- * @hidden
60
- */
61
- toolbarVisibilityByView = new Map();
62
- dateRangeSource = new BehaviorSubject(emptyDateRange());
63
- nextDateSource = new Subject();
64
- navigateSource = new Subject();
65
- viewEventSource = new Subject();
66
- layoutEndSource = new Subject();
67
- optionsChangeSource = new Subject();
68
- slotSelectionStartSource = new Subject();
69
- slotSelectionStartDragSource = new Subject();
70
- slotSelectionStartEndSource = new Subject();
71
- constructor() {
72
- this.dateRange = this.dateRangeSource.asObservable();
73
- this.nextDate = this.nextDateSource.asObservable();
74
- this.navigate = this.navigateSource.asObservable();
75
- this.viewEvent = this.viewEventSource.asObservable();
76
- this.layoutEnd = this.layoutEndSource.asObservable();
77
- this.optionsChange = this.optionsChangeSource.asObservable();
78
- this.slotSelectionStart = this.slotSelectionStartSource.asObservable();
79
- this.slotSelectionDrag = this.slotSelectionStartDragSource.asObservable();
80
- this.slotSelectionEnd = this.slotSelectionStartEndSource.asObservable();
81
- }
82
- /**
83
- * Publishes the date that will be displayed by the Scheduler
84
- * typically as a result from processing a navigation action.
85
- */
86
- notifyNextDate(date) {
87
- this.nextDateSource.next(date);
88
- }
89
- /**
90
- * Publishes the visible date range of the view.
91
- * The view will calculate and set the new data range when
92
- * the selected date changes.
93
- */
94
- notifyDateRange(range) {
95
- this.dateRangeSource.next(range);
96
- }
97
- /**
98
- * Notifies the Scheduler that the view has completed its layout.
99
- */
100
- notifyLayoutEnd() {
101
- this.layoutEndSource.next();
102
- }
103
- /**
104
- * Navigates to another view.
105
- */
106
- navigateTo(args) {
107
- this.navigateSource.next(args);
108
- }
109
- /**
110
- * Notifies the Scheduler that the view options have been changed.
111
- */
112
- notifyOptionsChange(changes) {
113
- this.optionsChangeSource.next(changes);
114
- }
115
- /**
116
- * Emits a DOM event to the Scheduler.
117
- */
118
- emitEvent(name, args) {
119
- this.viewEventSource.next({
120
- name: name,
121
- args: args
122
- });
123
- }
124
- /** @hidden */
125
- notifySlotSelectionStart(selection) {
126
- this.slotSelectionStartSource.next(selection);
127
- }
128
- /** @hidden */
129
- notifySlotSelectionDrag(selection) {
130
- this.slotSelectionStartDragSource.next(selection);
131
- }
132
- /** @hidden */
133
- notifySlotSelectionEnd(selection) {
134
- this.slotSelectionStartEndSource.next(selection);
135
- }
136
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ViewStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
137
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ViewStateService, providedIn: 'root' });
138
- }
139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ViewStateService, decorators: [{
140
- type: Injectable,
141
- args: [{
142
- providedIn: 'root'
143
- }]
144
- }], ctorParameters: () => [] });
@@ -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 { intersects, toUTCDate, toUTCDateTime } from '../utils';
6
- import { sortTasksByTime } from '../../common/util';
7
- import { addDays } from '@progress/kendo-date-math';
8
- /**
9
- * @hidden
10
- */
11
- export const createTasks = (periodStart, periodEnd, items, ranges) => {
12
- const tasks = [];
13
- const utcStart = toUTCDateTime(periodStart);
14
- const utcEnd = toUTCDateTime(periodEnd);
15
- for (let index = 0; index < items.length; index++) {
16
- const item = items[index];
17
- const data = {};
18
- const startTime = item.start.toUTCDate();
19
- const end = item.end;
20
- const endTime = (item.end.getTime() !== end.getTime() ? end.addDays(1) : end).toUTCDate();
21
- if (intersects(startTime, endTime, utcStart, utcEnd)) {
22
- for (let rangeIdx = 0; rangeIdx < ranges.length; rangeIdx++) {
23
- const range = ranges[rangeIdx];
24
- const rangeStart = toUTCDate(range);
25
- const rangeEnd = toUTCDate(addDays(range, 1));
26
- if (intersects(startTime, endTime, rangeStart, rangeEnd)) {
27
- const task = {
28
- index,
29
- startTime: startTime > rangeStart ? startTime : rangeStart,
30
- endTime: endTime < rangeEnd ? endTime : rangeEnd,
31
- start: item.start,
32
- end: item.end,
33
- event: item.event,
34
- isAllDay: item.event.isAllDay,
35
- rangeIndex: rangeIdx,
36
- data: data
37
- };
38
- task.head = endTime > rangeEnd && startTime > rangeStart;
39
- task.tail = startTime < rangeStart && endTime < rangeEnd;
40
- task.mid = endTime > rangeEnd && startTime < rangeStart;
41
- task.isMultiDay = task.head || task.mid || task.tail;
42
- tasks.push(task);
43
- }
44
- }
45
- }
46
- }
47
- return sortTasksByTime(tasks);
48
- };
49
- /**
50
- * @hidden
51
- */
52
- export const noop = (_) => { };
53
- /**
54
- * @hidden
55
- */
56
- export const yearEnd = (year) => new Date(year, 11, 31, 23, 59, 59, 999);
57
- /**
58
- * @hidden
59
- */
60
- export const yearStart = (year) => new Date(year, 0, 1, 0, 0, 0, 0);