ng-primitives 0.47.0 → 0.49.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 (121) hide show
  1. package/a11y/active-descendant/active-descendant.d.ts +5 -1
  2. package/a11y/visually-hidden/visually-hidden-state.d.ts +1 -36
  3. package/accordion/accordion/accordion-state.d.ts +1 -12
  4. package/accordion/accordion-content/accordion-content.d.ts +1 -12
  5. package/accordion/accordion-item/accordion-item-state.d.ts +1 -12
  6. package/avatar/avatar/avatar-state.d.ts +1 -5
  7. package/avatar/avatar-image/avatar-image.d.ts +1 -36
  8. package/button/button/button-state.d.ts +1 -6
  9. package/checkbox/checkbox/checkbox-state.d.ts +1 -12
  10. package/combobox/combobox/combobox-state.d.ts +1 -44
  11. package/combobox/combobox/combobox.d.ts +1 -1
  12. package/combobox/combobox-button/combobox-button.d.ts +2 -45
  13. package/combobox/combobox-dropdown/combobox-dropdown.d.ts +1 -44
  14. package/combobox/combobox-input/combobox-input.d.ts +2 -50
  15. package/combobox/combobox-option/combobox-option.d.ts +1 -44
  16. package/dialog/dialog/dialog-state.d.ts +1 -17
  17. package/fesm2022/ng-primitives-a11y.mjs +32 -10
  18. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  23. package/fesm2022/ng-primitives-combobox.mjs +23 -18
  24. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  25. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  27. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  29. package/fesm2022/ng-primitives-form-field.mjs +2 -2
  30. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  31. package/fesm2022/ng-primitives-input.mjs +11 -2
  32. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  33. package/fesm2022/ng-primitives-internal.mjs +9 -1
  34. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  35. package/fesm2022/ng-primitives-listbox.mjs +3 -1
  36. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  37. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  39. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-portal.mjs +128 -2
  41. package/fesm2022/ng-primitives-portal.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  43. package/fesm2022/ng-primitives-radio.mjs +8 -2
  44. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  45. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  47. package/fesm2022/ng-primitives-select.mjs +8 -2
  48. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  49. package/fesm2022/ng-primitives-slider.mjs +8 -2
  50. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  51. package/fesm2022/ng-primitives-switch.mjs +9 -4
  52. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  53. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  54. package/fesm2022/ng-primitives-textarea.mjs +11 -2
  55. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  56. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  57. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  58. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  59. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  60. package/file-upload/file-dropzone/file-dropzone-state.d.ts +1 -16
  61. package/file-upload/file-upload/file-upload-state.d.ts +1 -21
  62. package/focus-trap/focus-trap/focus-trap-state.d.ts +1 -28
  63. package/form-field/description/description.d.ts +1 -25
  64. package/form-field/error/error.d.ts +1 -25
  65. package/form-field/form-control/form-control-state.d.ts +1 -5
  66. package/form-field/form-control/form-control.d.ts +2 -2
  67. package/form-field/form-field/form-field-state.d.ts +1 -25
  68. package/form-field/label/label.d.ts +1 -25
  69. package/input/input/input-state.d.ts +1 -14
  70. package/input/input/input.d.ts +5 -1
  71. package/internal/style-injector/style-injector.d.ts +4 -0
  72. package/listbox/listbox/listbox-state.d.ts +1 -25
  73. package/menu/menu-trigger/menu-trigger-state.d.ts +1 -22
  74. package/menu/submenu-trigger/submenu-trigger-state.d.ts +1 -20
  75. package/meter/meter/meter-state.d.ts +1 -9
  76. package/meter/meter-indicator/meter-indicator.d.ts +1 -9
  77. package/meter/meter-label/meter-label.d.ts +1 -9
  78. package/package.json +5 -5
  79. package/pagination/pagination/pagination-state.d.ts +1 -10
  80. package/pagination/pagination-button/pagination-button.d.ts +1 -10
  81. package/pagination/pagination-first/pagination-first.d.ts +1 -10
  82. package/pagination/pagination-next/pagination-next.d.ts +1 -10
  83. package/pagination/pagination-previous/pagination-previous.d.ts +1 -10
  84. package/portal/index.d.ts +1 -0
  85. package/portal/scroll-strategy.d.ts +23 -0
  86. package/progress/progress/progress-state.d.ts +1 -12
  87. package/progress/progress-indicator/progress-indicator.d.ts +1 -12
  88. package/progress/progress-label/progress-label.d.ts +1 -12
  89. package/progress/progress-track/progress-track.d.ts +1 -12
  90. package/progress/progress-value/progress-value.d.ts +1 -12
  91. package/radio/radio-group/radio-group.d.ts +5 -1
  92. package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +1 -19
  93. package/schematics/ng-generate/schema.d.ts +1 -0
  94. package/schematics/ng-generate/schema.json +1 -0
  95. package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +11 -16
  96. package/schematics/ng-generate/templates/menu/menu-item.__fileSuffix@dasherize__.ts.template +40 -0
  97. package/schematics/ng-generate/templates/menu/menu.__fileSuffix@dasherize__.ts.template +53 -0
  98. package/schematics/ng-generate/templates/switch/switch.__fileSuffix@dasherize__.ts.template +3 -3
  99. package/search/search/search-state.d.ts +1 -9
  100. package/search/search-clear/search-clear.d.ts +1 -9
  101. package/select/select/select-state.d.ts +1 -4
  102. package/select/select/select.d.ts +5 -1
  103. package/slider/slider/slider-state.d.ts +1 -12
  104. package/slider/slider/slider.d.ts +5 -1
  105. package/slider/slider-range/slider-range.d.ts +1 -12
  106. package/slider/slider-thumb/slider-thumb.d.ts +1 -12
  107. package/slider/slider-track/slider-track.d.ts +1 -12
  108. package/switch/switch/switch-state.d.ts +1 -10
  109. package/switch/switch/switch.d.ts +5 -2
  110. package/switch/switch-thumb/switch-thumb.d.ts +1 -10
  111. package/tabs/tab-button/tab-button.d.ts +1 -36
  112. package/tabs/tab-list/tab-list.d.ts +1 -33
  113. package/tabs/tab-panel/tab-panel.d.ts +1 -33
  114. package/tabs/tabset/tabset-state.d.ts +1 -33
  115. package/textarea/textarea/textarea-state.d.ts +1 -4
  116. package/textarea/textarea/textarea.d.ts +5 -1
  117. package/toggle/toggle/toggle-state.d.ts +1 -10
  118. package/toggle-group/toggle-group/toggle-group-state.d.ts +1 -32
  119. package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +1 -22
  120. package/toolbar/toolbar/toolbar-state.d.ts +1 -23
  121. package/tooltip/tooltip-trigger/tooltip-trigger-state.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import { FocusMonitor } from '@angular/cdk/a11y';
2
- import { ViewportRuler, NoopScrollStrategy, BlockScrollStrategy } from '@angular/cdk/overlay';
2
+ import { ViewportRuler } from '@angular/cdk/overlay';
3
3
  import { DOCUMENT } from '@angular/common';
4
4
  import { InjectionToken, inject, TemplateRef, DestroyRef, signal, Injector, runInInjectionContext } from '@angular/core';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -9,6 +9,7 @@ import { injectDisposables } from 'ng-primitives/utils';
9
9
  import { Subject, fromEvent } from 'rxjs';
10
10
  import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';
11
11
  import { setupExitAnimation } from 'ng-primitives/internal';
12
+ import { coerceCssPixelValue } from '@angular/cdk/coercion';
12
13
 
13
14
  const NgpOverlayContextToken = new InjectionToken('NgpOverlayContextToken');
14
15
  /**
@@ -153,6 +154,131 @@ function createPortal(componentOrTemplate, viewContainerRef, injector, context)
153
154
  }
154
155
  }
155
156
 
157
+ /**
158
+ * This code is largely based on the CDK Overlay's scroll strategy implementation, however it
159
+ * has been modified so that it does not rely on the CDK's global overlay styles.
160
+ */
161
+ /** Cached result of the check that indicates whether the browser supports scroll behaviors. */
162
+ let scrollBehaviorSupported;
163
+ function supportsScrollBehavior() {
164
+ if (scrollBehaviorSupported != null) {
165
+ return scrollBehaviorSupported;
166
+ }
167
+ // If we're not in the browser, it can't be supported. Also check for `Element`, because
168
+ // some projects stub out the global `document` during SSR which can throw us off.
169
+ if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {
170
+ return (scrollBehaviorSupported = false);
171
+ }
172
+ // If the element can have a `scrollBehavior` style, we can be sure that it's supported.
173
+ if ('scrollBehavior' in document.documentElement.style) {
174
+ return (scrollBehaviorSupported = true);
175
+ }
176
+ // Check if scrollTo is supported and if it's been polyfilled
177
+ const scrollToFunction = Element.prototype.scrollTo;
178
+ if (!scrollToFunction) {
179
+ return (scrollBehaviorSupported = false);
180
+ }
181
+ // We can detect if the function has been polyfilled by calling `toString` on it. Native
182
+ // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get
183
+ // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider
184
+ // polyfilled functions as supporting scroll behavior.
185
+ return (scrollBehaviorSupported = !/\{\s*\[native code\]\s*\}/.test(scrollToFunction.toString()));
186
+ }
187
+ class BlockScrollStrategy {
188
+ constructor(viewportRuler, document) {
189
+ this.viewportRuler = viewportRuler;
190
+ this.document = document;
191
+ this.previousHTMLStyles = {
192
+ top: '',
193
+ left: '',
194
+ position: '',
195
+ overflowY: '',
196
+ width: '',
197
+ };
198
+ this.previousScrollPosition = { top: 0, left: 0 };
199
+ this.isEnabled = false;
200
+ }
201
+ /** Blocks page-level scroll while the attached overlay is open. */
202
+ enable() {
203
+ if (this.canBeEnabled()) {
204
+ const root = this.document.documentElement;
205
+ this.previousScrollPosition = this.viewportRuler.getViewportScrollPosition();
206
+ // Cache the previous inline styles in case the user had set them.
207
+ this.previousHTMLStyles.left = root.style.left || '';
208
+ this.previousHTMLStyles.top = root.style.top || '';
209
+ this.previousHTMLStyles.position = root.style.position || '';
210
+ this.previousHTMLStyles.overflowY = root.style.overflowY || '';
211
+ this.previousHTMLStyles.width = root.style.width || '';
212
+ // Set the styles to block scrolling.
213
+ root.style.position = 'fixed';
214
+ // Necessary for the content not to lose its width. Note that we're using 100%, instead of
215
+ // 100vw, because 100vw includes the width plus the scrollbar, whereas 100% is the width
216
+ // that the element had before we made it `fixed`.
217
+ root.style.width = '100%';
218
+ // Note: this will always add a scrollbar to whatever element it is on, which can
219
+ // potentially result in double scrollbars. It shouldn't be an issue, because we won't
220
+ // block scrolling on a page that doesn't have a scrollbar in the first place.
221
+ root.style.overflowY = 'scroll';
222
+ // Note: we're using the `html` node, instead of the `body`, because the `body` may
223
+ // have the user agent margin, whereas the `html` is guaranteed not to have one.
224
+ root.style.left = coerceCssPixelValue(-this.previousScrollPosition.left);
225
+ root.style.top = coerceCssPixelValue(-this.previousScrollPosition.top);
226
+ root.setAttribute('data-scrollblock', '');
227
+ this.isEnabled = true;
228
+ }
229
+ }
230
+ /** Unblocks page-level scroll while the attached overlay is open. */
231
+ disable() {
232
+ if (this.isEnabled) {
233
+ const html = this.document.documentElement;
234
+ const body = this.document.body;
235
+ const htmlStyle = html.style;
236
+ const bodyStyle = body.style;
237
+ const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';
238
+ const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';
239
+ this.isEnabled = false;
240
+ htmlStyle.left = this.previousHTMLStyles.left;
241
+ htmlStyle.top = this.previousHTMLStyles.top;
242
+ htmlStyle.position = this.previousHTMLStyles.position;
243
+ htmlStyle.overflowY = this.previousHTMLStyles.overflowY;
244
+ htmlStyle.width = this.previousHTMLStyles.width;
245
+ html.removeAttribute('data-scrollblock');
246
+ // Disable user-defined smooth scrolling temporarily while we restore the scroll position.
247
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior
248
+ // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,
249
+ // because it can throw off feature detections in `supportsScrollBehavior` which
250
+ // checks for `'scrollBehavior' in documentElement.style`.
251
+ if (scrollBehaviorSupported) {
252
+ htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';
253
+ }
254
+ window.scroll(this.previousScrollPosition.left, this.previousScrollPosition.top);
255
+ if (scrollBehaviorSupported) {
256
+ htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
257
+ bodyStyle.scrollBehavior = previousBodyScrollBehavior;
258
+ }
259
+ }
260
+ }
261
+ canBeEnabled() {
262
+ // Since the scroll strategies can't be singletons, we have to use a global CSS class
263
+ // (`cdk-global-scrollblock`) to make sure that we don't try to disable global
264
+ // scrolling multiple times.
265
+ const html = this.document.documentElement;
266
+ if (html.classList.contains('cdk-global-scrollblock') || this.isEnabled) {
267
+ return false;
268
+ }
269
+ const viewport = this.viewportRuler.getViewportSize();
270
+ return html.scrollHeight > viewport.height || html.scrollWidth > viewport.width;
271
+ }
272
+ }
273
+ class NoopScrollStrategy {
274
+ enable() {
275
+ // No operation for enabling
276
+ }
277
+ disable() {
278
+ // No operation for disabling
279
+ }
280
+ }
281
+
156
282
  /**
157
283
  * NgpOverlay manages the lifecycle and positioning of overlay UI elements.
158
284
  * It abstracts the common behavior shared by tooltips, popovers, menus, etc.
@@ -492,5 +618,5 @@ function injectOverlay() {
492
618
  * Generated bundle index. Do not edit.
493
619
  */
494
620
 
495
- export { NgpComponentPortal, NgpOverlay, NgpPortal, NgpTemplatePortal, createOverlay, createPortal, injectOverlay, injectOverlayContext, provideOverlayContext };
621
+ export { BlockScrollStrategy, NgpComponentPortal, NgpOverlay, NgpPortal, NgpTemplatePortal, NoopScrollStrategy, createOverlay, createPortal, injectOverlay, injectOverlayContext, provideOverlayContext };
496
622
  //# sourceMappingURL=ng-primitives-portal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-portal.mjs","sources":["../../../../packages/ng-primitives/portal/src/overlay-token.ts","../../../../packages/ng-primitives/portal/src/portal.ts","../../../../packages/ng-primitives/portal/src/overlay.ts","../../../../packages/ng-primitives/portal/src/ng-primitives-portal.ts"],"sourcesContent":["import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nconst NgpOverlayContextToken = new InjectionToken<unknown>('NgpOverlayContextToken');\n\n/**\n * Injects the context for the overlay.\n * @internal\n */\nexport function injectOverlayContext<T>(): T {\n return inject(NgpOverlayContextToken) as T;\n}\n\n/**\n * Provides the context for the overlay.\n * @param value The value to provide as the context.\n * @internal\n */\nexport function provideOverlayContext<T>(value: T): ValueProvider {\n return { provide: NgpOverlayContextToken, useValue: value };\n}\n","import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n EmbeddedViewRef,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgpExitAnimationRef, setupExitAnimation } from 'ng-primitives/internal';\n\nexport abstract class NgpPortal {\n constructor(\n protected readonly viewContainerRef: ViewContainerRef,\n protected readonly injector: Injector,\n ) {}\n\n /**\n * Get the elements of the portal.\n */\n abstract getElements(): HTMLElement[];\n\n /**\n * Detect changes in the portal.\n */\n abstract detectChanges(): void;\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n abstract getAttached(): boolean;\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n abstract attach(container: HTMLElement): this;\n\n /**\n * Detach the portal from the DOM.\n */\n abstract detach(): Promise<void>;\n}\n\nexport class NgpComponentPortal<T> extends NgpPortal {\n private readonly componentPortal: ComponentPortal<T>;\n private viewRef: ComponentRef<T> | null = null;\n private isDestroying = false;\n private exitAnimationRef: NgpExitAnimationRef | null = null;\n\n constructor(component: Type<T>, viewContainerRef: ViewContainerRef, injector: Injector) {\n super(viewContainerRef, injector);\n this.componentPortal = new ComponentPortal(component, viewContainerRef, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.componentPortal);\n\n const element = this.viewRef.location.nativeElement as HTMLElement;\n\n this.exitAnimationRef = setupExitAnimation({ element });\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? [this.viewRef.location.nativeElement] : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.changeDetectorRef.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && (this.viewRef.location.nativeElement as HTMLElement).isConnected;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await this.exitAnimationRef?.exit();\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport class NgpTemplatePortal<T> extends NgpPortal {\n private readonly templatePortal: TemplatePortal<T>;\n private viewRef: EmbeddedViewRef<T> | null = null;\n private exitAnimationRefs: NgpExitAnimationRef[] = [];\n private isDestroying = false;\n\n constructor(\n template: TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n ) {\n super(viewContainerRef, injector);\n this.templatePortal = new TemplatePortal(template, viewContainerRef, context, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.templatePortal);\n\n for (const rootNode of this.viewRef.rootNodes) {\n if (rootNode instanceof HTMLElement) {\n // Setup exit animation for each root node\n const exitAnimationRef = setupExitAnimation({ element: rootNode });\n this.exitAnimationRefs.push(exitAnimationRef);\n }\n }\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? this.viewRef.rootNodes : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && this.viewRef.rootNodes.length > 0;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await Promise.all(this.exitAnimationRefs.map(ref => ref.exit()));\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport function createPortal<T>(\n componentOrTemplate: Type<T> | TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n): NgpPortal {\n if (componentOrTemplate instanceof TemplateRef) {\n return new NgpTemplatePortal(componentOrTemplate, viewContainerRef, injector, context);\n } else {\n return new NgpComponentPortal(componentOrTemplate, viewContainerRef, injector);\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { BlockScrollStrategy, NoopScrollStrategy, ViewportRuler } from '@angular/cdk/overlay';\nimport { DOCUMENT } from '@angular/common';\nimport {\n DestroyRef,\n Injector,\n Provider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n Middleware,\n Placement,\n Strategy,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { fromResizeEvent } from 'ng-primitives/resize';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { Subject, fromEvent } from 'rxjs';\nimport { provideOverlayContext } from './overlay-token';\nimport { NgpPortal, createPortal } from './portal';\n\n/**\n * Configuration options for creating an overlay\n * @internal\n */\nexport interface NgpOverlayConfig<T = unknown> {\n /** Content to display in the overlay (component or template) */\n content: NgpOverlayContent<T>;\n\n /** The element that triggers the overlay */\n triggerElement: HTMLElement;\n\n /** The injector to use for creating the portal */\n injector: Injector;\n /** ViewContainerRef to use for creating the portal */\n viewContainerRef: ViewContainerRef;\n\n /** Context data to pass to the overlay content */\n context?: T | null;\n\n /** Container element to attach the overlay to (defaults to document.body) */\n container?: HTMLElement | null;\n\n /** Preferred placement of the overlay relative to the trigger */\n placement?: Placement;\n\n /** Offset distance between the overlay and trigger in pixels */\n offset?: number;\n\n /** Whether to enable flip behavior when space is limited */\n flip?: boolean;\n\n /** Delay before showing the overlay in milliseconds */\n showDelay?: number;\n\n /** Delay before hiding the overlay in milliseconds */\n hideDelay?: number;\n\n /** Whether the overlay should be positioned with fixed or absolute strategy */\n strategy?: Strategy;\n\n /** The scroll strategy to use for the overlay */\n scrollBehaviour?: 'reposition' | 'block';\n /** Whether to close the overlay when clicking outside */\n closeOnOutsideClick?: boolean;\n /** Whether to close the overlay when pressing escape */\n closeOnEscape?: boolean;\n /** Whether to restore focus to the trigger element when hiding the overlay */\n restoreFocus?: boolean;\n /** Additional middleware for floating UI positioning */\n additionalMiddleware?: Middleware[];\n\n /** Additional providers */\n providers?: Provider[];\n}\n\n/** Type for overlay content which can be either a template or component */\nexport type NgpOverlayContent<T> = TemplateRef<NgpOverlayTemplateContext<T>> | Type<unknown>;\n\n/** Context for template-based overlays */\nexport type NgpOverlayTemplateContext<T> = {\n $implicit: T;\n};\n\n/**\n * NgpOverlay manages the lifecycle and positioning of overlay UI elements.\n * It abstracts the common behavior shared by tooltips, popovers, menus, etc.\n * @internal\n */\nexport class NgpOverlay<T = unknown> {\n private readonly disposables = injectDisposables();\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewContainerRef: ViewContainerRef;\n private readonly viewportRuler = inject(ViewportRuler);\n private readonly focusMonitor = inject(FocusMonitor);\n /** Access any parent overlays */\n private readonly parentOverlay = inject(NgpOverlay, { optional: true });\n /** Signal tracking the portal instance */\n private readonly portal = signal<NgpPortal | null>(null);\n\n /** Signal tracking the overlay position */\n readonly position = signal<{ x: number; y: number }>({ x: 0, y: 0 });\n\n /** Signal tracking the trigger element width */\n readonly triggerWidth = signal<number | null>(null);\n\n /** The transform origin for the overlay */\n readonly transformOrigin = signal<string>('center center');\n\n /** Function to dispose the positioning auto-update */\n private disposePositioning?: () => void;\n\n /** Timeout handle for showing the overlay */\n private openTimeout?: () => void;\n\n /** Timeout handle for hiding the overlay */\n private closeTimeout?: () => void;\n\n /** Signal tracking whether the overlay is open */\n readonly isOpen = signal(false);\n\n /** The scroll strategy */\n private scrollStrategy = new NoopScrollStrategy();\n\n /** An observable that emits when the overlay is closing */\n readonly closing = new Subject<void>();\n\n /**\n * Creates a new overlay instance\n * @param config Initial configuration for the overlay\n * @param destroyRef Reference for automatic cleanup\n */\n constructor(private config: NgpOverlayConfig<T>) {\n // we cannot inject the viewContainerRef as this can throw an error during hydration in SSR\n this.viewContainerRef = config.viewContainerRef;\n\n // this must be done after the config is set\n this.transformOrigin.set(this.getTransformOrigin());\n\n // Monitor trigger element resize\n fromResizeEvent(this.config.triggerElement)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.triggerWidth.set(this.config.triggerElement.offsetWidth);\n });\n\n // if there is a parent overlay and it is closed, close this overlay\n this.parentOverlay?.closing.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.isOpen()) {\n this.hideImmediate();\n }\n });\n\n // If closeOnOutsideClick is enabled, set up a click listener\n fromEvent<MouseEvent>(this.document, 'mouseup', { capture: true })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnOutsideClick) {\n return;\n }\n\n const overlay = this.portal();\n\n if (!overlay || !this.isOpen()) {\n return;\n }\n\n const path = event.composedPath();\n const isInsideOverlay = overlay.getElements().some(el => path.includes(el));\n const isInsideTrigger = path.includes(this.config.triggerElement);\n\n if (!isInsideOverlay && !isInsideTrigger) {\n this.hide();\n }\n });\n\n // If closeOnEscape is enabled, set up a keydown listener\n fromEvent<KeyboardEvent>(this.document, 'keydown', { capture: true })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnEscape) return;\n if (event.key === 'Escape' && this.isOpen()) {\n this.hide({ origin: 'keyboard', immediate: true });\n }\n });\n\n // Ensure cleanup on destroy\n this.destroyRef.onDestroy(() => this.destroy());\n }\n\n /**\n * Show the overlay with the specified delay\n * @param showDelay Optional delay to override the configured showDelay\n */\n show(): Promise<void> {\n return new Promise<void>(resolve => {\n // If closing is in progress, cancel it\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n\n // Don't proceed if already opening or open\n if (this.openTimeout || this.isOpen()) {\n return;\n }\n\n // Use the provided delay or fall back to config\n const delay = this.config.showDelay ?? 0;\n\n this.openTimeout = this.disposables.setTimeout(() => {\n this.openTimeout = undefined;\n this.createOverlay();\n resolve();\n }, delay);\n });\n }\n\n /**\n * Hide the overlay with the specified delay\n * @param options Optional options for hiding the overlay\n */\n hide(options?: OverlayTriggerOptions): void {\n // If opening is in progress, cancel it\n if (this.openTimeout) {\n this.openTimeout();\n this.openTimeout = undefined;\n }\n\n // Don't proceed if already closing or closed\n if (this.closeTimeout || !this.isOpen()) {\n return;\n }\n\n this.closing.next();\n\n // Use the provided delay or fall back to config\n const delay = options?.immediate ? 0 : (this.config.hideDelay ?? 0);\n\n this.closeTimeout = this.disposables.setTimeout(async () => {\n this.closeTimeout = undefined;\n\n if (this.config.restoreFocus) {\n this.focusMonitor.focusVia(this.config.triggerElement, options?.origin ?? 'program', {\n preventScroll: true,\n });\n }\n\n await this.destroyOverlay();\n }, delay);\n }\n\n /**\n * Update the configuration of this overlay\n * @param config New configuration (partial)\n */\n updateConfig(config: Partial<NgpOverlayConfig<T>>): void {\n this.config = { ...this.config, ...config };\n\n // If the overlay is already open, update its position\n if (this.isOpen()) {\n this.updatePosition();\n }\n }\n\n /**\n * Immediately hide the overlay without any delay\n */\n hideImmediate(): void {\n this.hide({ immediate: true });\n }\n\n /**\n * Toggle the overlay open/closed state\n */\n toggle(): void {\n if (this.isOpen()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Force update the position of the overlay\n */\n updatePosition(): void {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n const elements = portal.getElements();\n\n if (elements.length === 0) {\n return;\n }\n\n const overlayElement = elements[0] as HTMLElement;\n\n // Compute new position\n this.computePosition(overlayElement);\n }\n\n /**\n * Completely destroy this overlay instance\n */\n destroy(): void {\n this.hideImmediate();\n this.disposePositioning?.();\n this.scrollStrategy.disable();\n }\n\n /**\n * Get the elements of the overlay\n */\n getElements(): HTMLElement[] {\n return this.portal()?.getElements() ?? [];\n }\n\n /**\n * Internal method to create the overlay\n */\n private createOverlay(): void {\n if (!this.config.content) {\n throw new Error('Overlay content must be provided');\n }\n\n // Create a new portal with context\n const portal = createPortal(\n this.config.content,\n this.viewContainerRef,\n Injector.create({\n parent: this.config.injector,\n providers: [\n ...(this.config.providers || []),\n { provide: NgpOverlay, useValue: this },\n provideOverlayContext<T>(this.config.context as T),\n ],\n }),\n { $implicit: this.config.context } as NgpOverlayTemplateContext<T>,\n );\n\n // Attach portal to container\n const container = this.config.container || this.document.body;\n portal.attach(container);\n\n // Update portal signal\n this.portal.set(portal);\n\n // Ensure view is up to date\n portal.detectChanges();\n\n const outletElement = portal.getElements()[0] as HTMLElement | null;\n\n if (!outletElement) {\n throw new Error('Overlay element is not available.');\n }\n\n if (portal.getElements().length > 1) {\n throw new Error('Overlay must have only one root element.');\n }\n\n // Set up positioning\n this.setupPositioning(outletElement);\n\n // Mark as open\n this.isOpen.set(true);\n\n this.scrollStrategy =\n this.config.scrollBehaviour === 'block'\n ? new BlockScrollStrategy(this.viewportRuler, this.document)\n : new NoopScrollStrategy();\n\n this.scrollStrategy.enable();\n }\n\n /**\n * Internal method to setup positioning of the overlay\n */\n private setupPositioning(overlayElement: HTMLElement): void {\n // Determine positioning strategy based on overlay element's CSS\n const strategy =\n getComputedStyle(overlayElement).position === 'fixed'\n ? 'fixed'\n : this.config.strategy || 'absolute';\n\n // Setup auto-update for positioning\n this.disposePositioning = autoUpdate(this.config.triggerElement, overlayElement, () =>\n this.computePosition(overlayElement, strategy),\n );\n }\n\n /**\n * Compute the overlay position using floating-ui\n */\n private async computePosition(\n overlayElement: HTMLElement,\n strategy: Strategy = 'absolute',\n ): Promise<void> {\n // Create middleware array\n const middleware: Middleware[] = [offset(this.config.offset || 0), shift()];\n\n // Add flip middleware if requested\n if (this.config.flip !== false) {\n middleware.push(flip());\n }\n\n // Add any additional middleware\n if (this.config.additionalMiddleware) {\n middleware.push(...this.config.additionalMiddleware);\n }\n\n // Compute the position\n const position = await computePosition(this.config.triggerElement, overlayElement, {\n placement: this.config.placement || 'top',\n middleware,\n strategy,\n });\n\n // Update position signal\n this.position.set({ x: position.x, y: position.y });\n\n // Ensure view is updated\n this.portal()?.detectChanges();\n }\n\n /**\n * Internal method to destroy the overlay portal\n */\n private async destroyOverlay(): Promise<void> {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n // Clear portal reference to prevent double destruction\n this.portal.set(null);\n\n // Clean up positioning\n this.disposePositioning?.();\n this.disposePositioning = undefined;\n\n // Detach the portal\n await portal.detach();\n\n // Mark as closed\n this.isOpen.set(false);\n\n // disable scroll strategy\n this.scrollStrategy.disable();\n this.scrollStrategy = new NoopScrollStrategy();\n }\n\n /**\n * Get the transform origin for the overlay\n */\n private getTransformOrigin(): string {\n const placement = this.config.placement ?? 'top';\n\n const basePlacement = placement.split('-')[0]; // Extract \"top\", \"bottom\", etc.\n const alignment = placement.split('-')[1]; // Extract \"start\" or \"end\"\n\n const map: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n };\n\n let x = 'center';\n let y = 'center';\n\n if (basePlacement === 'top' || basePlacement === 'bottom') {\n y = map[basePlacement];\n if (alignment === 'start') x = 'left';\n else if (alignment === 'end') x = 'right';\n } else {\n x = map[basePlacement];\n if (alignment === 'start') y = 'top';\n else if (alignment === 'end') y = 'bottom';\n }\n\n return `${y} ${x}`;\n }\n}\n\n/**\n * Helper function to create an overlay in a single call\n * @internal\n */\nexport function createOverlay<T>(config: NgpOverlayConfig<T>): NgpOverlay<T> {\n // we run the overlay creation in the injector context to ensure that it can call the inject function\n return runInInjectionContext(config.injector, () => new NgpOverlay<T>(config));\n}\n\n/**\n * Helper function to inject the NgpOverlay instance\n * @internal\n */\nexport function injectOverlay<T>(): NgpOverlay<T> {\n return inject(NgpOverlay);\n}\n\nexport interface OverlayTriggerOptions {\n /**\n * Whether the visibility change should be immediate.\n */\n immediate?: boolean;\n /**\n * The origin of the focus event that triggered the visibility change.\n */\n origin?: FocusOrigin;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAM,sBAAsB,GAAG,IAAI,cAAc,CAAU,wBAAwB,CAAC;AAEpF;;;AAGG;SACa,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,sBAAsB,CAAM;AAC5C;AAEA;;;;AAIG;AACG,SAAU,qBAAqB,CAAI,KAAQ,EAAA;IAC/C,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC7D;;MCRsB,SAAS,CAAA;IAC7B,WACqB,CAAA,gBAAkC,EACl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AAA,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1C,QAAA,MAAM,GAAG,GAA2B;AAClC,YAAA,GAAG,EAAE,QAAQ;AACb,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE,MAAM;SACd;QAED,IAAI,CAAC,GAAG,QAAQ;QAChB,IAAI,CAAC,GAAG,QAAQ;QAEhB,IAAI,aAAa,KAAK,KAAK,IAAI,aAAa,KAAK,QAAQ,EAAE;AACzD,YAAA,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC;YACtB,IAAI,SAAS,KAAK,OAAO;gBAAE,CAAC,GAAG,MAAM;iBAChC,IAAI,SAAS,KAAK,KAAK;gBAAE,CAAC,GAAG,OAAO;;aACpC;AACL,YAAA,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC;YACtB,IAAI,SAAS,KAAK,OAAO;gBAAE,CAAC,GAAG,KAAK;iBAC/B,IAAI,SAAS,KAAK,KAAK;gBAAE,CAAC,GAAG,QAAQ;;AAG5C,QAAA,OAAO,CAAG,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,EAAE;;AAErB;AAED;;;AAGG;AACG,SAAU,aAAa,CAAI,MAA2B,EAAA;;AAE1D,IAAA,OAAO,qBAAqB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,UAAU,CAAI,MAAM,CAAC,CAAC;AAChF;AAEA;;;AAGG;SACa,aAAa,GAAA;AAC3B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;ACngBA;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-portal.mjs","sources":["../../../../packages/ng-primitives/portal/src/overlay-token.ts","../../../../packages/ng-primitives/portal/src/portal.ts","../../../../packages/ng-primitives/portal/src/scroll-strategy.ts","../../../../packages/ng-primitives/portal/src/overlay.ts","../../../../packages/ng-primitives/portal/src/ng-primitives-portal.ts"],"sourcesContent":["import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nconst NgpOverlayContextToken = new InjectionToken<unknown>('NgpOverlayContextToken');\n\n/**\n * Injects the context for the overlay.\n * @internal\n */\nexport function injectOverlayContext<T>(): T {\n return inject(NgpOverlayContextToken) as T;\n}\n\n/**\n * Provides the context for the overlay.\n * @param value The value to provide as the context.\n * @internal\n */\nexport function provideOverlayContext<T>(value: T): ValueProvider {\n return { provide: NgpOverlayContextToken, useValue: value };\n}\n","import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n EmbeddedViewRef,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgpExitAnimationRef, setupExitAnimation } from 'ng-primitives/internal';\n\nexport abstract class NgpPortal {\n constructor(\n protected readonly viewContainerRef: ViewContainerRef,\n protected readonly injector: Injector,\n ) {}\n\n /**\n * Get the elements of the portal.\n */\n abstract getElements(): HTMLElement[];\n\n /**\n * Detect changes in the portal.\n */\n abstract detectChanges(): void;\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n abstract getAttached(): boolean;\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n abstract attach(container: HTMLElement): this;\n\n /**\n * Detach the portal from the DOM.\n */\n abstract detach(): Promise<void>;\n}\n\nexport class NgpComponentPortal<T> extends NgpPortal {\n private readonly componentPortal: ComponentPortal<T>;\n private viewRef: ComponentRef<T> | null = null;\n private isDestroying = false;\n private exitAnimationRef: NgpExitAnimationRef | null = null;\n\n constructor(component: Type<T>, viewContainerRef: ViewContainerRef, injector: Injector) {\n super(viewContainerRef, injector);\n this.componentPortal = new ComponentPortal(component, viewContainerRef, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.componentPortal);\n\n const element = this.viewRef.location.nativeElement as HTMLElement;\n\n this.exitAnimationRef = setupExitAnimation({ element });\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? [this.viewRef.location.nativeElement] : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.changeDetectorRef.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && (this.viewRef.location.nativeElement as HTMLElement).isConnected;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await this.exitAnimationRef?.exit();\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport class NgpTemplatePortal<T> extends NgpPortal {\n private readonly templatePortal: TemplatePortal<T>;\n private viewRef: EmbeddedViewRef<T> | null = null;\n private exitAnimationRefs: NgpExitAnimationRef[] = [];\n private isDestroying = false;\n\n constructor(\n template: TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n ) {\n super(viewContainerRef, injector);\n this.templatePortal = new TemplatePortal(template, viewContainerRef, context, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.templatePortal);\n\n for (const rootNode of this.viewRef.rootNodes) {\n if (rootNode instanceof HTMLElement) {\n // Setup exit animation for each root node\n const exitAnimationRef = setupExitAnimation({ element: rootNode });\n this.exitAnimationRefs.push(exitAnimationRef);\n }\n }\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? this.viewRef.rootNodes : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && this.viewRef.rootNodes.length > 0;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await Promise.all(this.exitAnimationRefs.map(ref => ref.exit()));\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport function createPortal<T>(\n componentOrTemplate: Type<T> | TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n): NgpPortal {\n if (componentOrTemplate instanceof TemplateRef) {\n return new NgpTemplatePortal(componentOrTemplate, viewContainerRef, injector, context);\n } else {\n return new NgpComponentPortal(componentOrTemplate, viewContainerRef, injector);\n }\n}\n","/**\n * This code is largely based on the CDK Overlay's scroll strategy implementation, however it\n * has been modified so that it does not rely on the CDK's global overlay styles.\n */\nimport { coerceCssPixelValue } from '@angular/cdk/coercion';\nimport { ViewportRuler } from '@angular/cdk/overlay';\n\nexport interface ScrollStrategy {\n enable(): void;\n disable(): void;\n}\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean | undefined;\n\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported != null) {\n return scrollBehaviorSupported;\n }\n\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n return (scrollBehaviorSupported = false);\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n return (scrollBehaviorSupported = true);\n }\n\n // Check if scrollTo is supported and if it's been polyfilled\n const scrollToFunction = Element.prototype.scrollTo;\n if (!scrollToFunction) {\n return (scrollBehaviorSupported = false);\n }\n\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n return (scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString()));\n}\n\ninterface HTMLStyles {\n top: string;\n left: string;\n position: string;\n overflowY: string;\n width: string;\n}\n\nexport class BlockScrollStrategy implements ScrollStrategy {\n private readonly previousHTMLStyles: HTMLStyles = {\n top: '',\n left: '',\n position: '',\n overflowY: '',\n width: '',\n };\n private previousScrollPosition = { top: 0, left: 0 };\n private isEnabled = false;\n\n constructor(\n private readonly viewportRuler: ViewportRuler,\n private readonly document: Document,\n ) {}\n\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this.canBeEnabled()) {\n const root = this.document.documentElement!;\n\n this.previousScrollPosition = this.viewportRuler.getViewportScrollPosition();\n\n // Cache the previous inline styles in case the user had set them.\n this.previousHTMLStyles.left = root.style.left || '';\n this.previousHTMLStyles.top = root.style.top || '';\n this.previousHTMLStyles.position = root.style.position || '';\n this.previousHTMLStyles.overflowY = root.style.overflowY || '';\n this.previousHTMLStyles.width = root.style.width || '';\n\n // Set the styles to block scrolling.\n root.style.position = 'fixed';\n\n // Necessary for the content not to lose its width. Note that we're using 100%, instead of\n // 100vw, because 100vw includes the width plus the scrollbar, whereas 100% is the width\n // that the element had before we made it `fixed`.\n root.style.width = '100%';\n\n // Note: this will always add a scrollbar to whatever element it is on, which can\n // potentially result in double scrollbars. It shouldn't be an issue, because we won't\n // block scrolling on a page that doesn't have a scrollbar in the first place.\n root.style.overflowY = 'scroll';\n\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this.previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this.previousScrollPosition.top);\n root.setAttribute('data-scrollblock', '');\n this.isEnabled = true;\n }\n }\n\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable(): void {\n if (this.isEnabled) {\n const html = this.document.documentElement!;\n const body = this.document.body!;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n\n this.isEnabled = false;\n\n htmlStyle.left = this.previousHTMLStyles.left;\n htmlStyle.top = this.previousHTMLStyles.top;\n htmlStyle.position = this.previousHTMLStyles.position;\n htmlStyle.overflowY = this.previousHTMLStyles.overflowY;\n htmlStyle.width = this.previousHTMLStyles.width;\n html.removeAttribute('data-scrollblock');\n\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,\n // because it can throw off feature detections in `supportsScrollBehavior` which\n // checks for `'scrollBehavior' in documentElement.style`.\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n }\n\n window.scroll(this.previousScrollPosition.left, this.previousScrollPosition.top);\n\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n\n private canBeEnabled(): boolean {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this.document.documentElement!;\n\n if (html.classList.contains('cdk-global-scrollblock') || this.isEnabled) {\n return false;\n }\n\n const viewport = this.viewportRuler.getViewportSize();\n return html.scrollHeight > viewport.height || html.scrollWidth > viewport.width;\n }\n}\n\nexport class NoopScrollStrategy implements ScrollStrategy {\n enable(): void {\n // No operation for enabling\n }\n\n disable(): void {\n // No operation for disabling\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ViewportRuler } from '@angular/cdk/overlay';\nimport { DOCUMENT } from '@angular/common';\nimport {\n DestroyRef,\n Injector,\n Provider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n Middleware,\n Placement,\n Strategy,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { fromResizeEvent } from 'ng-primitives/resize';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { Subject, fromEvent } from 'rxjs';\nimport { provideOverlayContext } from './overlay-token';\nimport { NgpPortal, createPortal } from './portal';\nimport { BlockScrollStrategy, NoopScrollStrategy } from './scroll-strategy';\n\n/**\n * Configuration options for creating an overlay\n * @internal\n */\nexport interface NgpOverlayConfig<T = unknown> {\n /** Content to display in the overlay (component or template) */\n content: NgpOverlayContent<T>;\n\n /** The element that triggers the overlay */\n triggerElement: HTMLElement;\n\n /** The injector to use for creating the portal */\n injector: Injector;\n /** ViewContainerRef to use for creating the portal */\n viewContainerRef: ViewContainerRef;\n\n /** Context data to pass to the overlay content */\n context?: T | null;\n\n /** Container element to attach the overlay to (defaults to document.body) */\n container?: HTMLElement | null;\n\n /** Preferred placement of the overlay relative to the trigger */\n placement?: Placement;\n\n /** Offset distance between the overlay and trigger in pixels */\n offset?: number;\n\n /** Whether to enable flip behavior when space is limited */\n flip?: boolean;\n\n /** Delay before showing the overlay in milliseconds */\n showDelay?: number;\n\n /** Delay before hiding the overlay in milliseconds */\n hideDelay?: number;\n\n /** Whether the overlay should be positioned with fixed or absolute strategy */\n strategy?: Strategy;\n\n /** The scroll strategy to use for the overlay */\n scrollBehaviour?: 'reposition' | 'block';\n /** Whether to close the overlay when clicking outside */\n closeOnOutsideClick?: boolean;\n /** Whether to close the overlay when pressing escape */\n closeOnEscape?: boolean;\n /** Whether to restore focus to the trigger element when hiding the overlay */\n restoreFocus?: boolean;\n /** Additional middleware for floating UI positioning */\n additionalMiddleware?: Middleware[];\n\n /** Additional providers */\n providers?: Provider[];\n}\n\n/** Type for overlay content which can be either a template or component */\nexport type NgpOverlayContent<T> = TemplateRef<NgpOverlayTemplateContext<T>> | Type<unknown>;\n\n/** Context for template-based overlays */\nexport type NgpOverlayTemplateContext<T> = {\n $implicit: T;\n};\n\n/**\n * NgpOverlay manages the lifecycle and positioning of overlay UI elements.\n * It abstracts the common behavior shared by tooltips, popovers, menus, etc.\n * @internal\n */\nexport class NgpOverlay<T = unknown> {\n private readonly disposables = injectDisposables();\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewContainerRef: ViewContainerRef;\n private readonly viewportRuler = inject(ViewportRuler);\n private readonly focusMonitor = inject(FocusMonitor);\n /** Access any parent overlays */\n private readonly parentOverlay = inject(NgpOverlay, { optional: true });\n /** Signal tracking the portal instance */\n private readonly portal = signal<NgpPortal | null>(null);\n\n /** Signal tracking the overlay position */\n readonly position = signal<{ x: number; y: number }>({ x: 0, y: 0 });\n\n /** Signal tracking the trigger element width */\n readonly triggerWidth = signal<number | null>(null);\n\n /** The transform origin for the overlay */\n readonly transformOrigin = signal<string>('center center');\n\n /** Function to dispose the positioning auto-update */\n private disposePositioning?: () => void;\n\n /** Timeout handle for showing the overlay */\n private openTimeout?: () => void;\n\n /** Timeout handle for hiding the overlay */\n private closeTimeout?: () => void;\n\n /** Signal tracking whether the overlay is open */\n readonly isOpen = signal(false);\n\n /** The scroll strategy */\n private scrollStrategy = new NoopScrollStrategy();\n\n /** An observable that emits when the overlay is closing */\n readonly closing = new Subject<void>();\n\n /**\n * Creates a new overlay instance\n * @param config Initial configuration for the overlay\n * @param destroyRef Reference for automatic cleanup\n */\n constructor(private config: NgpOverlayConfig<T>) {\n // we cannot inject the viewContainerRef as this can throw an error during hydration in SSR\n this.viewContainerRef = config.viewContainerRef;\n\n // this must be done after the config is set\n this.transformOrigin.set(this.getTransformOrigin());\n\n // Monitor trigger element resize\n fromResizeEvent(this.config.triggerElement)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.triggerWidth.set(this.config.triggerElement.offsetWidth);\n });\n\n // if there is a parent overlay and it is closed, close this overlay\n this.parentOverlay?.closing.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.isOpen()) {\n this.hideImmediate();\n }\n });\n\n // If closeOnOutsideClick is enabled, set up a click listener\n fromEvent<MouseEvent>(this.document, 'mouseup', { capture: true })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnOutsideClick) {\n return;\n }\n\n const overlay = this.portal();\n\n if (!overlay || !this.isOpen()) {\n return;\n }\n\n const path = event.composedPath();\n const isInsideOverlay = overlay.getElements().some(el => path.includes(el));\n const isInsideTrigger = path.includes(this.config.triggerElement);\n\n if (!isInsideOverlay && !isInsideTrigger) {\n this.hide();\n }\n });\n\n // If closeOnEscape is enabled, set up a keydown listener\n fromEvent<KeyboardEvent>(this.document, 'keydown', { capture: true })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnEscape) return;\n if (event.key === 'Escape' && this.isOpen()) {\n this.hide({ origin: 'keyboard', immediate: true });\n }\n });\n\n // Ensure cleanup on destroy\n this.destroyRef.onDestroy(() => this.destroy());\n }\n\n /**\n * Show the overlay with the specified delay\n * @param showDelay Optional delay to override the configured showDelay\n */\n show(): Promise<void> {\n return new Promise<void>(resolve => {\n // If closing is in progress, cancel it\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n\n // Don't proceed if already opening or open\n if (this.openTimeout || this.isOpen()) {\n return;\n }\n\n // Use the provided delay or fall back to config\n const delay = this.config.showDelay ?? 0;\n\n this.openTimeout = this.disposables.setTimeout(() => {\n this.openTimeout = undefined;\n this.createOverlay();\n resolve();\n }, delay);\n });\n }\n\n /**\n * Hide the overlay with the specified delay\n * @param options Optional options for hiding the overlay\n */\n hide(options?: OverlayTriggerOptions): void {\n // If opening is in progress, cancel it\n if (this.openTimeout) {\n this.openTimeout();\n this.openTimeout = undefined;\n }\n\n // Don't proceed if already closing or closed\n if (this.closeTimeout || !this.isOpen()) {\n return;\n }\n\n this.closing.next();\n\n // Use the provided delay or fall back to config\n const delay = options?.immediate ? 0 : (this.config.hideDelay ?? 0);\n\n this.closeTimeout = this.disposables.setTimeout(async () => {\n this.closeTimeout = undefined;\n\n if (this.config.restoreFocus) {\n this.focusMonitor.focusVia(this.config.triggerElement, options?.origin ?? 'program', {\n preventScroll: true,\n });\n }\n\n await this.destroyOverlay();\n }, delay);\n }\n\n /**\n * Update the configuration of this overlay\n * @param config New configuration (partial)\n */\n updateConfig(config: Partial<NgpOverlayConfig<T>>): void {\n this.config = { ...this.config, ...config };\n\n // If the overlay is already open, update its position\n if (this.isOpen()) {\n this.updatePosition();\n }\n }\n\n /**\n * Immediately hide the overlay without any delay\n */\n hideImmediate(): void {\n this.hide({ immediate: true });\n }\n\n /**\n * Toggle the overlay open/closed state\n */\n toggle(): void {\n if (this.isOpen()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Force update the position of the overlay\n */\n updatePosition(): void {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n const elements = portal.getElements();\n\n if (elements.length === 0) {\n return;\n }\n\n const overlayElement = elements[0] as HTMLElement;\n\n // Compute new position\n this.computePosition(overlayElement);\n }\n\n /**\n * Completely destroy this overlay instance\n */\n destroy(): void {\n this.hideImmediate();\n this.disposePositioning?.();\n this.scrollStrategy.disable();\n }\n\n /**\n * Get the elements of the overlay\n */\n getElements(): HTMLElement[] {\n return this.portal()?.getElements() ?? [];\n }\n\n /**\n * Internal method to create the overlay\n */\n private createOverlay(): void {\n if (!this.config.content) {\n throw new Error('Overlay content must be provided');\n }\n\n // Create a new portal with context\n const portal = createPortal(\n this.config.content,\n this.viewContainerRef,\n Injector.create({\n parent: this.config.injector,\n providers: [\n ...(this.config.providers || []),\n { provide: NgpOverlay, useValue: this },\n provideOverlayContext<T>(this.config.context as T),\n ],\n }),\n { $implicit: this.config.context } as NgpOverlayTemplateContext<T>,\n );\n\n // Attach portal to container\n const container = this.config.container || this.document.body;\n portal.attach(container);\n\n // Update portal signal\n this.portal.set(portal);\n\n // Ensure view is up to date\n portal.detectChanges();\n\n const outletElement = portal.getElements()[0] as HTMLElement | null;\n\n if (!outletElement) {\n throw new Error('Overlay element is not available.');\n }\n\n if (portal.getElements().length > 1) {\n throw new Error('Overlay must have only one root element.');\n }\n\n // Set up positioning\n this.setupPositioning(outletElement);\n\n // Mark as open\n this.isOpen.set(true);\n\n this.scrollStrategy =\n this.config.scrollBehaviour === 'block'\n ? new BlockScrollStrategy(this.viewportRuler, this.document)\n : new NoopScrollStrategy();\n\n this.scrollStrategy.enable();\n }\n\n /**\n * Internal method to setup positioning of the overlay\n */\n private setupPositioning(overlayElement: HTMLElement): void {\n // Determine positioning strategy based on overlay element's CSS\n const strategy =\n getComputedStyle(overlayElement).position === 'fixed'\n ? 'fixed'\n : this.config.strategy || 'absolute';\n\n // Setup auto-update for positioning\n this.disposePositioning = autoUpdate(this.config.triggerElement, overlayElement, () =>\n this.computePosition(overlayElement, strategy),\n );\n }\n\n /**\n * Compute the overlay position using floating-ui\n */\n private async computePosition(\n overlayElement: HTMLElement,\n strategy: Strategy = 'absolute',\n ): Promise<void> {\n // Create middleware array\n const middleware: Middleware[] = [offset(this.config.offset || 0), shift()];\n\n // Add flip middleware if requested\n if (this.config.flip !== false) {\n middleware.push(flip());\n }\n\n // Add any additional middleware\n if (this.config.additionalMiddleware) {\n middleware.push(...this.config.additionalMiddleware);\n }\n\n // Compute the position\n const position = await computePosition(this.config.triggerElement, overlayElement, {\n placement: this.config.placement || 'top',\n middleware,\n strategy,\n });\n\n // Update position signal\n this.position.set({ x: position.x, y: position.y });\n\n // Ensure view is updated\n this.portal()?.detectChanges();\n }\n\n /**\n * Internal method to destroy the overlay portal\n */\n private async destroyOverlay(): Promise<void> {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n // Clear portal reference to prevent double destruction\n this.portal.set(null);\n\n // Clean up positioning\n this.disposePositioning?.();\n this.disposePositioning = undefined;\n\n // Detach the portal\n await portal.detach();\n\n // Mark as closed\n this.isOpen.set(false);\n\n // disable scroll strategy\n this.scrollStrategy.disable();\n this.scrollStrategy = new NoopScrollStrategy();\n }\n\n /**\n * Get the transform origin for the overlay\n */\n private getTransformOrigin(): string {\n const placement = this.config.placement ?? 'top';\n\n const basePlacement = placement.split('-')[0]; // Extract \"top\", \"bottom\", etc.\n const alignment = placement.split('-')[1]; // Extract \"start\" or \"end\"\n\n const map: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n };\n\n let x = 'center';\n let y = 'center';\n\n if (basePlacement === 'top' || basePlacement === 'bottom') {\n y = map[basePlacement];\n if (alignment === 'start') x = 'left';\n else if (alignment === 'end') x = 'right';\n } else {\n x = map[basePlacement];\n if (alignment === 'start') y = 'top';\n else if (alignment === 'end') y = 'bottom';\n }\n\n return `${y} ${x}`;\n }\n}\n\n/**\n * Helper function to create an overlay in a single call\n * @internal\n */\nexport function createOverlay<T>(config: NgpOverlayConfig<T>): NgpOverlay<T> {\n // we run the overlay creation in the injector context to ensure that it can call the inject function\n return runInInjectionContext(config.injector, () => new NgpOverlay<T>(config));\n}\n\n/**\n * Helper function to inject the NgpOverlay instance\n * @internal\n */\nexport function injectOverlay<T>(): NgpOverlay<T> {\n return inject(NgpOverlay);\n}\n\nexport interface OverlayTriggerOptions {\n /**\n * Whether the visibility change should be immediate.\n */\n immediate?: boolean;\n /**\n * The origin of the focus event that triggered the visibility change.\n */\n origin?: FocusOrigin;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,MAAM,sBAAsB,GAAG,IAAI,cAAc,CAAU,wBAAwB,CAAC;AAEpF;;;AAGG;SACa,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAA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AAA;;AAE1D,IAAA,OAAO,qBAAqB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,UAAU,CAAI,MAAM,CAAC,CAAC;AAChF;AAEA;;;AAGG;SACa,aAAa,GAAA;AAC3B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;ACpgBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-progress.mjs","sources":["../../../../packages/ng-primitives/progress/src/progress/progress-state.ts","../../../../packages/ng-primitives/progress/src/progress-indicator/progress-indicator.ts","../../../../packages/ng-primitives/progress/src/progress-label/progress-label.ts","../../../../packages/ng-primitives/progress/src/progress-track/progress-track.ts","../../../../packages/ng-primitives/progress/src/progress-value/progress-value.ts","../../../../packages/ng-primitives/progress/src/progress/progress.ts","../../../../packages/ng-primitives/progress/src/ng-primitives-progress.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpProgress } from './progress';\n\n/**\n * The state token for the Progress primitive.\n */\nexport const NgpProgressStateToken = createStateToken<NgpProgress>('Progress');\n\n/**\n * Provides the Progress state.\n */\nexport const provideProgressState = createStateProvider(NgpProgressStateToken);\n\n/**\n * Injects the Progress state.\n */\nexport const injectProgressState = createStateInjector(NgpProgressStateToken);\n\n/**\n * The Progress state registration function.\n */\nexport const progressState = createState(NgpProgressStateToken);\n","import { computed, Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n/**\n * Apply the `ngpProgressIndicator` directive to an element that represents the current progress.\n * The width of this element can be set to the percentage of the progress value.\n */\n@Directive({\n selector: '[ngpProgressIndicator]',\n host: {\n '[style.width.%]': 'percentage()',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressIndicator {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * Get the percentage of the progress value.\n */\n protected readonly percentage = computed(() =>\n this.state().value() === null\n ? null\n : ((this.state().value()! - this.state().min()) / (this.state().max() - this.state().min())) *\n 100,\n );\n}\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressLabel]',\n exportAs: 'ngpProgressLabel',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressLabel {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * The unique identifier for the progress label.\n */\n readonly id = input<string>(uniqueId('ngp-progress-label'));\n\n constructor() {\n this.state().label.set(this);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressTrack]',\n exportAs: 'ngpProgressTrack',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressTrack {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressValue]',\n exportAs: 'ngpProgressValue',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressValue {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, computed, input, numberAttribute, signal } from '@angular/core';\nimport { NgpProgressLabel } from '../progress-label/progress-label';\nimport { progressState, provideProgressState } from './progress-state';\n\n/**\n * Apply the `ngpProgress` directive to an element that represents the progress bar.\n */\n@Directive({\n selector: '[ngpProgress]',\n providers: [provideProgressState()],\n host: {\n role: 'progressbar',\n '[attr.aria-valuemax]': 'state.max()',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'state.value()',\n '[attr.aria-valuetext]': 'valueText()',\n '[attr.aria-labelledby]': 'label() ? label().id : null',\n '[attr.data-progressing]': 'progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'complete() ? \"\" : null',\n },\n})\nexport class NgpProgress {\n /**\n * Define the progress value.\n */\n readonly value = input<number | null, NumberInput>(0, {\n alias: 'ngpProgressValue',\n transform: v => (v == null ? null : numberAttribute(v)),\n });\n\n /**\n * Define the progress min value.\n * @default '0'\n */\n readonly min = input<number, NumberInput>(0, {\n alias: 'ngpProgressMin',\n transform: numberAttribute,\n });\n\n /**\n * Define the progress max value.\n * @default 100\n */\n readonly max = input<number, NumberInput>(100, {\n alias: 'ngpProgressMax',\n transform: numberAttribute,\n });\n\n /**\n * Define a function that returns the progress value label.\n * @param value The current value\n * @param max The maximum value\n * @returns The value label\n */\n readonly valueLabel = input<NgpProgressValueTextFn>(\n (value, max) => `${Math.round((value / max) * 100)}%`,\n {\n alias: 'ngpProgressValueLabel',\n },\n );\n\n /**\n * Determine if the progress is indeterminate.\n * @internal\n */\n readonly indeterminate = computed(() => this.state.value() === null);\n\n /**\n * Determine if the progress is in a progressing state.\n * @internal\n */\n readonly progressing = computed(\n () =>\n this.state.value() != null &&\n this.state.value()! > 0 &&\n this.state.value()! < this.state.max(),\n );\n\n /**\n * Determine if the progress is complete.\n * @internal\n */\n readonly complete = computed(() => this.state.value() === this.state.max());\n\n /**\n * Get the progress value text.\n */\n protected readonly valueText = computed(() => {\n const value = this.state.value();\n\n if (value == null) {\n return '';\n }\n\n return this.state.valueLabel()(value, this.state.max());\n });\n\n /**\n * The label associated with the progress bar.\n * @internal\n */\n readonly label = signal<NgpProgressLabel | null>(null);\n\n /**\n * The state of the progress bar.\n * @internal\n */\n protected readonly state = progressState<NgpProgress>(this);\n}\n\nexport type NgpProgressValueTextFn = (value: number, max: number) => string;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAC,qBAAqB;AAE5E;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;ACvB/D;;;AAGG;MAUU,oBAAoB,CAAA;AATjC,IAAA,WAAA,GAAA;AAUE;;AAEG;QACgB,IAAK,CAAA,KAAA,GAAG,mBAAmB,EAAE;AAEhD;;AAEG;AACgB,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MACvC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK;AACvB,cAAE;AACF,cAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC;AACzF,gBAAA,GAAG,CACR;AACF;+GAfY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,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EAAA,GAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,qBAAA,EAAA,aAAA,EAAA,sBAAA,EAAA,6BAAA,EAAA,uBAAA,EAAA,6BAAA,EAAA,yBAAA,EAAA,+BAAA,EAAA,oBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAaxB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAfvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,aAAa;AACnB,wBAAA,sBAAsB,EAAE,aAAa;AACrC,wBAAA,sBAAsB,EAAE,GAAG;AAC3B,wBAAA,sBAAsB,EAAE,eAAe;AACvC,wBAAA,uBAAuB,EAAE,aAAa;AACtC,wBAAA,wBAAwB,EAAE,6BAA6B;AACvD,wBAAA,yBAAyB,EAAE,2BAA2B;AACtD,wBAAA,2BAA2B,EAAE,6BAA6B;AAC1D,wBAAA,sBAAsB,EAAE,wBAAwB;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-progress.mjs","sources":["../../../../packages/ng-primitives/progress/src/progress/progress-state.ts","../../../../packages/ng-primitives/progress/src/progress-indicator/progress-indicator.ts","../../../../packages/ng-primitives/progress/src/progress-label/progress-label.ts","../../../../packages/ng-primitives/progress/src/progress-track/progress-track.ts","../../../../packages/ng-primitives/progress/src/progress-value/progress-value.ts","../../../../packages/ng-primitives/progress/src/progress/progress.ts","../../../../packages/ng-primitives/progress/src/ng-primitives-progress.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpProgress } from './progress';\n\n/**\n * The state token for the Progress primitive.\n */\nexport const NgpProgressStateToken = createStateToken<NgpProgress>('Progress');\n\n/**\n * Provides the Progress state.\n */\nexport const provideProgressState = createStateProvider(NgpProgressStateToken);\n\n/**\n * Injects the Progress state.\n */\nexport const injectProgressState = createStateInjector<NgpProgress>(NgpProgressStateToken);\n\n/**\n * The Progress state registration function.\n */\nexport const progressState = createState(NgpProgressStateToken);\n","import { computed, Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n/**\n * Apply the `ngpProgressIndicator` directive to an element that represents the current progress.\n * The width of this element can be set to the percentage of the progress value.\n */\n@Directive({\n selector: '[ngpProgressIndicator]',\n host: {\n '[style.width.%]': 'percentage()',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressIndicator {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * Get the percentage of the progress value.\n */\n protected readonly percentage = computed(() =>\n this.state().value() === null\n ? null\n : ((this.state().value()! - this.state().min()) / (this.state().max() - this.state().min())) *\n 100,\n );\n}\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressLabel]',\n exportAs: 'ngpProgressLabel',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressLabel {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * The unique identifier for the progress label.\n */\n readonly id = input<string>(uniqueId('ngp-progress-label'));\n\n constructor() {\n this.state().label.set(this);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressTrack]',\n exportAs: 'ngpProgressTrack',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressTrack {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressValue]',\n exportAs: 'ngpProgressValue',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressValue {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, computed, input, numberAttribute, signal } from '@angular/core';\nimport { NgpProgressLabel } from '../progress-label/progress-label';\nimport { progressState, provideProgressState } from './progress-state';\n\n/**\n * Apply the `ngpProgress` directive to an element that represents the progress bar.\n */\n@Directive({\n selector: '[ngpProgress]',\n providers: [provideProgressState()],\n host: {\n role: 'progressbar',\n '[attr.aria-valuemax]': 'state.max()',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'state.value()',\n '[attr.aria-valuetext]': 'valueText()',\n '[attr.aria-labelledby]': 'label() ? label().id : null',\n '[attr.data-progressing]': 'progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'complete() ? \"\" : null',\n },\n})\nexport class NgpProgress {\n /**\n * Define the progress value.\n */\n readonly value = input<number | null, NumberInput>(0, {\n alias: 'ngpProgressValue',\n transform: v => (v == null ? null : numberAttribute(v)),\n });\n\n /**\n * Define the progress min value.\n * @default '0'\n */\n readonly min = input<number, NumberInput>(0, {\n alias: 'ngpProgressMin',\n transform: numberAttribute,\n });\n\n /**\n * Define the progress max value.\n * @default 100\n */\n readonly max = input<number, NumberInput>(100, {\n alias: 'ngpProgressMax',\n transform: numberAttribute,\n });\n\n /**\n * Define a function that returns the progress value label.\n * @param value The current value\n * @param max The maximum value\n * @returns The value label\n */\n readonly valueLabel = input<NgpProgressValueTextFn>(\n (value, max) => `${Math.round((value / max) * 100)}%`,\n {\n alias: 'ngpProgressValueLabel',\n },\n );\n\n /**\n * Determine if the progress is indeterminate.\n * @internal\n */\n readonly indeterminate = computed(() => this.state.value() === null);\n\n /**\n * Determine if the progress is in a progressing state.\n * @internal\n */\n readonly progressing = computed(\n () =>\n this.state.value() != null &&\n this.state.value()! > 0 &&\n this.state.value()! < this.state.max(),\n );\n\n /**\n * Determine if the progress is complete.\n * @internal\n */\n readonly complete = computed(() => this.state.value() === this.state.max());\n\n /**\n * Get the progress value text.\n */\n protected readonly valueText = computed(() => {\n const value = this.state.value();\n\n if (value == null) {\n return '';\n }\n\n return this.state.valueLabel()(value, this.state.max());\n });\n\n /**\n * The label associated with the progress bar.\n * @internal\n */\n readonly label = signal<NgpProgressLabel | null>(null);\n\n /**\n * The state of the progress bar.\n * @internal\n */\n protected readonly state = progressState<NgpProgress>(this);\n}\n\nexport type NgpProgressValueTextFn = (value: number, max: number) => string;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;ACvB/D;;;AAGG;MAUU,oBAAoB,CAAA;AATjC,IAAA,WAAA,GAAA;AAUE;;AAEG;QACgB,IAAK,CAAA,KAAA,GAAG,mBAAmB,EAAE;AAEhD;;AAEG;AACgB,QAAA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wBAAA,wBAAwB,EAAE,6BAA6B;AACvD,wBAAA,yBAAyB,EAAE,2BAA2B;AACtD,wBAAA,2BAA2B,EAAE,6BAA6B;AAC1D,wBAAA,sBAAsB,EAAE,wBAAwB;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -3,6 +3,7 @@ import { input, output, booleanAttribute, Directive, computed, HostListener } fr
3
3
  import { setupFormControl } from 'ng-primitives/form-field';
4
4
  import * as i1 from 'ng-primitives/roving-focus';
5
5
  import { injectRovingFocusGroupState, NgpRovingFocusGroup, NgpRovingFocusItem } from 'ng-primitives/roving-focus';
6
+ import { uniqueId } from 'ng-primitives/utils';
6
7
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
7
8
  import * as i2 from 'ng-primitives/interactions';
8
9
  import { NgpHover, NgpPress, NgpFocusVisible } from 'ng-primitives/interactions';
@@ -33,6 +34,10 @@ class NgpRadioGroup {
33
34
  * Access the roving focus group state.
34
35
  */
35
36
  this.rovingFocusGroupState = injectRovingFocusGroupState();
37
+ /**
38
+ * The id of the radio group. If not provided, a unique id will be generated.
39
+ */
40
+ this.id = input(uniqueId('ngp-radio-group'));
36
41
  /**
37
42
  * The value of the radio group.
38
43
  */
@@ -69,7 +74,7 @@ class NgpRadioGroup {
69
74
  * @internal
70
75
  */
71
76
  this.state = radioGroupState(this);
72
- setupFormControl({ disabled: this.state.disabled });
77
+ setupFormControl({ id: this.state.id, disabled: this.state.disabled });
73
78
  }
74
79
  ngOnInit() {
75
80
  // the roving focus group defaults to vertical orientation whereas we want to default to vertical
@@ -88,7 +93,7 @@ class NgpRadioGroup {
88
93
  this.valueChange.emit(value);
89
94
  }
90
95
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
91
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpRadioGroup, isStandalone: true, selector: "[ngpRadioGroup]", inputs: { value: { classPropertyName: "value", publicName: "ngpRadioGroupValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRadioGroupDisabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpRadioGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpRadioGroupCompareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpRadioGroupValueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "attr.aria-orientation": "state.orientation()", "attr.data-orientation": "state.orientation()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideRadioGroupState()], hostDirectives: [{ directive: i1.NgpRovingFocusGroup, inputs: ["ngpRovingFocusGroupOrientation", "ngpRadioGroupOrientation", "ngpRovingFocusGroupDisabled", "ngpRadioGroupDisabled"] }], ngImport: i0 }); }
96
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpRadioGroup, isStandalone: true, selector: "[ngpRadioGroup]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpRadioGroupValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRadioGroupDisabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpRadioGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpRadioGroupCompareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpRadioGroupValueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "id": "id()", "attr.aria-orientation": "state.orientation()", "attr.data-orientation": "state.orientation()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideRadioGroupState()], hostDirectives: [{ directive: i1.NgpRovingFocusGroup, inputs: ["ngpRovingFocusGroupOrientation", "ngpRadioGroupOrientation", "ngpRovingFocusGroupDisabled", "ngpRadioGroupDisabled"] }], ngImport: i0 }); }
92
97
  }
