@testgorilla/tgo-ui 11.22.3 → 12.0.1

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 (225) 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 -1795
  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/theme/_palette.scss +23 -18
  152. package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
  153. package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
  154. package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
  155. package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
  156. package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
  157. package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
  158. package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
  159. package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
  160. package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
  161. package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
  162. package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
  163. package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
  164. package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
  165. package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
  166. package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
  167. package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
  168. package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
  169. package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
  170. package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
  171. package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
  172. package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
  173. package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
  174. package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
  175. package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
  176. package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
  177. package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
  178. package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
  179. package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
  180. package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
  181. package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
  182. package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
  183. package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
  184. package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
  185. package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
  186. package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
  187. package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
  188. package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
  189. package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
  190. package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
  191. package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
  192. package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
  193. package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
  194. package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
  195. package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
  196. package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
  197. package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
  198. package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
  199. package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
  200. package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
  201. package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
  202. package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
  203. package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
  204. package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
  205. package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
  206. package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
  207. package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
  208. package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
  209. package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
  210. package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
  211. package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
  212. package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
  213. package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
  214. package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
  215. package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
  216. package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
  217. package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
  218. package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
  219. package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
  220. package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
  221. package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
  222. package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
  223. package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
  224. package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
  225. package/types/testgorilla-tgo-ui.d.ts +52 -45
