ngx-opalbytes-components 1.18.0 → 1.19.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/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, EventEmitter, OnChanges,
|
|
2
|
+
import { OnInit, EventEmitter, OnChanges, OnDestroy, AfterViewInit, ElementRef, TemplateRef, SimpleChanges, ChangeDetectorRef, Signal, AfterContentInit, QueryList, WritableSignal } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor, AbstractControl, FormControl } from '@angular/forms';
|
|
4
4
|
import { MatDateRangeInput } from '@angular/material/datepicker';
|
|
5
|
-
import { MatAutocompleteTrigger, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|
6
5
|
import * as rxjs from 'rxjs';
|
|
7
6
|
import { Observable } from 'rxjs';
|
|
8
7
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
@@ -110,7 +109,7 @@ interface ICaoAutoCompleteOption {
|
|
|
110
109
|
icon?: string;
|
|
111
110
|
iconPosition?: string;
|
|
112
111
|
}
|
|
113
|
-
declare class CaoAutocompleteComponent implements OnInit, OnChanges, ControlValueAccessor {
|
|
112
|
+
declare class CaoAutocompleteComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit, ControlValueAccessor {
|
|
114
113
|
label: string;
|
|
115
114
|
placeholder: string;
|
|
116
115
|
options: ICaoAutoCompleteOption[];
|
|
@@ -127,43 +126,82 @@ declare class CaoAutocompleteComponent implements OnInit, OnChanges, ControlValu
|
|
|
127
126
|
autocompleteBgColor: string;
|
|
128
127
|
strokeWidthIcon: number;
|
|
129
128
|
isDisabled: boolean;
|
|
129
|
+
inputHeigth: string;
|
|
130
|
+
checkIcon: string;
|
|
131
|
+
showCheckIcon: boolean;
|
|
132
|
+
isLucideCheckIcon: boolean;
|
|
130
133
|
readonly itemSelected: EventEmitter<ICaoAutoCompleteOption>;
|
|
131
134
|
readonly blurEvent: EventEmitter<void>;
|
|
132
135
|
readonly focusEvent: EventEmitter<void>;
|
|
133
136
|
readonly leadingIconClick: EventEmitter<Event | MouseEvent>;
|
|
134
137
|
readonly trailingIconClick: EventEmitter<Event | MouseEvent>;
|
|
135
|
-
|
|
138
|
+
inputEl: ElementRef<HTMLInputElement>;
|
|
139
|
+
wrapperEl: ElementRef<HTMLDivElement>;
|
|
140
|
+
panelTemplate: TemplateRef<any>;
|
|
141
|
+
/** controla apenas o texto digitado / exibido no input */
|
|
136
142
|
internalControl: FormControl<string | null>;
|
|
137
143
|
filteredOptions$: Observable<ICaoAutoCompleteOption[]>;
|
|
144
|
+
filteredOptionsList: ICaoAutoCompleteOption[];
|
|
138
145
|
isFocused: boolean;
|
|
139
|
-
|
|
146
|
+
isPanelOpen: boolean;
|
|
147
|
+
activeIndex: number;
|
|
148
|
+
private static uidSeq;
|
|
149
|
+
readonly listboxId: string;
|
|
140
150
|
private selectedOption;
|
|
141
151
|
private options$;
|
|
152
|
+
/** indica se o valor atual do internalControl foi digitado pelo usuário (e não escrito programaticamente) */
|
|
153
|
+
private isUserTyping;
|
|
142
154
|
private el;
|
|
155
|
+
private cdr;
|
|
156
|
+
private renderer;
|
|
157
|
+
private overlay;
|
|
158
|
+
private viewContainerRef;
|
|
159
|
+
private scrollDispatcher;
|
|
160
|
+
private sub;
|
|
161
|
+
private overlayRef;
|
|
162
|
+
private portal;
|
|
143
163
|
private onChange;
|
|
144
164
|
private onTouched;
|
|
145
165
|
ngOnInit(): void;
|
|
146
|
-
|
|
166
|
+
ngAfterViewInit(): void;
|
|
147
167
|
ngOnChanges(changes: SimpleChanges): void;
|
|
168
|
+
ngOnDestroy(): void;
|
|
169
|
+
private setupOverlay;
|
|
170
|
+
private closeOverlay;
|
|
171
|
+
private openOverlay;
|
|
172
|
+
private setStyle;
|
|
173
|
+
openPanel(): void;
|
|
174
|
+
closePanel(): void;
|
|
175
|
+
onDocumentClick(event: MouseEvent): void;
|
|
148
176
|
onFocus(): void;
|
|
149
177
|
onBlur(): void;
|
|
178
|
+
onInputKeydown(event: KeyboardEvent): void;
|
|
179
|
+
private moveActiveIndex;
|
|
150
180
|
selectItem(option: ICaoAutoCompleteOption): void;
|
|
151
|
-
onOptionSelected(event: MatAutocompleteSelectedEvent): void;
|
|
152
181
|
selectOption(option: ICaoAutoCompleteOption): void;
|
|
153
|
-
closePanel(): void;
|
|
154
182
|
clearSelection(): void;
|
|
155
183
|
onLeadingIconClick(event: MouseEvent | Event): void;
|
|
156
184
|
onTrailingIconClick(event: MouseEvent | Event): void;
|
|
157
185
|
private filter;
|
|
186
|
+
/** Move a opção selecionada para o início da lista, mantendo a ordem das demais */
|
|
187
|
+
private moveSelectedToTop;
|
|
188
|
+
private writeDisplayValue;
|
|
189
|
+
/** Marca que o usuário está digitando manualmente no campo (ativa o filtro por texto) */
|
|
190
|
+
onUserInput(): void;
|
|
158
191
|
displayFn(option: ICaoAutoCompleteOption): string;
|
|
192
|
+
isOptionSelected(option: ICaoAutoCompleteOption): boolean;
|
|
193
|
+
trackByOptionId(_: number, option: ICaoAutoCompleteOption): string | number;
|
|
194
|
+
optionId(option: ICaoAutoCompleteOption): string;
|
|
195
|
+
get activeOptionId(): string | null;
|
|
159
196
|
get errorText(): string | null;
|
|
160
197
|
get controlNameValue(): string;
|
|
161
198
|
writeValue(value: ICaoAutoCompleteOption | string): void;
|
|
162
199
|
registerOnChange(fn: (value: ICaoAutoCompleteOption | string | null) => void): void;
|
|
163
200
|
registerOnTouched(fn: () => void): void;
|
|
164
|
-
|
|
201
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
202
|
+
setInputHeight(): void;
|
|
165
203
|
static ɵfac: i0.ɵɵFactoryDeclaration<CaoAutocompleteComponent, never>;
|
|
166
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CaoAutocompleteComponent, "cao-autocomplete", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "options": { "alias": "options"; "required": false; }; "control": { "alias": "control"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "controlName": { "alias": "controlName"; "required": false; }; "isLucideIcon": { "alias": "isLucideIcon"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "_leadingIcon": { "alias": "_leadingIcon"; "required": false; }; "_trailingIcon": { "alias": "_trailingIcon"; "required": false; }; "optionIcon": { "alias": "optionIcon"; "required": false; }; "optionIConColor": { "alias": "optionIConColor"; "required": false; }; "isLucideOptionIcon": { "alias": "isLucideOptionIcon"; "required": false; }; "autocompleteBgColor": { "alias": "autocompleteBgColor"; "required": false; }; "strokeWidthIcon": { "alias": "strokeWidthIcon"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; }, { "itemSelected": "itemSelected"; "blurEvent": "blurEvent"; "focusEvent": "focusEvent"; "leadingIconClick": "leadingIconClick"; "trailingIconClick": "trailingIconClick"; }, never, never, true, never>;
|
|
204
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CaoAutocompleteComponent, "cao-autocomplete", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "options": { "alias": "options"; "required": false; }; "control": { "alias": "control"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "controlName": { "alias": "controlName"; "required": false; }; "isLucideIcon": { "alias": "isLucideIcon"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "_leadingIcon": { "alias": "_leadingIcon"; "required": false; }; "_trailingIcon": { "alias": "_trailingIcon"; "required": false; }; "optionIcon": { "alias": "optionIcon"; "required": false; }; "optionIConColor": { "alias": "optionIConColor"; "required": false; }; "isLucideOptionIcon": { "alias": "isLucideOptionIcon"; "required": false; }; "autocompleteBgColor": { "alias": "autocompleteBgColor"; "required": false; }; "strokeWidthIcon": { "alias": "strokeWidthIcon"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "inputHeigth": { "alias": "inputHeigth"; "required": false; }; "checkIcon": { "alias": "checkIcon"; "required": false; }; "showCheckIcon": { "alias": "showCheckIcon"; "required": false; }; "isLucideCheckIcon": { "alias": "isLucideCheckIcon"; "required": false; }; }, { "itemSelected": "itemSelected"; "blurEvent": "blurEvent"; "focusEvent": "focusEvent"; "leadingIconClick": "leadingIconClick"; "trailingIconClick": "trailingIconClick"; }, never, never, true, never>;
|
|
167
205
|
}
|
|
168
206
|
|
|
169
207
|
interface ICaoDropDownOption {
|