@progress/kendo-angular-popup 19.1.1-develop.2 → 19.1.2-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/esm2022/models/position-mode.mjs +1 -1
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/popup.component.mjs +27 -129
- package/esm2022/popup.module.mjs +1 -3
- package/esm2022/popup.service.mjs +32 -69
- package/esm2022/scale.mjs +3 -7
- package/fesm2022/progress-kendo-angular-popup.mjs +65 -210
- package/models/align.interface.d.ts +3 -3
- package/models/collision.interface.d.ts +3 -3
- package/models/collision.type.d.ts +0 -1
- package/models/margin.interface.d.ts +3 -3
- package/models/offset.interface.d.ts +3 -3
- package/models/popup-animation.interface.d.ts +9 -3
- package/models/popup-ref.d.ts +8 -11
- package/models/popup-settings.d.ts +14 -25
- package/models/position-mode.d.ts +1 -1
- package/package.json +4 -4
- package/popup.component.d.ts +27 -129
- package/popup.module.d.ts +1 -3
- package/popup.service.d.ts +32 -69
- package/scale.d.ts +3 -7
|
@@ -321,15 +321,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
321
321
|
}] });
|
|
322
322
|
|
|
323
323
|
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
* The document or container scale is required to compute the popup position correctly. Detecting the scale is not reliable and must be set by providing a value for SCALE. See [Support for Document Scale]({% slug documentscale_popup %}).
|
|
327
|
-
*
|
|
328
|
-
* > Using this token is not necessary for user-applied browser zoom.
|
|
329
|
-
*
|
|
330
|
-
* <demo metaUrl="popup/scale/" height="300"></demo>
|
|
324
|
+
* Use the `SCALE` injection token to set the document scale when you use a [scale transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale).
|
|
331
325
|
*
|
|
326
|
+
* The document or container scale is required to compute the popup position correctly. Set the value for `SCALE` to ensure correct positioning. See [Support for Document Scale]({% slug documentscale_popup %}).
|
|
332
327
|
*
|
|
328
|
+
* > You do not need to use this token for user-applied browser zoom.
|
|
333
329
|
*/
|
|
334
330
|
const SCALE = new InjectionToken('Popup Document Scale');
|
|
335
331
|
|
|
@@ -688,8 +684,8 @@ const packageMetadata = {
|
|
|
688
684
|
productName: 'Kendo UI for Angular',
|
|
689
685
|
productCode: 'KENDOUIANGULAR',
|
|
690
686
|
productCodes: ['KENDOUIANGULAR'],
|
|
691
|
-
publishDate:
|
|
692
|
-
version: '19.1.
|
|
687
|
+
publishDate: 1749804025,
|
|
688
|
+
version: '19.1.2-develop.1',
|
|
693
689
|
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'
|
|
694
690
|
};
|
|
695
691
|
|
|
@@ -700,19 +696,11 @@ const ANIMATION_CONTAINER_FIXED = 'k-animation-container-fixed';
|
|
|
700
696
|
* Represents the [Kendo UI Popup component for Angular]({% slug overview_popup %}).
|
|
701
697
|
*
|
|
702
698
|
* @example
|
|
703
|
-
* ```
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* <kendo-popup *ngIf="show" [anchor]="anchor">
|
|
709
|
-
* <strong>Popup content!</strong>
|
|
710
|
-
* </kendo-popup>
|
|
711
|
-
* `
|
|
712
|
-
* })
|
|
713
|
-
* class AppComponent {
|
|
714
|
-
* public show: boolean = false;
|
|
715
|
-
* }
|
|
699
|
+
* ```html
|
|
700
|
+
* <button #anchor (click)="show = !show">Toggle</button>
|
|
701
|
+
* <kendo-popup *ngIf="show" [anchor]="anchor">
|
|
702
|
+
* <strong>Popup content!</strong>
|
|
703
|
+
* </kendo-popup>
|
|
716
704
|
* ```
|
|
717
705
|
*/
|
|
718
706
|
class PopupComponent {
|
|
@@ -726,162 +714,68 @@ class PopupComponent {
|
|
|
726
714
|
_renderer;
|
|
727
715
|
_zone;
|
|
728
716
|
/**
|
|
729
|
-
* Controls the Popup animation. By default, the opening and closing animations
|
|
730
|
-
*
|
|
717
|
+
* Controls the Popup animation. By default, the opening and closing animations are enabled ([see example]({% slug animations_popup %})).
|
|
718
|
+
* @default true
|
|
731
719
|
*/
|
|
732
720
|
animate = true;
|
|
733
721
|
/**
|
|
734
|
-
*
|
|
735
|
-
* ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-components)).
|
|
722
|
+
* Sets the element to use as an anchor. The Popup opens next to this element. ([See example]({% slug alignmentpositioning_popup %}#toc-aligning-to-components)).
|
|
736
723
|
*/
|
|
737
724
|
anchor;
|
|
738
725
|
/**
|
|
739
|
-
*
|
|
740
|
-
*
|
|
726
|
+
* Sets the anchor pivot point ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
|
|
727
|
+
* @default '{ horizontal: "left", vertical: "bottom" }'
|
|
741
728
|
*/
|
|
742
729
|
anchorAlign = { horizontal: 'left', vertical: 'bottom' };
|
|
743
730
|
/**
|
|
744
|
-
*
|
|
745
|
-
*
|
|
731
|
+
* Sets the collision behavior of the Popup ([see example]({% slug viewportboundarydetection_popup %})).
|
|
732
|
+
* @default '{ horizontal: "fit", vertical: "flip" }'
|
|
746
733
|
*/
|
|
747
734
|
collision = { horizontal: 'fit', vertical: 'flip' };
|
|
748
735
|
/**
|
|
749
|
-
*
|
|
750
|
-
*
|
|
736
|
+
* Sets the pivot point of the Popup ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
|
|
737
|
+
* @default '{ horizontal: "left", vertical: "top" }'
|
|
751
738
|
*/
|
|
752
739
|
popupAlign = { horizontal: 'left', vertical: 'top' };
|
|
753
740
|
/**
|
|
754
|
-
* Controls whether the component
|
|
741
|
+
* Controls whether the component copies the `anchor` font styles.
|
|
742
|
+
* @default false
|
|
755
743
|
*/
|
|
756
744
|
copyAnchorStyles = false;
|
|
757
745
|
/**
|
|
758
|
-
*
|
|
759
|
-
* animated element ([see example]({% slug appearance_popup %})).
|
|
746
|
+
* Sets a list of CSS classes to add to the internal animated element ([see example]({% slug appearance_popup %})).
|
|
760
747
|
*
|
|
761
748
|
* > To style the content of the Popup, use this property binding.
|
|
762
749
|
*/
|
|
763
750
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
764
751
|
popupClass;
|
|
765
752
|
/**
|
|
766
|
-
*
|
|
767
|
-
* To make the Popup acquire absolute positioning, set this option to `absolute`.
|
|
753
|
+
* Sets the position mode of the component. By default, the Popup uses fixed positioning. To use absolute positioning, set this option to `absolute`.
|
|
768
754
|
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
* @example
|
|
773
|
-
* ```html
|
|
774
|
-
* <style>
|
|
775
|
-
* .parent-content {
|
|
776
|
-
* position: relative;
|
|
777
|
-
* width: 200px;
|
|
778
|
-
* height: 200px;
|
|
779
|
-
* overflow: auto;
|
|
780
|
-
* margin: 200px auto;
|
|
781
|
-
* border: 1px solid red;
|
|
782
|
-
* }
|
|
783
|
-
* .content {
|
|
784
|
-
* position: relative;
|
|
785
|
-
* width: 100px;
|
|
786
|
-
* height: 100px;
|
|
787
|
-
* overflow: auto;
|
|
788
|
-
* margin: 300px;
|
|
789
|
-
* border: 1px solid blue;
|
|
790
|
-
* }
|
|
791
|
-
* .anchor {
|
|
792
|
-
* position: absolute;
|
|
793
|
-
* top: 200px;
|
|
794
|
-
* left: 200px;
|
|
795
|
-
* }
|
|
796
|
-
* </style>
|
|
797
|
-
* ```
|
|
798
|
-
* ```ts
|
|
799
|
-
* _@Component({
|
|
800
|
-
* selector: 'my-app',
|
|
801
|
-
* template: `
|
|
802
|
-
* <div class="example-config">
|
|
803
|
-
* Position mode:
|
|
804
|
-
* <label><input type="radio" value="fixed" [(ngModel)]="mode" /> Fixed</label>
|
|
805
|
-
* <label><input type="radio" value="absolute" [(ngModel)]="mode" /> Absolute</label>
|
|
806
|
-
* </div>
|
|
807
|
-
* <div class="example-config">
|
|
808
|
-
* Append to
|
|
809
|
-
* <label>
|
|
810
|
-
* <input type="radio" name="place" [value]="1" [(ngModel)]="checked" />
|
|
811
|
-
* Root component
|
|
812
|
-
* </label>
|
|
813
|
-
* <label>
|
|
814
|
-
* <input type="radio" name="place" [value]="2" [(ngModel)]="checked" />
|
|
815
|
-
* <span [style.color]="'red'">Red Container</span>
|
|
816
|
-
* </label>
|
|
817
|
-
* <label>
|
|
818
|
-
* <input type="radio" name="place" [value]="3" [(ngModel)]="checked" />
|
|
819
|
-
* <span [style.color]="'blue'">Blue Container</span>
|
|
820
|
-
* </label>
|
|
821
|
-
* </div>
|
|
822
|
-
* <div class="example">
|
|
823
|
-
* <div class="parent-content" [scrollLeft]="250" [scrollTop]="230">
|
|
824
|
-
* <div class="content" [scrollLeft]="170" [scrollTop]="165">
|
|
825
|
-
* <button #anchor class="anchor" (click)="show = !show">Toggle</button>
|
|
826
|
-
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 3">
|
|
827
|
-
* <ul>
|
|
828
|
-
* <li>Item1</li>
|
|
829
|
-
* <li>Item2</li>
|
|
830
|
-
* <li>Item3</li>
|
|
831
|
-
* </ul>
|
|
832
|
-
* </kendo-popup>
|
|
833
|
-
* <span [style.position]="'absolute'" [style.top.px]="400" [style.left.px]="400">Bottom/Right</span>
|
|
834
|
-
* </div>
|
|
835
|
-
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 2">
|
|
836
|
-
* <ul>
|
|
837
|
-
* <li>Item1</li>
|
|
838
|
-
* <li>Item2</li>
|
|
839
|
-
* <li>Item3</li>
|
|
840
|
-
* </ul>
|
|
841
|
-
* </kendo-popup>
|
|
842
|
-
* <span [style.position]="'absolute'" [style.top.px]="600" [style.left.px]="600">Bottom/Right</span>
|
|
843
|
-
* </div>
|
|
844
|
-
* <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 1">
|
|
845
|
-
* <ul>
|
|
846
|
-
* <li>Item1</li>
|
|
847
|
-
* <li>Item2</li>
|
|
848
|
-
* <li>Item3</li>
|
|
849
|
-
* </ul>
|
|
850
|
-
* </kendo-popup>
|
|
851
|
-
* </div>
|
|
852
|
-
* `
|
|
853
|
-
* })
|
|
854
|
-
* class AppComponent {
|
|
855
|
-
* public checked: number = 3;
|
|
856
|
-
* public mode: string = 'absolute';
|
|
857
|
-
* public show: boolean = true;
|
|
858
|
-
* }
|
|
859
|
-
* ```
|
|
755
|
+
* To support mobile browsers with the zoom option, use the `absolute` positioning of the Popup.
|
|
756
|
+
* @default 'fixed'
|
|
860
757
|
*/
|
|
861
758
|
positionMode = 'fixed';
|
|
862
759
|
/**
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
866
|
-
* The boundary detection is applied by using the window viewport.
|
|
760
|
+
* Sets the absolute position of the element ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-absolute-points)).
|
|
761
|
+
* The Popup opens next to this point. The Popup pivot point is defined by the `popupAlign` option. The boundary detection uses the window viewport.
|
|
762
|
+
* @default '{ left: -10000, top: 0 }'
|
|
867
763
|
*/
|
|
868
764
|
offset = DEFAULT_OFFSET;
|
|
869
765
|
/**
|
|
870
|
-
*
|
|
871
|
-
* between the popup and the anchor ([see example]({% slug alignmentpositioning_popup %}#toc-adding-a-margin)).
|
|
766
|
+
* Sets the margin value in pixels. Adds blank space between the Popup and the anchor ([see example]({% slug alignmentpositioning_popup %}#toc-adding-a-margin)).
|
|
872
767
|
*/
|
|
873
768
|
margin;
|
|
874
769
|
/**
|
|
875
|
-
* Fires when the anchor
|
|
876
|
-
* ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
|
|
770
|
+
* Fires when the anchor scrolls outside the screen boundaries. ([See example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
|
|
877
771
|
*/
|
|
878
772
|
anchorViewportLeave = new EventEmitter();
|
|
879
773
|
/**
|
|
880
|
-
* Fires after the component
|
|
774
|
+
* Fires after the component closes.
|
|
881
775
|
*/
|
|
882
776
|
close = new EventEmitter();
|
|
883
777
|
/**
|
|
884
|
-
* Fires after the component
|
|
778
|
+
* Fires after the component opens and the opening animation ends.
|
|
885
779
|
*/
|
|
886
780
|
open = new EventEmitter();
|
|
887
781
|
/**
|
|
@@ -1141,15 +1035,13 @@ const removeElement = (element) => {
|
|
|
1141
1035
|
}
|
|
1142
1036
|
};
|
|
1143
1037
|
/**
|
|
1144
|
-
*
|
|
1145
|
-
* the application is used.
|
|
1038
|
+
* Injects the Popup container. If not set, uses the first root component of the application.
|
|
1146
1039
|
*
|
|
1147
|
-
* >
|
|
1040
|
+
* > Use `POPUP_CONTAINER` only with the `PopupService` class ([see example](slug:service_popup)).
|
|
1148
1041
|
*
|
|
1149
|
-
* In
|
|
1042
|
+
* In standalone components:
|
|
1150
1043
|
*
|
|
1151
1044
|
* @example
|
|
1152
|
-
*
|
|
1153
1045
|
* ```ts
|
|
1154
1046
|
* import { Component } from '@angular/core';
|
|
1155
1047
|
* import { KENDO_POPUP, PopupService } from '@progress/kendo-angular-popup';
|
|
@@ -1170,19 +1062,18 @@ const removeElement = (element) => {
|
|
|
1170
1062
|
* export class AppComponent {}
|
|
1171
1063
|
* ```
|
|
1172
1064
|
*
|
|
1173
|
-
* In
|
|
1065
|
+
* In NgModule-based applications:
|
|
1174
1066
|
*
|
|
1175
1067
|
* @example
|
|
1176
|
-
*
|
|
1177
|
-
* ```ts-no-run
|
|
1068
|
+
* ```ts
|
|
1178
1069
|
* import { PopupModule, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
|
|
1179
1070
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
1180
1071
|
* import { ElementRef, NgModule } from '@angular/core';
|
|
1181
1072
|
* import { AppComponent } from './app.component';
|
|
1182
1073
|
*
|
|
1183
1074
|
* _@NgModule({
|
|
1184
|
-
* declarations: [AppComponent],
|
|
1185
|
-
* imports: [BrowserModule, PopupModule],
|
|
1075
|
+
* declarations: [AppComponent],
|
|
1076
|
+
* imports: [BrowserModule, PopupModule],
|
|
1186
1077
|
* bootstrap: [AppComponent],
|
|
1187
1078
|
* providers: [{
|
|
1188
1079
|
* provide: POPUP_CONTAINER,
|
|
@@ -1199,8 +1090,7 @@ const removeElement = (element) => {
|
|
|
1199
1090
|
*/
|
|
1200
1091
|
const POPUP_CONTAINER = new InjectionToken('Popup Container');
|
|
1201
1092
|
/**
|
|
1202
|
-
*
|
|
1203
|
-
* ([see example]({% slug service_popup %})).
|
|
1093
|
+
* Provides a service for opening Popup components dynamically ([see example]({% slug service_popup %})).
|
|
1204
1094
|
*
|
|
1205
1095
|
* @export
|
|
1206
1096
|
* @class PopupService
|
|
@@ -1211,9 +1101,9 @@ class PopupService {
|
|
|
1211
1101
|
injector;
|
|
1212
1102
|
container;
|
|
1213
1103
|
/**
|
|
1214
|
-
* Gets the root view container
|
|
1104
|
+
* Gets the root view container for injecting the component.
|
|
1215
1105
|
*
|
|
1216
|
-
* @returns {ComponentRef<any>}
|
|
1106
|
+
* @returns {ComponentRef<any>} The root view container reference.
|
|
1217
1107
|
*/
|
|
1218
1108
|
get rootViewContainer() {
|
|
1219
1109
|
// https://github.com/angular/angular/blob/4.0.x/packages/core/src/application_ref.ts#L571
|
|
@@ -1227,9 +1117,9 @@ class PopupService {
|
|
|
1227
1117
|
`);
|
|
1228
1118
|
}
|
|
1229
1119
|
/**
|
|
1230
|
-
*
|
|
1120
|
+
* Gets the HTML element of the root component container.
|
|
1231
1121
|
*
|
|
1232
|
-
* @returns {HTMLElement}
|
|
1122
|
+
* @returns {HTMLElement} The root container HTML element.
|
|
1233
1123
|
*/
|
|
1234
1124
|
get rootViewContainerNode() {
|
|
1235
1125
|
return this.container ? this.container.nativeElement : this.getComponentRootNode(this.rootViewContainer);
|
|
@@ -1241,43 +1131,10 @@ class PopupService {
|
|
|
1241
1131
|
this.container = container;
|
|
1242
1132
|
}
|
|
1243
1133
|
/**
|
|
1244
|
-
* Opens a Popup component.
|
|
1245
|
-
* in the DOM directly in the root application component.
|
|
1246
|
-
*
|
|
1247
|
-
* @param {PopupSettings} options - The options which define the Popup.
|
|
1248
|
-
* @returns {ComponentRef<PopupComponent>} - A reference to the Popup object.
|
|
1249
|
-
*
|
|
1250
|
-
* @example
|
|
1134
|
+
* Opens a Popup component. The Popup mounts in the DOM under the root application component.
|
|
1251
1135
|
*
|
|
1252
|
-
*
|
|
1253
|
-
*
|
|
1254
|
-
* selector: 'my-app',
|
|
1255
|
-
* template: `
|
|
1256
|
-
* <ng-template #template>
|
|
1257
|
-
* Popup content
|
|
1258
|
-
* </ng-template>
|
|
1259
|
-
* <button #anchor kendoButton (click)="open(anchor, template)">Open</button>
|
|
1260
|
-
* `
|
|
1261
|
-
* })
|
|
1262
|
-
* export class AppComponent {
|
|
1263
|
-
* public popupRef: PopupRef;
|
|
1264
|
-
*
|
|
1265
|
-
* constructor( private popupService: PopupService ) {}
|
|
1266
|
-
*
|
|
1267
|
-
* public open(anchor: ElementRef, template: TemplateRef<any>): void {
|
|
1268
|
-
* if (this.popupRef) {
|
|
1269
|
-
* this.popupRef.close();
|
|
1270
|
-
* this.popupRef = null;
|
|
1271
|
-
* return;
|
|
1272
|
-
* }
|
|
1273
|
-
*
|
|
1274
|
-
* this.popupRef = this.popupService.open({
|
|
1275
|
-
* anchor: anchor,
|
|
1276
|
-
* content: template
|
|
1277
|
-
* });
|
|
1278
|
-
* }
|
|
1279
|
-
* }
|
|
1280
|
-
* ```
|
|
1136
|
+
* @param {PopupSettings} options - The options for the Popup.
|
|
1137
|
+
* @returns {ComponentRef<PopupComponent>} A reference to the Popup object.
|
|
1281
1138
|
*/
|
|
1282
1139
|
open(options = {}) {
|
|
1283
1140
|
const { component, nodes } = this.contentFrom(options.content);
|
|
@@ -1324,28 +1181,28 @@ class PopupService {
|
|
|
1324
1181
|
/**
|
|
1325
1182
|
* Gets the HTML element for a component reference.
|
|
1326
1183
|
*
|
|
1327
|
-
* @param {ComponentRef<any>} componentRef
|
|
1328
|
-
* @returns {HTMLElement}
|
|
1184
|
+
* @param {ComponentRef<any>} componentRef The component reference.
|
|
1185
|
+
* @returns {HTMLElement} The root HTML element of the component.
|
|
1329
1186
|
*/
|
|
1330
1187
|
getComponentRootNode(componentRef) {
|
|
1331
1188
|
return componentRef.location.nativeElement;
|
|
1332
1189
|
}
|
|
1333
1190
|
/**
|
|
1334
|
-
* Gets the `ComponentFactory` instance by
|
|
1191
|
+
* Gets the `ComponentFactory` instance by type.
|
|
1335
1192
|
*
|
|
1336
|
-
* @param {*} componentClass
|
|
1337
|
-
* @
|
|
1338
|
-
* @returns {ComponentRef<any>}
|
|
1193
|
+
* @param {*} componentClass The component class.
|
|
1194
|
+
* @returns {ComponentFactory<any>} The component factory instance.
|
|
1339
1195
|
*/
|
|
1340
1196
|
getComponentFactory(componentClass) {
|
|
1341
1197
|
return this.componentFactoryResolver.resolveComponentFactory(componentClass);
|
|
1342
1198
|
}
|
|
1343
1199
|
/**
|
|
1344
|
-
* Creates a component reference from a `Component`
|
|
1200
|
+
* Creates a component reference from a `Component` class.
|
|
1345
1201
|
*
|
|
1346
|
-
* @param {*} componentClass
|
|
1347
|
-
* @param {*} nodes
|
|
1348
|
-
* @
|
|
1202
|
+
* @param {*} componentClass The component class.
|
|
1203
|
+
* @param {*} nodes The nodes to project.
|
|
1204
|
+
* @param {ViewContainerRef} container The container to use.
|
|
1205
|
+
* @returns {ComponentRef<any>} The created component reference.
|
|
1349
1206
|
*/
|
|
1350
1207
|
createComponent(componentClass, nodes, container) {
|
|
1351
1208
|
const factory = this.getComponentFactory(componentClass);
|
|
@@ -1359,11 +1216,11 @@ class PopupService {
|
|
|
1359
1216
|
}
|
|
1360
1217
|
}
|
|
1361
1218
|
/**
|
|
1362
|
-
* Projects the
|
|
1219
|
+
* Projects the input options onto the component instance.
|
|
1363
1220
|
*
|
|
1364
|
-
* @param {ComponentRef<any>} component
|
|
1365
|
-
* @param {*} options
|
|
1366
|
-
* @returns {ComponentRef<any>}
|
|
1221
|
+
* @param {ComponentRef<any>} component The component reference.
|
|
1222
|
+
* @param {*} options The options to project.
|
|
1223
|
+
* @returns {ComponentRef<any>} The updated component reference.
|
|
1367
1224
|
*/
|
|
1368
1225
|
projectComponentInputs(component, options) {
|
|
1369
1226
|
Object.getOwnPropertyNames(options)
|
|
@@ -1374,10 +1231,10 @@ class PopupService {
|
|
|
1374
1231
|
return component;
|
|
1375
1232
|
}
|
|
1376
1233
|
/**
|
|
1377
|
-
* Gets the component and
|
|
1234
|
+
* Gets the component and nodes to append from the `content` option.
|
|
1378
1235
|
*
|
|
1379
|
-
* @param {*} content
|
|
1380
|
-
* @returns {any}
|
|
1236
|
+
* @param {*} content The content to use.
|
|
1237
|
+
* @returns {any} The component and nodes for projection.
|
|
1381
1238
|
*/
|
|
1382
1239
|
contentFrom(content) {
|
|
1383
1240
|
if (!content || content instanceof TemplateRef) {
|
|
@@ -1416,11 +1273,9 @@ const KENDO_POPUP = [
|
|
|
1416
1273
|
|
|
1417
1274
|
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
1418
1275
|
/**
|
|
1419
|
-
*
|
|
1420
|
-
* definition for the Popup component.
|
|
1276
|
+
* Required for adding all Popup features in NgModule-based Angular applications.
|
|
1421
1277
|
*
|
|
1422
1278
|
* @example
|
|
1423
|
-
*
|
|
1424
1279
|
* ```ts-no-run
|
|
1425
1280
|
* // Import the Popup module
|
|
1426
1281
|
* import { PopupModule } from '@progress/kendo-angular-popup';
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { AlignStrategy } from '@progress/kendo-popup-common';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Specifies the horizontal and vertical align points for the component.
|
|
8
8
|
*/
|
|
9
9
|
export interface Align extends AlignStrategy {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Specifies the horizontal point relative to the anchor or the Popup.
|
|
12
12
|
*
|
|
13
13
|
* The available options are:
|
|
14
14
|
* - `left`—Uses the leftmost point of the `anchor` element.
|
|
@@ -17,7 +17,7 @@ export interface Align extends AlignStrategy {
|
|
|
17
17
|
*/
|
|
18
18
|
horizontal: 'left' | 'center' | 'right';
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Specifies the vertical point relative to the anchor or the Popup.
|
|
21
21
|
*
|
|
22
22
|
* The available options are:
|
|
23
23
|
* - `top`—Uses the top point of the `anchor` element.
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { CollisionType } from './collision.type';
|
|
6
6
|
/**
|
|
7
|
-
* Defines the horizontal and vertical collision behavior
|
|
7
|
+
* Defines the horizontal and vertical collision behavior for the component.
|
|
8
8
|
*/
|
|
9
9
|
export interface Collision {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Sets the horizontal collision behavior for the component.
|
|
12
12
|
*/
|
|
13
13
|
horizontal: CollisionType;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Sets the vertical collision behavior for the component.
|
|
16
16
|
*/
|
|
17
17
|
vertical: CollisionType;
|
|
18
18
|
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Defines the possible collision behavior when the Popup is not fully visible.
|
|
7
7
|
*
|
|
8
|
-
* The available options are:
|
|
9
8
|
* - `fit`—Moves the Popup horizontally until it is fully displayed in the viewport.
|
|
10
9
|
* - `flip`—Flips the Popup position based on the origin and the position properties.
|
|
11
10
|
*/
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { MarginSettings } from '@progress/kendo-popup-common';
|
|
6
6
|
/**
|
|
7
|
-
* Defines the horizontal and
|
|
7
|
+
* Defines the horizontal and vertical margin offsets of the component.
|
|
8
8
|
*/
|
|
9
9
|
export interface Margin extends MarginSettings {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Sets the horizontal margin value.
|
|
12
12
|
*/
|
|
13
13
|
horizontal: number;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Sets the vertical margin value.
|
|
16
16
|
*/
|
|
17
17
|
vertical: number;
|
|
18
18
|
}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { OffsetPosition } from '@progress/kendo-popup-common';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Defines the offset position of the Popup.
|
|
8
8
|
*/
|
|
9
9
|
export interface Offset extends OffsetPosition {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Sets the top position of the Popup.
|
|
12
12
|
*/
|
|
13
13
|
top: number;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Sets the left position of the Popup.
|
|
16
16
|
*/
|
|
17
17
|
left: number;
|
|
18
18
|
}
|
|
@@ -7,20 +7,26 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export interface PopupAnimation {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Sets the type of the animation.
|
|
11
11
|
* @default 'slide'
|
|
12
12
|
*/
|
|
13
13
|
type?: AnimationType;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Sets the animation duration in milliseconds.
|
|
16
16
|
* @default 100
|
|
17
17
|
*/
|
|
18
18
|
duration: number;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Sets the animation direction. Applies if the type is `slide` or `expand`.
|
|
21
21
|
* @default 'down'
|
|
22
22
|
*/
|
|
23
23
|
direction: AnimationDirection;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Defines the possible animation types for the Popup.
|
|
27
|
+
*/
|
|
25
28
|
export type AnimationType = 'slide' | 'expand' | 'zoom' | 'fade';
|
|
29
|
+
/**
|
|
30
|
+
* Defines the possible animation directions for the Popup.
|
|
31
|
+
*/
|
|
26
32
|
export type AnimationDirection = 'down' | 'up' | 'left' | 'right';
|
package/models/popup-ref.d.ts
CHANGED
|
@@ -6,21 +6,19 @@ import { ComponentRef, EventEmitter } from '@angular/core';
|
|
|
6
6
|
import { PopupComponent } from '../popup.component';
|
|
7
7
|
/**
|
|
8
8
|
* Holds references to the object instance of the Popup.
|
|
9
|
-
* Controls
|
|
10
|
-
* ([see example]({% slug api_popup_popupservice %}#toc-open)).
|
|
9
|
+
* Controls Popups opened through `PopupService` ([see example]({% slug api_popup_popupservice %}#toc-open)).
|
|
11
10
|
*/
|
|
12
11
|
export interface PopupRef {
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* Provides a reference to the Popup instance.
|
|
15
14
|
*/
|
|
16
15
|
popup: ComponentRef<PopupComponent>;
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
17
|
+
* Provides a reference to the HTML element of the Popup.
|
|
19
18
|
*/
|
|
20
19
|
popupElement: HTMLElement;
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
23
|
-
* Popup is opened with [`content`]({% slug service_popup %}#toc-using-components).
|
|
21
|
+
* Provides a reference to the child component of the Popup. Available when the Popup opens with [`content`]({% slug service_popup %}#toc-using-components).
|
|
24
22
|
*/
|
|
25
23
|
content: ComponentRef<any>;
|
|
26
24
|
/**
|
|
@@ -28,20 +26,19 @@ export interface PopupRef {
|
|
|
28
26
|
*/
|
|
29
27
|
close: Function;
|
|
30
28
|
/**
|
|
31
|
-
* Fires when the anchor
|
|
32
|
-
* ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
|
|
29
|
+
* Fires when the anchor scrolls outside the screen boundaries ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
|
|
33
30
|
*/
|
|
34
31
|
popupAnchorViewportLeave: EventEmitter<any>;
|
|
35
32
|
/**
|
|
36
|
-
* Fires after the component
|
|
33
|
+
* Fires after the component closes.
|
|
37
34
|
*/
|
|
38
35
|
popupClose: EventEmitter<any>;
|
|
39
36
|
/**
|
|
40
|
-
* Fires after the component
|
|
37
|
+
* Fires after the component opens and the opening animation ends.
|
|
41
38
|
*/
|
|
42
39
|
popupOpen: EventEmitter<any>;
|
|
43
40
|
/**
|
|
44
|
-
* Fires after the component
|
|
41
|
+
* Fires after the component opens and the Popup is positioned.
|
|
45
42
|
*/
|
|
46
43
|
popupPositionChange: EventEmitter<any>;
|
|
47
44
|
}
|