@cauca-911/material 20.2.12 → 20.2.13

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 (246) hide show
  1. package/.eslintrc.json +77 -0
  2. package/README.md +24 -5
  3. package/README_PACKAGE.md +5 -0
  4. package/karma.conf.js +50 -0
  5. package/ng-package.json +7 -0
  6. package/package.json +23 -38
  7. package/{assets → src/assets}/i18n/cauca/en-material.json +104 -104
  8. package/{assets → src/assets}/i18n/cauca/es-material.json +104 -104
  9. package/{assets → src/assets}/i18n/cauca/fr-material.json +106 -106
  10. package/src/lib/cauca-material.component.html +1 -0
  11. package/src/lib/cauca-material.component.spec.ts +29 -0
  12. package/src/lib/cauca-material.component.ts +12 -0
  13. package/src/lib/cauca-material.service.spec.ts +16 -0
  14. package/src/lib/cauca-material.service.ts +7 -0
  15. package/src/lib/components/button/button.component.html +52 -0
  16. package/src/lib/components/button/button.component.scss +6 -0
  17. package/src/lib/components/button/button.component.spec.ts +134 -0
  18. package/src/lib/components/button/button.component.ts +21 -0
  19. package/src/lib/components/buttons/base-button.ts +35 -0
  20. package/src/lib/components/buttons/basic-button/basic-button.component.html +5 -0
  21. package/src/lib/components/buttons/basic-button/basic-button.component.scss +12 -0
  22. package/src/lib/components/buttons/basic-button/basic-button.component.spec.ts +106 -0
  23. package/src/lib/components/buttons/basic-button/basic-button.component.ts +17 -0
  24. package/src/lib/components/buttons/fab-button/fab-button.component.html +3 -0
  25. package/src/lib/components/buttons/fab-button/fab-button.component.scss +12 -0
  26. package/src/lib/components/buttons/fab-button/fab-button.component.spec.ts +82 -0
  27. package/src/lib/components/buttons/fab-button/fab-button.component.ts +16 -0
  28. package/src/lib/components/buttons/flat-button/flat-button.component.html +5 -0
  29. package/src/lib/components/buttons/flat-button/flat-button.component.scss +12 -0
  30. package/src/lib/components/buttons/flat-button/flat-button.component.spec.ts +106 -0
  31. package/src/lib/components/buttons/flat-button/flat-button.component.ts +17 -0
  32. package/src/lib/components/buttons/icon-button/icon-button.component.html +3 -0
  33. package/src/lib/components/buttons/icon-button/icon-button.component.scss +23 -0
  34. package/src/lib/components/buttons/icon-button/icon-button.component.spec.ts +38 -0
  35. package/src/lib/components/buttons/icon-button/icon-button.component.ts +15 -0
  36. package/src/lib/components/buttons/link-button/link-button.component.html +1 -0
  37. package/src/lib/components/buttons/link-button/link-button.component.scss +3 -0
  38. package/src/lib/components/buttons/link-button/link-button.component.spec.ts +97 -0
  39. package/src/lib/components/buttons/link-button/link-button.component.ts +25 -0
  40. package/src/lib/components/buttons/menu-item/menu-item.component.html +5 -0
  41. package/src/lib/components/buttons/menu-item/menu-item.component.scss +6 -0
  42. package/src/lib/components/buttons/menu-item/menu-item.component.spec.ts +66 -0
  43. package/src/lib/components/buttons/menu-item/menu-item.component.ts +19 -0
  44. package/src/lib/components/buttons/raised-button/raised-button.component.html +5 -0
  45. package/src/lib/components/buttons/raised-button/raised-button.component.scss +12 -0
  46. package/src/lib/components/buttons/raised-button/raised-button.component.spec.ts +108 -0
  47. package/src/lib/components/buttons/raised-button/raised-button.component.ts +17 -0
  48. package/src/lib/components/buttons/refresh-button/refresh-button.component.html +1 -0
  49. package/src/lib/components/buttons/refresh-button/refresh-button.component.scss +0 -0
  50. package/src/lib/components/buttons/refresh-button/refresh-button.component.spec.ts +81 -0
  51. package/src/lib/components/buttons/refresh-button/refresh-button.component.ts +19 -0
  52. package/src/lib/components/buttons/round-button/round-button.component.html +3 -0
  53. package/src/lib/components/buttons/round-button/round-button.component.scss +34 -0
  54. package/src/lib/components/buttons/round-button/round-button.component.spec.ts +26 -0
  55. package/src/lib/components/buttons/round-button/round-button.component.ts +14 -0
  56. package/src/lib/components/buttons/stroked-button/stroked-button.component.html +5 -0
  57. package/src/lib/components/buttons/stroked-button/stroked-button.component.scss +23 -0
  58. package/src/lib/components/buttons/stroked-button/stroked-button.component.spec.ts +114 -0
  59. package/src/lib/components/buttons/stroked-button/stroked-button.component.ts +17 -0
  60. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.html +9 -0
  61. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.scss +7 -0
  62. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.spec.ts +68 -0
  63. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.ts +155 -0
  64. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.html +6 -0
  65. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.scss +25 -0
  66. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.spec.ts +23 -0
  67. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.ts +23 -0
  68. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.html +53 -0
  69. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.scss +124 -0
  70. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.spec.ts +93 -0
  71. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts +227 -0
  72. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.html +9 -0
  73. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.scss +15 -0
  74. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.spec.ts +103 -0
  75. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.ts +47 -0
  76. package/src/lib/components/cauca-date-time-picker/models/dialog-date-time-picker-data.ts +29 -0
  77. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.html +11 -0
  78. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.scss +3 -0
  79. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.ts +87 -0
  80. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.html +8 -0
  81. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.scss +3 -0
  82. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.spec.ts +35 -0
  83. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.ts +57 -0
  84. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.html +19 -0
  85. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.scss +142 -0
  86. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.spec.ts +30 -0
  87. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.ts +112 -0
  88. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.html +26 -0
  89. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.scss +52 -0
  90. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.spec.ts +28 -0
  91. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.ts +53 -0
  92. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.html +7 -0
  93. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.scss +4 -0
  94. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.spec.ts +39 -0
  95. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.ts +20 -0
  96. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.html +7 -0
  97. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.scss +41 -0
  98. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.spec.ts +24 -0
  99. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.ts +67 -0
  100. package/src/lib/components/deprecated-components/shared/models/menu-item.ts +11 -0
  101. package/src/lib/components/deprecated-components/shared/models/simple-dialog-data.ts +5 -0
  102. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html +10 -0
  103. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.scss +14 -0
  104. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.spec.ts +90 -0
  105. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts +41 -0
  106. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html +11 -0
  107. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.scss +29 -0
  108. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.spec.ts +137 -0
  109. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts +47 -0
  110. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.html +17 -0
  111. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.scss +14 -0
  112. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.spec.ts +96 -0
  113. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.ts +40 -0
  114. package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.spec.ts +7 -0
  115. package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.ts +5 -0
  116. package/src/lib/components/dialogs/dialog-styles.css +9 -0
  117. package/src/lib/components/dialogs/dialog-styles.scss +9 -0
  118. package/src/lib/components/dialogs/error-dialog/error-dialog.component.html +10 -0
  119. package/src/lib/components/dialogs/error-dialog/error-dialog.component.scss +10 -0
  120. package/src/lib/components/dialogs/error-dialog/error-dialog.component.spec.ts +91 -0
  121. package/src/lib/components/dialogs/error-dialog/error-dialog.component.ts +32 -0
  122. package/src/lib/components/dialogs/services/dialog.service.spec.ts +82 -0
  123. package/src/lib/components/dialogs/services/dialog.service.ts +107 -0
  124. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.html +24 -0
  125. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.scss +22 -0
  126. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.spec.ts +126 -0
  127. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.ts +66 -0
  128. package/src/lib/components/inputs/color-picker/color-picker.component.html +9 -0
  129. package/src/lib/components/inputs/color-picker/color-picker.component.scss +0 -0
  130. package/src/lib/components/inputs/color-picker/color-picker.component.spec.ts +29 -0
  131. package/src/lib/components/inputs/color-picker/color-picker.component.ts +111 -0
  132. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.html +13 -0
  133. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.scss +0 -0
  134. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.spec.ts +80 -0
  135. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.ts +46 -0
  136. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.html +40 -0
  137. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.scss +39 -0
  138. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.spec.ts +135 -0
  139. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.ts +263 -0
  140. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.html +6 -0
  141. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.scss +27 -0
  142. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.spec.ts +90 -0
  143. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.ts +17 -0
  144. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.html +5 -0
  145. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.scss +8 -0
  146. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.spec.ts +98 -0
  147. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.ts +16 -0
  148. package/src/lib/components/inputs/password/password-input/password-input.component.html +11 -0
  149. package/src/lib/components/inputs/password/password-input/password-input.component.scss +12 -0
  150. package/src/lib/components/inputs/password/password-input/password-input.component.spec.ts +141 -0
  151. package/src/lib/components/inputs/password/password-input/password-input.component.ts +67 -0
  152. package/src/lib/components/inputs/password/password-selection/password-selection.component.html +15 -0
  153. package/src/lib/components/inputs/password/password-selection/password-selection.component.scss +32 -0
  154. package/src/lib/components/inputs/password/password-selection/password-selection.component.spec.ts +138 -0
  155. package/src/lib/components/inputs/password/password-selection/password-selection.component.ts +100 -0
  156. package/src/lib/components/inputs/select-with-search/select-with-search.component.html +19 -0
  157. package/src/lib/components/inputs/select-with-search/select-with-search.component.scss +0 -0
  158. package/src/lib/components/inputs/select-with-search/select-with-search.component.spec.ts +213 -0
  159. package/src/lib/components/inputs/select-with-search/select-with-search.component.ts +108 -0
  160. package/src/lib/components/layout/expandable-panel/expandable-panel.component.html +12 -0
  161. package/src/lib/components/layout/expandable-panel/expandable-panel.component.scss +43 -0
  162. package/src/lib/components/layout/expandable-panel/expandable-panel.component.spec.ts +48 -0
  163. package/src/lib/components/layout/expandable-panel/expandable-panel.component.ts +19 -0
  164. package/src/lib/components/layout/group-container/group-container.component.html +6 -0
  165. package/src/lib/components/layout/group-container/group-container.component.scss +22 -0
  166. package/src/lib/components/layout/group-container/group-container.component.spec.ts +34 -0
  167. package/src/lib/components/layout/group-container/group-container.component.ts +14 -0
  168. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.html +13 -0
  169. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.scss +27 -0
  170. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.spec.ts +144 -0
  171. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.ts +52 -0
  172. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.html +4 -0
  173. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.scss +10 -0
  174. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.spec.ts +80 -0
  175. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.ts +28 -0
  176. package/src/lib/components/layout/page-title/page-title.component.html +28 -0
  177. package/src/lib/components/layout/page-title/page-title.component.scss +40 -0
  178. package/src/lib/components/layout/page-title/page-title.component.spec.ts +162 -0
  179. package/src/lib/components/layout/page-title/page-title.component.ts +28 -0
  180. package/src/lib/components/layout/sections/main-section/main-section.component.html +6 -0
  181. package/src/lib/components/layout/sections/main-section/main-section.component.scss +27 -0
  182. package/src/lib/components/layout/sections/main-section/main-section.component.spec.ts +42 -0
  183. package/src/lib/components/layout/sections/main-section/main-section.component.ts +13 -0
  184. package/src/lib/components/layout/sections/section-column/section-column.component.html +3 -0
  185. package/src/lib/components/layout/sections/section-column/section-column.component.scss +18 -0
  186. package/src/lib/components/layout/sections/section-column/section-column.component.spec.ts +35 -0
  187. package/src/lib/components/layout/sections/section-column/section-column.component.ts +12 -0
  188. package/src/lib/components/layout/sections/section-field/section-field.component.html +21 -0
  189. package/src/lib/components/layout/sections/section-field/section-field.component.scss +44 -0
  190. package/src/lib/components/layout/sections/section-field/section-field.component.spec.ts +74 -0
  191. package/src/lib/components/layout/sections/section-field/section-field.component.ts +22 -0
  192. package/src/lib/components/list-paginator/list-paginator.component.html +16 -0
  193. package/src/lib/components/list-paginator/list-paginator.component.scss +46 -0
  194. package/src/lib/components/list-paginator/list-paginator.component.spec.ts +248 -0
  195. package/src/lib/components/list-paginator/list-paginator.component.ts +81 -0
  196. package/src/lib/components/misc/loading-error/loading-error.component.html +11 -0
  197. package/src/lib/components/misc/loading-error/loading-error.component.scss +0 -0
  198. package/src/lib/components/misc/loading-error/loading-error.component.spec.ts +75 -0
  199. package/src/lib/components/misc/loading-error/loading-error.component.ts +18 -0
  200. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.html +3 -0
  201. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.scss +0 -0
  202. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.spec.ts +43 -0
  203. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.ts +16 -0
  204. package/src/lib/components/misc/snack-bar/snack-bar.component.html +16 -0
  205. package/src/lib/components/misc/snack-bar/snack-bar.component.scss +84 -0
  206. package/src/lib/components/misc/snack-bar/snack-bar.component.spec.ts +136 -0
  207. package/src/lib/components/misc/snack-bar/snack-bar.component.ts +39 -0
  208. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.html +11 -0
  209. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.scss +0 -0
  210. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.spec.ts +67 -0
  211. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.ts +15 -0
  212. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.html +11 -0
  213. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.scss +0 -0
  214. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.spec.ts +77 -0
  215. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.ts +17 -0
  216. package/src/lib/components/presenters/badge/badge.component.html +6 -0
  217. package/src/lib/components/presenters/badge/badge.component.scss +10 -0
  218. package/src/lib/components/presenters/badge/badge.component.spec.ts +41 -0
  219. package/src/lib/components/presenters/badge/badge.component.ts +18 -0
  220. package/src/lib/components/presenters/icon/icon.component.scss +9 -0
  221. package/src/lib/components/presenters/icon/icon.component.spec.ts +38 -0
  222. package/src/lib/components/presenters/icon/icon.component.ts +37 -0
  223. package/src/lib/core/breadcrumb.service.spec.ts +35 -0
  224. package/src/lib/core/breadcrumb.service.ts +24 -0
  225. package/src/lib/core/directives/auto-trim-and-lower.directive.spec.ts +22 -0
  226. package/src/lib/core/directives/auto-trim-and-lower.directive.ts +19 -0
  227. package/src/lib/core/directives/form-error/form-error.module.ts +21 -0
  228. package/src/lib/core/directives/form-error/has-error-root.directive.ts +29 -0
  229. package/src/lib/core/directives/form-error/has-error.directive.ts +95 -0
  230. package/src/lib/core/loading-state.service.spec.ts +57 -0
  231. package/src/lib/core/loading-state.service.ts +44 -0
  232. package/src/lib/core/models/breadcrumb-location.ts +6 -0
  233. package/src/lib/core/models/password-validation.ts +20 -0
  234. package/src/lib/core/validators/password/password-validator.spec.ts +155 -0
  235. package/src/lib/core/validators/password/password-validator.ts +30 -0
  236. package/src/lib/provide-cauca-material.ts +10 -0
  237. package/src/public-api.ts +74 -0
  238. package/src/test.ts +17 -0
  239. package/tsconfig.lib.json +22 -0
  240. package/tsconfig.lib.prod.json +4 -0
  241. package/tsconfig.spec.json +17 -0
  242. package/LICENSE +0 -21
  243. package/fesm2022/cauca-911-material.mjs +0 -4640
  244. package/fesm2022/cauca-911-material.mjs.map +0 -1
  245. package/index.d.ts +0 -795
  246. /package/{assets → src/assets}/images/loading.gif +0 -0
