ngx-sp-infra 6.0.7 → 6.0.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.
|
@@ -4217,6 +4217,9 @@ class IconsList {
|
|
|
4217
4217
|
</svg>` },
|
|
4218
4218
|
{ nome: "open-modal", categoria: "", tags: [], svg: `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4219
4219
|
<path d="M13.5 10.4956C12.3954 10.4956 11.5 9.60017 11.5 8.49561V5.50537C9.25159 5.50537 6.93528 5.50537 5.5 5.50537C4.93407 5.50537 4.18883 5.43902 3.54688 5.67432C3.24711 5.78429 2.99806 5.95429 2.81934 6.21533C2.63955 6.47843 2.50012 6.88057 2.5 7.50537V15.0054C2.50028 15.2047 2.59626 15.5702 2.93945 15.8882C3.27609 16.1998 3.89435 16.5054 5 16.5054H10.9912C10.9941 16.5053 10.9971 16.5044 11 16.5044C11.0029 16.5044 11.0059 16.5053 11.0088 16.5054H17.5C17.8366 16.5054 18.353 16.3997 18.7705 16.0991C19.1622 15.8169 19.4998 15.3415 19.5 14.5054V10.4956H13.5ZM13.5 3.49561C12.9477 3.49561 12.5 3.94332 12.5 4.49561V8.49561C12.5 9.04789 12.9477 9.49561 13.5 9.49561H20.5C21.0523 9.49561 21.5 9.04789 21.5 8.49561V4.49561C21.5 3.94332 21.0523 3.49561 20.5 3.49561H13.5ZM20.5 14.5054C20.4998 15.6676 20.0037 16.443 19.3545 16.9106C18.7305 17.3598 17.9966 17.5054 17.5 17.5054H11.5V20.5044H16C16.2757 20.5044 16.4993 20.7288 16.5 21.0044C16.4998 21.2804 16.276 21.5044 16 21.5044H6C5.72397 21.5044 5.50018 21.2804 5.5 21.0044C5.50067 20.7288 5.72427 20.5044 6 20.5044H10.5V17.5054H5C3.70616 17.5054 2.82417 17.1431 2.26074 16.6216C1.70546 16.1072 1.50025 15.4726 1.5 15.0054V7.50537C1.50012 6.73151 1.67345 6.1187 1.99316 5.65088C2.31428 5.18153 2.75353 4.90072 3.20312 4.73584C4.06102 4.42141 5.06607 4.50537 5.5 4.50537H11.5V4.49561C11.5 3.39104 12.3954 2.49561 13.5 2.49561H20.5L20.7041 2.50635C21.7128 2.60861 22.5 3.45995 22.5 4.49561V8.49561L22.4893 8.69971C22.3938 9.64126 21.6457 10.3894 20.7041 10.4849L20.5 10.4956V14.5054Z" fill="currentColor"/>
|
|
4220
|
+
</svg>` },
|
|
4221
|
+
{ nome: "sharepoint", categoria: "", tags: [], svg: `<svg width="${size}" height="${size}" viewBox="0 0 24 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4222
|
+
<path d="M17.9984 7.375H16.7388C16.3647 5.83543 15.5919 4.43824 14.508 3.34217C13.4242 2.2461 12.0727 1.49512 10.6074 1.17454C9.14196 0.853971 7.62134 0.976668 6.21828 1.52869C4.81522 2.08072 3.58598 3.03993 2.67024 4.29734C1.7545 5.55475 1.18898 7.05994 1.03794 8.64187C0.886894 10.2238 1.15639 11.819 1.81579 13.2463C2.4752 14.6736 3.49808 15.8757 4.7682 16.716C6.03832 17.5563 7.50475 18.0012 9.00087 18H17.9984C19.3242 18 20.5956 17.4403 21.533 16.444C22.4704 15.4477 22.9971 14.0965 22.9971 12.6875C22.9971 11.2785 22.4704 9.92728 21.533 8.93099C20.5956 7.93471 19.3242 7.375 17.9984 7.375Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4220
4223
|
</svg>` },
|
|
4221
4224
|
];
|
|
4222
4225
|
// #endregion LISTA COMPLETA DE ÍCONES - ÍCONES NOVOS DEVEM SER ADICIONADOS AQUI
|
|
@@ -6391,7 +6394,7 @@ class LibComboboxReworkComponent {
|
|
|
6391
6394
|
set value(val) {
|
|
6392
6395
|
if (val !== this._value) {
|
|
6393
6396
|
this._value = val;
|
|
6394
|
-
this._onChange(val); // Notifica o FormControl sobre a mudança
|
|
6397
|
+
this._onChange(this.formatReturn(val)); // Notifica o FormControl sobre a mudança
|
|
6395
6398
|
}
|
|
6396
6399
|
}
|
|
6397
6400
|
displayValue() {
|
|
@@ -6519,12 +6522,10 @@ class LibComboboxReworkComponent {
|
|
|
6519
6522
|
if (this.selectedValues.length === 0)
|
|
6520
6523
|
this.selectedValues = null;
|
|
6521
6524
|
this.value = this.selectedValues;
|
|
6522
|
-
this._onChange(this.selectedValues);
|
|
6523
6525
|
this.selectionChange.emit(this.selectedValues);
|
|
6524
6526
|
}
|
|
6525
6527
|
else {
|
|
6526
6528
|
this.value = item;
|
|
6527
|
-
this._onChange(item);
|
|
6528
6529
|
this.selectionChange.emit(item);
|
|
6529
6530
|
this.closeDropdown();
|
|
6530
6531
|
}
|
|
@@ -6552,26 +6553,22 @@ class LibComboboxReworkComponent {
|
|
|
6552
6553
|
const match = this.list?.find((item) => item[this.customValue] === val);
|
|
6553
6554
|
return match ?? null;
|
|
6554
6555
|
}
|
|
6556
|
+
/** Formata o valor de retorno com base na configuração de retorno */
|
|
6557
|
+
formatReturn(val) {
|
|
6558
|
+
if (val) {
|
|
6559
|
+
if (this.multiple && Array.isArray(val)) {
|
|
6560
|
+
// Retorna a lista de IDs
|
|
6561
|
+
return val.map(v => v[this.customValue]);
|
|
6562
|
+
}
|
|
6563
|
+
else {
|
|
6564
|
+
// Retorna o ID do item
|
|
6565
|
+
return val[this.customValue];
|
|
6566
|
+
}
|
|
6567
|
+
}
|
|
6568
|
+
return val;
|
|
6569
|
+
}
|
|
6555
6570
|
// #endregion Seleção
|
|
6556
6571
|
// #region VALUE_ACCESSOR do Angular
|
|
6557
|
-
// // Método antigo
|
|
6558
|
-
// public writeValue(obj: T | T[] | null): void {
|
|
6559
|
-
// if (!obj) this.selectedValues = null;
|
|
6560
|
-
// this._onTouched();
|
|
6561
|
-
// if (this.multiple && obj) {
|
|
6562
|
-
// this.selectedValues = Array.isArray(obj) ? [...obj] : [];
|
|
6563
|
-
// if (this.selectedValues.length === 0) this.selectedValues = null;
|
|
6564
|
-
// this.value = this.selectedValues;
|
|
6565
|
-
// this._onChange(this.selectedValues);
|
|
6566
|
-
// this.selectionChange.emit(this.selectedValues);
|
|
6567
|
-
// }
|
|
6568
|
-
// else {
|
|
6569
|
-
// this.value = obj;
|
|
6570
|
-
// this._onChange(obj);
|
|
6571
|
-
// this.selectionChange.emit(obj);
|
|
6572
|
-
// }
|
|
6573
|
-
// this._cdr.markForCheck();
|
|
6574
|
-
// }
|
|
6575
6572
|
writeValue(obj) {
|
|
6576
6573
|
if (!obj)
|
|
6577
6574
|
this.selectedValues = null;
|
|
@@ -6583,13 +6580,11 @@ class LibComboboxReworkComponent {
|
|
|
6583
6580
|
if (this.selectedValues.length === 0)
|
|
6584
6581
|
this.selectedValues = null;
|
|
6585
6582
|
this.value = this.selectedValues;
|
|
6586
|
-
this._onChange(this.selectedValues);
|
|
6587
6583
|
this.selectionChange.emit(this.selectedValues);
|
|
6588
6584
|
}
|
|
6589
6585
|
else {
|
|
6590
6586
|
const resolved = this.resolveValue(obj);
|
|
6591
6587
|
this.value = resolved;
|
|
6592
|
-
this._onChange(resolved);
|
|
6593
6588
|
this.selectionChange.emit(resolved);
|
|
6594
6589
|
}
|
|
6595
6590
|
this._cdr.markForCheck();
|
|
@@ -6696,7 +6691,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
6696
6691
|
}
|
|
6697
6692
|
], template: "<div class=\"reusable-combobox input-group\" [class.show]=\"isOpen\" (focusout)=\"onBlurOutside($event)\" >\n @if (leftButtonTemplate) { <ng-container *ngTemplateOutlet=\"leftButtonTemplate\"></ng-container> }\n\n <div class=\"dropdown w-100\">\n <div #toggleButton id=\"toggle-button\" class=\"form-select d-flex align-items-center text-start\" type=\"button\" data-bs-toggle=\"dropdown\"\n data-bs-auto-close=\"outside\" [attr.aria-expanded]=\"isOpen\" [attr.aria-haspopup]=\"true\" [attr.aria-label]=\"placeholder\" [class.disabled]=\"disabled\"\n [class.is-invalid]=\"invalid\" (click)=\"toggleDropdown()\" readonly\n [ngClass]=\"{\n 'rounded-start-0': leftButtonTemplate,\n 'rounded-end-0': rightButtonTemplate,\n }\" >\n <span class=\"w-100 overflow-hidden text-truncate\"> {{ displayValue() }} </span> \n </div>\n\n <div class=\"dropdown-menu p-2 w-100\" [class.show]=\"isOpen\" style=\"max-height: 320px; overflow-y: auto;\" >\n <div class=\"dropdown-search input-group mb-2\">\n <input class=\"form-control form-control-sm\" type=\"search\" [placeholder]=\"searchPlaceholder\" [formControl]=\"searchControl\" aria-label=\"Pesquisar op\u00E7\u00F5es\" (keyup.enter)=\"filterButtonClick.emit(searchControl.value)\" />\n <button class=\"btn btn-sm btn-primary\" type=\"button\" (click)=\"filterButtonClick.emit(searchControl.value)\"> <lib-icon iconName=\"lupa\" iconSize=\"medium-small\" /> </button>\n </div>\n\n @if (multiple && selectedValues?.length) {\n <div class=\"d-flex flex-row gap-2 flex-wrap my-2\">\n <span *ngFor=\"let value of selectedValues; trackBy: trackByFn\" class=\"px-3 badge rounded-pill text-primary bg-primary-subtle\">\n {{ value[customLabel] }} <lib-icon class=\"glb-cursor-pointer\" iconName=\"fechar\" iconSize=\"small\" (click)=\"select(value)\" />\n </span>\n </div>\n }\n\n <!-- Se utilizar o filtro interno utiliza a propriedade de lista filteredItems$, caso contr\u00E1rio usa a pr\u00F3pria list pois ela ser\u00E1 filtrada pelo componente pai -->\n <ng-container *ngIf=\"(innerFilter ? (filteredItems$ | async) : list) as items\">\n @if (items.length === 0) { <div class=\"py-2 px-3 text-muted small\">{{ noResultsText }}</div> }\n\n @if (value !== '' && value !== null) {\n <button type=\"button\" class=\"dropdown-item d-flex align-items-center\" (click)=\"writeValue(null)\">\n <span class=\"fw-bold\">Limpar {{ multiple ? 'op\u00E7\u00F5es selecionadas' : 'op\u00E7\u00E3o selecionada' }}</span>\n </button>\n }\n\n <button *ngFor=\"let item of items; trackBy: trackByFn\" class=\"dropdown-item d-flex align-items-center\" type=\"button\"\n (click)=\"select(item)\" [attr.aria-selected]=\"isSelected(item)\" >\n\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item, selected: isSelected(item) }\"></ng-container>\n }\n @else {\n <div class=\"w-100 original\">\n <div class=\"d-flex justify-content-between\">\n <div>{{ (item[customLabel] ?? item[customValue]) }}</div>\n <small class=\"text-muted\" *ngIf=\"isSelected(item)\">\u2713</small>\n </div>\n </div>\n }\n </button>\n </ng-container>\n </div>\n </div>\n\n @if (rightButtonTemplate) { <ng-container *ngTemplateOutlet=\"rightButtonTemplate\"></ng-container> }\n</div>\n", styles: [".reusable-combobox{position:relative;display:flex;flex-wrap:nowrap;width:100%;max-width:100%}.reusable-combobox #toggle-button{box-sizing:border-box}.reusable-combobox .dropdown-menu{width:100%;box-shadow:0 6px 18px #00000014;border-radius:.5rem}.reusable-combobox .dropdown-item{cursor:pointer;border-radius:6px;transition:all .3s ease}.reusable-combobox .dropdown-item:hover:not(:focus){background-color:#f1f5f9}.reusable-combobox.compact .dropdown-menu{max-height:200px}.bg-primary-subtle{background-color:#d1dfe7!important}::-webkit-scrollbar{width:4px;background:transparent}::-webkit-scrollbar-thumb{background:#bbb;border-radius:16px}\n"] }]
|
|
6698
6693
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { list: [{
|
|
6699
|
-
type: Input
|
|
6694
|
+
type: Input,
|
|
6695
|
+
args: [{ required: true }]
|
|
6700
6696
|
}], placeholder: [{
|
|
6701
6697
|
type: Input
|
|
6702
6698
|
}], searchPlaceholder: [{
|