ngx-sp-infra 6.5.16 → 6.5.17
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.
|
@@ -6430,7 +6430,7 @@ class LibComboboxReworkComponent {
|
|
|
6430
6430
|
// Re-resolve the current value when the list changes
|
|
6431
6431
|
if (this._value)
|
|
6432
6432
|
this.writeValue(this._value);
|
|
6433
|
-
this.
|
|
6433
|
+
this.searchControl.setValue('', { emitEvent: true });
|
|
6434
6434
|
}
|
|
6435
6435
|
// Getter/Setter para o valor
|
|
6436
6436
|
get value() { return this._value; }
|
|
@@ -6490,7 +6490,7 @@ class LibComboboxReworkComponent {
|
|
|
6490
6490
|
this.invalid = false;
|
|
6491
6491
|
this.isOpen = false;
|
|
6492
6492
|
this.searchControl = new FormControl("");
|
|
6493
|
-
this.filteredItems$ = this._search$.pipe(debounceTime(150),
|
|
6493
|
+
this.filteredItems$ = this._search$.pipe(debounceTime(150), map((term) => this.filterItems(term)));
|
|
6494
6494
|
this.compare = (a, b) => {
|
|
6495
6495
|
if (!a || !b)
|
|
6496
6496
|
return false;
|
|
@@ -6512,6 +6512,7 @@ class LibComboboxReworkComponent {
|
|
|
6512
6512
|
}
|
|
6513
6513
|
return String(item);
|
|
6514
6514
|
};
|
|
6515
|
+
this._cdr.markForCheck();
|
|
6515
6516
|
}
|
|
6516
6517
|
ngOnInit() {
|
|
6517
6518
|
this.searchControl.valueChanges
|
|
@@ -6522,6 +6523,7 @@ class LibComboboxReworkComponent {
|
|
|
6522
6523
|
else
|
|
6523
6524
|
this.filterChange.emit(v);
|
|
6524
6525
|
});
|
|
6526
|
+
this.searchControl.setValue('', { emitEvent: true });
|
|
6525
6527
|
this.registerObserver();
|
|
6526
6528
|
}
|
|
6527
6529
|
ngAfterViewInit() {
|
|
@@ -6531,7 +6533,10 @@ class LibComboboxReworkComponent {
|
|
|
6531
6533
|
this.setMaxWidth();
|
|
6532
6534
|
}
|
|
6533
6535
|
ngOnChanges(changes) {
|
|
6534
|
-
|
|
6536
|
+
if (changes['list'] && changes['list'].currentValue) {
|
|
6537
|
+
this.searchControl.setValue('', { emitEvent: true });
|
|
6538
|
+
this._cdr.detectChanges();
|
|
6539
|
+
}
|
|
6535
6540
|
}
|
|
6536
6541
|
ngOnDestroy() {
|
|
6537
6542
|
this._destroy$.next();
|
|
@@ -6656,19 +6661,18 @@ class LibComboboxReworkComponent {
|
|
|
6656
6661
|
}
|
|
6657
6662
|
this._cdr.markForCheck();
|
|
6658
6663
|
}
|
|
6659
|
-
openDropdown() {
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
}
|
|
6664
|
+
// public openDropdown() {
|
|
6665
|
+
// if (this.disabled) return;
|
|
6666
|
+
// this.isOpen = true;
|
|
6667
|
+
// if (this.isOpen) {
|
|
6668
|
+
// this.searchControl.setValue("", { emitEvent: true });
|
|
6669
|
+
// setTimeout(() => {
|
|
6670
|
+
// const inputEl: HTMLInputElement | null = document.querySelector('.reusable-combobox .dropdown-search input');
|
|
6671
|
+
// inputEl?.focus();
|
|
6672
|
+
// }, 0);
|
|
6673
|
+
// }
|
|
6674
|
+
// this._cdr.markForCheck();
|
|
6675
|
+
// }
|
|
6672
6676
|
closeDropdown() {
|
|
6673
6677
|
this.isOpen = false;
|
|
6674
6678
|
this._cdr.markForCheck();
|
|
@@ -6812,7 +6816,6 @@ class LibComboboxComponent {
|
|
|
6812
6816
|
set ariaExpanded(value) {
|
|
6813
6817
|
this._ariaExpanded = value;
|
|
6814
6818
|
this.adjustDropdownWidth();
|
|
6815
|
-
this._cdr.detectChanges();
|
|
6816
6819
|
if (value === false) {
|
|
6817
6820
|
this.textoPesquisa = "";
|
|
6818
6821
|
// Validação para caso o input de pesquisa esteja escondido
|
|
@@ -6860,8 +6863,7 @@ class LibComboboxComponent {
|
|
|
6860
6863
|
}
|
|
6861
6864
|
// #endregion PUBLIC
|
|
6862
6865
|
// #endregion ==========> PROPERTIES <==========
|
|
6863
|
-
constructor(
|
|
6864
|
-
this._cdr = _cdr;
|
|
6866
|
+
constructor() {
|
|
6865
6867
|
// #region ==========> PROPERTIES <==========
|
|
6866
6868
|
// #region PROTECTED
|
|
6867
6869
|
this.textoPesquisa = "";
|
|
@@ -6928,7 +6930,6 @@ class LibComboboxComponent {
|
|
|
6928
6930
|
* @type {EventEmitter<string>} */
|
|
6929
6931
|
this.changePesquisa = new EventEmitter();
|
|
6930
6932
|
this.showSearchInput = false;
|
|
6931
|
-
this._cdr.markForCheck();
|
|
6932
6933
|
}
|
|
6933
6934
|
ngOnInit() {
|
|
6934
6935
|
this.comboboxID = `lib-combobox-${Math.random() * 100}`;
|
|
@@ -7046,7 +7047,7 @@ class LibComboboxComponent {
|
|
|
7046
7047
|
}
|
|
7047
7048
|
}
|
|
7048
7049
|
reloadList() { this.reloadListChange.emit(this.textoPesquisa); }
|
|
7049
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LibComboboxComponent, deps: [
|
|
7050
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LibComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7050
7051
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: LibComboboxComponent, isStandalone: true, selector: "lib-combobox", inputs: { control: "control", list: "list", labelText: "labelText", separator: "separator", libRequired: "libRequired", disabled: "disabled", mainPlaceholder: "mainPlaceholder", searchPlaceholder: "searchPlaceholder", theme: "theme", returnRecord: "returnRecord", additionalStringBold: "additionalStringBold", showErrorMessage: "showErrorMessage" }, outputs: { reloadListChange: "reloadListChange", changeValue: "changeValue", changePesquisa: "changePesquisa" }, viewQueries: [{ propertyName: "_mainInput", first: true, predicate: ["mainInput"], descendants: true }, { propertyName: "_searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "_dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<label *ngIf=\"labelText && labelText !== ''\" class=\"form-label fw-bold d-flex align-items-center gap-1\" [id]=\"labelID\" [for]=\"comboboxID\" [libRequired]=\"isRequired\">\n <ng-content select=\"lib-icon[iconLeft]\"></ng-content>\n {{ labelText }}\n <ng-content select=\"lib-icon[iconRight]\"></ng-content>\n</label>\n\n<div class=\"input-group dropdown flex-fill glb-max-height-350px\">\n\n <!-- Este elemento ng-content com o atributo [btnLeft] permite que o usu\u00E1rio final forne\u00E7a conte\u00FAdo personalizado para ser exibido no lado esquerdo do combobox de pesquisa.\n Ao usar o atributo [btnLeft], o usu\u00E1rio pode facilmente adicionar bot\u00F5es ou outros elementos para melhorar a funcionalidade ou apar\u00EAncia do combobox de pesquisa. -->\n <ng-content select=\"[btnLeft]\"></ng-content>\n\n <input #mainInput class=\"form-select text-start rounded-end cursor-pointer\" type=\"text\"\n data-bs-toggle=\"dropdown\" data-bs-auto-close=\"outside\" aria-expanded=\"false\" readonly\n [placeholder]=\"mainPlaceholder\" [class.text-muted]=\"innerControl.value == null\" [formControl]=\"innerControl\" [class.is-invalid]=\"invalidControl\" [id]=\"comboboxID\"\n (click)=\"ariaExpanded = !ariaExpanded; focusSearchInput()\" (focus)=\"focusSearchInput()\">\n\n <ul #dropdownMenu class=\"dropdown-menu p-2 glb-max-height-350px overflow-y-scroll z-index-1020\" [class.show]=\"ariaExpanded\">\n @if(showSearchInput){\n <div class=\"input-group mb-2\">\n <input #searchInput type=\"text\" id=\"searchInput-{{comboboxID}}\" class=\"searchInput form-control glb-input-no-glow\" [placeholder]=\"searchPlaceholder\" (keyup.enter)=\"reloadList()\"\n [(ngModel)]=\"textoPesquisa\" (ngModelChange)=\"changePesquisa.emit(textoPesquisa)\" >\n <button class=\"btn btn-{{theme}}\" (click)=\"reloadList()\"> <lib-icon iconName=\"lupa\" iconSize=\"medium-small\" /> </button>\n </div>\n }\n\n @if (list) {\n <li *ngIf=\"innerControl.value !== '' && innerControl.value !== null\" class=\"dropdown-item glb-cursor-pointer\" (click)=\"clearValue()\"> <span class=\"fw-bold\">Limpar op\u00E7\u00E3o selecionada</span> </li>\n @for (item of list | textFilter:textoPesquisa; track $index) {\n <li class=\"dropdown-item glb-cursor-pointer\" (click)=\"setValue(item)\">\n <span *ngIf=\"item.AdditionalStringProperty1 && item.AdditionalStringProperty1 !== ''\" class=\"glb-fs-12 d-inline-block w-125\" [class.fw-bold]=\"additionalStringBold\">\n {{ item.AdditionalStringProperty1 + (separator === undefined ? \"\" : \" \"+separator) }}\n </span> {{ item.LABEL }}\n </li>\n }\n @empty { <li class=\"dropdown-item fst-italic\">Nenhum registro encontrado com esta pesquisa...</li> }\n }\n @else { <li class=\"dropdown-item text-center\"> <div class=\"spinner-border\" role=\"status\"><span class=\"visually-hidden\">Carregando dados...</span></div> </li> }\n </ul>\n\n <!-- Este elemento ng-content com o atributo [btnRight] permite que o usu\u00E1rio final forne\u00E7a conte\u00FAdo personalizado para ser exibido no lado direito do combobox de pesquisa.\n Ao usar o atributo [btnRight], o usu\u00E1rio pode facilmente adicionar bot\u00F5es ou outros elementos para melhorar a funcionalidade ou apar\u00EAncia do combobox de pesquisa. -->\n <ng-content select=\"[btnRight]\"></ng-content>\n\n</div>\n\n<!-- #region MENSAGEM DE ERRO DE VALIDA\u00C7\u00C3O -->\n<lib-error-message *ngIf=\"showErrorMessage && invalidControl\" customMessage=\"Este campo \u00E9 obrigat\u00F3rio.\" />\n<!-- #endregion MENSAGEM DE ERRO DE VALIDA\u00C7\u00C3O -->", styles: [".glb-max-height-350px{max-height:350px!important}.form-label{font-size:16px!important}.z-index-1020{z-index:1020!important}.cursor-pointer{cursor:pointer!important}.dropdown-menu{position:relative}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: RequiredDirective, selector: "label[libRequired], span[libRequired], p[libRequired]", inputs: ["libRequired", "requiredID"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "component", type: FieldErrorMessageComponent, selector: "app-field-error-message, lib-error-message", inputs: ["customMessage", "control", "label"] }, { kind: "pipe", type: TextFilterPipe, name: "textFilter" }] }); }
|
|
7051
7052
|
}
|
|
7052
7053
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LibComboboxComponent, decorators: [{
|
|
@@ -7060,7 +7061,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
7060
7061
|
FieldErrorMessageComponent,
|
|
7061
7062
|
TextFilterPipe,
|
|
7062
7063
|
], template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<label *ngIf=\"labelText && labelText !== ''\" class=\"form-label fw-bold d-flex align-items-center gap-1\" [id]=\"labelID\" [for]=\"comboboxID\" [libRequired]=\"isRequired\">\n <ng-content select=\"lib-icon[iconLeft]\"></ng-content>\n {{ labelText }}\n <ng-content select=\"lib-icon[iconRight]\"></ng-content>\n</label>\n\n<div class=\"input-group dropdown flex-fill glb-max-height-350px\">\n\n <!-- Este elemento ng-content com o atributo [btnLeft] permite que o usu\u00E1rio final forne\u00E7a conte\u00FAdo personalizado para ser exibido no lado esquerdo do combobox de pesquisa.\n Ao usar o atributo [btnLeft], o usu\u00E1rio pode facilmente adicionar bot\u00F5es ou outros elementos para melhorar a funcionalidade ou apar\u00EAncia do combobox de pesquisa. -->\n <ng-content select=\"[btnLeft]\"></ng-content>\n\n <input #mainInput class=\"form-select text-start rounded-end cursor-pointer\" type=\"text\"\n data-bs-toggle=\"dropdown\" data-bs-auto-close=\"outside\" aria-expanded=\"false\" readonly\n [placeholder]=\"mainPlaceholder\" [class.text-muted]=\"innerControl.value == null\" [formControl]=\"innerControl\" [class.is-invalid]=\"invalidControl\" [id]=\"comboboxID\"\n (click)=\"ariaExpanded = !ariaExpanded; focusSearchInput()\" (focus)=\"focusSearchInput()\">\n\n <ul #dropdownMenu class=\"dropdown-menu p-2 glb-max-height-350px overflow-y-scroll z-index-1020\" [class.show]=\"ariaExpanded\">\n @if(showSearchInput){\n <div class=\"input-group mb-2\">\n <input #searchInput type=\"text\" id=\"searchInput-{{comboboxID}}\" class=\"searchInput form-control glb-input-no-glow\" [placeholder]=\"searchPlaceholder\" (keyup.enter)=\"reloadList()\"\n [(ngModel)]=\"textoPesquisa\" (ngModelChange)=\"changePesquisa.emit(textoPesquisa)\" >\n <button class=\"btn btn-{{theme}}\" (click)=\"reloadList()\"> <lib-icon iconName=\"lupa\" iconSize=\"medium-small\" /> </button>\n </div>\n }\n\n @if (list) {\n <li *ngIf=\"innerControl.value !== '' && innerControl.value !== null\" class=\"dropdown-item glb-cursor-pointer\" (click)=\"clearValue()\"> <span class=\"fw-bold\">Limpar op\u00E7\u00E3o selecionada</span> </li>\n @for (item of list | textFilter:textoPesquisa; track $index) {\n <li class=\"dropdown-item glb-cursor-pointer\" (click)=\"setValue(item)\">\n <span *ngIf=\"item.AdditionalStringProperty1 && item.AdditionalStringProperty1 !== ''\" class=\"glb-fs-12 d-inline-block w-125\" [class.fw-bold]=\"additionalStringBold\">\n {{ item.AdditionalStringProperty1 + (separator === undefined ? \"\" : \" \"+separator) }}\n </span> {{ item.LABEL }}\n </li>\n }\n @empty { <li class=\"dropdown-item fst-italic\">Nenhum registro encontrado com esta pesquisa...</li> }\n }\n @else { <li class=\"dropdown-item text-center\"> <div class=\"spinner-border\" role=\"status\"><span class=\"visually-hidden\">Carregando dados...</span></div> </li> }\n </ul>\n\n <!-- Este elemento ng-content com o atributo [btnRight] permite que o usu\u00E1rio final forne\u00E7a conte\u00FAdo personalizado para ser exibido no lado direito do combobox de pesquisa.\n Ao usar o atributo [btnRight], o usu\u00E1rio pode facilmente adicionar bot\u00F5es ou outros elementos para melhorar a funcionalidade ou apar\u00EAncia do combobox de pesquisa. -->\n <ng-content select=\"[btnRight]\"></ng-content>\n\n</div>\n\n<!-- #region MENSAGEM DE ERRO DE VALIDA\u00C7\u00C3O -->\n<lib-error-message *ngIf=\"showErrorMessage && invalidControl\" customMessage=\"Este campo \u00E9 obrigat\u00F3rio.\" />\n<!-- #endregion MENSAGEM DE ERRO DE VALIDA\u00C7\u00C3O -->", styles: [".glb-max-height-350px{max-height:350px!important}.form-label{font-size:16px!important}.z-index-1020{z-index:1020!important}.cursor-pointer{cursor:pointer!important}.dropdown-menu{position:relative}\n"] }]
|
|
7063
|
-
}], ctorParameters: () => [
|
|
7064
|
+
}], ctorParameters: () => [], propDecorators: { control: [{
|
|
7064
7065
|
type: Input,
|
|
7065
7066
|
args: [{ required: true }]
|
|
7066
7067
|
}], list: [{
|