@ethlete/core 4.21.3 → 4.22.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/CHANGELOG.md +26 -0
- package/esm2022/lib/components/structured-data/structured-data.component.mjs +3 -3
- package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-if/animated-if.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +3 -3
- package/esm2022/lib/directives/click-outside/click-outside.directive.mjs +3 -3
- package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
- package/esm2022/lib/directives/debug/debug.directive.mjs +3 -3
- package/esm2022/lib/directives/delayable/delayable.directive.mjs +3 -3
- package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +3 -3
- package/esm2022/lib/directives/is-element/is-element.directive.mjs +3 -3
- package/esm2022/lib/directives/let/let.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-content/observe-content.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +3 -3
- package/esm2022/lib/directives/repeat/repeat.directive.mjs +3 -3
- package/esm2022/lib/directives/root-boundary/root-boundary.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
- package/esm2022/lib/directives/seo/seo.directive.mjs +3 -3
- package/esm2022/lib/pipes/infer-mime-type/infer-mime-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/to-array/to-array.pipe.mjs +3 -3
- package/esm2022/lib/props/create-props.mjs +10 -8
- package/esm2022/lib/props/props.directive.mjs +13 -11
- package/esm2022/lib/services/click-observer.service.mjs +6 -6
- package/esm2022/lib/services/content-observer.service.mjs +6 -6
- package/esm2022/lib/services/focus-visible.service.mjs +3 -3
- package/esm2022/lib/services/intersection-observer.service.mjs +6 -6
- package/esm2022/lib/services/resize-observer.service.mjs +6 -6
- package/esm2022/lib/services/router-state.service.mjs +3 -3
- package/esm2022/lib/services/viewport.service.mjs +3 -3
- package/esm2022/lib/utils/signal.utils.mjs +136 -36
- package/fesm2022/ethlete-core.mjs +274 -171
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/pipes/normalize-match-participants/normalize-match-participants.util.d.ts +1 -1
- package/lib/props/dependency-stash.d.ts +3 -3
- package/lib/utils/cookie.util.d.ts +1 -1
- package/lib/utils/form.utils.d.ts +1 -1
- package/lib/utils/scrollable.utils.d.ts +1 -1
- package/lib/utils/signal.utils.d.ts +38 -11
- package/lib/utils/value.utils.d.ts +2 -2
- package/lib/utils/viewport.util.d.ts +1 -1
- package/lib/validators/index.d.ts +3 -3
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MatchListView } from '@ethlete/types';
|
|
2
2
|
import { NormalizedMatchParticipant, NormalizedMatchParticipants } from './normalize-match-participants.types';
|
|
3
3
|
export declare const normalizeMatchParticipants: (match: MatchListView | null) => NormalizedMatchParticipants | null;
|
|
4
|
-
export declare const normalizeMatchParticipant: (match: MatchListView | null, side:
|
|
4
|
+
export declare const normalizeMatchParticipant: (match: MatchListView | null, side: "home" | "away") => NormalizedMatchParticipant | null;
|
|
@@ -4,8 +4,8 @@ export declare const createDependencyStash: <T extends Record<string, WritableSi
|
|
|
4
4
|
signal: Signal<ReturnType<T[K]>>;
|
|
5
5
|
for: K;
|
|
6
6
|
}) => void;
|
|
7
|
-
provideValue: <
|
|
8
|
-
value: ReturnType<T[
|
|
9
|
-
for:
|
|
7
|
+
provideValue: <K extends keyof T>(data: {
|
|
8
|
+
value: ReturnType<T[K]>;
|
|
9
|
+
for: K;
|
|
10
10
|
}) => void;
|
|
11
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const hasCookie: (name: string) => boolean;
|
|
2
2
|
export declare const getCookie: (name: string) => string | null | undefined;
|
|
3
|
-
export declare const setCookie: (name: string, data: string, expiresInDays?: number, domain?: string | null, path?: string, sameSite?:
|
|
3
|
+
export declare const setCookie: (name: string, data: string, expiresInDays?: number, domain?: string | null, path?: string, sameSite?: "strict" | "none" | "lax") => void;
|
|
4
4
|
export declare const deleteCookie: (name: string, path?: string, domain?: string | null) => void;
|
|
5
5
|
export declare const getDomain: () => string | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FormGroup } from '@angular/forms';
|
|
2
2
|
export declare const cloneFormGroup: <T extends FormGroup<any>>(formGroup: T) => T;
|
|
3
|
-
export declare const getFormGroupValue: <T extends FormGroup
|
|
3
|
+
export declare const getFormGroupValue: <T extends FormGroup>(formGroup: T) => Record<string, unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const elementCanScroll: (element: HTMLElement, direction?:
|
|
1
|
+
export declare const elementCanScroll: (element: HTMLElement, direction?: "x" | "y") => boolean;
|
|
2
2
|
export interface IsElementVisibleOptions {
|
|
3
3
|
/**
|
|
4
4
|
* The element to check if it is visible inside a container.
|
|
@@ -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;
|
|
@@ -132,11 +133,11 @@ export interface ControlValueSignalOptions {
|
|
|
132
133
|
*/
|
|
133
134
|
debounceFirst?: boolean;
|
|
134
135
|
}
|
|
135
|
-
export declare const controlValueSignal: <T extends AbstractControl
|
|
136
|
+
export declare const controlValueSignal: <T extends Signal<AbstractControl | null> | AbstractControl, J extends T extends Signal<infer I> ? I : T>(control: T, options?: ControlValueSignalOptions) => Signal<ReturnType<NonNullable<J>["getRawValue"]> | null>;
|
|
136
137
|
/**
|
|
137
138
|
* The first item in the pair is the previous value and the second item is the current value.
|
|
138
139
|
*/
|
|
139
|
-
export declare const controlValueSignalWithPrevious: <T extends AbstractControl
|
|
140
|
+
export declare const controlValueSignalWithPrevious: <T extends AbstractControl>(control: T, options?: ControlValueSignalOptions) => Signal<any[] | [ReturnType<NonNullable<T extends Signal<infer I> ? I : T>["getRawValue"]> | null, ReturnType<NonNullable<T extends Signal<infer I> ? I : T>["getRawValue"]> | null]>;
|
|
140
141
|
/**
|
|
141
142
|
* @deprecated Use `controlValueSignal` instead with `debounceTime` option.
|
|
142
143
|
*/
|
|
@@ -149,7 +150,7 @@ export interface DebouncedControlValueSignalOptions {
|
|
|
149
150
|
/**
|
|
150
151
|
* @deprecated Use `controlValueSignal` instead with `debounceTime` set to `300` and `debounceFirst` set to `true`.
|
|
151
152
|
*/
|
|
152
|
-
export declare const debouncedControlValueSignal: <T extends FormControl
|
|
153
|
+
export declare const debouncedControlValueSignal: <T extends FormControl>(control: T, options?: DebouncedControlValueSignalOptions) => Signal<ReturnType<NonNullable<T extends Signal<infer I> ? I : T>["getRawValue"]> | null>;
|
|
153
154
|
export type InjectUtilConfig = {
|
|
154
155
|
/** The injector to use for the injection. Must be provided if the function is not called from within a injection context. */
|
|
155
156
|
injector?: Injector;
|
|
@@ -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¶m=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: (
|
|
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: (
|
|
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?:
|
|
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: (
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Primitive } from '../types';
|
|
2
|
-
export declare const isPrimitiveArray: (value: unknown) => value is Primitive
|
|
3
|
-
export declare const isObjectArray: (value: unknown) => value is Record<string, unknown
|
|
2
|
+
export declare const isPrimitiveArray: (value: unknown) => value is Array<Primitive>;
|
|
3
|
+
export declare const isObjectArray: (value: unknown) => value is Array<Record<string, unknown>>;
|
|
4
4
|
export declare const isEmptyArray: (value: unknown) => value is [];
|
|
@@ -2,5 +2,5 @@ import { VIEWPORT_CONFIG } from '../constants';
|
|
|
2
2
|
import { ViewportConfig } from '../types';
|
|
3
3
|
export declare const provideViewportConfig: (viewportConfig: ViewportConfig) => {
|
|
4
4
|
provide: typeof VIEWPORT_CONFIG;
|
|
5
|
-
useValue:
|
|
5
|
+
useValue: typeof viewportConfig;
|
|
6
6
|
};
|
|
@@ -3,10 +3,10 @@ export * from './is-array-not-empty.validator';
|
|
|
3
3
|
export * from './is-email.validator';
|
|
4
4
|
export * from './must-match.validator';
|
|
5
5
|
export declare const Validators: {
|
|
6
|
-
readonly MustMatch: (controlName: string, matchingControlName: string) => (formGroup: import("@angular/forms").AbstractControl
|
|
6
|
+
readonly MustMatch: (controlName: string, matchingControlName: string) => (formGroup: import("@angular/forms").AbstractControl) => {
|
|
7
7
|
mustMatch: boolean;
|
|
8
8
|
} | null;
|
|
9
|
-
readonly IsEmail: (control: import("@angular/forms").AbstractControl
|
|
10
|
-
readonly IsArrayNotEmpty: (control: import("@angular/forms").AbstractControl
|
|
9
|
+
readonly IsEmail: (control: import("@angular/forms").AbstractControl) => import("@angular/forms").ValidationErrors | null;
|
|
10
|
+
readonly IsArrayNotEmpty: (control: import("@angular/forms").AbstractControl) => import("@angular/forms").ValidationErrors | null;
|
|
11
11
|
readonly ValidateAtLeastOneRequired: (config: import("./at-least-one-required.validator").ValidateAtLeastOneRequiredConfig) => import("@angular/forms").ValidatorFn;
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.22.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/cdk": "18.0
|
|
6
|
-
"@angular/common": "18.0
|
|
7
|
-
"@angular/core": "18.0
|
|
8
|
-
"@angular/forms": "18.0
|
|
9
|
-
"@angular/platform-browser": "18.0
|
|
10
|
-
"@angular/router": "18.0
|
|
5
|
+
"@angular/cdk": "^18.1.0",
|
|
6
|
+
"@angular/common": "^18.1.0",
|
|
7
|
+
"@angular/core": "^18.1.0",
|
|
8
|
+
"@angular/forms": "^18.1.0",
|
|
9
|
+
"@angular/platform-browser": "^18.1.0",
|
|
10
|
+
"@angular/router": "^18.1.0",
|
|
11
11
|
"@ethlete/theming": "^2.3.1",
|
|
12
12
|
"@ethlete/types": "^1.6.2",
|
|
13
13
|
"@floating-ui/dom": "^1.5.3",
|