@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,222 +1,534 @@
1
- import { Overlay } from '@angular/cdk/overlay';
2
- import { ComponentPortal } from '@angular/cdk/portal';
3
- import * as i0 from '@angular/core';
4
- import { input, ChangeDetectionStrategy, Component, signal, inject, ElementRef, Injector, NgZone, HostListener, Directive } from '@angular/core';
5
- import { Subscription } from 'rxjs';
6
- import { CdkTrapFocus } from '@angular/cdk/a11y';
7
- import { NgTemplateOutlet } from '@angular/common';
8
- import * as i1 from '@testgorilla/tgo-ui/components/card';
9
- import { CardComponentModule } from '@testgorilla/tgo-ui/components/card';
10
-
11
- class PopoverComponent {
12
- constructor() {
13
- this.templateRef = input(null, ...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
14
- this.ctx = input({}, ...(ngDevMode ? [{ debugName: "ctx" }] : /* istanbul ignore next */ []));
15
- this.popoverCard = input(true, ...(ngDevMode ? [{ debugName: "popoverCard" }] : /* istanbul ignore next */ []));
16
- this.popoverCardSize = input('medium', ...(ngDevMode ? [{ debugName: "popoverCardSize" }] : /* istanbul ignore next */ []));
17
- this.trapFocus = input(false, ...(ngDevMode ? [{ debugName: "trapFocus" }] : /* istanbul ignore next */ []));
18
- this.ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
19
- }
20
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
21
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PopoverComponent, isStandalone: true, selector: "ui-popover", inputs: { templateRef: { classPropertyName: "templateRef", publicName: "templateRef", isSignal: true, isRequired: false, transformFunction: null }, ctx: { classPropertyName: "ctx", publicName: "ctx", isSignal: true, isRequired: false, transformFunction: null }, popoverCard: { classPropertyName: "popoverCard", publicName: "popoverCard", isSignal: true, isRequired: false, transformFunction: null }, popoverCardSize: { classPropertyName: "popoverCardSize", publicName: "popoverCardSize", isSignal: true, isRequired: false, transformFunction: null }, trapFocus: { classPropertyName: "trapFocus", publicName: "trapFocus", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (templateRef()) {\n <div class=\"popover-focus-scope\" [cdkTrapFocus]=\"trapFocus()\" [cdkTrapFocusAutoCapture]=\"trapFocus()\">\n <div\n class=\"popover-surface\"\n [attr.role]=\"trapFocus() ? 'dialog' : null\"\n [attr.aria-label]=\"trapFocus() && ariaLabel() ? ariaLabel() : null\"\n [attr.tabindex]=\"trapFocus() ? '-1' : null\"\n [attr.cdkFocusInitial]=\"trapFocus() ? '' : null\"\n >\n @if (popoverCard()) {\n <ui-card [size]=\"popoverCardSize()\">\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n </ui-card>\n } @else {\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n }\n </div>\n </div>\n}\n", styles: [".popover-focus-scope{display:contents}.popover-surface{display:block}.popover-surface:focus,.popover-surface:focus-visible{outline:none}:host{display:block;pointer-events:auto;animation:popover-enter .15s ease-out}@keyframes popover-enter{0%{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CardComponentModule }, { kind: "component", type: i1.CardComponent, selector: "ui-card", inputs: ["size", "sizeVariant", "variant", "applicationTheme", "errors", "errorsSize", "selected", "allowSelect", "allowFocus", "testId"], outputs: ["cardSelected"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
22
- }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PopoverComponent, decorators: [{
24
- type: Component,
25
- args: [{ selector: 'ui-popover', standalone: true, imports: [NgTemplateOutlet, CardComponentModule, CdkTrapFocus], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (templateRef()) {\n <div class=\"popover-focus-scope\" [cdkTrapFocus]=\"trapFocus()\" [cdkTrapFocusAutoCapture]=\"trapFocus()\">\n <div\n class=\"popover-surface\"\n [attr.role]=\"trapFocus() ? 'dialog' : null\"\n [attr.aria-label]=\"trapFocus() && ariaLabel() ? ariaLabel() : null\"\n [attr.tabindex]=\"trapFocus() ? '-1' : null\"\n [attr.cdkFocusInitial]=\"trapFocus() ? '' : null\"\n >\n @if (popoverCard()) {\n <ui-card [size]=\"popoverCardSize()\">\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n </ui-card>\n } @else {\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n }\n </div>\n </div>\n}\n", styles: [".popover-focus-scope{display:contents}.popover-surface{display:block}.popover-surface:focus,.popover-surface:focus-visible{outline:none}:host{display:block;pointer-events:auto;animation:popover-enter .15s ease-out}@keyframes popover-enter{0%{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}\n"] }]
26
- }], propDecorators: { templateRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateRef", required: false }] }], ctx: [{ type: i0.Input, args: [{ isSignal: true, alias: "ctx", required: false }] }], popoverCard: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverCard", required: false }] }], popoverCardSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverCardSize", required: false }] }], trapFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "trapFocus", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
27
-
28
- class PopoverDirective {
29
- constructor() {
30
- this.uiPopover = input.required(...(ngDevMode ? [{ debugName: "uiPopover" }] : /* istanbul ignore next */ []));
31
- this.popoverOffset = input(4, ...(ngDevMode ? [{ debugName: "popoverOffset" }] : /* istanbul ignore next */ []));
32
- this.popoverAlign = input('center', ...(ngDevMode ? [{ debugName: "popoverAlign" }] : /* istanbul ignore next */ []));
33
- this.popoverOpen = input(false, ...(ngDevMode ? [{ debugName: "popoverOpen" }] : /* istanbul ignore next */ []));
34
- this.popoverCard = input(true, ...(ngDevMode ? [{ debugName: "popoverCard" }] : /* istanbul ignore next */ []));
35
- this.popoverCardSize = input('medium', ...(ngDevMode ? [{ debugName: "popoverCardSize" }] : /* istanbul ignore next */ []));
36
- this.popoverTrigger = input('hover', ...(ngDevMode ? [{ debugName: "popoverTrigger" }] : /* istanbul ignore next */ []));
37
- this.popoverAriaLabel = input('', ...(ngDevMode ? [{ debugName: "popoverAriaLabel" }] : /* istanbul ignore next */ []));
38
- this.uiPopoverDisabled = input(false, ...(ngDevMode ? [{ debugName: "uiPopoverDisabled" }] : /* istanbul ignore next */ []));
39
- this.openState = signal(false, ...(ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []));
40
- /** Whether the popover is currently showing. Read it via `#ref="uiPopover"` or `viewChild(PopoverDirective)`. */
41
- this.isOpen = this.openState.asReadonly();
42
- this.overlay = inject(Overlay);
43
- this.elementRef = inject(ElementRef);
44
- this.injector = inject(Injector);
45
- this.ngZone = inject(NgZone);
46
- this.overlayRef = null;
47
- this.openTimeout = null;
48
- this.closeTimeout = null;
49
- this.overlayListeners = null;
50
- this.dismissSubscriptions = null;
51
- }
52
- onMouseEnter() {
53
- if (this.popoverTrigger() !== 'hover' || this.uiPopoverDisabled()) {
54
- return;
55
- }
56
- this.cancelClose();
57
- this.scheduleOpen();
58
- }
59
- onMouseLeave() {
60
- if (this.popoverTrigger() !== 'hover') {
61
- return;
62
- }
63
- this.cancelOpen();
64
- this.scheduleClose();
65
- }
66
- onClick() {
67
- if (this.popoverTrigger() !== 'click') {
68
- return;
69
- }
70
- this.toggle();
71
- }
72
- /** Opens the popover. No-op while `uiPopoverDisabled` is `true` or it is already open. */
73
- open() {
74
- if (this.uiPopoverDisabled()) {
75
- return;
76
- }
77
- if (!this.overlayRef) {
78
- this.createOverlay();
79
- }
80
- const overlayRef = this.overlayRef;
81
- if (!overlayRef || overlayRef.hasAttached()) {
82
- return;
83
- }
84
- const portal = new ComponentPortal(PopoverComponent, null, this.injector);
85
- const ref = overlayRef.attach(portal);
86
- ref.setInput('templateRef', this.uiPopover());
87
- ref.setInput('ctx', { close: () => this.close() });
88
- ref.setInput('popoverCard', this.popoverCard());
89
- ref.setInput('popoverCardSize', this.popoverCardSize());
90
- ref.setInput('trapFocus', this.popoverTrigger() === 'click');
91
- ref.setInput('ariaLabel', this.popoverAriaLabel());
92
- if (this.popoverTrigger() === 'hover') {
93
- const el = overlayRef.overlayElement;
94
- const enter = () => this.ngZone.run(() => this.cancelClose());
95
- const leave = () => this.ngZone.run(() => this.scheduleClose());
96
- el.addEventListener('mouseenter', enter);
97
- el.addEventListener('mouseleave', leave);
98
- this.overlayListeners = { enter, leave };
99
- }
100
- this.openState.set(true);
101
- }
102
- /** Closes the popover. Safe to call when it is already closed. */
103
- close() {
104
- if (!this.overlayRef) {
105
- return;
106
- }
107
- if (this.overlayListeners) {
108
- const el = this.overlayRef.overlayElement;
109
- el.removeEventListener('mouseenter', this.overlayListeners.enter);
110
- el.removeEventListener('mouseleave', this.overlayListeners.leave);
111
- this.overlayListeners = null;
112
- }
113
- this.overlayRef.detach();
114
- this.openState.set(false);
115
- }
116
- /** Opens the popover when closed, closes it when open. */
117
- toggle() {
118
- if (this.isOpen()) {
119
- this.close();
120
- }
121
- else {
122
- this.open();
123
- }
124
- }
125
- createOverlay() {
126
- const align = this.popoverAlign();
127
- const positionStrategy = this.overlay
128
- .position()
129
- .flexibleConnectedTo(this.elementRef)
130
- .withPositions([
131
- { originX: align, originY: 'bottom', overlayX: align, overlayY: 'top', offsetY: this.popoverOffset() },
132
- { originX: align, originY: 'top', overlayX: align, overlayY: 'bottom', offsetY: -this.popoverOffset() },
133
- ]);
134
- this.overlayRef = this.overlay.create({
135
- positionStrategy,
136
- scrollStrategy: this.overlay.scrollStrategies.reposition(),
137
- hasBackdrop: false,
138
- });
139
- if (this.popoverTrigger() === 'click') {
140
- this.listenForDismiss(this.overlayRef);
141
- }
142
- }
143
- /** Click-triggered popovers dismiss on an outside pointer event or on Escape. */
144
- listenForDismiss(overlayRef) {
145
- const subscriptions = new Subscription();
146
- subscriptions.add(overlayRef.outsidePointerEvents().subscribe(event => {
147
- // The anchor's own click handler toggles, so ignore it here to avoid closing and reopening.
148
- if (this.elementRef.nativeElement.contains(event.target)) {
149
- return;
150
- }
151
- this.close();
152
- }));
153
- subscriptions.add(overlayRef.keydownEvents().subscribe(event => {
154
- if (event.key !== 'Escape') {
155
- return;
156
- }
157
- event.preventDefault();
158
- // cdkTrapFocusAutoCapture restores focus to whatever was focused before the popover opened,
159
- // so closing is all this has to do.
160
- this.close();
161
- }));
162
- this.dismissSubscriptions = subscriptions;
163
- }
164
- scheduleOpen() {
165
- this.openTimeout = setTimeout(() => this.open(), 100);
166
- }
167
- cancelOpen() {
168
- if (this.openTimeout) {
169
- clearTimeout(this.openTimeout);
170
- this.openTimeout = null;
171
- }
172
- }
173
- scheduleClose() {
174
- this.closeTimeout = setTimeout(() => this.close(), 150);
175
- }
176
- cancelClose() {
177
- if (this.closeTimeout) {
178
- clearTimeout(this.closeTimeout);
179
- this.closeTimeout = null;
180
- }
181
- }
182
- ngOnInit() {
183
- if (this.popoverOpen()) {
184
- this.open();
185
- }
186
- }
187
- ngOnDestroy() {
188
- this.cancelOpen();
189
- this.cancelClose();
190
- this.close();
191
- this.dismissSubscriptions?.unsubscribe();
192
- this.overlayRef?.dispose();
193
- }
194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PopoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
195
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: PopoverDirective, isStandalone: true, selector: "[uiPopover]", inputs: { uiPopover: { classPropertyName: "uiPopover", publicName: "uiPopover", isSignal: true, isRequired: true, transformFunction: null }, popoverOffset: { classPropertyName: "popoverOffset", publicName: "popoverOffset", isSignal: true, isRequired: false, transformFunction: null }, popoverAlign: { classPropertyName: "popoverAlign", publicName: "popoverAlign", isSignal: true, isRequired: false, transformFunction: null }, popoverOpen: { classPropertyName: "popoverOpen", publicName: "popoverOpen", isSignal: true, isRequired: false, transformFunction: null }, popoverCard: { classPropertyName: "popoverCard", publicName: "popoverCard", isSignal: true, isRequired: false, transformFunction: null }, popoverCardSize: { classPropertyName: "popoverCardSize", publicName: "popoverCardSize", isSignal: true, isRequired: false, transformFunction: null }, popoverTrigger: { classPropertyName: "popoverTrigger", publicName: "popoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, popoverAriaLabel: { classPropertyName: "popoverAriaLabel", publicName: "popoverAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, uiPopoverDisabled: { classPropertyName: "uiPopoverDisabled", publicName: "uiPopoverDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "onClick()" } }, exportAs: ["uiPopover"], ngImport: i0 }); }
196
- }
197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PopoverDirective, decorators: [{
198
- type: Directive,
199
- args: [{
200
- selector: '[uiPopover]',
201
- exportAs: 'uiPopover',
202
- standalone: true,
203
- }]
204
- }], propDecorators: { uiPopover: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiPopover", required: true }] }], popoverOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverOffset", required: false }] }], popoverAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverAlign", required: false }] }], popoverOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverOpen", required: false }] }], popoverCard: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverCard", required: false }] }], popoverCardSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverCardSize", required: false }] }], popoverTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverTrigger", required: false }] }], popoverAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "popoverAriaLabel", required: false }] }], uiPopoverDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiPopoverDisabled", required: false }] }], onMouseEnter: [{
205
- type: HostListener,
206
- args: ['mouseenter']
207
- }], onMouseLeave: [{
208
- type: HostListener,
209
- args: ['mouseleave']
210
- }], onClick: [{
211
- type: HostListener,
212
- args: ['click']
213
- }] } });
214
-
215
- // PopoverComponent is internal — not part of the public API
216
-
217
- /**
218
- * Generated bundle index. Do not edit.
219
- */
220
-
1
+ import { Overlay } from "@angular/cdk/overlay";
2
+ import { ComponentPortal } from "@angular/cdk/portal";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, HostListener, Injector, NgZone, inject, input, signal } from "@angular/core";
5
+ import { Subscription } from "rxjs";
6
+ import { CdkTrapFocus } from "@angular/cdk/a11y";
7
+ import { NgTemplateOutlet } from "@angular/common";
8
+ import * as i1 from "@testgorilla/tgo-ui/components/card";
9
+ import { CardComponentModule } from "@testgorilla/tgo-ui/components/card";
10
+ var PopoverComponent = class PopoverComponent {
11
+ constructor() {
12
+ this.templateRef = input(null, ...ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []);
13
+ this.ctx = input({}, ...ngDevMode ? [{ debugName: "ctx" }] : /* istanbul ignore next */ []);
14
+ this.popoverCard = input(true, ...ngDevMode ? [{ debugName: "popoverCard" }] : /* istanbul ignore next */ []);
15
+ this.popoverCardSize = input("medium", ...ngDevMode ? [{ debugName: "popoverCardSize" }] : /* istanbul ignore next */ []);
16
+ this.trapFocus = input(false, ...ngDevMode ? [{ debugName: "trapFocus" }] : /* istanbul ignore next */ []);
17
+ this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
18
+ }
19
+ static {
20
+ this.ɵfac = i0.ɵɵngDeclareFactory({
21
+ minVersion: "12.0.0",
22
+ version: "22.2.4",
23
+ ngImport: i0,
24
+ type: PopoverComponent,
25
+ deps: [],
26
+ target: i0.ɵɵFactoryTarget.Component
27
+ });
28
+ }
29
+ static {
30
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
31
+ minVersion: "17.0.0",
32
+ version: "22.2.4",
33
+ type: PopoverComponent,
34
+ isStandalone: true,
35
+ selector: "ui-popover",
36
+ inputs: {
37
+ templateRef: {
38
+ classPropertyName: "templateRef",
39
+ publicName: "templateRef",
40
+ isSignal: true,
41
+ isRequired: false,
42
+ transformFunction: null
43
+ },
44
+ ctx: {
45
+ classPropertyName: "ctx",
46
+ publicName: "ctx",
47
+ isSignal: true,
48
+ isRequired: false,
49
+ transformFunction: null
50
+ },
51
+ popoverCard: {
52
+ classPropertyName: "popoverCard",
53
+ publicName: "popoverCard",
54
+ isSignal: true,
55
+ isRequired: false,
56
+ transformFunction: null
57
+ },
58
+ popoverCardSize: {
59
+ classPropertyName: "popoverCardSize",
60
+ publicName: "popoverCardSize",
61
+ isSignal: true,
62
+ isRequired: false,
63
+ transformFunction: null
64
+ },
65
+ trapFocus: {
66
+ classPropertyName: "trapFocus",
67
+ publicName: "trapFocus",
68
+ isSignal: true,
69
+ isRequired: false,
70
+ transformFunction: null
71
+ },
72
+ ariaLabel: {
73
+ classPropertyName: "ariaLabel",
74
+ publicName: "ariaLabel",
75
+ isSignal: true,
76
+ isRequired: false,
77
+ transformFunction: null
78
+ }
79
+ },
80
+ ngImport: i0,
81
+ template: "@if (templateRef()) {\n <div class=\"popover-focus-scope\" [cdkTrapFocus]=\"trapFocus()\" [cdkTrapFocusAutoCapture]=\"trapFocus()\">\n <div\n class=\"popover-surface\"\n [attr.role]=\"trapFocus() ? 'dialog' : null\"\n [attr.aria-label]=\"trapFocus() && ariaLabel() ? ariaLabel() : null\"\n [attr.tabindex]=\"trapFocus() ? '-1' : null\"\n [attr.cdkFocusInitial]=\"trapFocus() ? '' : null\"\n >\n @if (popoverCard()) {\n <ui-card [size]=\"popoverCardSize()\">\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n </ui-card>\n } @else {\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n }\n </div>\n </div>\n}\n",
82
+ styles: [".popover-focus-scope{display:contents}.popover-surface{display:block}.popover-surface:focus,.popover-surface:focus-visible{outline:none}:host{display:block;pointer-events:auto;animation:popover-enter .15s ease-out}@keyframes popover-enter{0%{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}\n"],
83
+ dependencies: [
84
+ {
85
+ kind: "directive",
86
+ type: NgTemplateOutlet,
87
+ selector: "[ngTemplateOutlet]",
88
+ inputs: [
89
+ "ngTemplateOutletContext",
90
+ "ngTemplateOutlet",
91
+ "ngTemplateOutletInjector"
92
+ ]
93
+ },
94
+ {
95
+ kind: "ngmodule",
96
+ type: CardComponentModule
97
+ },
98
+ {
99
+ kind: "component",
100
+ type: i1.CardComponent,
101
+ selector: "ui-card",
102
+ inputs: [
103
+ "size",
104
+ "sizeVariant",
105
+ "variant",
106
+ "applicationTheme",
107
+ "errors",
108
+ "errorsSize",
109
+ "selected",
110
+ "allowSelect",
111
+ "allowFocus",
112
+ "testId"
113
+ ],
114
+ outputs: ["cardSelected"]
115
+ },
116
+ {
117
+ kind: "directive",
118
+ type: CdkTrapFocus,
119
+ selector: "[cdkTrapFocus]",
120
+ inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
121
+ exportAs: ["cdkTrapFocus"]
122
+ }
123
+ ],
124
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
125
+ });
126
+ }
127
+ };
128
+ i0.ɵɵngDeclareClassMetadata({
129
+ minVersion: "12.0.0",
130
+ version: "22.2.4",
131
+ ngImport: i0,
132
+ type: PopoverComponent,
133
+ decorators: [{
134
+ type: Component,
135
+ args: [{
136
+ selector: "ui-popover",
137
+ standalone: true,
138
+ imports: [
139
+ NgTemplateOutlet,
140
+ CardComponentModule,
141
+ CdkTrapFocus
142
+ ],
143
+ changeDetection: ChangeDetectionStrategy.OnPush,
144
+ template: "@if (templateRef()) {\n <div class=\"popover-focus-scope\" [cdkTrapFocus]=\"trapFocus()\" [cdkTrapFocusAutoCapture]=\"trapFocus()\">\n <div\n class=\"popover-surface\"\n [attr.role]=\"trapFocus() ? 'dialog' : null\"\n [attr.aria-label]=\"trapFocus() && ariaLabel() ? ariaLabel() : null\"\n [attr.tabindex]=\"trapFocus() ? '-1' : null\"\n [attr.cdkFocusInitial]=\"trapFocus() ? '' : null\"\n >\n @if (popoverCard()) {\n <ui-card [size]=\"popoverCardSize()\">\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n </ui-card>\n } @else {\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n }\n </div>\n </div>\n}\n",
145
+ styles: [".popover-focus-scope{display:contents}.popover-surface{display:block}.popover-surface:focus,.popover-surface:focus-visible{outline:none}:host{display:block;pointer-events:auto;animation:popover-enter .15s ease-out}@keyframes popover-enter{0%{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}\n"]
146
+ }]
147
+ }],
148
+ propDecorators: {
149
+ templateRef: [{
150
+ type: i0.Input,
151
+ args: [{
152
+ isSignal: true,
153
+ alias: "templateRef",
154
+ required: false
155
+ }]
156
+ }],
157
+ ctx: [{
158
+ type: i0.Input,
159
+ args: [{
160
+ isSignal: true,
161
+ alias: "ctx",
162
+ required: false
163
+ }]
164
+ }],
165
+ popoverCard: [{
166
+ type: i0.Input,
167
+ args: [{
168
+ isSignal: true,
169
+ alias: "popoverCard",
170
+ required: false
171
+ }]
172
+ }],
173
+ popoverCardSize: [{
174
+ type: i0.Input,
175
+ args: [{
176
+ isSignal: true,
177
+ alias: "popoverCardSize",
178
+ required: false
179
+ }]
180
+ }],
181
+ trapFocus: [{
182
+ type: i0.Input,
183
+ args: [{
184
+ isSignal: true,
185
+ alias: "trapFocus",
186
+ required: false
187
+ }]
188
+ }],
189
+ ariaLabel: [{
190
+ type: i0.Input,
191
+ args: [{
192
+ isSignal: true,
193
+ alias: "ariaLabel",
194
+ required: false
195
+ }]
196
+ }]
197
+ }
198
+ });
199
+ var PopoverDirective = class PopoverDirective {
200
+ constructor() {
201
+ this.uiPopover = input.required(...ngDevMode ? [{ debugName: "uiPopover" }] : /* istanbul ignore next */ []);
202
+ this.popoverOffset = input(4, ...ngDevMode ? [{ debugName: "popoverOffset" }] : /* istanbul ignore next */ []);
203
+ this.popoverAlign = input("center", ...ngDevMode ? [{ debugName: "popoverAlign" }] : /* istanbul ignore next */ []);
204
+ this.popoverOpen = input(false, ...ngDevMode ? [{ debugName: "popoverOpen" }] : /* istanbul ignore next */ []);
205
+ this.popoverCard = input(true, ...ngDevMode ? [{ debugName: "popoverCard" }] : /* istanbul ignore next */ []);
206
+ this.popoverCardSize = input("medium", ...ngDevMode ? [{ debugName: "popoverCardSize" }] : /* istanbul ignore next */ []);
207
+ this.popoverTrigger = input("hover", ...ngDevMode ? [{ debugName: "popoverTrigger" }] : /* istanbul ignore next */ []);
208
+ this.popoverAriaLabel = input("", ...ngDevMode ? [{ debugName: "popoverAriaLabel" }] : /* istanbul ignore next */ []);
209
+ this.uiPopoverDisabled = input(false, ...ngDevMode ? [{ debugName: "uiPopoverDisabled" }] : /* istanbul ignore next */ []);
210
+ this.openState = signal(false, ...ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []);
211
+ this.isOpen = this.openState.asReadonly();
212
+ this.overlay = inject(Overlay);
213
+ this.elementRef = inject(ElementRef);
214
+ this.injector = inject(Injector);
215
+ this.ngZone = inject(NgZone);
216
+ this.overlayRef = null;
217
+ this.openTimeout = null;
218
+ this.closeTimeout = null;
219
+ this.overlayListeners = null;
220
+ this.dismissSubscriptions = null;
221
+ }
222
+ onMouseEnter() {
223
+ if (this.popoverTrigger() !== "hover" || this.uiPopoverDisabled()) return;
224
+ this.cancelClose();
225
+ this.scheduleOpen();
226
+ }
227
+ onMouseLeave() {
228
+ if (this.popoverTrigger() !== "hover") return;
229
+ this.cancelOpen();
230
+ this.scheduleClose();
231
+ }
232
+ onClick() {
233
+ if (this.popoverTrigger() !== "click") return;
234
+ this.toggle();
235
+ }
236
+ open() {
237
+ if (this.uiPopoverDisabled()) return;
238
+ if (!this.overlayRef) this.createOverlay();
239
+ const overlayRef = this.overlayRef;
240
+ if (!overlayRef || overlayRef.hasAttached()) return;
241
+ const portal = new ComponentPortal(PopoverComponent, null, this.injector);
242
+ const ref = overlayRef.attach(portal);
243
+ ref.setInput("templateRef", this.uiPopover());
244
+ ref.setInput("ctx", { close: () => this.close() });
245
+ ref.setInput("popoverCard", this.popoverCard());
246
+ ref.setInput("popoverCardSize", this.popoverCardSize());
247
+ ref.setInput("trapFocus", this.popoverTrigger() === "click");
248
+ ref.setInput("ariaLabel", this.popoverAriaLabel());
249
+ if (this.popoverTrigger() === "hover") {
250
+ const el = overlayRef.overlayElement;
251
+ const enter = () => this.ngZone.run(() => this.cancelClose());
252
+ const leave = () => this.ngZone.run(() => this.scheduleClose());
253
+ el.addEventListener("mouseenter", enter);
254
+ el.addEventListener("mouseleave", leave);
255
+ this.overlayListeners = {
256
+ enter,
257
+ leave
258
+ };
259
+ }
260
+ this.openState.set(true);
261
+ }
262
+ close() {
263
+ if (!this.overlayRef) return;
264
+ if (this.overlayListeners) {
265
+ const el = this.overlayRef.overlayElement;
266
+ el.removeEventListener("mouseenter", this.overlayListeners.enter);
267
+ el.removeEventListener("mouseleave", this.overlayListeners.leave);
268
+ this.overlayListeners = null;
269
+ }
270
+ this.overlayRef.detach();
271
+ this.openState.set(false);
272
+ }
273
+ toggle() {
274
+ if (this.isOpen()) this.close();
275
+ else this.open();
276
+ }
277
+ createOverlay() {
278
+ const align = this.popoverAlign();
279
+ const positionStrategy = this.overlay.position().flexibleConnectedTo(this.elementRef).withPositions([{
280
+ originX: align,
281
+ originY: "bottom",
282
+ overlayX: align,
283
+ overlayY: "top",
284
+ offsetY: this.popoverOffset()
285
+ }, {
286
+ originX: align,
287
+ originY: "top",
288
+ overlayX: align,
289
+ overlayY: "bottom",
290
+ offsetY: -this.popoverOffset()
291
+ }]);
292
+ this.overlayRef = this.overlay.create({
293
+ positionStrategy,
294
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
295
+ hasBackdrop: false
296
+ });
297
+ if (this.popoverTrigger() === "click") this.listenForDismiss(this.overlayRef);
298
+ }
299
+ listenForDismiss(overlayRef) {
300
+ const subscriptions = new Subscription();
301
+ subscriptions.add(overlayRef.outsidePointerEvents().subscribe((event) => {
302
+ if (this.elementRef.nativeElement.contains(event.target)) return;
303
+ this.close();
304
+ }));
305
+ subscriptions.add(overlayRef.keydownEvents().subscribe((event) => {
306
+ if (event.key !== "Escape") return;
307
+ event.preventDefault();
308
+ this.close();
309
+ }));
310
+ this.dismissSubscriptions = subscriptions;
311
+ }
312
+ scheduleOpen() {
313
+ this.openTimeout = setTimeout(() => this.open(), 100);
314
+ }
315
+ cancelOpen() {
316
+ if (this.openTimeout) {
317
+ clearTimeout(this.openTimeout);
318
+ this.openTimeout = null;
319
+ }
320
+ }
321
+ scheduleClose() {
322
+ this.closeTimeout = setTimeout(() => this.close(), 150);
323
+ }
324
+ cancelClose() {
325
+ if (this.closeTimeout) {
326
+ clearTimeout(this.closeTimeout);
327
+ this.closeTimeout = null;
328
+ }
329
+ }
330
+ ngOnInit() {
331
+ if (this.popoverOpen()) this.open();
332
+ }
333
+ ngOnDestroy() {
334
+ this.cancelOpen();
335
+ this.cancelClose();
336
+ this.close();
337
+ this.dismissSubscriptions?.unsubscribe();
338
+ this.overlayRef?.dispose();
339
+ }
340
+ static {
341
+ this.ɵfac = i0.ɵɵngDeclareFactory({
342
+ minVersion: "12.0.0",
343
+ version: "22.2.4",
344
+ ngImport: i0,
345
+ type: PopoverDirective,
346
+ deps: [],
347
+ target: i0.ɵɵFactoryTarget.Directive
348
+ });
349
+ }
350
+ static {
351
+ this.ɵdir = i0.ɵɵngDeclareDirective({
352
+ minVersion: "17.1.0",
353
+ version: "22.2.4",
354
+ type: PopoverDirective,
355
+ isStandalone: true,
356
+ selector: "[uiPopover]",
357
+ inputs: {
358
+ uiPopover: {
359
+ classPropertyName: "uiPopover",
360
+ publicName: "uiPopover",
361
+ isSignal: true,
362
+ isRequired: true,
363
+ transformFunction: null
364
+ },
365
+ popoverOffset: {
366
+ classPropertyName: "popoverOffset",
367
+ publicName: "popoverOffset",
368
+ isSignal: true,
369
+ isRequired: false,
370
+ transformFunction: null
371
+ },
372
+ popoverAlign: {
373
+ classPropertyName: "popoverAlign",
374
+ publicName: "popoverAlign",
375
+ isSignal: true,
376
+ isRequired: false,
377
+ transformFunction: null
378
+ },
379
+ popoverOpen: {
380
+ classPropertyName: "popoverOpen",
381
+ publicName: "popoverOpen",
382
+ isSignal: true,
383
+ isRequired: false,
384
+ transformFunction: null
385
+ },
386
+ popoverCard: {
387
+ classPropertyName: "popoverCard",
388
+ publicName: "popoverCard",
389
+ isSignal: true,
390
+ isRequired: false,
391
+ transformFunction: null
392
+ },
393
+ popoverCardSize: {
394
+ classPropertyName: "popoverCardSize",
395
+ publicName: "popoverCardSize",
396
+ isSignal: true,
397
+ isRequired: false,
398
+ transformFunction: null
399
+ },
400
+ popoverTrigger: {
401
+ classPropertyName: "popoverTrigger",
402
+ publicName: "popoverTrigger",
403
+ isSignal: true,
404
+ isRequired: false,
405
+ transformFunction: null
406
+ },
407
+ popoverAriaLabel: {
408
+ classPropertyName: "popoverAriaLabel",
409
+ publicName: "popoverAriaLabel",
410
+ isSignal: true,
411
+ isRequired: false,
412
+ transformFunction: null
413
+ },
414
+ uiPopoverDisabled: {
415
+ classPropertyName: "uiPopoverDisabled",
416
+ publicName: "uiPopoverDisabled",
417
+ isSignal: true,
418
+ isRequired: false,
419
+ transformFunction: null
420
+ }
421
+ },
422
+ host: { listeners: {
423
+ "mouseenter": "onMouseEnter()",
424
+ "mouseleave": "onMouseLeave()",
425
+ "click": "onClick()"
426
+ } },
427
+ exportAs: ["uiPopover"],
428
+ ngImport: i0
429
+ });
430
+ }
431
+ };
432
+ i0.ɵɵngDeclareClassMetadata({
433
+ minVersion: "12.0.0",
434
+ version: "22.2.4",
435
+ ngImport: i0,
436
+ type: PopoverDirective,
437
+ decorators: [{
438
+ type: Directive,
439
+ args: [{
440
+ selector: "[uiPopover]",
441
+ exportAs: "uiPopover",
442
+ standalone: true
443
+ }]
444
+ }],
445
+ propDecorators: {
446
+ uiPopover: [{
447
+ type: i0.Input,
448
+ args: [{
449
+ isSignal: true,
450
+ alias: "uiPopover",
451
+ required: true
452
+ }]
453
+ }],
454
+ popoverOffset: [{
455
+ type: i0.Input,
456
+ args: [{
457
+ isSignal: true,
458
+ alias: "popoverOffset",
459
+ required: false
460
+ }]
461
+ }],
462
+ popoverAlign: [{
463
+ type: i0.Input,
464
+ args: [{
465
+ isSignal: true,
466
+ alias: "popoverAlign",
467
+ required: false
468
+ }]
469
+ }],
470
+ popoverOpen: [{
471
+ type: i0.Input,
472
+ args: [{
473
+ isSignal: true,
474
+ alias: "popoverOpen",
475
+ required: false
476
+ }]
477
+ }],
478
+ popoverCard: [{
479
+ type: i0.Input,
480
+ args: [{
481
+ isSignal: true,
482
+ alias: "popoverCard",
483
+ required: false
484
+ }]
485
+ }],
486
+ popoverCardSize: [{
487
+ type: i0.Input,
488
+ args: [{
489
+ isSignal: true,
490
+ alias: "popoverCardSize",
491
+ required: false
492
+ }]
493
+ }],
494
+ popoverTrigger: [{
495
+ type: i0.Input,
496
+ args: [{
497
+ isSignal: true,
498
+ alias: "popoverTrigger",
499
+ required: false
500
+ }]
501
+ }],
502
+ popoverAriaLabel: [{
503
+ type: i0.Input,
504
+ args: [{
505
+ isSignal: true,
506
+ alias: "popoverAriaLabel",
507
+ required: false
508
+ }]
509
+ }],
510
+ uiPopoverDisabled: [{
511
+ type: i0.Input,
512
+ args: [{
513
+ isSignal: true,
514
+ alias: "uiPopoverDisabled",
515
+ required: false
516
+ }]
517
+ }],
518
+ onMouseEnter: [{
519
+ type: HostListener,
520
+ args: ["mouseenter"]
521
+ }],
522
+ onMouseLeave: [{
523
+ type: HostListener,
524
+ args: ["mouseleave"]
525
+ }],
526
+ onClick: [{
527
+ type: HostListener,
528
+ args: ["click"]
529
+ }]
530
+ }
531
+ });
221
532
  export { PopoverDirective };
222
- //# sourceMappingURL=testgorilla-tgo-ui-components-popover.mjs.map
533
+
534
+ //# sourceMappingURL=testgorilla-tgo-ui-components-popover.mjs.map