@radix-ng/primitives 0.51.0 → 1.0.0-beta.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 (178) hide show
  1. package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
  2. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
  6. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  11. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  12. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  13. package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
  14. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  15. package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
  16. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  17. package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
  18. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
  19. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
  21. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  22. package/fesm2022/radix-ng-primitives-core.mjs +735 -744
  23. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-cropper.mjs +1 -0
  25. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-date-field.mjs +51 -45
  27. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
  29. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
  31. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
  33. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  34. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  35. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  36. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  37. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  38. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  39. package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
  40. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  41. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  42. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  43. package/fesm2022/radix-ng-primitives-label.mjs +6 -6
  44. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  45. package/fesm2022/radix-ng-primitives-menu.mjs +1480 -344
  46. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  47. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  48. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  49. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  50. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  51. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
  52. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  53. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
  54. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
  57. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-popper.mjs +91 -41
  59. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
  61. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  63. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  65. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  66. package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
  67. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
  69. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
  71. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-select.mjs +791 -509
  73. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
  75. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
  77. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
  79. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
  81. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-tabs.mjs +381 -108
  83. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
  85. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
  87. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
  89. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
  91. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  92. package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1071
  93. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
  95. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  96. package/meter/README.md +3 -0
  97. package/navigation-menu/README.md +2 -1
  98. package/package.json +31 -18
  99. package/portal/README.md +2 -0
  100. package/preview-card/README.md +3 -0
  101. package/schematics/collection.json +1 -0
  102. package/schematics/ng-add/index.d.ts +3 -2
  103. package/schematics/ng-add/index.js +62 -31
  104. package/schematics/ng-add/index.js.map +1 -1
  105. package/schematics/ng-add/package-config.d.ts +4 -2
  106. package/schematics/ng-add/package-config.js +10 -2
  107. package/schematics/ng-add/package-config.js.map +1 -1
  108. package/schematics/ng-add/schema.d.ts +3 -0
  109. package/schematics/ng-add/schema.js +3 -0
  110. package/schematics/ng-add/schema.js.map +1 -0
  111. package/schematics/ng-add/schema.json +14 -0
  112. package/select/README.md +2 -0
  113. package/types/radix-ng-primitives-accordion.d.ts +48 -14
  114. package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
  115. package/types/radix-ng-primitives-arrow.d.ts +1 -1
  116. package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
  117. package/types/radix-ng-primitives-avatar.d.ts +7 -11
  118. package/types/radix-ng-primitives-button.d.ts +73 -0
  119. package/types/radix-ng-primitives-calendar.d.ts +1 -2
  120. package/types/radix-ng-primitives-checkbox.d.ts +201 -32
  121. package/types/radix-ng-primitives-collapsible.d.ts +112 -39
  122. package/types/radix-ng-primitives-collection.d.ts +38 -34
  123. package/types/radix-ng-primitives-config.d.ts +1 -1
  124. package/types/radix-ng-primitives-context-menu.d.ts +60 -116
  125. package/types/radix-ng-primitives-core.d.ts +307 -236
  126. package/types/radix-ng-primitives-cropper.d.ts +2 -2
  127. package/types/radix-ng-primitives-date-field.d.ts +38 -23
  128. package/types/radix-ng-primitives-dialog.d.ts +282 -165
  129. package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
  130. package/types/radix-ng-primitives-drawer.d.ts +448 -0
  131. package/types/radix-ng-primitives-editable.d.ts +1 -1
  132. package/types/radix-ng-primitives-field.d.ts +373 -0
  133. package/types/radix-ng-primitives-fieldset.d.ts +48 -0
  134. package/types/radix-ng-primitives-focus-scope.d.ts +13 -5
  135. package/types/radix-ng-primitives-input.d.ts +87 -0
  136. package/types/radix-ng-primitives-label.d.ts +0 -1
  137. package/types/radix-ng-primitives-menu.d.ts +572 -99
  138. package/types/radix-ng-primitives-menubar.d.ts +60 -50
  139. package/types/radix-ng-primitives-meter.d.ts +193 -0
  140. package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
  141. package/types/radix-ng-primitives-number-field.d.ts +405 -145
  142. package/types/radix-ng-primitives-pagination.d.ts +2 -2
  143. package/types/radix-ng-primitives-popover.d.ts +365 -351
  144. package/types/radix-ng-primitives-popper.d.ts +49 -9
  145. package/types/radix-ng-primitives-portal.d.ts +14 -6
  146. package/types/radix-ng-primitives-presence.d.ts +28 -76
  147. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  148. package/types/radix-ng-primitives-progress.d.ts +174 -48
  149. package/types/radix-ng-primitives-radio.d.ts +55 -25
  150. package/types/radix-ng-primitives-roving-focus.d.ts +30 -21
  151. package/types/radix-ng-primitives-select.d.ts +475 -177
  152. package/types/radix-ng-primitives-separator.d.ts +7 -32
  153. package/types/radix-ng-primitives-slider.d.ts +315 -201
  154. package/types/radix-ng-primitives-stepper.d.ts +5 -7
  155. package/types/radix-ng-primitives-switch.d.ts +86 -71
  156. package/types/radix-ng-primitives-tabs.d.ts +213 -79
  157. package/types/radix-ng-primitives-time-field.d.ts +42 -27
  158. package/types/radix-ng-primitives-toggle-group.d.ts +85 -164
  159. package/types/radix-ng-primitives-toggle.d.ts +43 -53
  160. package/types/radix-ng-primitives-toolbar.d.ts +163 -38
  161. package/types/radix-ng-primitives-tooltip.d.ts +347 -384
  162. package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
  163. package/dropdown-menu/README.md +0 -1
  164. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
  165. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  166. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
  167. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  168. package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
  169. package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
  170. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
  171. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  172. package/hover-card/README.md +0 -3
  173. package/select2/README.md +0 -3
  174. package/tooltip2/README.md +0 -3
  175. package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
  176. package/types/radix-ng-primitives-hover-card.d.ts +0 -471
  177. package/types/radix-ng-primitives-select2.d.ts +0 -511
  178. package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Directive, contentChild, computed, DestroyRef, Injector, PLATFORM_ID, input, numberAttribute, booleanAttribute, output, forwardRef, resource, afterNextRender, EnvironmentInjector, effect, createComponent, inputBinding } from '@angular/core';
2
+ import { inject, ElementRef, Directive, contentChild, signal, computed, InjectionToken, Injector, PLATFORM_ID, input, numberAttribute, booleanAttribute, output, forwardRef, resource, afterRenderEffect, afterNextRender, EnvironmentInjector, effect, createComponent, inputBinding } from '@angular/core';
3
3
  import { RdxArrow } from '@radix-ng/primitives/arrow';
4
4
  import { isPlatformBrowser } from '@angular/common';
5
- import { computePosition, offset, shift, flip, size, arrow, hide, limitShift, autoUpdate } from '@floating-ui/dom';
5
+ import { computePosition, offset, shift, limitShift, flip, size, arrow, hide, autoUpdate } from '@floating-ui/dom';
6
6
  import { createContext, elementSize, watch } from '@radix-ng/primitives/core';
7
7
 
8
8
  class RdxPopperAnchor {
@@ -21,7 +21,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
21
21
 
22
22
  class RdxPopper {
23
23
  constructor() {
24
- this.anchor = contentChild.required(RdxPopperAnchor);
24
+ this.anchor = contentChild(RdxPopperAnchor, ...(ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []));
25
+ this.anchorOverride = signal(undefined, ...(ngDevMode ? [{ debugName: "anchorOverride" }] : /* istanbul ignore next */ []));
25
26
  }
26
27
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
27
28
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.9", type: RdxPopper, isStandalone: true, selector: "[rdxPopperRoot]", queries: [{ propertyName: "anchor", first: true, predicate: RdxPopperAnchor, descendants: true, isSignal: true }], ngImport: i0 }); }
@@ -59,6 +60,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
59
60
  }]
60
61
  }] });
61
62
 
63
+ const RdxPopperContentConfigToken = new InjectionToken('RdxPopperContentConfig', {
64
+ factory: () => ({})
65
+ });
66
+ function provideRdxPopperContentConfig(config) {
67
+ return { provide: RdxPopperContentConfigToken, useValue: config };
68
+ }
69
+
62
70
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
63
71
  const SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'];
64
72
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -115,39 +123,45 @@ const context = () => {
115
123
  arrowX: popperContentWrapper.arrowX,
116
124
  arrowY: popperContentWrapper.arrowY,
117
125
  shouldHideArrow: popperContentWrapper.shouldHideArrow,
118
- isPositioned: popperContentWrapper.isPositioned
126
+ isPositioned: popperContentWrapper.isPositioned,
127
+ anchorHidden: popperContentWrapper.anchorHidden
119
128
  };
120
129
  };
121
130
  const [injectPopperContentWrapperContext, providePopperContentWrapperContext] = createContext('PopperContentWrapperContext');
