@progress/kendo-angular-dialog 6.0.0-dev.202201190911 → 7.0.0-next.202202211226

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 (196) hide show
  1. package/bundles/kendo-angular-dialog.umd.js +5 -0
  2. package/{dist/es2015/common → common}/actions-layout.d.ts +0 -0
  3. package/{dist/es2015/common → common}/preventable-event.d.ts +0 -0
  4. package/{dist/es2015/common → common}/util.d.ts +1 -1
  5. package/{dist/es2015/dialog → dialog}/dialog-actions.component.d.ts +14 -7
  6. package/{dist/es2015/dialog → dialog}/dialog-container.directive.d.ts +3 -0
  7. package/dialog/dialog-container.service.d.ts +16 -0
  8. package/{dist/es2015/dialog → dialog}/dialog-content-base.d.ts +4 -1
  9. package/{dist/es2015/dialog → dialog}/dialog-titlebar.component.d.ts +5 -2
  10. package/{dist/es2015/dialog → dialog}/dialog.component.d.ts +13 -6
  11. package/{dist/es2015/dialog → dialog}/dialog.service.d.ts +5 -1
  12. package/dialog/models/dialog-action.d.ts +28 -0
  13. package/dialog/models/dialog-close-result.d.ts +11 -0
  14. package/dialog/models/dialog-ref.d.ts +38 -0
  15. package/dialog/models/dialog-result.d.ts +14 -0
  16. package/{dist/es2015/dialog → dialog/models}/dialog-settings.d.ts +5 -73
  17. package/{dist/es/localization/dialog-localization.service.js → dialog/models/index.d.ts} +5 -5
  18. package/{dist/es2015/dialog.module.d.ts → dialog.module.d.ts} +11 -0
  19. package/{dist/es2015/dialogs.module.d.ts → dialogs.module.d.ts} +6 -0
  20. package/{dist/es2015 → esm2015}/common/actions-layout.js +1 -0
  21. package/{dist/es2015 → esm2015}/common/preventable-event.js +0 -0
  22. package/{dist/es2015 → esm2015}/common/util.js +0 -5
  23. package/esm2015/dialog/dialog-actions.component.js +115 -0
  24. package/esm2015/dialog/dialog-container.directive.js +30 -0
  25. package/esm2015/dialog/dialog-container.service.js +23 -0
  26. package/{dist/es2015 → esm2015}/dialog/dialog-content-base.js +18 -10
  27. package/esm2015/dialog/dialog-titlebar.component.js +136 -0
  28. package/{dist/es2015 → esm2015}/dialog/dialog.component.js +125 -115
  29. package/{dist/es2015 → esm2015}/dialog/dialog.service.js +16 -15
  30. package/{dist/es2015/window/window-container.service.d.ts → esm2015/dialog/models/dialog-action.js} +3 -5
  31. package/esm2015/dialog/models/dialog-close-result.js +11 -0
  32. package/esm2015/dialog/models/dialog-ref.js +11 -0
  33. package/{dist/es/common/actions-layout.js → esm2015/dialog/models/dialog-result.js} +1 -0
  34. package/{dist/es2015/dialog/dialog-container.service.d.ts → esm2015/dialog/models/dialog-settings.js} +3 -5
  35. package/esm2015/dialog/models/index.js +9 -0
  36. package/{dist/es2015 → esm2015}/dialog.module.js +20 -13
  37. package/{dist/es → esm2015}/dialogs.module.js +12 -12
  38. package/esm2015/kendo-angular-dialog.js +8 -0
  39. package/esm2015/localization/custom-messages.component.js +41 -0
  40. package/{dist/es2015 → esm2015}/localization/dialog-localization.service.js +0 -0
  41. package/esm2015/localization/localized-messages.directive.js +40 -0
  42. package/esm2015/localization/messages.js +28 -0
  43. package/esm2015/localization/titlebar-localization.service.js +44 -0
  44. package/{dist/es2015 → esm2015}/main.js +8 -2
  45. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  46. package/esm2015/shared.module.js +38 -0
  47. package/esm2015/window/actions/window-close-action.directive.js +59 -0
  48. package/esm2015/window/actions/window-maximize-action.directive.js +65 -0
  49. package/esm2015/window/actions/window-minimize-action.directive.js +65 -0
  50. package/esm2015/window/actions/window-restore-action.directive.js +65 -0
  51. package/{dist/es2015 → esm2015}/window/drag-resize.service.js +9 -11
  52. package/esm2015/window/models/index.js +10 -0
  53. package/esm2015/window/models/window-close-result.js +9 -0
  54. package/{dist/es2015/window/window-events.js → esm2015/window/models/window-messages.js} +1 -0
  55. package/esm2015/window/models/window-options.js +5 -0
  56. package/{dist/es2015/window/window-settings.js → esm2015/window/models/window-ref.js} +0 -11
  57. package/esm2015/window/models/window-settings.js +10 -0
  58. package/esm2015/window/models/window-types.js +5 -0
  59. package/{dist/es2015 → esm2015}/window/navigation.service.js +10 -11
  60. package/esm2015/window/window-container.directive.js +30 -0
  61. package/esm2015/window/window-container.service.js +23 -0
  62. package/{dist/es → esm2015}/window/window-events.js +1 -0
  63. package/{dist/es2015 → esm2015}/window/window-resize-handle.directive.js +21 -26
  64. package/{dist/es2015 → esm2015}/window/window-titlebar.component.js +35 -34
  65. package/{dist/es2015 → esm2015}/window/window.component.js +168 -187
  66. package/{dist/es2015 → esm2015}/window/window.service.js +15 -14
  67. package/{dist/es2015 → esm2015}/window.module.js +29 -17
  68. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-dialog.js} +1025 -928
  69. package/{dist/es2015/shared.module.d.ts → kendo-angular-dialog.d.ts} +3 -7
  70. package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
  71. package/{dist/es2015/localization → localization}/dialog-localization.service.d.ts +0 -0
  72. package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
  73. package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
  74. package/{dist/es2015/localization → localization}/titlebar-localization.service.d.ts +3 -0
  75. package/{dist/es2015/main.d.ts → main.d.ts} +7 -2
  76. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  77. package/package.json +33 -101
  78. package/schematics/ngAdd/index.js +5 -2
  79. package/schematics/ngAdd/index.js.map +1 -1
  80. package/shared.module.d.ts +21 -0
  81. package/{dist/es2015/window → window}/actions/window-close-action.directive.d.ts +3 -0
  82. package/{dist/es2015/window → window}/actions/window-maximize-action.directive.d.ts +4 -1
  83. package/{dist/es2015/window → window}/actions/window-minimize-action.directive.d.ts +4 -1
  84. package/{dist/es2015/window → window}/actions/window-restore-action.directive.d.ts +4 -1
  85. package/{dist/es2015/window → window}/drag-resize.service.d.ts +8 -4
  86. package/window/models/index.d.ts +10 -0
  87. package/window/models/window-close-result.d.ts +9 -0
  88. package/window/models/window-messages.d.ts +26 -0
  89. package/window/models/window-options.d.ts +20 -0
  90. package/window/models/window-ref.d.ts +40 -0
  91. package/{dist/es2015/window → window/models}/window-settings.d.ts +4 -84
  92. package/window/models/window-types.d.ts +11 -0
  93. package/{dist/es2015/window → window}/navigation.service.d.ts +4 -1
  94. package/{dist/es2015/window → window}/window-container.directive.d.ts +3 -0
  95. package/window/window-container.service.d.ts +16 -0
  96. package/{dist/es2015/window → window}/window-events.d.ts +0 -0
  97. package/{dist/es2015/window → window}/window-resize-handle.directive.d.ts +4 -1
  98. package/{dist/es2015/window → window}/window-titlebar.component.d.ts +6 -3
  99. package/{dist/es2015/window → window}/window.component.d.ts +42 -25
  100. package/{dist/es2015/window → window}/window.service.d.ts +5 -1
  101. package/window.module.d.ts +45 -0
  102. package/dist/cdn/js/kendo-angular-dialog.js +0 -20
  103. package/dist/cdn/main.js +0 -5
  104. package/dist/es/common/preventable-event.js +0 -29
  105. package/dist/es/common/util.js +0 -214
  106. package/dist/es/dialog/dialog-actions.component.js +0 -89
  107. package/dist/es/dialog/dialog-container.directive.js +0 -31
  108. package/dist/es/dialog/dialog-container.service.js +0 -31
  109. package/dist/es/dialog/dialog-content-base.js +0 -45
  110. package/dist/es/dialog/dialog-settings.js +0 -46
  111. package/dist/es/dialog/dialog-titlebar.component.js +0 -94
  112. package/dist/es/dialog/dialog.component.js +0 -462
  113. package/dist/es/dialog/dialog.service.js +0 -214
  114. package/dist/es/dialog.module.js +0 -56
  115. package/dist/es/index.js +0 -22
  116. package/dist/es/localization/custom-messages.component.js +0 -44
  117. package/dist/es/localization/localized-messages.directive.js +0 -35
  118. package/dist/es/localization/messages.js +0 -34
  119. package/dist/es/localization/titlebar-localization.service.js +0 -34
  120. package/dist/es/main.js +0 -21
  121. package/dist/es/package-metadata.js +0 -15
  122. package/dist/es/shared.module.js +0 -34
  123. package/dist/es/window/actions/window-close-action.directive.js +0 -63
  124. package/dist/es/window/actions/window-maximize-action.directive.js +0 -75
  125. package/dist/es/window/actions/window-minimize-action.directive.js +0 -75
  126. package/dist/es/window/actions/window-restore-action.directive.js +0 -75
  127. package/dist/es/window/drag-resize.service.js +0 -351
  128. package/dist/es/window/navigation.service.js +0 -155
  129. package/dist/es/window/window-container.directive.js +0 -31
  130. package/dist/es/window/window-container.service.js +0 -31
  131. package/dist/es/window/window-resize-handle.directive.js +0 -78
  132. package/dist/es/window/window-settings.js +0 -34
  133. package/dist/es/window/window-titlebar.component.js +0 -144
  134. package/dist/es/window/window.component.js +0 -808
  135. package/dist/es/window/window.service.js +0 -214
  136. package/dist/es/window.module.js +0 -76
  137. package/dist/es2015/dialog/dialog-actions.component.js +0 -98
  138. package/dist/es2015/dialog/dialog-container.directive.js +0 -30
  139. package/dist/es2015/dialog/dialog-container.service.js +0 -23
  140. package/dist/es2015/dialog/dialog-settings.js +0 -30
  141. package/dist/es2015/dialog/dialog-titlebar.component.js +0 -106
  142. package/dist/es2015/dialogs.module.js +0 -41
  143. package/dist/es2015/index.d.ts +0 -22
  144. package/dist/es2015/index.js +0 -22
  145. package/dist/es2015/index.metadata.json +0 -1
  146. package/dist/es2015/localization/custom-messages.component.js +0 -36
  147. package/dist/es2015/localization/localized-messages.directive.js +0 -35
  148. package/dist/es2015/localization/messages.js +0 -28
  149. package/dist/es2015/localization/titlebar-localization.service.js +0 -31
  150. package/dist/es2015/shared.module.js +0 -31
  151. package/dist/es2015/window/actions/window-close-action.directive.js +0 -60
  152. package/dist/es2015/window/actions/window-maximize-action.directive.js +0 -68
  153. package/dist/es2015/window/actions/window-minimize-action.directive.js +0 -68
  154. package/dist/es2015/window/actions/window-restore-action.directive.js +0 -68
  155. package/dist/es2015/window/window-container.directive.js +0 -30
  156. package/dist/es2015/window/window-container.service.js +0 -23
  157. package/dist/es2015/window.module.d.ts +0 -28
  158. package/dist/fesm5/index.js +0 -3474
  159. package/dist/npm/common/actions-layout.js +0 -6
  160. package/dist/npm/common/preventable-event.js +0 -31
  161. package/dist/npm/common/util.js +0 -219
  162. package/dist/npm/dialog/dialog-actions.component.js +0 -91
  163. package/dist/npm/dialog/dialog-container.directive.js +0 -33
  164. package/dist/npm/dialog/dialog-container.service.js +0 -33
  165. package/dist/npm/dialog/dialog-content-base.js +0 -47
  166. package/dist/npm/dialog/dialog-settings.js +0 -48
  167. package/dist/npm/dialog/dialog-titlebar.component.js +0 -96
  168. package/dist/npm/dialog/dialog.component.js +0 -464
  169. package/dist/npm/dialog/dialog.service.js +0 -216
  170. package/dist/npm/dialog.module.js +0 -58
  171. package/dist/npm/dialogs.module.js +0 -46
  172. package/dist/npm/index.js +0 -40
  173. package/dist/npm/localization/custom-messages.component.js +0 -46
  174. package/dist/npm/localization/dialog-localization.service.js +0 -11
  175. package/dist/npm/localization/localized-messages.directive.js +0 -37
  176. package/dist/npm/localization/messages.js +0 -36
  177. package/dist/npm/localization/titlebar-localization.service.js +0 -36
  178. package/dist/npm/main.js +0 -45
  179. package/dist/npm/package-metadata.js +0 -17
  180. package/dist/npm/shared.module.js +0 -36
  181. package/dist/npm/window/actions/window-close-action.directive.js +0 -65
  182. package/dist/npm/window/actions/window-maximize-action.directive.js +0 -77
  183. package/dist/npm/window/actions/window-minimize-action.directive.js +0 -77
  184. package/dist/npm/window/actions/window-restore-action.directive.js +0 -77
  185. package/dist/npm/window/drag-resize.service.js +0 -353
  186. package/dist/npm/window/navigation.service.js +0 -157
  187. package/dist/npm/window/window-container.directive.js +0 -33
  188. package/dist/npm/window/window-container.service.js +0 -33
  189. package/dist/npm/window/window-events.js +0 -6
  190. package/dist/npm/window/window-resize-handle.directive.js +0 -80
  191. package/dist/npm/window/window-settings.js +0 -36
  192. package/dist/npm/window/window-titlebar.component.js +0 -146
  193. package/dist/npm/window/window.component.js +0 -810
  194. package/dist/npm/window/window.service.js +0 -216
  195. package/dist/npm/window.module.js +0 -78
  196. package/dist/systemjs/kendo-angular-dialog.js +0 -5
