@tacdaed/fragments 1.0.0-beta.1 → 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 +4 -20
  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,170 +0,0 @@
1
- <div class="frg-multi-select" [class.multi-select-error]="hasError">
2
- <label [attr.for]="id + '-options'">{{ label }}</label>
3
-
4
- @if(hasSearch) {
5
- <div class="options-search">
6
- <input
7
- #searchInput
8
- type="text"
9
- [attr.name]="id + '-options'"
10
- [attr.id]="id + '-options'"
11
- class="options-search__input"
12
- [class.open]="isOpen"
13
- [attr.placeholder]="'Search…'"
14
- aria-label="Search options"
15
- role="searchbox"
16
- [value]="searchTerm"
17
- (input)="onSearch($event)"
18
- (blur)="onBlur($event)"
19
- (focus)="onFocus()"
20
- (keydown)="onSearchKeyDown($event)"
21
- />
22
- <ng-container [ngTemplateOutlet]="buttonsTemplate"></ng-container>
23
- </div>
24
-
25
- @if(showChips && selectedItems.length) {
26
- <div class="selected-chips selected-chips--below">
27
- @for(item of selectedItems; track item.id) {
28
- <frg-chip
29
- [id]="item.id"
30
- [label]="item.label || ''"
31
- size="sm"
32
- [style]="chipsStyle"
33
- [removable]="true"
34
- [disabled]="disabled"
35
- (removed)="removeItemById($event)"
36
- ></frg-chip>
37
- }
38
- </div>
39
- } @else if(selectedItems.length) {
40
- <div class="selected-labels">
41
- {{ selectedLabels }}
42
- </div>
43
- }
44
- } @else {
45
- <div class="frg-multi-select__handle-buttons">
46
- @if(showChips) {
47
- <div
48
- class="custom-select custom-select--chips"
49
- [id]="id + '-options'"
50
- [attr.name]="id + '-options'"
51
- [class.open]="isOpen"
52
- [class.disabled]="disabled"
53
- [attr.tabindex]="disabled ? -1 : 0"
54
- [attr.aria-expanded]="isOpen"
55
- (click)="toggleDropdown($event)"
56
- (keydown)="onKeyDown($event)"
57
- [attr.aria-controls]="id + '-options'"
58
- >
59
- @if(selectedItems.length) {
60
- <div class="selected-chips">
61
- @for(item of selectedItems; track item.id) {
62
- <frg-chip
63
- [id]="item.id"
64
- [label]="item.label || ''"
65
- size="sm"
66
- [style]="chipsStyle"
67
- [removable]="true"
68
- [disabled]="disabled"
69
- (removed)="removeItemById($event)"
70
- ></frg-chip>
71
- }
72
- </div>
73
- } @else {
74
- <span class="selected-labels__text selected-labels__placeholder">{{ placeholder || 'Select.' }}</span>
75
- }
76
- </div>
77
- } @else {
78
- <button
79
- type="button"
80
- class="custom-select"
81
- [id]="id + '-options'"
82
- [attr.name]="id + '-options'"
83
- [class.open]="isOpen"
84
- [disabled]="disabled"
85
- [attr.aria-expanded]="isOpen"
86
- (click)="toggleDropdown($event)"
87
- (keydown)="onKeyDown($event)"
88
- [attr.aria-controls]="id + '-options'"
89
- >
90
- @if(valuesTemplate) {
91
- <ng-container
92
- [ngTemplateOutlet]="valuesTemplate"
93
- [ngTemplateOutletContext]="{ $implicit: selectedItems }"
94
- ></ng-container>
95
- } @else {
96
- <span class="selected-labels__text" [class.selected-labels__placeholder]="!selectedItems.length">{{ selectedLabels }}</span>
97
- }
98
- </button>
99
- }
100
- <ng-container [ngTemplateOutlet]="buttonsTemplate"></ng-container>
101
- </div>
102
- }
103
-
104
- @if(isOpen) {
105
- <div
106
- class="options"
107
- [id]="id + '-options'"
108
- [class.open-up]="openDirection === 'top'"
109
- [class.open-down]="openDirection === 'down'"
110
- >
111
- @for(item of filteredItems; track item.id; let idx = $index) {
112
- <button
113
- #optionButton
114
- type="button"
115
- class="option"
116
- [class.disabled]="item.disabled"
117
- [class.selected]="selectedIds.includes(item.id)"
118
- [disabled]="item.disabled"
119
- (focus)="onFocus()"
120
- (blur)="onBlur($event)"
121
- (click)="selectItem(item, $event)"
122
- (keydown)="onOptionKeyDown($event, item, idx)"
123
- >
124
- <input
125
- type="checkbox"
126
- [attr.id]="id + '-option-' + idx"
127
- [attr.name]="id + '-option'"
128
- [checked]="item.selected"
129
- readonly
130
- />
131
- @if(optionTemplate) {
132
- <ng-container [ngTemplateOutlet]="optionTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
133
- } @else {
134
- {{ item.label }}
135
- }
136
- </button>
137
- }
138
- </div>
139
- }
140
-
141
- <frg-input-validation
142
- [errorList]="errorList"
143
- [isFormInvalid]="hasError"
144
- ></frg-input-validation>
145
- </div>
146
-
147
- <ng-template #buttonsTemplate>
148
- <div class="multi-select__actions">
149
- @if((value && selectedItems.length) || (hasSearch && searchTerm.length)) {
150
- <button
151
- type="button"
152
- class="clear-button"
153
- aria-label="Clear selection"
154
- (click)="clearValue($event)"
155
- >
156
- <span class="fas fa-xmark"></span>
157
- </button>
158
- }
159
- <button
160
- type="button"
161
- class="arrow-button"
162
- [class.open]="isOpen"
163
- aria-label="Toggle dropdown"
164
- (click)="toggleDropdown($event)"
165
- >
166
- <span class="arrow-icon fas fa-chevron-down"></span>
167
- </button>
168
- </div>
169
- </ng-template>
170
-
@@ -1,312 +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-multi-select {
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
- width: 100%;
25
- border-bottom: 2px solid $input-border-color;
26
- transition: border-color 0.3s;
27
-
28
- &:has(.open) {
29
- border-color: $input-focus-border-color;
30
- }
31
-
32
- &.focus,
33
- &:focus-visible,
34
- &:hover {
35
- border-color: $input-focus-border-color;
36
- }
37
-
38
- &__input {
39
- flex: 1;
40
- padding: $input-padding;
41
- padding-right: 3rem;
42
- border: none;
43
- background: transparent;
44
- font-family: $input-font-family;
45
- font-size: 1rem;
46
- color: $color-dark-neutral;
47
- cursor: pointer;
48
- outline: none;
49
-
50
- &::placeholder {
51
- color: $input-text-color;
52
- opacity: 0.7;
53
- }
54
-
55
- &:disabled {
56
- cursor: not-allowed;
57
- opacity: 0.6;
58
- }
59
- }
60
- }
61
-
62
- &__handle-buttons {
63
- display: flex;
64
- align-items: center;
65
- width: 100%;
66
- border-bottom: 2px solid $input-border-color;
67
- background: transparent;
68
- font-family: $input-font-family;
69
- color: $input-text-color;
70
- cursor: pointer;
71
- transition: border-color 0.3s;
72
- position: relative;
73
-
74
- &:has(.open) {
75
- border-color: $input-focus-border-color;
76
- }
77
-
78
- &:hover,
79
- &:focus-visible,
80
- &.focus {
81
- border-color: $input-focus-border-color;
82
- }
83
-
84
- .custom-select {
85
- flex: 1 1 auto;
86
- min-width: 0;
87
- display: flex;
88
- align-items: center;
89
- padding: $input-padding;
90
- padding-right: 3rem;
91
- border: none;
92
- background: transparent;
93
- text-align: left;
94
- font-size: 1rem;
95
- overflow: hidden;
96
-
97
- &:focus-visible {
98
- outline: none;
99
- }
100
-
101
- &:disabled {
102
- cursor: not-allowed;
103
- opacity: 0.6;
104
- }
105
-
106
- &.open {
107
- border-bottom-color: $color-primary;
108
- }
109
-
110
- .item-label {
111
- flex: 1 1 auto;
112
- min-width: 0; // critical for ellipsis in flex
113
- overflow: hidden;
114
- white-space: nowrap;
115
- text-overflow: ellipsis;
116
- opacity: 0.7;
117
- }
118
-
119
- .selected {
120
- flex: 1 1 auto;
121
- min-width: 0;
122
- overflow: hidden;
123
- white-space: nowrap;
124
- text-overflow: ellipsis;
125
- }
126
- }
127
-
128
- .custom-select--chips {
129
- min-height: 2.25rem;
130
- cursor: pointer;
131
- }
132
-
133
- .custom-select--chips.disabled {
134
- cursor: not-allowed;
135
- opacity: 0.6;
136
- }
137
-
138
- }
139
-
140
- .multi-select__actions {
141
- position: absolute;
142
- right: 0;
143
- top: 50%;
144
- transform: translateY(-50%);
145
- display: inline-flex;
146
- align-items: center;
147
- padding-right: 0.25rem;
148
- }
149
-
150
- .options {
151
- position: absolute;
152
- left: 0;
153
- right: 0;
154
- background: #fff;
155
- border-radius: 0.25rem;
156
- box-shadow: $box-shadow-md;
157
- z-index: 10;
158
- max-height: 240px;
159
- overflow-y: auto;
160
- animation: dropdown-fade-in 0.2s ease-in-out;
161
-
162
- &::-webkit-scrollbar {
163
- width: 0.3rem;
164
- background-color: transparent;
165
- }
166
-
167
- &::-webkit-scrollbar-thumb {
168
- background-color: $color-primary;
169
- border-radius: 0.1rem;
170
- }
171
-
172
- &::-webkit-scrollbar-thumb:hover {
173
- background-color: color.adjust($color-primary, $lightness: -10%);
174
- }
175
-
176
- .option {
177
- display: inline-flex;
178
- gap: .75rem;
179
- width: 100%;
180
- padding: 0.5rem 1rem;
181
- background: transparent;
182
- border: none;
183
- text-align: left;
184
- color: $input-text-color;
185
- font-size: 0.95rem;
186
- cursor: pointer;
187
- transition: background-color 0.15s ease, color 0.15s ease;
188
-
189
- &:hover:not(:disabled),
190
- &:focus-visible:not(:disabled) {
191
- background-color: color.scale($color-primary, $lightness: 90%);
192
- outline: none;
193
- }
194
-
195
- &.selected {
196
- background-color: color.scale($color-primary, $lightness: 85%);
197
- }
198
-
199
- &:disabled,
200
- &.disabled {
201
- opacity: 0.5;
202
- cursor: not-allowed;
203
- }
204
- }
205
-
206
- &.open-down {
207
- top: calc(100% + 0.25rem);
208
- }
209
-
210
- &.open-up {
211
- bottom: calc(100% + 0.25rem);
212
- }
213
- }
214
-
215
- .clear-button,
216
- .arrow-button {
217
- background: transparent;
218
- border: none;
219
- cursor: pointer;
220
- padding: 0;
221
- width: 1.25rem;
222
- height: 1.25rem;
223
- display: flex;
224
- align-items: center;
225
- justify-content: center;
226
- font-size: 0.75rem;
227
- line-height: 1;
228
- color: $color-dark-neutral;
229
- }
230
-
231
- .clear-button .fas {
232
- line-height: 1;
233
- }
234
-
235
- .arrow-button {
236
- display: flex;
237
- align-items: center;
238
- justify-content: center;
239
- background: transparent;
240
- border: none;
241
- cursor: pointer;
242
- transition: transform 0.3s ease;
243
-
244
- &:disabled {
245
- cursor: not-allowed;
246
- opacity: 0.5;
247
- }
248
- }
249
-
250
- .arrow-icon {
251
- font-size: 0.75rem;
252
- transition: transform 0.3s ease;
253
- }
254
-
255
- .arrow-button.open .arrow-icon {
256
- transform: rotate(180deg);
257
- }
258
-
259
- .selected-labels {
260
- padding: .2rem .5rem;
261
- font-size: .875rem;
262
- color: $color-dark-neutral;
263
-
264
- &__text {
265
- color: $color-dark-neutral;
266
- }
267
-
268
- &__placeholder {
269
- color: $input-text-color;
270
- opacity: 0.7;
271
- }
272
- }
273
-
274
- .selected-chips {
275
- display: flex;
276
- flex-wrap: wrap;
277
- align-items: center;
278
- gap: 0.25rem;
279
- min-height: 1.5rem;
280
- }
281
-
282
- .selected-chips--below {
283
- padding: 0.25rem 0.5rem 0;
284
- }
285
-
286
- .custom-select--chips.disabled frg-chip {
287
- pointer-events: none;
288
- opacity: 0.6;
289
- }
290
-
291
- &.multi-select-error .options-search,
292
- &.multi-select-error .frg-multi-select__handle-buttons {
293
- border-bottom-color: $color-danger;
294
- }
295
-
296
- &.multi-select-error label {
297
- color: $color-danger;
298
- }
299
-
300
- @keyframes dropdown-fade-in {
301
- from {
302
- opacity: 0;
303
- transform: translateY(-10px);
304
- }
305
-
306
- to {
307
- opacity: 1;
308
- transform: translateY(0);
309
- }
310
- }
311
- }
312
- }
@@ -1,61 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { By } from '@angular/platform-browser';
3
- import { MultiSelectComponent } from './multi-select.component';
4
- import { SelectionListItem } from '../selection-lists-interface';
5
-
6
- describe('MultiSelectComponent', () => {
7
- let fixture: ComponentFixture<MultiSelectComponent<string>>;
8
- let component: MultiSelectComponent<string>;
9
-
10
- const items: SelectionListItem<string>[] = [
11
- { id: 'a', label: 'Alpha', value: 'alpha', selected: false },
12
- { id: 'b', label: 'Beta', value: 'beta', selected: false }
13
- ];
14
-
15
- beforeEach(async () => {
16
- await TestBed.configureTestingModule({
17
- imports: [MultiSelectComponent]
18
- }).compileComponents();
19
-
20
- fixture = TestBed.createComponent(MultiSelectComponent<string>);
21
- component = fixture.componentInstance;
22
- component.items = [...items];
23
- });
24
-
25
- it('opens dropdown when trigger is clicked', () => {
26
- fixture.detectChanges();
27
-
28
- const trigger = fixture.debugElement.query(By.css('.custom-select'));
29
- trigger.nativeElement.click();
30
-
31
- expect((component as any).isOpen).toBeTrue();
32
- });
33
-
34
- it('selects multiple items and updates value', () => {
35
- const onChangeSpy = jasmine.createSpy('onChange');
36
- component.registerOnChange(onChangeSpy);
37
-
38
- fixture.detectChanges();
39
-
40
- component.selectItem(items[0], new Event('click'));
41
- component.selectItem(items[1], new Event('click'));
42
-
43
- expect(component.value).toEqual(['alpha', 'beta']);
44
- expect((component as any).selectedIds).toEqual(['a', 'b']);
45
- expect(onChangeSpy).toHaveBeenCalledWith(['alpha', 'beta']);
46
- });
47
-
48
- it('clears selections', () => {
49
- component.items = [
50
- { id: 'a', label: 'Alpha', value: 'alpha', selected: true },
51
- { id: 'b', label: 'Beta', value: 'beta', selected: true }
52
- ];
53
- (component as any).selectedIds = ['a', 'b'];
54
- component.value = ['alpha', 'beta'];
55
-
56
- (component as any).clearValue(new MouseEvent('click'));
57
-
58
- expect(component.value).toBeNull();
59
- expect((component as any).selectedIds.length).toBe(0);
60
- });
61
- });