@progress/kendo-angular-dialog 7.1.5-dev.202211170718 → 11.0.0-develop.100

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