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