@ethlete/cdk 3.7.0 → 3.8.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.
- package/CHANGELOG.md +18 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/components/combobox/combobox.component.mjs +3 -3
- package/esm2022/lib/components/forms/components/select/components/combobox/constants/combobox.constants.mjs +6 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/constants/index.mjs +2 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/constants/public-api.mjs +2 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.mjs +27 -12
- package/esm2022/lib/components/forms/components/select/components/combobox/partials/combobox-body/combobox-body.component.mjs +19 -3
- package/esm2022/lib/components/forms/components/select/components/combobox/partials/combobox-option/combobox-option.component.mjs +18 -2
- package/esm2022/lib/components/forms/components/select/components/combobox/public-api.mjs +3 -1
- package/esm2022/lib/components/forms/components/select/components/combobox/types/combobox.types.mjs +2 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/types/index.mjs +2 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/types/public-api.mjs +2 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/utils/combobox-config.utils.mjs +13 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/utils/public-api.mjs +2 -1
- package/esm2022/lib/components/forms/components/select/components/select/partials/select-body/select-body.component.mjs +3 -3
- package/esm2022/lib/components/forms/directives/expose-input-vars/expose-input-vars.directive.mjs +83 -0
- package/esm2022/lib/components/forms/directives/expose-input-vars/index.mjs +2 -0
- package/esm2022/lib/components/forms/directives/expose-input-vars/public-api.mjs +2 -0
- package/esm2022/lib/components/forms/directives/input/input.directive.mjs +10 -2
- package/esm2022/lib/components/forms/directives/public-api.mjs +2 -1
- package/esm2022/lib/components/forms/directives/writeable-input/writeable-input.directive.mjs +1 -1
- package/esm2022/lib/components/forms/services/input-state.service.mjs +1 -1
- package/esm2022/lib/components/forms/types/input.types.mjs +1 -1
- package/esm2022/lib/components/icons/chevron-icon/chevron-icon.component.mjs +3 -2
- package/fesm2022/ethlete-cdk.mjs +170 -20
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/forms/components/select/components/combobox/constants/combobox.constants.d.ts +6 -0
- package/lib/components/forms/components/select/components/combobox/constants/index.d.ts +1 -0
- package/lib/components/forms/components/select/components/combobox/constants/public-api.d.ts +1 -0
- package/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.d.ts +7 -2
- package/lib/components/forms/components/select/components/combobox/partials/combobox-body/combobox-body.component.d.ts +1 -0
- package/lib/components/forms/components/select/components/combobox/partials/combobox-option/combobox-option.component.d.ts +1 -0
- package/lib/components/forms/components/select/components/combobox/public-api.d.ts +2 -0
- package/lib/components/forms/components/select/components/combobox/types/combobox.types.d.ts +30 -0
- package/lib/components/forms/components/select/components/combobox/types/index.d.ts +1 -0
- package/lib/components/forms/components/select/components/combobox/types/public-api.d.ts +1 -0
- package/lib/components/forms/components/select/components/combobox/utils/combobox-config.utils.d.ts +6 -0
- package/lib/components/forms/components/select/components/combobox/utils/public-api.d.ts +1 -0
- package/lib/components/forms/directives/expose-input-vars/expose-input-vars.directive.d.ts +30 -0
- package/lib/components/forms/directives/expose-input-vars/index.d.ts +1 -0
- package/lib/components/forms/directives/expose-input-vars/public-api.d.ts +1 -0
- package/lib/components/forms/directives/input/input.directive.d.ts +5 -4
- package/lib/components/forms/directives/public-api.d.ts +1 -0
- package/lib/components/forms/directives/writeable-input/writeable-input.directive.d.ts +2 -1
- package/lib/components/forms/services/input-state.service.d.ts +1 -5
- package/lib/components/forms/types/input.types.d.ts +3 -0
- package/package.json +1 -1
- package/src/lib/styles/easing.css +115 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './combobox.constants';
|
|
@@ -8,16 +8,19 @@ export declare const COMBOBOX_TOKEN: InjectionToken<ComboboxDirective>;
|
|
|
8
8
|
export type AbstractComboboxBody = AnimatedOverlayComponentBase & {
|
|
9
9
|
_options$: BehaviorSubject<TypedQueryList<AbstractComboboxOption> | null>;
|
|
10
10
|
_containerElementRef: ElementRef<HTMLElement> | undefined;
|
|
11
|
+
id: string;
|
|
11
12
|
};
|
|
12
13
|
export type AbstractComboboxOption = {
|
|
13
14
|
_option$: BehaviorSubject<unknown>;
|
|
14
15
|
_elementRef: ElementRef<HTMLElement>;
|
|
16
|
+
id: string;
|
|
15
17
|
};
|
|
16
18
|
export declare class ComboboxDirective implements OnInit {
|
|
17
19
|
private readonly _destroy$;
|
|
18
|
-
|
|
20
|
+
readonly _input: import("../../../../../../directives").InputDirective<unknown, HTMLInputElement>;
|
|
19
21
|
private readonly _selectField;
|
|
20
22
|
private readonly _animatedOverlay;
|
|
23
|
+
private readonly _comboboxConfig;
|
|
21
24
|
get options(): unknown[];
|
|
22
25
|
set options(value: unknown[]);
|
|
23
26
|
set initialValue(value: unknown);
|
|
@@ -61,10 +64,12 @@ export declare class ComboboxDirective implements OnInit {
|
|
|
61
64
|
protected readonly filterChange: EventEmitter<string>;
|
|
62
65
|
private _shouldIgnoreNextBlurEvent;
|
|
63
66
|
private _deletedSearchWithKeyPress;
|
|
67
|
+
readonly selectBodyId$: BehaviorSubject<string | null>;
|
|
68
|
+
readonly activeOptionId$: BehaviorSubject<string | null>;
|
|
64
69
|
get currentFilter(): string;
|
|
65
70
|
private readonly _currentFilter$;
|
|
66
71
|
private get _isOpen();
|
|
67
|
-
|
|
72
|
+
readonly isOpen$: import("rxjs").Observable<boolean>;
|
|
68
73
|
readonly _selectionModel: SelectionModel<unknown>;
|
|
69
74
|
private readonly _activeSelectionModel;
|
|
70
75
|
private readonly _backspaceKeyPressManager;
|
|
@@ -7,6 +7,7 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
import * as i1 from "@ethlete/core";
|
|
8
8
|
export declare const COMBOBOX_BODY_TOKEN: InjectionToken<ComboboxBodyComponent>;
|
|
9
9
|
export declare class ComboboxBodyComponent implements OnInit, AbstractComboboxBody {
|
|
10
|
+
readonly id: string;
|
|
10
11
|
_elementRef?: ElementRef<HTMLElement> | undefined;
|
|
11
12
|
_markForCheck?: (() => void) | undefined;
|
|
12
13
|
private readonly _destroy$;
|
|
@@ -4,6 +4,7 @@ import { AbstractComboboxOption } from '../../directives';
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare const COMBOBOX_OPTION_TOKEN: InjectionToken<ComboboxOptionComponent>;
|
|
6
6
|
export declare class ComboboxOptionComponent implements AbstractComboboxOption {
|
|
7
|
+
readonly id: string;
|
|
7
8
|
protected readonly combobox: import("../../directives").ComboboxDirective;
|
|
8
9
|
readonly _elementRef: ElementRef<HTMLElement>;
|
|
9
10
|
get option(): unknown;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
2
|
+
import { ComponentWithError, ComponentWithOption } from '../private';
|
|
3
|
+
export interface ComboboxConfig {
|
|
4
|
+
/**
|
|
5
|
+
* A component used to display the selected options inside the input
|
|
6
|
+
*/
|
|
7
|
+
selectedOptionComponent?: ComponentWithOption;
|
|
8
|
+
/**
|
|
9
|
+
* A component used to display the options inside the body
|
|
10
|
+
*/
|
|
11
|
+
optionComponent?: ComponentWithOption;
|
|
12
|
+
/**
|
|
13
|
+
* A component used to display the error inside the body
|
|
14
|
+
*/
|
|
15
|
+
bodyErrorComponent?: ComponentWithError;
|
|
16
|
+
/**
|
|
17
|
+
* A component used to display the loading state inside the body
|
|
18
|
+
*/
|
|
19
|
+
bodyLoadingComponent?: ComponentType<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* A component used to display the empty state inside the body
|
|
22
|
+
*/
|
|
23
|
+
bodyEmptyComponent?: ComponentType<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* The text to display when the body is empty and no custom empty component is provided
|
|
26
|
+
*
|
|
27
|
+
* @default 'No results found'
|
|
28
|
+
*/
|
|
29
|
+
emptyText?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './combobox.types';
|
package/lib/components/forms/components/select/components/combobox/utils/combobox-config.utils.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComboboxConfig } from '../types';
|
|
2
|
+
export declare const createComboboxConfig: (globalConfig?: Partial<ComboboxConfig> | null | undefined, localConfig?: Partial<ComboboxConfig> | null | undefined) => ComboboxConfig;
|
|
3
|
+
export declare const provideComboboxConfig: (config?: Partial<ComboboxConfig> | null | undefined) => {
|
|
4
|
+
provide: import("@angular/core").InjectionToken<ComboboxConfig>;
|
|
5
|
+
useValue: ComboboxConfig;
|
|
6
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
|
+
import { InjectionToken } from '@angular/core';
|
|
3
|
+
import { InputValueUpdateType } from '../../types';
|
|
4
|
+
import { InputDirective } from '../input/input.directive';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export interface ExposeInputVarsContext {
|
|
7
|
+
shouldDisplayError: boolean;
|
|
8
|
+
autofilled: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
isFocusedVia: FocusOrigin;
|
|
11
|
+
lastUpdateType: InputValueUpdateType | null;
|
|
12
|
+
value: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare const EXPOSE_INPUT_VARS_TOKEN: InjectionToken<ExposeInputVarsDirective>;
|
|
15
|
+
export declare class ExposeInputVarsDirective {
|
|
16
|
+
private readonly _cdr;
|
|
17
|
+
private readonly _destroy$;
|
|
18
|
+
private readonly _monitorStop$;
|
|
19
|
+
private readonly _templateRef;
|
|
20
|
+
private readonly _viewContainerRef;
|
|
21
|
+
private _viewContext;
|
|
22
|
+
set explicitInput(input: InputDirective | null | undefined);
|
|
23
|
+
constructor();
|
|
24
|
+
static ngTemplateContextGuard(dir: ExposeInputVarsDirective, ctx: unknown): ctx is ExposeInputVarsContext;
|
|
25
|
+
_monitorInput(input: InputDirective): void;
|
|
26
|
+
private _monitorObservable;
|
|
27
|
+
private _updateView;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ExposeInputVarsDirective, never>;
|
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ExposeInputVarsDirective, "[etExposeInputVars]", never, { "explicitInput": { "alias": "etExposeInputVars"; "required": false; }; }, {}, never, never, true, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './expose-input-vars.directive';
|
|
@@ -4,6 +4,7 @@ import { NativeInputRefDirective } from '../native-input-ref';
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare const INPUT_TOKEN: InjectionToken<InputDirective<unknown, HTMLInputElement>>;
|
|
6
6
|
export declare class InputDirective<T = unknown, J extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement = HTMLInputElement> implements OnInit, OnDestroy {
|
|
7
|
+
private readonly _injector;
|
|
7
8
|
private readonly _inputStateService;
|
|
8
9
|
private readonly _formFieldStateService;
|
|
9
10
|
private readonly _ngControl;
|
|
@@ -19,8 +20,8 @@ export declare class InputDirective<T = unknown, J extends HTMLInputElement | HT
|
|
|
19
20
|
get id(): string;
|
|
20
21
|
get value$(): import("rxjs").Observable<T | null>;
|
|
21
22
|
get value(): T | null;
|
|
22
|
-
get lastUpdateType$(): import("rxjs").Observable<("
|
|
23
|
-
get lastUpdateType(): ("
|
|
23
|
+
get lastUpdateType$(): import("rxjs").Observable<import("../../types").InputValueUpdateType | null>;
|
|
24
|
+
get lastUpdateType(): import("../../types").InputValueUpdateType | null;
|
|
24
25
|
get valueChange$(): import("rxjs").Observable<T>;
|
|
25
26
|
get disabled$(): import("rxjs").Observable<boolean>;
|
|
26
27
|
get disabled(): boolean;
|
|
@@ -47,8 +48,8 @@ export declare class InputDirective<T = unknown, J extends HTMLInputElement | HT
|
|
|
47
48
|
get errorId$(): import("rxjs").Observable<string | null>;
|
|
48
49
|
get errorId(): string | null;
|
|
49
50
|
readonly describedBy$: import("rxjs").Observable<string | null>;
|
|
50
|
-
readonly onInternalUpdate$: import("rxjs").Observable<("
|
|
51
|
-
readonly onExternalUpdate$: import("rxjs").Observable<("
|
|
51
|
+
readonly onInternalUpdate$: import("rxjs").Observable<import("../../types").InputValueUpdateType | null>;
|
|
52
|
+
readonly onExternalUpdate$: import("rxjs").Observable<import("../../types").InputValueUpdateType | null>;
|
|
52
53
|
constructor();
|
|
53
54
|
ngOnInit(): void;
|
|
54
55
|
ngOnDestroy(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './dynamic-form-field/public-api';
|
|
2
2
|
export * from './dynamic-form-group/public-api';
|
|
3
|
+
export * from './expose-input-vars/public-api';
|
|
3
4
|
export * from './if-input-empty/public-api';
|
|
4
5
|
export * from './if-input-filled/public-api';
|
|
5
6
|
export * from './input-prefix/public-api';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
import { InputStateService
|
|
3
|
+
import { InputStateService } from '../../services';
|
|
4
|
+
import { InputTouchedFn, InputValueChangeFn } from '../../types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare const WRITEABLE_INPUT_TOKEN: InjectionToken<WriteableInputDirective>;
|
|
6
7
|
export declare const WRITEABLE_INPUT_VALUE_ACCESSOR: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
2
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
3
3
|
import { NativeInputRefDirective } from '../directives';
|
|
4
|
-
import { ValidatorErrors } from '../types';
|
|
4
|
+
import { InputTouchedFn, InputValueChangeFn, InputValueUpdateType, ValidatorErrors } from '../types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export type InputValueChangeFn<T = unknown> = (value: T) => void;
|
|
7
|
-
export type InputTouchedFn = () => void;
|
|
8
|
-
type InputValueUpdateType = 'internal' | 'external';
|
|
9
6
|
export declare class InputStateService<T = unknown, J extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement = HTMLInputElement> {
|
|
10
7
|
readonly lastUpdateType$: BehaviorSubject<InputValueUpdateType | null>;
|
|
11
8
|
readonly lastUpdateType: import("@angular/core").Signal<InputValueUpdateType | null>;
|
|
@@ -43,4 +40,3 @@ export declare class InputStateService<T = unknown, J extends HTMLInputElement |
|
|
|
43
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<InputStateService<any, any>, never>;
|
|
44
41
|
static ɵprov: i0.ɵɵInjectableDeclaration<InputStateService<any, any>>;
|
|
45
42
|
}
|
|
46
|
-
export {};
|
package/package.json
CHANGED
|
@@ -37,4 +37,119 @@
|
|
|
37
37
|
--ease-step-3: steps(4);
|
|
38
38
|
--ease-step-4: steps(7);
|
|
39
39
|
--ease-step-5: steps(10);
|
|
40
|
+
--ease-spring-1: linear(
|
|
41
|
+
0,
|
|
42
|
+
0.006,
|
|
43
|
+
0.025 2.8%,
|
|
44
|
+
0.101 6.1%,
|
|
45
|
+
0.539 18.9%,
|
|
46
|
+
0.721 25.3%,
|
|
47
|
+
0.849 31.5%,
|
|
48
|
+
0.937 38.1%,
|
|
49
|
+
0.968 41.8%,
|
|
50
|
+
0.991 45.7%,
|
|
51
|
+
1.006 50.1%,
|
|
52
|
+
1.015 55%,
|
|
53
|
+
1.017 63.9%,
|
|
54
|
+
1.001
|
|
55
|
+
);
|
|
56
|
+
--ease-spring-2: linear(
|
|
57
|
+
0,
|
|
58
|
+
0.007,
|
|
59
|
+
0.029 2.2%,
|
|
60
|
+
0.118 4.7%,
|
|
61
|
+
0.625 14.4%,
|
|
62
|
+
0.826 19%,
|
|
63
|
+
0.902,
|
|
64
|
+
0.962,
|
|
65
|
+
1.008 26.1%,
|
|
66
|
+
1.041 28.7%,
|
|
67
|
+
1.064 32.1%,
|
|
68
|
+
1.07 36%,
|
|
69
|
+
1.061 40.5%,
|
|
70
|
+
1.015 53.4%,
|
|
71
|
+
0.999 61.6%,
|
|
72
|
+
0.995 71.2%,
|
|
73
|
+
1
|
|
74
|
+
);
|
|
75
|
+
--ease-spring-3: linear(
|
|
76
|
+
0,
|
|
77
|
+
0.009,
|
|
78
|
+
0.035 2.1%,
|
|
79
|
+
0.141 4.4%,
|
|
80
|
+
0.723 12.9%,
|
|
81
|
+
0.938 16.7%,
|
|
82
|
+
1.017,
|
|
83
|
+
1.077,
|
|
84
|
+
1.121,
|
|
85
|
+
1.149 24.3%,
|
|
86
|
+
1.159,
|
|
87
|
+
1.163,
|
|
88
|
+
1.161,
|
|
89
|
+
1.154 29.9%,
|
|
90
|
+
1.129 32.8%,
|
|
91
|
+
1.051 39.6%,
|
|
92
|
+
1.017 43.1%,
|
|
93
|
+
0.991,
|
|
94
|
+
0.977 51%,
|
|
95
|
+
0.974 53.8%,
|
|
96
|
+
0.975 57.1%,
|
|
97
|
+
0.997 69.8%,
|
|
98
|
+
1.003 76.9%,
|
|
99
|
+
1
|
|
100
|
+
);
|
|
101
|
+
--ease-spring-4: linear(
|
|
102
|
+
0,
|
|
103
|
+
0.009,
|
|
104
|
+
0.037 1.7%,
|
|
105
|
+
0.153 3.6%,
|
|
106
|
+
0.776 10.3%,
|
|
107
|
+
1.001,
|
|
108
|
+
1.142 16%,
|
|
109
|
+
1.185,
|
|
110
|
+
1.209 19%,
|
|
111
|
+
1.215 19.9% 20.8%,
|
|
112
|
+
1.199,
|
|
113
|
+
1.165 25%,
|
|
114
|
+
1.056 30.3%,
|
|
115
|
+
1.008 33%,
|
|
116
|
+
0.973,
|
|
117
|
+
0.955 39.2%,
|
|
118
|
+
0.953 41.1%,
|
|
119
|
+
0.957 43.3%,
|
|
120
|
+
0.998 53.3%,
|
|
121
|
+
1.009 59.1% 63.7%,
|
|
122
|
+
0.998 78.9%,
|
|
123
|
+
1
|
|
124
|
+
);
|
|
125
|
+
--ease-spring-5: linear(
|
|
126
|
+
0,
|
|
127
|
+
0.01,
|
|
128
|
+
0.04 1.6%,
|
|
129
|
+
0.161 3.3%,
|
|
130
|
+
0.816 9.4%,
|
|
131
|
+
1.046,
|
|
132
|
+
1.189 14.4%,
|
|
133
|
+
1.231,
|
|
134
|
+
1.254 17%,
|
|
135
|
+
1.259,
|
|
136
|
+
1.257 18.6%,
|
|
137
|
+
1.236,
|
|
138
|
+
1.194 22.3%,
|
|
139
|
+
1.057 27%,
|
|
140
|
+
0.999 29.4%,
|
|
141
|
+
0.955 32.1%,
|
|
142
|
+
0.942,
|
|
143
|
+
0.935 34.9%,
|
|
144
|
+
0.933,
|
|
145
|
+
0.939 38.4%,
|
|
146
|
+
1 47.3%,
|
|
147
|
+
1.011,
|
|
148
|
+
1.017 52.6%,
|
|
149
|
+
1.016 56.4%,
|
|
150
|
+
1 65.2%,
|
|
151
|
+
0.996 70.2%,
|
|
152
|
+
1.001 87.2%,
|
|
153
|
+
1
|
|
154
|
+
);
|
|
40
155
|
}
|