ng-select2-component 8.0.2 → 8.0.6

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.
@@ -1,207 +1,216 @@
1
- import { ViewportRuler } from '@angular/cdk/scrolling';
2
- import { AfterViewInit, ChangeDetectorRef, DoCheck, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
3
- import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
4
- import { Select2Data, Select2Group, Select2Option, Select2RemoveEvent, Select2ScrollEvent, Select2SearchEvent, Select2UpdateEvent, Select2UpdateValue } from './select2-interfaces';
5
- export declare class Select2 implements ControlValueAccessor, OnInit, OnDestroy, DoCheck, AfterViewInit {
6
- protected _viewportRuler: ViewportRuler;
7
- private _changeDetectorRef;
8
- private _parentForm;
9
- private _parentFormGroup;
10
- _control: NgControl;
11
- /** data of options & optiongrps */
12
- data: Select2Data;
13
- minCharForSearch: number;
14
- displaySearchStatus: 'default' | 'hidden' | 'always';
15
- placeholder: string;
16
- customSearchEnabled: boolean;
17
- limitSelection: number;
18
- listPosition: 'above' | 'below';
19
- get multiple(): any;
20
- set multiple(value: any);
21
- /** use the material style */
22
- get overlay(): any;
23
- set overlay(value: any);
24
- /** use the material style */
25
- styleMode: 'material' | 'noStyle' | 'default';
26
- /** message when no result */
27
- noResultMessage: string;
28
- /** infinite scroll distance */
29
- infiniteScrollDistance: number;
30
- /** infinite scroll distance */
31
- infiniteScrollThrottle: number;
32
- /** infinite scroll activated */
33
- get infiniteScroll(): any;
34
- set infiniteScroll(value: any);
35
- /** use it for change the pattern of the filter search */
36
- editPattern: (str: string) => string;
37
- /** template for formating */
38
- templates: (TemplateRef<any> | {
39
- [key: string]: TemplateRef<any>;
40
- });
41
- /** the max height of the results container when opening the select */
42
- resultMaxHeight: string;
43
- update: EventEmitter<Select2UpdateEvent<Select2UpdateValue>>;
44
- open: EventEmitter<Select2>;
45
- close: EventEmitter<Select2>;
46
- focus: EventEmitter<Select2>;
47
- blur: EventEmitter<Select2>;
48
- search: EventEmitter<Select2SearchEvent<Select2UpdateValue>>;
49
- scroll: EventEmitter<Select2ScrollEvent>;
50
- removeOption: EventEmitter<Select2RemoveEvent<Select2UpdateValue>>;
51
- option: Select2Option | Select2Option[] | null;
52
- isOpen: boolean;
53
- searchStyle: string;
54
- /** Whether the element is focused or not. */
55
- focused: boolean;
56
- filteredData: Select2Data;
57
- get select2Options(): Select2Option[];
58
- get select2Option(): Select2Option;
59
- get searchText(): string;
60
- set searchText(text: string);
61
- /** minimal data of show the search field */
62
- get minCountForSearch(): number | string;
63
- set minCountForSearch(value: number | string);
64
- /** Unique id of the element. */
65
- get id(): string;
66
- set id(value: string);
67
- /** Whether the element is required. */
68
- get required(): any;
69
- set required(value: any);
70
- /** Whether selected items should be hidden. */
71
- get disabled(): any;
72
- set disabled(value: any);
73
- /** Whether items are hidden when has. */
74
- get hideSelectedItems(): any;
75
- set hideSelectedItems(value: any);
76
- /** Whether the element is readonly. */
77
- get readonly(): any;
78
- set readonly(value: any);
79
- /** The input element's value. */
80
- get value(): Select2UpdateValue;
81
- set value(value: Select2UpdateValue);
82
- /** Tab index for the select2 element. */
83
- get tabIndex(): number;
84
- set tabIndex(value: number);
85
- /** reset with no selected value */
86
- get resettable(): any;
87
- set resettable(value: any);
88
- get ariaInvalid(): boolean;
89
- get classMaterial(): boolean;
90
- get classNostyle(): boolean;
91
- get select2above(): boolean;
92
- overlayWidth: number;
93
- _triggerRect: ClientRect;
94
- private _minCountForSearch?;
95
- private selection;
96
- private resultContainer;
97
- private results;
98
- private searchInput;
99
- private hoveringValue;
100
- private innerSearchText;
101
- private isSearchboxHidden;
102
- private selectionElement;
103
- private get resultsElement();
104
- private _stateChanges;
105
- /** Tab index for the element. */
106
- private _tabIndex;
107
- private _disabled;
108
- private _required;
109
- private _readonly;
110
- private _multiple;
111
- private _overlay;
112
- private _resettable;
113
- private _hideSelectedItems;
114
- private _clickDetection;
115
- private _clickDetectionFc;
116
- private _id;
117
- private _uid;
118
- private _value;
119
- private _previousNativeValue;
120
- private _infiniteScroll;
121
- constructor(_viewportRuler: ViewportRuler, _changeDetectorRef: ChangeDetectorRef, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, _control: NgControl, tabIndex: string);
122
- /** View -> model callback called when select has been touched */
123
- private _onTouched;
124
- /** View -> model callback called when value changes */
125
- private _onChange;
126
- ngOnInit(): void;
127
- ngAfterViewInit(): void;
128
- ngDoCheck(): void;
129
- ngOnDestroy(): void;
130
- updateSearchBox(): void;
131
- hideSearch(): boolean;
132
- getOptionStyle(option: Select2Option): string;
133
- mouseenter(option: Select2Option): void;
134
- click(option: Select2Option): void;
135
- reset(e: MouseEvent): void;
136
- prevChange(event: Event): void;
137
- toggleOpenAndClose(): void;
138
- hasTemplate(option: (Select2Option | Select2Group), defaut: string): boolean;
139
- getTemplate(option: (Select2Option | Select2Group), defaut: string): any;
140
- triggerRect(): void;
141
- private testSelection;
142
- private testValueChange;
143
- private updateFilteredData;
144
- private clickDetection;
145
- private clickExit;
146
- private ifParentContainsClass;
147
- private ifParentContainsId;
148
- private getParentElementByClass;
149
- private getParentElementById;
150
- private containClasses;
151
- focusin(): void;
152
- focusout(): void;
153
- private moveUp;
154
- private moveDown;
155
- private updateScrollFromOption;
156
- private selectByEnter;
157
- select(option: Select2Option | null): void;
158
- keyDown(e: KeyboardEvent): void;
159
- openKey(e: KeyboardEvent): void;
160
- trackBy(_index: number, item: Select2Option): any;
161
- searchUpdate(e: Event): void;
162
- isSelected(option: Select2Option): "true" | "false";
163
- isDisabled(option: Select2Option): "true" | "false";
164
- removeSelection(e: MouseEvent, option: Select2Option): void;
165
- /**
166
- * Sets the model value. Implemented as part of ControlValueAccessor.
167
- * @param value
168
- */
169
- writeValue(value: any): void;
170
- /**
171
- * Saves a callback function to be invoked when the select's value
172
- * changes from user input. Part of the ControlValueAccessor interface
173
- * required to integrate with Angular's core forms API.
174
- *
175
- * @param fn Callback to be triggered when the value changes.
176
- */
177
- registerOnChange(fn: (value: any) => void): void;
178
- /**
179
- * Saves a callback function to be invoked when the select is blurred
180
- * by the user. Part of the ControlValueAccessor interface required
181
- * to integrate with Angular's core forms API.
182
- *
183
- * @param fn Callback to be triggered when the component has been touched.
184
- */
185
- registerOnTouched(fn: () => {}): void;
186
- /**
187
- * Sets whether the component should be disabled.
188
- * Implemented as part of ControlValueAccessor.
189
- * @param isDisabled
190
- */
191
- setDisabledState(isDisabled: boolean): void;
192
- _isErrorState(): boolean;
193
- private _testKey;
194
- private _getKey;
195
- private _isKey;
196
- /**
197
- * Sets the selected option based on a value. If no option can be
198
- * found with the designated value, the select trigger is cleared.
199
- */
200
- private _setSelectionByValue;
201
- /** Does some manual dirty checking on the native input `value` property. */
202
- private _dirtyCheckNativeValue;
203
- private _coerceBooleanProperty;
204
- private _focusSearchboxOrResultsElement;
205
- private _focus;
206
- onScroll(way: 'up' | 'down'): void;
207
- }
1
+ import { ConnectedPosition } from '@angular/cdk/overlay';
2
+ import { ViewportRuler } from '@angular/cdk/scrolling';
3
+ import { AfterViewInit, ChangeDetectorRef, DoCheck, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
4
+ import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
5
+ import { Select2Data, Select2Group, Select2Option, Select2RemoveEvent, Select2ScrollEvent, Select2SearchEvent, Select2UpdateEvent, Select2UpdateValue } from './select2-interfaces';
6
+ export declare class Select2 implements ControlValueAccessor, OnInit, OnDestroy, DoCheck, AfterViewInit {
7
+ protected _viewportRuler: ViewportRuler;
8
+ private _changeDetectorRef;
9
+ private _parentForm;
10
+ private _parentFormGroup;
11
+ _control: NgControl;
12
+ _data: Select2Data;
13
+ /** data of options & optiongrps */
14
+ set data(data: Select2Data);
15
+ minCharForSearch: number;
16
+ displaySearchStatus: 'default' | 'hidden' | 'always';
17
+ placeholder: string;
18
+ customSearchEnabled: boolean;
19
+ limitSelection: number;
20
+ listPosition: 'above' | 'below' | 'auto';
21
+ get multiple(): any;
22
+ set multiple(value: any);
23
+ /** use the material style */
24
+ get overlay(): any;
25
+ set overlay(value: any);
26
+ /** use the material style */
27
+ styleMode: 'material' | 'noStyle' | 'default';
28
+ /** message when no result */
29
+ noResultMessage: string;
30
+ /** infinite scroll distance */
31
+ infiniteScrollDistance: number;
32
+ /** infinite scroll distance */
33
+ infiniteScrollThrottle: number;
34
+ /** infinite scroll activated */
35
+ get infiniteScroll(): any;
36
+ set infiniteScroll(value: any);
37
+ /** use it for change the pattern of the filter search */
38
+ editPattern: (str: string) => string;
39
+ /** template for formating */
40
+ templates: TemplateRef<any> | {
41
+ [key: string]: TemplateRef<any>;
42
+ };
43
+ /** the max height of the results container when opening the select */
44
+ resultMaxHeight: string;
45
+ update: EventEmitter<Select2UpdateEvent<Select2UpdateValue>>;
46
+ open: EventEmitter<Select2>;
47
+ close: EventEmitter<Select2>;
48
+ focus: EventEmitter<Select2>;
49
+ blur: EventEmitter<Select2>;
50
+ search: EventEmitter<Select2SearchEvent<Select2UpdateValue>>;
51
+ scroll: EventEmitter<Select2ScrollEvent>;
52
+ removeOption: EventEmitter<Select2RemoveEvent<Select2UpdateValue>>;
53
+ option: Select2Option | Select2Option[] | null;
54
+ isOpen: boolean;
55
+ searchStyle: string;
56
+ /** Whether the element is focused or not. */
57
+ focused: boolean;
58
+ filteredData: Select2Data;
59
+ get select2Options(): Select2Option[];
60
+ get select2Option(): Select2Option;
61
+ get searchText(): string;
62
+ set searchText(text: string);
63
+ /** minimal data of show the search field */
64
+ get minCountForSearch(): number | string;
65
+ set minCountForSearch(value: number | string);
66
+ /** Unique id of the element. */
67
+ get id(): string;
68
+ set id(value: string);
69
+ /** Whether the element is required. */
70
+ get required(): any;
71
+ set required(value: any);
72
+ /** Whether selected items should be hidden. */
73
+ get disabled(): any;
74
+ set disabled(value: any);
75
+ /** Whether items are hidden when has. */
76
+ get hideSelectedItems(): any;
77
+ set hideSelectedItems(value: any);
78
+ /** Whether the element is readonly. */
79
+ get readonly(): any;
80
+ set readonly(value: any);
81
+ /** The input element's value. */
82
+ get value(): Select2UpdateValue;
83
+ set value(value: Select2UpdateValue);
84
+ /** Tab index for the select2 element. */
85
+ get tabIndex(): number;
86
+ set tabIndex(value: number);
87
+ /** reset with no selected value */
88
+ get resettable(): any;
89
+ set resettable(value: any);
90
+ get ariaInvalid(): boolean;
91
+ get classMaterial(): boolean;
92
+ get classNostyle(): boolean;
93
+ get select2above(): boolean;
94
+ overlayWidth: number;
95
+ overlayHeight: number;
96
+ _triggerRect: ClientRect;
97
+ _dropdownRect: ClientRect;
98
+ get _positions(): ConnectedPosition[];
99
+ private _minCountForSearch?;
100
+ private cdkConnectedOverlay;
101
+ private selection;
102
+ private resultContainer;
103
+ private results;
104
+ private searchInput;
105
+ private dropdown;
106
+ private hoveringValue;
107
+ private innerSearchText;
108
+ private isSearchboxHidden;
109
+ private selectionElement;
110
+ private get resultsElement();
111
+ private _stateChanges;
112
+ /** Tab index for the element. */
113
+ private _tabIndex;
114
+ private _disabled;
115
+ private _required;
116
+ private _readonly;
117
+ private _multiple;
118
+ private _overlay;
119
+ private _resettable;
120
+ private _hideSelectedItems;
121
+ private _clickDetection;
122
+ private _clickDetectionFc;
123
+ private _id;
124
+ private _uid;
125
+ private _value;
126
+ private _previousNativeValue;
127
+ private _infiniteScroll;
128
+ private _overlayPosition;
129
+ constructor(_viewportRuler: ViewportRuler, _changeDetectorRef: ChangeDetectorRef, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, _control: NgControl, tabIndex: string);
130
+ /** View -> model callback called when select has been touched */
131
+ private _onTouched;
132
+ /** View -> model callback called when value changes */
133
+ private _onChange;
134
+ ngOnInit(): void;
135
+ ngAfterViewInit(): void;
136
+ ngDoCheck(): void;
137
+ ngOnDestroy(): void;
138
+ updateSearchBox(): void;
139
+ hideSearch(): boolean;
140
+ getOptionStyle(option: Select2Option): string;
141
+ mouseenter(option: Select2Option): void;
142
+ click(option: Select2Option): void;
143
+ reset(e: MouseEvent): void;
144
+ prevChange(event: Event): void;
145
+ toggleOpenAndClose(): void;
146
+ hasTemplate(option: Select2Option | Select2Group, defaut: string): boolean;
147
+ getTemplate(option: Select2Option | Select2Group, defaut: string): any;
148
+ triggerRect(): void;
149
+ private testSelection;
150
+ private testValueChange;
151
+ private updateFilteredData;
152
+ private clickDetection;
153
+ private clickExit;
154
+ private ifParentContainsClass;
155
+ private ifParentContainsId;
156
+ private getParentElementByClass;
157
+ private getParentElementById;
158
+ private containClasses;
159
+ focusin(): void;
160
+ focusout(): void;
161
+ private moveUp;
162
+ private moveDown;
163
+ private updateScrollFromOption;
164
+ private selectByEnter;
165
+ select(option: Select2Option | null): void;
166
+ keyDown(e: KeyboardEvent): void;
167
+ openKey(e: KeyboardEvent): void;
168
+ trackBy(_index: number, item: Select2Option): any;
169
+ searchUpdate(e: Event): void;
170
+ isSelected(option: Select2Option): "true" | "false";
171
+ isDisabled(option: Select2Option): "true" | "false";
172
+ removeSelection(e: MouseEvent, option: Select2Option): void;
173
+ /**
174
+ * Sets the model value. Implemented as part of ControlValueAccessor.
175
+ * @param value
176
+ */
177
+ writeValue(value: any): void;
178
+ /**
179
+ * Saves a callback function to be invoked when the select's value
180
+ * changes from user input. Part of the ControlValueAccessor interface
181
+ * required to integrate with Angular's core forms API.
182
+ *
183
+ * @param fn Callback to be triggered when the value changes.
184
+ */
185
+ registerOnChange(fn: (value: any) => void): void;
186
+ /**
187
+ * Saves a callback function to be invoked when the select is blurred
188
+ * by the user. Part of the ControlValueAccessor interface required
189
+ * to integrate with Angular's core forms API.
190
+ *
191
+ * @param fn Callback to be triggered when the component has been touched.
192
+ */
193
+ registerOnTouched(fn: () => {}): void;
194
+ /**
195
+ * Sets whether the component should be disabled.
196
+ * Implemented as part of ControlValueAccessor.
197
+ * @param isDisabled
198
+ */
199
+ setDisabledState(isDisabled: boolean): void;
200
+ onScroll(way: 'up' | 'down'): void;
201
+ _isErrorState(): boolean;
202
+ private _testKey;
203
+ private _getKey;
204
+ private _isKey;
205
+ /**
206
+ * Sets the selected option based on a value. If no option can be
207
+ * found with the designated value, the select trigger is cleared.
208
+ */
209
+ private _setSelectionByValue;
210
+ /** Does some manual dirty checking on the native input `value` property. */
211
+ private _dirtyCheckNativeValue;
212
+ private _coerceBooleanProperty;
213
+ private _focusSearchboxOrResultsElement;
214
+ private _focus;
215
+ private _isAbobeOverlay;
216
+ }
@@ -1,2 +1,2 @@
1
- export declare class Select2Module {
2
- }
1
+ export declare class Select2Module {
2
+ }
@@ -1,4 +1,4 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public_api';