@progress/kendo-angular-popup 19.1.1 → 19.1.2-develop.2

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.
@@ -3,6 +3,6 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  /**
6
- * The type which defines all possible position modes of the Popup.
6
+ * Defines all possible values for the `positionMode` property of the Popup.
7
7
  */
8
8
  export {};
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1749539908,
14
- version: '19.1.1',
13
+ publishDate: 1749820265,
14
+ version: '19.1.2-develop.2',
15
15
  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'
16
16
  };
@@ -29,19 +29,11 @@ const ANIMATION_CONTAINER_FIXED = 'k-animation-container-fixed';
29
29
  * Represents the [Kendo UI Popup component for Angular]({% slug overview_popup %}).
30
30
  *
31
31
  * @example
32
- * ```ts
33
- * _@Component({
34
- * selector: 'my-app',
35
- * template: `
36
- * <button #anchor (click)="show=!show">Toggle</button>
37
- * <kendo-popup *ngIf="show" [anchor]="anchor">
38
- * <strong>Popup content!</strong>
39
- * </kendo-popup>
40
- * `
41
- * })
42
- * class AppComponent {
43
- * public show: boolean = false;
44
- * }
32
+ * ```html
33
+ * <button #anchor (click)="show = !show">Toggle</button>
34
+ * <kendo-popup *ngIf="show" [anchor]="anchor">
35
+ * <strong>Popup content!</strong>
36
+ * </kendo-popup>
45
37
  * ```
46
38
  */
47
39
  export class PopupComponent {
@@ -55,162 +47,68 @@ export class PopupComponent {
55
47
  _renderer;
56
48
  _zone;
57
49
  /**
58
- * Controls the Popup animation. By default, the opening and closing animations
59
- * are enabled ([see example]({% slug animations_popup %})).
50
+ * Controls the Popup animation. By default, the opening and closing animations are enabled ([see example]({% slug animations_popup %})).
51
+ * @default true
60
52
  */
61
53
  animate = true;
62
54
  /**
63
- * Specifies the element that will be used as an anchor. The Popup opens next to that element.
64
- * ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-components)).
55
+ * Sets the element to use as an anchor. The Popup opens next to this element. ([See example]({% slug alignmentpositioning_popup %}#toc-aligning-to-components)).
65
56
  */
66
57
  anchor;
67
58
  /**
68
- * Specifies the anchor pivot point
69
- * ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
59
+ * Sets the anchor pivot point ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
60
+ * @default '{ horizontal: "left", vertical: "bottom" }'
70
61
  */
71
62
  anchorAlign = { horizontal: 'left', vertical: 'bottom' };
72
63
  /**
73
- * Configures the collision behavior of the Popup
74
- * ([see example]({% slug viewportboundarydetection_popup %})).
64
+ * Sets the collision behavior of the Popup ([see example]({% slug viewportboundarydetection_popup %})).
65
+ * @default '{ horizontal: "fit", vertical: "flip" }'
75
66
  */
76
67
  collision = { horizontal: 'fit', vertical: 'flip' };
77
68
  /**
78
- * Specifies the pivot point of the Popup
79
- * ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
69
+ * Sets the pivot point of the Popup ([see example]({% slug alignmentpositioning_popup %}#toc-positioning)).
70
+ * @default '{ horizontal: "left", vertical: "top" }'
80
71
  */
81
72
  popupAlign = { horizontal: 'left', vertical: 'top' };
82
73
  /**
83
- * Controls whether the component will copy the `anchor` font styles.
74
+ * Controls whether the component copies the `anchor` font styles.
75
+ * @default false
84
76
  */
85
77
  copyAnchorStyles = false;
86
78
  /**
87
- * Specifies a list of CSS classes that will be added to the internal
88
- * animated element ([see example]({% slug appearance_popup %})).
79
+ * Sets a list of CSS classes to add to the internal animated element ([see example]({% slug appearance_popup %})).
89
80
  *
90
81
  * > To style the content of the Popup, use this property binding.
91
82
  */
92
83
  // eslint-disable-next-line @typescript-eslint/ban-types
93
84
  popupClass;
94
85
  /**
95
- * Specifies the position mode of the component. By default, the Popup uses fixed positioning.
96
- * To make the Popup acquire absolute positioning, set this option to `absolute`.
86
+ * Sets the position mode of the component. By default, the Popup uses fixed positioning. To use absolute positioning, set this option to `absolute`.
97
87
  *
98
- * > If you need to support mobile browsers with the zoom option,
99
- * use the `absolute` positioning of the Popup.
100
- *
101
- * @example
102
- * ```html
103
- * <style>
104
- * .parent-content {
105
- * position: relative;
106
- * width: 200px;
107
- * height: 200px;
108
- * overflow: auto;
109
- * margin: 200px auto;
110
- * border: 1px solid red;
111
- * }
112
- * .content {
113
- * position: relative;
114
- * width: 100px;
115
- * height: 100px;
116
- * overflow: auto;
117
- * margin: 300px;
118
- * border: 1px solid blue;
119
- * }
120
- * .anchor {
121
- * position: absolute;
122
- * top: 200px;
123
- * left: 200px;
124
- * }
125
- * </style>
126
- * ```
127
- * ```ts
128
- * _@Component({
129
- * selector: 'my-app',
130
- * template: `
131
- * <div class="example-config">
132
- * Position mode:
133
- * <label><input type="radio" value="fixed" [(ngModel)]="mode" /> Fixed</label>
134
- * <label><input type="radio" value="absolute" [(ngModel)]="mode" /> Absolute</label>
135
- * </div>
136
- * <div class="example-config">
137
- * Append to
138
- * <label>
139
- * <input type="radio" name="place" [value]="1" [(ngModel)]="checked" />
140
- * Root component
141
- * </label>
142
- * <label>
143
- * <input type="radio" name="place" [value]="2" [(ngModel)]="checked" />
144
- * <span [style.color]="'red'">Red Container</span>
145
- * </label>
146
- * <label>
147
- * <input type="radio" name="place" [value]="3" [(ngModel)]="checked" />
148
- * <span [style.color]="'blue'">Blue Container</span>
149
- * </label>
150
- * </div>
151
- * <div class="example">
152
- * <div class="parent-content" [scrollLeft]="250" [scrollTop]="230">
153
- * <div class="content" [scrollLeft]="170" [scrollTop]="165">
154
- * <button #anchor class="anchor" (click)="show = !show">Toggle</button>
155
- * <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 3">
156
- * <ul>
157
- * <li>Item1</li>
158
- * <li>Item2</li>
159
- * <li>Item3</li>
160
- * </ul>
161
- * </kendo-popup>
162
- * <span [style.position]="'absolute'" [style.top.px]="400" [style.left.px]="400">Bottom/Right</span>
163
- * </div>
164
- * <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 2">
165
- * <ul>
166
- * <li>Item1</li>
167
- * <li>Item2</li>
168
- * <li>Item3</li>
169
- * </ul>
170
- * </kendo-popup>
171
- * <span [style.position]="'absolute'" [style.top.px]="600" [style.left.px]="600">Bottom/Right</span>
172
- * </div>
173
- * <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 1">
174
- * <ul>
175
- * <li>Item1</li>
176
- * <li>Item2</li>
177
- * <li>Item3</li>
178
- * </ul>
179
- * </kendo-popup>
180
- * </div>
181
- * `
182
- * })
183
- * class AppComponent {
184
- * public checked: number = 3;
185
- * public mode: string = 'absolute';
186
- * public show: boolean = true;
187
- * }
188
- * ```
88
+ * To support mobile browsers with the zoom option, use the `absolute` positioning of the Popup.
89
+ * @default 'fixed'
189
90
  */
190
91
  positionMode = 'fixed';
191
92
  /**
192
- * Specifies the absolute position of the element
193
- * ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-absolute-points)).
194
- * The Popup opens next to that point. The Popup pivot point is defined by the `popupAlign` configuration option.
195
- * The boundary detection is applied by using the window viewport.
93
+ * Sets the absolute position of the element ([see example]({% slug alignmentpositioning_popup %}#toc-aligning-to-absolute-points)).
94
+ * The Popup opens next to this point. The Popup pivot point is defined by the `popupAlign` option. The boundary detection uses the window viewport.
95
+ * @default '{ left: -10000, top: 0 }'
196
96
  */
197
97
  offset = DEFAULT_OFFSET;
198
98
  /**
199
- * Specifies the margin value that will be added to the popup dimensions in pixels and leaves a blank space
200
- * between the popup and the anchor ([see example]({% slug alignmentpositioning_popup %}#toc-adding-a-margin)).
99
+ * Sets the margin value in pixels. Adds blank space between the Popup and the anchor ([see example]({% slug alignmentpositioning_popup %}#toc-adding-a-margin)).
201
100
  */
202
101
  margin;
203
102
  /**
204
- * Fires when the anchor is scrolled outside the screen boundaries.
205
- * ([see example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
103
+ * Fires when the anchor scrolls outside the screen boundaries. ([See example]({% slug closing_popup %}#toc-after-leaving-the-viewport)).
206
104
  */
207
105
  anchorViewportLeave = new EventEmitter();
208
106
  /**
209
- * Fires after the component is closed.
107
+ * Fires after the component closes.
210
108
  */
211
109
  close = new EventEmitter();
212
110
  /**
213
- * Fires after the component is opened and the opening animation ends.
111
+ * Fires after the component opens and the opening animation ends.
214
112
  */
215
113
  open = new EventEmitter();
216
114
  /**
@@ -11,11 +11,9 @@ import * as i1 from "@progress/kendo-angular-common";
11
11
  import * as i2 from "./popup.component";
12
12
  //IMPORTANT: NgModule export kept for backwards compatibility
13
13
  /**
14
- * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
15
- * definition for the Popup component.
14
+ * Required for adding all Popup features in NgModule-based Angular applications.
16
15
  *
17
16
  * @example
18
- *
19
17
  * ```ts-no-run
