@cauca-911/material 20.2.13 → 20.2.14

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 +4629 -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 +795 -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,213 +0,0 @@
1
- import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
2
- import { Component, Input } from '@angular/core';
3
-
4
- import { SelectWithSearchComponent } from './select-with-search.component';
5
- import { HarnessLoader } from '@angular/cdk/testing';
6
- import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
7
- import { MatFormFieldHarness } from '@angular/material/form-field/testing';
8
- import { MockModule, MockPipe } from 'ng-mocks';
9
- import { TranslateModule, TranslatePipe } from '@ngx-translate/core';
10
- import { MatSelectHarness } from '@angular/material/select/testing';
11
-
12
- // Mock the external search component to avoid FormControl timing side-effects in tests
13
- @Component({ selector: 'ngx-mat-select-search', template: '' })
14
- class MockNgxMatSelectSearchComponent {
15
- @Input() public formControl: any;
16
- @Input() public placeholderLabel?: string;
17
- @Input() public noEntriesFoundLabel?: string;
18
- }
19
-
20
- describe('SelectWithSearchComponent', () => {
21
- let component: SelectWithSearchComponent;
22
- let fixture: ComponentFixture<SelectWithSearchComponent>;
23
- let loader: HarnessLoader;
24
-
25
- beforeEach(async () => {
26
- await TestBed.configureTestingModule({
27
- imports: [SelectWithSearchComponent, MockModule(TranslateModule)],
28
- declarations: [
29
- MockPipe(TranslatePipe, value => value),
30
- MockNgxMatSelectSearchComponent
31
- ]
32
- }).compileComponents();
33
-
34
- fixture = TestBed.createComponent(SelectWithSearchComponent);
35
- loader = TestbedHarnessEnvironment.loader(fixture);
36
- component = fixture.componentInstance;
37
-
38
- fixture.componentRef.setInput('showClearOption', false);
39
- fixture.componentRef.setInput('enableSearch', true);
40
- fixture.detectChanges();
41
- });
42
-
43
- it('should create', () => {
44
- expect(component).toBeTruthy();
45
- });
46
-
47
- it('should show label received in input', async () => {
48
- const someLabel = 'ASuperLabel';
49
- const formField = await loader.getHarnessOrNull(MatFormFieldHarness);
50
-
51
- component.label = someLabel;
52
-
53
- expect(await formField.getLabel()).toBe(someLabel);
54
- });
55
-
56
- it('should disable control when zero option are provided', async () => {
57
- const formField = await loader.getHarnessOrNull(MatFormFieldHarness);
58
-
59
- expect(await formField.isDisabled()).toBeTrue();
60
- });
61
-
62
- it('shouldn\'t disable control when options are provided', async () => {
63
- component.options = [{id: '1', name: 'Super!'}];
64
- fixture.detectChanges();
65
- const formField = await loader.getHarnessOrNull(MatFormFieldHarness);
66
-
67
- expect(await formField.isDisabled()).toBeFalse();
68
- });
69
-
70
- it('should always have ngx search mat-option', async () => {
71
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
72
- component.options = [{ id: '1', name: 'Super!' }];
73
- fixture.detectChanges();
74
-
75
- await formField.open();
76
-
77
- expect((await formField.getOptions()).length).toBe(2);
78
- });
79
-
80
- it('should show mat-option for each option provided', async () => {
81
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!'}];
82
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
83
-
84
- fixture.detectChanges();
85
- await formField.open();
86
-
87
- expect((await formField.getOptions()).length).toBe(3);
88
- });
89
-
90
- it('should select option when value is provided', async () => {
91
- const someOption = { id: '1', name: 'Super!' };
92
- component.value = someOption.id;
93
- component.options = [{ id: '2', name: 'Cool!' }, someOption];
94
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
95
-
96
- fixture.detectChanges();
97
- await formField.open();
98
-
99
- expect(await formField.getValueText()).toBe(someOption.name);
100
- });
101
-
102
- it('should emit valueChanged when option change', async () => {
103
- const someOption = { id: '1', name: 'Super!' };
104
- component.options = [someOption, { id: '2', name: 'Cool!' }];
105
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
106
-
107
- fixture.detectChanges();
108
- await formField.open();
109
- await formField.clickOptions({text: someOption.name});
110
-
111
- expect(component.value).toBe(someOption.id);
112
- expect(await formField.getValueText()).toBe(someOption.name);
113
- });
114
-
115
- it('should filter options when setting filter control value', fakeAsync(() => {
116
- const someOption = { id: '1', name: 'Super!' };
117
- component.options = [someOption, { id: '2', name: 'Cool!' }];
118
-
119
- fixture.detectChanges();
120
- tick();
121
-
122
- expect(component.filteredOptions.value()?.length).toBe(2);
123
-
124
- component.optionFilterControl.setValue('Co');
125
- tick();
126
- fixture.detectChanges();
127
- tick();
128
-
129
- expect(component.filteredOptions.value()?.length).toBe(1);
130
- expect(component.filteredOptions.value()![0].name).toBe('Cool!');
131
- }));
132
-
133
- it('should select first option when selectFirstOptionByDefault is true', async () => {
134
- const someOption = { id: '1', name: 'Super!' };
135
- component.selectFirstOptionByDefault = true;
136
- component.options = [someOption, { id: '2', name: 'Cool!' }];
137
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
138
-
139
- expect(await formField.getValueText()).toBe(someOption.name);
140
- });
141
-
142
- it('shouldn\'t select first option when selectFirstOptionByDefault is false', async () => {
143
- const someOption = { id: '1', name: 'Super!' };
144
- component.selectFirstOptionByDefault = false;
145
- component.options = [someOption, { id: '2', name: 'Cool!' }];
146
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
147
-
148
- expect(await formField.getValueText()).toBeFalsy();
149
- });
150
-
151
- it('should show clear option when showClearOption is true', async () => {
152
- fixture.componentRef.setInput('showClearOption', true);
153
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
154
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
155
-
156
- fixture.detectChanges();
157
- await formField.open();
158
-
159
- expect((await formField.getOptions()).length).toBe(4);
160
-
161
- const options = await formField.getOptions();
162
- expect(await options[1].getText()).toBe('--');
163
- });
164
-
165
- it('should not show clear option when showClearOption is false', async () => {
166
- fixture.componentRef.setInput('showClearOption', false);
167
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
168
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
169
-
170
- fixture.detectChanges();
171
- await formField.open();
172
-
173
- // Should have search option + 2 regular options = 3 total
174
- expect((await formField.getOptions()).length).toBe(3);
175
- });
176
-
177
- it('should clear selection when clear option is selected', async () => {
178
- fixture.componentRef.setInput('showClearOption', true);
179
- component.value = '1';
180
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
181
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
182
-
183
- fixture.detectChanges();
184
- await formField.open();
185
- await formField.clickOptions({ text: '--' });
186
-
187
- expect(component.value).toBeNull();
188
- });
189
-
190
- it('should always show clear option even when filtering', fakeAsync(() => {
191
- fixture.componentRef.setInput('showClearOption', true);
192
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
193
-
194
- fixture.detectChanges();
195
- tick();
196
-
197
- // With clear option enabled, the resource should include clear option at index 0
198
- const initial = component.filteredOptions.value() || [];
199
- expect(initial.length).toBe(3);
200
- expect(initial[0].name).toBe('--');
201
-
202
- // Filter and ensure the clear option remains present
203
- component.optionFilterControl.setValue('Co');
204
- tick();
205
- fixture.detectChanges();
206
- tick();
207
-
208
- const filtered = component.filteredOptions.value() || [];
209
- expect(filtered.length).toBe(2);
210
- expect(filtered[0].name).toBe('--');
211
- expect(filtered[1].name).toBe('Cool!');
212
- }));
213
- });
@@ -1,108 +0,0 @@
1
- import { Component, computed, EventEmitter, input, Input, Output, resource, signal, ViewChild } from '@angular/core';
2
- import { ReactiveFormsModule, FormsModule, FormControl } from '@angular/forms';
3
- import { MatFormFieldModule } from '@angular/material/form-field';
4
- import { MatSelect, MatSelectModule } from '@angular/material/select';
5
- import { TranslateModule } from '@ngx-translate/core';
6
- import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
7
- import { toSignal } from '@angular/core/rxjs-interop';
8
- import { toLowerCaseAndWithoutDiacritics } from '@cauca-911/core';
9
-
10
- export interface Option {
11
- id: string | null;
12
- name: string;
13
- }
14
-
15
- @Component({
16
- selector: 'cauca-select-with-search',
17
- standalone: true,
18
- imports: [MatSelectModule, TranslateModule, MatFormFieldModule, ReactiveFormsModule, FormsModule, NgxMatSelectSearchModule],
19
- templateUrl: './select-with-search.component.html',
20
- styleUrl: './select-with-search.component.scss'
21
- })
22
- export class SelectWithSearchComponent {
23
- @Input({required: true}) public label: string;
24
- @Input() public selectFirstOptionByDefault: boolean = false;
25
-
26
- public optionFilterControl: FormControl<string> = new FormControl<string>('');
27
- @ViewChild('singleSelect', { static: true }) public singleSelect: MatSelect;
28
- public isDisabled = input<boolean>(false);
29
- public hasOptions = signal<boolean>(false);
30
- public disableControl = computed(() => this.isDisabled() || !this.hasOptions());
31
- public allowMultiSelection = input<boolean>(false);
32
- public showClearOption = input<boolean>(false);
33
- public enableSearch = input<boolean>(true);
34
-
35
- public filteredOptions = resource({
36
- params: () => ({ filter: this.filterText(), options: this.allOptions(), showClear: this.showClearOption() }),
37
- loader: ({ params }) => Promise.resolve(this.computeFilteredOptions(params))
38
- });
39
-
40
- @Output()
41
- public valueChanged = new EventEmitter();
42
-
43
- private selectedOptionId: string | null;
44
- private readonly allOptions = signal<Option[]>([]);
45
- private readonly filterText = toSignal(this.optionFilterControl.valueChanges, { initialValue: '' });
46
-
47
- @Input()
48
- public set options(newOptions: Option[]) {
49
- if (newOptions) {
50
- this.allOptions.set(newOptions);
51
- this.hasOptions.set(newOptions.length >= 1);
52
- this.setInitialSelectedOption();
53
- } else {
54
- this.allOptions.set([]);
55
- this.hasOptions.set(false);
56
- }
57
- }
58
- public get options(): Option[] {
59
- return this.allOptions();
60
- }
61
-
62
- @Input()
63
- public set value(newValue: string | null) {
64
- if (newValue !== this.selectedOptionId) {
65
- this.selectedOptionId = newValue;
66
- this.valueChanged.emit(this.value);
67
- }
68
- }
69
- public get value(): string | null {
70
- return this.selectedOptionId;
71
- }
72
-
73
- private setInitialSelectedOption(): void {
74
- if (this.value) {
75
- const city = this.options.find((c: Option) => c.id === this.value);
76
- if (!city) {
77
- this.selectFirstOption();
78
- }
79
- } else if (this.options.length > 0 && this.selectFirstOptionByDefault) {
80
- this.selectFirstOption();
81
- }
82
- }
83
-
84
- private selectFirstOption(): void {
85
- this.value = this.options[0].id;
86
- }
87
-
88
- private computeFilteredOptions(params: { filter: string, options: Option[], showClear: boolean }): Option[] {
89
- const { filter, options, showClear } = params;
90
- if (!options || !Array.isArray(options)) {
91
- return [];
92
- }
93
- let filtered: Option[];
94
-
95
- if (!filter) {
96
- filtered = options.slice();
97
- } else {
98
- const filterLower = toLowerCaseAndWithoutDiacritics(filter);
99
- filtered = options.filter(option => toLowerCaseAndWithoutDiacritics(option?.name ?? '').indexOf(filterLower) > -1);
100
- }
101
- if (showClear) {
102
- const clearOption: Option = { id: null, name: '--' };
103
- filtered = [clearOption, ...filtered];
104
- }
105
-
106
- return filtered;
107
- }
108
- }
@@ -1,12 +0,0 @@
1
- <section>
2
- <div class="expansion-button" (click)="changeState()">
3
- <mat-icon [class.collapsed]="isCollapsed()">expand_less</mat-icon>
4
- <div>
5
- <div class="primary">{{caption()}}</div>
6
- <div class="body2">{{subCaption()}}</div>
7
- </div>
8
- </div>
9
- <div class="expansion-panel" [class.collapsed]="isCollapsed()">
10
- <ng-content></ng-content>
11
- </div>
12
- </section>
@@ -1,43 +0,0 @@
1
- section {
2
- display: flex;
3
- padding: 16px 0px;
4
- }
5
-
6
- .primary {
7
- font-weight: 600;
8
- }
9
-
10
- .body2 {
11
- width: fit-content;
12
- white-space: nowrap;
13
- }
14
-
15
- .expansion-button {
16
- display: flex;
17
- gap: 4px;
18
- width: 240px;
19
- padding: 0px 16px 8px 0px;
20
- cursor: pointer;
21
- height: fit-content;
22
-
23
- mat-icon {
24
- transition: transform 500ms ease-in-out;
25
- &.collapsed {
26
- transform: rotate(180deg);
27
- }
28
- }
29
- }
30
-
31
- .expansion-panel {
32
- overflow: hidden;
33
- flex: 1;
34
- display: grid;
35
- grid-template-rows: 1fr;
36
- transition: grid-template-rows 500ms ease-in, opacity 500ms ease-in, visibility 500ms ease-in;
37
-
38
- &.collapsed {
39
- grid-template-rows: 0fr;
40
- opacity: 0;
41
- visibility: hidden;
42
- }
43
- }
@@ -1,48 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { ExpandablePanelComponent } from './expandable-panel.component';
3
-
4
- describe('ExpandablePanelComponent', () => {
5
- let component: ExpandablePanelComponent;
6
- let fixture: ComponentFixture<ExpandablePanelComponent>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [ExpandablePanelComponent],
11
- })
12
- .compileComponents();
13
-
14
- fixture = TestBed.createComponent(ExpandablePanelComponent);
15
- component = fixture.componentInstance;
16
- fixture.detectChanges();
17
- });
18
-
19
- it('should create', () => {
20
- expect(component).toBeTruthy();
21
- });
22
-
23
- it('should display the title and subtitle', () => {
24
- const someTitle = 'someTitle';
25
- const someSubTitle = 'someSubTitle';
26
- fixture.componentRef.setInput('caption', someTitle);
27
- fixture.componentRef.setInput('subCaption', someSubTitle);
28
-
29
- fixture.detectChanges();
30
-
31
- expect(component.subCaption()).toBe(someSubTitle);
32
- expect(component.caption()).toBe(someTitle);
33
- expect(fixture.nativeElement.querySelector('.primary').textContent).toBe(someTitle);
34
- expect(fixture.nativeElement.querySelector('.body2').textContent).toBe(someSubTitle);
35
- });
36
-
37
- it('should be open by default', () => {
38
- expect(component.isCollapsed()).toBeFalse();
39
- });
40
-
41
- it('should collapsed when clicking on the button', () => {
42
- fixture.nativeElement.querySelector('.expansion-button').click();
43
- fixture.detectChanges();
44
-
45
- expect(component.isCollapsed()).toBeTrue();
46
- });
47
-
48
- });
@@ -1,19 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, InputSignal, ModelSignal, input, model } from '@angular/core';
2
- import { MatIcon } from '@angular/material/icon';
3
-
4
- @Component({
5
- selector: 'cauca-expandable-panel',
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- imports: [MatIcon],
8
- templateUrl: './expandable-panel.component.html',
9
- styleUrl: './expandable-panel.component.scss',
10
- })
11
- export class ExpandablePanelComponent {
12
- public isCollapsed: ModelSignal<boolean> = model(false);
13
- public caption: InputSignal<string> = input('');
14
- public subCaption: InputSignal<string> = input('');
15
-
16
- public changeState(): void {
17
- this.isCollapsed.update(value => !value);
18
- }
19
- }
@@ -1,6 +0,0 @@
1
- <div class="group-container">
2
- <div class="group-container-title subtitle1">{{caption()|translate}}</div>
3
- <div class="group-container-content">
4
- <ng-content />
5
- </div>
6
- </div>
@@ -1,22 +0,0 @@
1
- .group-container {
2
- display: flex;
3
- align-items: flex-start;
4
- align-self: stretch;
5
- }
6
-
7
- .group-container-title {
8
- display: flex;
9
- width: 300px;
10
- max-width: 300px;
11
- padding: 16px 0px;
12
- flex-direction: column;
13
- align-items: flex-start;
14
- }
15
-
16
- .group-container-content {
17
- display: flex;
18
- flex-direction: column;
19
- align-items: stretch;
20
- flex: 1;
21
- padding: 16px;
22
- }
@@ -1,34 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { GroupContainerComponent } from './group-container.component';
4
- import { MockModule, MockPipe } from 'ng-mocks';
5
- import { TranslateModule, TranslatePipe } from '@ngx-translate/core';
6
-
7
- describe('GroupContainerComponent', () => {
8
- let component: GroupContainerComponent;
9
- let fixture: ComponentFixture<GroupContainerComponent>;
10
-
11
- beforeEach(async () => {
12
- await TestBed.configureTestingModule({
13
- imports: [GroupContainerComponent, MockModule(TranslateModule)],
14
- declarations: [MockPipe(TranslatePipe, value => value)],
15
- })
16
- .compileComponents();
17
-
18
- fixture = TestBed.createComponent(GroupContainerComponent);
19
- component = fixture.componentInstance;
20
- fixture.detectChanges();
21
- });
22
-
23
- it('should create', () => {
24
- expect(component).toBeTruthy();
25
- });
26
-
27
- it('should have display the caption', () =>{
28
- fixture.componentRef.setInput('caption', 'Test Caption');
29
-
30
- fixture.detectChanges();
31
-
32
- expect(fixture.nativeElement.querySelector('.group-container-title').textContent).toContain('Test Caption');
33
- });
34
- });
@@ -1,14 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
- import { TranslateModule } from '@ngx-translate/core';
3
-
4
- @Component({
5
- selector: 'cauca-group-container',
6
- standalone: true,
7
- changeDetection: ChangeDetectionStrategy.OnPush,
8
- imports: [TranslateModule],
9
- templateUrl: './group-container.component.html',
10
- styleUrl: './group-container.component.scss'
11
- })
12
- export class GroupContainerComponent {
13
- public caption = input<string>();
14
- }
@@ -1,13 +0,0 @@
1
- <section [ngClass]="opened() ? 'bottom-padding' : ''" (click)="handleClick()">
2
- <mat-icon>{{menuIcon()}}</mat-icon>
3
- <div>
4
- <div class="subtitle1">{{caption() | translate}}</div>
5
- @if(subCaption()) {<div class="body2">{{subCaption() | translate}}</div>}
6
- </div>
7
- @if (showExpansionIcon()) {<mat-icon [class.opened]="opened()">arrow_forward_ios</mat-icon>}
8
- </section>
9
- @if(opened()) {
10
- @for (item of items(); track item.title) {
11
- <cauca-menu-expandable-panel-item [icon]="item.icon" [caption]="item.title" [route]="item.route" [isSubItem]="true" [action]="item.action" />
12
- }
13
- }
@@ -1,27 +0,0 @@
1
- :host {
2
- padding: 10px 12px;
3
- background-color: #FFFFFF;
4
- cursor: pointer;
5
- display: block;
6
- }
7
-
8
- section {
9
- display: flex;
10
- gap: 16px;
11
- align-items: center;
12
-
13
- mat-icon:last-child {
14
- transition: transform 200ms ease-in-out;
15
- &.opened {
16
- transform: rotate(-90deg);
17
- }
18
- }
19
- }
20
-
21
- section.bottom-padding {
22
- padding-bottom: 10px;
23
- }
24
-
25
- div {
26
- flex: 1;
27
- }