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.
Files changed (237) hide show
  1. package/fesm2022/ng-components-tsi.mjs +5063 -0
  2. package/fesm2022/ng-components-tsi.mjs.map +1 -0
  3. package/index.d.ts +5 -0
  4. package/lib/directivas/acciones/atajos.directive.d.ts +8 -0
  5. package/lib/directivas/animaciones/fade-animation.d.ts +3 -0
  6. package/lib/directivas/estilos/animated-checkbox.directive.d.ts +9 -0
  7. package/lib/directivas/estilos/button.constants.d.ts +64 -0
  8. package/lib/directivas/estilos/buttons-modal.directive.d.ts +11 -0
  9. package/lib/directivas/estilos/buttons-outline-directive.d.ts +11 -0
  10. package/lib/directivas/estilos/icons.directive.d.ts +11 -0
  11. package/lib/directivas/inputs/caracteres-codigo.directive.d.ts +12 -0
  12. package/lib/directivas/inputs/decimal.directive.d.ts +13 -0
  13. package/lib/directivas/inputs/only-day.directive.d.ts +8 -0
  14. package/lib/directivas/inputs/only-number-flex.directive.d.ts +9 -0
  15. package/lib/directivas/inputs/only-number.directive.d.ts +8 -0
  16. package/lib/enums/table-events.d.ts +5 -0
  17. package/lib/modals/general/md-generico/md-generico.component.d.ts +25 -0
  18. package/lib/models/button-color.model.d.ts +3 -0
  19. package/{src/lib/models/button-properties.model.ts → lib/models/button-properties.model.d.ts} +7 -8
  20. package/lib/models/cell-rendered.d.ts +11 -0
  21. package/lib/models/comercial/documentos-cab-auxiliares.model.d.ts +17 -0
  22. package/{src/lib/models/dropdownoption.model.ts → lib/models/dropdownoption.model.d.ts} +14 -15
  23. package/lib/models/general/recursos.model.d.ts +271 -0
  24. package/lib/models/general/utils.interface.d.ts +57 -0
  25. package/lib/models/input-config.d.ts +25 -0
  26. package/{src/lib/models/selected-row.ts → lib/models/selected-row.d.ts} +4 -4
  27. package/{src/lib/models/table-data.model.ts → lib/models/table-data.model.d.ts} +21 -21
  28. package/lib/service/alert-confirmation.service.d.ts +26 -0
  29. package/lib/service/alert-error.service.d.ts +9 -0
  30. package/lib/service/alert.service.d.ts +33 -0
  31. package/lib/service/formateador.service.d.ts +10 -0
  32. package/lib/service/toast.service.d.ts +25 -0
  33. package/lib/ui/alerts/alert-confirmation/alert-confirmation.component.d.ts +32 -0
  34. package/lib/ui/alerts/alert-error/alert-error.component.d.ts +9 -0
  35. package/lib/ui/alerts/alerta/alerta.component.d.ts +12 -0
  36. package/lib/ui/alerts/badge/badge.component.d.ts +8 -0
  37. package/lib/ui/alerts/toaster/toaster.component.d.ts +17 -0
  38. package/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.d.ts +11 -0
  39. package/lib/ui/dropdown/dropdown-simple/dropdown.component.d.ts +13 -0
  40. package/lib/ui/forms/button/button.component.d.ts +47 -0
  41. package/lib/ui/forms/filter-toggle/filter-toggle.component.d.ts +9 -0
  42. package/lib/ui/forms/header/header.component.d.ts +17 -0
  43. package/lib/ui/forms/inputs/autocomplete/autocomplete.component.d.ts +43 -0
  44. package/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.d.ts +48 -0
  45. package/lib/ui/forms/inputs/check-box/check-box.component.d.ts +14 -0
  46. package/lib/ui/forms/inputs/doble-input/doble-input.component.d.ts +47 -0
  47. package/lib/ui/forms/inputs/input/input.component.d.ts +60 -0
  48. package/lib/ui/forms/inputs/input-clase/input-clase.component.d.ts +13 -0
  49. package/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.d.ts +8 -0
  50. package/lib/ui/forms/inputs/input-radio/input-radio.component.d.ts +24 -0
  51. package/lib/ui/forms/inputs/multiselected/multiselected.component.d.ts +39 -0
  52. package/lib/ui/forms/inputs/radio/radio.component.d.ts +14 -0
  53. package/lib/ui/forms/inputs/switch/switch.component.d.ts +20 -0
  54. package/lib/ui/forms/inputs/switch-activo/switch-activo.component.d.ts +21 -0
  55. package/lib/ui/forms/lists/list-option/list-option.component.d.ts +23 -0
  56. package/lib/ui/forms/lists/list-situaciones/list-situaciones.component.d.ts +28 -0
  57. package/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.d.ts +26 -0
  58. package/lib/ui/forms/sidebar/sidebar.component.d.ts +15 -0
  59. package/lib/ui/general/detalle-credito/detalle-credito.component.d.ts +8 -0
  60. package/lib/ui/general/montos-calcular/montos-calcular.component.d.ts +12 -0
  61. package/lib/ui/general/spinner/spinner.component.d.ts +5 -0
  62. package/lib/ui/tables/card-mobile/card-mobile.component.d.ts +17 -0
  63. package/lib/ui/tables/dropdown-menu/dropdown-menu.component.d.ts +43 -0
  64. package/lib/ui/tables/paginador/paginador.component.d.ts +20 -0
  65. package/lib/ui/tables/table-advance/table-advance.component.d.ts +94 -0
  66. package/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.d.ts +82 -0
  67. package/lib/ui/tables/table-agrupada/table-agrupada.component.d.ts +96 -0
  68. package/lib/ui/tables/table-busqueda/table-busqueda.component.d.ts +48 -0
  69. package/lib/ui/tables/table-detalle/table-detalle.component.d.ts +59 -0
  70. package/lib/ui/tables/table-simple/table-simple.component.d.ts +39 -0
  71. package/lib/ui/tables/table-ultimate/table-ultimate.component.d.ts +84 -0
  72. package/lib/ui/tabs/nav-tabs/nav-tabs.component.d.ts +9 -0
  73. package/lib/ui/tabs/tab-item/tab-item.component.d.ts +9 -0
  74. package/lib/utils/general/validaciones-simple.d.ts +2 -0
  75. package/lib/utils/general/validaciones.d.ts +11 -0
  76. package/lib/utils/helpers/api-result.d.ts +17 -0
  77. package/lib/utils/helpers/modal-result.d.ts +10 -0
  78. package/ng-components-tsi-0.0.39.tgz +0 -0
  79. package/package.json +31 -23
  80. package/{src/public-api.ts → public-api.d.ts} +68 -99
  81. package/ng-package.json +0 -7
  82. package/src/lib/directivas/acciones/atajos.directive.ts +0 -26
  83. package/src/lib/directivas/animaciones/fade-animation.ts +0 -45
  84. package/src/lib/directivas/animaciones/fade.directive.ts +0 -43
  85. package/src/lib/directivas/estilos/animated-checkbox.directive.ts +0 -26
  86. package/src/lib/directivas/estilos/button.constants.ts +0 -66
  87. package/src/lib/directivas/estilos/buttons-modal.directive.ts +0 -36
  88. package/src/lib/directivas/estilos/buttons-outline-directive.ts +0 -27
  89. package/src/lib/directivas/estilos/icons.directive.ts +0 -26
  90. package/src/lib/directivas/inputs/caracteres-codigo.directive.ts +0 -63
  91. package/src/lib/directivas/inputs/decimal.directive.ts +0 -51
  92. package/src/lib/directivas/inputs/only-day.directive.ts +0 -53
  93. package/src/lib/directivas/inputs/only-number-flex.directive.ts +0 -50
  94. package/src/lib/directivas/inputs/only-number.directive.ts +0 -53
  95. package/src/lib/enums/table-events.ts +0 -5
  96. package/src/lib/modals/general/md-generico/md-generico.component.html +0 -44
  97. package/src/lib/modals/general/md-generico/md-generico.component.scss +0 -4
  98. package/src/lib/modals/general/md-generico/md-generico.component.ts +0 -50
  99. package/src/lib/models/button-color.model.ts +0 -9
  100. package/src/lib/models/cell-rendered.ts +0 -12
  101. package/src/lib/models/comercial/documentos-cab-auxiliares.model.ts +0 -18
  102. package/src/lib/models/general/recursos.model.ts +0 -285
  103. package/src/lib/models/general/utils.interface.ts +0 -66
  104. package/src/lib/models/input-config.ts +0 -26
  105. package/src/lib/service/alert-confirmation.service.ts +0 -87
  106. package/src/lib/service/alert-error.service.ts +0 -27
  107. package/src/lib/service/alert.service.ts +0 -216
  108. package/src/lib/service/formateador.service.ts +0 -49
  109. package/src/lib/service/toast.service.ts +0 -75
  110. package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.html +0 -40
  111. package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.scss +0 -42
  112. package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.ts +0 -118
  113. package/src/lib/ui/alerts/alert-error/alert-error.component.html +0 -11
  114. package/src/lib/ui/alerts/alert-error/alert-error.component.scss +0 -39
  115. package/src/lib/ui/alerts/alert-error/alert-error.component.ts +0 -27
  116. package/src/lib/ui/alerts/alerta/alerta.component.html +0 -18
  117. package/src/lib/ui/alerts/alerta/alerta.component.scss +0 -104
  118. package/src/lib/ui/alerts/alerta/alerta.component.ts +0 -25
  119. package/src/lib/ui/alerts/badge/badge.component.ts +0 -16
  120. package/src/lib/ui/alerts/toaster/toaster.component.html +0 -52
  121. package/src/lib/ui/alerts/toaster/toaster.component.scss +0 -275
  122. package/src/lib/ui/alerts/toaster/toaster.component.ts +0 -50
  123. package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.html +0 -20
  124. package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.scss +0 -11
  125. package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.ts +0 -18
  126. package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.html +0 -10
  127. package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.scss +0 -54
  128. package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.ts +0 -36
  129. package/src/lib/ui/forms/button/button.component.html +0 -69
  130. package/src/lib/ui/forms/button/button.component.scss +0 -126
  131. package/src/lib/ui/forms/button/button.component.ts +0 -137
  132. package/src/lib/ui/forms/filter-toggle/filter-toggle.component.scss +0 -22
  133. package/src/lib/ui/forms/filter-toggle/filter-toggle.component.ts +0 -29
  134. package/src/lib/ui/forms/header/header.component.html +0 -22
  135. package/src/lib/ui/forms/header/header.component.scss +0 -22
  136. package/src/lib/ui/forms/header/header.component.ts +0 -40
  137. package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.html +0 -46
  138. package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.scss +0 -90
  139. package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.ts +0 -203
  140. package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.html +0 -61
  141. package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.scss +0 -128
  142. package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.ts +0 -145
  143. package/src/lib/ui/forms/inputs/check-box/check-box.component.html +0 -6
  144. package/src/lib/ui/forms/inputs/check-box/check-box.component.ts +0 -24
  145. package/src/lib/ui/forms/inputs/doble-input/doble-input.component.html +0 -60
  146. package/src/lib/ui/forms/inputs/doble-input/doble-input.component.scss +0 -86
  147. package/src/lib/ui/forms/inputs/doble-input/doble-input.component.ts +0 -129
  148. package/src/lib/ui/forms/inputs/input/input.component.html +0 -169
  149. package/src/lib/ui/forms/inputs/input/input.component.scss +0 -74
  150. package/src/lib/ui/forms/inputs/input/input.component.ts +0 -147
  151. package/src/lib/ui/forms/inputs/input-clase/input-clase.component.html +0 -30
  152. package/src/lib/ui/forms/inputs/input-clase/input-clase.component.scss +0 -0
  153. package/src/lib/ui/forms/inputs/input-clase/input-clase.component.ts +0 -28
  154. package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.html +0 -41
  155. package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.scss +0 -0
  156. package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.ts +0 -17
  157. package/src/lib/ui/forms/inputs/input-radio/input-radio.component.html +0 -26
  158. package/src/lib/ui/forms/inputs/input-radio/input-radio.component.scss +0 -53
  159. package/src/lib/ui/forms/inputs/input-radio/input-radio.component.ts +0 -36
  160. package/src/lib/ui/forms/inputs/multiselected/multiselected.component.html +0 -56
  161. package/src/lib/ui/forms/inputs/multiselected/multiselected.component.scss +0 -145
  162. package/src/lib/ui/forms/inputs/multiselected/multiselected.component.ts +0 -109
  163. package/src/lib/ui/forms/inputs/radio/radio.component.html +0 -7
  164. package/src/lib/ui/forms/inputs/radio/radio.component.scss +0 -0
  165. package/src/lib/ui/forms/inputs/radio/radio.component.ts +0 -23
  166. package/src/lib/ui/forms/inputs/switch/switch.component.html +0 -12
  167. package/src/lib/ui/forms/inputs/switch/switch.component.scss +0 -48
  168. package/src/lib/ui/forms/inputs/switch/switch.component.ts +0 -50
  169. package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.html +0 -12
  170. package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.scss +0 -65
  171. package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.ts +0 -52
  172. package/src/lib/ui/forms/lists/list-option/list-option.component.html +0 -24
  173. package/src/lib/ui/forms/lists/list-option/list-option.component.scss +0 -49
  174. package/src/lib/ui/forms/lists/list-option/list-option.component.ts +0 -35
  175. package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.html +0 -29
  176. package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.scss +0 -0
  177. package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.ts +0 -99
  178. package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.html +0 -46
  179. package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.scss +0 -30
  180. package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.ts +0 -96
  181. package/src/lib/ui/forms/sidebar/sidebar.component.html +0 -33
  182. package/src/lib/ui/forms/sidebar/sidebar.component.scss +0 -85
  183. package/src/lib/ui/forms/sidebar/sidebar.component.ts +0 -61
  184. package/src/lib/ui/general/detalle-credito/detalle-credito.component.html +0 -35
  185. package/src/lib/ui/general/detalle-credito/detalle-credito.component.scss +0 -35
  186. package/src/lib/ui/general/detalle-credito/detalle-credito.component.ts +0 -14
  187. package/src/lib/ui/general/montos-calcular/montos-calcular.component.html +0 -17
  188. package/src/lib/ui/general/montos-calcular/montos-calcular.component.scss +0 -36
  189. package/src/lib/ui/general/montos-calcular/montos-calcular.component.ts +0 -19
  190. package/src/lib/ui/general/spinner/spinner.component.html +0 -8
  191. package/src/lib/ui/general/spinner/spinner.component.scss +0 -96
  192. package/src/lib/ui/general/spinner/spinner.component.ts +0 -11
  193. package/src/lib/ui/tables/card-mobile/card-mobile.component.html +0 -34
  194. package/src/lib/ui/tables/card-mobile/card-mobile.component.scss +0 -0
  195. package/src/lib/ui/tables/card-mobile/card-mobile.component.ts +0 -36
  196. package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.html +0 -59
  197. package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.scss +0 -88
  198. package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.ts +0 -171
  199. package/src/lib/ui/tables/paginador/paginador.component.html +0 -12
  200. package/src/lib/ui/tables/paginador/paginador.component.scss +0 -27
  201. package/src/lib/ui/tables/paginador/paginador.component.ts +0 -49
  202. package/src/lib/ui/tables/table-advance/table-advance.component.html +0 -322
  203. package/src/lib/ui/tables/table-advance/table-advance.component.scss +0 -282
  204. package/src/lib/ui/tables/table-advance/table-advance.component.ts +0 -421
  205. package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.html +0 -226
  206. package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.scss +0 -282
  207. package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.ts +0 -352
  208. package/src/lib/ui/tables/table-agrupada/table-agrupada.component.html +0 -340
  209. package/src/lib/ui/tables/table-agrupada/table-agrupada.component.scss +0 -282
  210. package/src/lib/ui/tables/table-agrupada/table-agrupada.component.ts +0 -425
  211. package/src/lib/ui/tables/table-busqueda/table-busqueda.component.html +0 -130
  212. package/src/lib/ui/tables/table-busqueda/table-busqueda.component.scss +0 -189
  213. package/src/lib/ui/tables/table-busqueda/table-busqueda.component.ts +0 -199
  214. package/src/lib/ui/tables/table-detalle/table-detalle.component.html +0 -220
  215. package/src/lib/ui/tables/table-detalle/table-detalle.component.scss +0 -135
  216. package/src/lib/ui/tables/table-detalle/table-detalle.component.ts +0 -336
  217. package/src/lib/ui/tables/table-simple/table-simple.component.html +0 -116
  218. package/src/lib/ui/tables/table-simple/table-simple.component.scss +0 -70
  219. package/src/lib/ui/tables/table-simple/table-simple.component.ts +0 -141
  220. package/src/lib/ui/tables/table-ultimate/table-ultimate.component.html +0 -268
  221. package/src/lib/ui/tables/table-ultimate/table-ultimate.component.scss +0 -282
  222. package/src/lib/ui/tables/table-ultimate/table-ultimate.component.ts +0 -383
  223. package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.html +0 -12
  224. package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.scss +0 -100
  225. package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.ts +0 -19
  226. package/src/lib/ui/tabs/tab-item/tab-item.component.html +0 -0
  227. package/src/lib/ui/tabs/tab-item/tab-item.component.scss +0 -0
  228. package/src/lib/ui/tabs/tab-item/tab-item.component.ts +0 -13
  229. package/src/lib/utils/ayuda-global/datatable.ts +0 -67
  230. package/src/lib/utils/ayuda-global/filtros-busqueda.ts +0 -51
  231. package/src/lib/utils/general/validaciones-simple.ts +0 -14
  232. package/src/lib/utils/general/validaciones.ts +0 -123
  233. package/src/lib/utils/helpers/api-result.ts +0 -95
  234. package/src/lib/utils/helpers/modal-result.ts +0 -34
  235. package/tsconfig.lib.json +0 -15
  236. package/tsconfig.lib.prod.json +0 -11
  237. 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,425 +0,0 @@