20
18
  * // Import the Popup module
21
19
  * import { PopupModule } from '@progress/kendo-angular-popup';
@@ -11,15 +11,13 @@ const removeElement = (element) => {
11
11
  }
12
12
  };
13
13
  /**
14
- * Used to inject the Popup container. If not provided, the first root component of
15
- * the application is used.
14
+ * Injects the Popup container. If not set, uses the first root component of the application.
16
15
  *
17
- * > The `POPUP_CONTAINER` can be used only with the [`PopupService`](slug:service_popup) class.
16
+ * > Use `POPUP_CONTAINER` only with the `PopupService` class ([see example](slug:service_popup)).
18
17
  *
19
- * In case you are using standalone components:
18
+ * In standalone components:
20
19
  *
21
20
  * @example
22
- *
23
21
  * ```ts
24
22
  * import { Component } from '@angular/core';
25
23
  * import { KENDO_POPUP, PopupService } from '@progress/kendo-angular-popup';
@@ -40,19 +38,18 @@ const removeElement = (element) => {
40
38
  * export class AppComponent {}
41
39
  * ```
42
40
  *
43
- * In case you are using an NgModule-based application:
41
+ * In NgModule-based applications:
44
42
  *
45
43
  * @example
46
- *
47
- * ```ts-no-run
44
+ * ```ts
48
45
  * import { PopupModule, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
49
46
  * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
50
47
  * import { ElementRef, NgModule } from '@angular/core';
51
48
  * import { AppComponent } from './app.component';
52
49
  *
53
50
  * _@NgModule({
54
- * declarations: [AppComponent], // declare app component
55
- * imports: [BrowserModule, PopupModule], // import Popup module
51
+ * declarations: [AppComponent],
52
+ * imports: [BrowserModule, PopupModule],
56
53
  * bootstrap: [AppComponent],
57
54
  * providers: [{
58
55
  * provide: POPUP_CONTAINER,
@@ -69,8 +66,7 @@ const removeElement = (element) => {
69
66
  */
