@ethlete/cdk 4.12.0 → 4.13.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.
@@ -1,18 +1,13 @@
1
+ import { Location } from '@angular/common';
1
2
  import { InjectionToken } from '@angular/core';
2
3
  import { OverlayRef, OverlayRouterService } from '../../utils';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare const OVERLAY_BACK_OR_CLOSE_TOKEN: InjectionToken<OverlayBackOrCloseDirective>;
5
6
  export declare class OverlayBackOrCloseDirective {
7
+ locationService: Location;
6
8
  overlayRef: OverlayRef<any, any>;
7
9
  router: OverlayRouterService;
8
10
  disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
9
- hostClassBindings: {
10
- remove: (...tokens: string[]) => void;
11
- removeMany: (tokens: string[]) => void;
12
- has: (token: string) => boolean;
13
- push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
14
- pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
15
- };
16
11
  constructor();
17
12
  static ɵfac: i0.ɵɵFactoryDeclaration<OverlayBackOrCloseDirective, never>;
18
13
  static ɵdir: i0.ɵɵDirectiveDeclaration<OverlayBackOrCloseDirective, "[etOverlayBackOrClose]", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -178,12 +178,15 @@ export interface OverlayConfig<D = unknown> {
178
178
  /**
179
179
  * Whether the overlay should close when the user goes backwards/forwards in history.
180
180
  * Note that this usually doesn't include clicking on links (unless the user is using
181
- * the `HashLocationStrategy`).
181
+ * the `HashLocationStrategy`). Will be automatically set to false if the overlay contains a overlay router.
182
182
  * @default true
183
183
  */
184
184
  closeOnNavigation?: boolean;
185
185
  /**
186
186
  * Extra providers to be made available to the overlay.
187
+ *
188
+ * **WARNING**: Avoid providing `@Injectable()` classes such as services here, as they will never be destroyed.
189
+ * This could lead to memory leaks over time.
187
190
  */
188
191
  providers?: StaticProvider[];
189
192
  /**
@@ -1,5 +1,5 @@
1
1
  import { ComponentType } from '@angular/cdk/portal';
2
- import { InjectionToken } from '@angular/core';
2
+ import { InjectionToken, Provider } from '@angular/core';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { AnyQuery, QueryResponseOf, QueryState } from '@ethlete/query';
5
5
  import { OverlayRef } from './overlay-ref';
@@ -60,7 +60,4 @@ export declare class FilterOverlayService<F extends FormGroup, C extends Compone
60
60
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterOverlayService<any, any>, never>;
61
61
  static ɵprov: i0.ɵɵInjectableDeclaration<FilterOverlayService<any, any>>;
62
62
  }
63
- export declare const provideFilterOverlayConfig: (config: FilterOverlayConfig) => (typeof FilterOverlayService | {
64
- provide: InjectionToken<FilterOverlayConfig<FormGroup<any>, AnyQuery>>;
65
- useValue: FilterOverlayConfig<FormGroup<any>, AnyQuery>;
66
- })[];
63
+ export declare const provideFilterOverlayConfig: (config: FilterOverlayConfig) => Provider[];
@@ -18,6 +18,7 @@ export interface OverlayHeaderTemplates {
18
18
  }
19
19
  export declare class OverlayRef<T = any, R = any> {
20
20
  private _ref;
21
+ config: OverlayConfig;
21
22
  _containerInstance: OverlayContainerComponent;
22
23
  componentInstance: T | null;
23
24
  readonly componentRef: ComponentRef<T> | null;
@@ -1,6 +1,8 @@
1
1
  import { ComponentType } from '@angular/cdk/portal';
2
- import { InjectionToken } from '@angular/core';
3
- import * as i0 from "@angular/core";
2
+ import { InjectionToken, Provider } from '@angular/core';
3
+ import { Router } from '@angular/router';
4
+ import { RouterStateService } from '@ethlete/core';
5
+ import { OverlayRef } from './overlay-ref';
4
6
  export declare const OVERLAY_ROUTER_CONFIG_TOKEN: InjectionToken<OverlayRouterConfig>;
5
7
  export type OverlayRoute = {
6
8
  /**
@@ -37,11 +39,14 @@ export type OverlayRouterNavigateConfig = {
37
39
  navigationDirection?: OverlayRouterNavigationDirection;
38
40
  };
39
41
  export declare class OverlayRouterService {
40
- config: OverlayRouterConfig;
41
- syncCurrentRoute: import("@angular/core").WritableSignal<string>;
42
+ _router: Router;
43
+ _routerStateService: RouterStateService;
44
+ _id: string;
45
+ _overlayRef: OverlayRef<any, any>;
46
+ _config: OverlayRouterConfig;
47
+ _syncCurrentRoute: import("@angular/core").WritableSignal<string>;
48
+ _nativeBrowserTempBackNavigationStack: import("@angular/core").WritableSignal<string[]>;
42
49
  currentRoute: import("@angular/core").Signal<string>;
43
- routeHistory: import("@angular/core").WritableSignal<string[]>;
44
- rootHistoryItem: import("@angular/core").WritableSignal<string | null>;
45
50
  extraRoutes: import("@angular/core").WritableSignal<OverlayRoute[]>;
46
51
  routes: import("@angular/core").Signal<{
47
52
  inputs: Record<string, unknown>;
@@ -73,27 +78,19 @@ export declare class OverlayRouterService {
73
78
  */
74
79
  path: `/${string}`;
75
80
  } | null>;
76
- lastPage: import("@angular/core").Signal<string | null | undefined>;
77
- canGoBack: import("@angular/core").Signal<number>;
78
81
  navigationDirection: import("@angular/core").WritableSignal<OverlayRouterNavigationDirection>;
79
82
  constructor();
80
83
  navigate(route: string | (string | number)[], config?: OverlayRouterNavigateConfig): void;
81
- back(): void;
82
84
  resolvePath(route: string | (string | number)[]): {
83
85
  readonly route: string;
84
86
  readonly type: "forward" | "back" | "replace-current" | "absolute" | "unknown";
85
87
  };
86
88
  addRoute(route: OverlayRoute): void;
87
89
  removeRoute(path: string): void;
88
- _updateCurrentRoute(route: string, config?: {
89
- updateHistory?: boolean;
90
- }): void;
91
- _removeItemFromHistory(item: string): void;
90
+ _updateCurrentRoute(route: string): void;
91
+ _getInitialRoute(): string;
92
92
  _navigateToInitialRoute(): void;
93
- static ɵfac: i0.ɵɵFactoryDeclaration<OverlayRouterService, never>;
94
- static ɵprov: i0.ɵɵInjectableDeclaration<OverlayRouterService>;
93
+ _updateBrowserUrl(route: string | undefined): void;
94
+ private _disableCloseOnNavigation;
95
95
  }
