@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,75 +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 { Directive, ElementRef, HostBinding, HostListener, Input, Optional, NgZone, Renderer2 } from "@angular/core";
7
- import { DragResizeService } from './../drag-resize.service';
8
- import { Button } from '@progress/kendo-angular-buttons';
9
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
10
- var WindowMinimizeActionDirective = /** @class */ (function (_super) {
11
- tslib_1.__extends(WindowMinimizeActionDirective, _super);
12
- function WindowMinimizeActionDirective(el, renderer, _service, localization, ngZone) {
13
- var _this = _super.call(this, el, renderer, null, localization, ngZone) || this;
14
- _this.buttonType = 'button';
15
- _this.window = _service;
16
- _this.fillMode = 'flat';
17
- _this.icon = 'window-minimize';
18
- return _this;
19
- }
20
- /**
21
- * @hidden
22
- */
23
- WindowMinimizeActionDirective.prototype.onClick = function () {
24
- if (!this.isDisabled) {
25
- this.window.minimizeAction();
26
- }
27
- };
28
- Object.defineProperty(WindowMinimizeActionDirective.prototype, "visible", {
29
- get: function () {
30
- return this.window.options.state === 'default' ? 'inline-flex' : 'none';
31
- },
32
- enumerable: true,
33
- configurable: true
34
- });
35
- tslib_1.__decorate([
36
- Input(),
37
- tslib_1.__metadata("design:type", Object)
38
- ], WindowMinimizeActionDirective.prototype, "window", void 0);
39
- tslib_1.__decorate([
40
- HostBinding('attr.type'),
41
- tslib_1.__metadata("design:type", String)
42
- ], WindowMinimizeActionDirective.prototype, "buttonType", void 0);
43
- tslib_1.__decorate([
44
- HostListener('click'),
45
- tslib_1.__metadata("design:type", Function),
46
- tslib_1.__metadata("design:paramtypes", []),
47
- tslib_1.__metadata("design:returntype", void 0)
48
- ], WindowMinimizeActionDirective.prototype, "onClick", null);
49
- tslib_1.__decorate([
50
- HostBinding('style.display'),
51
- tslib_1.__metadata("design:type", String),
52
- tslib_1.__metadata("design:paramtypes", [])
53
- ], WindowMinimizeActionDirective.prototype, "visible", null);
54
- WindowMinimizeActionDirective = tslib_1.__decorate([
55
- Directive({
56
- exportAs: 'kendoWindowMinimizeAction',
57
- providers: [
58
- LocalizationService,
59
- {
60
- provide: L10N_PREFIX,
61
- useValue: 'kendo.button'
62
- }
63
- ],
64
- selector: 'button[kendoWindowMinimizeAction]' // tslint:disable-line
65
- }),
66
- tslib_1.__param(2, Optional()),
67
- tslib_1.__metadata("design:paramtypes", [ElementRef,
68
- Renderer2,
69
- DragResizeService,
70
- LocalizationService,
71
- NgZone])
72
- ], WindowMinimizeActionDirective);
73
- return WindowMinimizeActionDirective;
74
- }(Button));
75
- export { WindowMinimizeActionDirective };
@@ -1,75 +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 { Directive, ElementRef, HostBinding, HostListener, Input, Optional, NgZone, Renderer2 } from "@angular/core";
7
- import { DragResizeService } from './../drag-resize.service';
8
- import { Button } from '@progress/kendo-angular-buttons';
9
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
10
- var WindowRestoreActionDirective = /** @class */ (function (_super) {
11
- tslib_1.__extends(WindowRestoreActionDirective, _super);
12
- function WindowRestoreActionDirective(el, renderer, _service, localization, ngZone) {
13
- var _this = _super.call(this, el, renderer, null, localization, ngZone) || this;
14
- _this.buttonType = 'button';
15
- _this.window = _service;
16
- _this.fillMode = 'flat';
17
- _this.icon = 'window-restore';
18
- return _this;
19
- }
20
- /**
21
- * @hidden
22
- */
23
- WindowRestoreActionDirective.prototype.onClick = function () {
24
- if (!this.isDisabled) {
25
- this.window.restoreAction();
26
- }
27
- };
28
- Object.defineProperty(WindowRestoreActionDirective.prototype, "visible", {
29
- get: function () {
30
- return this.window.options.state === 'default' ? 'none' : 'inline-flex';
31
- },
32
- enumerable: true,
33
- configurable: true
34
- });
35
- tslib_1.__decorate([
36
- Input(),
37
- tslib_1.__metadata("design:type", Object)
38
- ], WindowRestoreActionDirective.prototype, "window", void 0);
39
- tslib_1.__decorate([
40
- HostBinding('attr.type'),
41
- tslib_1.__metadata("design:type", String)
42
- ], WindowRestoreActionDirective.prototype, "buttonType", void 0);
43
- tslib_1.__decorate([
44
- HostListener('click'),
45
- tslib_1.__metadata("design:type", Function),
46
- tslib_1.__metadata("design:paramtypes", []),
47
- tslib_1.__metadata("design:returntype", void 0)
48
- ], WindowRestoreActionDirective.prototype, "onClick", null);
49
- tslib_1.__decorate([
50
- HostBinding('style.display'),
51
- tslib_1.__metadata("design:type", String),
52
- tslib_1.__metadata("design:paramtypes", [])
53
- ], WindowRestoreActionDirective.prototype, "visible", null);
54
- WindowRestoreActionDirective = tslib_1.__decorate([
55
- Directive({
56
- exportAs: 'kendoWindowRestoreAction',
57
- providers: [
58
- LocalizationService,
59
- {
60
- provide: L10N_PREFIX,
61
- useValue: 'kendo.button'
62
- }
63
- ],
64
- selector: 'button[kendoWindowRestoreAction]' // tslint:disable-line
65
- }),
66
- tslib_1.__param(2, Optional()),
67
- tslib_1.__metadata("design:paramtypes", [ElementRef,
68
- Renderer2,
69
- DragResizeService,
70
- LocalizationService,
71
- NgZone])
72
- ], WindowRestoreActionDirective);
73
- return WindowRestoreActionDirective;
74
- }(Button));
75
- export { WindowRestoreActionDirective };
@@ -1,351 +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 { Injectable, NgZone, EventEmitter } from "@angular/core";
7
- import { Subscription } from 'rxjs';
8
- import { tap, map, switchMap, takeUntil } from 'rxjs/operators';
9
- import { isPresent, OFFSET_STYLES, preventDefault } from '../common/util';
10
- import { scrollPosition, offset, getDocumentElement, positionWithScroll, getWindowViewPort } from '@progress/kendo-popup-common';
11
- /**
12
- * @hidden
13
- */
14
- var newZIndex = 10002;
15
- /**
16
- * @hidden
17
- */
18
- var DEFAULT_OPTIONS = {
19
- draggable: true,
20
- height: null,
21
- left: null,
22
- minHeight: 100,
23
- minWidth: 120,
24
- position: 'absolute',
25
- resizable: true,
26
- state: 'default',
27
- top: null,
28
- width: null
29
- };
30
- /**
31
- * @hidden
32
- */
33
- var createMoveStream = function (el, ev) { return function (mouseDown) {
34
- return el.kendoDrag
35
- .pipe(takeUntil(el.kendoRelease.pipe(tap(function () { ev.emit(); }))), map(function (_a) {
36
- var pageX = _a.pageX, pageY = _a.pageY;
37
- return ({
38
- originalX: mouseDown.pageX,
39
- originalY: mouseDown.pageY,
40
- pageX: pageX,
41
- pageY: pageY
42
- });
43
- }));
44
- }; };
45
- var ɵ0 = createMoveStream;
46
- /**
47
- * @hidden
48
- */
49
- var DragResizeService = /** @class */ (function () {
50
- function DragResizeService(ngZone) {
51
- this.ngZone = ngZone;
52
- this.close = new EventEmitter();
53
- this.focus = new EventEmitter();
54
- this.change = new EventEmitter();
55
- this.stateChange = new EventEmitter();
56
- this.dragStart = new EventEmitter();
57
- this.dragEnd = new EventEmitter();
58
- this.resizeStart = new EventEmitter();
59
- this.resizeEnd = new EventEmitter();
60
- this.options = Object.assign({}, DEFAULT_OPTIONS);
61
- this.lastAction = null;
62
- this.subscriptions = new Subscription();
63
- this.dragSubscription = new Subscription();
64
- }
65
- DragResizeService.prototype.ngOnDestroy = function () {
66
- if (this.subscriptions) {
67
- this.subscriptions.unsubscribe();
68
- }
69
- if (this.dragSubscription) {
70
- this.dragSubscription.unsubscribe();
71
- }
72
- };
73
- DragResizeService.prototype.init = function (el) {
74
- var state = this.options.state;
75
- var options = this.options;
76
- this.window = el;
77
- if (state !== 'default') {
78
- this.restoreOptions = Object.assign({}, options);
79
- }
80
- if (state === 'minimized') {
81
- options.height = 0;
82
- options.minHeight = 0;
83
- }
84
- if (state === 'maximized') {
85
- options.position = 'fixed';
86
- }
87
- };
88
- DragResizeService.prototype.onDrag = function (el) {
89
- var _this = this;
90
- this.subscriptions.add(this.ngZone.runOutsideAngular(function () {
91
- var startPosition;
92
- var dragStarted;
93
- _this.dragSubscription = el.kendoPress
94
- .pipe(tap(function (ev) {
95
- if (!ev.isTouch) {
96
- preventDefault(ev);
97
- }
98
- _this.focus.emit();
99
- startPosition = _this.currentPosition();
100
- dragStarted = false;
101
- }), switchMap(createMoveStream(el, _this.dragEnd)))
102
- .subscribe(function (_a) {
103
- var pageX = _a.pageX, pageY = _a.pageY, originalX = _a.originalX, originalY = _a.originalY;
104
- if (!dragStarted) {
105
- _this.ensureWidth();
106
- _this.dragStart.emit();
107
- dragStarted = true;
108
- }
109
- _this.handleDrag({
110
- originalX: originalX, originalY: originalY,
111
- pageX: pageX, pageY: pageY, startPosition: startPosition
112
- });
113
- });
114
- }));
115
- };
116
- DragResizeService.prototype.handleDrag = function (_a) {
117
- var originalX = _a.originalX, originalY = _a.originalY, pageX = _a.pageX, pageY = _a.pageY, startPosition = _a.startPosition;
118
- this.options.left = startPosition.x + pageX - originalX;
119
- this.options.top = startPosition.y + pageY - originalY;
120
- if (this.options.state === 'minimized' && isPresent(this.restoreOptions)) {
121
- this.restoreOptions.left = this.options.left;
122
- this.restoreOptions.top = this.options.top;
123
- }
124
- this.change.emit({
125
- left: startPosition.x + pageX - originalX,
126
- top: startPosition.y + pageY - originalY
127
- });
128
- };
129
- DragResizeService.prototype.onResize = function (handle, direction) {
130
- var _this = this;
131
- this.subscriptions.add(this.ngZone.runOutsideAngular(function () {
132
- var startOffsetAndPosition;
133
- var resizeStarted = false;
134
- handle.kendoPress.pipe(tap(function (ev) {
135
- preventDefault(ev);
136
- _this.focus.emit();
137
- startOffsetAndPosition = _this.currentOffsetAndPosition();
138
- resizeStarted = false;
139
- }), switchMap(createMoveStream(handle, _this.resizeEnd)))
140
- .subscribe(function (_a) {
141
- var pageX = _a.pageX, pageY = _a.pageY, originalX = _a.originalX, originalY = _a.originalY;
142
- if (!resizeStarted) {
143
- _this.resizeStart.emit(direction);
144
- resizeStarted = true;
145
- }
146
- var deltaX = pageX - originalX;
147
- var deltaY = pageY - originalY;
148
- _this.handleResize(startOffsetAndPosition, direction, deltaX, deltaY);
149
- });
150
- }));
151
- };
152
- DragResizeService.prototype.handleResize = function (initial, dir, deltaX, deltaY) {
153
- var _this = this;
154
- var old = this.options;
155
- var ev = {};
156
- if (dir.indexOf('e') >= 0) {
157
- var newWidth = initial.width + deltaX;
158
- if (newWidth !== old.width && newWidth >= old.minWidth) {
159
- ev.width = newWidth;
160
- }
161
- }
162
- if (dir.indexOf('n') >= 0) {
163
- var newHeight = initial.height - deltaY;
164
- var newTop = initial.y + deltaY;
165
- if (newHeight !== old.height && newHeight >= old.minHeight && newTop !== old.top) {
166
- ev.height = newHeight;
167
- ev.top = newTop;
168
- }
169
- }
170
- if (dir.indexOf('s') >= 0) {
171
- var newHeight = initial.height + deltaY;
172
- if (newHeight !== old.height && newHeight >= old.minHeight) {
173
- ev.height = newHeight;
174
- }
175
- }
176
- if (dir.indexOf('w') >= 0) {
177
- var newLeft = initial.x + deltaX;
178
- var newWidth = initial.width - deltaX;
179
- if (newWidth !== old.width && newWidth >= old.minWidth && newLeft !== old.left) {
180
- ev.width = newWidth;
181
- ev.left = newLeft;
182
- }
183
- }
184
- if (isPresent(ev.width) || isPresent(ev.height)) {
185
- OFFSET_STYLES.forEach(function (style) {
186
- if (isPresent(ev[style])) {
187
- _this.options[style] = ev[style];
188
- }
189
- });
190
- this.change.emit(ev);
191
- }
192
- };
193
- DragResizeService.prototype.restoreAction = function () {
194
- this.lastAction = 'restore';
195
- this.defaultState();
196
- };
197
- DragResizeService.prototype.defaultState = function () {
198
- if (isPresent(this.restoreOptions)) {
199
- this.options = Object.assign({}, this.restoreOptions);
200
- }
201
- this.options.state = 'default';
202
- this.stateChange.emit('default');
203
- };
204
- DragResizeService.prototype.storeOptions = function () {
205
- this.restoreOptions = Object.assign({}, this.options);
206
- };
207
- DragResizeService.prototype.maximizeAction = function () {
208
- this.lastAction = 'maximize';
209
- this.maximizeState();
210
- };
211
- DragResizeService.prototype.maximizeState = function () {
212
- this.storeOptions();
213
- var wnd = this.windowViewPort;
214
- this.options = Object.assign({}, this.options, {
215
- height: wnd.height,
216
- left: 0,
217
- position: 'fixed',
218
- state: 'maximized',
219
- top: 0,
220
- width: wnd.width
221
- });
222
- this.stateChange.emit('maximized');
223
- };
224
- DragResizeService.prototype.minimizeAction = function () {
225
- this.lastAction = 'minimize';
226
- this.minimizeState();
227
- };
228
- DragResizeService.prototype.minimizeState = function () {
229
- this.storeOptions();
230
- this.options = Object.assign({}, this.options, {
231
- height: null,
232
- minHeight: 0,
233
- state: 'minimized'
234
- });
235
- this.stateChange.emit('minimized');
236
- };
237
- /**
238
- * Handles manual changes of the 'state' property.
239
- * Required to distinguish them from action clicks.
240
- */
241
- DragResizeService.prototype.applyManualState = function () {
242
- var state = this.options.state;
243
- switch (state) {
244
- case 'default':
245
- this.clearHeight();
246
- this.defaultState();
247
- break;
248
- case 'maximized':
249
- this.clearHeight();
250
- this.maximizeState();
251
- break;
252
- case 'minimized':
253
- this.minimizeState();
254
- break;
255
- default:
256
- break;
257
- }
258
- };
259
- DragResizeService.prototype.closeAction = function () {
260
- this.close.emit();
261
- };
262
- DragResizeService.prototype.ensureWidth = function () {
263
- var windowOffset = offset(this.window.nativeElement);
264
- if (!isPresent(this.options.width)) {
265
- this.options.width = windowOffset.width;
266
- this.change.emit({ width: windowOffset.width });
267
- }
268
- };
269
- DragResizeService.prototype.clearHeight = function () {
270
- if (this.options.height === 0) {
271
- delete this.options.height;
272
- }
273
- if (this.options.minHeight === 0) {
274
- delete this.options.minHeight;
275
- }
276
- };
277
- DragResizeService.prototype.center = function () {
278
- if (this.options.state === 'maximized') {
279
- return;
280
- }
281
- var scroll = scrollPosition(this.window.nativeElement);
282
- var wnd = this.windowViewPort;
283
- var wrapper = offset(this.window.nativeElement);
284
- var ev = {};
285
- if (!isPresent(this.options.left)) {
286
- this.options.left = scroll.x + Math.max(0, (wnd.width - wrapper.width) / 2);
287
- ev.left = this.options.left;
288
- }
289
- if (!isPresent(this.options.top)) {
290
- this.options.top = scroll.y + Math.max(0, (wnd.height - wrapper.height) / 2);
291
- ev.top = this.options.top;
292
- }
293
- this.change.emit(ev);
294
- };
295
- DragResizeService.prototype.currentOffsetAndPosition = function () {
296
- var o = this.options;
297
- var off = offset(this.window.nativeElement);
298
- return Object.assign({}, this.currentPosition(), {
299
- height: o.height ? o.height : off.height,
300
- width: o.width ? o.width : off.width
301
- });
302
- };
303
- DragResizeService.prototype.currentPosition = function () {
304
- var o = this.options;
305
- if (!o.top || !o.left) {
306
- this.setPosition();
307
- }
308
- return {
309
- x: this.options.left,
310
- y: this.options.top
311
- };
312
- };
313
- DragResizeService.prototype.setPosition = function () {
314
- var wrapper = positionWithScroll(this.window.nativeElement, getDocumentElement(this.window.nativeElement));
315
- this.options.left = wrapper.left;
316
- this.options.top = wrapper.top;
317
- };
318
- DragResizeService.prototype.setRestoreOption = function (style, value) {
319
- if (isPresent(this.restoreOptions)) {
320
- this.restoreOptions[style] = value;
321
- }
322
- };
323
- Object.defineProperty(DragResizeService.prototype, "nextPossibleZIndex", {
324
- get: function () {
325
- return newZIndex;
326
- },
327
- enumerable: true,
328
- configurable: true
329
- });
330
- Object.defineProperty(DragResizeService.prototype, "nextZIndex", {
331
- get: function () {
332
- return newZIndex++;
333
- },
334
- enumerable: true,
335
- configurable: true
336
- });
337
- Object.defineProperty(DragResizeService.prototype, "windowViewPort", {
338
- get: function () {
339
- return getWindowViewPort(this.window.nativeElement);
340
- },
341
- enumerable: true,
342
- configurable: true
343
- });
344
- DragResizeService = tslib_1.__decorate([
345
- Injectable(),
346
- tslib_1.__metadata("design:paramtypes", [NgZone])
347
- ], DragResizeService);
348
- return DragResizeService;
349
- }());
350
- export { DragResizeService };
351
- export { ɵ0 };
@@ -1,155 +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 { Injectable, NgZone } from "@angular/core";
7
- import { DragResizeService } from './drag-resize.service';
8
- import { isPresent, OFFSET_STYLES, Keys } from '../common/util';
9
- /**
10
- * @hidden
11
- */
12
- var NavigationService = /** @class */ (function () {
13
- function NavigationService(window, ngZone) {
14
- this.window = window;
15
- this.ngZone = ngZone;
16
- }
17
- NavigationService.prototype.process = function (ev) {
18
- var _this = this;
19
- var key = ev.keyCode;
20
- switch (key) {
21
- case Keys.up:
22
- case Keys.down:
23
- case Keys.left:
24
- case Keys.right: {
25
- ev.preventDefault();
26
- this.ngZone.run(function () {
27
- _this.handleArrow(key, ev);
28
- });
29
- break;
30
- }
31
- case Keys.esc:
32
- this.ngZone.run(function () {
33
- _this.handleEscape();
34
- });
35
- break;
36
- default:
37
- break;
38
- }
39
- };
40
- NavigationService.prototype.handleArrow = function (key, ev) {
41
- var options = this.window.options;
42
- if (ev.altKey) {
43
- this.handleStateChange(key, options.state);
44
- return;
45
- }
46
- if ((ev.ctrlKey || ev.metaKey) && options.state === 'default') {
47
- this.handleResize(key);
48
- }
49
- else {
50
- this.handleDrag(key);
51
- }
52
- };
53
- NavigationService.prototype.handleEscape = function () {
54
- this.window.closeAction();
55
- };
56
- NavigationService.prototype.handleDrag = function (key) {
57
- var options = this.window.options;
58
- if (!options.draggable) {
59
- return;
60
- }
61
- var offset = this.window.currentOffsetAndPosition();
62
- var restoreOptions = this.window.restoreOptions;
63
- var ev = {};
64
- var delta = 10;
65
- if (key === Keys.left || key === Keys.up) {
66
- delta *= -1;
67
- }
68
- switch (key) {
69
- case Keys.left:
70
- case Keys.right: {
71
- ev.left = offset.x + delta;
72
- options.left = ev.left;
73
- break;
74
- }
75
- case Keys.up:
76
- case Keys.down: {
77
- ev.top = offset.y + delta;
78
- options.top = ev.top;
79
- break;
80
- }
81
- default:
82
- break;
83
- }
84
- if (options.state === 'minimized' && isPresent(restoreOptions)) {
85
- restoreOptions.left = options.left;
86
- restoreOptions.top = options.top;
87
- }
88
- this.window.change.emit(ev);
89
- };
90
- NavigationService.prototype.handleResize = function (key) {
91
- var _this = this;
92
- var options = this.window.options;
93
- if (!options.resizable) {
94
- return;
95
- }
96
- var offset = this.window.currentOffsetAndPosition();
97
- var newWidth;
98
- var newHeight;
99
- var ev = {};
100
- var delta = 10;
101
- if (key === Keys.left || key === Keys.up) {
102
- delta *= -1;
103
- }
104
- switch (key) {
105
- case Keys.left:
106
- case Keys.right: {
107
- newWidth = offset.width + delta;
108
- if (newWidth !== options.width && newWidth >= options.minWidth) {
109
- ev.width = newWidth;
110
- }
111
- break;
112
- }
113
- case Keys.up:
114
- case Keys.down: {
115
- newHeight = offset.height + delta;
116
- if (newHeight !== options.height && newHeight >= options.minHeight) {
117
- ev.height = newHeight;
118
- }
119
- break;
120
- }
121
- default:
122
- break;
123
- }
124
- if (isPresent(ev.width) || isPresent(ev.height)) {
125
- OFFSET_STYLES.forEach(function (style) {
126
- if (isPresent(ev[style])) {
127
- _this.window.options[style] = ev[style];
128
- }
129
- });
130
- this.window.change.emit(ev);
131
- }
132
- };
133
- NavigationService.prototype.handleStateChange = function (key, state) {
134
- if ((state === 'minimized' && key === Keys.up) ||
135
- (state === 'maximized' && key === Keys.down)) {
136
- this.window.restoreAction();
137
- return;
138
- }
139
- if (state === 'default') {
140
- if (key === Keys.up) {
141
- this.window.maximizeAction();
142
- }
143
- else if (key === Keys.down) {
144
- this.window.minimizeAction();
145
- }
146
- }
147
- };
148
- NavigationService = tslib_1.__decorate([
149
- Injectable(),
150
- tslib_1.__metadata("design:paramtypes", [DragResizeService,
151
- NgZone])
152
- ], NavigationService);
153
- return NavigationService;
154
- }());
155
- export { NavigationService };
@@ -1,31 +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 { Directive, ViewContainerRef } from '@angular/core';
7
- import { WindowContainerService } from './window-container.service';
8
- /**
9
- * Provides an insertion point for the Windows which are created through the
10
- * Window service ([see example]({% slug api_dialog_windowservice %}#toc-open)).
11
- * Created Windows will be mounted after that element.
12
- *
13
- * @example
14
- * ```html-no-run
15
- * <div kendoWindowContainer></div>
16
- * ```
17
- */
18
- var WindowContainerDirective = /** @class */ (function () {
19
- function WindowContainerDirective(container, service) {
20
- service.container = container;
21
- }
22
- WindowContainerDirective = tslib_1.__decorate([
23
- Directive({
24
- selector: '[kendoWindowContainer]'
25
- }),
26
- tslib_1.__metadata("design:paramtypes", [ViewContainerRef,
27
- WindowContainerService])
28
- ], WindowContainerDirective);
29
- return WindowContainerDirective;
30
- }());
31
- export { WindowContainerDirective };