ng-components-tsi 0.0.38 → 0.0.39
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 +5063 -0
- package/fesm2022/ng-components-tsi.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/directivas/acciones/atajos.directive.d.ts +8 -0
- package/lib/directivas/animaciones/fade-animation.d.ts +3 -0
- package/lib/directivas/estilos/animated-checkbox.directive.d.ts +9 -0
- package/lib/directivas/estilos/button.constants.d.ts +64 -0
- package/lib/directivas/estilos/buttons-modal.directive.d.ts +11 -0
- package/lib/directivas/estilos/buttons-outline-directive.d.ts +11 -0
- package/lib/directivas/estilos/icons.directive.d.ts +11 -0
- package/lib/directivas/inputs/caracteres-codigo.directive.d.ts +12 -0
- package/lib/directivas/inputs/decimal.directive.d.ts +13 -0
- package/lib/directivas/inputs/only-day.directive.d.ts +8 -0
- package/lib/directivas/inputs/only-number-flex.directive.d.ts +9 -0
- package/lib/directivas/inputs/only-number.directive.d.ts +8 -0
- package/lib/enums/table-events.d.ts +5 -0
- package/lib/modals/general/md-generico/md-generico.component.d.ts +25 -0
- package/lib/models/button-color.model.d.ts +3 -0
- package/{src/lib/models/button-properties.model.ts → lib/models/button-properties.model.d.ts} +7 -8
- package/lib/models/cell-rendered.d.ts +11 -0
- package/lib/models/comercial/documentos-cab-auxiliares.model.d.ts +17 -0
- package/{src/lib/models/dropdownoption.model.ts → lib/models/dropdownoption.model.d.ts} +14 -15
- package/lib/models/general/recursos.model.d.ts +271 -0
- package/lib/models/general/utils.interface.d.ts +57 -0
- package/lib/models/input-config.d.ts +25 -0
- package/{src/lib/models/selected-row.ts → lib/models/selected-row.d.ts} +4 -4
- package/{src/lib/models/table-data.model.ts → lib/models/table-data.model.d.ts} +21 -21
- package/lib/service/alert-confirmation.service.d.ts +26 -0
- package/lib/service/alert-error.service.d.ts +9 -0
- package/lib/service/alert.service.d.ts +33 -0
- package/lib/service/formateador.service.d.ts +10 -0
- package/lib/service/toast.service.d.ts +25 -0
- package/lib/ui/alerts/alert-confirmation/alert-confirmation.component.d.ts +32 -0
- package/lib/ui/alerts/alert-error/alert-error.component.d.ts +9 -0
- package/lib/ui/alerts/alerta/alerta.component.d.ts +12 -0
- package/lib/ui/alerts/badge/badge.component.d.ts +8 -0
- package/lib/ui/alerts/toaster/toaster.component.d.ts +17 -0
- package/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.d.ts +11 -0
- package/lib/ui/dropdown/dropdown-simple/dropdown.component.d.ts +13 -0
- package/lib/ui/forms/button/button.component.d.ts +47 -0
- package/lib/ui/forms/filter-toggle/filter-toggle.component.d.ts +9 -0
- package/lib/ui/forms/header/header.component.d.ts +17 -0
- package/lib/ui/forms/inputs/autocomplete/autocomplete.component.d.ts +43 -0
- package/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.d.ts +48 -0
- package/lib/ui/forms/inputs/check-box/check-box.component.d.ts +14 -0
- package/lib/ui/forms/inputs/doble-input/doble-input.component.d.ts +47 -0
- package/lib/ui/forms/inputs/input/input.component.d.ts +60 -0
- package/lib/ui/forms/inputs/input-clase/input-clase.component.d.ts +13 -0
- package/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.d.ts +8 -0
- package/lib/ui/forms/inputs/input-radio/input-radio.component.d.ts +24 -0
- package/lib/ui/forms/inputs/multiselected/multiselected.component.d.ts +39 -0
- package/lib/ui/forms/inputs/radio/radio.component.d.ts +14 -0
- package/lib/ui/forms/inputs/switch/switch.component.d.ts +20 -0
- package/lib/ui/forms/inputs/switch-activo/switch-activo.component.d.ts +21 -0
- package/lib/ui/forms/lists/list-option/list-option.component.d.ts +23 -0
- package/lib/ui/forms/lists/list-situaciones/list-situaciones.component.d.ts +28 -0
- package/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.d.ts +26 -0
- package/lib/ui/forms/sidebar/sidebar.component.d.ts +15 -0
- package/lib/ui/general/detalle-credito/detalle-credito.component.d.ts +8 -0
- package/lib/ui/general/montos-calcular/montos-calcular.component.d.ts +12 -0
- package/lib/ui/general/spinner/spinner.component.d.ts +5 -0
- package/lib/ui/tables/card-mobile/card-mobile.component.d.ts +17 -0
- package/lib/ui/tables/dropdown-menu/dropdown-menu.component.d.ts +43 -0
- package/lib/ui/tables/paginador/paginador.component.d.ts +20 -0
- package/lib/ui/tables/table-advance/table-advance.component.d.ts +94 -0
- package/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.d.ts +82 -0
- package/lib/ui/tables/table-agrupada/table-agrupada.component.d.ts +96 -0
- package/lib/ui/tables/table-busqueda/table-busqueda.component.d.ts +48 -0
- package/lib/ui/tables/table-detalle/table-detalle.component.d.ts +59 -0
- package/lib/ui/tables/table-simple/table-simple.component.d.ts +39 -0
- package/lib/ui/tables/table-ultimate/table-ultimate.component.d.ts +84 -0
- package/lib/ui/tabs/nav-tabs/nav-tabs.component.d.ts +9 -0
- package/lib/ui/tabs/tab-item/tab-item.component.d.ts +9 -0
- package/lib/utils/general/validaciones-simple.d.ts +2 -0
- package/lib/utils/general/validaciones.d.ts +11 -0
- package/lib/utils/helpers/api-result.d.ts +17 -0
- package/lib/utils/helpers/modal-result.d.ts +10 -0
- package/ng-components-tsi-0.0.39.tgz +0 -0
- package/package.json +31 -23
- package/{src/public-api.ts → public-api.d.ts} +68 -99
- package/ng-package.json +0 -7
- package/src/lib/directivas/acciones/atajos.directive.ts +0 -26
- package/src/lib/directivas/animaciones/fade-animation.ts +0 -45
- package/src/lib/directivas/animaciones/fade.directive.ts +0 -43
- package/src/lib/directivas/estilos/animated-checkbox.directive.ts +0 -26
- package/src/lib/directivas/estilos/button.constants.ts +0 -66
- package/src/lib/directivas/estilos/buttons-modal.directive.ts +0 -36
- package/src/lib/directivas/estilos/buttons-outline-directive.ts +0 -27
- package/src/lib/directivas/estilos/icons.directive.ts +0 -26
- package/src/lib/directivas/inputs/caracteres-codigo.directive.ts +0 -63
- package/src/lib/directivas/inputs/decimal.directive.ts +0 -51
- package/src/lib/directivas/inputs/only-day.directive.ts +0 -53
- package/src/lib/directivas/inputs/only-number-flex.directive.ts +0 -50
- package/src/lib/directivas/inputs/only-number.directive.ts +0 -53
- package/src/lib/enums/table-events.ts +0 -5
- package/src/lib/modals/general/md-generico/md-generico.component.html +0 -44
- package/src/lib/modals/general/md-generico/md-generico.component.scss +0 -4
- package/src/lib/modals/general/md-generico/md-generico.component.ts +0 -50
- package/src/lib/models/button-color.model.ts +0 -9
- package/src/lib/models/cell-rendered.ts +0 -12
- package/src/lib/models/comercial/documentos-cab-auxiliares.model.ts +0 -18
- package/src/lib/models/general/recursos.model.ts +0 -285
- package/src/lib/models/general/utils.interface.ts +0 -66
- package/src/lib/models/input-config.ts +0 -26
- package/src/lib/service/alert-confirmation.service.ts +0 -87
- package/src/lib/service/alert-error.service.ts +0 -27
- package/src/lib/service/alert.service.ts +0 -216
- package/src/lib/service/formateador.service.ts +0 -49
- package/src/lib/service/toast.service.ts +0 -75
- package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.html +0 -40
- package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.scss +0 -42
- package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.ts +0 -118
- package/src/lib/ui/alerts/alert-error/alert-error.component.html +0 -11
- package/src/lib/ui/alerts/alert-error/alert-error.component.scss +0 -39
- package/src/lib/ui/alerts/alert-error/alert-error.component.ts +0 -27
- package/src/lib/ui/alerts/alerta/alerta.component.html +0 -18
- package/src/lib/ui/alerts/alerta/alerta.component.scss +0 -104
- package/src/lib/ui/alerts/alerta/alerta.component.ts +0 -25
- package/src/lib/ui/alerts/badge/badge.component.ts +0 -16
- package/src/lib/ui/alerts/toaster/toaster.component.html +0 -52
- package/src/lib/ui/alerts/toaster/toaster.component.scss +0 -275
- package/src/lib/ui/alerts/toaster/toaster.component.ts +0 -50
- package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.html +0 -20
- package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.scss +0 -11
- package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.ts +0 -18
- package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.html +0 -10
- package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.scss +0 -54
- package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.ts +0 -36
- package/src/lib/ui/forms/button/button.component.html +0 -69
- package/src/lib/ui/forms/button/button.component.scss +0 -126
- package/src/lib/ui/forms/button/button.component.ts +0 -137
- package/src/lib/ui/forms/filter-toggle/filter-toggle.component.scss +0 -22
- package/src/lib/ui/forms/filter-toggle/filter-toggle.component.ts +0 -29
- package/src/lib/ui/forms/header/header.component.html +0 -22
- package/src/lib/ui/forms/header/header.component.scss +0 -22
- package/src/lib/ui/forms/header/header.component.ts +0 -40
- package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.html +0 -46
- package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.scss +0 -90
- package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.ts +0 -203
- package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.html +0 -61
- package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.scss +0 -128
- package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.ts +0 -145
- package/src/lib/ui/forms/inputs/check-box/check-box.component.html +0 -6
- package/src/lib/ui/forms/inputs/check-box/check-box.component.ts +0 -24
- package/src/lib/ui/forms/inputs/doble-input/doble-input.component.html +0 -60
- package/src/lib/ui/forms/inputs/doble-input/doble-input.component.scss +0 -86
- package/src/lib/ui/forms/inputs/doble-input/doble-input.component.ts +0 -129
- package/src/lib/ui/forms/inputs/input/input.component.html +0 -169
- package/src/lib/ui/forms/inputs/input/input.component.scss +0 -74
- package/src/lib/ui/forms/inputs/input/input.component.ts +0 -147
- package/src/lib/ui/forms/inputs/input-clase/input-clase.component.html +0 -30
- package/src/lib/ui/forms/inputs/input-clase/input-clase.component.scss +0 -0
- package/src/lib/ui/forms/inputs/input-clase/input-clase.component.ts +0 -28
- package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.html +0 -41
- package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.scss +0 -0
- package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.ts +0 -17
- package/src/lib/ui/forms/inputs/input-radio/input-radio.component.html +0 -26
- package/src/lib/ui/forms/inputs/input-radio/input-radio.component.scss +0 -53
- package/src/lib/ui/forms/inputs/input-radio/input-radio.component.ts +0 -36
- package/src/lib/ui/forms/inputs/multiselected/multiselected.component.html +0 -56
- package/src/lib/ui/forms/inputs/multiselected/multiselected.component.scss +0 -145
- package/src/lib/ui/forms/inputs/multiselected/multiselected.component.ts +0 -109
- package/src/lib/ui/forms/inputs/radio/radio.component.html +0 -7
- package/src/lib/ui/forms/inputs/radio/radio.component.scss +0 -0
- package/src/lib/ui/forms/inputs/radio/radio.component.ts +0 -23
- package/src/lib/ui/forms/inputs/switch/switch.component.html +0 -12
- package/src/lib/ui/forms/inputs/switch/switch.component.scss +0 -48
- package/src/lib/ui/forms/inputs/switch/switch.component.ts +0 -50
- package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.html +0 -12
- package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.scss +0 -65
- package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.ts +0 -52
- package/src/lib/ui/forms/lists/list-option/list-option.component.html +0 -24
- package/src/lib/ui/forms/lists/list-option/list-option.component.scss +0 -49
- package/src/lib/ui/forms/lists/list-option/list-option.component.ts +0 -35
- package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.html +0 -29
- package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.scss +0 -0
- package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.ts +0 -99
- package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.html +0 -46
- package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.scss +0 -30
- package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.ts +0 -96
- package/src/lib/ui/forms/sidebar/sidebar.component.html +0 -33
- package/src/lib/ui/forms/sidebar/sidebar.component.scss +0 -85
- package/src/lib/ui/forms/sidebar/sidebar.component.ts +0 -61
- package/src/lib/ui/general/detalle-credito/detalle-credito.component.html +0 -35
- package/src/lib/ui/general/detalle-credito/detalle-credito.component.scss +0 -35
- package/src/lib/ui/general/detalle-credito/detalle-credito.component.ts +0 -14
- package/src/lib/ui/general/montos-calcular/montos-calcular.component.html +0 -17
- package/src/lib/ui/general/montos-calcular/montos-calcular.component.scss +0 -36
- package/src/lib/ui/general/montos-calcular/montos-calcular.component.ts +0 -19
- package/src/lib/ui/general/spinner/spinner.component.html +0 -8
- package/src/lib/ui/general/spinner/spinner.component.scss +0 -96
- package/src/lib/ui/general/spinner/spinner.component.ts +0 -11
- package/src/lib/ui/tables/card-mobile/card-mobile.component.html +0 -34
- package/src/lib/ui/tables/card-mobile/card-mobile.component.scss +0 -0
- package/src/lib/ui/tables/card-mobile/card-mobile.component.ts +0 -36
- package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.html +0 -59
- package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.scss +0 -88
- package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.ts +0 -171
- package/src/lib/ui/tables/paginador/paginador.component.html +0 -12
- package/src/lib/ui/tables/paginador/paginador.component.scss +0 -27
- package/src/lib/ui/tables/paginador/paginador.component.ts +0 -49
- package/src/lib/ui/tables/table-advance/table-advance.component.html +0 -322
- package/src/lib/ui/tables/table-advance/table-advance.component.scss +0 -282
- package/src/lib/ui/tables/table-advance/table-advance.component.ts +0 -421
- package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.html +0 -226
- package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.scss +0 -282
- package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.ts +0 -352
- package/src/lib/ui/tables/table-agrupada/table-agrupada.component.html +0 -340
- package/src/lib/ui/tables/table-agrupada/table-agrupada.component.scss +0 -282
- package/src/lib/ui/tables/table-agrupada/table-agrupada.component.ts +0 -425
- package/src/lib/ui/tables/table-busqueda/table-busqueda.component.html +0 -130
- package/src/lib/ui/tables/table-busqueda/table-busqueda.component.scss +0 -189
- package/src/lib/ui/tables/table-busqueda/table-busqueda.component.ts +0 -199
- package/src/lib/ui/tables/table-detalle/table-detalle.component.html +0 -220
- package/src/lib/ui/tables/table-detalle/table-detalle.component.scss +0 -135
- package/src/lib/ui/tables/table-detalle/table-detalle.component.ts +0 -336
- package/src/lib/ui/tables/table-simple/table-simple.component.html +0 -116
- package/src/lib/ui/tables/table-simple/table-simple.component.scss +0 -70
- package/src/lib/ui/tables/table-simple/table-simple.component.ts +0 -141
- package/src/lib/ui/tables/table-ultimate/table-ultimate.component.html +0 -268
- package/src/lib/ui/tables/table-ultimate/table-ultimate.component.scss +0 -282
- package/src/lib/ui/tables/table-ultimate/table-ultimate.component.ts +0 -383
- package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.html +0 -12
- package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.scss +0 -100
- package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.ts +0 -19
- package/src/lib/ui/tabs/tab-item/tab-item.component.html +0 -0
- package/src/lib/ui/tabs/tab-item/tab-item.component.scss +0 -0
- package/src/lib/ui/tabs/tab-item/tab-item.component.ts +0 -13
- package/src/lib/utils/ayuda-global/datatable.ts +0 -67
- package/src/lib/utils/ayuda-global/filtros-busqueda.ts +0 -51
- package/src/lib/utils/general/validaciones-simple.ts +0 -14
- package/src/lib/utils/general/validaciones.ts +0 -123
- package/src/lib/utils/helpers/api-result.ts +0 -95
- package/src/lib/utils/helpers/modal-result.ts +0 -34
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
.flex-table {
|
|
2
|
-
width: 100%;
|
|
3
|
-
;
|
|
4
|
-
min-width: max-content;
|
|
5
|
-
border-collapse: collapse;
|
|
6
|
-
table-layout: fixed;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.flex-table th,
|
|
10
|
-
td {
|
|
11
|
-
border: 1px solid #ddd;
|
|
12
|
-
padding: 8px;
|
|
13
|
-
position: relative;
|
|
14
|
-
white-space: nowrap;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
text-overflow: ellipsis;
|
|
17
|
-
min-width: 40px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.flex-table th {
|
|
21
|
-
transition: width 0.1s ease-out;
|
|
22
|
-
padding-right: 15px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.resize-handle {
|
|
26
|
-
width: 5px;
|
|
27
|
-
height: 100%;
|
|
28
|
-
background: rgb(215, 215, 215);
|
|
29
|
-
position: absolute;
|
|
30
|
-
right: 0;
|
|
31
|
-
top: 0;
|
|
32
|
-
cursor: ew-resize;
|
|
33
|
-
user-select: none;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.flex-table thead tr th {
|
|
38
|
-
font-size: 12px;
|
|
39
|
-
font-weight: bold;
|
|
40
|
-
color: black;
|
|
41
|
-
border: none;
|
|
42
|
-
border-bottom: 1px solid rgb(206, 206, 206);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.flex-table tbody tr td {
|
|
47
|
-
font-size: 11px;
|
|
48
|
-
font-weight: 600;
|
|
49
|
-
color: black;
|
|
50
|
-
border: none;
|
|
51
|
-
border-bottom: 1px solid rgb(206, 206, 206);
|
|
52
|
-
padding-top: 7px;
|
|
53
|
-
padding-bottom: 7px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.flex-table tbody tr {
|
|
57
|
-
transition: transform 0.3s ease-in-out, opacity 0.6s ease-in-out;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
thead {
|
|
62
|
-
position: sticky;
|
|
63
|
-
top: 0;
|
|
64
|
-
z-index: 1;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.icon-sort {
|
|
68
|
-
font-size: 11px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.collapsed {
|
|
72
|
-
display: none;
|
|
73
|
-
max-height: 0;
|
|
74
|
-
opacity: 0;
|
|
75
|
-
overflow: hidden;
|
|
76
|
-
transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.expand-row {
|
|
80
|
-
max-height: 100px;
|
|
81
|
-
opacity: 1;
|
|
82
|
-
transition: max-height 0.4s ease-in, opacity 0.3s ease-in;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.table-container {
|
|
86
|
-
width: 100%;
|
|
87
|
-
max-width: 100%;
|
|
88
|
-
overflow-x: auto;
|
|
89
|
-
display: block;
|
|
90
|
-
white-space: nowrap;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.text-error {
|
|
94
|
-
color: rgb(214, 0, 0) !important;
|
|
95
|
-
font-weight: bold !important;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.text-error2 {
|
|
99
|
-
color: rgb(214, 0, 0);
|
|
100
|
-
font-weight: bold !important;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.text-exito {
|
|
104
|
-
color: rgb(0, 119, 60) !important;
|
|
105
|
-
font-weight: bold !important;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.text-alerta {
|
|
109
|
-
color: rgb(233, 167, 0) !important;
|
|
110
|
-
font-weight: bold !important;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.text-exito2 {
|
|
114
|
-
color: rgb(0, 119, 60);
|
|
115
|
-
font-weight: bold !important;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@media (max-width:1600px) {
|
|
119
|
-
.flex-table tbody tr td {
|
|
120
|
-
font-size: 9px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.flex-table thead tr th {
|
|
124
|
-
font-size: 10px;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.table-blank {
|
|
129
|
-
--bs-table-bg-state: white !important
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.normal-table thead tr th {
|
|
133
|
-
font-size: 12px;
|
|
134
|
-
|
|
135
|
-
text-align: center;
|
|
136
|
-
font-weight: bold;
|
|
137
|
-
//color: black;
|
|
138
|
-
max-width: 220px;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
text-overflow: ellipsis;
|
|
142
|
-
font-weight: 600;
|
|
143
|
-
//border: 1px solid rgb(226, 226, 226);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.normal-table tbody tr {
|
|
147
|
-
height: 30px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.normal-table tbody tr td {
|
|
151
|
-
font-size: 11px;
|
|
152
|
-
vertical-align: middle;
|
|
153
|
-
font-weight: 500;
|
|
154
|
-
//color: black;
|
|
155
|
-
white-space: nowrap;
|
|
156
|
-
text-overflow: ellipsis;
|
|
157
|
-
//border: 1px solid rgb(226, 226, 226);
|
|
158
|
-
padding-top: 0;
|
|
159
|
-
padding-bottom: 0;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.normal-table thead {
|
|
163
|
-
position: sticky;
|
|
164
|
-
top: 0;
|
|
165
|
-
z-index: 1;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
@media (max-width:1600px) {
|
|
169
|
-
.normal-table tbody tr td {
|
|
170
|
-
font-size: 9px;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.normal-table thead tr th {
|
|
174
|
-
font-size: 10px;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.grilla-error td {
|
|
179
|
-
color: rgb(214, 0, 0) !important;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.auditoria {
|
|
183
|
-
padding-left: 35px;
|
|
184
|
-
padding-top: 8px;
|
|
185
|
-
padding-bottom: 10px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.popover-menu-column {
|
|
189
|
-
position: absolute;
|
|
190
|
-
top: 100%;
|
|
191
|
-
left: 0;
|
|
192
|
-
border-radius: 0.375rem;
|
|
193
|
-
padding: 0rem 0.75rem;
|
|
194
|
-
display: block;
|
|
195
|
-
max-height: 300px;
|
|
196
|
-
width: 250px;
|
|
197
|
-
overflow-y: auto;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.popover-title {
|
|
201
|
-
font-weight: 700;
|
|
202
|
-
margin-bottom: 0.7rem;
|
|
203
|
-
margin-left: -0.75rem;
|
|
204
|
-
margin-right: -0.75rem;
|
|
205
|
-
padding: 0.4rem 0.75rem;
|
|
206
|
-
border-bottom: 1px solid #7e7e7e;
|
|
207
|
-
position: sticky;
|
|
208
|
-
top: 0;
|
|
209
|
-
text-align: center;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.popover-menu-column::-webkit-scrollbar {
|
|
213
|
-
width: 5px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.popover-menu-column::-webkit-scrollbar-track {
|
|
217
|
-
background: #f1f1f1;
|
|
218
|
-
border-radius: 4px;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.popover-menu-column::-webkit-scrollbar-thumb {
|
|
222
|
-
background-color: #d7d7d7;
|
|
223
|
-
border-radius: 4px;
|
|
224
|
-
border: 2px solid transparent;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.popover-menu-filter {
|
|
228
|
-
position: absolute;
|
|
229
|
-
top: 85%;
|
|
230
|
-
right: 0;
|
|
231
|
-
background-color: rgb(255, 255, 255);
|
|
232
|
-
border: 1px solid #ddd;
|
|
233
|
-
border-radius: 0.375rem;
|
|
234
|
-
padding: 0rem 0.75rem;
|
|
235
|
-
display: block;
|
|
236
|
-
max-height: 300px;
|
|
237
|
-
width: 250px;
|
|
238
|
-
overflow-y: auto;
|
|
239
|
-
z-index: 2;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.popover-menu-filter::-webkit-scrollbar {
|
|
243
|
-
width: 5px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.popover-menu-filter::-webkit-scrollbar-track {
|
|
247
|
-
background: #f1f1f1;
|
|
248
|
-
border-radius: 4px;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.popover-menu-filter::-webkit-scrollbar-thumb {
|
|
252
|
-
background-color: #d7d7d7;
|
|
253
|
-
border-radius: 4px;
|
|
254
|
-
border: 2px solid transparent;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.font-label{
|
|
258
|
-
font-weight: 500 !important;
|
|
259
|
-
}
|
|
260
|
-
.mtn-0{
|
|
261
|
-
margin-top: 0px;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.normal-table tfoot tr {
|
|
265
|
-
height: 50px;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.normal-table tfoot tr td {
|
|
269
|
-
font-size: 11px;
|
|
270
|
-
vertical-align: middle;
|
|
271
|
-
font-weight: 500;
|
|
272
|
-
white-space: nowrap;
|
|
273
|
-
text-overflow: ellipsis;
|
|
274
|
-
padding-top: 0;
|
|
275
|
-
padding-bottom: 0;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.normal-table tfoot {
|
|
279
|
-
position: sticky;
|
|
280
|
-
bottom: 0;
|
|
281
|
-
z-index: 1;
|
|
282
|
-
}
|
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import { CommonModule, DatePipe, DecimalPipe } from '@angular/common';
|
|
2
|
-
import { Component, computed, ContentChild, effect, ElementRef, inject, input, linkedSignal, model, output, QueryList, signal, TemplateRef, untracked, ViewChild, ViewChildren } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { DropdownCdkComponent } from "../../dropdown/dropdown-cdk/dropdown-cdk.component";
|
|
5
|
-
import { dropdownAnimation, fadeInOut } from '../../../directivas/animaciones/fade-animation';
|
|
6
|
-
import { CellRender, CellRendered } from '../../../models/cell-rendered';
|
|
7
|
-
import { validarBoolean } from 'shared-tsi';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'app-table-advance',
|
|
11
|
-
imports: [FormsModule, CommonModule, DatePipe, DecimalPipe, DropdownCdkComponent],
|
|
12
|
-
templateUrl: './table-advance.component.html',
|
|
13
|
-
styleUrl: './table-advance.component.scss',
|
|
14
|
-
animations: [dropdownAnimation, fadeInOut],
|
|
15
|
-
providers: [DatePipe, DecimalPipe]
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
export class TableAdvanceComponent {
|
|
19
|
-
|
|
20
|
-
@ViewChildren('thElement') tableHeaders!: QueryList<ElementRef>
|
|
21
|
-
@ContentChild('customActions', { static: false }) customActions!: TemplateRef<any>
|
|
22
|
-
|
|
23
|
-
private datePipe = inject(DatePipe)
|
|
24
|
-
private decimalPipe = inject(DecimalPipe)
|
|
25
|
-
|
|
26
|
-
rows = input<any[]>([])
|
|
27
|
-
columns = input<any[]>([])
|
|
28
|
-
withDetails = input<boolean>(false)
|
|
29
|
-
withFiltro = input<boolean>(false)
|
|
30
|
-
altoContainer = input<number>()
|
|
31
|
-
|
|
32
|
-
emitirBusqueda = output<string>()
|
|
33
|
-
emitirCheck = output<any>()
|
|
34
|
-
emitirCheckCabecera = output<any>()
|
|
35
|
-
emitirRadio = output<any>()
|
|
36
|
-
emitirColumnasFiltrables = output<any>()
|
|
37
|
-
|
|
38
|
-
colorHeader = input<'normal' | 'light'>('normal')
|
|
39
|
-
isDarkMode = input<boolean>(false)
|
|
40
|
-
busqueda = signal<string>('')
|
|
41
|
-
|
|
42
|
-
selectedRow = model<any>(null)
|
|
43
|
-
|
|
44
|
-
identifier = input<string[]>([])
|
|
45
|
-
|
|
46
|
-
altoContenedor = signal<number>(0)
|
|
47
|
-
|
|
48
|
-
showPopoverColumn = signal<boolean>(false)
|
|
49
|
-
|
|
50
|
-
showPopoverFilter = signal<boolean>(false)
|
|
51
|
-
|
|
52
|
-
isHeaderOperation = signal<boolean>(false)
|
|
53
|
-
|
|
54
|
-
withHeight = input<boolean>(false)
|
|
55
|
-
rendered = input<CellRendered[]>([])
|
|
56
|
-
withTotal = input<boolean>(false)
|
|
57
|
-
withCheckbox = input<boolean>(false)
|
|
58
|
-
selectItems = model<(number | string)[]>([])
|
|
59
|
-
|
|
60
|
-
rowEvent = output<any>()
|
|
61
|
-
|
|
62
|
-
rowFilter = computed(() => {
|
|
63
|
-
const term = this.busqueda().toLowerCase()
|
|
64
|
-
const currentRows = this.rows?.() || []
|
|
65
|
-
return currentRows.filter(item => this.filtraItem(item, term))
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
filtrarColumnas = linkedSignal(() => {
|
|
69
|
-
const columns = this.columns()
|
|
70
|
-
const filtro: { [caption: string]: boolean } = {}
|
|
71
|
-
columns.forEach((col) => {
|
|
72
|
-
if (col.fieldname) {
|
|
73
|
-
filtro[col.fieldname] = true
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
return filtro
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
toggleFiltros(event: Event) {
|
|
80
|
-
const checked = (event.target as HTMLInputElement).checked
|
|
81
|
-
const filtros = this.filtrarColumnas()
|
|
82
|
-
Object.keys(filtros).forEach(key => {
|
|
83
|
-
filtros[key] = checked
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
visibilidadColumn = linkedSignal(() => {
|
|
88
|
-
const columns = this.columns()
|
|
89
|
-
const columnVisibility: { [caption: string]: boolean } = {}
|
|
90
|
-
columns.forEach((col) => {
|
|
91
|
-
if (col.caption) {
|
|
92
|
-
columnVisibility[col.caption] = true
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
return columnVisibility
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
concatenarValue(obj: any, value: string[]) {
|
|
99
|
-
let result = ''
|
|
100
|
-
value.forEach(el => {
|
|
101
|
-
result += obj[el]
|
|
102
|
-
})
|
|
103
|
-
return result
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
checkString = {
|
|
107
|
-
'S': 'Activo',
|
|
108
|
-
'N': 'Inactivo'
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
sortColumn: string | null = null
|
|
112
|
-
sortDirection: 'asc' | 'desc' = 'asc'
|
|
113
|
-
|
|
114
|
-
expandedRows: number = -1
|
|
115
|
-
|
|
116
|
-
constructor() {
|
|
117
|
-
effect(() => {
|
|
118
|
-
const size = (this.rowFilter() ?? []).length
|
|
119
|
-
|
|
120
|
-
const alto = this.altoContainer()
|
|
121
|
-
if (alto > 0 && alto < this.altoContenedor()) {
|
|
122
|
-
setTimeout(() => {
|
|
123
|
-
this.altoContenedor.set(alto)
|
|
124
|
-
}, 300)
|
|
125
|
-
}
|
|
126
|
-
if (alto > 0 && alto > this.altoContenedor()) {
|
|
127
|
-
this.altoContenedor.set(alto)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const selected = untracked(() => this.selectedRow())
|
|
131
|
-
if (size > 0 && selected) {
|
|
132
|
-
queueMicrotask(() => {
|
|
133
|
-
const el = document.getElementById('row_table_' + selected)
|
|
134
|
-
el?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
|
|
135
|
-
})
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
togglePopoverColumn() {
|
|
141
|
-
this.showPopoverColumn.update(prev => !prev)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
togglePopoverFilter() {
|
|
145
|
-
this.showPopoverFilter.update(prev => !prev)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
selectRow(index: any) {
|
|
149
|
-
if (this.identifier().length < 1) {
|
|
150
|
-
return this.selectedRow.set(index)
|
|
151
|
-
}
|
|
152
|
-
this.selectedRow.set(this.concatenarValue(index, this.identifier()))
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
getTipoCampo(fieldname: string): string {
|
|
156
|
-
const columna = this.columns().find(col => col.fieldname == fieldname)
|
|
157
|
-
return columna?.tipo ?? 'string'
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
sortTable(column: string) {
|
|
161
|
-
if (this.sortColumn == column) {
|
|
162
|
-
this.sortDirection = this.sortDirection == 'asc' ? 'desc' : 'asc'
|
|
163
|
-
} else {
|
|
164
|
-
this.sortColumn = column
|
|
165
|
-
this.sortDirection = 'asc'
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
this.rowFilter().sort((a, b) => {
|
|
169
|
-
const valueA = a[column] ?? ''
|
|
170
|
-
const valueB = b[column] ?? ''
|
|
171
|
-
|
|
172
|
-
if (typeof valueA == 'number' && typeof valueB == 'number') {
|
|
173
|
-
return this.sortDirection == 'asc' ? valueA - valueB : valueB - valueA
|
|
174
|
-
} else {
|
|
175
|
-
return this.sortDirection == 'asc'
|
|
176
|
-
? valueA.toString().localeCompare(valueB.toString())
|
|
177
|
-
: valueB.toString().localeCompare(valueA.toString())
|
|
178
|
-
}
|
|
179
|
-
})
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
toggleExpandRow(index: number) {
|
|
183
|
-
this.expandedRows = this.expandedRows == index ? -1 : index
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
textoDigitado(event: Event) {
|
|
187
|
-
const value = (event.target as HTMLInputElement).value
|
|
188
|
-
this.busqueda.set(value)
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
getHighlight(text: any, fieldname: string): string {
|
|
192
|
-
if (text == null) {
|
|
193
|
-
text = ''
|
|
194
|
-
}
|
|
195
|
-
if (!this.filtrarColumnas()[fieldname] || !this.busqueda()) return text
|
|
196
|
-
if (typeof text !== 'string') {
|
|
197
|
-
text = text.toString()
|
|
198
|
-
}
|
|
199
|
-
const regex = new RegExp(`(${this.busqueda()})`, 'gi')
|
|
200
|
-
return text?.replace(regex, '<mark>$1</mark>')
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
desglozarValor = (valor: string) => {
|
|
204
|
-
return valor!.split(',')
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
getSituacionNumberFromColumns(row: any, columns: any[]): number {
|
|
208
|
-
const situacionColumn = columns.find(col => col.type == 'situacion_number')
|
|
209
|
-
if (situacionColumn) {
|
|
210
|
-
return row[situacionColumn.prop] || 0
|
|
211
|
-
}
|
|
212
|
-
return 0
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
clickCheck(item: string, event: Event, row: any) {
|
|
216
|
-
if (this.isHeaderOperation()) return
|
|
217
|
-
|
|
218
|
-
const check = event.target as HTMLInputElement
|
|
219
|
-
const resultCheck = check.checked ? 1 : 0
|
|
220
|
-
const mes = item.at(-1)
|
|
221
|
-
const formatObj = { ...row, check: resultCheck, mes }
|
|
222
|
-
this.emitirCheck.emit(formatObj)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
areAllChecked(fieldname: string): boolean {
|
|
226
|
-
const rows = this.rowFilter()
|
|
227
|
-
return rows.length > 0 && rows.every(row => row[fieldname] == 1 || row[fieldname] == 'S')
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
toggleAllCheckboxes(event: Event, fieldname: string, rows: any[]) {
|
|
231
|
-
const check = event.target as HTMLInputElement
|
|
232
|
-
this.isHeaderOperation.set(true)
|
|
233
|
-
|
|
234
|
-
rows.forEach(row => {
|
|
235
|
-
row[fieldname] = check.checked ? 'S' : 0
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
const formatObj = {
|
|
239
|
-
...rows,
|
|
240
|
-
todos: check.checked ? 'S' : 'N',
|
|
241
|
-
field: fieldname
|
|
242
|
-
}
|
|
243
|
-
this.emitirCheckCabecera.emit(formatObj)
|
|
244
|
-
this.isHeaderOperation.set(false)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
clickRadio(row: any) {
|
|
248
|
-
const formatObj = { ...row }
|
|
249
|
-
this.emitirRadio.emit(formatObj)
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
private filtraItem(item: any, term: string): boolean {
|
|
253
|
-
const columnasActivas = Object.entries(this.filtrarColumnas())
|
|
254
|
-
.filter(([_campo, activo]) => activo)
|
|
255
|
-
return columnasActivas.some(([campo]) => {
|
|
256
|
-
let valor = item[campo]
|
|
257
|
-
const tipo = this.getTipoCampo(campo)
|
|
258
|
-
switch (tipo) {
|
|
259
|
-
case 'fecha':
|
|
260
|
-
valor = this.datePipe.transform(valor, 'dd/MM/yyyy') ?? ''
|
|
261
|
-
break
|
|
262
|
-
case 'decimal':
|
|
263
|
-
valor = this.decimalPipe.transform(valor, '1.2-2') ?? ''
|
|
264
|
-
break
|
|
265
|
-
case 'check':
|
|
266
|
-
valor = valor ? 'Sí' : 'No'
|
|
267
|
-
break
|
|
268
|
-
default:
|
|
269
|
-
valor = (valor ?? '').toString()
|
|
270
|
-
}
|
|
271
|
-
return valor.toLowerCase().includes(term)
|
|
272
|
-
})
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
validaVisibilidad(value: boolean) {
|
|
276
|
-
return validarBoolean(value)
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
allCheck(event: Event) {
|
|
280
|
-
const input = event.target as HTMLInputElement
|
|
281
|
-
if (input.checked) {
|
|
282
|
-
const keys = this.rowFilter().map(row => JSON.stringify(row))
|
|
283
|
-
this.selectItems.set(keys)
|
|
284
|
-
} else {
|
|
285
|
-
this.selectItems.set([])
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
validaAllCheck(): boolean {
|
|
290
|
-
const keys = this.rowFilter().map(row => JSON.stringify(row))
|
|
291
|
-
return (
|
|
292
|
-
keys.length > 0 &&
|
|
293
|
-
keys.every(k => this.selectItems().includes(k))
|
|
294
|
-
)
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
isItemSelected(index: number): boolean {
|
|
298
|
-
const row = this.rowFilter()[index]
|
|
299
|
-
const key = JSON.stringify(row)
|
|
300
|
-
return this.selectItems().includes(key)
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
toogleItem(index: number, event: Event) {
|
|
304
|
-
const input = event.target as HTMLInputElement
|
|
305
|
-
const row = this.rowFilter()[index]
|
|
306
|
-
const key = JSON.stringify(row)
|
|
307
|
-
|
|
308
|
-
if (input.checked) {
|
|
309
|
-
this.selectItems.update(sel => [...sel, key])
|
|
310
|
-
return
|
|
311
|
-
}
|
|
312
|
-
this.selectItems.update(sel => sel.filter(s => s != key))
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
resolveCell(col: string, row: any): CellRender | null {
|
|
316
|
-
const value = row[col]
|
|
317
|
-
const r = this.rendered().find(r => r.matches(col, value, row))
|
|
318
|
-
return r ? r.render(value, row) : null
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
getTotals(fieldname: string): number {
|
|
322
|
-
const itemsSelected = this.withCheckbox() ? this.selectItems().map(item => JSON.parse(item?.toString())) : this.rows()
|
|
323
|
-
return itemsSelected.reduce((acc, row) => {
|
|
324
|
-
const val = row[fieldname]
|
|
325
|
-
return acc + (typeof val == 'number' ? val : 0)
|
|
326
|
-
}, 0)
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
getCampoCantidad(): string | null {
|
|
330
|
-
const col = this.columns().find(c => c.cantidadPonderado)
|
|
331
|
-
return col?.fieldname ?? null
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
getAverageSimple(fieldname: string): number {
|
|
335
|
-
const selected = this.withFiltro()
|
|
336
|
-
? this.selectItems().map(item => JSON.parse(item.toString()))
|
|
337
|
-
: this.rows().filter((_item, index) => this.selectItems().includes(index))
|
|
338
|
-
const items = this.withCheckbox() ? selected : this.rows()
|
|
339
|
-
if (!items.length) return 0
|
|
340
|
-
const total = items.reduce((acc, row) => {
|
|
341
|
-
const val = row[fieldname]
|
|
342
|
-
return acc + (typeof val === 'number' ? val : 0)
|
|
343
|
-
}, 0)
|
|
344
|
-
return total / items.length
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
getAveragePonderado(fieldname: string): number {
|
|
348
|
-
const campoCantidad = this.getCampoCantidad()
|
|
349
|
-
if (!campoCantidad) return 0
|
|
350
|
-
const selected = this.withFiltro()
|
|
351
|
-
? this.selectItems().map(item => JSON.parse(item.toString()))
|
|
352
|
-
: this.rows().filter((_item, index) => this.selectItems().includes(index))
|
|
353
|
-
const items = this.withCheckbox() ? selected : this.rows()
|
|
354
|
-
let sumaValor = 0
|
|
355
|
-
let sumaCantidad = 0
|
|
356
|
-
items.forEach(row => {
|
|
357
|
-
const valor = row[fieldname]
|
|
358
|
-
const cantidad = row[campoCantidad]
|
|
359
|
-
if (typeof valor == 'number' && typeof cantidad == 'number') {
|
|
360
|
-
sumaValor += valor * cantidad
|
|
361
|
-
sumaCantidad += cantidad
|
|
362
|
-
}
|
|
363
|
-
})
|
|
364
|
-
return sumaCantidad > 0 ? sumaValor / sumaCantidad : 0
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
getFooterSegments() {
|
|
368
|
-
const offset = [this.withDetails(), this.withCheckbox(), this.customActions]
|
|
369
|
-
.filter(Boolean).length
|
|
370
|
-
const columns = this.columns()
|
|
371
|
-
const calculables = columns.filter(c => c.totalizable || c.promedio)
|
|
372
|
-
if (!calculables.length) {
|
|
373
|
-
return [{ type: 'colspan', span: columns.length + offset }]
|
|
374
|
-
}
|
|
375
|
-
let span = offset
|
|
376
|
-
return columns.reduce((segments, col) => {
|
|
377
|
-
if (col.totalizable) {
|
|
378
|
-
if (span > 0) segments.push({ type: 'colspan', span })
|
|
379
|
-
segments.push({ type: 'total', field: col.fieldname })
|
|
380
|
-
span = 0
|
|
381
|
-
} else if (col.promedioSimple) {
|
|
382
|
-
if (span > 0) segments.push({ type: 'colspan', span })
|
|
383
|
-
segments.push({ type: 'averageSimple', field: col.fieldname })
|
|
384
|
-
span = 0
|
|
385
|
-
}
|
|
386
|
-
else if (col.promedioPonderado) {
|
|
387
|
-
if (span > 0) segments.push({ type: 'colspan', span })
|
|
388
|
-
segments.push({ type: 'averagePonderado', field: col.fieldname })
|
|
389
|
-
span = 0
|
|
390
|
-
} else {
|
|
391
|
-
span++
|
|
392
|
-
}
|
|
393
|
-
return segments
|
|
394
|
-
}, [] as Array<
|
|
395
|
-
| { type: 'colspan'; span: number }
|
|
396
|
-
| { type: 'total'; field: string }
|
|
397
|
-
| { type: 'averageSimple'; field: string }
|
|
398
|
-
| { type: 'averagePonderado'; field: string }
|
|
399
|
-
>).concat(span > 0 ? [{ type: 'colspan', span }] : [])
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
getRowClass(row: any): { [key: string]: boolean } {
|
|
403
|
-
return {
|
|
404
|
-
'text-error': row.situac == 'J',
|
|
405
|
-
'text-alerta': row.situac == 'L'
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
onClick(row: any) {
|
|
410
|
-
return { usecase: 1, data: row }
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
onDoubleClick(row: any) {
|
|
414
|
-
return { usecase: 2, data: row }
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
onRightClick(event: MouseEvent, row: any) {
|
|
418
|
-
event.preventDefault();
|
|
419
|
-
return { usecase: 3, data: row }
|
|
420
|
-
}
|
|
421
|
-
}
|