@progress/kendo-angular-dialog 7.1.5 → 11.0.0-develop.101

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 (126) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +4 -4
  3. package/README.md +1 -1
  4. package/common/actions-layout.d.ts +2 -2
  5. package/common/animation-types.d.ts +1 -1
  6. package/common/dialog-animation-direction.d.ts +1 -1
  7. package/common/preventable-event.d.ts +1 -1
  8. package/common/util.d.ts +3 -3
  9. package/dialog/dialog-actions.component.d.ts +4 -3
  10. package/dialog/dialog-animations/animate-content.d.ts +1 -1
  11. package/dialog/dialog-animations/animations.d.ts +1 -1
  12. package/dialog/dialog-animations/create-animation-player.d.ts +1 -1
  13. package/dialog/dialog-container.directive.d.ts +1 -1
  14. package/dialog/dialog-container.service.d.ts +1 -1
  15. package/dialog/dialog-content-base.d.ts +1 -1
  16. package/dialog/dialog-titlebar.component.d.ts +6 -1
  17. package/dialog/dialog.component.d.ts +16 -2
  18. package/dialog/dialog.service.d.ts +1 -1
  19. package/dialog/models/dialog-action.d.ts +1 -1
  20. package/dialog/models/dialog-animation.d.ts +1 -1
  21. package/dialog/models/dialog-close-result.d.ts +1 -1
  22. package/dialog/models/dialog-ref.d.ts +1 -1
  23. package/dialog/models/dialog-result.d.ts +1 -1
  24. package/dialog/models/dialog-settings.d.ts +1 -1
  25. package/dialog/models/index.d.ts +2 -1
  26. package/dialog/models/theme-color.d.ts +13 -0
  27. package/dialog.module.d.ts +1 -1
  28. package/dialogs.module.d.ts +1 -1
  29. package/{esm2015/dialog/models/dialog-animation.js → esm2020/common/actions-layout.mjs} +1 -1
  30. package/{esm2015/common/actions-layout.js → esm2020/common/animation-types.mjs} +1 -1
  31. package/{esm2015/common/animation-types.js → esm2020/common/dialog-animation-direction.mjs} +1 -1
  32. package/{esm2015/common/preventable-event.js → esm2020/common/preventable-event.mjs} +1 -1
  33. package/{esm2015/common/util.js → esm2020/common/util.mjs} +3 -3
  34. package/{esm2015/dialog/dialog-actions.component.js → esm2020/dialog/dialog-actions.component.mjs} +23 -11
  35. package/{esm2015/dialog/dialog-animations/animate-content.js → esm2020/dialog/dialog-animations/animate-content.mjs} +1 -1
  36. package/{esm2015/dialog/dialog-animations/animations.js → esm2020/dialog/dialog-animations/animations.mjs} +9 -5
  37. package/{esm2015/dialog/dialog-animations/create-animation-player.js → esm2020/dialog/dialog-animations/create-animation-player.mjs} +1 -1
  38. package/{esm2015/dialog/dialog-container.directive.js → esm2020/dialog/dialog-container.directive.mjs} +6 -5
  39. package/{esm2015/dialog/dialog-container.service.js → esm2020/dialog/dialog-container.service.mjs} +4 -4
  40. package/{esm2015/dialog/dialog-content-base.js → esm2020/dialog/dialog-content-base.mjs} +5 -4
  41. package/{esm2015/dialog/dialog-titlebar.component.js → esm2020/dialog/dialog-titlebar.component.mjs} +29 -17
  42. package/{esm2015/dialog/dialog.component.js → esm2020/dialog/dialog.component.mjs} +43 -8
  43. package/{esm2015/dialog/dialog.service.js → esm2020/dialog/dialog.service.mjs} +5 -5
  44. package/{esm2015/dialog/models/dialog-action.js → esm2020/dialog/models/dialog-action.mjs} +1 -1
  45. package/{esm2015/common/dialog-animation-direction.js → esm2020/dialog/models/dialog-animation.mjs} +1 -1
  46. package/{esm2015/dialog/models/dialog-close-result.js → esm2020/dialog/models/dialog-close-result.mjs} +1 -1
  47. package/{esm2015/dialog/models/dialog-ref.js → esm2020/dialog/models/dialog-ref.mjs} +1 -1
  48. package/esm2020/dialog/models/dialog-result.mjs +5 -0
  49. package/{esm2015/dialog/models/dialog-settings.js → esm2020/dialog/models/dialog-settings.mjs} +1 -1
  50. package/{esm2015/dialog/models/index.js → esm2020/dialog/models/index.mjs} +2 -1
  51. package/esm2020/dialog/models/theme-color.mjs +5 -0
  52. package/{esm2015/dialog.module.js → esm2020/dialog.module.mjs} +5 -5
  53. package/{esm2015/dialogs.module.js → esm2020/dialogs.module.mjs} +5 -5
  54. package/{esm2015/main.js → esm2020/index.mjs} +2 -1
  55. package/{esm2015/localization/custom-messages.component.js → esm2020/localization/custom-messages.component.mjs} +5 -4
  56. package/{esm2015/localization/dialog-localization.service.js → esm2020/localization/dialog-localization.service.mjs} +1 -1
  57. package/{esm2015/localization/localized-messages.directive.js → esm2020/localization/localized-messages.directive.mjs} +5 -4
  58. package/{esm2015/localization/messages.js → esm2020/localization/messages.mjs} +4 -4
  59. package/{esm2015/localization/titlebar-localization.service.js → esm2020/localization/titlebar-localization.service.mjs} +5 -5
  60. package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
  61. package/{esm2015/kendo-angular-dialog.js → esm2020/progress-kendo-angular-dialog.mjs} +2 -2
  62. package/{esm2015/shared.module.js → esm2020/shared.module.mjs} +11 -9
  63. package/{esm2015/window/actions/window-close-action.directive.js → esm2020/window/actions/window-close-action.directive.mjs} +42 -9
  64. package/{esm2015/window/actions/window-maximize-action.directive.js → esm2020/window/actions/window-maximize-action.directive.mjs} +42 -9
  65. package/{esm2015/window/actions/window-minimize-action.directive.js → esm2020/window/actions/window-minimize-action.directive.mjs} +42 -9
  66. package/{esm2015/window/actions/window-restore-action.directive.js → esm2020/window/actions/window-restore-action.directive.mjs} +42 -9
  67. package/{esm2015/window/drag-resize.service.js → esm2020/window/drag-resize.service.mjs} +13 -13
  68. package/{esm2015/window/models/index.js → esm2020/window/models/index.mjs} +2 -1
  69. package/esm2020/window/models/theme-color.mjs +5 -0
  70. package/{esm2015/window/models/window-close-result.js → esm2020/window/models/window-close-result.mjs} +1 -1
  71. package/esm2020/window/models/window-messages.mjs +5 -0
  72. package/esm2020/window/models/window-options.mjs +5 -0
  73. package/{esm2015/window/models/window-ref.js → esm2020/window/models/window-ref.mjs} +1 -1
  74. package/{esm2015/window/models/window-settings.js → esm2020/window/models/window-settings.mjs} +1 -1
  75. package/esm2020/window/models/window-types.mjs +5 -0
  76. package/{esm2015/window/navigation.service.js → esm2020/window/navigation.service.mjs} +10 -9
  77. package/{esm2015/window/window-container.directive.js → esm2020/window/window-container.directive.mjs} +6 -5
  78. package/{esm2015/window/window-container.service.js → esm2020/window/window-container.service.mjs} +4 -4
  79. package/esm2020/window/window-events.mjs +5 -0
  80. package/{esm2015/window/window-resize-handle.directive.js → esm2020/window/window-resize-handle.directive.mjs} +7 -5
  81. package/{esm2015/window/window-titlebar.component.js → esm2020/window/window-titlebar.component.mjs} +6 -8
  82. package/{esm2015/window/window.component.js → esm2020/window/window.component.mjs} +55 -23
  83. package/{esm2015/window/window.service.js → esm2020/window/window.service.mjs} +5 -5
  84. package/{esm2015/window.module.js → esm2020/window.module.mjs} +5 -5
  85. package/fesm2015/progress-kendo-angular-dialog.mjs +3765 -0
  86. package/{fesm2015/kendo-angular-dialog.js → fesm2020/progress-kendo-angular-dialog.mjs} +378 -169
  87. package/{main.d.ts → index.d.ts} +4 -3
  88. package/localization/custom-messages.component.d.ts +1 -1
  89. package/localization/dialog-localization.service.d.ts +1 -1
  90. package/localization/localized-messages.directive.d.ts +1 -1
  91. package/localization/messages.d.ts +1 -1
  92. package/localization/titlebar-localization.service.d.ts +1 -1
  93. package/package-metadata.d.ts +1 -1
  94. package/package.json +30 -56
  95. package/{kendo-angular-dialog.d.ts → progress-kendo-angular-dialog.d.ts} +2 -2
  96. package/schematics/ngAdd/index.js +4 -6
  97. package/shared.module.d.ts +4 -2
  98. package/window/actions/window-close-action.directive.d.ts +7 -2
  99. package/window/actions/window-maximize-action.directive.d.ts +7 -2
  100. package/window/actions/window-minimize-action.directive.d.ts +7 -2
  101. package/window/actions/window-restore-action.directive.d.ts +7 -2
  102. package/window/drag-resize.service.d.ts +1 -1
  103. package/window/models/index.d.ts +2 -1
  104. package/window/models/theme-color.d.ts +13 -0
  105. package/window/models/window-close-result.d.ts +1 -1
  106. package/window/models/window-messages.d.ts +1 -1
  107. package/window/models/window-options.d.ts +1 -1
  108. package/window/models/window-ref.d.ts +1 -1
  109. package/window/models/window-settings.d.ts +1 -1
  110. package/window/models/window-types.d.ts +1 -1
  111. package/window/navigation.service.d.ts +1 -1
  112. package/window/window-container.directive.d.ts +1 -1
  113. package/window/window-container.service.d.ts +1 -1
  114. package/window/window-events.d.ts +1 -1
  115. package/window/window-resize-handle.directive.d.ts +1 -1
  116. package/window/window-titlebar.component.d.ts +1 -1
  117. package/window/window.component.d.ts +17 -3
  118. package/window/window.service.d.ts +1 -1
  119. package/window.module.d.ts +1 -1
  120. package/bundles/kendo-angular-dialog.umd.js +0 -5
  121. package/esm2015/dialog/models/dialog-result.js +0 -5
  122. package/esm2015/window/models/window-messages.js +0 -5
  123. package/esm2015/window/models/window-options.js +0 -5
  124. package/esm2015/window/models/window-types.js +0 -5
  125. package/esm2015/window/window-events.js +0 -5
  126. package/schematics/ngAdd/index.js.map +0 -1
