@ethlete/core 3.9.0 → 3.11.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/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +5 -6
- package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +4 -1
- package/esm2022/lib/utils/angular.utils.mjs +7 -0
- package/esm2022/lib/utils/public-api.mjs +2 -1
- package/esm2022/lib/utils/reactive-binding.util.mjs +12 -1
- package/esm2022/lib/utils/selection-model.utils.mjs +40 -2
- package/esm2022/lib/utils/signal.utils.mjs +81 -56
- package/fesm2022/ethlete-core.mjs +137 -63
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/directives/animated-lifecycle/animated-lifecycle.directive.d.ts +4 -1
- package/lib/directives/observe-visibility/observe-visibility.directive.d.ts +2 -0
- package/lib/utils/angular.utils.d.ts +3 -0
- package/lib/utils/public-api.d.ts +1 -0
- package/lib/utils/reactive-binding.util.d.ts +11 -0
- package/lib/utils/selection-model.utils.d.ts +27 -16
- package/lib/utils/signal.utils.d.ts +42 -7
- package/package.json +1 -1
|
@@ -12,7 +12,10 @@ export declare class AnimatedLifecycleDirective implements AfterViewInit {
|
|
|
12
12
|
private _state$;
|
|
13
13
|
readonly state$: import("rxjs").Observable<AnimatedLifecycleState>;
|
|
14
14
|
get state(): AnimatedLifecycleState;
|
|
15
|
-
|
|
15
|
+
readonly hostClassBindings: {
|
|
16
|
+
remove: (...tokens: string[]) => void;
|
|
17
|
+
has: (token: string) => boolean;
|
|
18
|
+
};
|
|
16
19
|
ngAfterViewInit(): void;
|
|
17
20
|
enter(config?: {
|
|
18
21
|
onlyTransition?: boolean;
|
|
@@ -20,6 +20,8 @@ export declare class ObserveVisibilityDirective implements AfterViewInit {
|
|
|
20
20
|
private readonly _elementRef;
|
|
21
21
|
private readonly _intersectionObserverService;
|
|
22
22
|
protected readonly visibilityChange: import("@angular/core").WritableSignal<ObserveVisibilityChange | null>;
|
|
23
|
+
readonly currentVisibility: Signal<ObserveVisibilityChange | null>;
|
|
24
|
+
readonly currentVisibility$: import("rxjs").Observable<ObserveVisibilityChange | null>;
|
|
23
25
|
readonly etObserveVisibility: EventEmitter<ObserveVisibilityChange>;
|
|
24
26
|
constructor();
|
|
25
27
|
ngAfterViewInit(): void;
|
|
@@ -16,5 +16,16 @@ export interface ReactiveBindingResult {
|
|
|
16
16
|
remove: (...attributes: string[]) => void;
|
|
17
17
|
push: (value: ReactiveAttributes) => void;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use one of the following instead:
|
|
21
|
+
* - `signalHostAttributes`
|
|
22
|
+
* - `signalHostClasses`
|
|
23
|
+
* - `signalHostStyles`
|
|
24
|
+
* - `signalAttributes`
|
|
25
|
+
* - `signalClasses`
|
|
26
|
+
* - `signalStyles`
|
|
27
|
+
*
|
|
28
|
+
* Will be removed in v4.
|
|
29
|
+
*/
|
|
19
30
|
export declare const createReactiveBindings: (...values: ReactiveAttributes[]) => ReactiveBindingResult;
|
|
20
31
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { TypedQueryList } from '../types';
|
|
1
3
|
export type SelectionModelTypes = string | number | Record<string, unknown> | unknown;
|
|
2
4
|
export type SelectionModelPropertyPath = string;
|
|
3
5
|
export type SelectionModelOptionValueFn<T extends SelectionModelTypes = any> = (option: T) => unknown;
|
|
@@ -15,45 +17,52 @@ export type SelectionModelOptionValueFn<T extends SelectionModelTypes = any> = (
|
|
|
15
17
|
*/
|
|
16
18
|
export type SelectionModelBinding<T extends SelectionModelTypes = any> = SelectionModelPropertyPath | SelectionModelOptionValueFn<T>;
|
|
17
19
|
export declare class SelectionModel<T extends SelectionModelTypes = unknown> {
|
|
18
|
-
get selection$():
|
|
20
|
+
get selection$(): Observable<T[]>;
|
|
19
21
|
get selection(): T[];
|
|
20
22
|
private readonly _selection$;
|
|
21
|
-
get options$():
|
|
23
|
+
get options$(): Observable<T[]>;
|
|
22
24
|
get options(): T[];
|
|
23
25
|
private readonly _options$;
|
|
24
|
-
get valueBinding$():
|
|
26
|
+
get valueBinding$(): Observable<SelectionModelBinding<T> | null>;
|
|
25
27
|
get valueBinding(): SelectionModelBinding<T> | null;
|
|
26
28
|
private readonly _valueBinding$;
|
|
27
|
-
get keyBinding$():
|
|
29
|
+
get keyBinding$(): Observable<SelectionModelBinding<T> | null>;
|
|
28
30
|
get keyBinding(): SelectionModelBinding<T> | null;
|
|
29
31
|
private readonly _keyBinding$;
|
|
30
|
-
get labelBinding$():
|
|
32
|
+
get labelBinding$(): Observable<SelectionModelBinding<T> | null>;
|
|
31
33
|
get labelBinding(): SelectionModelBinding<T> | null;
|
|
32
34
|
private readonly _labelBinding$;
|
|
33
|
-
get
|
|
35
|
+
get disabledBinding$(): Observable<SelectionModelBinding<T> | null>;
|
|
36
|
+
get disabledBinding(): SelectionModelBinding<T> | null;
|
|
37
|
+
private readonly _disabledBinding$;
|
|
38
|
+
get allowMultiple$(): Observable<boolean>;
|
|
34
39
|
get allowMultiple(): boolean;
|
|
35
40
|
private readonly _allowMultiple$;
|
|
36
|
-
get filter$():
|
|
41
|
+
get filter$(): Observable<string>;
|
|
37
42
|
get filter(): string;
|
|
38
43
|
private readonly _filter$;
|
|
39
|
-
readonly value$:
|
|
40
|
-
readonly filteredOptions$:
|
|
44
|
+
readonly value$: Observable<unknown>;
|
|
45
|
+
readonly filteredOptions$: Observable<T[]>;
|
|
41
46
|
private readonly _optionsAndSelection$;
|
|
42
47
|
setSelection(selection: T | T[]): this;
|
|
43
48
|
setValueBinding(fnOrPropertyPath: SelectionModelBinding<T> | null): this;
|
|
44
49
|
setKeyBinding(fnOrPropertyPath: SelectionModelBinding<T> | null): this;
|
|
45
50
|
setLabelBinding(fnOrPropertyPath: SelectionModelBinding<T> | null): this;
|
|
51
|
+
setDisabledBinding(fnOrPropertyPath: SelectionModelBinding<T> | null): this;
|
|
46
52
|
setOptions(options: T[]): this;
|
|
53
|
+
setOptionsFromQueryList(queryList: TypedQueryList<T>): this;
|
|
54
|
+
setOptionsFromQueryList$(queryList$: Observable<TypedQueryList<T> | null | undefined>): this;
|
|
47
55
|
setAllowMultiple(allowMultiple: boolean): this;
|
|
48
56
|
setFilter(filter: string | null): void;
|
|
49
57
|
reset(): void;
|
|
50
|
-
getOptionByValue$(value: unknown):
|
|
51
|
-
getOptionByLabel$(label: string):
|
|
52
|
-
getOptionByKey$(key: string):
|
|
53
|
-
isSelected$(option: T):
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
getOptionByValue$(value: unknown): Observable<T | undefined>;
|
|
59
|
+
getOptionByLabel$(label: string): Observable<T | undefined>;
|
|
60
|
+
getOptionByKey$(key: string): Observable<T | undefined>;
|
|
61
|
+
isSelected$(option: T): Observable<boolean>;
|
|
62
|
+
isDisabled$(option: T): Observable<unknown>;
|
|
63
|
+
getLabel$(option: T): Observable<unknown>;
|
|
64
|
+
getValue$(option: T): Observable<unknown>;
|
|
65
|
+
getKey$(option: T): Observable<unknown>;
|
|
57
66
|
getOptionByValue(value: unknown): T | undefined;
|
|
58
67
|
getOptionByLabel(label: string): T | undefined;
|
|
59
68
|
getOptionByKey(key: string): T | undefined;
|
|
@@ -75,9 +84,11 @@ export declare class SelectionModel<T extends SelectionModelTypes = unknown> {
|
|
|
75
84
|
getLabel(option: T): unknown;
|
|
76
85
|
getValue(option: T): unknown;
|
|
77
86
|
getKey(option: T): unknown;
|
|
87
|
+
getDisabled(option: T): unknown;
|
|
78
88
|
execFnOrGetOptionProperty(option: T, fnOrPropertyPath: SelectionModelBinding<T> | null): unknown;
|
|
79
89
|
getOptionProperty(option: T, propertyPath: string | null): unknown;
|
|
80
90
|
isSelected(option: T): boolean;
|
|
91
|
+
isDisabled(option: T): unknown;
|
|
81
92
|
getFilteredOptions(filter?: string, options?: T[]): T[];
|
|
82
93
|
addSelectedOption(option: T): void;
|
|
83
94
|
removeSelectedOption(option: T): void;
|
|
@@ -1,7 +1,42 @@
|
|
|
1
|
-
import { Signal } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ElementRef, Signal } from '@angular/core';
|
|
2
|
+
import { Observable, map } from 'rxjs';
|
|
3
|
+
type SignalElementBindingType = HTMLElement | ElementRef<HTMLElement> | Observable<HTMLElement | ElementRef<HTMLElement> | null | undefined> | Signal<HTMLElement | ElementRef<HTMLElement> | null | undefined>;
|
|
4
|
+
export declare const buildSignalEffects: <T extends Record<string, Signal<unknown>>>(config: {
|
|
5
|
+
map: T;
|
|
6
|
+
eachItemFn: (pair: {
|
|
7
|
+
key: string;
|
|
8
|
+
value: unknown;
|
|
9
|
+
}) => void;
|
|
10
|
+
cleanupFn: (pair: {
|
|
11
|
+
key: string;
|
|
12
|
+
value: unknown;
|
|
13
|
+
}) => void;
|
|
14
|
+
}) => {
|
|
15
|
+
remove: (...tokens: string[]) => void;
|
|
16
|
+
has: (token: string) => boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const signalClasses: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, classMap: T) => {
|
|
19
|
+
remove: (...tokens: string[]) => void;
|
|
20
|
+
has: (token: string) => boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const signalHostClasses: <T extends Record<string, Signal<unknown>>>(classMap: T) => {
|
|
23
|
+
remove: (...tokens: string[]) => void;
|
|
24
|
+
has: (token: string) => boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const signalAttributes: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, attributeMap: T) => {
|
|
27
|
+
remove: (...tokens: string[]) => void;
|
|
28
|
+
has: (token: string) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const signalHostAttributes: <T extends Record<string, Signal<unknown>>>(attributeMap: T) => {
|
|
31
|
+
remove: (...tokens: string[]) => void;
|
|
32
|
+
has: (token: string) => boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare const signalStyles: <T extends Record<string, Signal<unknown>>>(el: SignalElementBindingType, styleMap: T) => {
|
|
35
|
+
remove: (...tokens: string[]) => void;
|
|
36
|
+
has: (token: string) => boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare const signalHostStyles: <T extends Record<string, Signal<unknown>>>(styleMap: T) => {
|
|
39
|
+
remove: (...tokens: string[]) => void;
|
|
40
|
+
has: (token: string) => boolean;
|
|
41
|
+
};
|
|
42
|
+
export {};
|