@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,193 +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 { Injector, ViewChild } from '@angular/core';
6
- import { Component, forwardRef, Input, EventEmitter, Output } from '@angular/core';
7
- import { NG_VALUE_ACCESSOR, NgControl, ReactiveFormsModule } from '@angular/forms';
8
- import { timezoneNames } from '@progress/kendo-date-math';
9
- import { ComboBoxComponent } from '@progress/kendo-angular-dropdowns';
10
- import * as i0 from "@angular/core";
11
- import * as i1 from "@angular/forms";
12
- /**
13
- * @hidden
14
- */
15
- export const TIME_ZONE_VALUE_ACCESSOR = {
16
- multi: true,
17
- provide: NG_VALUE_ACCESSOR,
18
- useExisting: forwardRef(() => TimeZoneEditorComponent)
19
- };
20
- /**
21
- * Represents the Kendo UI TimeZone Editor component for Angular.
22
- *
23
- * Displays a ComboBox for selecting time zone names, used for editing the `start` and `end` time zones of Scheduler events.
24
- *
25
- * @example
26
- * ```html
27
- * <kendo-scheduler>
28
- * <ng-template kendoSchedulerEditDialogTemplate>
29
- * <div> Select Time Zone:
30
- * <kendo-timezone-editor></kendo-timezone-editor>
31
- * </div>
32
- * </ng-template>
33
- * </kendo-scheduler>
34
- */
35
- export class TimeZoneEditorComponent {
36
- injector;
37
- tzComboBox;
38
- tzComboBoxControl;
39
- /**
40
- * Specifies the width of the ComboBox that contains the names of the timezones.
41
- * @default 260
42
- */
43
- width = 260;
44
- /**
45
- * Fires when the value of the component has changed.
46
- */
47
- valueChange = new EventEmitter();
48
- /**
49
- * @hidden
50
- */
51
- get focusableId() {
52
- return this.tzComboBox?.focusableId || this.tzComboBoxControl?.focusableId;
53
- }
54
- /**
55
- * @hidden
56
- */
57
- get formControl() {
58
- const ngControl = this.injector.get(NgControl, null);
59
- return ngControl?.control || null;
60
- }
61
- tz;
62
- tzNames;
63
- tzSource;
64
- constructor(injector) {
65
- this.injector = injector;
66
- this.tzNames = timezoneNames();
67
- this.tzSource = this.tzNames.slice();
68
- }
69
- /**
70
- * @hidden
71
- */
72
- onTimeZoneChange(tzName) {
73
- this.tz = tzName;
74
- this.onChangeCallback(this.tz);
75
- this.valueChange.emit(tzName);
76
- }
77
- /**
78
- * @hidden
79
- */
80
- onTimeZoneFilterChange(value) {
81
- this.tzSource = this.tzNames.filter((tz) => tz.toLowerCase().indexOf(value.toLowerCase()) !== -1);
82
- }
83
- /**
84
- * @hidden
85
- */
86
- writeValue(value) {
87
- if (typeof value === 'string' && this.tzNames.indexOf(value) >= 0) {
88
- this.tz = value;
89
- }
90
- }
91
- /**
92
- * @hidden
93
- */
94
- focus() {
95
- this.tzComboBox ? this.tzComboBox.focus() : this.tzComboBoxControl.focus();
96
- }
97
- onTouchedCallback = (_) => { };
98
- onChangeCallback = (_) => { };
99
- /**
100
- * @hidden
101
- */
102
- registerOnChange(fn) {
103
- this.onChangeCallback = fn;
104
- }
105
- /**
106
- * @hidden
107
- */
108
- registerOnTouched(fn) {
109
- this.onTouchedCallback = fn;
110
- }
111
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimeZoneEditorComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
112
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TimeZoneEditorComponent, isStandalone: true, selector: "kendo-timezone-editor", inputs: { width: "width" }, outputs: { valueChange: "valueChange" }, providers: [
113
- TIME_ZONE_VALUE_ACCESSOR
114
- ], viewQueries: [{ propertyName: "tzComboBox", first: true, predicate: ["tzcombobox"], descendants: true, static: true }, { propertyName: "tzComboBoxControl", first: true, predicate: ["tzcomboboxControl"], descendants: true, static: true }], ngImport: i0, template: `
115
- @if (!formControl) {
116
- <kendo-combobox
117
- #tzcombobox
118
- [style.width.px]="width"
119
- [allowCustom]="false"
120
- [data]="tzSource"
121
- [filterable]="true"
122
- [suggest]="true"
123
- [value]="tz"
124
- (filterChange)="onTimeZoneFilterChange($event)"
125
- (valueChange)="onTimeZoneChange($event)">
126
- </kendo-combobox>
127
- }
128
- @if (formControl) {
129
- <kendo-combobox
130
- #tzcomboboxControl
131
- [style.width.px]="width"
132
- [allowCustom]="false"
133
- [data]="tzSource"
134
- [filterable]="true"
135
- [suggest]="true"
136
- [value]="tz"
137
- [formControl]="formControl"
138
- (filterChange)="onTimeZoneFilterChange($event)"
139
- (valueChange)="onTimeZoneChange($event)">
140
- </kendo-combobox>
141
- }
142
- `, isInline: true, dependencies: [{ kind: "component", type: ComboBoxComponent, selector: "kendo-combobox", inputs: ["icon", "svgIcon", "inputAttributes", "showStickyHeader", "focusableId", "allowCustom", "data", "value", "textField", "valueField", "valuePrimitive", "valueNormalizer", "placeholder", "adaptiveMode", "adaptiveTitle", "adaptiveSubtitle", "popupSettings", "listHeight", "loading", "suggest", "clearButton", "disabled", "itemDisabled", "readonly", "tabindex", "tabIndex", "filterable", "virtual", "size", "rounded", "fillMode"], outputs: ["valueChange", "selectionChange", "filterChange", "open", "opened", "close", "closed", "focus", "blur", "inputFocus", "inputBlur", "escape"], exportAs: ["kendoComboBox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
143
- }
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimeZoneEditorComponent, decorators: [{
145
- type: Component,
146
- args: [{
147
- providers: [
148
- TIME_ZONE_VALUE_ACCESSOR
149
- ],
150
- selector: 'kendo-timezone-editor',
151
- template: `
152
- @if (!formControl) {
153
- <kendo-combobox
154
- #tzcombobox
155
- [style.width.px]="width"
156
- [allowCustom]="false"
157
- [data]="tzSource"
158
- [filterable]="true"
159
- [suggest]="true"
160
- [value]="tz"
161
- (filterChange)="onTimeZoneFilterChange($event)"
162
- (valueChange)="onTimeZoneChange($event)">
163
- </kendo-combobox>
164
- }
165
- @if (formControl) {
166
- <kendo-combobox
167
- #tzcomboboxControl
168
- [style.width.px]="width"
169
- [allowCustom]="false"
170
- [data]="tzSource"
171
- [filterable]="true"
172
- [suggest]="true"
173
- [value]="tz"
174
- [formControl]="formControl"
175
- (filterChange)="onTimeZoneFilterChange($event)"
176
- (valueChange)="onTimeZoneChange($event)">
177
- </kendo-combobox>
178
- }
179
- `,
180
- standalone: true,
181
- imports: [ComboBoxComponent, ReactiveFormsModule]
182
- }]
183
- }], ctorParameters: () => [{ type: i0.Injector }], propDecorators: { tzComboBox: [{
184
- type: ViewChild,
185
- args: ['tzcombobox', { static: true }]
186
- }], tzComboBoxControl: [{
187
- type: ViewChild,
188
- args: ['tzcomboboxControl', { static: true }]
189
- }], width: [{
190
- type: Input
191
- }], valueChange: [{
192
- type: Output
193
- }] } });
@@ -1,320 +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 { parseDate, formatDate } from '@progress/kendo-angular-intl';
6
- import { toLocalDate } from '@progress/kendo-date-math';
7
- import { BehaviorSubject } from 'rxjs';
8
- import { getter, setter } from '@progress/kendo-angular-common';
9
- import { defaultModelFields } from '../common/default-model-fields';
10
- import { isRecurring, isException, isPresent, cloneTo, assignField } from '../common/util';
11
- const DATE_FORMATS = [
12
- "yyyyMMddTHHmmssSSSXXX",
13
- "yyyyMMddTHHmmssXXX",
14
- "yyyyMMddTHHmmss",
15
- "yyyyMMddTHHmm",
16
- "yyyyMMddTHH",
17
- "yyyyMMdd"
18
- ];
19
- /**
20
- * Represents a base implementation of the [edit service](slug:api_scheduler_editservice) that persists data to CRUD services such as OData.
21
- *
22
- * To use custom models, pass a [field map](slug:api_scheduler_schedulermodelfields) as a constructor parameter in the `BaseEditService` implementation. Subclasses must implement the `read` operation (that is not called directly by the base class) and the `save` method to persist created, updated, and deleted entities.
23
- *
24
- * The [`events`](#toc-events) observable publishes the current data when you subscribe, for example, by using an [async pipe](https://angular.io/api/common/AsyncPipe) ([more information](slug:editing_scheduler#connecting-custom-data-services)).
25
- *
26
- * Implementations that utilize dedicated services, such as Google Calendar and Microsoft Exchange, typically implement the
27
- * [`EditService`](slug:api_scheduler_editservice) of the Scheduler directly.
28
- *
29
- * See example in [this article](slug:custom_reactive_editing_scheduler).
30
- */
31
- export class BaseEditService {
32
- /**
33
- * Holds the model field map used for reading and updating data items.
34
- */
35
- fields;
36
- /**
37
- * Emits the current events as an observable stream.
38
- */
39
- events;
40
- /**
41
- * An array of the currently loaded events which is populated by the derived class.
42
- */
43
- data = [];
44
- /**
45
- * The source subject for the `events` observable.
46
- */
47
- source = new BehaviorSubject([]);
48
- createdItems = [];
49
- updatedItems = [];
50
- deletedItems = [];
51
- getId;
52
- getRecurrenceId;
53
- getRecurrenceRule;
54
- getRecurrenceExceptions;
55
- getStart;
56
- setId;
57
- setRecurrenceRule;
58
- setRecurrenceExceptions;
59
- setRecurrenceId;
60
- /**
61
- * Initializes the base edit service.
62
- *
63
- * @param fields - A field map that will be used for reading and modifying model objects. Defaults to the [`SchedulerEvent`]({% slug api_scheduler_schedulerevent %}) fields.
64
- */
65
- constructor(fields) {
66
- this.events = this.source.asObservable();
67
- this.fields = { ...defaultModelFields, ...fields };
68
- this.getId = getter(this.fields.id);
69
- this.getRecurrenceId = getter(this.fields.recurrenceId);
70
- this.getRecurrenceRule = getter(this.fields.recurrenceRule);
71
- this.getRecurrenceExceptions = getter(this.fields.recurrenceExceptions);
72
- this.getStart = getter(this.fields.start);
73
- this.setId = setter(this.fields.id);
74
- this.setRecurrenceRule = setter(this.fields.recurrenceRule);
75
- this.setRecurrenceExceptions = setter(this.fields.recurrenceExceptions);
76
- this.setRecurrenceId = setter(this.fields.recurrenceId);
77
- }
78
- create(event) {
79
- this.logCreate(event);
80
- this.saveChanges();
81
- }
82
- /*
83
- * Creates an exception to a recurring series.
84
- *
85
- * The `createException` method performs the following operations:
86
- * * Adds the start date of the event to the `recurrenceExceptions` of the master event (recurrence head).
87
- * * Creates a new event that stores the recurrence exception itself.
88
- */
89
- createException(event, value) {
90
- const exception = this.buildException(value);
91
- this.logRemoveOccurrence(event);
92
- this.logCreate(exception);
93
- this.saveChanges();
94
- }
95
- update(event, value) {
96
- this.assignValues(event, value);
97
- this.logUpdate(event);
98
- this.saveChanges();
99
- }
100
- remove(event) {
101
- this.logRemove(event);
102
- this.saveChanges();
103
- }
104
- removeSeries(event) {
105
- const id = this.getId(event);
106
- const recurrenceId = this.getRecurrenceId(event);
107
- const isHead = this.isRecurrenceHead(event);
108
- this.removeItemAndExceptions(isHead ? id : recurrenceId);
109
- this.saveChanges();
110
- }
111
- removeOccurrence(event) {
112
- this.logRemoveOccurrence(event);
113
- this.saveChanges();
114
- }
115
- /**
116
- * Returns the master recurring event for a specified recurring event.
117
- *
118
- * @param event - An event from the recurrence series.
119
- * @returns the master recurring event for the series.
120
- */
121
- findRecurrenceMaster(event) {
122
- const id = this.getId(event);
123
- const recurrenceId = this.getRecurrenceId(event);
124
- const headId = this.isRecurrenceHead(event) ? id : recurrenceId;
125
- const index = this.itemIndex(headId, this.data);
126
- return this.data[index];
127
- }
128
- /**
129
- * Checks if the event is part of the recurrence series.
130
- *
131
- * @param event - The event that will be checked.
132
- * @returns `true` if the event is an occurrence, an exception, or a master event. Otherwise, returns `false`.
133
- */
134
- isRecurring(event) {
135
- return isRecurring(event, this.fields);
136
- }
137
- /**
138
- * Checks if the event is a recurrence exception.
139
- *
140
- * @param event - The event that will be checked.
141
- * @returns `true` if the event is a unique event which belongs to a recurrence series. Otherwise, returns `false`.
142
- */
143
- isException(event) {
144
- return isException(event, this.fields);
145
- }
146
- /**
147
- * Returns a Boolean value which indicates if the event is new.
148
- * If the `ID` field is defined, the default implementation returns `true`.
149
- * Can be overridden to implement different conditions.
150
- *
151
- * @param event - The event that will be checked.
152
- */
153
- isNew(event) {
154
- const id = this.getId(event);
155
- return !isPresent(id);
156
- }
157
- /**
158
- * Returns the next `ID` that will be used for new events.
159
- * The default implementation returns `undefined`.
160
- */
161
- nextId() {
162
- return undefined;
163
- }
164
- /**
165
- * Copies values to the target model instance.
166
- * To copy the top-level fields, the base implementation uses
167
- * [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign).
168
- * To copy nested fields, override `assignValues` and handle the model-specific cases.
169
- *
170
- * @param target - The target object that will receive the field values.
171
- * @param source - The source object from which the fields will be read.
172
- */
173
- assignValues(target, source) {
174
- cloneTo(source, target);
175
- }
176
- /**
177
- * Clones an existing model object.
178
- * To copy the top-level model fields, the base creates an empty object and calls [`assignValues`](#toc-assignvalues).
179
- * To create models of the correct type, override `cloneEvent`.
180
- *
181
- * @param event - The model instance to copy.
182
- * @returns TEvent - The new model instance.
183
- */
184
- cloneEvent(event) {
185
- const result = {};
186
- this.assignValues(result, event);
187
- return result;
188
- }
189
- /**
190
- * A utility method which parses recurrence exception dates in an ISO format.
191
- *
192
- * @example
193
- * ```ts-no-run
194
- * const exdates = '20180614T060000Z;20180615T060000Z';
195
- * const result = super.parseExceptions(exdates);
196
- *
197
- * // console.log(result);
198
- * // Array [ Date 2018-06-14T03:00:00.000Z, Date 2018-06-15T03:00:00.000Z ]
199
- * ```
200
- *
201
- * @param value - A comma-separated list of ISO-formatted dates.
202
- * @returns Date[] - The recurrence exceptions as local dates.
203
- */
204
- parseExceptions(value) {
205
- if (!isPresent(value) || value === '') {
206
- return [];
207
- }
208
- return value
209
- .split(';')
210
- .map(ex => parseDate(ex, DATE_FORMATS) || undefined);
211
- }
212
- /**
213
- * A utility method which serializes recurrence exception dates in an ISO format.
214
- *
215
- * @example
216
- * ```ts-no-run
217
- * const exdates = [ new Date(2018, 5, 14, 3, 0, 0), new Date(2018, 5, 15, 3, 0, 0) ];
218
- * const result = super.serializeExceptions(exdates);
219
- *
220
- * // console.log(result);
221
- * // '20180614T060000Z;20180615T060000Z'
222
- * ```
223
- *
224
- * @param value - An array of `Date` instances.
225
- * @returns string - A comma-separated list of ISO-formatted dates.
226
- */
227
- serializeExceptions(exceptions) {
228
- if (!exceptions || exceptions.length === 0) {
229
- return '';
230
- }
231
- return exceptions.map(date => formatDate(toLocalDate(date), 'yyyyMMddTHHmmss') + 'Z').join(';');
232
- }
233
- reset() {
234
- this.data = [];
235
- this.deletedItems = [];
236
- this.updatedItems = [];
237
- this.createdItems = [];
238
- }
239
- itemIndex(id, items) {
240
- for (let idx = 0; idx < items.length; idx++) {
241
- if (this.getId(items[idx]) === id) {
242
- return idx;
243
- }
244
- }
245
- return -1;
246
- }
247
- buildException(item) {
248
- const fields = this.fields;
249
- const head = this.findRecurrenceMaster(item);
250
- const copy = this.cloneEvent(item);
251
- assignField(copy, head, fields.id);
252
- this.setId(copy, this.nextId());
253
- this.setRecurrenceRule(copy, undefined);
254
- this.setRecurrenceId(copy, this.getId(head));
255
- return copy;
256
- }
257
- isRecurrenceHead(item) {
258
- const id = this.getId(item);
259
- const recurrenceRule = this.getRecurrenceRule(item);
260
- return !!(id && recurrenceRule);
261
- }
262
- logCreate(item) {
263
- this.data = [...this.data, item];
264
- this.source.next(this.data);
265
- this.createdItems.push(item);
266
- }
267
- logUpdate(item) {
268
- const id = this.getId(item);
269
- if (!this.isNew(item)) {
270
- const index = this.itemIndex(id, this.updatedItems);
271
- if (index !== -1) {
272
- this.updatedItems.splice(index, 1, item);
273
- }
274
- else {
275
- this.updatedItems.push(item);
276
- }
277
- }
278
- else {
279
- const index = this.createdItems.indexOf(item);
280
- this.createdItems.splice(index, 1, item);
281
- }
282
- }
283
- logRemove(item) {
284
- const id = this.getId(item);
285
- let index = this.itemIndex(id, this.data);
286
- this.data = this.data.filter((_, i) => i !== index);
287
- this.source.next(this.data);
288
- index = this.itemIndex(id, this.createdItems);
289
- if (index >= 0) {
290
- this.createdItems.splice(index, 1);
291
- }
292
- else {
293
- this.deletedItems.push(item);
294
- }
295
- index = this.itemIndex(id, this.updatedItems);
296
- if (index >= 0) {
297
- this.updatedItems.splice(index, 1);
298
- }
299
- }
300
- logRemoveOccurrence(event) {
301
- const head = this.findRecurrenceMaster(event);
302
- const exceptionDate = this.getStart(event);
303
- const currentExceptions = this.getRecurrenceExceptions(head) || [];
304
- this.setRecurrenceExceptions(head, [...currentExceptions, exceptionDate]);
305
- this.logUpdate(head);
306
- }
307
- removeItemAndExceptions(itemId) {
308
- this.deletedItems = this.deletedItems.concat(this.data.filter(ev => this.getRecurrenceId(ev) === itemId || this.getId(ev) === itemId));
309
- }
310
- hasChanges() {
311
- return this.deletedItems.length + this.updatedItems.length + this.createdItems.length > 0;
312
- }
313
- saveChanges() {
314
- if (!this.hasChanges()) {
315
- return;
316
- }
317
- this.save(this.createdItems, this.updatedItems, this.deletedItems);
318
- this.reset();
319
- }
320
- }
@@ -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 {};