ngx-kit 8.4.1 → 8.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-kit",
3
- "version": "8.4.1",
3
+ "version": "8.5.0",
4
4
  "description": "Angular input components",
5
5
  "author": "Mohammadreza Samani <mr.samani1368@gmail.com>",
6
6
  "license": "MIT",
@@ -390,8 +390,6 @@ interface BaseOverlayOptions<T = any> {
390
390
  autoFocus?: boolean;
391
391
  /** Restore focus to the previously focused element when the overlay closes. Default: true. */
392
392
  restoreFocus?: boolean;
393
- /** Prevent the page behind the overlay from scrolling while it's open. Default: false. */
394
- lockBodyScroll?: boolean;
395
393
  /** Extra class(es) applied to the backdrop element. */
396
394
  backdropClass?: string | string[];
397
395
  /** Extra class(es) applied to the overlay panel element. */
@@ -436,7 +434,6 @@ declare class OverlayService {
436
434
  private readonly overlayStack;
437
435
  private globalListenersAttached;
438
436
  private layoutRaf;
439
- private bodyScrollLockCount;
440
437
  private previousBodyOverflow;
441
438
  private previousBodyPaddingRight;
442
439
  private get isBrowser();
@@ -449,23 +446,20 @@ declare class OverlayService {
449
446
  private createTemplateInstance;
450
447
  private pushInstance;
451
448
  private createHostElement;
452
- private createBackdropElement;
453
449
  private createOverlayElement;
454
450
  private addClasses;
455
451
  private renderHost;
456
452
  private destroyInstance;
453
+ private observeOverlayResize;
457
454
  private resolveUsePopover;
458
455
  private showHostPopover;
459
456
  private hideHostPopover;
460
457
  private supportsPopover;
461
- private lockBodyScroll;
462
- private unlockBodyScroll;
463
458
  private attachGlobalListeners;
464
459
  private detachGlobalListeners;
465
460
  private readonly onDocumentKeydown;
466
461
  private readonly onDocumentClick;
467
462
  private readonly onDocumentContextMenu;
468
- private readonly onDocumentScroll;
469
463
  private readonly onWindowResize;
470
464
  private scheduleReposition;
471
465
  private scheduleInitialLayout;
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, OnDestroy, Injector, EnvironmentProviders, EnvironmentInjector, Type, InjectionToken } from '@angular/core';
2
+ import { OnInit, OnDestroy, Injector, EnvironmentProviders, EnvironmentInjector, InjectionToken, Type } from '@angular/core';
3
3
  import * as ngx_kit_dialog from 'ngx-kit/dialog';
4
4
  import { Observable } from 'rxjs';
5
5
  import { OverlayRef } from 'ngx-kit/core';
@@ -73,8 +73,6 @@ declare class NgxDialogConfig<DataType = any> {
73
73
  * dialog - return `false` to block it (e.g. unsaved changes). Does not
74
74
  * affect a programmatic `dialogRef.close()` call. */
75
75
  beforeClose?: () => boolean;
76
- /** Prevent the page behind the dialog from scrolling while it's open. Default: true. */
77
- lockBodyScroll?: boolean;
78
76
  /** Move focus into the dialog on open. Default: true. */
79
77
  autoFocus?: boolean;
80
78
  /** Restore focus to the previously focused element on close. Default: true. */
@@ -169,24 +167,11 @@ declare class NgxDialogHeader implements OnInit {
169
167
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxDialogHeader, "ngx-dialog-header,[ngxDialogHeader]", ["ngxDialogHeader"], { "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "showMaximizeButton": { "alias": "showMaximizeButton"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgxDraggable; inputs: {}; outputs: {}; }]>;
170
168
  }
171
169
 
172
- /**
173
- * Why this can't be pure CSS flexbox: the header/body/footer elements are
174
- * *grandchildren* of the dialog panel (panel -> `*ngComponentOutlet`'s host
175
- * element -> header/body/footer), not direct children, because the content
176
- * component that hosts them is arbitrary and we don't control its own host
177
- * styling. `display:flex;flex-direction:column` on the panel therefore can't
178
- * size the body against the header/footer through that extra layer, so we
179
- * measure and set an explicit `max-height` instead, driven by a
180
- * `ResizeObserver` on the panel (not a `window:resize` listener, so it also
181
- * reacts to the dialog itself changing size, e.g. via `config.size`).
182
- */
183
170
  declare class NgxDialogBody {
184
171
  private readonly el;
185
- private readonly renderer;
186
172
  private readonly dialogRef;
187
173
  private readonly destroyRef;
188
174
  constructor();
189
- private recomputeHeight;
190
175
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxDialogBody, never>;
191
176
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxDialogBody, "ngx-dialog-body,[ngxDialogBody]", ["ngxDialogBody"], {}, {}, never, never, true, never>;
192
177
  }
@@ -197,6 +182,13 @@ declare class NgxDialogModule {
197
182
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<NgxDialogModule>;
198
183
  }
199
184
 
185
+ declare const DIALOG_DATA: InjectionToken<any>;
186
+ declare const DIALOG_REF: InjectionToken<NgxDialogRef<any>>;
187
+ /** The resolved config for the dialog currently being rendered. */
188
+ declare const NGX_DIALOG_CONFIG: InjectionToken<NgxDialogConfig<any>>;
189
+ /** The arbitrary content component passed to `open()`, projected via `*ngComponentOutlet`. */
190
+ declare const DIALOG_CONTENT: InjectionToken<Type<any>>;
191
+
200
192
  declare class NgxDialogService {
201
193
  private readonly overlay;
202
194
  private readonly injector;
@@ -219,30 +211,5 @@ declare class NgxDialogService {
219
211
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxDialogService>;
220
212
  }
221
213
 
222
- /**
223
- * Static convenience API over `NgxDialogService`, so you can call
224
- * `Dialog.open(...)` from anywhere without injecting the service manually.
225
- *
226
- * SSR note: the instance backing this static class is process-wide, not
227
- * per-request, so it is deliberately left unset on the server (see
228
- * `provideNgxDialog()`). Inject `NgxDialogService` directly in SSR code paths.
229
- */
230
- declare class Dialog {
231
- private static serviceInstance;
232
- private static readonly openRefs;
233
- /** @internal set by `provideNgxDialog()`'s environment initializer. */
234
- static _setService(svc: NgxDialogService): void;
235
- private static get service();
236
- static open<R = any, DataType = any>(component: Type<any>, config?: Partial<NgxDialogConfig<DataType>>): NgxDialogRef<R>;
237
- static closeAll(): void;
238
- }
239
-
240
- declare const DIALOG_DATA: InjectionToken<any>;
241
- declare const DIALOG_REF: InjectionToken<NgxDialogRef<any>>;
242
- /** The resolved config for the dialog currently being rendered. */
243
- declare const NGX_DIALOG_CONFIG: InjectionToken<NgxDialogConfig<any>>;
244
- /** The arbitrary content component passed to `open()`, projected via `*ngComponentOutlet`. */
245
- declare const DIALOG_CONTENT: InjectionToken<Type<any>>;
246
-
247
- export { DIALOG_CONTENT, DIALOG_DATA, DIALOG_REF, Dialog, NGX_DIALOG_CONFIG, NgxDialogBody, NgxDialogComponent, NgxDialogConfig, NgxDialogFooter, NgxDialogHeader, NgxDialogModule, NgxDialogService, provideNgxDialog };
214
+ export { DIALOG_CONTENT, DIALOG_DATA, DIALOG_REF, NGX_DIALOG_CONFIG, NgxDialogBody, NgxDialogComponent, NgxDialogConfig, NgxDialogFooter, NgxDialogHeader, NgxDialogModule, NgxDialogService, provideNgxDialog };
248
215
  export type { NgxDialogFooterAlign, NgxDialogFooterConfig, NgxDialogHeaderConfig, NgxDialogSize };
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { TemplateRef, OnDestroy, ElementRef, ApplicationRef } from '@angular/core';
2
+ import { TemplateRef, OnDestroy, ApplicationRef, ElementRef } from '@angular/core';
3
3
  import { OverlayRef, Placement, Alignment, OverlayService } from 'ngx-kit/core';
4
4
 
5
5
  interface MenuContext {
@@ -16,14 +16,14 @@ declare class NgxMenuPanel implements MenuContext {
16
16
  }
17
17
 
18
18
  declare class NgxMenu implements OnDestroy {
19
- private el;
20
- private appRef;
21
- private overlayService;
22
19
  ngxMenu: i0.InputSignal<NgxMenuPanel>;
23
20
  placement: i0.InputSignal<Placement | undefined>;
24
21
  alignment: i0.InputSignal<Alignment | undefined>;
25
22
  private containerRef?;
26
- constructor(el: ElementRef, appRef: ApplicationRef, overlayService: OverlayService);
23
+ protected readonly overlay: OverlayService;
24
+ protected readonly appRef: ApplicationRef;
25
+ protected readonly el: ElementRef<HTMLElement>;
26
+ constructor();
27
27
  ngOnDestroy(): void;
28
28
  onClick(ev: Event): void;
29
29
  private toggleContainer;
@@ -33,13 +33,13 @@ declare class NgxMenu implements OnDestroy {
33
33
  }
34
34
 
35
35
  declare class NgxContextMenu implements OnDestroy {
36
- private el;
37
- private appRef;
38
- private overlayService;
39
36
  ngxContextMenu: i0.InputSignal<NgxMenuPanel>;
40
37
  private containerRef?;
41
38
  private readonly boundOnClick;
42
- constructor(el: ElementRef<HTMLElement>, appRef: ApplicationRef, overlayService: OverlayService);
39
+ protected readonly overlay: OverlayService;
40
+ protected readonly appRef: ApplicationRef;
41
+ protected readonly el: ElementRef<HTMLElement>;
42
+ constructor();
43
43
  ngOnDestroy(): void;
44
44
  onClick(ev: PointerEvent): void;
45
45
  private toggleContainer;