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,220 +0,0 @@
|
|
|
1
|
-
@if (withFiltro()) {
|
|
2
|
-
<div class="col-12 mb-2 mt-2 d-flex justify-content-end align-items-center">
|
|
3
|
-
<label for="" class="form-label me-2 pt-2">Buscar</label>
|
|
4
|
-
<input type="text" class="form-control cw-250" (input)="textoDigitado($event)">
|
|
5
|
-
</div>
|
|
6
|
-
}
|
|
7
|
-
<div class="table-container table-responsive"
|
|
8
|
-
[style.max-height]="altoContainer() ? 'calc(100vh - ' + altoContainer() + 'px)' : ''"
|
|
9
|
-
[style.max-height]="altoContainer()? 'calc(100vh - ' + altoContainer() + 'px)' : ''">
|
|
10
|
-
<table #table class="table table-striped normal-table" [ngClass]="isDarkMode() ? 'table-dark' : ''">
|
|
11
|
-
<thead>
|
|
12
|
-
<tr class="shadow-sm">
|
|
13
|
-
@if (withCheckbox()) {
|
|
14
|
-
<th scope="col" class="text-center b-table w-min"
|
|
15
|
-
[ngClass]="colorHeader()== 'normal' ? '' : 'header-normal'">
|
|
16
|
-
<input type="checkbox" class="form-check-input fs-8 border border-secondary"
|
|
17
|
-
[checked]="validaAllCheck()" (change)="allCheck($event)">
|
|
18
|
-
</th>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@if (withEditItem()) {
|
|
22
|
-
<th scope="col" class="text-center b-table w-min"
|
|
23
|
-
[ngClass]="colorHeader()== 'normal' ? '' : 'header-normal'">
|
|
24
|
-
</th>
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@if (customActions) {
|
|
28
|
-
<th scope="col" class="b-table w-min mwp-50"
|
|
29
|
-
[ngClass]="colorHeader()== 'normal' ? '' : 'header-normal'"></th>
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@for (column of columns(); track $index) {
|
|
33
|
-
@if (column.visible) {
|
|
34
|
-
<th scope="col" class="b-table" #thElement [title]="column.caption"
|
|
35
|
-
[style.width]="widthDefault(column) + 'px'" [style.min-width]="widthDefault(column) + 'px'"
|
|
36
|
-
[ngClass]="colorHeader()== 'normal' ? '' : 'header-normal'">
|
|
37
|
-
{{ column.caption }}
|
|
38
|
-
</th>
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
</tr>
|
|
42
|
-
</thead>
|
|
43
|
-
|
|
44
|
-
<tbody>
|
|
45
|
-
@for (row of rowFilter(); track iRow; let iRow = $index) {
|
|
46
|
-
@let isLast = validaAccionDescri(iRow);
|
|
47
|
-
@let rowClass = getRowClass(row);
|
|
48
|
-
<tr [ngClass]="{'table-active': (identifier().length < 1 ? selectedRow() == $index : selectedRow() == concatenarValue(row,identifier()))}"
|
|
49
|
-
[class]="rowClass" (click)="selectRow(identifier().length < 1 ? $index : row)"
|
|
50
|
-
[id]="identifier().length < 1 ? ('row_table_' + $index) : ('row_table_'+ concatenarValue(row,identifier()))">
|
|
51
|
-
|
|
52
|
-
@if (withCheckbox()) {
|
|
53
|
-
<td scope="col" class="text-center b-table w-min" [class]="rowClass">
|
|
54
|
-
@if(!resolveCell('checkbox', row)?.hidden){
|
|
55
|
-
<input type="checkbox" class="form-check-input fs-8 border border-secondary my-0 py-0"
|
|
56
|
-
[disabled]="!lastItemDisabled() ? false : validaLastRegistro($index)"
|
|
57
|
-
[checked]="isItemSelected($index)" (change)="toogleItem($index, $event)">
|
|
58
|
-
}
|
|
59
|
-
</td>
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@if (withEditItem()) {
|
|
63
|
-
<td scope="col" class="text-start b-table w-min">
|
|
64
|
-
<div class="d-flex align-items-center justify-content-center">
|
|
65
|
-
<i (click)="validaEdit(iRow) ? editItem.emit(row) : null "
|
|
66
|
-
class="fas fa-pen fs-7 px-2 py-2 my-1 rounded-2 text-secondary shadow-sm"
|
|
67
|
-
[ngClass]="validaEdit(iRow) ? 'cursor-pointer' : ''" title="Editar articulo"></i>
|
|
68
|
-
</div>
|
|
69
|
-
</td>
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@if (customActions) {
|
|
73
|
-
<td class="text-center mwp-90 b-table w-min">
|
|
74
|
-
<div class="d-flex justify-content-center align-items-center">
|
|
75
|
-
<ng-container *ngTemplateOutlet="customActions; context: { $implicit: row }"></ng-container>
|
|
76
|
-
</div>
|
|
77
|
-
</td>
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@for (column of columns(); track $index) {
|
|
81
|
-
@if (column.visible) {
|
|
82
|
-
@switch (column.tipo) {
|
|
83
|
-
|
|
84
|
-
@case ('input-radio') {
|
|
85
|
-
<td scope="col" class="text-center b-table">
|
|
86
|
-
<input type="radio" class="form-check-input fs-8 border border-secondary m-0 p-0"
|
|
87
|
-
[disabled]="lastItemDisabled() && validaLastRegistro(iRow)" [checked]="selectedRadio() === iRow"
|
|
88
|
-
(change)="clickRadio(iRow)">
|
|
89
|
-
</td>
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@case ('fecha') {
|
|
93
|
-
<td class="b-table" [title]="row[column.fieldname] | date:'dd/MM/yyyy'"
|
|
94
|
-
[ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
95
|
-
{{ row[column.fieldname] | date:'dd/MM/yyyy' }}
|
|
96
|
-
</td>
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@case ('decimal') {
|
|
100
|
-
<td class="text-end b-table" [title]="limpiarNumero(row[column.fieldname]) | number:'1.2-2'"
|
|
101
|
-
[ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
102
|
-
{{limpiarNumero(row[column.fieldname]) | number:'1.2-2'}}
|
|
103
|
-
</td>
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@case ('list-select') {
|
|
107
|
-
<td class="text-center b-table" [title]="row[column.fieldname]">
|
|
108
|
-
<div ngbDropdown class="d-inline-block" container="body">
|
|
109
|
-
<div class="h-100 bg-sidebar d-flex align-items-center px-1">
|
|
110
|
-
<button [disabled]="!isLast" class="border-0 bg-none"
|
|
111
|
-
[ngClass]="!isLast ? 'text-muted' : 'text-input'" ngbDropdownToggle>
|
|
112
|
-
{{row[column.fieldname]}}
|
|
113
|
-
</button>
|
|
114
|
-
</div>
|
|
115
|
-
<div ngbDropdownMenu class="my-0 py-0">
|
|
116
|
-
@for (item of column.lista; track $index; let last = $last) {
|
|
117
|
-
<app-button [texto]="item.text"
|
|
118
|
-
[extraClass]="($index == 0 ? 'border-top-radius ' : '') + (last ? 'border-bottom-radius' : '')"
|
|
119
|
-
[dropdownButton]="true" (accion)="item?.action(row,item.codigo)" />
|
|
120
|
-
}
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
<!-- <app-dropdown-menu [options]="column.lista" [disabled]="lastItemDisabled() ? false : !validaLastRegistro($index)" [buttonProperties]="{color:'none',texto:row[column.fieldname]}"/> -->
|
|
124
|
-
</td>
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
@case ('input') {
|
|
129
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
130
|
-
<input type="text" class="form-control" [(ngModel)]="row[column.fieldname]"
|
|
131
|
-
(focus)="focusData(row[column.fieldname])"
|
|
132
|
-
(blur)="!validarData(row[column.fieldname]) ? null : column?.blur(row)"
|
|
133
|
-
(keyup.enter)="!validarData(row[column.fieldname]) ? null : column?.enter(row)"
|
|
134
|
-
[disabled]="column.disabled ? (typeof column.disabled === 'function' ? column.disabled(row) : column.disabled) : false">
|
|
135
|
-
</td>
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@case ('input-date') {
|
|
139
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
140
|
-
<input type="date" class="form-control" [(ngModel)]="row[column.fieldname]"
|
|
141
|
-
(blur)="column?.blur(row)" (keyup.enter)="column?.enter(row)"
|
|
142
|
-
[disabled]="column.disabled ? (typeof column.disabled === 'function' ? column.disabled(row) : column.disabled) : false">
|
|
143
|
-
</td>
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
@case ('input-etiqueta') {
|
|
147
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
148
|
-
<!-- <app-doble-input-buscar [oneinput]="true" type="etiqueta" [withDetails]="true"
|
|
149
|
-
[(valuedes)]="row[column.fieldname]" [(disabled)]="row.disabledEtiqueta"
|
|
150
|
-
[auxiliarData]="{tipinv:row.tipinv,codart:row.codart,codtit:row.codtit,codalm:row.codalm}"
|
|
151
|
-
(emitirAdicionalData)="manejarDataEtiqueta($event,row)"
|
|
152
|
-
(disabledChange)="limpiarEtiqueta($event,row)" [withBuscar2]="true"
|
|
153
|
-
[allDisabled]="row.disabledAll ?? false" /> -->
|
|
154
|
-
</td>
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
@case ('input-afecta') {
|
|
158
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
159
|
-
<!-- <app-doble-input-buscar [oneinput]="true" type="tafecta" [(valuecod)]="row[column.fieldname]"
|
|
160
|
-
[(disabled)]="row.disabledEtiqueta" [(valuedes)]="row.dtipafec" viewInput="cod"
|
|
161
|
-
[withBuscar]="true" [allDisabled]="row.disabledAll ?? false" /> -->
|
|
162
|
-
</td>
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@case ('input-number') {
|
|
166
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
167
|
-
<input type="text" class="form-control text-end"
|
|
168
|
-
[ngClass]="(!column.valida ? '' : (row[column.fieldname] ?? 0) <= 0 ? 'input-error' : '')"
|
|
169
|
-
[(ngModel)]="row[column.fieldname]" (blur)="validarFunction(column.blur)?.(row)"
|
|
170
|
-
[disabled]="row.disabledAll ?? false" onlyNumber>
|
|
171
|
-
</td>
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
@case ('input-decimal') {
|
|
175
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
176
|
-
<input type="text" class="form-control text-end w-100"
|
|
177
|
-
[ngClass]="(!column.valida ? '' : (row[column.fieldname] ?? 0) <= 0 ? 'input-error' : '')"
|
|
178
|
-
[(ngModel)]="row[column.fieldname]" (blur)="validarFunction(column.blur)?.(row)"
|
|
179
|
-
[appDecimal]="column.pipe" [readonly]="column.readonly ? column.readonly(row) : false"
|
|
180
|
-
[disabled]="row.disabledAll ?? generateKeyDisabled(row,column)" onlyNumber>
|
|
181
|
-
</td>
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
@case ('input-select') {
|
|
185
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
186
|
-
<select class="form-select" name="{{`cbo_lista_${row[column.fieldname]}`}}"
|
|
187
|
-
id="{{`cbo_lista_${row[column.fieldname]}`}}" [(ngModel)]="row[column.fieldname]"
|
|
188
|
-
(change)="validarFunction(column.change)?.(row)"
|
|
189
|
-
[disabled]="column.disabled ? (typeof column.disabled === 'function' ? column.disabled(row) : column.disabled) : false">
|
|
190
|
-
@for (item of column.lista; track $index) {
|
|
191
|
-
<option [value]="item[column.keyCodigo]"> {{ item[column.keyDescri]}} </option>
|
|
192
|
-
}
|
|
193
|
-
</select>
|
|
194
|
-
</td>
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
@case ('stock') {
|
|
198
|
-
<td class="b-table text-center" [title]="row[column.fieldname] ? row[column.fieldname] : 'Sin Stock'">
|
|
199
|
-
@if (limpiarNumero(row[column.fieldname]) > 0) {
|
|
200
|
-
{{row[column.fieldname]}}
|
|
201
|
-
}@else {
|
|
202
|
-
<i class="fas fa-times text-danger fw-bold fs-4"></i>
|
|
203
|
-
}
|
|
204
|
-
</td>
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
@default {
|
|
208
|
-
<td class="b-table" [title]="row[column.fieldname]" [ngClass]="row.situac == 'J' ? 'text-error':''">
|
|
209
|
-
<span [ngClass]="isLast ? 'cursor-pointer' : ''"
|
|
210
|
-
(click)="isLast ? column?.clic() : null">{{row[column.fieldname]}}</span>
|
|
211
|
-
</td>
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
</tr>
|
|
217
|
-
}
|
|
218
|
-
</tbody>
|
|
219
|
-
</table>
|
|
220
|
-
</div>
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
thead {
|
|
2
|
-
position: sticky;
|
|
3
|
-
top: 0;
|
|
4
|
-
z-index: 1;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.table-container {
|
|
8
|
-
width: 100%;
|
|
9
|
-
max-width: 100%;
|
|
10
|
-
overflow-x: auto;
|
|
11
|
-
display: block;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.table-blank {
|
|
16
|
-
--bs-table-bg-state: white !important
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.header-normal {
|
|
20
|
-
background: rgb(206, 206, 206) !important;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.normal-table thead tr th {
|
|
24
|
-
font-size: 11px;
|
|
25
|
-
text-align: start;
|
|
26
|
-
font-weight: bold;
|
|
27
|
-
max-width: 220px;
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
text-overflow: ellipsis;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.normal-table tbody tr {
|
|
34
|
-
height: 30px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.normal-table tbody tr td {
|
|
38
|
-
font-size: 11px;
|
|
39
|
-
vertical-align: middle;
|
|
40
|
-
font-weight: 500;
|
|
41
|
-
white-space: nowrap;
|
|
42
|
-
text-overflow: ellipsis;
|
|
43
|
-
padding-top: 0;
|
|
44
|
-
padding-bottom: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.normal-table thead {
|
|
48
|
-
position: sticky;
|
|
49
|
-
top: 0;
|
|
50
|
-
z-index: 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@media (max-width:1600px) {
|
|
54
|
-
.normal-table tbody tr td {
|
|
55
|
-
font-size: 9px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.normal-table thead tr th {
|
|
59
|
-
font-size: 10px;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.input-error {
|
|
64
|
-
border: 1px solid rgb(203, 0, 0);
|
|
65
|
-
color: rgb(203, 0, 0) !important;
|
|
66
|
-
//animation: aura-pulse 1.5s ease-out infinite;
|
|
67
|
-
position: relative;
|
|
68
|
-
z-index: 1;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@keyframes aura-pulse {
|
|
72
|
-
0% {
|
|
73
|
-
box-shadow: 0 0 0 0 rgba(203, 0, 0, 0.7);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
70% {
|
|
77
|
-
box-shadow: 0 0 0 5px rgba(203, 0, 0, 0);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
100% {
|
|
81
|
-
box-shadow: 0 0 0 0 rgba(203, 0, 0, 0);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.w-min {
|
|
86
|
-
max-width: 40px !important;
|
|
87
|
-
width: 40px !important;
|
|
88
|
-
min-width: 40px !important;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.bg-red {
|
|
92
|
-
background-color: red;
|
|
93
|
-
|
|
94
|
-
i,
|
|
95
|
-
span,
|
|
96
|
-
button,
|
|
97
|
-
td,
|
|
98
|
-
input,
|
|
99
|
-
select {
|
|
100
|
-
color: red !important;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.bg-red-input {
|
|
105
|
-
color: red !important;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.bg-blue {
|
|
109
|
-
background-color: blue;
|
|
110
|
-
|
|
111
|
-
i,
|
|
112
|
-
span,
|
|
113
|
-
button,
|
|
114
|
-
td,
|
|
115
|
-
input,
|
|
116
|
-
select {
|
|
117
|
-
color: blue !important;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.bg-blue-input {
|
|
122
|
-
color: blue !important;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.bg-yellow {
|
|
126
|
-
background-color: yellow;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.bg-green {
|
|
130
|
-
background-color: greenyellow;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.bg-initial {
|
|
134
|
-
background-color: initial;
|
|
135
|
-
}
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import { CommonModule, DatePipe, DecimalPipe } from '@angular/common';
|
|
2
|
-
import { Component, computed, ContentChild, inject, input, linkedSignal, model, output, signal, TemplateRef } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
5
|
-
import { ButtonComponent } from '../../forms/button/button.component';
|
|
6
|
-
import { DecimalDirective } from '../../../directivas/inputs/decimal.directive';
|
|
7
|
-
import { OnlyNumberDirective } from '../../../directivas/inputs/only-number.directive';
|
|
8
|
-
import { CellRender, CellRendered } from '../../../models/cell-rendered';
|
|
9
|
-
import { cleanNumber } from 'shared-tsi';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'app-table-detalle',
|
|
13
|
-
imports: [FormsModule, CommonModule, DecimalDirective, OnlyNumberDirective, NgbDropdownModule, ButtonComponent],
|
|
14
|
-
templateUrl: './table-detalle.component.html',
|
|
15
|
-
styleUrl: './table-detalle.component.scss',
|
|
16
|
-
providers: [DatePipe, DecimalPipe]
|
|
17
|
-
})
|
|
18
|
-
export class TableDetalleComponent {
|
|
19
|
-
|
|
20
|
-
private datePipe = inject(DatePipe)
|
|
21
|
-
private decimalPipe = inject(DecimalPipe)
|
|
22
|
-
|
|
23
|
-
selectedRow = model<any>(null)
|
|
24
|
-
identifier = input<string[]>([])
|
|
25
|
-
altoContainer = input<number>()
|
|
26
|
-
withFiltro = input<boolean>(false)
|
|
27
|
-
busqueda = model<string>('')
|
|
28
|
-
rows = input<any[]>([])
|
|
29
|
-
columns = input<any[]>([])
|
|
30
|
-
lastItemDisabled = input<boolean>(true)
|
|
31
|
-
position = input<'block' | 'flex'>('flex')
|
|
32
|
-
withCheckbox = input<boolean>(true)
|
|
33
|
-
withEditItem = input<boolean>(false)
|
|
34
|
-
|
|
35
|
-
colorHeader = input<'normal' | 'light'>('normal')
|
|
36
|
-
|
|
37
|
-
@ContentChild('customActions', { static: false }) customActions!: TemplateRef<any>
|
|
38
|
-
|
|
39
|
-
valueTemporal: any
|
|
40
|
-
|
|
41
|
-
deleteItems = model<number[]>([])
|
|
42
|
-
selectItems = model<any[]>([])
|
|
43
|
-
|
|
44
|
-
isDarkMode = input<boolean>(false)
|
|
45
|
-
selectedRadio = model<number | null>(null);
|
|
46
|
-
|
|
47
|
-
editItem = output<any>()
|
|
48
|
-
|
|
49
|
-
rendered = input<CellRendered[]>([])
|
|
50
|
-
|
|
51
|
-
concatenarValue(obj: any, value: string[]) {
|
|
52
|
-
let result = ''
|
|
53
|
-
value.forEach(el => {
|
|
54
|
-
result += obj[el]
|
|
55
|
-
})
|
|
56
|
-
return result
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
selectRow(index: any) {
|
|
60
|
-
if (this.identifier().length < 1) {
|
|
61
|
-
return this.selectedRow.set(index)
|
|
62
|
-
}
|
|
63
|
-
this.selectedRow.set(this.concatenarValue(index, this.identifier()))
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
getSituacionNumberFromColumns(row: any, columns: any[]): number {
|
|
67
|
-
const situacionColumn = columns.find(col => col.type == 'situacion_number');
|
|
68
|
-
if (situacionColumn) {
|
|
69
|
-
return row[situacionColumn.prop] || 0;
|
|
70
|
-
}
|
|
71
|
-
return 0
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
focusData(data: any) {
|
|
75
|
-
this.valueTemporal = data
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
validarData(value: any) {
|
|
79
|
-
if (this.valueTemporal == value) {
|
|
80
|
-
return false
|
|
81
|
-
}
|
|
82
|
-
this.valueTemporal = null
|
|
83
|
-
return true
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// useSelectionMode() {
|
|
87
|
-
// return this.selectItems() != undefined
|
|
88
|
-
// }
|
|
89
|
-
|
|
90
|
-
toogleItem(index: number, event: Event) {
|
|
91
|
-
const input = event.target as HTMLInputElement
|
|
92
|
-
if (input.checked) {
|
|
93
|
-
this.deleteItems.update(de => [...(de || []), index])
|
|
94
|
-
} else {
|
|
95
|
-
this.deleteItems.update(de => (de || []).filter(d => d != index))
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// if (this.useSelectionMode()) {
|
|
100
|
-
// if (input.checked) {
|
|
101
|
-
// this.selectItems.update(items => [...(items || []), row])
|
|
102
|
-
// } else {
|
|
103
|
-
// this.selectItems.update(items => (items || []).filter(item =>
|
|
104
|
-
// this.identifier().length > 0
|
|
105
|
-
// ? this.concatenarValue(item, this.identifier()) != this.concatenarValue(row, this.identifier())
|
|
106
|
-
// : item != row
|
|
107
|
-
// ))
|
|
108
|
-
// }
|
|
109
|
-
// } else {
|
|
110
|
-
// if (input.checked) {
|
|
111
|
-
// this.deleteItems.update(de => [...(de || []), index])
|
|
112
|
-
// } else {
|
|
113
|
-
// this.deleteItems.update(de => (de || []).filter(d => d != index))
|
|
114
|
-
// }
|
|
115
|
-
// }
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
allCheck(event: Event) {
|
|
119
|
-
const input = event.target as HTMLInputElement
|
|
120
|
-
|
|
121
|
-
if (input.checked) {
|
|
122
|
-
const total = this.rows().length
|
|
123
|
-
if (this.lastItemDisabled()) {
|
|
124
|
-
this.deleteItems.set(Array.from({ length: total - 1 }, (_, i) => i))
|
|
125
|
-
} else {
|
|
126
|
-
this.deleteItems.set(Array.from({ length: total }, (_, i) => i))
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
this.deleteItems.set([])
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// if (!this.useSelectionMode()) {
|
|
133
|
-
// if (input.checked) {
|
|
134
|
-
// const total = this.rows().length
|
|
135
|
-
// if (this.lastItemDisabled()) {
|
|
136
|
-
// this.deleteItems.set(Array.from({ length: total - 1 }, (_, i) => i))
|
|
137
|
-
// } else {
|
|
138
|
-
// this.deleteItems.set(Array.from({ length: total }, (_, i) => i))
|
|
139
|
-
// }
|
|
140
|
-
// } else {
|
|
141
|
-
// this.deleteItems.set([])
|
|
142
|
-
// }
|
|
143
|
-
// }
|
|
144
|
-
// else {
|
|
145
|
-
// if (input.checked) {
|
|
146
|
-
// let itemsToSelect = [...this.rows()]
|
|
147
|
-
// if (this.lastItemDisabled()) {
|
|
148
|
-
// itemsToSelect = itemsToSelect.slice(0, -1)
|
|
149
|
-
// }
|
|
150
|
-
// this.selectItems.set(itemsToSelect)
|
|
151
|
-
// } else {
|
|
152
|
-
// this.selectItems.set([])
|
|
153
|
-
// }
|
|
154
|
-
// }
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
validaAllCheck() {
|
|
158
|
-
const total = this.rows().length
|
|
159
|
-
if (this.lastItemDisabled() && total > 1) return this.deleteItems().length == (total - 1)
|
|
160
|
-
if (this.lastItemDisabled() && total <= 1) return false
|
|
161
|
-
return this.deleteItems().length == total
|
|
162
|
-
// if (!this.useSelectionMode()) {
|
|
163
|
-
// const total = this.rows().length
|
|
164
|
-
// if (this.lastItemDisabled() && total > 1) return this.deleteItems().length == (total - 1)
|
|
165
|
-
// if (this.lastItemDisabled() && total <= 1) return false
|
|
166
|
-
// return this.deleteItems().length == total
|
|
167
|
-
// }
|
|
168
|
-
// else {
|
|
169
|
-
// const totalItems = this.lastItemDisabled()
|
|
170
|
-
// ? this.rows().length - 1
|
|
171
|
-
// : this.rows().length
|
|
172
|
-
// return this.selectItems().length === totalItems && totalItems > 0
|
|
173
|
-
// }
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
isItemSelected(index: number): boolean {
|
|
177
|
-
return this.deleteItems().includes(index)
|
|
178
|
-
// if (!this.useSelectionMode()) {
|
|
179
|
-
// return this.deleteItems().includes(index)
|
|
180
|
-
// }
|
|
181
|
-
// else {
|
|
182
|
-
// const row = this.rows()[index]
|
|
183
|
-
// return this.selectItems().some(item =>
|
|
184
|
-
// this.identifier().length > 0
|
|
185
|
-
// ? this.concatenarValue(item, this.identifier()) === this.concatenarValue(row, this.identifier())
|
|
186
|
-
// : item === row
|
|
187
|
-
// )
|
|
188
|
-
// }
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
clickRadio(index: number) {
|
|
192
|
-
if (this.lastItemDisabled() && this.validaLastRegistro(index)) {
|
|
193
|
-
return
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
this.selectedRadio.set(index)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
validaLastRegistro = (index: number) => {
|
|
200
|
-
const registros = (this.rows() ?? []).length
|
|
201
|
-
return registros == index + 1
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
limpiarNumero(numero: any) {
|
|
205
|
-
if (typeof numero == 'string') return cleanNumber(numero)
|
|
206
|
-
if (!numero) return 0
|
|
207
|
-
return numero
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
widthDefault = (column: any) => {
|
|
211
|
-
if ((column.tipo == 'input' || column.tipo == 'input-number' || column.tipo == 'input-decimal') && column.width < 100) {
|
|
212
|
-
return 100
|
|
213
|
-
}
|
|
214
|
-
return column.width
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
manejarDataEtiqueta(data: any, row: any) {
|
|
218
|
-
row.etiqueta = data.ETIQUETA
|
|
219
|
-
row.fvenci = data.FVENCI
|
|
220
|
-
row.ancho = data.ANCHO
|
|
221
|
-
row.lote = data.LOTE
|
|
222
|
-
row.acabado = data.ACABADO
|
|
223
|
-
row.nrocarrete = data.NROCARRETE
|
|
224
|
-
row.chasis = data.CHASIS
|
|
225
|
-
row.motor = data.MOTOR
|
|
226
|
-
row.opnumdoc = data.OPNUMDOC
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
limpiarEtiqueta(event: boolean, row: any) {
|
|
230
|
-
if (!event) {
|
|
231
|
-
row = { ...row, etiqueta: '', fvenci: '', ancho: null, lote: '', acabado: '', nrocarrete: '', chasis: '', motor: '', opnumdoc: '' }
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
generateKeyDisabled = (item: any, column: any) => {
|
|
236
|
-
const generate = `disabled${column.fieldname}`
|
|
237
|
-
return item[generate] ?? false
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
validaAccionDescri = (index: number) => {
|
|
241
|
-
const rows = (this.rows() ?? []).length - 1
|
|
242
|
-
return this.lastItemDisabled() && index == rows
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
validarFunction = (value: any) => {
|
|
246
|
-
if (typeof value === 'function') return value
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
validaEdit(positi: number) {
|
|
251
|
-
if (this.lastItemDisabled() && this.validaLastRegistro(positi)) return false
|
|
252
|
-
return true
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
disabledColumn = (row: any, column: any) => {
|
|
256
|
-
if (row.disabledAll) return true;
|
|
257
|
-
if (column.disabled) return true;
|
|
258
|
-
return false
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
resolveCell(col: string, row: any): CellRender {
|
|
262
|
-
const value = row[col]
|
|
263
|
-
const r = this.rendered().find(r => r.matches(col, value, row))
|
|
264
|
-
return r ? r.render(value, row) : null
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
getRowClass(row: any): string {
|
|
268
|
-
const match = this.rendered()?.find(r => r.matches('*', null, row))
|
|
269
|
-
return match ? match.render(null, row)?.class || '' : ''
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
rowFilter = computed(() => {
|
|
273
|
-
const term = this.busqueda().toLowerCase()
|
|
274
|
-
const currentRows = this.rows?.() || []
|
|
275
|
-
return currentRows.filter(item => this.filtraItem(item, term))
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
getTipoCampo(fieldname: string): string {
|
|
279
|
-
const columna = this.columns().find(col => col.fieldname == fieldname)
|
|
280
|
-
return columna?.tipo ?? 'string'
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
private filtraItem(item: any, term: string): boolean {
|
|
284
|
-
const columnasActivas = Object.entries(this.filtrarColumnas())
|
|
285
|
-
.filter(([_campo, activo]) => activo)
|
|
286
|
-
|
|
287
|
-
return columnasActivas.some(([campo]) => {
|
|
288
|
-
let valor = item[campo]
|
|
289
|
-
const tipo = this.getTipoCampo(campo)
|
|
290
|
-
|
|
291
|
-
switch (tipo) {
|
|
292
|
-
case 'fecha':
|
|
293
|
-
valor = this.datePipe.transform(valor, 'dd/MM/yyyy') ?? ''
|
|
294
|
-
break
|
|
295
|
-
case 'decimal':
|
|
296
|
-
valor = this.decimalPipe.transform(valor, '1.2-2') ?? ''
|
|
297
|
-
break
|
|
298
|
-
case 'check':
|
|
299
|
-
valor = valor ? 'Sí' : 'No'
|
|
300
|
-
break
|
|
301
|
-
default:
|
|
302
|
-
valor = (valor ?? '').toString()
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return valor.toLowerCase().includes(term)
|
|
306
|
-
})
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
filtrarColumnas = linkedSignal(() => {
|
|
310
|
-
const columns = this.columns()
|
|
311
|
-
const filtro: { [caption: string]: boolean } = {}
|
|
312
|
-
columns.forEach((col) => {
|
|
313
|
-
if (col.fieldname) {
|
|
314
|
-
filtro[col.fieldname] = true
|
|
315
|
-
}
|
|
316
|
-
})
|
|
317
|
-
return filtro
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
textoDigitado(event: Event) {
|
|
321
|
-
const value = (event.target as HTMLInputElement).value
|
|
322
|
-
this.busqueda.set(value)
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
getHighlight(text: any): string {
|
|
326
|
-
if (text == null) {
|
|
327
|
-
text = ''
|
|
328
|
-
}
|
|
329
|
-
if (!this.busqueda()) return text
|
|
330
|
-
if (typeof text !== 'string') {
|
|
331
|
-
text = text.toString()
|
|
332
|
-
}
|
|
333
|
-
const regex = new RegExp(`(${this.busqueda()})`, 'gi')
|
|
334
|
-
return text?.replace(regex, '<mark>$1</mark>')
|
|
335
|
-
}
|
|
336
|
-
}
|