@@ -0,0 +1,57 @@
1
+ import { Component, Input, OnInit, inject } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import {ReactiveFormsModule, UntypedFormControl, Validators} from '@angular/forms';
4
+ import { MatFormFieldModule } from '@angular/material/form-field';
5
+ import { MatInput } from '@angular/material/input';
6
+ import { MatTab, MatTabGroup } from '@angular/material/tabs';
7
+ import {Configuration, CaucaCoreService, TranslateService} from '@cauca-911/core';
8
+ import { TranslateModule } from '@ngx-translate/core';
9
+
10
+ @Component({
11
+ selector: 'cauca-input-multiple-langue',
12
+ templateUrl: './cauca-input-multiple-langue.component.html',
13
+ styleUrls: ['./cauca-input-multiple-langue.component.scss'],
14
+ imports: [CommonModule, MatTabGroup, MatTab, MatInput, MatFormFieldModule, ReactiveFormsModule, TranslateModule]
15
+ })
16
+ export class CaucaInputMultipleLangueComponent implements OnInit {
17
+
18
+ @Input()
19
+ public value: string[] = [];
20
+ public config: Configuration;
21
+ public forms: UntypedFormControl[] = [];
22
+ public labels: string[] = [];
23
+ public selectedIndex = 0;
24
+
25
+ private readonly translate = inject(TranslateService);
26
+
27
+ public constructor() {
28
+ const coreService = inject(CaucaCoreService);
29
+ this.config = coreService.getConfig();
30
+ }
31
+
32
+ public ngOnInit(): void {
33
+ this.translate.get(this.config.languages).subscribe((labels: any) => {
34
+ for (const i in labels) {
35
+ if (labels[i]) {
36
+ this.labels.push(labels[i]);
37
+ }
38
+ }
39
+ this.initializeForms();
40
+ });
41
+ }
42
+
43
+ public onTagChanged(tabIndex: number): void {
44
+ console.log('cauca-material, onTabChanged', tabIndex);
45
+ }
46
+
47
+ public getErrorMessage(index: any): string {
48
+ return this.forms[index].hasError('required') ? 'error.required' : '';
49
+ }
50
+
51
+ private initializeForms(): void {
52
+ this.labels.forEach((item: any, index: number) => {
53
+ this.forms[index] = new UntypedFormControl('', [Validators.required]);
54
+ this.forms[index].setValue(this.value[index] || '');
55
+ });
56
+ }
57
+ }
@@ -0,0 +1,19 @@
1
+ <div class="header">
2
+ <button mat-icon-button class="close" (click)="hideOnMobile()">
3
+ <mat-icon>clear</mat-icon>
4
+ </button>
5
+ <ng-content select="[header]"></ng-content>
6
+ </div>
7
+ <div class="content">
8
+ <ng-content select="[beforeMenu]"></ng-content>
9
+ <cauca-menu-vertical #menu [menuItems]="menuItems" (itemClick)="onMenuItemClick()"></cauca-menu-vertical>
10
+ <ng-content select="[afterMenu]"></ng-content>
11
+ </div>
12
+ <div class="footer">
13
+ <ng-content select="[footer]"></ng-content>
14
+ </div>
15
+ <div *ngIf="version" class="version">
16
+ <div class="double-arrow" (click)="onToggleCollapse()"></div>
17
+ <span class="full">{{'material.version' | translate}} {{version}}</span>
18
+ <span class="abbr">{{version}}</span>
19
+ </div>
@@ -0,0 +1,142 @@
1
+ :host {
2
+ height: 100%;
3
+ flex-direction: column;
4
+ display: flex;
5
+ transition: all 0.1s ease-out;
6
+ overflow: hidden;
7
+ scrollbar-width: 5px;
8
+ scrollbar-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2);
9
+ }
10
+
11
+ ::-webkit-scrollbar {
12
+ width: 5px;
13
+ }
14
+ ::-webkit-scrollbar-track {
15
+ border-radius: 5px;
16
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
17
+ }
18
+ ::-webkit-scrollbar-thumb {
19
+ border-radius: 5px;
20
+ background-color: rgba(0, 0, 0, 0.2);
21
+ outline: 1px solid slategrey;
22
+ }
23
+
24
+ :host {
25
+ > div {
26
+ flex: 1;
27
+ }
28
+
29
+ > .header, > .footer {
30
+ flex: 0 0 auto;
31
+ }
32
+
33
+ > .content {
34
+ flex-grow: 1;
35
+ overflow: hidden auto;
36
+ }
37
+
38
+ > .version {
39
+ max-height: 1em;
40
+ }
41
+ }
42
+
43
+ :host.hidden {
44
+ width: 0;
45
+ min-width: 0;
46
+ max-width: 0;
47
+ }
48
+
49
+ :host.mobile {
50
+ width: 275px;
51
+ min-width: 275px;
52
+ max-width: 275px;
53
+ position: absolute;
54
+ z-index: 10;
55
+ }
56
+
57
+ :host.collapsed {
58
+ width: 75px;
59
+ min-width: 75px;
60
+ max-width: 75px;
61
+ }
62
+
63
+ :host.expanded {
64
+ width: 275px;
65
+ min-width: 275px;
66
+ max-width: 275px;
67
+ }
68
+
69
+ :host .close {
70
+ display: none;
71
+ }
72
+
73
+ :host.mobile .close {
74
+ right: 0;
75
+ display: inline-block;
76
+ position: absolute;
77
+ }
78
+
79
+ .double-arrow {
80
+ height: 3em;
81
+ line-height: 3em;
82
+ cursor: pointer;
83
+ position: fixed;
84
+ opacity: 0.25;
85
+ margin-top: -1em;
86
+ }
87
+
88
+ .double-arrow:hover {
89
+ opacity: 1;
90
+ }
91
+
92
+ :host.expanded .double-arrow,
93
+ :host.collapsed .double-arrow {
94
+ &:before {
95
+ font-family: "Material Icons";
96
+ content: 'double_arrow';
97
+ font-size: 3em;
98
+ text-align: right;
99
+ }
100
+ }
101
+
102
+ :host.collapsed .double-arrow {
103
+ margin-left: 10px;
104
+ }
105
+
106
+ :host.expanded .double-arrow {
107
+ margin-left: 200px;
108
+ }
109
+
110
+ :host.collapsed ::ng-deep .menu-caption,
111
+ :host.collapsed ::ng-deep .submenu {
112
+ display: none;
113
+ }
114
+
115
+ :host.keepExpanded .double-arrow {
116
+ transform: rotate(180deg);
117
+ opacity: 1;
118
+ }
119
+
120
+ .version {
121
+ bottom: 0;
122
+ padding: 1em;
123
+ }
124
+
125
+ .full, .abbr {
126
+ display: none;
127
+ }
128
+
129
+ :host.collapsed .abbr {
130
+ display: inline;
131
+ }
132
+
133
+ :host.mobile .full,
134
+ :host.expanded .full {
135
+ display: inline;
136
+ }
137
+
138
+ @media only screen and (max-width: 1000px) {
139
+ .double-arrow {
140
+ display: none;
141
+ }
142
+ }
@@ -0,0 +1,30 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { MatIconModule } from '@angular/material/icon';
3
+ import { CaucaMenuSidebarComponent } from './cauca-menu-sidebar.component';
4
+ import { CaucaMenuVerticalComponent } from '../cauca-menu-vertical/cauca-menu-vertical.component';
5
+
6
+ describe('CaucaSidebarMenuComponent', () => {
7
+ let component: CaucaMenuSidebarComponent;
8
+ let fixture: ComponentFixture<CaucaMenuSidebarComponent>;
9
+
10
+ beforeEach(waitForAsync(() => {
11
+ TestBed.configureTestingModule({
12
+ imports: [
13
+ CaucaMenuSidebarComponent,
14
+ CaucaMenuVerticalComponent,
15
+ MatIconModule,
16
+ ]
17
+ })
18
+ .compileComponents();
19
+ }));
20
+
21
+ beforeEach(() => {
22
+ fixture = TestBed.createComponent(CaucaMenuSidebarComponent);
23
+ component = fixture.componentInstance;
24
+ fixture.detectChanges();
25
+ });
26
+
27
+ it('should create', () => {
28
+ expect(component).toBeTruthy();
29
+ });
30
+ });
@@ -0,0 +1,112 @@
1
+ import { Component, ElementRef, HostListener, Input, inject } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MenuItem } from '../shared/models/menu-item';
4
+ import { MatIconButton } from '@angular/material/button';
5
+ import { MatIcon } from '@angular/material/icon';
6
+ import { TranslateModule } from '@ngx-translate/core';
7
+ import { CaucaMenuVerticalComponent } from '../cauca-menu-vertical/cauca-menu-vertical.component';
8
+
9
+ @Component({
10
+ selector: 'cauca-menu-sidebar',
11
+ templateUrl: './cauca-menu-sidebar.component.html',
12
+ styleUrls: ['./cauca-menu-sidebar.component.scss'],
13
+ imports: [CommonModule, MatIconButton, MatIcon, CaucaMenuVerticalComponent, TranslateModule]
14
+ })
15
+ export class CaucaMenuSidebarComponent {
16
+ @Input()
17
+ public menuItems: MenuItem[] = [];
18
+ @Input()
19
+ public version = '';
20
+
21
+ private hostElement: HTMLDivElement;
22
+ private keepMenuExpanded = false;
23
+
24
+ public constructor() {
25
+ const element = inject(ElementRef);
26
+
27
+ this.hostElement = element.nativeElement as HTMLDivElement;
28
+ this.hostElement.addEventListener('mouseover', (e: any) => this.onMouseOver(e));
29
+ this.hostElement.addEventListener('mouseout', (e: any) => this.onMouseOut(e));
30
+
31
+ this.setDisplayMenu();
32
+ }
33
+
34
+ @HostListener('window:resize', ['$event'])
35
+ public onResize(_e: any): void {
36
+ this.setDisplayMenu();
37
+ }
38
+
39
+ public onMenuItemClick(): void {
40
+ if (window.innerWidth < 1000) {
41
+ this.hideOnMobile();
42
+ }
43
+ }
44
+
45
+ public hideOnMobile(): void {
46
+ this.hostElement.classList.remove('mobile');
47
+ this.hostElement.classList.add('hidden');
48
+ }
49
+
50
+ public showOnMobile(): void {
51
+ this.hostElement.classList.remove('hidden');
52
+ this.hostElement.classList.add('mobile');
53
+ }
54
+
55
+ public onToggleCollapse(): void {
56
+ if (this.keepMenuExpanded) {
57
+ this.onCollapseMenu();
58
+ this.hostElement.classList.remove('keepExpanded');
59
+ } else {
60
+ this.onExpandedMenu();
61
+ this.hostElement.classList.add('keepExpanded');
62
+ }
63
+
64
+ this.keepMenuExpanded = !this.keepMenuExpanded;
65
+ localStorage.setItem('cauca-menu-status', this.keepMenuExpanded ? 'expanded' : 'collapsed');
66
+ }
67
+
68
+ private setDisplayMenu(): void {
69
+ this.hostElement.className = '';
70
+
71
+ if (window.innerWidth < 1000) {
72
+ this.hostElement.classList.add('hidden');
73
+ } else {
74
+ if (localStorage.getItem('cauca-menu-status') === 'expanded') {
75
+ this.keepMenuExpanded = true;
76
+ this.hostElement.classList.add('keepExpanded');
77
+ }
78
+
79
+ this.hostElement.classList.add(this.keepMenuExpanded ? 'expanded' : 'collapsed');
80
+ }
81
+ }
82
+
83
+ private onMouseOver(e: any): void {
84
+ if (!this.keepMenuExpanded) {
85
+ this.onExpandedMenu();
86
+ }
87
+
88
+ e.stopPropagation();
89
+ }
90
+
91
+ private onMouseOut(e: any): void {
92
+ if (!this.keepMenuExpanded) {
93
+ this.onCollapseMenu();
94
+ }
95
+
96
+ e.stopPropagation();
97
+ }
98
+
99
+ private onExpandedMenu(): void {
100
+ if (window.innerWidth >= 1000) {
101
+ this.hostElement.classList.remove('collapsed');
102
+ this.hostElement.classList.add('expanded');
103
+ }
104
+ }
105
+
106
+ private onCollapseMenu(): void {
107
+ if (window.innerWidth >= 1000) {
108
+ this.hostElement.classList.remove('expanded');
109
+ this.hostElement.classList.add('collapsed');
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,26 @@
1
+ <h4 *ngFor="let menu of menuItems" [class]="menu.activated ? 'selected' : ''">
2
+ <div (click)="goTo(menu.path, $event)" class="menu">
3
+ <div *ngIf="menu.icon" class="menu-icon">
4
+ <fa-icon *ngIf="menu.icon.filter !== undefined" [icon]="menu.icon"></fa-icon>
5
+ <img *ngIf="menu.icon.filter === undefined" [src]="menu.icon" />
6
+ </div>
7
+ <div *ngIf="menu.label" class="menu-caption">
8
+ <span>{{menu.label | translate}}</span>
9
+ </div>
10
+ </div>
11
+ <div *ngIf="menu.childs.length && menu.activated" class="submenu">
12
+ <div
13
+ *ngFor="let submenu of menu.childs"
14
+ [class]="submenu.activated ? 'menu selected' : 'menu'"
15
+ (click)="goTo(submenu.path, $event)">
16
+ <div *ngIf="!submenu.icon" class="menu-dot">&bull;</div>
17
+ <div *ngIf="submenu.icon" class="menu-icon">
18
+ <fa-icon *ngIf="submenu.icon.filter !== undefined" [icon]="submenu.icon"></fa-icon>
19
+ <img *ngIf="submenu.icon.filter === undefined" [src]="submenu.icon" />
20
+ </div>
21
+ <div *ngIf="submenu.label" class="menu-caption">
22
+ <span>{{submenu.label | translate}}</span>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </h4>
@@ -0,0 +1,52 @@
1
+ .menu, .submenu {
2
+ cursor: pointer;
3
+ }
4
+
5
+ h4 {
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+
10
+ h4 .menu {
11
+ padding: 1em 0;
12
+ display: flex;
13
+ flex-direction: row;
14
+ }
15
+
16
+ h4 .menu > div {
17
+ flex: 1 1 auto;
18
+ align-self: center;
19
+ }
20
+
21
+ .menu-dot {
22
+ max-width: 1.1em;
23
+ text-align: center;
24
+ margin-right: 0.5em;
25
+ font-size: 2em;
26
+ }
27
+
28
+ .menu-icon {
29
+ max-width: 60px;
30
+ text-align: center;
31
+ margin-right: 0.5em;
32
+ }
33
+
34
+ .submenu {
35
+ margin-left: 1em;
36
+ }
37
+
38
+ .submenu .menu {
39
+ padding: 0;
40
+ font-size: 0.9em;
41
+ line-height: 2.2em;
42
+ }
43
+
44
+ .submenu .menu::before {
45
+ content: "";
46
+ margin-left: 1.1em;
47
+ width: 0.1em;
48
+ height: 2.5em;
49
+ position: relative;
50
+ background: #ffffff;
51
+ margin-right: -1.17em;
52
+ }
@@ -0,0 +1,28 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { RouterTestingModule } from '@angular/router/testing';
3
+ import { CaucaMenuVerticalComponent } from './cauca-menu-vertical.component';
4
+
5
+ describe('CaucaVerticalMenuComponent', () => {
6
+ let component: CaucaMenuVerticalComponent;
7
+ let fixture: ComponentFixture<CaucaMenuVerticalComponent>;
8
+
9
+ beforeEach(waitForAsync(() => {
10
+ TestBed.configureTestingModule({
11
+ imports: [
12
+ CaucaMenuVerticalComponent,
13
+ RouterTestingModule,
14
+ ]
15
+ })
16
+ .compileComponents();
17
+ }));
18
+
19
+ beforeEach(() => {
20
+ fixture = TestBed.createComponent(CaucaMenuVerticalComponent);
21
+ component = fixture.componentInstance;
22
+ fixture.detectChanges();
23
+ });
24
+
25
+ it('should create', () => {
26
+ expect(component).toBeTruthy();
27
+ });
28
+ });
@@ -0,0 +1,53 @@
1
+ import { Component, EventEmitter, Input, Output, inject } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import {NavigationEnd, Router} from '@angular/router';
4
+ import {MenuItem} from '../shared/models/menu-item';
5
+ import { FaIconComponent } from '@fortawesome/angular-fontawesome';
6
+ import { TranslateModule } from '@ngx-translate/core';
7
+
8
+ @Component({
9
+ selector: 'cauca-menu-vertical',
10
+ templateUrl: './cauca-menu-vertical.component.html',
11
+ styleUrls: ['./cauca-menu-vertical.component.scss'],
12
+ imports: [
13
+ CommonModule,
14
+ FaIconComponent,
15
+ TranslateModule,
16
+ ]
17
+ })
18
+ export class CaucaMenuVerticalComponent {
19
+
20
+ @Output() public itemClick = new EventEmitter();
21
+ @Input() public menuItems: MenuItem[] = [];
22
+
23
+ private readonly router = inject(Router);
24
+
25
+ public constructor() {
26
+ this.router.events.subscribe((route: NavigationEnd) => {
27
+ if (route instanceof NavigationEnd) {
28
+ this.selectActiveRoute(route);
29
+ }
30
+ });
31
+ }
32
+
33
+ public goTo(path: string, e: any): void {
34
+ this.router.navigate([path]);
35
+ this.itemClick.emit();
36
+
37
+ e.stopPropagation();
38
+ }
39
+
40
+ private selectActiveRoute(route: NavigationEnd): void {
41
+ this.menuItems.forEach((menu: MenuItem) => {
42
+ if (route.url) {
43
+ menu.activated = (route.url === menu.path || (menu.childs.length && route.url.indexOf(menu.path) > -1));
44
+ }
45
+
46
+ menu.childs.forEach((subMenu: MenuItem) => {
47
+ if (route.url) {
48
+ subMenu.activated = (route.url === subMenu.path || route.urlAfterRedirects === subMenu.path);
49
+ }
50
+ });
51
+ });
52
+ }
53
+ }
@@ -0,0 +1,7 @@
1
+ <h1 mat-dialog-title>{{data.title}}</h1>
2
+ <div mat-dialog-content>
3
+ <div [innerHTML]="data.message"></div>
4
+ </div>
5
+ <div mat-dialog-actions *ngIf="data.buttons">
6
+ <button *ngFor="let label of data.buttons; let i = index" mat-raised-button (click)="onClick(i)">{{label}}</button>
7
+ </div>
@@ -0,0 +1,4 @@
1
+ div[mat-dialog-actions] {
2
+ margin-top: 20px;
3
+ text-align: center;
4
+ }
@@ -0,0 +1,39 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import {
3
+ MAT_DIALOG_DATA,
4
+ MatDialogModule,
5
+ MatDialogRef
6
+ } from '@angular/material/dialog';
7
+ import { CaucaSimpleDialogComponent } from './cauca-simple-dialog.component';
8
+
9
+ describe('CaucaSimpleDialogComponent', () => {
10
+ let component: CaucaSimpleDialogComponent;
11
+ let fixture: ComponentFixture<CaucaSimpleDialogComponent>;
12
+
13
+ beforeEach(waitForAsync(() => {
14
+ TestBed.configureTestingModule({
15
+ imports: [
16
+ CaucaSimpleDialogComponent,
17
+ MatDialogModule,
18
+ ],
19
+ providers: [{
20
+ provide: MatDialogRef,
21
+ useValue: {}
22
+ }, {
23
+ provide: MAT_DIALOG_DATA,
24
+ useValue: {}
25
+ }]
26
+ })
27
+ .compileComponents();
28
+ }));
29
+
30
+ beforeEach(() => {
31
+ fixture = TestBed.createComponent(CaucaSimpleDialogComponent);
32
+ component = fixture.componentInstance;
33
+ fixture.detectChanges();
34
+ });
35
+
36
+ it('should create', () => {
37
+ expect(component).toBeTruthy();
38
+ });
39
+ });
@@ -0,0 +1,20 @@
1
+ import { Component, inject } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';
4
+ import { SimpleDialogData } from '../shared/models/simple-dialog-data';
5
+ import { MatButtonModule } from '@angular/material/button';
6
+
7
+ @Component({
8
+ selector: 'cauca-simple-dialog',
9
+ templateUrl: './cauca-simple-dialog.component.html',
10
+ styleUrls: ['./cauca-simple-dialog.component.scss'],
11
+ imports: [CommonModule, MatDialogTitle, MatDialogContent, MatDialogActions, MatButtonModule]
12
+ })
13
+ export class CaucaSimpleDialogComponent{
14
+ public readonly data = inject<SimpleDialogData>(MAT_DIALOG_DATA);
15
+ private readonly dialogRef = inject<MatDialogRef<CaucaSimpleDialogComponent>>(MatDialogRef);
16
+
17
+ public onClick(buttonIndex: number): void {
18
+ this.dialogRef.close(buttonIndex);
19
+ }
20
+ }
@@ -0,0 +1,7 @@
1
+ <div #container class="slideshow">
2
+ @for (url of images; track url; let index = $index) {
3
+ <div [class.active]="index === selectedIndex" [class.entering]="states[index] === 'in'" [class.leaving]="states[index] === 'out'">
4
+ <img [src]="url" />
5
+ </div>
6
+ }
7
+ </div>
@@ -0,0 +1,41 @@
1
+ .slideshow {
2
+ margin: 0 auto;
3
+ position: relative;
4
+ overflow: hidden;
5
+ }
6
+
7
+ .slideshow > div {
8
+ width: 100%;
9
+ height: 100%;
10
+ position: absolute;
11
+ transition: transform 500ms ease-in, opacity 500ms ease-in;
12
+
13
+ /* Default state - off-screen to the right, ready to enter */
14
+ transform: translateX(100%);
15
+ opacity: 0;
16
+
17
+ &.active {
18
+ /* Active slide - centered */
19
+ transform: translateX(0%);
20
+ opacity: 1;
21
+ }
22
+
23
+ &.leaving {
24
+ /* Leaving slide - move off-screen to the left */
25
+ transform: translateX(-100%);
26
+ opacity: 0;
27
+ }
28
+
29
+ &.entering {
30
+ /* Entering slide - animate from right to center */
31
+ transform: translateX(0%);
32
+ opacity: 1;
33
+ }
34
+ }
35
+
36
+ img {
37
+ max-height: 100%;
38
+ max-width: 100%;
39
+ margin: 0 auto;
40
+ display: block;
41
+ }
@@ -0,0 +1,24 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { CaucaSlideshowComponent } from './cauca-slideshow.component';
3
+
4
+ describe('CaucaSlideshowComponent', () => {
5
+ let component: CaucaSlideshowComponent;
6
+ let fixture: ComponentFixture<CaucaSlideshowComponent>;
7
+
8
+ beforeEach(waitForAsync(() => {
9
+ TestBed.configureTestingModule({
10
+ imports: [ CaucaSlideshowComponent ]
11
+ })
12
+ .compileComponents();
13
+ }));
14
+
15
+ beforeEach(() => {
16
+ fixture = TestBed.createComponent(CaucaSlideshowComponent);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ });
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });