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

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