96
- export declare const provideOverlayRouterConfig: (config: OverlayRouterConfig) => (typeof OverlayRouterService | {
97
- provide: InjectionToken<OverlayRouterConfig>;
98
- useValue: OverlayRouterConfig;
99
- })[];
96
+ export declare const provideOverlayRouterConfig: (config: OverlayRouterConfig) => Provider[];
@@ -1,8 +1,7 @@
1
- import { InjectionToken, TemplateRef } from '@angular/core';
1
+ import { InjectionToken, Provider, TemplateRef } from '@angular/core';
2
2
  import { Breakpoint, ViewportService } from '@ethlete/core';
3
3
  import { OverlayHeaderTemplateDirective } from '../partials/overlay-header-template';
4
4
  import { OverlayRouterService } from './overlay-router';
5
- import * as i0 from "@angular/core";
6
5
  export declare const SIDEBAR_OVERLAY_CONFIG: InjectionToken<SidebarOverlayConfig>;
7
6
  export type SidebarOverlayConfig = {
8
7
  /**
@@ -26,10 +25,5 @@ export declare class SidebarOverlayService {
26
25
  sidebarContentTemplate: import("@angular/core").WritableSignal<TemplateRef<unknown> | null>;
27
26
  sidebarHeaderTemplate: import("@angular/core").WritableSignal<OverlayHeaderTemplateDirective | null>;
28
27
  constructor();
29
- static ɵfac: i0.ɵɵFactoryDeclaration<SidebarOverlayService, never>;
30
- static ɵprov: i0.ɵɵInjectableDeclaration<SidebarOverlayService>;
31
28
  }
32
- export declare const provideSidebarOverlayConfig: (config: SidebarOverlayConfig) => (typeof SidebarOverlayService | {
33
- provide: InjectionToken<SidebarOverlayConfig>;
34
- useValue: SidebarOverlayConfig;
35
- })[];
29
+ export declare const provideSidebarOverlayConfig: (config: SidebarOverlayConfig) => Provider[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/cdk",
3
- "version": "4.12.0",
3
+ "version": "4.13.1",
4
4
  "exports": {
5
5
  ".": {
6
6
  "css": "./src/lib/styles/index.css",