@progress/kendo-angular-popup 17.0.0-develop.9 → 17.0.1-develop.1
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.
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/popup.component.mjs +193 -151
- package/{esm2020 → esm2022}/popup.module.mjs +8 -7
- package/{esm2020 → esm2022}/popup.service.mjs +13 -9
- package/{esm2020 → esm2022}/services/align.service.mjs +5 -3
- package/{esm2020 → esm2022}/services/animation.service.mjs +8 -5
- package/{esm2020 → esm2022}/services/dom.service.mjs +4 -3
- package/{esm2020 → esm2022}/services/position.service.mjs +5 -3
- package/{esm2020 → esm2022}/services/resize.service.mjs +6 -3
- package/{esm2020 → esm2022}/services/scrollable.service.mjs +7 -3
- package/{fesm2020 → fesm2022}/progress-kendo-angular-popup.mjs +250 -188
- package/models/collision.type.d.ts +1 -1
- package/models/popup-animation.interface.d.ts +2 -2
- package/models/position-mode.d.ts +1 -1
- package/package.json +11 -17
- package/popup.component.d.ts +1 -1
- package/fesm2015/progress-kendo-angular-popup.mjs +0 -1404
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/models/align-element-settings.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/align.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/collision.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/collision.type.mjs +0 -0
- /package/{esm2020 → esm2022}/models/margin.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/offset.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/popup-animation.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/popup-ref.mjs +0 -0
- /package/{esm2020 → esm2022}/models/popup-settings.mjs +0 -0
- /package/{esm2020 → esm2022}/models/position-element-settings.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/models/position-mode.mjs +0 -0
- /package/{esm2020 → esm2022}/models/position.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-popup.mjs +0 -0
- /package/{esm2020 → esm2022}/scale.mjs +0 -0
- /package/{esm2020 → esm2022}/util.mjs +0 -0
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { Injectable, InjectionToken, Inject, Optional, EventEmitter, isDevMode, Component, Input, Output, ViewChild, TemplateRef, NgModule } from '@angular/core';
|
|
7
7
|
import { siblingContainer, parents, addScroll, align, boundingOffset, offset, positionWithScroll, removeScroll, restrictToView, scrollPosition, getWindowViewPort } from '@progress/kendo-popup-common';
|
|
8
|
-
import
|
|
8
|
+
import * as i1$1 from '@progress/kendo-angular-common';
|
|
9
|
+
import { isDocumentAvailable, hasObservers, ResizeSensorComponent, ResizeBatchService, KENDO_RESIZESENSOR } from '@progress/kendo-angular-common';
|
|
9
10
|
import { fromEvent, merge, from } from 'rxjs';
|
|
10
11
|
import { auditTime } from 'rxjs/operators';
|
|
11
12
|
import * as i1 from '@angular/animations';
|
|
@@ -184,6 +185,7 @@ const STYLES = [
|
|
|
184
185
|
* @hidden
|
|
185
186
|
*/
|
|
186
187
|
class DOMService {
|
|
188
|
+
_dummy;
|
|
187
189
|
addOffset(current, addition) {
|
|
188
190
|
return {
|
|
189
191
|
left: current.left + addition.left,
|
|
@@ -311,10 +313,10 @@ class DOMService {
|
|
|
311
313
|
isZoomed() {
|
|
312
314
|
return this.zoomLevel() > 1;
|
|
313
315
|
}
|
|
316
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DOMService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
317
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DOMService });
|
|
314
318
|
}
|
|
315
|
-
|
|
316
|
-
DOMService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DOMService });
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DOMService, decorators: [{
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DOMService, decorators: [{
|
|
318
320
|
type: Injectable
|
|
319
321
|
}] });
|
|
320
322
|
|
|
@@ -339,6 +341,8 @@ const SCALE = new InjectionToken('Popup Document Scale');
|
|
|
339
341
|
* @hidden
|
|
340
342
|
*/
|
|
341
343
|
class AlignService {
|
|
344
|
+
_dom;
|
|
345
|
+
scale;
|
|
342
346
|
constructor(_dom, scale = 1) {
|
|
343
347
|
this._dom = _dom;
|
|
344
348
|
this.scale = scale;
|
|
@@ -381,10 +385,10 @@ class AlignService {
|
|
|
381
385
|
const rect = eitherRect(this._dom.position(anchor, element, scale), offset);
|
|
382
386
|
return scaleRect(rect, scale);
|
|
383
387
|
}
|
|
388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlignService, deps: [{ token: DOMService }, { token: SCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
389
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlignService });
|
|
384
390
|
}
|
|
385
|
-
|
|
386
|
-
AlignService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlignService });
|
|
387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlignService, decorators: [{
|
|
391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlignService, decorators: [{
|
|
388
392
|
type: Injectable
|
|
389
393
|
}], ctorParameters: function () { return [{ type: DOMService }, { type: undefined, decorators: [{
|
|
390
394
|
type: Inject,
|
|
@@ -397,6 +401,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
397
401
|
* @hidden
|
|
398
402
|
*/
|
|
399
403
|
class PositionService {
|
|
404
|
+
_dom;
|
|
405
|
+
scale;
|
|
400
406
|
constructor(_dom, scale = 1) {
|
|
401
407
|
this._dom = _dom;
|
|
402
408
|
this.scale = scale;
|
|
@@ -428,10 +434,10 @@ class PositionService {
|
|
|
428
434
|
offset: offset
|
|
429
435
|
};
|
|
430
436
|
}
|
|
437
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PositionService, deps: [{ token: DOMService }, { token: SCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
438
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PositionService });
|
|
431
439
|
}
|
|
432
|
-
|
|
433
|
-
PositionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PositionService });
|
|
434
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PositionService, decorators: [{
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PositionService, decorators: [{
|
|
435
441
|
type: Injectable
|
|
436
442
|
}], ctorParameters: function () { return [{ type: DOMService }, { type: undefined, decorators: [{
|
|
437
443
|
type: Inject,
|
|
@@ -444,6 +450,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
444
450
|
* @hidden
|
|
445
451
|
*/
|
|
446
452
|
class ResizeService {
|
|
453
|
+
_dom;
|
|
454
|
+
_zone;
|
|
455
|
+
subscription;
|
|
447
456
|
constructor(_dom, _zone) {
|
|
448
457
|
this._dom = _dom;
|
|
449
458
|
this._zone = _zone;
|
|
@@ -467,10 +476,10 @@ class ResizeService {
|
|
|
467
476
|
isUnsubscribed() {
|
|
468
477
|
return this.subscription && this.subscription.closed;
|
|
469
478
|
}
|
|
479
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResizeService, deps: [{ token: DOMService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
480
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResizeService });
|
|
470
481
|
}
|
|
471
|
-
|
|
472
|
-
ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ResizeService });
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ResizeService, decorators: [{
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResizeService, decorators: [{
|
|
474
483
|
type: Injectable
|
|
475
484
|
}], ctorParameters: function () { return [{ type: DOMService }, { type: i0.NgZone }]; } });
|
|
476
485
|
|
|
@@ -482,6 +491,10 @@ const THRESHOLD_DIFF = 1;
|
|
|
482
491
|
* @hidden
|
|
483
492
|
*/
|
|
484
493
|
class ScrollableService {
|
|
494
|
+
_dom;
|
|
495
|
+
_zone;
|
|
496
|
+
element;
|
|
497
|
+
subscription;
|
|
485
498
|
constructor(_dom, _zone) {
|
|
486
499
|
this._dom = _dom;
|
|
487
500
|
this._zone = _zone;
|
|
@@ -533,10 +546,10 @@ class ScrollableService {
|
|
|
533
546
|
}
|
|
534
547
|
return true;
|
|
535
548
|
}
|
|
549
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ScrollableService, deps: [{ token: DOMService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
550
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ScrollableService });
|
|
536
551
|
}
|
|
537
|
-
|
|
538
|
-
ScrollableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollableService });
|
|
539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollableService, decorators: [{
|
|
552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ScrollableService, decorators: [{
|
|
540
553
|
type: Injectable
|
|
541
554
|
}], ctorParameters: function () { return [{ type: DOMService }, { type: i0.NgZone }]; } });
|
|
542
555
|
|
|
@@ -596,10 +609,13 @@ animationTypes.zoom = () => {
|
|
|
596
609
|
* @hidden
|
|
597
610
|
*/
|
|
598
611
|
class AnimationService {
|
|
612
|
+
animationBuilder;
|
|
613
|
+
start = new EventEmitter();
|
|
614
|
+
end = new EventEmitter();
|
|
615
|
+
flip;
|
|
616
|
+
player;
|
|
599
617
|
constructor(animationBuilder) {
|
|
600
618
|
this.animationBuilder = animationBuilder;
|
|
601
|
-
this.start = new EventEmitter();
|
|
602
|
-
this.end = new EventEmitter();
|
|
603
619
|
}
|
|
604
620
|
play(element, options, flip) {
|
|
605
621
|
if (!this.flip || this.flip.horizontal !== flip.horizontal ||
|
|
@@ -661,10 +677,10 @@ class AnimationService {
|
|
|
661
677
|
this.player = null;
|
|
662
678
|
}
|
|
663
679
|
}
|
|
680
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AnimationService, deps: [{ token: i1.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
681
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AnimationService });
|
|
664
682
|
}
|
|
665
|
-
|
|
666
|
-
AnimationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AnimationService });
|
|
667
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AnimationService, decorators: [{
|
|
683
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AnimationService, decorators: [{
|
|
668
684
|
type: Injectable
|
|
669
685
|
}], ctorParameters: function () { return [{ type: i1.AnimationBuilder }]; } });
|
|
670
686
|
|
|
@@ -675,8 +691,8 @@ const packageMetadata = {
|
|
|
675
691
|
name: '@progress/kendo-angular-popup',
|
|
676
692
|
productName: 'Kendo UI for Angular',
|
|
677
693
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
678
|
-
publishDate:
|
|
679
|
-
version: '17.0.
|
|
694
|
+
publishDate: 1731429590,
|
|
695
|
+
version: '17.0.1-develop.1',
|
|
680
696
|
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'
|
|
681
697
|
};
|
|
682
698
|
|
|
@@ -703,6 +719,195 @@ const ANIMATION_CONTAINER_FIXED = 'k-animation-container-fixed';
|
|
|
703
719
|
* ```
|
|
704
720
|
*/
|
|
705
721
|
class PopupComponent {
|
|
722
|
+
container;
|
|
723
|
+
_alignService;
|
|
724
|
+
domService;
|
|
725
|
+
_positionService;
|
|
726
|
+
_resizeService;
|
|
727
|
+
_scrollableService;
|
|
728
|
+
animationService;
|
|
729
|
+
_renderer;
|
|
730
|
+
_zone;
|
|
731
|
+
/**
|
|
732
|
+
* Controls the Popup animation. By default, the opening and closing animations
|
|
733
|
+
* are enabled ([see example]({% slug animations_popup %})).
|
|
734
|
+
*/
|
|
735
|
+
animate = true;
|
|
736
|
+
/**
|
|
737
|
+
* Specifies the element that will be used as an anchor. The Popup opens next to that element.
|
|
738
|
+
* ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-components)).
|
|
739
|
+
*/
|
|
740
|
+
anchor;
|
|
741
|
+
/**
|
|
742
|
+
* Specifies the anchor pivot point
|
|
743
|
+
* ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
|
|
744
|
+
*/
|
|
745
|
+
anchorAlign = { horizontal: 'left', vertical: 'bottom' };
|
|
746
|
+
/**
|
|
747
|
+
* Configures the collision behavior of the Popup
|
|
748
|
+
* ([see example]({% slug viewportboundarydetection_popup %})).
|
|
749
|
+
*/
|
|
750
|
+
collision = { horizontal: 'fit', vertical: 'flip' };
|
|
751
|
+
/**
|
|
752
|
+
* Specifies the pivot point of the Popup
|
|
753
|
+
* ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
|
|
754
|
+
*/
|
|
755
|
+
popupAlign = { horizontal: 'left', vertical: 'top' };
|
|
756
|
+
/**
|
|
757
|
+
* Controls whether the component will copy the `anchor` font styles.
|
|
758
|
+
*/
|
|
759
|
+
copyAnchorStyles = false;
|
|
760
|
+
/**
|
|
761
|
+
* Specifies a list of CSS classes that will be added to the internal
|
|
762
|
+
* animated element ([see example]({% slug appearance_popup %})).
|
|
763
|
+
*
|
|
764
|
+
* > To style the content of the Popup, use this property binding.
|
|
765
|
+
*/
|
|
766
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
767
|
+
popupClass;
|
|
768
|
+
/**
|
|
769
|
+
* Specifies the position mode of the component. By default, the Popup uses fixed positioning.
|
|
770
|
+
* To make the Popup acquire absolute positioning, set this option to `absolute`.
|
|
771
|
+
*
|
|
772
|
+
* > If you need to support mobile browsers with the zoom option,
|
|
773
|
+
* use the `absolute` positioning of the Popup.
|
|
774
|
+
*
|
|
775
|
+
* @example
|
|
776
|
+
* ```html
|
|
777
|
+
* <style>
|
|
778
|
+
* .parent-content {
|
|
779
|
+
* position: relative;
|
|
780
|
+
* width: 200px;
|
|
781
|
+
* height: 200px;
|
|
782
|
+
* overflow: auto;
|
|
783
|
+
* margin: 200px auto;
|
|
784
|
+
* border: 1px solid red;
|
|
785
|
+
* }
|
|
786
|
+
* .content {
|
|
787
|
+
* position: relative;
|
|
788
|
+
* width: 100px;
|
|
789
|
+
* height: 100px;
|
|
790
|
+
* overflow: auto;
|
|
791
|
+
* margin: 300px;
|
|
792
|
+
* border: 1px solid blue;
|
|
793
|
+
* }
|
|
794
|
+
* .anchor {
|
|
795
|
+
* position: absolute;
|
|
796
|
+
* top: 200px;
|
|
797
|
+
* left: 200px;
|
|
798
|
+
* }
|
|
799
|
+
* </style>
|
|
800
|
+
* ```
|
|
801
|
+
* ```ts
|
|
802
|
+
* _@Component({
|
|
803
|
+
* selector: 'my-app',
|
|
804
|
+
* template: `
|
|
805
|
+
* <div class="example-config">
|
|
806
|
+
* Position mode:
|
|
807
|
+
* <label><input type="radio" value="fixed" [(ngModel)]="mode" /> Fixed</label>
|
|
808
|
+
* <label><input type="radio" value="absolute" [(ngModel)]="mode" /> Absolute</label>
|
|
809
|
+
* </div>
|
|
810
|
+
* <div class="example-config">
|
|
811
|
+
* Append to
|
|
812
|
+
* <label>
|
|
813
|
+
* <input type="radio" name="place" [value]="1" [(ngModel)]="checked" />
|
|
814
|
+
* Root component
|
|
815
|
+
* </label>
|
|
816
|
+
* <label>
|
|
817
|
+
* <input type="radio" name="place" [value]="2" [(ngModel)]="checked" />
|
|
818
|
+
* <span [style.color]="'red'">Red Container</span>
|
|
819
|
+
* </label>
|
|
820
|
+
* <label>
|
|
821
|
+
* <input type="radio" name="place" [value]="3" [(ngModel)]="checked" />
|
|
822
|
+
* <span [style.color]="'blue'">Blue Container</span>
|
|
823
|
+
* </label>
|
|
824
|
+
* </div>
|
|
825
|
+
* <div class="example">
|
|
826
|
+
* <div class="parent-content" [scrollLeft]="250" [scrollTop]="230">
|
|
827
|
+
* <div class="content" [scrollLeft]="170" [scrollTop]="165">
|
|
828
|
+
* <button #anchor class="anchor" (click)="show = !show">Toggle</button>
|
|
829
|
+
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 3">
|
|
830
|
+
* <ul>
|
|
831
|
+
* <li>Item1</li>
|
|
832
|
+
* <li>Item2</li>
|
|
833
|
+
* <li>Item3</li>
|
|
834
|
+
* </ul>
|
|
835
|
+
* </kendo-popup>
|
|
836
|
+
* <span [style.position]="'absolute'" [style.top.px]="400" [style.left.px]="400">Bottom/Right</span>
|
|
837
|
+
* </div>
|
|
838
|
+
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 2">
|
|
839
|
+
* <ul>
|
|
840
|
+
* <li>Item1</li>
|
|
841
|
+
* <li>Item2</li>
|
|
842
|
+
* <li>Item3</li>
|
|
843
|
+
* </ul>
|
|
844
|
+
* </kendo-popup>
|
|
845
|
+
* <span [style.position]="'absolute'" [style.top.px]="600" [style.left.px]="600">Bottom/Right</span>
|
|
846
|
+
* </div>
|
|
847
|
+
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 1">
|
|
848
|
+
* <ul>
|
|
849
|
+
* <li>Item1</li>
|
|
850
|
+
* <li>Item2</li>
|
|
851
|
+
* <li>Item3</li>
|
|
852
|
+
* </ul>
|
|
853
|
+
* </kendo-popup>
|
|
854
|
+
* </div>
|
|
855
|
+
* `
|
|
856
|
+
* })
|
|
857
|
+
* class AppComponent {
|
|
858
|
+
* public checked: number = 3;
|
|
859
|
+
* public mode: string = 'absolute';
|
|
860
|
+
* public show: boolean = true;
|
|
861
|
+
* }
|
|
862
|
+
* ```
|
|
863
|
+
*/
|
|
864
|
+
positionMode = 'fixed';
|
|
865
|
+
/**
|
|
866
|
+
* Specifies the absolute position of the element
|
|
867
|
+
* ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-absolute-points)).
|
|
868
|
+
* The Popup opens next to that point. The Popup pivot point is defined by the `popupAlign` configuration option.
|
|
869
|
+
* The boundary detection is applied by using the window viewport.
|
|
870
|
+
*/
|
|
871
|
+
offset = DEFAULT_OFFSET;
|
|
872
|
+
/**
|
|
873
|
+
* Specifies the margin value that will be added to the popup dimensions in pixels and leaves a blank space
|
|
874
|
+
* between the popup and the anchor ([see example]({% slug alignmentpositioning_popup %}#toc-adding-a-margin)).
|
|
875
|
+
*/
|
|
876
|
+
margin;
|
|
877
|
+
/**
|
|
878
|
+
* Fires when the anchor is scrolled outside the screen boundaries.
|
|
879
|
+
* ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
|
|
880
|
+
*/
|
|
881
|
+
anchorViewportLeave = new EventEmitter();
|
|
882
|
+
/**
|
|
883
|
+
* Fires after the component is closed.
|
|
884
|
+
*/
|
|
885
|
+
close = new EventEmitter();
|
|
886
|
+
/**
|
|
887
|
+
* Fires after the component is opened and the opening animation ends.
|
|
888
|
+
*/
|
|
889
|
+
open = new EventEmitter();
|
|
890
|
+
/**
|
|
891
|
+
* Fires after the component is opened and the Popup is positioned.
|
|
892
|
+
*/
|
|
893
|
+
positionChange = new EventEmitter();
|
|
894
|
+
/**
|
|
895
|
+
* @hidden
|
|
896
|
+
*/
|
|
897
|
+
contentContainer;
|
|
898
|
+
/**
|
|
899
|
+
* @hidden
|
|
900
|
+
*/
|
|
901
|
+
resizeSensor;
|
|
902
|
+
/**
|
|
903
|
+
* @hidden
|
|
904
|
+
*/
|
|
905
|
+
content;
|
|
906
|
+
resolvedPromise = Promise.resolve(null);
|
|
907
|
+
_currentOffset;
|
|
908
|
+
animationSubscriptions;
|
|
909
|
+
repositionSubscription;
|
|
910
|
+
initialCheck = true;
|
|
706
911
|
constructor(container, _alignService, domService, _positionService, _resizeService, _scrollableService, animationService, _renderer, _zone) {
|
|
707
912
|
this.container = container;
|
|
708
913
|
this._alignService = _alignService;
|
|
@@ -713,153 +918,6 @@ class PopupComponent {
|
|
|
713
918
|
this.animationService = animationService;
|
|
714
919
|
this._renderer = _renderer;
|
|
715
920
|
this._zone = _zone;
|
|
716
|
-
/**
|
|
717
|
-
* Controls the Popup animation. By default, the opening and closing animations
|
|
718
|
-
* are enabled ([see example]({% slug animations_popup %})).
|
|
719
|
-
*/
|
|
720
|
-
this.animate = true;
|
|
721
|
-
/**
|
|
722
|
-
* Specifies the anchor pivot point
|
|
723
|
-
* ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
|
|
724
|
-
*/
|
|
725
|
-
this.anchorAlign = { horizontal: 'left', vertical: 'bottom' };
|
|
726
|
-
/**
|
|
727
|
-
* Configures the collision behavior of the Popup
|
|
728
|
-
* ([see example]({% slug viewportboundarydetection_popup %})).
|
|
729
|
-
*/
|
|
730
|
-
this.collision = { horizontal: 'fit', vertical: 'flip' };
|
|
731
|
-
/**
|
|
732
|
-
* Specifies the pivot point of the Popup
|
|
733
|
-
* ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
|
|
734
|
-
*/
|
|
735
|
-
this.popupAlign = { horizontal: 'left', vertical: 'top' };
|
|
736
|
-
/**
|
|
737
|
-
* Controls whether the component will copy the `anchor` font styles.
|
|
738
|
-
*/
|
|
739
|
-
this.copyAnchorStyles = false;
|
|
740
|
-
/**
|
|
741
|
-
* Specifies the position mode of the component. By default, the Popup uses fixed positioning.
|
|
742
|
-
* To make the Popup acquire absolute positioning, set this option to `absolute`.
|
|
743
|
-
*
|
|
744
|
-
* > If you need to support mobile browsers with the zoom option,
|
|
745
|
-
* use the `absolute` positioning of the Popup.
|
|
746
|
-
*
|
|
747
|
-
* @example
|
|
748
|
-
* ```html
|
|
749
|
-
* <style>
|
|
750
|
-
* .parent-content {
|
|
751
|
-
* position: relative;
|
|
752
|
-
* width: 200px;
|
|
753
|
-
* height: 200px;
|
|
754
|
-
* overflow: auto;
|
|
755
|
-
* margin: 200px auto;
|
|
756
|
-
* border: 1px solid red;
|
|
757
|
-
* }
|
|
758
|
-
* .content {
|
|
759
|
-
* position: relative;
|
|
760
|
-
* width: 100px;
|
|
761
|
-
* height: 100px;
|
|
762
|
-
* overflow: auto;
|
|
763
|
-
* margin: 300px;
|
|
764
|
-
* border: 1px solid blue;
|
|
765
|
-
* }
|
|
766
|
-
* .anchor {
|
|
767
|
-
* position: absolute;
|
|
768
|
-
* top: 200px;
|
|
769
|
-
* left: 200px;
|
|
770
|
-
* }
|
|
771
|
-
* </style>
|
|
772
|
-
* ```
|
|
773
|
-
* ```ts
|
|
774
|
-
* _@Component({
|
|
775
|
-
* selector: 'my-app',
|
|
776
|
-
* template: `
|
|
777
|
-
* <div class="example-config">
|
|
778
|
-
* Position mode:
|
|
779
|
-
* <label><input type="radio" value="fixed" [(ngModel)]="mode" /> Fixed</label>
|
|
780
|
-
* <label><input type="radio" value="absolute" [(ngModel)]="mode" /> Absolute</label>
|
|
781
|
-
* </div>
|
|
782
|
-
* <div class="example-config">
|
|
783
|
-
* Append to
|
|
784
|
-
* <label>
|
|
785
|
-
* <input type="radio" name="place" [value]="1" [(ngModel)]="checked" />
|
|
786
|
-
* Root component
|
|
787
|
-
* </label>
|
|
788
|
-
* <label>
|
|
789
|
-
* <input type="radio" name="place" [value]="2" [(ngModel)]="checked" />
|
|
790
|
-
* <span [style.color]="'red'">Red Container</span>
|
|
791
|
-
* </label>
|
|
792
|
-
* <label>
|
|
793
|
-
* <input type="radio" name="place" [value]="3" [(ngModel)]="checked" />
|
|
794
|
-
* <span [style.color]="'blue'">Blue Container</span>
|
|
795
|
-
* </label>
|
|
796
|
-
* </div>
|
|
797
|
-
* <div class="example">
|
|
798
|
-
* <div class="parent-content" [scrollLeft]="250" [scrollTop]="230">
|
|
799
|
-
* <div class="content" [scrollLeft]="170" [scrollTop]="165">
|
|
800
|
-
* <button #anchor class="anchor" (click)="show = !show">Toggle</button>
|
|
801
|
-
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 3">
|
|
802
|
-
* <ul>
|
|
803
|
-
* <li>Item1</li>
|
|
804
|
-
* <li>Item2</li>
|
|
805
|
-
* <li>Item3</li>
|
|
806
|
-
* </ul>
|
|
807
|
-
* </kendo-popup>
|
|
808
|
-
* <span [style.position]="'absolute'" [style.top.px]="400" [style.left.px]="400">Bottom/Right</span>
|
|
809
|
-
* </div>
|
|
810
|
-
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 2">
|
|
811
|
-
* <ul>
|
|
812
|
-
* <li>Item1</li>
|
|
813
|
-
* <li>Item2</li>
|
|
814
|
-
* <li>Item3</li>
|
|
815
|
-
* </ul>
|
|
816
|
-
* </kendo-popup>
|
|
817
|
-
* <span [style.position]="'absolute'" [style.top.px]="600" [style.left.px]="600">Bottom/Right</span>
|
|
818
|
-
* </div>
|
|
819
|
-
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 1">
|
|
820
|
-
* <ul>
|
|
821
|
-
* <li>Item1</li>
|
|
822
|
-
* <li>Item2</li>
|
|
823
|
-
* <li>Item3</li>
|
|
824
|
-
* </ul>
|
|
825
|
-
* </kendo-popup>
|
|
826
|
-
* </div>
|
|
827
|
-
* `
|
|
828
|
-
* })
|
|
829
|
-
* class AppComponent {
|
|
830
|
-
* public checked: number = 3;
|
|
831
|
-
* public mode: string = 'absolute';
|
|
832
|
-
* public show: boolean = true;
|
|
833
|
-
* }
|
|
834
|
-
* ```
|
|
835
|
-
*/
|
|
836
|
-
this.positionMode = 'fixed';
|
|
837
|
-
/**
|
|
838
|
-
* Specifies the absolute position of the element
|
|
839
|
-
* ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-absolute-points)).
|
|
840
|
-
* The Popup opens next to that point. The Popup pivot point is defined by the `popupAlign` configuration option.
|
|
841
|
-
* The boundary detection is applied by using the window viewport.
|
|
842
|
-
*/
|
|
843
|
-
this.offset = DEFAULT_OFFSET;
|
|
844
|
-
/**
|
|
845
|
-
* Fires when the anchor is scrolled outside the screen boundaries.
|
|
846
|
-
* ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
|
|
847
|
-
*/
|
|
848
|
-
this.anchorViewportLeave = new EventEmitter();
|
|
849
|
-
/**
|
|
850
|
-
* Fires after the component is closed.
|
|
851
|
-
*/
|
|
852
|
-
this.close = new EventEmitter();
|
|
853
|
-
/**
|
|
854
|
-
* Fires after the component is opened and the opening animation ends.
|
|
855
|
-
*/
|
|
856
|
-
this.open = new EventEmitter();
|
|
857
|
-
/**
|
|
858
|
-
* Fires after the component is opened and the Popup is positioned.
|
|
859
|
-
*/
|
|
860
|
-
this.positionChange = new EventEmitter();
|
|
861
|
-
this.resolvedPromise = Promise.resolve(null);
|
|
862
|
-
this.initialCheck = true;
|
|
863
921
|
validatePackage(packageMetadata);
|
|
864
922
|
this._renderer.addClass(container.nativeElement, ANIMATION_CONTAINER);
|
|
865
923
|
this.updateFixedClass();
|
|
@@ -1009,9 +1067,8 @@ class PopupComponent {
|
|
|
1009
1067
|
this.repositionSubscription.unsubscribe();
|
|
1010
1068
|
}
|
|
1011
1069
|
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
PopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PopupComponent, isStandalone: true, selector: "kendo-popup", inputs: { animate: "animate", anchor: "anchor", anchorAlign: "anchorAlign", collision: "collision", popupAlign: "popupAlign", copyAnchorStyles: "copyAnchorStyles", popupClass: "popupClass", positionMode: "positionMode", offset: "offset", margin: "margin" }, outputs: { anchorViewportLeave: "anchorViewportLeave", close: "close", open: "open", positionChange: "positionChange" }, providers: [AlignService, AnimationService, DOMService, PositionService, ResizeService, ScrollableService], viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "resizeSensor", first: true, predicate: ResizeSensorComponent, descendants: true, static: true }], exportAs: ["kendo-popup"], usesOnChanges: true, ngImport: i0, template: `
|
|
1070
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupComponent, deps: [{ token: i0.ElementRef }, { token: AlignService }, { token: DOMService }, { token: PositionService }, { token: ResizeService }, { token: ScrollableService }, { token: AnimationService }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
1071
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PopupComponent, isStandalone: true, selector: "kendo-popup", inputs: { animate: "animate", anchor: "anchor", anchorAlign: "anchorAlign", collision: "collision", popupAlign: "popupAlign", copyAnchorStyles: "copyAnchorStyles", popupClass: "popupClass", positionMode: "positionMode", offset: "offset", margin: "margin" }, outputs: { anchorViewportLeave: "anchorViewportLeave", close: "close", open: "open", positionChange: "positionChange" }, providers: [AlignService, AnimationService, DOMService, PositionService, ResizeService, ScrollableService], viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "resizeSensor", first: true, predicate: ResizeSensorComponent, descendants: true, static: true }], exportAs: ["kendo-popup"], usesOnChanges: true, ngImport: i0, template: `
|
|
1015
1072
|
<div class="k-child-animation-container">
|
|
1016
1073
|
<div class="k-popup" [ngClass]="popupClass" #container>
|
|
1017
1074
|
<ng-content></ng-content>
|
|
@@ -1021,7 +1078,8 @@ PopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
1021
1078
|
</div>
|
|
1022
1079
|
</div>
|
|
1023
1080
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }] });
|
|
1024
|
-
|
|
1081
|
+
}
|
|
1082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupComponent, decorators: [{
|
|
1025
1083
|
type: Component,
|
|
1026
1084
|
args: [{
|
|
1027
1085
|
exportAs: 'kendo-popup',
|
|
@@ -1147,12 +1205,10 @@ const POPUP_CONTAINER = new InjectionToken('Popup Container');
|
|
|
1147
1205
|
* @class PopupService
|
|
1148
1206
|
*/
|
|
1149
1207
|
class PopupService {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
this.container = container;
|
|
1155
|
-
}
|
|
1208
|
+
applicationRef;
|
|
1209
|
+
componentFactoryResolver;
|
|
1210
|
+
injector;
|
|
1211
|
+
container;
|
|
1156
1212
|
/**
|
|
1157
1213
|
* Gets the root view container into which the component will be injected.
|
|
1158
1214
|
*
|
|
@@ -1177,6 +1233,12 @@ class PopupService {
|
|
|
1177
1233
|
get rootViewContainerNode() {
|
|
1178
1234
|
return this.container ? this.container.nativeElement : this.getComponentRootNode(this.rootViewContainer);
|
|
1179
1235
|
}
|
|
1236
|
+
constructor(applicationRef, componentFactoryResolver, injector, container) {
|
|
1237
|
+
this.applicationRef = applicationRef;
|
|
1238
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1239
|
+
this.injector = injector;
|
|
1240
|
+
this.container = container;
|
|
1241
|
+
}
|
|
1180
1242
|
/**
|
|
1181
1243
|
* Opens a Popup component. Created Popups are mounted
|
|
1182
1244
|
* in the DOM directly in the root application component.
|
|
@@ -1322,10 +1384,10 @@ class PopupService {
|
|
|
1322
1384
|
]
|
|
1323
1385
|
};
|
|
1324
1386
|
}
|
|
1387
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupService, deps: [{ token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: POPUP_CONTAINER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1388
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupService, providedIn: 'root' });
|
|
1325
1389
|
}
|
|
1326
|
-
|
|
1327
|
-
PopupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopupService, providedIn: 'root' });
|
|
1328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopupService, decorators: [{
|
|
1390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupService, decorators: [{
|
|
1329
1391
|
type: Injectable,
|
|
1330
1392
|
args: [{
|
|
1331
1393
|
providedIn: 'root'
|
|
@@ -1377,15 +1439,15 @@ const KENDO_POPUP = [
|
|
|
1377
1439
|
* ```
|
|
1378
1440
|
*/
|
|
1379
1441
|
class PopupModule {
|
|
1442
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1443
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PopupModule, imports: [i1$1.ResizeSensorComponent, PopupComponent], exports: [PopupComponent] });
|
|
1444
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupModule, providers: [PopupService, ResizeBatchService], imports: [KENDO_RESIZESENSOR, KENDO_POPUP] });
|
|
1380
1445
|
}
|
|
1381
|
-
|
|
1382
|
-
PopupModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PopupModule, imports: [ResizeSensorComponent, PopupComponent], exports: [PopupComponent] });
|
|
1383
|
-
PopupModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopupModule, providers: [PopupService, ResizeBatchService], imports: [ResizeSensorComponent, KENDO_POPUP] });
|
|
1384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopupModule, decorators: [{
|
|
1446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopupModule, decorators: [{
|
|
1385
1447
|
type: NgModule,
|
|
1386
1448
|
args: [{
|
|
1387
1449
|
exports: [...KENDO_POPUP],
|
|
1388
|
-
imports: [
|
|
1450
|
+
imports: [...KENDO_RESIZESENSOR, ...KENDO_POPUP],
|
|
1389
1451
|
providers: [PopupService, ResizeBatchService]
|
|
1390
1452
|
}]
|
|
1391
1453
|
}] });
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* - `fit`—Moves the Popup horizontally until it is fully displayed in the viewport.
|
|
10
10
|
* - `flip`—Flips the Popup position based on the origin and the position properties.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type CollisionType = 'fit' | 'flip';
|
|
@@ -22,5 +22,5 @@ export interface PopupAnimation {
|
|
|
22
22
|
*/
|
|
23
23
|
direction: AnimationDirection;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type AnimationType = 'slide' | 'expand' | 'zoom' | 'fade';
|
|
26
|
+
export type AnimationDirection = 'down' | 'up' | 'left' | 'right';
|