@ethlete/core 4.21.4 → 4.23.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/esm2022/lib/components/structured-data/structured-data.component.mjs +3 -3
  3. package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -3
  4. package/esm2022/lib/directives/animated-if/animated-if.directive.mjs +3 -3
  5. package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +3 -3
  6. package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +24 -14
  7. package/esm2022/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  8. package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
  9. package/esm2022/lib/directives/debug/debug.directive.mjs +3 -3
  10. package/esm2022/lib/directives/delayable/delayable.directive.mjs +3 -3
  11. package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +3 -3
  12. package/esm2022/lib/directives/is-element/is-element.directive.mjs +3 -3
  13. package/esm2022/lib/directives/let/let.directive.mjs +3 -3
  14. package/esm2022/lib/directives/observe-content/observe-content.directive.mjs +10 -5
  15. package/esm2022/lib/directives/observe-resize/observe-resize.directive.mjs +10 -5
  16. package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
  17. package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +3 -3
  18. package/esm2022/lib/directives/repeat/repeat.directive.mjs +3 -3
  19. package/esm2022/lib/directives/root-boundary/root-boundary.directive.mjs +3 -3
  20. package/esm2022/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
  21. package/esm2022/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
  22. package/esm2022/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
  23. package/esm2022/lib/directives/seo/seo.directive.mjs +3 -3
  24. package/esm2022/lib/pipes/infer-mime-type/infer-mime-type.pipe.mjs +3 -3
  25. package/esm2022/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
  26. package/esm2022/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
  27. package/esm2022/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
  28. package/esm2022/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
  29. package/esm2022/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
  30. package/esm2022/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  31. package/esm2022/lib/props/props.directive.mjs +3 -3
  32. package/esm2022/lib/services/click-observer.service.mjs +6 -6
  33. package/esm2022/lib/services/content-observer.service.mjs +6 -6
  34. package/esm2022/lib/services/focus-visible.service.mjs +3 -3
  35. package/esm2022/lib/services/intersection-observer.service.mjs +6 -6
  36. package/esm2022/lib/services/resize-observer.service.mjs +6 -6
  37. package/esm2022/lib/services/router-state.service.mjs +3 -3
  38. package/esm2022/lib/services/viewport.service.mjs +3 -3
  39. package/esm2022/lib/utils/signal.utils.mjs +136 -36
  40. package/fesm2022/ethlete-core.mjs +347 -227
  41. package/fesm2022/ethlete-core.mjs.map +1 -1
  42. package/lib/directives/animated-overlay/animated-overlay.directive.d.ts +11 -3
  43. package/lib/utils/signal.utils.d.ts +35 -8
  44. package/package.json +1 -1
@@ -6,7 +6,6 @@ import { OffsetOptions, Padding, Placement } from '@floating-ui/dom';
6
6
  import { Subject } from 'rxjs';
7
7
  import { AnimatedLifecycleDirective } from '../animated-lifecycle';
8
8
  import * as i0 from "@angular/core";
