@ethlete/core 3.10.0 → 3.11.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.
@@ -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
- private readonly _bindings;
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;
@@ -1,6 +1,7 @@
1
1
  import { OverlayRef } from '@angular/cdk/overlay';
2
2
  import { ComponentPortal, ComponentType } from '@angular/cdk/portal';
3
3
  import { ComponentRef, ElementRef, StaticProvider } from '@angular/core';
4
+ import { ProvideThemeDirective } from '@ethlete/theming';
4
5
  import { OffsetOptions, Padding, Placement } from '@floating-ui/dom';
5
6
  import { Subject } from 'rxjs';
6
7
  import { AnimatedLifecycleDirective } from '../animated-lifecycle';
@@ -10,6 +11,7 @@ export interface AnimatedOverlayComponentBase {
10
11
  _elementRef?: ElementRef<HTMLElement>;
11
12
  _animatedLifecycle?: AnimatedLifecycleDirective;
12
13
  _markForCheck?: () => void;
14
+ _setThemeFromProvider?: (provider: ProvideThemeDirective) => void;
13
15
  }
14
16
  export declare class AnimatedOverlayDirective<T extends AnimatedOverlayComponentBase> {
15
17
  private readonly _destroy$;
@@ -80,6 +82,7 @@ export declare class AnimatedOverlayDirective<T extends AnimatedOverlayComponent
80
82
  providers?: StaticProvider[];
81
83
  data?: Partial<T>;
82
84
  mirrorWidth?: boolean;
85
+ themeProvider?: ProvideThemeDirective | null;
83
86
  }): T | undefined;
84
87
  unmount(): void;
85
88
  beforeOpened(): Subject<void>;
@@ -0,0 +1,3 @@
1
+ import { Observable } from 'rxjs';
2
+ import { TypedQueryList } from '../types';
3
+ export declare function switchQueryListChanges(): <T extends TypedQueryList<unknown> | null | undefined>(source: Observable<T>) => Observable<T>;
@@ -1,4 +1,5 @@
1
1
  export * from './active-selection-model.utils';
2
+ export * from './angular.utils';
2
3
  export * from './animation.utils';
3
4
  export * from './clamp.util';
4
5
  export * from './clone.util';
@@ -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$(): import("rxjs").Observable<T[]>;
20
+ get selection$(): Observable<T[]>;
19
21
  get selection(): T[];
20
22
  private readonly _selection$;
21
- get options$(): import("rxjs").Observable<T[]>;
23
+ get options$(): Observable<T[]>;
22
24
  get options(): T[];
23
25
  private readonly _options$;
24
- get valueBinding$(): import("rxjs").Observable<SelectionModelBinding<T> | null>;
26
+ get valueBinding$(): Observable<SelectionModelBinding<T> | null>;
25
27
  get valueBinding(): SelectionModelBinding<T> | null;
26
28
  private readonly _valueBinding$;
27
- get keyBinding$(): import("rxjs").Observable<SelectionModelBinding<T> | null>;
29
+ get keyBinding$(): Observable<SelectionModelBinding<T> | null>;
28
30
  get keyBinding(): SelectionModelBinding<T> | null;
29
31
  private readonly _keyBinding$;
30
- get labelBinding$(): import("rxjs").Observable<SelectionModelBinding<T> | null>;
32
+ get labelBinding$(): Observable<SelectionModelBinding<T> | null>;
31
33
  get labelBinding(): SelectionModelBinding<T> | null;
32
34
  private readonly _labelBinding$;
33
- get allowMultiple$(): import("rxjs").Observable<boolean>;
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$(): import("rxjs").Observable<string>;
41
+ get filter$(): Observable<string>;
37
42
  get filter(): string;
38
43
  private readonly _filter$;
39
- readonly value$: import("rxjs").Observable<unknown>;
40
- readonly filteredOptions$: import("rxjs").Observable<T[]>;
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): import("rxjs").Observable<T | undefined>;
51
- getOptionByLabel$(label: string): import("rxjs").Observable<T | undefined>;
52
- getOptionByKey$(key: string): import("rxjs").Observable<T | undefined>;
53
- isSelected$(option: T): import("rxjs").Observable<boolean>;
54
- getLabel$(option: T): import("rxjs").Observable<unknown>;
55
- getValue$(option: T): import("rxjs").Observable<unknown>;
56
- getKey$(option: T): import("rxjs").Observable<unknown>;
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
- export declare const signalClasses: <T extends Record<string, Signal<unknown>>>(el: HTMLElement, classMap: T) => void;
3
- export declare const signalHostClasses: <T extends Record<string, Signal<unknown>>>(classMap: T) => void;
4
- export declare const signalAttributes: <T extends Record<string, Signal<unknown>>>(el: HTMLElement, attributeMap: T) => void;
5
- export declare const signalHostAttributes: <T extends Record<string, Signal<unknown>>>(attributeMap: T) => void;
6
- export declare const signalStyle: <T extends Record<string, Signal<unknown>>>(el: HTMLElement, styleMap: T) => void;
7
- export declare const signalHostStyle: <T extends Record<string, Signal<unknown>>>(styleMap: T) => void;
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "3.10.0",
3
+ "version": "3.11.1",
4
4
  "dependencies": {
5
5
  "tslib": "^2.5.0"
6
6
  },
@@ -10,7 +10,8 @@
10
10
  "@angular/platform-browser": "16.2.5",
11
11
  "@ethlete/types": "1.4.0",
12
12
  "rxjs": "7.8.1",
13
- "@angular/cdk": "16.2.6",
13
+ "@angular/cdk": "16.2.7",
14
+ "@ethlete/theming": "2.2.1",
14
15
  "@floating-ui/dom": "1.5.3",
15
16
  "@angular/router": "16.2.5",
16
17
  "@angular/forms": "16.2.5"