@cauca-911/material 20.2.13 → 20.2.15

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/LICENSE +21 -0
  2. package/README.md +3 -22
  3. package/fesm2022/cauca-911-material.mjs +4639 -0
  4. package/fesm2022/cauca-911-material.mjs.map +1 -0
  5. package/package.json +38 -23
  6. package/types/cauca-911-material.d.ts +796 -0
  7. package/.eslintrc.json +0 -77
  8. package/README_PACKAGE.md +0 -5
  9. package/karma.conf.js +0 -50
  10. package/ng-package.json +0 -7
  11. package/src/lib/cauca-material.component.html +0 -1
  12. package/src/lib/cauca-material.component.spec.ts +0 -29
  13. package/src/lib/cauca-material.component.ts +0 -12
  14. package/src/lib/cauca-material.service.spec.ts +0 -16
  15. package/src/lib/cauca-material.service.ts +0 -7
  16. package/src/lib/components/button/button.component.html +0 -52
  17. package/src/lib/components/button/button.component.scss +0 -6
  18. package/src/lib/components/button/button.component.spec.ts +0 -134
  19. package/src/lib/components/button/button.component.ts +0 -21
  20. package/src/lib/components/buttons/base-button.ts +0 -35
  21. package/src/lib/components/buttons/basic-button/basic-button.component.html +0 -5
  22. package/src/lib/components/buttons/basic-button/basic-button.component.scss +0 -12
  23. package/src/lib/components/buttons/basic-button/basic-button.component.spec.ts +0 -106
  24. package/src/lib/components/buttons/basic-button/basic-button.component.ts +0 -17
  25. package/src/lib/components/buttons/fab-button/fab-button.component.html +0 -3
  26. package/src/lib/components/buttons/fab-button/fab-button.component.scss +0 -12
  27. package/src/lib/components/buttons/fab-button/fab-button.component.spec.ts +0 -82
  28. package/src/lib/components/buttons/fab-button/fab-button.component.ts +0 -16
  29. package/src/lib/components/buttons/flat-button/flat-button.component.html +0 -5
  30. package/src/lib/components/buttons/flat-button/flat-button.component.scss +0 -12
  31. package/src/lib/components/buttons/flat-button/flat-button.component.spec.ts +0 -106
  32. package/src/lib/components/buttons/flat-button/flat-button.component.ts +0 -17
  33. package/src/lib/components/buttons/icon-button/icon-button.component.html +0 -3
  34. package/src/lib/components/buttons/icon-button/icon-button.component.scss +0 -23
  35. package/src/lib/components/buttons/icon-button/icon-button.component.spec.ts +0 -38
  36. package/src/lib/components/buttons/icon-button/icon-button.component.ts +0 -15
  37. package/src/lib/components/buttons/link-button/link-button.component.html +0 -1
  38. package/src/lib/components/buttons/link-button/link-button.component.scss +0 -3
  39. package/src/lib/components/buttons/link-button/link-button.component.spec.ts +0 -97
  40. package/src/lib/components/buttons/link-button/link-button.component.ts +0 -25
  41. package/src/lib/components/buttons/menu-item/menu-item.component.html +0 -5
  42. package/src/lib/components/buttons/menu-item/menu-item.component.scss +0 -6
  43. package/src/lib/components/buttons/menu-item/menu-item.component.spec.ts +0 -66
  44. package/src/lib/components/buttons/menu-item/menu-item.component.ts +0 -19
  45. package/src/lib/components/buttons/raised-button/raised-button.component.html +0 -5
  46. package/src/lib/components/buttons/raised-button/raised-button.component.scss +0 -12
  47. package/src/lib/components/buttons/raised-button/raised-button.component.spec.ts +0 -108
  48. package/src/lib/components/buttons/raised-button/raised-button.component.ts +0 -17
  49. package/src/lib/components/buttons/refresh-button/refresh-button.component.html +0 -1
  50. package/src/lib/components/buttons/refresh-button/refresh-button.component.scss +0 -0
  51. package/src/lib/components/buttons/refresh-button/refresh-button.component.spec.ts +0 -81
  52. package/src/lib/components/buttons/refresh-button/refresh-button.component.ts +0 -19
  53. package/src/lib/components/buttons/round-button/round-button.component.html +0 -3
  54. package/src/lib/components/buttons/round-button/round-button.component.scss +0 -34
  55. package/src/lib/components/buttons/round-button/round-button.component.spec.ts +0 -26
  56. package/src/lib/components/buttons/round-button/round-button.component.ts +0 -14
  57. package/src/lib/components/buttons/stroked-button/stroked-button.component.html +0 -5
  58. package/src/lib/components/buttons/stroked-button/stroked-button.component.scss +0 -23
  59. package/src/lib/components/buttons/stroked-button/stroked-button.component.spec.ts +0 -114
  60. package/src/lib/components/buttons/stroked-button/stroked-button.component.ts +0 -17
  61. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.html +0 -9
  62. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.scss +0 -7
  63. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.spec.ts +0 -68
  64. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.ts +0 -155
  65. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.html +0 -6
  66. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.scss +0 -25
  67. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.spec.ts +0 -23
  68. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.ts +0 -23
  69. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.html +0 -53
  70. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.scss +0 -124
  71. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.spec.ts +0 -93
  72. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts +0 -227
  73. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.html +0 -9
  74. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.scss +0 -15
  75. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.spec.ts +0 -103
  76. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.ts +0 -47
  77. package/src/lib/components/cauca-date-time-picker/models/dialog-date-time-picker-data.ts +0 -29
  78. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.html +0 -11
  79. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.scss +0 -3
  80. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.ts +0 -87
  81. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.html +0 -8
  82. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.scss +0 -3
  83. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.spec.ts +0 -35
  84. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.ts +0 -57
  85. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.html +0 -19
  86. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.scss +0 -142
  87. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.spec.ts +0 -30
  88. package/src/lib/components/deprecated-components/cauca-menu-sidebar/cauca-menu-sidebar.component.ts +0 -112
  89. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.html +0 -26
  90. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.scss +0 -52
  91. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.spec.ts +0 -28
  92. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.ts +0 -53
  93. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.html +0 -7
  94. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.scss +0 -4
  95. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.spec.ts +0 -39
  96. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.ts +0 -20
  97. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.html +0 -7
  98. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.scss +0 -41
  99. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.spec.ts +0 -24
  100. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.ts +0 -67
  101. package/src/lib/components/deprecated-components/shared/models/menu-item.ts +0 -11
  102. package/src/lib/components/deprecated-components/shared/models/simple-dialog-data.ts +0 -5
  103. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html +0 -10
  104. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.scss +0 -14
  105. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.spec.ts +0 -90
  106. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts +0 -41
  107. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html +0 -11
  108. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.scss +0 -29
  109. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.spec.ts +0 -137
  110. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts +0 -47
  111. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.html +0 -17
  112. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.scss +0 -14
  113. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.spec.ts +0 -96
  114. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.ts +0 -40
  115. package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.spec.ts +0 -7
  116. package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.ts +0 -5
  117. package/src/lib/components/dialogs/dialog-styles.css +0 -9
  118. package/src/lib/components/dialogs/dialog-styles.scss +0 -9
  119. package/src/lib/components/dialogs/error-dialog/error-dialog.component.html +0 -10
  120. package/src/lib/components/dialogs/error-dialog/error-dialog.component.scss +0 -10
  121. package/src/lib/components/dialogs/error-dialog/error-dialog.component.spec.ts +0 -91
  122. package/src/lib/components/dialogs/error-dialog/error-dialog.component.ts +0 -32
  123. package/src/lib/components/dialogs/services/dialog.service.spec.ts +0 -82
  124. package/src/lib/components/dialogs/services/dialog.service.ts +0 -107
  125. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.html +0 -24
  126. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.scss +0 -22
  127. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.spec.ts +0 -126
  128. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.ts +0 -66
  129. package/src/lib/components/inputs/color-picker/color-picker.component.html +0 -9
  130. package/src/lib/components/inputs/color-picker/color-picker.component.scss +0 -0
  131. package/src/lib/components/inputs/color-picker/color-picker.component.spec.ts +0 -29
  132. package/src/lib/components/inputs/color-picker/color-picker.component.ts +0 -111
  133. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.html +0 -13
  134. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.scss +0 -0
  135. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.spec.ts +0 -80
  136. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.ts +0 -46
  137. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.html +0 -40
  138. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.scss +0 -39
  139. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.spec.ts +0 -135
  140. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.ts +0 -263
  141. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.html +0 -6
  142. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.scss +0 -27
  143. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.spec.ts +0 -90
  144. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.ts +0 -17
  145. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.html +0 -5
  146. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.scss +0 -8
  147. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.spec.ts +0 -98
  148. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.ts +0 -16
  149. package/src/lib/components/inputs/password/password-input/password-input.component.html +0 -11
  150. package/src/lib/components/inputs/password/password-input/password-input.component.scss +0 -12
  151. package/src/lib/components/inputs/password/password-input/password-input.component.spec.ts +0 -141
  152. package/src/lib/components/inputs/password/password-input/password-input.component.ts +0 -67
  153. package/src/lib/components/inputs/password/password-selection/password-selection.component.html +0 -15
  154. package/src/lib/components/inputs/password/password-selection/password-selection.component.scss +0 -32
  155. package/src/lib/components/inputs/password/password-selection/password-selection.component.spec.ts +0 -138
  156. package/src/lib/components/inputs/password/password-selection/password-selection.component.ts +0 -100
  157. package/src/lib/components/inputs/select-with-search/select-with-search.component.html +0 -19
  158. package/src/lib/components/inputs/select-with-search/select-with-search.component.scss +0 -0
  159. package/src/lib/components/inputs/select-with-search/select-with-search.component.spec.ts +0 -213
  160. package/src/lib/components/inputs/select-with-search/select-with-search.component.ts +0 -108
  161. package/src/lib/components/layout/expandable-panel/expandable-panel.component.html +0 -12
  162. package/src/lib/components/layout/expandable-panel/expandable-panel.component.scss +0 -43
  163. package/src/lib/components/layout/expandable-panel/expandable-panel.component.spec.ts +0 -48
  164. package/src/lib/components/layout/expandable-panel/expandable-panel.component.ts +0 -19
  165. package/src/lib/components/layout/group-container/group-container.component.html +0 -6
  166. package/src/lib/components/layout/group-container/group-container.component.scss +0 -22
  167. package/src/lib/components/layout/group-container/group-container.component.spec.ts +0 -34
  168. package/src/lib/components/layout/group-container/group-container.component.ts +0 -14
  169. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.html +0 -13
  170. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.scss +0 -27
  171. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.spec.ts +0 -144
  172. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.ts +0 -52
  173. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.html +0 -4
  174. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.scss +0 -10
  175. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.spec.ts +0 -80
  176. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.ts +0 -28
  177. package/src/lib/components/layout/page-title/page-title.component.html +0 -28
  178. package/src/lib/components/layout/page-title/page-title.component.scss +0 -40
  179. package/src/lib/components/layout/page-title/page-title.component.spec.ts +0 -162
  180. package/src/lib/components/layout/page-title/page-title.component.ts +0 -28
  181. package/src/lib/components/layout/sections/main-section/main-section.component.html +0 -6
  182. package/src/lib/components/layout/sections/main-section/main-section.component.scss +0 -27
  183. package/src/lib/components/layout/sections/main-section/main-section.component.spec.ts +0 -42
  184. package/src/lib/components/layout/sections/main-section/main-section.component.ts +0 -13
  185. package/src/lib/components/layout/sections/section-column/section-column.component.html +0 -3
  186. package/src/lib/components/layout/sections/section-column/section-column.component.scss +0 -18
  187. package/src/lib/components/layout/sections/section-column/section-column.component.spec.ts +0 -35
  188. package/src/lib/components/layout/sections/section-column/section-column.component.ts +0 -12
  189. package/src/lib/components/layout/sections/section-field/section-field.component.html +0 -21
  190. package/src/lib/components/layout/sections/section-field/section-field.component.scss +0 -44
  191. package/src/lib/components/layout/sections/section-field/section-field.component.spec.ts +0 -74
  192. package/src/lib/components/layout/sections/section-field/section-field.component.ts +0 -22
  193. package/src/lib/components/list-paginator/list-paginator.component.html +0 -16
  194. package/src/lib/components/list-paginator/list-paginator.component.scss +0 -46
  195. package/src/lib/components/list-paginator/list-paginator.component.spec.ts +0 -248
  196. package/src/lib/components/list-paginator/list-paginator.component.ts +0 -81
  197. package/src/lib/components/misc/loading-error/loading-error.component.html +0 -11
  198. package/src/lib/components/misc/loading-error/loading-error.component.scss +0 -0
  199. package/src/lib/components/misc/loading-error/loading-error.component.spec.ts +0 -75
  200. package/src/lib/components/misc/loading-error/loading-error.component.ts +0 -18
  201. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.html +0 -3
  202. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.scss +0 -0
  203. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.spec.ts +0 -43
  204. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.ts +0 -16
  205. package/src/lib/components/misc/snack-bar/snack-bar.component.html +0 -16
  206. package/src/lib/components/misc/snack-bar/snack-bar.component.scss +0 -84
  207. package/src/lib/components/misc/snack-bar/snack-bar.component.spec.ts +0 -136
  208. package/src/lib/components/misc/snack-bar/snack-bar.component.ts +0 -39
  209. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.html +0 -11
  210. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.scss +0 -0
  211. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.spec.ts +0 -67
  212. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.ts +0 -15
  213. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.html +0 -11
  214. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.scss +0 -0
  215. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.spec.ts +0 -77
  216. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.ts +0 -17
  217. package/src/lib/components/presenters/badge/badge.component.html +0 -6
  218. package/src/lib/components/presenters/badge/badge.component.scss +0 -10
  219. package/src/lib/components/presenters/badge/badge.component.spec.ts +0 -41
  220. package/src/lib/components/presenters/badge/badge.component.ts +0 -18
  221. package/src/lib/components/presenters/icon/icon.component.scss +0 -9
  222. package/src/lib/components/presenters/icon/icon.component.spec.ts +0 -38
  223. package/src/lib/components/presenters/icon/icon.component.ts +0 -37
  224. package/src/lib/core/breadcrumb.service.spec.ts +0 -35
  225. package/src/lib/core/breadcrumb.service.ts +0 -24
  226. package/src/lib/core/directives/auto-trim-and-lower.directive.spec.ts +0 -22
  227. package/src/lib/core/directives/auto-trim-and-lower.directive.ts +0 -19
  228. package/src/lib/core/directives/form-error/form-error.module.ts +0 -21
  229. package/src/lib/core/directives/form-error/has-error-root.directive.ts +0 -29
  230. package/src/lib/core/directives/form-error/has-error.directive.ts +0 -95
  231. package/src/lib/core/loading-state.service.spec.ts +0 -57
  232. package/src/lib/core/loading-state.service.ts +0 -44
  233. package/src/lib/core/models/breadcrumb-location.ts +0 -6
  234. package/src/lib/core/models/password-validation.ts +0 -20
  235. package/src/lib/core/validators/password/password-validator.spec.ts +0 -155
  236. package/src/lib/core/validators/password/password-validator.ts +0 -30
  237. package/src/lib/provide-cauca-material.ts +0 -10
  238. package/src/public-api.ts +0 -74
  239. package/src/test.ts +0 -17
  240. package/tsconfig.lib.json +0 -22
  241. package/tsconfig.lib.prod.json +0 -4
  242. package/tsconfig.spec.json +0 -17
  243. /package/{src/assets → assets}/i18n/cauca/en-material.json +0 -0
  244. /package/{src/assets → assets}/i18n/cauca/es-material.json +0 -0
  245. /package/{src/assets → assets}/i18n/cauca/fr-material.json +0 -0
  246. /package/{src/assets → assets}/images/loading.gif +0 -0
