@ethlete/core 4.12.1 → 4.14.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 +20 -0
- package/esm2022/lib/utils/scrollable.utils.mjs +7 -5
- package/esm2022/lib/utils/signal.utils.mjs +159 -61
- package/fesm2022/ethlete-core.mjs +164 -66
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/directives/animated-lifecycle/animated-lifecycle.directive.d.ts +3 -3
- package/lib/props/create-prop-handlers.d.ts +9 -9
- package/lib/props/props.directive.d.ts +9 -9
- package/lib/utils/signal.utils.d.ts +48 -34
- package/package.json +1 -1
|
@@ -13,10 +13,10 @@ export declare class AnimatedLifecycleDirective implements AfterViewInit {
|
|
|
13
13
|
readonly state$: import("rxjs").Observable<AnimatedLifecycleState>;
|
|
14
14
|
get state(): AnimatedLifecycleState;
|
|
15
15
|
readonly hostClassBindings: {
|
|
16
|
-
remove: (
|
|
16
|
+
remove: (tokens: string) => void;
|
|
17
17
|
removeMany: (tokens: string[]) => void;
|
|
18
|
-
has: (
|
|
19
|
-
push: (
|
|
18
|
+
has: (tokens: string) => boolean;
|
|
19
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
20
20
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
21
21
|
};
|
|
22
22
|
stateChange: import("@angular/core").OutputRef<AnimatedLifecycleState>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
export declare const createPropHandlers: () => {
|
|
3
3
|
classes: {
|
|
4
|
-
remove: (
|
|
4
|
+
remove: (tokens: string) => void;
|
|
5
5
|
removeMany: (tokens: string[]) => void;
|
|
6
|
-
has: (
|
|
7
|
-
push: (
|
|
6
|
+
has: (tokens: string) => boolean;
|
|
7
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
8
8
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
9
9
|
};
|
|
10
10
|
attributes: {
|
|
11
|
-
remove: (
|
|
11
|
+
remove: (tokens: string) => void;
|
|
12
12
|
removeMany: (tokens: string[]) => void;
|
|
13
|
-
has: (
|
|
14
|
-
push: (
|
|
13
|
+
has: (tokens: string) => boolean;
|
|
14
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
15
15
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
16
16
|
};
|
|
17
17
|
styles: {
|
|
18
|
-
remove: (
|
|
18
|
+
remove: (tokens: string) => void;
|
|
19
19
|
removeMany: (tokens: string[]) => void;
|
|
20
|
-
has: (
|
|
21
|
-
push: (
|
|
20
|
+
has: (tokens: string) => boolean;
|
|
21
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
22
22
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
23
23
|
};
|
|
24
24
|
id: string;
|
|
@@ -9,24 +9,24 @@ export declare class PropsDirective {
|
|
|
9
9
|
}>>;
|
|
10
10
|
propHandlers: {
|
|
11
11
|
classes: {
|
|
12
|
-
remove: (
|
|
12
|
+
remove: (tokens: string) => void;
|
|
13
13
|
removeMany: (tokens: string[]) => void;
|
|
14
|
-
has: (
|
|
15
|
-
push: (
|
|
14
|
+
has: (tokens: string) => boolean;
|
|
15
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
16
16
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
17
17
|
};
|
|
18
18
|
attributes: {
|
|
19
|
-
remove: (
|
|
19
|
+
remove: (tokens: string) => void;
|
|
20
20
|
removeMany: (tokens: string[]) => void;
|
|
21
|
-
has: (
|
|
22
|
-
push: (
|
|
21
|
+
has: (tokens: string) => boolean;
|
|
22
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
23
23
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
24
24
|
};
|
|
25
25
|
styles: {
|
|
26
|
-
remove: (
|
|
26
|
+
remove: (tokens: string) => void;
|
|
27
27
|
removeMany: (tokens: string[]) => void;
|
|
28
|
-
has: (
|
|
29
|
-
push: (
|
|
28
|
+
has: (tokens: string) => boolean;
|
|
29
|
+
push: (tokens: string, signal: import("@angular/core").Signal<unknown>) => void;
|
|
30
30
|
pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
|
|
31
31
|
};
|
|
32
32
|
id: string;
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { ElementRef, Injector, QueryList, Signal, WritableSignal } from '@angular/core';
|
|
1
|
+
import { EffectRef, ElementRef, Injector, QueryList, Signal, WritableSignal } from '@angular/core';
|
|
2
2
|
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
type SignalElementBindingComplexType = HTMLElement | ElementRef<HTMLElement> | QueryList<ElementRef<HTMLElement> | HTMLElement> | Array<ElementRef<HTMLElement> | HTMLElement> | null | undefined;
|
|
5
5
|
type SignalElementBindingType = HTMLElement | ElementRef<HTMLElement> | Observable<SignalElementBindingComplexType> | Signal<SignalElementBindingComplexType> | QueryList<ElementRef<HTMLElement> | HTMLElement> | ElementSignal;
|
|
6
6
|
type ElementSignal = Signal<{
|
|
7
|
+
/** @deprecated Always use currentElements */
|
|
7
8
|
currentElement: HTMLElement | null;
|
|
9
|
+
/** @deprecated Always use previousElements */
|
|
8
10
|
previousElement: HTMLElement | null;
|
|
9
11
|
currentElements: HTMLElement[];
|
|
10
12
|
previousElements: HTMLElement[];
|
|
11
13
|
}>;
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}) => {
|
|
23
|
-
remove: (...tokens: string[]) => void;
|
|
14
|
+
export interface BuildSignalEffectsConfig<T extends Record<string, Signal<unknown>>> {
|
|
15
|
+
/** The tokens to apply and their signal value */
|
|
16
|
+
tokenMap: T;
|
|
17
|
+
/** This function will be invoked for elements that were removed from the signal effects */
|
|
18
|
+
cleanupFn: (el: HTMLElement, tokens: string[]) => void;
|
|
19
|
+
/** This function will be invoked for elements that were added to the signal effects or when their signal value changes */
|
|
20
|
+
updateFn: (el: HTMLElement, tokens: string[], conditionResult: unknown) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const buildSignalEffects: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, config: BuildSignalEffectsConfig<T>) => {
|
|
23
|
+
remove: (tokens: string) => void;
|
|
24
24
|
removeMany: (tokens: string[]) => void;
|
|
25
|
-
has: (
|
|
26
|
-
push: (
|
|
25
|
+
has: (tokens: string) => boolean;
|
|
26
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
27
27
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
28
28
|
};
|
|
29
29
|
export declare const signalIsRendered: () => Signal<boolean>;
|
|
30
30
|
export declare const signalClasses: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, classMap: T) => {
|
|
31
|
-
remove: (
|
|
31
|
+
remove: (tokens: string) => void;
|
|
32
32
|
removeMany: (tokens: string[]) => void;
|
|
33
|
-
has: (
|
|
34
|
-
push: (
|
|
33
|
+
has: (tokens: string) => boolean;
|
|
34
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
35
35
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
36
36
|
};
|
|
37
37
|
export declare const signalHostClasses: <T extends Record<string, Signal<unknown>>>(classMap: T) => {
|
|
38
|
-
remove: (
|
|
38
|
+
remove: (tokens: string) => void;
|
|
39
39
|
removeMany: (tokens: string[]) => void;
|
|
40
|
-
has: (
|
|
41
|
-
push: (
|
|
40
|
+
has: (tokens: string) => boolean;
|
|
41
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
42
42
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
43
43
|
};
|
|
44
44
|
export declare const signalAttributes: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, attributeMap: T) => {
|
|
45
|
-
remove: (
|
|
45
|
+
remove: (tokens: string) => void;
|
|
46
46
|
removeMany: (tokens: string[]) => void;
|
|
47
|
-
has: (
|
|
48
|
-
push: (
|
|
47
|
+
has: (tokens: string) => boolean;
|
|
48
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
49
49
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
50
50
|
};
|
|
51
51
|
export declare const signalHostAttributes: <T extends Record<string, Signal<unknown>>>(attributeMap: T) => {
|
|
52
|
-
remove: (
|
|
52
|
+
remove: (tokens: string) => void;
|
|
53
53
|
removeMany: (tokens: string[]) => void;
|
|
54
|
-
has: (
|
|
55
|
-
push: (
|
|
54
|
+
has: (tokens: string) => boolean;
|
|
55
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
56
56
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
57
57
|
};
|
|
58
58
|
export declare const signalStyles: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, styleMap: T) => {
|
|
59
|
-
remove: (
|
|
59
|
+
remove: (tokens: string) => void;
|
|
60
60
|
removeMany: (tokens: string[]) => void;
|
|
61
|
-
has: (
|
|
62
|
-
push: (
|
|
61
|
+
has: (tokens: string) => boolean;
|
|
62
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
63
63
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
64
64
|
};
|
|
65
65
|
export declare const signalHostStyles: <T extends Record<string, Signal<unknown>>>(styleMap: T) => {
|
|
66
|
-
remove: (
|
|
66
|
+
remove: (tokens: string) => void;
|
|
67
67
|
removeMany: (tokens: string[]) => void;
|
|
68
|
-
has: (
|
|
69
|
-
push: (
|
|
68
|
+
has: (tokens: string) => boolean;
|
|
69
|
+
push: (tokens: string, signal: Signal<unknown>) => void;
|
|
70
70
|
pushMany: (map: Record<string, Signal<unknown>>) => void;
|
|
71
71
|
};
|
|
72
72
|
export interface LogicalSize {
|
|
@@ -83,7 +83,14 @@ export declare const signalElementDimensions: (el: SignalElementBindingType) =>
|
|
|
83
83
|
export declare const signalHostElementDimensions: () => Signal<ElementDimensions>;
|
|
84
84
|
export declare const signalElementMutations: (el: SignalElementBindingType, options?: MutationObserverInit) => Signal<MutationRecord | null>;
|
|
85
85
|
export declare const signalHostElementMutations: (options?: MutationObserverInit) => Signal<MutationRecord | null>;
|
|
86
|
-
export
|
|
86
|
+
export type SignalElementScrollStateOptions = {
|
|
87
|
+
/** The initial scroll position to scroll to. Once a truthy value get's emitted, all further values will be ignored. */
|
|
88
|
+
initialScrollPosition?: Signal<{
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
} | null>;
|
|
92
|
+
};
|
|
93
|
+
export declare const signalElementScrollState: (el: SignalElementBindingType, options?: SignalElementScrollStateOptions) => Signal<{
|
|
87
94
|
canScroll: boolean;
|
|
88
95
|
canScrollHorizontally: boolean;
|
|
89
96
|
canScrollVertically: boolean;
|
|
@@ -166,4 +173,11 @@ export declare const injectQueryParam: <T = string | null>(key: string, config?:
|
|
|
166
173
|
export declare const injectRouteDataItem: <T = unknown>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<unknown, T>) => Signal<T>;
|
|
167
174
|
/** Inject a specific path parameter as a signal */
|
|
168
175
|
export declare const injectPathParam: <T = string | null>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
|
|
176
|
+
export declare const createIsRenderedSignal: () => {
|
|
177
|
+
state: WritableSignal<boolean>;
|
|
178
|
+
bind: () => EffectRef;
|
|
179
|
+
};
|
|
180
|
+
export declare const createCanAnimateSignal: () => {
|
|
181
|
+
state: WritableSignal<boolean>;
|
|
182
|
+
};
|
|
169
183
|
export {};
|