70
67
  export const POPUP_CONTAINER = new InjectionToken('Popup Container');
71
68
  /**
72
- * A service for opening Popup components dynamically
73
- * ([see example]({% slug service_popup %})).
69
+ * Provides a service for opening Popup components dynamically ([see example]({% slug service_popup %})).
74
70
  *
75
71
  * @export
76
72
  * @class PopupService
@@ -81,9 +77,9 @@ export class PopupService {
81
77
  injector;
82
78
  container;
83
79
  /**
84
- * Gets the root view container into which the component will be injected.
80
+ * Gets the root view container for injecting the component.
85
81
  *
86
- * @returns {ComponentRef<any>}
82
+ * @returns {ComponentRef<any>} The root view container reference.
87
83
  */
88
84
  get rootViewContainer() {
89
85
  // https://github.com/angular/angular/blob/4.0.x/packages/core/src/application_ref.ts#L571
@@ -97,9 +93,9 @@ export class PopupService {
97
93
  `);
98
94
  }
99
95
  /**
100
- * Sets or gets the HTML element of the root component container.
96
+ * Gets the HTML element of the root component container.
101
97
  *
102
- * @returns {HTMLElement}
98
+ * @returns {HTMLElement} The root container HTML element.
103
99
  */
104
100
  get rootViewContainerNode() {
105
101
  return this.container ? this.container.nativeElement : this.getComponentRootNode(this.rootViewContainer);
@@ -111,43 +107,10 @@ export class PopupService {
111
107
  this.container = container;
112
108
  }
113
109
  /**
114
- * Opens a Popup component. Created Popups are mounted
115
- * in the DOM directly in the root application component.
116
- *
117
- * @param {PopupSettings} options - The options which define the Popup.
118
- * @returns {ComponentRef<PopupComponent>} - A reference to the Popup object.
119
- *
120
- * @example
121
- *
122
- * ```ts-no-run
123
- * _@Component({
124
- * selector: 'my-app',
125
- * template: `
126
- * <ng-template #template>
127
- * Popup content
128
- * </ng-template>
129
- * <button #anchor kendoButton (click)="open(anchor, template)">Open</button>
130
- * `
131
- * })
132
- * export class AppComponent {
133
- * public popupRef: PopupRef;
134
- *
135
- * constructor( private popupService: PopupService ) {}
136
- *
137
- * public open(anchor: ElementRef, template: TemplateRef<any>): void {
138
- * if (this.popupRef) {
139
- * this.popupRef.close();
140
- * this.popupRef = null;
141
- * return;
142
- * }
110
+ * Opens a Popup component. The Popup mounts in the DOM under the root application component.
143
111
  *
144
- * this.popupRef = this.popupService.open({
145
- * anchor: anchor,
146
- * content: template
147
- * });
148
- * }
149
- * }
150
- * ```
112
+ * @param {PopupSettings} options - The options for the Popup.
113
+ * @returns {ComponentRef<PopupComponent>} A reference to the Popup object.
151
114
  */
152
115
  open(options = {}) {
153
116
  const { component, nodes } = this.contentFrom(options.content);
@@ -194,28 +157,28 @@ export class PopupService {
194
157
  /**
195
158
  * Gets the HTML element for a component reference.
196
159
  *
197
- * @param {ComponentRef<any>} componentRef
198
- * @returns {HTMLElement}
160
+ * @param {ComponentRef<any>} componentRef The component reference.
161
+ * @returns {HTMLElement} The root HTML element of the component.
199
162
  */
200
163
  getComponentRootNode(componentRef) {
201
164
  return componentRef.location.nativeElement;
202
165
  }
203
166
  /**
204
- * Gets the `ComponentFactory` instance by its type.
167
+ * Gets the `ComponentFactory` instance by type.
205
168
  *
206
- * @param {*} componentClass
207
- * @param {*} nodes
208
- * @returns {ComponentRef<any>}
169
+ * @param {*} componentClass The component class.
170
+ * @returns {ComponentFactory<any>} The component factory instance.
209
171
  */
210
172
  getComponentFactory(componentClass) {
211
173
  return this.componentFactoryResolver.resolveComponentFactory(componentClass);
212
174
  }
213
175
  /**
214
- * Creates a component reference from a `Component` type class.
176
+ * Creates a component reference from a `Component` class.
215
177
  *
216
- * @param {*} componentClass
217
- * @param {*} nodes
218
- * @returns {ComponentRef<any>}
178
+ * @param {*} componentClass The component class.
179
+ * @param {*} nodes The nodes to project.
180
+ * @param {ViewContainerRef} container The container to use.
181
+ * @returns {ComponentRef<any>} The created component reference.
219
182
  */
220
183
  createComponent(componentClass, nodes, container) {
221
184
  const factory = this.getComponentFactory(componentClass);
@@ -229,11 +192,11 @@ export class PopupService {
229
192
  }
230
193
  }
231
194
  /**
232
- * Projects the inputs on the component.
195
+ * Projects the input options onto the component instance.
233
196
  *
234
- * @param {ComponentRef<any>} component
235
- * @param {*} options
236
- * @returns {ComponentRef<any>}
197
+ * @param {ComponentRef<any>} component The component reference.
198
+ * @param {*} options The options to project.
199
+ * @returns {ComponentRef<any>} The updated component reference.
237
200
  */
238
201
  projectComponentInputs(component, options) {
239
202
  Object.getOwnPropertyNames(options)
@@ -244,10 +207,10 @@ export class PopupService {
244
207
  return component;
245
208
  }
246
209
  /**
247
- * Gets the component and the nodes to append from the `content` option.
210
+ * Gets the component and nodes to append from the `content` option.
248
211
  *
249
- * @param {*} content
250
- * @returns {any}
212
+ * @param {*} content The content to use.
213
+ * @returns {any} The component and nodes for projection.
251
214
  */
252
215
  contentFrom(content) {
253
216
  if (!content || content instanceof TemplateRef) {
package/esm2022/scale.mjs CHANGED
@@ -4,14 +4,10 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { InjectionToken } from '@angular/core';
6
6
  /**
7
- * Used to set the document scale when using a [scale transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale).
8
- *
9
- * 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 %}).
10
- *
11
- * > Using this token is not necessary for user-applied browser zoom.
12
- *
13
- * <demo metaUrl="popup/scale/" height="300"></demo>
7
+ * 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).
14
8
  *
9
+ * 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 %}).
15
10
  *
11
+ * > You do not need to use this token for user-applied browser zoom.
16
12
  */
17
13
  export const SCALE = new InjectionToken('Popup Document Scale');