@cauca-911/material 21.0.1-beta.5 → 21.0.2

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 (240) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -24
  3. package/{src/assets → assets}/i18n/cauca/en-material.json +104 -104
  4. package/{src/assets → assets}/i18n/cauca/es-material.json +104 -104
  5. package/{src/assets → assets}/i18n/cauca/fr-material.json +106 -106
  6. package/fesm2022/cauca-911-material.mjs +4137 -0
  7. package/fesm2022/cauca-911-material.mjs.map +1 -0
  8. package/package.json +17 -2
  9. package/types/cauca-911-material.d.ts +745 -0
  10. package/.eslintrc.json +0 -79
  11. package/README_PACKAGE.md +0 -5
  12. package/karma.conf.js +0 -50
  13. package/ng-package.json +0 -7
  14. package/src/lib/cauca-material.component.html +0 -1
  15. package/src/lib/cauca-material.component.spec.ts +0 -29
  16. package/src/lib/cauca-material.component.ts +0 -12
  17. package/src/lib/cauca-material.service.spec.ts +0 -16
  18. package/src/lib/cauca-material.service.ts +0 -7
  19. package/src/lib/components/button/button.component.html +0 -52
  20. package/src/lib/components/button/button.component.scss +0 -6
  21. package/src/lib/components/button/button.component.spec.ts +0 -142
  22. package/src/lib/components/button/button.component.ts +0 -22
  23. package/src/lib/components/buttons/base-button.ts +0 -35
  24. package/src/lib/components/buttons/basic-button/basic-button.component.html +0 -5
  25. package/src/lib/components/buttons/basic-button/basic-button.component.scss +0 -12
  26. package/src/lib/components/buttons/basic-button/basic-button.component.spec.ts +0 -106
  27. package/src/lib/components/buttons/basic-button/basic-button.component.ts +0 -17
  28. package/src/lib/components/buttons/fab-button/fab-button.component.html +0 -3
  29. package/src/lib/components/buttons/fab-button/fab-button.component.scss +0 -12
  30. package/src/lib/components/buttons/fab-button/fab-button.component.spec.ts +0 -82
  31. package/src/lib/components/buttons/fab-button/fab-button.component.ts +0 -16
  32. package/src/lib/components/buttons/flat-button/flat-button.component.html +0 -5
  33. package/src/lib/components/buttons/flat-button/flat-button.component.scss +0 -12
  34. package/src/lib/components/buttons/flat-button/flat-button.component.spec.ts +0 -106
  35. package/src/lib/components/buttons/flat-button/flat-button.component.ts +0 -17
  36. package/src/lib/components/buttons/icon-button/icon-button.component.html +0 -3
  37. package/src/lib/components/buttons/icon-button/icon-button.component.scss +0 -23
  38. package/src/lib/components/buttons/icon-button/icon-button.component.spec.ts +0 -38
  39. package/src/lib/components/buttons/icon-button/icon-button.component.ts +0 -15
  40. package/src/lib/components/buttons/link-button/link-button.component.html +0 -1
  41. package/src/lib/components/buttons/link-button/link-button.component.scss +0 -3
  42. package/src/lib/components/buttons/link-button/link-button.component.spec.ts +0 -97
  43. package/src/lib/components/buttons/link-button/link-button.component.ts +0 -25
  44. package/src/lib/components/buttons/menu-item/menu-item.component.html +0 -5
  45. package/src/lib/components/buttons/menu-item/menu-item.component.scss +0 -6
  46. package/src/lib/components/buttons/menu-item/menu-item.component.spec.ts +0 -66
  47. package/src/lib/components/buttons/menu-item/menu-item.component.ts +0 -19
  48. package/src/lib/components/buttons/raised-button/raised-button.component.html +0 -5
  49. package/src/lib/components/buttons/raised-button/raised-button.component.scss +0 -12
  50. package/src/lib/components/buttons/raised-button/raised-button.component.spec.ts +0 -108
  51. package/src/lib/components/buttons/raised-button/raised-button.component.ts +0 -17
  52. package/src/lib/components/buttons/refresh-button/refresh-button.component.html +0 -1
  53. package/src/lib/components/buttons/refresh-button/refresh-button.component.scss +0 -0
  54. package/src/lib/components/buttons/refresh-button/refresh-button.component.spec.ts +0 -81
  55. package/src/lib/components/buttons/refresh-button/refresh-button.component.ts +0 -19
  56. package/src/lib/components/buttons/round-button/round-button.component.html +0 -3
  57. package/src/lib/components/buttons/round-button/round-button.component.scss +0 -34
  58. package/src/lib/components/buttons/round-button/round-button.component.spec.ts +0 -26
  59. package/src/lib/components/buttons/round-button/round-button.component.ts +0 -14
  60. package/src/lib/components/buttons/stroked-button/stroked-button.component.html +0 -5
  61. package/src/lib/components/buttons/stroked-button/stroked-button.component.scss +0 -23
  62. package/src/lib/components/buttons/stroked-button/stroked-button.component.spec.ts +0 -114
  63. package/src/lib/components/buttons/stroked-button/stroked-button.component.ts +0 -17
  64. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.html +0 -9
  65. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.scss +0 -7
  66. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.spec.ts +0 -68
  67. package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.ts +0 -155
  68. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.html +0 -6
  69. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.scss +0 -25
  70. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.spec.ts +0 -23
  71. package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.ts +0 -23
  72. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.html +0 -77
  73. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.scss +0 -124
  74. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.spec.ts +0 -96
  75. package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts +0 -228
  76. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.html +0 -9
  77. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.scss +0 -15
  78. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.spec.ts +0 -105
  79. package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.ts +0 -48
  80. package/src/lib/components/cauca-date-time-picker/models/dialog-date-time-picker-data.ts +0 -29
  81. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.html +0 -14
  82. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.scss +0 -3
  83. package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.ts +0 -87
  84. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.html +0 -12
  85. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.scss +0 -3
  86. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.spec.ts +0 -35
  87. package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.ts +0 -57
  88. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.html +0 -49
  89. package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.ts +0 -56
  90. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.html +0 -11
  91. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.scss +0 -4
  92. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.spec.ts +0 -39
  93. package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.ts +0 -20
  94. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.html +0 -7
  95. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.scss +0 -41
  96. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.spec.ts +0 -24
  97. package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.ts +0 -67
  98. package/src/lib/components/deprecated-components/shared/models/menu-item.ts +0 -11
  99. package/src/lib/components/deprecated-components/shared/models/simple-dialog-data.ts +0 -5
  100. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html +0 -10
  101. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.scss +0 -14
  102. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.spec.ts +0 -90
  103. package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts +0 -41
  104. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html +0 -11
  105. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.scss +0 -29
  106. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.spec.ts +0 -137
  107. package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts +0 -47
  108. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.html +0 -17
  109. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.scss +0 -14
  110. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.spec.ts +0 -96
  111. package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.ts +0 -40
  112. package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.spec.ts +0 -7
  113. package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.ts +0 -5
  114. package/src/lib/components/dialogs/dialog-styles.css +0 -9
  115. package/src/lib/components/dialogs/dialog-styles.scss +0 -9
  116. package/src/lib/components/dialogs/error-dialog/error-dialog.component.html +0 -10
  117. package/src/lib/components/dialogs/error-dialog/error-dialog.component.scss +0 -10
  118. package/src/lib/components/dialogs/error-dialog/error-dialog.component.spec.ts +0 -91
  119. package/src/lib/components/dialogs/error-dialog/error-dialog.component.ts +0 -32
  120. package/src/lib/components/dialogs/services/dialog.service.spec.ts +0 -82
  121. package/src/lib/components/dialogs/services/dialog.service.ts +0 -107
  122. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.html +0 -24
  123. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.scss +0 -22
  124. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.spec.ts +0 -126
  125. package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.ts +0 -66
  126. package/src/lib/components/inputs/color-picker/color-picker.component.html +0 -9
  127. package/src/lib/components/inputs/color-picker/color-picker.component.scss +0 -0
  128. package/src/lib/components/inputs/color-picker/color-picker.component.spec.ts +0 -29
  129. package/src/lib/components/inputs/color-picker/color-picker.component.ts +0 -111
  130. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.html +0 -13
  131. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.scss +0 -0
  132. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.spec.ts +0 -80
  133. package/src/lib/components/inputs/date-range-picker/date-range-picker.component.ts +0 -46
  134. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.html +0 -40
  135. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.scss +0 -39
  136. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.spec.ts +0 -135
  137. package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.ts +0 -263
  138. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.html +0 -6
  139. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.scss +0 -27
  140. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.spec.ts +0 -90
  141. package/src/lib/components/inputs/password/password-criteria/password-criteria.component.ts +0 -17
  142. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.html +0 -5
  143. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.scss +0 -8
  144. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.spec.ts +0 -98
  145. package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.ts +0 -16
  146. package/src/lib/components/inputs/password/password-input/password-input.component.html +0 -11
  147. package/src/lib/components/inputs/password/password-input/password-input.component.scss +0 -12
  148. package/src/lib/components/inputs/password/password-input/password-input.component.spec.ts +0 -141
  149. package/src/lib/components/inputs/password/password-input/password-input.component.ts +0 -67
  150. package/src/lib/components/inputs/password/password-selection/password-selection.component.html +0 -15
  151. package/src/lib/components/inputs/password/password-selection/password-selection.component.scss +0 -32
  152. package/src/lib/components/inputs/password/password-selection/password-selection.component.spec.ts +0 -138
  153. package/src/lib/components/inputs/password/password-selection/password-selection.component.ts +0 -101
  154. package/src/lib/components/inputs/select-with-search/select-with-search.component.html +0 -19
  155. package/src/lib/components/inputs/select-with-search/select-with-search.component.scss +0 -0
  156. package/src/lib/components/inputs/select-with-search/select-with-search.component.spec.ts +0 -215
  157. package/src/lib/components/inputs/select-with-search/select-with-search.component.ts +0 -108
  158. package/src/lib/components/layout/expandable-panel/expandable-panel.component.html +0 -14
  159. package/src/lib/components/layout/expandable-panel/expandable-panel.component.scss +0 -48
  160. package/src/lib/components/layout/expandable-panel/expandable-panel.component.spec.ts +0 -48
  161. package/src/lib/components/layout/expandable-panel/expandable-panel.component.ts +0 -19
  162. package/src/lib/components/layout/group-container/group-container.component.html +0 -6
  163. package/src/lib/components/layout/group-container/group-container.component.scss +0 -22
  164. package/src/lib/components/layout/group-container/group-container.component.spec.ts +0 -34
  165. package/src/lib/components/layout/group-container/group-container.component.ts +0 -14
  166. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.html +0 -13
  167. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.scss +0 -27
  168. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.spec.ts +0 -144
  169. package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.ts +0 -52
  170. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.html +0 -4
  171. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.scss +0 -10
  172. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.spec.ts +0 -80
  173. package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.ts +0 -28
  174. package/src/lib/components/layout/page-title/page-title.component.html +0 -35
  175. package/src/lib/components/layout/page-title/page-title.component.scss +0 -40
  176. package/src/lib/components/layout/page-title/page-title.component.spec.ts +0 -162
  177. package/src/lib/components/layout/page-title/page-title.component.ts +0 -28
  178. package/src/lib/components/layout/sections/main-section/main-section.component.html +0 -6
  179. package/src/lib/components/layout/sections/main-section/main-section.component.scss +0 -27
  180. package/src/lib/components/layout/sections/main-section/main-section.component.spec.ts +0 -42
  181. package/src/lib/components/layout/sections/main-section/main-section.component.ts +0 -13
  182. package/src/lib/components/layout/sections/section-column/section-column.component.html +0 -3
  183. package/src/lib/components/layout/sections/section-column/section-column.component.scss +0 -18
  184. package/src/lib/components/layout/sections/section-column/section-column.component.spec.ts +0 -35
  185. package/src/lib/components/layout/sections/section-column/section-column.component.ts +0 -12
  186. package/src/lib/components/layout/sections/section-field/section-field.component.html +0 -21
  187. package/src/lib/components/layout/sections/section-field/section-field.component.scss +0 -44
  188. package/src/lib/components/layout/sections/section-field/section-field.component.spec.ts +0 -74
  189. package/src/lib/components/layout/sections/section-field/section-field.component.ts +0 -22
  190. package/src/lib/components/list-paginator/list-paginator.component.html +0 -16
  191. package/src/lib/components/list-paginator/list-paginator.component.scss +0 -46
  192. package/src/lib/components/list-paginator/list-paginator.component.spec.ts +0 -248
  193. package/src/lib/components/list-paginator/list-paginator.component.ts +0 -81
  194. package/src/lib/components/misc/loading-error/loading-error.component.html +0 -11
  195. package/src/lib/components/misc/loading-error/loading-error.component.scss +0 -0
  196. package/src/lib/components/misc/loading-error/loading-error.component.spec.ts +0 -75
  197. package/src/lib/components/misc/loading-error/loading-error.component.ts +0 -18
  198. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.html +0 -3
  199. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.scss +0 -0
  200. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.spec.ts +0 -43
  201. package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.ts +0 -16
  202. package/src/lib/components/misc/snack-bar/snack-bar.component.html +0 -16
  203. package/src/lib/components/misc/snack-bar/snack-bar.component.scss +0 -84
  204. package/src/lib/components/misc/snack-bar/snack-bar.component.spec.ts +0 -136
  205. package/src/lib/components/misc/snack-bar/snack-bar.component.ts +0 -39
  206. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.html +0 -11
  207. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.scss +0 -0
  208. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.spec.ts +0 -67
  209. package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.ts +0 -15
  210. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.html +0 -11
  211. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.scss +0 -0
  212. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.spec.ts +0 -77
  213. package/src/lib/components/notifications/saving-error-box/saving-error-box.component.ts +0 -17
  214. package/src/lib/components/presenters/badge/badge.component.html +0 -6
  215. package/src/lib/components/presenters/badge/badge.component.scss +0 -10
  216. package/src/lib/components/presenters/badge/badge.component.spec.ts +0 -41
  217. package/src/lib/components/presenters/badge/badge.component.ts +0 -18
  218. package/src/lib/components/presenters/icon/icon.component.scss +0 -9
  219. package/src/lib/components/presenters/icon/icon.component.spec.ts +0 -38
  220. package/src/lib/components/presenters/icon/icon.component.ts +0 -37
  221. package/src/lib/core/breadcrumb.service.spec.ts +0 -35
  222. package/src/lib/core/breadcrumb.service.ts +0 -24
  223. package/src/lib/core/directives/auto-trim-and-lower.directive.spec.ts +0 -22
  224. package/src/lib/core/directives/auto-trim-and-lower.directive.ts +0 -19
  225. package/src/lib/core/directives/form-error/form-error.module.ts +0 -21
  226. package/src/lib/core/directives/form-error/has-error-root.directive.ts +0 -31
  227. package/src/lib/core/directives/form-error/has-error.directive.ts +0 -95
  228. package/src/lib/core/loading-state.service.spec.ts +0 -57
  229. package/src/lib/core/loading-state.service.ts +0 -44
  230. package/src/lib/core/models/breadcrumb-location.ts +0 -6
  231. package/src/lib/core/models/password-validation.ts +0 -20
  232. package/src/lib/core/validators/password/password-validator.spec.ts +0 -155
  233. package/src/lib/core/validators/password/password-validator.ts +0 -30
  234. package/src/lib/provide-cauca-material.ts +0 -10
  235. package/src/public-api.ts +0 -70
  236. package/src/test.ts +0 -17
  237. package/tsconfig.lib.json +0 -18
  238. package/tsconfig.lib.prod.json +0 -4
  239. package/tsconfig.spec.json +0 -17
  240. /package/{src/assets → assets}/images/loading.gif +0 -0
