@tacdaed/fragments 1.0.0-beta.2 → 1.0.0-beta.3

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 (248) hide show
  1. package/README.md +3 -3
  2. package/fesm2022/tacdaed-fragments.mjs +8928 -0
  3. package/fesm2022/tacdaed-fragments.mjs.map +1 -0
  4. package/index.d.ts +3929 -0
  5. package/package.json +29 -22
  6. package/ng-package.json +0 -25
  7. package/src/lib/components/accordion/accordion.component.html +0 -103
  8. package/src/lib/components/accordion/accordion.component.scss +0 -382
  9. package/src/lib/components/accordion/accordion.component.spec.ts +0 -147
  10. package/src/lib/components/accordion/accordion.component.ts +0 -211
  11. package/src/lib/components/accordion/accordion.type.ts +0 -82
  12. package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -43
  13. package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -112
  14. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -33
  15. package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -103
  16. package/src/lib/components/breadcrumb/breadcrumb.interface.ts +0 -7
  17. package/src/lib/components/button/button.component.html +0 -57
  18. package/src/lib/components/button/button.component.scss +0 -445
  19. package/src/lib/components/button/button.component.spec.ts +0 -99
  20. package/src/lib/components/button/button.component.ts +0 -143
  21. package/src/lib/components/button/button.type.ts +0 -7
  22. package/src/lib/components/card/card.component.html +0 -44
  23. package/src/lib/components/card/card.component.scss +0 -114
  24. package/src/lib/components/card/card.component.spec.ts +0 -65
  25. package/src/lib/components/card/card.component.ts +0 -21
  26. package/src/lib/components/card/card.type.ts +0 -3
  27. package/src/lib/components/code-block/code-block.component.html +0 -55
  28. package/src/lib/components/code-block/code-block.component.scss +0 -122
  29. package/src/lib/components/code-block/code-block.component.spec.ts +0 -81
  30. package/src/lib/components/code-block/code-block.component.ts +0 -302
  31. package/src/lib/components/code-block/code-block.interface.ts +0 -28
  32. package/src/lib/components/code-block/code-block.type.ts +0 -73
  33. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.html +0 -14
  34. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.scss +0 -20
  35. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.spec.ts +0 -38
  36. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.ts +0 -181
  37. package/src/lib/components/input/input-base.ts +0 -187
  38. package/src/lib/components/input/input-calendar/input-calendar.component.html +0 -76
  39. package/src/lib/components/input/input-calendar/input-calendar.component.scss +0 -179
  40. package/src/lib/components/input/input-calendar/input-calendar.component.spec.ts +0 -44
  41. package/src/lib/components/input/input-calendar/input-calendar.component.ts +0 -299
  42. package/src/lib/components/input/input-checkbox/input-checkbox.component.html +0 -37
  43. package/src/lib/components/input/input-checkbox/input-checkbox.component.scss +0 -128
  44. package/src/lib/components/input/input-checkbox/input-checkbox.component.spec.ts +0 -43
  45. package/src/lib/components/input/input-checkbox/input-checkbox.component.ts +0 -112
  46. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.html +0 -43
  47. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.scss +0 -140
  48. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.spec.ts +0 -62
  49. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.ts +0 -136
  50. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.html +0 -81
  51. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.scss +0 -228
  52. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.spec.ts +0 -62
  53. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.ts +0 -178
  54. package/src/lib/components/input/input-consts.ts +0 -132
  55. package/src/lib/components/input/input-date/input-date-validators.ts +0 -41
  56. package/src/lib/components/input/input-date/input-date.component.html +0 -41
  57. package/src/lib/components/input/input-date/input-date.component.scss +0 -95
  58. package/src/lib/components/input/input-date/input-date.component.spec.ts +0 -43
  59. package/src/lib/components/input/input-date/input-date.component.ts +0 -359
  60. package/src/lib/components/input/input-date-time/input-date-time.component.html +0 -70
  61. package/src/lib/components/input/input-date-time/input-date-time.component.scss +0 -133
  62. package/src/lib/components/input/input-date-time/input-date-time.component.spec.ts +0 -36
  63. package/src/lib/components/input/input-date-time/input-date-time.component.ts +0 -387
  64. package/src/lib/components/input/input-file-upload/input-file-upload.component.html +0 -89
  65. package/src/lib/components/input/input-file-upload/input-file-upload.component.scss +0 -171
  66. package/src/lib/components/input/input-file-upload/input-file-upload.component.spec.ts +0 -43
  67. package/src/lib/components/input/input-file-upload/input-file-upload.component.ts +0 -351
  68. package/src/lib/components/input/input-interface.ts +0 -8
  69. package/src/lib/components/input/input-number/input-number-validators.ts +0 -0
  70. package/src/lib/components/input/input-number/input-number.component.html +0 -51
  71. package/src/lib/components/input/input-number/input-number.component.scss +0 -140
  72. package/src/lib/components/input/input-number/input-number.component.spec.ts +0 -44
  73. package/src/lib/components/input/input-number/input-number.component.ts +0 -343
  74. package/src/lib/components/input/input-radio-group/input-radio-group.component.html +0 -44
  75. package/src/lib/components/input/input-radio-group/input-radio-group.component.scss +0 -139
  76. package/src/lib/components/input/input-radio-group/input-radio-group.component.spec.ts +0 -58
  77. package/src/lib/components/input/input-radio-group/input-radio-group.component.ts +0 -132
  78. package/src/lib/components/input/input-slider/input-slider.component.html +0 -111
  79. package/src/lib/components/input/input-slider/input-slider.component.scss +0 -203
  80. package/src/lib/components/input/input-slider/input-slider.component.spec.ts +0 -46
  81. package/src/lib/components/input/input-slider/input-slider.component.ts +0 -410
  82. package/src/lib/components/input/input-text/input-text-validators.ts +0 -67
  83. package/src/lib/components/input/input-text/input-text.component.html +0 -71
  84. package/src/lib/components/input/input-text/input-text.component.scss +0 -118
  85. package/src/lib/components/input/input-text/input-text.component.spec.ts +0 -55
  86. package/src/lib/components/input/input-text/input-text.component.ts +0 -215
  87. package/src/lib/components/input/input-time/input-time-validators.ts +0 -42
  88. package/src/lib/components/input/input-time/input-time.component.html +0 -92
  89. package/src/lib/components/input/input-time/input-time.component.scss +0 -191
  90. package/src/lib/components/input/input-time/input-time.component.spec.ts +0 -39
  91. package/src/lib/components/input/input-time/input-time.component.ts +0 -691
  92. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.html +0 -36
  93. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.scss +0 -121
  94. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.spec.ts +0 -54
  95. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.ts +0 -117
  96. package/src/lib/components/input/input-type.ts +0 -18
  97. package/src/lib/components/input/input-validation/input-validation.component.html +0 -19
  98. package/src/lib/components/input/input-validation/input-validation.component.scss +0 -39
  99. package/src/lib/components/input/input-validation/input-validation.component.spec.ts +0 -45
  100. package/src/lib/components/input/input-validation/input-validation.component.ts +0 -13
  101. package/src/lib/components/input/input.pipe.ts +0 -14
  102. package/src/lib/components/layout/container/container.component.html +0 -1
  103. package/src/lib/components/layout/container/container.component.scss +0 -33
  104. package/src/lib/components/layout/container/container.component.ts +0 -32
  105. package/src/lib/components/layout/container/container.type.ts +0 -1
  106. package/src/lib/components/layout/divider/divider.component.html +0 -1
  107. package/src/lib/components/layout/divider/divider.component.scss +0 -60
  108. package/src/lib/components/layout/divider/divider.component.ts +0 -38
  109. package/src/lib/components/layout/divider/divider.type.ts +0 -2
  110. package/src/lib/components/layout/section/section.component.html +0 -21
  111. package/src/lib/components/layout/section/section.component.scss +0 -43
  112. package/src/lib/components/layout/section/section.component.ts +0 -33
  113. package/src/lib/components/layout/section/section.type.ts +0 -2
  114. package/src/lib/components/layout/separator/separator.component.html +0 -9
  115. package/src/lib/components/layout/separator/separator.component.scss +0 -52
  116. package/src/lib/components/layout/separator/separator.component.ts +0 -25
  117. package/src/lib/components/layout/separator/separator.type.ts +0 -1
  118. package/src/lib/components/loader/content-blur/content-blur.component.html +0 -13
  119. package/src/lib/components/loader/content-blur/content-blur.component.scss +0 -43
  120. package/src/lib/components/loader/content-blur/content-blur.component.spec.ts +0 -42
  121. package/src/lib/components/loader/content-blur/content-blur.component.ts +0 -34
  122. package/src/lib/components/loader/loader.type.ts +0 -2
  123. package/src/lib/components/loader/progress-bar/progress-bar.component.html +0 -26
  124. package/src/lib/components/loader/progress-bar/progress-bar.component.scss +0 -151
  125. package/src/lib/components/loader/progress-bar/progress-bar.component.spec.ts +0 -47
  126. package/src/lib/components/loader/progress-bar/progress-bar.component.ts +0 -28
  127. package/src/lib/components/loader/progress-bar/progress-bar.type.ts +0 -8
  128. package/src/lib/components/loader/pulse-loader/pulse-loader.component.html +0 -12
  129. package/src/lib/components/loader/pulse-loader/pulse-loader.component.scss +0 -202
  130. package/src/lib/components/loader/pulse-loader/pulse-loader.component.spec.ts +0 -55
  131. package/src/lib/components/loader/pulse-loader/pulse-loader.component.ts +0 -73
  132. package/src/lib/components/loader/pulse-loader/pulse-loader.type.ts +0 -6
  133. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.html +0 -13
  134. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.scss +0 -113
  135. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.spec.ts +0 -37
  136. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.ts +0 -51
  137. package/src/lib/components/loader/skeleton-loader/skeleton-loader.type.ts +0 -6
  138. package/src/lib/components/loader/spinner/spinner.component.html +0 -20
  139. package/src/lib/components/loader/spinner/spinner.component.scss +0 -137
  140. package/src/lib/components/loader/spinner/spinner.component.spec.ts +0 -43
  141. package/src/lib/components/loader/spinner/spinner.component.ts +0 -32
  142. package/src/lib/components/loader/spinner/spinner.type.ts +0 -6
  143. package/src/lib/components/modal/modal.component.html +0 -47
  144. package/src/lib/components/modal/modal.component.scss +0 -139
  145. package/src/lib/components/modal/modal.component.spec.ts +0 -60
  146. package/src/lib/components/modal/modal.component.ts +0 -83
  147. package/src/lib/components/modal/modal.type.ts +0 -9
  148. package/src/lib/components/morph/blob-moph/blob-moprh.component.spec.ts +0 -79
  149. package/src/lib/components/morph/blob-moph/blob-moprh.component.ts +0 -96
  150. package/src/lib/components/morph/blob-moph/blob-morph.component.html +0 -34
  151. package/src/lib/components/morph/blob-moph/blob-morph.component.scss +0 -7
  152. package/src/lib/components/morph/morph.abstract.ts +0 -13
  153. package/src/lib/components/pagination/pagination.interface.ts +0 -4
  154. package/src/lib/components/pagination/small-pagination/small-pagination.component.html +0 -61
  155. package/src/lib/components/pagination/small-pagination/small-pagination.component.scss +0 -187
  156. package/src/lib/components/pagination/small-pagination/small-pagination.component.spec.ts +0 -88
  157. package/src/lib/components/pagination/small-pagination/small-pagination.component.ts +0 -177
  158. package/src/lib/components/selection-lists/multi-select/multi-select.component.html +0 -170
  159. package/src/lib/components/selection-lists/multi-select/multi-select.component.scss +0 -312
  160. package/src/lib/components/selection-lists/multi-select/multi-select.component.spec.ts +0 -61
  161. package/src/lib/components/selection-lists/multi-select/multi-select.component.ts +0 -372
  162. package/src/lib/components/selection-lists/selection-list/selection-list.component.html +0 -125
  163. package/src/lib/components/selection-lists/selection-list/selection-list.component.scss +0 -267
  164. package/src/lib/components/selection-lists/selection-list/selection-list.component.spec.ts +0 -66
  165. package/src/lib/components/selection-lists/selection-list/selection-list.component.ts +0 -315
  166. package/src/lib/components/selection-lists/selection-lists-base.ts +0 -35
  167. package/src/lib/components/selection-lists/selection-lists-const.ts +0 -17
  168. package/src/lib/components/selection-lists/selection-lists-interface.ts +0 -7
  169. package/src/lib/components/selection-lists/selection-lists.type.ts +0 -1
  170. package/src/lib/components/side-nav/side-nav.component.html +0 -101
  171. package/src/lib/components/side-nav/side-nav.component.scss +0 -295
  172. package/src/lib/components/side-nav/side-nav.component.spec.ts +0 -0
  173. package/src/lib/components/side-nav/side-nav.component.ts +0 -18
  174. package/src/lib/components/side-nav/side-nav.type.ts +0 -28
  175. package/src/lib/components/snackbar/snackbar.component.html +0 -33
  176. package/src/lib/components/snackbar/snackbar.component.scss +0 -195
  177. package/src/lib/components/snackbar/snackbar.component.ts +0 -112
  178. package/src/lib/components/snackbar/snackbar.type.ts +0 -27
  179. package/src/lib/components/status/chip/chip.component.html +0 -51
  180. package/src/lib/components/status/chip/chip.component.scss +0 -149
  181. package/src/lib/components/status/chip/chip.component.spec.ts +0 -62
  182. package/src/lib/components/status/chip/chip.component.ts +0 -83
  183. package/src/lib/components/status/chip/chip.type.ts +0 -42
  184. package/src/lib/components/status/directives/badge/badge.directive.spec.ts +0 -60
  185. package/src/lib/components/status/directives/badge/badge.directive.ts +0 -190
  186. package/src/lib/components/status/directives/badge/badge.interface.ts +0 -19
  187. package/src/lib/components/status/pill/pill.component.html +0 -40
  188. package/src/lib/components/status/pill/pill.component.scss +0 -113
  189. package/src/lib/components/status/pill/pill.component.spec.ts +0 -47
  190. package/src/lib/components/status/pill/pill.component.ts +0 -83
  191. package/src/lib/components/status/pill/pill.type.ts +0 -42
  192. package/src/lib/components/status/status.interface.ts +0 -57
  193. package/src/lib/components/status/status.type.ts +0 -62
  194. package/src/lib/components/status/tag/tag.component.html +0 -39
  195. package/src/lib/components/status/tag/tag.component.scss +0 -140
  196. package/src/lib/components/status/tag/tag.component.spec.ts +0 -47
  197. package/src/lib/components/status/tag/tag.component.ts +0 -83
  198. package/src/lib/components/status/tag/tag.type.ts +0 -42
  199. package/src/lib/components/stepper/stepper.component.html +0 -83
  200. package/src/lib/components/stepper/stepper.component.scss +0 -196
  201. package/src/lib/components/stepper/stepper.component.ts +0 -482
  202. package/src/lib/components/stepper/stepper.type.ts +0 -60
  203. package/src/lib/components/table/table.component.html +0 -438
  204. package/src/lib/components/table/table.component.scss +0 -259
  205. package/src/lib/components/table/table.component.spec.ts +0 -117
  206. package/src/lib/components/table/table.component.ts +0 -215
  207. package/src/lib/components/table/table.enum.ts +0 -4
  208. package/src/lib/components/table/table.function.ts +0 -47
  209. package/src/lib/components/table/table.interface.ts +0 -143
  210. package/src/lib/components/table/table.pipe.ts +0 -62
  211. package/src/lib/components/table/table.type.ts +0 -15
  212. package/src/lib/components/tabs/tabs.component.html +0 -88
  213. package/src/lib/components/tabs/tabs.component.scss +0 -305
  214. package/src/lib/components/tabs/tabs.component.spec.ts +0 -94
  215. package/src/lib/components/tabs/tabs.component.ts +0 -282
  216. package/src/lib/components/tabs/tabs.type.ts +0 -81
  217. package/src/lib/components/title-bar/title-bar.component.html +0 -21
  218. package/src/lib/components/title-bar/title-bar.component.scss +0 -139
  219. package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -44
  220. package/src/lib/components/title-bar/title-bar.component.ts +0 -13
  221. package/src/lib/components/toast/toast.component.html +0 -36
  222. package/src/lib/components/toast/toast.component.scss +0 -241
  223. package/src/lib/components/toast/toast.component.ts +0 -165
  224. package/src/lib/components/toast/toast.type.ts +0 -37
  225. package/src/lib/components/toast-stack/toast-stack.component.html +0 -30
  226. package/src/lib/components/toast-stack/toast-stack.component.scss +0 -35
  227. package/src/lib/components/toast-stack/toast-stack.component.ts +0 -51
  228. package/src/lib/consts/country-prefix.ts +0 -244
  229. package/src/lib/directives/tooltip/popover.directive.ts +0 -274
  230. package/src/lib/directives/tooltip/tooltip.directive.spec.ts +0 -86
  231. package/src/lib/directives/tooltip/tooltip.directive.ts +0 -234
  232. package/src/lib/directives/tooltip/tooltip.interface.ts +0 -29
  233. package/src/lib/directives/tooltip/tooltip.type.ts +0 -9
  234. package/src/lib/interfaces/common.interfaces.ts +0 -4
  235. package/src/lib/pipes/chunk.pipe.ts +0 -16
  236. package/src/lib/pipes/safe-html.pipe.ts +0 -14
  237. package/src/lib/pipes/sanitize-html.pipe.ts +0 -23
  238. package/src/lib/types/base.types.ts +0 -23
  239. package/src/lib/types/common.types.ts +0 -98
  240. package/src/lib/types/form.types.ts +0 -5
  241. package/src/lib/utils/common.utils.ts +0 -53
  242. package/src/lib/utils/date.utils.ts +0 -474
  243. package/src/lib/utils/number.utils.ts +0 -16
  244. package/src/lib/utils/uuid.utils.ts +0 -39
  245. package/src/public-api.ts +0 -114
  246. package/tsconfig.lib.json +0 -17
  247. package/tsconfig.lib.prod.json +0 -10
  248. package/tsconfig.spec.json +0 -9
