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