@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,267 +0,0 @@
1
- @use "sass:color";
2
- @use './../../../../../assets/styles/scss/variables' as *;
3
-
4
- :host {
5
- display: block;
6
- font-family: $input-font-family;
7
-
8
- label {
9
- display: flex;
10
- font-size: $font-size-xs;
11
- color: $input-text-color;
12
- padding: $input-padding 0;
13
- }
14
-
15
- .frg-selection-list {
16
- position: relative;
17
- display: inline-block;
18
- width: 100%;
19
-
20
- .options-search {
21
- position: relative;
22
- display: flex;
23
- align-items: center;
24
- gap: 0;
25
- width: 100%;
26
- border-bottom: 2px solid $input-border-color;
27
- transition: border-color 0.3s;
28
-
29
- &.focus,
30
- &:hover {
31
- border-color: $input-focus-border-color;
32
- }
33
-
34
- &__input {
35
- flex: 1;
36
- padding: $input-padding;
37
- padding-right: 3rem;
38
- border: none;
39
- background: transparent;
40
- font-family: $input-font-family;
41
- font-size: 1rem;
42
- color: $color-dark-neutral;
43
- cursor: pointer;
44
- outline: none;
45
-
46
- &::placeholder {
47
- color: $input-text-color;
48
- opacity: 0.7;
49
- }
50
-
51
- &:disabled {
52
- cursor: not-allowed;
53
- opacity: 0.6;
54
- }
55
- }
56
-
57
- }
58
-
59
- &__handle-buttons {
60
- display: flex;
61
- align-items: center;
62
- gap: 0;
63
- width: 100%;
64
- border-bottom: 2px solid $input-border-color;
65
- background: transparent;
66
- font-family: $input-font-family;
67
- color: $input-text-color;
68
- cursor: pointer;
69
- transition: border-color 0.3s;
70
- position: relative;
71
-
72
- &:hover,
73
- &.focus {
74
- border-color: $input-focus-border-color;
75
- }
76
-
77
- .custom-select {
78
- flex: 1;
79
- padding: $input-padding;
80
- padding-right: 3rem;
81
- border: none;
82
- background: transparent;
83
- text-align: left;
84
- display: flex;
85
- align-items: center;
86
- font-size: 1rem;
87
-
88
- &:focus-visible {
89
- outline: none;
90
- }
91
-
92
- &:disabled {
93
- cursor: not-allowed;
94
- opacity: 0.6;
95
- }
96
-
97
- &.open {
98
- border-bottom-color: $color-primary;
99
- }
100
-
101
- .item-label {
102
- flex: 1;
103
- overflow: hidden;
104
- white-space: nowrap;
105
- text-overflow: ellipsis;
106
- margin-right: 0.5rem;
107
- color: $input-text-color;
108
- opacity: 0.7;
109
- }
110
-
111
- .selected {
112
- flex: 1;
113
- overflow: hidden;
114
- white-space: nowrap;
115
- text-overflow: ellipsis;
116
- margin-right: 0.5rem;
117
- opacity: 1;
118
- color: $color-dark-neutral;
119
- }
120
- }
121
- }
122
-
123
- .options {
124
- position: absolute;
125
- left: 0;
126
- right: 0;
127
- background: #fff;
128
- border-radius: 0.25rem;
129
- box-shadow: $box-shadow-md;
130
- z-index: 10;
131
- max-height: 240px;
132
- overflow-y: auto;
133
- animation: dropdown-fade-in 0.2s ease-in-out;
134
-
135
- &::-webkit-scrollbar {
136
- width: 0.3rem;
137
- background-color: transparent;
138
- }
139
-
140
- &::-webkit-scrollbar-thumb {
141
- background-color: $color-primary;
142
- border-radius: 0.1rem;
143
- }
144
-
145
- &::-webkit-scrollbar-thumb:hover {
146
- background-color: color.adjust($color-primary, $lightness: -10%);
147
- }
148
-
149
- .option {
150
- display: block;
151
- width: 100%;
152
- padding: 0.5rem 1rem;
153
- background: transparent;
154
- border: none;
155
- text-align: left;
156
- color: $input-text-color;
157
- font-size: 0.95rem;
158
- cursor: pointer;
159
- transition: background-color 0.15s ease, color 0.15s ease;
160
-
161
- &:hover:not(:disabled),
162
- &:focus-visible:not(:disabled) {
163
- background-color: color.scale($color-primary, $lightness: 90%);
164
- outline: none;
165
- }
166
-
167
- &.selected {
168
- background-color: color.scale($color-primary, $lightness: 85%);
169
- }
170
-
171
- &:disabled,
172
- &.disabled {
173
- opacity: 0.5;
174
- cursor: not-allowed;
175
- }
176
- }
177
-
178
- &.open-down {
179
- top: calc(100% + 0.25rem);
180
- }
181
-
182
- &.open-up {
183
- bottom: calc(100% + 0.25rem);
184
- }
185
- }
186
-
187
- .clear-button,
188
- .arrow-button {
189
- background: transparent;
190
- border: none;
191
- cursor: pointer;
192
- padding: 0;
193
- width: 1.25rem;
194
- height: 1.25rem;
195
- display: flex;
196
- align-items: center;
197
- justify-content: center;
198
- font-size: 0.75rem;
199
- line-height: 1;
200
- color: $color-dark-neutral;
201
- }
202
-
203
- .clear-button {
204
- font-size: 0.75rem;
205
- }
206
-
207
- .clear-button .fas {
208
- line-height: 1;
209
- }
210
-
211
- .selection-list__actions {
212
- position: absolute;
213
- right: 0;
214
- top: 50%;
215
- transform: translateY(-50%);
216
- display: inline-flex;
217
- align-items: center;
218
- gap: 0.125rem;
219
- padding-right: 0.25rem;
220
- }
221
-
222
- .arrow-button {
223
- display: flex;
224
- align-items: center;
225
- justify-content: center;
226
- background: transparent;
227
- border: none;
228
- cursor: pointer;
229
- transition: transform 0.3s ease;
230
-
231
- &:disabled {
232
- cursor: not-allowed;
233
- opacity: 0.5;
234
- }
235
- }
236
-
237
- .arrow-icon {
238
- font-size: 0.75rem;
239
- transition: transform 0.3s ease;
240
- }
241
-
242
- .arrow-button.open .arrow-icon {
243
- transform: rotate(180deg);
244
- }
245
-
246
- &.selection-list-error .options-search,
247
- &.selection-list-error .frg-selection-list__handle-buttons {
248
- border-bottom-color: $color-danger;
249
- }
250
-
251
- &.selection-list-error label {
252
- color: $color-danger;
253
- }
254
-
255
- @keyframes dropdown-fade-in {
256
- from {
257
- opacity: 0;
258
- transform: translateY(-10px);
259
- }
260
-
261
- to {
262
- opacity: 1;
263
- transform: translateY(0);
264
- }
265
- }
266
- }
267
- }
@@ -1,66 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { By } from '@angular/platform-browser';
3
- import { SelectionListComponent } from './selection-list.component';
4
- import { SelectionListItem } from '../selection-lists-interface';
5
-
6
- describe('SelectionListComponent', () => {
7
- let fixture: ComponentFixture<SelectionListComponent<string>>;
8
- let component: SelectionListComponent<string>;
9
-
10
- const items: SelectionListItem<string>[] = [
11
- { id: 'a', label: 'Apple', value: 'apple', selected: false },
12
- { id: 'b', label: 'Banana', value: 'banana', selected: false }
13
- ];
14
-
15
- beforeEach(async () => {
16
- await TestBed.configureTestingModule({
17
- imports: [SelectionListComponent]
18
- }).compileComponents();
19
-
20
- fixture = TestBed.createComponent(SelectionListComponent<string>);
21
- component = fixture.componentInstance;
22
- component.items = [...items];
23
- });
24
-
25
- it('shows placeholder text when no selection', () => {
26
- component.placeholder = 'Pick one';
27
-
28
- fixture.detectChanges();
29
-
30
- const label = fixture.debugElement.query(By.css('.item-label'));
31
- expect(label.nativeElement.textContent).toContain('Pick one');
32
- });
33
-
34
- it('toggles dropdown on click', () => {
35
- fixture.detectChanges();
36
-
37
- const trigger = fixture.debugElement.query(By.css('.custom-select'));
38
- trigger.nativeElement.click();
39
-
40
- expect((component as any).isOpen).toBeTrue();
41
- });
42
-
43
- it('selects an item and closes dropdown', () => {
44
- const onChangeSpy = jasmine.createSpy('onChange');
45
- component.registerOnChange(onChangeSpy);
46
-
47
- fixture.detectChanges();
48
-
49
- component.selectItem(items[0], new Event('click'));
50
-
51
- expect(component.value).toBe('apple');
52
- expect((component as any).selectedId).toBe('a');
53
- expect((component as any).isOpen).toBeFalse();
54
- expect(onChangeSpy).toHaveBeenCalledWith('apple');
55
- });
56
-
57
- it('filters items when search term is long enough', () => {
58
- component.hasSearch = true;
59
- (component as any).searchTerm = 'app';
60
-
61
- fixture.detectChanges();
62
-
63
- expect(component.filteredItems.length).toBe(1);
64
- expect(component.filteredItems[0].label).toBe('Apple');
65
- });
66
- });
@@ -1,315 +0,0 @@
1
- import { NgTemplateOutlet } from "@angular/common";
2
- import { Component, ElementRef, HostListener, Input, QueryList, TemplateRef, ViewChild, ViewChildren, inject } from "@angular/core";
3
- import { SelectionListBase } from "../selection-lists-base";
4
- import { DEFAULT_SELECTION_LIST_ERROR_MESSAGES } from "../selection-lists-const";
5
- import { SelectionListItem } from "../selection-lists-interface";
6
- import { InputValidationComponent } from "../../input/input-validation/input-validation.component";
7
- import { DEFAULT_INPUT_SELECTION_LIST_WARNINGS_MESSAGES } from "../../input/input-consts";
8
-
9
- @Component({
10
- selector: "frg-selection-list",
11
- templateUrl: "./selection-list.component.html",
12
- styleUrls: ["./selection-list.component.scss"],
13
- imports: [NgTemplateOutlet, InputValidationComponent]
14
- })
15
- export class SelectionListComponent<T> extends SelectionListBase<T> {
16
- private readonly elementRef = inject(ElementRef);
17
-
18
- @Input() items: Array<SelectionListItem<T>> = [];
19
- @Input() optionTemplate?: TemplateRef<unknown>;
20
- @Input() hasSearch: boolean = false;
21
-
22
- @ViewChildren("optionButton") optionButtons!: QueryList<ElementRef<HTMLButtonElement>>;
23
- @ViewChild("searchInput", { read: ElementRef }) searchInput?: ElementRef<HTMLInputElement>;
24
-
25
- protected isOpen = false;
26
- protected searchTerm = "";
27
- protected selectedId: string = "";
28
-
29
- private focusedIndex = -1;
30
-
31
- @HostListener("document:click", ['$event'])
32
- closeDropdown(event: MouseEvent): void {
33
- const target = event.target as HTMLElement;
34
- const nativeElement = this.elementRef.nativeElement;
35
-
36
- const clickedInside = nativeElement.contains(target);
37
- const isSearchInput = target.closest('.options-search__input');
38
-
39
- if (!clickedInside && !isSearchInput) {
40
- this.isOpen = false;
41
- }
42
- }
43
-
44
- public get filteredItems(): Array<SelectionListItem<T>> {
45
- if (this.hasSearch && this.searchTerm && this.searchTerm.length > 2) {
46
- const lower = this.searchTerm.toLowerCase();
47
- const lowerWithTrim = this.searchTerm.toLowerCase().trim();
48
-
49
- return this.items.filter(item =>
50
- (item.label ?? '').toLowerCase().includes(lower)
51
- || (item.label ?? '').toLowerCase().trim().includes(lowerWithTrim)
52
- );
53
- };
54
-
55
- return this.items;
56
- }
57
-
58
- public get selectedItem(): SelectionListItem<T> | null {
59
- return this.items.find(i => i.id === this.selectedId) ?? null;
60
- }
61
-
62
- protected override get errorList(): string[] {
63
- if (!this.control?.errors) return [];
64
- const errors = this.control.errors;
65
- return Object.keys(errors).map(key => {
66
- if (this.errorMessages[key]) {
67
- return this.errorMessages[key];
68
- }
69
-
70
- if (key === 'minlength' && errors[key]?.requiredLength) {
71
- return `Minimum length is ${errors[key].requiredLength} characters.`;
72
- }
73
-
74
- if (key === 'maxlength' && errors[key]?.requiredLength) {
75
- return `Maximum length is ${errors[key].requiredLength} characters.`;
76
- }
77
-
78
- return DEFAULT_SELECTION_LIST_ERROR_MESSAGES[key] || 'Invalid field.';
79
- });
80
- }
81
-
82
- /**
83
- * Returns warning messages. Consumers may pass arbitrary warnings via `warningMessages`.
84
- * Falls back to DEFAULT_INPUT_SELECTION_LIST_WARNINGS_MESSAGES or a generic message.
85
- */
86
- protected override get warningList(): string[] {
87
- return Object.keys(this.warningMessages).map(key => {
88
- return (
89
- this.warningMessages[key] ||
90
- DEFAULT_INPUT_SELECTION_LIST_WARNINGS_MESSAGES[key] ||
91
- ''
92
- );
93
- });
94
- }
95
-
96
- /**
97
- * Returns whether any warnings are active.
98
- */
99
- protected get hasWarning(): boolean {
100
- return this.warningList.length > 0;
101
- }
102
-
103
- public toggleDropdown(event: Event): void {
104
- event.stopPropagation();
105
- if (this.disabled) return;
106
-
107
- this.isOpen = !this.isOpen;
108
-
109
- if (this.isOpen) {
110
- this.setDropdownDirection();
111
- setTimeout(() => {
112
- if (this.hasSearch && this.searchInput) {
113
- this.searchInput.nativeElement.focus();
114
- const len = this.searchInput.nativeElement.value.length;
115
- this.searchInput.nativeElement.setSelectionRange(len, len);
116
- } else {
117
- this.focusFirstItem();
118
- }
119
- }, 0);
120
- } else {
121
- this.searchTerm = "";
122
- }
123
- }
124
-
125
- public selectItem(item: SelectionListItem<T>, event: Event): void {
126
- event.stopPropagation();
127
- if (item.disabled) return;
128
-
129
- this.selectedId = item.id;
130
- this.value = item.value;
131
- this.isOpen = false;
132
- this.focusedIndex = this.items.findIndex(i => i.id === item.id);
133
-
134
- if (this.hasSearch) {
135
- this.searchTerm = item.label ?? '';
136
- }
137
-
138
- this.onChange(this.value);
139
- this.onTouched();
140
- }
141
-
142
- protected override clearValue(event: MouseEvent) {
143
- event.stopPropagation();
144
-
145
- this.selectedId = '';
146
- this.value = null;
147
- this.searchTerm = '';
148
- this.isOpen = false;
149
-
150
- this.onChange(null);
151
- this.onTouched();
152
- }
153
-
154
- protected onKeyDown(event: KeyboardEvent): void {
155
- if (this.disabled) return;
156
-
157
- switch (event.key) {
158
- case "Enter":
159
- case " ":
160
- case "Spacebar":
161
- event.preventDefault();
162
- this.toggleDropdown(event);
163
- break;
164
- case "ArrowDown":
165
- event.preventDefault();
166
- if (!this.isOpen) this.isOpen = true;
167
- setTimeout(() => {
168
- if (this.hasSearch && this.searchInput) {
169
- this.searchInput.nativeElement.focus();
170
- } else {
171
- this.focusFirstItem();
172
- }
173
- }, 0);
174
- break;
175
- case "Escape":
176
- this.isOpen = false;
177
- break;
178
- }
179
- }
180
-
181
- protected onOptionKeyDown(event: KeyboardEvent, item: SelectionListItem<T>, index: number): void {
182
- switch (event.key) {
183
- case "Enter":
184
- case " ":
185
- case "Spacebar":
186
- event.preventDefault();
187
- this.selectItem(item, event);
188
- break;
189
- case "ArrowDown":
190
- event.preventDefault();
191
- this.focusNextItem(index);
192
- break;
193
- case "ArrowUp":
194
- event.preventDefault();
195
- this.focusPreviousItem(index);
196
- break;
197
- case "Escape":
198
- event.preventDefault();
199
- this.isOpen = false;
200
- break;
201
- }
202
- }
203
-
204
- protected override onBlur(event: FocusEvent): void {
205
- const nativeElement = this.elementRef.nativeElement;
206
- const relatedTarget = event.relatedTarget as Node;
207
- if (!relatedTarget || !nativeElement.contains(relatedTarget)) {
208
- this.isOpen = false;
209
- if(this.selectedItem){
210
- this.searchTerm = this.selectedItem.label;
211
- } else {
212
- this.searchTerm = '';
213
- }
214
- }
215
- }
216
-
217
- protected override onFocus(): void {
218
- if (!this.disabled) {
219
- this.isOpen = true;
220
- this.setDropdownDirection();
221
- }
222
- }
223
-
224
- protected onSearch(event: Event): void {
225
- const target = event.target;
226
- if (target instanceof HTMLInputElement) {
227
- this.searchTerm = target.value ?? '';
228
- this.focusedIndex = 0;
229
- }
230
- }
231
-
232
- protected onSearchKeyDown(event: KeyboardEvent): void {
233
- if (event.key === "Enter") {
234
- event.preventDefault();
235
- const exactMatch = this.filteredItems.find(i => i.label?.toLowerCase() === this.searchTerm.toLowerCase());
236
- if (exactMatch) {
237
- this.selectItem(exactMatch, event);
238
- }
239
- }
240
-
241
- switch (event.key) {
242
- case "ArrowDown":
243
- event.preventDefault();
244
- setTimeout(() => this.focusFirstItem(), 0);
245
- break;
246
-
247
- case "Escape":
248
- event.preventDefault();
249
- this.isOpen = false;
250
- break;
251
- }
252
- }
253
-
254
- protected override updateDisabledState(_isDisabled: boolean): void {
255
- //Intentionally left void, to implement in case is needed
256
- }
257
- protected override updateView(_value: T | null): void {
258
- //Intentionally left void, to implement in case is needed
259
- }
260
-
261
- private focusFirstItem(): void {
262
- const buttons = this.getEnabledButtons();
263
- if (buttons.length > 0) {
264
- this.focusedIndex = 0;
265
- buttons[0].focus();
266
- }
267
- }
268
-
269
- private focusNextItem(currentIndex: number = this.focusedIndex): void {
270
- const buttons = this.getEnabledButtons();
271
- if (buttons.length === 0) return;
272
-
273
- const nextIndex = (currentIndex + 1) % buttons.length;
274
- this.focusedIndex = nextIndex;
275
- buttons[nextIndex].focus();
276
- }
277
-
278
- private focusPreviousItem(currentIndex: number = this.focusedIndex): void {
279
- const buttons = this.getEnabledButtons();
280
- if (buttons.length === 0) return;
281
-
282
- const prevIndex = (currentIndex - 1 + buttons.length) % buttons.length;
283
- this.focusedIndex = prevIndex;
284
- buttons[prevIndex].focus();
285
- }
286
-
287
- private getEnabledButtons(): HTMLButtonElement[] {
288
- return this.optionButtons
289
- ? this.optionButtons.map(ref => ref.nativeElement).filter(btn => !btn.disabled)
290
- : [];
291
- }
292
-
293
- private setDropdownDirection(): void {
294
- const trigger: HTMLElement | undefined = this.elementRef.nativeElement.querySelector('.custom-select');
295
- const searchTrigger: HTMLElement | undefined = this.elementRef.nativeElement.querySelector('.options-search__input');
296
- const dropdownHeight: number = 240;
297
-
298
- if(trigger || searchTrigger){
299
- const rect = trigger?.getBoundingClientRect() || searchTrigger?.getBoundingClientRect();
300
- const viewportHeight = window.innerHeight;
301
-
302
- const spaceBelow = viewportHeight - (rect?.bottom ?? 0);
303
- const spaceAbove = (rect?.top ?? 0);
304
-
305
- if (spaceBelow >= dropdownHeight) {
306
- this.openDirection = 'down';
307
- } else if (spaceAbove >= dropdownHeight) {
308
- this.openDirection = 'top';
309
- } else {
310
- this.openDirection = spaceBelow > spaceAbove ? 'down' : 'top';
311
- }
312
- }
313
- }
314
-
315
- }
@@ -1,35 +0,0 @@
1
- import { Directive, OnInit } from '@angular/core';
2
- import { ControlValueAccessor } from '@angular/forms';
3
- import { InputBase } from '../input/input-base';
4
- import { SelectionListPosition } from './selection-lists.type';
5
-
6
- /**
7
- * Base class for input components, providing common functionality for form controls.
8
- * This class implements ControlValueAccessor to integrate with Angular forms.
9
- * Subclasses must implement the abstract methods to update the view and disabled state.
10
- * It also provides properties for label, placeholder, required state, and error handling.
11
- * The errorMessages property can be customized to provide specific validation messages.
12
- * The hasError getter can be used in templates to conditionally display error messages.
13
- * Subclasses should call super.ngOnInit() if they override ngOnInit().
14
- *
15
- * @see ControlValueAccessor
16
- */
17
- @Directive()
18
- export abstract class SelectionListBase<T> extends InputBase<T> implements ControlValueAccessor, OnInit {
19
- /**
20
- * Direction of selection list when it opens.
21
- */
22
- protected openDirection: SelectionListPosition = 'down';
23
-
24
- /**
25
- * Clear the value of input
26
- */
27
- protected abstract clearValue(event: Event): void;
28
-
29
- /**
30
- * Handles selection change event.
31
- * Subclasses can override to provide custom behavior.
32
- * Default implementation does nothing.
33
- */
34
- protected onSelectionChange(_: Event): void { }
35
- }
@@ -1,17 +0,0 @@
1
- //#region [ERRORS]
2
- export const DEFAULT_SELECTION_LIST_ERROR_MESSAGES: Record<string, string> = {
3
- required: 'This field is required.',
4
- minlength: 'The value is too short.',
5
- maxlength: 'The value is too long.',
6
- pattern: 'The value does not match the required pattern.',
7
- };
8
- //#endregion
9
-
10
- //#region [WARNINGS]
11
- // export const DEFAULT_INPUT_NUMBER_WARNING_MESSAGES: Record<string, string> = {
12
- // min:'The minimium value allowed is {{limit}}',
13
- // max: 'The maximum value allowed is {{limit}}',
14
- // step: 'The value does not match the required step increment value of {{limit}}',
15
- // precision: 'The value exceeds the allowed number of decimal places value of {{limit}}',
16
- // };
17
- //#endregion
@@ -1,7 +0,0 @@
1
- export interface SelectionListItem<T> {
2
- id: string;
3
- label: string;
4
- value: T | null;
5
- selected: boolean;
6
- disabled?: boolean;
7
- }
@@ -1 +0,0 @@
1
- export type SelectionListPosition = 'top' | 'down';