@@ -1,808 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 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 tslib_1 from "tslib";
6
- import { Component, Input, Output, HostBinding, EventEmitter, ContentChild, ElementRef, Renderer2, ViewChildren, QueryList, HostListener, NgZone, ViewChild } from '@angular/core';
7
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { isChanged, isDocumentAvailable } from '@progress/kendo-angular-common';
9
- import { Subscription } from 'rxjs';
10
- import { validatePackage } from '@progress/kendo-licensing';
11
- import { packageMetadata } from '../package-metadata';
12
- import { DragResizeService } from './drag-resize.service';
13
- import { OFFSET_STYLES, isPresent, isTruthy, hasClasses, WINDOW_CLASSES, parseCSSClassNames, setHTMLAttributes } from '../common/util';
14
- import { RESIZE_DIRECTIONS } from "../common/util";
15
- import { ResizeHandleDirective } from './window-resize-handle.directive';
16
- import { WindowTitleBarComponent } from './window-titlebar.component';
17
- import { NavigationService } from './navigation.service';
18
- /**
19
- * Represents the [Kendo UI Window component for Angular]({% slug overview_window_dialogs %}).
20
- */
21
- var WindowComponent = /** @class */ (function () {
22
- function WindowComponent(el, renderer, service, navigation, ngZone, localization) {
23
- var _this = this;
24
- this.el = el;
25
- this.renderer = renderer;
26
- this.service = service;
27
- this.navigation = navigation;
28
- this.ngZone = ngZone;
29
- this.localization = localization;
30
- /**
31
- * Specifies if the content of the component is persisted in the DOM when minimized.
32
- * @default false
33
- */
34
- this.keepContent = false;
35
- /**
36
- * Fires when the user starts to move the Window.
37
- */
38
- this.dragStart = new EventEmitter();
39
- /**
40
- * Fires when the Window was moved by the user.
41
- */
42
- this.dragEnd = new EventEmitter();
43
- /**
44
- * Fires when the user starts to resize the Window.
45
- */
46
- this.resizeStart = new EventEmitter();
47
- /**
48
- * Fires when the Window was resized by the user.
49
- */
50
- this.resizeEnd = new EventEmitter();
51
- /**
52
- * Fires when the user closes the Window.
53
- */
54
- this.close = new EventEmitter();
55
- /**
56
- * Fires when the `width` property of the component was updated. The event is triggered only after the resizing
57
- * has ended. The event data contains the new width. Allows a two-way binding of the `width` property.
58
- */
59
- this.widthChange = new EventEmitter();
60
- /**
61
- * Fires when the `height` property of the component was updated. The event is triggered only after the resizing
62
- * has ended. The event data contains the new height. Allows a two-way binding of the `height` property.
63
- */
64
- this.heightChange = new EventEmitter();
65
- /**
66
- * Fires when the `top` property of the component was updated. The event is triggered only after the dragging
67
- * and resizing have ended. The event data contains the new top offset. Allows a two-way binding of the `top` property.
68
- */
69
- this.topChange = new EventEmitter();
70
- /**
71
- * Fires when the `left` property of the component was updated. The event is triggered only after the dragging
72
- * and resizing have ended. The event data contains the new left offset. Allows a two-way binding of the `left` property.
73
- */
74
- this.leftChange = new EventEmitter();
75
- /**
76
- * Fires when the `state` property of the component was updated. The event data contains the new state. Allows a
77
- * two-way binding of the `state` property.
78
- */
79
- this.stateChange = new EventEmitter();
80
- /**
81
- * @hidden
82
- */
83
- this.messages = {};
84
- this.tabIndex = 0;
85
- this.draged = false;
86
- this.resized = false;
87
- this.windowSubscription = new Subscription();
88
- this.domSubs = new Subscription();
89
- validatePackage(packageMetadata);
90
- this.direction = this.localization.rtl ? 'rtl' : 'ltr';
91
- this.localizationChangeSubscription = this.localization.changes
92
- .subscribe(function (_a) {
93
- var rtl = _a.rtl;
94
- return _this.direction = rtl ? 'rtl' : 'ltr';
95
- });
96
- this.resizeDirections = RESIZE_DIRECTIONS;
97
- this.subscribeEvents();
98
- }
99
- Object.defineProperty(WindowComponent.prototype, "draggable", {
100
- get: function () {
101
- return this.options.draggable;
102
- },
103
- /**
104
- * Specifies whether the user will be able to drag the component.
105
- * @default true
106
- */
107
- set: function (value) {
108
- this.options.draggable = value;
109
- },
110
- enumerable: true,
111
- configurable: true
112
- });
113
- Object.defineProperty(WindowComponent.prototype, "resizable", {
114
- get: function () {
115
- return this.options.resizable;
116
- },
117
- /**
118
- * Specifies whether the user will be able to resize the component.
119
- * @default true
120
- */
121
- set: function (value) {
122
- this.options.resizable = value;
123
- },
124
- enumerable: true,
125
- configurable: true
126
- });
127
- Object.defineProperty(WindowComponent.prototype, "cssClass", {
128
- get: function () {
129
- return this._cssClass;
130
- },
131
- /**
132
- * @hidden
133
- */
134
- set: function (classes) {
135
- this.setServiceClasses(this._cssClass, classes);
136
- this._cssClass = classes;
137
- },
138
- enumerable: true,
139
- configurable: true
140
- });
141
- Object.defineProperty(WindowComponent.prototype, "htmlAttributes", {
142
- get: function () {
143
- return this._htmlAttributes;
144
- },
145
- /**
146
- * @hidden
147
- */
148
- set: function (attributes) {
149
- setHTMLAttributes(attributes, this.renderer, this.el.nativeElement);
150
- var el = this.el.nativeElement;
151
- var dir = el.getAttribute('dir');
152
- var tIndex = el.getAttribute('tabindex');
153
- if (this.direction !== dir) {
154
- this.direction = dir;
155
- }
156
- if (this.tabIndex !== tIndex) {
157
- this.tabIndex = tIndex;
158
- }
159
- this._htmlAttributes = attributes;
160
- },
161
- enumerable: true,
162
- configurable: true
163
- });
164
- Object.defineProperty(WindowComponent.prototype, "state", {
165
- get: function () {
166
- return this.options.state;
167
- },
168
- /**
169
- * Specifies the initial state of the component.
170
- * If not specified, the value is set to `default`.
171
- *
172
- * The possible values are:
173
- * * `minimized`
174
- * * `maximized`
175
- * * `default`
176
- */
177
- set: function (value) {
178
- this.options.state = value;
179
- },
180
- enumerable: true,
181
- configurable: true
182
- });
183
- Object.defineProperty(WindowComponent.prototype, "minWidth", {
184
- get: function () {
185
- return this.options.minWidth;
186
- },
187
- /**
188
- * Specifies the minimum width of the component.
189
- * The `minWidth` property has to be set in pixels.
190
- * @default 120
191
- */
192
- set: function (value) {
193
- this.setOption('minWidth', value);
194
- },
195
- enumerable: true,
196
- configurable: true
197
- });
198
- Object.defineProperty(WindowComponent.prototype, "minHeight", {
199
- get: function () {
200
- return this.options.minHeight;
201
- },
202
- /**
203
- * Specifies the minimum height of the Window.
204
- * The `minHeight` property has to be set in pixels.
205
- * @default 100
206
- */
207
- set: function (value) {
208
- this.setOption('minHeight', value);
209
- },
210
- enumerable: true,
211
- configurable: true
212
- });
213
- Object.defineProperty(WindowComponent.prototype, "width", {
214
- get: function () {
215
- return this.options.width;
216
- },
217
- /**
218
- * Specifies the width of the Window.
219
- * The `width` property has to be set in pixels.
220
- */
221
- set: function (value) {
222
- this.setOption('width', value);
223
- },
224
- enumerable: true,
225
- configurable: true
226
- });
227
- Object.defineProperty(WindowComponent.prototype, "height", {
228
- get: function () {
229
- return this.options.height;
230
- },
231
- /**
232
- * Specifies the height of the Window.
233
- * The `height` property has to be set in pixels.
234
- */
235
- set: function (value) {
236
- this.setOption('height', value);
237
- },
238
- enumerable: true,
239
- configurable: true
240
- });
241
- Object.defineProperty(WindowComponent.prototype, "top", {
242
- get: function () {
243
- return this.options.top;
244
- },
245
- /**
246
- * Specifies the initial top offset of the Window.
247
- * The `top` property has to be set in pixels.
248
- */
249
- set: function (value) {
250
- this.setOption('top', value);
251
- },
252
- enumerable: true,
253
- configurable: true
254
- });
255
- Object.defineProperty(WindowComponent.prototype, "left", {
256
- get: function () {
257
- return this.options.left;
258
- },
259
- /**
260
- * Specifies the initial left offset of the Window.
261
- * Numeric values are treated as pixels.
262
- */
263
- set: function (value) {
264
- this.setOption('left', value);
265
- },
266
- enumerable: true,
267
- configurable: true
268
- });
269
- Object.defineProperty(WindowComponent.prototype, "closeButtonTitle", {
270
- get: function () {
271
- if (this.messages && this.messages.closeTitle) {
272
- return this.messages.closeTitle;
273
- }
274
- return this.localization.get('closeTitle');
275
- },
276
- enumerable: true,
277
- configurable: true
278
- });
279
- Object.defineProperty(WindowComponent.prototype, "restoreButtonTitle", {
280
- get: function () {
281
- if (this.messages && this.messages.restoreTitle) {
282
- return this.messages.restoreTitle;
283
- }
284
- return this.localization.get('restoreTitle');
285
- },
286
- enumerable: true,
287
- configurable: true
288
- });
289
- Object.defineProperty(WindowComponent.prototype, "maximizeButtonTitle", {
290
- get: function () {
291
- if (this.messages && this.messages.maximizeTitle) {
292
- return this.messages.maximizeTitle;
293
- }
294
- return this.localization.get('maximizeTitle');
295
- },
296
- enumerable: true,
297
- configurable: true
298
- });
299
- Object.defineProperty(WindowComponent.prototype, "minimizeButtonTitle", {
300
- get: function () {
301
- if (this.messages && this.messages.minimizeTitle) {
302
- return this.messages.minimizeTitle;
303
- }
304
- return this.localization.get('minimizeTitle');
305
- },
306
- enumerable: true,
307
- configurable: true
308
- });
309
- Object.defineProperty(WindowComponent.prototype, "hostClasses", {
310
- get: function () {
311
- return true;
312
- },
313
- enumerable: true,
314
- configurable: true
315
- });
316
- Object.defineProperty(WindowComponent.prototype, "dir", {
317
- get: function () {
318
- return this.direction;
319
- },
320
- enumerable: true,
321
- configurable: true
322
- });
323
- WindowComponent.prototype.ngAfterViewInit = function () {
324
- var _this = this;
325
- this.setNextZIndex();
326
- this.handleInitialFocus();
327
- this.ngZone.runOutsideAngular(function () {
328
- return Promise.resolve(null).then(function () { return _this.setInitialOffset(); });
329
- });
330
- this.initDomEvents();
331
- };
332
- WindowComponent.prototype.ngOnInit = function () {
333
- this.renderer.removeAttribute(this.el.nativeElement, 'title');
334
- this.service.init(this.el);
335
- };
336
- WindowComponent.prototype.ngOnChanges = function (changes) {
337
- var _this = this;
338
- OFFSET_STYLES.forEach(function (style) {
339
- if (isChanged(style, changes)) {
340
- _this.setStyle(style, _this.options[style]);
341
- }
342
- });
343
- if (isChanged('draggable', changes)) {
344
- var titleBar = isPresent(this.titleBarContent) ? this.titleBarContent : this.titleBarView;
345
- if (isTruthy(changes.draggable.currentValue)) {
346
- titleBar.subscribeDrag();
347
- }
348
- else {
349
- titleBar.unsubscribeDrag();
350
- }
351
- }
352
- if (isChanged('state', changes)) {
353
- if (isPresent(this.service.lastAction)) {
354
- this.service.lastAction = null;
355
- }
356
- else {
357
- this.service.applyManualState();
358
- this.updateAllOffset();
359
- }
360
- }
361
- };
362
- WindowComponent.prototype.ngOnDestroy = function () {
363
- if (this.windowSubscription) {
364
- this.windowSubscription.unsubscribe();
365
- }
366
- if (this.domSubs) {
367
- this.domSubs.unsubscribe();
368
- }
369
- this.localizationChangeSubscription.unsubscribe();
370
- };
371
- /**
372
- * Focuses the wrapper of the Window component.
373
- */
374
- WindowComponent.prototype.focus = function () {
375
- var wrapper = this.el.nativeElement;
376
- if (isPresent(wrapper)) {
377
- wrapper.focus();
378
- }
379
- };
380
- /**
381
- * Brings the current Window component on top of other Window components on the page.
382
- */
383
- WindowComponent.prototype.bringToFront = function () {
384
- this.setNextZIndex();
385
- };
386
- /**
387
- * Manually updates the `width` or `height` option of the Window.
388
- * The required style will be applied to the Window wrapper element and the
389
- * corresponding property of the component instance will be updated.
390
- * This method is intended to be used for sizing dynamically created components using the
391
- * [`WindowService`]({% slug api_dialog_windowservice %})
392
- * @param {WindowDimensionSetting} dimension - The option that will be updated
393
- * @param {number} value - The value set in pixels
394
- */
395
- WindowComponent.prototype.setDimension = function (dimension, value) {
396
- this.setOption(dimension, value);
397
- this.setStyle(dimension, value);
398
- };
399
- /**
400
- * Manually updates the `top` or `left` offset of the Window.
401
- * The required style will be applied to the Window wrapper element and the
402
- * corresponding property of the component instance will be updated.
403
- * This method is intended to be used for positioning dynamically created components using the
404
- * [`WindowService`]({% slug api_dialog_windowservice %})
405
- * @param {WindowOffsetSetting} offset - The option that will be updated
406
- * @param {number} value - The value set in pixels
407
- */
408
- WindowComponent.prototype.setOffset = function (offset, value) {
409
- this.setOption(offset, value);
410
- this.setStyle(offset, value);
411
- };
412
- Object.defineProperty(WindowComponent.prototype, "showDefaultTitleBar", {
413
- get: function () {
414
- return !isPresent(this.titleBarContent);
415
- },
416
- enumerable: true,
417
- configurable: true
418
- });
419
- Object.defineProperty(WindowComponent.prototype, "styleMinWidth", {
420
- get: function () {
421
- return this.minWidth + 'px';
422
- },
423
- enumerable: true,
424
- configurable: true
425
- });
426
- Object.defineProperty(WindowComponent.prototype, "styleMinHeight", {
427
- get: function () {
428
- return this.minHeight + 'px';
429
- },
430
- enumerable: true,
431
- configurable: true
432
- });
433
- Object.defineProperty(WindowComponent.prototype, "stylePosition", {
434
- get: function () {
435
- return this.options.position;
436
- },
437
- enumerable: true,
438
- configurable: true
439
- });
440
- Object.defineProperty(WindowComponent.prototype, "wrapperMaximizedClass", {
441
- get: function () {
442
- return this.state === 'maximized';
443
- },
444
- enumerable: true,
445
- configurable: true
446
- });
447
- Object.defineProperty(WindowComponent.prototype, "wrapperMinimizedClass", {
448
- get: function () {
449
- return this.state === 'minimized';
450
- },
451
- enumerable: true,
452
- configurable: true
453
- });
454
- /**
455
- * @hidden
456
- */
457
- WindowComponent.prototype.onComponentFocus = function () {
458
- this.renderer.addClass(this.el.nativeElement, 'k-focus');
459
- this.setNextZIndex();
460
- };
461
- /**
462
- * @hidden
463
- */
464
- WindowComponent.prototype.onComponentBlur = function () {
465
- this.renderer.removeClass(this.el.nativeElement, 'k-focus');
466
- };
467
- WindowComponent.prototype.subscribeEvents = function () {
468
- var _this = this;
469
- if (!isDocumentAvailable()) {
470
- return;
471
- }
472
- this.windowSubscription.add(this.service.focus.subscribe(function () {
473
- _this.el.nativeElement.focus();
474
- }));
475
- this.windowSubscription.add(this.service.dragStart.subscribe(function () {
476
- _this.draged = true;
477
- _this.ngZone.run(function () {
478
- _this.dragStart.emit();
479
- });
480
- }));
481
- this.windowSubscription.add(this.service.dragEnd.subscribe(function () {
482
- if (_this.draged) {
483
- _this.draged = false;
484
- _this.ngZone.run(function () {
485
- _this.dragEnd.emit();
486
- });
487
- }
488
- }));
489
- this.windowSubscription.add(this.service.close.subscribe(function () {
490
- _this.close.emit();
491
- }));
492
- this.windowSubscription.add(this.service.resizeStart.subscribe(function () {
493
- _this.resized = true;
494
- _this.ngZone.run(function () {
495
- _this.resizeStart.emit();
496
- });
497
- }));
498
- this.windowSubscription.add(this.service.resizeEnd.subscribe(function () {
499
- if (_this.resized) {
500
- _this.resized = false;
501
- _this.ngZone.run(function () {
502
- _this.resizeEnd.emit();
503
- });
504
- }
505
- }));
506
- this.windowSubscription.add(this.service.change.subscribe(function (ev) {
507
- OFFSET_STYLES.forEach(function (style) {
508
- if (isPresent(ev[style])) {
509
- _this.setStyle(style, ev[style]);
510
- if (_this.state !== 'maximized') {
511
- var emitter_1 = _this[style + 'Change'];
512
- if (emitter_1.observers.length) {
513
- _this.ngZone.run(function () {
514
- emitter_1.emit(ev[style]);
515
- });
516
- }
517
- }
518
- }
519
- });
520
- }));
521
- this.windowSubscription.add(this.service.stateChange.subscribe(function (state) {
522
- if (isPresent(_this.service.lastAction)) {
523
- _this.updateAllOffset();
524
- _this.stateChange.emit(state);
525
- }
526
- }));
527
- };
528
- WindowComponent.prototype.initDomEvents = function () {
529
- var _this = this;
530
- if (!this.el) {
531
- return;
532
- }
533
- this.ngZone.runOutsideAngular(function () {
534
- _this.domSubs.add(_this.renderer.listen(_this.el.nativeElement, 'keydown', function (ev) {
535
- _this.onKeyDown(ev);
536
- }));
537
- });
538
- };
539
- WindowComponent.prototype.onKeyDown = function (event) {
540
- if (hasClasses(event.target, WINDOW_CLASSES)) {
541
- this.navigation.process(event);
542
- }
543
- };
544
- WindowComponent.prototype.setServiceClasses = function (prevValue, value) {
545
- var _this = this;
546
- var el = this.el.nativeElement;
547
- if (prevValue) {
548
- parseCSSClassNames(prevValue).forEach(function (className) {
549
- _this.renderer.removeClass(el, className);
550
- });
551
- }
552
- if (value) {
553
- parseCSSClassNames(value).forEach(function (className) {
554
- _this.renderer.addClass(el, className);
555
- });
556
- }
557
- };
558
- WindowComponent.prototype.setNextZIndex = function () {
559
- var currentZIndex = this.el.nativeElement.style['z-index'];
560
- var nextPossibleZIndex = this.service.nextPossibleZIndex;
561
- if (!currentZIndex || (nextPossibleZIndex - currentZIndex > 1)) {
562
- this.renderer.setStyle(this.el.nativeElement, "z-index", this.service.nextZIndex);
563
- }
564
- };
565
- WindowComponent.prototype.setInitialOffset = function () {
566
- if (this.state !== 'maximized') {
567
- this.updateAllOffset();
568
- if (!isPresent(this.left) || !isPresent(this.top)) {
569
- this.service.center();
570
- }
571
- }
572
- else {
573
- var viewPort = this.service.windowViewPort;
574
- this.setStyle('width', viewPort.width);
575
- this.setStyle('height', viewPort.height);
576
- this.setStyle('top', 0);
577
- this.setStyle('left', 0);
578
- }
579
- };
580
- WindowComponent.prototype.updateAllOffset = function () {
581
- var _this = this;
582
- OFFSET_STYLES.forEach(function (style) {
583
- if (isPresent(_this[style])) {
584
- _this.setStyle(style, _this[style]);
585
- }
586
- else {
587
- _this.removeStyle(style);
588
- }
589
- });
590
- };
591
- WindowComponent.prototype.setStyle = function (style, value) {
592
- this.renderer.setStyle(this.el.nativeElement, style, value + 'px');
593
- };
594
- WindowComponent.prototype.removeStyle = function (style) {
595
- this.renderer.removeStyle(this.el.nativeElement, style);
596
- };
597
- Object.defineProperty(WindowComponent.prototype, "options", {
598
- get: function () {
599
- return this.service.options;
600
- },
601
- enumerable: true,
602
- configurable: true
603
- });
604
- WindowComponent.prototype.setOption = function (style, value) {
605
- if (typeof value !== 'number' && typeof value !== 'string') {
606
- return;
607
- }
608
- var parsedValue = (typeof value === 'number') ? value : parseInt(value, 10);
609
- this.options[style] = parsedValue;
610
- this.service.setRestoreOption(style, parsedValue);
611
- };
612
- WindowComponent.prototype.handleInitialFocus = function () {
613
- var wrapper = this.el.nativeElement;
614
- if (this.autoFocusedElement) {
615
- var initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
616
- if (initiallyFocusedElement) {
617
- initiallyFocusedElement.focus();
618
- }
619
- }
620
- else {
621
- this.focus();
622
- }
623
- };
624
- tslib_1.__decorate([
625
- Input(),
626
- tslib_1.__metadata("design:type", String)
627
- ], WindowComponent.prototype, "autoFocusedElement", void 0);
628
- tslib_1.__decorate([
629
- Input(),
630
- tslib_1.__metadata("design:type", String)
631
- ], WindowComponent.prototype, "title", void 0);
632
- tslib_1.__decorate([
633
- Input(),
634
- tslib_1.__metadata("design:type", Boolean),
635
- tslib_1.__metadata("design:paramtypes", [Boolean])
636
- ], WindowComponent.prototype, "draggable", null);
637
- tslib_1.__decorate([
638
- Input(),
639
- tslib_1.__metadata("design:type", Boolean),
640
- tslib_1.__metadata("design:paramtypes", [Boolean])
641
- ], WindowComponent.prototype, "resizable", null);
642
- tslib_1.__decorate([
643
- Input(),
644
- tslib_1.__metadata("design:type", Boolean)
645
- ], WindowComponent.prototype, "keepContent", void 0);
646
- tslib_1.__decorate([
647
- Input(),
648
- tslib_1.__metadata("design:type", String),
649
- tslib_1.__metadata("design:paramtypes", [String])
650
- ], WindowComponent.prototype, "state", null);
651
- tslib_1.__decorate([
652
- Input(),
653
- tslib_1.__metadata("design:type", Number),
654
- tslib_1.__metadata("design:paramtypes", [Number])
655
- ], WindowComponent.prototype, "minWidth", null);
656
- tslib_1.__decorate([
657
- Input(),
658
- tslib_1.__metadata("design:type", Number),
659
- tslib_1.__metadata("design:paramtypes", [Number])
660
- ], WindowComponent.prototype, "minHeight", null);
661
- tslib_1.__decorate([
662
- Input(),
663
- tslib_1.__metadata("design:type", Number),
664
- tslib_1.__metadata("design:paramtypes", [Number])
665
- ], WindowComponent.prototype, "width", null);
666
- tslib_1.__decorate([
667
- Input(),
668
- tslib_1.__metadata("design:type", Number),
669
- tslib_1.__metadata("design:paramtypes", [Number])
670
- ], WindowComponent.prototype, "height", null);
671
- tslib_1.__decorate([
672
- Input(),
673
- tslib_1.__metadata("design:type", Number),
674
- tslib_1.__metadata("design:paramtypes", [Number])
675
- ], WindowComponent.prototype, "top", null);
676
- tslib_1.__decorate([
677
- Input(),
678
- tslib_1.__metadata("design:type", Number),
679
- tslib_1.__metadata("design:paramtypes", [Number])
680
- ], WindowComponent.prototype, "left", null);
681
- tslib_1.__decorate([
682
- Output(),
683
- tslib_1.__metadata("design:type", EventEmitter)
684
- ], WindowComponent.prototype, "dragStart", void 0);
685
- tslib_1.__decorate([
686
- Output(),
687
- tslib_1.__metadata("design:type", EventEmitter)
688
- ], WindowComponent.prototype, "dragEnd", void 0);
689
- tslib_1.__decorate([
690
- Output(),
691
- tslib_1.__metadata("design:type", EventEmitter)
692
- ], WindowComponent.prototype, "resizeStart", void 0);
693
- tslib_1.__decorate([
694
- Output(),
695
- tslib_1.__metadata("design:type", EventEmitter)
696
- ], WindowComponent.prototype, "resizeEnd", void 0);
697
- tslib_1.__decorate([
698
- Output(),
699
- tslib_1.__metadata("design:type", EventEmitter)
700
- ], WindowComponent.prototype, "close", void 0);
701
- tslib_1.__decorate([
702
- Output(),
703
- tslib_1.__metadata("design:type", EventEmitter)
704
- ], WindowComponent.prototype, "widthChange", void 0);
705
- tslib_1.__decorate([
706
- Output(),
707
- tslib_1.__metadata("design:type", EventEmitter)
708
- ], WindowComponent.prototype, "heightChange", void 0);
709
- tslib_1.__decorate([
710
- Output(),
711
- tslib_1.__metadata("design:type", EventEmitter)
712
- ], WindowComponent.prototype, "topChange", void 0);
713
- tslib_1.__decorate([
714
- Output(),
715
- tslib_1.__metadata("design:type", EventEmitter)
716
- ], WindowComponent.prototype, "leftChange", void 0);
717
- tslib_1.__decorate([
718
- Output(),
719
- tslib_1.__metadata("design:type", EventEmitter)
720
- ], WindowComponent.prototype, "stateChange", void 0);
721
- tslib_1.__decorate([
722
- HostBinding('attr.tabIndex'),
723
- tslib_1.__metadata("design:type", Number)
724
- ], WindowComponent.prototype, "tabIndex", void 0);
725
- tslib_1.__decorate([
726
- HostBinding('class.k-window'),
727
- tslib_1.__metadata("design:type", Boolean),
728
- tslib_1.__metadata("design:paramtypes", [])
729
- ], WindowComponent.prototype, "hostClasses", null);
730
- tslib_1.__decorate([
731
- HostBinding('attr.dir'),
732
- tslib_1.__metadata("design:type", String),
733
- tslib_1.__metadata("design:paramtypes", [])
734
- ], WindowComponent.prototype, "dir", null);
735
- tslib_1.__decorate([
736
- ViewChild(WindowTitleBarComponent, { static: false }),
737
- tslib_1.__metadata("design:type", WindowTitleBarComponent)
738
- ], WindowComponent.prototype, "titleBarView", void 0);
739
- tslib_1.__decorate([
740
- ContentChild(WindowTitleBarComponent, { static: false }),
741
- tslib_1.__metadata("design:type", WindowTitleBarComponent)
742
- ], WindowComponent.prototype, "titleBarContent", void 0);
743
- tslib_1.__decorate([
744
- ViewChildren(ResizeHandleDirective),
745
- tslib_1.__metadata("design:type", QueryList)
746
- ], WindowComponent.prototype, "resizeHandles", void 0);
747
- tslib_1.__decorate([
748
- HostBinding('style.minWidth'),
749
- tslib_1.__metadata("design:type", String),
750
- tslib_1.__metadata("design:paramtypes", [])
751
- ], WindowComponent.prototype, "styleMinWidth", null);
752
- tslib_1.__decorate([
753
- HostBinding('style.minHeight'),
754
- tslib_1.__metadata("design:type", String),
755
- tslib_1.__metadata("design:paramtypes", [])
756
- ], WindowComponent.prototype, "styleMinHeight", null);
757
- tslib_1.__decorate([
758
- HostBinding('style.position'),
759
- tslib_1.__metadata("design:type", String),
760
- tslib_1.__metadata("design:paramtypes", [])
761
- ], WindowComponent.prototype, "stylePosition", null);
762
- tslib_1.__decorate([
763
- HostBinding('class.k-window-maximized'),
764
- tslib_1.__metadata("design:type", Boolean),
765
- tslib_1.__metadata("design:paramtypes", [])
766
- ], WindowComponent.prototype, "wrapperMaximizedClass", null);
767
- tslib_1.__decorate([
768
- HostBinding('class.k-window-minimized'),
769
- tslib_1.__metadata("design:type", Boolean),
770
- tslib_1.__metadata("design:paramtypes", [])
771
- ], WindowComponent.prototype, "wrapperMinimizedClass", null);
772
- tslib_1.__decorate([
773
- HostListener('focus'),
774
- tslib_1.__metadata("design:type", Function),
775
- tslib_1.__metadata("design:paramtypes", []),
776
- tslib_1.__metadata("design:returntype", void 0)
777
- ], WindowComponent.prototype, "onComponentFocus", null);
778
- tslib_1.__decorate([
779
- HostListener('blur'),
780
- tslib_1.__metadata("design:type", Function),
781
- tslib_1.__metadata("design:paramtypes", []),
782
- tslib_1.__metadata("design:returntype", void 0)
783
- ], WindowComponent.prototype, "onComponentBlur", null);
784
- WindowComponent = tslib_1.__decorate([
785
- Component({
786
- exportAs: 'kendoWindow',
787
- providers: [
788
- DragResizeService,
789
- NavigationService,
790
- LocalizationService,
791
- {
792
- provide: L10N_PREFIX,
793
- useValue: 'kendo.window'
794
- }
795
- ],
796
- selector: 'kendo-window',
797
- template: "\n <ng-container kendoWindowLocalizedMessages\n i18n-closeTitle=\"kendo.window.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n\n i18n-restoreTitle=\"kendo.window.restoreTitle|The title of the restore button\"\n restoreTitle=\"Restore\"\n\n i18n-maximizeTitle=\"kendo.window.maximizeTitle|The title of the maximize button\"\n maximizeTitle=\"Maximize\"\n\n i18n-minimizeTitle=\"kendo.window.minimizeTitle|The title of the minimize button\"\n minimizeTitle=\"Minimize\"\n >\n <ng-container>\n\n <kendo-window-titlebar *ngIf=\"showDefaultTitleBar\" [template]=\"titleBarTemplate\">\n <div class=\"k-window-title\">{{ title }}</div>\n <div class=\"k-window-actions\">\n <button kendoWindowMinimizeAction [attr.title]=\"minimizeButtonTitle\" [attr.aria-label]=\"minimizeButtonTitle\"></button>\n <button kendoWindowMaximizeAction [attr.title]=\"maximizeButtonTitle\" [attr.aria-label]=\"maximizeButtonTitle\"></button>\n <button kendoWindowRestoreAction [attr.title]=\"restoreButtonTitle\" [attr.aria-label]=\"restoreButtonTitle\"></button>\n <button kendoWindowCloseAction [attr.title]=\"closeButtonTitle\" [attr.aria-label]=\"closeButtonTitle\"></button>\n </div>\n </kendo-window-titlebar>\n <ng-content select=\"kendo-window-titlebar\" *ngIf=\"!showDefaultTitleBar\"></ng-content>\n\n <div *ngIf=\"state !== 'minimized' || keepContent\"\n [hidden]=\"state === 'minimized' && keepContent\"\n class=\"k-content k-window-content\"\n >\n <ng-content *ngIf=\"!contentTemplate\"></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" *ngIf=\"contentTemplate\"></ng-template>\n </div>\n\n <ng-template [ngIf]='resizable'>\n <div *ngFor='let dir of resizeDirections'\n [direction]=\"dir\"\n kendoWindowResizeHandle\n kendoDraggable>\n </div>\n </ng-template>\n "
798
- }),
799
- tslib_1.__metadata("design:paramtypes", [ElementRef,
800
- Renderer2,
801
- DragResizeService,
802
- NavigationService,
803
- NgZone,
804
- LocalizationService])
805
- ], WindowComponent);
806
- return WindowComponent;
807
- }());
808
- export { WindowComponent };