@@ -1,227 +0,0 @@
1
- import { Component, HostListener, OnInit, signal, WritableSignal, inject } from '@angular/core';
2
- import { provideNativeDateAdapter } from '@angular/material/core';
3
- import { MatDatepickerModule } from '@angular/material/datepicker';
4
- import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
5
- import { MatListModule } from '@angular/material/list';
6
- import { DialogDateTimePickerOptions, DialogDateTimePickerDataDisabled, DialogDateTimePickerDataStep } from '../../models/dialog-date-time-picker-data';
7
- import { CaucaCoreForChildModule } from '@cauca-911/core';
8
- import { MatButtonModule } from '@angular/material/button';
9
- import { MatIconModule } from '@angular/material/icon';
10
- import { CommonModule } from '@angular/common';
11
- import { MobileTimePickerComponent } from '../mobile-time-picker/mobile-time-picker.component';
12
- import { DesktopTimePickerComponent } from '../desktop-time-picker/desktop-time-picker.component';
13
-
14
- @Component({
15
- selector: 'cauca-dialog-date-time-picker',
16
- imports: [
17
- CommonModule,
18
- CaucaCoreForChildModule,
19
- MatButtonModule,
20
- MatDatepickerModule,
21
- MatIconModule,
22
- MatListModule,
23
- MobileTimePickerComponent,
24
- DesktopTimePickerComponent
25
- ],
26
- providers: [provideNativeDateAdapter()],
27
- templateUrl: './dialog-date-time-picker.component.html',
28
- styleUrl: './dialog-date-time-picker.component.scss'
29
- })
30
- export class DialogDateTimePickerComponent implements OnInit {
31
-
32
- public selectedHour = 0;
33
- public selectedMinute = 0;
34
- public selectedSecond = 0;
35
- public initialDate: Date = null;
36
- public selectedDate: Date = null;
37
- public minimumDate = new Date();
38
- public maximumDate = new Date();
39
- public showSeconds: boolean = false;
40
- public showClearButton: boolean = true;
41
- public showButtonIcons: boolean = true;
42
-
43
- public hours = [...Array(24).keys()];
44
- public minutes = [...Array(60).keys()];
45
- public seconds = [...Array(60).keys()];
46
- public showMobileUi: boolean = false;
47
-
48
- public showTime: WritableSignal<boolean> = signal(true);
49
-
50
- public disabled: DialogDateTimePickerDataDisabled = {
51
- hours: true,
52
- someHours: [],
53
- minutes: true,
54
- someMinutes: [],
55
- seconds: true,
56
- someSeconds: [],
57
- };
58
-
59
- private step: DialogDateTimePickerDataStep = {
60
- hours: 1,
61
- minutes: 1,
62
- seconds: 1,
63
- };
64
-
65
- private readonly dialogRef = inject<MatDialogRef<DialogDateTimePickerComponent>>(MatDialogRef);
66
- private readonly options = inject<DialogDateTimePickerOptions>(MAT_DIALOG_DATA);
67
-
68
- public constructor() {
69
- const options = this.options;
70
-
71
- this.step = options.step || this.step;
72
- this.showSeconds = options.showSeconds;
73
- this.showButtonIcons = options.showButtonIcons ?? this.showButtonIcons;
74
- this.showClearButton = options.showClearButton ?? this.showClearButton;
75
- this.showTime.set(options.showTime ?? true);
76
- this.setListHoursMinutes();
77
- this.initialEachComponentValue(options);
78
- }
79
-
80
- public ngOnInit(): void {
81
- this.onWindowWithChange(window.innerWidth);
82
- }
83
-
84
- @HostListener('window:resize', ['$event'])
85
- public onResize(event) {
86
- this.onWindowWithChange(event.target.innerWidth);
87
- }
88
-
89
- public dateChanged(date: Date): void {
90
- if (date) {
91
- this.selectedDate = date;
92
- this.selectedDate.setHours(this.selectedHour);
93
- this.selectedDate.setMinutes(this.selectedMinute);
94
- this.selectedDate.setSeconds(this.selectedSecond);
95
- this.disabled.hours = false;
96
- this.disabled.someHours = this.hours.filter(hour => this.hourOfSelectedDateIsDisabled(hour));
97
- } else {
98
- this.selectedDate = null;
99
- this.disabled.hours = true;
100
- }
101
- }
102
-
103
- public hourChanged(hour: number): void {
104
- if (this.disabled.hours || this.disabled.someHours.includes(hour)) return;
105
-
106
- this.selectedHour = hour;
107
- this.selectedDate.setHours(hour);
108
- this.disabled.minutes = false;
109
- this.disabled.someMinutes = this.minutes.filter(minute => this.minuteOfSelectedDateIsDisabled(minute));
110
- }
111
-
112
- public minuteChanged(minute: number): void {
113
- if (this.disabled.minutes || this.disabled.someMinutes.includes(minute)) return;
114
-
115
- this.selectedMinute = minute;
116
- this.selectedDate.setMinutes(minute);
117
- this.disabled.seconds = false;
118
- this.disabled.someSeconds = this.seconds.filter(second => this.secondOfSelectedDateIsDisabled(second));
119
- }
120
-
121
- public secondChanged(second: number): void {
122
- if (this.disabled.seconds || this.disabled.someSeconds.includes(second)) return;
123
-
124
- this.selectedSecond = second;
125
- this.selectedDate.setSeconds(second);
126
- }
127
-
128
- public clear(): void {
129
- this.dialogRef.close({
130
- value: null
131
- });
132
- }
133
-
134
- public cancel(): void {
135
- this.dialogRef.close({
136
- value: this.initialDate
137
- });
138
- }
139
-
140
- public confirm(): void {
141
- this.dialogRef.close({
142
- value: this.selectedDate
143
- });
144
- }
145
-
146
- private onWindowWithChange(width: number): void {
147
- this.showMobileUi = width && width <= 555;
148
- }
149
-
150
- private hourOfSelectedDateIsDisabled(hour: number): boolean {
151
- if (this.selectedDateIsTheMinimumDate()) {
152
- return hour < this.minimumDate.getHours();
153
- } else if (this.selectedDateIsTheMaximumDate()) {
154
- return hour > this.maximumDate.getHours();
155
- }
156
-
157
- return false;
158
- }
159
-
160
- private minuteOfSelectedDateIsDisabled(minute: number): boolean {
161
- if (
162
- this.selectedDateIsTheMinimumDate() &&
163
- this.selectedDate.getHours() === this.minimumDate.getHours()
164
- ) {
165
- return minute < this.minimumDate.getMinutes();
166
- } else if (
167
- this.selectedDateIsTheMaximumDate() &&
168
- this.selectedDate.getHours() === this.maximumDate.getHours()
169
- ) {
170
- return minute > this.maximumDate.getMinutes();
171
- }
172
-
173
- return false;
174
- }
175
-
176
- private secondOfSelectedDateIsDisabled(second: number): boolean {
177
- if (
178
- this.selectedDateIsTheMinimumDate() &&
179
- this.selectedDate.getHours() === this.minimumDate.getHours() &&
180
- this.selectedDate.getMinutes() === this.minimumDate.getMinutes()
181
- ) {
182
- return second < this.minimumDate.getSeconds();
183
- } else if (
184
- this.selectedDateIsTheMaximumDate() &&
185
- this.selectedDate.getMinutes() === this.maximumDate.getMinutes()
186
- ) {
187
- return second > this.maximumDate.getSeconds();
188
- }
189
-
190
- return false;
191
- }
192
-
193
- private initialEachComponentValue(options: DialogDateTimePickerOptions): void {
194
- this.initialDate = options.selectedDate ? new Date(options.selectedDate) : null;
195
- this.minimumDate = options.minimumDate ? new Date(options.minimumDate) : null;
196
- this.maximumDate = options.maximumDate ? new Date(options.maximumDate) : null;
197
- this.selectedDate = options.selectedDate ? new Date(options.selectedDate) : new Date();
198
- this.dateChanged(options.selectedDate ? new Date(options.selectedDate) : null);
199
- this.hourChanged(options.selectedDate ? new Date(options.selectedDate).getHours() : 0);
200
- this.minuteChanged(options.selectedDate ? new Date(options.selectedDate).getMinutes() : 0);
201
- this.secondChanged(options.selectedDate ? new Date(options.selectedDate).getSeconds() : 0);
202
- }
203
-
204
- private selectedDateIsTheMinimumDate(): boolean {
205
- return (
206
- this.minimumDate &&
207
- this.selectedDate.getFullYear() === this.minimumDate.getFullYear() &&
208
- this.selectedDate.getMonth() === this.minimumDate.getMonth() &&
209
- this.selectedDate.getDate() === this.minimumDate.getDate()
210
- );
211
- }
212
-
213
- private selectedDateIsTheMaximumDate(): boolean {
214
- return (
215
- this.maximumDate &&
216
- this.selectedDate.getFullYear() === this.maximumDate.getFullYear() &&
217
- this.selectedDate.getMonth() === this.maximumDate.getMonth() &&
218
- this.selectedDate.getDate() === this.maximumDate.getDate()
219
- );
220
- }
221
-
222
- private setListHoursMinutes(): void {
223
- this.hours = this.hours.filter(hour => hour % this.step.hours === 0);
224
- this.minutes = this.minutes.filter(minute => minute % this.step.minutes === 0);
225
- this.seconds = this.seconds.filter(seconde => seconde % this.step.seconds === 0);
226
- }
227
- }
@@ -1,9 +0,0 @@
1
- <button mat-icon-button (click)="valueUp()">
2
- <mat-icon>keyboard_arrow_up</mat-icon>
3
- </button>
4
- <div>
5
- {{(value < 10 ? '0' : '' ) + value}}
6
- </div>
7
- <button mat-icon-button (click)="valueDown()">
8
- <mat-icon>keyboard_arrow_down</mat-icon>
9
- </button>
@@ -1,15 +0,0 @@
1
- :host {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: center;
5
- justify-content: center;
6
- height: 70px;
7
- font-family: var(--mat-form-field-container-text-font);
8
- }
9
-
10
- .mat-mdc-icon-button {
11
- height: 24px;
12
- width: 24px;
13
- line-height: 24px;
14
- padding: 0;
15
- }
@@ -1,103 +0,0 @@
1
- import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
2
- import { HarnessLoader } from '@angular/cdk/testing';
3
- import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
4
- import { MatButtonHarness } from '@angular/material/button/testing';
5
-
6
- import { MobileTimePickerComponent } from './mobile-time-picker.component';
7
-
8
- const someOptions = [
9
- 0, 1, 2
10
- ];
11
- const someFirstOption = 0;
12
- const someLastOption = 2;
13
-
14
- describe('MobileTimePickerComponent', () => {
15
- let component: MobileTimePickerComponent;
16
- let fixture: ComponentFixture<MobileTimePickerComponent>;
17
- let loader: HarnessLoader;
18
-
19
- beforeEach(async () => {
20
- await TestBed.configureTestingModule({
21
- imports: [MobileTimePickerComponent]
22
- })
23
- .compileComponents();
24
-
25
- fixture = TestBed.createComponent(MobileTimePickerComponent);
26
- loader = TestbedHarnessEnvironment.loader(fixture);
27
- component = fixture.componentInstance;
28
- fixture.detectChanges();
29
- component.options = someOptions;
30
- component.value = 0;
31
- });
32
-
33
- it('should create', () => {
34
- expect(component).toBeTruthy();
35
- });
36
-
37
- it('should emit valueChange when clicking Up arrow', fakeAsync(async () => {
38
- const spy = spyOn(component.valueChange, 'emit');
39
- const button = await loader.getHarnessOrNull(MatButtonHarness);
40
-
41
- button.click();
42
- tick();
43
-
44
- expect(spy).toHaveBeenCalled();
45
- }));
46
-
47
- it('should change for next value when clicking Up arrow', fakeAsync(async () => {
48
- component.value = someFirstOption;
49
- const spy = spyOn(component.valueChange, 'emit');
50
- const button = await loader.getHarnessOrNull(MatButtonHarness);
51
-
52
- button.click();
53
- tick();
54
-
55
- expect(spy).toHaveBeenCalledWith(someFirstOption + 1);
56
- }));
57
-
58
- it('should return to first value when clicking Up arrow and at the last value is selected', fakeAsync(async () => {
59
- component.value = someLastOption;
60
- const spy = spyOn(component.valueChange, 'emit');
61
- const button = await loader.getHarnessOrNull(MatButtonHarness);
62
-
63
- button.click();
64
- tick();
65
-
66
- expect(spy).toHaveBeenCalledWith(someFirstOption);
67
- }));
68
-
69
- it('should emit valueChange when clicking Down arrow', fakeAsync(async () => {
70
- const spy = spyOn(component.valueChange, 'emit');
71
- const buttons = await loader.getAllHarnesses(MatButtonHarness);
72
- const button = buttons[buttons.length - 1];
73
-
74
- button.click();
75
- tick();
76
-
77
- expect(spy).toHaveBeenCalled();
78
- }));
79
-
80
- it('should change for next value when clicking Down arrow', fakeAsync(async () => {
81
- component.value = someLastOption;
82
- const spy = spyOn(component.valueChange, 'emit');
83
- const buttons = await loader.getAllHarnesses(MatButtonHarness);
84
- const button = buttons[buttons.length - 1];
85
-
86
- button.click();
87
- tick();
88
-
89
- expect(spy).toHaveBeenCalledWith(someLastOption - 1);
90
- }));
91
-
92
- it('should return to last value when clicking Down arrow and at the first value is selected', fakeAsync(async () => {
93
- component.value = someFirstOption;
94
- const spy = spyOn(component.valueChange, 'emit');
95
- const buttons = await loader.getAllHarnesses(MatButtonHarness);
96
- const button = buttons[buttons.length - 1];
97
-
98
- button.click();
99
- tick();
100
-
101
- expect(spy).toHaveBeenCalledWith(someLastOption);
102
- }));
103
- });
@@ -1,47 +0,0 @@
1
- import { Component, EventEmitter, Input, Output } from '@angular/core';
2
- import { MatButtonModule } from '@angular/material/button';
3
- import { MatFormFieldModule } from '@angular/material/form-field';
4
- import { MatIconModule } from '@angular/material/icon';
5
- import { MatInputModule } from '@angular/material/input';
6
-
7
- @Component({
8
- selector: 'cauca-mobile-time-picker',
9
- imports: [
10
- MatButtonModule,
11
- MatIconModule,
12
- MatFormFieldModule,
13
- MatInputModule
14
- ],
15
- templateUrl: './mobile-time-picker.component.html',
16
- styleUrl: './mobile-time-picker.component.scss'
17
- })
18
- export class MobileTimePickerComponent {
19
- @Input({required: true}) public value: number;
20
- @Input({ required: true }) public options: number[];
21
-
22
- @Output() public valueChange = new EventEmitter<number>();
23
-
24
- public valueUp(): void {
25
- const currentIndex = this.options.indexOf(this.value);
26
- let newValue = 0;
27
- if (currentIndex === this.options.length - 1) {
28
- newValue = this.options[0];
29
- } else {
30
- newValue = this.options[currentIndex + 1];
31
- }
32
-
33
- this.valueChange.emit(newValue);
34
- }
35
-
36
- public valueDown(): void {
37
- const currentIndex = this.options.indexOf(this.value);
38
- let newValue = 0;
39
- if (currentIndex === 0) {
40
- newValue = this.options[this.options.length - 1];
41
- } else {
42
- newValue = this.options[currentIndex - 1];
43
- }
44
-
45
- this.valueChange.emit(newValue);
46
- }
47
- }
@@ -1,29 +0,0 @@
1
- export interface DialogDateTimePickerDataStep {
2
- hours: number,
3
- minutes: number,
4
- seconds: number,
5
- }
6
-
7
- export interface DialogDateTimePickerDataDisabled {
8
- hours: boolean,
9
- someHours: number[],
10
- minutes: boolean,
11
- someMinutes: number[],
12
- seconds: boolean,
13
- someSeconds: number[],
14
- }
15
-
16
- export interface DialogDateTimePickerOptions {
17
- selectedDate: Date,
18
- minimumDate: Date | null,
19
- maximumDate: Date | null,
20
- showSeconds: boolean,
21
- showClearButton: boolean,
22
- showButtonIcons: boolean,
23
- showTime: boolean,
24
- step: DialogDateTimePickerDataStep,
25
- }
26
-
27
- export interface DialogDateTimePickerValue {
28
- value: Date,
29
- }
@@ -1,11 +0,0 @@
1
- <button mat-raised-button (click)="openDialog($event)">
2
- <mat-icon *ngIf="icon">{{icon}}</mat-icon>
3
- <span *ngIf="text">{{text}}</span>
4
- </button>
5
- <ng-container *ngIf="multiple; else notMultipleInput">
6
- <input #file type="file" (change)="onSelectFile($event)" [accept]="accept" multiple="multiple" />
7
- </ng-container>
8
-
9
- <ng-template #notMultipleInput>
10
- <input #file type="file" (change)="onSelectFile($event)" [accept]="accept" />
11
- </ng-template>
@@ -1,87 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild, inject } from '@angular/core';
2
- import { MatDialog } from '@angular/material/dialog';
3
- import { TranslateService } from '@cauca-911/core';
4
- import { CaucaSimpleDialogComponent } from '../cauca-simple-dialog/cauca-simple-dialog.component';
5
- import { MatButtonModule } from '@angular/material/button';
6
- import { MatIcon } from '@angular/material/icon';
7
-
8
- @Component({
9
- selector: 'cauca-input-file',
10
- templateUrl: './cauca-input-file.component.html',
11
- styleUrls: ['./cauca-input-file.component.scss'],
12
- imports: [MatButtonModule, MatIcon]
13
- })
14
- export class CaucaInputFileComponent implements OnInit {
15
-
16
- @ViewChild('file', {static: false})
17
- public file: ElementRef;
18
- @Output()
19
- public readend = new EventEmitter();
20
- @Input()
21
- public accept = '';
22
- @Input()
23
- public multiple = false;
24
- @Input()
25
- public icon = '';
26
- @Input()
27
- public text = '';
28
-
29
- private labels: any = {};
30
- private readonly translateService = inject(TranslateService);
31
- private readonly dialog = inject(MatDialog);
32
-
33
- public ngOnInit(): void {
34
- if (!this.icon && !this.text) {
35
- this.translateService.get(
36
- ['material.select', 'material.dialogTitle', 'material.dialogMessage']
37
- ).subscribe((labels: any) => {
38
- this.labels = labels;
39
- this.text = labels['material.select'];
40
- });
41
- }
42
- }
43
-
44
- public onSelectFile(e: any): void {
45
- for (let i = 0, j = e.target.files.length; i < j; i++) {
46
- const file = e.target.files[i];
47
- const reader = new FileReader();
48
- reader.onerror = ((error: any) => this.onError(error));
49
- reader.onload = ((event: any) => this.onReadEnd(file, event));
50
- reader.readAsDataURL(file);
51
- }
52
-
53
- if (e.target.files.length) {
54
- this.dialog.open(CaucaSimpleDialogComponent, {
55
- width: '250px',
56
- disableClose: true,
57
- data: {
58
- title: this.labels['material.dialogTitle'],
59
- message: this.labels['material.dialogMessage']
60
- }
61
- });
62
- }
63
- }
64
-
65
- public openDialog(event: any): void {
66
- if (this.file) {
67
- this.file.nativeElement.click();
68
- }
69
- event.stopPropagation();
70
- }
71
-
72
- private onError(error: any): void {
73
- throw error;
74
- }
75
-
76
- private onReadEnd(file: any, e: any): void {
77
- this.dialog.closeAll();
78
- this.readend.emit({
79
- name: file.name,
80
- size: file.size,
81
- type: file.type,
82
- lastModifiedDate: file.lastModifiedDate,
83
- content: e.target['result'],
84
- file,
85
- });
86
- }
87
- }
@@ -1,8 +0,0 @@
1
- <mat-tab-group [selectedIndex]="selectedIndex" (selectedIndexChange)="onTagChanged($event)">
2
- <mat-tab *ngFor="let lang of labels; let i = index" [label]="lang">
3
- <mat-form-field hideRequiredMarker="never">
4
- <input matInput [placeholder]="lang" [formControl]="forms[i]" required="required">
5
- <mat-error *ngIf="forms[i].invalid">{{getErrorMessage(i) | translate}}</mat-error>
6
- </mat-form-field>
7
- </mat-tab>
8
- </mat-tab-group>
@@ -1,35 +0,0 @@
1
- import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
3
- import { MatFormFieldModule } from '@angular/material/form-field';
4
- import { MatTabsModule } from '@angular/material/tabs';
5
- import { CaucaCoreModule } from '@cauca-911/core';
6
- import { CaucaInputMultipleLangueComponent } from './cauca-input-multiple-langue.component';
7
-
8
- describe('CaucaInputMultipleLangueComponent', () => {
9
- let component: CaucaInputMultipleLangueComponent;
10
- let fixture: ComponentFixture<CaucaInputMultipleLangueComponent>;
11
-
12
- beforeEach(waitForAsync(() => {
13
- TestBed.configureTestingModule({
14
- imports: [
15
- CaucaInputMultipleLangueComponent,
16
- CaucaCoreModule,
17
- FormsModule,
18
- ReactiveFormsModule,
19
- MatFormFieldModule,
20
- MatTabsModule,
21
- ]
22
- })
23
- .compileComponents();
24
- }));
25
-
26
- beforeEach(() => {
27
- fixture = TestBed.createComponent(CaucaInputMultipleLangueComponent);
28
- component = fixture.componentInstance;
29
- fixture.detectChanges();
30
- });
31
-
32
- it('should create', () => {
33
- expect(component).toBeTruthy();
34
- });
35
- });
@@ -1,57 +0,0 @@
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
- }
@@ -1,19 +0,0 @@
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>