ngx-opalbytes-components 1.17.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,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-opalbytes-components",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0",
@@ -1,8 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, EventEmitter, OnChanges, SimpleChanges, OnDestroy, ElementRef, ChangeDetectorRef, Signal, AfterContentInit, QueryList, TemplateRef, WritableSignal, AfterViewInit } from '@angular/core';
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';
@@ -29,10 +28,11 @@ declare class CaoBaseButtonComponent implements OnInit {
29
28
  dataCy?: string;
30
29
  iconColor?: string;
31
30
  strokeWidthIcon: number;
31
+ minTextToTooltip: number;
32
32
  ngOnInit(): void;
33
33
  onClick(): void;
34
34
  static ɵfac: i0.ɵɵFactoryDeclaration<CaoBaseButtonComponent, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<CaoBaseButtonComponent, "cao-button", never, { "buttonText": { "alias": "buttonText"; "required": false; }; "isDarkMode": { "alias": "isDarkMode"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "btnClass": { "alias": "btnClass"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "trailingIcon": { "alias": "trailingIcon"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; "isLucideIcon": { "alias": "isLucideIcon"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "strokeWidthIcon": { "alias": "strokeWidthIcon"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<CaoBaseButtonComponent, "cao-button", never, { "buttonText": { "alias": "buttonText"; "required": false; }; "isDarkMode": { "alias": "isDarkMode"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "btnClass": { "alias": "btnClass"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "trailingIcon": { "alias": "trailingIcon"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; "isLucideIcon": { "alias": "isLucideIcon"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "strokeWidthIcon": { "alias": "strokeWidthIcon"; "required": false; }; "minTextToTooltip": { "alias": "minTextToTooltip"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
36
36
  }
37
37
 
38
38
  type CaoTypeInputs = 'text' | 'textarea' | 'number' | 'password' | 'date';
@@ -109,7 +109,7 @@ interface ICaoAutoCompleteOption {
109
109
  icon?: string;
110
110
  iconPosition?: string;
111
111
  }
112
- declare class CaoAutocompleteComponent implements OnInit, OnChanges, ControlValueAccessor {
112
+ declare class CaoAutocompleteComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit, ControlValueAccessor {
113
113
  label: string;
114
114
  placeholder: string;
115
115
  options: ICaoAutoCompleteOption[];
@@ -126,43 +126,82 @@ declare class CaoAutocompleteComponent implements OnInit, OnChanges, ControlValu
126
126
  autocompleteBgColor: string;
127
127
  strokeWidthIcon: number;
128
128
  isDisabled: boolean;
129
+ inputHeigth: string;
130
+ checkIcon: string;
131
+ showCheckIcon: boolean;
132
+ isLucideCheckIcon: boolean;
129
133
  readonly itemSelected: EventEmitter<ICaoAutoCompleteOption>;
130
134
  readonly blurEvent: EventEmitter<void>;
131
135
  readonly focusEvent: EventEmitter<void>;
132
136
  readonly leadingIconClick: EventEmitter<Event | MouseEvent>;
133
137
  readonly trailingIconClick: EventEmitter<Event | MouseEvent>;
134
- autocompleteTrigger: MatAutocompleteTrigger;
138
+ inputEl: ElementRef<HTMLInputElement>;
139
+ wrapperEl: ElementRef<HTMLDivElement>;
140
+ panelTemplate: TemplateRef<any>;
141
+ /** controla apenas o texto digitado / exibido no input */
135
142
  internalControl: FormControl<string | null>;
136
143
  filteredOptions$: Observable<ICaoAutoCompleteOption[]>;
144
+ filteredOptionsList: ICaoAutoCompleteOption[];
137
145
  isFocused: boolean;
138
- icon: boolean;
146
+ isPanelOpen: boolean;
147
+ activeIndex: number;
148
+ private static uidSeq;
149
+ readonly listboxId: string;
139
150
  private selectedOption;
140
151
  private options$;
152
+ /** indica se o valor atual do internalControl foi digitado pelo usuário (e não escrito programaticamente) */
153
+ private isUserTyping;
141
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;
142
163
  private onChange;
143
164
  private onTouched;
144
165
  ngOnInit(): void;
145
- private setStyle;
166
+ ngAfterViewInit(): void;
146
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;
147
176
  onFocus(): void;
148
177
  onBlur(): void;
178
+ onInputKeydown(event: KeyboardEvent): void;
179
+ private moveActiveIndex;
149
180
  selectItem(option: ICaoAutoCompleteOption): void;
150
- onOptionSelected(event: MatAutocompleteSelectedEvent): void;
151
181
  selectOption(option: ICaoAutoCompleteOption): void;
152
- closePanel(): void;
153
182
  clearSelection(): void;
154
183
  onLeadingIconClick(event: MouseEvent | Event): void;
155
184
  onTrailingIconClick(event: MouseEvent | Event): void;
156
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;
157
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;
158
196
  get errorText(): string | null;
159
197
  get controlNameValue(): string;
160
198
  writeValue(value: ICaoAutoCompleteOption | string): void;
161
199
  registerOnChange(fn: (value: ICaoAutoCompleteOption | string | null) => void): void;
162
200
  registerOnTouched(fn: () => void): void;
163
- setInputHeight(height: string): void;
201
+ setDisabledState?(isDisabled: boolean): void;
202
+ setInputHeight(): void;
164
203
  static ɵfac: i0.ɵɵFactoryDeclaration<CaoAutocompleteComponent, never>;
165
- 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>;
166
205
  }
167
206
 
168
207
  interface ICaoDropDownOption {