@@ -1,330 +1,456 @@
1
- import { trigger, transition, style, animate } from '@angular/animations';
2
- import { NgClass, AsyncPipe, UpperCasePipe, SlicePipe, CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { Input, Optional, Inject, ChangeDetectionStrategy, Component, Injectable, NgModule } from '@angular/core';
5
- import * as i1 from '@angular/material/snack-bar';
6
- import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
7
- import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
8
- import { ButtonComponent, ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';
9
- import { alertBarsUtil, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';
10
- import * as i2 from '@testgorilla/tgo-ui/components/icon';
11
- import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
12
-
13
- class SnackbarComponent {
14
- /**
15
- * Snackbar message from html
16
- *
17
- * @memberof SnackbarComponent
18
- */
19
- set html(value) {
20
- if (value) {
21
- this.safeHtml = value;
22
- }
23
- }
24
- get dismissButtonTestId() {
25
- return this.testId ? `${this.testId}-dismiss` : null;
26
- }
27
- constructor(defaultAppTheme, data, snackbarRef, cdr) {
28
- this.defaultAppTheme = defaultAppTheme;
29
- this.data = data;
30
- this.snackbarRef = snackbarRef;
31
- this.cdr = cdr;
32
- /**
33
- * Background color of the button while in active state
34
- *
35
- * @type {SnackbarType}
36
- * @memberof SnackbarComponent
37
- */
38
- this.snackbarType = 'success';
39
- /**
40
- * Snackbar message
41
- *
42
- * @memberof SnackbarComponent
43
- */
44
- this.message = '';
45
- /**
46
- * Set the time that the snackbar will be visible
47
- *
48
- * @memberof SnackbarComponent
49
- */
50
- this.seconds = 5;
51
- /**
52
- * Include dismmiss button
53
- *
54
- * @memberof SnackbarComponent
55
- */
56
- this.includeDismissButton = true;
57
- /**
58
- * Static or fixed position
59
- *
60
- * @memberof SnackbarComponent
61
- */
62
- this.fixed = true;
63
- /**
64
- * Link text that will appended at the end of message
65
- *
66
- * @memberof AlertBannerComponent
67
- */
68
- this.linkText = '';
69
- /**
70
- * Link target
71
- *
72
- * @type {@type {LinkTargetType}}
73
- * @memberof AlertBannerComponent
74
- */
75
- this.linkTarget = '_blank';
76
- /**
77
- * The variant to be used
78
- *
79
- * @type {SnackbarVariant}
80
- * @memberof SnackbarComponent
81
- */
82
- this.variant = 'desktop';
83
- /**
84
- *
85
- * Defines the application theme
86
- *
87
- * @type {ApplicationTheme}
88
- * @memberof SnackbarComponent
89
- */
90
- this.applicationTheme = 'light';
91
- /**
92
- * Close button tooltip
93
- *
94
- * @type {string}
95
- * @memberof SnackbarComponent
96
- */
97
- this.closeButtonTooltip = '';
98
- this.testId = null;
99
- /**
100
- * A string representing the ARIA requirement for accessibility.
101
- * This attribute is used to indicate whether an input field is required for form submission.
102
- * @type {string}
103
- * @memberof SnackbarComponent
104
- */
105
- this.ariaDescribedby = '';
106
- this.showSnackbar = true;
107
- this.visible = false;
108
- this.timerStartedAt = 0;
109
- this.timerPausedAt = 0;
110
- this.translationContext = 'SNACKBAR.';
111
- this.maxCharacters = 70;
112
- if (defaultAppTheme) {
113
- this.applicationTheme = defaultAppTheme;
114
- }
115
- this.snackbarType = data.snackbarType ?? 'success';
116
- this.message = data.message ?? '';
117
- this.safeHtml = data.html ?? '';
118
- this.linkText = data.link?.text ?? '';
119
- this.linkUrl = data.link?.url ?? '';
120
- this.seconds = data.seconds ?? 5;
121
- }
122
- ngOnInit() {
123
- this.milisenconds = this.seconds * 1000;
124
- this.iconName = alertBarsUtil.setIcon(this.snackbarType);
125
- this.show();
126
- this.position = alertBarsUtil.setPosition(this.fixed);
127
- }
128
- //Show snackbar
129
- show() {
130
- this.timerStartedAt = Date.now();
131
- this.visible = true;
132
- this.timer = window.setTimeout(() => this.hide(), this.milisenconds);
133
- }
134
- //Hide snackbar
135
- hide() {
136
- this.visible = false;
137
- this.timerPausedAt = 0;
138
- this.timerStartedAt = 0;
139
- clearTimeout(this.timer);
140
- this.timer = undefined;
141
- this.dismissSnackbar();
142
- // `visible` gates the template and this runs from setTimeout.
143
- this.cdr.markForCheck();
144
- }
145
- //Pause timer when mouse enter
146
- onMouseEnter() {
147
- this.visible = true;
148
- this.timerPausedAt = Date.now();
149
- clearTimeout(this.timer);
150
- }
151
- //Continue timer when mouse leave
152
- onMouseLeave() {
153
- const diff = this.timerPausedAt - this.timerStartedAt;
154
- if (diff <= 0) {
155
- return this.hide();
156
- }
157
- this.timer = window.setTimeout(() => this.hide(), this.milisenconds - diff);
158
- }
159
- //Hide snackbar when dismiss button is clicked
160
- dismissClick() {
161
- this.visible = false;
162
- this.dismissSnackbar();
163
- }
164
- onLinkClick(event) {
165
- event?.preventDefault();
166
- if (this.data.link?.action) {
167
- this.data.link?.action();
168
- }
169
- else if (this.data.link?.url) {
170
- window.open(this.data.link?.url, '_blank');
171
- }
172
- }
173
- dismissSnackbar() {
174
- if (Object.keys(this.snackbarRef).length > 0) {
175
- this.snackbarRef.dismiss();
176
- }
177
- }
178
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }, { token: MAT_SNACK_BAR_DATA }, { token: i1.MatSnackBarRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
179
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: SnackbarComponent, isStandalone: true, selector: "ui-snackbar", inputs: { snackbarType: "snackbarType", message: "message", html: "html", seconds: "seconds", includeDismissButton: "includeDismissButton", fixed: "fixed", linkText: "linkText", linkUrl: "linkUrl", linkTarget: "linkTarget", variant: "variant", applicationTheme: "applicationTheme", closeButtonTooltip: "closeButtonTooltip", testId: "testId", ariaDescribedby: "ariaDescribedby" }, ngImport: i0, template: "<ng-container>\n @if (visible) {\n <!-- Kept as role=\"alert\": the E2E suite reads the message through getByRole('alert'). -->\n <div\n [ngClass]=\"snackbarType + ' ' + position\"\n [@openClose]\n class=\"snackbar-container\"\n [attr.theme]=\"applicationTheme\"\n [class.mobile]=\"variant === 'mobile'\"\n [class.desktop]=\"variant === 'desktop'\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n [attr.data-testid]=\"testId ?? 'snackbar-wrapper'\"\n [attr.data-test-snackbar-type]=\"snackbarType\"\n [attr.aria-describedby]=\"'describedby'\"\n role=\"alert\"\n [attr.aria-labelledby]=\"'labelledby'\"\n >\n <span style=\"position: absolute; left: -9999px\" id=\"labelledby\">{{\n 'ALERT_BANNER.' + (snackbarType | uppercase) | uiTranslate | async\n }}</span>\n <span style=\"position: absolute; left: -9999px\"\n >{{ message }}\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </span>\n <span [style.display]=\"'none'\" id=\"describedby\">{{ ariaDescribedby }}</span>\n <div\n aria-hidden=\"true\"\n class=\"snackbar-text\"\n [matTooltip]=\"message.length > maxCharacters ? message : ''\"\n data-testid=\"snackbar-content\"\n >\n @if (applicationTheme === 'classic') {\n <ui-icon [name]=\"iconName\" size=\"24\"></ui-icon>\n }\n {{ message.length > maxCharacters ? (message | slice: 0 : maxCharacters) + '..' : message }}\n @if (safeHtml) {\n <div [innerHTML]=\"safeHtml\"></div>\n }\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </div>\n @if (includeDismissButton && applicationTheme === 'classic') {\n <ui-button\n variant=\"text\"\n [label]=\"(translationContext + 'DISMISS' | uiTranslate | async)!\"\n [applicationTheme]=\"applicationTheme !== 'classic' ? 'light' : 'classic'\"\n (buttonClickEvent)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n @if (includeDismissButton && applicationTheme !== 'classic') {\n <ui-button\n [variant]=\"'icon-button'\"\n [applicationTheme]=\"'light'\"\n [iconName]=\"'Close-in-line'\"\n [size]=\"'small'\"\n [tooltip]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n (click)=\"dismissClick()\"\n [ariaLabel]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n </div>\n }\n</ng-container>\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}:host{display:flex;width:100%;justify-content:center}:host .snackbar-container{max-width:600px}:host .alert-container,:host .snackbar-container{margin:0 auto;display:flex;padding:0 14px;border-radius:4px;align-items:center;justify-content:space-between;opacity:1;min-height:48px}:host .alert-container.fixed,:host .snackbar-container.fixed{position:fixed}:host .alert-container.static,:host .snackbar-container.static{position:relative}:host .alert-container ui-icon,:host .snackbar-container ui-icon{margin-right:14px}:host .alert-container ui-button,:host .snackbar-container ui-button{margin-left:14px}:host .alert-container ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container ::ng-deep button.mat-mdc-unelevated-button.big{padding:0;min-width:auto}:host .alert-container .alert-text,:host .alert-container .snackbar-text,:host .snackbar-container .alert-text,:host .snackbar-container .snackbar-text{display:flex;align-items:center;color:#000}:host .alert-container .alert-text a,:host .alert-container .snackbar-text a,:host .snackbar-container .alert-text a,:host .snackbar-container .snackbar-text a{color:#000;text-decoration:underline;font-weight:700}:host .alert-container .alert-text a:hover,:host .alert-container .alert-text a:visited,:host .alert-container .alert-text a:focus,:host .alert-container .snackbar-text a:hover,:host .alert-container .snackbar-text a:visited,:host .alert-container .snackbar-text a:focus,:host .snackbar-container .alert-text a:hover,:host .snackbar-container .alert-text a:visited,:host .snackbar-container .alert-text a:focus,:host .snackbar-container .snackbar-text a:hover,:host .snackbar-container .snackbar-text a:visited,:host .snackbar-container .snackbar-text a:focus{text-decoration:none}:host .alert-container.success,:host .snackbar-container.success{background-color:#cbd6cb}:host .alert-container.info,:host .snackbar-container.info{background-color:#c8d7de}:host .alert-container.warning,:host .snackbar-container.warning{background-color:#f0d6bb}:host .alert-container.error,:host .snackbar-container.error{background-color:#e3c3c6}:host .alert-container[theme=dark].success,:host .alert-container[theme=light].success,:host .snackbar-container[theme=dark].success,:host .snackbar-container[theme=light].success{background-color:#aae47a}:host .alert-container[theme=dark].info,:host .alert-container[theme=light].info,:host .snackbar-container[theme=dark].info,:host .snackbar-container[theme=light].info{background-color:#d9e8ff}:host .alert-container[theme=dark].warning,:host .alert-container[theme=light].warning,:host .snackbar-container[theme=dark].warning,:host .snackbar-container[theme=light].warning{background-color:#ffe1b3}:host .alert-container[theme=dark].error,:host .alert-container[theme=light].error,:host .snackbar-container[theme=dark].error,:host .snackbar-container[theme=light].error{background-color:#ffac9a}:host .alert-container[theme=dark].ai,:host .alert-container[theme=light].ai,:host .snackbar-container[theme=dark].ai,:host .snackbar-container[theme=light].ai{background-color:#fff2fc;border:1px solid #ffe6fa;padding:12px 16px}:host .alert-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .alert-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big{padding:12px 24px}::ng-deep .display-none{display:none!important}@media(max-width:600px){:host .alert-container,:host .snackbar-container{padding:8px 14px}}:host .snackbar-container{bottom:0;z-index:98}:host .snackbar-container[theme=dark] ui-icon,:host .snackbar-container[theme=light] ui-icon{margin-right:10px;cursor:pointer}:host .snackbar-container[theme=dark] .snackbar-text,:host .snackbar-container[theme=light] .snackbar-text{padding-left:10px;margin-right:8px}:host .snackbar-container[theme=dark] .snackbar-text a,:host .snackbar-container[theme=light] .snackbar-text a{margin-left:4px}:host .snackbar-container[theme=dark].desktop,:host .snackbar-container[theme=light].desktop{border-radius:24px;box-shadow:0 4px 16px #2424240a;width:fit-content;max-width:600px;min-height:48px;line-height:1.4;font-size:14px;padding:16px 24px}:host .snackbar-container[theme=dark].mobile,:host .snackbar-container[theme=light].mobile{width:100%;min-width:100%;word-break:break-word}:host .mat-mdc-snack-bar-container{margin:16px 8px}::ng-deep .mdc-snackbar__surface{height:0}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: IconComponentModule }, { kind: "component", type: i2.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["size", "variant", "label", "iconPosition", "justIcon", "iconName", "trailingIconName", "trailingIconFilled", "disabled", "loading", "loadingWithLabel", "fullWidth", "url", "urlTarget", "value", "tooltip", "isPremium", "type", "companyColor", "buttonBadgeConfig", "applicationTheme", "disabledScaleOnClick", "ariaLabel", "ariaExpanded", "ariaControls", "ariaPressed", "ariaRequired", "ariaLabelledby", "ariaDescribedby", "preventDefault", "hasBackground", "tooltipPosition", "role", "iconFilled", "testId"], outputs: ["buttonClickEvent", "buttonHoverEvent"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: SlicePipe, name: "slice" }, { kind: "pipe", type: UiTranslatePipe, name: "uiTranslate" }], animations: [
180
- trigger('openClose', [
181
- transition(':enter', [
182
- style({ bottom: '-55px', opacity: 0 }),
183
- animate('0.2s ease-out', style({ opacity: 1, bottom: '10px' })),
184
- ]),
185
- transition(':leave', [
186
- style({ bottom: '10px', opacity: 1 }),
187
- animate('0.2s ease-in', style({ bottom: '-55px', opacity: 0 })),
188
- ]),
189
- ]),
190
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
191
- }
192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarComponent, decorators: [{
193
- type: Component,
194
- args: [{ selector: 'ui-snackbar', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
195
- trigger('openClose', [
196
- transition(':enter', [
197
- style({ bottom: '-55px', opacity: 0 }),
198
- animate('0.2s ease-out', style({ opacity: 1, bottom: '10px' })),
199
- ]),
200
- transition(':leave', [
201
- style({ bottom: '10px', opacity: 1 }),
202
- animate('0.2s ease-in', style({ bottom: '-55px', opacity: 0 })),
203
- ]),
204
- ]),
205
- ], imports: [
206
- NgClass,
207
- MatTooltip,
208
- IconComponentModule,
209
- ButtonComponent,
210
- AsyncPipe,
211
- UpperCasePipe,
212
- SlicePipe,
213
- UiTranslatePipe,
214
- ], template: "<ng-container>\n @if (visible) {\n <!-- Kept as role=\"alert\": the E2E suite reads the message through getByRole('alert'). -->\n <div\n [ngClass]=\"snackbarType + ' ' + position\"\n [@openClose]\n class=\"snackbar-container\"\n [attr.theme]=\"applicationTheme\"\n [class.mobile]=\"variant === 'mobile'\"\n [class.desktop]=\"variant === 'desktop'\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n [attr.data-testid]=\"testId ?? 'snackbar-wrapper'\"\n [attr.data-test-snackbar-type]=\"snackbarType\"\n [attr.aria-describedby]=\"'describedby'\"\n role=\"alert\"\n [attr.aria-labelledby]=\"'labelledby'\"\n >\n <span style=\"position: absolute; left: -9999px\" id=\"labelledby\">{{\n 'ALERT_BANNER.' + (snackbarType | uppercase) | uiTranslate | async\n }}</span>\n <span style=\"position: absolute; left: -9999px\"\n >{{ message }}\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </span>\n <span [style.display]=\"'none'\" id=\"describedby\">{{ ariaDescribedby }}</span>\n <div\n aria-hidden=\"true\"\n class=\"snackbar-text\"\n [matTooltip]=\"message.length > maxCharacters ? message : ''\"\n data-testid=\"snackbar-content\"\n >\n @if (applicationTheme === 'classic') {\n <ui-icon [name]=\"iconName\" size=\"24\"></ui-icon>\n }\n {{ message.length > maxCharacters ? (message | slice: 0 : maxCharacters) + '..' : message }}\n @if (safeHtml) {\n <div [innerHTML]=\"safeHtml\"></div>\n }\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </div>\n @if (includeDismissButton && applicationTheme === 'classic') {\n <ui-button\n variant=\"text\"\n [label]=\"(translationContext + 'DISMISS' | uiTranslate | async)!\"\n [applicationTheme]=\"applicationTheme !== 'classic' ? 'light' : 'classic'\"\n (buttonClickEvent)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n @if (includeDismissButton && applicationTheme !== 'classic') {\n <ui-button\n [variant]=\"'icon-button'\"\n [applicationTheme]=\"'light'\"\n [iconName]=\"'Close-in-line'\"\n [size]=\"'small'\"\n [tooltip]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n (click)=\"dismissClick()\"\n [ariaLabel]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n </div>\n }\n</ng-container>\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}:host{display:flex;width:100%;justify-content:center}:host .snackbar-container{max-width:600px}:host .alert-container,:host .snackbar-container{margin:0 auto;display:flex;padding:0 14px;border-radius:4px;align-items:center;justify-content:space-between;opacity:1;min-height:48px}:host .alert-container.fixed,:host .snackbar-container.fixed{position:fixed}:host .alert-container.static,:host .snackbar-container.static{position:relative}:host .alert-container ui-icon,:host .snackbar-container ui-icon{margin-right:14px}:host .alert-container ui-button,:host .snackbar-container ui-button{margin-left:14px}:host .alert-container ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container ::ng-deep button.mat-mdc-unelevated-button.big{padding:0;min-width:auto}:host .alert-container .alert-text,:host .alert-container .snackbar-text,:host .snackbar-container .alert-text,:host .snackbar-container .snackbar-text{display:flex;align-items:center;color:#000}:host .alert-container .alert-text a,:host .alert-container .snackbar-text a,:host .snackbar-container .alert-text a,:host .snackbar-container .snackbar-text a{color:#000;text-decoration:underline;font-weight:700}:host .alert-container .alert-text a:hover,:host .alert-container .alert-text a:visited,:host .alert-container .alert-text a:focus,:host .alert-container .snackbar-text a:hover,:host .alert-container .snackbar-text a:visited,:host .alert-container .snackbar-text a:focus,:host .snackbar-container .alert-text a:hover,:host .snackbar-container .alert-text a:visited,:host .snackbar-container .alert-text a:focus,:host .snackbar-container .snackbar-text a:hover,:host .snackbar-container .snackbar-text a:visited,:host .snackbar-container .snackbar-text a:focus{text-decoration:none}:host .alert-container.success,:host .snackbar-container.success{background-color:#cbd6cb}:host .alert-container.info,:host .snackbar-container.info{background-color:#c8d7de}:host .alert-container.warning,:host .snackbar-container.warning{background-color:#f0d6bb}:host .alert-container.error,:host .snackbar-container.error{background-color:#e3c3c6}:host .alert-container[theme=dark].success,:host .alert-container[theme=light].success,:host .snackbar-container[theme=dark].success,:host .snackbar-container[theme=light].success{background-color:#aae47a}:host .alert-container[theme=dark].info,:host .alert-container[theme=light].info,:host .snackbar-container[theme=dark].info,:host .snackbar-container[theme=light].info{background-color:#d9e8ff}:host .alert-container[theme=dark].warning,:host .alert-container[theme=light].warning,:host .snackbar-container[theme=dark].warning,:host .snackbar-container[theme=light].warning{background-color:#ffe1b3}:host .alert-container[theme=dark].error,:host .alert-container[theme=light].error,:host .snackbar-container[theme=dark].error,:host .snackbar-container[theme=light].error{background-color:#ffac9a}:host .alert-container[theme=dark].ai,:host .alert-container[theme=light].ai,:host .snackbar-container[theme=dark].ai,:host .snackbar-container[theme=light].ai{background-color:#fff2fc;border:1px solid #ffe6fa;padding:12px 16px}:host .alert-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .alert-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big{padding:12px 24px}::ng-deep .display-none{display:none!important}@media(max-width:600px){:host .alert-container,:host .snackbar-container{padding:8px 14px}}:host .snackbar-container{bottom:0;z-index:98}:host .snackbar-container[theme=dark] ui-icon,:host .snackbar-container[theme=light] ui-icon{margin-right:10px;cursor:pointer}:host .snackbar-container[theme=dark] .snackbar-text,:host .snackbar-container[theme=light] .snackbar-text{padding-left:10px;margin-right:8px}:host .snackbar-container[theme=dark] .snackbar-text a,:host .snackbar-container[theme=light] .snackbar-text a{margin-left:4px}:host .snackbar-container[theme=dark].desktop,:host .snackbar-container[theme=light].desktop{border-radius:24px;box-shadow:0 4px 16px #2424240a;width:fit-content;max-width:600px;min-height:48px;line-height:1.4;font-size:14px;padding:16px 24px}:host .snackbar-container[theme=dark].mobile,:host .snackbar-container[theme=light].mobile{width:100%;min-width:100%;word-break:break-word}:host .mat-mdc-snack-bar-container{margin:16px 8px}::ng-deep .mdc-snackbar__surface{height:0}\n"] }]
215
- }], ctorParameters: () => [{ type: undefined, decorators: [{
216
- type: Optional
217
- }, {
218
- type: Inject,
219
- args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
220
- }] }, { type: undefined, decorators: [{
221
- type: Inject,
222
- args: [MAT_SNACK_BAR_DATA]
223
- }] }, { type: i1.MatSnackBarRef }, { type: i0.ChangeDetectorRef }], propDecorators: { snackbarType: [{
224
- type: Input
225
- }], message: [{
226
- type: Input
227
- }], html: [{
228
- type: Input
229
- }], seconds: [{
230
- type: Input
231
- }], includeDismissButton: [{
232
- type: Input
233
- }], fixed: [{
234
- type: Input
235
- }], linkText: [{
236
- type: Input
237
- }], linkUrl: [{
238
- type: Input
239
- }], linkTarget: [{
240
- type: Input
241
- }], variant: [{
242
- type: Input
243
- }], applicationTheme: [{
244
- type: Input
245
- }], closeButtonTooltip: [{
246
- type: Input
247
- }], testId: [{
248
- type: Input
249
- }], ariaDescribedby: [{
250
- type: Input
251
- }] } });
252
-
253
- class SnackbarService {
254
- constructor(snackBar) {
255
- this.snackBar = snackBar;
256
- }
257
- error(message, applicationTheme, html, link, seconds) {
258
- return this.show('error', message, applicationTheme, html, link, seconds);
259
- }
260
- success(message, applicationTheme, html, link, seconds) {
261
- return this.show('success', message, applicationTheme, html, link, seconds);
262
- }
263
- info(message, applicationTheme, html, link, seconds) {
264
- return this.show('info', message, applicationTheme, html, link, seconds);
265
- }
266
- warning(message, applicationTheme, html, link, seconds) {
267
- return this.show('warning', message, applicationTheme, html, link, seconds);
268
- }
269
- // eslint-disable-next-line max-params -- public method signature; options-object refactor is breaking, deferred to the breaking-change MAJOR (see plan)
270
- show(snackbarType, message, applicationTheme, html, link, seconds) {
271
- const componentRef = this.snackBar.openFromComponent(SnackbarComponent, {
272
- data: {
273
- snackbarType,
274
- message,
275
- link,
276
- html,
277
- seconds,
278
- },
279
- });
280
- if (applicationTheme) {
281
- componentRef.instance.applicationTheme = applicationTheme;
282
- }
283
- return componentRef;
284
- }
285
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarService, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable }); }
286
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarService }); }
287
- }
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarService, decorators: [{
289
- type: Injectable
290
- }], ctorParameters: () => [{ type: i1.MatSnackBar }] });
291
-
292
- class SnackbarComponentModule {
293
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
294
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: SnackbarComponentModule, imports: [CommonModule,
295
- ButtonComponentModule,
296
- IconComponentModule,
297
- UiTranslatePipe,
298
- MatSnackBarModule,
299
- MatTooltipModule,
300
- SnackbarComponent], exports: [SnackbarComponent] }); }
301
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarComponentModule, providers: [SnackbarService], imports: [CommonModule,
302
- ButtonComponentModule,
303
- IconComponentModule,
304
- MatSnackBarModule,
305
- MatTooltipModule,
306
- SnackbarComponent] }); }
307
- }
308
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SnackbarComponentModule, decorators: [{
309
- type: NgModule,
310
- args: [{
311
- imports: [
312
- CommonModule,
313
- ButtonComponentModule,
314
- IconComponentModule,
315
- UiTranslatePipe,
316
- MatSnackBarModule,
317
- MatTooltipModule,
318
- SnackbarComponent,
319
- ],
320
- exports: [SnackbarComponent],
321
- providers: [SnackbarService],
322
- }]
323
- }] });
324
-
325
- /**
326
- * Generated bundle index. Do not edit.
327
- */
328
-
1
+ import { animate, style, transition, trigger } from "@angular/animations";
2
+ import { AsyncPipe, CommonModule, NgClass, SlicePipe, UpperCasePipe } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, Inject, Injectable, Input, NgModule, Optional } from "@angular/core";
5
+ import * as i1 from "@angular/material/snack-bar";
6
+ import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from "@angular/material/snack-bar";
7
+ import { MatTooltip, MatTooltipModule } from "@angular/material/tooltip";
8
+ import { ButtonComponent, ButtonComponentModule } from "@testgorilla/tgo-ui/components/button";
9
+ import { UiTranslatePipe, alertBarsUtil } from "@testgorilla/tgo-ui/components/core";
10
+ import * as i2 from "@testgorilla/tgo-ui/components/icon";
11
+ import { IconComponentModule } from "@testgorilla/tgo-ui/components/icon";
12
+ var SnackbarComponent = class SnackbarComponent {
13
+ set html(value) {
14
+ if (value) this.safeHtml = value;
15
+ }
16
+ get dismissButtonTestId() {
17
+ return this.testId ? `${this.testId}-dismiss` : null;
18
+ }
19
+ constructor(defaultAppTheme, data, snackbarRef, cdr) {
20
+ this.defaultAppTheme = defaultAppTheme;
21
+ this.data = data;
22
+ this.snackbarRef = snackbarRef;
23
+ this.cdr = cdr;
24
+ this.snackbarType = "success";
25
+ this.message = "";
26
+ this.seconds = 5;
27
+ this.includeDismissButton = true;
28
+ this.fixed = true;
29
+ this.linkText = "";
30
+ this.linkTarget = "_blank";
31
+ this.variant = "desktop";
32
+ this.applicationTheme = "light";
33
+ this.closeButtonTooltip = "";
34
+ this.testId = null;
35
+ this.ariaDescribedby = "";
36
+ this.showSnackbar = true;
37
+ this.visible = false;
38
+ this.timerStartedAt = 0;
39
+ this.timerPausedAt = 0;
40
+ this.translationContext = "SNACKBAR.";
41
+ this.maxCharacters = 70;
42
+ if (defaultAppTheme) this.applicationTheme = defaultAppTheme;
43
+ this.snackbarType = data.snackbarType ?? "success";
44
+ this.message = data.message ?? "";
45
+ this.safeHtml = data.html ?? "";
46
+ this.linkText = data.link?.text ?? "";
47
+ this.linkUrl = data.link?.url ?? "";
48
+ this.seconds = data.seconds ?? 5;
49
+ }
50
+ ngOnInit() {
51
+ this.milisenconds = this.seconds * 1e3;
52
+ this.iconName = alertBarsUtil.setIcon(this.snackbarType);
53
+ this.show();
54
+ this.position = alertBarsUtil.setPosition(this.fixed);
55
+ }
56
+ show() {
57
+ this.timerStartedAt = Date.now();
58
+ this.visible = true;
59
+ this.timer = window.setTimeout(() => this.hide(), this.milisenconds);
60
+ }
61
+ hide() {
62
+ this.visible = false;
63
+ this.timerPausedAt = 0;
64
+ this.timerStartedAt = 0;
65
+ clearTimeout(this.timer);
66
+ this.timer = void 0;
67
+ this.dismissSnackbar();
68
+ this.cdr.markForCheck();
69
+ }
70
+ onMouseEnter() {
71
+ this.visible = true;
72
+ this.timerPausedAt = Date.now();
73
+ clearTimeout(this.timer);
74
+ }
75
+ onMouseLeave() {
76
+ const diff = this.timerPausedAt - this.timerStartedAt;
77
+ if (diff <= 0) return this.hide();
78
+ this.timer = window.setTimeout(() => this.hide(), this.milisenconds - diff);
79
+ }
80
+ dismissClick() {
81
+ this.visible = false;
82
+ this.dismissSnackbar();
83
+ }
84
+ onLinkClick(event) {
85
+ event?.preventDefault();
86
+ if (this.data.link?.action) this.data.link?.action();
87
+ else if (this.data.link?.url) window.open(this.data.link?.url, "_blank");
88
+ }
89
+ dismissSnackbar() {
90
+ if (Object.keys(this.snackbarRef).length > 0) this.snackbarRef.dismiss();
91
+ }
92
+ static {
93
+ this.ɵfac = i0.ɵɵngDeclareFactory({
94
+ minVersion: "12.0.0",
95
+ version: "22.2.4",
96
+ ngImport: i0,
97
+ type: SnackbarComponent,
98
+ deps: [
99
+ {
100
+ token: "CANOPYUI_DEFAULT_APPLICATION_THEME",
101
+ optional: true
102
+ },
103
+ { token: MAT_SNACK_BAR_DATA },
104
+ { token: i1.MatSnackBarRef },
105
+ { token: i0.ChangeDetectorRef }
106
+ ],
107
+ target: i0.ɵɵFactoryTarget.Component
108
+ });
109
+ }
110
+ static {
111
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
112
+ minVersion: "17.0.0",
113
+ version: "22.2.4",
114
+ type: SnackbarComponent,
115
+ isStandalone: true,
116
+ selector: "ui-snackbar",
117
+ inputs: {
118
+ snackbarType: "snackbarType",
119
+ message: "message",
120
+ html: "html",
121
+ seconds: "seconds",
122
+ includeDismissButton: "includeDismissButton",
123
+ fixed: "fixed",
124
+ linkText: "linkText",
125
+ linkUrl: "linkUrl",
126
+ linkTarget: "linkTarget",
127
+ variant: "variant",
128
+ applicationTheme: "applicationTheme",
129
+ closeButtonTooltip: "closeButtonTooltip",
130
+ testId: "testId",
131
+ ariaDescribedby: "ariaDescribedby"
132
+ },
133
+ ngImport: i0,
134
+ template: "<ng-container>\n @if (visible) {\n <!-- Kept as role=\"alert\": the E2E suite reads the message through getByRole('alert'). -->\n <div\n [ngClass]=\"snackbarType + ' ' + position\"\n [@openClose]\n class=\"snackbar-container\"\n [attr.theme]=\"applicationTheme\"\n [class.mobile]=\"variant === 'mobile'\"\n [class.desktop]=\"variant === 'desktop'\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n [attr.data-testid]=\"testId ?? 'snackbar-wrapper'\"\n [attr.data-test-snackbar-type]=\"snackbarType\"\n [attr.aria-describedby]=\"'describedby'\"\n role=\"alert\"\n [attr.aria-labelledby]=\"'labelledby'\"\n >\n <span style=\"position: absolute; left: -9999px\" id=\"labelledby\">{{\n 'ALERT_BANNER.' + (snackbarType | uppercase) | uiTranslate | async\n }}</span>\n <span style=\"position: absolute; left: -9999px\"\n >{{ message }}\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </span>\n <span [style.display]=\"'none'\" id=\"describedby\">{{ ariaDescribedby }}</span>\n <div\n aria-hidden=\"true\"\n class=\"snackbar-text\"\n [matTooltip]=\"message.length > maxCharacters ? message : ''\"\n data-testid=\"snackbar-content\"\n >\n @if (applicationTheme === 'classic') {\n <ui-icon [name]=\"iconName\" size=\"24\"></ui-icon>\n }\n {{ message.length > maxCharacters ? (message | slice: 0 : maxCharacters) + '..' : message }}\n @if (safeHtml) {\n <div [innerHTML]=\"safeHtml\"></div>\n }\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </div>\n @if (includeDismissButton && applicationTheme === 'classic') {\n <ui-button\n variant=\"text\"\n [label]=\"(translationContext + 'DISMISS' | uiTranslate | async)!\"\n [applicationTheme]=\"applicationTheme !== 'classic' ? 'light' : 'classic'\"\n (buttonClickEvent)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n @if (includeDismissButton && applicationTheme !== 'classic') {\n <ui-button\n [variant]=\"'icon-button'\"\n [applicationTheme]=\"'light'\"\n [iconName]=\"'Close-in-line'\"\n [size]=\"'small'\"\n [tooltip]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n (click)=\"dismissClick()\"\n [ariaLabel]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n </div>\n }\n</ng-container>\n",
135
+ 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}:host{display:flex;width:100%;justify-content:center}:host .snackbar-container{max-width:600px}:host .alert-container,:host .snackbar-container{margin:0 auto;display:flex;padding:0 14px;border-radius:4px;align-items:center;justify-content:space-between;opacity:1;min-height:48px}:host .alert-container.fixed,:host .snackbar-container.fixed{position:fixed}:host .alert-container.static,:host .snackbar-container.static{position:relative}:host .alert-container ui-icon,:host .snackbar-container ui-icon{margin-right:14px}:host .alert-container ui-button,:host .snackbar-container ui-button{margin-left:14px}:host .alert-container ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container ::ng-deep button.mat-mdc-unelevated-button.big{padding:0;min-width:auto}:host .alert-container .alert-text,:host .alert-container .snackbar-text,:host .snackbar-container .alert-text,:host .snackbar-container .snackbar-text{display:flex;align-items:center;color:#000}:host .alert-container .alert-text a,:host .alert-container .snackbar-text a,:host .snackbar-container .alert-text a,:host .snackbar-container .snackbar-text a{color:#000;text-decoration:underline;font-weight:700}:host .alert-container .alert-text a:hover,:host .alert-container .alert-text a:visited,:host .alert-container .alert-text a:focus,:host .alert-container .snackbar-text a:hover,:host .alert-container .snackbar-text a:visited,:host .alert-container .snackbar-text a:focus,:host .snackbar-container .alert-text a:hover,:host .snackbar-container .alert-text a:visited,:host .snackbar-container .alert-text a:focus,:host .snackbar-container .snackbar-text a:hover,:host .snackbar-container .snackbar-text a:visited,:host .snackbar-container .snackbar-text a:focus{text-decoration:none}:host .alert-container.success,:host .snackbar-container.success{background-color:#cbd6cb}:host .alert-container.info,:host .snackbar-container.info{background-color:#c8d7de}:host .alert-container.warning,:host .snackbar-container.warning{background-color:#f0d6bb}:host .alert-container.error,:host .snackbar-container.error{background-color:#e3c3c6}:host .alert-container[theme=dark].success,:host .alert-container[theme=light].success,:host .snackbar-container[theme=dark].success,:host .snackbar-container[theme=light].success{background-color:#aae47a}:host .alert-container[theme=dark].info,:host .alert-container[theme=light].info,:host .snackbar-container[theme=dark].info,:host .snackbar-container[theme=light].info{background-color:#d9e8ff}:host .alert-container[theme=dark].warning,:host .alert-container[theme=light].warning,:host .snackbar-container[theme=dark].warning,:host .snackbar-container[theme=light].warning{background-color:#ffe1b3}:host .alert-container[theme=dark].error,:host .alert-container[theme=light].error,:host .snackbar-container[theme=dark].error,:host .snackbar-container[theme=light].error{background-color:#ffac9a}:host .alert-container[theme=dark].ai,:host .alert-container[theme=light].ai,:host .snackbar-container[theme=dark].ai,:host .snackbar-container[theme=light].ai{background-color:#fff2fc;border:1px solid #ffe6fa;padding:12px 16px}:host .alert-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .alert-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big{padding:12px 24px}::ng-deep .display-none{display:none!important}@media(max-width:600px){:host .alert-container,:host .snackbar-container{padding:8px 14px}}:host .snackbar-container{bottom:0;z-index:98}:host .snackbar-container[theme=dark] ui-icon,:host .snackbar-container[theme=light] ui-icon{margin-right:10px;cursor:pointer}:host .snackbar-container[theme=dark] .snackbar-text,:host .snackbar-container[theme=light] .snackbar-text{padding-left:10px;margin-right:8px}:host .snackbar-container[theme=dark] .snackbar-text a,:host .snackbar-container[theme=light] .snackbar-text a{margin-left:4px}:host .snackbar-container[theme=dark].desktop,:host .snackbar-container[theme=light].desktop{border-radius:24px;box-shadow:0 4px 16px #2424240a;width:fit-content;max-width:600px;min-height:48px;line-height:1.4;font-size:14px;padding:16px 24px}:host .snackbar-container[theme=dark].mobile,:host .snackbar-container[theme=light].mobile{width:100%;min-width:100%;word-break:break-word}:host .mat-mdc-snack-bar-container{margin:16px 8px}::ng-deep .mdc-snackbar__surface{height:0}\n"],
136
+ dependencies: [
137
+ {
138
+ kind: "directive",
139
+ type: NgClass,
140
+ selector: "[ngClass]",
141
+ inputs: ["class", "ngClass"]
142
+ },
143
+ {
144
+ kind: "directive",
145
+ type: MatTooltip,
146
+ selector: "[matTooltip]",
147
+ inputs: [
148
+ "matTooltipPosition",
149
+ "matTooltipPositionAtOrigin",
150
+ "matTooltipDisabled",
151
+ "matTooltipShowDelay",
152
+ "matTooltipHideDelay",
153
+ "matTooltipTouchGestures",
154
+ "matTooltip",
155
+ "matTooltipClass"
156
+ ],
157
+ exportAs: ["matTooltip"]
158
+ },
159
+ {
160
+ kind: "ngmodule",
161
+ type: IconComponentModule
162
+ },
163
+ {
164
+ kind: "component",
165
+ type: i2.IconComponent,
166
+ selector: "ui-icon",
167
+ inputs: [
168
+ "size",
169
+ "cssClass",
170
+ "name",
171
+ "color",
172
+ "filled",
173
+ "toggleIconStyle",
174
+ "applicationTheme",
175
+ "useFullIconName"
176
+ ]
177
+ },
178
+ {
179
+ kind: "component",
180
+ type: ButtonComponent,
181
+ selector: "ui-button",
182
+ inputs: [
183
+ "size",
184
+ "variant",
185
+ "label",
186
+ "iconPosition",
187
+ "justIcon",
188
+ "iconName",
189
+ "trailingIconName",
190
+ "trailingIconFilled",
191
+ "disabled",
192
+ "loading",
193
+ "loadingWithLabel",
194
+ "fullWidth",
195
+ "url",
196
+ "urlTarget",
197
+ "value",
198
+ "tooltip",
199
+ "isPremium",
200
+ "type",
201
+ "companyColor",
202
+ "buttonBadgeConfig",
203
+ "applicationTheme",
204
+ "disabledScaleOnClick",
205
+ "ariaLabel",
206
+ "ariaExpanded",
207
+ "ariaControls",
208
+ "ariaPressed",
209
+ "ariaRequired",
210
+ "ariaLabelledby",
211
+ "ariaDescribedby",
212
+ "preventDefault",
213
+ "hasBackground",
214
+ "tooltipPosition",
215
+ "role",
216
+ "iconFilled",
217
+ "testId"
218
+ ],
219
+ outputs: ["buttonClickEvent", "buttonHoverEvent"]
220
+ },
221
+ {
222
+ kind: "pipe",
223
+ type: AsyncPipe,
224
+ name: "async"
225
+ },
226
+ {
227
+ kind: "pipe",
228
+ type: UpperCasePipe,
229
+ name: "uppercase"
230
+ },
231
+ {
232
+ kind: "pipe",
233
+ type: SlicePipe,
234
+ name: "slice"
235
+ },
236
+ {
237
+ kind: "pipe",
238
+ type: UiTranslatePipe,
239
+ name: "uiTranslate"
240
+ }
241
+ ],
242
+ animations: [trigger("openClose", [transition(":enter", [style({
243
+ bottom: "-55px",
244
+ opacity: 0
245
+ }), animate("0.2s ease-out", style({
246
+ opacity: 1,
247
+ bottom: "10px"
248
+ }))]), transition(":leave", [style({
249
+ bottom: "10px",
250
+ opacity: 1
251
+ }), animate("0.2s ease-in", style({
252
+ bottom: "-55px",
253
+ opacity: 0
254
+ }))])])],
255
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
256
+ });
257
+ }
258
+ };
259
+ i0.ɵɵngDeclareClassMetadata({
260
+ minVersion: "12.0.0",
261
+ version: "22.2.4",
262
+ ngImport: i0,
263
+ type: SnackbarComponent,
264
+ decorators: [{
265
+ type: Component,
266
+ args: [{
267
+ selector: "ui-snackbar",
268
+ changeDetection: ChangeDetectionStrategy.OnPush,
269
+ animations: [trigger("openClose", [transition(":enter", [style({
270
+ bottom: "-55px",
271
+ opacity: 0
272
+ }), animate("0.2s ease-out", style({
273
+ opacity: 1,
274
+ bottom: "10px"
275
+ }))]), transition(":leave", [style({
276
+ bottom: "10px",
277
+ opacity: 1
278
+ }), animate("0.2s ease-in", style({
279
+ bottom: "-55px",
280
+ opacity: 0
281
+ }))])])],
282
+ imports: [
283
+ NgClass,
284
+ MatTooltip,
285
+ IconComponentModule,
286
+ ButtonComponent,
287
+ AsyncPipe,
288
+ UpperCasePipe,
289
+ SlicePipe,
290
+ UiTranslatePipe
291
+ ],
292
+ template: "<ng-container>\n @if (visible) {\n <!-- Kept as role=\"alert\": the E2E suite reads the message through getByRole('alert'). -->\n <div\n [ngClass]=\"snackbarType + ' ' + position\"\n [@openClose]\n class=\"snackbar-container\"\n [attr.theme]=\"applicationTheme\"\n [class.mobile]=\"variant === 'mobile'\"\n [class.desktop]=\"variant === 'desktop'\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n [attr.data-testid]=\"testId ?? 'snackbar-wrapper'\"\n [attr.data-test-snackbar-type]=\"snackbarType\"\n [attr.aria-describedby]=\"'describedby'\"\n role=\"alert\"\n [attr.aria-labelledby]=\"'labelledby'\"\n >\n <span style=\"position: absolute; left: -9999px\" id=\"labelledby\">{{\n 'ALERT_BANNER.' + (snackbarType | uppercase) | uiTranslate | async\n }}</span>\n <span style=\"position: absolute; left: -9999px\"\n >{{ message }}\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </span>\n <span [style.display]=\"'none'\" id=\"describedby\">{{ ariaDescribedby }}</span>\n <div\n aria-hidden=\"true\"\n class=\"snackbar-text\"\n [matTooltip]=\"message.length > maxCharacters ? message : ''\"\n data-testid=\"snackbar-content\"\n >\n @if (applicationTheme === 'classic') {\n <ui-icon [name]=\"iconName\" size=\"24\"></ui-icon>\n }\n {{ message.length > maxCharacters ? (message | slice: 0 : maxCharacters) + '..' : message }}\n @if (safeHtml) {\n <div [innerHTML]=\"safeHtml\"></div>\n }\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </div>\n @if (includeDismissButton && applicationTheme === 'classic') {\n <ui-button\n variant=\"text\"\n [label]=\"(translationContext + 'DISMISS' | uiTranslate | async)!\"\n [applicationTheme]=\"applicationTheme !== 'classic' ? 'light' : 'classic'\"\n (buttonClickEvent)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n @if (includeDismissButton && applicationTheme !== 'classic') {\n <ui-button\n [variant]=\"'icon-button'\"\n [applicationTheme]=\"'light'\"\n [iconName]=\"'Close-in-line'\"\n [size]=\"'small'\"\n [tooltip]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n (click)=\"dismissClick()\"\n [ariaLabel]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n data-testid=\"snackbar-dismiss-button\"\n [testId]=\"dismissButtonTestId\"\n ></ui-button>\n }\n </div>\n }\n</ng-container>\n",
293
+ 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}:host{display:flex;width:100%;justify-content:center}:host .snackbar-container{max-width:600px}:host .alert-container,:host .snackbar-container{margin:0 auto;display:flex;padding:0 14px;border-radius:4px;align-items:center;justify-content:space-between;opacity:1;min-height:48px}:host .alert-container.fixed,:host .snackbar-container.fixed{position:fixed}:host .alert-container.static,:host .snackbar-container.static{position:relative}:host .alert-container ui-icon,:host .snackbar-container ui-icon{margin-right:14px}:host .alert-container ui-button,:host .snackbar-container ui-button{margin-left:14px}:host .alert-container ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container ::ng-deep button.mat-mdc-unelevated-button.big{padding:0;min-width:auto}:host .alert-container .alert-text,:host .alert-container .snackbar-text,:host .snackbar-container .alert-text,:host .snackbar-container .snackbar-text{display:flex;align-items:center;color:#000}:host .alert-container .alert-text a,:host .alert-container .snackbar-text a,:host .snackbar-container .alert-text a,:host .snackbar-container .snackbar-text a{color:#000;text-decoration:underline;font-weight:700}:host .alert-container .alert-text a:hover,:host .alert-container .alert-text a:visited,:host .alert-container .alert-text a:focus,:host .alert-container .snackbar-text a:hover,:host .alert-container .snackbar-text a:visited,:host .alert-container .snackbar-text a:focus,:host .snackbar-container .alert-text a:hover,:host .snackbar-container .alert-text a:visited,:host .snackbar-container .alert-text a:focus,:host .snackbar-container .snackbar-text a:hover,:host .snackbar-container .snackbar-text a:visited,:host .snackbar-container .snackbar-text a:focus{text-decoration:none}:host .alert-container.success,:host .snackbar-container.success{background-color:#cbd6cb}:host .alert-container.info,:host .snackbar-container.info{background-color:#c8d7de}:host .alert-container.warning,:host .snackbar-container.warning{background-color:#f0d6bb}:host .alert-container.error,:host .snackbar-container.error{background-color:#e3c3c6}:host .alert-container[theme=dark].success,:host .alert-container[theme=light].success,:host .snackbar-container[theme=dark].success,:host .snackbar-container[theme=light].success{background-color:#aae47a}:host .alert-container[theme=dark].info,:host .alert-container[theme=light].info,:host .snackbar-container[theme=dark].info,:host .snackbar-container[theme=light].info{background-color:#d9e8ff}:host .alert-container[theme=dark].warning,:host .alert-container[theme=light].warning,:host .snackbar-container[theme=dark].warning,:host .snackbar-container[theme=light].warning{background-color:#ffe1b3}:host .alert-container[theme=dark].error,:host .alert-container[theme=light].error,:host .snackbar-container[theme=dark].error,:host .snackbar-container[theme=light].error{background-color:#ffac9a}:host .alert-container[theme=dark].ai,:host .alert-container[theme=light].ai,:host .snackbar-container[theme=dark].ai,:host .snackbar-container[theme=light].ai{background-color:#fff2fc;border:1px solid #ffe6fa;padding:12px 16px}:host .alert-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .alert-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=dark].ai ::ng-deep button.mat-mdc-unelevated-button.big,:host .snackbar-container[theme=light].ai ::ng-deep button.mat-mdc-unelevated-button.big{padding:12px 24px}::ng-deep .display-none{display:none!important}@media(max-width:600px){:host .alert-container,:host .snackbar-container{padding:8px 14px}}:host .snackbar-container{bottom:0;z-index:98}:host .snackbar-container[theme=dark] ui-icon,:host .snackbar-container[theme=light] ui-icon{margin-right:10px;cursor:pointer}:host .snackbar-container[theme=dark] .snackbar-text,:host .snackbar-container[theme=light] .snackbar-text{padding-left:10px;margin-right:8px}:host .snackbar-container[theme=dark] .snackbar-text a,:host .snackbar-container[theme=light] .snackbar-text a{margin-left:4px}:host .snackbar-container[theme=dark].desktop,:host .snackbar-container[theme=light].desktop{border-radius:24px;box-shadow:0 4px 16px #2424240a;width:fit-content;max-width:600px;min-height:48px;line-height:1.4;font-size:14px;padding:16px 24px}:host .snackbar-container[theme=dark].mobile,:host .snackbar-container[theme=light].mobile{width:100%;min-width:100%;word-break:break-word}:host .mat-mdc-snack-bar-container{margin:16px 8px}::ng-deep .mdc-snackbar__surface{height:0}\n"]
294
+ }]
295
+ }],
296
+ ctorParameters: () => [
297
+ {
298
+ type: void 0,
299
+ decorators: [{ type: Optional }, {
300
+ type: Inject,
301
+ args: ["CANOPYUI_DEFAULT_APPLICATION_THEME"]
302
+ }]
303
+ },
304
+ {
305
+ type: void 0,
306
+ decorators: [{
307
+ type: Inject,
308
+ args: [MAT_SNACK_BAR_DATA]
309
+ }]
310
+ },
311
+ { type: i1.MatSnackBarRef },
312
+ { type: i0.ChangeDetectorRef }
313
+ ],
314
+ propDecorators: {
315
+ snackbarType: [{ type: Input }],
316
+ message: [{ type: Input }],
317
+ html: [{ type: Input }],
318
+ seconds: [{ type: Input }],
319
+ includeDismissButton: [{ type: Input }],
320
+ fixed: [{ type: Input }],
321
+ linkText: [{ type: Input }],
322
+ linkUrl: [{ type: Input }],
323
+ linkTarget: [{ type: Input }],
324
+ variant: [{ type: Input }],
325
+ applicationTheme: [{ type: Input }],
326
+ closeButtonTooltip: [{ type: Input }],
327
+ testId: [{ type: Input }],
328
+ ariaDescribedby: [{ type: Input }]
329
+ }
330
+ });
331
+ var SnackbarService = class SnackbarService {
332
+ constructor(snackBar) {
333
+ this.snackBar = snackBar;
334
+ }
335
+ error(message, applicationTheme, html, link, seconds) {
336
+ return this.show("error", message, applicationTheme, html, link, seconds);
337
+ }
338
+ success(message, applicationTheme, html, link, seconds) {
339
+ return this.show("success", message, applicationTheme, html, link, seconds);
340
+ }
341
+ info(message, applicationTheme, html, link, seconds) {
342
+ return this.show("info", message, applicationTheme, html, link, seconds);
343
+ }
344
+ warning(message, applicationTheme, html, link, seconds) {
345
+ return this.show("warning", message, applicationTheme, html, link, seconds);
346
+ }
347
+ show(snackbarType, message, applicationTheme, html, link, seconds) {
348
+ const componentRef = this.snackBar.openFromComponent(SnackbarComponent, { data: {
349
+ snackbarType,
350
+ message,
351
+ link,
352
+ html,
353
+ seconds
354
+ } });
355
+ if (applicationTheme) componentRef.instance.applicationTheme = applicationTheme;
356
+ return componentRef;
357
+ }
358
+ static {
359
+ this.ɵfac = i0.ɵɵngDeclareFactory({
360
+ minVersion: "12.0.0",
361
+ version: "22.2.4",
362
+ ngImport: i0,
363
+ type: SnackbarService,
364
+ deps: [{ token: i1.MatSnackBar }],
365
+ target: i0.ɵɵFactoryTarget.Injectable
366
+ });
367
+ }
368
+ static {
369
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
370
+ minVersion: "12.0.0",
371
+ version: "22.2.4",
372
+ ngImport: i0,
373
+ type: SnackbarService
374
+ });
375
+ }
376
+ };
377
+ i0.ɵɵngDeclareClassMetadata({
378
+ minVersion: "12.0.0",
379
+ version: "22.2.4",
380
+ ngImport: i0,
381
+ type: SnackbarService,
382
+ decorators: [{ type: Injectable }],
383
+ ctorParameters: () => [{ type: i1.MatSnackBar }]
384
+ });
385
+ var SnackbarComponentModule = class SnackbarComponentModule {
386
+ static {
387
+ this.ɵfac = i0.ɵɵngDeclareFactory({
388
+ minVersion: "12.0.0",
389
+ version: "22.2.4",
390
+ ngImport: i0,
391
+ type: SnackbarComponentModule,
392
+ deps: [],
393
+ target: i0.ɵɵFactoryTarget.NgModule
394
+ });
395
+ }
396
+ static {
397
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
398
+ minVersion: "14.0.0",
399
+ version: "22.2.4",
400
+ ngImport: i0,
401
+ type: SnackbarComponentModule,
402
+ imports: [
403
+ CommonModule,
404
+ ButtonComponentModule,
405
+ IconComponentModule,
406
+ UiTranslatePipe,
407
+ MatSnackBarModule,
408
+ MatTooltipModule,
409
+ SnackbarComponent
410
+ ],
411
+ exports: [SnackbarComponent]
412
+ });
413
+ }
414
+ static {
415
+ this.ɵinj = i0.ɵɵngDeclareInjector({
416
+ minVersion: "12.0.0",
417
+ version: "22.2.4",
418
+ ngImport: i0,
419
+ type: SnackbarComponentModule,
420
+ providers: [SnackbarService],
421
+ imports: [
422
+ CommonModule,
423
+ ButtonComponentModule,
424
+ IconComponentModule,
425
+ MatSnackBarModule,
426
+ MatTooltipModule,
427
+ SnackbarComponent
428
+ ]
429
+ });
430
+ }
431
+ };
432
+ i0.ɵɵngDeclareClassMetadata({
433
+ minVersion: "12.0.0",
434
+ version: "22.2.4",
435
+ ngImport: i0,
436
+ type: SnackbarComponentModule,
437
+ decorators: [{
438
+ type: NgModule,
439
+ args: [{
440
+ imports: [
441
+ CommonModule,
442
+ ButtonComponentModule,
443
+ IconComponentModule,
444
+ UiTranslatePipe,
445
+ MatSnackBarModule,
446
+ MatTooltipModule,
447
+ SnackbarComponent
448
+ ],
449
+ exports: [SnackbarComponent],
450
+ providers: [SnackbarService]
451
+ }]
452
+ }]
453
+ });
329
454
  export { SnackbarComponent, SnackbarComponentModule, SnackbarService };
330
- //# sourceMappingURL=testgorilla-tgo-ui-components-snackbar.mjs.map
455
+
456
+ //# sourceMappingURL=testgorilla-tgo-ui-components-snackbar.mjs.map