@@ -1,140 +0,0 @@
1
- @use './../../../../../assets/styles/scss/variables' as *;
2
-
3
- :host {
4
- display: block;
5
-
6
- @mixin checkbox-group-style($color) {
7
- input[type="checkbox"]::after {
8
- border-right-color: $color;
9
- border-bottom-color: $color;
10
- }
11
-
12
- input[type="checkbox"]:checked {
13
- border-color: $color;
14
- }
15
-
16
- input[type="checkbox"]:focus-visible {
17
- box-shadow: 0 0 0 4px rgba($color, 0.14);
18
- }
19
- }
20
-
21
- .frg-checkbox-group__wrapper {
22
- display: flex;
23
- flex-direction: column;
24
- gap: 0.5rem;
25
- }
26
-
27
- .frg-checkbox-group__wrapper.frg-checkbox-group__primary {
28
- @include checkbox-group-style($color-primary);
29
- }
30
-
31
- .frg-checkbox-group__wrapper.frg-checkbox-group__secondary {
32
- @include checkbox-group-style($color-secondary);
33
- }
34
-
35
- .frg-checkbox-group__wrapper.frg-checkbox-group__tertiary {
36
- @include checkbox-group-style($color-tertiary);
37
- }
38
-
39
- .frg-checkbox-group__wrapper.frg-checkbox-group__success {
40
- @include checkbox-group-style($color-success);
41
- }
42
-
43
- .frg-checkbox-group__wrapper.frg-checkbox-group__warning {
44
- @include checkbox-group-style($color-warning);
45
- }
46
-
47
- .frg-checkbox-group__wrapper.frg-checkbox-group__danger {
48
- @include checkbox-group-style($color-danger);
49
- }
50
-
51
- .frg-checkbox-group__wrapper.frg-checkbox-group__light {
52
- @include checkbox-group-style($color-light);
53
- }
54
-
55
- .frg-checkbox-group__wrapper.frg-checkbox-group__dark {
56
- @include checkbox-group-style($color-dark);
57
- }
58
-
59
- .frg-checkbox-group__label {
60
- font-size: $font-size-xs;
61
- color: $input-text-color;
62
- }
63
-
64
- .frg-checkbox-group__list {
65
- display: grid;
66
- gap: 0.5rem;
67
- }
68
-
69
- .frg-checkbox {
70
- display: inline-flex;
71
- align-items: center;
72
- gap: 0.5rem;
73
- cursor: pointer;
74
- font-size: $font-size-xs;
75
- color: $input-text-color;
76
- }
77
-
78
- .input-error .frg-checkbox-group__label,
79
- .input-error .frg-checkbox {
80
- color: $color-danger;
81
- }
82
-
83
- .input-warning .frg-checkbox-group__label,
84
- .input-warning .frg-checkbox {
85
- color: $color-warning;
86
- }
87
-
88
- input[type="checkbox"] {
89
- appearance: none;
90
- -webkit-appearance: none;
91
- width: 1.1rem;
92
- height: 1.1rem;
93
- border-radius: 0.25rem;
94
- background: transparent;
95
- border: 1px solid $input-border-color;
96
- display: inline-grid;
97
- place-content: center;
98
- transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
99
- cursor: pointer;
100
- }
101
-
102
- input[type="checkbox"]::after {
103
- content: "";
104
- width: 0.5rem;
105
- height: 0.75rem;
106
- border-right: 2px solid $color-primary;
107
- border-bottom: 2px solid $color-primary;
108
- transform: translateY(-1px) rotate(45deg) scale(0);
109
- transform-origin: center;
110
- transition: transform 140ms ease;
111
- }
112
-
113
- input[type="checkbox"]:checked {
114
- background: transparent;
115
- border-color: $color-primary;
116
- }
117
-
118
- input[type="checkbox"]:checked::after {
119
- transform: translateY(-1px) rotate(45deg) scale(1);
120
- }
121
-
122
- input[type="checkbox"]:focus {
123
- outline: none;
124
- }
125
-
126
- input[type="checkbox"]:focus-visible {
127
- box-shadow: 0 0 0 4px rgba($color-primary, 0.14);
128
- }
129
-
130
- input[type="checkbox"]:disabled {
131
- cursor: not-allowed;
132
- opacity: 0.65;
133
- background: transparent;
134
- border-color: $input-disabled-border-color;
135
- }
136
-
137
- .frg-checkbox.disabled {
138
- cursor: not-allowed;
139
- }
140
- }
@@ -1,62 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { By } from '@angular/platform-browser';
3
- import { InputCheckboxGroupComponent, InputCheckboxGroupItem } from './input-checkbox-group.component';
4
-
5
- describe('InputCheckboxGroupComponent', () => {
6
- let fixture: ComponentFixture<InputCheckboxGroupComponent<string>>;
7
- let component: InputCheckboxGroupComponent<string>;
8
-
9
- const items: Array<InputCheckboxGroupItem<string>> = [
10
- { id: 'a', label: 'Option A', value: 'a' },
11
- { id: 'b', label: 'Option B', value: 'b' }
12
- ];
13
-
14
- beforeEach(async () => {
15
- await TestBed.configureTestingModule({
16
- imports: [InputCheckboxGroupComponent]
17
- }).compileComponents();
18
-
19
- fixture = TestBed.createComponent(InputCheckboxGroupComponent<string>);
20
- component = fixture.componentInstance;
21
- component.items = items;
22
- });
23
-
24
- it('adds a value when checked', () => {
25
- component.value = [];
26
-
27
- fixture.detectChanges();
28
-
29
- const input = fixture.debugElement.query(By.css('input[type="checkbox"]'));
30
- input.nativeElement.checked = true;
31
- input.nativeElement.dispatchEvent(new Event('change'));
32
- fixture.detectChanges();
33
-
34
- expect(component.value).toEqual(['a']);
35
- });
36
-
37
- it('removes a value when unchecked', () => {
38
- component.value = ['a'];
39
-
40
- fixture.detectChanges();
41
-
42
- const input = fixture.debugElement.query(By.css('input[type="checkbox"]'));
43
- input.nativeElement.checked = false;
44
- input.nativeElement.dispatchEvent(new Event('change'));
45
- fixture.detectChanges();
46
-
47
- expect(component.value).toEqual([]);
48
- });
49
-
50
- it('does not toggle when disabled', () => {
51
- component.value = [];
52
- component.disabled = true;
53
-
54
- fixture.detectChanges();
55
-
56
- const input = fixture.debugElement.query(By.css('input[type="checkbox"]'));
57
- input.nativeElement.checked = true;
58
- input.nativeElement.dispatchEvent(new Event('change'));
59
-
60
- expect(component.value).toEqual([]);
61
- });
62
- });
@@ -1,136 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import { InputBase } from '../input-base';
3
- import { DEFAULT_INPUT_CHECKBOX_GROUP_ERROR_MESSAGES, DEFAULT_INPUT_CHECKBOX_GROUP_WARNINGS_MESSAGES } from '../input-consts';
4
- import { InputChoiceStyleType } from '../input-type';
5
- import { InputValidationComponent } from '../input-validation/input-validation.component';
6
- import { InputRequiredLabelPipe } from '../input.pipe';
7
- import { NgClass } from '@angular/common';
8
-
9
- export interface InputCheckboxGroupItem<T> {
10
- id: string;
11
- label: string;
12
- value: T;
13
- disabled?: boolean;
14
- }
15
-
16
- @Component({
17
- selector: 'frg-input-checkbox-group',
18
- imports: [NgClass, InputRequiredLabelPipe, InputValidationComponent],
19
- templateUrl: './input-checkbox-group.component.html',
20
- styleUrl: './input-checkbox-group.component.scss',
21
- })
22
- export class InputCheckboxGroupComponent<T> extends InputBase<Array<T>> {
23
- /**
24
- * @inheritdoc
25
- */
26
- @Input() public override label: string = '';
27
- /**
28
- * @inheritdoc
29
- */
30
- @Input() public override required: boolean = false;
31
- /**
32
- * @inheritdoc
33
- */
34
- @Input() public override disabled: boolean = false;
35
- /**
36
- * @inheritdoc
37
- */
38
- @Input() public override errorMessages: Record<string, string> = {};
39
- /**
40
- * @inheritdoc
41
- */
42
- @Input() public override warningMessages: Record<string, string> = {};
43
- /**
44
- * @inheritdoc
45
- */
46
- @Input() public override showValidation: boolean = true;
47
- /**
48
- * Sets the visual style of the checkbox group.
49
- */
50
- @Input() public styleType: InputChoiceStyleType = 'primary';
51
-
52
- @Input() public items: Array<InputCheckboxGroupItem<T>> = [];
53
- @Input() public compareWith: (a: T, b: T) => boolean = (a, b) => a === b;
54
-
55
- /**
56
- * Toggles a checkbox item value.
57
- */
58
- public toggleItem(item: InputCheckboxGroupItem<T>, event: Event): void {
59
- if (this.disabled || item.disabled) return;
60
-
61
- const input = event.target as HTMLInputElement;
62
- const current = this.value ? [...this.value] : [];
63
- const isSelected = current.some(value => this.compareWith(value, item.value));
64
-
65
- const next = input.checked
66
- ? (isSelected ? current : [...current, item.value])
67
- : current.filter(value => !this.compareWith(value, item.value));
68
-
69
- this.value = next;
70
- this.onChange(this.value);
71
- this.onTouched();
72
- }
73
-
74
- /**
75
- * Checks if the item is selected.
76
- */
77
- public isSelected(item: InputCheckboxGroupItem<T>): boolean {
78
- return (this.value ?? []).some(value => this.compareWith(value, item.value));
79
- }
80
-
81
- /**
82
- * @inheritdoc
83
- */
84
- public override onBlur(): void {
85
- this.onTouched();
86
- }
87
-
88
- /**
89
- * @inheritdoc
90
- */
91
- protected updateView(_value: Array<T> | null): void {
92
- // Handled by Angular binding
93
- }
94
-
95
- /**
96
- * @inheritdoc
97
- */
98
- protected updateDisabledState(_isDisabled: boolean): void {
99
- // Handled by Angular binding
100
- }
101
-
102
- /**
103
- * @inheritdoc
104
- */
105
- protected override get errorList(): string[] {
106
- if (!this.control?.errors) return [];
107
- const errors = this.control.errors;
108
- return Object.keys(errors).map(key => {
109
- if (this.errorMessages[key]) {
110
- return this.errorMessages[key];
111
- }
112
- return DEFAULT_INPUT_CHECKBOX_GROUP_ERROR_MESSAGES[key] || 'Invalid field.';
113
- });
114
- }
115
-
116
- /**
117
- * Returns warning messages. Consumers may pass arbitrary warnings via `warningMessages`.
118
- * Falls back to DEFAULT_INPUT_CHECKBOX_GROUP_WARNINGS_MESSAGES or a generic message.
119
- */
120
- protected override get warningList(): string[] {
121
- return Object.keys(this.warningMessages).map(key => {
122
- return (
123
- this.warningMessages[key] ||
124
- DEFAULT_INPUT_CHECKBOX_GROUP_WARNINGS_MESSAGES[key] ||
125
- ''
126
- );
127
- });
128
- }
129
-
130
- /**
131
- * Returns whether any warnings are active.
132
- */
133
- protected get hasWarning(): boolean {
134
- return this.warningList.length > 0;
135
- }
136
- }
@@ -1,81 +0,0 @@
1
- <div class="clock-mode-toggle">
2
- <button
3
- type="button"
4
- class="clock-mode-toggle__btn"
5
- [class.is-active]="showHoursPicker$ | async"
6
- (click)="showHours()">
7
- Hours
8
- </button>
9
- <button
10
- type="button"
11
- class="clock-mode-toggle__btn"
12
- [class.is-active]="showMinutesPicker$ | async"
13
- (click)="showMinutes()">
14
- Minutes
15
- </button>
16
- </div>
17
-
18
- <div class="clock-picker">
19
- <div class="clock-face">
20
- @if(showHoursPicker$ | async){
21
- @for(hour of clockHours; track hour){
22
- <button
23
- class="clock-hour"
24
- [class.is-selected]="hour === selectedHour"
25
- (mouseenter)="onHourHover(hour)"
26
- (mouseleave)="onHourLeave()"
27
- (click)="onHourClick($event, hour)">
28
- {{hour}}
29
- </button>
30
- }
31
- @if(!isMeridiemFormat){
32
- @for(hour of fullClockHours; track hour){
33
- <button
34
- class="clock-hour"
35
- [class.is-selected]="hour === selectedHour"
36
- (mouseenter)="onHourHover(hour)"
37
- (mouseleave)="onHourLeave()"
38
- (click)="onHourClick($event, hour)">
39
- {{hour}}
40
- </button>
41
- }
42
- }
43
- }
44
-
45
- @if(showMinutesPicker$ | async){
46
- @for(minute of clockMinutes; track minute){
47
- <button
48
- class="clock-minute"
49
- [class.is-selected]="minute === selectedMinute"
50
- (mouseenter)="onMinuteHover(minute)"
51
- (mouseleave)="onMinuteLeave()"
52
- (click)="onMinuteClick($event, minute)">
53
- {{minute}}
54
- </button>
55
- }
56
- }
57
-
58
- <div class="clock-hand clock-hand--minutes" [class.clock-hand--opacity]="showHoursPicker$ | async" #handMinutes></div>
59
- <div class="clock-hand clock-hand--hours" #handHours></div>
60
- </div>
61
- </div>
62
-
63
- @if(isMeridiemFormat){
64
- <div class="clock-footer">
65
- <div class="clock-picker__meridiem">
66
- <input
67
- [id]="'meridiem'"
68
- [attr.data-partialTime]="'meridiem'"
69
- type="checkbox"
70
- tabindex="0"
71
- role="switch"
72
- [checked]="selectedMeridiem === 'PM'"
73
- aria-checked="{{ selectedMeridiem === 'PM' }}"
74
- placeholder="AM/PM"
75
- (change)="onMeridiemChange($event)"
76
- (keydown.enter)="onMeridiemChange($event)"
77
- />
78
- </div>
79
- <span class="focus-line"></span>
80
- </div>
81
- }
@@ -1,228 +0,0 @@
1
- @use "sass:color";
2
- @use './../../../../../assets/styles/scss/variables' as *;
3
-
4
- :host {
5
- display: block;
6
- position: relative;
7
-
8
- .clock-picker {
9
- display: flex;
10
- flex-direction: column;
11
- align-items: center;
12
- font-family: $input-font-family;
13
- margin: 0.5rem;
14
- padding: 0.5rem;
15
- background: $color-primary-light;
16
- border-radius: 200px;
17
- box-shadow: $box-shadow-md;
18
-
19
- .clock-face {
20
- position: relative;
21
- width: 15rem;
22
- height: 15rem;
23
- border-radius: 50%;
24
- background: $input-background;
25
-
26
- /* ------------------- HOURS ------------------- */
27
- .clock-hour {
28
- position: absolute;
29
- width: 30px;
30
- height: 30px;
31
- text-align: center;
32
- padding: 0;
33
- top: 50%;
34
- left: 50%;
35
- margin: -15px;
36
- color: $input-text-color;
37
- font-size: $font-size-md;
38
- border-radius: 50px;
39
- border: 0.1rem solid transparent;
40
- background: transparent;
41
- cursor: pointer;
42
- transition: all 0.2s ease-in-out;
43
-
44
- &.is-selected {
45
- border: 0.15rem solid $color-primary;
46
- color: $color-light;
47
- background-color: $color-primary;
48
- }
49
-
50
- &:hover {
51
- border: 0.15rem solid $color-primary;
52
- }
53
-
54
- @for $i from 1 through 12 {
55
- $angle: ($i - 1) * 30deg - 90deg;
56
- &:nth-child(#{$i}) {
57
- transform: rotate($angle) translate(6.25rem) rotate(-$angle);
58
- }
59
- }
60
-
61
- @for $i from 13 through 24 {
62
- $angle: ($i - 13) * 30deg - 90deg;
63
- &:nth-child(#{$i}) {
64
- transform: rotate($angle) translate(3.75rem) rotate(-$angle);
65
- }
66
- }
67
- }
68
-
69
- /* ------------------- MINUTES ------------------- */
70
- .clock-minute {
71
- position: absolute;
72
- width: 30px;
73
- height: 30px;
74
- text-align: center;
75
- padding: 0;
76
- top: 50%;
77
- left: 50%;
78
- margin: -15px;
79
- color: $input-text-color;
80
- font-size: $font-size-md;
81
- border-radius: 50px;
82
- border: 0.1rem solid transparent;
83
- background: transparent;
84
- cursor: pointer;
85
- transition: all 0.2s ease-in-out;
86
-
87
- &.is-selected {
88
- border: 0.15rem solid $color-primary;
89
- color: $color-light;
90
- background-color: $color-primary;
91
- }
92
-
93
- &:hover {
94
- border: 0.15rem solid $color-primary;
95
- }
96
-
97
- @for $i from 0 through 11 {
98
- $angle: ($i * 5 * 6deg) - 90deg;
99
- &:nth-child(#{$i + 1}) {
100
- transform: rotate($angle) translate(6.25rem) rotate(-$angle);
101
- }
102
- }
103
- }
104
-
105
- /* ------------------- CENTER PIN ------------------- */
106
- &::after {
107
- content: '';
108
- position: absolute;
109
- top: 50%;
110
- left: 50%;
111
- border-radius: 2px;
112
- transform: translate(-50%, -50%);
113
- padding: 0.3rem;
114
- background-color: $color-primary-dark;
115
- }
116
- }
117
-
118
- /* ------------------- CLOCK HANDS ------------------- */
119
- .clock-hand {
120
- position: absolute;
121
- height: 0.25rem;
122
- top: 50%;
123
- left: 50%;
124
- transform-origin: 0 50%;
125
- transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
126
- transform: translateY(-50%) rotate(var(--angle, -90deg));
127
-
128
- &--hours {
129
- width: 15%;
130
- background: $color-primary;
131
- }
132
-
133
- &--minutes {
134
- width: 25%;
135
- background: $color-primary-dark;
136
- }
137
-
138
- &--opacity {
139
- opacity: 0.3;
140
- }
141
- }
142
-
143
- }
144
-
145
- .clock-mode-toggle {
146
- display: inline-flex;
147
- gap: 0.5rem;
148
- margin-bottom: 0.5rem;
149
- justify-content: center;
150
- width: 100%;
151
-
152
- &__btn {
153
- border: 1px solid $input-border-color;
154
- background: $color-light;
155
- color: $input-text-color;
156
- border-radius: 0.25rem;
157
- padding: 0.2rem 0.6rem;
158
- cursor: pointer;
159
- font-size: $font-size-xs;
160
-
161
- &.is-active {
162
- background: $color-primary;
163
- border-color: $color-primary;
164
- color: $color-light;
165
- }
166
- }
167
- }
168
-
169
- /* ------------------- FOOTER ------------------- */
170
- .clock-footer {
171
- display: flex;
172
- justify-content: center;
173
- width: 100%;
174
- }
175
-
176
- /* ------------------- MERIDIEM SWITCH ------------------- */
177
- .clock-picker__meridiem {
178
- width: 3.5rem;
179
- height: 1.5rem;
180
- margin-top: 0.5rem;
181
-
182
- input[type="checkbox"] {
183
- appearance: none;
184
- width: 100%;
185
- height: 100%;
186
- border-radius: 0.25rem;
187
- background-color: $color-light-soft;
188
- cursor: pointer;
189
- position: relative;
190
- overflow: hidden;
191
- transition: background-color 0.25s ease;
192
-
193
- &:before,
194
- &:after {
195
- content: "AM";
196
- position: absolute;
197
- top: 50%;
198
- left: 50%;
199
- transform: translate(-50%, -50%);
200
- font-size: $font-size-md;
201
- font-weight: 600;
202
- color: $color-dark-neutral;
203
- transition: transform 0.25s ease, opacity 0.25s ease;
204
- }
205
-
206
- &:after {
207
- content: "PM";
208
- opacity: 0;
209
- transform: translate(-50%, 150%);
210
- color: $color-light;
211
- }
212
-
213
- &:checked {
214
- background-color: $color-primary;
215
-
216
- &:before {
217
- transform: translate(-50%, -150%);
218
- opacity: 0;
219
- }
220
-
221
- &:after {
222
- transform: translate(-50%, -50%);
223
- opacity: 1;
224
- }
225
- }
226
- }
227
- }
228
- }
@@ -1,62 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { By } from '@angular/platform-browser';
3
- import { InputClockPickerComponent } from './input-clock-picker.component';
4
-
5
- describe('InputClockPickerComponent', () => {
6
- let fixture: ComponentFixture<InputClockPickerComponent>;
7
- let component: InputClockPickerComponent;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [InputClockPickerComponent]
12
- }).compileComponents();
13
-
14
- fixture = TestBed.createComponent(InputClockPickerComponent);
15
- component = fixture.componentInstance;
16
- });
17
-
18
- it('emits hour selection and switches to minutes', () => {
19
- const emitSpy = spyOn(component.selectHour, 'emit');
20
-
21
- fixture.detectChanges();
22
-
23
- const hourButtons = fixture.debugElement.queryAll(By.css('.clock-hour'));
24
- hourButtons[0].nativeElement.click();
25
- fixture.detectChanges();
26
-
27
- expect(emitSpy).toHaveBeenCalled();
28
- expect(component.showHoursPicker$.value).toBeFalse();
29
- expect(component.showMinutesPicker$.value).toBeTrue();
30
- });
31
-
32
- it('emits minute selection and closes picker', () => {
33
- const emitSpy = spyOn(component.closePicker, 'emit');
34
-
35
- fixture.detectChanges();
36
-
37
- const hourButtons = fixture.debugElement.queryAll(By.css('.clock-hour'));
38
- hourButtons[0].nativeElement.click();
39
- fixture.detectChanges();
40
-
41
- const minuteButtons = fixture.debugElement.queryAll(By.css('.clock-minute'));
42
- minuteButtons[0].nativeElement.click();
43
- fixture.detectChanges();
44
-
45
- expect(component.showMinutesPicker$.value).toBeTrue();
46
- expect(emitSpy).toHaveBeenCalled();
47
- });
48
-
49
- it('toggles meridiem when format is 12h', () => {
50
- component.timeFormat = 'hh:mm a';
51
- const emitSpy = spyOn(component.selectMeridiem, 'emit');
52
-
53
- fixture.detectChanges();
54
-
55
- const meridiemInput = fixture.debugElement.query(By.css('input[role="switch"]')).nativeElement as HTMLInputElement;
56
- meridiemInput.checked = true;
57
- meridiemInput.dispatchEvent(new Event('change'));
58
-
59
- expect(component.selectedMeridiem).toBe('PM');
60
- expect(emitSpy).toHaveBeenCalledWith('PM');
61
- });
62
- });