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,87 +0,0 @@
1
- import { inject, Injectable } from '@angular/core';
2
- import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
3
- import { handleModalReturn } from '../utils/helpers/modal-result';
4
-
5
-
6
- export class AlertConfirmationConfig {
7
- texto?: string;
8
- showTextarea?: boolean;
9
- select?: boolean;
10
- opciones?: string[];
11
- selectedOption?: string;
12
- textareaValue?: string;
13
- confirmar?: string;
14
- mostrarConfirmar?: boolean;
15
- cancelar?: string;
16
- mostrarCancelar?: boolean;
17
- mostrarExtra?: boolean;
18
- extra?: string;
19
- colorExtra?: string;
20
- maxLength?: number;
21
- focus?:boolean
22
- }
23
-
24
- @Injectable({
25
- providedIn: 'root',
26
- })
27
- export class AlertConfirmationService {
28
- private modalService = inject(NgbModal)
29
-
30
- async open(config: AlertConfirmationConfig): Promise<NgbModalRef> {
31
- const {AlertConfirmationComponent} = await import('../../lib/ui/alerts/alert-confirmation/alert-confirmation.component');
32
- const modalRef = this.modalService.open(AlertConfirmationComponent, {
33
- windowClass: 'modal-xs',
34
- backdrop: 'static',
35
- centered: true,
36
- })
37
-
38
- if (config.texto !== undefined) {
39
- modalRef.componentInstance.texto.set(config.texto)
40
- }
41
- if (config.showTextarea !== undefined) {
42
- modalRef.componentInstance.showTextarea.set(config.showTextarea)
43
- }
44
- if (config.select !== undefined) {
45
- modalRef.componentInstance.select.set(config.select)
46
- }
47
- if (config.opciones !== undefined) {
48
- modalRef.componentInstance.opciones.set(config.opciones)
49
- }
50
- if (config.selectedOption !== undefined) {
51
- modalRef.componentInstance.selectedOption.set(config.selectedOption)
52
- }
53
- if (config.textareaValue !== undefined) {
54
- modalRef.componentInstance.textareaValue.set(config.textareaValue)
55
- }
56
- if (config.confirmar !== undefined) {
57
- modalRef.componentInstance.confirmar.set(config.confirmar)
58
- }
59
- if (config.mostrarConfirmar !== undefined) {
60
- modalRef.componentInstance.mostrarConfirmar.set(config.mostrarConfirmar)
61
- }
62
- if (config.cancelar !== undefined) {
63
- modalRef.componentInstance.cancelar.set(config.cancelar)
64
- }
65
- if (config.mostrarCancelar !== undefined) {
66
- modalRef.componentInstance.mostrarCancelar.set(config.mostrarCancelar)
67
- }
68
- if (config.mostrarExtra !== undefined) {
69
- modalRef.componentInstance.mostrarExtra.set(config.mostrarExtra)
70
- }
71
- if (config.extra !== undefined) {
72
- modalRef.componentInstance.extra.set(config.extra)
73
- }
74
- if (config.colorExtra !== undefined) {
75
- modalRef.componentInstance.colorExtra.set(config.colorExtra)
76
- }
77
- if (config.focus !== undefined) {
78
- modalRef.componentInstance.focus.set(config.focus)
79
- }
80
- modalRef.componentInstance.maxLength.set(config.maxLength ?? 200)
81
-
82
- return modalRef
83
- }
84
- async mostrarModalConfirmacion(config: AlertConfirmationConfig): Promise<any> {
85
- return handleModalReturn(await this.open(config))
86
- }
87
- }
@@ -1,27 +0,0 @@
1
- import { inject, Injectable } from '@angular/core';
2
- import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
3
- import { AlertErrorComponent } from '../ui/alerts/alert-error/alert-error.component';
4
-
5
- @Injectable({
6
- providedIn: 'root',
7
- })
8
-
9
- export class AlertErrorService {
10
-
11
- private modalService = inject(NgbModal)
12
-
13
- open(mensaje: string): NgbModalRef {
14
- const modalRef = this.modalService.open(AlertErrorComponent, {
15
- windowClass: 'modal-xs',
16
- backdrop: 'static',
17
- centered: true,
18
- })
19
-
20
- modalRef.componentInstance.mensaje.set(mensaje)
21
- return modalRef
22
- }
23
-
24
- mostrarModalError(mensaje: string): Promise<any> {
25
- return this.open(mensaje).result
26
- }
27
- }
@@ -1,216 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { catchError, throwError } from 'rxjs';
3
-
4
- import Swal from "sweetalert2";
5
-
6
- @Injectable({
7
- providedIn: 'root'
8
- })
9
- export class AlertService {
10
-
11
- constructor() { }
12
-
13
- showErrorAlert(msg: string): Promise<void> {
14
- return Swal.fire({
15
- html: msg,
16
- icon: "error",
17
- confirmButtonColor: "#3085d6",
18
- confirmButtonText: "Aceptar",
19
- focusConfirm:true
20
- }).then(() => { })
21
- }
22
-
23
- showSuccessAlert(msg: string): Promise<void> {
24
- return Swal.fire({
25
- html: msg,
26
- icon: "success",
27
- confirmButtonColor: "#3085d6",
28
- confirmButtonText: "Aceptar",
29
- focusConfirm:true
30
- }).then(() => { })
31
- }
32
-
33
- showWarningAlert(msg: string) {
34
- Swal.fire({
35
- text: msg,
36
- icon: "warning",
37
- confirmButtonColor: "#3085d6",
38
- confirmButtonText: "Aceptar",
39
- focusConfirm:true
40
- })
41
- }
42
-
43
- openConfirmDialog(): Promise<boolean> {
44
- return new Promise((resolve, reject) => {
45
- Swal.fire({
46
- text: `¿Seguro de eliminar?`,
47
- icon: "warning",
48
- showCancelButton: true,
49
- confirmButtonColor: "#328ad9",
50
- cancelButtonColor: "#ea0f0f",
51
- confirmButtonText: "Aceptar",
52
- focusConfirm:true
53
- }).then((result) => {
54
- if (result.isConfirmed) {
55
- resolve(true);
56
- } else {
57
- resolve(false);
58
- }
59
- }).catch(err => reject(err));
60
- });
61
- }
62
-
63
- openConfirmDialogFlex(params?: { titulo: string }): Promise<boolean> {
64
- return new Promise((resolve, reject) => {
65
- Swal.fire({
66
- text: `${params.titulo}`,
67
- icon: "warning",
68
- showCancelButton: true,
69
- confirmButtonColor: "#328ad9",
70
- cancelButtonColor: "#ea0f0f",
71
- confirmButtonText: "Aceptar",
72
- focusConfirm:true
73
- }).then((result) => {
74
- if (result.isConfirmed) {
75
- resolve(true);
76
- } else {
77
- resolve(false);
78
- }
79
- }).catch(err => reject(err));
80
- });
81
- }
82
-
83
- openConfirmDialogFlexHtml(params?: { content: string, type: any }): Promise<boolean> {
84
- return new Promise((resolve, reject) => {
85
- Swal.fire({
86
- html: `${params.content}`,
87
- icon: params.type,
88
- showCancelButton: true,
89
- confirmButtonColor: "#328ad9",
90
- cancelButtonColor: "#ea0f0f",
91
- confirmButtonText: "Aceptar",
92
- focusConfirm:true
93
- }).then((result) => {
94
- if (result.isConfirmed) {
95
- resolve(true);
96
- } else {
97
- resolve(false);
98
- }
99
- }).catch(err => reject(err));
100
- });
101
- }
102
-
103
-
104
- openConfirmDialogFlexYesAndNoHtml(params?: { content: string, type: any, yes?: string, no?: string }): Promise<boolean> {
105
- return new Promise((resolve, reject) => {
106
- Swal.fire({
107
- html: `${params.content}`,
108
- icon: params.type,
109
- showCancelButton: true,
110
- confirmButtonColor: "#328ad9",
111
- cancelButtonColor: "#ea0f0f",
112
- focusConfirm:true,
113
- confirmButtonText: params.yes ? params.yes : 'Si',
114
- cancelButtonText: params.no ? params.no : 'No',
115
- customClass: {
116
- confirmButton: 'custom-button',
117
- cancelButton: 'custom-button'
118
- }
119
- }).then((result) => {
120
- if (result.isConfirmed) {
121
- resolve(true);
122
- } else {
123
- resolve(false);
124
- }
125
- }).catch(err => reject(err));
126
- });
127
- }
128
-
129
- dividirDialog(): Promise<number | null> {
130
- return Swal.fire({
131
- title: "Ingrese cantidad de registros",
132
- input: "number",
133
- inputPlaceholder: "Ingresar la cantidad entre 1 a 10",
134
- showCancelButton: true,
135
- confirmButtonText: 'Continuar',
136
- cancelButtonText: 'Cancelar',
137
- customClass: {
138
- title: 'my-swal-title px-4 mx-4',
139
- confirmButton: 'btn btn-success btn-rounded me-2 mt-2',
140
- cancelButton: 'btn btn-warning btn-rounded mt-2'
141
- },
142
- buttonsStyling: false,
143
- inputValidator: (value) => {
144
- if (!value) {
145
- return "Ingrese un número entre 1 y 10";
146
- }
147
- if (Number(value) > 10) {
148
- return "El número debe ser 10 o menor!";
149
- }
150
- if (Number(value) < 1) {
151
- return "El número debe ser 1 o mayor!";
152
- }
153
- return null;
154
- }
155
- }).then(result => {
156
- if (result.isConfirmed) {
157
- return Number(result.value);
158
- } else {
159
- return null;
160
- }
161
- });
162
- }
163
-
164
- alertaHTML(mensaje: string, tipoAlerta: any) {
165
- Swal.fire({
166
- html: mensaje,
167
- icon: tipoAlerta,
168
- confirmButtonColor: "#3085d6",
169
- confirmButtonText: "Aceptar",
170
- focusConfirm:true
171
- })
172
- }
173
-
174
- openConfirmDialogMultipleActions(params: {
175
- content: string,
176
- type: any,
177
- confirm?: string,
178
- deny?: string,
179
- cancel?: string
180
- }): Promise<'aceptar' | 'sunat' | 'manual' | 'cancelado'> {
181
- return new Promise((resolve, reject) => {
182
- Swal.fire({
183
- html: params.content,
184
- icon: params.type,
185
- showCancelButton: true,
186
- showDenyButton: true,
187
- confirmButtonText: params.confirm ?? 'Aceptar',
188
- denyButtonText: params.deny ?? '<img src="../../../../../assets/images/Sunat.ico" height="16px" width="16px" style="vertical-align: middle; margin-right: 5px;" alt=""> Importar desde SUNAT',
189
- cancelButtonText: params.cancel ?? 'Registrar manual',
190
- confirmButtonColor: '#328ad9',
191
- denyButtonColor: '#b7b7b7',
192
- cancelButtonColor: '#6c757d',
193
- customClass: {
194
- confirmButton: 'custom-button-2',
195
- denyButton: 'custom-button-2',
196
- cancelButton: 'custom-button-2'
197
- }
198
- }).then(result => {
199
- if (result.isConfirmed) {
200
- resolve('aceptar');
201
- } else if (result.isDenied) {
202
- resolve('sunat');
203
- } else if (result.dismiss == Swal.DismissReason.cancel) {
204
- resolve('manual');
205
- } else {
206
- resolve('cancelado');
207
- }
208
- }).catch(err => reject(err));
209
- });
210
- }
211
-
212
- withErrorMessage = (msg: string) => catchError(err => {
213
- this.showErrorAlert(`${msg} <br> ${err.error}`);
214
- return throwError(() => err);
215
- });
216
- }
@@ -1,49 +0,0 @@
1
- import { DatePipe, DecimalPipe } from '@angular/common';
2
- import { inject, Injectable } from '@angular/core';
3
- import { TableData } from '../models/table-data.model';
4
-
5
- @Injectable({
6
- providedIn: 'root'
7
- })
8
- export class FormateadorService {
9
-
10
- private decimalPipe = inject(DecimalPipe)
11
- private datePipe = inject(DatePipe)
12
-
13
- private camposAuditoria = ['fcreac', 'factua'];
14
-
15
- procesarLista(data: any[], columns: TableData[]) {
16
- return data.map((item, index) => {
17
-
18
- const nuevoItem = { ...item };
19
- if (!('idListTsi' in nuevoItem)) {
20
- nuevoItem.idListTsi = crypto.randomUUID?.() ?? index;
21
- }
22
-
23
- const formatted: any = {};
24
-
25
- this.camposAuditoria.forEach(campo => {
26
- if (campo in item) {
27
- formatted[campo] = item[campo] ? this.datePipe.transform(item[campo], 'dd/MM/yyyy') : '';
28
- }
29
- });
30
-
31
- columns.forEach(col => {
32
- const field = col.fieldname;
33
- if (item.hasOwnProperty(field)) {
34
- if (col.tipo === 'decimal' || col.tipo === 'number') {
35
- const valor = item[field] ?? 0;
36
- formatted[field] = this.decimalPipe.transform(valor, `1.${col.decimales ?? 2}-${col.decimales ?? 2}`);
37
- }
38
-
39
- else if (col.tipo === 'fecha' || col.tipo === 'date') {
40
- const valor = item[field];
41
- formatted[field] = valor ? this.datePipe.transform(valor, 'dd/MM/yyyy') : '';
42
- }
43
- }
44
- });
45
-
46
- return {...nuevoItem, _format: formatted}
47
- })
48
- }
49
- }
@@ -1,75 +0,0 @@
1
- import { computed, Injectable, signal } from '@angular/core';
2
-
3
- export interface Toast {
4
- id: number,
5
- title: string,
6
- message: string,
7
- subtitle?: string,
8
- type: 'success' | 'error' | 'info' | 'warning' | 'webpush' | 'loading',
9
- progress?: number;
10
- autoClose?: boolean;
11
- }
12
-
13
- @Injectable({
14
- providedIn: 'root'
15
- })
16
- export class ToastService {
17
-
18
- toasts = signal<Toast[]>([])
19
- toastCount = computed(() => this.toasts().length)
20
-
21
- private show(title: string, message: string, type: 'success' | 'error' | 'info' | 'warning' | 'webpush', subtitle?: string) {
22
- const id = Date.now() * 1000 + Math.floor(Math.random() * 1000);
23
- const toast: Toast = { id, title, message, type, subtitle }
24
-
25
- this.toasts.update((prev) => [...prev, toast])
26
- setTimeout(() => this.remove(id), type == 'webpush' ? 10000 : 3000)
27
- return id
28
- }
29
-
30
- showLoading(message: string, subtitle?: string) {
31
- const id = Date.now() * 1000 + Math.floor(Math.random() * 1000);
32
-
33
- const toast: Toast = {
34
- id,
35
- title: 'Procesando...',
36
- message,
37
- type: 'loading',
38
- subtitle,
39
- progress: 0,
40
- autoClose: false
41
- };
42
- this.toasts.update(prev => [...prev, toast]);
43
- return id;
44
- }
45
-
46
- updateProgress(id: number, progress: number, title:string = 'Reporte listo', message:string = 'Carga exitosa') {
47
- this.toasts.update(prev =>
48
- prev.map(t => t.id === id ? { ...t, progress, title, message } : t)
49
- );
50
- }
51
-
52
- remove(id: number) {
53
- this.toasts.update(prev => prev.filter(t => t.id !== id))
54
- }
55
-
56
- success(title: string, message: string) {
57
- return this.show(title, message, 'success')
58
- }
59
-
60
- error(title: string, message: string) {
61
- return this.show(title, message, 'error')
62
- }
63
-
64
- info(title: string, message: string) {
65
- return this.show(title, message, 'info')
66
- }
67
-
68
- warning(title: string, message: string) {
69
- return this.show(title, message, 'warning')
70
- }
71
-
72
- webpush(title: string, message: string, subtitle?: string) {
73
- return this.show(title, message, 'webpush', subtitle)
74
- }
75
- }
@@ -1,40 +0,0 @@
1
- <div class="p-4">
2
- <div class="d-flex justify-content-center mb-3">
3
- <i class="fas fa-exclamation-circle color-icon"></i>
4
- </div>
5
-
6
- <div class="fs-8 text-center" [innerHTML]="textoFormateado()"></div>
7
-
8
- @if(select()){
9
- <div class="d-flex align-items-center gap-2 mt-3">
10
- <label class="form-label mb-0 nowrap">Motivo:</label>
11
- <select class="form-select text-center" [value]="selectedOption()"
12
- (change)="selectedOption.set($any($event.target).value)">
13
- @for(opt of opciones(); track $index){
14
- <option [value]="opt">{{ opt }}</option>
15
- }
16
- </select>
17
- </div>
18
- }
19
-
20
- @if(showTextarea() && mostrarTextareaComputed()){
21
- <textarea class="form-control mt-3 fs-6 ch-100" placeholder="Ingresar motivo..." [(ngModel)]="textareaValueModel"
22
- (ngModelChange)="onTextareaChange($event)" [maxlength]="maxLength()">
23
- </textarea>
24
- <div class="character-counter" [class.color-caracter]="(maxLength() - (textareaValueModel?.length || 0)) < 10">
25
- Caracteres disponibles: {{ maxLength() - (textareaValueModel?.length || 0) }} de {{ maxLength() }}
26
- </div>
27
- }
28
-
29
- <div class="d-flex justify-content-center gap-2 mt-3">
30
- @if(mostrarConfirmar()){
31
- <app-button [texto]="confirmar()" color="azul" (accion)="onConfirmar()" [isHtml]="true" [autoFocus]="focus()" />
32
- }
33
- @if(mostrarExtra()){
34
- <app-button [texto]="extra()" [color]="colorExtra()" (accion)="onExtra()" [isHtml]="true" />
35
- }
36
- @if(mostrarCancelar()){
37
- <app-button [texto]="cancelar()" color="rojo" (accion)="closeModal()" [isHtml]="true" [autoFocus]="!focus()" />
38
- }
39
- </div>
40
- </div>
@@ -1,42 +0,0 @@
1
- @keyframes metronomeSwing {
2
- 0% {
3
- transform: rotate(0deg);
4
- }
5
-
6
- 25% {
7
- transform: rotate(-10deg)
8
- }
9
-
10
- 50% {
11
- transform: rotate(10deg)
12
- }
13
-
14
- 75% {
15
- transform: rotate(-10deg)
16
- }
17
-
18
- 100% {
19
- transform: rotate(0deg)
20
- }
21
- }
22
-
23
- .color-icon {
24
- animation: metronomeSwing 1.5s infinite ease-in-out;
25
- font-size: 80px;
26
- color: #e9a837;
27
- }
28
-
29
- .textarea-container {
30
- position: relative;
31
- }
32
-
33
- .color-caracter {
34
- color: #e9a837 !important;
35
- }
36
-
37
- .character-counter {
38
- font-size: 0.8rem;
39
- color: #666;
40
- text-align: right;
41
- margin-top: 0.25rem;
42
- }
@@ -1,118 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, computed, signal, inject, input } from '@angular/core';
3
- import { FormsModule } from '@angular/forms';
4
- import { ButtonComponent } from '../../forms/button/button.component';
5
- import { ToastService } from '../../../service/toast.service';
6
- import { ColorType } from '../../../models/button-color.model';
7
- import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
8
-
9
- @Component({
10
- selector: 'app-alert-confirmation',
11
- imports: [CommonModule, FormsModule, ButtonComponent],
12
- templateUrl: './alert-confirmation.component.html',
13
- styleUrl: './alert-confirmation.component.scss'
14
- })
15
- export class AlertConfirmationComponent {
16
-
17
- private activeModal = inject(NgbActiveModal)
18
- private toast = inject(ToastService)
19
-
20
- showTextarea = signal<boolean>(true)
21
- texto = signal<string>('')
22
- textoFormateado = computed(() => {
23
- const texto = this.texto()
24
- const matches = [...texto.matchAll(/[-]{5,}/g)]
25
-
26
- if (matches.length == 0) {
27
- return texto.replace(/\n/g, '<br>')
28
- }
29
-
30
- const lastMatch = matches[matches.length - 1]
31
- const start = lastMatch.index!
32
- const end = start + lastMatch[0].length
33
-
34
- const textoSinUltimaLinea = texto.slice(0, start) + texto.slice(end)
35
-
36
- return textoSinUltimaLinea
37
- .replace(/\n/g, '<br>')
38
- .replace(/[-]{5,}/g, '<hr class="my-2 custom-hr" />')
39
- })
40
- select = signal<boolean>(false)
41
- opciones = signal<string[]>([])
42
- selectedOption = signal<string>('')
43
- textareaValue = signal<string>('')
44
-
45
- confirmar = signal<string>('Aceptar')
46
- mostrarConfirmar = signal<boolean>(true)
47
-
48
- cancelar = signal<string>('Cancelar')
49
- mostrarCancelar = signal<boolean>(true)
50
-
51
- mostrarExtra = signal<boolean>(false)
52
- extra = signal<string>('')
53
- colorExtra = signal<ColorType>('azul')
54
-
55
- maxLength = signal<number>(200)
56
-
57
- focus = signal<boolean>(true)
58
-
59
-
60
- get textareaValueModel(): string {
61
- return this.textareaValue()
62
- }
63
- set textareaValueModel(val: string) {
64
- this.textareaValue.set(val)
65
- }
66
-
67
- mostrarTextareaComputed = computed(() => {
68
- if (!this.select()) return true
69
- const opts = this.opciones()
70
- const sel = this.selectedOption()
71
- return sel == opts[opts.length - 1]
72
- })
73
-
74
- ngOnInit(): void {
75
- if (this.select()) {
76
- if (this.opciones().length > 0) {
77
- this.selectedOption.set(this.opciones()[0])
78
- }
79
- }
80
- }
81
-
82
- onTextareaChange(value: string): void {
83
- this.textareaValue.set(value)
84
- }
85
-
86
- onConfirmar(): void {
87
- const opts = this.opciones()
88
- const selected = this.selectedOption()
89
-
90
- if (this.select() && selected == opts[0]) {
91
- this.toast.warning('Advertencia', 'Debe seleccionar una opción correcta.')
92
- return
93
- }
94
-
95
- if (this.showTextarea() && this.mostrarTextareaComputed() && !this.textareaValue().trim()) {
96
- this.toast.warning('Advertencia', 'Debe ingresar un motivo.')
97
- return
98
- }
99
-
100
- if (!this.select()) {
101
- this.activeModal.close(this.showTextarea() ? this.textareaValue().trim() : true)
102
- } else {
103
- if (this.showTextarea() && this.mostrarTextareaComputed()) {
104
- this.activeModal.close(this.textareaValue().trim())
105
- } else {
106
- this.activeModal.close(selected)
107
- }
108
- }
109
- }
110
-
111
- onExtra(): void {
112
- this.activeModal.close('extra')
113
- }
114
-
115
- closeModal(): void {
116
- this.activeModal.close()
117
- }
118
- }
@@ -1,11 +0,0 @@
1
- <div class="pt-4 text-center modal-error">
2
- <div class="d-flex justify-content-center mb-3">
3
- <i class="fas fa-times-circle color-icon"></i>
4
- </div>
5
-
6
- <div class="fs-7 text-white fw-6" [innerHTML]="mensajeFormateado()"></div>
7
-
8
- <div class="d-flex justify-content-center mt-4 button-error">
9
- <app-button texto="Aceptar" color="rojo_alerta" (accion)="onAceptar()" [autoFocus]="true" />
10
- </div>
11
- </div>