93
98
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioGroup, decorators: [{
94
99
  type: Directive,
@@ -106,6 +111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
106
111
  ],
107
112
  host: {
108
113
  role: 'radiogroup',
114
+ '[id]': 'id()',
109
115
  '[attr.aria-orientation]': 'state.orientation()',
110
116
  '[attr.data-orientation]': 'state.orientation()',
111
117
  '[attr.data-disabled]': 'state.disabled() ? "" : null',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-radio.mjs","sources":["../../../../packages/ng-primitives/radio/src/radio-group/radio-group-state.ts","../../../../packages/ng-primitives/radio/src/radio-group/radio-group.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item-state.ts","../../../../packages/ng-primitives/radio/src/radio-indicator/radio-indicator.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item.ts","../../../../packages/ng-primitives/radio/src/ng-primitives-radio.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioGroup } from './radio-group';\n\n/**\n * The state token for the RadioGroup primitive.\n */\nexport const NgpRadioGroupStateToken = createStateToken<NgpRadioGroup<unknown>>('RadioGroup');\n\n/**\n * Provides the RadioGroup state.\n */\nexport const provideRadioGroupState = createStateProvider(NgpRadioGroupStateToken);\n\n/**\n * Injects the RadioGroup state.\n */\nexport const injectRadioGroupState = createStateInjector(NgpRadioGroupStateToken) as <\n T,\n>() => InjectedState<NgpRadioGroup<T>>;\n\n/**\n * The RadioGroup state registration function.\n */\nexport const radioGroupState = createState(NgpRadioGroupStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, OnInit, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { provideRadioGroupState, radioGroupState } from './radio-group-state';\n\n/**\n * Apply the `ngpRadioGroup` directive to an element that represents the group of radio items.\n */\n@Directive({\n selector: '[ngpRadioGroup]',\n providers: [provideRadioGroupState()],\n hostDirectives: [\n {\n directive: NgpRovingFocusGroup,\n inputs: [\n 'ngpRovingFocusGroupOrientation:ngpRadioGroupOrientation',\n 'ngpRovingFocusGroupDisabled:ngpRadioGroupDisabled',\n ],\n },\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': 'state.orientation()',\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpRadioGroup<T> implements OnInit {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * The value of the radio group.\n */\n readonly value = input<T | null>(null, { alias: 'ngpRadioGroupValue' });\n\n /**\n * Event emitted when the radio group value changes.\n */\n readonly valueChange = output<T | null>({\n alias: 'ngpRadioGroupValueChange',\n });\n\n /**\n * Whether the radio group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The orientation of the radio group.\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>('horizontal', {\n alias: 'ngpRadioGroupOrientation',\n });\n\n /**\n * The comparator function for the radio group. This is useful if values are objects and you want to compare them by value, not by reference.\n * @default (a, b) => a === b\n */\n readonly compareWith = input<(a: T | null, b: T | null) => boolean>((a, b) => a === b, {\n alias: 'ngpRadioGroupCompareWith',\n });\n\n /**\n * The state of the radio group.\n * @internal\n */\n protected readonly state = radioGroupState<NgpRadioGroup<T>>(this);\n\n constructor() {\n setupFormControl({ disabled: this.state.disabled });\n }\n\n ngOnInit(): void {\n // the roving focus group defaults to vertical orientation whereas we want to default to vertical\n this.rovingFocusGroupState().orientation.set(this.state.orientation());\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: T): void {\n // if the value is already selected, do nothing\n if (this.state.compareWith()(this.state.value(), value)) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioItem } from './radio-item';\n\n/**\n * The state token for the RadioItem primitive.\n */\nexport const NgpRadioItemStateToken = createStateToken<NgpRadioItem<unknown>>('RadioItem');\n\n/**\n * Provides the RadioItem state.\n */\nexport const provideRadioItemState = createStateProvider(NgpRadioItemStateToken);\n\n/**\n * Injects the RadioItem state.\n */\nexport const injectRadioItemState = createStateInjector(NgpRadioItemStateToken) as <\n T,\n>() => InjectedState<NgpRadioItem<T>>;\n\n/**\n * The RadioItem state registration function.\n */\nexport const radioItemState = createState(NgpRadioItemStateToken);\n","import { Directive, computed } from '@angular/core';\nimport { NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { injectRadioItemState } from '../radio-item/radio-item-state';\n\n/**\n * Apply the `ngpRadioIndicator` directive to an element that represents the radio indicator (i.e. the dot).\n */\n@Directive({\n selector: '[ngpRadioIndicator]',\n host: {\n '[attr.data-checked]': 'checked() ? \"\" : null',\n '[attr.data-disabled]': 'radioItemState().disabled() ? \"\" : null',\n },\n hostDirectives: [NgpHover, NgpPress],\n})\nexport class NgpRadioIndicator<T> {\n /**\n * Access the radio group state.\n */\n protected readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * Access the radio group item state\n */\n protected readonly radioItemState = injectRadioItemState<T>();\n\n /**\n * Determine if the radio indicator is checked.\n */\n protected readonly checked = computed(\n () => this.radioGroupState().value() === this.radioItemState().value(),\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, booleanAttribute, computed, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { provideRadioItemState, radioItemState } from './radio-item-state';\n\n/**\n * Apply the `ngpRadioItem` directive to an element that represents a radio item. This would typically be a `button` element.\n */\n@Directive({\n selector: '[ngpRadioItem]',\n hostDirectives: [NgpRovingFocusItem, NgpHover, NgpFocusVisible, NgpPress],\n providers: [provideRadioItemState()],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked() ? \"true\" : \"false\"',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.data-checked]': 'checked() ? \"\" : null',\n },\n})\nexport class NgpRadioItem<T> {\n /**\n * Access the radio group state.\n */\n private readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * The value of the radio item.\n */\n readonly value = input.required<T>({ alias: 'ngpRadioItemValue' });\n\n /**\n * Whether the radio item is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the radio item is checked.\n */\n readonly checked = computed(() =>\n this.radioGroupState().compareWith()(this.radioGroupState().value(), this.value()),\n );\n\n /**\n * The state of the radio item.\n */\n protected readonly state = radioItemState<NgpRadioItem<T>>(this);\n\n /**\n * When the item receives focus, select it.\n * @internal\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.radioGroupState().select(this.value());\n }\n\n /**\n * When the item receives a click, select it.\n * @internal\n */\n @HostListener('click')\n protected onClick(): void {\n this.radioGroupState().select(this.value());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;A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YAAY;uBAAC,OAAO;gBAUX,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO;;;AClEvB;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-radio.mjs","sources":["../../../../packages/ng-primitives/radio/src/radio-group/radio-group-state.ts","../../../../packages/ng-primitives/radio/src/radio-group/radio-group.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item-state.ts","../../../../packages/ng-primitives/radio/src/radio-indicator/radio-indicator.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item.ts","../../../../packages/ng-primitives/radio/src/ng-primitives-radio.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioGroup } from './radio-group';\n\n/**\n * The state token for the RadioGroup primitive.\n */\nexport const NgpRadioGroupStateToken = createStateToken<NgpRadioGroup<unknown>>('RadioGroup');\n\n/**\n * Provides the RadioGroup state.\n */\nexport const provideRadioGroupState = createStateProvider(NgpRadioGroupStateToken);\n\n/**\n * Injects the RadioGroup state.\n */\nexport const injectRadioGroupState = createStateInjector<NgpRadioGroup<unknown>>(\n NgpRadioGroupStateToken,\n) as <T>() => InjectedState<NgpRadioGroup<T>>;\n\n/**\n * The RadioGroup state registration function.\n */\nexport const radioGroupState = createState(NgpRadioGroupStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, OnInit, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideRadioGroupState, radioGroupState } from './radio-group-state';\n\n/**\n * Apply the `ngpRadioGroup` directive to an element that represents the group of radio items.\n */\n@Directive({\n selector: '[ngpRadioGroup]',\n providers: [provideRadioGroupState()],\n hostDirectives: [\n {\n directive: NgpRovingFocusGroup,\n inputs: [\n 'ngpRovingFocusGroupOrientation:ngpRadioGroupOrientation',\n 'ngpRovingFocusGroupDisabled:ngpRadioGroupDisabled',\n ],\n },\n ],\n host: {\n role: 'radiogroup',\n '[id]': 'id()',\n '[attr.aria-orientation]': 'state.orientation()',\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpRadioGroup<T> implements OnInit {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * The id of the radio group. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-radio-group'));\n\n /**\n * The value of the radio group.\n */\n readonly value = input<T | null>(null, { alias: 'ngpRadioGroupValue' });\n\n /**\n * Event emitted when the radio group value changes.\n */\n readonly valueChange = output<T | null>({\n alias: 'ngpRadioGroupValueChange',\n });\n\n /**\n * Whether the radio group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The orientation of the radio group.\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>('horizontal', {\n alias: 'ngpRadioGroupOrientation',\n });\n\n /**\n * The comparator function for the radio group. This is useful if values are objects and you want to compare them by value, not by reference.\n * @default (a, b) => a === b\n */\n readonly compareWith = input<(a: T | null, b: T | null) => boolean>((a, b) => a === b, {\n alias: 'ngpRadioGroupCompareWith',\n });\n\n /**\n * The state of the radio group.\n * @internal\n */\n protected readonly state = radioGroupState<NgpRadioGroup<T>>(this);\n\n constructor() {\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n\n ngOnInit(): void {\n // the roving focus group defaults to vertical orientation whereas we want to default to vertical\n this.rovingFocusGroupState().orientation.set(this.state.orientation());\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: T): void {\n // if the value is already selected, do nothing\n if (this.state.compareWith()(this.state.value(), value)) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioItem } from './radio-item';\n\n/**\n * The state token for the RadioItem primitive.\n */\nexport const NgpRadioItemStateToken = createStateToken<NgpRadioItem<unknown>>('RadioItem');\n\n/**\n * Provides the RadioItem state.\n */\nexport const provideRadioItemState = createStateProvider(NgpRadioItemStateToken);\n\n/**\n * Injects the RadioItem state.\n */\nexport const injectRadioItemState = createStateInjector<NgpRadioItem<unknown>>(\n NgpRadioItemStateToken,\n) as <T>() => InjectedState<NgpRadioItem<T>>;\n\n/**\n * The RadioItem state registration function.\n */\nexport const radioItemState = createState(NgpRadioItemStateToken);\n","import { Directive, computed } from '@angular/core';\nimport { NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { injectRadioItemState } from '../radio-item/radio-item-state';\n\n/**\n * Apply the `ngpRadioIndicator` directive to an element that represents the radio indicator (i.e. the dot).\n */\n@Directive({\n selector: '[ngpRadioIndicator]',\n host: {\n '[attr.data-checked]': 'checked() ? \"\" : null',\n '[attr.data-disabled]': 'radioItemState().disabled() ? \"\" : null',\n },\n hostDirectives: [NgpHover, NgpPress],\n})\nexport class NgpRadioIndicator<T> {\n /**\n * Access the radio group state.\n */\n protected readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * Access the radio group item state\n */\n protected readonly radioItemState = injectRadioItemState<T>();\n\n /**\n * Determine if the radio indicator is checked.\n */\n protected readonly checked = computed(\n () => this.radioGroupState().value() === this.radioItemState().value(),\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, booleanAttribute, computed, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { provideRadioItemState, radioItemState } from './radio-item-state';\n\n/**\n * Apply the `ngpRadioItem` directive to an element that represents a radio item. This would typically be a `button` element.\n */\n@Directive({\n selector: '[ngpRadioItem]',\n hostDirectives: [NgpRovingFocusItem, NgpHover, NgpFocusVisible, NgpPress],\n providers: [provideRadioItemState()],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked() ? \"true\" : \"false\"',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.data-checked]': 'checked() ? \"\" : null',\n },\n})\nexport class NgpRadioItem<T> {\n /**\n * Access the radio group state.\n */\n private readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * The value of the radio item.\n */\n readonly value = input.required<T>({ alias: 'ngpRadioItemValue' });\n\n /**\n * Whether the radio item is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the radio item is checked.\n */\n readonly checked = computed(() =>\n this.radioGroupState().compareWith()(this.radioGroupState().value(), this.value()),\n );\n\n /**\n * The state of the radio item.\n */\n protected readonly state = radioItemState<NgpRadioItem<T>>(this);\n\n /**\n * When the item receives focus, select it.\n * @internal\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.radioGroupState().select(this.value());\n }\n\n /**\n * When the item receives a click, select it.\n * @internal\n */\n @HostListener('click')\n protected onClick(): void {\n this.radioGroupState().select(this.value());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AASA;;AAEG;AACI,MAAM,uBAAuB,GAAG,gBAAgB,CAAyB,YAAY,CAAC;AAE7F;;AAEG;MACU,sBAAsB,GAAG,mBAAmB,CAAC,uBAAuB;AAEjF;;AAEG;MACU,qBAAqB,GAAG,mBAAmB,CACtD,uBAAuB;AAGzB;;AAEG;AACI,MAAM,eAAe,GAAG,WAAW,CAAC,uBAAuB,CAAC;;ACrBnE;;AAEG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