9
- import * as i1 from "../observe-resize/observe-resize.directive";
10
9
  export interface AnimatedOverlayComponentBase {
11
10
  _elementRef?: ElementRef<HTMLElement>;
12
11
  _animatedLifecycle?: AnimatedLifecycleDirective;
@@ -20,7 +19,7 @@ export declare class AnimatedOverlayDirective<T extends AnimatedOverlayComponent
20
19
  private readonly _viewContainerRef;
21
20
  private readonly _zone;
22
21
  private readonly _elementRef;
23
- private readonly _observeResize;
22
+ private readonly _resizeObserverService;
24
23
  private readonly _rootBoundary;
25
24
  private _portal;
26
25
  private _overlayRef;
@@ -80,6 +79,11 @@ export declare class AnimatedOverlayDirective<T extends AnimatedOverlayComponent
80
79
  * @default false
81
80
  */
82
81
  autoCloseIfReferenceHidden: boolean;
82
+ /**
83
+ * The reference element for the animated overlay.
84
+ * @default this._elementRef.nativeElement
85
+ */
86
+ referenceElement: HTMLElement;
83
87
  get isMounted(): boolean;
84
88
  get isMounted$(): import("rxjs").Observable<boolean>;
85
89
  get isMounting(): boolean;
@@ -106,5 +110,9 @@ export declare class AnimatedOverlayDirective<T extends AnimatedOverlayComponent
106
110
  afterClosed(): Subject<void>;
107
111
  _destroy(): void;
108
112
  static ɵfac: i0.ɵɵFactoryDeclaration<AnimatedOverlayDirective<any>, never>;
109
- static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatedOverlayDirective<any>, never, never, { "placement": { "alias": "placement"; "required": false; }; "fallbackPlacements": { "alias": "fallbackPlacements"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; }; "viewportPadding": { "alias": "viewportPadding"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "shift": { "alias": "shift"; "required": false; }; "autoHide": { "alias": "autoHide"; "required": false; }; "autoCloseIfReferenceHidden": { "alias": "autoCloseIfReferenceHidden"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.ObserveResizeDirective; inputs: {}; outputs: {}; }]>;
113
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatedOverlayDirective<any>, never, never, { "placement": { "alias": "placement"; "required": false; }; "fallbackPlacements": { "alias": "fallbackPlacements"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; }; "viewportPadding": { "alias": "viewportPadding"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "shift": { "alias": "shift"; "required": false; }; "autoHide": { "alias": "autoHide"; "required": false; }; "autoCloseIfReferenceHidden": { "alias": "autoCloseIfReferenceHidden"; "required": false; }; "referenceElement": { "alias": "referenceElement"; "required": false; }; }, {}, never, never, true, never>;
114
+ static ngAcceptInputType_autoResize: unknown;
115
+ static ngAcceptInputType_shift: unknown;
116
+ static ngAcceptInputType_autoHide: unknown;
117
+ static ngAcceptInputType_autoCloseIfReferenceHidden: unknown;
110
118
  }
@@ -1,6 +1,7 @@
1
1
  import { EffectRef, ElementRef, Injector, QueryList, Signal, WritableSignal } from '@angular/core';
2
2
  import { AbstractControl, FormControl } from '@angular/forms';
3
3
  import { Observable } from 'rxjs';
4
+ import { RouterState } from '../services';
4
5
  import { Breakpoint } from '../types';
5
6
  type SignalElementBindingComplexType = HTMLElement | ElementRef<HTMLElement> | QueryList<ElementRef<HTMLElement> | HTMLElement> | Array<ElementRef<HTMLElement> | HTMLElement> | null | undefined;
6
7
  type SignalElementBindingType = HTMLElement | ElementRef<HTMLElement> | Observable<SignalElementBindingComplexType> | Signal<SignalElementBindingComplexType> | QueryList<ElementRef<HTMLElement> | HTMLElement> | ElementSignal;
@@ -162,24 +163,50 @@ export type InjectUtilTransformConfig<In, Out> = {
162
163
  */
163
164
  transform?: (value: In) => Out;
164
165
  };
165
- export declare const injectOrRunInContext: <T>(fn: () => T, config?: InjectUtilConfig) => T;
166
166
  export declare const transformOrReturn: <In, Out>(src: Signal<In>, config?: InjectUtilTransformConfig<In, Out>) => Signal<Out>;
167
+ /** Inject the current router event */
168
+ export declare const injectRouterEvent: () => Signal<import("@angular/router").Event | null>;
169
+ /**
170
+ * Inject the current url.
171
+ * The url includes query params as well as the fragment. Use `injectRoute` instead if you are not intrusted in those.
172
+ * @example "/my-page?query=1&param=true#fragment"
173
+ */
174
+ export declare const injectUrl: () => Signal<string>;
175
+ /**
176
+ * Inject the current route
177
+ * @example "/my-page"
178
+ */
179
+ export declare const injectRoute: () => Signal<string>;
180
+ /**
181
+ * Inject the complete router state. This includes the current route data, path params, query params, title and fragment.
182
+ */
183
+ export declare const injectRouterState: () => Signal<RouterState>;
167
184
  /** Inject a signal containing the current route fragment (the part after the # inside the url if present) */
168
185
  export declare const injectFragment: <T = string | null>(config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
169
186
  /** Inject all currently available query parameters as a signal */
170
- export declare const injectQueryParams: (config?: InjectUtilConfig) => Signal<import("@angular/router").Params>;
187
+ export declare const injectQueryParams: () => Signal<import("@angular/router").Params>;
171
188
  /** Inject all currently available route data as a signal */
172
- export declare const injectRouteData: (config?: InjectUtilConfig) => Signal<import("@angular/router").Data>;
189
+ export declare const injectRouteData: () => Signal<import("@angular/router").Data>;
173
190
  /** Inject the current route title as a signal */
174
- export declare const injectRouteTitle: <T = string | null>(config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
191
+ export declare const injectRouteTitle: <T = string | null>(config?: InjectUtilTransformConfig<string | null, T>) => Signal<T>;
175
192
  /** Inject all currently available path parameters as a signal */
176
- export declare const injectPathParams: (config?: InjectUtilConfig) => Signal<import("@angular/router").Params>;
193
+ export declare const injectPathParams: () => Signal<import("@angular/router").Params>;
177
194
  /** Inject a specific query parameter as a signal */
178
- export declare const injectQueryParam: <T = string | null>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
195
+ export declare const injectQueryParam: <T = string | null>(key: string, config?: InjectUtilTransformConfig<string | null, T>) => Signal<T>;
179
196
  /** Inject a specific route data item as a signal */
180
- export declare const injectRouteDataItem: <T = unknown>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<unknown, T>) => Signal<T>;
197
+ export declare const injectRouteDataItem: <T = unknown>(key: string, config?: InjectUtilTransformConfig<unknown, T>) => Signal<T>;
181
198
  /** Inject a specific path parameter as a signal */
182
- export declare const injectPathParam: <T = string | null>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
199
+ export declare const injectPathParam: <T = string | null>(key: string, config?: InjectUtilTransformConfig<string | null, T>) => Signal<T>;
200
+ /**
201
+ * Inject query params that changed during navigation. Unchanged query params will be ignored.
202
+ * Removed query params will be represented by the symbol `ET_PROPERTY_REMOVED`.
203
+ */
204
+ export declare const injectQueryParamChanges: () => Signal<Record<string, unknown>>;
205
+ /**
206
+ * Inject path params that changed during navigation. Unchanged path params will be ignored.
207
+ * Removed path params will be represented by the symbol `ET_PROPERTY_REMOVED`.
208
+ */
209
+ export declare const injectPathParamChanges: () => Signal<Record<string, unknown>>;
183
210
  export declare const createIsRenderedSignal: () => {
184
211
  state: WritableSignal<boolean>;
185
212
  bind: () => EffectRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "4.21.4",
3
+ "version": "4.23.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^18.1.0",
6
6
  "@angular/common": "^18.1.0",