ngx-virtual-select-field-filterable 1.4.8 → 1.4.9

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/index.d.ts CHANGED
@@ -1 +1,307 @@
1
- export * from './lib/virtual-select-field';
1
+ import * as i0 from '@angular/core';
2
+ import { TemplateRef, EventEmitter, ElementRef, OnInit, OnDestroy, AfterContentInit, QueryList, Signal, TrackByFunction, InjectionToken } from '@angular/core';
3
+ import { BehaviorSubject, Observable } from 'rxjs';
4
+ import { ListKeyManagerOption, Highlightable } from '@angular/cdk/a11y';
5
+ import * as _angular_cdk_overlay_module_d from '@angular/cdk/overlay-module.d';
6
+ import { ControlValueAccessor, NgControl } from '@angular/forms';
7
+ import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
8
+ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
9
+ import { MatFormFieldControl, MatFormField } from '@angular/material/form-field';
10
+
11
+ interface NgxVirtualSelectFieldOptionModel<TValue> extends ListKeyManagerOption {
12
+ /**
13
+ * The visible text of the option.
14
+ */
15
+ label: string;
16
+ /**
17
+ * The value of the option.
18
+ */
19
+ value: TValue;
20
+ }
21
+ interface NgxVirtualSelectFieldOptionTemplateContextModel<TValue> {
22
+ $implicit: NgxVirtualSelectFieldOptionModel<TValue>;
23
+ }
24
+
25
+ declare class NgxVirtualSelectFieldOptionForDirective<TValue> {
26
+ template: TemplateRef<NgxVirtualSelectFieldOptionTemplateContextModel<TValue>>;
27
+ /**
28
+ * The options collection to render.
29
+ * @required
30
+ */
31
+ set options(options: NgxVirtualSelectFieldOptionModel<TValue>[]);
32
+ options$: BehaviorSubject<NgxVirtualSelectFieldOptionModel<TValue>[]>;
33
+ constructor(template: TemplateRef<NgxVirtualSelectFieldOptionTemplateContextModel<TValue>>);
34
+ static ngTemplateContextGuard<TValue>(_dir: NgxVirtualSelectFieldOptionForDirective<TValue>, ctx: unknown): ctx is NgxVirtualSelectFieldOptionTemplateContextModel<TValue>;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldOptionForDirective<any>, never>;
36
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxVirtualSelectFieldOptionForDirective<any>, "[ngxVirtualSelectFieldOptionFor]", never, { "options": { "alias": "ngxVirtualSelectFieldOptionForOf"; "required": true; }; }, {}, never, never, true, never>;
37
+ }
38
+
39
+ declare class NgxVirtualSelectFieldTriggerDirective {
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldTriggerDirective, never>;
41
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxVirtualSelectFieldTriggerDirective, "ngx-virtual-select-field-trigger", never, {}, {}, never, never, true, never>;
42
+ }
43
+
44
+ interface NgxVirtualSelectFieldOptionParent {
45
+ multiple?: boolean;
46
+ }
47
+
48
+ declare class NgxVirtualSelectFieldOptionComponent<TValue> implements Highlightable {
49
+ private _optionParent;
50
+ private _elementRef;
51
+ /**
52
+ * The value of the option.
53
+ * @required
54
+ */
55
+ value: TValue;
56
+ /**
57
+ * Whether the option is disabled.
58
+ */
59
+ disabled: boolean;
60
+ selectedChange: EventEmitter<NgxVirtualSelectFieldOptionSelectionChangeEvent<TValue>>;
61
+ protected readonly multiple: boolean;
62
+ protected readonly active: i0.WritableSignal<boolean>;
63
+ protected readonly selected: i0.WritableSignal<boolean>;
64
+ protected readonly hostNativeElement: HTMLElement;
65
+ constructor(_optionParent: NgxVirtualSelectFieldOptionParent, _elementRef: ElementRef<HTMLElement>);
66
+ setActiveStyles(): void;
67
+ setInactiveStyles(): void;
68
+ deselect(): void;
69
+ select(): void;
70
+ protected onClick(): void;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldOptionComponent<any>, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxVirtualSelectFieldOptionComponent<any>, "ngx-virtual-select-field-option", never, { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectedChange": "selectedChange"; }, never, ["*"], true, never>;
73
+ static ngAcceptInputType_disabled: unknown;
74
+ }
75
+ interface NgxVirtualSelectFieldOptionSelectionChangeEvent<TValue> {
76
+ source: NgxVirtualSelectFieldOptionComponent<TValue>;
77
+ value: TValue;
78
+ selected: boolean;
79
+ }
80
+
81
+ interface NgxVirtualSelectFieldConfig {
82
+ /**
83
+ * CSS class to add to the overlay element
84
+ */
85
+ overlayPanelClass?: string | string[];
86
+ /**
87
+ * Width for overlay panel
88
+ */
89
+ panelWidth?: string | number;
90
+ /**
91
+ * Height for an option element
92
+ */
93
+ optionHeight?: number;
94
+ /**
95
+ * Amount of visible items in list
96
+ */
97
+ panelViewportPageSize?: number;
98
+ }
99
+
100
+ declare class NgxVirtualSelectFieldComponent<TValue> implements OnInit, OnDestroy, AfterContentInit, MatFormFieldControl<TValue[] | TValue>, ControlValueAccessor, NgxVirtualSelectFieldOptionParent {
101
+ private _parentFormField;
102
+ private _defaultOptions?;
103
+ userAriaDescribedBy: string;
104
+ /**
105
+ * Width for overlay panel
106
+ * @default 'auto'
107
+ */
108
+ panelWidth: string | number | null;
109
+ /**
110
+ * Height for an option element
111
+ * @default 48
112
+ */
113
+ optionHeight: number;
114
+ /**
115
+ * Amount of visible items in list
116
+ * @default 8
117
+ */
118
+ panelViewportPageSize: number;
119
+ /**
120
+ * Enable multiple selection
121
+ * @default false
122
+ */
123
+ multiple: boolean;
124
+ /**
125
+ * Tab index for keyboard navigation
126
+ * @default 0
127
+ */
128
+ tabIndex: number;
129
+ /**
130
+ * Milliseconds to wait before navigating to active element after keyboard search
131
+ * @default 300
132
+ */
133
+ typeaheadDebounceInterval: number;
134
+ /**
135
+ * CSS class to be added to the panel element
136
+ * @default none
137
+ */
138
+ panelClass: string | string[] | null;
139
+ /**
140
+ * Enable filtering of options
141
+ * @default false
142
+ */
143
+ filterable: boolean;
144
+ /**
145
+ * Placeholder text for the filter input
146
+ * @default 'Search...'
147
+ */
148
+ filterPlaceholder: string;
149
+ /**
150
+ * Show clear button in filter input
151
+ * @default true
152
+ */
153
+ filterClearable: boolean;
154
+ /**
155
+ * Show clear button in select trigger
156
+ * @default false
157
+ */
158
+ clearable: boolean;
159
+ /**
160
+ * Show loading spinner
161
+ * @default false
162
+ */
163
+ loading: boolean;
164
+ /**
165
+ * Value of the select field
166
+ * @default null
167
+ */
168
+ set value(value: TValue[] | TValue | null);
169
+ private _value;
170
+ /**
171
+ * Placeholder for the select field
172
+ * @default none
173
+ */
174
+ set placeholder(placeholder: string);
175
+ get placeholder(): string;
176
+ private _placeholder;
177
+ /**
178
+ * Define if fields is required
179
+ * @default false
180
+ */
181
+ set required(req: boolean);
182
+ get required(): boolean;
183
+ private _required;
184
+ /**
185
+ * Define if field is disabled
186
+ * @default false
187
+ */
188
+ set disabled(value: boolean);
189
+ get disabled(): boolean;
190
+ private _disabled;
191
+ /**
192
+ * Value change event
193
+ */
194
+ valueChange: i0.OutputEmitterRef<any>;
195
+ /**
196
+ * Selection change event
197
+ * Emits after value change and form control update
198
+ */
199
+ selectionChange: i0.OutputEmitterRef<NgxVirtualSelectFieldChange<TValue>>;
200
+ cdkVirtualScrollViewport: CdkVirtualScrollViewport;
201
+ cdkConnectedOverlay: CdkConnectedOverlay;
202
+ filterInput: ElementRef<HTMLInputElement> | undefined;
203
+ optionFor: NgxVirtualSelectFieldOptionForDirective<TValue>;
204
+ customTrigger: NgxVirtualSelectFieldTriggerDirective | null;
205
+ optionsQuery: QueryList<NgxVirtualSelectFieldOptionComponent<TValue>> | null;
206
+ readonly id: string;
207
+ readonly controlType = "ngx-virtual-select-field";
208
+ readonly ngControl: NgControl | null;
209
+ autofilled: boolean;
210
+ protected readonly POSITIONS: _angular_cdk_overlay_module_d.ConnectedPosition[];
211
+ protected readonly overlayPanelClass: string | string[];
212
+ protected readonly inheritedColorTheme: string;
213
+ protected readonly overlayWidth: Signal<string | number>;
214
+ protected readonly isPanelOpened: i0.WritableSignal<boolean>;
215
+ protected readonly filterText: i0.WritableSignal<string>;
216
+ protected readonly options: i0.WritableSignal<NgxVirtualSelectFieldOptionModel<TValue>[]>;
217
+ protected readonly filteredOptions: Signal<NgxVirtualSelectFieldOptionModel<TValue>[]>;
218
+ protected readonly hasOptionsToFilter: Signal<boolean>;
219
+ protected readonly hasNoFilteredResults: Signal<boolean>;
220
+ protected triggerValue$: Observable<string> | null;
221
+ protected preferredOverlayOrigin: CdkOverlayOrigin | ElementRef | undefined;
222
+ private readonly _changeDetectorRef;
223
+ private readonly _destroyRef;
224
+ private readonly _elRef;
225
+ private readonly _stateChanges;
226
+ private readonly _scrolledIndexChange;
227
+ private _onChange;
228
+ private _onTouched;
229
+ private _selectionModel;
230
+ private _keyManager;
231
+ constructor(_parentFormField: MatFormField, _defaultOptions?: NgxVirtualSelectFieldConfig | undefined);
232
+ private createOverlayWidthSignal;
233
+ private resolveOverlayWidth;
234
+ get shouldLabelFloat(): boolean;
235
+ get empty(): boolean;
236
+ get stateChanges(): Observable<void>;
237
+ get errorState(): boolean;
238
+ get focused(): boolean;
239
+ private _focused;
240
+ protected get maxPageSize(): number;
241
+ ngOnInit(): void;
242
+ ngAfterContentInit(): void;
243
+ private updateOptionSelection;
244
+ ngOnDestroy(): void;
245
+ writeValue(value: TValue[]): void;
246
+ registerOnChange(fn: (value: TValue[] | TValue) => void): void;
247
+ registerOnTouched(fn: () => void): void;
248
+ setDisabledState(isDisabled: boolean): void;
249
+ setDescribedByIds(ids: string[]): void;
250
+ onContainerClick(): void;
251
+ onOverlayAttached(): void;
252
+ private navigateToFirstSelectedOption;
253
+ protected onFocusIn(): void;
254
+ protected onFocusOut(): void;
255
+ protected optionTrackBy: TrackByFunction<NgxVirtualSelectFieldOptionModel<TValue>>;
256
+ protected onScrolledIndexChange(): void;
257
+ protected onFilterInput(event: Event): void;
258
+ protected onFilterClear(): void;
259
+ protected onClear(event: Event): void;
260
+ protected isAllSelected(): boolean;
261
+ protected isIndeterminate(): boolean;
262
+ protected onSelectAllChange(): void;
263
+ protected onFilterKeyDown(event: KeyboardEvent): void;
264
+ protected open(): void;
265
+ protected close(): void;
266
+ protected onKeyDown(event: KeyboardEvent): void;
267
+ private doPanelOpenedKeydown;
268
+ private toggleAllOptions;
269
+ private doPanelClosedKeydown;
270
+ private initListKeyManager;
271
+ private normalizeKeyManagerOptions;
272
+ private updateActiveOptionComponent;
273
+ private shouldScrollToActiveItem;
274
+ private setActiveOptionComponentByValue;
275
+ private focus;
276
+ private selectOptionByValue;
277
+ private updateRenderedOptionsState;
278
+ private findOptionByValue;
279
+ private emitValue;
280
+ private assertIsDefined;
281
+ private static nextId;
282
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldComponent<any>, [{ optional: true; }, { optional: true; }]>;
283
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxVirtualSelectFieldComponent<any>, "ngx-virtual-select-field", ["ngxVirtualSelectField"], { "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "panelWidth": { "alias": "panelWidth"; "required": false; }; "optionHeight": { "alias": "optionHeight"; "required": false; }; "panelViewportPageSize": { "alias": "panelViewportPageSize"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "typeaheadDebounceInterval": { "alias": "typeaheadDebounceInterval"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; }; "filterClearable": { "alias": "filterClearable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "value": { "alias": "value"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; "selectionChange": "selectionChange"; }, ["optionFor", "customTrigger", "optionsQuery"], ["ngx-virtual-select-field-trigger"], true, never>;
284
+ static ngAcceptInputType_optionHeight: unknown;
285
+ static ngAcceptInputType_panelViewportPageSize: unknown;
286
+ static ngAcceptInputType_multiple: unknown;
287
+ static ngAcceptInputType_tabIndex: unknown;
288
+ static ngAcceptInputType_typeaheadDebounceInterval: unknown;
289
+ static ngAcceptInputType_filterable: unknown;
290
+ static ngAcceptInputType_filterClearable: unknown;
291
+ static ngAcceptInputType_clearable: unknown;
292
+ static ngAcceptInputType_loading: unknown;
293
+ static ngAcceptInputType_required: unknown;
294
+ static ngAcceptInputType_disabled: unknown;
295
+ }
296
+ declare class NgxVirtualSelectFieldChange<TValue> {
297
+ source: NgxVirtualSelectFieldComponent<TValue>;
298
+ value: any;
299
+ constructor(source: NgxVirtualSelectFieldComponent<TValue>, value: any);
300
+ }
301
+
302
+ declare const NGX_VIRTUAL_SELECT_FIELD_CONFIG: InjectionToken<NgxVirtualSelectFieldConfig>;
303
+
304
+ declare const NgxVirtualSelectFieldBundle: readonly [typeof NgxVirtualSelectFieldComponent, typeof NgxVirtualSelectFieldOptionForDirective, typeof NgxVirtualSelectFieldTriggerDirective, typeof NgxVirtualSelectFieldOptionComponent];
305
+
306
+ export { NGX_VIRTUAL_SELECT_FIELD_CONFIG, NgxVirtualSelectFieldBundle, NgxVirtualSelectFieldChange, NgxVirtualSelectFieldComponent, NgxVirtualSelectFieldOptionComponent, NgxVirtualSelectFieldOptionForDirective, NgxVirtualSelectFieldTriggerDirective };
307
+ export type { NgxVirtualSelectFieldOptionModel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-virtual-select-field-filterable",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Virtual Select Field for Angular Material",
5
5
  "keywords": [
6
6
  "angular",
@@ -18,11 +18,11 @@
18
18
  "node": "^18.13.0 || >=20.9.0"
19
19
  },
20
20
  "peerDependencies": {
21
- "@angular/common": "^19.0.0",
22
- "@angular/core": "^19.0.0",
23
- "@angular/forms": "^19.0.0",
24
- "@angular/cdk": "^19.0.0",
25
- "@angular/material": "^19.0.0",
21
+ "@angular/common": "^20.0.0",
22
+ "@angular/core": "^20.0.0",
23
+ "@angular/forms": "^20.0.0",
24
+ "@angular/cdk": "^20.0.0",
25
+ "@angular/material": "^20.0.0",
26
26
  "rxjs": "^7.4.0"
27
27
  },
28
28
  "dependencies": {
@@ -1,10 +0,0 @@
1
- import { NgxVirtualSelectFieldOptionForDirective } from './virtual-select-field-option-for';
2
- import { NgxVirtualSelectFieldComponent } from './virtual-select-field.component';
3
- import { NgxVirtualSelectFieldTriggerDirective } from './virtual-select-field-trigger';
4
- import { NgxVirtualSelectFieldOptionComponent } from './virtual-select-field-option';
5
- export { NgxVirtualSelectFieldOptionForDirective, NgxVirtualSelectFieldOptionModel, } from './virtual-select-field-option-for';
6
- export { NgxVirtualSelectFieldComponent, NgxVirtualSelectFieldChange, } from './virtual-select-field.component';
7
- export { NgxVirtualSelectFieldTriggerDirective } from './virtual-select-field-trigger';
8
- export { NgxVirtualSelectFieldOptionComponent } from './virtual-select-field-option';
9
- export { NGX_VIRTUAL_SELECT_FIELD_CONFIG } from './virtual-select-field.constants';
10
- export declare const NgxVirtualSelectFieldBundle: readonly [typeof NgxVirtualSelectFieldComponent, typeof NgxVirtualSelectFieldOptionForDirective, typeof NgxVirtualSelectFieldTriggerDirective, typeof NgxVirtualSelectFieldOptionComponent];
@@ -1,7 +0,0 @@
1
- export declare const ARROW_DOWN_KEY = "ArrowDown";
2
- export declare const ARROW_UP_KEY = "ArrowUp";
3
- export declare const ARROW_RIGHT_KEY = "ArrowRight";
4
- export declare const ARROW_LEFT_KEY = "ArrowLeft";
5
- export declare const ENTER_CODE = "Enter";
6
- export declare const SPACE_CODE = "Space";
7
- export declare const KEY_A_CODE = "KeyA";
@@ -1,3 +0,0 @@
1
- export { NgxVirtualSelectFieldOptionComponent } from './virtual-select-field-option.component';
2
- export { NgxVirtualSelectFieldOptionParent, NGX_VIRTUAL_SELECT_FIELD_OPTION_PARENT, } from './virtual-select-field-option.models';
3
- export { NgxVirtualSelectFieldOptionSelectionChangeEvent } from './virtual-select-field-option.component';
@@ -1,36 +0,0 @@
1
- import { EventEmitter, ElementRef } from '@angular/core';
2
- import { NgxVirtualSelectFieldOptionParent } from './virtual-select-field-option.models';
3
- import { Highlightable } from '@angular/cdk/a11y';
4
- import * as i0 from "@angular/core";
5
- export declare class NgxVirtualSelectFieldOptionComponent<TValue> implements Highlightable {
6
- private _optionParent;
7
- private _elementRef;
8
- /**
9
- * The value of the option.
10
- * @required
11
- */
12
- value: TValue;
13
- /**
14
- * Whether the option is disabled.
15
- */
16
- disabled: boolean;
17
- selectedChange: EventEmitter<NgxVirtualSelectFieldOptionSelectionChangeEvent<TValue>>;
18
- protected readonly multiple: boolean;
19
- protected readonly active: import("@angular/core").WritableSignal<boolean>;
20
- protected readonly selected: import("@angular/core").WritableSignal<boolean>;
21
- protected readonly hostNativeElement: HTMLElement;
22
- constructor(_optionParent: NgxVirtualSelectFieldOptionParent, _elementRef: ElementRef<HTMLElement>);
23
- setActiveStyles(): void;
24
- setInactiveStyles(): void;
25
- deselect(): void;
26
- select(): void;
27
- protected onClick(): void;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldOptionComponent<any>, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxVirtualSelectFieldOptionComponent<any>, "ngx-virtual-select-field-option", never, { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectedChange": "selectedChange"; }, never, ["*"], true, never>;
30
- static ngAcceptInputType_disabled: unknown;
31
- }
32
- export interface NgxVirtualSelectFieldOptionSelectionChangeEvent<TValue> {
33
- source: NgxVirtualSelectFieldOptionComponent<TValue>;
34
- value: TValue;
35
- selected: boolean;
36
- }
@@ -1,5 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export interface NgxVirtualSelectFieldOptionParent {
3
- multiple?: boolean;
4
- }
5
- export declare const NGX_VIRTUAL_SELECT_FIELD_OPTION_PARENT: InjectionToken<NgxVirtualSelectFieldOptionParent>;
@@ -1,2 +0,0 @@
1
- export { NgxVirtualSelectFieldOptionForDirective } from './virtual-select-field-option-for.directive';
2
- export { NgxVirtualSelectFieldOptionModel } from './virtual-select-field-option-for.models';
@@ -1,17 +0,0 @@
1
- import { TemplateRef } from '@angular/core';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { NgxVirtualSelectFieldOptionModel, NgxVirtualSelectFieldOptionTemplateContextModel } from './virtual-select-field-option-for.models';
4
- import * as i0 from "@angular/core";
5
- export declare class NgxVirtualSelectFieldOptionForDirective<TValue> {
6
- template: TemplateRef<NgxVirtualSelectFieldOptionTemplateContextModel<TValue>>;
7
- /**
8
- * The options collection to render.
9
- * @required
10
- */
11
- set options(options: NgxVirtualSelectFieldOptionModel<TValue>[]);
12
- options$: BehaviorSubject<NgxVirtualSelectFieldOptionModel<TValue>[]>;
13
- constructor(template: TemplateRef<NgxVirtualSelectFieldOptionTemplateContextModel<TValue>>);
14
- static ngTemplateContextGuard<TValue>(_dir: NgxVirtualSelectFieldOptionForDirective<TValue>, ctx: unknown): ctx is NgxVirtualSelectFieldOptionTemplateContextModel<TValue>;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldOptionForDirective<any>, never>;
16
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxVirtualSelectFieldOptionForDirective<any>, "[ngxVirtualSelectFieldOptionFor]", never, { "options": { "alias": "ngxVirtualSelectFieldOptionForOf"; "required": true; }; }, {}, never, never, true, never>;
17
- }
@@ -1,14 +0,0 @@
1
- import { ListKeyManagerOption } from '@angular/cdk/a11y';
2
- export interface NgxVirtualSelectFieldOptionModel<TValue> extends ListKeyManagerOption {
3
- /**
4
- * The visible text of the option.
5
- */
6
- label: string;
7
- /**
8
- * The value of the option.
9
- */
10
- value: TValue;
11
- }
12
- export interface NgxVirtualSelectFieldOptionTemplateContextModel<TValue> {
13
- $implicit: NgxVirtualSelectFieldOptionModel<TValue>;
14
- }
@@ -1 +0,0 @@
1
- export { NgxVirtualSelectFieldTriggerDirective, NGX_VIRTUAL_SELECT_FIELD_TRIGGER, } from './virtual-select-field-trigger.directive';
@@ -1,7 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare const NGX_VIRTUAL_SELECT_FIELD_TRIGGER: InjectionToken<NgxVirtualSelectFieldTriggerDirective>;
4
- export declare class NgxVirtualSelectFieldTriggerDirective {
5
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldTriggerDirective, never>;
6
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxVirtualSelectFieldTriggerDirective, "ngx-virtual-select-field-trigger", never, {}, {}, never, never, true, never>;
7
- }
@@ -1,209 +0,0 @@
1
- import { AfterContentInit, ElementRef, OnDestroy, OnInit, QueryList, Signal, TrackByFunction } from '@angular/core';
2
- import { ControlValueAccessor, NgControl } from '@angular/forms';
3
- import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
4
- import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
5
- import { MatFormField, MatFormFieldControl } from '@angular/material/form-field';
6
- import { Observable } from 'rxjs';
7
- import { NgxVirtualSelectFieldOptionForDirective, NgxVirtualSelectFieldOptionModel } from './virtual-select-field-option-for';
8
- import { NgxVirtualSelectFieldTriggerDirective } from './virtual-select-field-trigger';
9
- import { NgxVirtualSelectFieldOptionComponent, NgxVirtualSelectFieldOptionParent } from './virtual-select-field-option';
10
- import { NgxVirtualSelectFieldConfig } from './virtual-select-field.models';
11
- import * as i0 from "@angular/core";
12
- export declare class NgxVirtualSelectFieldComponent<TValue> implements OnInit, OnDestroy, AfterContentInit, MatFormFieldControl<TValue[] | TValue>, ControlValueAccessor, NgxVirtualSelectFieldOptionParent {
13
- private _parentFormField;
14
- private _defaultOptions?;
15
- userAriaDescribedBy: string;
16
- /**
17
- * Width for overlay panel
18
- * @default 'auto'
19
- */
20
- panelWidth: string | number | null;
21
- /**
22
- * Height for an option element
23
- * @default 48
24
- */
25
- optionHeight: number;
26
- /**
27
- * Amount of visible items in list
28
- * @default 8
29
- */
30
- panelViewportPageSize: number;
31
- /**
32
- * Enable multiple selection
33
- * @default false
34
- */
35
- multiple: boolean;
36
- /**
37
- * Tab index for keyboard navigation
38
- * @default 0
39
- */
40
- tabIndex: number;
41
- /**
42
- * Milliseconds to wait before navigating to active element after keyboard search
43
- * @default 300
44
- */
45
- typeaheadDebounceInterval: number;
46
- /**
47
- * CSS class to be added to the panel element
48
- * @default none
49
- */
50
- panelClass: string | string[] | null;
51
- /**
52
- * Enable filtering of options
53
- * @default false
54
- */
55
- filterable: boolean;
56
- /**
57
- * Placeholder text for the filter input
58
- * @default 'Search...'
59
- */
60
- filterPlaceholder: string;
61
- /**
62
- * Show clear button in filter input
63
- * @default true
64
- */
65
- filterClearable: boolean;
66
- /**
67
- * Show clear button in select trigger
68
- * @default false
69
- */
70
- clearable: boolean;
71
- /**
72
- * Show loading spinner
73
- * @default false
74
- */
75
- loading: boolean;
76
- /**
77
- * Value of the select field
78
- * @default null
79
- */
80
- set value(value: TValue[] | TValue | null);
81
- private _value;
82
- /**
83
- * Placeholder for the select field
84
- * @default none
85
- */
86
- set placeholder(placeholder: string);
87
- get placeholder(): string;
88
- private _placeholder;
89
- /**
90
- * Define if fields is required
91
- * @default false
92
- */
93
- set required(req: boolean);
94
- get required(): boolean;
95
- private _required;
96
- /**
97
- * Define if field is disabled
98
- * @default false
99
- */
100
- set disabled(value: boolean);
101
- get disabled(): boolean;
102
- private _disabled;
103
- /**
104
- * Value change event
105
- */
106
- valueChange: import("@angular/core").OutputEmitterRef<any>;
107
- /**
108
- * Selection change event
109
- * Emits after value change and form control update
110
- */
111
- selectionChange: import("@angular/core").OutputEmitterRef<NgxVirtualSelectFieldChange<TValue>>;
112
- cdkVirtualScrollViewport: CdkVirtualScrollViewport;
113
- cdkConnectedOverlay: CdkConnectedOverlay;
114
- filterInput: ElementRef<HTMLInputElement> | undefined;
115
- optionFor: NgxVirtualSelectFieldOptionForDirective<TValue>;
116
- customTrigger: NgxVirtualSelectFieldTriggerDirective | null;
117
- optionsQuery: QueryList<NgxVirtualSelectFieldOptionComponent<TValue>> | null;
118
- readonly id: string;
119
- readonly controlType = "ngx-virtual-select-field";
120
- readonly ngControl: NgControl | null;
121
- autofilled: boolean;
122
- protected readonly POSITIONS: import("@angular/cdk/overlay").ConnectedPosition[];
123
- protected readonly overlayPanelClass: string | string[];
124
- protected readonly inheritedColorTheme: string;
125
- protected readonly overlayWidth: Signal<string | number>;
126
- protected readonly isPanelOpened: import("@angular/core").WritableSignal<boolean>;
127
- protected readonly filterText: import("@angular/core").WritableSignal<string>;
128
- protected readonly options: import("@angular/core").WritableSignal<NgxVirtualSelectFieldOptionModel<TValue>[]>;
129
- protected readonly filteredOptions: Signal<NgxVirtualSelectFieldOptionModel<TValue>[]>;
130
- protected readonly hasOptionsToFilter: Signal<boolean>;
131
- protected readonly hasNoFilteredResults: Signal<boolean>;
132
- protected triggerValue$: Observable<string> | null;
133
- protected preferredOverlayOrigin: CdkOverlayOrigin | ElementRef | undefined;
134
- private readonly _changeDetectorRef;
135
- private readonly _destroyRef;
136
- private readonly _elRef;
137
- private readonly _stateChanges;
138
- private readonly _scrolledIndexChange;
139
- private _onChange;
140
- private _onTouched;
141
- private _selectionModel;
142
- private _keyManager;
143
- constructor(_parentFormField: MatFormField, _defaultOptions?: NgxVirtualSelectFieldConfig | undefined);
144
- private createOverlayWidthSignal;
145
- private resolveOverlayWidth;
146
- get shouldLabelFloat(): boolean;
147
- get empty(): boolean;
148
- get stateChanges(): Observable<void>;
149
- get errorState(): boolean;
150
- get focused(): boolean;
151
- private _focused;
152
- protected get maxPageSize(): number;
153
- ngOnInit(): void;
154
- ngAfterContentInit(): void;
155
- private updateOptionSelection;
156
- ngOnDestroy(): void;
157
- writeValue(value: TValue[]): void;
158
- registerOnChange(fn: (value: TValue[] | TValue) => void): void;
159
- registerOnTouched(fn: () => void): void;
160
- setDisabledState(isDisabled: boolean): void;
161
- setDescribedByIds(ids: string[]): void;
162
- onContainerClick(): void;
163
- onOverlayAttached(): void;
164
- private navigateToFirstSelectedOption;
165
- protected onFocusIn(): void;
166
- protected onFocusOut(): void;
167
- protected optionTrackBy: TrackByFunction<NgxVirtualSelectFieldOptionModel<TValue>>;
168
- protected onScrolledIndexChange(): void;
169
- protected onFilterInput(event: Event): void;
170
- protected onFilterClear(): void;
171
- protected onClear(event: Event): void;
172
- protected onFilterKeyDown(event: KeyboardEvent): void;
173
- protected open(): void;
174
- protected close(): void;
175
- protected onKeyDown(event: KeyboardEvent): void;
176
- private doPanelOpenedKeydown;
177
- private toggleAllOptions;
178
- private doPanelClosedKeydown;
179
- private initListKeyManager;
180
- private normalizeKeyManagerOptions;
181
- private updateActiveOptionComponent;
182
- private shouldScrollToActiveItem;
183
- private setActiveOptionComponentByValue;
184
- private focus;
185
- private selectOptionByValue;
186
- private updateRenderedOptionsState;
187
- private findOptionByValue;
188
- private emitValue;
189
- private assertIsDefined;
190
- private static nextId;
191
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxVirtualSelectFieldComponent<any>, [{ optional: true; }, { optional: true; }]>;
192
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxVirtualSelectFieldComponent<any>, "ngx-virtual-select-field", ["ngxVirtualSelectField"], { "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "panelWidth": { "alias": "panelWidth"; "required": false; }; "optionHeight": { "alias": "optionHeight"; "required": false; }; "panelViewportPageSize": { "alias": "panelViewportPageSize"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "typeaheadDebounceInterval": { "alias": "typeaheadDebounceInterval"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; }; "filterClearable": { "alias": "filterClearable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "value": { "alias": "value"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; "selectionChange": "selectionChange"; }, ["optionFor", "customTrigger", "optionsQuery"], ["ngx-virtual-select-field-trigger"], true, never>;
193
- static ngAcceptInputType_optionHeight: unknown;
194
- static ngAcceptInputType_panelViewportPageSize: unknown;
195
- static ngAcceptInputType_multiple: unknown;
196
- static ngAcceptInputType_tabIndex: unknown;
197
- static ngAcceptInputType_typeaheadDebounceInterval: unknown;
198
- static ngAcceptInputType_filterable: unknown;
199
- static ngAcceptInputType_filterClearable: unknown;
200
- static ngAcceptInputType_clearable: unknown;
201
- static ngAcceptInputType_loading: unknown;
202
- static ngAcceptInputType_required: unknown;
203
- static ngAcceptInputType_disabled: unknown;
204
- }
205
- export declare class NgxVirtualSelectFieldChange<TValue> {
206
- source: NgxVirtualSelectFieldComponent<TValue>;
207
- value: any;
208
- constructor(source: NgxVirtualSelectFieldComponent<TValue>, value: any);
209
- }