@jvsoft/components 0.0.2
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/README.md +63 -0
- package/dialog-flotante/dialog-flotante.component.d.ts +32 -0
- package/dialog-flotante/dialog-flotante.interface.d.ts +11 -0
- package/dialog-flotante/index.d.ts +5 -0
- package/dialog-flotante/public-api.d.ts +1 -0
- package/fesm2022/jvsoft-components-dialog-flotante.mjs +119 -0
- package/fesm2022/jvsoft-components-dialog-flotante.mjs.map +1 -0
- package/fesm2022/jvsoft-components-luces-navidad.mjs +33 -0
- package/fesm2022/jvsoft-components-luces-navidad.mjs.map +1 -0
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs +47 -0
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs.map +1 -0
- package/fesm2022/jvsoft-components-progress-spinner.mjs +78 -0
- package/fesm2022/jvsoft-components-progress-spinner.mjs.map +1 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs +89 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map +1 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +1481 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +1 -0
- package/fesm2022/jvsoft-components.mjs +1714 -0
- package/fesm2022/jvsoft-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/luces-navidad/index.d.ts +5 -0
- package/luces-navidad/luces-navidad.component.d.ts +11 -0
- package/luces-navidad/public-api.d.ts +1 -0
- package/mat-suffix-search-button/index.d.ts +5 -0
- package/mat-suffix-search-button/mat-suffix-search-button.component.d.ts +12 -0
- package/mat-suffix-search-button/public-api.d.ts +1 -0
- package/package.json +53 -0
- package/progress-spinner/index.d.ts +5 -0
- package/progress-spinner/progress-spinner.component.d.ts +9 -0
- package/progress-spinner/progress-spinner.service.d.ts +25 -0
- package/progress-spinner/public-api.d.ts +2 -0
- package/src/styles.scss +3 -0
- package/tabla-mantenimiento/classes/data-model.d.ts +25 -0
- package/tabla-mantenimiento/components/progress-bar/index.d.ts +5 -0
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.d.ts +30 -0
- package/tabla-mantenimiento/components/progress-bar/public-api.d.ts +1 -0
- package/tabla-mantenimiento/index.d.ts +5 -0
- package/tabla-mantenimiento/interfaces/global/boton-mantenimiento.d.ts +41 -0
- package/tabla-mantenimiento/interfaces/global/columnas-tabla.d.ts +108 -0
- package/tabla-mantenimiento/interfaces/global/index.d.ts +3 -0
- package/tabla-mantenimiento/interfaces/global/otros.d.ts +26 -0
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.d.ts +19 -0
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.d.ts +10 -0
- package/tabla-mantenimiento/pipes/zero-fill.pipe.d.ts +8 -0
- package/tabla-mantenimiento/public-api.d.ts +3 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.d.ts +26 -0
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.d.ts +18 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.d.ts +143 -0
- package/tabla-mantenimiento/tabla-mantenimiento.functions.d.ts +5 -0
- package/tabla-mantenimiento/tabla-mantenimiento.service.d.ts +8 -0
- package/tabla-mantenimiento/table-util.d.ts +11 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component } from '@angular/core';
|
|
3
|
+
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
4
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
|
+
import { BehaviorSubject } from 'rxjs';
|
|
6
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
7
|
+
|
|
8
|
+
class ProgressSpinnerService {
|
|
9
|
+
overlay;
|
|
10
|
+
overlayRef = this.createOverlay();
|
|
11
|
+
_mensaje = new BehaviorSubject('');
|
|
12
|
+
mensaje$ = this._mensaje.asObservable();
|
|
13
|
+
_config = new BehaviorSubject({});
|
|
14
|
+
config$ = this._config.asObservable();
|
|
15
|
+
overlayActivo = false;
|
|
16
|
+
get configActual() {
|
|
17
|
+
return this._config.getValue();
|
|
18
|
+
}
|
|
19
|
+
set configActual(data) {
|
|
20
|
+
this._config.next(data);
|
|
21
|
+
}
|
|
22
|
+
constructor(overlay) {
|
|
23
|
+
this.overlay = overlay;
|
|
24
|
+
}
|
|
25
|
+
createOverlay() {
|
|
26
|
+
return this.overlay.create({
|
|
27
|
+
hasBackdrop: true,
|
|
28
|
+
positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically()
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
show(config) {
|
|
32
|
+
this.configActual = config ?? {};
|
|
33
|
+
if (!this.overlayActivo) {
|
|
34
|
+
this.overlayRef.attach(new ComponentPortal(ProgressSpinnerComponent));
|
|
35
|
+
this.overlayActivo = true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
hide(config, timeout = 1) {
|
|
39
|
+
this.configActual = config ?? {};
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
this.overlayRef.detach();
|
|
42
|
+
this.overlayActivo = false;
|
|
43
|
+
}, timeout * 1000); // Ajusta según sea necesario
|
|
44
|
+
}
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressSpinnerService, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
46
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressSpinnerService, providedIn: 'root' });
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressSpinnerService, decorators: [{
|
|
49
|
+
type: Injectable,
|
|
50
|
+
args: [{
|
|
51
|
+
providedIn: 'root'
|
|
52
|
+
}]
|
|
53
|
+
}], ctorParameters: () => [{ type: i1.Overlay }] });
|
|
54
|
+
|
|
55
|
+
class ProgressSpinnerComponent {
|
|
56
|
+
progresSpinnerService;
|
|
57
|
+
get configProgressSpiiner() {
|
|
58
|
+
return this.progresSpinnerService._config.getValue();
|
|
59
|
+
}
|
|
60
|
+
constructor(progresSpinnerService) {
|
|
61
|
+
this.progresSpinnerService = progresSpinnerService;
|
|
62
|
+
}
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressSpinnerComponent, deps: [{ token: ProgressSpinnerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.7", type: ProgressSpinnerComponent, isStandalone: true, selector: "jvs-progress-spinner", ngImport: i0, template: "<div class=\"overlay\" [style]=\"'background-color: ' + configProgressSpiiner?.fondoStyle\">\n <div class=\"flex flex-col justify-center items-center gap-2\">\n <mat-spinner diameter=\"40\"></mat-spinner>\n <div class=\"w-full\">{{ configProgressSpiiner?.mensaje }}</div>\n </div>\n\n</div>\n", styles: ["@tailwind base;@tailwind components;@tailwind utilities;:host .overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffffb3;display:flex;justify-content:center;align-items:center;z-index:1000}\n"], dependencies: [{ kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressSpinnerComponent, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{ selector: 'jvs-progress-spinner', imports: [
|
|
69
|
+
MatProgressSpinner
|
|
70
|
+
], template: "<div class=\"overlay\" [style]=\"'background-color: ' + configProgressSpiiner?.fondoStyle\">\n <div class=\"flex flex-col justify-center items-center gap-2\">\n <mat-spinner diameter=\"40\"></mat-spinner>\n <div class=\"w-full\">{{ configProgressSpiiner?.mensaje }}</div>\n </div>\n\n</div>\n", styles: ["@tailwind base;@tailwind components;@tailwind utilities;:host .overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffffb3;display:flex;justify-content:center;align-items:center;z-index:1000}\n"] }]
|
|
71
|
+
}], ctorParameters: () => [{ type: ProgressSpinnerService }] });
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Generated bundle index. Do not edit.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
export { ProgressSpinnerComponent, ProgressSpinnerService };
|
|
78
|
+
//# sourceMappingURL=jvsoft-components-progress-spinner.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jvsoft-components-progress-spinner.mjs","sources":["../../../projects/components/progress-spinner/progress-spinner.service.ts","../../../projects/components/progress-spinner/progress-spinner.component.ts","../../../projects/components/progress-spinner/progress-spinner.component.html","../../../projects/components/progress-spinner/jvsoft-components-progress-spinner.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {Overlay, OverlayRef} from '@angular/cdk/overlay';\nimport {ComponentPortal} from '@angular/cdk/portal';\nimport {BehaviorSubject} from 'rxjs';\nimport {ProgressSpinnerComponent} from './progress-spinner.component';\n\nexport interface ProgressSpinnerConfig {\n fondoStyle?: string;\n mensaje?: string;\n icono?: string;\n}\n@Injectable({\n providedIn: 'root'\n})\nexport class ProgressSpinnerService {\n private overlayRef: OverlayRef = this.createOverlay();\n _mensaje = new BehaviorSubject('');\n mensaje$ = this._mensaje.asObservable();\n _config = new BehaviorSubject({});\n config$ = this._config.asObservable();\n\n overlayActivo = false;\n\n\n get configActual(): ProgressSpinnerConfig {\n return this._config.getValue();\n }\n set configActual(data: ProgressSpinnerConfig) {\n this._config.next(data);\n }\n\n constructor(private overlay: Overlay) { }\n\n private createOverlay(): OverlayRef {\n return this.overlay.create({\n hasBackdrop: true,\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically()\n });\n }\n\n show(config?: ProgressSpinnerConfig): void {\n this.configActual = config ?? {};\n if (!this.overlayActivo){\n this.overlayRef.attach(new ComponentPortal(ProgressSpinnerComponent));\n this.overlayActivo = true;\n }\n }\n\n hide(config?: ProgressSpinnerConfig, timeout: number = 1): void {\n this.configActual = config ?? {};\n setTimeout(() => {\n this.overlayRef.detach();\n this.overlayActivo = false;\n }, timeout * 1000); // Ajusta según sea necesario\n\n }\n}\n","import {Component} from '@angular/core';\nimport {ProgressSpinnerConfig, ProgressSpinnerService} from './progress-spinner.service';\nimport {MatProgressSpinner} from '@angular/material/progress-spinner';\n\n@Component({\n selector: 'jvs-progress-spinner',\n templateUrl: './progress-spinner.component.html',\n styleUrls: ['./progress-spinner.component.scss'],\n imports: [\n MatProgressSpinner\n ]\n})\nexport class ProgressSpinnerComponent {\n get configProgressSpiiner(): ProgressSpinnerConfig {\n return this.progresSpinnerService._config.getValue();\n }\n constructor(\n public progresSpinnerService: ProgressSpinnerService,\n ) {\n }\n}\n","<div class=\"overlay\" [style]=\"'background-color: ' + configProgressSpiiner?.fondoStyle\">\n <div class=\"flex flex-col justify-center items-center gap-2\">\n <mat-spinner diameter=\"40\"></mat-spinner>\n <div class=\"w-full\">{{ configProgressSpiiner?.mensaje }}</div>\n </div>\n\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ProgressSpinnerService"],"mappings":";;;;;;;MAca,sBAAsB,CAAA;AAiBX,IAAA,OAAA;AAhBZ,IAAA,UAAU,GAAe,IAAI,CAAC,aAAa,EAAE;AACrD,IAAA,QAAQ,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC;AAClC,IAAA,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;AACvC,IAAA,OAAO,GAAG,IAAI,eAAe,CAAC,EAAE,CA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AGvB,OAAA,EAAA;wBACL;AACH,qBAAA,EAAA,QAAA,EAAA,0TAAA,EAAA,MAAA,EAAA,CAAA,gOAAA,CAAA,EAAA;;;AEVL;;AAEG;;;;"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule, DecimalPipe } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
class ProgressBarComponent {
|
|
7
|
+
objThis;
|
|
8
|
+
porcentaje = 0;
|
|
9
|
+
textoCentrado = false;
|
|
10
|
+
_textoMostrar = '';
|
|
11
|
+
get textoMostrar() { return this._textoMostrar; }
|
|
12
|
+
set textoMostrar(val) { this._textoMostrar = val; }
|
|
13
|
+
_formatoNumero = '';
|
|
14
|
+
get formatoNumero() { return this._formatoNumero; }
|
|
15
|
+
set formatoNumero(val) { this._formatoNumero = val ?? '1.0-0'; }
|
|
16
|
+
_coloresValor = [];
|
|
17
|
+
get coloresValor() { return this._coloresValor; }
|
|
18
|
+
set coloresValor(val) {
|
|
19
|
+
if (!val || !Array.isArray(val)) {
|
|
20
|
+
this._coloresValor = [
|
|
21
|
+
{ valorMaximo: 1, class: 'p-0' },
|
|
22
|
+
{ valorMaximo: 40, class: 'bg-red-400 text-red-900' },
|
|
23
|
+
// {valorMaximo: 35, class: 'bg-red-600 text-red-100'},
|
|
24
|
+
{ valorMaximo: 80, class: 'bg-yellow-600 text-yellow-100' },
|
|
25
|
+
{ valorMaximo: 100, class: 'bg-green-600 text-green-100' },
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this._coloresValor = val;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
constructor() { }
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
}
|
|
35
|
+
colorEstilo() {
|
|
36
|
+
let estiloFin = null;
|
|
37
|
+
let claseFin = null;
|
|
38
|
+
let encontro = false;
|
|
39
|
+
this.coloresValor = this.ordenarPorPropiedad(this.coloresValor, 'valorMaximo');
|
|
40
|
+
this.coloresValor.forEach(estilo => {
|
|
41
|
+
if (!encontro && (this.porcentaje <= estilo.valorMaximo)) {
|
|
42
|
+
// console.log(this.porcentaje, estilo, (this.porcentaje < estilo.valorMaximo));
|
|
43
|
+
encontro = true;
|
|
44
|
+
estiloFin = estilo.style;
|
|
45
|
+
claseFin = estilo.class;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
style: estiloFin ?? '',
|
|
50
|
+
class: claseFin ?? '',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
ordenarPorPropiedad(objData, propiedad, numeros = false) {
|
|
54
|
+
if (numeros) {
|
|
55
|
+
return objData.sort((a, b) => a[propiedad] - b[propiedad]);
|
|
56
|
+
}
|
|
57
|
+
return objData.sort((a, b) => (a[propiedad] > b[propiedad]) ? 1 : ((b[propiedad] > a[propiedad]) ? -1 : 0));
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.7", type: ProgressBarComponent, isStandalone: true, selector: "jvsoft-progress-bar", inputs: { objThis: "objThis", porcentaje: "porcentaje", textoCentrado: "textoCentrado", textoMostrar: "textoMostrar", formatoNumero: "formatoNumero", coloresValor: "coloresValor" }, ngImport: i0, template: "<div class=\"w-full bg-gray-200 text-gray-700 rounded-full\" [class.text-center]=\"textoCentrado\">\n\t<div class=\"text-xxs font-medium text-center p-1 leading-none rounded-full\"\n\t\t [ngClass]=\"colorEstilo().class ? colorEstilo().class : 'bg-blue-600 text-blue-100'\"\n\t\t [style]=\"colorEstilo().style ? colorEstilo().style : ''\"\n\t\t [style.width]=\"(textoCentrado ? 100 : porcentaje) + '%'\"\n\t>\n <span *ngIf=\"textoMostrar else defaultText;\" class=\"whitespace-nowrap\">{{ textoMostrar }}</span>\n <ng-template #defaultText>{{ porcentaje | number: formatoNumero }}%</ng-template>\n </div>\n</div>\n", styles: ["@tailwind base;@tailwind components;@tailwind utilities;\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }] });
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
63
|
+
type: Component,
|
|
64
|
+
args: [{ selector: 'jvsoft-progress-bar', imports: [
|
|
65
|
+
CommonModule,
|
|
66
|
+
DecimalPipe
|
|
67
|
+
], template: "<div class=\"w-full bg-gray-200 text-gray-700 rounded-full\" [class.text-center]=\"textoCentrado\">\n\t<div class=\"text-xxs font-medium text-center p-1 leading-none rounded-full\"\n\t\t [ngClass]=\"colorEstilo().class ? colorEstilo().class : 'bg-blue-600 text-blue-100'\"\n\t\t [style]=\"colorEstilo().style ? colorEstilo().style : ''\"\n\t\t [style.width]=\"(textoCentrado ? 100 : porcentaje) + '%'\"\n\t>\n <span *ngIf=\"textoMostrar else defaultText;\" class=\"whitespace-nowrap\">{{ textoMostrar }}</span>\n <ng-template #defaultText>{{ porcentaje | number: formatoNumero }}%</ng-template>\n </div>\n</div>\n", styles: ["@tailwind base;@tailwind components;@tailwind utilities;\n"] }]
|
|
68
|
+
}], ctorParameters: () => [], propDecorators: { objThis: [{
|
|
69
|
+
type: Input
|
|
70
|
+
}], porcentaje: [{
|
|
71
|
+
type: Input
|
|
72
|
+
}], textoCentrado: [{
|
|
73
|
+
type: Input
|
|
74
|
+
}], textoMostrar: [{
|
|
75
|
+
type: Input
|
|
76
|
+
}], formatoNumero: [{
|
|
77
|
+
type: Input
|
|
78
|
+
}], coloresValor: [{
|
|
79
|
+
type: Input
|
|
80
|
+
}] } });
|
|
81
|
+
|
|
82
|
+
// export * from './progress-spinner.service';
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Generated bundle index. Do not edit.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export { ProgressBarComponent };
|
|
89
|
+
//# sourceMappingURL=jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs","sources":["../../../projects/components/tabla-mantenimiento/components/progress-bar/progress-bar.component.ts","../../../projects/components/tabla-mantenimiento/components/progress-bar/progress-bar.component.html","../../../projects/components/tabla-mantenimiento/components/progress-bar/public-api.ts","../../../projects/components/tabla-mantenimiento/components/progress-bar/jvsoft-components-tabla-mantenimiento-components-progress-bar.ts"],"sourcesContent":["import {Component, Input, OnInit} from '@angular/core';\nimport {CommonModule, DecimalPipe} from '@angular/common';\n\nexport interface EstilosBarra {\n\tvalorMaximo: number;\n\tclass?: string;\n\tstyle?: string;\n}\n\n@Component({\n selector: 'jvsoft-progress-bar',\n templateUrl: './progress-bar.component.html',\n styleUrls: ['./progress-bar.component.scss'],\n imports: [\n CommonModule,\n DecimalPipe\n ]\n})\nexport class ProgressBarComponent implements OnInit {\n\n\t@Input() objThis: any;\n\t@Input() porcentaje = 0;\n\t@Input() textoCentrado = false;\n\n private _textoMostrar: string = '';\n get textoMostrar(): string { return this._textoMostrar; }\n\t@Input() set textoMostrar(val: string) { this._textoMostrar = val; }\n\n private _formatoNumero: string = '';\n get formatoNumero(): string { return this._formatoNumero; }\n\t@Input() set formatoNumero(val: string) { this._formatoNumero = val ?? '1.0-0'; }\n\n private _coloresValor: EstilosBarra[] = [];\n get coloresValor(): EstilosBarra[] { return this._coloresValor; }\n @Input() set coloresValor(val: EstilosBarra[]) {\n if (!val || !Array.isArray(val)) {\n this._coloresValor = [\n {valorMaximo: 1, class: 'p-0'},\n {valorMaximo: 40, class: 'bg-red-400 text-red-900'},\n // {valorMaximo: 35, class: 'bg-red-600 text-red-100'},\n {valorMaximo: 80, class: 'bg-yellow-600 text-yellow-100'},\n {valorMaximo: 100, class: 'bg-green-600 text-green-100'},\n ];\n }\n else {\n this._coloresValor = val;\n }\n }\n\n\tconstructor() { }\n\n\tngOnInit(): void {\n\t}\n\n\tcolorEstilo(): {style: string, class: string} {\n\t\tlet estiloFin = null;\n\t\tlet claseFin = null;\n\t\tlet encontro = false;\n\n\t\tthis.coloresValor = this.ordenarPorPropiedad(this.coloresValor, 'valorMaximo');\n\n\t\tthis.coloresValor.forEach(estilo => {\n\t\t\tif (!encontro && (this.porcentaje <= estilo.valorMaximo)) {\n\t\t\t\t// console.log(this.porcentaje, estilo, (this.porcentaje < estilo.valorMaximo));\n\t\t\t\tencontro = true;\n\t\t\t\testiloFin = estilo.style;\n\t\t\t\tclaseFin = estilo.class;\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tstyle: estiloFin ?? '',\n\t\t\tclass: claseFin ?? '',\n\t\t};\n\t}\n\n ordenarPorPropiedad(objData: any[], propiedad: string, numeros = false) {\n if (numeros) {\n return objData.sort((a, b) => a[propiedad] - b[propiedad]);\n }\n return objData.sort((a, b) => (a[propiedad] > b[propiedad]) ? 1:((b[propiedad] > a[propiedad]) ? -1:0));\n }\n\n}\n","<div class=\"w-full bg-gray-200 text-gray-700 rounded-full\" [class.text-center]=\"textoCentrado\">\n\t<div class=\"text-xxs font-medium text-center p-1 leading-none rounded-full\"\n\t\t [ngClass]=\"colorEstilo().class ? colorEstilo().class : 'bg-blue-600 text-blue-100'\"\n\t\t [style]=\"colorEstilo().style ? colorEstilo().style : ''\"\n\t\t [style.width]=\"(textoCentrado ? 100 : porcentaje) + '%'\"\n\t>\n <span *ngIf=\"textoMostrar else defaultText;\" class=\"whitespace-nowrap\">{{ textoMostrar }}</span>\n <ng-template #defaultText>{{ porcentaje | number: formatoNumero }}%</ng-template>\n </div>\n</div>\n","export * from './progress-bar.component';\n// export * from './progress-spinner.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAkBa,oBAAoB,CAAA;AAEvB,IAAA,OAAO;IACP,UAAU,GAAG,CAAC;IACd,aAAa,GAAG,KAAK;IAEnB,aAAa,GAAW,EAAE;IAClC,IAAI,YAAY,KAAa,OAAO,IAAI,CAAC,aAAa,CAAC;IAC1D,IAAa,YAAY,CAAC,GAAW,EAAI,EAAA,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC;IAEvD,cAAc,GAAW,EAAE;IACnC,IAAI,aAAa,KAAa,OAAO,IAAI,CAAC,cAAc,CAAC;AAC5D,IAAA,IAAa,aAAa,CAAC,GAAW,EAAA,EAAI,IAAI,CAAC,cAAc,GAAG,GAAG,IAAI,OAAO,CAAC;IAEpE,aAAa,GAAmB,EAAE;IAC1C,IAAI,YAAY,KAAqB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC/D,IAAa,YAAY,CAAC,GAAmB,EAAA;QACzC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG;AACjB,gBAAA,EAAC,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAC;AAC9B,gBAAA,EAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAC;;AAEnD,gBAAA,EAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,+BAA+B,EAAC;AACzD,gBAAA,EAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,6BAA6B,EAAC;aAC3D;;aAEA;AACD,YAAA,IAAI,CAAC,aAAa,GAAG,GAAG;;;AAInC,IAAA,WAAA,GAAA;IAEA,QAAQ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