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

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 +21 -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 +29 -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 +30 -13
  68. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-dialog.js} +1026 -922
  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 +35 -106
  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,46 +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
- /**
6
- * The settings for the Dialog actions when the Dialog is opened through `DialogService`
7
- * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
8
- */
9
- var DialogAction = /** @class */ (function () {
10
- function DialogAction() {
11
- }
12
- return DialogAction;
13
- }());
14
- export { DialogAction };
15
- /**
16
- * Indicates that the **Close** button is clicked. Used when the results from
17
- * the Dialogs that are opened through `DialogService` are filtered
18
- * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
19
- */
20
- var DialogCloseResult = /** @class */ (function () {
21
- function DialogCloseResult() {
22
- }
23
- return DialogCloseResult;
24
- }());
25
- export { DialogCloseResult };
26
- /**
27
- * The settings that can be used when the Dialog is opened through `DialogService`.
28
- * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
29
- */
30
- var DialogSettings = /** @class */ (function () {
31
- function DialogSettings() {
32
- }
33
- return DialogSettings;
34
- }());
35
- export { DialogSettings };
36
- /**
37
- * Holds references to the object instance and published events of the Dialog.
38
- * Controls the Dialogs that were opened through the `DialogService`
39
- * ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
40
- */
41
- var DialogRef = /** @class */ (function () {
42
- function DialogRef() {
43
- }
44
- return DialogRef;
45
- }());
46
- export { DialogRef };
@@ -1,94 +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, EventEmitter, HostBinding, Output, Input, ElementRef, Optional, NgZone } from '@angular/core';
7
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { take } from 'rxjs/operators';
9
- import { PreventableEvent } from '../common/preventable-event';
10
- import { TitleBarLocalizationService } from '../localization/titlebar-localization.service';
11
- /**
12
- * Represents the [Kendo UI DialogTitleBar component for Angular]({% slug api_dialog_dialogtitlebarcomponent %}).
13
- *
14
- * It is used as part of the Dialog content when the component is created dynamically by using an [Angular service]({% slug service_dialog %}).
15
- */
16
- var DialogTitleBarComponent = /** @class */ (function () {
17
- function DialogTitleBarComponent(zone, hostElement, localizationService) {
18
- this.zone = zone;
19
- this.hostElement = hostElement;
20
- this.localizationService = localizationService;
21
- /**
22
- * Fires when the close button of the title-bar is clicked.
23
- */
24
- this.close = new EventEmitter();
25
- }
26
- Object.defineProperty(DialogTitleBarComponent.prototype, "className", {
27
- get: function () {
28
- return true;
29
- },
30
- enumerable: true,
31
- configurable: true
32
- });
33
- Object.defineProperty(DialogTitleBarComponent.prototype, "closeButtonTitle", {
34
- get: function () {
35
- return this.closeTitle || this.localizationService.get('closeTitle');
36
- },
37
- enumerable: true,
38
- configurable: true
39
- });
40
- DialogTitleBarComponent.prototype.ngAfterViewInit = function () {
41
- var _this = this;
42
- this.zone.onStable.pipe(take(1)).subscribe(function () {
43
- var element = _this.hostElement.nativeElement.querySelector('.k-dialog-title');
44
- element.setAttribute('id', _this.id);
45
- });
46
- };
47
- /**
48
- * @hidden
49
- */
50
- DialogTitleBarComponent.prototype.onCloseClick = function (e) {
51
- e.preventDefault();
52
- var eventArgs = new PreventableEvent();
53
- this.close.emit(eventArgs);
54
- };
55
- tslib_1.__decorate([
56
- Output(),
57
- tslib_1.__metadata("design:type", EventEmitter)
58
- ], DialogTitleBarComponent.prototype, "close", void 0);
59
- tslib_1.__decorate([
60
- Input(),
61
- tslib_1.__metadata("design:type", String)
62
- ], DialogTitleBarComponent.prototype, "id", void 0);
63
- tslib_1.__decorate([
64
- Input(),
65
- tslib_1.__metadata("design:type", String)
66
- ], DialogTitleBarComponent.prototype, "closeTitle", void 0);
67
- tslib_1.__decorate([
68
- HostBinding('class.k-window-titlebar'),
69
- HostBinding('class.k-dialog-titlebar'),
70
- tslib_1.__metadata("design:type", Boolean),
71
- tslib_1.__metadata("design:paramtypes", [])
72
- ], DialogTitleBarComponent.prototype, "className", null);
73
- DialogTitleBarComponent = tslib_1.__decorate([
74
- Component({
75
- selector: 'kendo-dialog-titlebar',
76
- providers: [
77
- TitleBarLocalizationService,
78
- {
79
- provide: LocalizationService,
80
- useExisting: TitleBarLocalizationService
81
- },
82
- {
83
- provide: L10N_PREFIX,
84
- useValue: 'kendo.dialog'
85
- }
86
- ],
87
- template: "\n <ng-container\n kendoDialogTitleBarLocalizedMessages\n i18n-closeTitle=\"kendo.dialog.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n >\n <div class=\"k-window-title k-dialog-title\">\n <ng-content></ng-content>\n </div>\n\n <div class=\"k-window-actions k-dialog-actions\">\n <button\n role=\"button\"\n [attr.title]=\"closeButtonTitle\"\n [attr.aria-label]=\"closeButtonTitle\"\n class=\"k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-window-action k-dialog-action k-dialog-close\"\n (click)=\"onCloseClick($event)\"\n >\n <span class=\"k-button-icon k-icon k-i-x\"></span>\n </button>\n </div>\n </ng-container>\n "
88
- }),
89
- tslib_1.__param(2, Optional()),
90
- tslib_1.__metadata("design:paramtypes", [NgZone, ElementRef, LocalizationService])
91
- ], DialogTitleBarComponent);
92
- return DialogTitleBarComponent;
93
- }());
94
- export { DialogTitleBarComponent };
@@ -1,462 +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, EventEmitter, HostBinding, Input, ViewChild, Output, ElementRef, Renderer2, ChangeDetectorRef, NgZone, ContentChildren, QueryList, ViewChildren } from '@angular/core';
7
- import { animate, state, style, transition, trigger } from '@angular/animations';
8
- import { DialogActionsComponent } from './dialog-actions.component';
9
- import { DialogTitleBarComponent } from './dialog-titlebar.component';
10
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
11
- import { validatePackage } from '@progress/kendo-licensing';
12
- import { packageMetadata } from '../package-metadata';
13
- import { hasClasses, Keys, isPresent, focusableSelector, isFocusable, DIALOG_ELEMENTS_HANDLING_ARROWS, DIALOG_ELEMENTS_HANDLING_ESC_KEY, createValueWithUnit, setHTMLAttributes, parseCSSClassNames, findPrimaryButton } from '../common/util';
14
- import { DialogCloseResult } from './dialog-settings';
15
- import { DIALOG_LOCALIZATION_SERVICE } from './../localization/dialog-localization.service';
16
- import { take } from 'rxjs/operators';
17
- import { Subscription } from 'rxjs';
18
- /**
19
- * Represents the [Kendo UI Dialog component for Angular]({% slug overview_dialog_dialogs %}).
20
- */
21
- var DialogComponent = /** @class */ (function () {
22
- function DialogComponent(wrapper, renderer, localization, cdr, ngZone) {
23
- var _this = this;
24
- this.wrapper = wrapper;
25
- this.renderer = renderer;
26
- this.cdr = cdr;
27
- this.ngZone = ngZone;
28
- /**
29
- * Specifies the layout of the action buttons in the Dialog.
30
- * This option is only applicable if the action buttons are specified through the `actions` options.
31
- *
32
- * @default 'stretched'
33
- */
34
- this.actionsLayout = 'stretched';
35
- /**
36
- * @hidden
37
- */
38
- this.titleId = null;
39
- /**
40
- * @hidden
41
- */
42
- this.contentId = null;
43
- /**
44
- * Fires when the user clicks an action button of the Dialog.
45
- * The event is fired only when the action buttons are specified through the `actions` options.
46
- */
47
- this.action = new EventEmitter();
48
- /**
49
- * Fires when the user clicks the **Close** button of the Dialog or the **ESC** key.
50
- */
51
- this.close = new EventEmitter();
52
- this.tabIndex = 0;
53
- this.subscriptions = [];
54
- this.domSubs = new Subscription();
55
- validatePackage(packageMetadata);
56
- this.direction = localization.rtl ? 'rtl' : 'ltr';
57
- this.subscriptions.push(localization.changes.subscribe(function (_a) {
58
- var rtl = _a.rtl;
59
- return (_this.direction = rtl ? 'rtl' : 'ltr');
60
- }));
61
- this.titleId = this.generateTitleId();
62
- this.contentId = this.generateContentId();
63
- }
64
- Object.defineProperty(DialogComponent.prototype, "htmlAttributes", {
65
- get: function () {
66
- return this._htmlAttributes;
67
- },
68
- /**
69
- * @hidden
70
- */
71
- set: function (attributes) {
72
- setHTMLAttributes(attributes, this.renderer, this.wrapper.nativeElement);
73
- var el = this.wrapper.nativeElement;
74
- var dir = el.getAttribute('dir');
75
- var tIndex = el.getAttribute('tabindex');
76
- if (this.direction !== dir && dir) {
77
- this.direction = dir;
78
- }
79
- if (this.tabIndex !== tIndex && tIndex) {
80
- this.tabIndex = tIndex;
81
- }
82
- this._htmlAttributes = attributes;
83
- },
84
- enumerable: true,
85
- configurable: true
86
- });
87
- Object.defineProperty(DialogComponent.prototype, "cssClass", {
88
- get: function () {
89
- return this._cssClass;
90
- },
91
- /**
92
- * @hidden
93
- */
94
- set: function (classes) {
95
- this.setServiceClasses(this._cssClass, classes);
96
- this._cssClass = classes;
97
- },
98
- enumerable: true,
99
- configurable: true
100
- });
101
- Object.defineProperty(DialogComponent.prototype, "dir", {
102
- get: function () {
103
- return this.direction;
104
- },
105
- enumerable: true,
106
- configurable: true
107
- });
108
- DialogComponent.prototype.ngAfterContentInit = function () {
109
- var _this = this;
110
- this.bubble('close', this.titlebarContent.first);
111
- this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-describedby', this.contentId);
112
- if (this.titlebarContent.first) {
113
- this.titlebarContent.first.id = this.titleId;
114
- }
115
- else {
116
- this.subscriptions.push(this.titlebarContent.changes.subscribe(function () {
117
- if (isPresent(_this.titlebarContent.first)) {
118
- _this.titlebarContent.first.id = _this.titleId;
119
- _this.ngZone.onStable.pipe(take(1)).subscribe(function () {
120
- _this.bubble('close', _this.titlebarContent.first);
121
- _this.renderer.setAttribute(_this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', _this.titleId);
122
- });
123
- }
124
- }));
125
- }
126
- };
127
- DialogComponent.prototype.ngAfterViewInit = function () {
128
- var _this = this;
129
- this.handleInitialFocus();
130
- this.bubble('close', this.titlebarView.first);
131
- this.bubble('action', this.actionsView);
132
- if (this.titlebarView.first || this.titlebarContent.first) {
133
- //Needed for Dialogs created via service
134
- this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
135
- }
136
- else {
137
- this.subscriptions.push(this.titlebarView.changes.subscribe(function () {
138
- if (isPresent(_this.titlebarView.first)) {
139
- _this.titlebarView.first.id = _this.titleId;
140
- _this.ngZone.onStable.pipe(take(1)).subscribe(function () {
141
- _this.bubble('close', _this.titlebarView.first);
142
- _this.renderer.setAttribute(_this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', _this.titleId);
143
- });
144
- }
145
- }));
146
- }
147
- this.initDomEvents();
148
- };
149
- DialogComponent.prototype.ngOnInit = function () {
150
- this.renderer.removeAttribute(this.wrapper.nativeElement, 'title');
151
- this.cdr.detectChanges();
152
- };
153
- DialogComponent.prototype.ngOnDestroy = function () {
154
- this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
155
- this.subscriptions = [];
156
- if (this.domSubs) {
157
- this.domSubs.unsubscribe();
158
- }
159
- };
160
- /**
161
- * Focuses the wrapper of the Dialog component.
162
- */
163
- DialogComponent.prototype.focus = function () {
164
- var wrapper = this.wrapper.nativeElement;
165
- if (isPresent(wrapper)) {
166
- wrapper.focus();
167
- }
168
- };
169
- DialogComponent.prototype.initDomEvents = function () {
170
- var _this = this;
171
- if (!this.wrapper) {
172
- return;
173
- }
174
- this.ngZone.runOutsideAngular(function () {
175
- _this.domSubs.add(_this.renderer.listen(_this.wrapper.nativeElement, 'keydown', function (ev) {
176
- _this.onKeyDown(ev);
177
- }));
178
- });
179
- };
180
- DialogComponent.prototype.onKeyDown = function (event) {
181
- var _this = this;
182
- var target = event.target;
183
- var parent = target.parentElement;
184
- if (hasClasses(target, DIALOG_ELEMENTS_HANDLING_ESC_KEY) || hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ESC_KEY)) {
185
- if (event.keyCode === Keys.esc) {
186
- this.ngZone.run(function () {
187
- _this.close.emit(new DialogCloseResult());
188
- });
189
- }
190
- }
191
- if (hasClasses(target, 'k-button') && hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ARROWS) &&
192
- (event.keyCode === Keys.left || event.keyCode === Keys.right)) {
193
- this.ngZone.run(function () {
194
- _this.handleActionButtonFocus(parent, event.keyCode);
195
- });
196
- }
197
- if (event.keyCode === Keys.tab) {
198
- this.ngZone.run(function () {
199
- _this.keepFocusWithinComponent(target, event);
200
- });
201
- }
202
- };
203
- DialogComponent.prototype.setServiceClasses = function (prevValue, value) {
204
- var _this = this;
205
- var el = this.wrapper.nativeElement;
206
- if (prevValue) {
207
- parseCSSClassNames(prevValue).forEach(function (className) {
208
- _this.renderer.removeClass(el, className);
209
- });
210
- }
211
- if (value) {
212
- parseCSSClassNames(value).forEach(function (className) {
213
- _this.renderer.addClass(el, className);
214
- });
215
- }
216
- };
217
- /**
218
- * @hidden
219
- */
220
- DialogComponent.prototype.handleInitialFocus = function () {
221
- var wrapper = this.wrapper.nativeElement;
222
- var primaryButton = this.findPrimary(wrapper);
223
- if (this.autoFocusedElement) {
224
- var initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
225
- if (initiallyFocusedElement) {
226
- initiallyFocusedElement.focus();
227
- }
228
- }
229
- else if (this.shouldFocusPrimary(primaryButton)) {
230
- primaryButton.focus();
231
- }
232
- else {
233
- wrapper.focus();
234
- }
235
- };
236
- /**
237
- * @hidden
238
- */
239
- DialogComponent.prototype.findPrimary = function (wrapper) {
240
- var actionBtns = wrapper.querySelectorAll('.k-actions .k-button');
241
- return findPrimaryButton(actionBtns);
242
- };
243
- /**
244
- * @hidden
245
- */
246
- DialogComponent.prototype.handleActionButtonFocus = function (parent, key) {
247
- var focusableActionButtons = this.getAllFocusableChildren(parent);
248
- for (var i = 0; i < focusableActionButtons.length; i++) {
249
- var current = focusableActionButtons[i];
250
- if (current === document.activeElement) {
251
- if (key === Keys.left && i > 0) {
252
- focusableActionButtons[i - 1].focus();
253
- break;
254
- }
255
- if (key === Keys.right && i < focusableActionButtons.length - 1) {
256
- focusableActionButtons[i + 1].focus();
257
- break;
258
- }
259
- }
260
- }
261
- };
262
- /**
263
- * @hidden
264
- */
265
- DialogComponent.prototype.keepFocusWithinComponent = function (target, event) {
266
- var wrapper = this.wrapper.nativeElement;
267
- var _a = this.getFirstAndLastFocusable(wrapper), firstFocusable = _a[0], lastFocusable = _a[1];
268
- var tabAfterLastFocusable = !event.shiftKey && target === lastFocusable;
269
- var shiftTabAfterFirstFocusable = event.shiftKey && target === firstFocusable;
270
- if (tabAfterLastFocusable) {
271
- event.preventDefault();
272
- firstFocusable.focus();
273
- }
274
- if (shiftTabAfterFirstFocusable) {
275
- event.preventDefault();
276
- lastFocusable.focus();
277
- }
278
- };
279
- /**
280
- * @hidden
281
- */
282
- DialogComponent.prototype.shouldFocusPrimary = function (el) {
283
- return isPresent(el) && isFocusable(el);
284
- };
285
- /**
286
- * @hidden
287
- */
288
- DialogComponent.prototype.getAllFocusableChildren = function (parent) {
289
- return parent.querySelectorAll(focusableSelector);
290
- };
291
- /**
292
- * @hidden
293
- */
294
- DialogComponent.prototype.getFirstAndLastFocusable = function (parent) {
295
- var all = this.getAllFocusableChildren(parent);
296
- var firstFocusable = all.length > 0 ? all[0] : parent;
297
- var lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
298
- return [firstFocusable, lastFocusable];
299
- };
300
- /**
301
- * @hidden
302
- */
303
- DialogComponent.prototype.generateTitleId = function () {
304
- return 'kendo-dialog-title-' + Math.ceil(Math.random() * 1000000).toString();
305
- };
306
- /**
307
- * @hidden
308
- */
309
- DialogComponent.prototype.generateContentId = function () {
310
- return 'kendo-dialog-content-' + Math.ceil(Math.random() * 1000000).toString();
311
- };
312
- Object.defineProperty(DialogComponent.prototype, "wrapperClass", {
313
- get: function () {
314
- return true;
315
- },
316
- enumerable: true,
317
- configurable: true
318
- });
319
- Object.defineProperty(DialogComponent.prototype, "styles", {
320
- get: function () {
321
- var styles = {};
322
- if (this.width) {
323
- styles.width = createValueWithUnit(this.width);
324
- }
325
- if (this.height) {
326
- styles.height = createValueWithUnit(this.height);
327
- }
328
- if (this.minWidth) {
329
- styles.minWidth = createValueWithUnit(this.minWidth);
330
- }
331
- if (this.maxWidth) {
332
- styles.maxWidth = createValueWithUnit(this.maxWidth);
333
- }
334
- if (this.minHeight) {
335
- styles.minHeight = createValueWithUnit(this.minHeight);
336
- }
337
- if (this.maxHeight) {
338
- styles.maxHeight = createValueWithUnit(this.maxHeight);
339
- }
340
- return styles;
341
- },
342
- enumerable: true,
343
- configurable: true
344
- });
345
- DialogComponent.prototype.bubble = function (eventName, component) {
346
- var _this = this;
347
- if (component) {
348
- var emit = function (e) { return _this[eventName].emit(e); };
349
- var s = component[eventName].subscribe(emit);
350
- this.subscriptions.push(s);
351
- }
352
- };
353
- tslib_1.__decorate([
354
- Input(),
355
- tslib_1.__metadata("design:type", Array)
356
- ], DialogComponent.prototype, "actions", void 0);
357
- tslib_1.__decorate([
358
- Input(),
359
- tslib_1.__metadata("design:type", String)
360
- ], DialogComponent.prototype, "actionsLayout", void 0);
361
- tslib_1.__decorate([
362
- Input(),
363
- tslib_1.__metadata("design:type", String)
364
- ], DialogComponent.prototype, "autoFocusedElement", void 0);
365
- tslib_1.__decorate([
366
- Input(),
367
- tslib_1.__metadata("design:type", String)
368
- ], DialogComponent.prototype, "title", void 0);
369
- tslib_1.__decorate([
370
- Input(),
371
- tslib_1.__metadata("design:type", Object)
372
- ], DialogComponent.prototype, "width", void 0);
373
- tslib_1.__decorate([
374
- Input(),
375
- tslib_1.__metadata("design:type", Object)
376
- ], DialogComponent.prototype, "minWidth", void 0);
377
- tslib_1.__decorate([
378
- Input(),
379
- tslib_1.__metadata("design:type", Object)
380
- ], DialogComponent.prototype, "maxWidth", void 0);
381
- tslib_1.__decorate([
382
- Input(),
383
- tslib_1.__metadata("design:type", Object)
384
- ], DialogComponent.prototype, "height", void 0);
385
- tslib_1.__decorate([
386
- Input(),
387
- tslib_1.__metadata("design:type", Object)
388
- ], DialogComponent.prototype, "minHeight", void 0);
389
- tslib_1.__decorate([
390
- Input(),
391
- tslib_1.__metadata("design:type", Object)
392
- ], DialogComponent.prototype, "maxHeight", void 0);
393
- tslib_1.__decorate([
394
- Output(),
395
- tslib_1.__metadata("design:type", EventEmitter)
396
- ], DialogComponent.prototype, "action", void 0);
397
- tslib_1.__decorate([
398
- Output(),
399
- tslib_1.__metadata("design:type", EventEmitter)
400
- ], DialogComponent.prototype, "close", void 0);
401
- tslib_1.__decorate([
402
- HostBinding('attr.dir'),
403
- tslib_1.__metadata("design:type", String),
404
- tslib_1.__metadata("design:paramtypes", [])
405
- ], DialogComponent.prototype, "dir", null);
406
- tslib_1.__decorate([
407
- HostBinding('attr.tabIndex'),
408
- tslib_1.__metadata("design:type", Number)
409
- ], DialogComponent.prototype, "tabIndex", void 0);
410
- tslib_1.__decorate([
411
- ContentChildren(DialogTitleBarComponent, { descendants: false }),
412
- tslib_1.__metadata("design:type", QueryList)
413
- ], DialogComponent.prototype, "titlebarContent", void 0);
414
- tslib_1.__decorate([
415
- ViewChildren(DialogTitleBarComponent),
416
- tslib_1.__metadata("design:type", QueryList)
417
- ], DialogComponent.prototype, "titlebarView", void 0);
418
- tslib_1.__decorate([
419
- ViewChild(DialogActionsComponent, { static: false }),
420
- tslib_1.__metadata("design:type", DialogActionsComponent)
421
- ], DialogComponent.prototype, "actionsView", void 0);
422
- tslib_1.__decorate([
423
- HostBinding('class.k-dialog-wrapper'),
424
- tslib_1.__metadata("design:type", Boolean),
425
- tslib_1.__metadata("design:paramtypes", [])
426
- ], DialogComponent.prototype, "wrapperClass", null);
427
- DialogComponent = tslib_1.__decorate([
428
- Component({
429
- animations: [
430
- trigger('overlayAppear', [
431
- state('in', style({ opacity: 1 })),
432
- transition('void => *', [style({ opacity: 0.1 }), animate('.3s cubic-bezier(.2, .6, .4, 1)')])
433
- ]),
434
- trigger('dialogSlideInAppear', [
435
- state('in', style({ transform: 'translate(0, 0)' })),
436
- transition('void => *', [style({ transform: 'translate(0, -10%)' }), animate('.3s cubic-bezier(.2, 1, .2, 1)')])
437
- ])
438
- ],
439
- exportAs: 'kendoDialog',
440
- providers: [
441
- LocalizationService,
442
- {
443
- provide: DIALOG_LOCALIZATION_SERVICE,
444
- useExisting: LocalizationService
445
- },
446
- {
447
- provide: L10N_PREFIX,
448
- useValue: 'kendo.dialog'
449
- }
450
- ],
451
- selector: 'kendo-dialog',
452
- template: "\n <ng-container\n kendoDialogLocalizedMessages\n i18n-closeTitle=\"kendo.dialog.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n >\n <div class=\"k-overlay\" @overlayAppear></div>\n\n <div class=\"k-window k-dialog\" role=\"dialog\" aria-modal=\"true\" [ngStyle]=\"styles\" @dialogSlideInAppear>\n <kendo-dialog-titlebar *ngIf=\"title\" [closeTitle]=\"closeTitle\" [id]=\"titleId\">{{ title }}</kendo-dialog-titlebar>\n <ng-content select=\"kendo-dialog-titlebar\" *ngIf=\"!title\"></ng-content>\n\n <div [id]=\"contentId\" class=\"k-content k-window-content k-dialog-content\">\n <ng-content *ngIf=\"!contentTemplate\"></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" *ngIf=\"contentTemplate\"></ng-template>\n </div>\n\n <ng-content select=\"kendo-dialog-actions\" *ngIf=\"!actions\"></ng-content>\n <kendo-dialog-actions *ngIf=\"actions\" [actions]=\"actions\" [layout]=\"actionsLayout\"> </kendo-dialog-actions>\n </div>\n </ng-container>\n "
453
- }),
454
- tslib_1.__metadata("design:paramtypes", [ElementRef,
455
- Renderer2,
456
- LocalizationService,
457
- ChangeDetectorRef,
458
- NgZone])
459
- ], DialogComponent);
460
- return DialogComponent;
461
- }());
462
- export { DialogComponent };