@acorex/cdk 22.3.15 → 22.3.17

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.
@@ -391,9 +391,11 @@ class AXOverlayService {
391
391
  }
392
392
  // Get the host element
393
393
  const hostElement = this.getHostElement(instance);
394
- // Create backdrop if enabled
395
- if (options?.backdrop?.enabled) {
396
- backdropElement = this.createBackdrop(options, zToken.zIndex);
394
+ // Create backdrop if enabled. Mobile action sheets also get one: their dimming
395
+ // used to be a box-shadow spread, which paints the scrim but does not hit-test,
396
+ // so controls behind the sheet stayed clickable.
397
+ if (options?.backdrop?.enabled || this.needsActionSheetBackdrop(options)) {
398
+ backdropElement = this.createBackdrop(this.withActionSheetBackdrop(options), zToken.zIndex);
397
399
  }
398
400
  // If anchor options are provided, set up positioned overlay (for tooltips, popovers)
399
401
  if (options?.anchorOptions?.anchor) {
@@ -481,6 +483,30 @@ class AXOverlayService {
481
483
  bringToFront,
482
484
  };
483
485
  }
486
+ /**
487
+ * Mobile action sheets need a hit-testable scrim even when the caller did not
488
+ * ask for a backdrop. An explicit `backdrop.enabled: false` opts out.
489
+ */
490
+ needsActionSheetBackdrop(options) {
491
+ return !!options?.actionSheetStyle && this._platform.is('SM') && options?.backdrop?.enabled !== false;
492
+ }
493
+ /**
494
+ * Fills in the action-sheet scrim when the caller did not configure a backdrop.
495
+ * Outside-click closing stays with the popover (`clickOut`); this layer only
496
+ * intercepts hits so the page behind the sheet cannot be clicked.
497
+ */
498
+ withActionSheetBackdrop(options) {
499
+ if (!this.needsActionSheetBackdrop(options) || options?.backdrop?.enabled) {
500
+ return options;
501
+ }
502
+ return {
503
+ ...options,
504
+ backdrop: {
505
+ enabled: true,
506
+ background: true,
507
+ },
508
+ };
509
+ }
484
510
  /**
485
511
  * Creates a backdrop element.
486
512
  */
@@ -497,6 +523,8 @@ class AXOverlayService {
497
523
  backdrop.style.width = '100%';
498
524
  backdrop.style.height = '100%';
499
525
  backdrop.style.zIndex = String(zIndex);
526
+ backdrop.style.pointerEvents = 'auto';
527
+ backdrop.style.touchAction = 'none';
500
528
  if (options?.backdrop?.background) {
501
529
  backdrop.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
502
530
  }
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-cdk-overlay.mjs","sources":["../../../../packages/cdk/overlay/src/lib/overlay-animation.ts","../../../../packages/cdk/overlay/src/lib/overlay-visual-context.ts","../../../../packages/cdk/overlay/src/lib/overlay.types.ts","../../../../packages/cdk/overlay/src/lib/overlay.service.ts","../../../../packages/cdk/overlay/src/acorex-cdk-overlay.ts"],"sourcesContent":["export const AX_OVERLAY_DEFAULT_ENTER_ANIMATION = ['animate-animated', 'animate-fadeIn', 'animate-fast'];\nexport const AX_OVERLAY_DEFAULT_LEAVE_ANIMATION = ['animate-animated', 'animate-fadeOut', 'animate-2xfaster'];\n\nconst OVERLAY_ANIMATION_DURATION_CLASSES = [\n 'animate-2xfaster',\n 'animate-faster',\n 'animate-fast',\n 'animate-slow',\n 'animate-slower',\n 'animate-2xslower',\n] as const;\n\nconst OVERLAY_ANIMATION_NAME_CLASSES = ['animate-fadeIn', 'animate-fadeOut'] as const;\n\nexport type AXOverlayAnimation =\n | boolean\n | string[]\n | {\n enter?: string[];\n leave?: string[];\n };\n\nexport interface AXOverlayResolvedAnimation {\n enter: string[];\n leave: string[];\n}\n\n/**\n * Resolves overlay animation classes.\n * - omitted: no animation (opt-in at the overlay layer)\n * - `true`: default fade in/out\n * - `false` or `[]`: no animation\n * - `string[]`: custom enter classes only\n * - `{ enter, leave }`: omitted keys fall back to the default fade classes\n */\nexport function resolveOverlayAnimation(animation?: AXOverlayAnimation): AXOverlayResolvedAnimation {\n if (animation === undefined || animation === false) {\n return { enter: [], leave: [] };\n }\n\n if (animation === true) {\n return {\n enter: [...AX_OVERLAY_DEFAULT_ENTER_ANIMATION],\n leave: [...AX_OVERLAY_DEFAULT_LEAVE_ANIMATION],\n };\n }\n\n if (Array.isArray(animation)) {\n if (animation.length === 0) {\n return { enter: [], leave: [] };\n }\n return { enter: [...animation], leave: [] };\n }\n\n return {\n enter: animation.enter === undefined ? [...AX_OVERLAY_DEFAULT_ENTER_ANIMATION] : [...animation.enter],\n leave: animation.leave === undefined ? [...AX_OVERLAY_DEFAULT_LEAVE_ANIMATION] : [...animation.leave],\n };\n}\n\n/** Prefers the content/pane so transforms are not applied to the full-screen container. */\nexport function getOverlayAnimationTarget(container: HTMLElement): HTMLElement {\n const content = container.querySelector<HTMLElement>(':scope > .ax-overlay-content');\n if (content) return content;\n const pane = container.querySelector<HTMLElement>(':scope > .ax-overlay-pane');\n if (pane) return pane;\n return container;\n}\n\nexport function applyOverlayAnimationClasses(element: HTMLElement, classes: string[]): void {\n for (const cls of classes) {\n if (cls) {\n element.classList.add(cls);\n }\n }\n}\n\nexport function removeOverlayAnimationClasses(element: HTMLElement, classes: string[]): void {\n for (const cls of classes) {\n if (cls) {\n element.classList.remove(cls);\n }\n }\n}\n\nexport function prefersReducedMotion(documentRef: Document): boolean {\n return !!documentRef.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nexport function parseCssTimeList(value: string): number[] {\n return value.split(',').map((part) => {\n const trimmed = part.trim();\n if (trimmed.endsWith('ms')) {\n return Number.parseFloat(trimmed) || 0;\n }\n if (trimmed.endsWith('s')) {\n return (Number.parseFloat(trimmed) || 0) * 1000;\n }\n return 0;\n });\n}\n\n/** Maps theme duration utility classes to milliseconds (see tailwind-base). */\nexport function getAnimationDurationFromClasses(classes: string[]): number {\n if (classes.includes('animate-2xfaster')) return 250;\n if (classes.includes('animate-faster')) return 500;\n if (classes.includes('animate-fast')) return 800;\n if (classes.includes('animate-slow')) return 2000;\n if (classes.includes('animate-slower')) return 3000;\n if (classes.includes('animate-2xslower')) return 5000;\n return 500;\n}\n\nexport function getOverlayAnimationTimeout(\n element: HTMLElement,\n documentRef: Document,\n fallbackMs?: number,\n): number {\n if (fallbackMs !== undefined && fallbackMs > 0) {\n return fallbackMs + 32;\n }\n\n const style = documentRef.defaultView?.getComputedStyle(element);\n if (!style) return 0;\n\n const durations = parseCssTimeList(style.animationDuration);\n const delays = parseCssTimeList(style.animationDelay);\n const max = durations.reduce((longest, duration, index) => {\n return Math.max(longest, duration + (delays[index] ?? delays[0] ?? 0));\n }, 0);\n\n return max > 0 ? max + 32 : 0;\n}\n\nexport function playOverlayLeaveAnimation(\n element: HTMLElement,\n enter: string[],\n leave: string[],\n documentRef: Document,\n): Promise<void> {\n removeOverlayAnimationClasses(element, [\n ...enter,\n ...OVERLAY_ANIMATION_NAME_CLASSES,\n ...OVERLAY_ANIMATION_DURATION_CLASSES,\n ]);\n void element.offsetWidth;\n\n const leaveDurationMs = getAnimationDurationFromClasses(leave);\n applyOverlayAnimationClasses(element, leave);\n element.style.animationDuration = `${leaveDurationMs}ms`;\n\n return waitForOverlayAnimationEnd(element, documentRef, {\n fallbackMs: leaveDurationMs,\n animationName: 'fadeOut',\n });\n}\n\nexport function waitForOverlayAnimationEnd(\n element: HTMLElement,\n documentRef: Document,\n options?: { fallbackMs?: number; animationName?: string },\n): Promise<void> {\n return new Promise((resolve) => {\n const timeoutMs = getOverlayAnimationTimeout(element, documentRef, options?.fallbackMs);\n if (timeoutMs <= 0) {\n resolve();\n return;\n }\n\n let settled = false;\n const finish = () => {\n if (settled) return;\n settled = true;\n element.removeEventListener('animationend', onEnd);\n element.style.animationDuration = '';\n resolve();\n };\n const onEnd = (event: AnimationEvent) => {\n if (event.target !== element) return;\n if (options?.animationName && !event.animationName.toLowerCase().includes(options.animationName.toLowerCase())) {\n return;\n }\n finish();\n };\n\n element.addEventListener('animationend', onEnd);\n documentRef.defaultView?.setTimeout(finish, timeoutMs);\n });\n}\n","import { ElementRef } from '@angular/core';\n\nexport type AXOverlayVisualContextScope = 'full' | 'theme';\n\nexport interface AXOverlayVisualContext {\n appearance?: string;\n theme?: 'ax-light' | 'ax-dark';\n contrast?: string;\n size?: string;\n}\n\nexport const APPEARANCE_CLASSES = [\n 'ax-appearance-flat',\n 'ax-appearance-depth',\n 'ax-appearance-translucent',\n] as const;\n\nexport const THEME_CLASSES = ['ax-light', 'ax-dark'] as const;\n\nexport const CONTRAST_CLASSES = ['ax-contrast-enhanced', 'ax-contrast-high'] as const;\n\nexport const SIZE_CLASSES = ['ax-xs', 'ax-sm', 'ax-md', 'ax-lg', 'ax-xl'] as const;\n\nexport const MANAGED_OVERLAY_VISUAL_CLASSES = [\n ...APPEARANCE_CLASSES,\n ...THEME_CLASSES,\n ...CONTRAST_CLASSES,\n ...SIZE_CLASSES,\n] as const;\n\n/**\n * Resolves the nearest effective visual context from an anchor or context source.\n * Theme uses nearest ax-light / ax-dark so nested Light overrides Dark ancestors.\n */\nexport function resolveVisualContext(\n source: HTMLElement | null | undefined,\n fallbackRoot?: HTMLElement | null,\n): AXOverlayVisualContext {\n const context: AXOverlayVisualContext = {};\n const root = fallbackRoot ?? (typeof document !== 'undefined' ? document.documentElement : null);\n\n let node: HTMLElement | null = source ?? root;\n while (node) {\n if (!context.appearance) {\n for (const cls of APPEARANCE_CLASSES) {\n if (node.classList.contains(cls)) {\n context.appearance = cls;\n break;\n }\n }\n }\n\n if (!context.contrast) {\n for (const cls of CONTRAST_CLASSES) {\n if (node.classList.contains(cls)) {\n context.contrast = cls;\n break;\n }\n }\n }\n\n if (!context.size) {\n for (const cls of SIZE_CLASSES) {\n if (node.classList.contains(cls)) {\n context.size = cls;\n break;\n }\n }\n\n if (!context.size && typeof getComputedStyle !== 'undefined') {\n const computedSize = getComputedStyle(node).getPropertyValue('--ax-sys-size').trim();\n if (SIZE_CLASSES.includes(computedSize as (typeof SIZE_CLASSES)[number])) {\n context.size = computedSize;\n }\n }\n }\n\n if (!context.theme) {\n if (node.classList.contains('ax-light')) {\n context.theme = 'ax-light';\n } else if (node.classList.contains('ax-dark')) {\n context.theme = 'ax-dark';\n }\n }\n\n node = node.parentElement;\n }\n\n if (!context.theme && root) {\n if (root.classList.contains('ax-light')) {\n context.theme = 'ax-light';\n } else if (root.classList.contains('ax-dark')) {\n context.theme = 'ax-dark';\n }\n }\n\n return context;\n}\n\n/** Applies resolved visual context classes to an overlay container. */\nexport function applyVisualContext(\n target: HTMLElement,\n context: AXOverlayVisualContext,\n scope: AXOverlayVisualContextScope = 'full',\n): void {\n for (const cls of MANAGED_OVERLAY_VISUAL_CLASSES) {\n target.classList.remove(cls);\n }\n\n if (scope === 'full' && context.appearance) {\n target.classList.add(context.appearance);\n }\n if (context.theme) {\n target.classList.add(context.theme);\n }\n if (scope === 'full' && context.contrast) {\n target.classList.add(context.contrast);\n }\n if (context.size) {\n target.classList.add(context.size);\n }\n}\n\nexport function resolveContextElement(\n contextElement: HTMLElement | ElementRef<HTMLElement> | undefined,\n anchor: HTMLElement | ElementRef<HTMLElement> | undefined,\n fallbackRoot: HTMLElement,\n): HTMLElement {\n if (contextElement) {\n return contextElement instanceof ElementRef ? contextElement.nativeElement : contextElement;\n }\n if (anchor) {\n return anchor instanceof ElementRef ? anchor.nativeElement : anchor;\n }\n return fallbackRoot;\n}\n","import { AXConnectedPosition, AXPlacement, AXPlacementType } from '@acorex/cdk/common';\nimport { AXComponentOptions } from '@acorex/core/components';\nimport { AXZToken } from '@acorex/core/z-index';\nimport { ComponentRef, ElementRef, EmbeddedViewRef } from '@angular/core';\nimport type { AXOverlayAnimation } from './overlay-animation';\nimport type { AXOverlayVisualContextScope } from './overlay-visual-context';\n\nexport interface AXOverlayRef<T> {\n instance: EmbeddedViewRef<T> | ComponentRef<T>;\n /** Updates the overlay position relative to the anchor */\n updatePosition: () => void;\n /** Destroys the overlay. DOM removal waits for a leave animation when one is configured. */\n dispose: () => void;\n /** The overlay container element */\n overlayElement: HTMLElement | null;\n /** The backdrop element if one was created */\n backdropElement: HTMLElement | null;\n /** The z-index token for this overlay */\n zToken: AXZToken | null;\n /** Brings this overlay to the front of all other overlays */\n bringToFront: () => void;\n}\n\nexport interface AXOverlayAnchorOptions {\n /** The anchor element to position relative to */\n anchor: HTMLElement | ElementRef<HTMLElement>;\n /** Placement of the overlay relative to the anchor */\n placement?: AXPlacementType;\n /** Horizontal offset in pixels */\n offsetX?: number;\n /** Vertical offset in pixels */\n offsetY?: number;\n /** Whether to flip the overlay when it overflows the viewport */\n autoFlip?: boolean;\n}\n\nexport interface AXOverlayOptions extends AXComponentOptions {\n backdrop?: {\n enabled?: boolean;\n background?: boolean;\n backdropClass?: string;\n closeOnClick?: boolean;\n };\n position?: AXPlacement;\n /** Anchor-based positioning options for tooltips, popovers, etc. */\n anchorOptions?: AXOverlayAnchorOptions;\n /** Custom CSS class for the overlay panel */\n panelClass?: string | string[];\n /**\n * Enter/leave animation applied to overlay content (`.ax-overlay-content` or `.ax-overlay-pane`),\n * not the full-screen container. Omitted: no animation. `true`: default fade in/out.\n * `false` or `[]`: disabled. A class array is enter-only. `{ enter, leave }` configures both.\n */\n animation?: AXOverlayAnimation;\n /** Whether to close when clicking outside */\n closeOnOutsideClick?: boolean;\n /** Whether to close when pressing Escape */\n closeOnEscape?: boolean;\n /** Width of the overlay container (e.g., 'auto', '200px', '100%') */\n width?: string;\n /** Dispose this overlay when Angular starts a navigation. Default: true. */\n closeOnNavigation?: boolean;\n /** Callback when the overlay is disposed (e.g., due to scroll) */\n onDispose?: () => void;\n /** Whether to use centered container (default: true). Set to false for positioned overlays like toasts */\n centered?: boolean;\n actionSheetStyle?: boolean;\n /** Base z-index for this overlay */\n zIndexBase?: number;\n /**\n * Visual context source for anchorless overlays (toast, dialog, notification).\n * Falls back to anchor, then document root.\n */\n contextElement?: HTMLElement | ElementRef<HTMLElement>;\n /**\n * Which visual context dimensions propagate to the overlay shell.\n * `theme` keeps light/dark (+ size) only; floating surfaces opt out of\n * appearance/contrast classes (popup, toast, dropdown).\n */\n visualContextScope?: AXOverlayVisualContextScope;\n}\n\n/**\n * Calculates the position of an overlay element relative to an anchor element.\n */\nexport function calculateAnchorPosition(\n anchorRect: DOMRect,\n overlayRect: DOMRect,\n position: AXConnectedPosition,\n): { top: number; left: number } {\n let left = 0;\n let top = 0;\n\n // Calculate origin point on anchor\n switch (position.originX) {\n case 'start':\n left = anchorRect.left;\n break;\n case 'center':\n left = anchorRect.left + anchorRect.width / 2;\n break;\n case 'end':\n left = anchorRect.right;\n break;\n }\n\n switch (position.originY) {\n case 'top':\n top = anchorRect.top;\n break;\n case 'center':\n top = anchorRect.top + anchorRect.height / 2;\n break;\n case 'bottom':\n top = anchorRect.bottom;\n break;\n }\n\n // Adjust for overlay alignment\n switch (position.overlayX) {\n case 'start':\n // left stays the same\n break;\n case 'center':\n left -= overlayRect.width / 2;\n break;\n case 'end':\n left -= overlayRect.width;\n break;\n }\n\n switch (position.overlayY) {\n case 'top':\n // top stays the same\n break;\n case 'center':\n top -= overlayRect.height / 2;\n break;\n case 'bottom':\n top -= overlayRect.height;\n break;\n }\n\n // Apply offsets\n if (position.offsetX) {\n left += position.offsetX;\n }\n if (position.offsetY) {\n top += position.offsetY;\n }\n\n return { top, left };\n}\n\n/**\n * Checks if the overlay position fits within the viewport.\n */\nexport function fitsInViewport(\n position: { top: number; left: number },\n overlayRect: DOMRect,\n viewportWidth: number,\n viewportHeight: number,\n): boolean {\n return (\n position.left >= 0 &&\n position.top >= 0 &&\n position.left + overlayRect.width <= viewportWidth &&\n position.top + overlayRect.height <= viewportHeight\n );\n}\n\n/**\n * Clamps a position to ensure the overlay stays within viewport bounds.\n */\nexport function clampToViewport(\n coords: { top: number; left: number },\n overlayRect: DOMRect,\n viewportWidth: number,\n viewportHeight: number,\n margin = 4,\n): { top: number; left: number } {\n const clampedLeft = Math.max(margin, Math.min(coords.left, viewportWidth - overlayRect.width - margin));\n const clampedTop = Math.max(margin, Math.min(coords.top, viewportHeight - overlayRect.height - margin));\n\n return { top: clampedTop, left: clampedLeft };\n}\n\n/**\n * Finds the best position for an overlay that fits in the viewport.\n */\nexport function findBestPosition(\n anchorRect: DOMRect,\n overlayRect: DOMRect,\n positions: AXConnectedPosition[],\n viewportWidth: number,\n viewportHeight: number,\n): { position: AXConnectedPosition; coords: { top: number; left: number } } {\n for (const position of positions) {\n const coords = calculateAnchorPosition(anchorRect, overlayRect, position);\n\n if (fitsInViewport(coords, overlayRect, viewportWidth, viewportHeight)) {\n return { position, coords };\n }\n }\n\n // Fallback to first position if none fit, but clamp to viewport bounds\n const fallbackCoords = calculateAnchorPosition(anchorRect, overlayRect, positions[0]);\n const clampedCoords = clampToViewport(fallbackCoords, overlayRect, viewportWidth, viewportHeight);\n return { position: positions[0], coords: clampedCoords };\n}\n","import { convertToPlacement } from '@acorex/cdk/common';\nimport { AXComponentContent, AXComponentService } from '@acorex/core/components';\nimport { AXPlatform } from '@acorex/core/platform';\nimport { AXZIndexService, AXZToken } from '@acorex/core/z-index';\nimport { DOCUMENT } from '@angular/common';\nimport { ComponentRef, ElementRef, EmbeddedViewRef, inject, Injectable, TemplateRef } from '@angular/core';\nimport { NavigationStart, Router } from '@angular/router';\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport {\n applyOverlayAnimationClasses,\n getOverlayAnimationTarget,\n playOverlayLeaveAnimation,\n prefersReducedMotion,\n resolveOverlayAnimation,\n} from './overlay-animation';\nimport { applyVisualContext, resolveContextElement, resolveVisualContext } from './overlay-visual-context';\nimport { AXOverlayOptions, AXOverlayRef, findBestPosition } from './overlay.types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXOverlayService {\n private componentService = inject(AXComponentService);\n private document = inject(DOCUMENT);\n private zIndexService = inject(AXZIndexService);\n private _platform: AXPlatform = inject(AXPlatform);\n private router = inject(Router, { optional: true });\n\n /**\n * Creates an overlay with optional anchor-based positioning.\n * @param content - Component or template to display\n * @param options - Configuration options for the overlay\n * @returns Promise<AXOverlayRef> - Reference to the created overlay\n */\n async create<T = unknown>(content: AXComponentContent<T>, options?: AXOverlayOptions): Promise<AXOverlayRef<T>> {\n let instance: EmbeddedViewRef<T> | ComponentRef<T>;\n let overlayContainer: HTMLElement | null = null;\n let backdropElement: HTMLElement | null = null;\n let isDisposed = false;\n let navigationSubscription: Subscription | null = null;\n\n // Acquire a z-index token for this overlay\n let zToken: AXZToken | null = this.zIndexService.acquire(options?.zIndexBase);\n\n if (content instanceof TemplateRef) {\n instance = this.componentService.createFromTemplate<T>(content);\n } else {\n instance = this.componentService.createFromComponent<T>(content);\n if (options?.inputs) {\n Object.entries(options.inputs).forEach((c) => {\n (instance as ComponentRef<T>).setInput(c[0], c[1]);\n });\n }\n }\n\n // Get the host element\n const hostElement = this.getHostElement(instance);\n\n // Create backdrop if enabled\n if (options?.backdrop?.enabled) {\n backdropElement = this.createBackdrop(options, zToken.zIndex);\n }\n\n // If anchor options are provided, set up positioned overlay (for tooltips, popovers)\n if (options?.anchorOptions?.anchor) {\n overlayContainer = this.createOverlayContainer(hostElement, options, zToken.zIndex);\n this.positionOverlay(overlayContainer, options);\n } else if (options?.centered === false) {\n // Non-centered positioned overlay (for toasts, notifications)\n overlayContainer = this.createOverlayContainer(hostElement, options, zToken.zIndex);\n } else {\n // No anchor - create centered overlay (for modals, popups)\n overlayContainer = this.createCenteredOverlayContainer(hostElement, options, zToken.zIndex);\n }\n\n const updatePosition = () => {\n if (overlayContainer && options?.anchorOptions?.anchor) {\n this.positionOverlay(overlayContainer, options);\n }\n };\n\n const animation = resolveOverlayAnimation(options?.animation);\n const reduceMotion = prefersReducedMotion(this.document);\n\n const dispose = () => {\n if (isDisposed) return;\n isDisposed = true;\n\n navigationSubscription?.unsubscribe();\n navigationSubscription = null;\n\n const finish = () => {\n backdropElement?.remove();\n overlayContainer?.remove();\n instance.destroy();\n this.zIndexService.release(zToken);\n zToken = null;\n options?.onDispose?.();\n };\n\n const animationTarget = overlayContainer ? getOverlayAnimationTarget(overlayContainer) : null;\n if (!animationTarget || !animation.leave.length || reduceMotion) {\n finish();\n return;\n }\n\n if (overlayContainer) {\n overlayContainer.style.pointerEvents = 'none';\n }\n if (backdropElement) {\n backdropElement.style.pointerEvents = 'none';\n }\n\n void playOverlayLeaveAnimation(animationTarget, animation.enter, animation.leave, this.document).finally(finish);\n };\n\n const bringToFront = () => {\n if (!zToken || isDisposed) return;\n zToken = this.zIndexService.bringToFront(zToken);\n if (backdropElement) {\n backdropElement.style.zIndex = String(zToken.zIndex);\n }\n if (overlayContainer) {\n overlayContainer.style.zIndex = String(zToken.zIndex);\n }\n };\n\n // Set up backdrop click handler\n if (backdropElement && options?.backdrop?.closeOnClick) {\n backdropElement.addEventListener('click', () => {\n dispose();\n });\n }\n\n if (options?.closeOnNavigation !== false && this.router) {\n navigationSubscription = this.router.events\n .pipe(filter((event): event is NavigationStart => event instanceof NavigationStart))\n .subscribe(() => {\n dispose();\n });\n }\n\n this.applyOverlayVisualContext(options, overlayContainer);\n\n const animationTarget = overlayContainer ? getOverlayAnimationTarget(overlayContainer) : null;\n if (animationTarget && animation.enter.length && !reduceMotion) {\n applyOverlayAnimationClasses(animationTarget, animation.enter);\n }\n\n return {\n instance,\n updatePosition,\n dispose,\n overlayElement: overlayContainer,\n backdropElement,\n zToken,\n bringToFront,\n };\n }\n\n /**\n * Creates a backdrop element.\n */\n private createBackdrop(options: AXOverlayOptions | undefined, zIndex: number): HTMLElement {\n const backdrop = this.document.createElement('div');\n backdrop.classList.add('ax-overlay-backdrop');\n\n if (options?.backdrop?.backdropClass) {\n backdrop.classList.add(options.backdrop.backdropClass);\n }\n\n // Style the backdrop\n backdrop.style.position = 'fixed';\n backdrop.style.top = '0';\n backdrop.style.left = '0';\n backdrop.style.width = '100%';\n backdrop.style.height = '100%';\n backdrop.style.zIndex = String(zIndex);\n\n if (options?.backdrop?.background) {\n backdrop.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';\n }\n\n this.document.body.appendChild(backdrop);\n return backdrop;\n }\n\n /**\n * Creates a centered overlay container (for modals/popups).\n */\n private createCenteredOverlayContainer(\n content: HTMLElement,\n options: AXOverlayOptions | undefined,\n zIndex: number,\n ): HTMLElement {\n const container = this.document.createElement('div');\n container.classList.add('ax-overlay-container', 'ax-overlay-centered');\n\n // Add custom panel classes\n if (options?.panelClass) {\n const classes = Array.isArray(options.panelClass) ? options.panelClass : [options.panelClass];\n classes.forEach((cls) => {\n if (cls) {\n container.classList.add(cls);\n }\n });\n }\n\n // Set styles for centered positioning\n container.style.position = 'fixed';\n container.style.top = '0';\n container.style.left = '0';\n container.style.width = '100%';\n container.style.height = '100%';\n container.style.display = 'flex';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n container.style.zIndex = String(zIndex);\n\n // Create inner wrapper for the content\n const contentWrapper = this.document.createElement('div');\n contentWrapper.classList.add('ax-overlay-content');\n\n // Apply width if provided\n if (options?.width) {\n contentWrapper.style.width = options.width;\n } else if (this.hasPanelClass(options?.panelClass, 'ax-popup-overlay')) {\n contentWrapper.style.width = 'auto';\n contentWrapper.style.maxWidth = '100%';\n }\n\n // Move content into wrapper\n contentWrapper.appendChild(content);\n container.appendChild(contentWrapper);\n\n // Append to body\n this.document.body.appendChild(container);\n\n return container;\n }\n\n /**\n * Gets the host element from a ComponentRef or EmbeddedViewRef.\n */\n private hasPanelClass(panelClass: string | string[] | undefined, className: string): boolean {\n if (!panelClass) return false;\n const classes = Array.isArray(panelClass) ? panelClass : [panelClass];\n return classes.some((cls) => cls === className);\n }\n\n /**\n * Gets the host element from a ComponentRef or EmbeddedViewRef.\n */\n private getHostElement<T>(instance: EmbeddedViewRef<T> | ComponentRef<T>): HTMLElement {\n if (instance instanceof ComponentRef) {\n return instance.location.nativeElement;\n } else {\n // EmbeddedViewRef - get the first root node\n return instance.rootNodes[0] as HTMLElement;\n }\n }\n\n /**\n * Creates an overlay container element and appends the content to it.\n */\n private createOverlayContainer(\n content: HTMLElement,\n options: AXOverlayOptions | undefined,\n zIndex: number,\n ): HTMLElement {\n const container = this.document.createElement('div');\n const pane = this.document.createElement('div');\n container.classList.add('ax-overlay-container');\n\n if (Array.isArray(options.panelClass)) {\n const check = options.panelClass.some((element) => {\n return element === 'ax-action-sheet-panel';\n });\n if (!check) pane.classList.add('ax-overlay-pane');\n }\n\n if (options.actionSheetStyle && this._platform.is('SM')) pane.classList.add('ax-overlay-actionsheet');\n\n // Add custom panel classes\n if (options?.panelClass) {\n const classes = Array.isArray(options.panelClass) ? options.panelClass : [options.panelClass];\n classes.forEach((cls) => {\n if (cls) {\n container.classList.add(cls);\n }\n });\n }\n\n // Set initial styles for positioning\n container.style.position = 'fixed';\n container.style.zIndex = String(zIndex);\n container.style.maxWidth = '100%';\n container.style.maxHeight = '100%';\n\n if (options?.actionSheetStyle) {\n container.style.width = this._platform.is('SM') ? '100%' : 'fit-content';\n } else {\n container.style.width = options?.width || 'fit-content';\n }\n\n // Move content into container\n pane.appendChild(content);\n container.appendChild(pane);\n\n // Append to body\n this.document.body.appendChild(container);\n\n return container;\n }\n\n /**\n * Positions the overlay container relative to the anchor element.\n */\n private positionOverlay(container: HTMLElement, options: AXOverlayOptions): void {\n if (options.actionSheetStyle && this._platform.is('SM')) {\n container.style.bottom = `0px`;\n container.style.left = `0px`;\n container.style.right = `0px`;\n container.style.width = 'auto';\n return;\n }\n\n const anchorOptions = options.anchorOptions;\n if (!anchorOptions?.anchor) return;\n\n const anchorElement =\n anchorOptions.anchor instanceof ElementRef ? anchorOptions.anchor.nativeElement : anchorOptions.anchor;\n\n const anchorRect = anchorElement.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n const viewportWidth = this.document.documentElement.clientWidth;\n const viewportHeight = this.document.documentElement.clientHeight;\n\n // Get positions from placement\n let positions = convertToPlacement(anchorOptions.placement ?? 'bottom');\n if (positions.length === 0) {\n positions = convertToPlacement('bottom');\n }\n\n // Apply custom offsets to positions with direction-aware inversion\n // When position flips, the offset should also be inverted to maintain the intended gap\n if (anchorOptions.offsetX || anchorOptions.offsetY) {\n const primaryPosition = positions[0];\n positions = positions.map((p) => {\n let adjustedOffsetX = anchorOptions.offsetX ?? 0;\n let adjustedOffsetY = anchorOptions.offsetY ?? 0;\n\n // Invert offsetY when vertical direction flips\n // (from bottom to top or vice versa)\n if (primaryPosition.originY !== p.originY) {\n adjustedOffsetY = -adjustedOffsetY;\n }\n\n // Invert offsetX when horizontal direction flips\n // (from end to start or vice versa)\n if (primaryPosition.originX !== p.originX) {\n adjustedOffsetX = -adjustedOffsetX;\n }\n\n return {\n ...p,\n offsetX: (p.offsetX ?? 0) + adjustedOffsetX,\n offsetY: (p.offsetY ?? 0) + adjustedOffsetY,\n };\n });\n }\n\n // Find the best position that fits in viewport\n const { coords } = anchorOptions.autoFlip\n ? findBestPosition(anchorRect, containerRect, positions, viewportWidth, viewportHeight)\n : {\n coords: {\n top:\n positions[0].originY === 'bottom'\n ? anchorRect.bottom + (positions[0].offsetY ?? 0)\n : anchorRect.top - containerRect.height + (positions[0].offsetY ?? 0),\n left: anchorRect.left + (positions[0].offsetX ?? 0),\n },\n };\n\n // Apply position\n container.style.top = `${coords.top}px`;\n container.style.left = `${coords.left}px`;\n }\n\n private applyOverlayVisualContext(options: AXOverlayOptions | undefined, targetElement: HTMLElement | null): void {\n if (!targetElement) return;\n\n const fallbackRoot = this.document.documentElement;\n const source = resolveContextElement(options?.contextElement, options?.anchorOptions?.anchor, fallbackRoot);\n const context = resolveVisualContext(source, fallbackRoot);\n const scope = options?.visualContextScope ?? 'full';\n applyVisualContext(targetElement, context, scope);\n\n const pane = targetElement.querySelector('.ax-overlay-pane');\n // Pane is a separate stacking context; mirror context classes so portaled content\n // inherits the same CSS variables when the pane is not a descendant of the container.\n if (pane instanceof HTMLElement) {\n applyVisualContext(pane, context, scope);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,kCAAkC,GAAG,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,cAAc;AAChG,MAAM,kCAAkC,GAAG,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB;AAE5G,MAAM,kCAAkC,GAAG;IACzC,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,cAA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xG,QAAA,IAAI,CAAC,aAAa;YAAE;AAEpB,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe;AAClD,QAAA,MAAM,MAAM,GAAG,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC;QAC3G,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;AAC1D,QAAA,MAAM,KAAK,GAAG,OAAO,EAAE,kBAAkB,IAAI,MAAM;AACnD,QAAA,kBAAkB,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC;QAEjD,MAAM,IAAI,GAAG,aAAa,CAAC,aAAa,CAAC,kBAAkB,CAAC;;;AAG5D,QAAA,IAAI,IAAI,YAAY,WAAW,EAAE;AAC/B,YAAA,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;QAC1C;IACF;8GAhYW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACrBD;;AAEG;;"}
1
+ {"version":3,"file":"acorex-cdk-overlay.mjs","sources":["../../../../packages/cdk/overlay/src/lib/overlay-animation.ts","../../../../packages/cdk/overlay/src/lib/overlay-visual-context.ts","../../../../packages/cdk/overlay/src/lib/overlay.types.ts","../../../../packages/cdk/overlay/src/lib/overlay.service.ts","../../../../packages/cdk/overlay/src/acorex-cdk-overlay.ts"],"sourcesContent":["export const AX_OVERLAY_DEFAULT_ENTER_ANIMATION = ['animate-animated', 'animate-fadeIn', 'animate-fast'];\nexport const AX_OVERLAY_DEFAULT_LEAVE_ANIMATION = ['animate-animated', 'animate-fadeOut', 'animate-2xfaster'];\n\nconst OVERLAY_ANIMATION_DURATION_CLASSES = [\n 'animate-2xfaster',\n 'animate-faster',\n 'animate-fast',\n 'animate-slow',\n 'animate-slower',\n 'animate-2xslower',\n] as const;\n\nconst OVERLAY_ANIMATION_NAME_CLASSES = ['animate-fadeIn', 'animate-fadeOut'] as const;\n\nexport type AXOverlayAnimation =\n | boolean\n | string[]\n | {\n enter?: string[];\n leave?: string[];\n };\n\nexport interface AXOverlayResolvedAnimation {\n enter: string[];\n leave: string[];\n}\n\n/**\n * Resolves overlay animation classes.\n * - omitted: no animation (opt-in at the overlay layer)\n * - `true`: default fade in/out\n * - `false` or `[]`: no animation\n * - `string[]`: custom enter classes only\n * - `{ enter, leave }`: omitted keys fall back to the default fade classes\n */\nexport function resolveOverlayAnimation(animation?: AXOverlayAnimation): AXOverlayResolvedAnimation {\n if (animation === undefined || animation === false) {\n return { enter: [], leave: [] };\n }\n\n if (animation === true) {\n return {\n enter: [...AX_OVERLAY_DEFAULT_ENTER_ANIMATION],\n leave: [...AX_OVERLAY_DEFAULT_LEAVE_ANIMATION],\n };\n }\n\n if (Array.isArray(animation)) {\n if (animation.length === 0) {\n return { enter: [], leave: [] };\n }\n return { enter: [...animation], leave: [] };\n }\n\n return {\n enter: animation.enter === undefined ? [...AX_OVERLAY_DEFAULT_ENTER_ANIMATION] : [...animation.enter],\n leave: animation.leave === undefined ? [...AX_OVERLAY_DEFAULT_LEAVE_ANIMATION] : [...animation.leave],\n };\n}\n\n/** Prefers the content/pane so transforms are not applied to the full-screen container. */\nexport function getOverlayAnimationTarget(container: HTMLElement): HTMLElement {\n const content = container.querySelector<HTMLElement>(':scope > .ax-overlay-content');\n if (content) return content;\n const pane = container.querySelector<HTMLElement>(':scope > .ax-overlay-pane');\n if (pane) return pane;\n return container;\n}\n\nexport function applyOverlayAnimationClasses(element: HTMLElement, classes: string[]): void {\n for (const cls of classes) {\n if (cls) {\n element.classList.add(cls);\n }\n }\n}\n\nexport function removeOverlayAnimationClasses(element: HTMLElement, classes: string[]): void {\n for (const cls of classes) {\n if (cls) {\n element.classList.remove(cls);\n }\n }\n}\n\nexport function prefersReducedMotion(documentRef: Document): boolean {\n return !!documentRef.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nexport function parseCssTimeList(value: string): number[] {\n return value.split(',').map((part) => {\n const trimmed = part.trim();\n if (trimmed.endsWith('ms')) {\n return Number.parseFloat(trimmed) || 0;\n }\n if (trimmed.endsWith('s')) {\n return (Number.parseFloat(trimmed) || 0) * 1000;\n }\n return 0;\n });\n}\n\n/** Maps theme duration utility classes to milliseconds (see tailwind-base). */\nexport function getAnimationDurationFromClasses(classes: string[]): number {\n if (classes.includes('animate-2xfaster')) return 250;\n if (classes.includes('animate-faster')) return 500;\n if (classes.includes('animate-fast')) return 800;\n if (classes.includes('animate-slow')) return 2000;\n if (classes.includes('animate-slower')) return 3000;\n if (classes.includes('animate-2xslower')) return 5000;\n return 500;\n}\n\nexport function getOverlayAnimationTimeout(\n element: HTMLElement,\n documentRef: Document,\n fallbackMs?: number,\n): number {\n if (fallbackMs !== undefined && fallbackMs > 0) {\n return fallbackMs + 32;\n }\n\n const style = documentRef.defaultView?.getComputedStyle(element);\n if (!style) return 0;\n\n const durations = parseCssTimeList(style.animationDuration);\n const delays = parseCssTimeList(style.animationDelay);\n const max = durations.reduce((longest, duration, index) => {\n return Math.max(longest, duration + (delays[index] ?? delays[0] ?? 0));\n }, 0);\n\n return max > 0 ? max + 32 : 0;\n}\n\nexport function playOverlayLeaveAnimation(\n element: HTMLElement,\n enter: string[],\n leave: string[],\n documentRef: Document,\n): Promise<void> {\n removeOverlayAnimationClasses(element, [\n ...enter,\n ...OVERLAY_ANIMATION_NAME_CLASSES,\n ...OVERLAY_ANIMATION_DURATION_CLASSES,\n ]);\n void element.offsetWidth;\n\n const leaveDurationMs = getAnimationDurationFromClasses(leave);\n applyOverlayAnimationClasses(element, leave);\n element.style.animationDuration = `${leaveDurationMs}ms`;\n\n return waitForOverlayAnimationEnd(element, documentRef, {\n fallbackMs: leaveDurationMs,\n animationName: 'fadeOut',\n });\n}\n\nexport function waitForOverlayAnimationEnd(\n element: HTMLElement,\n documentRef: Document,\n options?: { fallbackMs?: number; animationName?: string },\n): Promise<void> {\n return new Promise((resolve) => {\n const timeoutMs = getOverlayAnimationTimeout(element, documentRef, options?.fallbackMs);\n if (timeoutMs <= 0) {\n resolve();\n return;\n }\n\n let settled = false;\n const finish = () => {\n if (settled) return;\n settled = true;\n element.removeEventListener('animationend', onEnd);\n element.style.animationDuration = '';\n resolve();\n };\n const onEnd = (event: AnimationEvent) => {\n if (event.target !== element) return;\n if (options?.animationName && !event.animationName.toLowerCase().includes(options.animationName.toLowerCase())) {\n return;\n }\n finish();\n };\n\n element.addEventListener('animationend', onEnd);\n documentRef.defaultView?.setTimeout(finish, timeoutMs);\n });\n}\n","import { ElementRef } from '@angular/core';\n\nexport type AXOverlayVisualContextScope = 'full' | 'theme';\n\nexport interface AXOverlayVisualContext {\n appearance?: string;\n theme?: 'ax-light' | 'ax-dark';\n contrast?: string;\n size?: string;\n}\n\nexport const APPEARANCE_CLASSES = [\n 'ax-appearance-flat',\n 'ax-appearance-depth',\n 'ax-appearance-translucent',\n] as const;\n\nexport const THEME_CLASSES = ['ax-light', 'ax-dark'] as const;\n\nexport const CONTRAST_CLASSES = ['ax-contrast-enhanced', 'ax-contrast-high'] as const;\n\nexport const SIZE_CLASSES = ['ax-xs', 'ax-sm', 'ax-md', 'ax-lg', 'ax-xl'] as const;\n\nexport const MANAGED_OVERLAY_VISUAL_CLASSES = [\n ...APPEARANCE_CLASSES,\n ...THEME_CLASSES,\n ...CONTRAST_CLASSES,\n ...SIZE_CLASSES,\n] as const;\n\n/**\n * Resolves the nearest effective visual context from an anchor or context source.\n * Theme uses nearest ax-light / ax-dark so nested Light overrides Dark ancestors.\n */\nexport function resolveVisualContext(\n source: HTMLElement | null | undefined,\n fallbackRoot?: HTMLElement | null,\n): AXOverlayVisualContext {\n const context: AXOverlayVisualContext = {};\n const root = fallbackRoot ?? (typeof document !== 'undefined' ? document.documentElement : null);\n\n let node: HTMLElement | null = source ?? root;\n while (node) {\n if (!context.appearance) {\n for (const cls of APPEARANCE_CLASSES) {\n if (node.classList.contains(cls)) {\n context.appearance = cls;\n break;\n }\n }\n }\n\n if (!context.contrast) {\n for (const cls of CONTRAST_CLASSES) {\n if (node.classList.contains(cls)) {\n context.contrast = cls;\n break;\n }\n }\n }\n\n if (!context.size) {\n for (const cls of SIZE_CLASSES) {\n if (node.classList.contains(cls)) {\n context.size = cls;\n break;\n }\n }\n\n if (!context.size && typeof getComputedStyle !== 'undefined') {\n const computedSize = getComputedStyle(node).getPropertyValue('--ax-sys-size').trim();\n if (SIZE_CLASSES.includes(computedSize as (typeof SIZE_CLASSES)[number])) {\n context.size = computedSize;\n }\n }\n }\n\n if (!context.theme) {\n if (node.classList.contains('ax-light')) {\n context.theme = 'ax-light';\n } else if (node.classList.contains('ax-dark')) {\n context.theme = 'ax-dark';\n }\n }\n\n node = node.parentElement;\n }\n\n if (!context.theme && root) {\n if (root.classList.contains('ax-light')) {\n context.theme = 'ax-light';\n } else if (root.classList.contains('ax-dark')) {\n context.theme = 'ax-dark';\n }\n }\n\n return context;\n}\n\n/** Applies resolved visual context classes to an overlay container. */\nexport function applyVisualContext(\n target: HTMLElement,\n context: AXOverlayVisualContext,\n scope: AXOverlayVisualContextScope = 'full',\n): void {\n for (const cls of MANAGED_OVERLAY_VISUAL_CLASSES) {\n target.classList.remove(cls);\n }\n\n if (scope === 'full' && context.appearance) {\n target.classList.add(context.appearance);\n }\n if (context.theme) {\n target.classList.add(context.theme);\n }\n if (scope === 'full' && context.contrast) {\n target.classList.add(context.contrast);\n }\n if (context.size) {\n target.classList.add(context.size);\n }\n}\n\nexport function resolveContextElement(\n contextElement: HTMLElement | ElementRef<HTMLElement> | undefined,\n anchor: HTMLElement | ElementRef<HTMLElement> | undefined,\n fallbackRoot: HTMLElement,\n): HTMLElement {\n if (contextElement) {\n return contextElement instanceof ElementRef ? contextElement.nativeElement : contextElement;\n }\n if (anchor) {\n return anchor instanceof ElementRef ? anchor.nativeElement : anchor;\n }\n return fallbackRoot;\n}\n","import { AXConnectedPosition, AXPlacement, AXPlacementType } from '@acorex/cdk/common';\nimport { AXComponentOptions } from '@acorex/core/components';\nimport { AXZToken } from '@acorex/core/z-index';\nimport { ComponentRef, ElementRef, EmbeddedViewRef } from '@angular/core';\nimport type { AXOverlayAnimation } from './overlay-animation';\nimport type { AXOverlayVisualContextScope } from './overlay-visual-context';\n\nexport interface AXOverlayRef<T> {\n instance: EmbeddedViewRef<T> | ComponentRef<T>;\n /** Updates the overlay position relative to the anchor */\n updatePosition: () => void;\n /** Destroys the overlay. DOM removal waits for a leave animation when one is configured. */\n dispose: () => void;\n /** The overlay container element */\n overlayElement: HTMLElement | null;\n /** The backdrop element if one was created */\n backdropElement: HTMLElement | null;\n /** The z-index token for this overlay */\n zToken: AXZToken | null;\n /** Brings this overlay to the front of all other overlays */\n bringToFront: () => void;\n}\n\nexport interface AXOverlayAnchorOptions {\n /** The anchor element to position relative to */\n anchor: HTMLElement | ElementRef<HTMLElement>;\n /** Placement of the overlay relative to the anchor */\n placement?: AXPlacementType;\n /** Horizontal offset in pixels */\n offsetX?: number;\n /** Vertical offset in pixels */\n offsetY?: number;\n /** Whether to flip the overlay when it overflows the viewport */\n autoFlip?: boolean;\n}\n\nexport interface AXOverlayOptions extends AXComponentOptions {\n backdrop?: {\n enabled?: boolean;\n background?: boolean;\n backdropClass?: string;\n closeOnClick?: boolean;\n };\n position?: AXPlacement;\n /** Anchor-based positioning options for tooltips, popovers, etc. */\n anchorOptions?: AXOverlayAnchorOptions;\n /** Custom CSS class for the overlay panel */\n panelClass?: string | string[];\n /**\n * Enter/leave animation applied to overlay content (`.ax-overlay-content` or `.ax-overlay-pane`),\n * not the full-screen container. Omitted: no animation. `true`: default fade in/out.\n * `false` or `[]`: disabled. A class array is enter-only. `{ enter, leave }` configures both.\n */\n animation?: AXOverlayAnimation;\n /** Whether to close when clicking outside */\n closeOnOutsideClick?: boolean;\n /** Whether to close when pressing Escape */\n closeOnEscape?: boolean;\n /** Width of the overlay container (e.g., 'auto', '200px', '100%') */\n width?: string;\n /** Dispose this overlay when Angular starts a navigation. Default: true. */\n closeOnNavigation?: boolean;\n /** Callback when the overlay is disposed (e.g., due to scroll) */\n onDispose?: () => void;\n /** Whether to use centered container (default: true). Set to false for positioned overlays like toasts */\n centered?: boolean;\n actionSheetStyle?: boolean;\n /** Base z-index for this overlay */\n zIndexBase?: number;\n /**\n * Visual context source for anchorless overlays (toast, dialog, notification).\n * Falls back to anchor, then document root.\n */\n contextElement?: HTMLElement | ElementRef<HTMLElement>;\n /**\n * Which visual context dimensions propagate to the overlay shell.\n * `theme` keeps light/dark (+ size) only; floating surfaces opt out of\n * appearance/contrast classes (popup, toast, dropdown).\n */\n visualContextScope?: AXOverlayVisualContextScope;\n}\n\n/**\n * Calculates the position of an overlay element relative to an anchor element.\n */\nexport function calculateAnchorPosition(\n anchorRect: DOMRect,\n overlayRect: DOMRect,\n position: AXConnectedPosition,\n): { top: number; left: number } {\n let left = 0;\n let top = 0;\n\n // Calculate origin point on anchor\n switch (position.originX) {\n case 'start':\n left = anchorRect.left;\n break;\n case 'center':\n left = anchorRect.left + anchorRect.width / 2;\n break;\n case 'end':\n left = anchorRect.right;\n break;\n }\n\n switch (position.originY) {\n case 'top':\n top = anchorRect.top;\n break;\n case 'center':\n top = anchorRect.top + anchorRect.height / 2;\n break;\n case 'bottom':\n top = anchorRect.bottom;\n break;\n }\n\n // Adjust for overlay alignment\n switch (position.overlayX) {\n case 'start':\n // left stays the same\n break;\n case 'center':\n left -= overlayRect.width / 2;\n break;\n case 'end':\n left -= overlayRect.width;\n break;\n }\n\n switch (position.overlayY) {\n case 'top':\n // top stays the same\n break;\n case 'center':\n top -= overlayRect.height / 2;\n break;\n case 'bottom':\n top -= overlayRect.height;\n break;\n }\n\n // Apply offsets\n if (position.offsetX) {\n left += position.offsetX;\n }\n if (position.offsetY) {\n top += position.offsetY;\n }\n\n return { top, left };\n}\n\n/**\n * Checks if the overlay position fits within the viewport.\n */\nexport function fitsInViewport(\n position: { top: number; left: number },\n overlayRect: DOMRect,\n viewportWidth: number,\n viewportHeight: number,\n): boolean {\n return (\n position.left >= 0 &&\n position.top >= 0 &&\n position.left + overlayRect.width <= viewportWidth &&\n position.top + overlayRect.height <= viewportHeight\n );\n}\n\n/**\n * Clamps a position to ensure the overlay stays within viewport bounds.\n */\nexport function clampToViewport(\n coords: { top: number; left: number },\n overlayRect: DOMRect,\n viewportWidth: number,\n viewportHeight: number,\n margin = 4,\n): { top: number; left: number } {\n const clampedLeft = Math.max(margin, Math.min(coords.left, viewportWidth - overlayRect.width - margin));\n const clampedTop = Math.max(margin, Math.min(coords.top, viewportHeight - overlayRect.height - margin));\n\n return { top: clampedTop, left: clampedLeft };\n}\n\n/**\n * Finds the best position for an overlay that fits in the viewport.\n */\nexport function findBestPosition(\n anchorRect: DOMRect,\n overlayRect: DOMRect,\n positions: AXConnectedPosition[],\n viewportWidth: number,\n viewportHeight: number,\n): { position: AXConnectedPosition; coords: { top: number; left: number } } {\n for (const position of positions) {\n const coords = calculateAnchorPosition(anchorRect, overlayRect, position);\n\n if (fitsInViewport(coords, overlayRect, viewportWidth, viewportHeight)) {\n return { position, coords };\n }\n }\n\n // Fallback to first position if none fit, but clamp to viewport bounds\n const fallbackCoords = calculateAnchorPosition(anchorRect, overlayRect, positions[0]);\n const clampedCoords = clampToViewport(fallbackCoords, overlayRect, viewportWidth, viewportHeight);\n return { position: positions[0], coords: clampedCoords };\n}\n","import { convertToPlacement } from '@acorex/cdk/common';\nimport { AXComponentContent, AXComponentService } from '@acorex/core/components';\nimport { AXPlatform } from '@acorex/core/platform';\nimport { AXZIndexService, AXZToken } from '@acorex/core/z-index';\nimport { DOCUMENT } from '@angular/common';\nimport { ComponentRef, ElementRef, EmbeddedViewRef, inject, Injectable, TemplateRef } from '@angular/core';\nimport { NavigationStart, Router } from '@angular/router';\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport {\n applyOverlayAnimationClasses,\n getOverlayAnimationTarget,\n playOverlayLeaveAnimation,\n prefersReducedMotion,\n resolveOverlayAnimation,\n} from './overlay-animation';\nimport { applyVisualContext, resolveContextElement, resolveVisualContext } from './overlay-visual-context';\nimport { AXOverlayOptions, AXOverlayRef, findBestPosition } from './overlay.types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXOverlayService {\n private componentService = inject(AXComponentService);\n private document = inject(DOCUMENT);\n private zIndexService = inject(AXZIndexService);\n private _platform: AXPlatform = inject(AXPlatform);\n private router = inject(Router, { optional: true });\n\n /**\n * Creates an overlay with optional anchor-based positioning.\n * @param content - Component or template to display\n * @param options - Configuration options for the overlay\n * @returns Promise<AXOverlayRef> - Reference to the created overlay\n */\n async create<T = unknown>(content: AXComponentContent<T>, options?: AXOverlayOptions): Promise<AXOverlayRef<T>> {\n let instance: EmbeddedViewRef<T> | ComponentRef<T>;\n let overlayContainer: HTMLElement | null = null;\n let backdropElement: HTMLElement | null = null;\n let isDisposed = false;\n let navigationSubscription: Subscription | null = null;\n\n // Acquire a z-index token for this overlay\n let zToken: AXZToken | null = this.zIndexService.acquire(options?.zIndexBase);\n\n if (content instanceof TemplateRef) {\n instance = this.componentService.createFromTemplate<T>(content);\n } else {\n instance = this.componentService.createFromComponent<T>(content);\n if (options?.inputs) {\n Object.entries(options.inputs).forEach((c) => {\n (instance as ComponentRef<T>).setInput(c[0], c[1]);\n });\n }\n }\n\n // Get the host element\n const hostElement = this.getHostElement(instance);\n\n // Create backdrop if enabled. Mobile action sheets also get one: their dimming\n // used to be a box-shadow spread, which paints the scrim but does not hit-test,\n // so controls behind the sheet stayed clickable.\n if (options?.backdrop?.enabled || this.needsActionSheetBackdrop(options)) {\n backdropElement = this.createBackdrop(this.withActionSheetBackdrop(options), zToken.zIndex);\n }\n\n // If anchor options are provided, set up positioned overlay (for tooltips, popovers)\n if (options?.anchorOptions?.anchor) {\n overlayContainer = this.createOverlayContainer(hostElement, options, zToken.zIndex);\n this.positionOverlay(overlayContainer, options);\n } else if (options?.centered === false) {\n // Non-centered positioned overlay (for toasts, notifications)\n overlayContainer = this.createOverlayContainer(hostElement, options, zToken.zIndex);\n } else {\n // No anchor - create centered overlay (for modals, popups)\n overlayContainer = this.createCenteredOverlayContainer(hostElement, options, zToken.zIndex);\n }\n\n const updatePosition = () => {\n if (overlayContainer && options?.anchorOptions?.anchor) {\n this.positionOverlay(overlayContainer, options);\n }\n };\n\n const animation = resolveOverlayAnimation(options?.animation);\n const reduceMotion = prefersReducedMotion(this.document);\n\n const dispose = () => {\n if (isDisposed) return;\n isDisposed = true;\n\n navigationSubscription?.unsubscribe();\n navigationSubscription = null;\n\n const finish = () => {\n backdropElement?.remove();\n overlayContainer?.remove();\n instance.destroy();\n this.zIndexService.release(zToken);\n zToken = null;\n options?.onDispose?.();\n };\n\n const animationTarget = overlayContainer ? getOverlayAnimationTarget(overlayContainer) : null;\n if (!animationTarget || !animation.leave.length || reduceMotion) {\n finish();\n return;\n }\n\n if (overlayContainer) {\n overlayContainer.style.pointerEvents = 'none';\n }\n if (backdropElement) {\n backdropElement.style.pointerEvents = 'none';\n }\n\n void playOverlayLeaveAnimation(animationTarget, animation.enter, animation.leave, this.document).finally(finish);\n };\n\n const bringToFront = () => {\n if (!zToken || isDisposed) return;\n zToken = this.zIndexService.bringToFront(zToken);\n if (backdropElement) {\n backdropElement.style.zIndex = String(zToken.zIndex);\n }\n if (overlayContainer) {\n overlayContainer.style.zIndex = String(zToken.zIndex);\n }\n };\n\n // Set up backdrop click handler\n if (backdropElement && options?.backdrop?.closeOnClick) {\n backdropElement.addEventListener('click', () => {\n dispose();\n });\n }\n\n if (options?.closeOnNavigation !== false && this.router) {\n navigationSubscription = this.router.events\n .pipe(filter((event): event is NavigationStart => event instanceof NavigationStart))\n .subscribe(() => {\n dispose();\n });\n }\n\n this.applyOverlayVisualContext(options, overlayContainer);\n\n const animationTarget = overlayContainer ? getOverlayAnimationTarget(overlayContainer) : null;\n if (animationTarget && animation.enter.length && !reduceMotion) {\n applyOverlayAnimationClasses(animationTarget, animation.enter);\n }\n\n return {\n instance,\n updatePosition,\n dispose,\n overlayElement: overlayContainer,\n backdropElement,\n zToken,\n bringToFront,\n };\n }\n\n /**\n * Mobile action sheets need a hit-testable scrim even when the caller did not\n * ask for a backdrop. An explicit `backdrop.enabled: false` opts out.\n */\n private needsActionSheetBackdrop(options: AXOverlayOptions | undefined): boolean {\n return !!options?.actionSheetStyle && this._platform.is('SM') && options?.backdrop?.enabled !== false;\n }\n\n /**\n * Fills in the action-sheet scrim when the caller did not configure a backdrop.\n * Outside-click closing stays with the popover (`clickOut`); this layer only\n * intercepts hits so the page behind the sheet cannot be clicked.\n */\n private withActionSheetBackdrop(options: AXOverlayOptions | undefined): AXOverlayOptions | undefined {\n if (!this.needsActionSheetBackdrop(options) || options?.backdrop?.enabled) {\n return options;\n }\n return {\n ...options,\n backdrop: {\n enabled: true,\n background: true,\n },\n };\n }\n\n /**\n * Creates a backdrop element.\n */\n private createBackdrop(options: AXOverlayOptions | undefined, zIndex: number): HTMLElement {\n const backdrop = this.document.createElement('div');\n backdrop.classList.add('ax-overlay-backdrop');\n\n if (options?.backdrop?.backdropClass) {\n backdrop.classList.add(options.backdrop.backdropClass);\n }\n\n // Style the backdrop\n backdrop.style.position = 'fixed';\n backdrop.style.top = '0';\n backdrop.style.left = '0';\n backdrop.style.width = '100%';\n backdrop.style.height = '100%';\n backdrop.style.zIndex = String(zIndex);\n backdrop.style.pointerEvents = 'auto';\n backdrop.style.touchAction = 'none';\n\n if (options?.backdrop?.background) {\n backdrop.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';\n }\n\n this.document.body.appendChild(backdrop);\n return backdrop;\n }\n\n /**\n * Creates a centered overlay container (for modals/popups).\n */\n private createCenteredOverlayContainer(\n content: HTMLElement,\n options: AXOverlayOptions | undefined,\n zIndex: number,\n ): HTMLElement {\n const container = this.document.createElement('div');\n container.classList.add('ax-overlay-container', 'ax-overlay-centered');\n\n // Add custom panel classes\n if (options?.panelClass) {\n const classes = Array.isArray(options.panelClass) ? options.panelClass : [options.panelClass];\n classes.forEach((cls) => {\n if (cls) {\n container.classList.add(cls);\n }\n });\n }\n\n // Set styles for centered positioning\n container.style.position = 'fixed';\n container.style.top = '0';\n container.style.left = '0';\n container.style.width = '100%';\n container.style.height = '100%';\n container.style.display = 'flex';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n container.style.zIndex = String(zIndex);\n\n // Create inner wrapper for the content\n const contentWrapper = this.document.createElement('div');\n contentWrapper.classList.add('ax-overlay-content');\n\n // Apply width if provided\n if (options?.width) {\n contentWrapper.style.width = options.width;\n } else if (this.hasPanelClass(options?.panelClass, 'ax-popup-overlay')) {\n contentWrapper.style.width = 'auto';\n contentWrapper.style.maxWidth = '100%';\n }\n\n // Move content into wrapper\n contentWrapper.appendChild(content);\n container.appendChild(contentWrapper);\n\n // Append to body\n this.document.body.appendChild(container);\n\n return container;\n }\n\n /**\n * Gets the host element from a ComponentRef or EmbeddedViewRef.\n */\n private hasPanelClass(panelClass: string | string[] | undefined, className: string): boolean {\n if (!panelClass) return false;\n const classes = Array.isArray(panelClass) ? panelClass : [panelClass];\n return classes.some((cls) => cls === className);\n }\n\n /**\n * Gets the host element from a ComponentRef or EmbeddedViewRef.\n */\n private getHostElement<T>(instance: EmbeddedViewRef<T> | ComponentRef<T>): HTMLElement {\n if (instance instanceof ComponentRef) {\n return instance.location.nativeElement;\n } else {\n // EmbeddedViewRef - get the first root node\n return instance.rootNodes[0] as HTMLElement;\n }\n }\n\n /**\n * Creates an overlay container element and appends the content to it.\n */\n private createOverlayContainer(\n content: HTMLElement,\n options: AXOverlayOptions | undefined,\n zIndex: number,\n ): HTMLElement {\n const container = this.document.createElement('div');\n const pane = this.document.createElement('div');\n container.classList.add('ax-overlay-container');\n\n if (Array.isArray(options.panelClass)) {\n const check = options.panelClass.some((element) => {\n return element === 'ax-action-sheet-panel';\n });\n if (!check) pane.classList.add('ax-overlay-pane');\n }\n\n if (options.actionSheetStyle && this._platform.is('SM')) pane.classList.add('ax-overlay-actionsheet');\n\n // Add custom panel classes\n if (options?.panelClass) {\n const classes = Array.isArray(options.panelClass) ? options.panelClass : [options.panelClass];\n classes.forEach((cls) => {\n if (cls) {\n container.classList.add(cls);\n }\n });\n }\n\n // Set initial styles for positioning\n container.style.position = 'fixed';\n container.style.zIndex = String(zIndex);\n container.style.maxWidth = '100%';\n container.style.maxHeight = '100%';\n\n if (options?.actionSheetStyle) {\n container.style.width = this._platform.is('SM') ? '100%' : 'fit-content';\n } else {\n container.style.width = options?.width || 'fit-content';\n }\n\n // Move content into container\n pane.appendChild(content);\n container.appendChild(pane);\n\n // Append to body\n this.document.body.appendChild(container);\n\n return container;\n }\n\n /**\n * Positions the overlay container relative to the anchor element.\n */\n private positionOverlay(container: HTMLElement, options: AXOverlayOptions): void {\n if (options.actionSheetStyle && this._platform.is('SM')) {\n container.style.bottom = `0px`;\n container.style.left = `0px`;\n container.style.right = `0px`;\n container.style.width = 'auto';\n return;\n }\n\n const anchorOptions = options.anchorOptions;\n if (!anchorOptions?.anchor) return;\n\n const anchorElement =\n anchorOptions.anchor instanceof ElementRef ? anchorOptions.anchor.nativeElement : anchorOptions.anchor;\n\n const anchorRect = anchorElement.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n const viewportWidth = this.document.documentElement.clientWidth;\n const viewportHeight = this.document.documentElement.clientHeight;\n\n // Get positions from placement\n let positions = convertToPlacement(anchorOptions.placement ?? 'bottom');\n if (positions.length === 0) {\n positions = convertToPlacement('bottom');\n }\n\n // Apply custom offsets to positions with direction-aware inversion\n // When position flips, the offset should also be inverted to maintain the intended gap\n if (anchorOptions.offsetX || anchorOptions.offsetY) {\n const primaryPosition = positions[0];\n positions = positions.map((p) => {\n let adjustedOffsetX = anchorOptions.offsetX ?? 0;\n let adjustedOffsetY = anchorOptions.offsetY ?? 0;\n\n // Invert offsetY when vertical direction flips\n // (from bottom to top or vice versa)\n if (primaryPosition.originY !== p.originY) {\n adjustedOffsetY = -adjustedOffsetY;\n }\n\n // Invert offsetX when horizontal direction flips\n // (from end to start or vice versa)\n if (primaryPosition.originX !== p.originX) {\n adjustedOffsetX = -adjustedOffsetX;\n }\n\n return {\n ...p,\n offsetX: (p.offsetX ?? 0) + adjustedOffsetX,\n offsetY: (p.offsetY ?? 0) + adjustedOffsetY,\n };\n });\n }\n\n // Find the best position that fits in viewport\n const { coords } = anchorOptions.autoFlip\n ? findBestPosition(anchorRect, containerRect, positions, viewportWidth, viewportHeight)\n : {\n coords: {\n top:\n positions[0].originY === 'bottom'\n ? anchorRect.bottom + (positions[0].offsetY ?? 0)\n : anchorRect.top - containerRect.height + (positions[0].offsetY ?? 0),\n left: anchorRect.left + (positions[0].offsetX ?? 0),\n },\n };\n\n // Apply position\n container.style.top = `${coords.top}px`;\n container.style.left = `${coords.left}px`;\n }\n\n private applyOverlayVisualContext(options: AXOverlayOptions | undefined, targetElement: HTMLElement | null): void {\n if (!targetElement) return;\n\n const fallbackRoot = this.document.documentElement;\n const source = resolveContextElement(options?.contextElement, options?.anchorOptions?.anchor, fallbackRoot);\n const context = resolveVisualContext(source, fallbackRoot);\n const scope = options?.visualContextScope ?? 'full';\n applyVisualContext(targetElement, context, scope);\n\n const pane = targetElement.querySelector('.ax-overlay-pane');\n // Pane is a separate stacking context; mirror context classes so portaled content\n // inherits the same CSS variables when the pane is not a descendant of the container.\n if (pane instanceof HTMLElement) {\n applyVisualContext(pane, context, scope);\n }\n }\n}\n","/**\n * Generated bundle index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,GAAG,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;AAC1D,QAAA,MAAM,KAAK,GAAG,OAAO,EAAE,kBAAkB,IAAI,MAAM;AACnD,QAAA,kBAAkB,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC;QAEjD,MAAM,IAAI,GAAG,aAAa,CAAC,aAAa,CAAC,kBAAkB,CAAC;;;AAG5D,QAAA,IAAI,IAAI,YAAY,WAAW,EAAE;AAC/B,YAAA,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;QAC1C;IACF;8GA9ZW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACrBD;;AAEG;;"}
@@ -0,0 +1,616 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, ChangeDetectionStrategy, Component, inject, ApplicationRef, EnvironmentInjector, DestroyRef, DOCUMENT, PLATFORM_ID, NgZone, signal, effect, untracked, createComponent, Injectable, ElementRef, afterNextRender, TemplateRef, Directive, contentChild, booleanAttribute } from '@angular/core';
3
+ import { AXTranslationService } from '@acorex/core/translation';
4
+ import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
5
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
+
7
+ class AXViewportGuardOverlayComponent {
8
+ constructor() {
9
+ this.guard = input(null, /* @ts-ignore */
10
+ ...(ngDevMode ? [{ debugName: "guard" }] : /* istanbul ignore next */ []));
11
+ }
12
+ context(view) {
13
+ const message = {
14
+ kind: view.kind,
15
+ orientation: view.orientation,
16
+ kicker: view.kicker,
17
+ title: view.title,
18
+ message: view.message,
19
+ hint: view.hint,
20
+ };
21
+ return { $implicit: message, message };
22
+ }
23
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXViewportGuardOverlayComponent, isStandalone: true, selector: "ax-viewport-guard-overlay", inputs: { guard: { classPropertyName: "guard", publicName: "guard", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ax-vg-host" }, ngImport: i0, template: `
25
+ @if (guard(); as view) {
26
+ <div
27
+ class="ax-vg"
28
+ role="alertdialog"
29
+ aria-modal="true"
30
+ tabindex="0"
31
+ [attr.aria-labelledby]="view.template ? null : 'ax-vg-title'"
32
+ [attr.aria-describedby]="view.template ? null : 'ax-vg-message'"
33
+ [attr.aria-label]="view.template ? view.title : null"
34
+ >
35
+ @if (view.template; as template) {
36
+ <ng-container [ngTemplateOutlet]="template" [ngTemplateOutletContext]="context(view)" />
37
+ } @else {
38
+ <section class="ax-vg__card" [attr.data-kind]="view.kind">
39
+ <div
40
+ class="ax-vg__art"
41
+ [class.ax-vg__art--portrait]="view.kind === 'orientation' && view.orientation === 'portrait'"
42
+ [class.ax-vg__art--landscape]="view.kind === 'orientation' && view.orientation === 'landscape'"
43
+ aria-hidden="true"
44
+ >
45
+ @switch (view.kind) {
46
+ @case ('size') {
47
+ <svg class="ax-vg__glyph" viewBox="0 0 64 64" fill="none">
48
+ <rect x="18" y="18" width="28" height="28" rx="6" stroke="currentColor" stroke-width="2.25" />
49
+ <path
50
+ d="M10 18V10h8M54 18V10h-8M10 46v8h8M54 46v8h-8"
51
+ stroke="currentColor"
52
+ stroke-width="2.25"
53
+ stroke-linecap="round"
54
+ stroke-linejoin="round"
55
+ />
56
+ </svg>
57
+ }
58
+ @case ('orientation') {
59
+ <svg class="ax-vg__orbit" viewBox="0 0 64 64" fill="none">
60
+ <path
61
+ d="M32 54A22 22 0 1 1 48.4 17.3"
62
+ stroke="currentColor"
63
+ stroke-width="2.4"
64
+ stroke-linecap="round"
65
+ />
66
+ <path d="M52.7 22.1 45 19.5 50.9 14.1Z" fill="currentColor" />
67
+ </svg>
68
+ <svg class="ax-vg__phone" viewBox="0 0 64 64" fill="none">
69
+ <rect x="24" y="12" width="16" height="40" rx="4" stroke="currentColor" stroke-width="2.25" />
70
+ <path d="M29 18h6" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" />
71
+ <circle cx="32" cy="45" r="1.35" fill="currentColor" />
72
+ </svg>
73
+ }
74
+ }
75
+ </div>
76
+ <div class="ax-vg__copy">
77
+ <p class="ax-vg__kicker">{{ view.kicker }}</p>
78
+ <h2 id="ax-vg-title" class="ax-vg__title">{{ view.title }}</h2>
79
+ <p id="ax-vg-message" class="ax-vg__message">{{ view.message }}</p>
80
+ <p class="ax-vg__hint">{{ view.hint }}</p>
81
+ </div>
82
+ </section>
83
+ }
84
+ </div>
85
+ }
86
+ `, isInline: true, styles: [":host{position:fixed;inset:0;z-index:2147483000;display:block;overflow:auto;overscroll-behavior:none;color:#141414;color:rgba(var(--ax-sys-color-on-surface),1);background-color:#f4f4f5;background-image:radial-gradient(ellipse 90% 55% at 50% -12%,rgba(var(--ax-sys-color-warning-200),.7),transparent 58%),radial-gradient(ellipse 46% 38% at 100% 100%,rgba(var(--ax-sys-color-primary-200),.38),transparent 60%),linear-gradient(rgba(var(--ax-sys-color-surface),.94),rgba(var(--ax-sys-color-surface),.94));-webkit-font-smoothing:antialiased}.ax-vg{box-sizing:border-box;min-height:100%;display:grid;place-items:center;padding:max(1.25rem,env(safe-area-inset-top)) max(1.25rem,env(safe-area-inset-right)) max(1.25rem,env(safe-area-inset-bottom)) max(1.25rem,env(safe-area-inset-left))}.ax-vg:focus{outline:none}.ax-vg__card{box-sizing:border-box;width:min(26.5rem,100%);display:flex;flex-direction:column;align-items:center;text-align:center;gap:clamp(.9rem,2.6vh,1.35rem);padding:clamp(1.35rem,4.2vw,2.15rem);border-radius:clamp(1.25rem,3vw,1.75rem);background:#ffffffeb;background:rgba(var(--ax-sys-color-lightest-surface),.92);border:1px solid rgba(226,226,226,.9);border:1px solid rgba(var(--ax-sys-color-border-lightest-surface),.95);box-shadow:inset 0 1px #ffffff8c,0 18px 50px #0a0a0a1f;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);animation:ax-viewport-guard-in .32s cubic-bezier(.2,.8,.2,1)}.ax-vg__art{position:relative;width:clamp(4.75rem,22vw,6.5rem);height:clamp(4.75rem,22vw,6.5rem);flex:none;display:grid;place-items:center;border-radius:1.5rem;color:#8a4b00;color:rgba(var(--ax-sys-color-warning-800),1);background:#fff4dc;background:radial-gradient(circle at 50% 38%,rgba(var(--ax-sys-color-warning-50),1),rgba(var(--ax-sys-color-warning-100),1));box-shadow:inset 0 0 0 1px rgba(var(--ax-sys-color-warning-200),.95)}.ax-vg__glyph{width:64%;height:64%;animation:ax-viewport-guard-pulse 2.6s ease-in-out infinite}.ax-vg__orbit,.ax-vg__phone{position:absolute;width:auto;height:auto}.ax-vg__orbit{inset:10%;opacity:.9}.ax-vg__phone{inset:27%;transform-origin:center}.ax-vg__art--portrait .ax-vg__phone{animation:ax-viewport-guard-to-portrait 2.6s ease-in-out infinite}.ax-vg__art--landscape .ax-vg__phone{animation:ax-viewport-guard-to-landscape 2.6s ease-in-out infinite}.ax-vg__copy{width:100%;min-width:0}.ax-vg__kicker{display:inline-flex;margin:0 0 .55rem;padding:.18rem .65rem;border-radius:999px;background:rgba(var(--ax-sys-color-warning-100),1);color:rgba(var(--ax-sys-color-warning-900),1);font-size:.75rem;font-weight:600;line-height:1.4}.ax-vg__title{margin:0;font-size:clamp(1.25rem,1.6vw + .85rem,1.7rem);font-weight:700;line-height:1.28;text-wrap:balance}.ax-vg__message{margin:.55rem 0 0;font-size:clamp(.9rem,.5vw + .78rem,1.02rem);line-height:1.6;color:#141414b8;color:rgba(var(--ax-sys-color-on-surface),.72);text-wrap:pretty}.ax-vg__hint{display:inline-flex;align-items:center;justify-content:center;margin:1rem 0 0;padding:.42rem .8rem;border-radius:999px;background:rgba(var(--ax-sys-color-warning-50),1);color:rgba(var(--ax-sys-color-warning-900),1);font-size:clamp(.75rem,.4vw + .68rem,.84rem);font-weight:600;line-height:1.3}@media(max-height:540px){.ax-vg__card{flex-direction:row;align-items:center;text-align:start;width:min(42rem,100%);gap:1rem;padding:1rem 1.15rem;border-radius:1.35rem}.ax-vg__art{width:4.15rem;height:4.15rem;border-radius:1.15rem}.ax-vg__copy{flex:1;width:auto}.ax-vg__kicker{margin-bottom:.35rem}.ax-vg__message{margin-top:.35rem}.ax-vg__hint{margin-top:.7rem}}@media(max-width:380px){.ax-vg{padding:max(.85rem,env(safe-area-inset-top)) max(.85rem,env(safe-area-inset-right)) max(.85rem,env(safe-area-inset-bottom)) max(.85rem,env(safe-area-inset-left))}.ax-vg__card{padding:1.15rem 1rem;border-radius:1.2rem}}@media(max-height:540px)and (max-width:560px){.ax-vg__title{font-size:1.05rem}.ax-vg__message{font-size:.84rem;line-height:1.45}.ax-vg__hint{margin-top:.55rem;padding:.32rem .65rem}}@media(max-height:340px){.ax-vg__kicker{display:none}.ax-vg__art{width:3.25rem;height:3.25rem}}@media(prefers-reduced-motion:reduce){.ax-vg__card,.ax-vg__glyph,.ax-vg__phone{animation:none}.ax-vg__art--portrait .ax-vg__phone{transform:rotate(0)}.ax-vg__art--landscape .ax-vg__phone{transform:rotate(90deg)}}@keyframes ax-viewport-guard-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.06)}}@keyframes ax-viewport-guard-in{0%{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}@keyframes ax-viewport-guard-to-portrait{0%,18%{transform:rotate(90deg)}46%,70%{transform:rotate(0)}to{transform:rotate(90deg)}}@keyframes ax-viewport-guard-to-landscape{0%,18%{transform:rotate(0)}46%,70%{transform:rotate(90deg)}to{transform:rotate(0)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
87
+ }
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardOverlayComponent, decorators: [{
89
+ type: Component,
90
+ args: [{ selector: 'ax-viewport-guard-overlay', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], host: {
91
+ class: 'ax-vg-host',
92
+ }, template: `
93
+ @if (guard(); as view) {
94
+ <div
95
+ class="ax-vg"
96
+ role="alertdialog"
97
+ aria-modal="true"
98
+ tabindex="0"
99
+ [attr.aria-labelledby]="view.template ? null : 'ax-vg-title'"
100
+ [attr.aria-describedby]="view.template ? null : 'ax-vg-message'"
101
+ [attr.aria-label]="view.template ? view.title : null"
102
+ >
103
+ @if (view.template; as template) {
104
+ <ng-container [ngTemplateOutlet]="template" [ngTemplateOutletContext]="context(view)" />
105
+ } @else {
106
+ <section class="ax-vg__card" [attr.data-kind]="view.kind">
107
+ <div
108
+ class="ax-vg__art"
109
+ [class.ax-vg__art--portrait]="view.kind === 'orientation' && view.orientation === 'portrait'"
110
+ [class.ax-vg__art--landscape]="view.kind === 'orientation' && view.orientation === 'landscape'"
111
+ aria-hidden="true"
112
+ >
113
+ @switch (view.kind) {
114
+ @case ('size') {
115
+ <svg class="ax-vg__glyph" viewBox="0 0 64 64" fill="none">
116
+ <rect x="18" y="18" width="28" height="28" rx="6" stroke="currentColor" stroke-width="2.25" />
117
+ <path
118
+ d="M10 18V10h8M54 18V10h-8M10 46v8h8M54 46v8h-8"
119
+ stroke="currentColor"
120
+ stroke-width="2.25"
121
+ stroke-linecap="round"
122
+ stroke-linejoin="round"
123
+ />
124
+ </svg>
125
+ }
126
+ @case ('orientation') {
127
+ <svg class="ax-vg__orbit" viewBox="0 0 64 64" fill="none">
128
+ <path
129
+ d="M32 54A22 22 0 1 1 48.4 17.3"
130
+ stroke="currentColor"
131
+ stroke-width="2.4"
132
+ stroke-linecap="round"
133
+ />
134
+ <path d="M52.7 22.1 45 19.5 50.9 14.1Z" fill="currentColor" />
135
+ </svg>
136
+ <svg class="ax-vg__phone" viewBox="0 0 64 64" fill="none">
137
+ <rect x="24" y="12" width="16" height="40" rx="4" stroke="currentColor" stroke-width="2.25" />
138
+ <path d="M29 18h6" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" />
139
+ <circle cx="32" cy="45" r="1.35" fill="currentColor" />
140
+ </svg>
141
+ }
142
+ }
143
+ </div>
144
+ <div class="ax-vg__copy">
145
+ <p class="ax-vg__kicker">{{ view.kicker }}</p>
146
+ <h2 id="ax-vg-title" class="ax-vg__title">{{ view.title }}</h2>
147
+ <p id="ax-vg-message" class="ax-vg__message">{{ view.message }}</p>
148
+ <p class="ax-vg__hint">{{ view.hint }}</p>
149
+ </div>
150
+ </section>
151
+ }
152
+ </div>
153
+ }
154
+ `, styles: [":host{position:fixed;inset:0;z-index:2147483000;display:block;overflow:auto;overscroll-behavior:none;color:#141414;color:rgba(var(--ax-sys-color-on-surface),1);background-color:#f4f4f5;background-image:radial-gradient(ellipse 90% 55% at 50% -12%,rgba(var(--ax-sys-color-warning-200),.7),transparent 58%),radial-gradient(ellipse 46% 38% at 100% 100%,rgba(var(--ax-sys-color-primary-200),.38),transparent 60%),linear-gradient(rgba(var(--ax-sys-color-surface),.94),rgba(var(--ax-sys-color-surface),.94));-webkit-font-smoothing:antialiased}.ax-vg{box-sizing:border-box;min-height:100%;display:grid;place-items:center;padding:max(1.25rem,env(safe-area-inset-top)) max(1.25rem,env(safe-area-inset-right)) max(1.25rem,env(safe-area-inset-bottom)) max(1.25rem,env(safe-area-inset-left))}.ax-vg:focus{outline:none}.ax-vg__card{box-sizing:border-box;width:min(26.5rem,100%);display:flex;flex-direction:column;align-items:center;text-align:center;gap:clamp(.9rem,2.6vh,1.35rem);padding:clamp(1.35rem,4.2vw,2.15rem);border-radius:clamp(1.25rem,3vw,1.75rem);background:#ffffffeb;background:rgba(var(--ax-sys-color-lightest-surface),.92);border:1px solid rgba(226,226,226,.9);border:1px solid rgba(var(--ax-sys-color-border-lightest-surface),.95);box-shadow:inset 0 1px #ffffff8c,0 18px 50px #0a0a0a1f;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);animation:ax-viewport-guard-in .32s cubic-bezier(.2,.8,.2,1)}.ax-vg__art{position:relative;width:clamp(4.75rem,22vw,6.5rem);height:clamp(4.75rem,22vw,6.5rem);flex:none;display:grid;place-items:center;border-radius:1.5rem;color:#8a4b00;color:rgba(var(--ax-sys-color-warning-800),1);background:#fff4dc;background:radial-gradient(circle at 50% 38%,rgba(var(--ax-sys-color-warning-50),1),rgba(var(--ax-sys-color-warning-100),1));box-shadow:inset 0 0 0 1px rgba(var(--ax-sys-color-warning-200),.95)}.ax-vg__glyph{width:64%;height:64%;animation:ax-viewport-guard-pulse 2.6s ease-in-out infinite}.ax-vg__orbit,.ax-vg__phone{position:absolute;width:auto;height:auto}.ax-vg__orbit{inset:10%;opacity:.9}.ax-vg__phone{inset:27%;transform-origin:center}.ax-vg__art--portrait .ax-vg__phone{animation:ax-viewport-guard-to-portrait 2.6s ease-in-out infinite}.ax-vg__art--landscape .ax-vg__phone{animation:ax-viewport-guard-to-landscape 2.6s ease-in-out infinite}.ax-vg__copy{width:100%;min-width:0}.ax-vg__kicker{display:inline-flex;margin:0 0 .55rem;padding:.18rem .65rem;border-radius:999px;background:rgba(var(--ax-sys-color-warning-100),1);color:rgba(var(--ax-sys-color-warning-900),1);font-size:.75rem;font-weight:600;line-height:1.4}.ax-vg__title{margin:0;font-size:clamp(1.25rem,1.6vw + .85rem,1.7rem);font-weight:700;line-height:1.28;text-wrap:balance}.ax-vg__message{margin:.55rem 0 0;font-size:clamp(.9rem,.5vw + .78rem,1.02rem);line-height:1.6;color:#141414b8;color:rgba(var(--ax-sys-color-on-surface),.72);text-wrap:pretty}.ax-vg__hint{display:inline-flex;align-items:center;justify-content:center;margin:1rem 0 0;padding:.42rem .8rem;border-radius:999px;background:rgba(var(--ax-sys-color-warning-50),1);color:rgba(var(--ax-sys-color-warning-900),1);font-size:clamp(.75rem,.4vw + .68rem,.84rem);font-weight:600;line-height:1.3}@media(max-height:540px){.ax-vg__card{flex-direction:row;align-items:center;text-align:start;width:min(42rem,100%);gap:1rem;padding:1rem 1.15rem;border-radius:1.35rem}.ax-vg__art{width:4.15rem;height:4.15rem;border-radius:1.15rem}.ax-vg__copy{flex:1;width:auto}.ax-vg__kicker{margin-bottom:.35rem}.ax-vg__message{margin-top:.35rem}.ax-vg__hint{margin-top:.7rem}}@media(max-width:380px){.ax-vg{padding:max(.85rem,env(safe-area-inset-top)) max(.85rem,env(safe-area-inset-right)) max(.85rem,env(safe-area-inset-bottom)) max(.85rem,env(safe-area-inset-left))}.ax-vg__card{padding:1.15rem 1rem;border-radius:1.2rem}}@media(max-height:540px)and (max-width:560px){.ax-vg__title{font-size:1.05rem}.ax-vg__message{font-size:.84rem;line-height:1.45}.ax-vg__hint{margin-top:.55rem;padding:.32rem .65rem}}@media(max-height:340px){.ax-vg__kicker{display:none}.ax-vg__art{width:3.25rem;height:3.25rem}}@media(prefers-reduced-motion:reduce){.ax-vg__card,.ax-vg__glyph,.ax-vg__phone{animation:none}.ax-vg__art--portrait .ax-vg__phone{transform:rotate(0)}.ax-vg__art--landscape .ax-vg__phone{transform:rotate(90deg)}}@keyframes ax-viewport-guard-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.06)}}@keyframes ax-viewport-guard-in{0%{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}@keyframes ax-viewport-guard-to-portrait{0%,18%{transform:rotate(90deg)}46%,70%{transform:rotate(0)}to{transform:rotate(90deg)}}@keyframes ax-viewport-guard-to-landscape{0%,18%{transform:rotate(0)}46%,70%{transform:rotate(90deg)}to{transform:rotate(0)}}\n"] }]
155
+ }], propDecorators: { guard: [{ type: i0.Input, args: [{ isSignal: true, alias: "guard", required: false }] }] } });
156
+
157
+ const PHONE_SHORT_SIDE = 540;
158
+ const EMPTY_SNAPSHOT = { width: 0, height: 0, portrait: true, phone: false, ready: false };
159
+ class AXViewportGuardPresenter {
160
+ constructor() {
161
+ this.appRef = inject(ApplicationRef);
162
+ this.environmentInjector = inject(EnvironmentInjector);
163
+ this.destroyRef = inject(DestroyRef);
164
+ this.document = inject(DOCUMENT);
165
+ this.platformId = inject(PLATFORM_ID);
166
+ this.zone = inject(NgZone);
167
+ this.translation = inject(AXTranslationService);
168
+ this.requests = signal(new Map(), /* @ts-ignore */
169
+ ...(ngDevMode ? [{ debugName: "requests" }] : /* istanbul ignore next */ []));
170
+ this.lang = signal(this.translation.getActiveLang(), /* @ts-ignore */
171
+ ...(ngDevMode ? [{ debugName: "lang" }] : /* istanbul ignore next */ []));
172
+ this.snapshot = signal(EMPTY_SNAPSHOT, /* @ts-ignore */
173
+ ...(ngDevMode ? [{ debugName: "snapshot" }] : /* istanbul ignore next */ []));
174
+ this.viewRef = null;
175
+ this.listening = false;
176
+ this.bodyOverflow = null;
177
+ this.focusedKey = '';
178
+ this.translation.langChanges$.pipe(takeUntilDestroyed()).subscribe((lang) => this.lang.set(lang));
179
+ if (!isPlatformBrowser(this.platformId)) {
180
+ return;
181
+ }
182
+ effect(() => {
183
+ const view = this.activeView();
184
+ untracked(() => this.sync(view));
185
+ });
186
+ }
187
+ ensureListening() {
188
+ if (this.listening || !isPlatformBrowser(this.platformId)) {
189
+ return;
190
+ }
191
+ const win = this.document.defaultView;
192
+ if (!win) {
193
+ return;
194
+ }
195
+ this.listening = true;
196
+ const portrait = win.matchMedia('(orientation: portrait)');
197
+ const publish = () => this.zone.run(() => this.snapshot.set(readViewport(win)));
198
+ const publishSoon = () => {
199
+ publish();
200
+ win.requestAnimationFrame(publish);
201
+ };
202
+ publish();
203
+ win.addEventListener('resize', publish, { passive: true });
204
+ win.visualViewport?.addEventListener('resize', publish);
205
+ win.addEventListener('orientationchange', publishSoon);
206
+ portrait.addEventListener('change', publishSoon);
207
+ this.destroyRef.onDestroy(() => {
208
+ win.removeEventListener('resize', publish);
209
+ win.visualViewport?.removeEventListener('resize', publish);
210
+ win.removeEventListener('orientationchange', publishSoon);
211
+ portrait.removeEventListener('change', publishSoon);
212
+ });
213
+ }
214
+ claim(id, request) {
215
+ this.requests.update((current) => {
216
+ const existing = current.get(id);
217
+ if (!request && !existing) {
218
+ return current;
219
+ }
220
+ if (request && existing && sameRequest(existing, request)) {
221
+ return current;
222
+ }
223
+ const next = new Map(current);
224
+ if (request) {
225
+ next.set(id, request);
226
+ }
227
+ else {
228
+ next.delete(id);
229
+ }
230
+ return next;
231
+ });
232
+ }
233
+ activeView() {
234
+ this.lang();
235
+ const request = pickRequest(this.requests());
236
+ if (!request) {
237
+ return null;
238
+ }
239
+ return request.kind === 'size' ? this.sizeView(request) : this.orientationView(request);
240
+ }
241
+ sizeView(request) {
242
+ const copy = request.message;
243
+ const width = request.minWidth > 0 ? String(request.minWidth) : '';
244
+ const height = request.minHeight != null && request.minHeight > 0 ? String(request.minHeight) : '';
245
+ const params = {
246
+ width: isolate(width),
247
+ height: isolate(height),
248
+ size: isolate(width && height ? `${width} × ${height}` : width || height),
249
+ };
250
+ const hintKey = width && height ? 'hint' : height ? 'hint-height' : 'hint-width';
251
+ return {
252
+ kind: 'size',
253
+ orientation: null,
254
+ kicker: this.part(copy?.kicker, 'viewport-guard.size.kicker'),
255
+ title: this.part(copy?.title, 'viewport-guard.size.title'),
256
+ message: this.part(copy?.message, 'viewport-guard.size.message'),
257
+ hint: this.part(copy?.hint, `viewport-guard.size.${hintKey}`, params),
258
+ template: request.template,
259
+ };
260
+ }
261
+ orientationView(request) {
262
+ const copy = request.message;
263
+ const mode = request.orientation;
264
+ return {
265
+ kind: 'orientation',
266
+ orientation: mode,
267
+ kicker: this.part(copy?.kicker, 'viewport-guard.orientation.kicker'),
268
+ title: this.part(copy?.title, `viewport-guard.orientation.title-${mode}`),
269
+ message: this.part(copy?.message, `viewport-guard.orientation.message-${mode}`),
270
+ hint: this.part(copy?.hint, `viewport-guard.orientation.hint-${mode}`),
271
+ template: request.template,
272
+ };
273
+ }
274
+ part(custom, key, params) {
275
+ const source = custom?.trim() || key;
276
+ return this.translation.translateSync(source, { scope: 'acorex', params });
277
+ }
278
+ sync(view) {
279
+ if (!view) {
280
+ this.teardown();
281
+ return;
282
+ }
283
+ this.lockScroll();
284
+ const ref = this.ensureView();
285
+ ref.setInput('guard', view);
286
+ ref.changeDetectorRef.detectChanges();
287
+ this.focus(view);
288
+ }
289
+ ensureView() {
290
+ if (this.viewRef) {
291
+ return this.viewRef;
292
+ }
293
+ const ref = createComponent(AXViewportGuardOverlayComponent, { environmentInjector: this.environmentInjector });
294
+ this.appRef.attachView(ref.hostView);
295
+ const host = ref.location.nativeElement;
296
+ const body = this.document.body;
297
+ const fontFamily = body ? this.document.defaultView?.getComputedStyle(body).fontFamily : '';
298
+ if (fontFamily) {
299
+ host.style.fontFamily = fontFamily;
300
+ }
301
+ this.document.documentElement.appendChild(host);
302
+ this.viewRef = ref;
303
+ return ref;
304
+ }
305
+ focus(view) {
306
+ const key = `${view.kind}|${view.orientation}|${view.title}|${view.message}|${view.hint}`;
307
+ if (key === this.focusedKey) {
308
+ return;
309
+ }
310
+ this.focusedKey = key;
311
+ queueMicrotask(() => {
312
+ const dialog = this.viewRef?.location.nativeElement.querySelector('[role="alertdialog"]');
313
+ dialog?.focus({ preventScroll: true });
314
+ });
315
+ }
316
+ lockScroll() {
317
+ const body = this.document.body;
318
+ if (!body || this.bodyOverflow !== null) {
319
+ return;
320
+ }
321
+ this.bodyOverflow = body.style.overflow;
322
+ body.style.overflow = 'hidden';
323
+ }
324
+ teardown() {
325
+ this.focusedKey = '';
326
+ const body = this.document.body;
327
+ if (body && this.bodyOverflow !== null) {
328
+ body.style.overflow = this.bodyOverflow;
329
+ this.bodyOverflow = null;
330
+ }
331
+ if (!this.viewRef) {
332
+ return;
333
+ }
334
+ this.appRef.detachView(this.viewRef.hostView);
335
+ this.viewRef.destroy();
336
+ this.viewRef = null;
337
+ }
338
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardPresenter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
339
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardPresenter, providedIn: 'root' }); }
340
+ }
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardPresenter, decorators: [{
342
+ type: Injectable,
343
+ args: [{ providedIn: 'root' }]
344
+ }], ctorParameters: () => [] });
345
+ let nextGuardId = 0;
346
+ /** Wires a directive to the shared overlay. Call from the directive constructor. */
347
+ function connectViewportGuard(prefix, active) {
348
+ const host = inject(ElementRef).nativeElement;
349
+ const presenter = inject(AXViewportGuardPresenter);
350
+ const platformId = inject(PLATFORM_ID);
351
+ const destroyRef = inject(DestroyRef);
352
+ const id = `${prefix}-${++nextGuardId}`;
353
+ if (!isPlatformBrowser(platformId)) {
354
+ return;
355
+ }
356
+ afterNextRender(() => presenter.ensureListening());
357
+ effect(() => {
358
+ const request = active();
359
+ untracked(() => {
360
+ presenter.claim(id, request);
361
+ if (request) {
362
+ lockHost(host, id);
363
+ }
364
+ else {
365
+ unlockHost(host, id);
366
+ }
367
+ });
368
+ });
369
+ destroyRef.onDestroy(() => {
370
+ presenter.claim(id, null);
371
+ unlockHost(host, id);
372
+ });
373
+ }
374
+ function readViewport(win) {
375
+ const coarse = win.matchMedia('(pointer: coarse)').matches;
376
+ const shortSide = Math.min(win.screen.width, win.screen.height);
377
+ const dpr = win.devicePixelRatio || 1;
378
+ const cssShortSide = shortSide > PHONE_SHORT_SIDE && dpr > 1 && shortSide / dpr <= PHONE_SHORT_SIDE ? shortSide / dpr : shortSide;
379
+ return {
380
+ width: Math.round(win.innerWidth),
381
+ height: Math.round(win.innerHeight),
382
+ portrait: win.matchMedia('(orientation: portrait)').matches,
383
+ phone: coarse && cssShortSide <= PHONE_SHORT_SIDE,
384
+ ready: true,
385
+ };
386
+ }
387
+ function pickRequest(requests) {
388
+ let size = null;
389
+ let orientation = null;
390
+ for (const request of requests.values()) {
391
+ if (request.kind === 'size') {
392
+ const wider = size != null && request.minWidth > size.minWidth;
393
+ const taller = size != null && request.minWidth === size.minWidth && (request.minHeight ?? 0) > (size.minHeight ?? 0);
394
+ if (!size || wider || taller) {
395
+ size = request;
396
+ }
397
+ }
398
+ else {
399
+ orientation ??= request;
400
+ }
401
+ }
402
+ return size ?? orientation;
403
+ }
404
+ function sameRequest(left, right) {
405
+ if (left.kind !== right.kind || left.template !== right.template || !sameMessage(left.message, right.message)) {
406
+ return false;
407
+ }
408
+ if (left.kind === 'size' && right.kind === 'size') {
409
+ return left.minWidth === right.minWidth && left.minHeight === right.minHeight;
410
+ }
411
+ return left.kind === 'orientation' && right.kind === 'orientation' && left.orientation === right.orientation;
412
+ }
413
+ function sameMessage(left, right) {
414
+ return (left?.kicker === right?.kicker &&
415
+ left?.title === right?.title &&
416
+ left?.message === right?.message &&
417
+ left?.hint === right?.hint);
418
+ }
419
+ function isolate(value) {
420
+ return value ? `\u2066${value}\u2069` : '';
421
+ }
422
+ const hostLocks = new WeakMap();
423
+ function lockHost(element, token) {
424
+ let state = hostLocks.get(element);
425
+ if (!state) {
426
+ state = {
427
+ tokens: new Set(),
428
+ display: element.style.getPropertyValue('display'),
429
+ inert: element.hasAttribute('inert'),
430
+ ariaHidden: element.getAttribute('aria-hidden'),
431
+ };
432
+ hostLocks.set(element, state);
433
+ }
434
+ state.tokens.add(token);
435
+ element.style.setProperty('display', 'none', 'important');
436
+ element.setAttribute('inert', '');
437
+ element.setAttribute('aria-hidden', 'true');
438
+ }
439
+ function unlockHost(element, token) {
440
+ const state = hostLocks.get(element);
441
+ if (!state) {
442
+ return;
443
+ }
444
+ state.tokens.delete(token);
445
+ if (state.tokens.size > 0) {
446
+ return;
447
+ }
448
+ if (state.display) {
449
+ element.style.setProperty('display', state.display);
450
+ }
451
+ else {
452
+ element.style.removeProperty('display');
453
+ }
454
+ if (state.inert) {
455
+ element.setAttribute('inert', '');
456
+ }
457
+ else {
458
+ element.removeAttribute('inert');
459
+ }
460
+ if (state.ariaHidden == null) {
461
+ element.removeAttribute('aria-hidden');
462
+ }
463
+ else {
464
+ element.setAttribute('aria-hidden', state.ariaHidden);
465
+ }
466
+ hostLocks.delete(element);
467
+ }
468
+
469
+ /**
470
+ * Types an `ng-template` whose `let-message` is the resolved guard copy.
471
+ *
472
+ * ```html
473
+ * <ng-template #warning axViewportGuardTemplate let-message>
474
+ * <h2>{{ message.title }}</h2>
475
+ * <p>{{ message.message }}</p>
476
+ * </ng-template>
477
+ *
478
+ * <div axMinViewport="1024" [template]="warning"></div>
479
+ * ```
480
+ */
481
+ class AXViewportGuardTemplateDirective {
482
+ constructor() {
483
+ this.template = inject((TemplateRef));
484
+ }
485
+ static ngTemplateContextGuard(_directive, _context) {
486
+ return true;
487
+ }
488
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
489
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: AXViewportGuardTemplateDirective, isStandalone: true, selector: "ng-template[axViewportGuardTemplate]", ngImport: i0 }); }
490
+ }
491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXViewportGuardTemplateDirective, decorators: [{
492
+ type: Directive,
493
+ args: [{
494
+ selector: 'ng-template[axViewportGuardTemplate]',
495
+ }]
496
+ }] });
497
+
498
+ /**
499
+ * Hides the host when the viewport is smaller than the given size.
500
+ *
501
+ * ```html
502
+ * <div axMinViewport="1024" [minHeight]="640" [message]="copy" [template]="warning"></div>
503
+ * ```
504
+ */
505
+ class AXMinViewportDirective {
506
+ constructor() {
507
+ /** Minimum viewport width in CSS pixels. */
508
+ this.minWidth = input(0, { ...(ngDevMode ? { debugName: "minWidth" } : /* istanbul ignore next */ {}), alias: 'axMinViewport', transform: pxInput });
509
+ /** Minimum viewport height in CSS pixels. Omitted heights are ignored. */
510
+ this.minHeight = input(null, { ...(ngDevMode ? { debugName: "minHeight" } : /* istanbul ignore next */ {}), transform: optionalPxInput });
511
+ /** Replaces any part of the default translated warning. */
512
+ this.message = input(null, /* @ts-ignore */
513
+ ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
514
+ /** Custom warning. `let-message` receives the resolved copy. */
515
+ this.template = input(null, /* @ts-ignore */
516
+ ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
517
+ this.presenter = inject(AXViewportGuardPresenter);
518
+ this.projectedTemplate = contentChild(AXViewportGuardTemplateDirective, { ...(ngDevMode ? { debugName: "projectedTemplate" } : /* istanbul ignore next */ {}), descendants: true });
519
+ connectViewportGuard('size', () => this.request());
520
+ }
521
+ request() {
522
+ const message = this.message();
523
+ const template = this.template() ?? this.projectedTemplate()?.template ?? null;
524
+ const viewport = this.presenter.snapshot();
525
+ const minWidth = this.minWidth();
526
+ const minHeight = this.minHeight();
527
+ if (!viewport.ready) {
528
+ return null;
529
+ }
530
+ const blocked = (minWidth > 0 && viewport.width < minWidth) ||
531
+ (minHeight != null && minHeight > 0 && viewport.height < minHeight);
532
+ return blocked ? { kind: 'size', minWidth, minHeight, message, template } : null;
533
+ }
534
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXMinViewportDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
535
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.1.6", type: AXMinViewportDirective, isStandalone: true, selector: "[axMinViewport]", inputs: { minWidth: { classPropertyName: "minWidth", publicName: "axMinViewport", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "projectedTemplate", first: true, predicate: AXViewportGuardTemplateDirective, descendants: true, isSignal: true }], exportAs: ["axMinViewport"], ngImport: i0 }); }
536
+ }
537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXMinViewportDirective, decorators: [{
538
+ type: Directive,
539
+ args: [{
540
+ selector: '[axMinViewport]',
541
+ exportAs: 'axMinViewport',
542
+ }]
543
+ }], ctorParameters: () => [], propDecorators: { minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "axMinViewport", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], projectedTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXViewportGuardTemplateDirective), { ...{ descendants: true }, isSignal: true }] }] } });
544
+ function pxInput(value) {
545
+ if (value == null || value === '') {
546
+ return 0;
547
+ }
548
+ const parsed = Number(value);
549
+ return Number.isFinite(parsed) ? parsed : 0;
550
+ }
551
+ function optionalPxInput(value) {
552
+ if (value == null || value === '') {
553
+ return null;
554
+ }
555
+ const parsed = Number(value);
556
+ return Number.isFinite(parsed) ? parsed : null;
557
+ }
558
+
559
+ /**
560
+ * On a phone, hides the host when the device is not in the required orientation.
561
+ *
562
+ * ```html
563
+ * <div axOrientationLock="landscape" [message]="copy" [template]="warning"></div>
564
+ * ```
565
+ */
566
+ class AXOrientationLockDirective {
567
+ constructor() {
568
+ /** Orientation that keeps the page visible. */
569
+ this.orientation = input.required({ ...(ngDevMode ? { debugName: "orientation" } : /* istanbul ignore next */ {}), alias: 'axOrientationLock' });
570
+ /**
571
+ * Limits the guard to phones. Set to false to apply it on every device.
572
+ *
573
+ * @defaultValue true
574
+ */
575
+ this.phonesOnly = input(true, { ...(ngDevMode ? { debugName: "phonesOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
576
+ /** Replaces any part of the default translated warning. */
577
+ this.message = input(null, /* @ts-ignore */
578
+ ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
579
+ /** Custom warning. `let-message` receives the resolved copy. */
580
+ this.template = input(null, /* @ts-ignore */
581
+ ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
582
+ this.presenter = inject(AXViewportGuardPresenter);
583
+ this.projectedTemplate = contentChild(AXViewportGuardTemplateDirective, { ...(ngDevMode ? { debugName: "projectedTemplate" } : /* istanbul ignore next */ {}), descendants: true });
584
+ connectViewportGuard('orientation', () => this.request());
585
+ }
586
+ request() {
587
+ const orientation = this.orientation();
588
+ const message = this.message();
589
+ const template = this.template() ?? this.projectedTemplate()?.template ?? null;
590
+ const viewport = this.presenter.snapshot();
591
+ if ((orientation !== 'portrait' && orientation !== 'landscape') || !viewport.ready) {
592
+ return null;
593
+ }
594
+ if (this.phonesOnly() && !viewport.phone) {
595
+ return null;
596
+ }
597
+ const current = viewport.portrait ? 'portrait' : 'landscape';
598
+ return current === orientation ? null : { kind: 'orientation', orientation, message, template };
599
+ }
600
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXOrientationLockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
601
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.1.6", type: AXOrientationLockDirective, isStandalone: true, selector: "[axOrientationLock]", inputs: { orientation: { classPropertyName: "orientation", publicName: "axOrientationLock", isSignal: true, isRequired: true, transformFunction: null }, phonesOnly: { classPropertyName: "phonesOnly", publicName: "phonesOnly", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "projectedTemplate", first: true, predicate: AXViewportGuardTemplateDirective, descendants: true, isSignal: true }], exportAs: ["axOrientationLock"], ngImport: i0 }); }
602
+ }
603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXOrientationLockDirective, decorators: [{
604
+ type: Directive,
605
+ args: [{
606
+ selector: '[axOrientationLock]',
607
+ exportAs: 'axOrientationLock',
608
+ }]
609
+ }], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "axOrientationLock", required: true }] }], phonesOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "phonesOnly", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], projectedTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXViewportGuardTemplateDirective), { ...{ descendants: true }, isSignal: true }] }] } });
610
+
611
+ /**
612
+ * Generated bundle index. Do not edit.
613
+ */
614
+
615
+ export { AXMinViewportDirective, AXOrientationLockDirective, AXViewportGuardTemplateDirective };
616
+ //# sourceMappingURL=acorex-cdk-viewport-guard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-cdk-viewport-guard.mjs","sources":["../../../../packages/cdk/viewport-guard/src/lib/viewport-guard-overlay.component.ts","../../../../packages/cdk/viewport-guard/src/lib/viewport-guard.presenter.ts","../../../../packages/cdk/viewport-guard/src/lib/viewport-guard-template.directive.ts","../../../../packages/cdk/viewport-guard/src/lib/min-viewport.directive.ts","../../../../packages/cdk/viewport-guard/src/lib/orientation-lock.directive.ts","../../../../packages/cdk/viewport-guard/src/acorex-cdk-viewport-guard.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport {\n AXViewportGuardTemplateContext,\n AXViewportGuardTemplateData,\n AXViewportGuardView,\n} from './viewport-guard.types';\n\n@Component({\n selector: 'ax-viewport-guard-overlay',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n host: {\n class: 'ax-vg-host',\n },\n template: `\n @if (guard(); as view) {\n <div\n class=\"ax-vg\"\n role=\"alertdialog\"\n aria-modal=\"true\"\n tabindex=\"0\"\n [attr.aria-labelledby]=\"view.template ? null : 'ax-vg-title'\"\n [attr.aria-describedby]=\"view.template ? null : 'ax-vg-message'\"\n [attr.aria-label]=\"view.template ? view.title : null\"\n >\n @if (view.template; as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"context(view)\" />\n } @else {\n <section class=\"ax-vg__card\" [attr.data-kind]=\"view.kind\">\n <div\n class=\"ax-vg__art\"\n [class.ax-vg__art--portrait]=\"view.kind === 'orientation' && view.orientation === 'portrait'\"\n [class.ax-vg__art--landscape]=\"view.kind === 'orientation' && view.orientation === 'landscape'\"\n aria-hidden=\"true\"\n >\n @switch (view.kind) {\n @case ('size') {\n <svg class=\"ax-vg__glyph\" viewBox=\"0 0 64 64\" fill=\"none\">\n <rect x=\"18\" y=\"18\" width=\"28\" height=\"28\" rx=\"6\" stroke=\"currentColor\" stroke-width=\"2.25\" />\n <path\n d=\"M10 18V10h8M54 18V10h-8M10 46v8h8M54 46v8h-8\"\n stroke=\"currentColor\"\n stroke-width=\"2.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n @case ('orientation') {\n <svg class=\"ax-vg__orbit\" viewBox=\"0 0 64 64\" fill=\"none\">\n <path\n d=\"M32 54A22 22 0 1 1 48.4 17.3\"\n stroke=\"currentColor\"\n stroke-width=\"2.4\"\n stroke-linecap=\"round\"\n />\n <path d=\"M52.7 22.1 45 19.5 50.9 14.1Z\" fill=\"currentColor\" />\n </svg>\n <svg class=\"ax-vg__phone\" viewBox=\"0 0 64 64\" fill=\"none\">\n <rect x=\"24\" y=\"12\" width=\"16\" height=\"40\" rx=\"4\" stroke=\"currentColor\" stroke-width=\"2.25\" />\n <path d=\"M29 18h6\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" />\n <circle cx=\"32\" cy=\"45\" r=\"1.35\" fill=\"currentColor\" />\n </svg>\n }\n }\n </div>\n <div class=\"ax-vg__copy\">\n <p class=\"ax-vg__kicker\">{{ view.kicker }}</p>\n <h2 id=\"ax-vg-title\" class=\"ax-vg__title\">{{ view.title }}</h2>\n <p id=\"ax-vg-message\" class=\"ax-vg__message\">{{ view.message }}</p>\n <p class=\"ax-vg__hint\">{{ view.hint }}</p>\n </div>\n </section>\n }\n </div>\n }\n `,\n styleUrl: './viewport-guard-overlay.component.css',\n})\nexport class AXViewportGuardOverlayComponent {\n readonly guard = input<AXViewportGuardView | null>(null);\n\n protected context(view: AXViewportGuardView): AXViewportGuardTemplateContext {\n const message: AXViewportGuardTemplateData = {\n kind: view.kind,\n orientation: view.orientation,\n kicker: view.kicker,\n title: view.title,\n message: view.message,\n hint: view.hint,\n };\n return { $implicit: message, message };\n }\n}\n","import { AXTranslateParams, AXTranslationService } from '@acorex/core/translation';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n ApplicationRef,\n ComponentRef,\n DestroyRef,\n DOCUMENT,\n ElementRef,\n EnvironmentInjector,\n Injectable,\n NgZone,\n PLATFORM_ID,\n afterNextRender,\n createComponent,\n effect,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { AXViewportGuardOverlayComponent } from './viewport-guard-overlay.component';\nimport {\n AXOrientationGuardRequest,\n AXSizeGuardRequest,\n AXViewportGuardMessage,\n AXViewportGuardRequest,\n AXViewportGuardView,\n AXViewportSnapshot,\n} from './viewport-guard.types';\n\nconst PHONE_SHORT_SIDE = 540;\nconst EMPTY_SNAPSHOT: AXViewportSnapshot = { width: 0, height: 0, portrait: true, phone: false, ready: false };\n\n@Injectable({ providedIn: 'root' })\nexport class AXViewportGuardPresenter {\n private readonly appRef = inject(ApplicationRef);\n private readonly environmentInjector = inject(EnvironmentInjector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly document = inject(DOCUMENT);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly zone = inject(NgZone);\n private readonly translation = inject(AXTranslationService);\n\n private readonly requests = signal(new Map<string, AXViewportGuardRequest>());\n private readonly lang = signal(this.translation.getActiveLang());\n readonly snapshot = signal<AXViewportSnapshot>(EMPTY_SNAPSHOT);\n\n private viewRef: ComponentRef<AXViewportGuardOverlayComponent> | null = null;\n private listening = false;\n private bodyOverflow: string | null = null;\n private focusedKey = '';\n\n constructor() {\n this.translation.langChanges$.pipe(takeUntilDestroyed()).subscribe((lang) => this.lang.set(lang));\n\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n effect(() => {\n const view = this.activeView();\n untracked(() => this.sync(view));\n });\n }\n\n ensureListening(): void {\n if (this.listening || !isPlatformBrowser(this.platformId)) {\n return;\n }\n const win = this.document.defaultView;\n if (!win) {\n return;\n }\n\n this.listening = true;\n const portrait = win.matchMedia('(orientation: portrait)');\n const publish = () => this.zone.run(() => this.snapshot.set(readViewport(win)));\n const publishSoon = () => {\n publish();\n win.requestAnimationFrame(publish);\n };\n\n publish();\n win.addEventListener('resize', publish, { passive: true });\n win.visualViewport?.addEventListener('resize', publish);\n win.addEventListener('orientationchange', publishSoon);\n portrait.addEventListener('change', publishSoon);\n this.destroyRef.onDestroy(() => {\n win.removeEventListener('resize', publish);\n win.visualViewport?.removeEventListener('resize', publish);\n win.removeEventListener('orientationchange', publishSoon);\n portrait.removeEventListener('change', publishSoon);\n });\n }\n\n claim(id: string, request: AXViewportGuardRequest | null): void {\n this.requests.update((current) => {\n const existing = current.get(id);\n if (!request && !existing) {\n return current;\n }\n if (request && existing && sameRequest(existing, request)) {\n return current;\n }\n const next = new Map(current);\n if (request) {\n next.set(id, request);\n } else {\n next.delete(id);\n }\n return next;\n });\n }\n\n private activeView(): AXViewportGuardView | null {\n this.lang();\n const request = pickRequest(this.requests());\n if (!request) {\n return null;\n }\n return request.kind === 'size' ? this.sizeView(request) : this.orientationView(request);\n }\n\n private sizeView(request: AXSizeGuardRequest): AXViewportGuardView {\n const copy = request.message;\n const width = request.minWidth > 0 ? String(request.minWidth) : '';\n const height = request.minHeight != null && request.minHeight > 0 ? String(request.minHeight) : '';\n const params = {\n width: isolate(width),\n height: isolate(height),\n size: isolate(width && height ? `${width} × ${height}` : width || height),\n };\n const hintKey = width && height ? 'hint' : height ? 'hint-height' : 'hint-width';\n\n return {\n kind: 'size',\n orientation: null,\n kicker: this.part(copy?.kicker, 'viewport-guard.size.kicker'),\n title: this.part(copy?.title, 'viewport-guard.size.title'),\n message: this.part(copy?.message, 'viewport-guard.size.message'),\n hint: this.part(copy?.hint, `viewport-guard.size.${hintKey}`, params),\n template: request.template,\n };\n }\n\n private orientationView(request: AXOrientationGuardRequest): AXViewportGuardView {\n const copy = request.message;\n const mode = request.orientation;\n return {\n kind: 'orientation',\n orientation: mode,\n kicker: this.part(copy?.kicker, 'viewport-guard.orientation.kicker'),\n title: this.part(copy?.title, `viewport-guard.orientation.title-${mode}`),\n message: this.part(copy?.message, `viewport-guard.orientation.message-${mode}`),\n hint: this.part(copy?.hint, `viewport-guard.orientation.hint-${mode}`),\n template: request.template,\n };\n }\n\n private part(custom: string | null | undefined, key: string, params?: AXTranslateParams): string {\n const source = custom?.trim() || key;\n return this.translation.translateSync(source, { scope: 'acorex', params });\n }\n\n private sync(view: AXViewportGuardView | null): void {\n if (!view) {\n this.teardown();\n return;\n }\n this.lockScroll();\n const ref = this.ensureView();\n ref.setInput('guard', view);\n ref.changeDetectorRef.detectChanges();\n this.focus(view);\n }\n\n private ensureView(): ComponentRef<AXViewportGuardOverlayComponent> {\n if (this.viewRef) {\n return this.viewRef;\n }\n const ref = createComponent(AXViewportGuardOverlayComponent, { environmentInjector: this.environmentInjector });\n this.appRef.attachView(ref.hostView);\n const host = ref.location.nativeElement;\n const body = this.document.body;\n const fontFamily = body ? this.document.defaultView?.getComputedStyle(body).fontFamily : '';\n if (fontFamily) {\n host.style.fontFamily = fontFamily;\n }\n this.document.documentElement.appendChild(host);\n this.viewRef = ref;\n return ref;\n }\n\n private focus(view: AXViewportGuardView): void {\n const key = `${view.kind}|${view.orientation}|${view.title}|${view.message}|${view.hint}`;\n if (key === this.focusedKey) {\n return;\n }\n this.focusedKey = key;\n queueMicrotask(() => {\n const dialog = this.viewRef?.location.nativeElement.querySelector('[role=\"alertdialog\"]') as HTMLElement | null;\n dialog?.focus({ preventScroll: true });\n });\n }\n\n private lockScroll(): void {\n const body = this.document.body;\n if (!body || this.bodyOverflow !== null) {\n return;\n }\n this.bodyOverflow = body.style.overflow;\n body.style.overflow = 'hidden';\n }\n\n private teardown(): void {\n this.focusedKey = '';\n const body = this.document.body;\n if (body && this.bodyOverflow !== null) {\n body.style.overflow = this.bodyOverflow;\n this.bodyOverflow = null;\n }\n if (!this.viewRef) {\n return;\n }\n this.appRef.detachView(this.viewRef.hostView);\n this.viewRef.destroy();\n this.viewRef = null;\n }\n}\n\nlet nextGuardId = 0;\n\n/** Wires a directive to the shared overlay. Call from the directive constructor. */\nexport function connectViewportGuard(prefix: string, active: () => AXViewportGuardRequest | null): void {\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const presenter = inject(AXViewportGuardPresenter);\n const platformId = inject(PLATFORM_ID);\n const destroyRef = inject(DestroyRef);\n const id = `${prefix}-${++nextGuardId}`;\n\n if (!isPlatformBrowser(platformId)) {\n return;\n }\n\n afterNextRender(() => presenter.ensureListening());\n effect(() => {\n const request = active();\n untracked(() => {\n presenter.claim(id, request);\n if (request) {\n lockHost(host, id);\n } else {\n unlockHost(host, id);\n }\n });\n });\n destroyRef.onDestroy(() => {\n presenter.claim(id, null);\n unlockHost(host, id);\n });\n}\n\nfunction readViewport(win: Window): AXViewportSnapshot {\n const coarse = win.matchMedia('(pointer: coarse)').matches;\n const shortSide = Math.min(win.screen.width, win.screen.height);\n const dpr = win.devicePixelRatio || 1;\n const cssShortSide =\n shortSide > PHONE_SHORT_SIDE && dpr > 1 && shortSide / dpr <= PHONE_SHORT_SIDE ? shortSide / dpr : shortSide;\n\n return {\n width: Math.round(win.innerWidth),\n height: Math.round(win.innerHeight),\n portrait: win.matchMedia('(orientation: portrait)').matches,\n phone: coarse && cssShortSide <= PHONE_SHORT_SIDE,\n ready: true,\n };\n}\n\nfunction pickRequest(requests: ReadonlyMap<string, AXViewportGuardRequest>): AXViewportGuardRequest | null {\n let size: AXSizeGuardRequest | null = null;\n let orientation: AXOrientationGuardRequest | null = null;\n for (const request of requests.values()) {\n if (request.kind === 'size') {\n const wider = size != null && request.minWidth > size.minWidth;\n const taller =\n size != null && request.minWidth === size.minWidth && (request.minHeight ?? 0) > (size.minHeight ?? 0);\n if (!size || wider || taller) {\n size = request;\n }\n } else {\n orientation ??= request;\n }\n }\n return size ?? orientation;\n}\n\nfunction sameRequest(left: AXViewportGuardRequest, right: AXViewportGuardRequest): boolean {\n if (left.kind !== right.kind || left.template !== right.template || !sameMessage(left.message, right.message)) {\n return false;\n }\n if (left.kind === 'size' && right.kind === 'size') {\n return left.minWidth === right.minWidth && left.minHeight === right.minHeight;\n }\n return left.kind === 'orientation' && right.kind === 'orientation' && left.orientation === right.orientation;\n}\n\nfunction sameMessage(left: AXViewportGuardMessage | null, right: AXViewportGuardMessage | null): boolean {\n return (\n left?.kicker === right?.kicker &&\n left?.title === right?.title &&\n left?.message === right?.message &&\n left?.hint === right?.hint\n );\n}\n\nfunction isolate(value: string): string {\n return value ? `\\u2066${value}\\u2069` : '';\n}\n\ninterface HostLock {\n tokens: Set<string>;\n display: string;\n inert: boolean;\n ariaHidden: string | null;\n}\n\nconst hostLocks = new WeakMap<HTMLElement, HostLock>();\n\nfunction lockHost(element: HTMLElement, token: string): void {\n let state = hostLocks.get(element);\n if (!state) {\n state = {\n tokens: new Set(),\n display: element.style.getPropertyValue('display'),\n inert: element.hasAttribute('inert'),\n ariaHidden: element.getAttribute('aria-hidden'),\n };\n hostLocks.set(element, state);\n }\n state.tokens.add(token);\n element.style.setProperty('display', 'none', 'important');\n element.setAttribute('inert', '');\n element.setAttribute('aria-hidden', 'true');\n}\n\nfunction unlockHost(element: HTMLElement, token: string): void {\n const state = hostLocks.get(element);\n if (!state) {\n return;\n }\n state.tokens.delete(token);\n if (state.tokens.size > 0) {\n return;\n }\n if (state.display) {\n element.style.setProperty('display', state.display);\n } else {\n element.style.removeProperty('display');\n }\n if (state.inert) {\n element.setAttribute('inert', '');\n } else {\n element.removeAttribute('inert');\n }\n if (state.ariaHidden == null) {\n element.removeAttribute('aria-hidden');\n } else {\n element.setAttribute('aria-hidden', state.ariaHidden);\n }\n hostLocks.delete(element);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport { AXViewportGuardTemplateContext } from './viewport-guard.types';\n\n/**\n * Types an `ng-template` whose `let-message` is the resolved guard copy.\n *\n * ```html\n * <ng-template #warning axViewportGuardTemplate let-message>\n * <h2>{{ message.title }}</h2>\n * <p>{{ message.message }}</p>\n * </ng-template>\n *\n * <div axMinViewport=\"1024\" [template]=\"warning\"></div>\n * ```\n */\n@Directive({\n selector: 'ng-template[axViewportGuardTemplate]',\n})\nexport class AXViewportGuardTemplateDirective {\n readonly template = inject(TemplateRef<AXViewportGuardTemplateContext>);\n\n static ngTemplateContextGuard(\n _directive: AXViewportGuardTemplateDirective,\n _context: unknown,\n ): _context is AXViewportGuardTemplateContext {\n return true;\n }\n}\n","import { contentChild, Directive, inject, input, TemplateRef } from '@angular/core';\n\nimport { AXViewportGuardPresenter, connectViewportGuard } from './viewport-guard.presenter';\nimport { AXViewportGuardTemplateDirective } from './viewport-guard-template.directive';\nimport {\n AXViewportGuardMessage,\n AXViewportGuardRequest,\n AXViewportGuardTemplateContext,\n} from './viewport-guard.types';\n\n/**\n * Hides the host when the viewport is smaller than the given size.\n *\n * ```html\n * <div axMinViewport=\"1024\" [minHeight]=\"640\" [message]=\"copy\" [template]=\"warning\"></div>\n * ```\n */\n@Directive({\n selector: '[axMinViewport]',\n exportAs: 'axMinViewport',\n})\nexport class AXMinViewportDirective {\n /** Minimum viewport width in CSS pixels. */\n readonly minWidth = input(0, { alias: 'axMinViewport', transform: pxInput });\n\n /** Minimum viewport height in CSS pixels. Omitted heights are ignored. */\n readonly minHeight = input<number | null>(null, { transform: optionalPxInput });\n\n /** Replaces any part of the default translated warning. */\n readonly message = input<AXViewportGuardMessage | null>(null);\n\n /** Custom warning. `let-message` receives the resolved copy. */\n readonly template = input<TemplateRef<AXViewportGuardTemplateContext> | null>(null);\n\n private readonly presenter = inject(AXViewportGuardPresenter);\n private readonly projectedTemplate = contentChild(AXViewportGuardTemplateDirective, { descendants: true });\n\n constructor() {\n connectViewportGuard('size', () => this.request());\n }\n\n private request(): AXViewportGuardRequest | null {\n const message = this.message();\n const template = this.template() ?? this.projectedTemplate()?.template ?? null;\n const viewport = this.presenter.snapshot();\n const minWidth = this.minWidth();\n const minHeight = this.minHeight();\n if (!viewport.ready) {\n return null;\n }\n const blocked =\n (minWidth > 0 && viewport.width < minWidth) ||\n (minHeight != null && minHeight > 0 && viewport.height < minHeight);\n return blocked ? { kind: 'size', minWidth, minHeight, message, template } : null;\n }\n}\n\nfunction pxInput(value: unknown): number {\n if (value == null || value === '') {\n return 0;\n }\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\nfunction optionalPxInput(value: unknown): number | null {\n if (value == null || value === '') {\n return null;\n }\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n}\n","import { booleanAttribute, contentChild, Directive, inject, input, TemplateRef } from '@angular/core';\n\nimport { AXViewportGuardPresenter, connectViewportGuard } from './viewport-guard.presenter';\nimport { AXViewportGuardTemplateDirective } from './viewport-guard-template.directive';\nimport {\n AXScreenOrientation,\n AXViewportGuardMessage,\n AXViewportGuardRequest,\n AXViewportGuardTemplateContext,\n} from './viewport-guard.types';\n\n/**\n * On a phone, hides the host when the device is not in the required orientation.\n *\n * ```html\n * <div axOrientationLock=\"landscape\" [message]=\"copy\" [template]=\"warning\"></div>\n * ```\n */\n@Directive({\n selector: '[axOrientationLock]',\n exportAs: 'axOrientationLock',\n})\nexport class AXOrientationLockDirective {\n /** Orientation that keeps the page visible. */\n readonly orientation = input.required<AXScreenOrientation>({ alias: 'axOrientationLock' });\n\n /**\n * Limits the guard to phones. Set to false to apply it on every device.\n *\n * @defaultValue true\n */\n readonly phonesOnly = input(true, { transform: booleanAttribute });\n\n /** Replaces any part of the default translated warning. */\n readonly message = input<AXViewportGuardMessage | null>(null);\n\n /** Custom warning. `let-message` receives the resolved copy. */\n readonly template = input<TemplateRef<AXViewportGuardTemplateContext> | null>(null);\n\n private readonly presenter = inject(AXViewportGuardPresenter);\n private readonly projectedTemplate = contentChild(AXViewportGuardTemplateDirective, { descendants: true });\n\n constructor() {\n connectViewportGuard('orientation', () => this.request());\n }\n\n private request(): AXViewportGuardRequest | null {\n const orientation = this.orientation();\n const message = this.message();\n const template = this.template() ?? this.projectedTemplate()?.template ?? null;\n const viewport = this.presenter.snapshot();\n if ((orientation !== 'portrait' && orientation !== 'landscape') || !viewport.ready) {\n return null;\n }\n if (this.phonesOnly() && !viewport.phone) {\n return null;\n }\n const current: AXScreenOrientation = viewport.portrait ? 'portrait' : 'landscape';\n return current === orientation ? null : { kind: 'orientation', or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KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,gCAAgC,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACxC3G;;AAEG;;"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@acorex/cdk",
3
- "version": "22.3.15",
3
+ "version": "22.3.17",
4
4
  "peerDependencies": {
5
- "@acorex/core": "22.3.15",
5
+ "@acorex/core": "22.3.17",
6
6
  "quill": ">=2.0.2",
7
7
  "qrcode": ">=1.5.4",
8
8
  "swiper": ">=11.1.15",
@@ -116,6 +116,10 @@
116
116
  "types": "./types/acorex-cdk-uploader.d.ts",
117
117
  "default": "./fesm2022/acorex-cdk-uploader.mjs"
118
118
  },
119
+ "./viewport-guard": {
120
+ "types": "./types/acorex-cdk-viewport-guard.d.ts",
121
+ "default": "./fesm2022/acorex-cdk-viewport-guard.mjs"
122
+ },
119
123
  "./virtual-scroll": {
120
124
  "types": "./types/acorex-cdk-virtual-scroll.d.ts",
121
125
  "default": "./fesm2022/acorex-cdk-virtual-scroll.mjs"
@@ -179,6 +179,17 @@ declare class AXOverlayService {
179
179
  * @returns Promise<AXOverlayRef> - Reference to the created overlay
180
180
  */
181
181
  create<T = unknown>(content: AXComponentContent<T>, options?: AXOverlayOptions): Promise<AXOverlayRef<T>>;
182
+ /**
183
+ * Mobile action sheets need a hit-testable scrim even when the caller did not
184
+ * ask for a backdrop. An explicit `backdrop.enabled: false` opts out.
185
+ */
186
+ private needsActionSheetBackdrop;
187
+ /**
188
+ * Fills in the action-sheet scrim when the caller did not configure a backdrop.
189
+ * Outside-click closing stays with the popover (`clickOut`); this layer only
190
+ * intercepts hits so the page behind the sheet cannot be clicked.
191
+ */
192
+ private withActionSheetBackdrop;
182
193
  /**
183
194
  * Creates a backdrop element.
184
195
  */
@@ -0,0 +1,99 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TemplateRef } from '@angular/core';
3
+
4
+ type AXScreenOrientation = 'portrait' | 'landscape';
5
+ /** Optional copy. Empty fields fall back to the translated defaults. */
6
+ interface AXViewportGuardMessage {
7
+ kicker?: string | null;
8
+ title?: string | null;
9
+ message?: string | null;
10
+ hint?: string | null;
11
+ }
12
+ /** Resolved warning passed into a custom template as `let-message`. */
13
+ interface AXViewportGuardTemplateData {
14
+ kind: 'size' | 'orientation';
15
+ orientation: AXScreenOrientation | null;
16
+ kicker: string;
17
+ title: string;
18
+ message: string;
19
+ hint: string;
20
+ }
21
+ /** Context of `axViewportGuardTemplate`. `$implicit` and `message` are the same data. */
22
+ interface AXViewportGuardTemplateContext {
23
+ $implicit: AXViewportGuardTemplateData;
24
+ message: AXViewportGuardTemplateData;
25
+ }
26
+
27
+ /**
28
+ * Hides the host when the viewport is smaller than the given size.
29
+ *
30
+ * ```html
31
+ * <div axMinViewport="1024" [minHeight]="640" [message]="copy" [template]="warning"></div>
32
+ * ```
33
+ */
34
+ declare class AXMinViewportDirective {
35
+ /** Minimum viewport width in CSS pixels. */
36
+ readonly minWidth: _angular_core.InputSignalWithTransform<number, unknown>;
37
+ /** Minimum viewport height in CSS pixels. Omitted heights are ignored. */
38
+ readonly minHeight: _angular_core.InputSignalWithTransform<number, unknown>;
39
+ /** Replaces any part of the default translated warning. */
40
+ readonly message: _angular_core.InputSignal<AXViewportGuardMessage>;
41
+ /** Custom warning. `let-message` receives the resolved copy. */
42
+ readonly template: _angular_core.InputSignal<TemplateRef<AXViewportGuardTemplateContext>>;
43
+ private readonly presenter;
44
+ private readonly projectedTemplate;
45
+ constructor();
46
+ private request;
47
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMinViewportDirective, never>;
48
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXMinViewportDirective, "[axMinViewport]", ["axMinViewport"], { "minWidth": { "alias": "axMinViewport"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; }, {}, ["projectedTemplate"], never, true, never>;
49
+ }
50
+
51
+ /**
52
+ * On a phone, hides the host when the device is not in the required orientation.
53
+ *
54
+ * ```html
55
+ * <div axOrientationLock="landscape" [message]="copy" [template]="warning"></div>
56
+ * ```
57
+ */
58
+ declare class AXOrientationLockDirective {
59
+ /** Orientation that keeps the page visible. */
60
+ readonly orientation: _angular_core.InputSignal<AXScreenOrientation>;
61
+ /**
62
+ * Limits the guard to phones. Set to false to apply it on every device.
63
+ *
64
+ * @defaultValue true
65
+ */
66
+ readonly phonesOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
67
+ /** Replaces any part of the default translated warning. */
68
+ readonly message: _angular_core.InputSignal<AXViewportGuardMessage>;
69
+ /** Custom warning. `let-message` receives the resolved copy. */
70
+ readonly template: _angular_core.InputSignal<TemplateRef<AXViewportGuardTemplateContext>>;
71
+ private readonly presenter;
72
+ private readonly projectedTemplate;
73
+ constructor();
74
+ private request;
75
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXOrientationLockDirective, never>;
76
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXOrientationLockDirective, "[axOrientationLock]", ["axOrientationLock"], { "orientation": { "alias": "axOrientationLock"; "required": true; "isSignal": true; }; "phonesOnly": { "alias": "phonesOnly"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; }, {}, ["projectedTemplate"], never, true, never>;
77
+ }
78
+
79
+ /**
80
+ * Types an `ng-template` whose `let-message` is the resolved guard copy.
81
+ *
82
+ * ```html
83
+ * <ng-template #warning axViewportGuardTemplate let-message>
84
+ * <h2>{{ message.title }}</h2>
85
+ * <p>{{ message.message }}</p>
86
+ * </ng-template>
87
+ *
88
+ * <div axMinViewport="1024" [template]="warning"></div>
89
+ * ```
90
+ */
91
+ declare class AXViewportGuardTemplateDirective {
92
+ readonly template: TemplateRef<any>;
93
+ static ngTemplateContextGuard(_directive: AXViewportGuardTemplateDirective, _context: unknown): _context is AXViewportGuardTemplateContext;
94
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXViewportGuardTemplateDirective, never>;
95
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXViewportGuardTemplateDirective, "ng-template[axViewportGuardTemplate]", never, {}, {}, never, never, true, never>;
96
+ }
97
+
98
+ export { AXMinViewportDirective, AXOrientationLockDirective, AXViewportGuardTemplateDirective };
99
+ export type { AXScreenOrientation, AXViewportGuardMessage, AXViewportGuardTemplateContext, AXViewportGuardTemplateData };