@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.
- package/editing/recurrence/localization/messages.d.ts +1 -1
- package/editing/resource-editor-base.d.ts +1 -1
- package/editing-directives/editing-directive-base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-scheduler.mjs +313 -313
- package/localization/messages.d.ts +1 -1
- package/package.json +20 -28
- package/schematics/ngAdd/index.js +3 -3
- package/views/common/base-view.d.ts +1 -1
- package/views/common/configuration-view-base.d.ts +1 -1
- package/views/day-time/day-time-view-base.d.ts +1 -1
- package/views/day-time/day-time-view.component.d.ts +1 -1
- package/views/multi-day/multi-day-view-base.d.ts +1 -1
- package/views/timeline/timeline-base.d.ts +1 -1
- package/views/view-items/base-slot.directive.d.ts +1 -1
- package/views/view-items/base-view-item.d.ts +1 -1
- package/esm2022/common/constants.mjs +0 -8
- package/esm2022/common/default-model-fields.mjs +0 -20
- package/esm2022/common/dom-queries.mjs +0 -107
- package/esm2022/common/modifiers.mjs +0 -31
- package/esm2022/common/util.mjs +0 -227
- package/esm2022/data-binding.directive.mjs +0 -162
- package/esm2022/directives.mjs +0 -136
- package/esm2022/editing/date-time-picker.component.mjs +0 -190
- package/esm2022/editing/dialogs.service.mjs +0 -96
- package/esm2022/editing/edit-dialog-template.directive.mjs +0 -53
- package/esm2022/editing/edit-dialog.component.mjs +0 -679
- package/esm2022/editing/edit.service.mjs +0 -107
- package/esm2022/editing/local-data-changes.service.mjs +0 -18
- package/esm2022/editing/recurrence/end-rule-radio-button.directive.mjs +0 -77
- package/esm2022/editing/recurrence/localization/custom-messages.component.mjs +0 -44
- package/esm2022/editing/recurrence/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/editing/recurrence/localization/messages.mjs +0 -239
- package/esm2022/editing/recurrence/localization/recurrence-localization.service.mjs +0 -47
- package/esm2022/editing/recurrence/recurrence-editor.component.mjs +0 -497
- package/esm2022/editing/recurrence/recurrence-end-rule-editor.component.mjs +0 -334
- package/esm2022/editing/recurrence/recurrence-frequency-editor.component.mjs +0 -105
- package/esm2022/editing/recurrence/recurrence-interval-editor.component.mjs +0 -169
- package/esm2022/editing/recurrence/recurrence-monthly-yearly-editor.component.mjs +0 -468
- package/esm2022/editing/recurrence/recurrence-weekday-rule-editor.component.mjs +0 -138
- package/esm2022/editing/recurrence/recurrence.service.mjs +0 -254
- package/esm2022/editing/recurrence/repeat-on-radio-button.directive.mjs +0 -81
- package/esm2022/editing/resource-editor-base.mjs +0 -59
- package/esm2022/editing/resource-multiple-editor.component.mjs +0 -101
- package/esm2022/editing/resource-single-editor.component.mjs +0 -82
- package/esm2022/editing/timezone-editor.component.mjs +0 -193
- package/esm2022/editing-directives/base-edit.service.mjs +0 -320
- package/esm2022/editing-directives/edit-service.interface.mjs +0 -5
- package/esm2022/editing-directives/editing-directive-base.mjs +0 -242
- package/esm2022/editing-directives/local-edit.service.mjs +0 -122
- package/esm2022/editing-directives/reactive-editing.directive.mjs +0 -132
- package/esm2022/editing-directives/utils.mjs +0 -107
- package/esm2022/events/add-event.mjs +0 -26
- package/esm2022/events/cancel-event.mjs +0 -14
- package/esm2022/events/create-event.mjs +0 -40
- package/esm2022/events/date-change-event.mjs +0 -29
- package/esm2022/events/drag-end-event.mjs +0 -46
- package/esm2022/events/drag-event.mjs +0 -54
- package/esm2022/events/drag-start-event.mjs +0 -30
- package/esm2022/events/edit-event-base.mjs +0 -32
- package/esm2022/events/edit-event.mjs +0 -30
- package/esm2022/events/event-click-event.mjs +0 -32
- package/esm2022/events/event-keydown-event.mjs +0 -28
- package/esm2022/events/more-events-click.mjs +0 -24
- package/esm2022/events/navigate-event.mjs +0 -26
- package/esm2022/events/preventable-event.mjs +0 -28
- package/esm2022/events/remove-event.mjs +0 -30
- package/esm2022/events/resize-end-event.mjs +0 -38
- package/esm2022/events/resize-event.mjs +0 -46
- package/esm2022/events/resize-start-event.mjs +0 -30
- package/esm2022/events/save-event.mjs +0 -18
- package/esm2022/events/slot-click-event.mjs +0 -44
- package/esm2022/events/slot-drag-end-event.mjs +0 -10
- package/esm2022/events/slot-drag-event.mjs +0 -40
- package/esm2022/events/slot-drag-start-event.mjs +0 -44
- package/esm2022/events/view-event-map.mjs +0 -35
- package/esm2022/events.mjs +0 -27
- package/esm2022/index.mjs +0 -83
- package/esm2022/loading.component.mjs +0 -52
- package/esm2022/localization/custom-messages.component.mjs +0 -56
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -614
- package/esm2022/localization/scheduler-localization.service.mjs +0 -31
- package/esm2022/navigation/focus-position.interface.mjs +0 -5
- package/esm2022/navigation/focus.service.mjs +0 -202
- package/esm2022/navigation/focusable-element.interface.mjs +0 -5
- package/esm2022/navigation/focusable.directive.mjs +0 -98
- package/esm2022/navigation/shortcuts.directive.mjs +0 -239
- package/esm2022/navigation.mjs +0 -6
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/pdf/pdf-command.directive.mjs +0 -96
- package/esm2022/pdf/pdf-export-event.mjs +0 -10
- package/esm2022/pdf/pdf.component.mjs +0 -241
- package/esm2022/pdf/pdf.module.mjs +0 -42
- package/esm2022/pdf/pdf.service.mjs +0 -36
- package/esm2022/progress-kendo-angular-scheduler.mjs +0 -8
- package/esm2022/scheduler.component.mjs +0 -1981
- package/esm2022/scheduler.module.mjs +0 -138
- package/esm2022/toolbar/navigation.component.mjs +0 -391
- package/esm2022/toolbar/toolbar-context.mjs +0 -5
- package/esm2022/toolbar/toolbar-template.directive.mjs +0 -50
- package/esm2022/toolbar/toolbar.component.mjs +0 -168
- package/esm2022/toolbar/toolbar.service.mjs +0 -46
- package/esm2022/toolbar/view-selector.component.mjs +0 -181
- package/esm2022/types/actions.mjs +0 -5
- package/esm2022/types/create-form-group-args.interface.mjs +0 -5
- package/esm2022/types/crud-operation.enum.mjs +0 -18
- package/esm2022/types/current-time-settings.interface.mjs +0 -5
- package/esm2022/types/date-range.interface.mjs +0 -5
- package/esm2022/types/datepicker-options.interface.mjs +0 -5
- package/esm2022/types/edit-event-args.interface.mjs +0 -5
- package/esm2022/types/edit-mode.enum.mjs +0 -23
- package/esm2022/types/editable-settings.interface.mjs +0 -5
- package/esm2022/types/event-style-args.interface.mjs +0 -5
- package/esm2022/types/focusable-container.mjs +0 -5
- package/esm2022/types/group.interface.mjs +0 -5
- package/esm2022/types/numeric-options.interface.mjs +0 -5
- package/esm2022/types/ongoing-events-settings.interface.mjs +0 -5
- package/esm2022/types/resource.interface.mjs +0 -5
- package/esm2022/types/scheduler-event.mjs +0 -5
- package/esm2022/types/scheduler-model-fields.interface.mjs +0 -5
- package/esm2022/types/scheduler-slot.interface.mjs +0 -5
- package/esm2022/types/scheduler-view.mjs +0 -9
- package/esm2022/types/slot-class-args.interface.mjs +0 -5
- package/esm2022/types/slot-selection.mjs +0 -35
- package/esm2022/types/view-item.interface.mjs +0 -5
- package/esm2022/types.mjs +0 -12
- package/esm2022/views/agenda/agenda-header-item.component.mjs +0 -85
- package/esm2022/views/agenda/agenda-header.component.mjs +0 -75
- package/esm2022/views/agenda/agenda-task-item.component.mjs +0 -137
- package/esm2022/views/agenda/agenda-view-internal.component.mjs +0 -424
- package/esm2022/views/agenda/agenda-view-list.component.mjs +0 -256
- package/esm2022/views/agenda/agenda-view.component.mjs +0 -130
- package/esm2022/views/agenda/tasks.collection.mjs +0 -96
- package/esm2022/views/agenda/utils.mjs +0 -176
- package/esm2022/views/common/base-view.mjs +0 -1099
- package/esm2022/views/common/configuration-view-base.mjs +0 -164
- package/esm2022/views/common/dom-events.service.mjs +0 -22
- package/esm2022/views/common/hint-container.component.mjs +0 -41
- package/esm2022/views/common/repeat.pipe.mjs +0 -36
- package/esm2022/views/common/resize-hint.component.mjs +0 -97
- package/esm2022/views/common/resource-iterator.pipe.mjs +0 -49
- package/esm2022/views/common/scheduler-task.mjs +0 -5
- package/esm2022/views/common/slot-selectable.directive.mjs +0 -137
- package/esm2022/views/common/view-footer.component.mjs +0 -103
- package/esm2022/views/common/work-hours-footer.directive.mjs +0 -45
- package/esm2022/views/constants.mjs +0 -31
- package/esm2022/views/day-time/day-time-slot.service.mjs +0 -633
- package/esm2022/views/day-time/day-time-view-base.mjs +0 -244
- package/esm2022/views/day-time/day-time-view-item.component.mjs +0 -216
- package/esm2022/views/day-time/day-time-view.component.mjs +0 -437
- package/esm2022/views/day-time/event-slot.directive.mjs +0 -138
- package/esm2022/views/day-time/utils.mjs +0 -32
- package/esm2022/views/month/month-slot.component.mjs +0 -166
- package/esm2022/views/month/month-slot.service.mjs +0 -404
- package/esm2022/views/month/month-view-item.component.mjs +0 -161
- package/esm2022/views/month/month-view-renderer.component.mjs +0 -683
- package/esm2022/views/month/month-view.component.mjs +0 -203
- package/esm2022/views/month/multi-week-view.component.mjs +0 -202
- package/esm2022/views/month/utils.mjs +0 -107
- package/esm2022/views/multi-day/day-view.component.mjs +0 -186
- package/esm2022/views/multi-day/multi-day-view-base.mjs +0 -55
- package/esm2022/views/multi-day/multi-day-view-renderer.component.mjs +0 -1002
- package/esm2022/views/multi-day/multi-day-view.component.mjs +0 -197
- package/esm2022/views/multi-day/utils.mjs +0 -63
- package/esm2022/views/multi-day/week-view.component.mjs +0 -189
- package/esm2022/views/multi-day/work-week-view.component.mjs +0 -172
- package/esm2022/views/scheduler-view.directive.mjs +0 -65
- package/esm2022/views/templates/agenda-date-template.directive.mjs +0 -41
- package/esm2022/views/templates/agenda-time-template.directive.mjs +0 -46
- package/esm2022/views/templates/all-day-event-template.directive.mjs +0 -42
- package/esm2022/views/templates/all-day-slot-template.directive.mjs +0 -42
- package/esm2022/views/templates/date-header-template.directive.mjs +0 -42
- package/esm2022/views/templates/event-template.directive.mjs +0 -42
- package/esm2022/views/templates/group-header-template.directive.mjs +0 -42
- package/esm2022/views/templates/major-time-header-template.directive.mjs +0 -41
- package/esm2022/views/templates/minor-time-header-template.directive.mjs +0 -41
- package/esm2022/views/templates/month-day-slot-template.directive.mjs +0 -42
- package/esm2022/views/templates/multi-week-day-slot-template.directive.mjs +0 -42
- package/esm2022/views/templates/time-slot-template.directive.mjs +0 -43
- package/esm2022/views/templates.mjs +0 -16
- package/esm2022/views/timeline/timeline-base.mjs +0 -39
- package/esm2022/views/timeline/timeline-month-view.component.mjs +0 -211
- package/esm2022/views/timeline/timeline-multi-day-view.component.mjs +0 -649
- package/esm2022/views/timeline/timeline-view.component.mjs +0 -189
- package/esm2022/views/timeline/timeline-week-view.component.mjs +0 -181
- package/esm2022/views/timeline/utils.mjs +0 -60
- package/esm2022/views/utils.mjs +0 -373
- package/esm2022/views/view-context.service.mjs +0 -111
- package/esm2022/views/view-items/base-slot.directive.mjs +0 -104
- package/esm2022/views/view-items/base-slot.service.mjs +0 -82
- package/esm2022/views/view-items/base-view-item.mjs +0 -194
- package/esm2022/views/view-items/item-map.mjs +0 -38
- package/esm2022/views/view-items/types.mjs +0 -5
- package/esm2022/views/view-state.service.mjs +0 -144
- package/esm2022/views/year/utils.mjs +0 -60
- package/esm2022/views/year/year-view-internal.component.mjs +0 -471
- package/esm2022/views/year/year-view.component.mjs +0 -136
|
@@ -1,202 +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, Injectable, Renderer2, Optional, NgZone } from '@angular/core';
|
|
6
|
-
import { Subscription } from 'rxjs';
|
|
7
|
-
import { take } from 'rxjs/operators';
|
|
8
|
-
import { DomEventsService } from '../views/common/dom-events.service';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "../views/common/dom-events.service";
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
export class FocusService {
|
|
15
|
-
renderer;
|
|
16
|
-
wrapper;
|
|
17
|
-
domEvents;
|
|
18
|
-
zone;
|
|
19
|
-
get activeElement() {
|
|
20
|
-
if (this.activeItem) {
|
|
21
|
-
return this.activeItem.element;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
get focusableItems() {
|
|
25
|
-
return this.items;
|
|
26
|
-
}
|
|
27
|
-
activeItem;
|
|
28
|
-
focusedItem;
|
|
29
|
-
items = new Set();
|
|
30
|
-
elementMap = new WeakMap();
|
|
31
|
-
subs = new Subscription();
|
|
32
|
-
hasContentRendered = false;
|
|
33
|
-
constructor(renderer, wrapper, domEvents, zone) {
|
|
34
|
-
this.renderer = renderer;
|
|
35
|
-
this.wrapper = wrapper;
|
|
36
|
-
this.domEvents = domEvents;
|
|
37
|
-
this.zone = zone;
|
|
38
|
-
this.subs.add(this.domEvents.focus.subscribe(e => this.onFocusIn(e)));
|
|
39
|
-
this.subs.add(this.domEvents.focusOut.subscribe(() => this.onFocusOut()));
|
|
40
|
-
}
|
|
41
|
-
ngOnDestroy() {
|
|
42
|
-
this.subs.unsubscribe();
|
|
43
|
-
}
|
|
44
|
-
register(item) {
|
|
45
|
-
if (!this.activeItem) {
|
|
46
|
-
this.activeItem = item;
|
|
47
|
-
item.toggle(true);
|
|
48
|
-
}
|
|
49
|
-
const items = Array.from(this.focusableItems);
|
|
50
|
-
if (item.containerType !== 'content') {
|
|
51
|
-
this.items.add(item);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
const newContentIndex = items.map(item => item.containerType).lastIndexOf('content') + 1;
|
|
55
|
-
const hasFooter = items.find(item => item.containerType === 'footer');
|
|
56
|
-
if (newContentIndex > 0) {
|
|
57
|
-
// ensure that new events are positioned after the rest of the events for correct navigation sequence
|
|
58
|
-
items.splice(newContentIndex, 0, item);
|
|
59
|
-
this.items = new Set(items);
|
|
60
|
-
}
|
|
61
|
-
else if (hasFooter) {
|
|
62
|
-
// ensure that the first event is before the footer
|
|
63
|
-
items.splice(items.length - 1, 0, item);
|
|
64
|
-
this.items = new Set(items);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
this.items.add(item);
|
|
68
|
-
}
|
|
69
|
-
// activate the first content element if there is one; otherwise, keep the toolbar or footer active
|
|
70
|
-
if (!this.hasContentRendered) {
|
|
71
|
-
this.activeItem.toggle(false);
|
|
72
|
-
this.activeItem = item;
|
|
73
|
-
item.toggle(true);
|
|
74
|
-
this.hasContentRendered = true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
this.elementMap.set(item.element.nativeElement, item);
|
|
78
|
-
this.toggleWrapper();
|
|
79
|
-
}
|
|
80
|
-
unregister(item) {
|
|
81
|
-
if (item === this.activeItem) {
|
|
82
|
-
this.activateNext();
|
|
83
|
-
}
|
|
84
|
-
this.items.delete(item);
|
|
85
|
-
this.elementMap.delete(item.element.nativeElement);
|
|
86
|
-
this.toggleWrapper();
|
|
87
|
-
}
|
|
88
|
-
focus() {
|
|
89
|
-
if (this.activeItem) {
|
|
90
|
-
this.activeItem.focus();
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
this.focusContent();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
focusContent() {
|
|
97
|
-
const items = Array.from(this.focusableItems);
|
|
98
|
-
const activeItemContainer = this.activeItem?.containerType;
|
|
99
|
-
const focusableContent = activeItemContainer === 'content' ? this.activeItem : items.find(item => item.containerType === 'content');
|
|
100
|
-
const focusableTool = activeItemContainer === 'toolbar' ? this.activeItem : items.find(item => item.containerType === 'toolbar');
|
|
101
|
-
const itemToFocus = focusableContent || focusableTool;
|
|
102
|
-
itemToFocus.focus();
|
|
103
|
-
this.activeItem = itemToFocus;
|
|
104
|
-
}
|
|
105
|
-
focusToolbar() {
|
|
106
|
-
const items = Array.from(this.focusableItems);
|
|
107
|
-
const firstFocusableTool = items.find(item => item.containerType === 'toolbar');
|
|
108
|
-
// eslint-disable-next-line no-unused-expressions
|
|
109
|
-
firstFocusableTool && firstFocusableTool.focus();
|
|
110
|
-
this.activeItem = firstFocusableTool;
|
|
111
|
-
}
|
|
112
|
-
focusNext(options) {
|
|
113
|
-
const currentItem = this.activeItem;
|
|
114
|
-
this.activateNext(options);
|
|
115
|
-
if (this.activeItem) {
|
|
116
|
-
this.activeItem.focus();
|
|
117
|
-
}
|
|
118
|
-
return this.activeItem !== currentItem;
|
|
119
|
-
}
|
|
120
|
-
focusByIndex(index) {
|
|
121
|
-
const item = Array.from(this.items.values())[index];
|
|
122
|
-
if (!item) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
this.activate(item);
|
|
126
|
-
this.focus();
|
|
127
|
-
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
128
|
-
const itemToFocus = Array.from(this.items.values())[index];
|
|
129
|
-
if (!itemToFocus) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
activate(next) {
|
|
135
|
-
this.items.forEach(item => {
|
|
136
|
-
item.toggle(item === next);
|
|
137
|
-
});
|
|
138
|
-
this.activeItem = next;
|
|
139
|
-
}
|
|
140
|
-
activateNext(position) {
|
|
141
|
-
const next = this.findNext(position);
|
|
142
|
-
this.activeItem = next;
|
|
143
|
-
this.activeItem?.focus();
|
|
144
|
-
}
|
|
145
|
-
findNext(position) {
|
|
146
|
-
const { offset, nowrap } = { nowrap: false, offset: 1, ...position };
|
|
147
|
-
const items = Array.from(this.items.values())
|
|
148
|
-
.filter(item => item.canFocus())
|
|
149
|
-
.sort((a, b) => a.focusIndex - b.focusIndex);
|
|
150
|
-
if (items.length === 0) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
if (!this.activeItem) {
|
|
154
|
-
return nowrap ? null : items[0];
|
|
155
|
-
}
|
|
156
|
-
const index = items.indexOf(this.activeItem);
|
|
157
|
-
let nextIndex = index + offset;
|
|
158
|
-
if (nowrap) {
|
|
159
|
-
nextIndex = Math.max(0, Math.min(items.length - 1, nextIndex));
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
nextIndex = nextIndex % items.length;
|
|
163
|
-
if (nextIndex < 0) {
|
|
164
|
-
nextIndex = items.length - 1;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return items[nextIndex];
|
|
168
|
-
}
|
|
169
|
-
toggleWrapper() {
|
|
170
|
-
if (this.wrapper) {
|
|
171
|
-
this.renderer.setAttribute(this.wrapper.nativeElement, 'tabindex', this.activeItem ? '-1' : '0');
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
onFocusIn(e) {
|
|
175
|
-
const item = this.elementMap.get(e.target);
|
|
176
|
-
if (!item || item === this.focusedItem) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
if (this.focusedItem) {
|
|
180
|
-
this.focusedItem.toggleFocus(false);
|
|
181
|
-
}
|
|
182
|
-
this.activate(item);
|
|
183
|
-
item.toggleFocus(true);
|
|
184
|
-
this.focusedItem = item;
|
|
185
|
-
}
|
|
186
|
-
onFocusOut() {
|
|
187
|
-
if (!this.focusedItem) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
this.focusedItem.toggleFocus(false);
|
|
191
|
-
this.focusedItem = null;
|
|
192
|
-
}
|
|
193
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusService, deps: [{ token: i0.Renderer2, optional: true }, { token: i0.ElementRef, optional: true }, { token: i1.DomEventsService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
194
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusService });
|
|
195
|
-
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusService, decorators: [{
|
|
197
|
-
type: Injectable
|
|
198
|
-
}], ctorParameters: () => [{ type: i0.Renderer2, decorators: [{
|
|
199
|
-
type: Optional
|
|
200
|
-
}] }, { type: i0.ElementRef, decorators: [{
|
|
201
|
-
type: Optional
|
|
202
|
-
}] }, { type: i1.DomEventsService }, { type: i0.NgZone }] });
|
|
@@ -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,98 +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 { Directive, ElementRef, Input, Renderer2 } from '@angular/core';
|
|
6
|
-
import { isDocumentAvailable, isVisible } from '@progress/kendo-angular-common';
|
|
7
|
-
import { FocusService } from './focus.service';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "./focus.service";
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
export class FocusableDirective {
|
|
14
|
-
element;
|
|
15
|
-
renderer;
|
|
16
|
-
focusService;
|
|
17
|
-
/**
|
|
18
|
-
* The order of the element with respect to the other focusable elements.
|
|
19
|
-
* If multiple elements share the same value, their relative to each other order follows their position in the component tree.
|
|
20
|
-
*/
|
|
21
|
-
focusIndex = 0;
|
|
22
|
-
containerType = 'content';
|
|
23
|
-
get visible() {
|
|
24
|
-
return this.element.nativeElement.style.display !== 'none';
|
|
25
|
-
}
|
|
26
|
-
get enabled() {
|
|
27
|
-
return !this.element.nativeElement.disabled;
|
|
28
|
-
}
|
|
29
|
-
active;
|
|
30
|
-
constructor(element, renderer, focusService) {
|
|
31
|
-
this.element = element;
|
|
32
|
-
this.renderer = renderer;
|
|
33
|
-
this.focusService = focusService;
|
|
34
|
-
this.toggle(false);
|
|
35
|
-
}
|
|
36
|
-
ngAfterViewChecked() {
|
|
37
|
-
const element = this.element.nativeElement;
|
|
38
|
-
const isViewSelector = element.closest('.k-scheduler-views-wrapper');
|
|
39
|
-
if (!isViewSelector || !isDocumentAvailable()) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
// eslint-disable-next-line no-unused-expressions
|
|
43
|
-
isVisible(element) ? this.focusService.register(this) : this.focusService.unregister(this);
|
|
44
|
-
}
|
|
45
|
-
ngOnInit() {
|
|
46
|
-
this.focusService.register(this);
|
|
47
|
-
}
|
|
48
|
-
ngOnDestroy() {
|
|
49
|
-
this.focusService.unregister(this);
|
|
50
|
-
}
|
|
51
|
-
toggle(active) {
|
|
52
|
-
if (active !== this.active) {
|
|
53
|
-
const index = active ? '0' : '-1';
|
|
54
|
-
this.renderer.setAttribute(this.element.nativeElement, 'tabIndex', index);
|
|
55
|
-
this.active = active;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
canFocus() {
|
|
59
|
-
return this.visible && this.enabled;
|
|
60
|
-
}
|
|
61
|
-
focus() {
|
|
62
|
-
this.element.nativeElement.focus({ preventScroll: true });
|
|
63
|
-
}
|
|
64
|
-
toggleFocus(value) {
|
|
65
|
-
const element = this.element.nativeElement;
|
|
66
|
-
const focusedClass = element.matches('.k-button-group .k-button') ? 'k-focus' : 'k-selected';
|
|
67
|
-
const renderedEvents = this.element.nativeElement.ownerDocument.querySelectorAll('.k-event');
|
|
68
|
-
const method = value ? 'addClass' : 'removeClass';
|
|
69
|
-
this.renderer[method](element, focusedClass);
|
|
70
|
-
if (renderedEvents.length > 0) {
|
|
71
|
-
const ariaLabel = element.getAttribute('aria-label');
|
|
72
|
-
renderedEvents.forEach((event) => {
|
|
73
|
-
if (event.getAttribute('aria-label') === ariaLabel) {
|
|
74
|
-
this.renderer[method](event, 'k-selected');
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const selectable = element.matches('.k-scheduler-agendaview .k-scheduler-content .k-selected');
|
|
79
|
-
if (selectable) {
|
|
80
|
-
element.closest('.k-scheduler-agendaview').querySelector('[aria-selected="true"]')?.removeAttribute('aria-selected');
|
|
81
|
-
this.renderer.setAttribute(element, 'aria-selected', value.toString());
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.FocusService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
85
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: FocusableDirective, isStandalone: true, selector: "[kendoSchedulerFocusIndex]", inputs: { focusIndex: ["kendoSchedulerFocusIndex", "focusIndex"], containerType: "containerType" }, ngImport: i0 });
|
|
86
|
-
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusableDirective, decorators: [{
|
|
88
|
-
type: Directive,
|
|
89
|
-
args: [{
|
|
90
|
-
selector: '[kendoSchedulerFocusIndex]',
|
|
91
|
-
standalone: true
|
|
92
|
-
}]
|
|
93
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.FocusService }], propDecorators: { focusIndex: [{
|
|
94
|
-
type: Input,
|
|
95
|
-
args: ['kendoSchedulerFocusIndex']
|
|
96
|
-
}], containerType: [{
|
|
97
|
-
type: Input
|
|
98
|
-
}] } });
|
|
@@ -1,239 +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 { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
|
-
import { Keys, normalizeKeys } from '@progress/kendo-angular-common';
|
|
7
|
-
import { ZonedDate } from '@progress/kendo-date-math';
|
|
8
|
-
import { Subscription } from 'rxjs';
|
|
9
|
-
import { FocusService } from './focus.service';
|
|
10
|
-
import { Modifiers, noModifiers, withModifiers } from '../common/modifiers';
|
|
11
|
-
import { groupResources } from '../common/util';
|
|
12
|
-
import { SchedulerComponent } from '../scheduler.component';
|
|
13
|
-
import { DomEventsService } from '../views/common/dom-events.service';
|
|
14
|
-
import { take } from 'rxjs/operators';
|
|
15
|
-
import { ViewStateService } from '../views/view-state.service';
|
|
16
|
-
import { hasClasses } from '../common/dom-queries';
|
|
17
|
-
import { DialogsService } from '../editing/dialogs.service';
|
|
18
|
-
import * as i0 from "@angular/core";
|
|
19
|
-
import * as i1 from "../scheduler.component";
|
|
20
|
-
import * as i2 from "../views/common/dom-events.service";
|
|
21
|
-
import * as i3 from "./focus.service";
|
|
22
|
-
import * as i4 from "../views/view-state.service";
|
|
23
|
-
import * as i5 from "../editing/dialogs.service";
|
|
24
|
-
const isContentWrapper = element => hasClasses(element, 'k-scheduler-content');
|
|
25
|
-
const CALENDAR_TAG = 'KENDO-CALENDAR-HORIZONTAL';
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
export class ShortcutsDirective {
|
|
30
|
-
scheduler;
|
|
31
|
-
domEvents;
|
|
32
|
-
focusService;
|
|
33
|
-
zone;
|
|
34
|
-
changeDetector;
|
|
35
|
-
viewState;
|
|
36
|
-
dialogsService;
|
|
37
|
-
shortcuts = [{
|
|
38
|
-
match: e => normalizeKeys(e) === Keys.KeyC && noModifiers(e),
|
|
39
|
-
action: e => {
|
|
40
|
-
const scheduler = this.scheduler;
|
|
41
|
-
const hours = new Date().getHours();
|
|
42
|
-
const selected = scheduler.selectedDate;
|
|
43
|
-
const start = new Date(selected.getFullYear(), selected.getMonth(), selected.getDate(), hours + 1);
|
|
44
|
-
const end = new Date(selected.getFullYear(), selected.getMonth(), selected.getDate(), hours + 2);
|
|
45
|
-
let firstResource;
|
|
46
|
-
if (scheduler.group) {
|
|
47
|
-
const resources = scheduler.resources || [];
|
|
48
|
-
const group = scheduler.group || {};
|
|
49
|
-
const grouped = groupResources(group, resources);
|
|
50
|
-
if (grouped.length > 0) {
|
|
51
|
-
firstResource = grouped[0].data[0];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
scheduler.create.emit({
|
|
55
|
-
start: ZonedDate.fromLocalDate(start, scheduler.timezone).toLocalDate(),
|
|
56
|
-
end: ZonedDate.fromLocalDate(end, scheduler.timezone).toLocalDate(),
|
|
57
|
-
isAllDay: false,
|
|
58
|
-
resources: [firstResource],
|
|
59
|
-
originalEvent: e,
|
|
60
|
-
sender: scheduler
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
match: e => {
|
|
65
|
-
const code = normalizeKeys(e);
|
|
66
|
-
return (code.startsWith('Digit') || code.startsWith('Numpad')) && withModifiers(e, Modifiers.AltKey);
|
|
67
|
-
},
|
|
68
|
-
action: e => {
|
|
69
|
-
const scheduler = this.scheduler;
|
|
70
|
-
const code = normalizeKeys(e);
|
|
71
|
-
const viewIndex = this.digitToNumber(code, code.startsWith('Digit') ? 'Digit' : 'Numpad') - 1;
|
|
72
|
-
const views = scheduler.views.toArray();
|
|
73
|
-
const view = views[viewIndex];
|
|
74
|
-
if (view) {
|
|
75
|
-
this.zone.run(() => {
|
|
76
|
-
const prevented = scheduler.onNavigationAction({ type: 'view-change', view });
|
|
77
|
-
if (!prevented) {
|
|
78
|
-
this.changeDetector.markForCheck();
|
|
79
|
-
this.focusWait();
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
match: e => e.code === Keys.F10 && noModifiers(e),
|
|
86
|
-
action: (e) => {
|
|
87
|
-
this.zone.run(() => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
this.scheduler.onNavigationAction({ type: 'focus-toolbar' });
|
|
90
|
-
this.focusWait();
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
match: e => normalizeKeys(e) === Keys.KeyT && noModifiers(e),
|
|
95
|
-
action: () => {
|
|
96
|
-
this.zone.run(() => {
|
|
97
|
-
this.scheduler.onNavigationAction({ type: 'today' });
|
|
98
|
-
this.focusWait();
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
match: e => normalizeKeys(e) === Keys.KeyB && noModifiers(e),
|
|
103
|
-
action: () => {
|
|
104
|
-
this.zone.run(() => {
|
|
105
|
-
this.scheduler.onNavigationAction({ type: 'toggle-business-hours' });
|
|
106
|
-
this.focusWait();
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
match: (e) => {
|
|
111
|
-
const code = normalizeKeys(e);
|
|
112
|
-
return (code === Keys.ArrowLeft || code === Keys.ArrowRight) && withModifiers(e, Modifiers.ShiftKey);
|
|
113
|
-
},
|
|
114
|
-
action: (e) => {
|
|
115
|
-
const code = normalizeKeys(e);
|
|
116
|
-
const type = code === Keys.ArrowLeft ? 'prev' : 'next';
|
|
117
|
-
this.zone.run(() => {
|
|
118
|
-
this.scheduler.onNavigationAction({ type });
|
|
119
|
-
this.focusWait();
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
match: e => {
|
|
124
|
-
const code = normalizeKeys(e);
|
|
125
|
-
return (code === Keys.ArrowUp || code === Keys.ArrowLeft) && noModifiers(e) && !isContentWrapper(e.target);
|
|
126
|
-
},
|
|
127
|
-
action: e => {
|
|
128
|
-
//use the MultiViewCalendar navigation for Year View
|
|
129
|
-
if (e.target.tagName === CALENDAR_TAG) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
// do nothing if the shortcut is executed on an element inside the kendoSchedulerToolbarTemplate
|
|
133
|
-
if (this.isInToolbarTemplate(e.target)) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const prevented = this.scheduler.onNavigationAction({ type: 'focus-prev' });
|
|
137
|
-
if (!prevented) {
|
|
138
|
-
const item = this.focusService.activeItem;
|
|
139
|
-
const isFirstEvent = item.containerType === 'content' && item.element.nativeElement.matches(':first-of-type');
|
|
140
|
-
const code = normalizeKeys(e);
|
|
141
|
-
const isUpArrow = code === Keys.ArrowUp;
|
|
142
|
-
// eslint-disable-next-line no-unused-expressions
|
|
143
|
-
isFirstEvent && isUpArrow ? this.focusService.focusToolbar() : this.focusService.focusNext({ offset: -1 });
|
|
144
|
-
e.preventDefault();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
match: e => {
|
|
149
|
-
const code = normalizeKeys(e);
|
|
150
|
-
return (code === Keys.ArrowDown || code === Keys.ArrowRight) && noModifiers(e) && !isContentWrapper(e.target);
|
|
151
|
-
},
|
|
152
|
-
action: e => {
|
|
153
|
-
//use the MultiViewCalendar navigation for Year View
|
|
154
|
-
if (e.target.tagName === CALENDAR_TAG) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
// do nothing if the shortcut is executed on an element inside the kendoSchedulerToolbarTemplate
|
|
158
|
-
if (this.isInToolbarTemplate(e.target)) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
const prevented = this.scheduler.onNavigationAction({ type: 'focus-next' });
|
|
162
|
-
if (!prevented) {
|
|
163
|
-
const isInToolbar = this.focusService.activeItem.containerType === 'toolbar';
|
|
164
|
-
const offset = 1;
|
|
165
|
-
const code = normalizeKeys(e);
|
|
166
|
-
if (code === Keys.ArrowDown && isInToolbar) {
|
|
167
|
-
const focusableElementsArray = Array.from(this.focusService.focusableItems);
|
|
168
|
-
const firstFocusableContentElementIndex = focusableElementsArray.findIndex(item => item.containerType === 'content');
|
|
169
|
-
if (firstFocusableContentElementIndex > -1) {
|
|
170
|
-
this.focusService.focusByIndex(firstFocusableContentElementIndex);
|
|
171
|
-
e.preventDefault();
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
this.focusService.focusNext({ offset });
|
|
176
|
-
e.preventDefault();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}];
|
|
180
|
-
taskShortcuts = [{
|
|
181
|
-
match: e => (e.code === Keys.Delete || e.code === Keys.Backspace) && noModifiers(e),
|
|
182
|
-
action: (e, event) => {
|
|
183
|
-
this.viewState.emitEvent('remove', { event: event, dataItem: event.dataItem });
|
|
184
|
-
e.preventDefault();
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
match: e => (e.code === Keys.Enter || e.code === Keys.NumpadEnter) && noModifiers(e),
|
|
188
|
-
action: (e, event) => {
|
|
189
|
-
this.viewState.emitEvent('eventDblClick', { type: 'dblclick', event: event, originalEvent: e });
|
|
190
|
-
e.preventDefault();
|
|
191
|
-
}
|
|
192
|
-
}];
|
|
193
|
-
subs = new Subscription();
|
|
194
|
-
constructor(scheduler, domEvents, focusService, zone, changeDetector, viewState, dialogsService) {
|
|
195
|
-
this.scheduler = scheduler;
|
|
196
|
-
this.domEvents = domEvents;
|
|
197
|
-
this.focusService = focusService;
|
|
198
|
-
this.zone = zone;
|
|
199
|
-
this.changeDetector = changeDetector;
|
|
200
|
-
this.viewState = viewState;
|
|
201
|
-
this.dialogsService = dialogsService;
|
|
202
|
-
this.subs.add(this.domEvents.keydown.subscribe(e => this.onKeydown(e)));
|
|
203
|
-
this.subs.add(this.scheduler.eventKeydown.subscribe(e => this.onEventKeydown(e)));
|
|
204
|
-
}
|
|
205
|
-
onKeydown(e) {
|
|
206
|
-
const match = this.shortcuts.find(shortcut => shortcut.match(e));
|
|
207
|
-
if (match && !this.dialogsService.isOpen) {
|
|
208
|
-
match.action(e);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
onEventKeydown(e) {
|
|
212
|
-
const match = this.taskShortcuts.find(shortcut => shortcut.match(e.originalEvent));
|
|
213
|
-
if (match && !this.dialogsService.isOpen) {
|
|
214
|
-
match.action(e.originalEvent, e.event);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
focusWait() {
|
|
218
|
-
this.viewState.layoutEnd.pipe(take(1)).subscribe(() => this.focusService.focus());
|
|
219
|
-
}
|
|
220
|
-
isInToolbarTemplate(element) {
|
|
221
|
-
const isInToolbar = element.closest('.k-scheduler-toolbar');
|
|
222
|
-
const isInBuiltInElement = element.closest('.k-toolbar-group') ||
|
|
223
|
-
element.closest('.k-scheduler-views') ||
|
|
224
|
-
element.closest('.k-views-dropdown');
|
|
225
|
-
return isInToolbar && !isInBuiltInElement;
|
|
226
|
-
}
|
|
227
|
-
digitToNumber(code, keyType) {
|
|
228
|
-
return parseInt(code.replace(keyType, ''), 10);
|
|
229
|
-
}
|
|
230
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ShortcutsDirective, deps: [{ token: i1.SchedulerComponent }, { token: i2.DomEventsService }, { token: i3.FocusService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i4.ViewStateService }, { token: i5.DialogsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
231
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ShortcutsDirective, isStandalone: true, selector: "kendo-scheduler", ngImport: i0 });
|
|
232
|
-
}
|
|
233
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ShortcutsDirective, decorators: [{
|
|
234
|
-
type: Directive,
|
|
235
|
-
args: [{
|
|
236
|
-
selector: 'kendo-scheduler',
|
|
237
|
-
standalone: true
|
|
238
|
-
}]
|
|
239
|
-
}], ctorParameters: () => [{ type: i1.SchedulerComponent }, { type: i2.DomEventsService }, { type: i3.FocusService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i4.ViewStateService }, { type: i5.DialogsService }] });
|
package/esm2022/navigation.mjs
DELETED
|
@@ -1,6 +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 { FocusService } from './navigation/focus.service';
|
|
6
|
-
export { FocusableDirective } from './navigation/focusable.directive';
|
|
@@ -1,16 +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 const packageMetadata = {
|
|
9
|
-
name: '@progress/kendo-angular-scheduler',
|
|
10
|
-
productName: 'Kendo UI for Angular',
|
|
11
|
-
productCode: 'KENDOUIANGULAR',
|
|
12
|
-
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate: 1768386630,
|
|
14
|
-
version: '21.4.1-develop.1',
|
|
15
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
16
|
-
};
|
|
@@ -1,96 +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 { Component, HostListener, ElementRef, Renderer2, NgZone } from '@angular/core';
|
|
6
|
-
import { Button } from '@progress/kendo-angular-buttons';
|
|
7
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { PDFService } from './pdf.service';
|
|
9
|
-
import { filePdfIcon } from '@progress/kendo-svg-icons';
|
|
10
|
-
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
11
|
-
import { NgClass } from '@angular/common';
|
|
12
|
-
import * as i0 from "@angular/core";
|
|
13
|
-
import * as i1 from "./pdf.service";
|
|
14
|
-
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
|
-
/**
|
|
16
|
-
* Represents the `export-to-PDF` command for the Scheduler.
|
|
17
|
-
*
|
|
18
|
-
* You can apply this directive to any `button` element inside a [`ToolbarTemplate`](slug:toolbar_scheduler).
|
|
19
|
-
* When a user clicks a button associated with this directive, the [`pdfExport`](slug:api_scheduler_schedulercomponent#toc-pdfexport) event fires
|
|
20
|
-
* ([see example](slug:pdfexport_scheduler)).
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```html
|
|
24
|
-
* <kendo-scheduler>
|
|
25
|
-
* <ng-template kendoSchedulerToolbarTemplate>
|
|
26
|
-
* <button kendoSchedulerPDFCommand>Export to PDF</button>
|
|
27
|
-
* </ng-template>
|
|
28
|
-
* <kendo-scheduler-pdf fileName="Scheduler.pdf">
|
|
29
|
-
* </kendo-scheduler-pdf>
|
|
30
|
-
* </kendo-scheduler>
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export class PDFCommandDirective extends Button {
|
|
34
|
-
pdfService;
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
onClick(e) {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
this.pdfService.exportClick.emit();
|
|
41
|
-
}
|
|
42
|
-
constructor(pdfService, element, renderer, localization, ngZone) {
|
|
43
|
-
super(element, renderer, null, localization, ngZone);
|
|
44
|
-
this.pdfService = pdfService;
|
|
45
|
-
}
|
|
46
|
-
ngOnInit() {
|
|
47
|
-
this.icon = 'pdf';
|
|
48
|
-
this.svgIcon = filePdfIcon;
|
|
49
|
-
}
|
|
50
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PDFCommandDirective, deps: [{ token: i1.PDFService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: PDFCommandDirective, isStandalone: true, selector: "[kendoSchedulerPDFCommand]", host: { listeners: { "click": "onClick($event)" } }, usesInheritance: true, ngImport: i0, template: `
|
|
52
|
-
@if (icon || svgIcon) {
|
|
53
|
-
<kendo-icon-wrapper
|
|
54
|
-
innerCssClass="k-button-icon"
|
|
55
|
-
[name]="icon"
|
|
56
|
-
[svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
57
|
-
}
|
|
58
|
-
@if (imageUrl) {
|
|
59
|
-
<span class="k-button-icon k-icon">
|
|
60
|
-
<img [src]="imageUrl" class="k-image" role="presentation" />
|
|
61
|
-
</span>
|
|
62
|
-
}
|
|
63
|
-
@if (iconClass) {
|
|
64
|
-
<span class="k-button-icon" [ngClass]="iconClass"></span>
|
|
65
|
-
}
|
|
66
|
-
<span class="k-button-text"><ng-content></ng-content></span>
|
|
67
|
-
`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
68
|
-
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PDFCommandDirective, decorators: [{
|
|
70
|
-
type: Component,
|
|
71
|
-
args: [{
|
|
72
|
-
selector: '[kendoSchedulerPDFCommand]',
|
|
73
|
-
template: `
|
|
74
|
-
@if (icon || svgIcon) {
|
|
75
|
-
<kendo-icon-wrapper
|
|
76
|
-
innerCssClass="k-button-icon"
|
|
77
|
-
[name]="icon"
|
|
78
|
-
[svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
79
|
-
}
|
|
80
|
-
@if (imageUrl) {
|
|
81
|
-
<span class="k-button-icon k-icon">
|
|
82
|
-
<img [src]="imageUrl" class="k-image" role="presentation" />
|
|
83
|
-
</span>
|
|
84
|
-
}
|
|
85
|
-
@if (iconClass) {
|
|
86
|
-
<span class="k-button-icon" [ngClass]="iconClass"></span>
|
|
87
|
-
}
|
|
88
|
-
<span class="k-button-text"><ng-content></ng-content></span>
|
|
89
|
-
`,
|
|
90
|
-
standalone: true,
|
|
91
|
-
imports: [IconWrapperComponent, NgClass]
|
|
92
|
-
}]
|
|
93
|
-
}], ctorParameters: () => [{ type: i1.PDFService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.LocalizationService }, { type: i0.NgZone }], propDecorators: { onClick: [{
|
|
94
|
-
type: HostListener,
|
|
95
|
-
args: ['click', ['$event']]
|
|
96
|
-
}] } });
|