@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,578 +1,1227 @@
1
- import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay';
2
- import { AsyncPipe, NgClass, CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { signal, input, booleanAttribute, output, computed, inject, DestroyRef, effect, viewChild, forwardRef, Input, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
5
- import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
- import { MatTooltip } from '@angular/material/tooltip';
8
- import { debounceTime, fromEvent, map, tap, firstValueFrom } from 'rxjs';
9
- import { BadgeComponent, BadgeComponentModule } from '@testgorilla/tgo-ui/components/badge';
10
- import { ButtonComponent, ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';
11
- import { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';
12
- import { FieldComponent, FieldComponentModule } from '@testgorilla/tgo-ui/components/field';
13
- import { IconComponent, IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
14
- import { OverflowMenuComponent, OverflowMenuComponentModule } from '@testgorilla/tgo-ui/components/overflow-menu';
15
- import { PopoverDirective } from '@testgorilla/tgo-ui/components/popover';
16
- import { SkeletonComponent } from '@testgorilla/tgo-ui/components/skeleton';
17
- import { TagComponent, TagComponentModule } from '@testgorilla/tgo-ui/components/tag';
18
- import { CdkTextareaAutosize } from '@angular/cdk/text-field';
19
- import { CardComponentModule } from '@testgorilla/tgo-ui/components/card';
20
- import { TooltipComponentModule } from '@testgorilla/tgo-ui/components/tooltip';
21
-
22
- /** Throttles outward `ControlValueAccessor` emissions only; the signal write is synchronous. */
1
+ import { CdkConnectedOverlay, CdkOverlayOrigin } from "@angular/cdk/overlay";
2
+ import { AsyncPipe, CommonModule, NgClass } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DestroyRef, Input, NgModule, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal, viewChild } from "@angular/core";
5
+ import { takeUntilDestroyed, toObservable, toSignal } from "@angular/core/rxjs-interop";
6
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
7
+ import { MatTooltip } from "@angular/material/tooltip";
8
+ import { debounceTime, firstValueFrom, fromEvent, map, tap } from "rxjs";
9
+ import { BadgeComponent, BadgeComponentModule } from "@testgorilla/tgo-ui/components/badge";
10
+ import { ButtonComponent, ButtonComponentModule } from "@testgorilla/tgo-ui/components/button";
11
+ import { UiTranslatePipe } from "@testgorilla/tgo-ui/components/core";
12
+ import { FieldComponent, FieldComponentModule } from "@testgorilla/tgo-ui/components/field";
13
+ import { IconComponent, IconComponentModule } from "@testgorilla/tgo-ui/components/icon";
14
+ import { OverflowMenuComponent, OverflowMenuComponentModule } from "@testgorilla/tgo-ui/components/overflow-menu";
15
+ import { PopoverDirective } from "@testgorilla/tgo-ui/components/popover";
16
+ import { SkeletonComponent } from "@testgorilla/tgo-ui/components/skeleton";
17
+ import { TagComponent, TagComponentModule } from "@testgorilla/tgo-ui/components/tag";
18
+ import { CdkTextareaAutosize } from "@angular/cdk/text-field";
19
+ import { CardComponentModule } from "@testgorilla/tgo-ui/components/card";
20
+ import { TooltipComponentModule } from "@testgorilla/tgo-ui/components/tooltip";
23
21
  const INPUT_EMIT_DEBOUNCE_MS = 200;
24
- /** Window after `compositionend` in which an Enter still counts as committing an IME candidate. */
25
22
  const IME_COMMIT_GRACE_MS = 50;
26
- const CHARACTER_COUNT_ANNOUNCE_DEBOUNCE_MS = 1000;
27
- const CHARACTER_COUNT_ANNOUNCE_THRESHOLD = 0.1;
23
+ const CHARACTER_COUNT_ANNOUNCE_DEBOUNCE_MS = 1e3;
24
+ const CHARACTER_COUNT_ANNOUNCE_THRESHOLD = .1;
28
25
  let nextActionsMenuId = 0;
29
- /** `undefined` falls back to the default icon; `null` means no icon. */
30
- const resolveIcon = (icon, fallback) => icon === null ? '' : (icon ?? fallback);
31
- class PromptComponent {
32
- constructor() {
33
- this.disabledState = signal(false, ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
34
- this.tags = input([], ...(ngDevMode ? [{ debugName: "tags" }] : /* istanbul ignore next */ []));
35
- this.actionTag = input(null, ...(ngDevMode ? [{ debugName: "actionTag" }] : /* istanbul ignore next */ []));
36
- /** Tag rendered next to the action tag or file upload button, e.g. "Find similar profile". */
37
- this.secondaryActionTag = input(null, ...(ngDevMode ? [{ debugName: "secondaryActionTag" }] : /* istanbul ignore next */ []));
38
- /**
39
- * Collapses `actionTag` and `secondaryActionTag` behind a Plus button that opens a menu listing
40
- * them; the button turns into a Close button while the menu is open.
41
- */
42
- this.collapseActionTags = input(false, { ...(ngDevMode ? { debugName: "collapseActionTags" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
43
- this.maxCharacters = input(255, ...(ngDevMode ? [{ debugName: "maxCharacters" }] : /* istanbul ignore next */ []));
44
- this.supportedFileTypes = input('', ...(ngDevMode ? [{ debugName: "supportedFileTypes" }] : /* istanbul ignore next */ []));
45
- this.autoClear = input(true, ...(ngDevMode ? [{ debugName: "autoClear" }] : /* istanbul ignore next */ []));
46
- this.showSendButton = input(false, ...(ngDevMode ? [{ debugName: "showSendButton" }] : /* istanbul ignore next */ []));
47
- this.sendButtonDisabled = input(false, { ...(ngDevMode ? { debugName: "sendButtonDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
48
- this.enableFileUpload = input(false, ...(ngDevMode ? [{ debugName: "enableFileUpload" }] : /* istanbul ignore next */ []));
49
- this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
50
- /**
51
- * Placeholder for the prompt.
52
- */
53
- this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
54
- /**
55
- * Custom error message displayed below the prompt.
56
- */
57
- this.errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
58
- /** Items for the built-in dropdown; opens on focus, filters by label as the user types. */
59
- this.dropdownItems = input([], ...(ngDevMode ? [{ debugName: "dropdownItems" }] : /* istanbul ignore next */ []));
60
- this.dropdownHeading = input('', ...(ngDevMode ? [{ debugName: "dropdownHeading" }] : /* istanbul ignore next */ []));
61
- this.showDropdownClose = input(false, { ...(ngDevMode ? { debugName: "showDropdownClose" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
62
- /**
63
- * Whether to display a live `used / max` character count in the footer.
64
- */
65
- this.showCharacterCount = input(false, { ...(ngDevMode ? { debugName: "showCharacterCount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
66
- /**
67
- * Lighter hint rendered right after the typed text to flag what is still missing, e.g. "Add location".
68
- * Display-only: it is never inserted into the value, and Tab does not accept it.
69
- */
70
- this.helpText = input('', ...(ngDevMode ? [{ debugName: "helpText" }] : /* istanbul ignore next */ []));
71
- this.promptData = output();
72
- this.actionTagFileSelected = output();
73
- this.secondaryActionTagPress = output();
74
- this.dropdownItemSelected = output();
75
- this.dropdownClosed = output();
76
- this.promptFilesList = signal([], ...(ngDevMode ? [{ debugName: "promptFilesList" }] : /* istanbul ignore next */ []));
77
- this.promptTextValue = signal('', ...(ngDevMode ? [{ debugName: "promptTextValue" }] : /* istanbul ignore next */ []));
78
- this.fileListMenuConfig = signal([], ...(ngDevMode ? [{ debugName: "fileListMenuConfig" }] : /* istanbul ignore next */ []));
79
- this.tagsVisible = signal([], ...(ngDevMode ? [{ debugName: "tagsVisible" }] : /* istanbul ignore next */ []));
80
- this.tagsInDropdown = signal([], ...(ngDevMode ? [{ debugName: "tagsInDropdown" }] : /* istanbul ignore next */ []));
81
- this.autocompleteSuggestion = signal('', ...(ngDevMode ? [{ debugName: "autocompleteSuggestion" }] : /* istanbul ignore next */ []));
82
- this.isDropdownOpened = signal(false, ...(ngDevMode ? [{ debugName: "isDropdownOpened" }] : /* istanbul ignore next */ []));
83
- this.actionsMenuId = `ui-prompt-actions-menu-${nextActionsMenuId++}`;
84
- this.keepDropdownClosed = signal(false, ...(ngDevMode ? [{ debugName: "keepDropdownClosed" }] : /* istanbul ignore next */ []));
85
- this.isFieldHovered = signal(false, ...(ngDevMode ? [{ debugName: "isFieldHovered" }] : /* istanbul ignore next */ []));
86
- this.isFieldFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFieldFocused" }] : /* istanbul ignore next */ []));
87
- /** True while an IME candidate window is open (CJK input). */
88
- this.composing = signal(false, ...(ngDevMode ? [{ debugName: "composing" }] : /* istanbul ignore next */ []));
89
- this.compositionEndedAt = 0;
90
- this.filteredDropdownItems = computed(() => {
91
- const query = this.promptTextValue().trim().toLowerCase();
92
- return this.dropdownItems().filter(item => {
93
- const label = item.label.toLowerCase();
94
- return label !== query && (!query || label.includes(query));
95
- });
96
- }, ...(ngDevMode ? [{ debugName: "filteredDropdownItems" }] : /* istanbul ignore next */ []));
97
- // Derived from focus so blur closes the overlay for free.
98
- this.itemsDropdownVisible = computed(() => this.isFieldFocused() && !this.keepDropdownClosed() && this.filteredDropdownItems().length > 0 && !this.isLocked(), ...(ngDevMode ? [{ debugName: "itemsDropdownVisible" }] : /* istanbul ignore next */ []));
99
- /** True while focus sits anywhere inside the prompt. */
100
- this.isContainerFocused = signal(false, ...(ngDevMode ? [{ debugName: "isContainerFocused" }] : /* istanbul ignore next */ []));
101
- this.isHighlighted = computed(() => this.isFieldHovered() || this.isContainerFocused(), ...(ngDevMode ? [{ debugName: "isHighlighted" }] : /* istanbul ignore next */ []));
102
- this.showFocusRing = computed(() => this.isHighlighted() && !this.loading(), ...(ngDevMode ? [{ debugName: "showFocusRing" }] : /* istanbul ignore next */ []));
103
- this.fileInputAccept = computed(() => this.actionTag()?.acceptedFileTypes ?? this.supportedFileTypes(), ...(ngDevMode ? [{ debugName: "fileInputAccept" }] : /* istanbul ignore next */ []));
104
- this.isLocked = computed(() => this.disabledState() || this.loading(), ...(ngDevMode ? [{ debugName: "isLocked" }] : /* istanbul ignore next */ []));
105
- /** Hidden on an empty prompt (the placeholder owns that state) and behind a tag's autocomplete suggestion. */
106
- this.visibleHelpText = computed(() => this.promptTextValue() && !this.autocompleteSuggestion() && !this.isLocked() ? this.helpText().trim() : '', ...(ngDevMode ? [{ debugName: "visibleHelpText" }] : /* istanbul ignore next */ []));
107
- this.actionTagIcon = computed(() => resolveIcon(this.actionTag()?.icon, 'Plus'), ...(ngDevMode ? [{ debugName: "actionTagIcon" }] : /* istanbul ignore next */ []));
108
- this.actionTagMenuTrailingIcon = computed(() => resolveIcon(this.actionTag()?.menuTrailingIcon, 'Plus'), ...(ngDevMode ? [{ debugName: "actionTagMenuTrailingIcon" }] : /* istanbul ignore next */ []));
109
- this.secondaryActionTagMenuTrailingIcon = computed(() => resolveIcon(this.secondaryActionTag()?.menuTrailingIcon, 'Arrow-chevron-right-in-line'), ...(ngDevMode ? [{ debugName: "secondaryActionTagMenuTrailingIcon" }] : /* istanbul ignore next */ []));
110
- /** Menu items sorted by `menuOrder`; a stable sort keeps the default order for ties and omissions. */
111
- this.actionsMenuEntries = computed(() => {
112
- const secondary = this.secondaryActionTag();
113
- const action = this.actionTag();
114
- const entries = [];
115
- if (secondary) {
116
- entries.push({ kind: 'secondary', tag: secondary, trailingIcon: this.secondaryActionTagMenuTrailingIcon() });
117
- }
118
- if (action) {
119
- entries.push({ kind: 'action', tag: action, trailingIcon: this.actionTagMenuTrailingIcon() });
120
- }
121
- return entries.sort((a, b) => (a.tag.menuOrder ?? Infinity) - (b.tag.menuOrder ?? Infinity));
122
- }, ...(ngDevMode ? [{ debugName: "actionsMenuEntries" }] : /* istanbul ignore next */ []));
123
- this.isActionsMenuOpen = computed(() => this.actionsPopover()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "isActionsMenuOpen" }] : /* istanbul ignore next */ []));
124
- this.showActionsMenuTrigger = computed(() => this.collapseActionTags() && Boolean(this.actionTag() ?? this.secondaryActionTag()), ...(ngDevMode ? [{ debugName: "showActionsMenuTrigger" }] : /* istanbul ignore next */ []));
125
- this.hasContent = computed(() => Boolean(this.promptTextValue().trim()) || this.promptFilesList().length > 0, ...(ngDevMode ? [{ debugName: "hasContent" }] : /* istanbul ignore next */ []));
126
- /**
127
- * Shared by the Send button's disabled state and the Enter shortcut, so they cannot disagree.
128
- * Ignores `showSendButton` on purpose: this is whether submission is allowed, not whether a
129
- * button is rendered.
130
- */
131
- this.canSubmit = computed(() => !this.isLocked() && !this.sendButtonDisabled() && this.hasContent(), ...(ngDevMode ? [{ debugName: "canSubmit" }] : /* istanbul ignore next */ []));
132
- this.isOverCharacterLimit = computed(() => this.promptTextValue().length > this.maxCharacters(), ...(ngDevMode ? [{ debugName: "isOverCharacterLimit" }] : /* istanbul ignore next */ []));
133
- this.announcedTextValue = toSignal(toObservable(computed(() => (this.showCharacterCount() ? this.promptTextValue() : ''))).pipe(debounceTime(CHARACTER_COUNT_ANNOUNCE_DEBOUNCE_MS)), { initialValue: '' });
134
- this.characterCountAnnouncement = computed(() => {
135
- if (!this.showCharacterCount()) {
136
- return null;
137
- }
138
- const max = this.maxCharacters();
139
- const remaining = max - this.announcedTextValue().length;
140
- if (remaining < 0) {
141
- return { key: 'PROMPT.CHARACTERS_OVER_LIMIT', params: { count: -remaining } };
142
- }
143
- if (remaining <= max * CHARACTER_COUNT_ANNOUNCE_THRESHOLD) {
144
- return { key: 'PROMPT.CHARACTERS_REMAINING', params: { count: remaining } };
145
- }
146
- return null;
147
- }, ...(ngDevMode ? [{ debugName: "characterCountAnnouncement" }] : /* istanbul ignore next */ []));
148
- this.destroyRef = inject(DestroyRef);
149
- this.translationPipe = inject(UiTranslatePipe);
150
- this.resetOnLock = effect(() => {
151
- if (this.isLocked()) {
152
- this.isDropdownOpened.set(false);
153
- this.actionsPopover()?.close();
154
- this.isFieldFocused.set(false);
155
- this.isFieldHovered.set(false);
156
- this.isContainerFocused.set(false);
157
- this.autocompleteSuggestion.set('');
158
- this.composing.set(false);
159
- }
160
- }, ...(ngDevMode ? [{ debugName: "resetOnLock" }] : /* istanbul ignore next */ []));
161
- this.fileDrop = viewChild('fileDropRef', ...(ngDevMode ? [{ debugName: "fileDrop" }] : /* istanbul ignore next */ []));
162
- this.tagDropdown = viewChild('tagDropdown', ...(ngDevMode ? [{ debugName: "tagDropdown" }] : /* istanbul ignore next */ []));
163
- this.fieldComponentRef = viewChild.required('textarea');
164
- this.promptContainer = viewChild.required('promptContainerRef');
165
- this.actionsPopover = viewChild(PopoverDirective, ...(ngDevMode ? [{ debugName: "actionsPopover" }] : /* istanbul ignore next */ []));
166
- this.actionsMenu = viewChild('actionsMenu', ...(ngDevMode ? [{ debugName: "actionsMenu" }] : /* istanbul ignore next */ []));
167
- this.dropdownPositions = [
168
- {
169
- originX: 'start',
170
- originY: 'bottom',
171
- overlayX: 'start',
172
- overlayY: 'top',
173
- },
174
- ];
175
- this.onChange = (_value) => { };
176
- this.onTouch = () => { };
177
- }
178
- /**
179
- * Whether the prompt is disabled.
180
- * @type {boolean}
181
- * @memberof PromptComponent
182
- */
183
- get disabled() {
184
- return this.disabledState();
185
- }
186
- set disabled(value) {
187
- this.setDisabledState(value);
188
- }
189
- ngOnInit() {
190
- this.initTags();
191
- }
192
- ngAfterViewInit() {
193
- setTimeout(() => {
194
- this.syncInputChange();
195
- }, 0);
196
- }
197
- async uploadFile(event) {
198
- const files = event.currentTarget.files;
199
- if (files?.length) {
200
- this.promptFilesList.update(list => {
201
- list.push(files.item(0));
202
- return list;
203
- });
204
- this.emitValue();
205
- await this.updateFileMenu();
206
- }
207
- }
208
- sendPromptData() {
209
- if (!this.canSubmit()) {
210
- return;
211
- }
212
- this.promptData.emit({ text: this.promptTextValue() || '', files: this.promptFilesList() });
213
- if (this.autoClear()) {
214
- this.clearPromptData();
215
- }
216
- }
217
- selectedMenuOption(menuOptionValue) {
218
- const updatedConfig = this.fileListMenuConfig().filter(menu => menu.value !== menuOptionValue);
219
- const updatedFileList = this.promptFilesList().filter(file => file.name !== menuOptionValue);
220
- this.promptFilesList.set(updatedFileList);
221
- this.fileListMenuConfig.set(updatedConfig);
222
- }
223
- selectTag(tag, event) {
224
- if (this.isLocked()) {
225
- return;
226
- }
227
- event.stopPropagation();
228
- event.preventDefault();
229
- this.isDropdownOpened.set(false);
230
- this.promptTextValue.set(tag.label);
231
- this.autocompleteSuggestion.set(`${tag.label} ${tag.autocomplete}`);
232
- this.fieldComponentRef().field.nativeElement.focus();
233
- this.onTouch();
234
- }
235
- onTextareaTab(event) {
236
- if (this.isLocked()) {
237
- return;
238
- }
239
- if (this.autocompleteSuggestion()) {
240
- event.preventDefault();
241
- this.promptTextValue.set(this.autocompleteSuggestion());
242
- this.autocompleteSuggestion.set('');
243
- }
244
- }
245
- onTextareaEnter(event) {
246
- const keyboardEvent = event;
247
- // Three checks because browsers disagree on when `compositionend` fires relative to the
248
- // Enter that commits an IME candidate: Chrome/Firefox after, Safari before, Android during.
249
- if (keyboardEvent.isComposing || this.composing() || Date.now() - this.compositionEndedAt < IME_COMMIT_GRACE_MS) {
250
- return;
251
- }
252
- // Unconditional, so a blocked Enter is swallowed rather than inserting a newline.
253
- event.preventDefault();
254
- this.sendPromptData();
255
- }
256
- dropdownOutsideClick() {
257
- this.isDropdownOpened.set(false);
258
- }
259
- onFieldBlur() {
260
- this.isFieldFocused.set(false);
261
- }
262
- onContainerFocusIn() {
263
- this.isContainerFocused.set(true);
264
- }
265
- onContainerFocusOut(event) {
266
- const next = event.relatedTarget;
267
- if (next instanceof Node && this.promptContainer().nativeElement.contains(next)) {
268
- return;
269
- }
270
- this.isContainerFocused.set(false);
271
- }
272
- itemsDropdownOutsideClick(event) {
273
- if (this.promptContainer().nativeElement.contains(event.target)) {
274
- return;
275
- }
276
- this.isFieldFocused.set(false);
277
- this.dropdownClosed.emit();
278
- }
279
- closeItemsDropdown() {
280
- this.keepDropdownClosed.set(true);
281
- this.dropdownClosed.emit();
282
- }
283
- onTextareaEscape(event) {
284
- if (this.itemsDropdownVisible()) {
285
- // Consume it only when it dismissed the dropdown, so an Escape with nothing open still
286
- // reaches an enclosing ui-dialog / ui-side-sheet.
287
- event.stopPropagation();
288
- this.closeItemsDropdown();
289
- }
290
- }
291
- selectDropdownItem(item, event) {
292
- if (this.isLocked()) {
293
- return;
294
- }
295
- event.stopPropagation();
296
- event.preventDefault();
297
- this.keepDropdownClosed.set(true);
298
- this.promptTextValue.set(item.label);
299
- this.autocompleteSuggestion.set('');
300
- this.fieldComponentRef().field.nativeElement.focus();
301
- this.dropdownItemSelected.emit(item);
302
- this.emitValue();
303
- }
304
- toggleDropdown() {
305
- if (this.isLocked()) {
306
- return;
307
- }
308
- this.isDropdownOpened.set(!this.isDropdownOpened());
309
- }
310
- focusTagDropdown() {
311
- setTimeout(() => {
312
- this.tagDropdown()?.nativeElement.focus();
313
- }, 300);
314
- }
315
- syncInputChange() {
316
- if (!this.fieldComponentRef()?.field?.nativeElement) {
317
- return;
318
- }
319
- const textarea = this.fieldComponentRef().field.nativeElement;
320
- fromEvent(textarea, 'input')
321
- .pipe(map((event) => event.target.value),
322
- // Synchronous, so Enter and the Send button never observe a stale value.
323
- tap(value => {
324
- this.promptTextValue.set(value);
325
- this.keepDropdownClosed.set(false);
326
- if (this.autocompleteSuggestion()) {
327
- this.autocompleteSuggestion.set('');
328
- }
329
- }), debounceTime(INPUT_EMIT_DEBOUNCE_MS), tap(() => this.emitValue()), takeUntilDestroyed(this.destroyRef))
330
- .subscribe();
331
- fromEvent(textarea, 'compositionstart')
332
- .pipe(tap(() => this.composing.set(true)), takeUntilDestroyed(this.destroyRef))
333
- .subscribe();
334
- fromEvent(textarea, 'compositionend')
335
- .pipe(tap(() => {
336
- this.composing.set(false);
337
- this.compositionEndedAt = Date.now();
338
- }), takeUntilDestroyed(this.destroyRef))
339
- .subscribe();
340
- }
341
- initTags() {
342
- if (!this.tags()?.length) {
343
- return;
344
- }
345
- if (this.tags().length <= 5) {
346
- this.tagsVisible.set(this.tags());
347
- return;
348
- }
349
- this.tagsVisible.set(this.tags().slice(0, 5));
350
- this.tagsInDropdown.set(this.tags().slice(5));
351
- }
352
- async updateFileMenu() {
353
- const menuConfig = [];
354
- const tooltip = await firstValueFrom(this.translationPipe.transform('COMMON.DELETE'));
355
- this.promptFilesList().forEach(file => {
356
- menuConfig.push({
357
- label: file.name,
358
- value: file.name,
359
- icon: 'Delete',
360
- tooltipText: tooltip,
361
- });
362
- });
363
- this.fileListMenuConfig.set(menuConfig);
364
- }
365
- clearPromptData() {
366
- this.promptTextValue.set('');
367
- this.promptFilesList.set([]);
368
- this.fileListMenuConfig.set([]);
369
- }
370
- writeValue(value) {
371
- this.promptTextValue.set(value?.text ?? '');
372
- this.promptFilesList.set(value?.files ?? []);
373
- }
374
- registerOnChange(fn) {
375
- this.onChange = fn;
376
- }
377
- registerOnTouched(fn) {
378
- this.onTouch = fn;
379
- }
380
- setDisabledState(isDisabled) {
381
- this.disabledState.set(isDisabled);
382
- }
383
- async onFileSelected(event) {
384
- if (this.isLocked()) {
385
- return;
386
- }
387
- if (this.actionTag()) {
388
- this.handleActionTagFile(event);
389
- }
390
- else {
391
- await this.uploadFile(event);
392
- }
393
- }
394
- onActionTagPress() {
395
- if (this.isLocked() || this.actionTag()?.disabled) {
396
- return;
397
- }
398
- this.fileDrop()?.nativeElement.click();
399
- }
400
- onSecondaryActionTagPress() {
401
- if (this.isLocked() || this.secondaryActionTag()?.disabled) {
402
- return;
403
- }
404
- this.secondaryActionTagPress.emit();
405
- }
406
- /** The popover's focus trap hands focus back to the Plus button when the menu closes. */
407
- closeActionsMenu() {
408
- this.actionsPopover()?.close();
409
- }
410
- onActionsMenuKeydown(event) {
411
- const items = this.actionsMenuItems();
412
- const current = items.indexOf(document.activeElement);
413
- const focusAt = (index) => {
414
- event.preventDefault();
415
- items[(index + items.length) % items.length]?.focus();
416
- };
417
- switch (event.key) {
418
- case 'ArrowDown':
419
- focusAt(current + 1);
420
- break;
421
- case 'ArrowUp':
422
- focusAt(current - 1);
423
- break;
424
- case 'Home':
425
- focusAt(0);
426
- break;
427
- case 'End':
428
- focusAt(items.length - 1);
429
- break;
430
- case 'Escape':
431
- // Consumed so an enclosing ui-dialog / ui-side-sheet does not close as well.
432
- event.preventDefault();
433
- event.stopPropagation();
434
- this.closeActionsMenu();
435
- break;
436
- }
437
- }
438
- selectActionsMenuEntry(entry, event) {
439
- if (entry.kind === 'action') {
440
- this.selectActionTagFromMenu(event);
441
- }
442
- else {
443
- this.selectSecondaryActionTagFromMenu(event);
444
- }
445
- }
446
- selectActionTagFromMenu(event) {
447
- event.preventDefault();
448
- if (this.actionTag()?.disabled) {
449
- return;
450
- }
451
- this.closeActionsMenu();
452
- this.onActionTagPress();
453
- }
454
- selectSecondaryActionTagFromMenu(event) {
455
- event.preventDefault();
456
- if (this.secondaryActionTag()?.disabled) {
457
- return;
458
- }
459
- this.closeActionsMenu();
460
- this.onSecondaryActionTagPress();
461
- }
462
- actionsMenuItems() {
463
- const menu = this.actionsMenu()?.nativeElement;
464
- return menu ? Array.from(menu.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) : [];
465
- }
466
- handleActionTagFile(event) {
467
- const inputEl = event.currentTarget;
468
- const file = inputEl.files?.item(0) ?? null;
469
- if (file) {
470
- this.actionTagFileSelected.emit(file);
471
- }
472
- inputEl.value = '';
473
- }
474
- emitValue() {
475
- this.onChange({ text: this.promptTextValue() || '', files: this.promptFilesList() });
476
- this.onTouch();
477
- }
478
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PromptComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
479
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PromptComponent, isStandalone: true, selector: "ui-prompt", inputs: { tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null }, actionTag: { classPropertyName: "actionTag", publicName: "actionTag", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionTag: { classPropertyName: "secondaryActionTag", publicName: "secondaryActionTag", isSignal: true, isRequired: false, transformFunction: null }, collapseActionTags: { classPropertyName: "collapseActionTags", publicName: "collapseActionTags", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, supportedFileTypes: { classPropertyName: "supportedFileTypes", publicName: "supportedFileTypes", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, showSendButton: { classPropertyName: "showSendButton", publicName: "showSendButton", isSignal: true, isRequired: false, transformFunction: null }, sendButtonDisabled: { classPropertyName: "sendButtonDisabled", publicName: "sendButtonDisabled", isSignal: true, isRequired: false, transformFunction: null }, enableFileUpload: { classPropertyName: "enableFileUpload", publicName: "enableFileUpload", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, dropdownItems: { classPropertyName: "dropdownItems", publicName: "dropdownItems", isSignal: true, isRequired: false, transformFunction: null }, dropdownHeading: { classPropertyName: "dropdownHeading", publicName: "dropdownHeading", isSignal: true, isRequired: false, transformFunction: null }, showDropdownClose: { classPropertyName: "showDropdownClose", publicName: "showDropdownClose", isSignal: true, isRequired: false, transformFunction: null }, showCharacterCount: { classPropertyName: "showCharacterCount", publicName: "showCharacterCount", isSignal: true, isRequired: false, transformFunction: null }, helpText: { classPropertyName: "helpText", publicName: "helpText", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute } }, outputs: { promptData: "promptData", actionTagFileSelected: "actionTagFileSelected", secondaryActionTagPress: "secondaryActionTagPress", dropdownItemSelected: "dropdownItemSelected", dropdownClosed: "dropdownClosed" }, providers: [
480
- UiTranslatePipe,
481
- {
482
- provide: NG_VALUE_ACCESSOR,
483
- useExisting: forwardRef(() => PromptComponent),
484
- multi: true,
485
- },
486
- ], viewQueries: [{ propertyName: "fileDrop", first: true, predicate: ["fileDropRef"], descendants: true, isSignal: true }, { propertyName: "tagDropdown", first: true, predicate: ["tagDropdown"], descendants: true, isSignal: true }, { propertyName: "fieldComponentRef", first: true, predicate: ["textarea"], descendants: true, isSignal: true }, { propertyName: "promptContainer", first: true, predicate: ["promptContainerRef"], descendants: true, isSignal: true }, { propertyName: "actionsPopover", first: true, predicate: PopoverDirective, descendants: true, isSignal: true }, { propertyName: "actionsMenu", first: true, predicate: ["actionsMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container>\n <div\n class=\"prompt-container\"\n [class.has-error]=\"!!errorMessage()\"\n [class.disabled]=\"isLocked()\"\n [attr.aria-disabled]=\"isLocked()\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n cdkOverlayOrigin\n #promptOrigin=\"cdkOverlayOrigin\"\n #promptContainerRef\n [class.prompt-container-focused]=\"showFocusRing()\"\n (focusin)=\"onContainerFocusIn()\"\n (focusout)=\"onContainerFocusOut($event)\"\n >\n @if (loading()) {\n <div class=\"prompt-loading\" aria-hidden=\"true\" animate.enter=\"cnp-prompt-fade-in\">\n <ui-skeleton [theme]=\"{ width: '100%', height: '20px', margin: '0' }\"></ui-skeleton>\n <ui-skeleton [theme]=\"{ width: '30%', height: '20px', margin: '0' }\"></ui-skeleton>\n </div>\n }\n <div class=\"prompt-autocomplete\" [hidden]=\"loading()\">\n <textarea tabindex=\"-1\" class=\"ghost\" id=\"autocomplete\" [value]=\"autocompleteSuggestion()\" readonly></textarea>\n @if (visibleHelpText(); as help) {\n <!-- The mirror repeats the typed text invisibly so the hint lands right after its last character. -->\n <div class=\"ghost prompt-help-text\" aria-hidden=\"true\">\n <span class=\"prompt-help-text-mirror\">{{ promptTextValue() }}</span\n ><span class=\"prompt-help-text-hint\">{{ ' ' + help }}</span>\n </div>\n }\n\n @let showIcon = !isFieldFocused() && !promptTextValue();\n @if (showIcon) {\n <ui-icon\n class=\"prompt-icon\"\n animate.enter=\"cnp-prompt-icon-in\"\n animate.leave=\"cnp-prompt-icon-out\"\n [color]=\"'inherit'\"\n [class.hovered]=\"isFieldHovered()\"\n [name]=\"'Sparkle-in-line'\"\n ></ui-icon>\n }\n <!-- `keydown.enter` matches unmodified Enter only; Shift+Enter resolves to `shift.enter`\n and falls through to a newline. Do not add a shiftKey check. -->\n <ui-field\n #textarea\n class=\"prompt-text\"\n [class.show-icon]=\"showIcon\"\n role=\"input\"\n [showBottomContent]=\"false\"\n [borderless]=\"true\"\n [type]=\"'multi-line'\"\n [autosizableTextarea]=\"true\"\n [maxCharacters]=\"maxCharacters()\"\n [placeholder]=\"showIcon ? placeholder() || ('PROMPT.ASK_ANYTHING' | uiTranslate | async)! : ''\"\n [value]=\"promptTextValue() || ''\"\n [hasTextAreaCounter]=\"false\"\n [ariaDescribedby]=\"visibleHelpText()\"\n [disabled]=\"disabled\"\n (mouseenter)=\"isFieldHovered.set(true)\"\n (mouseleave)=\"isFieldHovered.set(false)\"\n (focusin)=\"isFieldFocused.set(true)\"\n (fieldBlur)=\"onFieldBlur()\"\n (keydown.tab)=\"onTextareaTab($event)\"\n (keydown.enter)=\"onTextareaEnter($event)\"\n (keydown.escape)=\"onTextareaEscape($event)\"\n ></ui-field>\n </div>\n <div class=\"prompt-footer flex-container\">\n <div class=\"flex-container\">\n @if (showActionsMenuTrigger()) {\n <ui-button\n [uiPopover]=\"actionsMenuTemplate\"\n [popoverTrigger]=\"'click'\"\n [popoverCardSize]=\"'small'\"\n [popoverAlign]=\"'start'\"\n [popoverOffset]=\"8\"\n [popoverAriaLabel]=\"('COMMON.ADD' | uiTranslate | async)!\"\n [uiPopoverDisabled]=\"isLocked()\"\n [variant]=\"'icon-button'\"\n [iconName]=\"isActionsMenuOpen() ? 'Close' : 'Plus'\"\n [tooltip]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [ariaExpanded]=\"isActionsMenuOpen()\"\n [ariaControls]=\"isActionsMenuOpen() ? actionsMenuId : undefined\"\n [disabled]=\"isLocked()\"\n ></ui-button>\n\n <ng-template #actionsMenuTemplate>\n <div\n class=\"actions-menu\"\n role=\"menu\"\n #actionsMenu\n [id]=\"actionsMenuId\"\n (keydown)=\"onActionsMenuKeydown($event)\"\n >\n @for (entry of actionsMenuEntries(); track entry.kind) {\n <div\n class=\"actions-menu-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.aria-label]=\"entry.tag.ariaLabel ?? entry.tag.label\"\n [attr.aria-disabled]=\"entry.tag.disabled ? 'true' : null\"\n (click)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.enter)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.space)=\"selectActionsMenuEntry(entry, $event)\"\n >\n @if (entry.tag.icon) {\n <ui-icon class=\"actions-menu-item-icon\" [name]=\"entry.tag.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"actions-menu-item-label\">{{ entry.tag.label }}</span>\n @if (entry.trailingIcon) {\n <ui-icon\n class=\"actions-menu-item-trailing\"\n [name]=\"entry.trailingIcon\"\n [color]=\"'inherit'\"\n ></ui-icon>\n }\n </div>\n }\n </div>\n </ng-template>\n }\n\n @if (actionTag(); as at) {\n @if (!collapseActionTags()) {\n <ui-tag\n [label]=\"at.label\"\n [icon]=\"actionTagIcon()\"\n [ariaLabel]=\"at.ariaLabel ?? at.label\"\n [isDisabled]=\"isLocked() || !!at.disabled\"\n (press)=\"onActionTagPress()\"\n ></ui-tag>\n }\n } @else if (enableFileUpload()) {\n <ui-button\n [variant]=\"'icon-button'\"\n [tooltip]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [iconName]=\"'Plus'\"\n [disabled]=\"isLocked()\"\n (click)=\"fileDrop()?.nativeElement?.click()\"\n ></ui-button>\n\n @if (promptFilesList().length) {\n <div class=\"menu\" animate.enter=\"cnp-prompt-pop-in\">\n <ui-badge\n [notificationsAmount]=\"promptFilesList().length\"\n [variant]=\"'notification'\"\n class=\"menu-badge\"\n ></ui-badge>\n <ui-overflow-menu\n [matTooltip]=\"('PROMPT.FILES' | uiTranslate | async)!\"\n [matTooltipPosition]=\"'above'\"\n [buttonSize]=\"'medium'\"\n [iconTrigger]=\"'Document'\"\n [buttonVariant]=\"'ghost'\"\n [buttons]=\"fileListMenuConfig()\"\n [isDynamicMenu]=\"true\"\n [withRemovableOption]=\"true\"\n (selectItem)=\"selectedMenuOption($event)\"\n ></ui-overflow-menu>\n </div>\n }\n }\n\n @if (secondaryActionTag(); as sat) {\n @if (!collapseActionTags()) {\n <ui-tag\n class=\"prompt-secondary-action-tag\"\n [label]=\"sat.label\"\n [icon]=\"sat.icon ?? ''\"\n [ariaLabel]=\"sat.ariaLabel ?? sat.label\"\n [isDisabled]=\"isLocked() || !!sat.disabled\"\n (press)=\"onSecondaryActionTagPress()\"\n ></ui-tag>\n }\n }\n\n @if (actionTag() || enableFileUpload()) {\n <input\n data-testid=\"prompt-file-input\"\n [tabIndex]=\"-1\"\n class=\"form-control\"\n #fileDropRef\n type=\"file\"\n id=\"file-upload\"\n [accept]=\"fileInputAccept()\"\n [disabled]=\"isLocked()\"\n (change)=\"onFileSelected($event)\"\n />\n }\n </div>\n\n @if (tags()?.length && !promptTextValue()) {\n <div class=\"flex-container carousel\" animate.enter=\"cnp-prompt-row-in\">\n <div class=\"tag-container flex-container\" role=\"list\" #tagsScrollContainer>\n @for (tag of tagsVisible(); track tag) {\n <ui-tag\n [label]=\"tag.label\"\n role=\"listitem\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"isLocked()\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n ></ui-tag>\n }\n\n @if (tagsInDropdown().length) {\n <ui-button\n class=\"view-more\"\n variant=\"text-inline\"\n [label]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [ariaLabel]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [size]=\"'medium'\"\n [disabled]=\"isLocked()\"\n (click)=\"toggleDropdown()\"\n (keydown.enter)=\"focusTagDropdown()\"\n cdkOverlayOrigin\n #dropdownTrigger=\"cdkOverlayOrigin\"\n ></ui-button>\n }\n </div>\n\n <div class=\"flex-container\">\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [ariaLabel]=\"'Scroll left button'\"\n [iconName]=\"'Arrow-chevron-left-in-line'\"\n [disabled]=\"isLocked() || tagsScrollContainer.scrollLeft === 0\"\n (click)=\"tagsScrollContainer.scrollBy({ left: -100, behavior: 'smooth' })\"\n ></ui-button>\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Arrow-chevron-right-in-line'\"\n [ariaLabel]=\"'Scroll right button'\"\n [disabled]=\"\n isLocked() ||\n tagsScrollContainer.scrollLeft + tagsScrollContainer.clientWidth >= tagsScrollContainer.scrollWidth\n \"\n (click)=\"tagsScrollContainer.scrollBy({ left: 100, behavior: 'smooth' })\"\n ></ui-button>\n </div>\n </div>\n }\n\n @if (showCharacterCount()) {\n <span class=\"prompt-character-count\" [class.over-limit]=\"isOverCharacterLimit()\"\n >{{ promptTextValue().length }} / {{ maxCharacters() }}</span\n >\n <span class=\"prompt-character-count-status\" aria-live=\"polite\">\n @if (characterCountAnnouncement(); as announcement) {\n {{ announcement.key | uiTranslate: announcement.params | async }}\n }\n </span>\n }\n\n @if (showSendButton()) {\n <ui-button\n class=\"send-button\"\n animate.enter=\"cnp-prompt-pop-in\"\n [variant]=\"'secondary'\"\n [iconName]=\"'Arrow-up-in-line'\"\n [tooltip]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [ariaLabel]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [size]=\"'medium'\"\n [disabled]=\"!canSubmit()\"\n (click)=\"sendPromptData()\"\n ></ui-button>\n }\n </div>\n\n <div class=\"prompt-projected-footer\">\n <ng-content select=\"[promptFooter]\"></ng-content>\n </div>\n </div>\n\n @if (errorMessage()) {\n <div class=\"prompt-error\" animate.enter=\"cnp-prompt-error-in\">\n <ui-icon [name]=\"'Error'\" color=\"red\"></ui-icon>\n <span>{{ errorMessage() }}</span>\n </div>\n }\n\n <!-- Dropdown for hidden tags -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"isDropdownOpened() && !isLocked()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"dropdownOutsideClick()\"\n >\n <div class=\"dropdown-container\" role=\"list\" #tagDropdown tabindex=\"0\" animate.enter=\"cnp-prompt-dropdown-in\">\n @for (tag of tagsInDropdown(); track tag) {\n <div\n class=\"dropdown-tag\"\n tabindex=\"0\"\n [attr.aria-label]=\"tag.label\"\n role=\"listitem\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n >\n {{ tag.label }}\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Built-in items dropdown (UI-877) \u2014 opens on focus, typing filters by label -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"itemsDropdownVisible()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"itemsDropdownOutsideClick($event)\"\n >\n <div\n class=\"dropdown-container custom-dropdown-container\"\n animate.enter=\"cnp-prompt-dropdown-in\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (dropdownHeading() || showDropdownClose()) {\n <div class=\"dropdown-header\">\n @if (dropdownHeading()) {\n <span class=\"dropdown-heading\">{{ dropdownHeading() }}</span>\n }\n @if (showDropdownClose()) {\n <ui-button\n class=\"dropdown-close\"\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Close-in-line'\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"closeItemsDropdown()\"\n ></ui-button>\n }\n </div>\n }\n <div role=\"list\">\n @for (item of filteredDropdownItems(); track item.id) {\n <div\n class=\"dropdown-tag dropdown-item\"\n tabindex=\"0\"\n role=\"listitem\"\n [attr.aria-label]=\"item.label\"\n (click)=\"selectDropdownItem(item, $event)\"\n (keydown.enter)=\"selectDropdownItem(item, $event)\"\n (keydown.space)=\"selectDropdownItem(item, $event)\"\n >\n @if (item.icon) {\n <ui-icon class=\"dropdown-item-icon\" [name]=\"item.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"dropdown-item-label\">{{ item.label }}</span>\n <ui-icon class=\"dropdown-item-chevron\" [name]=\"'Arrow-chevron-right-in-line'\" [color]=\"'inherit'\"></ui-icon>\n </div>\n }\n </div>\n </div>\n </ng-template>\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 ::ng-deep ui-field.prompt-text>mat-form-field{vertical-align:top}:host ::ng-deep ui-field.prompt-text .mat-mdc-text-field-wrapper{border-radius:10px!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper{background:transparent}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{padding-bottom:0!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper textarea{max-height:220px!important}:host ::ng-deep ui-button.send-button .rounded-icon .mdc-button{width:48px!important;height:48px!important}:host ::ng-deep ui-overflow-menu button.mat-mdc-unelevated-button.ghost.light-theme.only-icon{border:none}.prompt-container{border:1px solid #919191;border-radius:10px;background-color:#fff;outline:0 solid transparent;outline-offset:-2px;transition:border-color .18s cubic-bezier(.2,0,0,1),outline-color .18s cubic-bezier(.2,0,0,1),outline-width .12s cubic-bezier(.2,0,0,1);--ui-prompt-ring: inset 0 0 0 2px transparent}.prompt-container:after{content:\"\";position:absolute;z-index:1;inset:-1px;border-radius:inherit;box-shadow:var(--ui-prompt-ring);pointer-events:none;transition:box-shadow .18s cubic-bezier(.2,0,0,1)}.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px #000000;border:1px solid black;outline:1px solid black}.prompt-container.disabled{border:1px solid #d3d3d3}.prompt-container.disabled.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px transparent;outline-width:0}.prompt-container.disabled .prompt-icon{color:#d3d3d3}ui-field.prompt-text{transition:padding-left .12s cubic-bezier(.2,0,0,1)}ui-field.show-icon{padding-left:24px}.prompt-icon{position:absolute;top:14px;left:16px;color:#666;transition:color .12s cubic-bezier(.2,0,0,1)}.prompt-icon.hovered{color:#000}.dropdown-container{width:100%}.custom-dropdown-container{overflow:hidden;background-color:#fff;border-radius:0 0 8px 8px;box-shadow:0 8px 16px #00000014}.dropdown-header{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px}.dropdown-heading{font-weight:700}.dropdown-close{margin-left:auto}.dropdown-item{display:flex;gap:12px;align-items:center}.dropdown-item-icon,.dropdown-item-chevron{flex-shrink:0}.dropdown-item-label{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-tag{padding:16px;background-color:#fff;transition:background-color .12s cubic-bezier(.2,0,0,1)}.dropdown-tag:hover,.dropdown-tag:focus{background-color:#fff2fc;cursor:pointer}.carousel{flex-grow:1;min-width:0}.tag-container{overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tag-container::-webkit-scrollbar{display:none}.tag-container{margin:0 8px}.actions-menu{min-width:228px;margin:-8px}.actions-menu-item{display:flex;gap:12px;align-items:center;padding:8px;border-radius:8px;cursor:pointer;transition:background-color .12s cubic-bezier(.2,0,0,1)}.actions-menu-item:hover,.actions-menu-item:focus-visible{background-color:#fff2fc}.actions-menu-item[aria-disabled=true]{color:#d3d3d3;background-color:transparent;cursor:default}.actions-menu-item-icon,.actions-menu-item-trailing{flex-shrink:0}.actions-menu-item-label{flex:1;white-space:nowrap}#file-upload{display:none}.prompt-footer,.flex-container{display:flex;flex-flow:row nowrap;align-items:center}.prompt-footer{justify-content:space-between;padding:8px 16px}@media(max-width:600px){.prompt-footer{padding:8px}}@media(max-width:320px){.prompt-footer{padding:8px}}.prompt-character-count{margin-left:auto;padding-right:8px;color:#888;font-size:12px;line-height:16px;white-space:nowrap}.prompt-character-count.over-limit{color:#e02800}.prompt-character-count-status{position:absolute;left:-9999px}.prompt-projected-footer{display:none}.prompt-projected-footer:has(*){display:block;overflow:hidden;border-radius:0 0 9px 9px}.menu{display:flex;flex-flow:column nowrap;position:relative}.menu .menu-badge{position:absolute;right:0;z-index:1000}.view-more{margin-left:4px;white-space:nowrap}.view-more ::ng-deep button.mat-mdc-unelevated-button .label{white-space:nowrap}.prompt-container{position:relative}.prompt-container.has-error{--ui-prompt-ring: inset 0 0 0 2px #e02800;border:1px solid #e02800;outline:1px solid #e02800}.prompt-error{margin-top:4px;align-items:center;display:flex;color:#e02800;font-size:12px;line-height:16px}.prompt-error ui-icon{margin-right:4px}.prompt-loading{display:flex;flex-direction:column;gap:4px;padding:12px 16px 0}.prompt-loading ui-skeleton{height:20px}.ghost{position:absolute;top:0;left:0;bottom:16px;color:#888;border:none;pointer-events:none;background:transparent;width:100%;padding:12px 16px;font-size:inherit;line-height:22px;letter-spacing:inherit;font-weight:inherit;font-family:ModernGothic,sans-serif;resize:none}.prompt-help-text{overflow:hidden;white-space:pre-wrap;overflow-wrap:break-word}.prompt-help-text-mirror{color:transparent}.prompt-help-text-hint{color:#919191}@keyframes cnp-prompt-fade-in{0%{opacity:0}}@keyframes cnp-prompt-icon-in{0%{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-icon-out{to{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-row-in{0%{opacity:0;transform:translateY(6px)}}@keyframes cnp-prompt-pop-in{0%{opacity:0;transform:scale(.8)}}@keyframes cnp-prompt-error-in{0%{opacity:0;transform:translateY(-4px)}}@keyframes cnp-prompt-dropdown-in{0%{opacity:0;transform:translateY(-6px)}}.cnp-prompt-fade-in{animation:cnp-prompt-fade-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-in{animation:cnp-prompt-icon-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-out{animation:cnp-prompt-icon-out .12s cubic-bezier(.2,0,0,1) both}.cnp-prompt-row-in{animation:cnp-prompt-row-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-pop-in{animation:cnp-prompt-pop-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-error-in{animation:cnp-prompt-error-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-dropdown-in{animation:cnp-prompt-dropdown-in .18s cubic-bezier(.2,0,0,1) both}@media(prefers-reduced-motion:reduce){.prompt-container,.prompt-container:after,.prompt-icon,.dropdown-tag,ui-field.prompt-text{transition:none}.cnp-prompt-fade-in,.cnp-prompt-icon-in,.cnp-prompt-icon-out,.cnp-prompt-row-in,.cnp-prompt-pop-in,.cnp-prompt-error-in,.cnp-prompt-dropdown-in{animation-duration:1ms}}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["count", "theme", "appearance", "isAiTheme", "applicationTheme"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "component", type: FieldComponent, selector: "ui-field", inputs: ["fullWidth", "fullHeight", "label", "labelHtml", "labelIcon", "fieldName", "placeholder", "id", "value", "badgeVariant", "errors", "disabled", "required", "readOnly", "hintMessage", "type", "updateOnBlur", "allowOnlyDigits", "isAutocompleteOff", "allowNegative", "showBottomContent", "applicationTheme", "ariaLabel", "testId", "loading", "isValid", "maxCharacters", "trimOnBlur", "trimOnSubmit", "maxRows", "hasTextAreaCounter", "hideBuiltInErrors", "hideLabelInErrors", "max", "min", "textareaHeight", "borderless", "autosizableTextarea", "isAIVariant", "ariaLabelledby", "ariaDescribedby", "hasError"], outputs: ["validateEvent", "fieldBlur"] }, { kind: "component", type: TagComponent, selector: "ui-tag", inputs: ["label", "icon", "allowClose", "readOnly", "isSelected", "showIconWhenSelected", "pinnedBackground", "constrainWidth", "isDisabled", "applicationTheme", "ariaLabel", "testId", "ariaRequired", "showBadge", "notificationsAmount"], outputs: ["isSelectedChange", "close", "press"] }, { 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: "component", type: BadgeComponent, selector: "ui-badge", inputs: ["label", "staticLabel", "icon", "iconColor", "trailingIcon", "trailingIconColor", "color", "variant", "notificationsAmount", "applicationTheme", "rebrandColor", "truncateLabel", "enableAnimation"] }, { kind: "component", type: OverflowMenuComponent, selector: "ui-overflow-menu", inputs: ["buttons", "iconTrigger", "menuLabel", "applicationTheme", "ariaLabel", "testId", "ariaRequired", "describedby", "contentTemplateRef", "buttonVariant", "buttonSize", "menuConfig", "selectionMode", "menuAnchor", "shouldMatchAnchorWidth", "isDynamicMenu", "withRemovableOption"], outputs: ["selectItem", "menuOpened", "menuClosed"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: PopoverDirective, selector: "[uiPopover]", inputs: ["uiPopover", "popoverOffset", "popoverAlign", "popoverOpen", "popoverCard", "popoverCardSize", "popoverTrigger", "popoverAriaLabel", "uiPopoverDisabled"], exportAs: ["uiPopover"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: UiTranslatePipe, name: "uiTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
487
- }
488
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PromptComponent, decorators: [{
489
- type: Component,
490
- args: [{ selector: 'ui-prompt', providers: [
491
- UiTranslatePipe,
492
- {
493
- provide: NG_VALUE_ACCESSOR,
494
- useExisting: forwardRef(() => PromptComponent),
495
- multi: true,
496
- },
497
- ], changeDetection: ChangeDetectionStrategy.OnPush, imports: [
498
- CdkOverlayOrigin,
499
- NgClass,
500
- SkeletonComponent,
501
- IconComponent,
502
- FieldComponent,
503
- TagComponent,
504
- ButtonComponent,
505
- BadgeComponent,
506
- OverflowMenuComponent,
507
- MatTooltip,
508
- CdkConnectedOverlay,
509
- PopoverDirective,
510
- AsyncPipe,
511
- UiTranslatePipe,
512
- ], template: "<ng-container>\n <div\n class=\"prompt-container\"\n [class.has-error]=\"!!errorMessage()\"\n [class.disabled]=\"isLocked()\"\n [attr.aria-disabled]=\"isLocked()\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n cdkOverlayOrigin\n #promptOrigin=\"cdkOverlayOrigin\"\n #promptContainerRef\n [class.prompt-container-focused]=\"showFocusRing()\"\n (focusin)=\"onContainerFocusIn()\"\n (focusout)=\"onContainerFocusOut($event)\"\n >\n @if (loading()) {\n <div class=\"prompt-loading\" aria-hidden=\"true\" animate.enter=\"cnp-prompt-fade-in\">\n <ui-skeleton [theme]=\"{ width: '100%', height: '20px', margin: '0' }\"></ui-skeleton>\n <ui-skeleton [theme]=\"{ width: '30%', height: '20px', margin: '0' }\"></ui-skeleton>\n </div>\n }\n <div class=\"prompt-autocomplete\" [hidden]=\"loading()\">\n <textarea tabindex=\"-1\" class=\"ghost\" id=\"autocomplete\" [value]=\"autocompleteSuggestion()\" readonly></textarea>\n @if (visibleHelpText(); as help) {\n <!-- The mirror repeats the typed text invisibly so the hint lands right after its last character. -->\n <div class=\"ghost prompt-help-text\" aria-hidden=\"true\">\n <span class=\"prompt-help-text-mirror\">{{ promptTextValue() }}</span\n ><span class=\"prompt-help-text-hint\">{{ ' ' + help }}</span>\n </div>\n }\n\n @let showIcon = !isFieldFocused() && !promptTextValue();\n @if (showIcon) {\n <ui-icon\n class=\"prompt-icon\"\n animate.enter=\"cnp-prompt-icon-in\"\n animate.leave=\"cnp-prompt-icon-out\"\n [color]=\"'inherit'\"\n [class.hovered]=\"isFieldHovered()\"\n [name]=\"'Sparkle-in-line'\"\n ></ui-icon>\n }\n <!-- `keydown.enter` matches unmodified Enter only; Shift+Enter resolves to `shift.enter`\n and falls through to a newline. Do not add a shiftKey check. -->\n <ui-field\n #textarea\n class=\"prompt-text\"\n [class.show-icon]=\"showIcon\"\n role=\"input\"\n [showBottomContent]=\"false\"\n [borderless]=\"true\"\n [type]=\"'multi-line'\"\n [autosizableTextarea]=\"true\"\n [maxCharacters]=\"maxCharacters()\"\n [placeholder]=\"showIcon ? placeholder() || ('PROMPT.ASK_ANYTHING' | uiTranslate | async)! : ''\"\n [value]=\"promptTextValue() || ''\"\n [hasTextAreaCounter]=\"false\"\n [ariaDescribedby]=\"visibleHelpText()\"\n [disabled]=\"disabled\"\n (mouseenter)=\"isFieldHovered.set(true)\"\n (mouseleave)=\"isFieldHovered.set(false)\"\n (focusin)=\"isFieldFocused.set(true)\"\n (fieldBlur)=\"onFieldBlur()\"\n (keydown.tab)=\"onTextareaTab($event)\"\n (keydown.enter)=\"onTextareaEnter($event)\"\n (keydown.escape)=\"onTextareaEscape($event)\"\n ></ui-field>\n </div>\n <div class=\"prompt-footer flex-container\">\n <div class=\"flex-container\">\n @if (showActionsMenuTrigger()) {\n <ui-button\n [uiPopover]=\"actionsMenuTemplate\"\n [popoverTrigger]=\"'click'\"\n [popoverCardSize]=\"'small'\"\n [popoverAlign]=\"'start'\"\n [popoverOffset]=\"8\"\n [popoverAriaLabel]=\"('COMMON.ADD' | uiTranslate | async)!\"\n [uiPopoverDisabled]=\"isLocked()\"\n [variant]=\"'icon-button'\"\n [iconName]=\"isActionsMenuOpen() ? 'Close' : 'Plus'\"\n [tooltip]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [ariaExpanded]=\"isActionsMenuOpen()\"\n [ariaControls]=\"isActionsMenuOpen() ? actionsMenuId : undefined\"\n [disabled]=\"isLocked()\"\n ></ui-button>\n\n <ng-template #actionsMenuTemplate>\n <div\n class=\"actions-menu\"\n role=\"menu\"\n #actionsMenu\n [id]=\"actionsMenuId\"\n (keydown)=\"onActionsMenuKeydown($event)\"\n >\n @for (entry of actionsMenuEntries(); track entry.kind) {\n <div\n class=\"actions-menu-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.aria-label]=\"entry.tag.ariaLabel ?? entry.tag.label\"\n [attr.aria-disabled]=\"entry.tag.disabled ? 'true' : null\"\n (click)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.enter)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.space)=\"selectActionsMenuEntry(entry, $event)\"\n >\n @if (entry.tag.icon) {\n <ui-icon class=\"actions-menu-item-icon\" [name]=\"entry.tag.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"actions-menu-item-label\">{{ entry.tag.label }}</span>\n @if (entry.trailingIcon) {\n <ui-icon\n class=\"actions-menu-item-trailing\"\n [name]=\"entry.trailingIcon\"\n [color]=\"'inherit'\"\n ></ui-icon>\n }\n </div>\n }\n </div>\n </ng-template>\n }\n\n @if (actionTag(); as at) {\n @if (!collapseActionTags()) {\n <ui-tag\n [label]=\"at.label\"\n [icon]=\"actionTagIcon()\"\n [ariaLabel]=\"at.ariaLabel ?? at.label\"\n [isDisabled]=\"isLocked() || !!at.disabled\"\n (press)=\"onActionTagPress()\"\n ></ui-tag>\n }\n } @else if (enableFileUpload()) {\n <ui-button\n [variant]=\"'icon-button'\"\n [tooltip]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [iconName]=\"'Plus'\"\n [disabled]=\"isLocked()\"\n (click)=\"fileDrop()?.nativeElement?.click()\"\n ></ui-button>\n\n @if (promptFilesList().length) {\n <div class=\"menu\" animate.enter=\"cnp-prompt-pop-in\">\n <ui-badge\n [notificationsAmount]=\"promptFilesList().length\"\n [variant]=\"'notification'\"\n class=\"menu-badge\"\n ></ui-badge>\n <ui-overflow-menu\n [matTooltip]=\"('PROMPT.FILES' | uiTranslate | async)!\"\n [matTooltipPosition]=\"'above'\"\n [buttonSize]=\"'medium'\"\n [iconTrigger]=\"'Document'\"\n [buttonVariant]=\"'ghost'\"\n [buttons]=\"fileListMenuConfig()\"\n [isDynamicMenu]=\"true\"\n [withRemovableOption]=\"true\"\n (selectItem)=\"selectedMenuOption($event)\"\n ></ui-overflow-menu>\n </div>\n }\n }\n\n @if (secondaryActionTag(); as sat) {\n @if (!collapseActionTags()) {\n <ui-tag\n class=\"prompt-secondary-action-tag\"\n [label]=\"sat.label\"\n [icon]=\"sat.icon ?? ''\"\n [ariaLabel]=\"sat.ariaLabel ?? sat.label\"\n [isDisabled]=\"isLocked() || !!sat.disabled\"\n (press)=\"onSecondaryActionTagPress()\"\n ></ui-tag>\n }\n }\n\n @if (actionTag() || enableFileUpload()) {\n <input\n data-testid=\"prompt-file-input\"\n [tabIndex]=\"-1\"\n class=\"form-control\"\n #fileDropRef\n type=\"file\"\n id=\"file-upload\"\n [accept]=\"fileInputAccept()\"\n [disabled]=\"isLocked()\"\n (change)=\"onFileSelected($event)\"\n />\n }\n </div>\n\n @if (tags()?.length && !promptTextValue()) {\n <div class=\"flex-container carousel\" animate.enter=\"cnp-prompt-row-in\">\n <div class=\"tag-container flex-container\" role=\"list\" #tagsScrollContainer>\n @for (tag of tagsVisible(); track tag) {\n <ui-tag\n [label]=\"tag.label\"\n role=\"listitem\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"isLocked()\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n ></ui-tag>\n }\n\n @if (tagsInDropdown().length) {\n <ui-button\n class=\"view-more\"\n variant=\"text-inline\"\n [label]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [ariaLabel]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [size]=\"'medium'\"\n [disabled]=\"isLocked()\"\n (click)=\"toggleDropdown()\"\n (keydown.enter)=\"focusTagDropdown()\"\n cdkOverlayOrigin\n #dropdownTrigger=\"cdkOverlayOrigin\"\n ></ui-button>\n }\n </div>\n\n <div class=\"flex-container\">\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [ariaLabel]=\"'Scroll left button'\"\n [iconName]=\"'Arrow-chevron-left-in-line'\"\n [disabled]=\"isLocked() || tagsScrollContainer.scrollLeft === 0\"\n (click)=\"tagsScrollContainer.scrollBy({ left: -100, behavior: 'smooth' })\"\n ></ui-button>\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Arrow-chevron-right-in-line'\"\n [ariaLabel]=\"'Scroll right button'\"\n [disabled]=\"\n isLocked() ||\n tagsScrollContainer.scrollLeft + tagsScrollContainer.clientWidth >= tagsScrollContainer.scrollWidth\n \"\n (click)=\"tagsScrollContainer.scrollBy({ left: 100, behavior: 'smooth' })\"\n ></ui-button>\n </div>\n </div>\n }\n\n @if (showCharacterCount()) {\n <span class=\"prompt-character-count\" [class.over-limit]=\"isOverCharacterLimit()\"\n >{{ promptTextValue().length }} / {{ maxCharacters() }}</span\n >\n <span class=\"prompt-character-count-status\" aria-live=\"polite\">\n @if (characterCountAnnouncement(); as announcement) {\n {{ announcement.key | uiTranslate: announcement.params | async }}\n }\n </span>\n }\n\n @if (showSendButton()) {\n <ui-button\n class=\"send-button\"\n animate.enter=\"cnp-prompt-pop-in\"\n [variant]=\"'secondary'\"\n [iconName]=\"'Arrow-up-in-line'\"\n [tooltip]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [ariaLabel]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [size]=\"'medium'\"\n [disabled]=\"!canSubmit()\"\n (click)=\"sendPromptData()\"\n ></ui-button>\n }\n </div>\n\n <div class=\"prompt-projected-footer\">\n <ng-content select=\"[promptFooter]\"></ng-content>\n </div>\n </div>\n\n @if (errorMessage()) {\n <div class=\"prompt-error\" animate.enter=\"cnp-prompt-error-in\">\n <ui-icon [name]=\"'Error'\" color=\"red\"></ui-icon>\n <span>{{ errorMessage() }}</span>\n </div>\n }\n\n <!-- Dropdown for hidden tags -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"isDropdownOpened() && !isLocked()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"dropdownOutsideClick()\"\n >\n <div class=\"dropdown-container\" role=\"list\" #tagDropdown tabindex=\"0\" animate.enter=\"cnp-prompt-dropdown-in\">\n @for (tag of tagsInDropdown(); track tag) {\n <div\n class=\"dropdown-tag\"\n tabindex=\"0\"\n [attr.aria-label]=\"tag.label\"\n role=\"listitem\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n >\n {{ tag.label }}\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Built-in items dropdown (UI-877) \u2014 opens on focus, typing filters by label -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"itemsDropdownVisible()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"itemsDropdownOutsideClick($event)\"\n >\n <div\n class=\"dropdown-container custom-dropdown-container\"\n animate.enter=\"cnp-prompt-dropdown-in\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (dropdownHeading() || showDropdownClose()) {\n <div class=\"dropdown-header\">\n @if (dropdownHeading()) {\n <span class=\"dropdown-heading\">{{ dropdownHeading() }}</span>\n }\n @if (showDropdownClose()) {\n <ui-button\n class=\"dropdown-close\"\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Close-in-line'\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"closeItemsDropdown()\"\n ></ui-button>\n }\n </div>\n }\n <div role=\"list\">\n @for (item of filteredDropdownItems(); track item.id) {\n <div\n class=\"dropdown-tag dropdown-item\"\n tabindex=\"0\"\n role=\"listitem\"\n [attr.aria-label]=\"item.label\"\n (click)=\"selectDropdownItem(item, $event)\"\n (keydown.enter)=\"selectDropdownItem(item, $event)\"\n (keydown.space)=\"selectDropdownItem(item, $event)\"\n >\n @if (item.icon) {\n <ui-icon class=\"dropdown-item-icon\" [name]=\"item.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"dropdown-item-label\">{{ item.label }}</span>\n <ui-icon class=\"dropdown-item-chevron\" [name]=\"'Arrow-chevron-right-in-line'\" [color]=\"'inherit'\"></ui-icon>\n </div>\n }\n </div>\n </div>\n </ng-template>\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 ::ng-deep ui-field.prompt-text>mat-form-field{vertical-align:top}:host ::ng-deep ui-field.prompt-text .mat-mdc-text-field-wrapper{border-radius:10px!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper{background:transparent}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{padding-bottom:0!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper textarea{max-height:220px!important}:host ::ng-deep ui-button.send-button .rounded-icon .mdc-button{width:48px!important;height:48px!important}:host ::ng-deep ui-overflow-menu button.mat-mdc-unelevated-button.ghost.light-theme.only-icon{border:none}.prompt-container{border:1px solid #919191;border-radius:10px;background-color:#fff;outline:0 solid transparent;outline-offset:-2px;transition:border-color .18s cubic-bezier(.2,0,0,1),outline-color .18s cubic-bezier(.2,0,0,1),outline-width .12s cubic-bezier(.2,0,0,1);--ui-prompt-ring: inset 0 0 0 2px transparent}.prompt-container:after{content:\"\";position:absolute;z-index:1;inset:-1px;border-radius:inherit;box-shadow:var(--ui-prompt-ring);pointer-events:none;transition:box-shadow .18s cubic-bezier(.2,0,0,1)}.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px #000000;border:1px solid black;outline:1px solid black}.prompt-container.disabled{border:1px solid #d3d3d3}.prompt-container.disabled.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px transparent;outline-width:0}.prompt-container.disabled .prompt-icon{color:#d3d3d3}ui-field.prompt-text{transition:padding-left .12s cubic-bezier(.2,0,0,1)}ui-field.show-icon{padding-left:24px}.prompt-icon{position:absolute;top:14px;left:16px;color:#666;transition:color .12s cubic-bezier(.2,0,0,1)}.prompt-icon.hovered{color:#000}.dropdown-container{width:100%}.custom-dropdown-container{overflow:hidden;background-color:#fff;border-radius:0 0 8px 8px;box-shadow:0 8px 16px #00000014}.dropdown-header{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px}.dropdown-heading{font-weight:700}.dropdown-close{margin-left:auto}.dropdown-item{display:flex;gap:12px;align-items:center}.dropdown-item-icon,.dropdown-item-chevron{flex-shrink:0}.dropdown-item-label{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-tag{padding:16px;background-color:#fff;transition:background-color .12s cubic-bezier(.2,0,0,1)}.dropdown-tag:hover,.dropdown-tag:focus{background-color:#fff2fc;cursor:pointer}.carousel{flex-grow:1;min-width:0}.tag-container{overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tag-container::-webkit-scrollbar{display:none}.tag-container{margin:0 8px}.actions-menu{min-width:228px;margin:-8px}.actions-menu-item{display:flex;gap:12px;align-items:center;padding:8px;border-radius:8px;cursor:pointer;transition:background-color .12s cubic-bezier(.2,0,0,1)}.actions-menu-item:hover,.actions-menu-item:focus-visible{background-color:#fff2fc}.actions-menu-item[aria-disabled=true]{color:#d3d3d3;background-color:transparent;cursor:default}.actions-menu-item-icon,.actions-menu-item-trailing{flex-shrink:0}.actions-menu-item-label{flex:1;white-space:nowrap}#file-upload{display:none}.prompt-footer,.flex-container{display:flex;flex-flow:row nowrap;align-items:center}.prompt-footer{justify-content:space-between;padding:8px 16px}@media(max-width:600px){.prompt-footer{padding:8px}}@media(max-width:320px){.prompt-footer{padding:8px}}.prompt-character-count{margin-left:auto;padding-right:8px;color:#888;font-size:12px;line-height:16px;white-space:nowrap}.prompt-character-count.over-limit{color:#e02800}.prompt-character-count-status{position:absolute;left:-9999px}.prompt-projected-footer{display:none}.prompt-projected-footer:has(*){display:block;overflow:hidden;border-radius:0 0 9px 9px}.menu{display:flex;flex-flow:column nowrap;position:relative}.menu .menu-badge{position:absolute;right:0;z-index:1000}.view-more{margin-left:4px;white-space:nowrap}.view-more ::ng-deep button.mat-mdc-unelevated-button .label{white-space:nowrap}.prompt-container{position:relative}.prompt-container.has-error{--ui-prompt-ring: inset 0 0 0 2px #e02800;border:1px solid #e02800;outline:1px solid #e02800}.prompt-error{margin-top:4px;align-items:center;display:flex;color:#e02800;font-size:12px;line-height:16px}.prompt-error ui-icon{margin-right:4px}.prompt-loading{display:flex;flex-direction:column;gap:4px;padding:12px 16px 0}.prompt-loading ui-skeleton{height:20px}.ghost{position:absolute;top:0;left:0;bottom:16px;color:#888;border:none;pointer-events:none;background:transparent;width:100%;padding:12px 16px;font-size:inherit;line-height:22px;letter-spacing:inherit;font-weight:inherit;font-family:ModernGothic,sans-serif;resize:none}.prompt-help-text{overflow:hidden;white-space:pre-wrap;overflow-wrap:break-word}.prompt-help-text-mirror{color:transparent}.prompt-help-text-hint{color:#919191}@keyframes cnp-prompt-fade-in{0%{opacity:0}}@keyframes cnp-prompt-icon-in{0%{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-icon-out{to{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-row-in{0%{opacity:0;transform:translateY(6px)}}@keyframes cnp-prompt-pop-in{0%{opacity:0;transform:scale(.8)}}@keyframes cnp-prompt-error-in{0%{opacity:0;transform:translateY(-4px)}}@keyframes cnp-prompt-dropdown-in{0%{opacity:0;transform:translateY(-6px)}}.cnp-prompt-fade-in{animation:cnp-prompt-fade-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-in{animation:cnp-prompt-icon-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-out{animation:cnp-prompt-icon-out .12s cubic-bezier(.2,0,0,1) both}.cnp-prompt-row-in{animation:cnp-prompt-row-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-pop-in{animation:cnp-prompt-pop-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-error-in{animation:cnp-prompt-error-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-dropdown-in{animation:cnp-prompt-dropdown-in .18s cubic-bezier(.2,0,0,1) both}@media(prefers-reduced-motion:reduce){.prompt-container,.prompt-container:after,.prompt-icon,.dropdown-tag,ui-field.prompt-text{transition:none}.cnp-prompt-fade-in,.cnp-prompt-icon-in,.cnp-prompt-icon-out,.cnp-prompt-row-in,.cnp-prompt-pop-in,.cnp-prompt-error-in,.cnp-prompt-dropdown-in{animation-duration:1ms}}\n"] }]
513
- }], propDecorators: { tags: [{ type: i0.Input, args: [{ isSignal: true, alias: "tags", required: false }] }], actionTag: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionTag", required: false }] }], secondaryActionTag: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionTag", required: false }] }], collapseActionTags: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseActionTags", required: false }] }], maxCharacters: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCharacters", required: false }] }], supportedFileTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "supportedFileTypes", required: false }] }], autoClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClear", required: false }] }], showSendButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSendButton", required: false }] }], sendButtonDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonDisabled", required: false }] }], enableFileUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableFileUpload", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], dropdownItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownItems", required: false }] }], dropdownHeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownHeading", required: false }] }], showDropdownClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDropdownClose", required: false }] }], showCharacterCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCharacterCount", required: false }] }], helpText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpText", required: false }] }], disabled: [{
514
- type: Input,
515
- args: [{ transform: booleanAttribute }]
516
- }], promptData: [{ type: i0.Output, args: ["promptData"] }], actionTagFileSelected: [{ type: i0.Output, args: ["actionTagFileSelected"] }], secondaryActionTagPress: [{ type: i0.Output, args: ["secondaryActionTagPress"] }], dropdownItemSelected: [{ type: i0.Output, args: ["dropdownItemSelected"] }], dropdownClosed: [{ type: i0.Output, args: ["dropdownClosed"] }], fileDrop: [{ type: i0.ViewChild, args: ['fileDropRef', { isSignal: true }] }], tagDropdown: [{ type: i0.ViewChild, args: ['tagDropdown', { isSignal: true }] }], fieldComponentRef: [{ type: i0.ViewChild, args: ['textarea', { isSignal: true }] }], promptContainer: [{ type: i0.ViewChild, args: ['promptContainerRef', { isSignal: true }] }], actionsPopover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => PopoverDirective), { isSignal: true }] }], actionsMenu: [{ type: i0.ViewChild, args: ['actionsMenu', { isSignal: true }] }] } });
517
-
518
- class PromptModule {
519
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PromptModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
520
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: PromptModule, imports: [CommonModule,
521
- FieldComponentModule,
522
- ButtonComponentModule,
523
- OverflowMenuComponentModule,
524
- TagComponentModule,
525
- BadgeComponentModule,
526
- CdkOverlayOrigin,
527
- CdkConnectedOverlay,
528
- CardComponentModule,
529
- CdkTextareaAutosize,
530
- TooltipComponentModule,
531
- MatTooltip,
532
- UiTranslatePipe,
533
- IconComponentModule,
534
- SkeletonComponent,
535
- PromptComponent], exports: [PromptComponent] }); }
536
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PromptModule, imports: [CommonModule,
537
- FieldComponentModule,
538
- ButtonComponentModule,
539
- OverflowMenuComponentModule,
540
- TagComponentModule,
541
- BadgeComponentModule,
542
- CardComponentModule,
543
- TooltipComponentModule,
544
- IconComponentModule,
545
- SkeletonComponent,
546
- PromptComponent] }); }
547
- }
548
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PromptModule, decorators: [{
549
- type: NgModule,
550
- args: [{
551
- imports: [
552
- CommonModule,
553
- FieldComponentModule,
554
- ButtonComponentModule,
555
- OverflowMenuComponentModule,
556
- TagComponentModule,
557
- BadgeComponentModule,
558
- CdkOverlayOrigin,
559
- CdkConnectedOverlay,
560
- CardComponentModule,
561
- CdkTextareaAutosize,
562
- TooltipComponentModule,
563
- MatTooltip,
564
- UiTranslatePipe,
565
- IconComponentModule,
566
- SkeletonComponent,
567
- PromptComponent,
568
- ],
569
- exports: [PromptComponent],
570
- }]
571
- }] });
572
-
573
- /**
574
- * Generated bundle index. Do not edit.
575
- */
576
-
26
+ const resolveIcon = (icon, fallback) => icon === null ? "" : icon ?? fallback;
27
+ var PromptComponent = class PromptComponent {
28
+ constructor() {
29
+ this.disabledState = signal(false, ...ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []);
30
+ this.tags = input([], ...ngDevMode ? [{ debugName: "tags" }] : /* istanbul ignore next */ []);
31
+ this.actionTag = input(null, ...ngDevMode ? [{ debugName: "actionTag" }] : /* istanbul ignore next */ []);
32
+ this.secondaryActionTag = input(null, ...ngDevMode ? [{ debugName: "secondaryActionTag" }] : /* istanbul ignore next */ []);
33
+ this.collapseActionTags = input(false, {
34
+ ...ngDevMode ? { debugName: "collapseActionTags" } : /* istanbul ignore next */ {},
35
+ transform: booleanAttribute
36
+ });
37
+ this.maxCharacters = input(255, ...ngDevMode ? [{ debugName: "maxCharacters" }] : /* istanbul ignore next */ []);
38
+ this.supportedFileTypes = input("", ...ngDevMode ? [{ debugName: "supportedFileTypes" }] : /* istanbul ignore next */ []);
39
+ this.autoClear = input(true, ...ngDevMode ? [{ debugName: "autoClear" }] : /* istanbul ignore next */ []);
40
+ this.showSendButton = input(false, ...ngDevMode ? [{ debugName: "showSendButton" }] : /* istanbul ignore next */ []);
41
+ this.sendButtonDisabled = input(false, {
42
+ ...ngDevMode ? { debugName: "sendButtonDisabled" } : /* istanbul ignore next */ {},
43
+ transform: booleanAttribute
44
+ });
45
+ this.enableFileUpload = input(false, ...ngDevMode ? [{ debugName: "enableFileUpload" }] : /* istanbul ignore next */ []);
46
+ this.loading = input(false, {
47
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
48
+ transform: booleanAttribute
49
+ });
50
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
51
+ this.errorMessage = input("", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
52
+ this.dropdownItems = input([], ...ngDevMode ? [{ debugName: "dropdownItems" }] : /* istanbul ignore next */ []);
53
+ this.dropdownHeading = input("", ...ngDevMode ? [{ debugName: "dropdownHeading" }] : /* istanbul ignore next */ []);
54
+ this.showDropdownClose = input(false, {
55
+ ...ngDevMode ? { debugName: "showDropdownClose" } : /* istanbul ignore next */ {},
56
+ transform: booleanAttribute
57
+ });
58
+ this.showCharacterCount = input(false, {
59
+ ...ngDevMode ? { debugName: "showCharacterCount" } : /* istanbul ignore next */ {},
60
+ transform: booleanAttribute
61
+ });
62
+ this.helpText = input("", ...ngDevMode ? [{ debugName: "helpText" }] : /* istanbul ignore next */ []);
63
+ this.promptData = output();
64
+ this.actionTagFileSelected = output();
65
+ this.secondaryActionTagPress = output();
66
+ this.dropdownItemSelected = output();
67
+ this.dropdownClosed = output();
68
+ this.promptFilesList = signal([], ...ngDevMode ? [{ debugName: "promptFilesList" }] : /* istanbul ignore next */ []);
69
+ this.promptTextValue = signal("", ...ngDevMode ? [{ debugName: "promptTextValue" }] : /* istanbul ignore next */ []);
70
+ this.fileListMenuConfig = signal([], ...ngDevMode ? [{ debugName: "fileListMenuConfig" }] : /* istanbul ignore next */ []);
71
+ this.tagsVisible = signal([], ...ngDevMode ? [{ debugName: "tagsVisible" }] : /* istanbul ignore next */ []);
72
+ this.tagsInDropdown = signal([], ...ngDevMode ? [{ debugName: "tagsInDropdown" }] : /* istanbul ignore next */ []);
73
+ this.autocompleteSuggestion = signal("", ...ngDevMode ? [{ debugName: "autocompleteSuggestion" }] : /* istanbul ignore next */ []);
74
+ this.isDropdownOpened = signal(false, ...ngDevMode ? [{ debugName: "isDropdownOpened" }] : /* istanbul ignore next */ []);
75
+ this.actionsMenuId = `ui-prompt-actions-menu-${nextActionsMenuId++}`;
76
+ this.keepDropdownClosed = signal(false, ...ngDevMode ? [{ debugName: "keepDropdownClosed" }] : /* istanbul ignore next */ []);
77
+ this.isFieldHovered = signal(false, ...ngDevMode ? [{ debugName: "isFieldHovered" }] : /* istanbul ignore next */ []);
78
+ this.isFieldFocused = signal(false, ...ngDevMode ? [{ debugName: "isFieldFocused" }] : /* istanbul ignore next */ []);
79
+ this.composing = signal(false, ...ngDevMode ? [{ debugName: "composing" }] : /* istanbul ignore next */ []);
80
+ this.compositionEndedAt = 0;
81
+ this.filteredDropdownItems = computed(() => {
82
+ const query = this.promptTextValue().trim().toLowerCase();
83
+ return this.dropdownItems().filter((item) => {
84
+ const label = item.label.toLowerCase();
85
+ return label !== query && (!query || label.includes(query));
86
+ });
87
+ }, ...ngDevMode ? [{ debugName: "filteredDropdownItems" }] : /* istanbul ignore next */ []);
88
+ this.itemsDropdownVisible = computed(() => this.isFieldFocused() && !this.keepDropdownClosed() && this.filteredDropdownItems().length > 0 && !this.isLocked(), ...ngDevMode ? [{ debugName: "itemsDropdownVisible" }] : /* istanbul ignore next */ []);
89
+ this.isContainerFocused = signal(false, ...ngDevMode ? [{ debugName: "isContainerFocused" }] : /* istanbul ignore next */ []);
90
+ this.isHighlighted = computed(() => this.isFieldHovered() || this.isContainerFocused(), ...ngDevMode ? [{ debugName: "isHighlighted" }] : /* istanbul ignore next */ []);
91
+ this.showFocusRing = computed(() => this.isHighlighted() && !this.loading(), ...ngDevMode ? [{ debugName: "showFocusRing" }] : /* istanbul ignore next */ []);
92
+ this.fileInputAccept = computed(() => this.actionTag()?.acceptedFileTypes ?? this.supportedFileTypes(), ...ngDevMode ? [{ debugName: "fileInputAccept" }] : /* istanbul ignore next */ []);
93
+ this.isLocked = computed(() => this.disabledState() || this.loading(), ...ngDevMode ? [{ debugName: "isLocked" }] : /* istanbul ignore next */ []);
94
+ this.visibleHelpText = computed(() => this.promptTextValue() && !this.autocompleteSuggestion() && !this.isLocked() ? this.helpText().trim() : "", ...ngDevMode ? [{ debugName: "visibleHelpText" }] : /* istanbul ignore next */ []);
95
+ this.actionTagIcon = computed(() => resolveIcon(this.actionTag()?.icon, "Plus"), ...ngDevMode ? [{ debugName: "actionTagIcon" }] : /* istanbul ignore next */ []);
96
+ this.actionTagMenuTrailingIcon = computed(() => resolveIcon(this.actionTag()?.menuTrailingIcon, "Plus"), ...ngDevMode ? [{ debugName: "actionTagMenuTrailingIcon" }] : /* istanbul ignore next */ []);
97
+ this.secondaryActionTagMenuTrailingIcon = computed(() => resolveIcon(this.secondaryActionTag()?.menuTrailingIcon, "Arrow-chevron-right-in-line"), ...ngDevMode ? [{ debugName: "secondaryActionTagMenuTrailingIcon" }] : /* istanbul ignore next */ []);
98
+ this.actionsMenuEntries = computed(() => {
99
+ const secondary = this.secondaryActionTag();
100
+ const action = this.actionTag();
101
+ const entries = [];
102
+ if (secondary) entries.push({
103
+ kind: "secondary",
104
+ tag: secondary,
105
+ trailingIcon: this.secondaryActionTagMenuTrailingIcon()
106
+ });
107
+ if (action) entries.push({
108
+ kind: "action",
109
+ tag: action,
110
+ trailingIcon: this.actionTagMenuTrailingIcon()
111
+ });
112
+ return entries.sort((a, b) => (a.tag.menuOrder ?? Infinity) - (b.tag.menuOrder ?? Infinity));
113
+ }, ...ngDevMode ? [{ debugName: "actionsMenuEntries" }] : /* istanbul ignore next */ []);
114
+ this.isActionsMenuOpen = computed(() => this.actionsPopover()?.isOpen() ?? false, ...ngDevMode ? [{ debugName: "isActionsMenuOpen" }] : /* istanbul ignore next */ []);
115
+ this.showActionsMenuTrigger = computed(() => this.collapseActionTags() && Boolean(this.actionTag() ?? this.secondaryActionTag()), ...ngDevMode ? [{ debugName: "showActionsMenuTrigger" }] : /* istanbul ignore next */ []);
116
+ this.hasContent = computed(() => Boolean(this.promptTextValue().trim()) || this.promptFilesList().length > 0, ...ngDevMode ? [{ debugName: "hasContent" }] : /* istanbul ignore next */ []);
117
+ this.canSubmit = computed(() => !this.isLocked() && !this.sendButtonDisabled() && this.hasContent(), ...ngDevMode ? [{ debugName: "canSubmit" }] : /* istanbul ignore next */ []);
118
+ this.isOverCharacterLimit = computed(() => this.promptTextValue().length > this.maxCharacters(), ...ngDevMode ? [{ debugName: "isOverCharacterLimit" }] : /* istanbul ignore next */ []);
119
+ this.announcedTextValue = toSignal(toObservable(computed(() => this.showCharacterCount() ? this.promptTextValue() : "")).pipe(debounceTime(CHARACTER_COUNT_ANNOUNCE_DEBOUNCE_MS)), { initialValue: "" });
120
+ this.characterCountAnnouncement = computed(() => {
121
+ if (!this.showCharacterCount()) return null;
122
+ const max = this.maxCharacters();
123
+ const remaining = max - this.announcedTextValue().length;
124
+ if (remaining < 0) return {
125
+ key: "PROMPT.CHARACTERS_OVER_LIMIT",
126
+ params: { count: -remaining }
127
+ };
128
+ if (remaining <= max * CHARACTER_COUNT_ANNOUNCE_THRESHOLD) return {
129
+ key: "PROMPT.CHARACTERS_REMAINING",
130
+ params: { count: remaining }
131
+ };
132
+ return null;
133
+ }, ...ngDevMode ? [{ debugName: "characterCountAnnouncement" }] : /* istanbul ignore next */ []);
134
+ this.destroyRef = inject(DestroyRef);
135
+ this.translationPipe = inject(UiTranslatePipe);
136
+ this.resetOnLock = effect(() => {
137
+ if (this.isLocked()) {
138
+ this.isDropdownOpened.set(false);
139
+ this.actionsPopover()?.close();
140
+ this.isFieldFocused.set(false);
141
+ this.isFieldHovered.set(false);
142
+ this.isContainerFocused.set(false);
143
+ this.autocompleteSuggestion.set("");
144
+ this.composing.set(false);
145
+ }
146
+ }, ...ngDevMode ? [{ debugName: "resetOnLock" }] : /* istanbul ignore next */ []);
147
+ this.fileDrop = viewChild("fileDropRef", ...ngDevMode ? [{ debugName: "fileDrop" }] : /* istanbul ignore next */ []);
148
+ this.tagDropdown = viewChild("tagDropdown", ...ngDevMode ? [{ debugName: "tagDropdown" }] : /* istanbul ignore next */ []);
149
+ this.fieldComponentRef = viewChild.required("textarea", ...ngDevMode ? [{ debugName: "fieldComponentRef" }] : /* istanbul ignore next */ []);
150
+ this.promptContainer = viewChild.required("promptContainerRef", ...ngDevMode ? [{ debugName: "promptContainer" }] : /* istanbul ignore next */ []);
151
+ this.actionsPopover = viewChild(PopoverDirective, ...ngDevMode ? [{ debugName: "actionsPopover" }] : /* istanbul ignore next */ []);
152
+ this.actionsMenu = viewChild("actionsMenu", ...ngDevMode ? [{ debugName: "actionsMenu" }] : /* istanbul ignore next */ []);
153
+ this.dropdownPositions = [{
154
+ originX: "start",
155
+ originY: "bottom",
156
+ overlayX: "start",
157
+ overlayY: "top"
158
+ }];
159
+ this.onChange = (_value) => {};
160
+ this.onTouch = () => {};
161
+ }
162
+ get disabled() {
163
+ return this.disabledState();
164
+ }
165
+ set disabled(value) {
166
+ this.setDisabledState(value);
167
+ }
168
+ ngOnInit() {
169
+ this.initTags();
170
+ }
171
+ ngAfterViewInit() {
172
+ setTimeout(() => {
173
+ this.syncInputChange();
174
+ }, 0);
175
+ }
176
+ async uploadFile(event) {
177
+ const files = event.currentTarget.files;
178
+ if (files?.length) {
179
+ this.promptFilesList.update((list) => {
180
+ list.push(files.item(0));
181
+ return list;
182
+ });
183
+ this.emitValue();
184
+ await this.updateFileMenu();
185
+ }
186
+ }
187
+ sendPromptData() {
188
+ if (!this.canSubmit()) return;
189
+ this.promptData.emit({
190
+ text: this.promptTextValue() || "",
191
+ files: this.promptFilesList()
192
+ });
193
+ if (this.autoClear()) this.clearPromptData();
194
+ }
195
+ selectedMenuOption(menuOptionValue) {
196
+ const updatedConfig = this.fileListMenuConfig().filter((menu) => menu.value !== menuOptionValue);
197
+ const updatedFileList = this.promptFilesList().filter((file) => file.name !== menuOptionValue);
198
+ this.promptFilesList.set(updatedFileList);
199
+ this.fileListMenuConfig.set(updatedConfig);
200
+ }
201
+ selectTag(tag, event) {
202
+ if (this.isLocked()) return;
203
+ event.stopPropagation();
204
+ event.preventDefault();
205
+ this.isDropdownOpened.set(false);
206
+ this.promptTextValue.set(tag.label);
207
+ this.autocompleteSuggestion.set(`${tag.label} ${tag.autocomplete}`);
208
+ this.fieldComponentRef().field.nativeElement.focus();
209
+ this.onTouch();
210
+ }
211
+ onTextareaTab(event) {
212
+ if (this.isLocked()) return;
213
+ if (this.autocompleteSuggestion()) {
214
+ event.preventDefault();
215
+ this.promptTextValue.set(this.autocompleteSuggestion());
216
+ this.autocompleteSuggestion.set("");
217
+ }
218
+ }
219
+ onTextareaEnter(event) {
220
+ if (event.isComposing || this.composing() || Date.now() - this.compositionEndedAt < IME_COMMIT_GRACE_MS) return;
221
+ event.preventDefault();
222
+ this.sendPromptData();
223
+ }
224
+ dropdownOutsideClick() {
225
+ this.isDropdownOpened.set(false);
226
+ }
227
+ onFieldBlur() {
228
+ this.isFieldFocused.set(false);
229
+ }
230
+ onContainerFocusIn() {
231
+ this.isContainerFocused.set(true);
232
+ }
233
+ onContainerFocusOut(event) {
234
+ const next = event.relatedTarget;
235
+ if (next instanceof Node && this.promptContainer().nativeElement.contains(next)) return;
236
+ this.isContainerFocused.set(false);
237
+ }
238
+ itemsDropdownOutsideClick(event) {
239
+ if (this.promptContainer().nativeElement.contains(event.target)) return;
240
+ this.isFieldFocused.set(false);
241
+ this.dropdownClosed.emit();
242
+ }
243
+ closeItemsDropdown() {
244
+ this.keepDropdownClosed.set(true);
245
+ this.dropdownClosed.emit();
246
+ }
247
+ onTextareaEscape(event) {
248
+ if (this.itemsDropdownVisible()) {
249
+ event.stopPropagation();
250
+ this.closeItemsDropdown();
251
+ }
252
+ }
253
+ selectDropdownItem(item, event) {
254
+ if (this.isLocked()) return;
255
+ event.stopPropagation();
256
+ event.preventDefault();
257
+ this.keepDropdownClosed.set(true);
258
+ this.promptTextValue.set(item.label);
259
+ this.autocompleteSuggestion.set("");
260
+ this.fieldComponentRef().field.nativeElement.focus();
261
+ this.dropdownItemSelected.emit(item);
262
+ this.emitValue();
263
+ }
264
+ toggleDropdown() {
265
+ if (this.isLocked()) return;
266
+ this.isDropdownOpened.set(!this.isDropdownOpened());
267
+ }
268
+ focusTagDropdown() {
269
+ setTimeout(() => {
270
+ this.tagDropdown()?.nativeElement.focus();
271
+ }, 300);
272
+ }
273
+ syncInputChange() {
274
+ if (!this.fieldComponentRef()?.field?.nativeElement) return;
275
+ const textarea = this.fieldComponentRef().field.nativeElement;
276
+ fromEvent(textarea, "input").pipe(map((event) => event.target.value), tap((value) => {
277
+ this.promptTextValue.set(value);
278
+ this.keepDropdownClosed.set(false);
279
+ if (this.autocompleteSuggestion()) this.autocompleteSuggestion.set("");
280
+ }), debounceTime(INPUT_EMIT_DEBOUNCE_MS), tap(() => this.emitValue()), takeUntilDestroyed(this.destroyRef)).subscribe();
281
+ fromEvent(textarea, "compositionstart").pipe(tap(() => this.composing.set(true)), takeUntilDestroyed(this.destroyRef)).subscribe();
282
+ fromEvent(textarea, "compositionend").pipe(tap(() => {
283
+ this.composing.set(false);
284
+ this.compositionEndedAt = Date.now();
285
+ }), takeUntilDestroyed(this.destroyRef)).subscribe();
286
+ }
287
+ initTags() {
288
+ if (!this.tags()?.length) return;
289
+ if (this.tags().length <= 5) {
290
+ this.tagsVisible.set(this.tags());
291
+ return;
292
+ }
293
+ this.tagsVisible.set(this.tags().slice(0, 5));
294
+ this.tagsInDropdown.set(this.tags().slice(5));
295
+ }
296
+ async updateFileMenu() {
297
+ const menuConfig = [];
298
+ const tooltip = await firstValueFrom(this.translationPipe.transform("COMMON.DELETE"));
299
+ this.promptFilesList().forEach((file) => {
300
+ menuConfig.push({
301
+ label: file.name,
302
+ value: file.name,
303
+ icon: "Delete",
304
+ tooltipText: tooltip
305
+ });
306
+ });
307
+ this.fileListMenuConfig.set(menuConfig);
308
+ }
309
+ clearPromptData() {
310
+ this.promptTextValue.set("");
311
+ this.promptFilesList.set([]);
312
+ this.fileListMenuConfig.set([]);
313
+ }
314
+ writeValue(value) {
315
+ this.promptTextValue.set(value?.text ?? "");
316
+ this.promptFilesList.set(value?.files ?? []);
317
+ }
318
+ registerOnChange(fn) {
319
+ this.onChange = fn;
320
+ }
321
+ registerOnTouched(fn) {
322
+ this.onTouch = fn;
323
+ }
324
+ setDisabledState(isDisabled) {
325
+ this.disabledState.set(isDisabled);
326
+ }
327
+ async onFileSelected(event) {
328
+ if (this.isLocked()) return;
329
+ if (this.actionTag()) this.handleActionTagFile(event);
330
+ else await this.uploadFile(event);
331
+ }
332
+ onActionTagPress() {
333
+ if (this.isLocked() || this.actionTag()?.disabled) return;
334
+ this.fileDrop()?.nativeElement.click();
335
+ }
336
+ onSecondaryActionTagPress() {
337
+ if (this.isLocked() || this.secondaryActionTag()?.disabled) return;
338
+ this.secondaryActionTagPress.emit();
339
+ }
340
+ closeActionsMenu() {
341
+ this.actionsPopover()?.close();
342
+ }
343
+ onActionsMenuKeydown(event) {
344
+ const items = this.actionsMenuItems();
345
+ const current = items.indexOf(document.activeElement);
346
+ const focusAt = (index) => {
347
+ event.preventDefault();
348
+ items[(index + items.length) % items.length]?.focus();
349
+ };
350
+ switch (event.key) {
351
+ case "ArrowDown":
352
+ focusAt(current + 1);
353
+ break;
354
+ case "ArrowUp":
355
+ focusAt(current - 1);
356
+ break;
357
+ case "Home":
358
+ focusAt(0);
359
+ break;
360
+ case "End":
361
+ focusAt(items.length - 1);
362
+ break;
363
+ case "Escape":
364
+ event.preventDefault();
365
+ event.stopPropagation();
366
+ this.closeActionsMenu();
367
+ }
368
+ }
369
+ selectActionsMenuEntry(entry, event) {
370
+ if (entry.kind === "action") this.selectActionTagFromMenu(event);
371
+ else this.selectSecondaryActionTagFromMenu(event);
372
+ }
373
+ selectActionTagFromMenu(event) {
374
+ event.preventDefault();
375
+ if (this.actionTag()?.disabled) return;
376
+ this.closeActionsMenu();
377
+ this.onActionTagPress();
378
+ }
379
+ selectSecondaryActionTagFromMenu(event) {
380
+ event.preventDefault();
381
+ if (this.secondaryActionTag()?.disabled) return;
382
+ this.closeActionsMenu();
383
+ this.onSecondaryActionTagPress();
384
+ }
385
+ actionsMenuItems() {
386
+ const menu = this.actionsMenu()?.nativeElement;
387
+ return menu ? Array.from(menu.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")) : [];
388
+ }
389
+ handleActionTagFile(event) {
390
+ const inputEl = event.currentTarget;
391
+ const file = inputEl.files?.item(0) ?? null;
392
+ if (file) this.actionTagFileSelected.emit(file);
393
+ inputEl.value = "";
394
+ }
395
+ emitValue() {
396
+ this.onChange({
397
+ text: this.promptTextValue() || "",
398
+ files: this.promptFilesList()
399
+ });
400
+ this.onTouch();
401
+ }
402
+ static {
403
+ this.ɵfac = i0.ɵɵngDeclareFactory({
404
+ minVersion: "12.0.0",
405
+ version: "22.2.4",
406
+ ngImport: i0,
407
+ type: PromptComponent,
408
+ deps: [],
409
+ target: i0.ɵɵFactoryTarget.Component
410
+ });
411
+ }
412
+ static {
413
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
414
+ minVersion: "17.0.0",
415
+ version: "22.2.4",
416
+ type: PromptComponent,
417
+ isStandalone: true,
418
+ selector: "ui-prompt",
419
+ inputs: {
420
+ tags: {
421
+ classPropertyName: "tags",
422
+ publicName: "tags",
423
+ isSignal: true,
424
+ isRequired: false,
425
+ transformFunction: null
426
+ },
427
+ actionTag: {
428
+ classPropertyName: "actionTag",
429
+ publicName: "actionTag",
430
+ isSignal: true,
431
+ isRequired: false,
432
+ transformFunction: null
433
+ },
434
+ secondaryActionTag: {
435
+ classPropertyName: "secondaryActionTag",
436
+ publicName: "secondaryActionTag",
437
+ isSignal: true,
438
+ isRequired: false,
439
+ transformFunction: null
440
+ },
441
+ collapseActionTags: {
442
+ classPropertyName: "collapseActionTags",
443
+ publicName: "collapseActionTags",
444
+ isSignal: true,
445
+ isRequired: false,
446
+ transformFunction: null
447
+ },
448
+ maxCharacters: {
449
+ classPropertyName: "maxCharacters",
450
+ publicName: "maxCharacters",
451
+ isSignal: true,
452
+ isRequired: false,
453
+ transformFunction: null
454
+ },
455
+ supportedFileTypes: {
456
+ classPropertyName: "supportedFileTypes",
457
+ publicName: "supportedFileTypes",
458
+ isSignal: true,
459
+ isRequired: false,
460
+ transformFunction: null
461
+ },
462
+ autoClear: {
463
+ classPropertyName: "autoClear",
464
+ publicName: "autoClear",
465
+ isSignal: true,
466
+ isRequired: false,
467
+ transformFunction: null
468
+ },
469
+ showSendButton: {
470
+ classPropertyName: "showSendButton",
471
+ publicName: "showSendButton",
472
+ isSignal: true,
473
+ isRequired: false,
474
+ transformFunction: null
475
+ },
476
+ sendButtonDisabled: {
477
+ classPropertyName: "sendButtonDisabled",
478
+ publicName: "sendButtonDisabled",
479
+ isSignal: true,
480
+ isRequired: false,
481
+ transformFunction: null
482
+ },
483
+ enableFileUpload: {
484
+ classPropertyName: "enableFileUpload",
485
+ publicName: "enableFileUpload",
486
+ isSignal: true,
487
+ isRequired: false,
488
+ transformFunction: null
489
+ },
490
+ loading: {
491
+ classPropertyName: "loading",
492
+ publicName: "loading",
493
+ isSignal: true,
494
+ isRequired: false,
495
+ transformFunction: null
496
+ },
497
+ placeholder: {
498
+ classPropertyName: "placeholder",
499
+ publicName: "placeholder",
500
+ isSignal: true,
501
+ isRequired: false,
502
+ transformFunction: null
503
+ },
504
+ errorMessage: {
505
+ classPropertyName: "errorMessage",
506
+ publicName: "errorMessage",
507
+ isSignal: true,
508
+ isRequired: false,
509
+ transformFunction: null
510
+ },
511
+ dropdownItems: {
512
+ classPropertyName: "dropdownItems",
513
+ publicName: "dropdownItems",
514
+ isSignal: true,
515
+ isRequired: false,
516
+ transformFunction: null
517
+ },
518
+ dropdownHeading: {
519
+ classPropertyName: "dropdownHeading",
520
+ publicName: "dropdownHeading",
521
+ isSignal: true,
522
+ isRequired: false,
523
+ transformFunction: null
524
+ },
525
+ showDropdownClose: {
526
+ classPropertyName: "showDropdownClose",
527
+ publicName: "showDropdownClose",
528
+ isSignal: true,
529
+ isRequired: false,
530
+ transformFunction: null
531
+ },
532
+ showCharacterCount: {
533
+ classPropertyName: "showCharacterCount",
534
+ publicName: "showCharacterCount",
535
+ isSignal: true,
536
+ isRequired: false,
537
+ transformFunction: null
538
+ },
539
+ helpText: {
540
+ classPropertyName: "helpText",
541
+ publicName: "helpText",
542
+ isSignal: true,
543
+ isRequired: false,
544
+ transformFunction: null
545
+ },
546
+ disabled: {
547
+ classPropertyName: "disabled",
548
+ publicName: "disabled",
549
+ isSignal: false,
550
+ isRequired: false,
551
+ transformFunction: booleanAttribute
552
+ }
553
+ },
554
+ outputs: {
555
+ promptData: "promptData",
556
+ actionTagFileSelected: "actionTagFileSelected",
557
+ secondaryActionTagPress: "secondaryActionTagPress",
558
+ dropdownItemSelected: "dropdownItemSelected",
559
+ dropdownClosed: "dropdownClosed"
560
+ },
561
+ providers: [UiTranslatePipe, {
562
+ provide: NG_VALUE_ACCESSOR,
563
+ useExisting: forwardRef(() => PromptComponent),
564
+ multi: true
565
+ }],
566
+ viewQueries: [
567
+ {
568
+ propertyName: "fileDrop",
569
+ first: true,
570
+ predicate: ["fileDropRef"],
571
+ descendants: true,
572
+ isSignal: true
573
+ },
574
+ {
575
+ propertyName: "tagDropdown",
576
+ first: true,
577
+ predicate: ["tagDropdown"],
578
+ descendants: true,
579
+ isSignal: true
580
+ },
581
+ {
582
+ propertyName: "fieldComponentRef",
583
+ first: true,
584
+ predicate: ["textarea"],
585
+ descendants: true,
586
+ isSignal: true
587
+ },
588
+ {
589
+ propertyName: "promptContainer",
590
+ first: true,
591
+ predicate: ["promptContainerRef"],
592
+ descendants: true,
593
+ isSignal: true
594
+ },
595
+ {
596
+ propertyName: "actionsPopover",
597
+ first: true,
598
+ predicate: PopoverDirective,
599
+ descendants: true,
600
+ isSignal: true
601
+ },
602
+ {
603
+ propertyName: "actionsMenu",
604
+ first: true,
605
+ predicate: ["actionsMenu"],
606
+ descendants: true,
607
+ isSignal: true
608
+ }
609
+ ],
610
+ ngImport: i0,
611
+ template: "<ng-container>\n <div\n class=\"prompt-container\"\n [class.has-error]=\"!!errorMessage()\"\n [class.disabled]=\"isLocked()\"\n [attr.aria-disabled]=\"isLocked()\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n cdkOverlayOrigin\n #promptOrigin=\"cdkOverlayOrigin\"\n #promptContainerRef\n [class.prompt-container-focused]=\"showFocusRing()\"\n (focusin)=\"onContainerFocusIn()\"\n (focusout)=\"onContainerFocusOut($event)\"\n >\n @if (loading()) {\n <div class=\"prompt-loading\" aria-hidden=\"true\" animate.enter=\"cnp-prompt-fade-in\">\n <ui-skeleton [theme]=\"{ width: '100%', height: '20px', margin: '0' }\"></ui-skeleton>\n <ui-skeleton [theme]=\"{ width: '30%', height: '20px', margin: '0' }\"></ui-skeleton>\n </div>\n }\n <div class=\"prompt-autocomplete\" [hidden]=\"loading()\">\n <textarea tabindex=\"-1\" class=\"ghost\" id=\"autocomplete\" [value]=\"autocompleteSuggestion()\" readonly></textarea>\n @if (visibleHelpText(); as help) {\n <!-- The mirror repeats the typed text invisibly so the hint lands right after its last character. -->\n <div class=\"ghost prompt-help-text\" aria-hidden=\"true\">\n <span class=\"prompt-help-text-mirror\">{{ promptTextValue() }}</span\n ><span class=\"prompt-help-text-hint\">{{ ' ' + help }}</span>\n </div>\n }\n\n @let showIcon = !isFieldFocused() && !promptTextValue();\n @if (showIcon) {\n <ui-icon\n class=\"prompt-icon\"\n animate.enter=\"cnp-prompt-icon-in\"\n animate.leave=\"cnp-prompt-icon-out\"\n [color]=\"'inherit'\"\n [class.hovered]=\"isFieldHovered()\"\n [name]=\"'Sparkle-in-line'\"\n ></ui-icon>\n }\n <!-- `keydown.enter` matches unmodified Enter only; Shift+Enter resolves to `shift.enter`\n and falls through to a newline. Do not add a shiftKey check. -->\n <ui-field\n #textarea\n class=\"prompt-text\"\n [class.show-icon]=\"showIcon\"\n role=\"input\"\n [showBottomContent]=\"false\"\n [borderless]=\"true\"\n [type]=\"'multi-line'\"\n [autosizableTextarea]=\"true\"\n [maxCharacters]=\"maxCharacters()\"\n [placeholder]=\"showIcon ? placeholder() || ('PROMPT.ASK_ANYTHING' | uiTranslate | async)! : ''\"\n [value]=\"promptTextValue() || ''\"\n [hasTextAreaCounter]=\"false\"\n [ariaDescribedby]=\"visibleHelpText()\"\n [disabled]=\"disabled\"\n (mouseenter)=\"isFieldHovered.set(true)\"\n (mouseleave)=\"isFieldHovered.set(false)\"\n (focusin)=\"isFieldFocused.set(true)\"\n (fieldBlur)=\"onFieldBlur()\"\n (keydown.tab)=\"onTextareaTab($event)\"\n (keydown.enter)=\"onTextareaEnter($event)\"\n (keydown.escape)=\"onTextareaEscape($event)\"\n ></ui-field>\n </div>\n <div class=\"prompt-footer flex-container\">\n <div class=\"flex-container\">\n @if (showActionsMenuTrigger()) {\n <ui-button\n [uiPopover]=\"actionsMenuTemplate\"\n [popoverTrigger]=\"'click'\"\n [popoverCardSize]=\"'small'\"\n [popoverAlign]=\"'start'\"\n [popoverOffset]=\"8\"\n [popoverAriaLabel]=\"('COMMON.ADD' | uiTranslate | async)!\"\n [uiPopoverDisabled]=\"isLocked()\"\n [variant]=\"'icon-button'\"\n [iconName]=\"isActionsMenuOpen() ? 'Close' : 'Plus'\"\n [tooltip]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [ariaExpanded]=\"isActionsMenuOpen()\"\n [ariaControls]=\"isActionsMenuOpen() ? actionsMenuId : undefined\"\n [disabled]=\"isLocked()\"\n ></ui-button>\n\n <ng-template #actionsMenuTemplate>\n <div\n class=\"actions-menu\"\n role=\"menu\"\n #actionsMenu\n [id]=\"actionsMenuId\"\n (keydown)=\"onActionsMenuKeydown($event)\"\n >\n @for (entry of actionsMenuEntries(); track entry.kind) {\n <div\n class=\"actions-menu-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.aria-label]=\"entry.tag.ariaLabel ?? entry.tag.label\"\n [attr.aria-disabled]=\"entry.tag.disabled ? 'true' : null\"\n (click)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.enter)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.space)=\"selectActionsMenuEntry(entry, $event)\"\n >\n @if (entry.tag.icon) {\n <ui-icon class=\"actions-menu-item-icon\" [name]=\"entry.tag.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"actions-menu-item-label\">{{ entry.tag.label }}</span>\n @if (entry.trailingIcon) {\n <ui-icon\n class=\"actions-menu-item-trailing\"\n [name]=\"entry.trailingIcon\"\n [color]=\"'inherit'\"\n ></ui-icon>\n }\n </div>\n }\n </div>\n </ng-template>\n }\n\n @if (actionTag(); as at) {\n @if (!collapseActionTags()) {\n <ui-tag\n [label]=\"at.label\"\n [icon]=\"actionTagIcon()\"\n [ariaLabel]=\"at.ariaLabel ?? at.label\"\n [isDisabled]=\"isLocked() || !!at.disabled\"\n (press)=\"onActionTagPress()\"\n ></ui-tag>\n }\n } @else if (enableFileUpload()) {\n <ui-button\n [variant]=\"'icon-button'\"\n [tooltip]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [iconName]=\"'Plus'\"\n [disabled]=\"isLocked()\"\n (click)=\"fileDrop()?.nativeElement?.click()\"\n ></ui-button>\n\n @if (promptFilesList().length) {\n <div class=\"menu\" animate.enter=\"cnp-prompt-pop-in\">\n <ui-badge\n [notificationsAmount]=\"promptFilesList().length\"\n [variant]=\"'notification'\"\n class=\"menu-badge\"\n ></ui-badge>\n <ui-overflow-menu\n [matTooltip]=\"('PROMPT.FILES' | uiTranslate | async)!\"\n [matTooltipPosition]=\"'above'\"\n [buttonSize]=\"'medium'\"\n [iconTrigger]=\"'Document'\"\n [buttonVariant]=\"'ghost'\"\n [buttons]=\"fileListMenuConfig()\"\n [isDynamicMenu]=\"true\"\n [withRemovableOption]=\"true\"\n (selectItem)=\"selectedMenuOption($event)\"\n ></ui-overflow-menu>\n </div>\n }\n }\n\n @if (secondaryActionTag(); as sat) {\n @if (!collapseActionTags()) {\n <ui-tag\n class=\"prompt-secondary-action-tag\"\n [label]=\"sat.label\"\n [icon]=\"sat.icon ?? ''\"\n [ariaLabel]=\"sat.ariaLabel ?? sat.label\"\n [isDisabled]=\"isLocked() || !!sat.disabled\"\n (press)=\"onSecondaryActionTagPress()\"\n ></ui-tag>\n }\n }\n\n @if (actionTag() || enableFileUpload()) {\n <input\n data-testid=\"prompt-file-input\"\n [tabIndex]=\"-1\"\n class=\"form-control\"\n #fileDropRef\n type=\"file\"\n id=\"file-upload\"\n [accept]=\"fileInputAccept()\"\n [disabled]=\"isLocked()\"\n (change)=\"onFileSelected($event)\"\n />\n }\n </div>\n\n @if (tags()?.length && !promptTextValue()) {\n <div class=\"flex-container carousel\" animate.enter=\"cnp-prompt-row-in\">\n <div class=\"tag-container flex-container\" role=\"list\" #tagsScrollContainer>\n @for (tag of tagsVisible(); track tag) {\n <ui-tag\n [label]=\"tag.label\"\n role=\"listitem\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"isLocked()\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n ></ui-tag>\n }\n\n @if (tagsInDropdown().length) {\n <ui-button\n class=\"view-more\"\n variant=\"text-inline\"\n [label]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [ariaLabel]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [size]=\"'medium'\"\n [disabled]=\"isLocked()\"\n (click)=\"toggleDropdown()\"\n (keydown.enter)=\"focusTagDropdown()\"\n cdkOverlayOrigin\n #dropdownTrigger=\"cdkOverlayOrigin\"\n ></ui-button>\n }\n </div>\n\n <div class=\"flex-container\">\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [ariaLabel]=\"'Scroll left button'\"\n [iconName]=\"'Arrow-chevron-left-in-line'\"\n [disabled]=\"isLocked() || tagsScrollContainer.scrollLeft === 0\"\n (click)=\"tagsScrollContainer.scrollBy({ left: -100, behavior: 'smooth' })\"\n ></ui-button>\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Arrow-chevron-right-in-line'\"\n [ariaLabel]=\"'Scroll right button'\"\n [disabled]=\"\n isLocked() ||\n tagsScrollContainer.scrollLeft + tagsScrollContainer.clientWidth >= tagsScrollContainer.scrollWidth\n \"\n (click)=\"tagsScrollContainer.scrollBy({ left: 100, behavior: 'smooth' })\"\n ></ui-button>\n </div>\n </div>\n }\n\n @if (showCharacterCount()) {\n <span class=\"prompt-character-count\" [class.over-limit]=\"isOverCharacterLimit()\"\n >{{ promptTextValue().length }} / {{ maxCharacters() }}</span\n >\n <span class=\"prompt-character-count-status\" aria-live=\"polite\">\n @if (characterCountAnnouncement(); as announcement) {\n {{ announcement.key | uiTranslate: announcement.params | async }}\n }\n </span>\n }\n\n @if (showSendButton()) {\n <ui-button\n class=\"send-button\"\n animate.enter=\"cnp-prompt-pop-in\"\n [variant]=\"'secondary'\"\n [iconName]=\"'Arrow-up-in-line'\"\n [tooltip]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [ariaLabel]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [size]=\"'medium'\"\n [disabled]=\"!canSubmit()\"\n (click)=\"sendPromptData()\"\n ></ui-button>\n }\n </div>\n\n <div class=\"prompt-projected-footer\">\n <ng-content select=\"[promptFooter]\"></ng-content>\n </div>\n </div>\n\n @if (errorMessage()) {\n <div class=\"prompt-error\" animate.enter=\"cnp-prompt-error-in\">\n <ui-icon [name]=\"'Error'\" color=\"red\"></ui-icon>\n <span>{{ errorMessage() }}</span>\n </div>\n }\n\n <!-- Dropdown for hidden tags -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"isDropdownOpened() && !isLocked()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"dropdownOutsideClick()\"\n >\n <div class=\"dropdown-container\" role=\"list\" #tagDropdown tabindex=\"0\" animate.enter=\"cnp-prompt-dropdown-in\">\n @for (tag of tagsInDropdown(); track tag) {\n <div\n class=\"dropdown-tag\"\n tabindex=\"0\"\n [attr.aria-label]=\"tag.label\"\n role=\"listitem\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n >\n {{ tag.label }}\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Built-in items dropdown (UI-877) — opens on focus, typing filters by label -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"itemsDropdownVisible()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"itemsDropdownOutsideClick($event)\"\n >\n <div\n class=\"dropdown-container custom-dropdown-container\"\n animate.enter=\"cnp-prompt-dropdown-in\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (dropdownHeading() || showDropdownClose()) {\n <div class=\"dropdown-header\">\n @if (dropdownHeading()) {\n <span class=\"dropdown-heading\">{{ dropdownHeading() }}</span>\n }\n @if (showDropdownClose()) {\n <ui-button\n class=\"dropdown-close\"\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Close-in-line'\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"closeItemsDropdown()\"\n ></ui-button>\n }\n </div>\n }\n <div role=\"list\">\n @for (item of filteredDropdownItems(); track item.id) {\n <div\n class=\"dropdown-tag dropdown-item\"\n tabindex=\"0\"\n role=\"listitem\"\n [attr.aria-label]=\"item.label\"\n (click)=\"selectDropdownItem(item, $event)\"\n (keydown.enter)=\"selectDropdownItem(item, $event)\"\n (keydown.space)=\"selectDropdownItem(item, $event)\"\n >\n @if (item.icon) {\n <ui-icon class=\"dropdown-item-icon\" [name]=\"item.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"dropdown-item-label\">{{ item.label }}</span>\n <ui-icon class=\"dropdown-item-chevron\" [name]=\"'Arrow-chevron-right-in-line'\" [color]=\"'inherit'\"></ui-icon>\n </div>\n }\n </div>\n </div>\n </ng-template>\n</ng-container>\n",
612
+ 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 ::ng-deep ui-field.prompt-text>mat-form-field{vertical-align:top}:host ::ng-deep ui-field.prompt-text .mat-mdc-text-field-wrapper{border-radius:10px!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper{background:transparent}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{padding-bottom:0!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper textarea{max-height:220px!important}:host ::ng-deep ui-button.send-button .rounded-icon .mdc-button{width:48px!important;height:48px!important}:host ::ng-deep ui-overflow-menu button.mat-mdc-unelevated-button.ghost.light-theme.only-icon{border:none}.prompt-container{border:1px solid #919191;border-radius:10px;background-color:#fff;outline:0 solid transparent;outline-offset:-2px;transition:border-color .18s cubic-bezier(.2,0,0,1),outline-color .18s cubic-bezier(.2,0,0,1),outline-width .12s cubic-bezier(.2,0,0,1);--ui-prompt-ring: inset 0 0 0 2px transparent}.prompt-container:after{content:\"\";position:absolute;z-index:1;inset:-1px;border-radius:inherit;box-shadow:var(--ui-prompt-ring);pointer-events:none;transition:box-shadow .18s cubic-bezier(.2,0,0,1)}.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px #000000;border:1px solid black;outline:1px solid black}.prompt-container.disabled{border:1px solid #d3d3d3}.prompt-container.disabled.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px transparent;outline-width:0}.prompt-container.disabled .prompt-icon{color:#d3d3d3}ui-field.prompt-text{transition:padding-left .12s cubic-bezier(.2,0,0,1)}ui-field.show-icon{padding-left:24px}.prompt-icon{position:absolute;top:14px;left:16px;color:#666;transition:color .12s cubic-bezier(.2,0,0,1)}.prompt-icon.hovered{color:#000}.dropdown-container{width:100%}.custom-dropdown-container{overflow:hidden;background-color:#fff;border-radius:0 0 8px 8px;box-shadow:0 8px 16px #00000014}.dropdown-header{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px}.dropdown-heading{font-weight:700}.dropdown-close{margin-left:auto}.dropdown-item{display:flex;gap:12px;align-items:center}.dropdown-item-icon,.dropdown-item-chevron{flex-shrink:0}.dropdown-item-label{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-tag{padding:16px;background-color:#fff;transition:background-color .12s cubic-bezier(.2,0,0,1)}.dropdown-tag:hover,.dropdown-tag:focus{background-color:#fff2fc;cursor:pointer}.carousel{flex-grow:1;min-width:0}.tag-container{overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tag-container::-webkit-scrollbar{display:none}.tag-container{margin:0 8px}.actions-menu{min-width:228px;margin:-8px}.actions-menu-item{display:flex;gap:12px;align-items:center;padding:8px;border-radius:8px;cursor:pointer;transition:background-color .12s cubic-bezier(.2,0,0,1)}.actions-menu-item:hover,.actions-menu-item:focus-visible{background-color:#fff2fc}.actions-menu-item[aria-disabled=true]{color:#d3d3d3;background-color:transparent;cursor:default}.actions-menu-item-icon,.actions-menu-item-trailing{flex-shrink:0}.actions-menu-item-label{flex:1;white-space:nowrap}#file-upload{display:none}.prompt-footer,.flex-container{display:flex;flex-flow:row nowrap;align-items:center}.prompt-footer{justify-content:space-between;padding:8px 16px}@media(max-width:600px){.prompt-footer{padding:8px}}@media(max-width:320px){.prompt-footer{padding:8px}}.prompt-character-count{margin-left:auto;padding-right:8px;color:#888;font-size:12px;line-height:16px;white-space:nowrap}.prompt-character-count.over-limit{color:#e02800}.prompt-character-count-status{position:absolute;left:-9999px}.prompt-projected-footer{display:none}.prompt-projected-footer:has(*){display:block;overflow:hidden;border-radius:0 0 9px 9px}.menu{display:flex;flex-flow:column nowrap;position:relative}.menu .menu-badge{position:absolute;right:0;z-index:1000}.view-more{margin-left:4px;white-space:nowrap}.view-more ::ng-deep button.mat-mdc-unelevated-button .label{white-space:nowrap}.prompt-container{position:relative}.prompt-container.has-error{--ui-prompt-ring: inset 0 0 0 2px #e02800;border:1px solid #e02800;outline:1px solid #e02800}.prompt-error{margin-top:4px;align-items:center;display:flex;color:#e02800;font-size:12px;line-height:16px}.prompt-error ui-icon{margin-right:4px}.prompt-loading{display:flex;flex-direction:column;gap:4px;padding:12px 16px 0}.prompt-loading ui-skeleton{height:20px}.ghost{position:absolute;top:0;left:0;bottom:16px;color:#888;border:none;pointer-events:none;background:transparent;width:100%;padding:12px 16px;font-size:inherit;line-height:22px;letter-spacing:inherit;font-weight:inherit;font-family:ModernGothic,sans-serif;resize:none}.prompt-help-text{overflow:hidden;white-space:pre-wrap;overflow-wrap:break-word}.prompt-help-text-mirror{color:transparent}.prompt-help-text-hint{color:#919191}@keyframes cnp-prompt-fade-in{0%{opacity:0}}@keyframes cnp-prompt-icon-in{0%{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-icon-out{to{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-row-in{0%{opacity:0;transform:translateY(6px)}}@keyframes cnp-prompt-pop-in{0%{opacity:0;transform:scale(.8)}}@keyframes cnp-prompt-error-in{0%{opacity:0;transform:translateY(-4px)}}@keyframes cnp-prompt-dropdown-in{0%{opacity:0;transform:translateY(-6px)}}.cnp-prompt-fade-in{animation:cnp-prompt-fade-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-in{animation:cnp-prompt-icon-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-out{animation:cnp-prompt-icon-out .12s cubic-bezier(.2,0,0,1) both}.cnp-prompt-row-in{animation:cnp-prompt-row-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-pop-in{animation:cnp-prompt-pop-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-error-in{animation:cnp-prompt-error-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-dropdown-in{animation:cnp-prompt-dropdown-in .18s cubic-bezier(.2,0,0,1) both}@media(prefers-reduced-motion:reduce){.prompt-container,.prompt-container:after,.prompt-icon,.dropdown-tag,ui-field.prompt-text{transition:none}.cnp-prompt-fade-in,.cnp-prompt-icon-in,.cnp-prompt-icon-out,.cnp-prompt-row-in,.cnp-prompt-pop-in,.cnp-prompt-error-in,.cnp-prompt-dropdown-in{animation-duration:1ms}}\n"],
613
+ dependencies: [
614
+ {
615
+ kind: "directive",
616
+ type: CdkOverlayOrigin,
617
+ selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
618
+ exportAs: ["cdkOverlayOrigin"]
619
+ },
620
+ {
621
+ kind: "component",
622
+ type: SkeletonComponent,
623
+ selector: "ui-skeleton",
624
+ inputs: [
625
+ "count",
626
+ "theme",
627
+ "appearance",
628
+ "isAiTheme",
629
+ "applicationTheme"
630
+ ]
631
+ },
632
+ {
633
+ kind: "component",
634
+ type: IconComponent,
635
+ selector: "ui-icon",
636
+ inputs: [
637
+ "size",
638
+ "cssClass",
639
+ "name",
640
+ "color",
641
+ "filled",
642
+ "toggleIconStyle",
643
+ "applicationTheme",
644
+ "useFullIconName"
645
+ ]
646
+ },
647
+ {
648
+ kind: "component",
649
+ type: FieldComponent,
650
+ selector: "ui-field",
651
+ inputs: [
652
+ "fullWidth",
653
+ "fullHeight",
654
+ "label",
655
+ "labelHtml",
656
+ "labelIcon",
657
+ "fieldName",
658
+ "placeholder",
659
+ "id",
660
+ "value",
661
+ "badgeVariant",
662
+ "errors",
663
+ "disabled",
664
+ "required",
665
+ "readOnly",
666
+ "hintMessage",
667
+ "type",
668
+ "updateOnBlur",
669
+ "allowOnlyDigits",
670
+ "isAutocompleteOff",
671
+ "allowNegative",
672
+ "showBottomContent",
673
+ "applicationTheme",
674
+ "ariaLabel",
675
+ "testId",
676
+ "loading",
677
+ "isValid",
678
+ "maxCharacters",
679
+ "trimOnBlur",
680
+ "trimOnSubmit",
681
+ "maxRows",
682
+ "hasTextAreaCounter",
683
+ "hideBuiltInErrors",
684
+ "hideLabelInErrors",
685
+ "max",
686
+ "min",
687
+ "textareaHeight",
688
+ "borderless",
689
+ "autosizableTextarea",
690
+ "isAIVariant",
691
+ "ariaLabelledby",
692
+ "ariaDescribedby",
693
+ "hasError"
694
+ ],
695
+ outputs: ["validateEvent", "fieldBlur"]
696
+ },
697
+ {
698
+ kind: "component",
699
+ type: TagComponent,
700
+ selector: "ui-tag",
701
+ inputs: [
702
+ "label",
703
+ "icon",
704
+ "allowClose",
705
+ "readOnly",
706
+ "isSelected",
707
+ "showIconWhenSelected",
708
+ "pinnedBackground",
709
+ "constrainWidth",
710
+ "isDisabled",
711
+ "applicationTheme",
712
+ "ariaLabel",
713
+ "testId",
714
+ "ariaRequired",
715
+ "showBadge",
716
+ "notificationsAmount"
717
+ ],
718
+ outputs: [
719
+ "isSelectedChange",
720
+ "close",
721
+ "press"
722
+ ]
723
+ },
724
+ {
725
+ kind: "component",
726
+ type: ButtonComponent,
727
+ selector: "ui-button",
728
+ inputs: [
729
+ "size",
730
+ "variant",
731
+ "label",
732
+ "iconPosition",
733
+ "justIcon",
734
+ "iconName",
735
+ "trailingIconName",
736
+ "trailingIconFilled",
737
+ "disabled",
738
+ "loading",
739
+ "loadingWithLabel",
740
+ "fullWidth",
741
+ "url",
742
+ "urlTarget",
743
+ "value",
744
+ "tooltip",
745
+ "isPremium",
746
+ "type",
747
+ "companyColor",
748
+ "buttonBadgeConfig",
749
+ "applicationTheme",
750
+ "disabledScaleOnClick",
751
+ "ariaLabel",
752
+ "ariaExpanded",
753
+ "ariaControls",
754
+ "ariaPressed",
755
+ "ariaRequired",
756
+ "ariaLabelledby",
757
+ "ariaDescribedby",
758
+ "preventDefault",
759
+ "hasBackground",
760
+ "tooltipPosition",
761
+ "role",
762
+ "iconFilled",
763
+ "testId"
764
+ ],
765
+ outputs: ["buttonClickEvent", "buttonHoverEvent"]
766
+ },
767
+ {
768
+ kind: "component",
769
+ type: BadgeComponent,
770
+ selector: "ui-badge",
771
+ inputs: [
772
+ "label",
773
+ "staticLabel",
774
+ "icon",
775
+ "iconColor",
776
+ "trailingIcon",
777
+ "trailingIconColor",
778
+ "color",
779
+ "variant",
780
+ "notificationsAmount",
781
+ "applicationTheme",
782
+ "rebrandColor",
783
+ "truncateLabel",
784
+ "enableAnimation"
785
+ ]
786
+ },
787
+ {
788
+ kind: "component",
789
+ type: OverflowMenuComponent,
790
+ selector: "ui-overflow-menu",
791
+ inputs: [
792
+ "buttons",
793
+ "iconTrigger",
794
+ "menuLabel",
795
+ "applicationTheme",
796
+ "ariaLabel",
797
+ "testId",
798
+ "ariaRequired",
799
+ "describedby",
800
+ "contentTemplateRef",
801
+ "buttonVariant",
802
+ "buttonSize",
803
+ "menuConfig",
804
+ "selectionMode",
805
+ "menuAnchor",
806
+ "shouldMatchAnchorWidth",
807
+ "isDynamicMenu",
808
+ "withRemovableOption"
809
+ ],
810
+ outputs: [
811
+ "selectItem",
812
+ "menuOpened",
813
+ "menuClosed"
814
+ ]
815
+ },
816
+ {
817
+ kind: "directive",
818
+ type: MatTooltip,
819
+ selector: "[matTooltip]",
820
+ inputs: [
821
+ "matTooltipPosition",
822
+ "matTooltipPositionAtOrigin",
823
+ "matTooltipDisabled",
824
+ "matTooltipShowDelay",
825
+ "matTooltipHideDelay",
826
+ "matTooltipTouchGestures",
827
+ "matTooltip",
828
+ "matTooltipClass"
829
+ ],
830
+ exportAs: ["matTooltip"]
831
+ },
832
+ {
833
+ kind: "directive",
834
+ type: CdkConnectedOverlay,
835
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
836
+ inputs: [
837
+ "cdkConnectedOverlayOrigin",
838
+ "cdkConnectedOverlayPositions",
839
+ "cdkConnectedOverlayPositionStrategy",
840
+ "cdkConnectedOverlayOffsetX",
841
+ "cdkConnectedOverlayOffsetY",
842
+ "cdkConnectedOverlayWidth",
843
+ "cdkConnectedOverlayHeight",
844
+ "cdkConnectedOverlayMinWidth",
845
+ "cdkConnectedOverlayMinHeight",
846
+ "cdkConnectedOverlayBackdropClass",
847
+ "cdkConnectedOverlayPanelClass",
848
+ "cdkConnectedOverlayViewportMargin",
849
+ "cdkConnectedOverlayScrollStrategy",
850
+ "cdkConnectedOverlayOpen",
851
+ "cdkConnectedOverlayDisableClose",
852
+ "cdkConnectedOverlayTransformOriginOn",
853
+ "cdkConnectedOverlayHasBackdrop",
854
+ "cdkConnectedOverlayLockPosition",
855
+ "cdkConnectedOverlayFlexibleDimensions",
856
+ "cdkConnectedOverlayGrowAfterOpen",
857
+ "cdkConnectedOverlayPush",
858
+ "cdkConnectedOverlayDisposeOnNavigation",
859
+ "cdkConnectedOverlayUsePopover",
860
+ "cdkConnectedOverlayMatchWidth",
861
+ "cdkConnectedOverlay"
862
+ ],
863
+ outputs: [
864
+ "backdropClick",
865
+ "positionChange",
866
+ "attach",
867
+ "detach",
868
+ "overlayKeydown",
869
+ "overlayOutsideClick"
870
+ ],
871
+ exportAs: ["cdkConnectedOverlay"]
872
+ },
873
+ {
874
+ kind: "directive",
875
+ type: PopoverDirective,
876
+ selector: "[uiPopover]",
877
+ inputs: [
878
+ "uiPopover",
879
+ "popoverOffset",
880
+ "popoverAlign",
881
+ "popoverOpen",
882
+ "popoverCard",
883
+ "popoverCardSize",
884
+ "popoverTrigger",
885
+ "popoverAriaLabel",
886
+ "uiPopoverDisabled"
887
+ ],
888
+ exportAs: ["uiPopover"]
889
+ },
890
+ {
891
+ kind: "pipe",
892
+ type: AsyncPipe,
893
+ name: "async"
894
+ },
895
+ {
896
+ kind: "pipe",
897
+ type: UiTranslatePipe,
898
+ name: "uiTranslate"
899
+ }
900
+ ],
901
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
902
+ });
903
+ }
904
+ };
905
+ i0.ɵɵngDeclareClassMetadata({
906
+ minVersion: "12.0.0",
907
+ version: "22.2.4",
908
+ ngImport: i0,
909
+ type: PromptComponent,
910
+ decorators: [{
911
+ type: Component,
912
+ args: [{
913
+ selector: "ui-prompt",
914
+ providers: [UiTranslatePipe, {
915
+ provide: NG_VALUE_ACCESSOR,
916
+ useExisting: forwardRef(() => PromptComponent),
917
+ multi: true
918
+ }],
919
+ changeDetection: ChangeDetectionStrategy.OnPush,
920
+ imports: [
921
+ CdkOverlayOrigin,
922
+ NgClass,
923
+ SkeletonComponent,
924
+ IconComponent,
925
+ FieldComponent,
926
+ TagComponent,
927
+ ButtonComponent,
928
+ BadgeComponent,
929
+ OverflowMenuComponent,
930
+ MatTooltip,
931
+ CdkConnectedOverlay,
932
+ PopoverDirective,
933
+ AsyncPipe,
934
+ UiTranslatePipe
935
+ ],
936
+ template: "<ng-container>\n <div\n class=\"prompt-container\"\n [class.has-error]=\"!!errorMessage()\"\n [class.disabled]=\"isLocked()\"\n [attr.aria-disabled]=\"isLocked()\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n cdkOverlayOrigin\n #promptOrigin=\"cdkOverlayOrigin\"\n #promptContainerRef\n [class.prompt-container-focused]=\"showFocusRing()\"\n (focusin)=\"onContainerFocusIn()\"\n (focusout)=\"onContainerFocusOut($event)\"\n >\n @if (loading()) {\n <div class=\"prompt-loading\" aria-hidden=\"true\" animate.enter=\"cnp-prompt-fade-in\">\n <ui-skeleton [theme]=\"{ width: '100%', height: '20px', margin: '0' }\"></ui-skeleton>\n <ui-skeleton [theme]=\"{ width: '30%', height: '20px', margin: '0' }\"></ui-skeleton>\n </div>\n }\n <div class=\"prompt-autocomplete\" [hidden]=\"loading()\">\n <textarea tabindex=\"-1\" class=\"ghost\" id=\"autocomplete\" [value]=\"autocompleteSuggestion()\" readonly></textarea>\n @if (visibleHelpText(); as help) {\n <!-- The mirror repeats the typed text invisibly so the hint lands right after its last character. -->\n <div class=\"ghost prompt-help-text\" aria-hidden=\"true\">\n <span class=\"prompt-help-text-mirror\">{{ promptTextValue() }}</span\n ><span class=\"prompt-help-text-hint\">{{ ' ' + help }}</span>\n </div>\n }\n\n @let showIcon = !isFieldFocused() && !promptTextValue();\n @if (showIcon) {\n <ui-icon\n class=\"prompt-icon\"\n animate.enter=\"cnp-prompt-icon-in\"\n animate.leave=\"cnp-prompt-icon-out\"\n [color]=\"'inherit'\"\n [class.hovered]=\"isFieldHovered()\"\n [name]=\"'Sparkle-in-line'\"\n ></ui-icon>\n }\n <!-- `keydown.enter` matches unmodified Enter only; Shift+Enter resolves to `shift.enter`\n and falls through to a newline. Do not add a shiftKey check. -->\n <ui-field\n #textarea\n class=\"prompt-text\"\n [class.show-icon]=\"showIcon\"\n role=\"input\"\n [showBottomContent]=\"false\"\n [borderless]=\"true\"\n [type]=\"'multi-line'\"\n [autosizableTextarea]=\"true\"\n [maxCharacters]=\"maxCharacters()\"\n [placeholder]=\"showIcon ? placeholder() || ('PROMPT.ASK_ANYTHING' | uiTranslate | async)! : ''\"\n [value]=\"promptTextValue() || ''\"\n [hasTextAreaCounter]=\"false\"\n [ariaDescribedby]=\"visibleHelpText()\"\n [disabled]=\"disabled\"\n (mouseenter)=\"isFieldHovered.set(true)\"\n (mouseleave)=\"isFieldHovered.set(false)\"\n (focusin)=\"isFieldFocused.set(true)\"\n (fieldBlur)=\"onFieldBlur()\"\n (keydown.tab)=\"onTextareaTab($event)\"\n (keydown.enter)=\"onTextareaEnter($event)\"\n (keydown.escape)=\"onTextareaEscape($event)\"\n ></ui-field>\n </div>\n <div class=\"prompt-footer flex-container\">\n <div class=\"flex-container\">\n @if (showActionsMenuTrigger()) {\n <ui-button\n [uiPopover]=\"actionsMenuTemplate\"\n [popoverTrigger]=\"'click'\"\n [popoverCardSize]=\"'small'\"\n [popoverAlign]=\"'start'\"\n [popoverOffset]=\"8\"\n [popoverAriaLabel]=\"('COMMON.ADD' | uiTranslate | async)!\"\n [uiPopoverDisabled]=\"isLocked()\"\n [variant]=\"'icon-button'\"\n [iconName]=\"isActionsMenuOpen() ? 'Close' : 'Plus'\"\n [tooltip]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"((isActionsMenuOpen() ? 'COMMON.CLOSE' : 'COMMON.ADD') | uiTranslate | async)!\"\n [ariaExpanded]=\"isActionsMenuOpen()\"\n [ariaControls]=\"isActionsMenuOpen() ? actionsMenuId : undefined\"\n [disabled]=\"isLocked()\"\n ></ui-button>\n\n <ng-template #actionsMenuTemplate>\n <div\n class=\"actions-menu\"\n role=\"menu\"\n #actionsMenu\n [id]=\"actionsMenuId\"\n (keydown)=\"onActionsMenuKeydown($event)\"\n >\n @for (entry of actionsMenuEntries(); track entry.kind) {\n <div\n class=\"actions-menu-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.aria-label]=\"entry.tag.ariaLabel ?? entry.tag.label\"\n [attr.aria-disabled]=\"entry.tag.disabled ? 'true' : null\"\n (click)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.enter)=\"selectActionsMenuEntry(entry, $event)\"\n (keydown.space)=\"selectActionsMenuEntry(entry, $event)\"\n >\n @if (entry.tag.icon) {\n <ui-icon class=\"actions-menu-item-icon\" [name]=\"entry.tag.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"actions-menu-item-label\">{{ entry.tag.label }}</span>\n @if (entry.trailingIcon) {\n <ui-icon\n class=\"actions-menu-item-trailing\"\n [name]=\"entry.trailingIcon\"\n [color]=\"'inherit'\"\n ></ui-icon>\n }\n </div>\n }\n </div>\n </ng-template>\n }\n\n @if (actionTag(); as at) {\n @if (!collapseActionTags()) {\n <ui-tag\n [label]=\"at.label\"\n [icon]=\"actionTagIcon()\"\n [ariaLabel]=\"at.ariaLabel ?? at.label\"\n [isDisabled]=\"isLocked() || !!at.disabled\"\n (press)=\"onActionTagPress()\"\n ></ui-tag>\n }\n } @else if (enableFileUpload()) {\n <ui-button\n [variant]=\"'icon-button'\"\n [tooltip]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('PROMPT.ADD_FILES' | uiTranslate | async)!\"\n [iconName]=\"'Plus'\"\n [disabled]=\"isLocked()\"\n (click)=\"fileDrop()?.nativeElement?.click()\"\n ></ui-button>\n\n @if (promptFilesList().length) {\n <div class=\"menu\" animate.enter=\"cnp-prompt-pop-in\">\n <ui-badge\n [notificationsAmount]=\"promptFilesList().length\"\n [variant]=\"'notification'\"\n class=\"menu-badge\"\n ></ui-badge>\n <ui-overflow-menu\n [matTooltip]=\"('PROMPT.FILES' | uiTranslate | async)!\"\n [matTooltipPosition]=\"'above'\"\n [buttonSize]=\"'medium'\"\n [iconTrigger]=\"'Document'\"\n [buttonVariant]=\"'ghost'\"\n [buttons]=\"fileListMenuConfig()\"\n [isDynamicMenu]=\"true\"\n [withRemovableOption]=\"true\"\n (selectItem)=\"selectedMenuOption($event)\"\n ></ui-overflow-menu>\n </div>\n }\n }\n\n @if (secondaryActionTag(); as sat) {\n @if (!collapseActionTags()) {\n <ui-tag\n class=\"prompt-secondary-action-tag\"\n [label]=\"sat.label\"\n [icon]=\"sat.icon ?? ''\"\n [ariaLabel]=\"sat.ariaLabel ?? sat.label\"\n [isDisabled]=\"isLocked() || !!sat.disabled\"\n (press)=\"onSecondaryActionTagPress()\"\n ></ui-tag>\n }\n }\n\n @if (actionTag() || enableFileUpload()) {\n <input\n data-testid=\"prompt-file-input\"\n [tabIndex]=\"-1\"\n class=\"form-control\"\n #fileDropRef\n type=\"file\"\n id=\"file-upload\"\n [accept]=\"fileInputAccept()\"\n [disabled]=\"isLocked()\"\n (change)=\"onFileSelected($event)\"\n />\n }\n </div>\n\n @if (tags()?.length && !promptTextValue()) {\n <div class=\"flex-container carousel\" animate.enter=\"cnp-prompt-row-in\">\n <div class=\"tag-container flex-container\" role=\"list\" #tagsScrollContainer>\n @for (tag of tagsVisible(); track tag) {\n <ui-tag\n [label]=\"tag.label\"\n role=\"listitem\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"isLocked()\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n ></ui-tag>\n }\n\n @if (tagsInDropdown().length) {\n <ui-button\n class=\"view-more\"\n variant=\"text-inline\"\n [label]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [ariaLabel]=\"('PROMPT.VIEW_MORE' | uiTranslate | async)!\"\n [size]=\"'medium'\"\n [disabled]=\"isLocked()\"\n (click)=\"toggleDropdown()\"\n (keydown.enter)=\"focusTagDropdown()\"\n cdkOverlayOrigin\n #dropdownTrigger=\"cdkOverlayOrigin\"\n ></ui-button>\n }\n </div>\n\n <div class=\"flex-container\">\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [ariaLabel]=\"'Scroll left button'\"\n [iconName]=\"'Arrow-chevron-left-in-line'\"\n [disabled]=\"isLocked() || tagsScrollContainer.scrollLeft === 0\"\n (click)=\"tagsScrollContainer.scrollBy({ left: -100, behavior: 'smooth' })\"\n ></ui-button>\n <ui-button\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Arrow-chevron-right-in-line'\"\n [ariaLabel]=\"'Scroll right button'\"\n [disabled]=\"\n isLocked() ||\n tagsScrollContainer.scrollLeft + tagsScrollContainer.clientWidth >= tagsScrollContainer.scrollWidth\n \"\n (click)=\"tagsScrollContainer.scrollBy({ left: 100, behavior: 'smooth' })\"\n ></ui-button>\n </div>\n </div>\n }\n\n @if (showCharacterCount()) {\n <span class=\"prompt-character-count\" [class.over-limit]=\"isOverCharacterLimit()\"\n >{{ promptTextValue().length }} / {{ maxCharacters() }}</span\n >\n <span class=\"prompt-character-count-status\" aria-live=\"polite\">\n @if (characterCountAnnouncement(); as announcement) {\n {{ announcement.key | uiTranslate: announcement.params | async }}\n }\n </span>\n }\n\n @if (showSendButton()) {\n <ui-button\n class=\"send-button\"\n animate.enter=\"cnp-prompt-pop-in\"\n [variant]=\"'secondary'\"\n [iconName]=\"'Arrow-up-in-line'\"\n [tooltip]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [ariaLabel]=\"('COMMON.SEND' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [size]=\"'medium'\"\n [disabled]=\"!canSubmit()\"\n (click)=\"sendPromptData()\"\n ></ui-button>\n }\n </div>\n\n <div class=\"prompt-projected-footer\">\n <ng-content select=\"[promptFooter]\"></ng-content>\n </div>\n </div>\n\n @if (errorMessage()) {\n <div class=\"prompt-error\" animate.enter=\"cnp-prompt-error-in\">\n <ui-icon [name]=\"'Error'\" color=\"red\"></ui-icon>\n <span>{{ errorMessage() }}</span>\n </div>\n }\n\n <!-- Dropdown for hidden tags -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"isDropdownOpened() && !isLocked()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"dropdownOutsideClick()\"\n >\n <div class=\"dropdown-container\" role=\"list\" #tagDropdown tabindex=\"0\" animate.enter=\"cnp-prompt-dropdown-in\">\n @for (tag of tagsInDropdown(); track tag) {\n <div\n class=\"dropdown-tag\"\n tabindex=\"0\"\n [attr.aria-label]=\"tag.label\"\n role=\"listitem\"\n (click)=\"selectTag(tag, $event)\"\n (keyup.enter)=\"selectTag(tag, $event)\"\n (keyup.space)=\"selectTag(tag, $event)\"\n >\n {{ tag.label }}\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Built-in items dropdown (UI-877) — opens on focus, typing filters by label -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"promptOrigin\"\n [cdkConnectedOverlayOpen]=\"itemsDropdownVisible()\"\n [cdkConnectedOverlayPositions]=\"dropdownPositions\"\n [cdkConnectedOverlayWidth]=\"promptContainerRef?.offsetWidth || 0\"\n (overlayOutsideClick)=\"itemsDropdownOutsideClick($event)\"\n >\n <div\n class=\"dropdown-container custom-dropdown-container\"\n animate.enter=\"cnp-prompt-dropdown-in\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (dropdownHeading() || showDropdownClose()) {\n <div class=\"dropdown-header\">\n @if (dropdownHeading()) {\n <span class=\"dropdown-heading\">{{ dropdownHeading() }}</span>\n }\n @if (showDropdownClose()) {\n <ui-button\n class=\"dropdown-close\"\n [variant]=\"'icon-button'\"\n [size]=\"'small'\"\n [iconName]=\"'Close-in-line'\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n [tooltipPosition]=\"'above'\"\n [ariaLabel]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"closeItemsDropdown()\"\n ></ui-button>\n }\n </div>\n }\n <div role=\"list\">\n @for (item of filteredDropdownItems(); track item.id) {\n <div\n class=\"dropdown-tag dropdown-item\"\n tabindex=\"0\"\n role=\"listitem\"\n [attr.aria-label]=\"item.label\"\n (click)=\"selectDropdownItem(item, $event)\"\n (keydown.enter)=\"selectDropdownItem(item, $event)\"\n (keydown.space)=\"selectDropdownItem(item, $event)\"\n >\n @if (item.icon) {\n <ui-icon class=\"dropdown-item-icon\" [name]=\"item.icon\" [color]=\"'inherit'\"></ui-icon>\n }\n <span class=\"dropdown-item-label\">{{ item.label }}</span>\n <ui-icon class=\"dropdown-item-chevron\" [name]=\"'Arrow-chevron-right-in-line'\" [color]=\"'inherit'\"></ui-icon>\n </div>\n }\n </div>\n </div>\n </ng-template>\n</ng-container>\n",
937
+ 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 ::ng-deep ui-field.prompt-text>mat-form-field{vertical-align:top}:host ::ng-deep ui-field.prompt-text .mat-mdc-text-field-wrapper{border-radius:10px!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper{background:transparent}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{padding-bottom:0!important}:host ::ng-deep .ui-field .mat-mdc-form-field.multi-line-textarea.mat-mdc-form-field-type-mat-input.mat-form-field-appearance-outline .mat-mdc-text-field-wrapper textarea{max-height:220px!important}:host ::ng-deep ui-button.send-button .rounded-icon .mdc-button{width:48px!important;height:48px!important}:host ::ng-deep ui-overflow-menu button.mat-mdc-unelevated-button.ghost.light-theme.only-icon{border:none}.prompt-container{border:1px solid #919191;border-radius:10px;background-color:#fff;outline:0 solid transparent;outline-offset:-2px;transition:border-color .18s cubic-bezier(.2,0,0,1),outline-color .18s cubic-bezier(.2,0,0,1),outline-width .12s cubic-bezier(.2,0,0,1);--ui-prompt-ring: inset 0 0 0 2px transparent}.prompt-container:after{content:\"\";position:absolute;z-index:1;inset:-1px;border-radius:inherit;box-shadow:var(--ui-prompt-ring);pointer-events:none;transition:box-shadow .18s cubic-bezier(.2,0,0,1)}.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px #000000;border:1px solid black;outline:1px solid black}.prompt-container.disabled{border:1px solid #d3d3d3}.prompt-container.disabled.prompt-container-focused{--ui-prompt-ring: inset 0 0 0 2px transparent;outline-width:0}.prompt-container.disabled .prompt-icon{color:#d3d3d3}ui-field.prompt-text{transition:padding-left .12s cubic-bezier(.2,0,0,1)}ui-field.show-icon{padding-left:24px}.prompt-icon{position:absolute;top:14px;left:16px;color:#666;transition:color .12s cubic-bezier(.2,0,0,1)}.prompt-icon.hovered{color:#000}.dropdown-container{width:100%}.custom-dropdown-container{overflow:hidden;background-color:#fff;border-radius:0 0 8px 8px;box-shadow:0 8px 16px #00000014}.dropdown-header{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px}.dropdown-heading{font-weight:700}.dropdown-close{margin-left:auto}.dropdown-item{display:flex;gap:12px;align-items:center}.dropdown-item-icon,.dropdown-item-chevron{flex-shrink:0}.dropdown-item-label{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-tag{padding:16px;background-color:#fff;transition:background-color .12s cubic-bezier(.2,0,0,1)}.dropdown-tag:hover,.dropdown-tag:focus{background-color:#fff2fc;cursor:pointer}.carousel{flex-grow:1;min-width:0}.tag-container{overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tag-container::-webkit-scrollbar{display:none}.tag-container{margin:0 8px}.actions-menu{min-width:228px;margin:-8px}.actions-menu-item{display:flex;gap:12px;align-items:center;padding:8px;border-radius:8px;cursor:pointer;transition:background-color .12s cubic-bezier(.2,0,0,1)}.actions-menu-item:hover,.actions-menu-item:focus-visible{background-color:#fff2fc}.actions-menu-item[aria-disabled=true]{color:#d3d3d3;background-color:transparent;cursor:default}.actions-menu-item-icon,.actions-menu-item-trailing{flex-shrink:0}.actions-menu-item-label{flex:1;white-space:nowrap}#file-upload{display:none}.prompt-footer,.flex-container{display:flex;flex-flow:row nowrap;align-items:center}.prompt-footer{justify-content:space-between;padding:8px 16px}@media(max-width:600px){.prompt-footer{padding:8px}}@media(max-width:320px){.prompt-footer{padding:8px}}.prompt-character-count{margin-left:auto;padding-right:8px;color:#888;font-size:12px;line-height:16px;white-space:nowrap}.prompt-character-count.over-limit{color:#e02800}.prompt-character-count-status{position:absolute;left:-9999px}.prompt-projected-footer{display:none}.prompt-projected-footer:has(*){display:block;overflow:hidden;border-radius:0 0 9px 9px}.menu{display:flex;flex-flow:column nowrap;position:relative}.menu .menu-badge{position:absolute;right:0;z-index:1000}.view-more{margin-left:4px;white-space:nowrap}.view-more ::ng-deep button.mat-mdc-unelevated-button .label{white-space:nowrap}.prompt-container{position:relative}.prompt-container.has-error{--ui-prompt-ring: inset 0 0 0 2px #e02800;border:1px solid #e02800;outline:1px solid #e02800}.prompt-error{margin-top:4px;align-items:center;display:flex;color:#e02800;font-size:12px;line-height:16px}.prompt-error ui-icon{margin-right:4px}.prompt-loading{display:flex;flex-direction:column;gap:4px;padding:12px 16px 0}.prompt-loading ui-skeleton{height:20px}.ghost{position:absolute;top:0;left:0;bottom:16px;color:#888;border:none;pointer-events:none;background:transparent;width:100%;padding:12px 16px;font-size:inherit;line-height:22px;letter-spacing:inherit;font-weight:inherit;font-family:ModernGothic,sans-serif;resize:none}.prompt-help-text{overflow:hidden;white-space:pre-wrap;overflow-wrap:break-word}.prompt-help-text-mirror{color:transparent}.prompt-help-text-hint{color:#919191}@keyframes cnp-prompt-fade-in{0%{opacity:0}}@keyframes cnp-prompt-icon-in{0%{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-icon-out{to{opacity:0;transform:translate(-4px) scale(.9)}}@keyframes cnp-prompt-row-in{0%{opacity:0;transform:translateY(6px)}}@keyframes cnp-prompt-pop-in{0%{opacity:0;transform:scale(.8)}}@keyframes cnp-prompt-error-in{0%{opacity:0;transform:translateY(-4px)}}@keyframes cnp-prompt-dropdown-in{0%{opacity:0;transform:translateY(-6px)}}.cnp-prompt-fade-in{animation:cnp-prompt-fade-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-in{animation:cnp-prompt-icon-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-icon-out{animation:cnp-prompt-icon-out .12s cubic-bezier(.2,0,0,1) both}.cnp-prompt-row-in{animation:cnp-prompt-row-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-pop-in{animation:cnp-prompt-pop-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-error-in{animation:cnp-prompt-error-in .18s cubic-bezier(.2,0,0,1) both}.cnp-prompt-dropdown-in{animation:cnp-prompt-dropdown-in .18s cubic-bezier(.2,0,0,1) both}@media(prefers-reduced-motion:reduce){.prompt-container,.prompt-container:after,.prompt-icon,.dropdown-tag,ui-field.prompt-text{transition:none}.cnp-prompt-fade-in,.cnp-prompt-icon-in,.cnp-prompt-icon-out,.cnp-prompt-row-in,.cnp-prompt-pop-in,.cnp-prompt-error-in,.cnp-prompt-dropdown-in{animation-duration:1ms}}\n"]
938
+ }]
939
+ }],
940
+ propDecorators: {
941
+ tags: [{
942
+ type: i0.Input,
943
+ args: [{
944
+ isSignal: true,
945
+ alias: "tags",
946
+ required: false
947
+ }]
948
+ }],
949
+ actionTag: [{
950
+ type: i0.Input,
951
+ args: [{
952
+ isSignal: true,
953
+ alias: "actionTag",
954
+ required: false
955
+ }]
956
+ }],
957
+ secondaryActionTag: [{
958
+ type: i0.Input,
959
+ args: [{
960
+ isSignal: true,
961
+ alias: "secondaryActionTag",
962
+ required: false
963
+ }]
964
+ }],
965
+ collapseActionTags: [{
966
+ type: i0.Input,
967
+ args: [{
968
+ isSignal: true,
969
+ alias: "collapseActionTags",
970
+ required: false
971
+ }]
972
+ }],
973
+ maxCharacters: [{
974
+ type: i0.Input,
975
+ args: [{
976
+ isSignal: true,
977
+ alias: "maxCharacters",
978
+ required: false
979
+ }]
980
+ }],
981
+ supportedFileTypes: [{
982
+ type: i0.Input,
983
+ args: [{
984
+ isSignal: true,
985
+ alias: "supportedFileTypes",
986
+ required: false
987
+ }]
988
+ }],
989
+ autoClear: [{
990
+ type: i0.Input,
991
+ args: [{
992
+ isSignal: true,
993
+ alias: "autoClear",
994
+ required: false
995
+ }]
996
+ }],
997
+ showSendButton: [{
998
+ type: i0.Input,
999
+ args: [{
1000
+ isSignal: true,
1001
+ alias: "showSendButton",
1002
+ required: false
1003
+ }]
1004
+ }],
1005
+ sendButtonDisabled: [{
1006
+ type: i0.Input,
1007
+ args: [{
1008
+ isSignal: true,
1009
+ alias: "sendButtonDisabled",
1010
+ required: false
1011
+ }]
1012
+ }],
1013
+ enableFileUpload: [{
1014
+ type: i0.Input,
1015
+ args: [{
1016
+ isSignal: true,
1017
+ alias: "enableFileUpload",
1018
+ required: false
1019
+ }]
1020
+ }],
1021
+ loading: [{
1022
+ type: i0.Input,
1023
+ args: [{
1024
+ isSignal: true,
1025
+ alias: "loading",
1026
+ required: false
1027
+ }]
1028
+ }],
1029
+ placeholder: [{
1030
+ type: i0.Input,
1031
+ args: [{
1032
+ isSignal: true,
1033
+ alias: "placeholder",
1034
+ required: false
1035
+ }]
1036
+ }],
1037
+ errorMessage: [{
1038
+ type: i0.Input,
1039
+ args: [{
1040
+ isSignal: true,
1041
+ alias: "errorMessage",
1042
+ required: false
1043
+ }]
1044
+ }],
1045
+ dropdownItems: [{
1046
+ type: i0.Input,
1047
+ args: [{
1048
+ isSignal: true,
1049
+ alias: "dropdownItems",
1050
+ required: false
1051
+ }]
1052
+ }],
1053
+ dropdownHeading: [{
1054
+ type: i0.Input,
1055
+ args: [{
1056
+ isSignal: true,
1057
+ alias: "dropdownHeading",
1058
+ required: false
1059
+ }]
1060
+ }],
1061
+ showDropdownClose: [{
1062
+ type: i0.Input,
1063
+ args: [{
1064
+ isSignal: true,
1065
+ alias: "showDropdownClose",
1066
+ required: false
1067
+ }]
1068
+ }],
1069
+ showCharacterCount: [{
1070
+ type: i0.Input,
1071
+ args: [{
1072
+ isSignal: true,
1073
+ alias: "showCharacterCount",
1074
+ required: false
1075
+ }]
1076
+ }],
1077
+ helpText: [{
1078
+ type: i0.Input,
1079
+ args: [{
1080
+ isSignal: true,
1081
+ alias: "helpText",
1082
+ required: false
1083
+ }]
1084
+ }],
1085
+ disabled: [{
1086
+ type: Input,
1087
+ args: [{ transform: booleanAttribute }]
1088
+ }],
1089
+ promptData: [{
1090
+ type: i0.Output,
1091
+ args: ["promptData"]
1092
+ }],
1093
+ actionTagFileSelected: [{
1094
+ type: i0.Output,
1095
+ args: ["actionTagFileSelected"]
1096
+ }],
1097
+ secondaryActionTagPress: [{
1098
+ type: i0.Output,
1099
+ args: ["secondaryActionTagPress"]
1100
+ }],
1101
+ dropdownItemSelected: [{
1102
+ type: i0.Output,
1103
+ args: ["dropdownItemSelected"]
1104
+ }],
1105
+ dropdownClosed: [{
1106
+ type: i0.Output,
1107
+ args: ["dropdownClosed"]
1108
+ }],
1109
+ fileDrop: [{
1110
+ type: i0.ViewChild,
1111
+ args: ["fileDropRef", { isSignal: true }]
1112
+ }],
1113
+ tagDropdown: [{
1114
+ type: i0.ViewChild,
1115
+ args: ["tagDropdown", { isSignal: true }]
1116
+ }],
1117
+ fieldComponentRef: [{
1118
+ type: i0.ViewChild,
1119
+ args: ["textarea", { isSignal: true }]
1120
+ }],
1121
+ promptContainer: [{
1122
+ type: i0.ViewChild,
1123
+ args: ["promptContainerRef", { isSignal: true }]
1124
+ }],
1125
+ actionsPopover: [{
1126
+ type: i0.ViewChild,
1127
+ args: [i0.forwardRef(() => PopoverDirective), { isSignal: true }]
1128
+ }],
1129
+ actionsMenu: [{
1130
+ type: i0.ViewChild,
1131
+ args: ["actionsMenu", { isSignal: true }]
1132
+ }]
1133
+ }
1134
+ });
1135
+ var PromptModule = class PromptModule {
1136
+ static {
1137
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1138
+ minVersion: "12.0.0",
1139
+ version: "22.2.4",
1140
+ ngImport: i0,
1141
+ type: PromptModule,
1142
+ deps: [],
1143
+ target: i0.ɵɵFactoryTarget.NgModule
1144
+ });
1145
+ }
1146
+ static {
1147
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
1148
+ minVersion: "14.0.0",
1149
+ version: "22.2.4",
1150
+ ngImport: i0,
1151
+ type: PromptModule,
1152
+ imports: [
1153
+ CommonModule,
1154
+ FieldComponentModule,
1155
+ ButtonComponentModule,
1156
+ OverflowMenuComponentModule,
1157
+ TagComponentModule,
1158
+ BadgeComponentModule,
1159
+ CdkOverlayOrigin,
1160
+ CdkConnectedOverlay,
1161
+ CardComponentModule,
1162
+ CdkTextareaAutosize,
1163
+ TooltipComponentModule,
1164
+ MatTooltip,
1165
+ UiTranslatePipe,
1166
+ IconComponentModule,
1167
+ SkeletonComponent,
1168
+ PromptComponent
1169
+ ],
1170
+ exports: [PromptComponent]
1171
+ });
1172
+ }
1173
+ static {
1174
+ this.ɵinj = i0.ɵɵngDeclareInjector({
1175
+ minVersion: "12.0.0",
1176
+ version: "22.2.4",
1177
+ ngImport: i0,
1178
+ type: PromptModule,
1179
+ imports: [
1180
+ CommonModule,
1181
+ FieldComponentModule,
1182
+ ButtonComponentModule,
1183
+ OverflowMenuComponentModule,
1184
+ TagComponentModule,
1185
+ BadgeComponentModule,
1186
+ CardComponentModule,
1187
+ TooltipComponentModule,
1188
+ IconComponentModule,
1189
+ SkeletonComponent,
1190
+ PromptComponent
1191
+ ]
1192
+ });
1193
+ }
1194
+ };
1195
+ i0.ɵɵngDeclareClassMetadata({
1196
+ minVersion: "12.0.0",
1197
+ version: "22.2.4",
1198
+ ngImport: i0,
1199
+ type: PromptModule,
1200
+ decorators: [{
1201
+ type: NgModule,
1202
+ args: [{
1203
+ imports: [
1204
+ CommonModule,
1205
+ FieldComponentModule,
1206
+ ButtonComponentModule,
1207
+ OverflowMenuComponentModule,
1208
+ TagComponentModule,
1209
+ BadgeComponentModule,
1210
+ CdkOverlayOrigin,
1211
+ CdkConnectedOverlay,
1212
+ CardComponentModule,
1213
+ CdkTextareaAutosize,
1214
+ TooltipComponentModule,
1215
+ MatTooltip,
1216
+ UiTranslatePipe,
1217
+ IconComponentModule,
1218
+ SkeletonComponent,
1219
+ PromptComponent
1220
+ ],
1221
+ exports: [PromptComponent]
1222
+ }]
1223
+ }]
1224
+ });
577
1225
  export { PromptComponent, PromptModule };
578
- //# sourceMappingURL=testgorilla-tgo-ui-components-prompt.mjs.map
1226
+
1227
+ //# sourceMappingURL=testgorilla-tgo-ui-components-prompt.mjs.map