1
- import { DecimalPipe, NgClass, NgTemplateOutlet } from '@angular/common';
2
- import { Component, computed, contentChild, effect, ElementRef, HostListener, inject, input, linkedSignal, model, output, QueryList, signal, TemplateRef, untracked, viewChild, ViewChild, ViewChildren } from '@angular/core';
3
- import { FormsModule } from '@angular/forms';
4
- import { DropdownCdkComponent } from "../../dropdown/dropdown-cdk/dropdown-cdk.component";
5
- import { CardMobileComponent } from "../card-mobile/card-mobile.component";
6
- import { CellRender, CellRendered } from '../../../models/cell-rendered';
7
- import { TableData } from '../../../models/table-data.model';
8
- import { formatNumber, validarBoolean } from 'shared-tsi';
9
- import { FormateadorService } from '../../../service/formateador.service';
10
- import { SelectedRow } from '../../../models/selected-row';
11
- import { fadeInOut, dropdownAnimation } from '../../../directivas/animaciones/fade-animation';
12
- import { AnimatedCheckboxDirective } from '../../../directivas/estilos/animated-checkbox.directive';
13
-
14
- interface HeaderSegment {
15
- type: 'column' | 'group'
16
- column?: TableData
17
- group?: {
18
- label: string
19
- colspan: number
20
- }
21
- }
22
-
23
- @Component({
24
- selector: 'app-table-agrupada',
25
- imports: [DropdownCdkComponent, FormsModule, NgClass, NgTemplateOutlet, CardMobileComponent, AnimatedCheckboxDirective],
26
- templateUrl: './table-agrupada.component.html',
27
- styleUrl: './table-agrupada.component.scss',
28
- animations: [fadeInOut, dropdownAnimation]
29
- })
30
- export class TableAgrupadaComponent {
31
-
32
- tableHeaders = viewChild<QueryList<ElementRef>>('thElement')
33
- customActions = contentChild<TemplateRef<any>>('customActions')
34
- anchor = viewChild<ElementRef<HTMLTableRowElement>>('anchor')
35
-
36
- private readonly formateador = inject(FormateadorService)
37
- private decimalPipe = inject(DecimalPipe)
38
- titleTabla = input<string>('Contrato')
39
- rows = input<any[]>([])
40
- columns = input<any[]>([])
41
- withDetails = input<boolean>(false)
42
- withFiltro = input<boolean>(false)
43
- altoContainer = input<number>()
44
- colorHeader = input<'normal' | 'light'>('normal')
45
-
46
- busqueda = signal<string>('')
47
- selectedRow = model<any>(null)
48
- identifier = input<string[]>([])
49
-
50
- altoContenedor = signal<number>(0)
51
- withHeight = input<boolean>(false)
52
- rendered = input<CellRendered[]>([])
53
- withTotal = input<boolean>(false)
54
- withCheckbox = input<boolean>(false)
55
- selectItems = model<SelectedRow<any>[]>([])
56
- isDarkMode = input<boolean>(false)
57
-
58
- sortColumn: string | null = null
59
- sortDirection: 'asc' | 'desc' = 'asc'
60
- expandedRows: number = -1
61
-
62
- activeMobileMode = input<boolean>(true)
63
-
64
- /* VARIABLES PARA OPTIMIZAR */
65
- dataVirtual = signal<any[]>([])
66
- isLoading = signal(false);
67
- isLoadingResponsive = signal(false)
68
-
69
- private loadedCount = 0;
70
- private observer!: IntersectionObserver;
71
- maxItems = input<number>(50)
72
- batchSize = input<number>(40)
73
-
74
- rowClassFn = input<(row: any) => string | string[] | Record<string, boolean>>(null);
75
- rowDisabledFn = input<((row: any) => boolean) | null>(null);
76
-
77
- hasColumnGroups = computed(() => this.columns().some(col => !!col.group))
78
- groupedColumns = computed(() => {
79
- if (!this.hasColumnGroups()) return []
80
- return this.columns().filter(c => c.group && c.visible !== false)
81
- })
82
-
83
- headerSegments = computed<HeaderSegment[]>(() => {
84
- const cols = this.columns().filter(c => c.visible !== false)
85
- if (!cols.some(c => c.group)) {
86
- return cols.map(col => ({ type: 'column', column: col }))
87
- }
88
- const result: HeaderSegment[] = []
89
- let i = 0
90
- while (i < cols.length) {
91
- const col = cols[i]
92
- if (!col.group) {
93
- result.push({ type: 'column', column: col })
94
- i++
95
- continue
96
- }
97
- const groupName = col.group
98
- let colspan = 0
99
- while (i < cols.length && cols[i].group === groupName) {
100
- colspan++
101
- i++
102
- }
103
- result.push({ type: 'group', group: { label: groupName, colspan } })
104
- }
105
- return result
106
- })
107
-
108
- rowEvent = output<any>()
109
-
110
- rowFormat = computed(() => this.formateador.procesarLista(this.rows(), this.columns()))
111
-
112
- rowFilter = linkedSignal(() => {
113
- const term = this.busqueda().toLowerCase()
114
- const currentRows = this.rowFormat?.() || []
115
- return currentRows.filter(item => this.filtraItem(item, term))
116
- })
117
-
118
- filtrarColumnas = linkedSignal(() => {
119
- const columns = this.columns()
120
- const filtro: { [caption: string]: boolean } = {}
121
- columns.forEach((col) => {
122
- if (col.fieldname) {
123
- filtro[col.fieldname] = true
124
- }
125
- })
126
- return filtro
127
- })
128
-
129
- toggleFiltros(event: Event) {
130
- const checked = (event.target as HTMLInputElement).checked
131
- const filtros = this.filtrarColumnas()
132
- Object.keys(filtros).forEach(key => {
133
- filtros[key] = checked
134
- })
135
- }
136
-
137
- visibilidadColumn = linkedSignal(() => {
138
- const columnVisibility: { [key: string]: boolean } = {}
139
- this.columns().forEach(col => {
140
- if (col.fieldname) {
141
- columnVisibility[col.fieldname] = true
142
- }
143
- })
144
- return columnVisibility
145
- })
146
-
147
- concatenarValue(obj: any, value: string[]) {
148
- let result = ''
149
- value.forEach(el => {
150
- result += obj[el]
151
- })
152
- return result
153
- }
154
-
155
- isMobile = signal<boolean>(window.innerWidth <= 768)
156
-
157
- constructor() {
158
- effect(() => {
159
- const size = (this.rowFilter() ?? []).length
160
-
161
- const alto = this.altoContainer()
162
- if (alto > 0 && alto < this.altoContenedor()) {
163
- setTimeout(() => {
164
- this.altoContenedor.set(alto)
165
- }, 300)
166
- }
167
- if (alto > 0 && alto > this.altoContenedor()) {
168
- this.altoContenedor.set(alto)
169
- }
170
-
171
- const selected = untracked(() => this.selectedRow())
172
- if (size > 0 && selected) {
173
- queueMicrotask(() => {
174
- const el = document.getElementById('row_table_' + selected)
175
- el?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
176
- })
177
- }
178
- })
179
-
180
- effect(() => this.resetSroll());
181
-
182
- effect(() => {
183
- if (!this.activeMobileMode()) return
184
- this.isMobile();
185
- this.isLoadingResponsive.set(true);
186
- setTimeout(() => this.isLoadingResponsive.set(false), 200);
187
- });
188
-
189
- effect(() => {
190
- if (this.anchor()) {
191
- this.actionsAnchor()
192
- }
193
- })
194
- }
195
-
196
- @HostListener('window:resize', ['$event'])
197
- onResize(event: any) {
198
- if (!this.activeMobileMode()) return
199
- this.isMobile.set(event.target.innerWidth <= 768);
200
- }
201
-
202
- resetSroll() {
203
- const filtered = this.rowFilter();
204
- const firstBatch = filtered.slice(0, this.batchSize());
205
- this.dataVirtual.set(firstBatch);
206
- this.loadedCount = firstBatch.length;
207
- }
208
-
209
- actionsAnchor() {
210
- this.observer = new IntersectionObserver(entries => {
211
- if (entries[0].isIntersecting && this.loadedCount < this.rowFilter().length && !this.isLoading()) {
212
- this.loadMore();
213
- }
214
- });
215
- this.observer.observe(this.anchor().nativeElement);
216
- }
217
-
218
- selectRow(index: any) {
219
- if (this.identifier().length < 1) {
220
- return this.selectedRow.set(index)
221
- }
222
- this.selectedRow.set(this.concatenarValue(index, this.identifier()))
223
- }
224
-
225
- sortTable(column: string) {
226
- if (this.sortColumn == column) {
227
- this.sortDirection = this.sortDirection == 'asc' ? 'desc' : 'asc'
228
- } else {
229
- this.sortColumn = column
230
- this.sortDirection = 'asc'
231
- }
232
-
233
- const sorted = [...this.rowFilter()].sort((a, b) => {
234
- const valueA = a[column] ?? '';
235
- const valueB = b[column] ?? '';
236
-
237
- if (typeof valueA === 'number' && typeof valueB === 'number') {
238
- return this.sortDirection === 'asc'
239
- ? valueA - valueB
240
- : valueB - valueA;
241
- }
242
-
243
- // VALIDACION ADICIONAL, SI ES TEXTO ,PERO NUMEROS
244
- const numA = Number(valueA);
245
- const numB = Number(valueB);
246
-
247
- if (!isNaN(numA) && !isNaN(numB)) {
248
- return this.sortDirection === 'asc'
249
- ? numA - numB
250
- : numB - numA;
251
- }
252
-
253
- return this.sortDirection === 'asc'
254
- ? valueA.toString().localeCompare(valueB.toString())
255
- : valueB.toString().localeCompare(valueA.toString());
256
- });
257
-
258
- this.rowFilter.set(sorted);
259
- this.resetSroll()
260
-
261
- // this.dataVirtual().sort((a, b) => {
262
- // const valueA = a[column] ?? ''
263
- // const valueB = b[column] ?? ''
264
-
265
- // if (typeof valueA == 'number' && typeof valueB == 'number') {
266
- // return this.sortDirection == 'asc' ? valueA - valueB : valueB - valueA
267
- // } else {
268
- // return this.sortDirection == 'asc'
269
- // ? valueA.toString().localeCompare(valueB.toString())
270
- // : valueB.toString().localeCompare(valueA.toString())
271
- // }
272
- // })
273
- }
274
-
275
- toggleExpandRow(index: number) {
276
- this.expandedRows = this.expandedRows == index ? -1 : index
277
- }
278
-
279
- textoDigitado(event: Event) {
280
- const value = (event.target as HTMLInputElement).value
281
- this.busqueda.set(value)
282
- }
283
-
284
- getHighlight(text: any, fieldname: string): string {
285
- if (text == null) {
286
- text = ''
287
- }
288
- if (!this.filtrarColumnas()[fieldname] || !this.busqueda()) return text
289
- if (typeof text !== 'string') {
290
- text = text.toString()
291
- }
292
- const regex = new RegExp(`(${this.busqueda()})`, 'gi')
293
- return text?.replace(regex, '<mark>$1</mark>')
294
- }
295
-
296
- getSituacionNumberFromColumns(row: any, columns: any[]): number {
297
- const situacionColumn = columns.find(col => col.type == 'situacion_number')
298
- if (situacionColumn) {
299
- return row[situacionColumn.prop] || 0
300
- }
301
- return 0
302
- }
303
-
304
- private filtraItem(item: any, term: string): boolean {
305
- const columnasActivas = Object.entries(this.filtrarColumnas())
306
- .filter(([_campo, activo]) => activo)
307
- return columnasActivas.some(([campo]) => {
308
- const raw = item[campo];
309
- const formatted = item._format?.[campo];
310
- const valor = (formatted ?? raw ?? '').toString().toLowerCase();
311
- return valor.includes(term)
312
- })
313
- }
314
-
315
- validaVisibilidad(value: boolean) {
316
- return validarBoolean(value)
317
- }
318
-
319
- isCheckboxDisabled(row: any): boolean {
320
- return this.rowDisabledFn?.()?.(row) ?? false
321
- }
322
-
323
- allCheck(event: Event) {
324
- const input = event.target as HTMLInputElement
325
- if (input.checked) {
326
- const total = this.rowFilter()
327
- .filter(r => !this.isCheckboxDisabled(r))
328
- .map(r => ({ id: r.idListTsi, data: r }))
329
- this.selectItems.set(total)
330
- } else {
331
- this.selectItems.set([])
332
- }
333
- }
334
-
335
- validaAllCheck(): boolean {
336
- const selectable = this.rowFilter().filter(r => !this.isCheckboxDisabled(r))
337
- const selectedIds = new Set(this.selectItems().map(s => s.id));
338
- return selectable.length > 0 && selectable.every(row => selectedIds.has(row.idListTsi));
339
- }
340
-
341
- isItemSelected(id: string): boolean {
342
- return this.selectItems().some(item => item.id == id)
343
- }
344
-
345
- toogleItem(idList: string, event: Event) {
346
- const row = this.rowFormat().find(r => r.idListTsi == idList)
347
- if (!row || this.isCheckboxDisabled(row)) {
348
- return
349
- }
350
-
351
- const input = event.target as HTMLInputElement
352
- if (input.checked) {
353
- const item: SelectedRow<any> = { id: idList, data: row };
354
- this.selectItems.update(sel => [...sel, item])
355
- return
356
- }
357
- this.selectItems.update(sel => sel.filter(s => s.id != idList))
358
- }
359
-
360
- resolveCell(col: string, row: any): CellRender | null {
361
- const value = row[col]
362
- const r = this.rendered().find(r => r.matches(col, value, row))
363
- return r ? r.render(value, row) : null
364
- }
365
-
366
- getTotals(fieldname: string): string {
367
- const itemsSelected = this.withCheckbox() ? this.selectItems().map(item => JSON.parse(item?.toString())) : this.rowFormat()
368
- const final = itemsSelected.reduce((acc, row) => {
369
- const val = row[fieldname]
370
- return acc + (typeof val == 'number' ? val : 0)
371
- }, 0)
372
-
373
- return formatNumber(this.decimalPipe, final)
374
- }
375
-
376
- getColspanBeforeTotals(): number {
377
- const firstTotalizableIndex = this.columns().findIndex(c => c.totalizable)
378
- const result = firstTotalizableIndex >= 0 ? firstTotalizableIndex : this.columns.length
379
- return this.withCheckbox() ? result + 1 : result
380
- }
381
-
382
- getRowClass(row: any): { [key: string]: boolean } {
383
- return {
384
- 'text-error': row.situac == 'J',
385
- 'text-alerta': row.situac == 'L'
386
- }
387
- }
388
-
389
- getPosition(col: TableData): string {
390
- if (col.position) return `text-${col.position}`
391
- if (['decimal', 'number'].includes(col.tipo)) return `text-end`
392
- if (['fecha', 'date'].includes(col.tipo)) return `text-center`
393
- return 'text-start'
394
- }
395
-
396
- private loadMore() {
397
- this.isLoading.set(true);
398
- setTimeout(() => {
399
-
400
- const current = this.dataVirtual();
401
- const next = this.rowFilter().slice(this.loadedCount, this.loadedCount + this.batchSize());
402
- const merged = [...current];
403
- for (const item of next) {
404
- if (!merged.some(x => x.idListTsi === item.idListTsi)) {
405
- merged.push(item);
406
- }
407
- }
408
- this.dataVirtual.set(merged);
409
- this.loadedCount += next.length;
410
- this.isLoading.set(false);
411
- }, 100);
412
- }
413
-
414
- onClick(row: any) {
415
- this.rowEvent.emit({ usecase: 1, data: row })
416
- }
417
- onDoubleClick(row: any) {
418
- this.rowEvent.emit({ usecase: 2, data: row })
419
- }
420
- onRightClick(event: MouseEvent, row: any) {
421
- event.preventDefault();
422
- this.rowEvent.emit({ usecase: 3, data: row })
423
- }
424
-
425
- }