@progress/kendo-angular-popup 4.0.6-dev.202203161114 → 5.0.0-dev.202204191152

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 (115) hide show
  1. package/bundles/kendo-angular-popup.umd.js +5 -0
  2. package/{dist/es2015/models/position-mode.js → esm2015/kendo-angular-popup.js} +2 -1
  3. package/{dist/es → esm2015}/main.js +0 -0
  4. package/{dist/es → esm2015}/models/align-element-settings.interface.js +1 -0
  5. package/{dist/es2015 → esm2015}/models/align.interface.js +1 -0
  6. package/{dist/es2015 → esm2015}/models/collision.interface.js +1 -0
  7. package/{dist/es2015 → esm2015}/models/collision.type.js +1 -0
  8. package/{dist/es → esm2015}/models/margin.interface.js +1 -0
  9. package/{dist/es → esm2015}/models/offset.interface.js +1 -0
  10. package/{dist/es → esm2015}/models/popup-animation.interface.js +1 -0
  11. package/{dist/es → esm2015}/models/popup-ref.js +1 -0
  12. package/{dist/es → esm2015}/models/popup-settings.js +1 -0
  13. package/{dist/es → esm2015}/models/position-element-settings.interface.js +1 -0
  14. package/{dist/es → esm2015}/models/position-mode.js +1 -0
  15. package/{dist/es → esm2015}/models/position.interface.js +1 -0
  16. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  17. package/{dist/es2015 → esm2015}/popup.component.js +64 -86
  18. package/{dist/es2015 → esm2015}/popup.module.js +16 -13
  19. package/{dist/es2015 → esm2015}/popup.service.js +14 -15
  20. package/{dist/es2015 → esm2015}/scale.js +0 -0
  21. package/{dist/es2015 → esm2015}/services/align.service.js +14 -10
  22. package/{dist/es2015 → esm2015}/services/animation.service.js +10 -10
  23. package/{dist/es2015 → esm2015}/services/dom.service.js +9 -8
  24. package/{dist/es2015 → esm2015}/services/position.service.js +14 -10
  25. package/{dist/es2015 → esm2015}/services/resize.service.js +10 -10
  26. package/{dist/es2015 → esm2015}/services/scrollable.service.js +10 -10
  27. package/{dist/es2015 → esm2015}/util.js +5 -10
  28. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-popup.js} +205 -192
  29. package/kendo-angular-popup.d.ts +9 -0
  30. package/{dist/es2015/main.d.ts → main.d.ts} +1 -1
  31. package/{dist/es2015/models → models}/align-element-settings.interface.d.ts +0 -0
  32. package/{dist/es2015/models → models}/align.interface.d.ts +0 -0
  33. package/{dist/es2015/models → models}/collision.interface.d.ts +0 -0
  34. package/{dist/es2015/models → models}/collision.type.d.ts +0 -0
  35. package/{dist/es2015/models → models}/margin.interface.d.ts +0 -0
  36. package/{dist/es2015/models → models}/offset.interface.d.ts +0 -0
  37. package/{dist/es2015/models → models}/popup-animation.interface.d.ts +4 -2
  38. package/{dist/es2015/models → models}/popup-ref.d.ts +0 -0
  39. package/{dist/es2015/models → models}/popup-settings.d.ts +0 -0
  40. package/{dist/es2015/models → models}/position-element-settings.interface.d.ts +0 -0
  41. package/{dist/es2015/models → models}/position-mode.d.ts +0 -0
  42. package/{dist/es2015/models → models}/position.interface.d.ts +0 -0
  43. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  44. package/package.json +30 -97
  45. package/{dist/es2015/popup.component.d.ts → popup.component.d.ts} +5 -1
  46. package/{dist/es2015/popup.module.d.ts → popup.module.d.ts} +7 -0
  47. package/{dist/es2015/popup.service.d.ts → popup.service.d.ts} +5 -2
  48. package/{dist/es2015/scale.d.ts → scale.d.ts} +0 -0
  49. package/schematics/ngAdd/index.js +5 -2
  50. package/schematics/ngAdd/index.js.map +1 -1
  51. package/{dist/es2015/services → services}/align.service.d.ts +3 -0
  52. package/{dist/es2015/services → services}/animation.service.d.ts +3 -0
  53. package/{dist/es2015/services → services}/dom.service.d.ts +3 -0
  54. package/{dist/es2015/services → services}/position.service.d.ts +3 -0
  55. package/{dist/es2015/services → services}/resize.service.d.ts +3 -0
  56. package/{dist/es2015/services → services}/scrollable.service.d.ts +3 -0
  57. package/{dist/es2015/util.d.ts → util.d.ts} +1 -1
  58. package/dist/cdn/js/kendo-angular-popup.js +0 -20
  59. package/dist/cdn/main.js +0 -5
  60. package/dist/es/index.js +0 -14
  61. package/dist/es/models/align.interface.js +0 -4
  62. package/dist/es/models/collision.interface.js +0 -4
  63. package/dist/es/models/collision.type.js +0 -4
  64. package/dist/es/package-metadata.js +0 -15
  65. package/dist/es/popup.component.js +0 -438
  66. package/dist/es/popup.module.js +0 -57
  67. package/dist/es/popup.service.js +0 -254
  68. package/dist/es/scale.js +0 -21
  69. package/dist/es/services/align.service.js +0 -64
  70. package/dist/es/services/animation.service.js +0 -137
  71. package/dist/es/services/dom.service.js +0 -158
  72. package/dist/es/services/position.service.js +0 -53
  73. package/dist/es/services/resize.service.js +0 -46
  74. package/dist/es/services/scrollable.service.js +0 -78
  75. package/dist/es/util.js +0 -168
  76. package/dist/es2015/index.d.ts +0 -14
  77. package/dist/es2015/index.js +0 -14
  78. package/dist/es2015/index.metadata.json +0 -1
  79. package/dist/es2015/main.js +0 -8
  80. package/dist/es2015/models/align-element-settings.interface.js +0 -4
  81. package/dist/es2015/models/margin.interface.js +0 -4
  82. package/dist/es2015/models/offset.interface.js +0 -4
  83. package/dist/es2015/models/popup-animation.interface.js +0 -4
  84. package/dist/es2015/models/popup-ref.js +0 -4
  85. package/dist/es2015/models/popup-settings.js +0 -4
  86. package/dist/es2015/models/position-element-settings.interface.js +0 -4
  87. package/dist/es2015/models/position.interface.js +0 -4
  88. package/dist/fesm5/index.js +0 -1381
  89. package/dist/npm/index.js +0 -23
  90. package/dist/npm/main.js +0 -15
  91. package/dist/npm/models/align-element-settings.interface.js +0 -6
  92. package/dist/npm/models/align.interface.js +0 -6
  93. package/dist/npm/models/collision.interface.js +0 -6
  94. package/dist/npm/models/collision.type.js +0 -6
  95. package/dist/npm/models/margin.interface.js +0 -6
  96. package/dist/npm/models/offset.interface.js +0 -6
  97. package/dist/npm/models/popup-animation.interface.js +0 -6
  98. package/dist/npm/models/popup-ref.js +0 -6
  99. package/dist/npm/models/popup-settings.js +0 -6
  100. package/dist/npm/models/position-element-settings.interface.js +0 -6
  101. package/dist/npm/models/position-mode.js +0 -9
  102. package/dist/npm/models/position.interface.js +0 -6
  103. package/dist/npm/package-metadata.js +0 -17
  104. package/dist/npm/popup.component.js +0 -440
  105. package/dist/npm/popup.module.js +0 -59
  106. package/dist/npm/popup.service.js +0 -256
  107. package/dist/npm/scale.js +0 -23
  108. package/dist/npm/services/align.service.js +0 -66
  109. package/dist/npm/services/animation.service.js +0 -139
  110. package/dist/npm/services/dom.service.js +0 -160
  111. package/dist/npm/services/position.service.js +0 -55
  112. package/dist/npm/services/resize.service.js +0 -48
  113. package/dist/npm/services/scrollable.service.js +0 -80
  114. package/dist/npm/util.js +0 -173
  115. package/dist/systemjs/kendo-angular-popup.js +0 -5
