@testgorilla/tgo-ui 11.22.2 → 12.0.0

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 (227) hide show
  1. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
  2. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
  3. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
  4. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
  5. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
  6. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
  7. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
  8. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
  9. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
  10. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
  11. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
  12. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
  13. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
  14. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
  15. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
  16. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
  17. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
  18. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
  19. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
  20. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
  21. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
  22. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
  23. package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
  24. package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
  25. package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
  26. package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
  27. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
  28. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
  29. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
  30. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
  31. package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
  32. package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
  33. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
  34. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
  35. package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
  36. package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
  37. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
  38. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
  39. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
  40. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
  41. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
  42. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
  43. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
  44. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
  45. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
  46. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
  47. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
  48. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
  49. package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
  50. package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
  51. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
  52. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
  53. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
  54. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
  55. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
  56. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
  57. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
  58. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
  59. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1789
  60. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
  61. package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
  62. package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
  63. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
  64. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
  65. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
  66. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
  67. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
  68. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
  69. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
  70. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
  71. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
  72. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
  73. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
  74. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
  75. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
  76. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
  77. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
  78. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
  79. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
  80. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
  81. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
  82. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
  83. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
  84. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
  85. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
  86. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
  87. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
  88. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
  89. package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
  90. package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
  91. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
  92. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
  93. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
  94. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
  95. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
  96. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
  97. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
  98. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
  99. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
  100. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
  101. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
  102. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
  103. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
  104. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
  105. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
  106. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
  107. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
  108. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
  109. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
  110. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
  111. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
  112. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
  113. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
  114. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
  115. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
  116. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
  117. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
  118. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
  119. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
  120. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
  121. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
  122. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
  123. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
  124. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
  125. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
  126. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
  127. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
  128. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
  129. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
  130. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
  131. package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
  132. package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
  133. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
  134. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
  135. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
  136. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
  137. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
  138. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
  139. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
  140. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
  141. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
  142. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
  143. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
  144. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
  145. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
  146. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
  147. package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
  148. package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
  149. package/mcp/catalog.json +1 -1
  150. package/package.json +16 -17
  151. package/projects/tgo-canopy-ui/assets/icons/rebrand/Sequences-filled.svg +3 -0
  152. package/projects/tgo-canopy-ui/assets/icons/rebrand/Sequences-in-line.svg +3 -0
  153. package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
  154. package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
  155. package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
  156. package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
  157. package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
  158. package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
  159. package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
  160. package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
  161. package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
  162. package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
  163. package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
  164. package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
  165. package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
  166. package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
  167. package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
  168. package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
  169. package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
  170. package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
  171. package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
  172. package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
  173. package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
  174. package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
  175. package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
  176. package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
  177. package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
  178. package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
  179. package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
  180. package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
  181. package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
  182. package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
  183. package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
  184. package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
  185. package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
  186. package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
  187. package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
  188. package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
  189. package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
  190. package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
  191. package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
  192. package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
  193. package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
  194. package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
  195. package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
  196. package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
  197. package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
  198. package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
  199. package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
  200. package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
  201. package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
  202. package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
  203. package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
  204. package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
  205. package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
  206. package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
  207. package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
  208. package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
  209. package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
  210. package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
  211. package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
  212. package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
  213. package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
  214. package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
  215. package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
  216. package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
  217. package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
  218. package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
  219. package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
  220. package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
  221. package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
  222. package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
  223. package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
  224. package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
  225. package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
  226. package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
  227. package/types/testgorilla-tgo-ui.d.ts +52 -45
