ng-primitives 0.66.0 → 0.68.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.
- package/accordion/accordion-content/accordion-content.d.ts +1 -8
- package/fesm2022/ng-primitives-accordion.mjs +25 -20
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +3 -1
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +2 -1
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +4 -4
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +19 -17
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +2 -1
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +15 -15
- package/toast/config/toast-config.d.ts +5 -1
- package/toast/toast/toast-manager.d.ts +1 -2
- package/toast/toast/toast-options.d.ts +2 -2
- package/toast/toast/toast.d.ts +2 -1
|
@@ -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/scroll-strategy.ts","../../../../packages/ng-primitives/portal/src/overlay.ts","../../../../packages/ng-primitives/portal/src/overlay-arrow.ts","../../../../packages/ng-primitives/portal/src/ng-primitives-portal.ts"],"sourcesContent":["import { inject, InjectionToken, Signal, 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>(): Signal<T> {\n return inject(NgpOverlayContextToken) as Signal<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: Signal<T | undefined> | undefined): 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 Signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n computed,\n inject,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport {\n Middleware,\n Placement,\n Strategy,\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { fromResizeEvent } from 'ng-primitives/internal';\nimport { injectDisposables, safeTakeUntilDestroyed, uniqueId } 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?: Signal<T | undefined>;\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 | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\n\n /**\n * Determine if the overlay has been positioned\n * @internal\n */\n readonly isPositioned = computed(\n () => this.position().x !== undefined && this.position().y !== undefined,\n );\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 /** Signal tracking the final placement of the overlay */\n readonly finalPlacement = signal<Placement | undefined>(undefined);\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 /** A unique id for the overlay */\n readonly id = signal<string>(uniqueId('ngp-overlay'));\n\n /** The aria-describedby attribute for accessibility */\n readonly ariaDescribedBy = computed(() => (this.isOpen() ? this.id() : undefined));\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 /** Store the arrow element */\n private arrowElement: HTMLElement | null = null;\n\n /** @internal The position of the arrow */\n readonly arrowPosition = signal<{ x: number | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\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(safeTakeUntilDestroyed(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(safeTakeUntilDestroyed(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(safeTakeUntilDestroyed(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(safeTakeUntilDestroyed(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 * Stop any pending close operation. This is useful for example, if we move the mouse from the tooltip trigger to the tooltip itself.\n * This will prevent the tooltip from closing immediately when the mouse leaves the trigger.\n * @internal\n */\n cancelPendingClose(): void {\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\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 unless immediate is true\n if ((this.closeTimeout && !options?.immediate) || !this.isOpen()) {\n return;\n }\n\n this.closing.next();\n\n const dispose = 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 };\n\n if (options?.immediate) {\n // If immediate, dispose right away\n dispose();\n } else {\n this.closeTimeout = this.disposables.setTimeout(dispose, this.config.hideDelay ?? 0);\n }\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),\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 // If the arrow element is registered, add arrow middleware\n if (this.arrowElement) {\n middleware.push(arrow({ element: this.arrowElement }));\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 // Update final placement signal\n this.finalPlacement.set(position.placement);\n\n // Update arrow position if available\n if (this.arrowElement) {\n this.arrowPosition.set({\n x: position.middlewareData.arrow?.x,\n y: position.middlewareData.arrow?.y,\n });\n }\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 // Reset final placement\n this.finalPlacement.set(undefined);\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 * Register the arrow element for positioning\n * @internal\n */\n registerArrow(arrowElement: HTMLElement | null): void {\n this.arrowElement = arrowElement;\n }\n\n /**\n * Remove the registered arrow element\n * @internal\n */\n unregisterArrow(): void {\n this.arrowElement = null;\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","import { DestroyRef, afterRenderEffect, inject } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlay } from './overlay';\n\nexport function setupOverlayArrow(): void {\n const overlay = injectOverlay();\n const element = injectElementRef();\n const destroyRef = inject(DestroyRef);\n\n // register the arrow element with the overlay\n overlay.registerArrow(element.nativeElement);\n\n // cleanup the arrow element on destroy\n destroyRef.onDestroy(() => overlay.unregisterArrow());\n\n // update the arrow position after the overlay is rendered\n afterRenderEffect(() => {\n const position = overlay.arrowPosition();\n element.nativeElement.style.setProperty('inset-inline-start', `${position.x}px`);\n element.nativeElement.style.setProperty('inset-block-start', `${position.y}px`);\n element.nativeElement.dataset['placement'] = overlay.finalPlacement();\n });\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,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iBAAiB,CAAC,MAAK;AACrB,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE;AACxC,QAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA,EAAA,CAAI,CAAC;AAChF,QAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA,EAAA,CAAI,CAAC;AAC/E,QAAA,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,cAAc,EAAE;AACvE,IAAA,CAAC,CAAC;AACJ;;ACtBA;;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/overlay-arrow.ts","../../../../packages/ng-primitives/portal/src/ng-primitives-portal.ts"],"sourcesContent":["import { inject, InjectionToken, Signal, 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>(): Signal<T> {\n return inject(NgpOverlayContextToken) as Signal<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: Signal<T | undefined> | undefined): 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 Signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n computed,\n inject,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport {\n Middleware,\n Placement,\n Strategy,\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { fromResizeEvent } from 'ng-primitives/internal';\nimport { injectDisposables, safeTakeUntilDestroyed, uniqueId } 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?: Signal<T | undefined>;\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 | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\n\n /**\n * Determine if the overlay has been positioned\n * @internal\n */\n readonly isPositioned = computed(\n () => this.position().x !== undefined && this.position().y !== undefined,\n );\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 /** Signal tracking the final placement of the overlay */\n readonly finalPlacement = signal<Placement | undefined>(undefined);\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 /** A unique id for the overlay */\n readonly id = signal<string>(uniqueId('ngp-overlay'));\n\n /** The aria-describedby attribute for accessibility */\n readonly ariaDescribedBy = computed(() => (this.isOpen() ? this.id() : undefined));\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 /** Store the arrow element */\n private arrowElement: HTMLElement | null = null;\n\n /** @internal The position of the arrow */\n readonly arrowPosition = signal<{ x: number | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\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(safeTakeUntilDestroyed(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(safeTakeUntilDestroyed(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(safeTakeUntilDestroyed(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(safeTakeUntilDestroyed(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 * Stop any pending close operation. This is useful for example, if we move the mouse from the tooltip trigger to the tooltip itself.\n * This will prevent the tooltip from closing immediately when the mouse leaves the trigger.\n * @internal\n */\n cancelPendingClose(): void {\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\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 unless immediate is true\n if ((this.closeTimeout && !options?.immediate) || !this.isOpen()) {\n return;\n }\n\n this.closing.next();\n\n const dispose = 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 };\n\n if (options?.immediate) {\n // If immediate, dispose right away\n dispose();\n } else {\n this.closeTimeout = this.disposables.setTimeout(dispose, this.config.hideDelay ?? 0);\n }\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),\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 // find a dedicated outlet element\n // this is the element that has the `data-overlay` attribute\n // if no such element exists, we use the first element in the portal\n const outletElement =\n portal.getElements().find(el => el.hasAttribute('data-overlay')) ?? portal.getElements()[0];\n\n if (!outletElement) {\n throw new Error('Overlay element is not available.');\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 // If the arrow element is registered, add arrow middleware\n if (this.arrowElement) {\n middleware.push(arrow({ element: this.arrowElement }));\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 // Update final placement signal\n this.finalPlacement.set(position.placement);\n\n // Update arrow position if available\n if (this.arrowElement) {\n this.arrowPosition.set({\n x: position.middlewareData.arrow?.x,\n y: position.middlewareData.arrow?.y,\n });\n }\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 // Reset final placement\n this.finalPlacement.set(undefined);\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 * Register the arrow element for positioning\n * @internal\n */\n registerArrow(arrowElement: HTMLElement | null): void {\n this.arrowElement = arrowElement;\n }\n\n /**\n * Remove the registered arrow element\n * @internal\n */\n unregisterArrow(): void {\n this.arrowElement = null;\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","import { DestroyRef, afterRenderEffect, inject } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlay } from './overlay';\n\nexport function setupOverlayArrow(): void {\n const overlay = injectOverlay();\n const element = injectElementRef();\n const destroyRef = inject(DestroyRef);\n\n // register the arrow element with the overlay\n overlay.registerArrow(element.nativeElement);\n\n // cleanup the arrow element on destroy\n destroyRef.onDestroy(() => overlay.unregisterArrow());\n\n // update the arrow position after the overlay is rendered\n afterRenderEffect(() => {\n const position = overlay.arrowPosition();\n element.nativeElement.style.setProperty('inset-inline-start', `${position.x}px`);\n element.nativeElement.style.setProperty('inset-block-start', `${position.y}px`);\n element.nativeElement.dataset['placement'] = overlay.finalPlacement();\n });\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,CAAc;AACpD;AAEA;;;;AAIG;AACG,SAAU,qBAAqB,CAAI,KAAwC,EAAA;IAC/E,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC7D;;MCRsB,SAA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,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA,EAAA,CAAI,CAAC;AAC/E,QAAA,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,cAAc,EAAE;AACvE,IAAA,CAAC,CAAC;AACJ;;ACtBA;;AAEG;;;;"}
|
|
@@ -9,6 +9,7 @@ const defaultToastConfig = {
|
|
|
9
9
|
gap: 14,
|
|
10
10
|
duration: 3000,
|
|
11
11
|
width: 360,
|
|
12
|
+
placement: 'top-end',
|
|
12
13
|
offsetTop: 24,
|
|
13
14
|
offsetBottom: 24,
|
|
14
15
|
offsetLeft: 24,
|
|
@@ -76,7 +77,8 @@ class NgpToastManager {
|
|
|
76
77
|
// services can't access the view container directly, so this is a workaround
|
|
77
78
|
const viewContainerRef = this.applicationRef.components[0].injector.get(ViewContainerRef);
|
|
78
79
|
let instance = null;
|
|
79
|
-
const placement = options.placement ??
|
|
80
|
+
const placement = options.placement ?? this.config.placement;
|
|
81
|
+
const duration = options.duration ?? this.config.duration;
|
|
80
82
|
const container = this.getOrCreateContainer(placement);
|
|
81
83
|
const portal = createPortal(toast, viewContainerRef, Injector.create({
|
|
82
84
|
parent: this.injector,
|
|
@@ -84,7 +86,7 @@ class NgpToastManager {
|
|
|
84
86
|
provideToastContext(options.context),
|
|
85
87
|
provideToastOptions({
|
|
86
88
|
placement,
|
|
87
|
-
duration
|
|
89
|
+
duration,
|
|
88
90
|
register: (toast) => (instance = toast),
|
|
89
91
|
expanded: computed(() => this.expanded().includes(placement)),
|
|
90
92
|
dismissible: options.dismissible ?? this.config.dismissible,
|
|
@@ -116,7 +118,7 @@ class NgpToastManager {
|
|
|
116
118
|
this.toasts.update(toasts => toasts.filter(t => t !== ref));
|
|
117
119
|
// if there are no more toasts, ensure the container is no longer considered expanded
|
|
118
120
|
if (this.toasts().length === 0) {
|
|
119
|
-
this.expanded.update(expanded => expanded.filter(p => p !== toast.
|
|
121
|
+
this.expanded.update(expanded => expanded.filter(p => p !== toast.options.placement));
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
}
|
|
@@ -161,7 +163,7 @@ class NgpToastManager {
|
|
|
161
163
|
container.style.setProperty('left', `${this.config.offsetLeft}px`);
|
|
162
164
|
break;
|
|
163
165
|
case 'top-center':
|
|
164
|
-
container.style.setProperty('top',
|
|
166
|
+
container.style.setProperty('top', `${this.config.offsetTop}px`);
|
|
165
167
|
container.style.setProperty('left', '50%');
|
|
166
168
|
container.style.setProperty('transform', 'translateX(-50%)');
|
|
167
169
|
break;
|
|
@@ -174,7 +176,7 @@ class NgpToastManager {
|
|
|
174
176
|
container.style.setProperty('left', `${this.config.offsetLeft}px`);
|
|
175
177
|
break;
|
|
176
178
|
case 'bottom-center':
|
|
177
|
-
container.style.setProperty('bottom',
|
|
179
|
+
container.style.setProperty('bottom', `${this.config.offsetBottom}px`);
|
|
178
180
|
container.style.setProperty('left', '50%');
|
|
179
181
|
container.style.setProperty('transform', 'translateX(-50%)');
|
|
180
182
|
break;
|
|
@@ -245,7 +247,7 @@ class NgpToast {
|
|
|
245
247
|
this.injector = inject(Injector);
|
|
246
248
|
this.config = injectToastConfig();
|
|
247
249
|
/** @internal */
|
|
248
|
-
this.
|
|
250
|
+
this.options = injectToastOptions();
|
|
249
251
|
this.interactivityChecker = inject(InteractivityChecker);
|
|
250
252
|
this.isInteracting = signal(false);
|
|
251
253
|
this.pointerStartRef = null;
|
|
@@ -268,7 +270,7 @@ class NgpToast {
|
|
|
268
270
|
*/
|
|
269
271
|
this.toasts = computed(() => this.manager
|
|
270
272
|
.toasts()
|
|
271
|
-
.filter(toast => toast.instance.
|
|
273
|
+
.filter(toast => toast.instance.options.placement === this.options.placement));
|
|
272
274
|
/**
|
|
273
275
|
* The number of toasts that are currently being displayed before this toast.
|
|
274
276
|
*/
|
|
@@ -317,20 +319,20 @@ class NgpToast {
|
|
|
317
319
|
/**
|
|
318
320
|
* The x position of the toast.
|
|
319
321
|
*/
|
|
320
|
-
this.x = this.
|
|
322
|
+
this.x = this.options.placement.split('-')[1] || 'end';
|
|
321
323
|
/**
|
|
322
324
|
* The y position of the toast.
|
|
323
325
|
*/
|
|
324
|
-
this.y = this.
|
|
326
|
+
this.y = this.options.placement.split('-')[0] || 'top';
|
|
325
327
|
/**
|
|
326
328
|
* The toast timer instance.
|
|
327
329
|
*/
|
|
328
|
-
this.timer = toastTimer(this.
|
|
329
|
-
this.
|
|
330
|
+
this.timer = toastTimer(this.options.duration, () => this.manager.dismiss(this));
|
|
331
|
+
this.options.register(this);
|
|
330
332
|
// Start the timer when the toast is created
|
|
331
333
|
this.timer.start();
|
|
332
334
|
// Pause the timer when the toast is expanded or when the user is interacting with it
|
|
333
|
-
explicitEffect([this.
|
|
335
|
+
explicitEffect([this.options.expanded, this.isInteracting], ([expanded, interacting]) => {
|
|
334
336
|
// If the toast is expanded, or if the user is interacting with it, reset the timer
|
|
335
337
|
if (expanded || interacting) {
|
|
336
338
|
this.timer.pause();
|
|
@@ -342,7 +344,7 @@ class NgpToast {
|
|
|
342
344
|
}
|
|
343
345
|
onPointerDown(event) {
|
|
344
346
|
// right click should not trigger swipe and we check if the toast is dismissible
|
|
345
|
-
if (event.button === 2 || !this.
|
|
347
|
+
if (event.button === 2 || !this.options.dismissible) {
|
|
346
348
|
return;
|
|
347
349
|
}
|
|
348
350
|
this.isInteracting.set(true);
|
|
@@ -357,7 +359,7 @@ class NgpToast {
|
|
|
357
359
|
this.pointerStartRef = { x: event.clientX, y: event.clientY };
|
|
358
360
|
}
|
|
359
361
|
onPointerMove(event) {
|
|
360
|
-
if (!this.pointerStartRef || !this.
|
|
362
|
+
if (!this.pointerStartRef || !this.options.dismissible) {
|
|
361
363
|
return;
|
|
362
364
|
}
|
|
363
365
|
const isHighlighted = window.getSelection()?.toString().length ?? 0 > 0;
|
|
@@ -366,7 +368,7 @@ class NgpToast {
|
|
|
366
368
|
}
|
|
367
369
|
const yDelta = event.clientY - this.pointerStartRef.y;
|
|
368
370
|
const xDelta = event.clientX - this.pointerStartRef.x;
|
|
369
|
-
const swipeDirections = this.
|
|
371
|
+
const swipeDirections = this.options.swipeDirections;
|
|
370
372
|
// Determine swipe direction if not already locked
|
|
371
373
|
if (!this.swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
372
374
|
this.swipeDirection.set(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');
|
|
@@ -438,7 +440,7 @@ class NgpToast {
|
|
|
438
440
|
this.swiping.set(false);
|
|
439
441
|
}
|
|
440
442
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
441
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpToast, isStandalone: true, selector: "[ngpToast]", host: { listeners: { "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp()" }, properties: { "attr.data-position-x": "x", "attr.data-position-y": "y", "attr.data-visible": "visible()", "attr.data-front": "index() === 0", "attr.data-swiping": "swiping()", "attr.data-swipe-direction": "swipeOutDirection()", "attr.data-expanded": "
|
|
443
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpToast, isStandalone: true, selector: "[ngpToast]", host: { listeners: { "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp()" }, properties: { "attr.data-position-x": "x", "attr.data-position-y": "y", "attr.data-visible": "visible()", "attr.data-front": "index() === 0", "attr.data-swiping": "swiping()", "attr.data-swipe-direction": "swipeOutDirection()", "attr.data-expanded": "options.expanded()", "style.--ngp-toast-gap.px": "config.gap", "style.--ngp-toast-z-index": "zIndex()", "style.--ngp-toasts-before": "index()", "style.--ngp-toast-index": "index() + 1", "style.--ngp-toast-width.px": "config.width", "style.--ngp-toast-height.px": "dimensions().height", "style.--ngp-toast-offset.px": "offset()", "style.--ngp-toast-front-height.px": "frontToastHeight()", "style.--ngp-toast-swipe-amount-x.px": "swipeAmount().x", "style.--ngp-toast-swipe-amount-y.px": "swipeAmount().y", "style.--ngp-toast-swipe-x": "swipeAmount().x", "style.--ngp-toast-swipe-y": "swipeAmount().y" } }, exportAs: ["ngpToast"], ngImport: i0 }); }
|
|
442
444
|
}
|
|
443
445
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToast, decorators: [{
|
|
444
446
|
type: Directive,
|
|
@@ -452,7 +454,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
452
454
|
'[attr.data-front]': 'index() === 0',
|
|
453
455
|
'[attr.data-swiping]': 'swiping()',
|
|
454
456
|
'[attr.data-swipe-direction]': 'swipeOutDirection()',
|
|
455
|
-
'[attr.data-expanded]': '
|
|
457
|
+
'[attr.data-expanded]': 'options.expanded()',
|
|
456
458
|
'[style.--ngp-toast-gap.px]': 'config.gap',
|
|
457
459
|
'[style.--ngp-toast-z-index]': 'zIndex()',
|
|
458
460
|
'[style.--ngp-toasts-before]': 'index()',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-context.ts","../../../../packages/ng-primitives/toast/src/toast/toast-options.ts","../../../../packages/ng-primitives/toast/src/toast/toast-manager.ts","../../../../packages/ng-primitives/toast/src/toast/toast-timer.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastSwipeDirection } from '../toast/toast';\n\nexport interface NgpToastConfig {\n /**\n * The duration of each toast.\n */\n duration: number;\n\n /**\n * The width of each toast in pixels.\n */\n width: number;\n\n /**\n * The offset from the top of the viewport in pixels.\n */\n offsetTop: number;\n\n /**\n * The offset from the bottom of the viewport in pixels.\n */\n offsetBottom: number;\n\n /**\n * The offset from the left of the viewport in pixels.\n */\n offsetLeft: number;\n\n /**\n * The offset from the right of the viewport in pixels.\n */\n offsetRight: number;\n\n /**\n * Whether a toast can be dismissed by swiping.\n */\n dismissible: boolean;\n\n /**\n * The amount a toast must be swiped before it is considered dismissed.\n */\n swipeThreshold: number;\n\n /**\n * The default swipe directions supported by the toast.\n */\n swipeDirections: NgpToastSwipeDirection[];\n\n /**\n * The maximum number of toasts that can be displayed at once.\n */\n maxToasts: number;\n\n /**\n * The aria live setting.\n */\n ariaLive: string;\n\n /**\n * The gap between each toast.\n */\n gap: number;\n\n /**\n * The z-index of the toast container.\n * This is used to ensure that the toast container is always on top of other elements.\n */\n zIndex: number;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 14,\n duration: 3000,\n width: 360,\n offsetTop: 24,\n offsetBottom: 24,\n offsetLeft: 24,\n offsetRight: 24,\n swipeThreshold: 45,\n swipeDirections: ['left', 'right', 'top', 'bottom'],\n dismissible: true,\n maxToasts: 3,\n zIndex: 9999999,\n ariaLive: 'polite',\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n return [\n {\n provide: NgpToastConfigToken,\n useValue: { ...defaultToastConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nconst NgpToastContext = new InjectionToken<unknown>('NgpToastContext');\n\nexport function provideToastContext<T>(context: T): ValueProvider {\n return { provide: NgpToastContext, useValue: context };\n}\n\nexport function injectToastContext<T>(): T {\n return inject(NgpToastContext) as T;\n}\n","import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\nimport type { NgpToast, NgpToastSwipeDirection } from './toast';\n\nconst NgpToastOptions = new InjectionToken<NgpToastOptions>('NgpToastOptions');\n\nexport function provideToastOptions(context: NgpToastOptions): ValueProvider {\n return { provide: NgpToastOptions, useValue: context };\n}\n\nexport function injectToastOptions(): NgpToastOptions {\n return inject(NgpToastOptions);\n}\n\nexport interface NgpToastOptions {\n /**\n * The position of the toast.\n */\n placement:\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'top-center'\n | 'bottom-center';\n /**\n * The duration of the toast in milliseconds.\n */\n duration: number;\n\n /**\n * A function to register the toast instance with the manager.\n * @internal\n */\n register: (toast: NgpToast) => void;\n\n /**\n * Whether the toast region is expanded.\n * @internal\n */\n expanded: Signal<boolean>;\n\n /**\n * Whether the toast supports swipe dismiss.\n * @internal\n */\n dismissible: boolean;\n\n /**\n * The swipe directions supported by the toast.\n * @internal\n */\n swipeDirections: NgpToastSwipeDirection[];\n}\n","import {\n ApplicationRef,\n computed,\n inject,\n Injectable,\n Injector,\n RendererFactory2,\n signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { createPortal, NgpPortal } from 'ng-primitives/portal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToast, NgpToastSwipeDirection } from './toast';\nimport { provideToastContext } from './toast-context';\nimport { provideToastOptions } from './toast-options';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpToastManager {\n private readonly config = injectToastConfig();\n private readonly applicationRef = inject(ApplicationRef);\n private readonly rendererFactory = inject(RendererFactory2);\n private readonly renderer = this.rendererFactory.createRenderer(null, null);\n private readonly injector = inject(Injector);\n // Map to store containers by placement\n private readonly containers = new Map<string, HTMLElement>();\n\n readonly toasts = signal<NgpToastRecord[]>([]);\n\n /** Signal that tracks which placements are expanded */\n private readonly expanded = signal<NgpToastPlacement[]>([]);\n\n /** Show a toast notification */\n show(toast: TemplateRef<void> | Type<unknown>, options: NgpToastOptions = {}): NgpToastRef {\n // services can't access the view container directly, so this is a workaround\n const viewContainerRef = this.applicationRef.components[0].injector.get(ViewContainerRef);\n\n let instance: NgpToast | null = null;\n const placement = options.placement ?? 'top-end';\n const container = this.getOrCreateContainer(placement);\n\n const portal = createPortal(\n toast,\n viewContainerRef,\n Injector.create({\n parent: this.injector,\n providers: [\n provideToastContext(options.context),\n provideToastOptions({\n placement,\n duration: options.duration ?? 5000,\n register: (toast: NgpToast) => (instance = toast),\n expanded: computed(() => this.expanded().includes(placement)),\n dismissible: options.dismissible ?? this.config.dismissible,\n swipeDirections: options.swipeDirections ?? this.config.swipeDirections,\n }),\n ],\n }),\n {\n // Hide the toast when the dismiss method is called\n dismiss: () => this.dismiss(instance!),\n context: options.context,\n },\n );\n\n portal.attach(container);\n\n // Add the toast to the list of toasts\n if (!instance) {\n throw new Error('A toast must have the NgpToast directive applied.');\n }\n\n this.toasts.update(toasts => [{ instance: instance!, portal }, ...toasts]);\n\n return {\n dismiss: () => this.dismiss(instance!),\n };\n }\n\n /** Hide a toast notification */\n async dismiss(toast: NgpToast): Promise<void> {\n const ref = this.toasts().find(t => t.instance === toast);\n\n if (ref) {\n // Detach the portal from the container\n await ref.portal.detach();\n\n // Remove the toast from the list of toasts\n this.toasts.update(toasts => toasts.filter(t => t !== ref));\n\n // if there are no more toasts, ensure the container is no longer considered expanded\n if (this.toasts().length === 0) {\n this.expanded.update(expanded => expanded.filter(p => p !== toast.context.placement));\n }\n }\n }\n\n /**\n * Lazily create or get a container for a given placement.\n */\n private getOrCreateContainer(placement: string): HTMLElement {\n if (this.containers.has(placement)) {\n return this.containers.get(placement)!;\n }\n const container = this.createContainer(placement);\n this.containers.set(placement, container);\n return container;\n }\n\n /**\n * Create a section in which toasts will be rendered for a specific placement.\n */\n private createContainer(placement: string): HTMLElement {\n const container = this.renderer.createElement('section') as HTMLElement;\n this.renderer.setAttribute(container, 'aria-live', this.config.ariaLive);\n this.renderer.setAttribute(container, 'aria-atomic', 'false');\n this.renderer.setAttribute(container, 'tabindex', '-1');\n this.renderer.setAttribute(container, 'data-ngp-toast-container', placement);\n\n container.style.setProperty('position', 'fixed');\n container.style.setProperty('z-index', `${this.config.zIndex}`);\n container.style.setProperty('width', `${this.config.width}px`);\n\n container.style.setProperty('--ngp-toast-offset-top', `${this.config.offsetTop}px`);\n container.style.setProperty('--ngp-toast-offset-bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('--ngp-toast-offset-left', `${this.config.offsetLeft}px`);\n container.style.setProperty('--ngp-toast-offset-right', `${this.config.offsetRight}px`);\n container.style.setProperty('--ngp-toast-gap', `${this.config.gap}px`);\n container.style.setProperty('--ngp-toast-width', `${this.config.width}px`);\n\n // mark the container as expanded\n this.renderer.listen(container, 'mouseenter', () =>\n this.expanded.update(expanded => [...expanded, placement as NgpToastPlacement]),\n );\n\n this.renderer.listen(container, 'mouseleave', () => {\n this.expanded.update(expanded =>\n expanded.filter(p => p !== (placement as NgpToastPlacement)),\n );\n });\n\n // Set placement styles\n switch (placement) {\n case 'top-start':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'top-center':\n container.style.setProperty('top', '0');\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'top-end':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n case 'bottom-start':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'bottom-center':\n container.style.setProperty('bottom', '0');\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'bottom-end':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n default:\n throw new Error(`Unknown toast placement: ${placement}`);\n }\n\n this.renderer.appendChild(document.body, container);\n return container;\n }\n}\n\nexport type NgpToastPlacement =\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center';\n\nexport interface NgpToastOptions<T = unknown> {\n /** The position of the toast */\n placement?: NgpToastPlacement;\n\n /** The duration of the toast in milliseconds */\n duration?: number;\n\n /** Whether the toast is dismissible */\n dismissible?: boolean;\n\n /** The swipe directions supported by the toast */\n swipeDirections?: NgpToastSwipeDirection[];\n\n /** The context to make available to the toast */\n context?: T;\n}\n\ninterface NgpToastRecord {\n instance: NgpToast;\n portal: NgpPortal;\n}\n\ninterface NgpToastRef {\n dismiss(): Promise<void>;\n}\n","class NgpToastTimer {\n private startTime: number | null = null;\n private remaining: number;\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n private isRunning = false;\n\n constructor(\n private duration: number,\n private callback: () => void,\n ) {\n this.remaining = duration;\n }\n\n start(): void {\n if (this.isRunning) return;\n\n this.isRunning = true;\n this.startTime = Date.now();\n\n this.timeoutId = setTimeout(() => {\n this.isRunning = false;\n this.callback();\n }, this.remaining);\n }\n\n pause(): void {\n if (!this.isRunning || this.startTime === null) return;\n\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n\n const elapsed = Date.now() - this.startTime;\n this.remaining -= elapsed;\n this.startTime = null;\n this.timeoutId = null;\n }\n\n stop(): void {\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n this.timeoutId = null;\n this.startTime = null;\n this.remaining = this.duration;\n }\n}\n\nexport function toastTimer(duration: number, callback: () => void): NgpToastTimer {\n return new NgpToastTimer(duration, callback);\n}\n","import { InteractivityChecker } from '@angular/cdk/a11y';\nimport {\n afterNextRender,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n signal,\n} from '@angular/core';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectDimensions } from 'ng-primitives/utils';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastManager } from './toast-manager';\nimport { injectToastOptions } from './toast-options';\nimport { toastTimer } from './toast-timer';\n\n@Directive({\n selector: '[ngpToast]',\n exportAs: 'ngpToast',\n host: {\n '[attr.data-position-x]': 'x',\n '[attr.data-position-y]': 'y',\n '[attr.data-visible]': 'visible()',\n '[attr.data-front]': 'index() === 0',\n '[attr.data-swiping]': 'swiping()',\n '[attr.data-swipe-direction]': 'swipeOutDirection()',\n '[attr.data-expanded]': 'context.expanded()',\n '[style.--ngp-toast-gap.px]': 'config.gap',\n '[style.--ngp-toast-z-index]': 'zIndex()',\n '[style.--ngp-toasts-before]': 'index()',\n '[style.--ngp-toast-index]': 'index() + 1',\n '[style.--ngp-toast-width.px]': 'config.width',\n '[style.--ngp-toast-height.px]': 'dimensions().height',\n '[style.--ngp-toast-offset.px]': 'offset()',\n '[style.--ngp-toast-front-height.px]': 'frontToastHeight()',\n '[style.--ngp-toast-swipe-amount-x.px]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-amount-y.px]': 'swipeAmount().y',\n '[style.--ngp-toast-swipe-x]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-y]': 'swipeAmount().y',\n },\n})\nexport class NgpToast {\n private readonly manager = inject(NgpToastManager);\n private readonly injector = inject(Injector);\n protected readonly config = injectToastConfig();\n /** @internal */\n readonly context = injectToastOptions();\n private readonly interactivityChecker = inject(InteractivityChecker);\n private readonly isInteracting = signal(false);\n\n private pointerStartRef: { x: number; y: number } | null = null;\n private dragStartTime: Date | null = null;\n protected readonly swiping = signal(false);\n protected readonly swipeDirection = signal<'x' | 'y' | null>(null);\n protected readonly swipeAmount = signal({ x: 0, y: 0 });\n\n protected readonly swipeOutDirection = computed(() => {\n const direction = this.swipeDirection();\n if (direction === 'x') {\n return this.swipeAmount().x > 0 ? 'right' : 'left';\n } else if (direction === 'y') {\n return this.swipeAmount().y > 0 ? 'bottom' : 'top';\n }\n return null;\n });\n\n /**\n * Get all toasts that are currently being displayed in the same position.\n */\n private readonly toasts = computed(() =>\n this.manager\n .toasts()\n .filter(toast => toast.instance.context.placement === this.context.placement),\n );\n\n /**\n * The number of toasts that are currently being displayed before this toast.\n */\n protected readonly index = computed(() => {\n return this.toasts().findIndex(toast => toast.instance === this);\n });\n\n /**\n * Determine the position of the toast in the list of toasts.\n * This is the combination of the heights of all the toasts before this one, plus the gap between them.\n */\n protected readonly offset = computed(() => {\n const gap = this.config.gap;\n\n return this.toasts()\n .slice(0, this.index())\n .reduce((acc, toast) => acc + toast.instance.dimensions().height + gap, 0);\n });\n\n /**\n * Determine if this toast is visible.\n * Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed.\n */\n protected readonly visible = computed(() => {\n const maxToasts = this.config.maxToasts;\n // determine if this toast is within the maximum number of toasts that can be displayed\n return this.index() < maxToasts || this.toasts().length <= maxToasts;\n });\n\n /**\n * Determine the height of the front toast.\n * This is used to determine the height of the toast when it is not expanded.\n */\n protected readonly frontToastHeight = computed(() => {\n // get the first toast in the list with height - as when a new toast is added, it may not initially have dimensions\n return (\n this.toasts()\n .find(toast => toast.instance.dimensions().height)\n ?.instance.dimensions().height || 0\n );\n });\n\n /**\n * Determine the z-index of the toast. This is the inverse of the index.\n * The first toast will have the highest z-index, and the last toast will have the lowest z-index.\n * This is used to ensure that the first toast is always on top of the others.\n */\n protected readonly zIndex = computed(() => this.toasts().length - this.index());\n\n /**\n * The height of the toast in pixels.\n */\n protected readonly dimensions = injectDimensions();\n\n /**\n * The x position of the toast.\n */\n readonly x = this.context.placement.split('-')[1] || 'end';\n\n /**\n * The y position of the toast.\n */\n readonly y = this.context.placement.split('-')[0] || 'top';\n\n /**\n * The toast timer instance.\n */\n private readonly timer = toastTimer(this.config.duration, () => this.manager.dismiss(this));\n\n constructor() {\n this.context.register(this);\n\n // Start the timer when the toast is created\n this.timer.start();\n\n // Pause the timer when the toast is expanded or when the user is interacting with it\n explicitEffect([this.context.expanded, this.isInteracting], ([expanded, interacting]) => {\n // If the toast is expanded, or if the user is interacting with it, reset the timer\n if (expanded || interacting) {\n this.timer.pause();\n } else {\n this.timer.start();\n }\n });\n }\n\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // right click should not trigger swipe and we check if the toast is dismissible\n if (event.button === 2 || !this.context.dismissible) {\n return;\n }\n\n this.isInteracting.set(true);\n\n // we need to check if the pointer is on an interactive element, if so, we should not start swiping\n if (this.interactivityChecker.isFocusable(event.target as HTMLElement)) {\n return;\n }\n\n this.dragStartTime = new Date();\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n this.swiping.set(true);\n this.pointerStartRef = { x: event.clientX, y: event.clientY };\n }\n\n @HostListener('pointermove', ['$event'])\n protected onPointerMove(event: PointerEvent): void {\n if (!this.pointerStartRef || !this.context.dismissible) {\n return;\n }\n\n const isHighlighted = window.getSelection()?.toString().length ?? 0 > 0;\n\n if (isHighlighted) {\n return;\n }\n\n const yDelta = event.clientY - this.pointerStartRef.y;\n const xDelta = event.clientX - this.pointerStartRef.x;\n\n const swipeDirections = this.context.swipeDirections;\n\n // Determine swipe direction if not already locked\n if (!this.swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n this.swipeDirection.set(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n }\n\n const swipeAmount = { x: 0, y: 0 };\n\n const getDampening = (delta: number) => {\n const factor = Math.abs(delta) / 20;\n\n return 1 / (1.5 + factor);\n };\n\n // Only apply swipe in the locked direction\n if (this.swipeDirection() === 'y') {\n // Handle vertical swipes\n if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n if (\n (swipeDirections.includes('top') && yDelta < 0) ||\n (swipeDirections.includes('bottom') && yDelta > 0)\n ) {\n swipeAmount.y = yDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = yDelta * getDampening(yDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;\n }\n }\n } else if (this.swipeDirection() === 'x') {\n // Handle horizontal swipes\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n if (\n (swipeDirections.includes('left') && xDelta < 0) ||\n (swipeDirections.includes('right') && xDelta > 0)\n ) {\n swipeAmount.x = xDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = xDelta * getDampening(xDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;\n }\n }\n }\n\n this.swipeAmount.set({ x: swipeAmount.x, y: swipeAmount.y });\n\n if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n this.swiping.set(true);\n }\n }\n\n @HostListener('pointerup')\n protected onPointerUp(): void {\n this.isInteracting.set(false);\n\n if (\n !this.config.dismissible ||\n !this.pointerStartRef ||\n !this.swiping() ||\n !this.dragStartTime\n ) {\n return;\n }\n\n this.pointerStartRef = null;\n\n const swipeAmountX = this.swipeAmount().x;\n const swipeAmountY = this.swipeAmount().y;\n const timeTaken = new Date().getTime() - this.dragStartTime.getTime();\n\n const swipeAmount = this.swipeDirection() === 'x' ? swipeAmountX : swipeAmountY;\n const velocity = Math.abs(swipeAmount) / timeTaken;\n\n if (Math.abs(swipeAmount) >= this.config.swipeThreshold || velocity > 0.11) {\n afterNextRender({ write: () => this.manager.dismiss(this) }, { injector: this.injector });\n return;\n } else {\n this.swipeAmount.set({ x: 0, y: 0 });\n }\n\n // Reset swipe state\n this.swipeDirection.set(null);\n this.swiping.set(false);\n }\n}\n\nexport type NgpToastSwipeDirection = 'top' | 'right' | 'bottom' | 'left';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAuEO,MAAM,kBAAk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AChD,wBAAA,6BAA6B,EAAE,iBAAiB;AACjD,qBAAA;AACF,iBAAA;wDA0HW,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;gBAsB7B,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;gBAuE7B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW;;;AC7P3B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-context.ts","../../../../packages/ng-primitives/toast/src/toast/toast-options.ts","../../../../packages/ng-primitives/toast/src/toast/toast-manager.ts","../../../../packages/ng-primitives/toast/src/toast/toast-timer.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastPlacement, NgpToastSwipeDirection } from '../toast/toast';\n\nexport interface NgpToastConfig {\n /**\n * The position of the toast.\n */\n placement: NgpToastPlacement;\n\n /**\n * The duration of each toast.\n */\n duration: number;\n\n /**\n * The width of each toast in pixels.\n */\n width: number;\n\n /**\n * The offset from the top of the viewport in pixels.\n */\n offsetTop: number;\n\n /**\n * The offset from the bottom of the viewport in pixels.\n */\n offsetBottom: number;\n\n /**\n * The offset from the left of the viewport in pixels.\n */\n offsetLeft: number;\n\n /**\n * The offset from the right of the viewport in pixels.\n */\n offsetRight: number;\n\n /**\n * Whether a toast can be dismissed by swiping.\n */\n dismissible: boolean;\n\n /**\n * The amount a toast must be swiped before it is considered dismissed.\n */\n swipeThreshold: number;\n\n /**\n * The default swipe directions supported by the toast.\n */\n swipeDirections: NgpToastSwipeDirection[];\n\n /**\n * The maximum number of toasts that can be displayed at once.\n */\n maxToasts: number;\n\n /**\n * The aria live setting.\n */\n ariaLive: string;\n\n /**\n * The gap between each toast.\n */\n gap: number;\n\n /**\n * The z-index of the toast container.\n * This is used to ensure that the toast container is always on top of other elements.\n */\n zIndex: number;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 14,\n duration: 3000,\n width: 360,\n placement: 'top-end',\n offsetTop: 24,\n offsetBottom: 24,\n offsetLeft: 24,\n offsetRight: 24,\n swipeThreshold: 45,\n swipeDirections: ['left', 'right', 'top', 'bottom'],\n dismissible: true,\n maxToasts: 3,\n zIndex: 9999999,\n ariaLive: 'polite',\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n return [\n {\n provide: NgpToastConfigToken,\n useValue: { ...defaultToastConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nconst NgpToastContext = new InjectionToken<unknown>('NgpToastContext');\n\nexport function provideToastContext<T>(context: T): ValueProvider {\n return { provide: NgpToastContext, useValue: context };\n}\n\nexport function injectToastContext<T>(): T {\n return inject(NgpToastContext) as T;\n}\n","import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\nimport type { NgpToast, NgpToastSwipeDirection, NgpToastPlacement } from './toast';\n\nconst NgpToastOptions = new InjectionToken<NgpToastOptions>('NgpToastOptions');\n\nexport function provideToastOptions(context: NgpToastOptions): ValueProvider {\n return { provide: NgpToastOptions, useValue: context };\n}\n\nexport function injectToastOptions(): NgpToastOptions {\n return inject(NgpToastOptions);\n}\n\nexport interface NgpToastOptions {\n /**\n * The position of the toast.\n */\n placement: NgpToastPlacement;\n\n /**\n * The duration of the toast in milliseconds.\n */\n duration: number;\n\n /**\n * A function to register the toast instance with the manager.\n * @internal\n */\n register: (toast: NgpToast) => void;\n\n /**\n * Whether the toast region is expanded.\n * @internal\n */\n expanded: Signal<boolean>;\n\n /**\n * Whether the toast supports swipe dismiss.\n * @internal\n */\n dismissible: boolean;\n\n /**\n * The swipe directions supported by the toast.\n * @internal\n */\n swipeDirections: NgpToastSwipeDirection[];\n}\n","import {\n ApplicationRef,\n computed,\n inject,\n Injectable,\n Injector,\n RendererFactory2,\n signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { createPortal, NgpPortal } from 'ng-primitives/portal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToast, NgpToastPlacement, NgpToastSwipeDirection } from './toast';\nimport { provideToastContext } from './toast-context';\nimport { provideToastOptions } from './toast-options';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpToastManager {\n private readonly config = injectToastConfig();\n private readonly applicationRef = inject(ApplicationRef);\n private readonly rendererFactory = inject(RendererFactory2);\n private readonly renderer = this.rendererFactory.createRenderer(null, null);\n private readonly injector = inject(Injector);\n // Map to store containers by placement\n private readonly containers = new Map<string, HTMLElement>();\n\n readonly toasts = signal<NgpToastRecord[]>([]);\n\n /** Signal that tracks which placements are expanded */\n private readonly expanded = signal<NgpToastPlacement[]>([]);\n\n /** Show a toast notification */\n show(toast: TemplateRef<void> | Type<unknown>, options: NgpToastOptions = {}): NgpToastRef {\n // services can't access the view container directly, so this is a workaround\n const viewContainerRef = this.applicationRef.components[0].injector.get(ViewContainerRef);\n\n let instance: NgpToast | null = null;\n const placement = options.placement ?? this.config.placement;\n const duration = options.duration ?? this.config.duration;\n const container = this.getOrCreateContainer(placement);\n\n const portal = createPortal(\n toast,\n viewContainerRef,\n Injector.create({\n parent: this.injector,\n providers: [\n provideToastContext(options.context),\n provideToastOptions({\n placement,\n duration,\n register: (toast: NgpToast) => (instance = toast),\n expanded: computed(() => this.expanded().includes(placement)),\n dismissible: options.dismissible ?? this.config.dismissible,\n swipeDirections: options.swipeDirections ?? this.config.swipeDirections,\n }),\n ],\n }),\n {\n // Hide the toast when the dismiss method is called\n dismiss: () => this.dismiss(instance!),\n context: options.context,\n },\n );\n\n portal.attach(container);\n\n // Add the toast to the list of toasts\n if (!instance) {\n throw new Error('A toast must have the NgpToast directive applied.');\n }\n\n this.toasts.update(toasts => [{ instance: instance!, portal }, ...toasts]);\n\n return {\n dismiss: () => this.dismiss(instance!),\n };\n }\n\n /** Hide a toast notification */\n async dismiss(toast: NgpToast): Promise<void> {\n const ref = this.toasts().find(t => t.instance === toast);\n\n if (ref) {\n // Detach the portal from the container\n await ref.portal.detach();\n\n // Remove the toast from the list of toasts\n this.toasts.update(toasts => toasts.filter(t => t !== ref));\n\n // if there are no more toasts, ensure the container is no longer considered expanded\n if (this.toasts().length === 0) {\n this.expanded.update(expanded => expanded.filter(p => p !== toast.options.placement));\n }\n }\n }\n\n /**\n * Lazily create or get a container for a given placement.\n */\n private getOrCreateContainer(placement: string): HTMLElement {\n if (this.containers.has(placement)) {\n return this.containers.get(placement)!;\n }\n const container = this.createContainer(placement);\n this.containers.set(placement, container);\n return container;\n }\n\n /**\n * Create a section in which toasts will be rendered for a specific placement.\n */\n private createContainer(placement: string): HTMLElement {\n const container = this.renderer.createElement('section') as HTMLElement;\n this.renderer.setAttribute(container, 'aria-live', this.config.ariaLive);\n this.renderer.setAttribute(container, 'aria-atomic', 'false');\n this.renderer.setAttribute(container, 'tabindex', '-1');\n this.renderer.setAttribute(container, 'data-ngp-toast-container', placement);\n\n container.style.setProperty('position', 'fixed');\n container.style.setProperty('z-index', `${this.config.zIndex}`);\n container.style.setProperty('width', `${this.config.width}px`);\n\n container.style.setProperty('--ngp-toast-offset-top', `${this.config.offsetTop}px`);\n container.style.setProperty('--ngp-toast-offset-bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('--ngp-toast-offset-left', `${this.config.offsetLeft}px`);\n container.style.setProperty('--ngp-toast-offset-right', `${this.config.offsetRight}px`);\n container.style.setProperty('--ngp-toast-gap', `${this.config.gap}px`);\n container.style.setProperty('--ngp-toast-width', `${this.config.width}px`);\n\n // mark the container as expanded\n this.renderer.listen(container, 'mouseenter', () =>\n this.expanded.update(expanded => [...expanded, placement as NgpToastPlacement]),\n );\n\n this.renderer.listen(container, 'mouseleave', () => {\n this.expanded.update(expanded =>\n expanded.filter(p => p !== (placement as NgpToastPlacement)),\n );\n });\n\n // Set placement styles\n switch (placement) {\n case 'top-start':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'top-center':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'top-end':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n case 'bottom-start':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'bottom-center':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'bottom-end':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n default:\n throw new Error(`Unknown toast placement: ${placement}`);\n }\n\n this.renderer.appendChild(document.body, container);\n return container;\n }\n}\n\nexport interface NgpToastOptions<T = unknown> {\n /** The position of the toast */\n placement?: NgpToastPlacement;\n\n /** The duration of the toast in milliseconds */\n duration?: number;\n\n /** Whether the toast is dismissible */\n dismissible?: boolean;\n\n /** The swipe directions supported by the toast */\n swipeDirections?: NgpToastSwipeDirection[];\n\n /** The context to make available to the toast */\n context?: T;\n}\n\ninterface NgpToastRecord {\n instance: NgpToast;\n portal: NgpPortal;\n}\n\ninterface NgpToastRef {\n dismiss(): Promise<void>;\n}\n","class NgpToastTimer {\n private startTime: number | null = null;\n private remaining: number;\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n private isRunning = false;\n\n constructor(\n private duration: number,\n private callback: () => void,\n ) {\n this.remaining = duration;\n }\n\n start(): void {\n if (this.isRunning) return;\n\n this.isRunning = true;\n this.startTime = Date.now();\n\n this.timeoutId = setTimeout(() => {\n this.isRunning = false;\n this.callback();\n }, this.remaining);\n }\n\n pause(): void {\n if (!this.isRunning || this.startTime === null) return;\n\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n\n const elapsed = Date.now() - this.startTime;\n this.remaining -= elapsed;\n this.startTime = null;\n this.timeoutId = null;\n }\n\n stop(): void {\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n this.timeoutId = null;\n this.startTime = null;\n this.remaining = this.duration;\n }\n}\n\nexport function toastTimer(duration: number, callback: () => void): NgpToastTimer {\n return new NgpToastTimer(duration, callback);\n}\n","import { InteractivityChecker } from '@angular/cdk/a11y';\nimport {\n afterNextRender,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n signal,\n} from '@angular/core';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectDimensions } from 'ng-primitives/utils';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastManager } from './toast-manager';\nimport { injectToastOptions } from './toast-options';\nimport { toastTimer } from './toast-timer';\n\n@Directive({\n selector: '[ngpToast]',\n exportAs: 'ngpToast',\n host: {\n '[attr.data-position-x]': 'x',\n '[attr.data-position-y]': 'y',\n '[attr.data-visible]': 'visible()',\n '[attr.data-front]': 'index() === 0',\n '[attr.data-swiping]': 'swiping()',\n '[attr.data-swipe-direction]': 'swipeOutDirection()',\n '[attr.data-expanded]': 'options.expanded()',\n '[style.--ngp-toast-gap.px]': 'config.gap',\n '[style.--ngp-toast-z-index]': 'zIndex()',\n '[style.--ngp-toasts-before]': 'index()',\n '[style.--ngp-toast-index]': 'index() + 1',\n '[style.--ngp-toast-width.px]': 'config.width',\n '[style.--ngp-toast-height.px]': 'dimensions().height',\n '[style.--ngp-toast-offset.px]': 'offset()',\n '[style.--ngp-toast-front-height.px]': 'frontToastHeight()',\n '[style.--ngp-toast-swipe-amount-x.px]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-amount-y.px]': 'swipeAmount().y',\n '[style.--ngp-toast-swipe-x]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-y]': 'swipeAmount().y',\n },\n})\nexport class NgpToast {\n private readonly manager = inject(NgpToastManager);\n private readonly injector = inject(Injector);\n protected readonly config = injectToastConfig();\n /** @internal */\n readonly options = injectToastOptions();\n private readonly interactivityChecker = inject(InteractivityChecker);\n private readonly isInteracting = signal(false);\n\n private pointerStartRef: { x: number; y: number } | null = null;\n private dragStartTime: Date | null = null;\n protected readonly swiping = signal(false);\n protected readonly swipeDirection = signal<'x' | 'y' | null>(null);\n protected readonly swipeAmount = signal({ x: 0, y: 0 });\n\n protected readonly swipeOutDirection = computed(() => {\n const direction = this.swipeDirection();\n if (direction === 'x') {\n return this.swipeAmount().x > 0 ? 'right' : 'left';\n } else if (direction === 'y') {\n return this.swipeAmount().y > 0 ? 'bottom' : 'top';\n }\n return null;\n });\n\n /**\n * Get all toasts that are currently being displayed in the same position.\n */\n private readonly toasts = computed(() =>\n this.manager\n .toasts()\n .filter(toast => toast.instance.options.placement === this.options.placement),\n );\n\n /**\n * The number of toasts that are currently being displayed before this toast.\n */\n protected readonly index = computed(() => {\n return this.toasts().findIndex(toast => toast.instance === this);\n });\n\n /**\n * Determine the position of the toast in the list of toasts.\n * This is the combination of the heights of all the toasts before this one, plus the gap between them.\n */\n protected readonly offset = computed(() => {\n const gap = this.config.gap;\n\n return this.toasts()\n .slice(0, this.index())\n .reduce((acc, toast) => acc + toast.instance.dimensions().height + gap, 0);\n });\n\n /**\n * Determine if this toast is visible.\n * Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed.\n */\n protected readonly visible = computed(() => {\n const maxToasts = this.config.maxToasts;\n // determine if this toast is within the maximum number of toasts that can be displayed\n return this.index() < maxToasts || this.toasts().length <= maxToasts;\n });\n\n /**\n * Determine the height of the front toast.\n * This is used to determine the height of the toast when it is not expanded.\n */\n protected readonly frontToastHeight = computed(() => {\n // get the first toast in the list with height - as when a new toast is added, it may not initially have dimensions\n return (\n this.toasts()\n .find(toast => toast.instance.dimensions().height)\n ?.instance.dimensions().height || 0\n );\n });\n\n /**\n * Determine the z-index of the toast. This is the inverse of the index.\n * The first toast will have the highest z-index, and the last toast will have the lowest z-index.\n * This is used to ensure that the first toast is always on top of the others.\n */\n protected readonly zIndex = computed(() => this.toasts().length - this.index());\n\n /**\n * The height of the toast in pixels.\n */\n protected readonly dimensions = injectDimensions();\n\n /**\n * The x position of the toast.\n */\n readonly x = this.options.placement.split('-')[1] || 'end';\n\n /**\n * The y position of the toast.\n */\n readonly y = this.options.placement.split('-')[0] || 'top';\n\n /**\n * The toast timer instance.\n */\n private readonly timer = toastTimer(this.options.duration, () => this.manager.dismiss(this));\n\n constructor() {\n this.options.register(this);\n\n // Start the timer when the toast is created\n this.timer.start();\n\n // Pause the timer when the toast is expanded or when the user is interacting with it\n explicitEffect([this.options.expanded, this.isInteracting], ([expanded, interacting]) => {\n // If the toast is expanded, or if the user is interacting with it, reset the timer\n if (expanded || interacting) {\n this.timer.pause();\n } else {\n this.timer.start();\n }\n });\n }\n\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // right click should not trigger swipe and we check if the toast is dismissible\n if (event.button === 2 || !this.options.dismissible) {\n return;\n }\n\n this.isInteracting.set(true);\n\n // we need to check if the pointer is on an interactive element, if so, we should not start swiping\n if (this.interactivityChecker.isFocusable(event.target as HTMLElement)) {\n return;\n }\n\n this.dragStartTime = new Date();\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n this.swiping.set(true);\n this.pointerStartRef = { x: event.clientX, y: event.clientY };\n }\n\n @HostListener('pointermove', ['$event'])\n protected onPointerMove(event: PointerEvent): void {\n if (!this.pointerStartRef || !this.options.dismissible) {\n return;\n }\n\n const isHighlighted = window.getSelection()?.toString().length ?? 0 > 0;\n\n if (isHighlighted) {\n return;\n }\n\n const yDelta = event.clientY - this.pointerStartRef.y;\n const xDelta = event.clientX - this.pointerStartRef.x;\n\n const swipeDirections = this.options.swipeDirections;\n\n // Determine swipe direction if not already locked\n if (!this.swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n this.swipeDirection.set(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n }\n\n const swipeAmount = { x: 0, y: 0 };\n\n const getDampening = (delta: number) => {\n const factor = Math.abs(delta) / 20;\n\n return 1 / (1.5 + factor);\n };\n\n // Only apply swipe in the locked direction\n if (this.swipeDirection() === 'y') {\n // Handle vertical swipes\n if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n if (\n (swipeDirections.includes('top') && yDelta < 0) ||\n (swipeDirections.includes('bottom') && yDelta > 0)\n ) {\n swipeAmount.y = yDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = yDelta * getDampening(yDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;\n }\n }\n } else if (this.swipeDirection() === 'x') {\n // Handle horizontal swipes\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n if (\n (swipeDirections.includes('left') && xDelta < 0) ||\n (swipeDirections.includes('right') && xDelta > 0)\n ) {\n swipeAmount.x = xDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = xDelta * getDampening(xDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;\n }\n }\n }\n\n this.swipeAmount.set({ x: swipeAmount.x, y: swipeAmount.y });\n\n if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n this.swiping.set(true);\n }\n }\n\n @HostListener('pointerup')\n protected onPointerUp(): void {\n this.isInteracting.set(false);\n\n if (\n !this.config.dismissible ||\n !this.pointerStartRef ||\n !this.swiping() ||\n !this.dragStartTime\n ) {\n return;\n }\n\n this.pointerStartRef = null;\n\n const swipeAmountX = this.swipeAmount().x;\n const swipeAmountY = this.swipeAmount().y;\n const timeTaken = new Date().getTime() - this.dragStartTime.getTime();\n\n const swipeAmount = this.swipeDirection() === 'x' ? swipeAmountX : swipeAmountY;\n const velocity = Math.abs(swipeAmount) / timeTaken;\n\n if (Math.abs(swipeAmount) >= this.config.swipeThreshold || velocity > 0.11) {\n afterNextRender({ write: () => this.manager.dismiss(this) }, { injector: this.injector });\n return;\n } else {\n this.swipeAmount.set({ x: 0, y: 0 });\n }\n\n // Reset swipe state\n this.swipeDirection.set(null);\n this.swiping.set(false);\n }\n}\n\nexport type NgpToastSwipeDirection = 'top' | 'right' | 'bottom' | 'left';\n\nexport type NgpToastPlacement =\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA4EO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,KAAK,EAAE,GAAG;AACV,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;IAClB,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACnD,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,Q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