@jvsoft/components 0.0.10 → 0.0.12
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/CHANGELOG.md +18 -0
- package/build.js +20 -0
- package/dialog-flotante/dialog-flotante.component.html +66 -0
- package/dialog-flotante/dialog-flotante.component.ts +115 -0
- package/dialog-flotante/dialog-flotante.interface.ts +13 -0
- package/dialog-flotante/index.ts +1 -0
- package/dialog-flotante/ng-package.json +5 -0
- package/{index.d.ts → index.ts} +8 -1
- package/lista-arbol/lista-arbol.component.html +66 -0
- package/lista-arbol/lista-arbol.component.ts +238 -0
- package/lista-arbol/lista-arbol.functions.ts +46 -0
- package/lista-arbol/ng-package.json +5 -0
- package/luces-navidad/christmas-tree.png +0 -0
- package/luces-navidad/index.ts +1 -0
- package/luces-navidad/luces-navidad.component.html +6 -0
- package/luces-navidad/luces-navidad.component.ts +24 -0
- package/luces-navidad/ng-package.json +5 -0
- package/mat-suffix-search-button/index.ts +1 -0
- package/mat-suffix-search-button/mat-suffix-search-button.component.html +5 -0
- package/mat-suffix-search-button/mat-suffix-search-button.component.ts +36 -0
- package/mat-suffix-search-button/ng-package.json +5 -0
- package/menu/index.ts +1 -0
- package/menu/menu.component.html +40 -0
- package/menu/menu.component.ts +88 -0
- package/menu/menu.interface.ts +16 -0
- package/menu/ng-package.json +5 -0
- package/ng-package.json +17 -0
- package/package.json +17 -42
- package/progress-spinner.zip +0 -0
- package/tabla-mantenimiento/classes/data-model.ts +150 -0
- package/tabla-mantenimiento/components/progress-bar/index.ts +1 -0
- package/tabla-mantenimiento/components/progress-bar/ng-package.json +5 -0
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.html +10 -0
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.ts +85 -0
- package/tabla-mantenimiento/components/progress-bar/public-api.ts +2 -0
- package/tabla-mantenimiento/index.ts +1 -0
- package/tabla-mantenimiento/interfaces/{archivo.d.ts → archivo.ts} +7 -4
- package/tabla-mantenimiento/interfaces/global/{boton-mantenimiento.d.ts → boton-mantenimiento.ts} +9 -3
- package/tabla-mantenimiento/interfaces/global/{columnas-tabla.d.ts → columnas-tabla.ts} +90 -13
- package/tabla-mantenimiento/interfaces/global/export-excel-servidor.ts +0 -0
- package/tabla-mantenimiento/interfaces/global/no-export.ts +11 -0
- package/tabla-mantenimiento/interfaces/global/{otros.d.ts → otros.ts} +15 -3
- package/tabla-mantenimiento/interfaces/implements/{incluye-tabla-mantenimiento.d.ts → incluye-tabla-mantenimiento.ts} +6 -4
- package/tabla-mantenimiento/interfaces/implements/{index.d.ts → index.ts} +1 -0
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.ts +97 -0
- package/tabla-mantenimiento/ng-package.json +5 -0
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.ts +12 -0
- package/tabla-mantenimiento/pipes/zero-fill.pipe.ts +19 -0
- package/tabla-mantenimiento/{public-api.d.ts → public-api.ts} +3 -2
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.html +22 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.ts +12 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.html +58 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.ts +19 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.html +40 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.ts +17 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.html +25 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.ts +14 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.html +28 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.ts +13 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.html +30 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.ts +38 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.html +97 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.ts +43 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.html +26 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.ts +36 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.module.ts +54 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.html +76 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.ts +67 -0
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.html +7 -0
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.ts +39 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.html +385 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.ts +951 -0
- package/tabla-mantenimiento/tabla-mantenimiento.functions.ts +57 -0
- package/tabla-mantenimiento/tabla-mantenimiento.service.ts +44 -0
- package/tabla-mantenimiento/table-util.ts +49 -0
- package/tabla-mantenimiento.zip +0 -0
- package/tsconfig.lib.json +16 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/yarn-error.log +68 -0
- package/dialog-flotante/dialog-flotante.component.d.ts +0 -32
- package/dialog-flotante/dialog-flotante.interface.d.ts +0 -11
- package/dialog-flotante/index.d.ts +0 -5
- package/fesm2022/jvsoft-components-dialog-flotante.mjs +0 -130
- package/fesm2022/jvsoft-components-dialog-flotante.mjs.map +0 -1
- package/fesm2022/jvsoft-components-lista-arbol.mjs +0 -266
- package/fesm2022/jvsoft-components-lista-arbol.mjs.map +0 -1
- package/fesm2022/jvsoft-components-luces-navidad.mjs +0 -33
- package/fesm2022/jvsoft-components-luces-navidad.mjs.map +0 -1
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs +0 -47
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs.map +0 -1
- package/fesm2022/jvsoft-components-menu.mjs +0 -102
- package/fesm2022/jvsoft-components-menu.mjs.map +0 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs +0 -91
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map +0 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +0 -1801
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +0 -1
- package/fesm2022/jvsoft-components.mjs +0 -2309
- package/fesm2022/jvsoft-components.mjs.map +0 -1
- package/lista-arbol/index.d.ts +0 -5
- package/lista-arbol/lista-arbol.component.d.ts +0 -58
- package/lista-arbol/lista-arbol.functions.d.ts +0 -1
- package/luces-navidad/index.d.ts +0 -5
- package/luces-navidad/luces-navidad.component.d.ts +0 -11
- package/mat-suffix-search-button/index.d.ts +0 -5
- package/mat-suffix-search-button/mat-suffix-search-button.component.d.ts +0 -12
- package/menu/index.d.ts +0 -5
- package/menu/menu.component.d.ts +0 -25
- package/menu/menu.interface.d.ts +0 -16
- package/src/styles/base-jvsoft-components.css +0 -9
- package/tabla-mantenimiento/classes/data-model.d.ts +0 -25
- package/tabla-mantenimiento/components/progress-bar/index.d.ts +0 -5
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.d.ts +0 -30
- package/tabla-mantenimiento/components/progress-bar/public-api.d.ts +0 -1
- package/tabla-mantenimiento/index.d.ts +0 -5
- package/tabla-mantenimiento/interfaces/global/no-export.d.ts +0 -2
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.d.ts +0 -19
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.d.ts +0 -10
- package/tabla-mantenimiento/pipes/zero-fill.pipe.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.d.ts +0 -9
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.d.ts +0 -9
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.d.ts +0 -9
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.d.ts +0 -18
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.module.d.ts +0 -23
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.d.ts +0 -21
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.d.ts +0 -18
- package/tabla-mantenimiento/tabla-mantenimiento.component.d.ts +0 -147
- package/tabla-mantenimiento/tabla-mantenimiento.functions.d.ts +0 -5
- package/tabla-mantenimiento/tabla-mantenimiento.service.d.ts +0 -8
- package/tabla-mantenimiento/table-util.d.ts +0 -11
- /package/dialog-flotante/{public-api.d.ts → public-api.ts} +0 -0
- /package/lista-arbol/{public-api.d.ts → public-api.ts} +0 -0
- /package/luces-navidad/{public-api.d.ts → public-api.ts} +0 -0
- /package/mat-suffix-search-button/{public-api.d.ts → public-api.ts} +0 -0
- /package/menu/{public-api.d.ts → public-api.ts} +0 -0
- /package/tabla-mantenimiento/interfaces/global/{index.d.ts → index.ts} +0 -0
- /package/tabla-mantenimiento/interfaces/{index.d.ts → index.ts} +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Component } from '@angular/core';
|
|
3
|
-
import { MatRipple } from '@angular/material/core';
|
|
4
|
-
import { MatIcon } from '@angular/material/icon';
|
|
5
|
-
|
|
6
|
-
class MatSuffixSearchButtonComponent {
|
|
7
|
-
fControl;
|
|
8
|
-
eventLimpiar = new EventEmitter();
|
|
9
|
-
eventBuscar = new EventEmitter();
|
|
10
|
-
get control() {
|
|
11
|
-
return this.fControl;
|
|
12
|
-
}
|
|
13
|
-
emitirClick() {
|
|
14
|
-
if (this.control.value) {
|
|
15
|
-
this.control.reset();
|
|
16
|
-
this.eventLimpiar.emit(true);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
this.eventBuscar.emit(true);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: MatSuffixSearchButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.7", type: MatSuffixSearchButtonComponent, isStandalone: true, selector: "div[matSuffix][matSuffixSearchButton]", inputs: { fControl: "fControl" }, outputs: { eventLimpiar: "eventLimpiar", eventBuscar: "eventBuscar" }, host: { classAttribute: "flex items-center justify-start" }, ngImport: i0, template: "<button matRipple type=\"button\" class=\"boton-circular-gris\"\n (click)=\"emitirClick(); $event.preventDefault();\"\n>\n <mat-icon [svgIcon]=\"(control.value ? 'roundCancel' : 'roundSearch')\" class=\"icon-xs\"></mat-icon>\n</button>\n", dependencies: [{ kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
24
|
-
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: MatSuffixSearchButtonComponent, decorators: [{
|
|
26
|
-
type: Component,
|
|
27
|
-
args: [{ selector: 'div[matSuffix][matSuffixSearchButton]', imports: [
|
|
28
|
-
MatRipple,
|
|
29
|
-
MatIcon
|
|
30
|
-
], host: {
|
|
31
|
-
class: 'flex items-center justify-start',
|
|
32
|
-
}, template: "<button matRipple type=\"button\" class=\"boton-circular-gris\"\n (click)=\"emitirClick(); $event.preventDefault();\"\n>\n <mat-icon [svgIcon]=\"(control.value ? 'roundCancel' : 'roundSearch')\" class=\"icon-xs\"></mat-icon>\n</button>\n" }]
|
|
33
|
-
}], propDecorators: { fControl: [{
|
|
34
|
-
type: Input,
|
|
35
|
-
args: [{ required: true }]
|
|
36
|
-
}], eventLimpiar: [{
|
|
37
|
-
type: Output
|
|
38
|
-
}], eventBuscar: [{
|
|
39
|
-
type: Output
|
|
40
|
-
}] } });
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Generated bundle index. Do not edit.
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
export { MatSuffixSearchButtonComponent };
|
|
47
|
-
//# sourceMappingURL=jvsoft-components-mat-suffix-search-button.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jvsoft-components-mat-suffix-search-button.mjs","sources":["../../../projects/components/mat-suffix-search-button/mat-suffix-search-button.component.ts","../../../projects/components/mat-suffix-search-button/mat-suffix-search-button.component.html","../../../projects/components/mat-suffix-search-button/jvsoft-components-mat-suffix-search-button.ts"],"sourcesContent":["import {Component, EventEmitter, Input, Output} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MatRipple} from '@angular/material/core';\nimport {MatIcon} from '@angular/material/icon';\n\n@Component({\n selector: 'div[matSuffix][matSuffixSearchButton]',\n imports: [\n MatRipple,\n MatIcon\n ],\n templateUrl: './mat-suffix-search-button.component.html',\n host: {\n class: 'flex items-center justify-start',\n }\n})\nexport class MatSuffixSearchButtonComponent {\n @Input({required: true}) fControl: any;\n @Output() eventLimpiar: EventEmitter<any> = new EventEmitter();\n @Output() eventBuscar: EventEmitter<any> = new EventEmitter();\n\n get control(): FormControl {\n return this.fControl;\n }\n\n emitirClick() {\n if (this.control.value) {\n this.control.reset();\n this.eventLimpiar.emit(true);\n }\n else {\n this.eventBuscar.emit(true);\n }\n }\n\n}\n","<button matRipple type=\"button\" class=\"boton-circular-gris\"\n (click)=\"emitirClick(); $event.preventDefault();\"\n>\n <mat-icon [svgIcon]=\"(control.value ? 'roundCancel' : 'roundSearch')\" class=\"icon-xs\"></mat-icon>\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAgBa,8BAA8B,CAAA;AACd,IAAA,QAAQ;AACvB,IAAA,YAAY,GAAsB,IAAI,YAAY,EAAE;AACpD,IAAA,WAAW,GAAsB,IAAI,YAAY,EAAE;AAE7D,IAAA,IAAI,OAAO,GAAA;QACP,OAAO,IAAI,CAAC,QAAQ;;IAGxB,WAAW,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AACpB,YAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AACpB,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;;aAE3B;AACD,YAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;;;uGAf1B,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,EChB3C,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uCAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,EAAA,YAAA,EAAA,cAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,iCAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,qPAKA,EDGQ,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,SAAS,wPACT,OAAO,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAOF,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAX1C,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uCAAuC,EACxC,OAAA,EAAA;wBACL,SAAS;wBACT;qBACH,EAEK,IAAA,EAAA;AACF,wBAAA,KAAK,EAAE,iCAAiC;AAC3C,qBAAA,EAAA,QAAA,EAAA,qPAAA,EAAA;8BAGwB,QAAQ,EAAA,CAAA;sBAAhC,KAAK;uBAAC,EAAC,QAAQ,EAAE,IAAI,EAAC;gBACb,YAAY,EAAA,CAAA;sBAArB;gBACS,WAAW,EAAA,CAAA;sBAApB;;;AEnBL;;AAEG;;;;"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, ViewChildren, Output, Input, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i2 from '@angular/material/menu';
|
|
6
|
-
import { MatMenuModule, MatMenu } from '@angular/material/menu';
|
|
7
|
-
import * as i3 from '@angular/material/icon';
|
|
8
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
-
import * as i4 from '@angular/material/core';
|
|
10
|
-
import { MatRippleModule } from '@angular/material/core';
|
|
11
|
-
import * as i5 from '@angular/material/tooltip';
|
|
12
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
|
|
14
|
-
class MenuComponent {
|
|
15
|
-
cssBoton;
|
|
16
|
-
title;
|
|
17
|
-
disabled = false;
|
|
18
|
-
itemSeleccion;
|
|
19
|
-
menu = [];
|
|
20
|
-
action = new EventEmitter();
|
|
21
|
-
matmenus;
|
|
22
|
-
menuItems = [];
|
|
23
|
-
yet = false;
|
|
24
|
-
_submenus = []; // 🔥 Tipo explícito como Array de Array de BotonMenu
|
|
25
|
-
get submenus() {
|
|
26
|
-
return this._submenus.filter(() => true); // Mantiene la estructura, aunque no hace filtro real
|
|
27
|
-
}
|
|
28
|
-
ngOnInit() {
|
|
29
|
-
this.createSubmenus(this.menu, 's0', 1);
|
|
30
|
-
this.reindex();
|
|
31
|
-
}
|
|
32
|
-
ngAfterViewInit() {
|
|
33
|
-
// Previene errores de Angular al repintar el menú
|
|
34
|
-
setTimeout(() => {
|
|
35
|
-
this.yet = true;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
onClick(value) {
|
|
39
|
-
this.action.emit(value);
|
|
40
|
-
}
|
|
41
|
-
getMenu(index) {
|
|
42
|
-
return index >= 0 && this.matmenus ? this.matmenus.get(index) ?? null : null;
|
|
43
|
-
}
|
|
44
|
-
reindex() {
|
|
45
|
-
// Asigna el índice del ítem del menú
|
|
46
|
-
this._submenus.forEach((menu) => {
|
|
47
|
-
menu.forEach((item) => {
|
|
48
|
-
if (item.idxOpcionCalc !== -1) {
|
|
49
|
-
item.idxOpcionCalc = this.menuItems.indexOf(item.valorSeleccion ?? '');
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
createSubmenus(menu, prefix, count) {
|
|
55
|
-
this.menuItems.push(prefix);
|
|
56
|
-
this._submenus.push(menu.map((item, index) => ({
|
|
57
|
-
...item,
|
|
58
|
-
valorSeleccion: item.subItems ? `${prefix}${index}` : item.valorSeleccion,
|
|
59
|
-
idxOpcionCalc: item.subItems ? 0 : -1,
|
|
60
|
-
})));
|
|
61
|
-
// Llamada recursiva para crear submenús
|
|
62
|
-
menu.forEach((item, index) => {
|
|
63
|
-
if (item.subItems) {
|
|
64
|
-
this.createSubmenus(item.subItems, `${prefix}${index}`, count + 1);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: MenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.7", type: MenuComponent, isStandalone: true, selector: "jvs-menu", inputs: { cssBoton: "cssBoton", title: "title", disabled: "disabled", itemSeleccion: "itemSeleccion", menu: "menu" }, outputs: { action: "action" }, viewQueries: [{ propertyName: "matmenus", predicate: MatMenu, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"yet\">\n <button matRipple [matMenuTriggerFor]=\"matmenus.first\"\n [disabled]=\"disabled\"\n type=\"button\" [class]=\"cssBoton ?? 'boton-circular boton-circular-red border-0'\"\n (click)=\"$event.preventDefault(); $event.stopImmediatePropagation()\"\n [matTooltip]=\"title\"\n >\n <ng-content></ng-content>\n </button>\n</ng-container>\n\n<!--<pre class=\"text-indigo-900\">{{_submenus | json}}</pre>-->\n<ng-container *ngFor=\"let menu of _submenus\">\n <!--<pre class=\"text-red-700\">{{menu | json}}</pre>-->\n <mat-menu xPosition=\"before\" yPosition=\"below\" class=\"max-w-none\">\n <ng-container *ngFor=\"let item of menu\">\n <!--<pre *ngIf=\"menu$\" class=\"text-orange-700\">{{item | json}}</pre>-->\n <!--<span>{{ [item.label, item.idxOpcionCalc!=-1 , yet , (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion})), [!item.esVisible , (item.esVisible ? item.esVisible({itemMenu: item, archivo: itemSeleccion}) : 'NO HAY')]] | json }}</span>-->\n <button mat-menu-item *ngIf=\"item.idxOpcionCalc!=-1 && yet && (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion}))\"\n class=\"flex items-center justify-items-center uppercase w-full rounded-none px-2 \"\n [matMenuTriggerFor]=\"getMenu(item.idxOpcionCalc)\">\n <mat-icon *ngIf=\"item.icono\"\n class=\"flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs\"\n [svgIcon]=\"item.icono ?? 'fa5sFileSignature'\"\n ></mat-icon>\n <span class=\"grow text-2xs\" [innerHTML]=\"item.label\">{{item.label}}</span>\n </button>\n <button mat-menu-item *ngIf=\"item.idxOpcionCalc==-1 && (!item.esVisible || item.esVisible(item))\" (click)=\"onClick(item.valorSeleccion)\"\n class=\"flex items-center justify-items-center uppercase w-full rounded-none px-2 \"\n >\n <mat-icon *ngIf=\"item.icono\"\n class=\"flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs\"\n [svgIcon]=\"item.icono ?? 'fa5sFileSignature'\"\n ></mat-icon>\n <span class=\"grow text-2xs\" [innerHTML]=\"item.label\">{{item.label}} </span>\n </button>\n\n </ng-container>\n </mat-menu>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
|
|
70
|
-
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: MenuComponent, decorators: [{
|
|
72
|
-
type: Component,
|
|
73
|
-
args: [{ selector: 'jvs-menu', standalone: true, imports: [
|
|
74
|
-
CommonModule,
|
|
75
|
-
MatMenuModule,
|
|
76
|
-
MatIconModule,
|
|
77
|
-
MatRippleModule,
|
|
78
|
-
MatTooltipModule,
|
|
79
|
-
], template: "<ng-container *ngIf=\"yet\">\n <button matRipple [matMenuTriggerFor]=\"matmenus.first\"\n [disabled]=\"disabled\"\n type=\"button\" [class]=\"cssBoton ?? 'boton-circular boton-circular-red border-0'\"\n (click)=\"$event.preventDefault(); $event.stopImmediatePropagation()\"\n [matTooltip]=\"title\"\n >\n <ng-content></ng-content>\n </button>\n</ng-container>\n\n<!--<pre class=\"text-indigo-900\">{{_submenus | json}}</pre>-->\n<ng-container *ngFor=\"let menu of _submenus\">\n <!--<pre class=\"text-red-700\">{{menu | json}}</pre>-->\n <mat-menu xPosition=\"before\" yPosition=\"below\" class=\"max-w-none\">\n <ng-container *ngFor=\"let item of menu\">\n <!--<pre *ngIf=\"menu$\" class=\"text-orange-700\">{{item | json}}</pre>-->\n <!--<span>{{ [item.label, item.idxOpcionCalc!=-1 , yet , (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion})), [!item.esVisible , (item.esVisible ? item.esVisible({itemMenu: item, archivo: itemSeleccion}) : 'NO HAY')]] | json }}</span>-->\n <button mat-menu-item *ngIf=\"item.idxOpcionCalc!=-1 && yet && (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion}))\"\n class=\"flex items-center justify-items-center uppercase w-full rounded-none px-2 \"\n [matMenuTriggerFor]=\"getMenu(item.idxOpcionCalc)\">\n <mat-icon *ngIf=\"item.icono\"\n class=\"flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs\"\n [svgIcon]=\"item.icono ?? 'fa5sFileSignature'\"\n ></mat-icon>\n <span class=\"grow text-2xs\" [innerHTML]=\"item.label\">{{item.label}}</span>\n </button>\n <button mat-menu-item *ngIf=\"item.idxOpcionCalc==-1 && (!item.esVisible || item.esVisible(item))\" (click)=\"onClick(item.valorSeleccion)\"\n class=\"flex items-center justify-items-center uppercase w-full rounded-none px-2 \"\n >\n <mat-icon *ngIf=\"item.icono\"\n class=\"flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs\"\n [svgIcon]=\"item.icono ?? 'fa5sFileSignature'\"\n ></mat-icon>\n <span class=\"grow text-2xs\" [innerHTML]=\"item.label\">{{item.label}} </span>\n </button>\n\n </ng-container>\n </mat-menu>\n</ng-container>\n" }]
|
|
80
|
-
}], propDecorators: { cssBoton: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], title: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], disabled: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], itemSeleccion: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], menu: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], action: [{
|
|
91
|
-
type: Output
|
|
92
|
-
}], matmenus: [{
|
|
93
|
-
type: ViewChildren,
|
|
94
|
-
args: [MatMenu]
|
|
95
|
-
}] } });
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Generated bundle index. Do not edit.
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
export { MenuComponent };
|
|
102
|
-
//# sourceMappingURL=jvsoft-components-menu.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jvsoft-components-menu.mjs","sources":["../../../projects/components/menu/menu.component.ts","../../../projects/components/menu/menu.component.html","../../../projects/components/menu/jvsoft-components-menu.ts"],"sourcesContent":["import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatMenu, MatMenuModule} from '@angular/material/menu';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatRippleModule} from '@angular/material/core';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {BotonMenu} from './menu.interface';\n\n@Component({\n selector: 'jvs-menu',\n standalone: true,\n imports: [\n CommonModule,\n MatMenuModule,\n MatIconModule,\n MatRippleModule,\n MatTooltipModule,\n ],\n templateUrl: './menu.component.html',\n})\nexport class MenuComponent implements OnInit, AfterViewInit {\n @Input() cssBoton?: string;\n @Input() title?: string;\n @Input() disabled: boolean = false;\n @Input() itemSeleccion?: string;\n @Input() menu: BotonMenu[] = [];\n @Output() action: EventEmitter<string> = new EventEmitter<string>();\n\n @ViewChildren(MatMenu) matmenus!: QueryList<MatMenu>;\n\n menuItems: string[] = [];\n yet: boolean = false;\n _submenus: BotonMenu[][] = []; // 🔥 Tipo explícito como Array de Array de BotonMenu\n\n get submenus(): BotonMenu[][] {\n return this._submenus.filter(() => true); // Mantiene la estructura, aunque no hace filtro real\n }\n\n ngOnInit(): void {\n this.createSubmenus(this.menu, 's0', 1);\n this.reindex();\n }\n\n ngAfterViewInit(): void {\n // Previene errores de Angular al repintar el menú\n setTimeout(() => {\n this.yet = true;\n });\n }\n\n onClick(value: string): void {\n this.action.emit(value);\n }\n\n getMenu(index: number): MatMenu | null {\n return index >= 0 && this.matmenus ? this.matmenus.get(index) ?? null:null;\n }\n\n reindex(): void {\n // Asigna el índice del ítem del menú\n this._submenus.forEach((menu: BotonMenu[]) => {\n menu.forEach((item: BotonMenu) => {\n if (item.idxOpcionCalc !== -1) {\n item.idxOpcionCalc = this.menuItems.indexOf(item.valorSeleccion ?? '');\n }\n });\n });\n }\n\n createSubmenus(menu: BotonMenu[], prefix: string, count: number): void {\n this.menuItems.push(prefix);\n\n this._submenus.push(\n menu.map((item, index): BotonMenu => ({\n ...item,\n valorSeleccion: item.subItems ? `${prefix}${index}`:item.valorSeleccion,\n idxOpcionCalc: item.subItems ? 0:-1,\n }))\n );\n\n // Llamada recursiva para crear submenús\n menu.forEach((item, index) => {\n if (item.subItems) {\n this.createSubmenus(item.subItems, `${prefix}${index}`, count + 1);\n }\n });\n }\n}\n","<ng-container *ngIf=\"yet\">\n <button matRipple [matMenuTriggerFor]=\"matmenus.first\"\n [disabled]=\"disabled\"\n type=\"button\" [class]=\"cssBoton ?? 'boton-circular boton-circular-red border-0'\"\n (click)=\"$event.preventDefault(); $event.stopImmediatePropagation()\"\n [matTooltip]=\"title\"\n >\n <ng-content></ng-content>\n </button>\n</ng-container>\n\n<!--<pre class=\"text-indigo-900\">{{_submenus | json}}</pre>-->\n<ng-container *ngFor=\"let menu of _submenus\">\n <!--<pre class=\"text-red-700\">{{menu | json}}</pre>-->\n <mat-menu xPosition=\"before\" yPosition=\"below\" class=\"max-w-none\">\n <ng-container *ngFor=\"let item of menu\">\n <!--<pre *ngIf=\"menu$\" class=\"text-orange-700\">{{item | json}}</pre>-->\n <!--<span>{{ [item.label, item.idxOpcionCalc!=-1 , yet , (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion})), [!item.esVisible , (item.esVisible ? item.esVisible({itemMenu: item, archivo: itemSeleccion}) : 'NO HAY')]] | json }}</span>-->\n <button mat-menu-item *ngIf=\"item.idxOpcionCalc!=-1 && yet && (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion}))\"\n class=\"flex items-center justify-items-center uppercase w-full rounded-none px-2 \"\n [matMenuTriggerFor]=\"getMenu(item.idxOpcionCalc)\">\n <mat-icon *ngIf=\"item.icono\"\n class=\"flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs\"\n [svgIcon]=\"item.icono ?? 'fa5sFileSignature'\"\n ></mat-icon>\n <span class=\"grow text-2xs\" [innerHTML]=\"item.label\">{{item.label}}</span>\n </button>\n <button mat-menu-item *ngIf=\"item.idxOpcionCalc==-1 && (!item.esVisible || item.esVisible(item))\" (click)=\"onClick(item.valorSeleccion)\"\n class=\"flex items-center justify-items-center uppercase w-full rounded-none px-2 \"\n >\n <mat-icon *ngIf=\"item.icono\"\n class=\"flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs\"\n [svgIcon]=\"item.icono ?? 'fa5sFileSignature'\"\n ></mat-icon>\n <span class=\"grow text-2xs\" [innerHTML]=\"item.label\">{{item.label}} </span>\n </button>\n\n </ng-container>\n </mat-menu>\n</ng-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAoBa,aAAa,CAAA;AACb,IAAA,QAAQ;AACR,IAAA,KAAK;IACL,QAAQ,GAAY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,0 @@
|
|
|
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: "jvs-progress-bar", inputs: { objThis: "objThis", porcentaje: "porcentaje", textoCentrado: "textoCentrado", textoMostrar: "textoMostrar", formatoNumero: "formatoNumero", coloresValor: "coloresValor" }, host: { classAttribute: "jvs-progress-bar" }, 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", 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: 'jvs-progress-bar', imports: [
|
|
65
|
-
CommonModule,
|
|
66
|
-
DecimalPipe
|
|
67
|
-
], host: {
|
|
68
|
-
class: 'jvs-progress-bar',
|
|
69
|
-
}, 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" }]
|
|
70
|
-
}], ctorParameters: () => [], propDecorators: { objThis: [{
|
|
71
|
-
type: Input
|
|
72
|
-
}], porcentaje: [{
|
|
73
|
-
type: Input
|
|
74
|
-
}], textoCentrado: [{
|
|
75
|
-
type: Input
|
|
76
|
-
}], textoMostrar: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], formatoNumero: [{
|
|
79
|
-
type: Input
|
|
80
|
-
}], coloresValor: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}] } });
|
|
83
|
-
|
|
84
|
-
// export * from './progress-spinner.service';
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Generated bundle index. Do not edit.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
export { ProgressBarComponent };
|
|
91
|
-
//# sourceMappingURL=jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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: 'jvs-progress-bar',\n templateUrl: './progress-bar.component.html',\n imports: [\n CommonModule,\n DecimalPipe\n ],\n host: {\n class: 'jvs-progress-bar',\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 | undefined) { this._formatoNumero = val ?? '1.0-0'; }\n\n private _coloresValor: EstilosBarra[] = [];\n get coloresValor(): EstilosBarra[] { return this._coloresValor; }\n @Input() set coloresValor(val: EstilosBarra[] | undefined ) {\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","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