package/dist/npm/index.js DELETED
@@ -1,23 +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
- /**
7
- * Generated bundle index. Do not edit.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- var tslib_1 = require("tslib");
11
- tslib_1.__exportStar(require("./main"), exports);
12
- var align_service_1 = require("./services/align.service");
13
- exports.AlignService = align_service_1.AlignService
14
- var animation_service_1 = require("./services/animation.service");
15
- exports.AnimationService = animation_service_1.AnimationService
16
- var dom_service_1 = require("./services/dom.service");
17
- exports.DOMService = dom_service_1.DOMService
18
- var position_service_1 = require("./services/position.service");
19
- exports.PositionService = position_service_1.PositionService
20
- var resize_service_1 = require("./services/resize.service");
21
- exports.ResizeService = resize_service_1.ResizeService
22
- var scrollable_service_1 = require("./services/scrollable.service");
23
- exports.ScrollableService = scrollable_service_1.ScrollableService
package/dist/npm/main.js DELETED
@@ -1,15 +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 popup_service_1 = require("./popup.service");
8
- exports.PopupService = popup_service_1.PopupService;
9
- exports.POPUP_CONTAINER = popup_service_1.POPUP_CONTAINER;
10
- var popup_component_1 = require("./popup.component");
11
- exports.PopupComponent = popup_component_1.PopupComponent;
12
- var popup_module_1 = require("./popup.module");
13
- exports.PopupModule = popup_module_1.PopupModule;
14
- var scale_1 = require("./scale");
15
- exports.SCALE = scale_1.SCALE;
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -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 });
@@ -1,9 +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
- /**
7
- * The type which defines all possible position modes of the Popup.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 });
@@ -1,17 +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
- /**
8
- * @hidden
9
- */
10
- exports.packageMetadata = {
11
- name: '@progress/kendo-angular-popup',
12
- productName: 'Kendo UI for Angular',
13
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1647429230,
15
- version: '',
16
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
17
- };
@@ -1,440 +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 align_service_1 = require("./services/align.service");
10
- var dom_service_1 = require("./services/dom.service");
11
- var position_service_1 = require("./services/position.service");
12
- var resize_service_1 = require("./services/resize.service");
13
- var scrollable_service_1 = require("./services/scrollable.service");
14
- var animation_service_1 = require("./services/animation.service");
15
- var util_1 = require("./util");
16
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
17
- var rxjs_1 = require("rxjs");
18
- var kendo_licensing_1 = require("@progress/kendo-licensing");
19
- var package_metadata_1 = require("./package-metadata");
20
- var DEFAULT_OFFSET = { left: -10000, top: 0 };
21
- var ANIMATION_CONTAINER = 'k-animation-container';
22
- var ANIMATION_CONTAINER_FIXED = 'k-animation-container-fixed';
23
- /**
24
- * Represents the [Kendo UI Popup component for Angular]({% slug overview_popup %}).
25
- *
26
- * @example
27
- * ```ts
28
- * _@Component({
29
- * selector: 'my-app',
30
- * template: `
31
- * <button #anchor (click)="show=!show">Toggle</button>
32
- * <kendo-popup *ngIf="show" [anchor]="anchor">
33
- * <strong>Popup content!</strong>
34
- * </kendo-popup>
35
- * `
36
- * })
37
- * class AppComponent {
38
- * public show: boolean = false;
39
- * }
40
- * ```
41
- */
42
- var PopupComponent = /** @class */ (function () {
43
- function PopupComponent(container, _alignService, domService, _positionService, _resizeService, _scrollableService, animationService, _renderer, _zone) {
44
- this.container = container;
45
- this._alignService = _alignService;
46
- this.domService = domService;
47
- this._positionService = _positionService;
48
- this._resizeService = _resizeService;
49
- this._scrollableService = _scrollableService;
50
- this.animationService = animationService;
51
- this._renderer = _renderer;
52
- this._zone = _zone;
53
- /**
54
- * Controls the Popup animation. By default, the opening and closing animations
55
- * are enabled ([see example]({% slug animations_popup %})).
56
- */
57
- this.animate = true;
58
- /**
59
- * Specifies the anchor pivot point
60
- * ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
61
- */
62
- this.anchorAlign = { horizontal: 'left', vertical: 'bottom' };
63
- /**
64
- * Configures the collision behavior of the Popup
65
- * ([see example]({% slug viewportboundarydetection_popup %})).
66
- */
67
- this.collision = { horizontal: 'fit', vertical: 'flip' };
68
- /**
69
- * Specifies the pivot point of the Popup
70
- * ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
71
- */
72
- this.popupAlign = { horizontal: 'left', vertical: 'top' };
73
- /**
74
- * Controls whether the component will copy the `anchor` font styles.
75
- */
76
- this.copyAnchorStyles = false;
77
- /**
78
- * Specifies the position mode of the component. By default, the Popup uses fixed positioning.
79
- * To make the Popup acquire absolute positioning, set this option to `absolute`.
80
- *
81
- * > If you need to support mobile browsers with the zoom option,
82
- * use the `absolute` positioning of the Popup.
83
- *
84
- * @example
85
- * ```html
86
- * <style>
87
- * .parent-content {
88
- * position: relative;
89
- * width: 200px;
90
- * height: 200px;
91
- * overflow: auto;
92
- * margin: 200px auto;
93
- * border: 1px solid red;
94
- * }
95
- * .content {
96
- * position: relative;
97
- * width: 100px;
98
- * height: 100px;
99
- * overflow: auto;
100
- * margin: 300px;
101
- * border: 1px solid blue;
102
- * }
103
- * .anchor {
104
- * position: absolute;
105
- * top: 200px;
106
- * left: 200px;
107
- * }
108
- * </style>
109
- * ```
110
- * ```ts
111
- * _@Component({
112
- * selector: 'my-app',
113
- * template: `
114
- * <div class="example-config">
115
- * Position mode:
116
- * <label><input type="radio" value="fixed" [(ngModel)]="mode" /> Fixed</label>
117
- * <label><input type="radio" value="absolute" [(ngModel)]="mode" /> Absolute</label>
118
- * </div>
119
- * <div class="example-config">
120
- * Append to
121
- * <label>
122
- * <input type="radio" name="place" [value]="1" [(ngModel)]="checked" />
123
- * Root component
124
- * </label>
125
- * <label>
126
- * <input type="radio" name="place" [value]="2" [(ngModel)]="checked" />
127
- * <span style="color: red">Red Container</span>
128
- * </label>
129
- * <label>
130
- * <input type="radio" name="place" [value]="3" [(ngModel)]="checked" />
131
- * <span style="color: blue">Blue Container</span>
132
- * </label>
133
- * </div>
134
- * <div class="example">
135
- * <div class="parent-content" [scrollLeft]="250" [scrollTop]="230">
136
- * <div class="content" [scrollLeft]="170" [scrollTop]="165">
137
- * <button #anchor class="anchor" (click)="show = !show">Toggle</button>
138
- * <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 3">
139
- * <ul>
140
- * <li>Item1</li>
141
- * <li>Item2</li>
142
- * <li>Item3</li>
143
- * </ul>
144
- * </kendo-popup>
145
- * <span style="position: absolute; top: 400px; left: 400px">Bottom/Right</span>
146
- * </div>
147
- * <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 2">
148
- * <ul>
149
- * <li>Item1</li>
150
- * <li>Item2</li>
151
- * <li>Item3</li>
152
- * </ul>
153
- * </kendo-popup>
154
- * <span style="position: absolute; top: 600px; left: 600px">Bottom/Right</span>
155
- * </div>
156
- * <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 1">
157
- * <ul>
158
- * <li>Item1</li>
159
- * <li>Item2</li>
160
- * <li>Item3</li>
161
- * </ul>
162
- * </kendo-popup>
163
- * </div>
164
- * `
165
- * })
166
- * class AppComponent {
167
- * public checked: number = 3;
168
- * public mode: string = 'absolute';
169
- * public show: boolean = true;
170
- * }
171
- * ```
172
- */
173
- this.positionMode = 'fixed';
174
- /**
175
- * Specifies the absolute position of the element
176
- * ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-absolute-points)).
177
- * The Popup opens next to that point. The Popup pivot point is defined by the `popupAlign` configuration option.
178
- * The boundary detection is applied by using the window viewport.
179
- */
180
- this.offset = DEFAULT_OFFSET;
181
- /**
182
- * Fires when the anchor is scrolled outside the screen boundaries.
183
- * ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
184
- */
185
- this.anchorViewportLeave = new core_1.EventEmitter();
186
- /**
187
- * Fires after the component is closed.
188
- */
189
- this.close = new core_1.EventEmitter();
190
- /**
191
- * Fires after the component is opened and the opening animation ends.
192
- */
193
- this.open = new core_1.EventEmitter();
194
- /**
195
- * Fires after the component is opened and the Popup is positioned.
196
- */
197
- this.positionChange = new core_1.EventEmitter();
198
- this.resolvedPromise = Promise.resolve(null);
199
- this.initialCheck = true;
200
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
201
- this._renderer.addClass(container.nativeElement, ANIMATION_CONTAINER);
202
- this.updateFixedClass();
203
- }
204
- PopupComponent.prototype.ngOnInit = function () {
205
- this.reposition = this.reposition.bind(this);
206
- this._resizeService.subscribe(this.reposition);
207
- this.animationSubscriptions = this.animationService.start.subscribe(this.onAnimationStart.bind(this));
208
- this.animationSubscriptions.add(this.animationService.end.subscribe(this.onAnimationEnd.bind(this)));
209
- this._scrollableService.forElement(this.domService.nativeElement(this.anchor) || this.container.nativeElement).subscribe(this.onScroll.bind(this));
210
- this.currentOffset = DEFAULT_OFFSET;
211
- this.setZIndex();
212
- this.copyFontStyles();
213
- this.updateFixedClass();
214
- this.reposition();
215
- };
216
- PopupComponent.prototype.ngOnChanges = function (changes) {
217
- if (changes.copyAnchorStyles) {
218
- this.copyFontStyles();
219
- }
220
- if (changes.positionMode) {
221
- this.updateFixedClass();
222
- }
223
- };
224
- PopupComponent.prototype.ngAfterViewInit = function () {
225
- var _this = this;
226
- if (!this.animate) {
227
- this.resolvedPromise.then(function () {
228
- _this.onAnimationEnd();
229
- });
230
- }
231
- };
232
- PopupComponent.prototype.ngAfterViewChecked = function () {
233
- var _this = this;
234
- if (this.initialCheck) {
235
- this.initialCheck = false;
236
- return;
237
- }
238
- this._zone.runOutsideAngular(function () {
239
- // workarounds https://github.com/angular/angular/issues/19094
240
- // uses promise because it is executed synchronously after the content is updated
241
- // does not use onStable in case the current zone is not the angular one.
242
- _this.unsubscribeReposition();
243
- _this.repositionSubscription = rxjs_1.from(_this.resolvedPromise)
244
- .subscribe(_this.reposition);
245
- });
246
- };
247
- PopupComponent.prototype.ngOnDestroy = function () {
248
- this.anchorViewportLeave.complete();
249
- this.positionChange.complete();
250
- this.close.emit();
251
- this.close.complete();
252
- this._resizeService.unsubscribe();
253
- this._scrollableService.unsubscribe();
254
- this.animationSubscriptions.unsubscribe();
255
- this.unsubscribeReposition();
256
- };
257
- /**
258
- * @hidden
259
- */
260
- PopupComponent.prototype.onResize = function () {
261
- this.reposition();
262
- };
263
- PopupComponent.prototype.onAnimationStart = function () {
264
- this._renderer.removeClass(this.container.nativeElement, 'k-animation-container-shown');
265
- };
266
- PopupComponent.prototype.onAnimationEnd = function () {
267
- this._renderer.addClass(this.container.nativeElement, 'k-animation-container-shown');
268
- this.open.emit();
269
- this.open.complete();
270
- };
271
- Object.defineProperty(PopupComponent.prototype, "currentOffset", {
272
- get: function () {
273
- return this._currentOffset;
274
- },
275
- set: function (offset) {
276
- this.setContainerStyle('left', offset.left + "px");
277
- this.setContainerStyle('top', offset.top + "px");
278
- this._currentOffset = offset;
279
- },
280
- enumerable: true,
281
- configurable: true
282
- });
283
- PopupComponent.prototype.setZIndex = function () {
284
- if (this.anchor) {
285
- this.setContainerStyle('z-index', String(this.domService.zIndex(this.domService.nativeElement(this.anchor), this.container)));
286
- }
287
- };
288
- PopupComponent.prototype.reposition = function () {
289
- var _this = this;
290
- if (!kendo_angular_common_1.isDocumentAvailable()) {
291
- return;
292
- }
293
- var _a = this.position(), flip = _a.flip, offset = _a.offset;
294
- if (!this.currentOffset || util_1.isDifferentOffset(this.currentOffset, offset)) {
295
- this.currentOffset = offset;
296
- if (kendo_angular_common_1.hasObservers(this.positionChange)) {
297
- this._zone.run(function () { return _this.positionChange.emit({ offset: offset, flip: flip }); });
298
- }
299
- }
300
- if (this.animate) {
301
- this.animationService.play(this.contentContainer.nativeElement, this.animate, flip);
302
- }
303
- this.resizeSensor.acceptSize();
304
- };
305
- PopupComponent.prototype.position = function () {
306
- var alignedOffset = this._alignService.alignElement({
307
- anchor: this.domService.nativeElement(this.anchor),
308
- anchorAlign: this.anchorAlign,
309
- element: this.container,
310
- elementAlign: this.popupAlign,
311
- margin: this.margin,
312
- offset: this.offset,
313
- positionMode: this.positionMode
314
- });
315
- return this._positionService.positionElement({
316
- anchor: this.domService.nativeElement(this.anchor),
317
- anchorAlign: this.anchorAlign,
318
- collisions: this.collision,
319
- currentLocation: alignedOffset,
320
- element: this.container,
321
- elementAlign: this.popupAlign,
322
- margin: this.margin
323
- });
324
- };
325
- PopupComponent.prototype.onScroll = function (isInViewPort) {
326
- var _this = this;
327
- var hasLeaveObservers = kendo_angular_common_1.hasObservers(this.anchorViewportLeave);
328
- if (isInViewPort || !hasLeaveObservers) {
329
- this.reposition();
330
- }
331
- else if (hasLeaveObservers) {
332
- this._zone.run(function () {
333
- _this.anchorViewportLeave.emit();
334
- });
335
- }
336
- };
337
- PopupComponent.prototype.copyFontStyles = function () {
338
- var _this = this;
339
- if (!this.anchor || !this.copyAnchorStyles) {
340
- return;
341
- }
342
- this.domService.getFontStyles(this.domService.nativeElement(this.anchor))
343
- .forEach(function (s) { return _this.setContainerStyle(s.key, s.value); });
344
- };
345
- PopupComponent.prototype.updateFixedClass = function () {
346
- var action = this.positionMode === 'fixed' ? 'addClass' : 'removeClass';
347
- this._renderer[action](this.container.nativeElement, ANIMATION_CONTAINER_FIXED);
348
- };
349
- PopupComponent.prototype.setContainerStyle = function (name, value) {
350
- this._renderer.setStyle(this.container.nativeElement, name, value);
351
- };
352
- PopupComponent.prototype.unsubscribeReposition = function () {
353
- if (this.repositionSubscription) {
354
- this.repositionSubscription.unsubscribe();
355
- }
356
- };
357
- tslib_1.__decorate([
358
- core_1.Input(),
359
- tslib_1.__metadata("design:type", Object)
360
- ], PopupComponent.prototype, "animate", void 0);
361
- tslib_1.__decorate([
362
- core_1.Input(),
363
- tslib_1.__metadata("design:type", Object)
364
- ], PopupComponent.prototype, "anchor", void 0);
365
- tslib_1.__decorate([
366
- core_1.Input(),
367
- tslib_1.__metadata("design:type", Object)
368
- ], PopupComponent.prototype, "anchorAlign", void 0);
369
- tslib_1.__decorate([
370
- core_1.Input(),
371
- tslib_1.__metadata("design:type", Object)
372
- ], PopupComponent.prototype, "collision", void 0);
373
- tslib_1.__decorate([
374
- core_1.Input(),
375
- tslib_1.__metadata("design:type", Object)
376
- ], PopupComponent.prototype, "popupAlign", void 0);
377
- tslib_1.__decorate([
378
- core_1.Input(),
379
- tslib_1.__metadata("design:type", Boolean)
380
- ], PopupComponent.prototype, "copyAnchorStyles", void 0);
381
- tslib_1.__decorate([
382
- core_1.Input(),
383
- tslib_1.__metadata("design:type", Object)
384
- ], PopupComponent.prototype, "popupClass", void 0);
385
- tslib_1.__decorate([
386
- core_1.Input(),
387
- tslib_1.__metadata("design:type", String)
388
- ], PopupComponent.prototype, "positionMode", void 0);
389
- tslib_1.__decorate([
390
- core_1.Input(),
391
- tslib_1.__metadata("design:type", Object)
392
- ], PopupComponent.prototype, "offset", void 0);
393
- tslib_1.__decorate([
394
- core_1.Input(),
395
- tslib_1.__metadata("design:type", Object)
396
- ], PopupComponent.prototype, "margin", void 0);
397
- tslib_1.__decorate([
398
- core_1.Output(),
399
- tslib_1.__metadata("design:type", core_1.EventEmitter)
400
- ], PopupComponent.prototype, "anchorViewportLeave", void 0);
401
- tslib_1.__decorate([
402
- core_1.Output(),
403
- tslib_1.__metadata("design:type", core_1.EventEmitter)
404
- ], PopupComponent.prototype, "close", void 0);
405
- tslib_1.__decorate([
406
- core_1.Output(),
407
- tslib_1.__metadata("design:type", core_1.EventEmitter)
408
- ], PopupComponent.prototype, "open", void 0);
409
- tslib_1.__decorate([
410
- core_1.Output(),
411
- tslib_1.__metadata("design:type", core_1.EventEmitter)
412
- ], PopupComponent.prototype, "positionChange", void 0);
413
- tslib_1.__decorate([
414
- core_1.ViewChild('container', { static: true }),
415
- tslib_1.__metadata("design:type", core_1.ElementRef)
416
- ], PopupComponent.prototype, "contentContainer", void 0);
417
- tslib_1.__decorate([
418
- core_1.ViewChild(kendo_angular_common_1.ResizeSensorComponent, { static: true }),
419
- tslib_1.__metadata("design:type", kendo_angular_common_1.ResizeSensorComponent)
420
- ], PopupComponent.prototype, "resizeSensor", void 0);
421
- PopupComponent = tslib_1.__decorate([
422
- core_1.Component({
423
- exportAs: 'kendo-popup',
424
- providers: [align_service_1.AlignService, animation_service_1.AnimationService, dom_service_1.DOMService, position_service_1.PositionService, resize_service_1.ResizeService, scrollable_service_1.ScrollableService],
425
- selector: 'kendo-popup',
426
- template: "\n <div class=\"k-popup\" [ngClass]=\"popupClass\" #container>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]=\"content\" [ngIf]=\"content\"></ng-template>\n <kendo-resize-sensor [rateLimit]=\"100\" (resize)=\"onResize()\">\n </kendo-resize-sensor>\n </div>\n "
427
- }),
428
- tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
429
- align_service_1.AlignService,
430
- dom_service_1.DOMService,
431
- position_service_1.PositionService,
432
- resize_service_1.ResizeService,
433
- scrollable_service_1.ScrollableService,
434
- animation_service_1.AnimationService,
435
- core_1.Renderer2,
436
- core_1.NgZone])
437
- ], PopupComponent);
438
- return PopupComponent;
439
- }());
440
- exports.PopupComponent = PopupComponent;
@@ -1,59 +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 common_1 = require("@angular/common");
10
- var popup_component_1 = require("./popup.component");
11
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
12
- var popup_service_1 = require("./popup.service");
13
- var POPUP_DIRECTIVES = [popup_component_1.PopupComponent];
14
- /**
15
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
16
- * definition for the Popup component.
17
- *
18
- * @example
19
- *
20
- * ```ts-no-run
21
- * // Import the Popup module
22
- * import { PopupModule } from '@progress/kendo-angular-popup';
23
- *
24
- * // The browser platform with a compiler
25
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
26
- *
27
- * import { NgModule } from '@angular/core';
28
- *
29
- * // Import the app component
30
- * import { AppComponent } from './app.component';
31
- *
32
- * // Define the app module
33
- * _@NgModule({
34
- * declarations: [AppComponent], // declare app component
35
- * imports: [BrowserModule, PopupModule], // import Popup module
36
- * bootstrap: [AppComponent]
37
- * })
38
- * export class AppModule {}
39
- *
40
- * // Compile and launch the module
41
- * platformBrowserDynamic().bootstrapModule(AppModule);
42
- *
43
- * ```
44
- */
45
- var PopupModule = /** @class */ (function () {
46
- function PopupModule() {
47
- }
48
- PopupModule = tslib_1.__decorate([
49
- core_1.NgModule({
50
- declarations: [POPUP_DIRECTIVES],
51
- entryComponents: [POPUP_DIRECTIVES],
52
- exports: [POPUP_DIRECTIVES],
53
- imports: [common_1.CommonModule, kendo_angular_common_1.ResizeSensorModule],
54
- providers: [popup_service_1.PopupService]
55
- })
56
- ], PopupModule);
57
- return PopupModule;
58
- }());
59
- exports.PopupModule = PopupModule;