122
131
  class RdxPopperContentWrapper {
123
132
  constructor() {
124
133
  this.elementRef = inject(ElementRef);
125
- this.destroyRef = inject(DestroyRef);
126
134
  this.injector = inject(Injector);
127
135
  this.context = inject(RdxPopper);
128
136
  this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
137
+ /** Optional positioning defaults provided by a composing primitive (e.g. tooltip). */
138
+ this.config = inject(RdxPopperContentConfigToken);
139
+ /**
140
+ * An element to position the popup against. Defaults to the popper anchor.
141
+ */
142
+ this.anchor = input(...(ngDevMode ? [undefined, { debugName: "anchor" }] : /* istanbul ignore next */ []));
129
143
  /**
130
144
  * The preferred side of the anchor to render against when open.
131
145
  * Will be reversed when collisions occur and avoidCollisions is enabled.
132
146
  */
133
- this.side = input('bottom', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
147
+ this.side = input(this.config.side ?? 'bottom', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
134
148
  /**
135
149
  * Distance between the anchor and the popup in pixels.
136
150
  */
137
- this.sideOffset = input(0, { ...(ngDevMode ? { debugName: "sideOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
151
+ this.sideOffset = input(this.config.sideOffset ?? 0, { ...(ngDevMode ? { debugName: "sideOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
138
152
  /**
139
153
  * How to align the popup relative to the specified side. May change when collisions occur.
140
154
  */
141
- this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
155
+ this.align = input(this.config.align ?? 'center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
142
156
  /** An offset in pixels from the `start` or `end` alignment options. */
143
- this.alignOffset = input(0, { ...(ngDevMode ? { debugName: "alignOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
157
+ this.alignOffset = input(this.config.alignOffset ?? 0, { ...(ngDevMode ? { debugName: "alignOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
144
158
  /**
145
159
  * Minimum distance to maintain between the arrow and the edges of the popup.
146
160
  * If your content has border-radius, this will prevent it from overflowing the corners.
147
161
  */
148
- this.arrowPadding = input(0, { ...(ngDevMode ? { debugName: "arrowPadding" } : /* istanbul ignore next */ {}), transform: numberAttribute });
162
+ this.arrowPadding = input(this.config.arrowPadding ?? 0, { ...(ngDevMode ? { debugName: "arrowPadding" } : /* istanbul ignore next */ {}), transform: numberAttribute });
149
163
  /** When `true`, overrides the `side` and `align` preferences to prevent collisions with boundary edges. */
150
- this.avoidCollisions = input(true, { ...(ngDevMode ? { debugName: "avoidCollisions" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
164
+ this.avoidCollisions = input(this.config.avoidCollisions ?? true, { ...(ngDevMode ? { debugName: "avoidCollisions" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
151
165
  /**
152
166
  * The element used as the collision boundary.
153
167
  * By default this is the viewport, though you can provide additional element(s) to be included in this check.
@@ -157,34 +171,37 @@ class RdxPopperContentWrapper {
157
171
  * The distance in pixels from the boundary edges where collision detection should occur.
158
172
  * Accepts a number (same for all sides), or a partial padding object, for example: `{ top: 20, left: 20 }`.
159
173
  */
160
- this.collisionPadding = input(0, ...(ngDevMode ? [{ debugName: "collisionPadding" }] : /* istanbul ignore next */ []));
174
+ this.collisionPadding = input(this.config.collisionPadding ?? 0, ...(ngDevMode ? [{ debugName: "collisionPadding" }] : /* istanbul ignore next */ []));
161
175
  /**
162
176
  * The sticky behavior on the align axis. `partial` will keep the
163
177
  * content in the boundary as long as the trigger is at least partially
164
178
  * in the boundary whilst "always" will keep the content in the boundary
165
179
  * regardless.
166
180
  */
167
- this.sticky = input('partial', ...(ngDevMode ? [{ debugName: "sticky" }] : /* istanbul ignore next */ []));
181
+ this.sticky = input(this.config.sticky ?? 'partial', ...(ngDevMode ? [{ debugName: "sticky" }] : /* istanbul ignore next */ []));
168
182
  /**
169
183
  * Whether to hide the content when the trigger becomes fully occluded.
170
184
  */
171
- this.hideWhenDetached = input(false, { ...(ngDevMode ? { debugName: "hideWhenDetached" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
185
+ this.hideWhenDetached = input(this.config.hideWhenDetached ?? false, { ...(ngDevMode ? { debugName: "hideWhenDetached" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
172
186
  /**
173
187
  * The type of CSS position property to use.
174
188
  */
175
- this.positionStrategy = input('fixed', ...(ngDevMode ? [{ debugName: "positionStrategy" }] : /* istanbul ignore next */ []));
189
+ this.positionStrategy = input(this.config.positionStrategy ?? 'fixed', ...(ngDevMode ? [{ debugName: "positionStrategy" }] : /* istanbul ignore next */ []));
176
190
  /**
177
191
  * Strategy to update the position of the floating element on every animation frame.
178
192
  */
179
- this.updatePositionStrategy = input('always', ...(ngDevMode ? [{ debugName: "updatePositionStrategy" }] : /* istanbul ignore next */ []));
193
+ this.updatePositionStrategy = input(this.config.updatePositionStrategy ?? 'optimized', ...(ngDevMode ? [{ debugName: "updatePositionStrategy" }] : /* istanbul ignore next */ []));
180
194
  /**
181
195
  * Emits when the element is placed.
182
196
  */
183
197
  this.placed = output();
184
198
  this.arrow = contentChild(forwardRef(() => RdxPopperArrow), ...(ngDevMode ? [{ debugName: "arrow" }] : /* istanbul ignore next */ []));
185
199
  this.shouldHideArrow = computed(() => this.position.value()?.middlewareData['arrow']?.centerOffset !== 0, ...(ngDevMode ? [{ debugName: "shouldHideArrow" }] : /* istanbul ignore next */ []));
200
+ /** Whether the arrow could not be centered on the anchor because the popup was shifted. */
201
+ this.arrowUncentered = computed(() => (this.position.value()?.middlewareData['arrow']?.centerOffset ?? 0) !== 0, ...(ngDevMode ? [{ debugName: "arrowUncentered" }] : /* istanbul ignore next */ []));
186
202
  this.arrowX = computed(() => this.position.value()?.middlewareData['arrow']?.x, ...(ngDevMode ? [{ debugName: "arrowX" }] : /* istanbul ignore next */ []));
187
203
  this.arrowY = computed(() => this.position.value()?.middlewareData['arrow']?.y, ...(ngDevMode ? [{ debugName: "arrowY" }] : /* istanbul ignore next */ []));
204
+ this.anchorHidden = computed(() => this.position.value()?.middlewareData.hide?.referenceHidden === true, ...(ngDevMode ? [{ debugName: "anchorHidden" }] : /* istanbul ignore next */ []));
188
205
  this.desiredPlacement = computed(() => (this.side() + (this.align() !== 'center' ? '-' + this.align() : '')), ...(ngDevMode ? [{ debugName: "desiredPlacement" }] : /* istanbul ignore next */ []));
189
206
  this.arrowSize = computed(() => {
190
207
  const arrowElementRef = this.arrow()?.elementRef;
@@ -216,25 +233,55 @@ class RdxPopperContentWrapper {
216
233
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
217
234
  altBoundary: this.hasExplicitBoundaries()
218
235
  }), ...(ngDevMode ? [{ debugName: "detectOverflowOptions" }] : /* istanbul ignore next */ []));
219
- this.position = resource({ ...(ngDevMode ? { debugName: "position" } : /* istanbul ignore next */ {}), loader: () => computePosition(this.context.anchor().elementRef.nativeElement, this.elementRef.nativeElement, {
220
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
236
+ this.resolvedAnchor = computed(() => {
237
+ const anchor = this.anchor();
238
+ const resolvedAnchor = typeof anchor === 'function' ? anchor() : anchor;
239
+ if (resolvedAnchor instanceof ElementRef) {
240
+ return resolvedAnchor.nativeElement;
241
+ }
242
+ if (resolvedAnchor) {
243
+ return resolvedAnchor;
244
+ }
245
+ const fallbackAnchor = this.context.anchorOverride() ?? this.context.anchor()?.elementRef.nativeElement;
246
+ if (!fallbackAnchor) {
247
+ throw new Error('RdxPopperContentWrapper requires an anchor.');
248
+ }
249
+ return fallbackAnchor;
250
+ }, ...(ngDevMode ? [{ debugName: "resolvedAnchor" }] : /* istanbul ignore next */ []));
251
+ this.position = resource({ ...(ngDevMode ? { debugName: "position" } : /* istanbul ignore next */ {}), params: () => ({
252
+ anchor: this.resolvedAnchor(),
221
253
  strategy: this.positionStrategy(),
222
254
  placement: this.desiredPlacement(),
255
+ sideOffset: this.sideOffset(),
256
+ alignOffset: this.alignOffset(),
257
+ arrowHeight: this.arrowSize()().height,
258
+ arrowWidth: this.arrowSize()().width,
259
+ avoidCollisions: this.avoidCollisions(),
260
+ sticky: this.sticky(),
261
+ detectOverflowOptions: this.detectOverflowOptions(),
262
+ arrow: this.arrow(),
263
+ arrowPadding: this.arrowPadding(),
264
+ hideWhenDetached: this.hideWhenDetached()
265
+ }),
266
+ loader: ({ params }) => computePosition(params.anchor, this.elementRef.nativeElement, {
267
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
268
+ strategy: params.strategy,
269
+ placement: params.placement,
223
270
  middleware: [
224
271
  offset({
225
- mainAxis: this.sideOffset() + this.arrowSize()().height || 0,
226
- alignmentAxis: this.alignOffset()
272
+ mainAxis: params.sideOffset + params.arrowHeight || 0,
273
+ alignmentAxis: params.alignOffset
227
274
  }),
228
- this.avoidCollisions() &&
275
+ params.avoidCollisions &&
229
276
  shift({
230
277
  mainAxis: true,
231
278
  crossAxis: false,
232
- limiter: this.sticky() === 'partial' ? limitShift() : undefined,
233
- ...this.detectOverflowOptions()
279
+ limiter: params.sticky === 'partial' ? limitShift() : undefined,
280
+ ...params.detectOverflowOptions
234
281
  }),
235
- this.avoidCollisions() && flip({ ...this.detectOverflowOptions() }),
282
+ params.avoidCollisions && flip({ ...params.detectOverflowOptions }),
236
283
  size({
237
- ...this.detectOverflowOptions(),
284
+ ...params.detectOverflowOptions,
238
285
  apply: ({ elements, rects, availableWidth, availableHeight }) => {
239
286
  const { width: anchorWidth, height: anchorHeight } = rects.reference;
240
287
  const contentStyle = elements.floating.style;
@@ -244,19 +291,19 @@ class RdxPopperContentWrapper {
244
291
  contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
245
292
  }
246
293
  }),
247
- this.arrow() &&
294
+ params.arrow &&
248
295
  arrow({
249
- element: this.arrow().elementRef.nativeElement,
250
- padding: this.arrowPadding()
296
+ element: params.arrow.elementRef.nativeElement,
297
+ padding: params.arrowPadding
251
298
  }),
252
299
  transformOrigin({
253
- arrowWidth: this.arrowSize()().width,
254
- arrowHeight: this.arrowSize()().height
300
+ arrowWidth: params.arrowWidth,
301
+ arrowHeight: params.arrowHeight
255
302
  }),
256
- this.hideWhenDetached() &&
303
+ params.hideWhenDetached &&
257
304
  hide({
258
305
  strategy: 'referenceHidden',
259
- ...this.detectOverflowOptions()
306
+ ...params.detectOverflowOptions
260
307
  })
261
308
  ]
262
309
  }) });
@@ -311,6 +358,8 @@ class RdxPopperContentWrapper {
311
358
  pos?.middlewareData['transformOrigin']?.x,
312
359
  pos?.middlewareData['transformOrigin']?.y
313
360
  ].join(' '),
361
+ '--radix-popper-content-wrapper-width': `${this.elementRef.nativeElement.offsetWidth}px`,
362
+ '--radix-popper-content-wrapper-height': `${this.elementRef.nativeElement.offsetHeight}px`,
314
363
  visibility: ready ? 'visible' : 'hidden',
315
364
  pointerEvents: ready ? 'auto' : 'none',
316
365
  // hide the content if using the hide middleware and should be hidden
@@ -322,23 +371,24 @@ class RdxPopperContentWrapper {
322
371
  })
323
372
  };
324
373
  }, ...(ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []));
325
- this.afterNextRender = afterNextRender(() => {
374
+ this.afterRenderEffect = afterRenderEffect((onCleanup) => {
326
375
  this.position.reload();
327
- const cleanup = autoUpdate(this.context.anchor().elementRef.nativeElement, this.elementRef.nativeElement, () => this.position.reload(), {
376
+ const cleanup = autoUpdate(this.resolvedAnchor(), this.elementRef.nativeElement, () => this.position.reload(), {
328
377
  animationFrame: this.updatePositionStrategy() === 'always'
329
378
  });
330
- this.destroyRef.onDestroy(() => {
331
- cleanup();
332
- });
379
+ onCleanup(cleanup);
333
380
  });
334
- watch([this.isPositioned], () => {
381
+ watch([this.isPositioned], ([isPositioned]) => {
382
+ if (!isPositioned) {
383
+ return;
384
+ }
335
385
  afterNextRender(() => {
336
386
  this.placed.emit();
337
387
  }, { injector: this.injector });
338
388
  });
339
389
  }
340
390
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopperContentWrapper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
341
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.9", type: RdxPopperContentWrapper, isStandalone: true, selector: "[rdxPopperContentWrapper]", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, arrowPadding: { classPropertyName: "arrowPadding", publicName: "arrowPadding", isSignal: true, isRequired: false, transformFunction: null }, avoidCollisions: { classPropertyName: "avoidCollisions", publicName: "avoidCollisions", isSignal: true, isRequired: false, transformFunction: null }, collisionBoundary: { classPropertyName: "collisionBoundary", publicName: "collisionBoundary", isSignal: true, isRequired: false, transformFunction: null }, collisionPadding: { classPropertyName: "collisionPadding", publicName: "collisionPadding", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, hideWhenDetached: { classPropertyName: "hideWhenDetached", publicName: "hideWhenDetached", isSignal: true, isRequired: false, transformFunction: null }, positionStrategy: { classPropertyName: "positionStrategy", publicName: "positionStrategy", isSignal: true, isRequired: false, transformFunction: null }, updatePositionStrategy: { classPropertyName: "updatePositionStrategy", publicName: "updatePositionStrategy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { placed: "placed" }, host: { attributes: { "data-radix-popper-content-wrapper": "" }, properties: { "style": "style()" } }, providers: [providePopperContentWrapperContext(context)], queries: [{ propertyName: "arrow", first: true, predicate: i0.forwardRef(() => RdxPopperArrow), descendants: true, isSignal: true }, { propertyName: "contentElementRef", first: true, predicate: RdxPopperContent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
391
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.9", type: RdxPopperContentWrapper, isStandalone: true, selector: "[rdxPopperContentWrapper]", inputs: { anchor: { classPropertyName: "anchor", publicName: "anchor", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, arrowPadding: { classPropertyName: "arrowPadding", publicName: "arrowPadding", isSignal: true, isRequired: false, transformFunction: null }, avoidCollisions: { classPropertyName: "avoidCollisions", publicName: "avoidCollisions", isSignal: true, isRequired: false, transformFunction: null }, collisionBoundary: { classPropertyName: "collisionBoundary", publicName: "collisionBoundary", isSignal: true, isRequired: false, transformFunction: null }, collisionPadding: { classPropertyName: "collisionPadding", publicName: "collisionPadding", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, hideWhenDetached: { classPropertyName: "hideWhenDetached", publicName: "hideWhenDetached", isSignal: true, isRequired: false, transformFunction: null }, positionStrategy: { classPropertyName: "positionStrategy", publicName: "positionStrategy", isSignal: true, isRequired: false, transformFunction: null }, updatePositionStrategy: { classPropertyName: "updatePositionStrategy", publicName: "updatePositionStrategy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { placed: "placed" }, host: { attributes: { "data-radix-popper-content-wrapper": "" }, properties: { "style": "style()" } }, providers: [providePopperContentWrapperContext(context)], queries: [{ propertyName: "arrow", first: true, predicate: i0.forwardRef(() => RdxPopperArrow), descendants: true, isSignal: true }, { propertyName: "contentElementRef", first: true, predicate: RdxPopperContent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
342
392
  }
343
393
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopperContentWrapper, decorators: [{
344
394
  type: Directive,
@@ -350,7 +400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
350
400
  '[style]': 'style()'
351
401
  }
352
402
  }]
353
- }], ctorParameters: () => [], propDecorators: { side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], alignOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignOffset", required: false }] }], arrowPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowPadding", required: false }] }], avoidCollisions: [{ type: i0.Input, args: [{ isSignal: true, alias: "avoidCollisions", required: false }] }], collisionBoundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "collisionBoundary", required: false }] }], collisionPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "collisionPadding", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], hideWhenDetached: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideWhenDetached", required: false }] }], positionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "positionStrategy", required: false }] }], updatePositionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "updatePositionStrategy", required: false }] }], placed: [{ type: i0.Output, args: ["placed"] }], arrow: [{ type: i0.ContentChild, args: [forwardRef(() => RdxPopperArrow), { isSignal: true }] }], contentElementRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RdxPopperContent), { ...{
403
+ }], ctorParameters: () => [], propDecorators: { anchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchor", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], alignOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignOffset", required: false }] }], arrowPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowPadding", required: false }] }], avoidCollisions: [{ type: i0.Input, args: [{ isSignal: true, alias: "avoidCollisions", required: false }] }], collisionBoundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "collisionBoundary", required: false }] }], collisionPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "collisionPadding", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], hideWhenDetached: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideWhenDetached", required: false }] }], positionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "positionStrategy", required: false }] }], updatePositionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "updatePositionStrategy", required: false }] }], placed: [{ type: i0.Output, args: ["placed"] }], arrow: [{ type: i0.ContentChild, args: [forwardRef(() => RdxPopperArrow), { isSignal: true }] }], contentElementRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RdxPopperContent), { ...{
354
404
  read: ElementRef
355
405
  }, isSignal: true }] }] } });
356
406
 
@@ -419,5 +469,5 @@ const popperImports = [RdxPopper, RdxPopperArrow, RdxPopperContentWrapper, RdxPo
419
469
  * Generated bundle index. Do not edit.
420
470
  */
421
471
 
422
- export { RdxPopper, RdxPopperAnchor, RdxPopperArrow, RdxPopperContent, RdxPopperContentWrapper, getSideAndAlignFromPlacement, injectPopperContentWrapperContext, isNotNull, popperImports, providePopperContentWrapperContext, transformOrigin };
472
+ export { RdxPopper, RdxPopperAnchor, RdxPopperArrow, RdxPopperContent, RdxPopperContentConfigToken, RdxPopperContentWrapper, getSideAndAlignFromPlacement, injectPopperContentWrapperContext, isNotNull, popperImports, providePopperContentWrapperContext, provideRdxPopperContentConfig, transformOrigin };
423
473
  //# sourceMappingURL=radix-ng-primitives-popper.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-popper.mjs","sources":["../../../packages/primitives/popper/src/popper-anchor.ts","../../../packages/primitives/popper/src/popper.ts","../../../packages/primitives/popper/src/popper-content.ts","../../../packages/primitives/popper/src/utils.ts","../../../packages/primitives/popper/src/popper-content-wrapper.ts","../../../packages/primitives/popper/src/popper-arrow.ts","../../../packages/primitives/popper/index.ts","../../../packages/primitives/popper/radix-ng-primitives-popper.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\n\n@Directive({\n selector: '[rdxPopperAnchor]'\n})\nexport class RdxPopperAnchor {\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n}\n","import { contentChild, Directive } from '@angular/core';\nimport { RdxPopperAnchor } from './popper-anchor';\n\n@Directive({\n selector: '[rdxPopperRoot]'\n})\nexport class RdxPopper {\n readonly anchor = contentChild.required(RdxPopperAnchor);\n}\n","import { computed, Directive } from '@angular/core';\nimport { injectPopperContentWrapperContext } from './popper-content-wrapper';\n\n@Directive({\n selector: '[rdxPopperContent]',\n host: {\n '[attr.data-side]': 'popperContentWrapper.placedSide()',\n '[attr.data-align]': 'popperContentWrapper.placedAlign()',\n '[style]': 'style()'\n }\n})\nexport class RdxPopperContent {\n protected readonly popperContentWrapper = injectPopperContentWrapperContext()!;\n\n /**\n * if the PopperContent hasn't been placed yet (not all measurements done)\n * we prevent animations so that users's animation don't kick in too early referring wrong sides\n */\n protected readonly style = computed(() => ({\n animation: !this.popperContentWrapper.isPositioned() ? 'none' : undefined\n }));\n}\n","import type { Middleware, Placement } from '@floating-ui/dom';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\nexport type Side = (typeof SIDE_OPTIONS)[number];\nexport type Align = (typeof ALIGN_OPTIONS)[number];\n\nexport function isNotNull<T>(value: T | null): value is T {\n return value !== null;\n}\n\nexport function transformOrigin(options: { arrowWidth: number; arrowHeight: number }): Middleware {\n return {\n name: 'transformOrigin',\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: '0%', center: '50%', end: '100%' }[placedAlign];\n\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n\n let x = '';\n let y = '';\n\n if (placedSide === 'bottom') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === 'top') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === 'right') {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === 'left') {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n };\n}\n\nexport function getSideAndAlignFromPlacement(placement: Placement) {\n const [side, align = 'center'] = placement.split('-');\n return [side as Side, align as Align] as const;\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n numberAttribute,\n output,\n PLATFORM_ID,\n resource\n} from '@angular/core';\nimport {\n autoUpdate,\n computePosition,\n flip,\n arrow as floatingUIArrow,\n hide,\n limitShift,\n offset,\n Placement,\n shift,\n size\n} from '@floating-ui/dom';\nimport { createContext, elementSize, watch } from '@radix-ng/primitives/core';\nimport { RdxPopper } from './popper';\nimport { RdxPopperArrow } from './popper-arrow';\nimport { RdxPopperContent } from './popper-content';\nimport { Align, isNotNull, Side, transformOrigin } from './utils';\n\nconst context = () => {\n const popperContentWrapper = inject(RdxPopperContentWrapper);\n\n return {\n placedSide: popperContentWrapper.placedSide,\n placedAlign: popperContentWrapper.placedAlign,\n arrowX: popperContentWrapper.arrowX,\n arrowY: popperContentWrapper.arrowY,\n shouldHideArrow: popperContentWrapper.shouldHideArrow,\n isPositioned: popperContentWrapper.isPositioned\n };\n};\n\nexport type PopperContentWrapperContext = ReturnType<typeof context>;\n\nexport const [injectPopperContentWrapperContext, providePopperContentWrapperContext] =\n createContext<PopperContentWrapperContext>('PopperContentWrapperContext');\n\n@Directive({\n selector: '[rdxPopperContentWrapper]',\n providers: [providePopperContentWrapperContext(context)],\n host: {\n 'data-radix-popper-content-wrapper': '',\n '[style]': 'style()'\n }\n})\nexport class RdxPopperContentWrapper {\n private readonly elementRef = inject(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n\n private readonly context = inject(RdxPopper);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /**\n * The preferred side of the anchor to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n readonly side = input<Side>('bottom');\n\n /**\n * Distance between the anchor and the popup in pixels.\n */\n readonly sideOffset = input<number, NumberInput>(0, { transform: numberAttribute });\n\n /**\n * How to align the popup relative to the specified side. May change when collisions occur.\n */\n readonly align = input<Align>('center');\n\n /** An offset in pixels from the `start` or `end` alignment options. */\n readonly alignOffset = input<number, NumberInput>(0, { transform: numberAttribute });\n\n /**\n * Minimum distance to maintain between the arrow and the edges of the popup.\n * If your content has border-radius, this will prevent it from overflowing the corners.\n */\n readonly arrowPadding = input<number, NumberInput>(0, { transform: numberAttribute });\n\n /** When `true`, overrides the `side` and `align` preferences to prevent collisions with boundary edges. */\n readonly avoidCollisions = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * The element used as the collision boundary.\n * By default this is the viewport, though you can provide additional element(s) to be included in this check.\n */\n readonly collisionBoundary = input<ElementRef<HTMLElement> | ElementRef<HTMLElement>[]>();\n /**\n * The distance in pixels from the boundary edges where collision detection should occur.\n * Accepts a number (same for all sides), or a partial padding object, for example: `{ top: 20, left: 20 }`.\n */\n readonly collisionPadding = input<number | Partial<Record<Side, number>>>(0);\n\n /**\n * The sticky behavior on the align axis. `partial` will keep the\n * content in the boundary as long as the trigger is at least partially\n * in the boundary whilst \"always\" will keep the content in the boundary\n * regardless.\n */\n readonly sticky = input<'partial' | 'always'>('partial');\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n readonly hideWhenDetached = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The type of CSS position property to use.\n */\n readonly positionStrategy = input<'fixed' | 'absolute'>('fixed');\n\n /**\n * Strategy to update the position of the floating element on every animation frame.\n */\n readonly updatePositionStrategy = input<'optimized' | 'always'>('always');\n\n /**\n * Emits when the element is placed.\n */\n readonly placed = output<void>();\n\n readonly arrow = contentChild(forwardRef(() => RdxPopperArrow));\n\n readonly shouldHideArrow = computed(() => this.position.value()?.middlewareData['arrow']?.centerOffset !== 0);\n readonly arrowX = computed(() => this.position.value()?.middlewareData['arrow']?.x);\n readonly arrowY = computed(() => this.position.value()?.middlewareData['arrow']?.y);\n\n private readonly desiredPlacement = computed(\n () => (this.side() + (this.align() !== 'center' ? '-' + this.align() : '')) as Placement\n );\n\n private readonly arrowSize = computed(() => {\n const arrowElementRef = this.arrow()?.elementRef;\n\n if (!arrowElementRef) {\n return computed(() => ({\n height: 0,\n width: 0\n }));\n }\n\n return elementSize({\n elementRef: arrowElementRef,\n injector: this.injector\n });\n });\n\n private readonly boundary = computed(() => {\n const boundary = this.collisionBoundary();\n\n if (Array.isArray(boundary)) {\n return boundary.map((e) => e.nativeElement);\n }\n\n if (!boundary) {\n return [];\n }\n\n return [boundary.nativeElement];\n });\n\n private readonly hasExplicitBoundaries = computed(() => this.boundary().length > 0);\n\n private readonly detectOverflowOptions = computed(() => ({\n padding: this.collisionPadding(),\n boundary: this.boundary().filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: this.hasExplicitBoundaries()\n }));\n\n private readonly position = resource({\n loader: () =>\n computePosition(this.context.anchor().elementRef.nativeElement, this.elementRef.nativeElement, {\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: this.positionStrategy(),\n placement: this.desiredPlacement(),\n middleware: [\n offset({\n mainAxis: this.sideOffset() + this.arrowSize()().height || 0,\n alignmentAxis: this.alignOffset()\n }),\n this.avoidCollisions() &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: this.sticky() === 'partial' ? limitShift() : undefined,\n ...this.detectOverflowOptions()\n }),\n this.avoidCollisions() && flip({ ...this.detectOverflowOptions() }),\n size({\n ...this.detectOverflowOptions(),\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n }\n }),\n this.arrow() &&\n floatingUIArrow({\n element: this.arrow()!.elementRef.nativeElement,\n padding: this.arrowPadding()\n }),\n transformOrigin({\n arrowWidth: this.arrowSize()().width,\n arrowHeight: this.arrowSize()().height\n }),\n this.hideWhenDetached() &&\n hide({\n strategy: 'referenceHidden',\n ...this.detectOverflowOptions()\n })\n ]\n })\n });\n\n /**\n * Whether the panel is positioned.\n */\n readonly isPositioned = computed(() => this.position.hasValue());\n\n /**\n * The current placement of the panel.\n */\n readonly placement = computed(() => {\n const placement = this.position.value()?.placement;\n\n if (!placement) {\n return;\n }\n\n const [side, align = 'center'] = placement.split('-');\n\n return {\n side: side as Side,\n align: align as Align\n };\n });\n\n /**\n * The side the panel is currently placed against.\n */\n readonly placedSide = computed(() => this.placement()?.side);\n\n /**\n * The current alignment of the panel.\n */\n readonly placedAlign = computed(() => this.placement()?.align);\n\n private readonly contentElementRef = contentChild.required<RdxPopperContent, ElementRef<HTMLElement>>(\n RdxPopperContent,\n {\n read: ElementRef\n }\n );\n\n protected readonly contentZIndex = computed(() => {\n if (!this.isBrowser) {\n return 0;\n }\n\n return getComputedStyle(this.contentElementRef().nativeElement).zIndex;\n });\n\n protected readonly style = computed(() => {\n const pos = this.position.value();\n const x = pos?.x;\n const y = pos?.y;\n\n const ready = Number.isFinite(x) && Number.isFinite(y);\n\n return {\n position: this.positionStrategy(),\n transform: this.isPositioned() ? '' : 'translate(0, -200%)', // keep off the page when measuring\n minWidth: 'max-content',\n zIndex: this.contentZIndex(),\n top: Number.isFinite(y as number) ? `${y}px` : '',\n left: Number.isFinite(x as number) ? `${x}px` : '',\n '--radix-popper-transform-origin': [\n pos?.middlewareData['transformOrigin']?.x,\n pos?.middlewareData['transformOrigin']?.y\n ].join(' '),\n\n visibility: ready ? 'visible' : 'hidden',\n pointerEvents: ready ? 'auto' : 'none',\n\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...(pos?.middlewareData.hide?.referenceHidden && {\n visibility: 'hidden',\n pointerEvents: 'none'\n })\n };\n });\n\n private readonly afterNextRender = afterNextRender(() => {\n this.position.reload();\n\n const cleanup = autoUpdate(\n this.context.anchor().elementRef.nativeElement,\n this.elementRef.nativeElement,\n () => this.position.reload(),\n {\n animationFrame: this.updatePositionStrategy() === 'always'\n }\n );\n\n this.destroyRef.onDestroy(() => {\n cleanup();\n });\n });\n\n constructor() {\n watch([this.isPositioned], () => {\n afterNextRender(\n () => {\n this.placed.emit();\n },\n { injector: this.injector }\n );\n });\n }\n}\n","import {\n computed,\n createComponent,\n Directive,\n effect,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n inputBinding,\n numberAttribute\n} from '@angular/core';\nimport { RdxArrow } from '@radix-ng/primitives/arrow';\nimport { injectPopperContentWrapperContext } from './popper-content-wrapper';\nimport { Side } from './utils';\n\nconst OPPOSITE_SIDE: Record<Side, Side> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right'\n};\n\n@Directive({\n selector: '[rdxPopperArrow]',\n host: {\n '[style]': 'style()'\n }\n})\nexport class RdxPopperArrow {\n private readonly popperContentContext = injectPopperContentWrapperContext()!;\n\n private readonly environmentInjector = inject(EnvironmentInjector);\n\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly width = input(10, { transform: numberAttribute });\n\n readonly height = input(5, { transform: numberAttribute });\n\n baseSide = computed(() => OPPOSITE_SIDE[this.popperContentContext.placedSide()!]);\n\n protected readonly style = computed(() => {\n return {\n position: 'absolute',\n left: this.popperContentContext.arrowX() ? `${this.popperContentContext.arrowX()}px` : undefined,\n top: this.popperContentContext.arrowY() ? `${this.popperContentContext.arrowY()}px` : undefined,\n [this.baseSide()]: 0,\n transformOrigin: {\n top: '',\n right: '0 0',\n bottom: 'center 0',\n left: '100% 0'\n }[this.popperContentContext.placedSide()!],\n transform: {\n top: 'translateY(100%)',\n right: 'translateY(50%) rotate(90deg) translateX(-50%)',\n bottom: `rotate(180deg)`,\n left: 'translateY(50%) rotate(-90deg) translateX(50%)'\n }[this.popperContentContext.placedSide()!],\n visibility: this.popperContentContext.shouldHideArrow() ? 'hidden' : undefined\n };\n });\n\n private onCleanup = effect((onCleanup) => {\n const component = createComponent(RdxArrow, {\n environmentInjector: this.environmentInjector,\n hostElement: this.elementRef.nativeElement,\n projectableNodes: [Array.from(this.elementRef.nativeElement.childNodes)],\n bindings: [inputBinding('width', () => this.width()), inputBinding('height', () => this.height())]\n });\n\n component.changeDetectorRef.detectChanges();\n\n onCleanup(() => component.destroy());\n });\n}\n","import { RdxPopper } from './src/popper';\nimport { RdxPopperAnchor } from './src/popper-anchor';\nimport { RdxPopperArrow } from './src/popper-arrow';\nimport { RdxPopperContent } from './src/popper-content';\nimport { RdxPopperContentWrapper } from './src/popper-content-wrapper';\n\nexport * from './src/popper';\nexport * from './src/popper-anchor';\nexport * from './src/popper-arrow';\nexport * from './src/popper-content';\nexport * from './src/popper-content-wrapper';\nexport * from './src/utils';\n\nexport const popperImports = [RdxPopper, RdxPopperArrow, RdxPopperContentWrapper, RdxPopperContent, RdxPopperAnchor];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["floatingUIArrow"],"mappings":";;;;;;;MAKa,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAIa,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACpE,IAAA;8GAFY,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,SAAS;AAAC,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itives/popper/src/popper-anchor.ts","../../../packages/primitives/popper/src/popper.ts","../../../packages/primitives/popper/src/popper-content.ts","../../../packages/primitives/popper/src/popper-content.config.ts","../../../packages/primitives/popper/src/utils.ts","../../../packages/primitives/popper/src/popper-content-wrapper.ts","../../../packages/primitives/popper/src/popper-arrow.ts","../../../packages/primitives/popper/index.ts","../../../packages/primitives/popper/radix-ng-primitives-popper.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\n\n@Directive({\n selector: '[rdxPopperAnchor]'\n})\nexport class RdxPopperAnchor {\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n}\n","import { contentChild, Directive, signal } from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\nimport { RdxPopperAnchor } from './popper-anchor';\n\n@Directive({\n selector: '[rdxPopperRoot]'\n})\nexport class RdxPopper {\n readonly anchor = contentChild(RdxPopperAnchor);\n readonly anchorOverride = signal<ReferenceElement | undefined>(undefined);\n}\n","import { computed, Directive } from '@angular/core';\nimport { injectPopperContentWrapperContext } from './popper-content-wrapper';\n\n@Directive({\n selector: '[rdxPopperContent]',\n host: {\n '[attr.data-side]': 'popperContentWrapper.placedSide()',\n '[attr.data-align]': 'popperContentWrapper.placedAlign()',\n '[style]': 'style()'\n }\n})\nexport class RdxPopperContent {\n protected readonly popperContentWrapper = injectPopperContentWrapperContext()!;\n\n /**\n * if the PopperContent hasn't been placed yet (not all measurements done)\n * we prevent animations so that users's animation don't kick in too early referring wrong sides\n */\n protected readonly style = computed(() => ({\n animation: !this.popperContentWrapper.isPositioned() ? 'none' : undefined\n }));\n}\n","import { InjectionToken, Provider } from '@angular/core';\nimport { Align, Side } from './utils';\n\n/**\n * Default positioning values for `RdxPopperContentWrapper`.\n *\n * Lets a composing primitive (e.g. tooltip) provide its own Base UI-aligned defaults without\n * changing the shared popper defaults that other consumers (e.g. popover) rely on. Any value left\n * `undefined` falls back to the wrapper's built-in default. Consumer template bindings always win.\n */\nexport interface RdxPopperContentConfig {\n side?: Side;\n align?: Align;\n sideOffset?: number;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionPadding?: number | Partial<Record<Side, number>>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n positionStrategy?: 'fixed' | 'absolute';\n updatePositionStrategy?: 'optimized' | 'always';\n}\n\nexport const RdxPopperContentConfigToken = new InjectionToken<RdxPopperContentConfig>('RdxPopperContentConfig', {\n factory: () => ({})\n});\n\nexport function provideRdxPopperContentConfig(config: RdxPopperContentConfig): Provider {\n return { provide: RdxPopperContentConfigToken, useValue: config };\n}\n","import type { Middleware, Placement } from '@floating-ui/dom';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\nexport type Side = (typeof SIDE_OPTIONS)[number];\nexport type Align = (typeof ALIGN_OPTIONS)[number];\n\nexport function isNotNull<T>(value: T | null): value is T {\n return value !== null;\n}\n\nexport function transformOrigin(options: { arrowWidth: number; arrowHeight: number }): Middleware {\n return {\n name: 'transformOrigin',\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: '0%', center: '50%', end: '100%' }[placedAlign];\n\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n\n let x = '';\n let y = '';\n\n if (placedSide === 'bottom') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === 'top') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === 'right') {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === 'left') {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n };\n}\n\nexport function getSideAndAlignFromPlacement(placement: Placement) {\n const [side, align = 'center'] = placement.split('-');\n return [side as Side, align as Align] as const;\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChild,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n numberAttribute,\n output,\n PLATFORM_ID,\n resource\n} from '@angular/core';\nimport type { ReferenceElement, VirtualElement } from '@floating-ui/dom';\nimport {\n autoUpdate,\n computePosition,\n flip,\n arrow as floatingUIArrow,\n hide,\n limitShift,\n offset,\n Placement,\n shift,\n size\n} from '@floating-ui/dom';\nimport { BooleanInput, createContext, elementSize, NumberInput, watch } from '@radix-ng/primitives/core';\nimport { RdxPopper } from './popper';\nimport { RdxPopperArrow } from './popper-arrow';\nimport { RdxPopperContent } from './popper-content';\nimport { RdxPopperContentConfigToken } from './popper-content.config';\nimport { Align, isNotNull, Side, transformOrigin } from './utils';\n\nexport type RdxPopperAnchorElement =\n | Element\n | ElementRef<Element>\n | VirtualElement\n | (() => Element | VirtualElement | null)\n | null\n | undefined;\n\nconst context = () => {\n const popperContentWrapper = inject(RdxPopperContentWrapper);\n\n return {\n placedSide: popperContentWrapper.placedSide,\n placedAlign: popperContentWrapper.placedAlign,\n arrowX: popperContentWrapper.arrowX,\n arrowY: popperContentWrapper.arrowY,\n shouldHideArrow: popperContentWrapper.shouldHideArrow,\n isPositioned: popperContentWrapper.isPositioned,\n anchorHidden: popperContentWrapper.anchorHidden\n };\n};\n\nexport type PopperContentWrapperContext = ReturnType<typeof context>;\n\nexport const [injectPopperContentWrapperContext, providePopperContentWrapperContext] =\n createContext<PopperContentWrapperContext>('PopperContentWrapperContext');\n\n@Directive({\n selector: '[rdxPopperContentWrapper]',\n providers: [providePopperContentWrapperContext(context)],\n host: {\n 'data-radix-popper-content-wrapper': '',\n '[style]': 'style()'\n }\n})\nexport class RdxPopperContentWrapper {\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n\n private readonly context = inject(RdxPopper);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Optional positioning defaults provided by a composing primitive (e.g. tooltip). */\n private readonly config = inject(RdxPopperContentConfigToken);\n\n /**\n * An element to position the popup against. Defaults to the popper anchor.\n */\n readonly anchor = input<RdxPopperAnchorElement>();\n\n /**\n * The preferred side of the anchor to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n readonly side = input<Side>(this.config.side ?? 'bottom');\n\n /**\n * Distance between the anchor and the popup in pixels.\n */\n readonly sideOffset = input<number, NumberInput>(this.config.sideOffset ?? 0, { transform: numberAttribute });\n\n /**\n * How to align the popup relative to the specified side. May change when collisions occur.\n */\n readonly align = input<Align>(this.config.align ?? 'center');\n\n /** An offset in pixels from the `start` or `end` alignment options. */\n readonly alignOffset = input<number, NumberInput>(this.config.alignOffset ?? 0, { transform: numberAttribute });\n\n /**\n * Minimum distance to maintain between the arrow and the edges of the popup.\n * If your content has border-radius, this will prevent it from overflowing the corners.\n */\n readonly arrowPadding = input<number, NumberInput>(this.config.arrowPadding ?? 0, { transform: numberAttribute });\n\n /** When `true`, overrides the `side` and `align` preferences to prevent collisions with boundary edges. */\n readonly avoidCollisions = input<boolean, BooleanInput>(this.config.avoidCollisions ?? true, {\n transform: booleanAttribute\n });\n\n /**\n * The element used as the collision boundary.\n * By default this is the viewport, though you can provide additional element(s) to be included in this check.\n */\n readonly collisionBoundary = input<ElementRef<HTMLElement> | ElementRef<HTMLElement>[]>();\n /**\n * The distance in pixels from the boundary edges where collision detection should occur.\n * Accepts a number (same for all sides), or a partial padding object, for example: `{ top: 20, left: 20 }`.\n */\n readonly collisionPadding = input<number | Partial<Record<Side, number>>>(this.config.collisionPadding ?? 0);\n\n /**\n * The sticky behavior on the align axis. `partial` will keep the\n * content in the boundary as long as the trigger is at least partially\n * in the boundary whilst \"always\" will keep the content in the boundary\n * regardless.\n */\n readonly sticky = input<'partial' | 'always'>(this.config.sticky ?? 'partial');\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n readonly hideWhenDetached = input<boolean, BooleanInput>(this.config.hideWhenDetached ?? false, {\n transform: booleanAttribute\n });\n\n /**\n * The type of CSS position property to use.\n */\n readonly positionStrategy = input<'fixed' | 'absolute'>(this.config.positionStrategy ?? 'fixed');\n\n /**\n * Strategy to update the position of the floating element on every animation frame.\n */\n readonly updatePositionStrategy = input<'optimized' | 'always'>(this.config.updatePositionStrategy ?? 'optimized');\n\n /**\n * Emits when the element is placed.\n */\n readonly placed = output<void>();\n\n readonly arrow = contentChild(forwardRef(() => RdxPopperArrow));\n\n readonly shouldHideArrow = computed(() => this.position.value()?.middlewareData['arrow']?.centerOffset !== 0);\n /** Whether the arrow could not be centered on the anchor because the popup was shifted. */\n readonly arrowUncentered = computed(\n () => (this.position.value()?.middlewareData['arrow']?.centerOffset ?? 0) !== 0\n );\n readonly arrowX = computed(() => this.position.value()?.middlewareData['arrow']?.x);\n readonly arrowY = computed(() => this.position.value()?.middlewareData['arrow']?.y);\n readonly anchorHidden = computed(() => this.position.value()?.middlewareData.hide?.referenceHidden === true);\n\n private readonly desiredPlacement = computed(\n () => (this.side() + (this.align() !== 'center' ? '-' + this.align() : '')) as Placement\n );\n\n private readonly arrowSize = computed(() => {\n const arrowElementRef = this.arrow()?.elementRef;\n\n if (!arrowElementRef) {\n return computed(() => ({\n height: 0,\n width: 0\n }));\n }\n\n return elementSize({\n elementRef: arrowElementRef,\n injector: this.injector\n });\n });\n\n private readonly boundary = computed(() => {\n const boundary = this.collisionBoundary();\n\n if (Array.isArray(boundary)) {\n return boundary.map((e) => e.nativeElement);\n }\n\n if (!boundary) {\n return [];\n }\n\n return [boundary.nativeElement];\n });\n\n private readonly hasExplicitBoundaries = computed(() => this.boundary().length > 0);\n\n private readonly detectOverflowOptions = computed(() => ({\n padding: this.collisionPadding(),\n boundary: this.boundary().filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: this.hasExplicitBoundaries()\n }));\n\n private readonly resolvedAnchor = computed<ReferenceElement>(() => {\n const anchor = this.anchor();\n const resolvedAnchor = typeof anchor === 'function' ? anchor() : anchor;\n\n if (resolvedAnchor instanceof ElementRef) {\n return resolvedAnchor.nativeElement;\n }\n\n if (resolvedAnchor) {\n return resolvedAnchor;\n }\n\n const fallbackAnchor = this.context.anchorOverride() ?? this.context.anchor()?.elementRef.nativeElement;\n\n if (!fallbackAnchor) {\n throw new Error('RdxPopperContentWrapper requires an anchor.');\n }\n\n return fallbackAnchor;\n });\n\n private readonly position = resource({\n params: () => ({\n anchor: this.resolvedAnchor(),\n strategy: this.positionStrategy(),\n placement: this.desiredPlacement(),\n sideOffset: this.sideOffset(),\n alignOffset: this.alignOffset(),\n arrowHeight: this.arrowSize()().height,\n arrowWidth: this.arrowSize()().width,\n avoidCollisions: this.avoidCollisions(),\n sticky: this.sticky(),\n detectOverflowOptions: this.detectOverflowOptions(),\n arrow: this.arrow(),\n arrowPadding: this.arrowPadding(),\n hideWhenDetached: this.hideWhenDetached()\n }),\n loader: ({ params }) =>\n computePosition(params.anchor, this.elementRef.nativeElement, {\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: params.strategy,\n placement: params.placement,\n middleware: [\n offset({\n mainAxis: params.sideOffset + params.arrowHeight || 0,\n alignmentAxis: params.alignOffset\n }),\n params.avoidCollisions &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: params.sticky === 'partial' ? limitShift() : undefined,\n ...params.detectOverflowOptions\n }),\n params.avoidCollisions && flip({ ...params.detectOverflowOptions }),\n size({\n ...params.detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n }\n }),\n params.arrow &&\n floatingUIArrow({\n element: params.arrow.elementRef.nativeElement,\n padding: params.arrowPadding\n }),\n transformOrigin({\n arrowWidth: params.arrowWidth,\n arrowHeight: params.arrowHeight\n }),\n params.hideWhenDetached &&\n hide({\n strategy: 'referenceHidden',\n ...params.detectOverflowOptions\n })\n ]\n })\n });\n\n /**\n * Whether the panel is positioned.\n */\n readonly isPositioned = computed(() => this.position.hasValue());\n\n /**\n * The current placement of the panel.\n */\n readonly placement = computed(() => {\n const placement = this.position.value()?.placement;\n\n if (!placement) {\n return;\n }\n\n const [side, align = 'center'] = placement.split('-');\n\n return {\n side: side as Side,\n align: align as Align\n };\n });\n\n /**\n * The side the panel is currently placed against.\n */\n readonly placedSide = computed(() => this.placement()?.side);\n\n /**\n * The current alignment of the panel.\n */\n readonly placedAlign = computed(() => this.placement()?.align);\n\n private readonly contentElementRef = contentChild.required<RdxPopperContent, ElementRef<HTMLElement>>(\n RdxPopperContent,\n {\n read: ElementRef\n }\n );\n\n protected readonly contentZIndex = computed(() => {\n if (!this.isBrowser) {\n return 0;\n }\n\n return getComputedStyle(this.contentElementRef().nativeElement).zIndex;\n });\n\n protected readonly style = computed(() => {\n const pos = this.position.value();\n const x = pos?.x;\n const y = pos?.y;\n\n const ready = Number.isFinite(x) && Number.isFinite(y);\n\n return {\n position: this.positionStrategy(),\n transform: this.isPositioned() ? '' : 'translate(0, -200%)', // keep off the page when measuring\n minWidth: 'max-content',\n zIndex: this.contentZIndex(),\n top: Number.isFinite(y as number) ? `${y}px` : '',\n left: Number.isFinite(x as number) ? `${x}px` : '',\n '--radix-popper-transform-origin': [\n pos?.middlewareData['transformOrigin']?.x,\n pos?.middlewareData['transformOrigin']?.y\n ].join(' '),\n '--radix-popper-content-wrapper-width': `${this.elementRef.nativeElement.offsetWidth}px`,\n '--radix-popper-content-wrapper-height': `${this.elementRef.nativeElement.offsetHeight}px`,\n\n visibility: ready ? 'visible' : 'hidden',\n pointerEvents: ready ? 'auto' : 'none',\n\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...(pos?.middlewareData.hide?.referenceHidden && {\n visibility: 'hidden',\n pointerEvents: 'none'\n })\n };\n });\n\n private readonly afterRenderEffect = afterRenderEffect((onCleanup) => {\n this.position.reload();\n\n const cleanup = autoUpdate(this.resolvedAnchor(), this.elementRef.nativeElement, () => this.position.reload(), {\n animationFrame: this.updatePositionStrategy() === 'always'\n });\n\n onCleanup(cleanup);\n });\n\n constructor() {\n watch([this.isPositioned], ([isPositioned]) => {\n if (!isPositioned) {\n return;\n }\n\n afterNextRender(\n () => {\n this.placed.emit();\n },\n { injector: this.injector }\n );\n });\n }\n}\n","import {\n computed,\n createComponent,\n Directive,\n effect,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n inputBinding,\n numberAttribute\n} from '@angular/core';\nimport { RdxArrow } from '@radix-ng/primitives/arrow';\nimport { injectPopperContentWrapperContext } from './popper-content-wrapper';\nimport { Side } from './utils';\n\nconst OPPOSITE_SIDE: Record<Side, Side> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right'\n};\n\n@Directive({\n selector: '[rdxPopperArrow]',\n host: {\n '[style]': 'style()'\n }\n})\nexport class RdxPopperArrow {\n private readonly popperContentContext = injectPopperContentWrapperContext()!;\n\n private readonly environmentInjector = inject(EnvironmentInjector);\n\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly width = input(10, { transform: numberAttribute });\n\n readonly height = input(5, { transform: numberAttribute });\n\n baseSide = computed(() => OPPOSITE_SIDE[this.popperContentContext.placedSide()!]);\n\n protected readonly style = computed(() => {\n return {\n position: 'absolute',\n left: this.popperContentContext.arrowX() ? `${this.popperContentContext.arrowX()}px` : undefined,\n top: this.popperContentContext.arrowY() ? `${this.popperContentContext.arrowY()}px` : undefined,\n [this.baseSide()]: 0,\n transformOrigin: {\n top: '',\n right: '0 0',\n bottom: 'center 0',\n left: '100% 0'\n }[this.popperContentContext.placedSide()!],\n transform: {\n top: 'translateY(100%)',\n right: 'translateY(50%) rotate(90deg) translateX(-50%)',\n bottom: `rotate(180deg)`,\n left: 'translateY(50%) rotate(-90deg) translateX(50%)'\n }[this.popperContentContext.placedSide()!],\n visibility: this.popperContentContext.shouldHideArrow() ? 'hidden' : undefined\n };\n });\n\n private onCleanup = effect((onCleanup) => {\n const component = createComponent(RdxArrow, {\n environmentInjector: this.environmentInjector,\n hostElement: this.elementRef.nativeElement,\n projectableNodes: [Array.from(this.elementRef.nativeElement.childNodes)],\n bindings: [inputBinding('width', () => this.width()), inputBinding('height', () => this.height())]\n });\n\n component.changeDetectorRef.detectChanges();\n\n onCleanup(() => component.destroy());\n });\n}\n","import { RdxPopper } from './src/popper';\nimport { RdxPopperAnchor } from './src/popper-anchor';\nimport { RdxPopperArrow } from './src/popper-arrow';\nimport { RdxPopperContent } from './src/popper-content';\nimport { RdxPopperContentWrapper } from './src/popper-content-wrapper';\n\nexport * from './src/popper';\nexport * from './src/popper-anchor';\nexport * from './src/popper-arrow';\nexport * from './src/popper-content';\nexport * from './src/popper-content-wrapper';\nexport * from './src/popper-content.config';\nexport * from './src/utils';\n\nexport const popperImports = [RdxPopper, RdxPopperArrow, RdxPopperContentWrapper, RdxPopperContent, RdxPopperAnchor];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["floatingUIArrow"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d,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,IAAI,EAAE;AACF,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACdM,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,eAAe;;ACdnH;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { DOCUMENT, isPlatformBrowser } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, ElementRef, PLATFORM_ID, DestroyRef, input, linkedSignal, computed, Directive } from '@angular/core';
3
+ import { inject, ElementRef, PLATFORM_ID, DestroyRef, input, linkedSignal, computed, effect, Directive } from '@angular/core';
4
4
 
5
5
  class RdxPortal {
6
6
  constructor() {
@@ -9,13 +9,14 @@ class RdxPortal {
9
9
  this.document = inject(DOCUMENT, { optional: true });
10
10
  this.destroyRef = inject(DestroyRef);
11
11
  /**
12
- * Specify a container element to portal the content into.
12
+ * Specify a container to portal the content into. Can be an `ElementRef`, a native element, or a
13
+ * CSS selector. Defaults to `document.body` when not set (or when a selector matches nothing).
13
14
  */
14
15
  this.container = input(...(ngDevMode ? [undefined, { debugName: "container" }] : /* istanbul ignore next */ []));
15
16
  this._computedContainer = linkedSignal(this.container, ...(ngDevMode ? [{ debugName: "_computedContainer" }] : /* istanbul ignore next */ []));
16
- this.computedContainer = this._computedContainer;
17
+ this.computedContainer = this._computedContainer.asReadonly();
17
18
  this.elementContainer = computed(() => {
18
- const provided = this.computedContainer()?.nativeElement ?? null;
19
+ const provided = this.resolveContainer(this.computedContainer());
19
20
  const body = this.document?.body ?? null;
20
21
  return provided ?? body;
21
22
  }, ...(ngDevMode ? [{ debugName: "elementContainer" }] : /* istanbul ignore next */ []));
@@ -23,23 +24,46 @@ class RdxPortal {
23
24
  if (!isBrowser || !this.document) {
24
25
  return;
25
26
  }
26
- const node = this.document.createComment('rdx-portal');
27
- this.elementRef.nativeElement.parentNode?.insertBefore(node, this.elementRef.nativeElement);
28
- this.elementContainer()?.appendChild(this.elementRef.nativeElement);
27
+ const element = this.elementRef.nativeElement;
28
+ // Anchor the original DOM position with a comment node, so the element can be restored
29
+ // exactly where it was when the directive is destroyed.
30
+ const anchor = this.document.createComment('rdx-portal');
31
+ element.parentNode?.insertBefore(anchor, element);
32
+ // Move reactively: the effect runs after inputs are bound (so `container` is respected on
33
+ // first render) and re-runs whenever the target container changes. `appendChild` relocates
34
+ // the element, it does not clone it.
35
+ effect(() => {
36
+ this.elementContainer()?.appendChild(element);
37
+ });
29
38
  this.destroyRef.onDestroy(() => {
30
- node.parentNode?.replaceChild(this.elementRef.nativeElement, node);
39
+ anchor.parentNode?.replaceChild(element, anchor);
31
40
  });
32
41
  }
33
42
  setContainer(container) {
34
43
  this._computedContainer.set(container);
35
44
  }
45
+ resolveContainer(container) {
46
+ if (!container) {
47
+ return null;
48
+ }
49
+ if (typeof container === 'string') {
50
+ return this.document?.querySelector(container) ?? null;
51
+ }
52
+ if (container instanceof ElementRef) {
53
+ return container.nativeElement ?? null;
54
+ }
55
+ // Anything that isn't a real element (e.g. a TemplateRef passed by mistake) falls back to
56
+ // the default container so the element still leaves the flow instead of staying in place.
57
+ return container instanceof HTMLElement ? container : null;
58
+ }
36
59
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
37
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxPortal, isStandalone: true, selector: "[rdxPortal]", inputs: { container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
60
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxPortal, isStandalone: true, selector: "[rdxPortal]", inputs: { container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["rdxPortal"], ngImport: i0 }); }
38
61
  }
39
62
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPortal, decorators: [{
40
63
  type: Directive,
41
64
  args: [{
42
- selector: '[rdxPortal]'
65
+ selector: '[rdxPortal]',
66
+ exportAs: 'rdxPortal'
43
67
  }]
44
68
  }], ctorParameters: () => [], propDecorators: { container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }] } });
45
69
 
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-portal.mjs","sources":["../../../packages/primitives/portal/src/portal.ts","../../../packages/primitives/portal/radix-ng-primitives-portal.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { computed, DestroyRef, Directive, ElementRef, inject, input, linkedSignal, PLATFORM_ID } from '@angular/core';\n\n@Directive({\n selector: '[rdxPortal]'\n})\nexport class RdxPortal {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly document = inject(DOCUMENT, { optional: true }) as Document | null;\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Specify a container element to portal the content into.\n */\n readonly container = input<ElementRef<HTMLElement>>();\n\n private _computedContainer = linkedSignal(this.container);\n readonly computedContainer = this._computedContainer;\n\n private readonly elementContainer = computed<HTMLElement | null>(() => {\n const provided = this.computedContainer()?.nativeElement ?? null;\n const body = this.document?.body ?? null;\n return provided ?? body;\n });\n\n constructor() {\n const isBrowser = isPlatformBrowser(this.platformId);\n if (!isBrowser || !this.document) {\n return;\n }\n\n const node = this.document.createComment('rdx-portal');\n\n this.elementRef.nativeElement.parentNode?.insertBefore(node, this.elementRef.nativeElement);\n this.elementContainer()?.appendChild(this.elementRef.nativeElement);\n\n this.destroyRef.onDestroy(() => {\n node.parentNode?.replaceChild(this.elementRef.nativeElement, node);\n });\n }\n\n setContainer(container: ElementRef<HTMLElement>) {\n this._computedContainer.set(container);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,SAAS,CAAA;AAoBlB,IAAA,WAAA,GAAA;AAnBiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAChC,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAoB;AAClE,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD;;AAEG;QACM,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;AAE7C,QAAA,IAAA,CAAA,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,yFAAC;AAChD,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC,kBAAkB;AAEnC,QAAA,IAAA,CAAA,gBAAgB,GAAG,QAAQ,CAAqB,MAAK;YAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,aAAa,IAAI,IAAI;YAChE,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,IAAI;YACxC,OAAO,QAAQ,IAAI,IAAI;AAC3B,QAAA,CAAC,uFAAC;QAGE,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC;QACpD,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC9B;QACJ;QAEA,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC;AAEtD,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;AAC3F,QAAA,IAAI,CAAC,gBAAgB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;AAEnE,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;AAC3B,YAAA,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC;AACtE,QAAA,CAAC,CAAC;IACN;AAEA,IAAA,YAAY,CAAC,SAAkC,EAAA;AAC3C,QAAA,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC;IAC1C;8GAtCS,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAHrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE;AACb,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-portal.mjs","sources":["../../../packages/primitives/portal/src/portal.ts","../../../packages/primitives/portal/radix-ng-primitives-portal.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n PLATFORM_ID\n} from '@angular/core';\n\n/**\n * A target container for the portal. Accepts an `ElementRef`, a native element, or a CSS selector\n * resolved against the document.\n */\nexport type RdxPortalContainer = ElementRef<HTMLElement> | HTMLElement | string;\n\n@Directive({\n selector: '[rdxPortal]',\n exportAs: 'rdxPortal'\n})\nexport class RdxPortal {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly document = inject(DOCUMENT, { optional: true }) as Document | null;\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Specify a container to portal the content into. Can be an `ElementRef`, a native element, or a\n * CSS selector. Defaults to `document.body` when not set (or when a selector matches nothing).\n */\n readonly container = input<RdxPortalContainer>();\n\n private readonly _computedContainer = linkedSignal(this.container);\n readonly computedContainer = this._computedContainer.asReadonly();\n\n private readonly elementContainer = computed<HTMLElement | null>(() => {\n const provided = this.resolveContainer(this.computedContainer());\n const body = this.document?.body ?? null;\n return provided ?? body;\n });\n\n constructor() {\n const isBrowser = isPlatformBrowser(this.platformId);\n if (!isBrowser || !this.document) {\n return;\n }\n\n const element = this.elementRef.nativeElement;\n // Anchor the original DOM position with a comment node, so the element can be restored\n // exactly where it was when the directive is destroyed.\n const anchor = this.document.createComment('rdx-portal');\n element.parentNode?.insertBefore(anchor, element);\n\n // Move reactively: the effect runs after inputs are bound (so `container` is respected on\n // first render) and re-runs whenever the target container changes. `appendChild` relocates\n // the element, it does not clone it.\n effect(() => {\n this.elementContainer()?.appendChild(element);\n });\n\n this.destroyRef.onDestroy(() => {\n anchor.parentNode?.replaceChild(element, anchor);\n });\n }\n\n setContainer(container: RdxPortalContainer) {\n this._computedContainer.set(container);\n }\n\n private resolveContainer(container: RdxPortalContainer | undefined): HTMLElement | null {\n if (!container) {\n return null;\n }\n if (typeof container === 'string') {\n return this.document?.querySelector<HTMLElement>(container) ?? null;\n }\n if (container instanceof ElementRef) {\n return container.nativeElement ?? null;\n }\n // Anything that isn't a real element (e.g. a TemplateRef passed by mistake) falls back to\n // the default container so the element still leaves the flow instead of staying in place.\n return container instanceof HTMLElement ? container : null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAuBa,SAAS,CAAA;AAqBlB,IAAA,WAAA,GAAA;AApBiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAChC,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAoB;AAClE,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD;;;AAGG;QACM,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAsB;AAE/B,QAAA,IAAA,CAAA,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,yFAAC;AACzD,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE;AAEhD,QAAA,IAAA,CAAA,gBAAgB,GAAG,QAAQ,CAAqB,MAAK;YAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAChE,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,IAAI;YACxC,OAAO,QAAQ,IAAI,IAAI;AAC3B,QAAA,CAAC,uFAAC;QAGE,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC;QACpD,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC9B;QACJ;AAEA,QAAA,MAAM,OAAO,GAAG,IAAI,CA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