@@ -1 +1 @@
1
- {"version":3,"file":"testgorilla-tgo-ui-components-radio-button.mjs","sources":["../../../components/radio-button/radio-button.component.ts","../../../components/radio-button/radio-button.component.html","../../../components/radio-button/radio-button.component.module.ts","../../../components/radio-button/testgorilla-tgo-ui-components-radio-button.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { NgClass } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EventEmitter,\n HostBinding,\n HostListener,\n inject,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ProviderToken,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { MatRadioButton } from '@angular/material/radio';\nimport { MatTooltip } from '@angular/material/tooltip';\n\nimport { ApplicationTheme, Alignment, EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\n\nimport { RadioButtonEventType } from './radio-button.model';\n\n@Component({\n selector: 'ui-radio-button',\n templateUrl: './radio-button.component.html',\n styleUrls: ['./radio-button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // Needs to be removed since it causes some a11y issues (https://github.com/angular/components/issues/21266).\n '[attr.tabindex]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the mat-radio-button element.\n '(focus)': 'radioElement.focus()',\n },\n imports: [NgClass, MatRadioButton, EllipseTextDirective, MatTooltip],\n})\nexport class RadioButtonComponent implements OnInit, OnChanges, ControlValueAccessor, AfterViewInit, OnDestroy {\n private _isProcessingClick = false;\n\n @HostListener('click', ['$event'])\n onHostClick(event: MouseEvent): void {\n if (this._isProcessingClick) {\n return;\n }\n const target = event.target as HTMLElement | null;\n const targetClasses: string = target?.classList?.value ?? '';\n const fromMediaArea = this.mediaCard && target?.closest?.('.media-card-wrapper');\n if (targetClasses.includes('mat-mdc-radio-button') || targetClasses.includes('mdc-form-field') || fromMediaArea) {\n this._isProcessingClick = true;\n this.radioElement._inputElement.nativeElement.click();\n this._isProcessingClick = false;\n }\n }\n /**\n * Determines whether the radio button is disabled.\n * Default: false.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() disabled = false;\n\n /**\n * Determines whether the radio button is checked.\n * Default: false.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n //@Input() selected = false;\n\n _selected = false;\n @Input()\n get selected() {\n return this._selected;\n }\n set selected(selected: boolean) {\n this._selected = selected;\n }\n\n /**\n * Determines whether the radio button can be unchecked.\n * Default: false.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() allowUnselect = false;\n\n /**\n * Determines the radio button color.\n * Default: Test Gorilla primary color.\n *\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @HostBinding('style.--color')\n @Input()\n companyColor: string | null = null;\n\n /**\n * Used to group radios for unique selection.\n *\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() name = '';\n\n /**\n * Text content will be applied to the input element if present.\n *\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() label = '';\n\n /**\n * Determines whether the radio button is a multiple choice cell.\n * Default: false\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() multiple = false;\n\n /**\n * Renders the radio button as a media card. The image/video/gif passed via\n * the `[radio-media]` content slot fills the card and the radio + label sit\n * on top, in the bottom-left, with a dark scrim for contrast.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() mediaCard = false;\n\n /**\n * Determines value of the radio button.\n * Default: false\n *\n * @type {any}\n * @memberof RadioButtonComponent\n */\n @Input() value: unknown;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof RadioButtonComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() ariaLabel: string;\n\n @Input() testId: string | null = null;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() ariaRequired = false;\n\n /**\n * Defines if checkbox has error\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() hasError = false;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() ariaLabelledby = '';\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() ariaDescribedby = '';\n\n /**\n * Truncate text if it is too long\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() truncateText = false;\n\n /**\n * Text alignment\n * @type {'center' | 'top'}\n * @memberof RadioButtonComponent\n */\n @Input() alignment: Alignment = 'center';\n\n /**\n * Sets the tab index for the checkbox component.\n * This determines the order in which elements receive focus when the user navigates through them using the Tab key.\n * Default value is 0.\n *\n * @type {number}\n * @memberof RadioButtonComponent\n */\n @Input() tabIndex = 0;\n\n /**\n * Show tooltip when label is truncated\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() hideTooltipOnEllipsis = false;\n\n /**\n * Event emitted when the checked state of the radio button changes.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Output() changeRadio = new EventEmitter<RadioButtonEventType>();\n\n classMultiple: string;\n showTooltip = false;\n protected origin: string | null = null;\n\n @ViewChild('radio') radioElement: MatRadioButton;\n\n private appliedTestId: string | null = null;\n @ViewChild('tooltip') tooltipElement: MatTooltip;\n\n private readonly defaultAppTheme = inject(\n 'CANOPYUI_DEFAULT_APPLICATION_THEME' as unknown as ProviderToken<ApplicationTheme>,\n {\n optional: true,\n }\n );\n public ngControl = inject(NgControl, { optional: true, self: true });\n public hostNgControl = inject(NgControl, { optional: true, host: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly ngZone = inject(NgZone);\n private readonly cdr = inject(ChangeDetectorRef);\n\n constructor() {\n if (this.defaultAppTheme) {\n this.applicationTheme = this.defaultAppTheme;\n }\n\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit() {\n this.checkHost();\n this.classMultiple = this.setClass();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['selected']) {\n this.classMultiple = this.setClass();\n }\n this.setCompanyColor();\n this.applyTestId();\n }\n\n // MatRadioButton takes no attribute passthrough, so the id is set on the native input directly.\n private applyTestId(): void {\n if (!this.radioElement || this.testId === this.appliedTestId) {\n return;\n }\n const radioNativeInput = this.radioElement._inputElement.nativeElement;\n if (this.testId) {\n radioNativeInput.setAttribute('data-testid', this.testId);\n } else {\n radioNativeInput.removeAttribute('data-testid');\n }\n this.appliedTestId = this.testId;\n }\n\n ngAfterViewInit() {\n this.radioElement._inputElement.nativeElement.setAttribute('role', 'radio');\n this.applyTestId();\n this.radioElement._inputElement.nativeElement.onclick = () => {\n this.clickRadio();\n };\n\n this.focusMonitor\n .monitor(this.radioElement._inputElement.nativeElement)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(origin =>\n this.ngZone.run(() => {\n this.origin = origin;\n this.cdr.markForCheck();\n this.onFocus(origin === 'keyboard');\n })\n );\n }\n\n ngOnDestroy(): void {\n this.focusMonitor.stopMonitoring(this.radioElement._inputElement.nativeElement);\n }\n\n //Click method\n clickRadio() {\n if (this.allowUnselect) {\n this.radioElement.checked = !this.radioElement.checked;\n this._selected = this.radioElement.checked;\n this.classMultiple = this.setClass();\n this.selected = this.radioElement.checked;\n this.changeRadio?.emit({\n optionName: this.radioElement.value as string,\n optionChecked: this.radioElement.checked,\n });\n } else {\n if (!this.hostNgControl) {\n this.selected = true;\n }\n this.changeRadio.emit({ optionName: this.radioElement.value as string, optionChecked: true });\n }\n if (this.disabled) {\n this._selected = false;\n this.changeRadio.emit({ optionName: '', optionChecked: false });\n }\n this.onChange(this._selected);\n }\n\n writeValue(value: unknown): void {\n if (typeof value === 'boolean' || value === this.value) {\n this.selected = value as boolean;\n }\n // The forms API calls this from outside the component's own change\n // detection — under OnPush the view must be marked explicitly.\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n\n onChange: (value: boolean) => void = () => {};\n\n /**\n * @ignore\n */\n onTouch = () => {};\n\n //Set class for multiple radio\n setClass(): string {\n if (this.multiple) {\n return this._selected ? 'multiple-checked' : 'multiple-unchecked';\n }\n return '';\n }\n\n onLabelEllipsisChange(isEllipsis: boolean): void {\n this.showTooltip = isEllipsis && !this.hideTooltipOnEllipsis;\n }\n\n private checkHost(): void {\n if (this.hostNgControl) {\n this.selected = this.value === this.hostNgControl.value;\n this.hostNgControl.valueChanges?.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(value => {\n this.selected = value === this.value;\n this.classMultiple = this.setClass();\n });\n }\n }\n\n private setCompanyColor(): void {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- empty companyColor falls back to the theme colour\n this.companyColor = this.companyColor\n ? this.companyColor\n : this.applicationTheme === 'classic'\n ? '#46A997'\n : '#D410AA';\n }\n\n onFocus(isFocus: boolean): void {\n setTimeout(() => {\n if (this.tooltipElement) {\n if (this.showTooltip && isFocus) {\n this.tooltipElement.show();\n } else {\n this.tooltipElement.hide();\n }\n }\n }, 0);\n }\n\n focus(): void {\n this.radioElement.focus();\n }\n}\n","<div\n #radioContainer\n tabindex=\"0\"\n [class]=\"multiple ? 'radio-container' : 'radio'\"\n [class.multiple-disabled]=\"disabled && multiple\"\n [class.media-card]=\"mediaCard\"\n [class.media-card-selected]=\"mediaCard && selected\"\n [ngClass]=\"classMultiple\"\n [attr.alignment]=\"alignment\"\n [attr.truncate-text]=\"truncateText\"\n [attr.theme]=\"applicationTheme\"\n [attr.hasError]=\"hasError\"\n (keydown.enter)=\"clickRadio(); radioContainer.focus()\"\n (keydown.space)=\"clickRadio(); radioContainer.focus()\"\n>\n @if (mediaCard) {\n <div class=\"media-card-wrapper\" aria-hidden=\"true\">\n <ng-content select=\"[radio-media]\"></ng-content>\n </div>\n }\n <mat-radio-button\n #radio\n [checked]=\"selected\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [value]=\"value\"\n class=\"radio-button\"\n [required]=\"ariaRequired\"\n [aria-label]=\"ariaLabel\"\n [aria-labelledby]=\"ariaLabelledby ? ariaLabelledby : label\"\n [aria-describedby]=\"ariaDescribedby\"\n (keydown.enter)=\"$event.preventDefault()\"\n (keydown.space)=\"$event.preventDefault()\"\n [tabIndex]=\"tabIndex\"\n >\n @if (label) {\n <span\n #tooltip=\"matTooltip\"\n class=\"label\"\n uiEllipseText\n (onChangeTextState)=\"onLabelEllipsisChange($event)\"\n [matTooltip]=\"showTooltip ? label : ''\"\n [matTooltipClass]=\"applicationTheme\"\n >{{ label }}</span\n >\n }\n <ng-content select=\"[radio-label]\"></ng-content>\n </mat-radio-button>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { FocusVisibleDirective } from '@testgorilla/tgo-ui/components/checkbox';\nimport { EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\n\nimport { RadioButtonComponent } from './radio-button.component';\n\n@NgModule({\n imports: [\n CommonModule,\n MatRadioModule,\n FormsModule,\n ReactiveFormsModule,\n MatInputModule,\n EllipseTextDirective,\n MatTooltipModule,\n MatCheckboxModule,\n FocusVisibleDirective,\n RadioButtonComponent,\n ],\n exports: [RadioButtonComponent],\n})\nexport class RadioButtonComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;MAkDa,oBAAoB,CAAA;AAI/B,IAAA,WAAW,CAAC,KAAiB,EAAA;AAC3B,QAAA,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B;QACF;AACA,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAA4B;QACjD,MAAM,aAAa,GAAW,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE;AAC5D,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,EAAE,OAAO,GAAG,qBAAqB,CAAC;AAChF,QAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,sBAAsB,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,aAAa,EAAE;AAC/G,YAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI;YAC9B,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE;AACrD,YAAA,IAAI,CAAC,kBAAkB,GAAG,KAAK;QACjC;IACF;AAoBA,IAAA,IACI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;IACvB;IACA,IAAI,QAAQ,CAAC,QAAiB,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,QAAQ;IAC3B;AAkLA,IAAA,WAAA,GAAA;QA3NQ,IAAA,CAAA,kBAAkB,GAAG,KAAK;AAgBlC;;;;;;AAMG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEzB;;;;;;AAMG;;QAGH,IAAA,CAAA,SAAS,GAAG,KAAK;AASjB;;;;;;AAMG;QACM,IAAA,CAAA,aAAa,GAAG,KAAK;AAE9B;;;;;;AAMG;QAGH,IAAA,CAAA,YAAY,GAAkB,IAAI;AAElC;;;;;AAKG;QACM,IA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,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YAbnC,YAAY;YACZ,cAAc;YACd,WAAW;YACX,mBAAmB;YACnB,cAAc;YAEd,gBAAgB;YAChB,iBAAiB;YAEjB,oBAAoB,CAAA,EAAA,CAAA,CAAA;;4FAIX,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAftC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,WAAW;wBACX,mBAAmB;wBACnB,cAAc;wBACd,oBAAoB;wBACpB,gBAAgB;wBAChB,iBAAiB;wBACjB,qBAAqB;wBACrB,oBAAoB;AACrB,qBAAA;oBACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA;;;AC3BD;;AAEG;;"}
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-radio-button.mjs","names":[],"sources":["../../../components/radio-button/radio-button.component.ts","../../../components/radio-button/radio-button.component.html","../../../components/radio-button/radio-button.component.module.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { NgClass } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EventEmitter,\n HostBinding,\n HostListener,\n inject,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ProviderToken,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { MatRadioButton } from '@angular/material/radio';\nimport { MatTooltip } from '@angular/material/tooltip';\n\nimport { ApplicationTheme, Alignment, EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\n\nimport { RadioButtonEventType } from './radio-button.model';\n\n@Component({\n selector: 'ui-radio-button',\n templateUrl: './radio-button.component.html',\n styleUrls: ['./radio-button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // Needs to be removed since it causes some a11y issues (https://github.com/angular/components/issues/21266).\n '[attr.tabindex]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the mat-radio-button element.\n '(focus)': 'radioElement.focus()',\n },\n imports: [NgClass, MatRadioButton, EllipseTextDirective, MatTooltip],\n})\nexport class RadioButtonComponent implements OnInit, OnChanges, ControlValueAccessor, AfterViewInit, OnDestroy {\n private _isProcessingClick = false;\n\n @HostListener('click', ['$event'])\n onHostClick(event: MouseEvent): void {\n if (this._isProcessingClick) {\n return;\n }\n const target = event.target as HTMLElement | null;\n const targetClasses: string = target?.classList?.value ?? '';\n const fromMediaArea = this.mediaCard && target?.closest?.('.media-card-wrapper');\n if (targetClasses.includes('mat-mdc-radio-button') || targetClasses.includes('mdc-form-field') || fromMediaArea) {\n this._isProcessingClick = true;\n this.radioElement._inputElement.nativeElement.click();\n this._isProcessingClick = false;\n }\n }\n /**\n * Determines whether the radio button is disabled.\n * Default: false.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() disabled = false;\n\n /**\n * Determines whether the radio button is checked.\n * Default: false.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n //@Input() selected = false;\n\n _selected = false;\n @Input()\n get selected() {\n return this._selected;\n }\n set selected(selected: boolean) {\n this._selected = selected;\n }\n\n /**\n * Determines whether the radio button can be unchecked.\n * Default: false.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() allowUnselect = false;\n\n /**\n * Determines the radio button color.\n * Default: Test Gorilla primary color.\n *\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @HostBinding('style.--color')\n @Input()\n companyColor: string | null = null;\n\n /**\n * Used to group radios for unique selection.\n *\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() name = '';\n\n /**\n * Text content will be applied to the input element if present.\n *\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() label = '';\n\n /**\n * Determines whether the radio button is a multiple choice cell.\n * Default: false\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() multiple = false;\n\n /**\n * Renders the radio button as a media card. The image/video/gif passed via\n * the `[radio-media]` content slot fills the card and the radio + label sit\n * on top, in the bottom-left, with a dark scrim for contrast.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() mediaCard = false;\n\n /**\n * Determines value of the radio button.\n * Default: false\n *\n * @type {any}\n * @memberof RadioButtonComponent\n */\n @Input() value: unknown;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof RadioButtonComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() ariaLabel: string;\n\n @Input() testId: string | null = null;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() ariaRequired = false;\n\n /**\n * Defines if checkbox has error\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() hasError = false;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() ariaLabelledby = '';\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof RadioButtonComponent\n */\n @Input() ariaDescribedby = '';\n\n /**\n * Truncate text if it is too long\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() truncateText = false;\n\n /**\n * Text alignment\n * @type {'center' | 'top'}\n * @memberof RadioButtonComponent\n */\n @Input() alignment: Alignment = 'center';\n\n /**\n * Sets the tab index for the checkbox component.\n * This determines the order in which elements receive focus when the user navigates through them using the Tab key.\n * Default value is 0.\n *\n * @type {number}\n * @memberof RadioButtonComponent\n */\n @Input() tabIndex = 0;\n\n /**\n * Show tooltip when label is truncated\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Input() hideTooltipOnEllipsis = false;\n\n /**\n * Event emitted when the checked state of the radio button changes.\n *\n * @type {boolean}\n * @memberof RadioButtonComponent\n */\n @Output() changeRadio = new EventEmitter<RadioButtonEventType>();\n\n classMultiple: string;\n showTooltip = false;\n protected origin: string | null = null;\n\n @ViewChild('radio') radioElement: MatRadioButton;\n\n private appliedTestId: string | null = null;\n @ViewChild('tooltip') tooltipElement: MatTooltip;\n\n private readonly defaultAppTheme = inject(\n 'CANOPYUI_DEFAULT_APPLICATION_THEME' as unknown as ProviderToken<ApplicationTheme>,\n {\n optional: true,\n }\n );\n public ngControl = inject(NgControl, { optional: true, self: true });\n public hostNgControl = inject(NgControl, { optional: true, host: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly ngZone = inject(NgZone);\n private readonly cdr = inject(ChangeDetectorRef);\n\n constructor() {\n if (this.defaultAppTheme) {\n this.applicationTheme = this.defaultAppTheme;\n }\n\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit() {\n this.checkHost();\n this.classMultiple = this.setClass();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['selected']) {\n this.classMultiple = this.setClass();\n }\n this.setCompanyColor();\n this.applyTestId();\n }\n\n // MatRadioButton takes no attribute passthrough, so the id is set on the native input directly.\n private applyTestId(): void {\n if (!this.radioElement || this.testId === this.appliedTestId) {\n return;\n }\n const radioNativeInput = this.radioElement._inputElement.nativeElement;\n if (this.testId) {\n radioNativeInput.setAttribute('data-testid', this.testId);\n } else {\n radioNativeInput.removeAttribute('data-testid');\n }\n this.appliedTestId = this.testId;\n }\n\n ngAfterViewInit() {\n this.radioElement._inputElement.nativeElement.setAttribute('role', 'radio');\n this.applyTestId();\n this.radioElement._inputElement.nativeElement.onclick = () => {\n this.clickRadio();\n };\n\n this.focusMonitor\n .monitor(this.radioElement._inputElement.nativeElement)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(origin =>\n this.ngZone.run(() => {\n this.origin = origin;\n this.cdr.markForCheck();\n this.onFocus(origin === 'keyboard');\n })\n );\n }\n\n ngOnDestroy(): void {\n this.focusMonitor.stopMonitoring(this.radioElement._inputElement.nativeElement);\n }\n\n //Click method\n clickRadio() {\n if (this.allowUnselect) {\n this.radioElement.checked = !this.radioElement.checked;\n this._selected = this.radioElement.checked;\n this.classMultiple = this.setClass();\n this.selected = this.radioElement.checked;\n this.changeRadio?.emit({\n optionName: this.radioElement.value as string,\n optionChecked: this.radioElement.checked,\n });\n } else {\n if (!this.hostNgControl) {\n this.selected = true;\n }\n this.changeRadio.emit({ optionName: this.radioElement.value as string, optionChecked: true });\n }\n if (this.disabled) {\n this._selected = false;\n this.changeRadio.emit({ optionName: '', optionChecked: false });\n }\n this.onChange(this._selected);\n }\n\n writeValue(value: unknown): void {\n if (typeof value === 'boolean' || value === this.value) {\n this.selected = value as boolean;\n }\n // The forms API calls this from outside the component's own change\n // detection — under OnPush the view must be marked explicitly.\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n\n onChange: (value: boolean) => void = () => {};\n\n /**\n * @ignore\n */\n onTouch = () => {};\n\n //Set class for multiple radio\n setClass(): string {\n if (this.multiple) {\n return this._selected ? 'multiple-checked' : 'multiple-unchecked';\n }\n return '';\n }\n\n onLabelEllipsisChange(isEllipsis: boolean): void {\n this.showTooltip = isEllipsis && !this.hideTooltipOnEllipsis;\n }\n\n private checkHost(): void {\n if (this.hostNgControl) {\n this.selected = this.value === this.hostNgControl.value;\n this.hostNgControl.valueChanges?.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(value => {\n this.selected = value === this.value;\n this.classMultiple = this.setClass();\n });\n }\n }\n\n private setCompanyColor(): void {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- empty companyColor falls back to the theme colour\n this.companyColor = this.companyColor\n ? this.companyColor\n : this.applicationTheme === 'classic'\n ? '#46A997'\n : '#D410AA';\n }\n\n onFocus(isFocus: boolean): void {\n setTimeout(() => {\n if (this.tooltipElement) {\n if (this.showTooltip && isFocus) {\n this.tooltipElement.show();\n } else {\n this.tooltipElement.hide();\n }\n }\n }, 0);\n }\n\n focus(): void {\n this.radioElement.focus();\n }\n}\n","<div\n #radioContainer\n tabindex=\"0\"\n [class]=\"multiple ? 'radio-container' : 'radio'\"\n [class.multiple-disabled]=\"disabled && multiple\"\n [class.media-card]=\"mediaCard\"\n [class.media-card-selected]=\"mediaCard && selected\"\n [ngClass]=\"classMultiple\"\n [attr.alignment]=\"alignment\"\n [attr.truncate-text]=\"truncateText\"\n [attr.theme]=\"applicationTheme\"\n [attr.hasError]=\"hasError\"\n (keydown.enter)=\"clickRadio(); radioContainer.focus()\"\n (keydown.space)=\"clickRadio(); radioContainer.focus()\"\n>\n @if (mediaCard) {\n <div class=\"media-card-wrapper\" aria-hidden=\"true\">\n <ng-content select=\"[radio-media]\"></ng-content>\n </div>\n }\n <mat-radio-button\n #radio\n [checked]=\"selected\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [value]=\"value\"\n class=\"radio-button\"\n [required]=\"ariaRequired\"\n [aria-label]=\"ariaLabel\"\n [aria-labelledby]=\"ariaLabelledby ? ariaLabelledby : label\"\n [aria-describedby]=\"ariaDescribedby\"\n (keydown.enter)=\"$event.preventDefault()\"\n (keydown.space)=\"$event.preventDefault()\"\n [tabIndex]=\"tabIndex\"\n >\n @if (label) {\n <span\n #tooltip=\"matTooltip\"\n class=\"label\"\n uiEllipseText\n (onChangeTextState)=\"onLabelEllipsisChange($event)\"\n [matTooltip]=\"showTooltip ? label : ''\"\n [matTooltipClass]=\"applicationTheme\"\n >{{ label }}</span\n >\n }\n <ng-content select=\"[radio-label]\"></ng-content>\n </mat-radio-button>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { FocusVisibleDirective } from '@testgorilla/tgo-ui/components/checkbox';\nimport { EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\n\nimport { RadioButtonComponent } from './radio-button.component';\n\n@NgModule({\n imports: [\n CommonModule,\n MatRadioModule,\n FormsModule,\n ReactiveFormsModule,\n MatInputModule,\n EllipseTextDirective,\n MatTooltipModule,\n MatCheckboxModule,\n FocusVisibleDirective,\n RadioButtonComponent,\n ],\n exports: [RadioButtonComponent],\n})\nexport class RadioButtonComponentModule {}\n"],"mappings":";;;;;;;;;;;;AAkDA,IAAa,uBAAb,MAAa,qBAAoB;CAI/B,YAAY,OAAiB;EAC3B,IAAI,KAAK,oBACP;EAEF,MAAM,SAAS,MAAM;EACrB,MAAM,gBAAwB,QAAQ,WAAW,SAAS;EAC1D,MAAM,gBAAgB,KAAK,aAAa,QAAQ,UAAU,qBAAqB;EAC/E,IAAI,cAAc,SAAS,sBAAsB,KAAK,cAAc,SAAS,gBAAgB,KAAK,eAAe;GAC/G,KAAK,qBAAqB;GAC1B,KAAK,aAAa,cAAc,cAAc,MAAK;GACnD,KAAK,qBAAqB;EAC5B;CACF;CAoBA,IACI,WAAQ;EACV,OAAO,KAAK;CACd;CACA,IAAI,SAAS,UAAiB;EAC5B,KAAK,YAAY;CACnB;CAkLA,cAAA;EA3NQ,KAAA,q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ACA;IAEA;IACA;IAEA;GAAoB;EAAA,CAAA;CAAA;;AAIX,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA0B,YAAA,CAAA;EAftC,MAAA;EAAS,MAAA,CAAA;GACR,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GACD,SAAS,CAAC,oBAAoB;EAC/B,CAAA"}
@@ -1,151 +1,227 @@
1
- import { NgClass, NgStyle, CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Pipe, EventEmitter, Output, Input, Optional, Inject, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
- import { MatInputModule } from '@angular/material/input';
5
-
6
- class HalfStarPipe {
7
- /**
8
- * @description Used to indicate whether display half-star icon.
9
- * Returns true if the rounded value of the current element
10
- * is equal to it's index, and value is not integer (e.g. index = 4, value = 3.5),
11
- * @param index the index of the current element
12
- * @param value the value of the current element
13
- */
14
- transform(index, value) {
15
- return Math.ceil(value) === index && !Number.isInteger(value);
16
- }
17
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: HalfStarPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
18
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: HalfStarPipe, isStandalone: true, name: "halfStar" }); }
19
- }
20
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: HalfStarPipe, decorators: [{
21
- type: Pipe,
22
- args: [{ name: 'halfStar' }]
23
- }] });
24
-
25
- class RatingComponent {
26
- itemTestId(item) {
27
- return this.testId ? `${this.testId}-${item + 1}` : null;
28
- }
29
- set length(length) {
30
- this.items = Array(Math.max(length, this.MIN_LENGTH))
31
- .fill(0)
32
- .map((x, i) => i);
33
- }
34
- constructor(defaultAppTheme) {
35
- this.defaultAppTheme = defaultAppTheme;
36
- this.MIN_LENGTH = 0;
37
- this.DEFAULT_LENGTH = 5;
38
- this.items = [];
39
- /**
40
- *
41
- * Defines the application theme where accordion is used
42
- *
43
- * @type {ApplicationTheme}
44
- * @memberof AccordionComponent
45
- */
46
- this.applicationTheme = 'light';
47
- /**
48
- * The theme of the rating component. Defaults "block".
49
- * @type {RatingComponentTheme}
50
- * @memberof RatingComponent
51
- */
52
- this.theme = 'block';
53
- /**
54
- * A flag indicating whether the rating component is disabled.
55
- * @type {boolean}
56
- * @memberof RatingComponent
57
- */
58
- this.disabled = false;
59
- this.testId = null;
60
- /**
61
- * A string representing the ARIA requirement for accessibility.
62
- * This attribute is used to indicate whether an input field is required for form submission.
63
- * @type {boolean}
64
- * @memberof RatingComponent
65
- */
66
- this.ariaRequired = false;
67
- /**
68
- * The width of the rating bar.
69
- * @type {number}
70
- * @memberof RatingComponent
71
- */
72
- this.barWidth = 35;
73
- /**
74
- * A flag indicating whether the rating can be unselected by clicking on the same value.
75
- * When false, clicking on the same value will not change the rating.
76
- * @type {boolean}
77
- * @memberof RatingComponent
78
- */
79
- this.canUnselect = true;
80
- this.valueChange = new EventEmitter();
81
- if (defaultAppTheme) {
82
- this.applicationTheme = defaultAppTheme;
83
- }
84
- this.length = this.DEFAULT_LENGTH;
85
- }
86
- select(index) {
87
- const newValue = index + 1;
88
- // If canUnselect is false and we're clicking on the same value, don't change anything
89
- if (!this.canUnselect && this.value === newValue) {
90
- return;
91
- }
92
- this.value = this.value === newValue ? 0 : newValue;
93
- this.valueChange.emit(this.value);
94
- }
95
- onHover(index) {
96
- this.hoverIndex = index + 1;
97
- }
98
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RatingComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
99
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: RatingComponent, isStandalone: true, selector: "ui-rating", inputs: { applicationTheme: "applicationTheme", value: "value", theme: "theme", disabled: "disabled", ariaLabel: "ariaLabel", testId: "testId", ariaRequired: "ariaRequired", barWidth: "barWidth", canUnselect: "canUnselect", length: "length" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div\n class=\"rating\"\n (mouseleave)=\"onHover(-1)\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-required]=\"ariaRequired\"\n [attr.data-testid]=\"testId\"\n>\n @if (theme === 'block') {\n @for (item of items; track item) {\n <div\n class=\"rating-item\"\n [attr.theme]=\"applicationTheme\"\n tabindex=\"0\"\n (click)=\"select(item)\"\n (keydown.enter)=\"select(item)\"\n (mouseenter)=\"onHover(item)\"\n [ngClass]=\"{ 'rating-item-selected': item < value, 'rating-item-hover': item < hoverIndex }\"\n [ngStyle]=\"{ 'width.px': barWidth }\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n } @else {\n <div class=\"star-container\" [attr.theme]=\"applicationTheme\">\n @for (item of items; track item; let i = $index) {\n <div\n #star\n class=\"star\"\n tabindex=\"0\"\n [tabIndex]=\"0\"\n (mouseenter)=\"onHover(item)\"\n (mouseleave)=\"onHover(-1)\"\n [ngClass]=\"{\n filled: value > i,\n hover: item < hoverIndex && (value ? item >= value : true),\n disabled,\n 'filled-half': i + 1 | halfStar: value,\n }\"\n (click)=\"select(item); star.blur()\"\n (keydown.enter)=\"select(item); star.blur()\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n </div>\n }\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.rating{display:flex;align-content:center;justify-content:flex-start;align-items:center}.rating-item{width:35px;height:16px;border:1px solid #e0e0e0;border-left:0;cursor:pointer}.rating-item-hover{border:0;background-color:#b5ddd5}.rating-item-hover[theme=dark],.rating-item-hover[theme=light]{background-color:color-mix(in srgb,var(--ui-rating-color, #d410aa) 40%,#fff)}.rating-item-hover:not(:first-child){border-left:1px solid #ffffff}.rating-item:first-child{border-radius:4px 0 0 4px}.rating-item:first-child:not(.rating-item-selected):not(.rating-item-hover){border-left:1px solid #e0e0e0}.rating-item:last-child{border-radius:0 4px 4px 0}.rating-item:first-child:last-child{border-radius:4px}.rating-item-selected{border:0;background-color:#46a997}.rating-item-selected[theme=dark],.rating-item-selected[theme=light]{background-color:var(--ui-rating-color, #d410aa)}.rating-item-selected:not(:first-child){border-left:1px solid #ffffff}.rating .star-container{display:flex;flex-direction:row;min-height:24px}.rating .star-container .star{width:24px;height:24px;background:url(/icons/rating-icons/Star-outline.svg) no-repeat center;background-size:100%;margin-right:4px}.rating .star-container .star:last-child{margin-right:0}.rating .star-container .star:focus{outline:1px dashed #888888}.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus{opacity:.5}.rating .star-container .star.filled-half{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container .star.disabled{pointer-events:none;background-image:url(/icons/rating-icons/Star-filled-disabled.svg)}.rating .star-container .star:active{opacity:1}.rating .star-container .star-filled,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus,.rating .star-container .star.filled,.rating .star-container .star:active{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star,.rating .star-container[theme=light] .star{cursor:pointer;background:url(/icons/rebrand/Review-star-in-line.svg) no-repeat center}.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus{opacity:.5}.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:focus{outline-offset:4px}.rating .star-container[theme=dark] .star.filled-half,.rating .star-container[theme=light] .star.filled-half{background-image:none;-webkit-mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star.disabled,.rating .star-container[theme=light] .star.disabled{background-image:url(/icons/rebrand/Review-star-filled-disabled.svg)}.rating .star-container[theme=dark] .star-filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=dark] .star:active,.rating .star-container[theme=light] .star-filled,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=light] .star:active{background-image:none;-webkit-mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: HalfStarPipe, name: "halfStar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
100
- }
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RatingComponent, decorators: [{
102
- type: Component,
103
- args: [{ selector: 'ui-rating', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, NgStyle, HalfStarPipe], template: "<div\n class=\"rating\"\n (mouseleave)=\"onHover(-1)\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-required]=\"ariaRequired\"\n [attr.data-testid]=\"testId\"\n>\n @if (theme === 'block') {\n @for (item of items; track item) {\n <div\n class=\"rating-item\"\n [attr.theme]=\"applicationTheme\"\n tabindex=\"0\"\n (click)=\"select(item)\"\n (keydown.enter)=\"select(item)\"\n (mouseenter)=\"onHover(item)\"\n [ngClass]=\"{ 'rating-item-selected': item < value, 'rating-item-hover': item < hoverIndex }\"\n [ngStyle]=\"{ 'width.px': barWidth }\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n } @else {\n <div class=\"star-container\" [attr.theme]=\"applicationTheme\">\n @for (item of items; track item; let i = $index) {\n <div\n #star\n class=\"star\"\n tabindex=\"0\"\n [tabIndex]=\"0\"\n (mouseenter)=\"onHover(item)\"\n (mouseleave)=\"onHover(-1)\"\n [ngClass]=\"{\n filled: value > i,\n hover: item < hoverIndex && (value ? item >= value : true),\n disabled,\n 'filled-half': i + 1 | halfStar: value,\n }\"\n (click)=\"select(item); star.blur()\"\n (keydown.enter)=\"select(item); star.blur()\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n </div>\n }\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.rating{display:flex;align-content:center;justify-content:flex-start;align-items:center}.rating-item{width:35px;height:16px;border:1px solid #e0e0e0;border-left:0;cursor:pointer}.rating-item-hover{border:0;background-color:#b5ddd5}.rating-item-hover[theme=dark],.rating-item-hover[theme=light]{background-color:color-mix(in srgb,var(--ui-rating-color, #d410aa) 40%,#fff)}.rating-item-hover:not(:first-child){border-left:1px solid #ffffff}.rating-item:first-child{border-radius:4px 0 0 4px}.rating-item:first-child:not(.rating-item-selected):not(.rating-item-hover){border-left:1px solid #e0e0e0}.rating-item:last-child{border-radius:0 4px 4px 0}.rating-item:first-child:last-child{border-radius:4px}.rating-item-selected{border:0;background-color:#46a997}.rating-item-selected[theme=dark],.rating-item-selected[theme=light]{background-color:var(--ui-rating-color, #d410aa)}.rating-item-selected:not(:first-child){border-left:1px solid #ffffff}.rating .star-container{display:flex;flex-direction:row;min-height:24px}.rating .star-container .star{width:24px;height:24px;background:url(/icons/rating-icons/Star-outline.svg) no-repeat center;background-size:100%;margin-right:4px}.rating .star-container .star:last-child{margin-right:0}.rating .star-container .star:focus{outline:1px dashed #888888}.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus{opacity:.5}.rating .star-container .star.filled-half{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container .star.disabled{pointer-events:none;background-image:url(/icons/rating-icons/Star-filled-disabled.svg)}.rating .star-container .star:active{opacity:1}.rating .star-container .star-filled,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus,.rating .star-container .star.filled,.rating .star-container .star:active{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star,.rating .star-container[theme=light] .star{cursor:pointer;background:url(/icons/rebrand/Review-star-in-line.svg) no-repeat center}.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus{opacity:.5}.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:focus{outline-offset:4px}.rating .star-container[theme=dark] .star.filled-half,.rating .star-container[theme=light] .star.filled-half{background-image:none;-webkit-mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star.disabled,.rating .star-container[theme=light] .star.disabled{background-image:url(/icons/rebrand/Review-star-filled-disabled.svg)}.rating .star-container[theme=dark] .star-filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=dark] .star:active,.rating .star-container[theme=light] .star-filled,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=light] .star:active{background-image:none;-webkit-mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}\n"] }]
104
- }], ctorParameters: () => [{ type: undefined, decorators: [{
105
- type: Optional
106
- }, {
107
- type: Inject,
108
- args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
109
- }] }], propDecorators: { applicationTheme: [{
110
- type: Input
111
- }], value: [{
112
- type: Input
113
- }], theme: [{
114
- type: Input
115
- }], disabled: [{
116
- type: Input
117
- }], ariaLabel: [{
118
- type: Input
119
- }], testId: [{
120
- type: Input
121
- }], ariaRequired: [{
122
- type: Input
123
- }], barWidth: [{
124
- type: Input
125
- }], canUnselect: [{
126
- type: Input
127
- }], length: [{
128
- type: Input
129
- }], valueChange: [{
130
- type: Output
131
- }] } });
132
-
133
- class RatingComponentModule {
134
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RatingComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
135
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: RatingComponentModule, imports: [CommonModule, MatInputModule, RatingComponent, HalfStarPipe], exports: [RatingComponent] }); }
136
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RatingComponentModule, imports: [CommonModule, MatInputModule] }); }
137
- }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RatingComponentModule, decorators: [{
139
- type: NgModule,
140
- args: [{
141
- imports: [CommonModule, MatInputModule, RatingComponent, HalfStarPipe],
142
- exports: [RatingComponent],
143
- }]
144
- }] });
145
-
146
- /**
147
- * Generated bundle index. Do not edit.
148
- */
149
-
1
+ import { CommonModule, NgClass, NgStyle } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, NgModule, Optional, Output, Pipe } from "@angular/core";
4
+ import { MatInputModule } from "@angular/material/input";
5
+ var HalfStarPipe = class HalfStarPipe {
6
+ transform(index, value) {
7
+ return Math.ceil(value) === index && !Number.isInteger(value);
8
+ }
9
+ static {
10
+ this.ɵfac = i0.ɵɵngDeclareFactory({
11
+ minVersion: "12.0.0",
12
+ version: "22.2.4",
13
+ ngImport: i0,
14
+ type: HalfStarPipe,
15
+ deps: [],
16
+ target: i0.ɵɵFactoryTarget.Pipe
17
+ });
18
+ }
19
+ static {
20
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
21
+ minVersion: "14.0.0",
22
+ version: "22.2.4",
23
+ ngImport: i0,
24
+ type: HalfStarPipe,
25
+ isStandalone: true,
26
+ name: "halfStar"
27
+ });
28
+ }
29
+ };
30
+ i0.ɵɵngDeclareClassMetadata({
31
+ minVersion: "12.0.0",
32
+ version: "22.2.4",
33
+ ngImport: i0,
34
+ type: HalfStarPipe,
35
+ decorators: [{
36
+ type: Pipe,
37
+ args: [{ name: "halfStar" }]
38
+ }]
39
+ });
40
+ var RatingComponent = class RatingComponent {
41
+ itemTestId(item) {
42
+ return this.testId ? `${this.testId}-${item + 1}` : null;
43
+ }
44
+ set length(length) {
45
+ this.items = Array(Math.max(length, this.MIN_LENGTH)).fill(0).map((x, i) => i);
46
+ }
47
+ constructor(defaultAppTheme) {
48
+ this.defaultAppTheme = defaultAppTheme;
49
+ this.MIN_LENGTH = 0;
50
+ this.DEFAULT_LENGTH = 5;
51
+ this.items = [];
52
+ this.applicationTheme = "light";
53
+ this.theme = "block";
54
+ this.disabled = false;
55
+ this.testId = null;
56
+ this.ariaRequired = false;
57
+ this.barWidth = 35;
58
+ this.canUnselect = true;
59
+ this.valueChange = new EventEmitter();
60
+ if (defaultAppTheme) this.applicationTheme = defaultAppTheme;
61
+ this.length = this.DEFAULT_LENGTH;
62
+ }
63
+ select(index) {
64
+ const newValue = index + 1;
65
+ if (!this.canUnselect && this.value === newValue) return;
66
+ this.value = this.value === newValue ? 0 : newValue;
67
+ this.valueChange.emit(this.value);
68
+ }
69
+ onHover(index) {
70
+ this.hoverIndex = index + 1;
71
+ }
72
+ static {
73
+ this.ɵfac = i0.ɵɵngDeclareFactory({
74
+ minVersion: "12.0.0",
75
+ version: "22.2.4",
76
+ ngImport: i0,
77
+ type: RatingComponent,
78
+ deps: [{
79
+ token: "CANOPYUI_DEFAULT_APPLICATION_THEME",
80
+ optional: true
81
+ }],
82
+ target: i0.ɵɵFactoryTarget.Component
83
+ });
84
+ }
85
+ static {
86
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
87
+ minVersion: "17.0.0",
88
+ version: "22.2.4",
89
+ type: RatingComponent,
90
+ isStandalone: true,
91
+ selector: "ui-rating",
92
+ inputs: {
93
+ applicationTheme: "applicationTheme",
94
+ value: "value",
95
+ theme: "theme",
96
+ disabled: "disabled",
97
+ ariaLabel: "ariaLabel",
98
+ testId: "testId",
99
+ ariaRequired: "ariaRequired",
100
+ barWidth: "barWidth",
101
+ canUnselect: "canUnselect",
102
+ length: "length"
103
+ },
104
+ outputs: { valueChange: "valueChange" },
105
+ ngImport: i0,
106
+ template: "<div\n class=\"rating\"\n (mouseleave)=\"onHover(-1)\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-required]=\"ariaRequired\"\n [attr.data-testid]=\"testId\"\n>\n @if (theme === 'block') {\n @for (item of items; track item) {\n <div\n class=\"rating-item\"\n [attr.theme]=\"applicationTheme\"\n tabindex=\"0\"\n (click)=\"select(item)\"\n (keydown.enter)=\"select(item)\"\n (mouseenter)=\"onHover(item)\"\n [ngClass]=\"{ 'rating-item-selected': item < value, 'rating-item-hover': item < hoverIndex }\"\n [ngStyle]=\"{ 'width.px': barWidth }\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n } @else {\n <div class=\"star-container\" [attr.theme]=\"applicationTheme\">\n @for (item of items; track item; let i = $index) {\n <div\n #star\n class=\"star\"\n tabindex=\"0\"\n [tabIndex]=\"0\"\n (mouseenter)=\"onHover(item)\"\n (mouseleave)=\"onHover(-1)\"\n [ngClass]=\"{\n filled: value > i,\n hover: item < hoverIndex && (value ? item >= value : true),\n disabled,\n 'filled-half': i + 1 | halfStar: value,\n }\"\n (click)=\"select(item); star.blur()\"\n (keydown.enter)=\"select(item); star.blur()\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n </div>\n }\n</div>\n",
107
+ styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.rating{display:flex;align-content:center;justify-content:flex-start;align-items:center}.rating-item{width:35px;height:16px;border:1px solid #e0e0e0;border-left:0;cursor:pointer}.rating-item-hover{border:0;background-color:#b5ddd5}.rating-item-hover[theme=dark],.rating-item-hover[theme=light]{background-color:color-mix(in srgb,var(--ui-rating-color, #d410aa) 40%,#fff)}.rating-item-hover:not(:first-child){border-left:1px solid #ffffff}.rating-item:first-child{border-radius:4px 0 0 4px}.rating-item:first-child:not(.rating-item-selected):not(.rating-item-hover){border-left:1px solid #e0e0e0}.rating-item:last-child{border-radius:0 4px 4px 0}.rating-item:first-child:last-child{border-radius:4px}.rating-item-selected{border:0;background-color:#46a997}.rating-item-selected[theme=dark],.rating-item-selected[theme=light]{background-color:var(--ui-rating-color, #d410aa)}.rating-item-selected:not(:first-child){border-left:1px solid #ffffff}.rating .star-container{display:flex;flex-direction:row;min-height:24px}.rating .star-container .star{width:24px;height:24px;background:url(/icons/rating-icons/Star-outline.svg) no-repeat center;background-size:100%;margin-right:4px}.rating .star-container .star:last-child{margin-right:0}.rating .star-container .star:focus{outline:1px dashed #888888}.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus{opacity:.5}.rating .star-container .star.filled-half{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container .star.disabled{pointer-events:none;background-image:url(/icons/rating-icons/Star-filled-disabled.svg)}.rating .star-container .star:active{opacity:1}.rating .star-container .star-filled,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus,.rating .star-container .star.filled,.rating .star-container .star:active{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star,.rating .star-container[theme=light] .star{cursor:pointer;background:url(/icons/rebrand/Review-star-in-line.svg) no-repeat center}.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus{opacity:.5}.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:focus{outline-offset:4px}.rating .star-container[theme=dark] .star.filled-half,.rating .star-container[theme=light] .star.filled-half{background-image:none;-webkit-mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star.disabled,.rating .star-container[theme=light] .star.disabled{background-image:url(/icons/rebrand/Review-star-filled-disabled.svg)}.rating .star-container[theme=dark] .star-filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=dark] .star:active,.rating .star-container[theme=light] .star-filled,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=light] .star:active{background-image:none;-webkit-mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}\n"],
108
+ dependencies: [
109
+ {
110
+ kind: "directive",
111
+ type: NgClass,
112
+ selector: "[ngClass]",
113
+ inputs: ["class", "ngClass"]
114
+ },
115
+ {
116
+ kind: "directive",
117
+ type: NgStyle,
118
+ selector: "[ngStyle]",
119
+ inputs: ["ngStyle"]
120
+ },
121
+ {
122
+ kind: "pipe",
123
+ type: HalfStarPipe,
124
+ name: "halfStar"
125
+ }
126
+ ],
127
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
128
+ });
129
+ }
130
+ };
131
+ i0.ɵɵngDeclareClassMetadata({
132
+ minVersion: "12.0.0",
133
+ version: "22.2.4",
134
+ ngImport: i0,
135
+ type: RatingComponent,
136
+ decorators: [{
137
+ type: Component,
138
+ args: [{
139
+ selector: "ui-rating",
140
+ changeDetection: ChangeDetectionStrategy.OnPush,
141
+ imports: [
142
+ NgClass,
143
+ NgStyle,
144
+ HalfStarPipe
145
+ ],
146
+ template: "<div\n class=\"rating\"\n (mouseleave)=\"onHover(-1)\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-required]=\"ariaRequired\"\n [attr.data-testid]=\"testId\"\n>\n @if (theme === 'block') {\n @for (item of items; track item) {\n <div\n class=\"rating-item\"\n [attr.theme]=\"applicationTheme\"\n tabindex=\"0\"\n (click)=\"select(item)\"\n (keydown.enter)=\"select(item)\"\n (mouseenter)=\"onHover(item)\"\n [ngClass]=\"{ 'rating-item-selected': item < value, 'rating-item-hover': item < hoverIndex }\"\n [ngStyle]=\"{ 'width.px': barWidth }\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n } @else {\n <div class=\"star-container\" [attr.theme]=\"applicationTheme\">\n @for (item of items; track item; let i = $index) {\n <div\n #star\n class=\"star\"\n tabindex=\"0\"\n [tabIndex]=\"0\"\n (mouseenter)=\"onHover(item)\"\n (mouseleave)=\"onHover(-1)\"\n [ngClass]=\"{\n filled: value > i,\n hover: item < hoverIndex && (value ? item >= value : true),\n disabled,\n 'filled-half': i + 1 | halfStar: value,\n }\"\n (click)=\"select(item); star.blur()\"\n (keydown.enter)=\"select(item); star.blur()\"\n [attr.data-testid]=\"itemTestId(item)\"\n ></div>\n }\n </div>\n }\n</div>\n",
147
+ styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.rating{display:flex;align-content:center;justify-content:flex-start;align-items:center}.rating-item{width:35px;height:16px;border:1px solid #e0e0e0;border-left:0;cursor:pointer}.rating-item-hover{border:0;background-color:#b5ddd5}.rating-item-hover[theme=dark],.rating-item-hover[theme=light]{background-color:color-mix(in srgb,var(--ui-rating-color, #d410aa) 40%,#fff)}.rating-item-hover:not(:first-child){border-left:1px solid #ffffff}.rating-item:first-child{border-radius:4px 0 0 4px}.rating-item:first-child:not(.rating-item-selected):not(.rating-item-hover){border-left:1px solid #e0e0e0}.rating-item:last-child{border-radius:0 4px 4px 0}.rating-item:first-child:last-child{border-radius:4px}.rating-item-selected{border:0;background-color:#46a997}.rating-item-selected[theme=dark],.rating-item-selected[theme=light]{background-color:var(--ui-rating-color, #d410aa)}.rating-item-selected:not(:first-child){border-left:1px solid #ffffff}.rating .star-container{display:flex;flex-direction:row;min-height:24px}.rating .star-container .star{width:24px;height:24px;background:url(/icons/rating-icons/Star-outline.svg) no-repeat center;background-size:100%;margin-right:4px}.rating .star-container .star:last-child{margin-right:0}.rating .star-container .star:focus{outline:1px dashed #888888}.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus{opacity:.5}.rating .star-container .star.filled-half{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;mask:url(/icons/rating-icons/Star-half.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container .star.disabled{pointer-events:none;background-image:url(/icons/rating-icons/Star-filled-disabled.svg)}.rating .star-container .star:active{opacity:1}.rating .star-container .star-filled,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container .star:hover,.rating .star-container .star.hover,.rating .star-container .star:focus,.rating .star-container .star.filled,.rating .star-container .star:active{background-image:none;-webkit-mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;mask:url(/icons/rating-icons/Star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star,.rating .star-container[theme=light] .star{cursor:pointer;background:url(/icons/rebrand/Review-star-in-line.svg) no-repeat center}.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus{opacity:.5}.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=light] .star:focus{outline-offset:4px}.rating .star-container[theme=dark] .star.filled-half,.rating .star-container[theme=light] .star.filled-half{background-image:none;-webkit-mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;mask:url(/icons/rebrand/Review-half-star-filled.svg) no-repeat center/100%!important;background-color:var(--ui-rating-color, #d410aa)}.rating .star-container[theme=dark] .star.disabled,.rating .star-container[theme=light] .star.disabled{background-image:url(/icons/rebrand/Review-star-filled-disabled.svg)}.rating .star-container[theme=dark] .star-filled,.rating .star-container[theme=dark] .star:hover,.rating .star-container[theme=dark] .star.hover,.rating .star-container[theme=dark] .star:focus,.rating .star-container[theme=dark] .star.filled,.rating .star-container[theme=dark] .star:active,.rating .star-container[theme=light] .star-filled,.rating .star-container[theme=light] .star:hover,.rating .star-container[theme=light] .star.hover,.rating .star-container[theme=light] .star:focus,.rating .star-container[theme=light] .star.filled,.rating .star-container[theme=light] .star:active{background-image:none;-webkit-mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;mask:url(/icons/rebrand/Review-star-filled.svg) no-repeat center/100%;background-color:var(--ui-rating-color, #d410aa)}\n"]
148
+ }]
149
+ }],
150
+ ctorParameters: () => [{
151
+ type: void 0,
152
+ decorators: [{ type: Optional }, {
153
+ type: Inject,
154
+ args: ["CANOPYUI_DEFAULT_APPLICATION_THEME"]
155
+ }]
156
+ }],
157
+ propDecorators: {
158
+ applicationTheme: [{ type: Input }],
159
+ value: [{ type: Input }],
160
+ theme: [{ type: Input }],
161
+ disabled: [{ type: Input }],
162
+ ariaLabel: [{ type: Input }],
163
+ testId: [{ type: Input }],
164
+ ariaRequired: [{ type: Input }],
165
+ barWidth: [{ type: Input }],
166
+ canUnselect: [{ type: Input }],
167
+ length: [{ type: Input }],
168
+ valueChange: [{ type: Output }]
169
+ }
170
+ });
171
+ var RatingComponentModule = class RatingComponentModule {
172
+ static {
173
+ this.ɵfac = i0.ɵɵngDeclareFactory({
174
+ minVersion: "12.0.0",
175
+ version: "22.2.4",
176
+ ngImport: i0,
177
+ type: RatingComponentModule,
178
+ deps: [],
179
+ target: i0.ɵɵFactoryTarget.NgModule
180
+ });
181
+ }
182
+ static {
183
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
184
+ minVersion: "14.0.0",
185
+ version: "22.2.4",
186
+ ngImport: i0,
187
+ type: RatingComponentModule,
188
+ imports: [
189
+ CommonModule,
190
+ MatInputModule,
191
+ RatingComponent,
192
+ HalfStarPipe
193
+ ],
194
+ exports: [RatingComponent]
195
+ });
196
+ }
197
+ static {
198
+ this.ɵinj = i0.ɵɵngDeclareInjector({
199
+ minVersion: "12.0.0",
200
+ version: "22.2.4",
201
+ ngImport: i0,
202
+ type: RatingComponentModule,
203
+ imports: [CommonModule, MatInputModule]
204
+ });
205
+ }
206
+ };
207
+ i0.ɵɵngDeclareClassMetadata({
208
+ minVersion: "12.0.0",
209
+ version: "22.2.4",
210
+ ngImport: i0,
211
+ type: RatingComponentModule,
212
+ decorators: [{
213
+ type: NgModule,
214
+ args: [{
215
+ imports: [
216
+ CommonModule,
217
+ MatInputModule,
218
+ RatingComponent,
219
+ HalfStarPipe
220
+ ],
221
+ exports: [RatingComponent]
222
+ }]
223
+ }]
224
+ });
150
225
  export { RatingComponent, RatingComponentModule };
151
- //# sourceMappingURL=testgorilla-tgo-ui-components-rating.mjs.map
226
+
227
+ //# sourceMappingURL=testgorilla-tgo-ui-components-rating.mjs.map