ng-components-tsi 0.0.9 → 0.0.10
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/fesm2022/ng-components-tsi.mjs +31 -7
- package/fesm2022/ng-components-tsi.mjs.map +1 -1
- package/lib/modals/general/md-generico/md-generico.component.d.ts +1 -1
- package/lib/service/toast.service.d.ts +5 -1
- package/lib/ui/alerts/toaster/toaster.component.d.ts +1 -2
- package/lib/ui/forms/inputs/input/input.component.d.ts +4 -4
- package/lib/ui/forms/inputs/input-radio/input-radio.component.d.ts +1 -1
- package/lib/ui/forms/lists/list-option/list-option.component.d.ts +1 -1
- package/lib/ui/tables/paginador/paginador.component.d.ts +1 -1
- package/lib/utils/helpers/api-result.d.ts +4 -1
- package/ng-components-tsi-0.0.10.tgz +0 -0
- package/package.json +3 -3
- package/ng-components-tsi-0.0.9.tgz +0 -0
|
@@ -10,7 +10,7 @@ import { NgbTooltipModule, NgbActiveModal, NgbDropdownModule, NgbDropdown, NgbNa
|
|
|
10
10
|
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
11
11
|
import * as i1$3 from '@angular/cdk/overlay';
|
|
12
12
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
13
|
-
import { Subject, debounceTime, distinctUntilChanged, filter, startWith, map, fromEvent, throttleTime, catchError, throwError } from 'rxjs';
|
|
13
|
+
import { Subject, debounceTime, distinctUntilChanged, filter, startWith, map, fromEvent, throttleTime, catchError, throwError, switchMap, of } from 'rxjs';
|
|
14
14
|
import { beep, getFirstItem, cleanNumber, obtenerTipoClases, validaArray, validarBoolean, formatNumber, validarVacioAndNull } from 'shared-tsi';
|
|
15
15
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
16
16
|
import { ActivatedRoute, Router, NavigationEnd, RouterLink, RouterOutlet, RouterLinkActive } from '@angular/router';
|
|
@@ -209,6 +209,23 @@ class ToastService {
|
|
|
209
209
|
setTimeout(() => this.remove(id), type == 'webpush' ? 10000 : 3000);
|
|
210
210
|
return id;
|
|
211
211
|
}
|
|
212
|
+
showLoading(message, subtitle) {
|
|
213
|
+
const id = Date.now() * 1000 + Math.floor(Math.random() * 1000);
|
|
214
|
+
const toast = {
|
|
215
|
+
id,
|
|
216
|
+
title: 'Procesando...',
|
|
217
|
+
message,
|
|
218
|
+
type: 'loading',
|
|
219
|
+
subtitle,
|
|
220
|
+
progress: 0,
|
|
221
|
+
autoClose: false
|
|
222
|
+
};
|
|
223
|
+
this.toasts.update(prev => [...prev, toast]);
|
|
224
|
+
return id;
|
|
225
|
+
}
|
|
226
|
+
updateProgress(id, progress, title = 'Reporte listo', message = 'Carga exitosa') {
|
|
227
|
+
this.toasts.update(prev => prev.map(t => t.id === id ? { ...t, progress, title, message } : t));
|
|
228
|
+
}
|
|
212
229
|
remove(id) {
|
|
213
230
|
this.toasts.update(prev => prev.filter(t => t.id !== id));
|
|
214
231
|
}
|
|
@@ -378,7 +395,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
378
395
|
class ToasterComponent {
|
|
379
396
|
toastService = inject(ToastService);
|
|
380
397
|
toasts = this.toastService.toasts;
|
|
381
|
-
isWebPush = input(false);
|
|
382
398
|
iconType = {
|
|
383
399
|
'success': 'fas fa-check bg-success',
|
|
384
400
|
'error': 'fas fa-times bg-danger',
|
|
@@ -398,7 +414,7 @@ class ToasterComponent {
|
|
|
398
414
|
this.toastService.remove(id);
|
|
399
415
|
}
|
|
400
416
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ToasterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
401
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ToasterComponent, isStandalone: true, selector: "app-toaster",
|
|
417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ToasterComponent, isStandalone: true, selector: "app-toaster", ngImport: i0, template: "<div class=\"toastr-container\">\r\n @for (toast of toastNormal; track toast.id) {\r\n\r\n <div class=\"toast {{toast.type}} bg-white\" [@toastAnimation]>\r\n\r\n @if (toast.type == 'loading') {\r\n\r\n <div class=\"toast-icon\">\r\n @if (toast.progress < 100) {\r\n <div class=\"spinner\"></div>\r\n }@else {\r\n <i class=\"fas fa-check checkmark\"></i>\r\n }\r\n \r\n </div>\r\n <div class=\"toast-content\">\r\n <h4 class=\"toast-title text-dark\">{{ toast.title }}</h4>\r\n <p class=\"toast-message text-dark\">{{ toast.message }}</p>\r\n </div>\r\n }@else {\r\n <div class=\"toast-icon\">\r\n <i class=\"{{iconType[toast.type]}}\"></i>\r\n </div>\r\n <div class=\"toast-content\">\r\n <h4 class=\"toast-title\">{{ toast.title }}</h4>\r\n <p class=\"toast-message\">{{ toast.message }}</p>\r\n </div>\r\n <button class=\"toast-close\" (click)=\"removeToast(toast.id)\">\u00D7</button>\r\n <div class=\"toast-loader\"></div>\r\n }\r\n\r\n\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"toastr-webpush shadow\">\r\n @for (toast of toastWebPush; track toast.id) {\r\n <div class=\"toast-webpush {{toast.type}}\" [@toastAnimation]>\r\n <div class=\"toast-icon\">\r\n <img src=\"https://testing.grupotsiperu.com.pe:8844/assets/images/logo-tsi-tres.png\" alt=\"\">\r\n </div>\r\n <div class=\"toast-content-webpush\">\r\n <h4 class=\"toast-title\">{{ toast.title }}</h4>\r\n <p class=\"toast-message-webpush\">{{ toast.message }}</p>\r\n <p class=\"toast-subtitle\">{{ toast.subtitle }}</p>\r\n </div>\r\n <button class=\"toast-close-webpush\" (click)=\"removeToast(toast.id)\">\u00D7</button>\r\n <div class=\"toast-loader-webpush\"></div>\r\n </div>\r\n }\r\n</div>", styles: ["@charset \"UTF-8\";.toastr-container{position:fixed;top:10px;right:10px;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;cursor:pointer}.toast{display:flex;align-items:center;width:350px;min-height:35px;border-radius:4px;margin-bottom:10px;overflow:hidden;position:relative;font-family:Poppins,sans-serif}.toast-icon i{display:flex;align-items:center;justify-content:center;width:25px!important;height:25px!important;padding:12px;margin-left:10px;border-radius:100%;color:#fff;animation:iconPopIn 1.5s ease-in-out infinite;transform-origin:center}.toast-content{flex-grow:1;padding:12px 8px 1px}.toast-title{font-weight:600;margin-bottom:3px;font-size:13px}.toast-message{font-size:13px;padding:0 8px}.toast-close{position:absolute;top:5px;right:10px;background:none;border:none;font-weight:600;font-size:22px!important;cursor:pointer;padding:0;color:inherit;opacity:.7;transition:opacity .2s ease-in-out}.toast-close:hover{opacity:1}.success{background-color:#00c68e;color:#fff}.error{background-color:#bd362f;color:#fff}.info{background-color:#398bf7;color:#fff}.warning{background-color:#ffa908;color:#fff}.success .toast-loader{background-color:#00a879}.error .toast-loader{background-color:#ffe4e3}.info .toast-loader{background-color:#2796b4}.warning .toast-loader{background-color:#eeeeeee8}.toast-loader{position:absolute;bottom:0;left:0;height:4px;animation:loader 3s linear}@keyframes loader{0%{width:100%}to{width:0%}}.toast-loader-webpush{position:absolute;bottom:0;left:0;height:4px;animation:loader 10s linear}.webpush .toast-loader-webpush{background-color:#c6c6c6}.webpush{background-color:#f8f8f8;color:#000}.toastr-webpush{position:fixed;bottom:10px!important;right:10px;z-index:1000;display:flex;flex-direction:column;align-items:flex-end;cursor:pointer}.toast-webpush{display:flex;align-items:center;width:350px;min-height:120px;border-radius:4px;margin-bottom:0;overflow:hidden;position:relative;font-family:Poppins,sans-serif}.toast-icon img{display:flex;align-items:center;justify-content:center;width:80px!important;height:80px!important;padding:12px;margin-left:10px;border-radius:100%}.toast-content-webpush{flex-grow:1;padding:5px 8px 1px}.toast-message-webpush{font-size:11px;color:gray;margin-bottom:8px;padding-bottom:0}.toast-subtitle{font-size:10px;color:#a0a0a0;padding:0;margin:0}.toast-close-webpush{position:absolute;top:5px;right:10px;background:none;border:none;font-weight:600;font-size:22px!important;cursor:pointer;padding:0;color:inherit;opacity:.3;transition:opacity .2s ease-in-out}.toast-close-webpush:hover{opacity:1}@media (max-width: 400px){.toast,.toast-webpush{width:100%}.toastr-container,.toastr-webpush{left:10px;right:25px}}@keyframes iconPopIn{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.9}to{transform:scale(1);opacity:1}}.spinner{width:24px;height:24px;border:3px solid #ccc;border-top:3px solid #333;border-radius:50%;animation:spin 1s linear infinite;margin-right:10px;margin-left:10px;display:inline-block;vertical-align:middle}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.checkmark{width:24px;height:24px;color:green!important;border-radius:100%;border:1px solid green;font-weight:700;margin-right:10px;margin-left:10px;display:inline-block;vertical-align:middle}\n"], animations: [
|
|
402
418
|
trigger('toastAnimation', [
|
|
403
419
|
transition(':enter', [
|
|
404
420
|
style({ transform: 'translateY(100%)', opacity: 0 }),
|
|
@@ -422,7 +438,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
422
438
|
animate('300ms ease-in', style({ transform: 'translateY(100%)', opacity: 0 }))
|
|
423
439
|
])
|
|
424
440
|
])
|
|
425
|
-
], template: "<div class=\"toastr-container\">\r\n @for (toast of toastNormal; track toast.id) {\r\n <div class=\"toast {{toast.type}}\" [@toastAnimation]>\r\n <div class=\"toast-icon\">\r\n <i class=\"{{iconType[toast.type]}}\"></i>\r\n </div>\r\n <div class=\"toast-content\">\r\n <h4 class=\"toast-title\">{{ toast.title }}</h4>\r\n <p class=\"toast-message\">{{ toast.message }}</p>\r\n </div>\r\n <button class=\"toast-close\" (click)=\"removeToast(toast.id)\">\u00D7</button>\r\n <div class=\"toast-loader\"></div>\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"toastr-webpush shadow\">\r\n @for (toast of toastWebPush; track toast.id) {\r\n <div class=\"toast-webpush {{toast.type}}\" [@toastAnimation]>\r\n <div class=\"toast-icon\">\r\n <img src=\"https://testing.grupotsiperu.com.pe:8844/assets/images/logo-tsi-tres.png\" alt=\"\">\r\n </div>\r\n <div class=\"toast-content-webpush\">\r\n <h4 class=\"toast-title\">{{ toast.title }}</h4>\r\n <p class=\"toast-message-webpush\">{{ toast.message }}</p>\r\n <p class=\"toast-subtitle\">{{ toast.subtitle }}</p>\r\n </div>\r\n <button class=\"toast-close-webpush\" (click)=\"removeToast(toast.id)\">\u00D7</button>\r\n <div class=\"toast-loader-webpush\"></div>\r\n </div>\r\n }\r\n</div>", styles: ["
|
|
441
|
+
], template: "<div class=\"toastr-container\">\r\n @for (toast of toastNormal; track toast.id) {\r\n\r\n <div class=\"toast {{toast.type}} bg-white\" [@toastAnimation]>\r\n\r\n @if (toast.type == 'loading') {\r\n\r\n <div class=\"toast-icon\">\r\n @if (toast.progress < 100) {\r\n <div class=\"spinner\"></div>\r\n }@else {\r\n <i class=\"fas fa-check checkmark\"></i>\r\n }\r\n \r\n </div>\r\n <div class=\"toast-content\">\r\n <h4 class=\"toast-title text-dark\">{{ toast.title }}</h4>\r\n <p class=\"toast-message text-dark\">{{ toast.message }}</p>\r\n </div>\r\n }@else {\r\n <div class=\"toast-icon\">\r\n <i class=\"{{iconType[toast.type]}}\"></i>\r\n </div>\r\n <div class=\"toast-content\">\r\n <h4 class=\"toast-title\">{{ toast.title }}</h4>\r\n <p class=\"toast-message\">{{ toast.message }}</p>\r\n </div>\r\n <button class=\"toast-close\" (click)=\"removeToast(toast.id)\">\u00D7</button>\r\n <div class=\"toast-loader\"></div>\r\n }\r\n\r\n\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"toastr-webpush shadow\">\r\n @for (toast of toastWebPush; track toast.id) {\r\n <div class=\"toast-webpush {{toast.type}}\" [@toastAnimation]>\r\n <div class=\"toast-icon\">\r\n <img src=\"https://testing.grupotsiperu.com.pe:8844/assets/images/logo-tsi-tres.png\" alt=\"\">\r\n </div>\r\n <div class=\"toast-content-webpush\">\r\n <h4 class=\"toast-title\">{{ toast.title }}</h4>\r\n <p class=\"toast-message-webpush\">{{ toast.message }}</p>\r\n <p class=\"toast-subtitle\">{{ toast.subtitle }}</p>\r\n </div>\r\n <button class=\"toast-close-webpush\" (click)=\"removeToast(toast.id)\">\u00D7</button>\r\n <div class=\"toast-loader-webpush\"></div>\r\n </div>\r\n }\r\n</div>", styles: ["@charset \"UTF-8\";.toastr-container{position:fixed;top:10px;right:10px;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;cursor:pointer}.toast{display:flex;align-items:center;width:350px;min-height:35px;border-radius:4px;margin-bottom:10px;overflow:hidden;position:relative;font-family:Poppins,sans-serif}.toast-icon i{display:flex;align-items:center;justify-content:center;width:25px!important;height:25px!important;padding:12px;margin-left:10px;border-radius:100%;color:#fff;animation:iconPopIn 1.5s ease-in-out infinite;transform-origin:center}.toast-content{flex-grow:1;padding:12px 8px 1px}.toast-title{font-weight:600;margin-bottom:3px;font-size:13px}.toast-message{font-size:13px;padding:0 8px}.toast-close{position:absolute;top:5px;right:10px;background:none;border:none;font-weight:600;font-size:22px!important;cursor:pointer;padding:0;color:inherit;opacity:.7;transition:opacity .2s ease-in-out}.toast-close:hover{opacity:1}.success{background-color:#00c68e;color:#fff}.error{background-color:#bd362f;color:#fff}.info{background-color:#398bf7;color:#fff}.warning{background-color:#ffa908;color:#fff}.success .toast-loader{background-color:#00a879}.error .toast-loader{background-color:#ffe4e3}.info .toast-loader{background-color:#2796b4}.warning .toast-loader{background-color:#eeeeeee8}.toast-loader{position:absolute;bottom:0;left:0;height:4px;animation:loader 3s linear}@keyframes loader{0%{width:100%}to{width:0%}}.toast-loader-webpush{position:absolute;bottom:0;left:0;height:4px;animation:loader 10s linear}.webpush .toast-loader-webpush{background-color:#c6c6c6}.webpush{background-color:#f8f8f8;color:#000}.toastr-webpush{position:fixed;bottom:10px!important;right:10px;z-index:1000;display:flex;flex-direction:column;align-items:flex-end;cursor:pointer}.toast-webpush{display:flex;align-items:center;width:350px;min-height:120px;border-radius:4px;margin-bottom:0;overflow:hidden;position:relative;font-family:Poppins,sans-serif}.toast-icon img{display:flex;align-items:center;justify-content:center;width:80px!important;height:80px!important;padding:12px;margin-left:10px;border-radius:100%}.toast-content-webpush{flex-grow:1;padding:5px 8px 1px}.toast-message-webpush{font-size:11px;color:gray;margin-bottom:8px;padding-bottom:0}.toast-subtitle{font-size:10px;color:#a0a0a0;padding:0;margin:0}.toast-close-webpush{position:absolute;top:5px;right:10px;background:none;border:none;font-weight:600;font-size:22px!important;cursor:pointer;padding:0;color:inherit;opacity:.3;transition:opacity .2s ease-in-out}.toast-close-webpush:hover{opacity:1}@media (max-width: 400px){.toast,.toast-webpush{width:100%}.toastr-container,.toastr-webpush{left:10px;right:25px}}@keyframes iconPopIn{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.9}to{transform:scale(1);opacity:1}}.spinner{width:24px;height:24px;border:3px solid #ccc;border-top:3px solid #333;border-radius:50%;animation:spin 1s linear infinite;margin-right:10px;margin-left:10px;display:inline-block;vertical-align:middle}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.checkmark{width:24px;height:24px;color:green!important;border-radius:100%;border:1px solid green;font-weight:700;margin-right:10px;margin-left:10px;display:inline-block;vertical-align:middle}\n"] }]
|
|
426
442
|
}] });
|
|
427
443
|
|
|
428
444
|
class DropdownCdkComponent {
|
|
@@ -2328,7 +2344,7 @@ class TableAdvanceOptimizadaComponent {
|
|
|
2328
2344
|
this.sortColumn = column;
|
|
2329
2345
|
this.sortDirection = 'asc';
|
|
2330
2346
|
}
|
|
2331
|
-
this.
|
|
2347
|
+
this.dataVirtual().sort((a, b) => {
|
|
2332
2348
|
const valueA = a[column] ?? '';
|
|
2333
2349
|
const valueB = b[column] ?? '';
|
|
2334
2350
|
if (typeof valueA == 'number' && typeof valueB == 'number') {
|
|
@@ -3956,6 +3972,14 @@ function getInputsObligatorios(data) {
|
|
|
3956
3972
|
function handleErrorsApi(err, alert) {
|
|
3957
3973
|
alert.mostrarModalError(err.error);
|
|
3958
3974
|
}
|
|
3975
|
+
function throwIfEmptyArray() {
|
|
3976
|
+
return switchMap((res) => {
|
|
3977
|
+
if (!res || res.length == 0) {
|
|
3978
|
+
return throwError(() => new Error('NO_RESULTS'));
|
|
3979
|
+
}
|
|
3980
|
+
return of(res);
|
|
3981
|
+
});
|
|
3982
|
+
}
|
|
3959
3983
|
function handleEmptyResult(data, withFiltro, toast, message = 'No se encontraron resultados') {
|
|
3960
3984
|
withFiltro.set(true);
|
|
3961
3985
|
data.set([]);
|
|
@@ -3984,7 +4008,7 @@ function handleReset(reset, page, sender) {
|
|
|
3984
4008
|
function handleResetNoSignal(reset, page, sender) {
|
|
3985
4009
|
if (reset) {
|
|
3986
4010
|
page.set(1);
|
|
3987
|
-
sender =
|
|
4011
|
+
sender.offset = 0;
|
|
3988
4012
|
}
|
|
3989
4013
|
}
|
|
3990
4014
|
|
|
@@ -3997,5 +4021,5 @@ function handleResetNoSignal(reset, page, sender) {
|
|
|
3997
4021
|
* Generated bundle index. Do not edit.
|
|
3998
4022
|
*/
|
|
3999
4023
|
|
|
4000
|
-
export { AlertConfirmationComponent, AlertConfirmationConfig, AlertConfirmationService, AlertErrorComponent, AlertErrorService, AlertService, AlertaComponent, Almacenes, AutocompleteComponent, AutocompleteV2Component, BadgeComponent, ButtonComponent, ButtonProperties, CardMobileComponent, CheckBoxComponent, Cobradores, DetalleCreditoComponent, DetalleDocumentosCab, Direcciones, DobleInputComponent, DropdownCdkComponent, DropdownComponent, DropdownMenuComponent, DropdownOption, FormateadorService, HeaderComponent, InputClaseComponent, InputComponent, InputDinamicoComponent, InputRadioComponent, ListOptionComponent, ListSituacionesComponent, MaterialesCotizacion, MdGenericoComponent, Monedas, MontosCalcularComponent, Motivos, MultiSelectDropdownComponent, MultiselectedComponent, NavTabsComponent, PaginadorComponent, RadioComponent, Recursos, Series, SidebarComponent, SpinnerComponent, SwitchComponent, TBanco, TabItemComponent, TableAdvanceComponent, TableAdvanceOptimizadaComponent, TableBusquedaComponent, TableData, TableDetalleComponent, TableSimpleComponent, TipoDocumento, ToastService, ToasterComponent, Transportista, Vendedor, getInputsObligatorios, handleEmptyResult, handleErrorsApi, handleReset, handleResetNoSignal, handleSuccessApi, handleSuccessResult, validaFecha, validaLista, validaPeriodo, validaPosicion, validaTipo, validarSituacion };
|
|
4024
|
+
export { AlertConfirmationComponent, AlertConfirmationConfig, AlertConfirmationService, AlertErrorComponent, AlertErrorService, AlertService, AlertaComponent, Almacenes, AutocompleteComponent, AutocompleteV2Component, BadgeComponent, ButtonComponent, ButtonProperties, CardMobileComponent, CheckBoxComponent, Cobradores, DetalleCreditoComponent, DetalleDocumentosCab, Direcciones, DobleInputComponent, DropdownCdkComponent, DropdownComponent, DropdownMenuComponent, DropdownOption, FormateadorService, HeaderComponent, InputClaseComponent, InputComponent, InputDinamicoComponent, InputRadioComponent, ListOptionComponent, ListSituacionesComponent, MaterialesCotizacion, MdGenericoComponent, Monedas, MontosCalcularComponent, Motivos, MultiSelectDropdownComponent, MultiselectedComponent, NavTabsComponent, PaginadorComponent, RadioComponent, Recursos, Series, SidebarComponent, SpinnerComponent, SwitchComponent, TBanco, TabItemComponent, TableAdvanceComponent, TableAdvanceOptimizadaComponent, TableBusquedaComponent, TableData, TableDetalleComponent, TableSimpleComponent, TipoDocumento, ToastService, ToasterComponent, Transportista, Vendedor, getInputsObligatorios, handleEmptyResult, handleErrorsApi, handleReset, handleResetNoSignal, handleSuccessApi, handleSuccessResult, throwIfEmptyArray, validaFecha, validaLista, validaPeriodo, validaPosicion, validaTipo, validarSituacion };
|
|
4001
4025
|
//# sourceMappingURL=ng-components-tsi.mjs.map
|