@@ -1,215 +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', fakeAsync(async () => {
48
- const someLabel = 'ASuperLabel';
49
-
50
- component.label = someLabel;
51
- fixture.detectChanges();
52
- tick();
53
-
54
- const formField = await loader.getHarnessOrNull(MatFormFieldHarness);
55
- expect(await formField.getLabel()).toBe(someLabel);
56
- }));
57
-
58
- it('should disable control when zero option are provided', async () => {
59
- const formField = await loader.getHarnessOrNull(MatFormFieldHarness);
60
-
61
- expect(await formField.isDisabled()).toBeTrue();
62
- });
63
-
64
- it('shouldn\'t disable control when options are provided', async () => {
65
- component.options = [{id: '1', name: 'Super!'}];
66
- fixture.detectChanges();
67
- const formField = await loader.getHarnessOrNull(MatFormFieldHarness);
68
-
69
- expect(await formField.isDisabled()).toBeFalse();
70
- });
71
-
72
- it('should always have ngx search mat-option', async () => {
73
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
74
- component.options = [{ id: '1', name: 'Super!' }];
75
- fixture.detectChanges();
76
-
77
- await formField.open();
78
-
79
- expect((await formField.getOptions()).length).toBe(2);
80
- });
81
-
82
- it('should show mat-option for each option provided', async () => {
83
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!'}];
84
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
85
-
86
- fixture.detectChanges();
87
- await formField.open();
88
-
89
- expect((await formField.getOptions()).length).toBe(3);
90
- });
91
-
92
- it('should select option when value is provided', async () => {
93
- const someOption = { id: '1', name: 'Super!' };
94
- component.value = someOption.id;
95
- component.options = [{ id: '2', name: 'Cool!' }, someOption];
96
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
97
-
98
- fixture.detectChanges();
99
- await formField.open();
100
-
101
- expect(await formField.getValueText()).toBe(someOption.name);
102
- });
103
-
104
- it('should emit valueChanged when option change', async () => {
105
- const someOption = { id: '1', name: 'Super!' };
106
- component.options = [someOption, { id: '2', name: 'Cool!' }];
107
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
108
-
109
- fixture.detectChanges();
110
- await formField.open();
111
- await formField.clickOptions({text: someOption.name});
112
-
113
- expect(component.value).toBe(someOption.id);
114
- expect(await formField.getValueText()).toBe(someOption.name);
115
- });
116
-
117
- it('should filter options when setting filter control value', fakeAsync(() => {
118
- const someOption = { id: '1', name: 'Super!' };
119
- component.options = [someOption, { id: '2', name: 'Cool!' }];
120
-
121
- fixture.detectChanges();
122
- tick();
123
-
124
- expect(component.filteredOptions.value()?.length).toBe(2);
125
-
126
- component.optionFilterControl.setValue('Co');
127
- tick();
128
- fixture.detectChanges();
129
- tick();
130
-
131
- expect(component.filteredOptions.value()?.length).toBe(1);
132
- expect(component.filteredOptions.value()![0].name).toBe('Cool!');
133
- }));
134
-
135
- it('should select first option when selectFirstOptionByDefault is true', async () => {
136
- const someOption = { id: '1', name: 'Super!' };
137
- component.selectFirstOptionByDefault = true;
138
- component.options = [someOption, { id: '2', name: 'Cool!' }];
139
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
140
-
141
- expect(await formField.getValueText()).toBe(someOption.name);
142
- });
143
-
144
- it('shouldn\'t select first option when selectFirstOptionByDefault is false', async () => {
145
- const someOption = { id: '1', name: 'Super!' };
146
- component.selectFirstOptionByDefault = false;
147
- component.options = [someOption, { id: '2', name: 'Cool!' }];
148
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
149
-
150
- expect(await formField.getValueText()).toBeFalsy();
151
- });
152
-
153
- it('should show clear option when showClearOption is true', async () => {
154
- fixture.componentRef.setInput('showClearOption', true);
155
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
156
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
157
-
158
- fixture.detectChanges();
159
- await formField.open();
160
-
161
- expect((await formField.getOptions()).length).toBe(4);
162
-
163
- const options = await formField.getOptions();
164
- expect(await options[1].getText()).toBe('--');
165
- });
166
-
167
- it('should not show clear option when showClearOption is false', async () => {
168
- fixture.componentRef.setInput('showClearOption', false);
169
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
170
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
171
-
172
- fixture.detectChanges();
173
- await formField.open();
174
-
175
- // Should have search option + 2 regular options = 3 total
176
- expect((await formField.getOptions()).length).toBe(3);
177
- });
178
-
179
- it('should clear selection when clear option is selected', async () => {
180
- fixture.componentRef.setInput('showClearOption', true);
181
- component.value = '1';
182
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
183
- const formField = await loader.getHarnessOrNull(MatSelectHarness);
184
-
185
- fixture.detectChanges();
186
- await formField.open();
187
- await formField.clickOptions({ text: '--' });
188
-
189
- expect(component.value).toBeNull();
190
- });
191
-
192
- it('should always show clear option even when filtering', fakeAsync(() => {
193
- fixture.componentRef.setInput('showClearOption', true);
194
- component.options = [{ id: '1', name: 'Super!' }, { id: '2', name: 'Cool!' }];
195
-
196
- fixture.detectChanges();
197
- tick();
198
-
199
- // With clear option enabled, the resource should include clear option at index 0
200
- const initial = component.filteredOptions.value() || [];
201
- expect(initial.length).toBe(3);
202
- expect(initial[0].name).toBe('--');
203
-
204
- // Filter and ensure the clear option remains present
205
- component.optionFilterControl.setValue('Co');
206
- tick();
207
- fixture.detectChanges();
208
- tick();
209
-
210
- const filtered = component.filteredOptions.value() || [];
211
- expect(filtered.length).toBe(2);
212
- expect(filtered[0].name).toBe('--');
213
- expect(filtered[1].name).toBe('Cool!');
214
- }));
215
- });
@@ -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,14 +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
- <div class="expansion-panel-content">
11
- <ng-content></ng-content>
12
- </div>
13
- </div>
14
- </section>
@@ -1,48 +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
- min-height: 0;
37
- transition: grid-template-rows 500ms ease-in, opacity 500ms ease-in, visibility 500ms ease-in;
38
-
39
- &.collapsed {
40
- grid-template-rows: 0fr;
41
- opacity: 0;
42
- visibility: hidden;
43
- }
44
- }
45
-
46
- .expansion-panel-content {
47
- min-height: 0;
48
- }
@@ -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
- }