@progress/kendo-angular-dialog 6.0.3-dev.202203091004 → 7.0.0-next.202203171702

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