@@ -0,0 +1,3765 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as i0 from '@angular/core';
6
+ import { EventEmitter, TemplateRef, Component, Input, Output, HostBinding, InjectionToken, Injectable, Inject, Optional, Directive, forwardRef, ContentChildren, ViewChildren, ViewChild, isDevMode, Renderer2, Host, HostListener, ContentChild, NgModule } from '@angular/core';
7
+ import * as i2$1 from '@angular/animations';
8
+ import { style, animate, keyframes, trigger, state, transition } from '@angular/animations';
9
+ import { of, Subscription, Subject, merge } from 'rxjs';
10
+ import { delay, takeUntil, take, filter, map, share, tap, switchMap } from 'rxjs/operators';
11
+ import * as i4 from '@angular/common';
12
+ import { CommonModule } from '@angular/common';
13
+ import * as i1 from '@progress/kendo-angular-l10n';
14
+ import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages } from '@progress/kendo-angular-l10n';
15
+ import { xIcon, windowMinimizeIcon, windowIcon, windowRestoreIcon } from '@progress/kendo-svg-icons';
16
+ import * as i2 from '@progress/kendo-angular-buttons';
17
+ import { Button, ButtonModule } from '@progress/kendo-angular-buttons';
18
+ import { validatePackage } from '@progress/kendo-licensing';
19
+ import * as i1$1 from '@progress/kendo-angular-common';
20
+ import { isDocumentAvailable, DraggableDirective, isChanged, DraggableModule } from '@progress/kendo-angular-common';
21
+ import { offset, scrollPosition, positionWithScroll, getDocumentElement, getWindowViewPort } from '@progress/kendo-popup-common';
22
+ import * as i3 from '@progress/kendo-angular-icons';
23
+ import { IconsModule } from '@progress/kendo-angular-icons';
24
+
25
+ /**
26
+ * @hidden
27
+ */
28
+ const isPresent = (value) => value !== null && value !== undefined;
29
+ /**
30
+ * @hidden
31
+ */
32
+ const isTruthy = (value) => !!value;
33
+ const toClassList = (classNames) => String(classNames).trim().split(' ');
34
+ const focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
35
+ /**
36
+ * @hidden
37
+ */
38
+ var Keys;
39
+ (function (Keys) {
40
+ Keys[Keys["esc"] = 27] = "esc";
41
+ Keys[Keys["tab"] = 9] = "tab";
42
+ Keys[Keys["enter"] = 13] = "enter";
43
+ Keys[Keys["space"] = 32] = "space";
44
+ Keys[Keys["ctrl"] = 17] = "ctrl";
45
+ Keys[Keys["shift"] = 16] = "shift";
46
+ Keys[Keys["left"] = 37] = "left";
47
+ Keys[Keys["up"] = 38] = "up";
48
+ Keys[Keys["right"] = 39] = "right";
49
+ Keys[Keys["down"] = 40] = "down";
50
+ })(Keys || (Keys = {}));
51
+ /**
52
+ * @hidden
53
+ */
54
+ const DIALOG_ELEMENTS_HANDLING_ESC_KEY = 'k-dialog-wrapper k-actions k-dialog-titlebar-action';
55
+ /**
56
+ * @hidden
57
+ */
58
+ const DIALOG_ELEMENTS_HANDLING_ARROWS = 'k-actions';
59
+ /**
60
+ * @hidden
61
+ */
62
+ const WINDOW_CLASSES = 'k-window';
63
+ /**
64
+ * @hidden
65
+ */
66
+ const hasClasses = (element, classNames) => {
67
+ const namesList = toClassList(classNames);
68
+ return Boolean(toClassList(element.className).find((className) => namesList.indexOf(className) >= 0));
69
+ };
70
+ /**
71
+ * @hidden
72
+ */
73
+ const isVisible = (element) => {
74
+ const rect = element.getBoundingClientRect();
75
+ return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
76
+ };
77
+ /**
78
+ * @hidden
79
+ */
80
+ const isFocusable = (element, checkVisibility = true) => {
81
+ if (element.tagName) {
82
+ const tagName = element.tagName.toLowerCase();
83
+ const tabIndex = element.getAttribute('tabIndex');
84
+ const validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
85
+ let focusable = false;
86
+ if (focusableRegex.test(tagName)) {
87
+ focusable = !element.disabled;
88
+ }
89
+ else {
90
+ focusable = validTabIndex;
91
+ }
92
+ return focusable && (!checkVisibility || isVisible(element));
93
+ }
94
+ return false;
95
+ };
96
+ /**
97
+ * @hidden
98
+ */
99
+ const setHTMLAttributes = (attributes, renderer, element) => {
100
+ for (const attribute in attributes) {
101
+ if (attribute) {
102
+ renderer.setAttribute(element, attribute, attributes[attribute]);
103
+ }
104
+ }
105
+ };
106
+ /**
107
+ * Receives CSS class declarations either as an object, string or array and returns an array of the class names.
108
+ *
109
+ * @hidden
110
+ */
111
+ const parseCSSClassNames = (value) => {
112
+ if (isObject(value)) {
113
+ return parseObjectClassNames(value);
114
+ }
115
+ if (isString(value)) {
116
+ return parseStringClassNames(value);
117
+ }
118
+ if (Array.isArray(value)) {
119
+ return parseArrayClassNames(value);
120
+ }
121
+ };
122
+ const parseObjectClassNames = (value) => {
123
+ const classes = [];
124
+ Object.keys(value).forEach(className => {
125
+ const currentClassName = splitStringToArray(className);
126
+ if (value[className] && currentClassName[0]) {
127
+ classes.push(...currentClassName);
128
+ }
129
+ });
130
+ return classes;
131
+ };
132
+ const parseStringClassNames = (value) => {
133
+ const classes = [];
134
+ const classesArray = splitStringToArray(value);
135
+ classesArray.forEach(className => {
136
+ classes.push(className);
137
+ });
138
+ return classes;
139
+ };
140
+ const parseArrayClassNames = (value) => {
141
+ const classes = [];
142
+ value.forEach((className) => {
143
+ const current = splitStringToArray(className);
144
+ if (current[0]) {
145
+ classes.push(...current);
146
+ }
147
+ });
148
+ return classes;
149
+ };
150
+ /**
151
+ * @hidden
152
+ */
153
+ const focusableSelector = [
154
+ 'a[href]',
155
+ 'area[href]',
156
+ 'input:not([disabled])',
157
+ 'select:not([disabled])',
158
+ 'textarea:not([disabled])',
159
+ 'button:not([disabled])',
160
+ 'iframe',
161
+ 'object',
162
+ 'embed',
163
+ '*[tabindex]',
164
+ '*[contenteditable]'
165
+ ].join(',');
166
+ /**
167
+ * @hidden
168
+ */
169
+ const preventDefault = ({ originalEvent: event }) => {
170
+ event.stopPropagation();
171
+ event.preventDefault();
172
+ };
173
+ /**
174
+ * @hidden
175
+ */
176
+ const isWindowAvailable = () => {
177
+ return typeof window !== 'undefined';
178
+ };
179
+ /**
180
+ * @hidden
181
+ */
182
+ const preventOnDblClick = release => (mouseDown) => of(mouseDown).pipe(delay(150), takeUntil(release));
183
+ /**
184
+ * @hidden
185
+ */
186
+ const RESIZE_DIRECTIONS = ['n', 'e', 's', 'w', 'se', 'sw', 'ne', 'nw'];
187
+ /**
188
+ * @hidden
189
+ */
190
+ const OFFSET_STYLES = ['top', 'left', 'width', 'height'];
191
+ /**
192
+ * @hidden
193
+ */
194
+ const isString = (value) => value instanceof String || typeof value === 'string';
195
+ /**
196
+ * @hidden
197
+ */
198
+ const isObject = (value) => isPresent(value) && !Array.isArray(value) && typeof value === 'object';
199
+ /**
200
+ * @hidden
201
+ */
202
+ const isNumber = (value) => typeof value === 'number' && isFinite(value);
203
+ /**
204
+ * @hidden
205
+ */
206
+ const createValueWithUnit = (value) => value + (isNumber(value) ? 'px' : '');
207
+ /**
208
+ * @hidden
209
+ */
210
+ const splitStringToArray = (value) => value.trim().replace(/\s+/g, " ").split(' ');
211
+ /**
212
+ * @hidden
213
+ */
214
+ const findPrimaryButton = (buttons) => {
215
+ for (let i = buttons.length - 1; i >= 0; i--) {
216
+ const classList = buttons[i].classList;
217
+ for (let j = 0; j < classList.length; j++) {
218
+ if (classList[j].endsWith('-primary')) {
219
+ return buttons[i];
220
+ }
221
+ }
222
+ }
223
+ };
224
+
225
+ /**
226
+ * Specifies the action buttons of the Dialog
227
+ * ([see example]({% slug actionbuttons_dialog %})).
228
+ */
229
+ class DialogActionsComponent {
230
+ constructor(el) {
231
+ this.el = el;
232
+ /**
233
+ * Specifies the possible layout of the action buttons.
234
+ */
235
+ this.layout = 'stretched';
236
+ /**
237
+ * Fires when the user clicks an action button.
238
+ */
239
+ this.action = new EventEmitter();
240
+ this.hostClasses = true;
241
+ }
242
+ /**
243
+ * Allows the declarative specification of the actions.
244
+ */
245
+ set actions(value) {
246
+ if (value instanceof TemplateRef) {
247
+ this.actionsTemplate = value;
248
+ }
249
+ else if (Array.isArray(value)) {
250
+ this.actionsArray = value;
251
+ }
252
+ else {
253
+ throw new Error('"actions" must be either TemplateRef or DialogAction[] instance.');
254
+ }
255
+ }
256
+ get stretchedClassName() {
257
+ return this.layout === 'stretched';
258
+ }
259
+ get endClassName() {
260
+ return this.layout === 'end';
261
+ }
262
+ /**
263
+ * @hidden
264
+ */
265
+ onButtonClick(action, _e) {
266
+ this.action.emit(action);
267
+ }
268
+ /**
269
+ * @hidden
270
+ */
271
+ buttonClass(action) {
272
+ let classes = ['k-button k-button-md k-rounded-md'];
273
+ const fillMode = action.fillMode ? action.fillMode : 'solid';
274
+ const themeColor = action.themeColor ? action.themeColor : 'base';
275
+ const cssClasses = action.cssClass ? parseCSSClassNames(action.cssClass) : [];
276
+ classes.push(`k-button-${fillMode} k-button-${fillMode}-${themeColor}`);
277
+ if (cssClasses.length > 0) {
278
+ classes = classes.concat(cssClasses);
279
+ }
280
+ return classes.join(' ');
281
+ }
282
+ }
283
+ DialogActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogActionsComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
284
+ DialogActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: { actions: "actions", layout: "layout" }, outputs: { action: "action" }, host: { properties: { "class.k-actions": "this.hostClasses", "class.k-actions-horizontal": "this.hostClasses", "class.k-window-actions": "this.hostClasses", "class.k-dialog-actions": "this.hostClasses", "class.k-actions-stretched": "this.stretchedClassName", "class.k-actions-end": "this.endClassName" } }, ngImport: i0, template: `
285
+ <ng-content *ngIf="!actions"></ng-content>
286
+ <ng-container *ngIf="actionsArray; else actionTemplate">
287
+ <button
288
+ type="button"
289
+ *ngFor="let action of actionsArray"
290
+ [ngClass]="buttonClass(action)"
291
+ (click)="onButtonClick(action, $event)"
292
+ [attr.aria-label]="action.text"
293
+ >
294
+ {{ action.text }}
295
+ </button>
296
+ </ng-container>
297
+ <ng-template #actionTemplate [ngTemplateOutlet]="actionsTemplate"></ng-template>
298
+ `, isInline: true, directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogActionsComponent, decorators: [{
300
+ type: Component,
301
+ args: [{
302
+ selector: 'kendo-dialog-actions',
303
+ template: `
304
+ <ng-content *ngIf="!actions"></ng-content>
305
+ <ng-container *ngIf="actionsArray; else actionTemplate">
306
+ <button
307
+ type="button"
308
+ *ngFor="let action of actionsArray"
309
+ [ngClass]="buttonClass(action)"
310
+ (click)="onButtonClick(action, $event)"
311
+ [attr.aria-label]="action.text"
312
+ >
313
+ {{ action.text }}
314
+ </button>
315
+ </ng-container>
316
+ <ng-template #actionTemplate [ngTemplateOutlet]="actionsTemplate"></ng-template>
317
+ `
318
+ }]
319
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { actions: [{
320
+ type: Input
321
+ }], layout: [{
322
+ type: Input
323
+ }], action: [{
324
+ type: Output
325
+ }], hostClasses: [{
326
+ type: HostBinding,
327
+ args: ['class.k-actions']
328
+ }, {
329
+ type: HostBinding,
330
+ args: ['class.k-actions-horizontal']
331
+ }, {
332
+ type: HostBinding,
333
+ args: ['class.k-window-actions']
334
+ }, {
335
+ type: HostBinding,
336
+ args: ['class.k-dialog-actions']
337
+ }], stretchedClassName: [{
338
+ type: HostBinding,
339
+ args: ['class.k-actions-stretched']
340
+ }], endClassName: [{
341
+ type: HostBinding,
342
+ args: ['class.k-actions-end']
343
+ }] } });
344
+
345
+ class PreventableEvent {
346
+ /**
347
+ * @hidden
348
+ */
349
+ constructor() {
350
+ this.prevented = false;
351
+ }
352
+ /**
353
+ * Prevents the default action for a specified event.
354
+ * In this way, the source component suppresses the built-in behavior that follows the event.
355
+ */
356
+ preventDefault() {
357
+ this.prevented = true;
358
+ }
359
+ /**
360
+ * If the event is prevented by any of its subscribers, returns `true`.
361
+ *
362
+ * @returns `true` if the default action was prevented. Otherwise, returns `false`.
363
+ */
364
+ isDefaultPrevented() {
365
+ return this.prevented;
366
+ }
367
+ }
368
+
369
+ /**
370
+ * @hidden
371
+ */
372
+ const DIALOG_LOCALIZATION_SERVICE = new InjectionToken('Dialog LocalizationService');
373
+
374
+ /**
375
+ * @hidden
376
+ */
377
+ class TitleBarLocalizationService extends LocalizationService {
378
+ constructor(prefix, messageService, rtl, dialogLocalization) {
379
+ super(prefix, messageService, rtl);
380
+ this.dialogLocalization = dialogLocalization;
381
+ }
382
+ get(shortKey) {
383
+ if (this.dialogLocalization) {
384
+ return this.dialogLocalization.get(shortKey);
385
+ }
386
+ return super.get(shortKey);
387
+ }
388
+ }
389
+ TitleBarLocalizationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TitleBarLocalizationService, deps: [{ token: L10N_PREFIX }, { token: i1.MessageService, optional: true }, { token: RTL, optional: true }, { token: DIALOG_LOCALIZATION_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
390
+ TitleBarLocalizationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TitleBarLocalizationService });
391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TitleBarLocalizationService, decorators: [{
392
+ type: Injectable
393
+ }], ctorParameters: function () {
394
+ return [{ type: undefined, decorators: [{
395
+ type: Inject,
396
+ args: [L10N_PREFIX]
397
+ }] }, { type: i1.MessageService, decorators: [{
398
+ type: Optional
399
+ }] }, { type: undefined, decorators: [{
400
+ type: Optional
401
+ }, {
402
+ type: Inject,
403
+ args: [RTL]
404
+ }] }, { type: i1.LocalizationService, decorators: [{
405
+ type: Optional
406
+ }, {
407
+ type: Inject,
408
+ args: [DIALOG_LOCALIZATION_SERVICE]
409
+ }] }];
410
+ } });
411
+
412
+ /**
413
+ * @hidden
414
+ */
415
+ class Messages extends ComponentMessages {
416
+ }
417
+ Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
418
+ Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: Messages, selector: "kendo-dialog-messages-base", inputs: { closeTitle: "closeTitle", restoreTitle: "restoreTitle", maximizeTitle: "maximizeTitle", minimizeTitle: "minimizeTitle" }, usesInheritance: true, ngImport: i0 });
419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: Messages, decorators: [{
420
+ type: Directive,
421
+ args: [{
422
+ // eslint-disable-next-line @angular-eslint/directive-selector
423
+ selector: 'kendo-dialog-messages-base'
424
+ }]
425
+ }], propDecorators: { closeTitle: [{
426
+ type: Input
427
+ }], restoreTitle: [{
428
+ type: Input
429
+ }], maximizeTitle: [{
430
+ type: Input
431
+ }], minimizeTitle: [{
432
+ type: Input
433
+ }] } });
434
+
435
+ /**
436
+ * @hidden
437
+ */
438
+ class LocalizedMessagesDirective extends Messages {
439
+ constructor(service) {
440
+ super();
441
+ this.service = service;
442
+ }
443
+ }
444
+ LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
445
+ LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: LocalizedMessagesDirective, selector: "\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n ", providers: [
446
+ {
447
+ provide: Messages,
448
+ useExisting: forwardRef(() => LocalizedMessagesDirective)
449
+ }
450
+ ], usesInheritance: true, ngImport: i0 });
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
452
+ type: Directive,
453
+ args: [{
454
+ providers: [
455
+ {
456
+ provide: Messages,
457
+ useExisting: forwardRef(() => LocalizedMessagesDirective)
458
+ }
459
+ ],
460
+ selector: `
461
+ [kendoDialogLocalizedMessages],
462
+ [kendoWindowLocalizedMessages],
463
+ [kendoDialogTitleBarLocalizedMessages]
464
+ `
465
+ }]
466
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
467
+
468
+ /**
469
+ * Represents the [Kendo UI DialogTitleBar component for Angular]({% slug api_dialog_dialogtitlebarcomponent %}).
470
+ *
471
+ * It is used as part of the Dialog content when the component is created dynamically by using an [Angular service]({% slug service_dialog %}).
472
+ */
473
+ class DialogTitleBarComponent {
474
+ constructor(zone, hostElement, localizationService) {
475
+ this.zone = zone;
476
+ this.hostElement = hostElement;
477
+ this.localizationService = localizationService;
478
+ /**
479
+ * Fires when the close button of the title-bar is clicked.
480
+ */
481
+ this.close = new EventEmitter();
482
+ /**
483
+ * @hidden
484
+ */
485
+ this.xIcon = xIcon;
486
+ }
487
+ get className() {
488
+ return true;
489
+ }
490
+ get closeButtonTitle() {
491
+ return this.closeTitle || this.localizationService.get('closeTitle');
492
+ }
493
+ ngAfterViewInit() {
494
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
495
+ const element = this.hostElement.nativeElement.querySelector('.k-dialog-title');
496
+ element.setAttribute('id', this.id);
497
+ });
498
+ }
499
+ /**
500
+ * @hidden
501
+ */
502
+ onCloseClick(e) {
503
+ e.preventDefault();
504
+ const eventArgs = new PreventableEvent();
505
+ this.close.emit(eventArgs);
506
+ }
507
+ }
508
+ DialogTitleBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogTitleBarComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i1.LocalizationService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
509
+ DialogTitleBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: { id: "id", closeTitle: "closeTitle" }, outputs: { close: "close" }, host: { properties: { "class.k-window-titlebar": "this.className", "class.k-dialog-titlebar": "this.className" } }, providers: [
510
+ TitleBarLocalizationService,
511
+ {
512
+ provide: LocalizationService,
513
+ useExisting: TitleBarLocalizationService
514
+ },
515
+ {
516
+ provide: L10N_PREFIX,
517
+ useValue: 'kendo.dialog'
518
+ }
519
+ ], ngImport: i0, template: `
520
+ <ng-container
521
+ kendoDialogTitleBarLocalizedMessages
522
+ i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"
523
+ closeTitle="Close"
524
+ >
525
+ <span class="k-window-title k-dialog-title">
526
+ <ng-content></ng-content>
527
+ </span>
528
+
529
+ <div class="k-window-titlebar-actions k-dialog-titlebar-actions">
530
+ <button
531
+ kendoButton
532
+ fillMode="flat"
533
+ role="button"
534
+ [attr.title]="closeButtonTitle"
535
+ [attr.aria-label]="closeButtonTitle"
536
+ icon="close"
537
+ [svgIcon]="xIcon"
538
+ class="k-window-titlebar-action k-dialog-titlebar-action"
539
+ (click)="onCloseClick($event)"
540
+ >
541
+ </button>
542
+ </div>
543
+ </ng-container>
544
+ `, isInline: true, components: [{ type: i2.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n " }] });
545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogTitleBarComponent, decorators: [{
546
+ type: Component,
547
+ args: [{
548
+ selector: 'kendo-dialog-titlebar',
549
+ providers: [
550
+ TitleBarLocalizationService,
551
+ {
552
+ provide: LocalizationService,
553
+ useExisting: TitleBarLocalizationService
554
+ },
555
+ {
556
+ provide: L10N_PREFIX,
557
+ useValue: 'kendo.dialog'
558
+ }
559
+ ],
560
+ template: `
561
+ <ng-container
562
+ kendoDialogTitleBarLocalizedMessages
563
+ i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"
564
+ closeTitle="Close"
565
+ >
566
+ <span class="k-window-title k-dialog-title">
567
+ <ng-content></ng-content>
568
+ </span>
569
+
570
+ <div class="k-window-titlebar-actions k-dialog-titlebar-actions">
571
+ <button
572
+ kendoButton
573
+ fillMode="flat"
574
+ role="button"
575
+ [attr.title]="closeButtonTitle"
576
+ [attr.aria-label]="closeButtonTitle"
577
+ icon="close"
578
+ [svgIcon]="xIcon"
579
+ class="k-window-titlebar-action k-dialog-titlebar-action"
580
+ (click)="onCloseClick($event)"
581
+ >
582
+ </button>
583
+ </div>
584
+ </ng-container>
585
+ `
586
+ }]
587
+ }], ctorParameters: function () {
588
+ return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i1.LocalizationService, decorators: [{
589
+ type: Optional
590
+ }] }];
591
+ }, propDecorators: { close: [{
592
+ type: Output
593
+ }], id: [{
594
+ type: Input
595
+ }], closeTitle: [{
596
+ type: Input
597
+ }], className: [{
598
+ type: HostBinding,
599
+ args: ['class.k-window-titlebar']
600
+ }, {
601
+ type: HostBinding,
602
+ args: ['class.k-dialog-titlebar']
603
+ }] } });
604
+
605
+ /**
606
+ * @hidden
607
+ */
608
+ const packageMetadata = {
609
+ name: '@progress/kendo-angular-dialog',
610
+ productName: 'Kendo UI for Angular',
611
+ productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
612
+ publishDate: 1673510534,
613
+ version: '',
614
+ licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
615
+ };
616
+
617
+ /**
618
+ * Indicates that the **Close** button is clicked. Used when the results from
619
+ * the Dialogs that are opened through `DialogService` are filtered
620
+ * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
621
+ */
622
+ class DialogCloseResult {
623
+ }
624
+
625
+ /**
626
+ * @hidden
627
+ */
628
+ function animations(duration, direction, animationType) {
629
+ switch (animationType) {
630
+ case 'slide': {
631
+ const translate = direction === 'left' || direction === 'right' ? 'translateX' : 'translateY';
632
+ const start = direction === 'right' || direction === 'down' ? -100 : 100;
633
+ const end = 0;
634
+ return [
635
+ style({ transform: `${translate}(${start}%)` }),
636
+ animate(`${duration}ms ease-in`, style({ transform: `${translate}(${end}%)` }))
637
+ ];
638
+ }
639
+ case 'expand': {
640
+ const scale = direction === 'up' || direction === 'down' ? 'scaleY' : 'scaleX';
641
+ const startScale = 0;
642
+ const endScale = 1;
643
+ let origin;
644
+ if (direction === 'down') {
645
+ origin = 'top';
646
+ }
647
+ else if (direction === 'left') {
648
+ origin = 'right';
649
+ }
650
+ else if (direction === 'right') {
651
+ origin = 'left';
652
+ }
653
+ else {
654
+ origin = 'bottom';
655
+ }
656
+ return [
657
+ style({ transform: `${scale}(${startScale})`, transformOrigin: origin }),
658
+ animate(`${duration}ms ease-in`, style({ transform: `${scale}(${endScale})` }))
659
+ ];
660
+ }
661
+ case 'zoom': {
662
+ const startZoom = 0;
663
+ const endZoom = 1;
664
+ return [
665
+ animate(duration, keyframes([
666
+ style({ transform: `scale(${startZoom})` }),
667
+ style({ transform: `scale(${endZoom})` })
668
+ ]))
669
+ ];
670
+ }
671
+ case 'fade': {
672
+ const startFade = 0;
673
+ const endFade = 1;
674
+ return [
675
+ animate(duration, keyframes([
676
+ style({ opacity: `${startFade}` }),
677
+ style({ opacity: `${endFade}` })
678
+ ]))
679
+ ];
680
+ }
681
+ case 'translate':
682
+ return [
683
+ style({ transform: 'translate(0, -10%)' }),
684
+ animate(`${duration}ms cubic-bezier(.2, 1, .2, 1)`)
685
+ ];
686
+ default:
687
+ return [
688
+ style({ transform: 'translate(0, -10%)' }),
689
+ animate(`${duration}ms cubic-bezier(.2, 1, .2, 1)`)
690
+ ];
691
+ }
692
+ }
693
+
694
+ /**
695
+ * @hidden
696
+ */
697
+ const createPlayer = (builder, animation, animatedElement) => {
698
+ const factory = builder.build(animation);
699
+ let player = factory.create(animatedElement);
700
+ player.onDone(() => {
701
+ if (player) {
702
+ player.destroy();
703
+ player = null;
704
+ }
705
+ });
706
+ return player;
707
+ };
708
+
709
+ /**
710
+ * @hidden
711
+ */
712
+ const animateContent = (animation, defAnimationConfig, animatedElement, builder) => {
713
+ let animationConfig = defAnimationConfig;
714
+ if (typeof animation !== 'boolean') {
715
+ animationConfig = animation;
716
+ animationConfig.duration = animationConfig.duration ? animationConfig.duration : defAnimationConfig.duration;
717
+ }
718
+ const animationSpecs = animations(animationConfig.duration, animationConfig.direction, animationConfig.type);
719
+ const player = createPlayer(builder, animationSpecs, animatedElement);
720
+ player.play();
721
+ };
722
+
723
+ const DEFAULT_ANIMATION_CONFIG = { duration: 300, type: 'translate' };
724
+ /**
725
+ * Represents the [Kendo UI Dialog component for Angular]({% slug overview_dialog_dialogs %}).
726
+ */
727
+ class DialogComponent {
728
+ constructor(wrapper, renderer, localization, cdr, ngZone, builder) {
729
+ this.wrapper = wrapper;
730
+ this.renderer = renderer;
731
+ this.cdr = cdr;
732
+ this.ngZone = ngZone;
733
+ this.builder = builder;
734
+ /**
735
+ * Specifies the layout of the action buttons in the Dialog.
736
+ * This option is only applicable if the action buttons are specified through the `actions` options.
737
+ *
738
+ * @default 'stretched'
739
+ */
740
+ this.actionsLayout = 'stretched';
741
+ /**
742
+ * Configures the Dialog opening animation ([see example]({% slug animations_dialog %})).
743
+ * By default the animation type is set to `translate` and its duration is `300ms`.
744
+ *
745
+ * @default true
746
+ */
747
+ this.animation = true;
748
+ /**
749
+ * @hidden
750
+ */
751
+ this.titleId = null;
752
+ /**
753
+ * @hidden
754
+ */
755
+ this.contentId = null;
756
+ /**
757
+ * Fires when the user clicks an action button of the Dialog.
758
+ * The event is fired only when the action buttons are specified through the `actions` options.
759
+ */
760
+ this.action = new EventEmitter();
761
+ /**
762
+ * Fires when the user clicks the **Close** button of the Dialog or the **ESC** key.
763
+ */
764
+ this.close = new EventEmitter();
765
+ this.tabIndex = 0;
766
+ this._themeColor = null;
767
+ this.subscriptions = [];
768
+ this.domSubs = new Subscription();
769
+ validatePackage(packageMetadata);
770
+ this.direction = localization.rtl ? 'rtl' : 'ltr';
771
+ this.subscriptions.push(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
772
+ this.titleId = this.generateTitleId();
773
+ this.contentId = this.generateContentId();
774
+ }
775
+ /**
776
+ * The Dialog allows you to specify predefined theme colors.
777
+ * The theme color will be applied as a background and border color to the titlebar while also amending the text color accordingly.
778
+ *
779
+ * The possible values are:
780
+ * * `primary`
781
+ * * `dark`
782
+ * * `light`
783
+ */
784
+ set themeColor(themeColor) {
785
+ this.handleThemeColorClass(this.themeColor, themeColor);
786
+ this._themeColor = themeColor;
787
+ }
788
+ get themeColor() {
789
+ return this._themeColor;
790
+ }
791
+ /**
792
+ * @hidden
793
+ */
794
+ set htmlAttributes(attributes) {
795
+ setHTMLAttributes(attributes, this.renderer, this.wrapper.nativeElement);
796
+ const el = this.wrapper.nativeElement;
797
+ const dir = el.getAttribute('dir');
798
+ const tIndex = el.getAttribute('tabindex');
799
+ if (this.direction !== dir && dir) {
800
+ this.direction = dir;
801
+ }
802
+ if (this.tabIndex !== tIndex && tIndex) {
803
+ this.tabIndex = tIndex;
804
+ }
805
+ this._htmlAttributes = attributes;
806
+ }
807
+ get htmlAttributes() {
808
+ return this._htmlAttributes;
809
+ }
810
+ /**
811
+ * @hidden
812
+ */
813
+ set cssClass(classes) {
814
+ this.setServiceClasses(this._cssClass, classes);
815
+ this._cssClass = classes;
816
+ }
817
+ get cssClass() {
818
+ return this._cssClass;
819
+ }
820
+ get dir() {
821
+ return this.direction;
822
+ }
823
+ ngAfterContentInit() {
824
+ this.bubble('close', this.titlebarContent.first);
825
+ this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-describedby', this.contentId);
826
+ if (this.titlebarContent.first) {
827
+ this.titlebarContent.first.id = this.titleId;
828
+ }
829
+ else {
830
+ this.subscriptions.push(this.titlebarContent.changes.subscribe(() => {
831
+ if (isPresent(this.titlebarContent.first)) {
832
+ this.titlebarContent.first.id = this.titleId;
833
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
834
+ this.bubble('close', this.titlebarContent.first);
835
+ this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
836
+ });
837
+ }
838
+ }));
839
+ }
840
+ }
841
+ ngAfterViewInit() {
842
+ if (!isDocumentAvailable()) {
843
+ return;
844
+ }
845
+ this.handleInitialFocus();
846
+ this.bubble('close', this.titlebarView.first);
847
+ this.bubble('action', this.actionsView);
848
+ if (this.titlebarView.first || this.titlebarContent.first) {
849
+ //Needed for Dialogs created via service
850
+ this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
851
+ }
852
+ else {
853
+ this.subscriptions.push(this.titlebarView.changes.subscribe(() => {
854
+ if (isPresent(this.titlebarView.first)) {
855
+ this.titlebarView.first.id = this.titleId;
856
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
857
+ this.bubble('close', this.titlebarView.first);
858
+ this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
859
+ });
860
+ }
861
+ }));
862
+ }
863
+ this.initDomEvents();
864
+ this.handleThemeColorClass(null, this.themeColor);
865
+ }
866
+ ngOnInit() {
867
+ if (this.animation) {
868
+ animateContent(this.animation, DEFAULT_ANIMATION_CONFIG, this.dialog.nativeElement, this.builder);
869
+ }
870
+ this.renderer.removeAttribute(this.wrapper.nativeElement, 'title');
871
+ this.cdr.detectChanges();
872
+ }
873
+ ngOnDestroy() {
874
+ this.subscriptions.forEach(s => s.unsubscribe());
875
+ this.subscriptions = [];
876
+ if (this.domSubs) {
877
+ this.domSubs.unsubscribe();
878
+ }
879
+ }
880
+ /**
881
+ * Focuses the wrapper of the Dialog component.
882
+ */
883
+ focus() {
884
+ const wrapper = this.wrapper.nativeElement;
885
+ if (isPresent(wrapper)) {
886
+ wrapper.focus();
887
+ }
888
+ }
889
+ initDomEvents() {
890
+ if (!this.wrapper) {
891
+ return;
892
+ }
893
+ this.ngZone.runOutsideAngular(() => {
894
+ this.domSubs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', (ev) => {
895
+ this.onKeyDown(ev);
896
+ }));
897
+ });
898
+ }
899
+ onKeyDown(event) {
900
+ const target = event.target;
901
+ const parent = target.parentElement;
902
+ if (hasClasses(target, DIALOG_ELEMENTS_HANDLING_ESC_KEY) || hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ESC_KEY)) {
903
+ if (event.keyCode === Keys.esc) {
904
+ this.ngZone.run(() => {
905
+ this.close.emit(new DialogCloseResult());
906
+ });
907
+ }
908
+ }
909
+ if (hasClasses(target, 'k-button') && hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ARROWS) &&
910
+ (event.keyCode === Keys.left || event.keyCode === Keys.right)) {
911
+ this.ngZone.run(() => {
912
+ this.handleActionButtonFocus(parent, event.keyCode);
913
+ });
914
+ }
915
+ if (event.keyCode === Keys.tab) {
916
+ this.ngZone.run(() => {
917
+ this.keepFocusWithinComponent(target, event);
918
+ });
919
+ }
920
+ }
921
+ setServiceClasses(prevValue, value) {
922
+ const el = this.wrapper.nativeElement;
923
+ if (prevValue) {
924
+ parseCSSClassNames(prevValue).forEach(className => {
925
+ this.renderer.removeClass(el, className);
926
+ });
927
+ }
928
+ if (value) {
929
+ parseCSSClassNames(value).forEach(className => {
930
+ this.renderer.addClass(el, className);
931
+ });
932
+ }
933
+ }
934
+ /**
935
+ * @hidden
936
+ */
937
+ handleInitialFocus() {
938
+ const wrapper = this.wrapper.nativeElement;
939
+ const primaryButton = this.findPrimary(wrapper);
940
+ if (this.autoFocusedElement) {
941
+ const initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
942
+ if (initiallyFocusedElement) {
943
+ initiallyFocusedElement.focus();
944
+ }
945
+ }
946
+ else if (this.shouldFocusPrimary(primaryButton)) {
947
+ primaryButton.focus();
948
+ }
949
+ else {
950
+ wrapper.focus();
951
+ }
952
+ }
953
+ /**
954
+ * @hidden
955
+ */
956
+ findPrimary(wrapper) {
957
+ const actionBtns = wrapper.querySelectorAll('.k-actions .k-button');
958
+ return findPrimaryButton(actionBtns);
959
+ }
960
+ /**
961
+ * @hidden
962
+ */
963
+ handleActionButtonFocus(parent, key) {
964
+ const focusableActionButtons = this.getAllFocusableChildren(parent);
965
+ for (let i = 0; i < focusableActionButtons.length; i++) {
966
+ const current = focusableActionButtons[i];
967
+ if (current === document.activeElement) {
968
+ if (key === Keys.left && i > 0) {
969
+ focusableActionButtons[i - 1].focus();
970
+ break;
971
+ }
972
+ if (key === Keys.right && i < focusableActionButtons.length - 1) {
973
+ focusableActionButtons[i + 1].focus();
974
+ break;
975
+ }
976
+ }
977
+ }
978
+ }
979
+ /**
980
+ * @hidden
981
+ */
982
+ keepFocusWithinComponent(target, event) {
983
+ const wrapper = this.wrapper.nativeElement;
984
+ const [firstFocusable, lastFocusable] = this.getFirstAndLastFocusable(wrapper);
985
+ const tabAfterLastFocusable = !event.shiftKey && target === lastFocusable;
986
+ const shiftTabAfterFirstFocusable = event.shiftKey && target === firstFocusable;
987
+ if (tabAfterLastFocusable) {
988
+ event.preventDefault();
989
+ firstFocusable.focus();
990
+ }
991
+ if (shiftTabAfterFirstFocusable) {
992
+ event.preventDefault();
993
+ lastFocusable.focus();
994
+ }
995
+ }
996
+ /**
997
+ * @hidden
998
+ */
999
+ shouldFocusPrimary(el) {
1000
+ return isPresent(el) && isFocusable(el);
1001
+ }
1002
+ /**
1003
+ * @hidden
1004
+ */
1005
+ getAllFocusableChildren(parent) {
1006
+ return parent.querySelectorAll(focusableSelector);
1007
+ }
1008
+ /**
1009
+ * @hidden
1010
+ */
1011
+ getFirstAndLastFocusable(parent) {
1012
+ const all = this.getAllFocusableChildren(parent);
1013
+ const firstFocusable = all.length > 0 ? all[0] : parent;
1014
+ const lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
1015
+ return [firstFocusable, lastFocusable];
1016
+ }
1017
+ /**
1018
+ * @hidden
1019
+ */
1020
+ generateTitleId() {
1021
+ return 'kendo-dialog-title-' + Math.ceil(Math.random() * 1000000).toString();
1022
+ }
1023
+ /**
1024
+ * @hidden
1025
+ */
1026
+ generateContentId() {
1027
+ return 'kendo-dialog-content-' + Math.ceil(Math.random() * 1000000).toString();
1028
+ }
1029
+ get wrapperClass() {
1030
+ return true;
1031
+ }
1032
+ get styles() {
1033
+ const styles = {};
1034
+ if (this.width) {
1035
+ styles.width = createValueWithUnit(this.width);
1036
+ }
1037
+ if (this.height) {
1038
+ styles.height = createValueWithUnit(this.height);
1039
+ }
1040
+ if (this.minWidth) {
1041
+ styles.minWidth = createValueWithUnit(this.minWidth);
1042
+ }
1043
+ if (this.maxWidth) {
1044
+ styles.maxWidth = createValueWithUnit(this.maxWidth);
1045
+ }
1046
+ if (this.minHeight) {
1047
+ styles.minHeight = createValueWithUnit(this.minHeight);
1048
+ }
1049
+ if (this.maxHeight) {
1050
+ styles.maxHeight = createValueWithUnit(this.maxHeight);
1051
+ }
1052
+ return styles;
1053
+ }
1054
+ bubble(eventName, component) {
1055
+ if (component) {
1056
+ const emit = e => this[eventName].emit(e);
1057
+ const s = component[eventName].subscribe(emit);
1058
+ this.subscriptions.push(s);
1059
+ }
1060
+ }
1061
+ handleThemeColorClass(previousValue, currentValue) {
1062
+ const dialog = this.dialog.nativeElement;
1063
+ if (previousValue) {
1064
+ const classToRemove = `k-dialog-${previousValue}`;
1065
+ this.renderer.removeClass(dialog, classToRemove);
1066
+ }
1067
+ if (currentValue) {
1068
+ const classToAdd = `k-dialog-${currentValue}`;
1069
+ this.renderer.addClass(dialog, classToAdd);
1070
+ }
1071
+ }
1072
+ }
1073
+ DialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i2$1.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Component });
1074
+ DialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DialogComponent, selector: "kendo-dialog", inputs: { actions: "actions", actionsLayout: "actionsLayout", autoFocusedElement: "autoFocusedElement", title: "title", width: "width", minWidth: "minWidth", maxWidth: "maxWidth", height: "height", minHeight: "minHeight", maxHeight: "maxHeight", animation: "animation", themeColor: "themeColor" }, outputs: { action: "action", close: "close" }, host: { properties: { "attr.dir": "this.dir", "attr.tabIndex": "this.tabIndex", "class.k-dialog-wrapper": "this.wrapperClass" } }, providers: [
1075
+ LocalizationService,
1076
+ {
1077
+ provide: DIALOG_LOCALIZATION_SERVICE,
1078
+ useExisting: LocalizationService
1079
+ },
1080
+ {
1081
+ provide: L10N_PREFIX,
1082
+ useValue: 'kendo.dialog'
1083
+ }
1084
+ ], queries: [{ propertyName: "titlebarContent", predicate: DialogTitleBarComponent }], viewQueries: [{ propertyName: "actionsView", first: true, predicate: DialogActionsComponent, descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true, static: true }, { propertyName: "titlebarView", predicate: DialogTitleBarComponent, descendants: true }], exportAs: ["kendoDialog"], ngImport: i0, template: `
1085
+ <ng-container
1086
+ kendoDialogLocalizedMessages
1087
+ i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"
1088
+ closeTitle="Close"
1089
+ >
1090
+ <div class="k-overlay" @overlayAppear></div>
1091
+
1092
+ <div #dialog class="k-window k-dialog" role="dialog" aria-modal="true" [ngStyle]="styles">
1093
+ <kendo-dialog-titlebar *ngIf="title" [closeTitle]="closeTitle" [id]="titleId">{{ title }}</kendo-dialog-titlebar>
1094
+ <ng-content select="kendo-dialog-titlebar" *ngIf="!title"></ng-content>
1095
+
1096
+ <div [id]="contentId" class="k-window-content k-dialog-content">
1097
+ <ng-content *ngIf="!contentTemplate"></ng-content>
1098
+ <ng-template [ngTemplateOutlet]="contentTemplate" *ngIf="contentTemplate"></ng-template>
1099
+ </div>
1100
+
1101
+ <ng-content select="kendo-dialog-actions" *ngIf="!actions"></ng-content>
1102
+ <kendo-dialog-actions *ngIf="actions" [actions]="actions" [layout]="actionsLayout"> </kendo-dialog-actions>
1103
+ </div>
1104
+ </ng-container>
1105
+ `, isInline: true, components: [{ type: DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n " }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
1106
+ trigger('overlayAppear', [
1107
+ state('in', style({ opacity: 1 })),
1108
+ transition('void => *', [style({ opacity: 0.1 }), animate('.3s cubic-bezier(.2, .6, .4, 1)')])
1109
+ ])
1110
+ ] });
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogComponent, decorators: [{
1112
+ type: Component,
1113
+ args: [{
1114
+ animations: [
1115
+ trigger('overlayAppear', [
1116
+ state('in', style({ opacity: 1 })),
1117
+ transition('void => *', [style({ opacity: 0.1 }), animate('.3s cubic-bezier(.2, .6, .4, 1)')])
1118
+ ])
1119
+ ],
1120
+ exportAs: 'kendoDialog',
1121
+ providers: [
1122
+ LocalizationService,
1123
+ {
1124
+ provide: DIALOG_LOCALIZATION_SERVICE,
1125
+ useExisting: LocalizationService
1126
+ },
1127
+ {
1128
+ provide: L10N_PREFIX,
1129
+ useValue: 'kendo.dialog'
1130
+ }
1131
+ ],
1132
+ selector: 'kendo-dialog',
1133
+ template: `
1134
+ <ng-container
1135
+ kendoDialogLocalizedMessages
1136
+ i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"
1137
+ closeTitle="Close"
1138
+ >
1139
+ <div class="k-overlay" @overlayAppear></div>
1140
+
1141
+ <div #dialog class="k-window k-dialog" role="dialog" aria-modal="true" [ngStyle]="styles">
1142
+ <kendo-dialog-titlebar *ngIf="title" [closeTitle]="closeTitle" [id]="titleId">{{ title }}</kendo-dialog-titlebar>
1143
+ <ng-content select="kendo-dialog-titlebar" *ngIf="!title"></ng-content>
1144
+
1145
+ <div [id]="contentId" class="k-window-content k-dialog-content">
1146
+ <ng-content *ngIf="!contentTemplate"></ng-content>
1147
+ <ng-template [ngTemplateOutlet]="contentTemplate" *ngIf="contentTemplate"></ng-template>
1148
+ </div>
1149
+
1150
+ <ng-content select="kendo-dialog-actions" *ngIf="!actions"></ng-content>
1151
+ <kendo-dialog-actions *ngIf="actions" [actions]="actions" [layout]="actionsLayout"> </kendo-dialog-actions>
1152
+ </div>
1153
+ </ng-container>
1154
+ `
1155
+ }]
1156
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i2$1.AnimationBuilder }]; }, propDecorators: { actions: [{
1157
+ type: Input
1158
+ }], actionsLayout: [{
1159
+ type: Input
1160
+ }], autoFocusedElement: [{
1161
+ type: Input
1162
+ }], title: [{
1163
+ type: Input
1164
+ }], width: [{
1165
+ type: Input
1166
+ }], minWidth: [{
1167
+ type: Input
1168
+ }], maxWidth: [{
1169
+ type: Input
1170
+ }], height: [{
1171
+ type: Input
1172
+ }], minHeight: [{
1173
+ type: Input
1174
+ }], maxHeight: [{
1175
+ type: Input
1176
+ }], animation: [{
1177
+ type: Input
1178
+ }], themeColor: [{
1179
+ type: Input
1180
+ }], action: [{
1181
+ type: Output
1182
+ }], close: [{
1183
+ type: Output
1184
+ }], dir: [{
1185
+ type: HostBinding,
1186
+ args: ['attr.dir']
1187
+ }], tabIndex: [{
1188
+ type: HostBinding,
1189
+ args: ['attr.tabIndex']
1190
+ }], titlebarContent: [{
1191
+ type: ContentChildren,
1192
+ args: [DialogTitleBarComponent, { descendants: false }]
1193
+ }], titlebarView: [{
1194
+ type: ViewChildren,
1195
+ args: [DialogTitleBarComponent]
1196
+ }], actionsView: [{
1197
+ type: ViewChild,
1198
+ args: [DialogActionsComponent, { static: false }]
1199
+ }], dialog: [{
1200
+ type: ViewChild,
1201
+ args: ['dialog', { static: true }]
1202
+ }], wrapperClass: [{
1203
+ type: HostBinding,
1204
+ args: ['class.k-dialog-wrapper']
1205
+ }] } });
1206
+
1207
+ /**
1208
+ * Holds references to the object instance and published events of the Dialog.
1209
+ * Controls the Dialogs that were opened through the `DialogService`
1210
+ * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
1211
+ */
1212
+ class DialogRef {
1213
+ }
1214
+
1215
+ /**
1216
+ * The base class which will be extended by a component that is provided as content through `content`
1217
+ * ([see example]({% slug service_dialog %}#toc-passing-title-content-and-actions-as-a-single-component)).
1218
+ */
1219
+ class DialogContentBase {
1220
+ constructor(dialog) {
1221
+ this.dialog = dialog;
1222
+ }
1223
+ /**
1224
+ * @hidden
1225
+ */
1226
+ ngAfterViewInit() {
1227
+ if (this.dialogTitleBar) {
1228
+ // when opening component inside dialog with service AND the component has defined its own titlebar
1229
+ this.dialogTitleBar.close.pipe(filter((e) => !e.isDefaultPrevented())).subscribe(() => {
1230
+ this.dialog.close();
1231
+ });
1232
+ }
1233
+ if (this.dialogActions) {
1234
+ if (this.dialogActions.actions) {
1235
+ this.dialogActions.action.subscribe(action => this.dialog.dialog.instance.action.emit(action));
1236
+ }
1237
+ }
1238
+ }
1239
+ }
1240
+ DialogContentBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContentBase, deps: [{ token: DialogRef }], target: i0.ɵɵFactoryTarget.Directive });
1241
+ DialogContentBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DialogContentBase, viewQueries: [{ propertyName: "dialogTitleBar", first: true, predicate: DialogTitleBarComponent, descendants: true }, { propertyName: "dialogActions", first: true, predicate: DialogActionsComponent, descendants: true }], ngImport: i0 });
1242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContentBase, decorators: [{
1243
+ type: Directive
1244
+ }], ctorParameters: function () { return [{ type: DialogRef }]; }, propDecorators: { dialogTitleBar: [{
1245
+ type: ViewChild,
1246
+ args: [DialogTitleBarComponent, { static: false }]
1247
+ }], dialogActions: [{
1248
+ type: ViewChild,
1249
+ args: [DialogActionsComponent, { static: false }]
1250
+ }] } });
1251
+
1252
+ /**
1253
+ * @hidden
1254
+ */
1255
+ class DialogContainerService {
1256
+ set container(container) {
1257
+ DialogContainerService.container = container;
1258
+ }
1259
+ get container() {
1260
+ return DialogContainerService.container;
1261
+ }
1262
+ }
1263
+ DialogContainerService.container = null;
1264
+ DialogContainerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1265
+ DialogContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContainerService });
1266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContainerService, decorators: [{
1267
+ type: Injectable
1268
+ }] });
1269
+
1270
+ /**
1271
+ * The settings for the Dialog actions when the Dialog is opened through `DialogService`
1272
+ * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
1273
+ */
1274
+ class DialogAction {
1275
+ }
1276
+
1277
+ /**
1278
+ * The settings that can be used when the Dialog is opened through `DialogService`.
1279
+ * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
1280
+ */
1281
+ class DialogSettings {
1282
+ }
1283
+
1284
+ // eslint-disable max-line-length
1285
+ const isNotComponent$1 = (component) => isString(component) || component instanceof TemplateRef;
1286
+ class DialogInjector {
1287
+ constructor(getDialogRef, parentInjector) {
1288
+ this.getDialogRef = getDialogRef;
1289
+ this.parentInjector = parentInjector;
1290
+ }
1291
+ get(token, notFoundValue) {
1292
+ if (token === DialogRef) {
1293
+ return this.getDialogRef();
1294
+ }
1295
+ return this.parentInjector.get(token, notFoundValue);
1296
+ }
1297
+ }
1298
+ /**
1299
+ * A service for opening Dialog windows dynamically
1300
+ * ([see example]({% slug service_dialog %})).
1301
+ */
1302
+ class DialogService {
1303
+ constructor(
1304
+ /**
1305
+ * @hidden
1306
+ */
1307
+ resolver, containerService) {
1308
+ this.resolver = resolver;
1309
+ this.containerService = containerService;
1310
+ }
1311
+ /**
1312
+ * Opens a Dialog window. Requires an element in the application that uses the
1313
+ * [`kendoDialogContainer`]({% slug api_dialog_dialogcontainerdirective %}) directive.
1314
+ * Created Dialogs will be mounted in the DOM directly after that element.
1315
+ *
1316
+ * @param {DialogAction} options - The options that define the Dialog.
1317
+ * @returns {DialogRef} - A reference to the Dialog object and the convenience properties.
1318
+ *
1319
+ * @example
1320
+ *
1321
+ * ```ts-no-run
1322
+ * _@Component({
1323
+ * selector: 'my-app',
1324
+ * template: `
1325
+ * <button kendoButton (click)="open()">Harmless button</button>
1326
+ * <div kendoDialogContainer></div>
1327
+ * `
1328
+ * })
1329
+ * export class AppComponent {
1330
+ * constructor( private dialogService: DialogService ) {}
1331
+ *
1332
+ * public open() {
1333
+ * var dialog = this.dialogService.open({
1334
+ * title: "Please confirm",
1335
+ * content: "Are you sure?",
1336
+ * actions: [
1337
+ * { text: "No" },
1338
+ * { text: "Yes", themeColor: 'primary' }
1339
+ * ]
1340
+ * });
1341
+ *
1342
+ * dialog.result.subscribe((result) => {
1343
+ * if (result instanceof DialogCloseResult) {
1344
+ * console.log("close");
1345
+ * } else {
1346
+ * console.log("action", result);
1347
+ * }
1348
+ * });
1349
+ * }
1350
+ * }
1351
+ * ```
1352
+ *
1353
+ */
1354
+ open(options) {
1355
+ const factory = this.resolver.resolveComponentFactory(DialogComponent);
1356
+ const container = options.appendTo || this.containerService.container;
1357
+ if (!container) {
1358
+ throw new Error(`
1359
+ Cannot attach dialog to the page.
1360
+ Add an element that uses the kendoDialogContainer directive, or set the 'appendTo' property.
1361
+ See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/.
1362
+ `);
1363
+ }
1364
+ // create DialogRef to (1) pass as result, (2) provide through injector
1365
+ const dialogRef = {
1366
+ close: () => {
1367
+ /* noop */
1368
+ },
1369
+ content: null,
1370
+ dialog: null,
1371
+ result: null
1372
+ };
1373
+ return this.initializeDialog(options.content, factory, container, dialogRef, options);
1374
+ }
1375
+ initializeDialog(component, factory, container, dialogRef, options) {
1376
+ const content = this.contentFrom(component, container, dialogRef);
1377
+ const dialog = container.createComponent(factory, undefined, undefined, content.nodes);
1378
+ dialogRef.dialog = dialog;
1379
+ dialog.changeDetectorRef.markForCheck();
1380
+ // copy @Input options to dialog instance
1381
+ this.applyOptions(dialog.instance, options);
1382
+ // create close handler and result stream
1383
+ const apiClose = new Subject();
1384
+ const close = (e) => {
1385
+ if (e instanceof PreventableEvent) {
1386
+ e = new DialogCloseResult();
1387
+ }
1388
+ apiClose.next(e || new DialogCloseResult());
1389
+ if (content.componentRef) {
1390
+ content.componentRef.destroy();
1391
+ }
1392
+ dialog.destroy();
1393
+ };
1394
+ const result = merge(apiClose,
1395
+ // triggered when the titlebar or actions are defined in DialogSettings
1396
+ merge(dialog.instance.close, dialog.instance.action).pipe(map(e => (e instanceof PreventableEvent ? new DialogCloseResult() : e)), filter(e => {
1397
+ if (options.preventAction) {
1398
+ // add dialogRef only when using component
1399
+ const dialogRefParameter = isNotComponent$1(component) ? undefined : dialogRef;
1400
+ return !options.preventAction(e, dialogRefParameter);
1401
+ }
1402
+ return true;
1403
+ }))).pipe(take(1),
1404
+ // Takes care for multiple subscriptions:
1405
+ // We subscribe internaly and the user may subscribe to get a close result - dialog.result.subscribe().
1406
+ // This causes multiple subscriptions to the same source and thus multiple emissions. share() solves that.
1407
+ share());
1408
+ result.subscribe(close);
1409
+ dialogRef.close = close;
1410
+ dialogRef.result = result;
1411
+ if (component && isDevMode()) {
1412
+ const hasContentTitle = content.nodes[0] && content.nodes[0].length > 0;
1413
+ const hasContentActions = content.nodes[2] && content.nodes[2].length > 0;
1414
+ const multipleTitles = options.title && hasContentTitle;
1415
+ const multipleActions = options.actions && hasContentActions;
1416
+ if (component.prototype instanceof DialogContentBase) {
1417
+ // content component extends DialogContentBase
1418
+ if (multipleTitles || multipleActions) {
1419
+ console.warn(`
1420
+ Multiple Title and/or Actions configurations detected.
1421
+ When using a component as content, provide the title and actions either in the component's markup
1422
+ or via the title and actions properties of the DialogSettings object, but not both.
1423
+ See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/#toc-passing-title-content-and-actions-as-a-single-component'`);
1424
+ }
1425
+ }
1426
+ else {
1427
+ if (hasContentTitle || hasContentActions) {
1428
+ console.warn(`
1429
+ When Title and/or Actions markup is provided in content component's template,
1430
+ the component needs to inherit the DialogContentBase class to ensure that close and result events are properly hooked.
1431
+ See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/#toc-passing-title-content-and-actions-as-a-single-component'`);
1432
+ }
1433
+ }
1434
+ }
1435
+ return dialogRef;
1436
+ }
1437
+ applyOptions(instance, options) {
1438
+ instance.title = options.title;
1439
+ instance.actions = options.actions;
1440
+ instance.actionsLayout = options.actionsLayout || 'stretched';
1441
+ instance.width = options.width;
1442
+ instance.minWidth = options.minWidth;
1443
+ instance.maxWidth = options.maxWidth;
1444
+ instance.height = options.height;
1445
+ instance.minHeight = options.minHeight;
1446
+ instance.maxHeight = options.maxHeight;
1447
+ instance.autoFocusedElement = options.autoFocusedElement;
1448
+ instance.closeTitle = options.closeTitle;
1449
+ instance.cssClass = options.cssClass;
1450
+ instance.htmlAttributes = options.htmlAttributes;
1451
+ instance.animation = options.animation !== undefined ? options.animation : true;
1452
+ if (options.content instanceof TemplateRef) {
1453
+ instance.contentTemplate = options.content;
1454
+ }
1455
+ }
1456
+ contentFrom(content, container, dialogRef) {
1457
+ const renderer = container.injector.get(Renderer2);
1458
+ let nodes = [];
1459
+ let titleNodes = [];
1460
+ let actionNodes = [];
1461
+ let componentRef = null;
1462
+ if (typeof content === 'string') {
1463
+ nodes = [renderer.createText(content)];
1464
+ }
1465
+ else if (content && !(content instanceof TemplateRef)) {
1466
+ // Component
1467
+ const injector = new DialogInjector(() => dialogRef, container.injector);
1468
+ const factory = this.resolver.resolveComponentFactory(content);
1469
+ componentRef = container.createComponent(factory, undefined, injector);
1470
+ titleNodes = Array.from(componentRef.location.nativeElement.querySelectorAll('kendo-dialog-titlebar'));
1471
+ nodes = [componentRef.location.nativeElement];
1472
+ actionNodes = Array.from(componentRef.location.nativeElement.querySelectorAll('kendo-dialog-actions'));
1473
+ dialogRef.content = componentRef;
1474
+ }
1475
+ return {
1476
+ componentRef,
1477
+ nodes: [
1478
+ titleNodes,
1479
+ nodes,
1480
+ actionNodes // <ng-content select="kendo-dialog-actions">
1481
+ ]
1482
+ };
1483
+ }
1484
+ }
1485
+ DialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogService, deps: [{ token: i0.ComponentFactoryResolver }, { token: DialogContainerService }], target: i0.ɵɵFactoryTarget.Injectable });
1486
+ DialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogService });
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogService, decorators: [{
1488
+ type: Injectable
1489
+ }], ctorParameters: function () {
1490
+ return [{ type: i0.ComponentFactoryResolver }, { type: DialogContainerService, decorators: [{
1491
+ type: Inject,
1492
+ args: [DialogContainerService]
1493
+ }] }];
1494
+ } });
1495
+
1496
+ /**
1497
+ * @hidden
1498
+ */
1499
+ let newZIndex = 10002;
1500
+ /**
1501
+ * @hidden
1502
+ */
1503
+ const DEFAULT_OPTIONS = {
1504
+ draggable: true,
1505
+ height: null,
1506
+ left: null,
1507
+ minHeight: 100,
1508
+ minWidth: 120,
1509
+ position: 'absolute',
1510
+ resizable: true,
1511
+ state: 'default',
1512
+ top: null,
1513
+ width: null
1514
+ };
1515
+ /**
1516
+ * @hidden
1517
+ */
1518
+ const createMoveStream = (el, ev) => mouseDown => {
1519
+ return el.kendoDrag
1520
+ .pipe(takeUntil(el.kendoRelease.pipe(tap(() => { ev.emit(); }))), map(({ pageX, pageY }) => ({
1521
+ originalX: mouseDown.pageX,
1522
+ originalY: mouseDown.pageY,
1523
+ pageX,
1524
+ pageY
1525
+ })));
1526
+ };
1527
+ /**
1528
+ * @hidden
1529
+ */
1530
+ class DragResizeService {
1531
+ constructor(ngZone) {
1532
+ this.ngZone = ngZone;
1533
+ this.close = new EventEmitter();
1534
+ this.focus = new EventEmitter();
1535
+ this.change = new EventEmitter();
1536
+ this.stateChange = new EventEmitter();
1537
+ this.dragStart = new EventEmitter();
1538
+ this.dragEnd = new EventEmitter();
1539
+ this.resizeStart = new EventEmitter();
1540
+ this.resizeEnd = new EventEmitter();
1541
+ this.options = Object.assign({}, DEFAULT_OPTIONS);
1542
+ this.lastAction = null;
1543
+ this.subscriptions = new Subscription();
1544
+ this.dragSubscription = new Subscription();
1545
+ }
1546
+ ngOnDestroy() {
1547
+ if (this.subscriptions) {
1548
+ this.subscriptions.unsubscribe();
1549
+ }
1550
+ if (this.dragSubscription) {
1551
+ this.dragSubscription.unsubscribe();
1552
+ }
1553
+ }
1554
+ init(el) {
1555
+ const state = this.options.state;
1556
+ const options = this.options;
1557
+ this.window = el;
1558
+ if (state !== 'default') {
1559
+ this.restoreOptions = Object.assign({}, options);
1560
+ }
1561
+ if (state === 'minimized') {
1562
+ options.height = 0;
1563
+ options.minHeight = 0;
1564
+ }
1565
+ if (state === 'maximized') {
1566
+ options.position = 'fixed';
1567
+ }
1568
+ }
1569
+ onDrag(el) {
1570
+ this.subscriptions.add(this.ngZone.runOutsideAngular(() => {
1571
+ let startPosition;
1572
+ let dragStarted;
1573
+ this.dragSubscription = el.kendoPress
1574
+ .pipe(tap((ev) => {
1575
+ if (!ev.isTouch) {
1576
+ preventDefault(ev);
1577
+ }
1578
+ this.focus.emit();
1579
+ startPosition = this.currentPosition();
1580
+ dragStarted = false;
1581
+ }), switchMap(createMoveStream(el, this.dragEnd)))
1582
+ .subscribe(({ pageX, pageY, originalX, originalY }) => {
1583
+ if (!dragStarted) {
1584
+ this.ensureWidth();
1585
+ this.dragStart.emit();
1586
+ dragStarted = true;
1587
+ }
1588
+ this.handleDrag({
1589
+ originalX, originalY,
1590
+ pageX, pageY, startPosition
1591
+ });
1592
+ });
1593
+ }));
1594
+ }
1595
+ handleDrag({ originalX, originalY, pageX, pageY, startPosition }) {
1596
+ this.options.left = startPosition.x + pageX - originalX;
1597
+ this.options.top = startPosition.y + pageY - originalY;
1598
+ if (this.options.state === 'minimized' && isPresent(this.restoreOptions)) {
1599
+ this.restoreOptions.left = this.options.left;
1600
+ this.restoreOptions.top = this.options.top;
1601
+ }
1602
+ this.change.emit({
1603
+ left: startPosition.x + pageX - originalX,
1604
+ top: startPosition.y + pageY - originalY
1605
+ });
1606
+ }
1607
+ onResize(handle, direction) {
1608
+ this.subscriptions.add(this.ngZone.runOutsideAngular(() => {
1609
+ let startOffsetAndPosition;
1610
+ let resizeStarted = false;
1611
+ handle.kendoPress.pipe(tap((ev) => {
1612
+ preventDefault(ev);
1613
+ this.focus.emit();
1614
+ startOffsetAndPosition = this.currentOffsetAndPosition();
1615
+ resizeStarted = false;
1616
+ }), switchMap(createMoveStream(handle, this.resizeEnd)))
1617
+ .subscribe(({ pageX, pageY, originalX, originalY }) => {
1618
+ if (!resizeStarted) {
1619
+ this.resizeStart.emit(direction);
1620
+ resizeStarted = true;
1621
+ }
1622
+ const deltaX = pageX - originalX;
1623
+ const deltaY = pageY - originalY;
1624
+ this.handleResize(startOffsetAndPosition, direction, deltaX, deltaY);
1625
+ });
1626
+ }));
1627
+ }
1628
+ handleResize(initial, dir, deltaX, deltaY) {
1629
+ const old = this.options;
1630
+ const ev = {};
1631
+ if (dir.indexOf('e') >= 0) {
1632
+ const newWidth = initial.width + deltaX;
1633
+ if (newWidth !== old.width && newWidth >= old.minWidth) {
1634
+ ev.width = newWidth;
1635
+ }
1636
+ }
1637
+ if (dir.indexOf('n') >= 0) {
1638
+ const newHeight = initial.height - deltaY;
1639
+ const newTop = initial.y + deltaY;
1640
+ if (newHeight !== old.height && newHeight >= old.minHeight && newTop !== old.top) {
1641
+ ev.height = newHeight;
1642
+ ev.top = newTop;
1643
+ }
1644
+ }
1645
+ if (dir.indexOf('s') >= 0) {
1646
+ const newHeight = initial.height + deltaY;
1647
+ if (newHeight !== old.height && newHeight >= old.minHeight) {
1648
+ ev.height = newHeight;
1649
+ }
1650
+ }
1651
+ if (dir.indexOf('w') >= 0) {
1652
+ const newLeft = initial.x + deltaX;
1653
+ const newWidth = initial.width - deltaX;
1654
+ if (newWidth !== old.width && newWidth >= old.minWidth && newLeft !== old.left) {
1655
+ ev.width = newWidth;
1656
+ ev.left = newLeft;
1657
+ }
1658
+ }
1659
+ if (isPresent(ev.width) || isPresent(ev.height)) {
1660
+ OFFSET_STYLES.forEach((style) => {
1661
+ if (isPresent(ev[style])) {
1662
+ this.options[style] = ev[style];
1663
+ }
1664
+ });
1665
+ this.change.emit(ev);
1666
+ }
1667
+ }
1668
+ restoreAction() {
1669
+ this.lastAction = 'restore';
1670
+ this.defaultState();
1671
+ }
1672
+ defaultState() {
1673
+ if (isPresent(this.restoreOptions)) {
1674
+ this.options = Object.assign({}, this.restoreOptions);
1675
+ }
1676
+ this.options.state = 'default';
1677
+ this.stateChange.emit('default');
1678
+ }
1679
+ storeOptions() {
1680
+ this.restoreOptions = Object.assign({}, this.options);
1681
+ }
1682
+ maximizeAction() {
1683
+ this.lastAction = 'maximize';
1684
+ this.maximizeState();
1685
+ }
1686
+ maximizeState() {
1687
+ this.storeOptions();
1688
+ const wnd = this.windowViewPort;
1689
+ this.options = Object.assign({}, this.options, {
1690
+ height: wnd.height,
1691
+ left: 0,
1692
+ position: 'fixed',
1693
+ state: 'maximized',
1694
+ top: 0,
1695
+ width: wnd.width
1696
+ });
1697
+ this.stateChange.emit('maximized');
1698
+ }
1699
+ minimizeAction() {
1700
+ this.lastAction = 'minimize';
1701
+ this.minimizeState();
1702
+ }
1703
+ minimizeState() {
1704
+ this.storeOptions();
1705
+ this.options = Object.assign({}, this.options, {
1706
+ height: null,
1707
+ minHeight: 0,
1708
+ state: 'minimized'
1709
+ });
1710
+ this.stateChange.emit('minimized');
1711
+ }
1712
+ /**
1713
+ * Handles manual changes of the 'state' property.
1714
+ * Required to distinguish them from action clicks.
1715
+ */
1716
+ applyManualState() {
1717
+ const state = this.options.state;
1718
+ switch (state) {
1719
+ case 'default':
1720
+ this.clearHeight();
1721
+ this.defaultState();
1722
+ break;
1723
+ case 'maximized':
1724
+ this.clearHeight();
1725
+ this.maximizeState();
1726
+ break;
1727
+ case 'minimized':
1728
+ this.minimizeState();
1729
+ break;
1730
+ default:
1731
+ break;
1732
+ }
1733
+ }
1734
+ closeAction() {
1735
+ this.close.emit();
1736
+ }
1737
+ ensureWidth() {
1738
+ const windowOffset = offset(this.window.nativeElement);
1739
+ if (!isPresent(this.options.width)) {
1740
+ this.options.width = windowOffset.width;
1741
+ this.change.emit({ width: windowOffset.width });
1742
+ }
1743
+ }
1744
+ clearHeight() {
1745
+ if (this.options.height === 0) {
1746
+ delete this.options.height;
1747
+ }
1748
+ if (this.options.minHeight === 0) {
1749
+ delete this.options.minHeight;
1750
+ }
1751
+ }
1752
+ center() {
1753
+ if (this.options.state === 'maximized') {
1754
+ return;
1755
+ }
1756
+ const scroll = scrollPosition(this.window.nativeElement);
1757
+ const wnd = this.windowViewPort;
1758
+ const wrapper = offset(this.window.nativeElement);
1759
+ const ev = {};
1760
+ if (!isPresent(this.options.left)) {
1761
+ this.options.left = scroll.x + Math.max(0, (wnd.width - wrapper.width) / 2);
1762
+ ev.left = this.options.left;
1763
+ }
1764
+ if (!isPresent(this.options.top)) {
1765
+ this.options.top = scroll.y + Math.max(0, (wnd.height - wrapper.height) / 2);
1766
+ ev.top = this.options.top;
1767
+ }
1768
+ this.change.emit(ev);
1769
+ }
1770
+ currentOffsetAndPosition() {
1771
+ const o = this.options;
1772
+ const off = offset(this.window.nativeElement);
1773
+ return Object.assign({}, this.currentPosition(), {
1774
+ height: o.height ? o.height : off.height,
1775
+ width: o.width ? o.width : off.width
1776
+ });
1777
+ }
1778
+ currentPosition() {
1779
+ const o = this.options;
1780
+ if (!o.top || !o.left) {
1781
+ this.setPosition();
1782
+ }
1783
+ return {
1784
+ x: this.options.left,
1785
+ y: this.options.top
1786
+ };
1787
+ }
1788
+ setPosition() {
1789
+ const wrapper = positionWithScroll(this.window.nativeElement, getDocumentElement(this.window.nativeElement));
1790
+ this.options.left = wrapper.left;
1791
+ this.options.top = wrapper.top;
1792
+ }
1793
+ setRestoreOption(style, value) {
1794
+ if (isPresent(this.restoreOptions)) {
1795
+ this.restoreOptions[style] = value;
1796
+ }
1797
+ }
1798
+ get nextPossibleZIndex() {
1799
+ return newZIndex;
1800
+ }
1801
+ get nextZIndex() {
1802
+ return newZIndex++;
1803
+ }
1804
+ get windowViewPort() {
1805
+ return getWindowViewPort(this.window.nativeElement);
1806
+ }
1807
+ }
1808
+ DragResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DragResizeService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1809
+ DragResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DragResizeService });
1810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DragResizeService, decorators: [{
1811
+ type: Injectable
1812
+ }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
1813
+
1814
+ /**
1815
+ * @hidden
1816
+ */
1817
+ class ResizeHandleDirective {
1818
+ constructor(draggable, el, renderer, service) {
1819
+ this.draggable = draggable;
1820
+ this.el = el;
1821
+ this.renderer = renderer;
1822
+ this.service = service;
1823
+ this.subscriptions = new Subscription();
1824
+ }
1825
+ get hostClass() {
1826
+ return true;
1827
+ }
1828
+ ngOnInit() {
1829
+ this.setDisplay();
1830
+ this.renderer.addClass(this.el.nativeElement, 'k-resize-' + this.direction);
1831
+ this.subscriptions.add(of(this.draggable).subscribe(handle => {
1832
+ this.service.onResize(handle, this.direction);
1833
+ }));
1834
+ this.subscriptions.add(this.service.resizeStart.subscribe((dir) => {
1835
+ if (dir !== this.direction) {
1836
+ this.setDisplay('none');
1837
+ }
1838
+ }));
1839
+ this.subscriptions.add(this.service.dragStart.subscribe(() => {
1840
+ this.setDisplay('none');
1841
+ }));
1842
+ this.subscriptions.add(merge(this.service.resizeEnd, this.service.dragEnd).subscribe(() => {
1843
+ this.setDisplay('block');
1844
+ }));
1845
+ this.subscriptions.add(this.service.stateChange.subscribe((state) => {
1846
+ this.setDisplay(state === 'default' ? 'block' : 'none');
1847
+ }));
1848
+ }
1849
+ ngOnDestroy() {
1850
+ this.subscriptions.unsubscribe();
1851
+ }
1852
+ setDisplay(value = 'block') {
1853
+ this.renderer.setStyle(this.el.nativeElement, 'display', this.service.options.state === 'default' ? value : 'none');
1854
+ }
1855
+ }
1856
+ ResizeHandleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeHandleDirective, deps: [{ token: i1$1.DraggableDirective, host: true }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DragResizeService }], target: i0.ɵɵFactoryTarget.Directive });
1857
+ ResizeHandleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ResizeHandleDirective, selector: "[kendoWindowResizeHandle]", inputs: { direction: "direction" }, host: { properties: { "class.k-resize-handle": "this.hostClass" } }, ngImport: i0 });
1858
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeHandleDirective, decorators: [{
1859
+ type: Directive,
1860
+ args: [{
1861
+ selector: '[kendoWindowResizeHandle]'
1862
+ }]
1863
+ }], ctorParameters: function () {
1864
+ return [{ type: i1$1.DraggableDirective, decorators: [{
1865
+ type: Host
1866
+ }] }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: DragResizeService }];
1867
+ }, propDecorators: { direction: [{
1868
+ type: Input
1869
+ }], hostClass: [{
1870
+ type: HostBinding,
1871
+ args: ['class.k-resize-handle']
1872
+ }] } });
1873
+
1874
+ class WindowTitleBarComponent {
1875
+ constructor(el, service, ngZone) {
1876
+ this.el = el;
1877
+ this.ngZone = ngZone;
1878
+ this.service = service;
1879
+ }
1880
+ ngOnInit() {
1881
+ this.dragDirective = new DraggableDirective(this.el, this.ngZone);
1882
+ this.dragDirective.ngOnInit();
1883
+ if (this.isDraggable) {
1884
+ this.subscribeDrag();
1885
+ }
1886
+ this.subscribeStateChange();
1887
+ }
1888
+ ngAfterViewInit() {
1889
+ const element = this.el.nativeElement.querySelector('.k-window-title');
1890
+ if (isPresent(element)) {
1891
+ element.setAttribute('id', this.id);
1892
+ }
1893
+ }
1894
+ ngOnDestroy() {
1895
+ this.dragDirective.ngOnDestroy();
1896
+ this.unsubscribeDrag();
1897
+ this.unsubscribeState();
1898
+ }
1899
+ /**
1900
+ * @hidden
1901
+ */
1902
+ subscribeDrag() {
1903
+ this.unsubscribeDrag();
1904
+ this.dragSubscription = of(this.dragDirective).subscribe(titleBar => {
1905
+ this.service.onDrag(titleBar);
1906
+ });
1907
+ }
1908
+ /**
1909
+ * @hidden
1910
+ */
1911
+ subscribeStateChange() {
1912
+ this.stateSubscription = this.service.stateChange.subscribe((state) => {
1913
+ if (this.service.options.draggable) {
1914
+ if (state === 'maximized') {
1915
+ this.unsubscribeDrag();
1916
+ }
1917
+ else {
1918
+ this.subscribeDrag();
1919
+ }
1920
+ }
1921
+ });
1922
+ }
1923
+ /**
1924
+ * @hidden
1925
+ */
1926
+ unsubscribeDrag() {
1927
+ if (this.dragSubscription) {
1928
+ this.service.dragSubscription.unsubscribe();
1929
+ this.dragSubscription.unsubscribe();
1930
+ this.dragSubscription = null;
1931
+ }
1932
+ }
1933
+ /**
1934
+ * @hidden
1935
+ */
1936
+ unsubscribeState() {
1937
+ if (this.stateSubscription) {
1938
+ this.stateSubscription.unsubscribe();
1939
+ this.stateSubscription = null;
1940
+ }
1941
+ }
1942
+ get className() {
1943
+ return true;
1944
+ }
1945
+ get touchAction() {
1946
+ if (this.isDraggable) {
1947
+ return 'none';
1948
+ }
1949
+ }
1950
+ /**
1951
+ * @hidden
1952
+ */
1953
+ handle(ev) {
1954
+ const target = ev.target;
1955
+ const state = this.service.options.state;
1956
+ if (!hasClasses(target, 'k-icon') && !isFocusable(target, false) && this.service.options.resizable) {
1957
+ if (state === 'default') {
1958
+ this.service.maximizeAction();
1959
+ }
1960
+ else if (state === 'maximized') {
1961
+ this.service.restoreAction();
1962
+ }
1963
+ }
1964
+ }
1965
+ get isDraggable() {
1966
+ const options = this.service.options;
1967
+ return options.draggable && options.state !== 'maximized';
1968
+ }
1969
+ }
1970
+ WindowTitleBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowTitleBarComponent, deps: [{ token: i0.ElementRef }, { token: DragResizeService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1971
+ WindowTitleBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowTitleBarComponent, selector: "kendo-window-titlebar", inputs: { template: "template", id: "id" }, host: { listeners: { "dblclick": "handle($event)" }, properties: { "class.k-window-titlebar": "this.className", "style.touch-action": "this.touchAction" } }, ngImport: i0, template: `
1972
+ <ng-content *ngIf="!template"></ng-content>
1973
+ <ng-template
1974
+ [ngTemplateOutlet]="template"
1975
+ [ngTemplateOutletContext]="{'$implicit': service}" *ngIf="template">
1976
+ </ng-template>
1977
+ `, isInline: true, directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowTitleBarComponent, decorators: [{
1979
+ type: Component,
1980
+ args: [{
1981
+ selector: 'kendo-window-titlebar',
1982
+ template: `
1983
+ <ng-content *ngIf="!template"></ng-content>
1984
+ <ng-template
1985
+ [ngTemplateOutlet]="template"
1986
+ [ngTemplateOutletContext]="{'$implicit': service}" *ngIf="template">
1987
+ </ng-template>
1988
+ `
1989
+ }]
1990
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DragResizeService }, { type: i0.NgZone }]; }, propDecorators: { template: [{
1991
+ type: Input
1992
+ }], id: [{
1993
+ type: Input
1994
+ }], className: [{
1995
+ type: HostBinding,
1996
+ args: ['class.k-window-titlebar']
1997
+ }], touchAction: [{
1998
+ type: HostBinding,
1999
+ args: ['style.touch-action']
2000
+ }], handle: [{
2001
+ type: HostListener,
2002
+ args: ['dblclick', ['$event']]
2003
+ }] } });
2004
+
2005
+ /**
2006
+ * @hidden
2007
+ */
2008
+ class NavigationService {
2009
+ constructor(window, ngZone) {
2010
+ this.window = window;
2011
+ this.ngZone = ngZone;
2012
+ }
2013
+ process(ev) {
2014
+ const key = ev.keyCode;
2015
+ switch (key) {
2016
+ case Keys.up:
2017
+ case Keys.down:
2018
+ case Keys.left:
2019
+ case Keys.right: {
2020
+ ev.preventDefault();
2021
+ this.ngZone.run(() => {
2022
+ this.handleArrow(key, ev);
2023
+ });
2024
+ break;
2025
+ }
2026
+ case Keys.esc:
2027
+ this.ngZone.run(() => {
2028
+ this.handleEscape();
2029
+ });
2030
+ break;
2031
+ default:
2032
+ break;
2033
+ }
2034
+ }
2035
+ handleArrow(key, ev) {
2036
+ const options = this.window.options;
2037
+ if (ev.altKey) {
2038
+ this.handleStateChange(key, options.state);
2039
+ return;
2040
+ }
2041
+ if ((ev.ctrlKey || ev.metaKey) && options.state === 'default') {
2042
+ this.handleResize(key);
2043
+ }
2044
+ else {
2045
+ this.handleDrag(key);
2046
+ }
2047
+ }
2048
+ handleEscape() {
2049
+ this.window.closeAction();
2050
+ }
2051
+ handleDrag(key) {
2052
+ const options = this.window.options;
2053
+ if (!options.draggable) {
2054
+ return;
2055
+ }
2056
+ const offset = this.window.currentOffsetAndPosition();
2057
+ const restoreOptions = this.window.restoreOptions;
2058
+ const ev = {};
2059
+ let delta = 10;
2060
+ if (key === Keys.left || key === Keys.up) {
2061
+ delta *= -1;
2062
+ }
2063
+ switch (key) {
2064
+ case Keys.left:
2065
+ case Keys.right: {
2066
+ ev.left = offset.x + delta;
2067
+ options.left = ev.left;
2068
+ break;
2069
+ }
2070
+ case Keys.up:
2071
+ case Keys.down: {
2072
+ ev.top = offset.y + delta;
2073
+ options.top = ev.top;
2074
+ break;
2075
+ }
2076
+ default:
2077
+ break;
2078
+ }
2079
+ if (options.state === 'minimized' && isPresent(restoreOptions)) {
2080
+ restoreOptions.left = options.left;
2081
+ restoreOptions.top = options.top;
2082
+ }
2083
+ this.window.change.emit(ev);
2084
+ }
2085
+ handleResize(key) {
2086
+ const options = this.window.options;
2087
+ if (!options.resizable) {
2088
+ return;
2089
+ }
2090
+ const offset = this.window.currentOffsetAndPosition();
2091
+ let newWidth;
2092
+ let newHeight;
2093
+ const ev = {};
2094
+ let delta = 10;
2095
+ if (key === Keys.left || key === Keys.up) {
2096
+ delta *= -1;
2097
+ }
2098
+ switch (key) {
2099
+ case Keys.left:
2100
+ case Keys.right: {
2101
+ newWidth = offset.width + delta;
2102
+ if (newWidth !== options.width && newWidth >= options.minWidth) {
2103
+ ev.width = newWidth;
2104
+ }
2105
+ break;
2106
+ }
2107
+ case Keys.up:
2108
+ case Keys.down: {
2109
+ newHeight = offset.height + delta;
2110
+ if (newHeight !== options.height && newHeight >= options.minHeight) {
2111
+ ev.height = newHeight;
2112
+ }
2113
+ break;
2114
+ }
2115
+ default:
2116
+ break;
2117
+ }
2118
+ if (isPresent(ev.width) || isPresent(ev.height)) {
2119
+ OFFSET_STYLES.forEach((style) => {
2120
+ if (isPresent(ev[style])) {
2121
+ this.window.options[style] = ev[style];
2122
+ }
2123
+ });
2124
+ this.window.change.emit(ev);
2125
+ }
2126
+ }
2127
+ handleStateChange(key, state) {
2128
+ if ((state === 'minimized' && key === Keys.up) ||
2129
+ (state === 'maximized' && key === Keys.down)) {
2130
+ this.window.restoreAction();
2131
+ return;
2132
+ }
2133
+ if (state === 'default') {
2134
+ if (key === Keys.up) {
2135
+ this.window.maximizeAction();
2136
+ }
2137
+ else if (key === Keys.down) {
2138
+ this.window.minimizeAction();
2139
+ }
2140
+ }
2141
+ }
2142
+ }
2143
+ NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService, deps: [{ token: DragResizeService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
2144
+ NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService });
2145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService, decorators: [{
2146
+ type: Injectable
2147
+ }], ctorParameters: function () { return [{ type: DragResizeService }, { type: i0.NgZone }]; } });
2148
+
2149
+ class WindowMinimizeActionDirective extends Button {
2150
+ constructor(el, renderer, _service, localization, ngZone) {
2151
+ super(el, renderer, null, localization, ngZone);
2152
+ this.buttonType = 'button';
2153
+ this.buttonClass = true;
2154
+ /**
2155
+ * @hidden
2156
+ */
2157
+ this.windowMinimizeIcon = windowMinimizeIcon;
2158
+ this.window = _service;
2159
+ this.fillMode = 'flat';
2160
+ this.icon = 'window-minimize';
2161
+ }
2162
+ /**
2163
+ * @hidden
2164
+ */
2165
+ onClick() {
2166
+ if (!this.isDisabled) {
2167
+ this.window.minimizeAction();
2168
+ }
2169
+ }
2170
+ get visible() {
2171
+ return this.window.options.state === 'default' ? 'inline-flex' : 'none';
2172
+ }
2173
+ }
2174
+ WindowMinimizeActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMinimizeActionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DragResizeService, optional: true }, { token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2175
+ WindowMinimizeActionDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowMinimizeActionDirective, selector: "button[kendoWindowMinimizeAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass", "style.display": "this.visible" } }, providers: [
2176
+ LocalizationService,
2177
+ {
2178
+ provide: L10N_PREFIX,
2179
+ useValue: 'kendo.button'
2180
+ }
2181
+ ], exportAs: ["kendoWindowMinimizeAction"], usesInheritance: true, ngImport: i0, template: `
2182
+ <kendo-icon-wrapper
2183
+ *ngIf="!imageUrl && !iconClass"
2184
+ innerCssClass="k-button-icon"
2185
+ name="window-minimize"
2186
+ [svgIcon]="windowMinimizeIcon">
2187
+ </kendo-icon-wrapper>
2188
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2189
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2190
+ </span>
2191
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2192
+ <span class="k-button-text"><ng-content></ng-content></span>
2193
+ `, isInline: true, components: [{ type: i3.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMinimizeActionDirective, decorators: [{
2195
+ type: Component,
2196
+ args: [{
2197
+ exportAs: 'kendoWindowMinimizeAction',
2198
+ providers: [
2199
+ LocalizationService,
2200
+ {
2201
+ provide: L10N_PREFIX,
2202
+ useValue: 'kendo.button'
2203
+ }
2204
+ ],
2205
+ selector: 'button[kendoWindowMinimizeAction]',
2206
+ template: `
2207
+ <kendo-icon-wrapper
2208
+ *ngIf="!imageUrl && !iconClass"
2209
+ innerCssClass="k-button-icon"
2210
+ name="window-minimize"
2211
+ [svgIcon]="windowMinimizeIcon">
2212
+ </kendo-icon-wrapper>
2213
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2214
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2215
+ </span>
2216
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2217
+ <span class="k-button-text"><ng-content></ng-content></span>
2218
+ `
2219
+ }]
2220
+ }], ctorParameters: function () {
2221
+ return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: DragResizeService, decorators: [{
2222
+ type: Optional
2223
+ }] }, { type: i1.LocalizationService }, { type: i0.NgZone }];
2224
+ }, propDecorators: { window: [{
2225
+ type: Input
2226
+ }], buttonType: [{
2227
+ type: HostBinding,
2228
+ args: ['attr.type']
2229
+ }], buttonClass: [{
2230
+ type: HostBinding,
2231
+ args: ['class.k-window-titlebar-action']
2232
+ }], onClick: [{
2233
+ type: HostListener,
2234
+ args: ['click']
2235
+ }], visible: [{
2236
+ type: HostBinding,
2237
+ args: ['style.display']
2238
+ }] } });
2239
+
2240
+ class WindowMaximizeActionDirective extends Button {
2241
+ constructor(el, renderer, _service, localization, ngZone) {
2242
+ super(el, renderer, null, localization, ngZone);
2243
+ this.buttonType = 'button';
2244
+ this.buttonClass = true;
2245
+ /**
2246
+ * @hidden
2247
+ */
2248
+ this.windowIcon = windowIcon;
2249
+ this.window = _service;
2250
+ this.fillMode = 'flat';
2251
+ this.icon = 'window';
2252
+ }
2253
+ /**
2254
+ * @hidden
2255
+ */
2256
+ onClick() {
2257
+ if (!this.isDisabled) {
2258
+ this.window.maximizeAction();
2259
+ }
2260
+ }
2261
+ get visible() {
2262
+ return this.window.options.state === 'default' ? 'inline-flex' : 'none';
2263
+ }
2264
+ }
2265
+ WindowMaximizeActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMaximizeActionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DragResizeService, optional: true }, { token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2266
+ WindowMaximizeActionDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowMaximizeActionDirective, selector: "button[kendoWindowMaximizeAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass", "style.display": "this.visible" } }, providers: [
2267
+ LocalizationService,
2268
+ {
2269
+ provide: L10N_PREFIX,
2270
+ useValue: 'kendo.button'
2271
+ }
2272
+ ], exportAs: ["kendoWindowMaximizeAction"], usesInheritance: true, ngImport: i0, template: `
2273
+ <kendo-icon-wrapper
2274
+ *ngIf="!imageUrl && !iconClass"
2275
+ innerCssClass="k-button-icon"
2276
+ name="window"
2277
+ [svgIcon]="windowIcon">
2278
+ </kendo-icon-wrapper>
2279
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2280
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2281
+ </span>
2282
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2283
+ <span class="k-button-text"><ng-content></ng-content></span>
2284
+ `, isInline: true, components: [{ type: i3.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMaximizeActionDirective, decorators: [{
2286
+ type: Component,
2287
+ args: [{
2288
+ exportAs: 'kendoWindowMaximizeAction',
2289
+ providers: [
2290
+ LocalizationService,
2291
+ {
2292
+ provide: L10N_PREFIX,
2293
+ useValue: 'kendo.button'
2294
+ }
2295
+ ],
2296
+ selector: 'button[kendoWindowMaximizeAction]',
2297
+ template: `
2298
+ <kendo-icon-wrapper
2299
+ *ngIf="!imageUrl && !iconClass"
2300
+ innerCssClass="k-button-icon"
2301
+ name="window"
2302
+ [svgIcon]="windowIcon">
2303
+ </kendo-icon-wrapper>
2304
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2305
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2306
+ </span>
2307
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2308
+ <span class="k-button-text"><ng-content></ng-content></span>
2309
+ `
2310
+ }]
2311
+ }], ctorParameters: function () {
2312
+ return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: DragResizeService, decorators: [{
2313
+ type: Optional
2314
+ }] }, { type: i1.LocalizationService }, { type: i0.NgZone }];
2315
+ }, propDecorators: { window: [{
2316
+ type: Input
2317
+ }], buttonType: [{
2318
+ type: HostBinding,
2319
+ args: ['attr.type']
2320
+ }], buttonClass: [{
2321
+ type: HostBinding,
2322
+ args: ['class.k-window-titlebar-action']
2323
+ }], onClick: [{
2324
+ type: HostListener,
2325
+ args: ['click']
2326
+ }], visible: [{
2327
+ type: HostBinding,
2328
+ args: ['style.display']
2329
+ }] } });
2330
+
2331
+ class WindowRestoreActionDirective extends Button {
2332
+ constructor(el, renderer, _service, localization, ngZone) {
2333
+ super(el, renderer, null, localization, ngZone);
2334
+ /**
2335
+ * @hidden
2336
+ */
2337
+ this.windowRestoreIcon = windowRestoreIcon;
2338
+ this.buttonType = 'button';
2339
+ this.buttonClass = true;
2340
+ this.window = _service;
2341
+ this.fillMode = 'flat';
2342
+ this.icon = 'window-restore';
2343
+ }
2344
+ /**
2345
+ * @hidden
2346
+ */
2347
+ onClick() {
2348
+ if (!this.isDisabled) {
2349
+ this.window.restoreAction();
2350
+ }
2351
+ }
2352
+ get visible() {
2353
+ return this.window.options.state === 'default' ? 'none' : 'inline-flex';
2354
+ }
2355
+ }
2356
+ WindowRestoreActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowRestoreActionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DragResizeService, optional: true }, { token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2357
+ WindowRestoreActionDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowRestoreActionDirective, selector: "button[kendoWindowRestoreAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass", "style.display": "this.visible" } }, providers: [
2358
+ LocalizationService,
2359
+ {
2360
+ provide: L10N_PREFIX,
2361
+ useValue: 'kendo.button'
2362
+ }
2363
+ ], exportAs: ["kendoWindowRestoreAction"], usesInheritance: true, ngImport: i0, template: `
2364
+ <kendo-icon-wrapper
2365
+ *ngIf="!imageUrl && !iconClass"
2366
+ innerCssClass="k-button-icon"
2367
+ name="window-restore"
2368
+ [svgIcon]="windowRestoreIcon">
2369
+ </kendo-icon-wrapper>
2370
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2371
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2372
+ </span>
2373
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2374
+ <span class="k-button-text"><ng-content></ng-content></span>
2375
+ `, isInline: true, components: [{ type: i3.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowRestoreActionDirective, decorators: [{
2377
+ type: Component,
2378
+ args: [{
2379
+ exportAs: 'kendoWindowRestoreAction',
2380
+ providers: [
2381
+ LocalizationService,
2382
+ {
2383
+ provide: L10N_PREFIX,
2384
+ useValue: 'kendo.button'
2385
+ }
2386
+ ],
2387
+ selector: 'button[kendoWindowRestoreAction]',
2388
+ template: `
2389
+ <kendo-icon-wrapper
2390
+ *ngIf="!imageUrl && !iconClass"
2391
+ innerCssClass="k-button-icon"
2392
+ name="window-restore"
2393
+ [svgIcon]="windowRestoreIcon">
2394
+ </kendo-icon-wrapper>
2395
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2396
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2397
+ </span>
2398
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2399
+ <span class="k-button-text"><ng-content></ng-content></span>
2400
+ `
2401
+ }]
2402
+ }], ctorParameters: function () {
2403
+ return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: DragResizeService, decorators: [{
2404
+ type: Optional
2405
+ }] }, { type: i1.LocalizationService }, { type: i0.NgZone }];
2406
+ }, propDecorators: { window: [{
2407
+ type: Input
2408
+ }], buttonType: [{
2409
+ type: HostBinding,
2410
+ args: ['attr.type']
2411
+ }], buttonClass: [{
2412
+ type: HostBinding,
2413
+ args: ['class.k-window-titlebar-action']
2414
+ }], onClick: [{
2415
+ type: HostListener,
2416
+ args: ['click']
2417
+ }], visible: [{
2418
+ type: HostBinding,
2419
+ args: ['style.display']
2420
+ }] } });
2421
+
2422
+ class WindowCloseActionDirective extends Button {
2423
+ constructor(el, renderer, _service, localization, ngZone) {
2424
+ super(el, renderer, null, localization, ngZone);
2425
+ /**
2426
+ * @hidden
2427
+ */
2428
+ this.xIcon = xIcon;
2429
+ this.buttonType = 'button';
2430
+ this.buttonClass = true;
2431
+ this.window = _service;
2432
+ this.fillMode = 'flat';
2433
+ this.icon = 'x';
2434
+ }
2435
+ /**
2436
+ * @hidden
2437
+ */
2438
+ onClick() {
2439
+ if (!this.isDisabled) {
2440
+ this.window.closeAction();
2441
+ }
2442
+ }
2443
+ }
2444
+ WindowCloseActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowCloseActionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DragResizeService, optional: true }, { token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2445
+ WindowCloseActionDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowCloseActionDirective, selector: "button[kendoWindowCloseAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass" } }, providers: [
2446
+ LocalizationService,
2447
+ {
2448
+ provide: L10N_PREFIX,
2449
+ useValue: 'kendo.button'
2450
+ }
2451
+ ], exportAs: ["kendoWindowCloseAction"], usesInheritance: true, ngImport: i0, template: `
2452
+ <kendo-icon-wrapper
2453
+ *ngIf="!imageUrl && !iconClass"
2454
+ innerCssClass="k-button-icon"
2455
+ name="close"
2456
+ [svgIcon]="xIcon">
2457
+ </kendo-icon-wrapper>
2458
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2459
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2460
+ </span>
2461
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2462
+ <span class="k-button-text"><ng-content></ng-content></span>
2463
+ `, isInline: true, components: [{ type: i3.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowCloseActionDirective, decorators: [{
2465
+ type: Component,
2466
+ args: [{
2467
+ exportAs: 'kendoWindowCloseAction',
2468
+ providers: [
2469
+ LocalizationService,
2470
+ {
2471
+ provide: L10N_PREFIX,
2472
+ useValue: 'kendo.button'
2473
+ }
2474
+ ],
2475
+ selector: 'button[kendoWindowCloseAction]',
2476
+ template: `
2477
+ <kendo-icon-wrapper
2478
+ *ngIf="!imageUrl && !iconClass"
2479
+ innerCssClass="k-button-icon"
2480
+ name="close"
2481
+ [svgIcon]="xIcon">
2482
+ </kendo-icon-wrapper>
2483
+ <span *ngIf="imageUrl" class="k-button-icon k-icon">
2484
+ <img [src]="imageUrl" class="k-image" role="presentation" />
2485
+ </span>
2486
+ <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
2487
+ <span class="k-button-text"><ng-content></ng-content></span>
2488
+ `
2489
+ }]
2490
+ }], ctorParameters: function () {
2491
+ return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: DragResizeService, decorators: [{
2492
+ type: Optional
2493
+ }] }, { type: i1.LocalizationService }, { type: i0.NgZone }];
2494
+ }, propDecorators: { window: [{
2495
+ type: Input
2496
+ }], buttonType: [{
2497
+ type: HostBinding,
2498
+ args: ['attr.type']
2499
+ }], buttonClass: [{
2500
+ type: HostBinding,
2501
+ args: ['class.k-window-titlebar-action']
2502
+ }], onClick: [{
2503
+ type: HostListener,
2504
+ args: ['click']
2505
+ }] } });
2506
+
2507
+ /**
2508
+ * Represents the [Kendo UI Window component for Angular]({% slug overview_window_dialogs %}).
2509
+ */
2510
+ class WindowComponent {
2511
+ constructor(el, renderer, service, navigation, ngZone, localization) {
2512
+ this.el = el;
2513
+ this.renderer = renderer;
2514
+ this.service = service;
2515
+ this.navigation = navigation;
2516
+ this.ngZone = ngZone;
2517
+ this.localization = localization;
2518
+ /**
2519
+ * Specifies if the content of the component is persisted in the DOM when minimized.
2520
+ * @default false
2521
+ */
2522
+ this.keepContent = false;
2523
+ /**
2524
+ * Fires when the user starts to move the Window.
2525
+ */
2526
+ this.dragStart = new EventEmitter();
2527
+ /**
2528
+ * Fires when the Window was moved by the user.
2529
+ */
2530
+ this.dragEnd = new EventEmitter();
2531
+ /**
2532
+ * Fires when the user starts to resize the Window.
2533
+ */
2534
+ this.resizeStart = new EventEmitter();
2535
+ /**
2536
+ * Fires when the Window was resized by the user.
2537
+ */
2538
+ this.resizeEnd = new EventEmitter();
2539
+ /**
2540
+ * Fires when the user closes the Window.
2541
+ */
2542
+ this.close = new EventEmitter();
2543
+ /**
2544
+ * Fires when the `width` property of the component was updated. The event is triggered only after the resizing
2545
+ * has ended. The event data contains the new width. Allows a two-way binding of the `width` property.
2546
+ */
2547
+ this.widthChange = new EventEmitter();
2548
+ /**
2549
+ * Fires when the `height` property of the component was updated. The event is triggered only after the resizing
2550
+ * has ended. The event data contains the new height. Allows a two-way binding of the `height` property.
2551
+ */
2552
+ this.heightChange = new EventEmitter();
2553
+ /**
2554
+ * Fires when the `top` property of the component was updated. The event is triggered only after the dragging
2555
+ * and resizing have ended. The event data contains the new top offset. Allows a two-way binding of the `top` property.
2556
+ */
2557
+ this.topChange = new EventEmitter();
2558
+ /**
2559
+ * Fires when the `left` property of the component was updated. The event is triggered only after the dragging
2560
+ * and resizing have ended. The event data contains the new left offset. Allows a two-way binding of the `left` property.
2561
+ */
2562
+ this.leftChange = new EventEmitter();
2563
+ /**
2564
+ * Fires when the `state` property of the component was updated. The event data contains the new state. Allows a
2565
+ * two-way binding of the `state` property.
2566
+ */
2567
+ this.stateChange = new EventEmitter();
2568
+ /**
2569
+ * @hidden
2570
+ */
2571
+ this.messages = {};
2572
+ this.tabIndex = 0;
2573
+ this.role = 'dialog';
2574
+ this.hostClass = true;
2575
+ /**
2576
+ * @hidden
2577
+ */
2578
+ this.titleId = null;
2579
+ this._themeColor = null;
2580
+ this.draged = false;
2581
+ this.resized = false;
2582
+ this.windowSubscription = new Subscription();
2583
+ this.domSubs = new Subscription();
2584
+ validatePackage(packageMetadata);
2585
+ this.direction = this.localization.rtl ? 'rtl' : 'ltr';
2586
+ this.localizationChangeSubscription = this.localization.changes
2587
+ .subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
2588
+ this.resizeDirections = RESIZE_DIRECTIONS;
2589
+ this.subscribeEvents();
2590
+ this.titleId = this.generateTitleId();
2591
+ }
2592
+ /**
2593
+ * Specifies whether the user will be able to drag the component.
2594
+ * @default true
2595
+ */
2596
+ set draggable(value) {
2597
+ this.options.draggable = value;
2598
+ }
2599
+ get draggable() {
2600
+ return this.options.draggable;
2601
+ }
2602
+ /**
2603
+ * Specifies whether the user will be able to resize the component.
2604
+ * @default true
2605
+ */
2606
+ set resizable(value) {
2607
+ this.options.resizable = value;
2608
+ }
2609
+ get resizable() {
2610
+ return this.options.resizable;
2611
+ }
2612
+ /**
2613
+ * The Window allows you to specify predefined theme colors.
2614
+ * The theme color will be applied as a background and border color to the titlebar while also amending the text color accordingly.
2615
+ *
2616
+ * The possible values are:
2617
+ * * `primary`
2618
+ * * `dark`
2619
+ * * `light`
2620
+ */
2621
+ set themeColor(themeColor) {
2622
+ this.handleThemeColorClass(this.themeColor, themeColor);
2623
+ this._themeColor = themeColor;
2624
+ }
2625
+ get themeColor() {
2626
+ return this._themeColor;
2627
+ }
2628
+ /**
2629
+ * @hidden
2630
+ */
2631
+ set cssClass(classes) {
2632
+ this.setServiceClasses(this._cssClass, classes);
2633
+ this._cssClass = classes;
2634
+ }
2635
+ get cssClass() {
2636
+ return this._cssClass;
2637
+ }
2638
+ /**
2639
+ * @hidden
2640
+ */
2641
+ set htmlAttributes(attributes) {
2642
+ setHTMLAttributes(attributes, this.renderer, this.el.nativeElement);
2643
+ const el = this.el.nativeElement;
2644
+ const dir = el.getAttribute('dir');
2645
+ const tIndex = el.getAttribute('tabindex');
2646
+ if (this.direction !== dir) {
2647
+ this.direction = dir;
2648
+ }
2649
+ if (this.tabIndex !== tIndex) {
2650
+ this.tabIndex = tIndex;
2651
+ }
2652
+ this._htmlAttributes = attributes;
2653
+ }
2654
+ get htmlAttributes() {
2655
+ return this._htmlAttributes;
2656
+ }
2657
+ /**
2658
+ * Specifies the initial state of the component.
2659
+ * If not specified, the value is set to `default`.
2660
+ *
2661
+ * The possible values are:
2662
+ * * `minimized`
2663
+ * * `maximized`
2664
+ * * `default`
2665
+ */
2666
+ set state(value) {
2667
+ this.options.state = value;
2668
+ }
2669
+ get state() {
2670
+ return this.options.state;
2671
+ }
2672
+ /**
2673
+ * Specifies the minimum width of the component.
2674
+ * The `minWidth` property has to be set in pixels.
2675
+ * @default 120
2676
+ */
2677
+ set minWidth(value) {
2678
+ this.setOption('minWidth', value);
2679
+ }
2680
+ get minWidth() {
2681
+ return this.options.minWidth;
2682
+ }
2683
+ /**
2684
+ * Specifies the minimum height of the Window.
2685
+ * The `minHeight` property has to be set in pixels.
2686
+ * @default 100
2687
+ */
2688
+ set minHeight(value) {
2689
+ this.setOption('minHeight', value);
2690
+ }
2691
+ get minHeight() {
2692
+ return this.options.minHeight;
2693
+ }
2694
+ /**
2695
+ * Specifies the width of the Window.
2696
+ * The `width` property has to be set in pixels.
2697
+ */
2698
+ set width(value) {
2699
+ this.setOption('width', value);
2700
+ }
2701
+ get width() {
2702
+ return this.options.width;
2703
+ }
2704
+ /**
2705
+ * Specifies the height of the Window.
2706
+ * The `height` property has to be set in pixels.
2707
+ */
2708
+ set height(value) {
2709
+ this.setOption('height', value);
2710
+ }
2711
+ get height() {
2712
+ return this.options.height;
2713
+ }
2714
+ /**
2715
+ * Specifies the initial top offset of the Window.
2716
+ * The `top` property has to be set in pixels.
2717
+ */
2718
+ set top(value) {
2719
+ this.setOption('top', value);
2720
+ }
2721
+ get top() {
2722
+ return this.options.top;
2723
+ }
2724
+ /**
2725
+ * Specifies the initial left offset of the Window.
2726
+ * Numeric values are treated as pixels.
2727
+ */
2728
+ set left(value) {
2729
+ this.setOption('left', value);
2730
+ }
2731
+ get left() {
2732
+ return this.options.left;
2733
+ }
2734
+ get closeButtonTitle() {
2735
+ if (this.messages && this.messages.closeTitle) {
2736
+ return this.messages.closeTitle;
2737
+ }
2738
+ return this.localization.get('closeTitle');
2739
+ }
2740
+ get restoreButtonTitle() {
2741
+ if (this.messages && this.messages.restoreTitle) {
2742
+ return this.messages.restoreTitle;
2743
+ }
2744
+ return this.localization.get('restoreTitle');
2745
+ }
2746
+ get maximizeButtonTitle() {
2747
+ if (this.messages && this.messages.maximizeTitle) {
2748
+ return this.messages.maximizeTitle;
2749
+ }
2750
+ return this.localization.get('maximizeTitle');
2751
+ }
2752
+ get minimizeButtonTitle() {
2753
+ if (this.messages && this.messages.minimizeTitle) {
2754
+ return this.messages.minimizeTitle;
2755
+ }
2756
+ return this.localization.get('minimizeTitle');
2757
+ }
2758
+ get dir() {
2759
+ return this.direction;
2760
+ }
2761
+ ngAfterViewInit() {
2762
+ if (!isDocumentAvailable()) {
2763
+ return;
2764
+ }
2765
+ this.setNextZIndex();
2766
+ this.handleInitialFocus();
2767
+ this.ngZone.runOutsideAngular(() => Promise.resolve(null).then(() => this.setInitialOffset()));
2768
+ this.initDomEvents();
2769
+ if (this.titleBarView || this.titleBarContent) {
2770
+ this.renderer.setAttribute(this.el.nativeElement, 'aria-labelledby', this.titleId);
2771
+ }
2772
+ this.handleThemeColorClass(null, this.themeColor);
2773
+ }
2774
+ ngOnInit() {
2775
+ this.renderer.removeAttribute(this.el.nativeElement, 'title');
2776
+ this.service.init(this.el);
2777
+ }
2778
+ ngOnChanges(changes) {
2779
+ OFFSET_STYLES.forEach((style) => {
2780
+ if (isChanged(style, changes)) {
2781
+ this.setStyle(style, this.options[style]);
2782
+ }
2783
+ });
2784
+ if (isChanged('draggable', changes)) {
2785
+ const titleBar = isPresent(this.titleBarContent) ? this.titleBarContent : this.titleBarView;
2786
+ if (isTruthy(changes['draggable'].currentValue)) {
2787
+ titleBar.subscribeDrag();
2788
+ }
2789
+ else {
2790
+ titleBar.unsubscribeDrag();
2791
+ }
2792
+ }
2793
+ if (isChanged('state', changes)) {
2794
+ if (isPresent(this.service.lastAction)) {
2795
+ this.service.lastAction = null;
2796
+ }
2797
+ else {
2798
+ this.service.applyManualState();
2799
+ this.updateAllOffset();
2800
+ }
2801
+ }
2802
+ }
2803
+ ngOnDestroy() {
2804
+ if (this.windowSubscription) {
2805
+ this.windowSubscription.unsubscribe();
2806
+ }
2807
+ if (this.domSubs) {
2808
+ this.domSubs.unsubscribe();
2809
+ }
2810
+ this.localizationChangeSubscription.unsubscribe();
2811
+ }
2812
+ /**
2813
+ * Focuses the wrapper of the Window component.
2814
+ */
2815
+ focus() {
2816
+ const wrapper = this.el.nativeElement;
2817
+ if (isPresent(wrapper)) {
2818
+ wrapper.focus();
2819
+ }
2820
+ }
2821
+ /**
2822
+ * Brings the current Window component on top of other Window components on the page.
2823
+ */
2824
+ bringToFront() {
2825
+ this.setNextZIndex();
2826
+ }
2827
+ /**
2828
+ * Manually updates the `width` or `height` option of the Window.
2829
+ * The required style will be applied to the Window wrapper element and the
2830
+ * corresponding property of the component instance will be updated.
2831
+ * This method is intended to be used for sizing dynamically created components using the
2832
+ * [`WindowService`]({% slug api_dialog_windowservice %})
2833
+ * @param {WindowDimensionSetting} dimension - The option that will be updated
2834
+ * @param {number} value - The value set in pixels
2835
+ */
2836
+ setDimension(dimension, value) {
2837
+ this.setOption(dimension, value);
2838
+ this.setStyle(dimension, value);
2839
+ }
2840
+ /**
2841
+ * Manually updates the `top` or `left` offset of the Window.
2842
+ * The required style will be applied to the Window wrapper element and the
2843
+ * corresponding property of the component instance will be updated.
2844
+ * This method is intended to be used for positioning dynamically created components using the
2845
+ * [`WindowService`]({% slug api_dialog_windowservice %})
2846
+ * @param {WindowOffsetSetting} offset - The option that will be updated
2847
+ * @param {number} value - The value set in pixels
2848
+ */
2849
+ setOffset(offset, value) {
2850
+ this.setOption(offset, value);
2851
+ this.setStyle(offset, value);
2852
+ }
2853
+ get showDefaultTitleBar() {
2854
+ return !isPresent(this.titleBarContent);
2855
+ }
2856
+ get styleMinWidth() {
2857
+ return this.minWidth + 'px';
2858
+ }
2859
+ get styleMinHeight() {
2860
+ return this.minHeight + 'px';
2861
+ }
2862
+ get stylePosition() {
2863
+ return this.options.position;
2864
+ }
2865
+ get wrapperMaximizedClass() {
2866
+ return this.state === 'maximized';
2867
+ }
2868
+ get wrapperMinimizedClass() {
2869
+ return this.state === 'minimized';
2870
+ }
2871
+ /**
2872
+ * @hidden
2873
+ */
2874
+ onComponentFocus() {
2875
+ this.renderer.addClass(this.el.nativeElement, 'k-focus');
2876
+ this.setNextZIndex();
2877
+ }
2878
+ /**
2879
+ * @hidden
2880
+ */
2881
+ onComponentBlur() {
2882
+ this.renderer.removeClass(this.el.nativeElement, 'k-focus');
2883
+ }
2884
+ subscribeEvents() {
2885
+ if (!isDocumentAvailable()) {
2886
+ return;
2887
+ }
2888
+ this.windowSubscription.add(this.service.focus.subscribe(() => {
2889
+ this.el.nativeElement.focus();
2890
+ }));
2891
+ this.windowSubscription.add(this.service.dragStart.subscribe(() => {
2892
+ this.draged = true;
2893
+ this.ngZone.run(() => {
2894
+ this.dragStart.emit();
2895
+ });
2896
+ }));
2897
+ this.windowSubscription.add(this.service.dragEnd.subscribe(() => {
2898
+ if (this.draged) {
2899
+ this.draged = false;
2900
+ this.ngZone.run(() => {
2901
+ this.dragEnd.emit();
2902
+ });
2903
+ }
2904
+ }));
2905
+ this.windowSubscription.add(this.service.close.subscribe(() => {
2906
+ this.close.emit();
2907
+ }));
2908
+ this.windowSubscription.add(this.service.resizeStart.subscribe(() => {
2909
+ this.resized = true;
2910
+ this.ngZone.run(() => {
2911
+ this.resizeStart.emit();
2912
+ });
2913
+ }));
2914
+ this.windowSubscription.add(this.service.resizeEnd.subscribe(() => {
2915
+ if (this.resized) {
2916
+ this.resized = false;
2917
+ this.ngZone.run(() => {
2918
+ this.resizeEnd.emit();
2919
+ });
2920
+ }
2921
+ }));
2922
+ this.windowSubscription.add(this.service.change.subscribe((ev) => {
2923
+ OFFSET_STYLES.forEach((style) => {
2924
+ if (isPresent(ev[style])) {
2925
+ this.setStyle(style, ev[style]);
2926
+ if (this.state !== 'maximized') {
2927
+ const emitter = this[style + 'Change'];
2928
+ if (emitter.observers.length) {
2929
+ this.ngZone.run(() => {
2930
+ emitter.emit(ev[style]);
2931
+ });
2932
+ }
2933
+ }
2934
+ }
2935
+ });
2936
+ }));
2937
+ this.windowSubscription.add(this.service.stateChange.subscribe((state) => {
2938
+ if (isPresent(this.service.lastAction)) {
2939
+ this.updateAllOffset();
2940
+ this.stateChange.emit(state);
2941
+ }
2942
+ }));
2943
+ }
2944
+ initDomEvents() {
2945
+ if (!this.el) {
2946
+ return;
2947
+ }
2948
+ this.ngZone.runOutsideAngular(() => {
2949
+ this.domSubs.add(this.renderer.listen(this.el.nativeElement, 'keydown', (ev) => {
2950
+ this.onKeyDown(ev);
2951
+ }));
2952
+ });
2953
+ }
2954
+ onKeyDown(event) {
2955
+ if (hasClasses(event.target, WINDOW_CLASSES)) {
2956
+ this.navigation.process(event);
2957
+ }
2958
+ }
2959
+ setServiceClasses(prevValue, value) {
2960
+ const el = this.el.nativeElement;
2961
+ if (prevValue) {
2962
+ parseCSSClassNames(prevValue).forEach(className => {
2963
+ this.renderer.removeClass(el, className);
2964
+ });
2965
+ }
2966
+ if (value) {
2967
+ parseCSSClassNames(value).forEach(className => {
2968
+ this.renderer.addClass(el, className);
2969
+ });
2970
+ }
2971
+ }
2972
+ setNextZIndex() {
2973
+ const currentZIndex = this.el.nativeElement.style['z-index'];
2974
+ const nextPossibleZIndex = this.service.nextPossibleZIndex;
2975
+ if (!currentZIndex || (nextPossibleZIndex - currentZIndex > 1)) {
2976
+ this.renderer.setStyle(this.el.nativeElement, "z-index", this.service.nextZIndex);
2977
+ }
2978
+ }
2979
+ setInitialOffset() {
2980
+ if (this.state !== 'maximized') {
2981
+ this.updateAllOffset();
2982
+ if (!isPresent(this.left) || !isPresent(this.top)) {
2983
+ this.service.center();
2984
+ }
2985
+ }
2986
+ else {
2987
+ const viewPort = this.service.windowViewPort;
2988
+ this.setStyle('width', viewPort.width);
2989
+ this.setStyle('height', viewPort.height);
2990
+ this.setStyle('top', 0);
2991
+ this.setStyle('left', 0);
2992
+ }
2993
+ }
2994
+ updateAllOffset() {
2995
+ OFFSET_STYLES.forEach((style) => {
2996
+ if (isPresent(this[style])) {
2997
+ this.setStyle(style, this[style]);
2998
+ }
2999
+ else {
3000
+ this.removeStyle(style);
3001
+ }
3002
+ });
3003
+ }
3004
+ setStyle(style, value) {
3005
+ this.renderer.setStyle(this.el.nativeElement, style, value + 'px');
3006
+ }
3007
+ removeStyle(style) {
3008
+ this.renderer.removeStyle(this.el.nativeElement, style);
3009
+ }
3010
+ get options() {
3011
+ return this.service.options;
3012
+ }
3013
+ setOption(style, value) {
3014
+ if (typeof value !== 'number' && typeof value !== 'string') {
3015
+ return;
3016
+ }
3017
+ const parsedValue = (typeof value === 'number') ? value : parseInt(value, 10);
3018
+ this.options[style] = parsedValue;
3019
+ this.service.setRestoreOption(style, parsedValue);
3020
+ }
3021
+ handleInitialFocus() {
3022
+ const wrapper = this.el.nativeElement;
3023
+ if (this.autoFocusedElement) {
3024
+ const initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
3025
+ if (initiallyFocusedElement) {
3026
+ initiallyFocusedElement.focus();
3027
+ }
3028
+ }
3029
+ else {
3030
+ this.focus();
3031
+ }
3032
+ }
3033
+ /**
3034
+ * @hidden
3035
+ */
3036
+ generateTitleId() {
3037
+ return 'kendo-window-title-' + Math.ceil(Math.random() * 1000000).toString();
3038
+ }
3039
+ handleThemeColorClass(previousValue, currentValue) {
3040
+ const wrapper = this.el.nativeElement;
3041
+ if (previousValue) {
3042
+ const classToRemove = `k-window-${previousValue}`;
3043
+ this.renderer.removeClass(wrapper, classToRemove);
3044
+ }
3045
+ if (currentValue) {
3046
+ const classToAdd = `k-window-${currentValue}`;
3047
+ this.renderer.addClass(wrapper, classToAdd);
3048
+ }
3049
+ }
3050
+ }
3051
+ WindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DragResizeService }, { token: NavigationService }, { token: i0.NgZone }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
3052
+ WindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowComponent, selector: "kendo-window", inputs: { autoFocusedElement: "autoFocusedElement", title: "title", draggable: "draggable", resizable: "resizable", themeColor: "themeColor", keepContent: "keepContent", state: "state", minWidth: "minWidth", minHeight: "minHeight", width: "width", height: "height", top: "top", left: "left" }, outputs: { dragStart: "dragStart", dragEnd: "dragEnd", resizeStart: "resizeStart", resizeEnd: "resizeEnd", close: "close", widthChange: "widthChange", heightChange: "heightChange", topChange: "topChange", leftChange: "leftChange", stateChange: "stateChange" }, host: { listeners: { "focus": "onComponentFocus()", "blur": "onComponentBlur()" }, properties: { "attr.tabIndex": "this.tabIndex", "attr.role": "this.role", "class.k-window": "this.hostClass", "attr.dir": "this.dir", "style.minWidth": "this.styleMinWidth", "style.minHeight": "this.styleMinHeight", "style.position": "this.stylePosition", "class.k-window-maximized": "this.wrapperMaximizedClass", "class.k-window-minimized": "this.wrapperMinimizedClass" } }, providers: [
3053
+ DragResizeService,
3054
+ NavigationService,
3055
+ LocalizationService,
3056
+ {
3057
+ provide: L10N_PREFIX,
3058
+ useValue: 'kendo.window'
3059
+ }
3060
+ ], queries: [{ propertyName: "titleBarContent", first: true, predicate: WindowTitleBarComponent, descendants: true }], viewQueries: [{ propertyName: "titleBarView", first: true, predicate: WindowTitleBarComponent, descendants: true }, { propertyName: "resizeHandles", predicate: ResizeHandleDirective, descendants: true }], exportAs: ["kendoWindow"], usesOnChanges: true, ngImport: i0, template: `
3061
+ <ng-container kendoWindowLocalizedMessages
3062
+ i18n-closeTitle="kendo.window.closeTitle|The title of the close button"
3063
+ closeTitle="Close"
3064
+
3065
+ i18n-restoreTitle="kendo.window.restoreTitle|The title of the restore button"
3066
+ restoreTitle="Restore"
3067
+
3068
+ i18n-maximizeTitle="kendo.window.maximizeTitle|The title of the maximize button"
3069
+ maximizeTitle="Maximize"
3070
+
3071
+ i18n-minimizeTitle="kendo.window.minimizeTitle|The title of the minimize button"
3072
+ minimizeTitle="Minimize"
3073
+ >
3074
+ <ng-container>
3075
+
3076
+ <kendo-window-titlebar *ngIf="showDefaultTitleBar" [template]="titleBarTemplate" [id]="titleId">
3077
+ <span class="k-window-title">{{ title }}</span>
3078
+ <div class="k-window-titlebar-actions">
3079
+ <button kendoWindowMinimizeAction [attr.title]="minimizeButtonTitle" [attr.aria-label]="minimizeButtonTitle"></button>
3080
+ <button kendoWindowMaximizeAction [attr.title]="maximizeButtonTitle" [attr.aria-label]="maximizeButtonTitle"></button>
3081
+ <button kendoWindowRestoreAction [attr.title]="restoreButtonTitle" [attr.aria-label]="restoreButtonTitle"></button>
3082
+ <button kendoWindowCloseAction [attr.title]="closeButtonTitle" [attr.aria-label]="closeButtonTitle"></button>
3083
+ </div>
3084
+ </kendo-window-titlebar>
3085
+ <ng-content select="kendo-window-titlebar" *ngIf="!showDefaultTitleBar"></ng-content>
3086
+
3087
+ <div *ngIf="state !== 'minimized' || keepContent"
3088
+ [hidden]="state === 'minimized' && keepContent"
3089
+ class="k-window-content"
3090
+ >
3091
+ <ng-content *ngIf="!contentTemplate"></ng-content>
3092
+ <ng-template [ngTemplateOutlet]="contentTemplate" *ngIf="contentTemplate"></ng-template>
3093
+ </div>
3094
+
3095
+ <ng-template [ngIf]='resizable'>
3096
+ <div *ngFor='let dir of resizeDirections'
3097
+ [direction]="dir"
3098
+ kendoWindowResizeHandle
3099
+ kendoDraggable>
3100
+ </div>
3101
+ </ng-template>
3102
+ `, isInline: true, components: [{ type: WindowTitleBarComponent, selector: "kendo-window-titlebar", inputs: ["template", "id"] }, { type: WindowMinimizeActionDirective, selector: "button[kendoWindowMinimizeAction]", inputs: ["window"], exportAs: ["kendoWindowMinimizeAction"] }, { type: WindowMaximizeActionDirective, selector: "button[kendoWindowMaximizeAction]", inputs: ["window"], exportAs: ["kendoWindowMaximizeAction"] }, { type: WindowRestoreActionDirective, selector: "button[kendoWindowRestoreAction]", inputs: ["window"], exportAs: ["kendoWindowRestoreAction"] }, { type: WindowCloseActionDirective, selector: "button[kendoWindowCloseAction]", inputs: ["window"], exportAs: ["kendoWindowCloseAction"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n " }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: ResizeHandleDirective, selector: "[kendoWindowResizeHandle]", inputs: ["direction"] }, { type: i1$1.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }] });
3103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowComponent, decorators: [{
3104
+ type: Component,
3105
+ args: [{
3106
+ exportAs: 'kendoWindow',
3107
+ providers: [
3108
+ DragResizeService,
3109
+ NavigationService,
3110
+ LocalizationService,
3111
+ {
3112
+ provide: L10N_PREFIX,
3113
+ useValue: 'kendo.window'
3114
+ }
3115
+ ],
3116
+ selector: 'kendo-window',
3117
+ template: `
3118
+ <ng-container kendoWindowLocalizedMessages
3119
+ i18n-closeTitle="kendo.window.closeTitle|The title of the close button"
3120
+ closeTitle="Close"
3121
+
3122
+ i18n-restoreTitle="kendo.window.restoreTitle|The title of the restore button"
3123
+ restoreTitle="Restore"
3124
+
3125
+ i18n-maximizeTitle="kendo.window.maximizeTitle|The title of the maximize button"
3126
+ maximizeTitle="Maximize"
3127
+
3128
+ i18n-minimizeTitle="kendo.window.minimizeTitle|The title of the minimize button"
3129
+ minimizeTitle="Minimize"
3130
+ >
3131
+ <ng-container>
3132
+
3133
+ <kendo-window-titlebar *ngIf="showDefaultTitleBar" [template]="titleBarTemplate" [id]="titleId">
3134
+ <span class="k-window-title">{{ title }}</span>
3135
+ <div class="k-window-titlebar-actions">
3136
+ <button kendoWindowMinimizeAction [attr.title]="minimizeButtonTitle" [attr.aria-label]="minimizeButtonTitle"></button>
3137
+ <button kendoWindowMaximizeAction [attr.title]="maximizeButtonTitle" [attr.aria-label]="maximizeButtonTitle"></button>
3138
+ <button kendoWindowRestoreAction [attr.title]="restoreButtonTitle" [attr.aria-label]="restoreButtonTitle"></button>
3139
+ <button kendoWindowCloseAction [attr.title]="closeButtonTitle" [attr.aria-label]="closeButtonTitle"></button>
3140
+ </div>
3141
+ </kendo-window-titlebar>
3142
+ <ng-content select="kendo-window-titlebar" *ngIf="!showDefaultTitleBar"></ng-content>
3143
+
3144
+ <div *ngIf="state !== 'minimized' || keepContent"
3145
+ [hidden]="state === 'minimized' && keepContent"
3146
+ class="k-window-content"
3147
+ >
3148
+ <ng-content *ngIf="!contentTemplate"></ng-content>
3149
+ <ng-template [ngTemplateOutlet]="contentTemplate" *ngIf="contentTemplate"></ng-template>
3150
+ </div>
3151
+
3152
+ <ng-template [ngIf]='resizable'>
3153
+ <div *ngFor='let dir of resizeDirections'
3154
+ [direction]="dir"
3155
+ kendoWindowResizeHandle
3156
+ kendoDraggable>
3157
+ </div>
3158
+ </ng-template>
3159
+ `
3160
+ }]
3161
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: DragResizeService }, { type: NavigationService }, { type: i0.NgZone }, { type: i1.LocalizationService }]; }, propDecorators: { autoFocusedElement: [{
3162
+ type: Input
3163
+ }], title: [{
3164
+ type: Input
3165
+ }], draggable: [{
3166
+ type: Input
3167
+ }], resizable: [{
3168
+ type: Input
3169
+ }], themeColor: [{
3170
+ type: Input
3171
+ }], keepContent: [{
3172
+ type: Input
3173
+ }], state: [{
3174
+ type: Input
3175
+ }], minWidth: [{
3176
+ type: Input
3177
+ }], minHeight: [{
3178
+ type: Input
3179
+ }], width: [{
3180
+ type: Input
3181
+ }], height: [{
3182
+ type: Input
3183
+ }], top: [{
3184
+ type: Input
3185
+ }], left: [{
3186
+ type: Input
3187
+ }], dragStart: [{
3188
+ type: Output
3189
+ }], dragEnd: [{
3190
+ type: Output
3191
+ }], resizeStart: [{
3192
+ type: Output
3193
+ }], resizeEnd: [{
3194
+ type: Output
3195
+ }], close: [{
3196
+ type: Output
3197
+ }], widthChange: [{
3198
+ type: Output
3199
+ }], heightChange: [{
3200
+ type: Output
3201
+ }], topChange: [{
3202
+ type: Output
3203
+ }], leftChange: [{
3204
+ type: Output
3205
+ }], stateChange: [{
3206
+ type: Output
3207
+ }], tabIndex: [{
3208
+ type: HostBinding,
3209
+ args: ['attr.tabIndex']
3210
+ }], role: [{
3211
+ type: HostBinding,
3212
+ args: ['attr.role']
3213
+ }], hostClass: [{
3214
+ type: HostBinding,
3215
+ args: ['class.k-window']
3216
+ }], dir: [{
3217
+ type: HostBinding,
3218
+ args: ['attr.dir']
3219
+ }], titleBarView: [{
3220
+ type: ViewChild,
3221
+ args: [WindowTitleBarComponent, { static: false }]
3222
+ }], titleBarContent: [{
3223
+ type: ContentChild,
3224
+ args: [WindowTitleBarComponent, { static: false }]
3225
+ }], resizeHandles: [{
3226
+ type: ViewChildren,
3227
+ args: [ResizeHandleDirective]
3228
+ }], styleMinWidth: [{
3229
+ type: HostBinding,
3230
+ args: ['style.minWidth']
3231
+ }], styleMinHeight: [{
3232
+ type: HostBinding,
3233
+ args: ['style.minHeight']
3234
+ }], stylePosition: [{
3235
+ type: HostBinding,
3236
+ args: ['style.position']
3237
+ }], wrapperMaximizedClass: [{
3238
+ type: HostBinding,
3239
+ args: ['class.k-window-maximized']
3240
+ }], wrapperMinimizedClass: [{
3241
+ type: HostBinding,
3242
+ args: ['class.k-window-minimized']
3243
+ }], onComponentFocus: [{
3244
+ type: HostListener,
3245
+ args: ['focus']
3246
+ }], onComponentBlur: [{
3247
+ type: HostListener,
3248
+ args: ['blur']
3249
+ }] } });
3250
+
3251
+ /**
3252
+ * Indicates that the **Close** button of a Window that is opened through `WindowService` is clicked.
3253
+ */
3254
+ class WindowCloseResult {
3255
+ }
3256
+
3257
+ /**
3258
+ * Holds references to the object instance of the Window.
3259
+ * Controls the Windows that were opened through `WindowService`
3260
+ * ([see example]({% slug api_dialog_windowservice %}#toc-open)).
3261
+ */
3262
+ class WindowRef {
3263
+ }
3264
+
3265
+ /**
3266
+ * The settings for the Window actions when the Window is opened through `WindowService`
3267
+ * ([see example]({% slug api_dialog_windowservice %}#toc-open)).
3268
+ */
3269
+ class WindowSettings {
3270
+ }
3271
+
3272
+ /**
3273
+ * @hidden
3274
+ */
3275
+ class WindowContainerService {
3276
+ set container(container) {
3277
+ WindowContainerService.container = container;
3278
+ }
3279
+ get container() {
3280
+ return WindowContainerService.container;
3281
+ }
3282
+ }
3283
+ WindowContainerService.container = null;
3284
+ WindowContainerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3285
+ WindowContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowContainerService });
3286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowContainerService, decorators: [{
3287
+ type: Injectable
3288
+ }] });
3289
+
3290
+ const isNotComponent = (component) => isString(component) || component instanceof TemplateRef;
3291
+ class WindowInjector {
3292
+ constructor(getWindowRef, parentInjector) {
3293
+ this.getWindowRef = getWindowRef;
3294
+ this.parentInjector = parentInjector;
3295
+ }
3296
+ get(token, notFoundValue) {
3297
+ if (token === WindowRef) {
3298
+ return this.getWindowRef();
3299
+ }
3300
+ return this.parentInjector.get(token, notFoundValue);
3301
+ }
3302
+ }
3303
+ /**
3304
+ * A service for opening Windows dynamically
3305
+ * ([see example]({% slug service_window %})).
3306
+ */
3307
+ class WindowService {
3308
+ constructor(
3309
+ /**
3310
+ * @hidden
3311
+ */
3312
+ resolver, containerService) {
3313
+ this.resolver = resolver;
3314
+ this.containerService = containerService;
3315
+ }
3316
+ /**
3317
+ * Opens a Window component.
3318
+ *
3319
+ * @param {WindowSettings} settings - The settings that define the Window.
3320
+ * @returns {WindowRef} - A reference to the Window object.
3321
+ *
3322
+ * @example
3323
+ *
3324
+ * ```ts-no-run
3325
+ * _@Component({
3326
+ * selector: 'my-app',
3327
+ * template: `
3328
+ * <button kendoButton (click)="open()">Open window</button>
3329
+ * <div kendoWindowContainer></div>
3330
+ * `
3331
+ * })
3332
+ * export class AppComponent {
3333
+ * constructor( private windowService: WindowService ) {}
3334
+ *
3335
+ * public open() {
3336
+ * var window = this.windowService.open({
3337
+ * title: "My window",
3338
+ * content: "My content!"
3339
+ * });
3340
+ *
3341
+ * window.result.subscribe((result) => {
3342
+ * if (result instanceof WindowCloseResult) {
3343
+ * console.log("Window was closed");
3344
+ * }
3345
+ * });
3346
+ * }
3347
+ * }
3348
+ * ```
3349
+ *
3350
+ */
3351
+ open(settings) {
3352
+ const factory = this.resolver.resolveComponentFactory(WindowComponent);
3353
+ const container = settings.appendTo || this.containerService.container;
3354
+ if (!container) {
3355
+ throw new Error(`Cannot attach window to the page.
3356
+ Add an element that uses the kendoWindowContainer directive, or set the 'appendTo' property.
3357
+ See https://www.telerik.com/kendo-angular-ui/components/dialogs/window/service/
3358
+ `);
3359
+ }
3360
+ const windowRef = {
3361
+ close: () => { },
3362
+ content: null,
3363
+ result: null,
3364
+ window: null
3365
+ };
3366
+ const content = this.contentFrom(settings.content, container, windowRef);
3367
+ const window = container.createComponent(factory, undefined, undefined, content.nodes);
3368
+ windowRef.window = window;
3369
+ this.applyOptions(window.instance, settings);
3370
+ const apiClose = new Subject();
3371
+ const close = (e) => {
3372
+ apiClose.next(e || new WindowCloseResult());
3373
+ if (content.componentRef) {
3374
+ content.componentRef.destroy();
3375
+ }
3376
+ window.destroy();
3377
+ };
3378
+ const result = merge(apiClose, window.instance.close.pipe(map(e => (e ? e : new WindowCloseResult())), filter((e) => {
3379
+ if (settings.preventClose) {
3380
+ // add windowRef only when using component
3381
+ const windowRefParameter = isNotComponent(settings.content) ? undefined : windowRef;
3382
+ return !settings.preventClose(e, windowRefParameter);
3383
+ }
3384
+ return true;
3385
+ }))).pipe(take(1),
3386
+ // Takes care for multiple subscriptions:
3387
+ // We subscribe internally and the user may subscribe to get a close result - window.result.subscribe().
3388
+ // This causes multiple subscriptions to the same source and thus multiple emissions. share() solves that.
3389
+ share());
3390
+ result.subscribe(close);
3391
+ windowRef.close = close;
3392
+ windowRef.result = result;
3393
+ window.changeDetectorRef.markForCheck();
3394
+ return windowRef;
3395
+ }
3396
+ applyOptions(instance, options) {
3397
+ if (isPresent(options.htmlAttributes)) {
3398
+ instance.htmlAttributes = options.htmlAttributes;
3399
+ }
3400
+ if (isPresent(options.cssClass)) {
3401
+ instance.cssClass = options.cssClass;
3402
+ }
3403
+ if (isPresent(options.title)) {
3404
+ instance.title = options.title;
3405
+ }
3406
+ if (isPresent(options.keepContent)) {
3407
+ instance.keepContent = options.keepContent;
3408
+ }
3409
+ if (isPresent(options.width)) {
3410
+ instance.width = options.width;
3411
+ }
3412
+ if (isPresent(options.minWidth)) {
3413
+ instance.minWidth = options.minWidth;
3414
+ }
3415
+ if (isPresent(options.height)) {
3416
+ instance.height = options.height;
3417
+ }
3418
+ if (isPresent(options.minHeight)) {
3419
+ instance.minHeight = options.minHeight;
3420
+ }
3421
+ if (isPresent(options.left)) {
3422
+ instance.left = options.left;
3423
+ }
3424
+ if (isPresent(options.top)) {
3425
+ instance.top = options.top;
3426
+ }
3427
+ if (isPresent(options.draggable)) {
3428
+ instance.draggable = options.draggable;
3429
+ }
3430
+ if (isPresent(options.resizable)) {
3431
+ instance.resizable = options.resizable;
3432
+ }
3433
+ if (isPresent(options.messages && options.messages.closeTitle)) {
3434
+ instance.messages.closeTitle = options.messages.closeTitle;
3435
+ }
3436
+ if (isPresent(options.messages && options.messages.restoreTitle)) {
3437
+ instance.messages.restoreTitle = options.messages.restoreTitle;
3438
+ }
3439
+ if (isPresent(options.messages && options.messages.maximizeTitle)) {
3440
+ instance.messages.maximizeTitle = options.messages.maximizeTitle;
3441
+ }
3442
+ if (isPresent(options.messages && options.messages.minimizeTitle)) {
3443
+ instance.messages.minimizeTitle = options.messages.minimizeTitle;
3444
+ }
3445
+ if (isPresent(options.autoFocusedElement)) {
3446
+ instance.autoFocusedElement = options.autoFocusedElement;
3447
+ }
3448
+ if (isPresent(options.state)) {
3449
+ instance.state = options.state;
3450
+ if (options.state === 'minimized') {
3451
+ instance.keepContent = true;
3452
+ }
3453
+ }
3454
+ if (options.content instanceof TemplateRef) {
3455
+ instance.contentTemplate = options.content;
3456
+ }
3457
+ if (options.titleBarContent instanceof TemplateRef) {
3458
+ instance.titleBarTemplate = options.titleBarContent;
3459
+ }
3460
+ }
3461
+ contentFrom(content, container, windowRef) {
3462
+ const renderer = container.injector.get(Renderer2);
3463
+ let nodes = [];
3464
+ let componentRef = null;
3465
+ if (typeof content === 'string') {
3466
+ nodes = [renderer.createText(content)];
3467
+ }
3468
+ else if (content && !(content instanceof TemplateRef)) {
3469
+ const injector = new WindowInjector(() => windowRef, container.injector);
3470
+ const factory = this.resolver.resolveComponentFactory(content);
3471
+ componentRef = container.createComponent(factory, undefined, injector);
3472
+ nodes = [componentRef.location.nativeElement];
3473
+ windowRef.content = componentRef;
3474
+ }
3475
+ return {
3476
+ componentRef,
3477
+ nodes: [
3478
+ [],
3479
+ nodes // Content
3480
+ ]
3481
+ };
3482
+ }
3483
+ }
3484
+ WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, deps: [{ token: i0.ComponentFactoryResolver }, { token: WindowContainerService }], target: i0.ɵɵFactoryTarget.Injectable });
3485
+ WindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService });
3486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, decorators: [{
3487
+ type: Injectable
3488
+ }], ctorParameters: function () {
3489
+ return [{ type: i0.ComponentFactoryResolver }, { type: WindowContainerService, decorators: [{
3490
+ type: Inject,
3491
+ args: [WindowContainerService]
3492
+ }] }];
3493
+ } });
3494
+
3495
+ /**
3496
+ * Provides an insertion point for the Dialogs which are created through the
3497
+ * Dialog service ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
3498
+ * Created Dialogs will be mounted after that element.
3499
+ *
3500
+ * @example
3501
+ * ```html-no-run
3502
+ * <div kendoDialogContainer></div>
3503
+ * ```
3504
+ */
3505
+ class DialogContainerDirective {
3506
+ constructor(container, service) {
3507
+ service.container = container;
3508
+ }
3509
+ }
3510
+ DialogContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContainerDirective, deps: [{ token: i0.ViewContainerRef }, { token: DialogContainerService }], target: i0.ɵɵFactoryTarget.Directive });
3511
+ DialogContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DialogContainerDirective, selector: "[kendoDialogContainer]", ngImport: i0 });
3512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogContainerDirective, decorators: [{
3513
+ type: Directive,
3514
+ args: [{
3515
+ selector: '[kendoDialogContainer]'
3516
+ }]
3517
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: DialogContainerService }]; } });
3518
+
3519
+ /**
3520
+ * Custom component messages override default component messages
3521
+ * ([see example]({% slug globalization_dialogs %}#toc-localization)).
3522
+ */
3523
+ class CustomMessagesComponent extends Messages {
3524
+ constructor(service) {
3525
+ super();
3526
+ this.service = service;
3527
+ }
3528
+ get override() {
3529
+ return true;
3530
+ }
3531
+ }
3532
+ CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
3533
+ CustomMessagesComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: CustomMessagesComponent, selector: "kendo-dialog-messages, kendo-window-messages", providers: [
3534
+ {
3535
+ provide: Messages,
3536
+ useExisting: forwardRef(() => CustomMessagesComponent)
3537
+ }
3538
+ ], usesInheritance: true, ngImport: i0 });
3539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomMessagesComponent, decorators: [{
3540
+ type: Directive,
3541
+ args: [{
3542
+ providers: [
3543
+ {
3544
+ provide: Messages,
3545
+ useExisting: forwardRef(() => CustomMessagesComponent)
3546
+ }
3547
+ ],
3548
+ // eslint-disable-next-line @angular-eslint/directive-selector
3549
+ selector: 'kendo-dialog-messages, kendo-window-messages'
3550
+ }]
3551
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
3552
+
3553
+ /**
3554
+ * @hidden
3555
+ */
3556
+ const SHARED_DIRECTIVES = [
3557
+ DialogActionsComponent,
3558
+ CustomMessagesComponent,
3559
+ LocalizedMessagesDirective
3560
+ ];
3561
+ /**
3562
+ * @hidden
3563
+ */
3564
+ class SharedModule {
3565
+ }
3566
+ SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3567
+ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, declarations: [DialogActionsComponent,
3568
+ CustomMessagesComponent,
3569
+ LocalizedMessagesDirective], imports: [CommonModule, IconsModule, ButtonModule], exports: [DialogActionsComponent,
3570
+ CustomMessagesComponent,
3571
+ LocalizedMessagesDirective, CommonModule, IconsModule, ButtonModule] });
3572
+ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[CommonModule, IconsModule, ButtonModule], CommonModule, IconsModule, ButtonModule] });
3573
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
3574
+ type: NgModule,
3575
+ args: [{
3576
+ declarations: [SHARED_DIRECTIVES],
3577
+ exports: [SHARED_DIRECTIVES, CommonModule, IconsModule, ButtonModule],
3578
+ imports: [CommonModule, IconsModule, ButtonModule]
3579
+ }]
3580
+ }] });
3581
+
3582
+ /**
3583
+ * @hidden
3584
+ */
3585
+ const DIALOG_DIRECTIVES = [
3586
+ DialogComponent,
3587
+ DialogTitleBarComponent
3588
+ ];
3589
+ /**
3590
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
3591
+ * definition for the Dialog component that includes all Dialog components and directives.
3592
+ * Imports `DialogModule` into the [root module](link:site.data.urls.angular['ngmodules']#angular-modularity)
3593
+ * of your application or into any other sub-module that will use the Dialog component.
3594
+ *
3595
+ * @example
3596
+ * ```ts-no-run
3597
+ * import { NgModule } from '@angular/core';
3598
+ * import { BrowserModule } from '@angular/platform-browser';
3599
+ * import { DialogModule } from '@progress/kendo-angular-dialog';
3600
+ * import { AppComponent } from './app.component';
3601
+ *
3602
+ * _@NgModule({
3603
+ * bootstrap: [AppComponent],
3604
+ * declarations: [AppComponent],
3605
+ * imports: [BrowserModule, DialogModule]
3606
+ * })
3607
+ * export class AppModule {
3608
+ * }
3609
+ * ```
3610
+ */
3611
+ class DialogModule {
3612
+ }
3613
+ DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3614
+ DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogModule, declarations: [DialogComponent,
3615
+ DialogTitleBarComponent, DialogContainerDirective], imports: [SharedModule], exports: [DialogComponent,
3616
+ DialogTitleBarComponent, DialogActionsComponent, CustomMessagesComponent, LocalizedMessagesDirective, DialogContainerDirective] });
3617
+ DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogModule, providers: [DialogContainerService, DialogService], imports: [[SharedModule]] });
3618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogModule, decorators: [{
3619
+ type: NgModule,
3620
+ args: [{
3621
+ declarations: [DIALOG_DIRECTIVES, DialogContainerDirective],
3622
+ entryComponents: [DIALOG_DIRECTIVES],
3623
+ exports: [DIALOG_DIRECTIVES, SHARED_DIRECTIVES, DialogContainerDirective],
3624
+ imports: [SharedModule],
3625
+ providers: [DialogContainerService, DialogService]
3626
+ }]
3627
+ }] });
3628
+
3629
+ /**
3630
+ * Provides an insertion point for the Windows which are created through the
3631
+ * Window service ([see example]({% slug api_dialog_windowservice %}#toc-open)).
3632
+ * Created Windows will be mounted after that element.
3633
+ *
3634
+ * @example
3635
+ * ```html-no-run
3636
+ * <div kendoWindowContainer></div>
3637
+ * ```
3638
+ */
3639
+ class WindowContainerDirective {
3640
+ constructor(container, service) {
3641
+ service.container = container;
3642
+ }
3643
+ }
3644
+ WindowContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowContainerDirective, deps: [{ token: i0.ViewContainerRef }, { token: WindowContainerService }], target: i0.ɵɵFactoryTarget.Directive });
3645
+ WindowContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: WindowContainerDirective, selector: "[kendoWindowContainer]", ngImport: i0 });
3646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowContainerDirective, decorators: [{
3647
+ type: Directive,
3648
+ args: [{
3649
+ selector: '[kendoWindowContainer]'
3650
+ }]
3651
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: WindowContainerService }]; } });
3652
+
3653
+ const WINDOW_DIRECTIVES = [
3654
+ ResizeHandleDirective,
3655
+ WindowComponent,
3656
+ WindowTitleBarComponent,
3657
+ WindowCloseActionDirective,
3658
+ WindowMinimizeActionDirective,
3659
+ WindowMaximizeActionDirective,
3660
+ WindowRestoreActionDirective
3661
+ ];
3662
+ const ENTRY_COMPONENTS = [
3663
+ WindowComponent,
3664
+ WindowTitleBarComponent
3665
+ ];
3666
+ const exportedModules = [
3667
+ WindowComponent,
3668
+ WindowCloseActionDirective,
3669
+ WindowMinimizeActionDirective,
3670
+ WindowMaximizeActionDirective,
3671
+ WindowRestoreActionDirective,
3672
+ WindowTitleBarComponent
3673
+ ];
3674
+ /**
3675
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
3676
+ * definition for the Window component. Imports `WindowModule` into the
3677
+ * [root module](link:site.data.urls.angular['ngmodules']#angular-modularity)
3678
+ * of your application or into any other sub-module that will use the Window component.
3679
+ *
3680
+ * @example
3681
+ * ```ts-no-run
3682
+ * import { NgModule } from '@angular/core';
3683
+ * import { BrowserModule } from '@angular/platform-browser';
3684
+ * import { WindowModule } from '@progress/kendo-angular-window';
3685
+ * import { AppComponent } from './app.component';
3686
+ *
3687
+ * _@NgModule({
3688
+ * bootstrap: [AppComponent],
3689
+ * declarations: [AppComponent],
3690
+ * imports: [BrowserModule, WindowModule]
3691
+ * })
3692
+ * export class AppModule {
3693
+ * }
3694
+ * ```
3695
+ */
3696
+ class WindowModule {
3697
+ }
3698
+ WindowModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3699
+ WindowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowModule, declarations: [ResizeHandleDirective,
3700
+ WindowComponent,
3701
+ WindowTitleBarComponent,
3702
+ WindowCloseActionDirective,
3703
+ WindowMinimizeActionDirective,
3704
+ WindowMaximizeActionDirective,
3705
+ WindowRestoreActionDirective, WindowContainerDirective], imports: [SharedModule, DraggableModule], exports: [WindowComponent,
3706
+ WindowCloseActionDirective,
3707
+ WindowMinimizeActionDirective,
3708
+ WindowMaximizeActionDirective,
3709
+ WindowRestoreActionDirective,
3710
+ WindowTitleBarComponent, DialogActionsComponent, CustomMessagesComponent, LocalizedMessagesDirective, WindowContainerDirective] });
3711
+ WindowModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowModule, providers: [WindowContainerService, WindowService], imports: [[SharedModule, DraggableModule]] });
3712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowModule, decorators: [{
3713
+ type: NgModule,
3714
+ args: [{
3715
+ declarations: [WINDOW_DIRECTIVES, WindowContainerDirective],
3716
+ entryComponents: [ENTRY_COMPONENTS],
3717
+ exports: [exportedModules, SHARED_DIRECTIVES, WindowContainerDirective],
3718
+ imports: [SharedModule, DraggableModule],
3719
+ providers: [WindowContainerService, WindowService]
3720
+ }]
3721
+ }] });
3722
+
3723
+ /**
3724
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
3725
+ * definition for the Dialogs components.
3726
+ *
3727
+ * @example
3728
+ *
3729
+ * ```ts-no-run
3730
+ * import { DialogsModule } from '@progress/kendo-angular-dialog';
3731
+ *
3732
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3733
+ * import { NgModule } from '@angular/core';
3734
+ *
3735
+ * import { AppComponent } from './app.component';
3736
+ *
3737
+ * _@NgModule({
3738
+ * declarations: [AppComponent],
3739
+ * imports: [BrowserModule, DialogsModule],
3740
+ * bootstrap: [AppComponent]
3741
+ * })
3742
+ * export class AppModule {}
3743
+ *
3744
+ * platformBrowserDynamic().bootstrapModule(AppModule);
3745
+ *
3746
+ * ```
3747
+ */
3748
+ class DialogsModule {
3749
+ }
3750
+ DialogsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3751
+ DialogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogsModule, exports: [DialogModule, WindowModule] });
3752
+ DialogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogsModule, imports: [DialogModule, WindowModule] });
3753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DialogsModule, decorators: [{
3754
+ type: NgModule,
3755
+ args: [{
3756
+ exports: [DialogModule, WindowModule]
3757
+ }]
3758
+ }] });
3759
+
3760
+ /**
3761
+ * Generated bundle index. Do not edit.
3762
+ */
3763
+
3764
+ export { CustomMessagesComponent, DialogAction, DialogActionsComponent, DialogCloseResult, DialogComponent, DialogContainerDirective, DialogContainerService, DialogContentBase, DialogModule, DialogRef, DialogService, DialogSettings, DialogTitleBarComponent, DialogsModule, DragResizeService, LocalizedMessagesDirective, Messages, PreventableEvent, WindowCloseActionDirective, WindowCloseResult, WindowComponent, WindowContainerDirective, WindowMaximizeActionDirective, WindowMinimizeActionDirective, WindowModule, WindowRef, WindowRestoreActionDirective, WindowService, WindowSettings, WindowTitleBarComponent };
3765
+