@acorex/cdk 22.4.49 → 22.4.50
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.
|
@@ -18,6 +18,13 @@ const OVERLAY_ANIMATION_DURATION_CLASSES = [
|
|
|
18
18
|
'animate-slower',
|
|
19
19
|
'animate-2xslower',
|
|
20
20
|
];
|
|
21
|
+
/** Same slack `getOverlayAnimationTimeout` adds after duration + delay. */
|
|
22
|
+
const OVERLAY_ANIMATION_TIMEOUT_PAD_MS = 32;
|
|
23
|
+
/**
|
|
24
|
+
* `--animate-fadeIn` is `1s both fadeIn`. The class-duration map returns 500
|
|
25
|
+
* when no duration utility is present, which would cut that fade in half.
|
|
26
|
+
*/
|
|
27
|
+
const OVERLAY_BARE_FADE_IN_DURATION_MS = 1000;
|
|
21
28
|
const OVERLAY_ANIMATION_NAME_CLASSES = ['animate-fadeIn', 'animate-fadeOut'];
|
|
22
29
|
/**
|
|
23
30
|
* Resolves overlay animation classes.
|
|
@@ -105,7 +112,7 @@ function getAnimationDurationFromClasses(classes) {
|
|
|
105
112
|
}
|
|
106
113
|
function getOverlayAnimationTimeout(element, documentRef, fallbackMs) {
|
|
107
114
|
if (fallbackMs !== undefined && fallbackMs > 0) {
|
|
108
|
-
return fallbackMs +
|
|
115
|
+
return fallbackMs + OVERLAY_ANIMATION_TIMEOUT_PAD_MS;
|
|
109
116
|
}
|
|
110
117
|
const style = documentRef.defaultView?.getComputedStyle(element);
|
|
111
118
|
if (!style)
|
|
@@ -115,7 +122,87 @@ function getOverlayAnimationTimeout(element, documentRef, fallbackMs) {
|
|
|
115
122
|
const max = durations.reduce((longest, duration, index) => {
|
|
116
123
|
return Math.max(longest, duration + (delays[index] ?? delays[0] ?? 0));
|
|
117
124
|
}, 0);
|
|
118
|
-
return max > 0 ? max +
|
|
125
|
+
return max > 0 ? max + OVERLAY_ANIMATION_TIMEOUT_PAD_MS : 0;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* How long enter classes may stay on the animation target.
|
|
129
|
+
* Prefers computed `animation-duration` + `animation-delay`. A positive
|
|
130
|
+
* `fallbackMs` passed to `getOverlayAnimationTimeout` ignores computed style,
|
|
131
|
+
* and the class map's 500ms default is shorter than a bare 1s `fadeIn`, so
|
|
132
|
+
* neither is used to arm this timeout.
|
|
133
|
+
* When computed time is 0 the clock is not running; a positive timeout still
|
|
134
|
+
* strips the classes so fill-mode `both` cannot keep opacity at 0.
|
|
135
|
+
*/
|
|
136
|
+
function getEnterOverlayAnimationTimeout(element, documentRef, enterClasses) {
|
|
137
|
+
const computed = getOverlayAnimationTimeout(element, documentRef);
|
|
138
|
+
if (computed > 0) {
|
|
139
|
+
return computed;
|
|
140
|
+
}
|
|
141
|
+
const hasDurationUtility = OVERLAY_ANIMATION_DURATION_CLASSES.some((cls) => enterClasses.includes(cls));
|
|
142
|
+
const durationMs = hasDurationUtility
|
|
143
|
+
? getAnimationDurationFromClasses(enterClasses)
|
|
144
|
+
: OVERLAY_BARE_FADE_IN_DURATION_MS;
|
|
145
|
+
return durationMs + OVERLAY_ANIMATION_TIMEOUT_PAD_MS;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Applies enter classes, then removes only those classes after `fadeIn` ends.
|
|
149
|
+
* `prefers-reduced-motion` applies nothing and arms no timer.
|
|
150
|
+
* The returned cancel function leaves classes and inline `animationDuration`
|
|
151
|
+
* untouched so a leave animation can still run.
|
|
152
|
+
*/
|
|
153
|
+
function startOverlayEnterAnimation(element, enterClasses, documentRef, reduceMotion) {
|
|
154
|
+
if (reduceMotion || enterClasses.length === 0) {
|
|
155
|
+
return () => undefined;
|
|
156
|
+
}
|
|
157
|
+
applyOverlayAnimationClasses(element, enterClasses);
|
|
158
|
+
return scheduleOverlayEnterAnimationCleanup(element, enterClasses, documentRef);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Removes `enterClasses` from `element` on its own `fadeIn` `animationend`, or
|
|
162
|
+
* when `getEnterOverlayAnimationTimeout` elapses, whichever is first.
|
|
163
|
+
* Does not clear `element.style.animationDuration` (`waitForOverlayAnimationEnd`
|
|
164
|
+
* does, and that would wipe the duration leave has just set).
|
|
165
|
+
* Cancel is idempotent with the finish path and does not remove classes.
|
|
166
|
+
*/
|
|
167
|
+
function scheduleOverlayEnterAnimationCleanup(element, enterClasses, documentRef) {
|
|
168
|
+
if (enterClasses.length === 0) {
|
|
169
|
+
return () => undefined;
|
|
170
|
+
}
|
|
171
|
+
const classes = [...enterClasses];
|
|
172
|
+
let settled = false;
|
|
173
|
+
const view = documentRef.defaultView;
|
|
174
|
+
let timeoutId;
|
|
175
|
+
let onAnimationEnd = () => undefined;
|
|
176
|
+
const disarm = () => {
|
|
177
|
+
element.removeEventListener('animationend', onAnimationEnd);
|
|
178
|
+
if (timeoutId !== undefined) {
|
|
179
|
+
view?.clearTimeout(timeoutId);
|
|
180
|
+
timeoutId = undefined;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const finish = () => {
|
|
184
|
+
if (settled)
|
|
185
|
+
return;
|
|
186
|
+
settled = true;
|
|
187
|
+
disarm();
|
|
188
|
+
removeOverlayAnimationClasses(element, classes);
|
|
189
|
+
};
|
|
190
|
+
const cancel = () => {
|
|
191
|
+
if (settled)
|
|
192
|
+
return;
|
|
193
|
+
settled = true;
|
|
194
|
+
disarm();
|
|
195
|
+
};
|
|
196
|
+
onAnimationEnd = (event) => {
|
|
197
|
+
if (settled || event.target !== element)
|
|
198
|
+
return;
|
|
199
|
+
if (!event.animationName?.toLowerCase().includes('fadein'))
|
|
200
|
+
return;
|
|
201
|
+
finish();
|
|
202
|
+
};
|
|
203
|
+
element.addEventListener('animationend', onAnimationEnd);
|
|
204
|
+
timeoutId = view?.setTimeout(finish, getEnterOverlayAnimationTimeout(element, documentRef, classes));
|
|
205
|
+
return cancel;
|
|
119
206
|
}
|
|
120
207
|
function playOverlayLeaveAnimation(element, enter, leave, documentRef) {
|
|
121
208
|
removeOverlayAnimationClasses(element, [
|
|
@@ -528,6 +615,7 @@ class AXOverlayService {
|
|
|
528
615
|
let navigationSubscription = null;
|
|
529
616
|
let detachDrag = null;
|
|
530
617
|
let setDragEnabled = (_enabled) => undefined;
|
|
618
|
+
let cancelEnterAnimation = () => undefined;
|
|
531
619
|
// Acquire a z-index token for this overlay
|
|
532
620
|
let zToken = this.zIndexService.acquire(options?.zIndexBase);
|
|
533
621
|
if (content instanceof TemplateRef) {
|
|
@@ -580,6 +668,10 @@ class AXOverlayService {
|
|
|
580
668
|
if (isDisposed)
|
|
581
669
|
return;
|
|
582
670
|
isDisposed = true;
|
|
671
|
+
// Enter cleanup removes `animate-animated` and must not clear the inline
|
|
672
|
+
// duration leave sets. Disarm it before the leave animation starts.
|
|
673
|
+
cancelEnterAnimation();
|
|
674
|
+
cancelEnterAnimation = () => undefined;
|
|
583
675
|
navigationSubscription?.unsubscribe();
|
|
584
676
|
navigationSubscription = null;
|
|
585
677
|
const finish = () => {
|
|
@@ -631,8 +723,8 @@ class AXOverlayService {
|
|
|
631
723
|
}
|
|
632
724
|
this.applyOverlayVisualContext(options, overlayContainer);
|
|
633
725
|
const animationTarget = overlayContainer ? getOverlayAnimationTarget(overlayContainer) : null;
|
|
634
|
-
if (animationTarget &&
|
|
635
|
-
|
|
726
|
+
if (animationTarget && !isDisposed) {
|
|
727
|
+
cancelEnterAnimation = startOverlayEnterAnimation(animationTarget, animation.enter, this.document, reduceMotion);
|
|
636
728
|
}
|
|
637
729
|
return {
|
|
638
730
|
instance,
|
|
@@ -903,5 +995,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
903
995
|
* Generated bundle index. Do not edit.
|
|
904
996
|
*/
|
|
905
997
|
|
|
906
|
-
export { APPEARANCE_CLASSES, AXOverlayService, AX_OVERLAY_DEFAULT_ENTER_ANIMATION, AX_OVERLAY_DEFAULT_LEAVE_ANIMATION, CONTRAST_CLASSES, MANAGED_OVERLAY_VISUAL_CLASSES, SIZE_CLASSES, THEME_CLASSES, applyOverlayAnimationClasses, applyVisualContext, calculateAnchorPosition, clampToViewport, findBestPosition, fitsInViewport, getAnimationDurationFromClasses, getOverlayAnimationTarget, getOverlayAnimationTimeout, parseCssTimeList, playOverlayLeaveAnimation, prefersReducedMotion, removeOverlayAnimationClasses, resolveContextElement, resolveOverlayAnimation, resolveVisualContext, waitForOverlayAnimationEnd };
|
|
998
|
+
export { APPEARANCE_CLASSES, AXOverlayService, AX_OVERLAY_DEFAULT_ENTER_ANIMATION, AX_OVERLAY_DEFAULT_LEAVE_ANIMATION, CONTRAST_CLASSES, MANAGED_OVERLAY_VISUAL_CLASSES, SIZE_CLASSES, THEME_CLASSES, applyOverlayAnimationClasses, applyVisualContext, calculateAnchorPosition, clampToViewport, findBestPosition, fitsInViewport, getAnimationDurationFromClasses, getEnterOverlayAnimationTimeout, getOverlayAnimationTarget, getOverlayAnimationTimeout, parseCssTimeList, playOverlayLeaveAnimation, prefersReducedMotion, removeOverlayAnimationClasses, resolveContextElement, resolveOverlayAnimation, resolveVisualContext, scheduleOverlayEnterAnimationCleanup, startOverlayEnterAnimation, waitForOverlayAnimationEnd };
|
|
907
999
|
//# sourceMappingURL=acorex-cdk-overlay.mjs.map
|
|
@@ -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-drag.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","/**\n * Viewport drag for an overlay element.\n * The whole element moves unless `handleSelector` limits the gesture to a region such as a popup header.\n * Pointers that start on buttons, links, or fields are left alone.\n */\nexport function attachOverlayDrag(\n element: HTMLElement,\n documentRef: Document,\n options?: {\n onPositionChanged?: () => void;\n handleSelector?: string;\n },\n): { dispose: () => void; setEnabled: (enabled: boolean) => void } {\n let translateX = 0;\n let translateY = 0;\n let originX = 0;\n let originY = 0;\n let startX = 0;\n let startY = 0;\n let dragging = false;\n let moved = false;\n let enabled = true;\n let activePointerId = -1;\n\n const resetPosition = () => {\n translateX = 0;\n translateY = 0;\n element.style.transform = '';\n };\n\n const endDrag = () => {\n dragging = false;\n moved = false;\n activePointerId = -1;\n documentRef.removeEventListener('pointermove', onPointerMove);\n documentRef.removeEventListener('pointerup', onPointerUp);\n documentRef.removeEventListener('pointercancel', onPointerUp);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (!enabled || event.button !== 0 || dragging || isInteractiveTarget(event.target)) {\n return;\n }\n if (options?.handleSelector) {\n const handle = event.target instanceof Element ? event.target.closest(options.handleSelector) : null;\n if (!handle || !element.contains(handle)) {\n return;\n }\n }\n\n dragging = true;\n moved = false;\n activePointerId = event.pointerId;\n startX = event.clientX;\n startY = event.clientY;\n originX = translateX;\n originY = translateY;\n documentRef.addEventListener('pointermove', onPointerMove);\n documentRef.addEventListener('pointerup', onPointerUp);\n documentRef.addEventListener('pointercancel', onPointerUp);\n };\n\n const onPointerMove = (event: PointerEvent) => {\n if (!dragging || event.pointerId !== activePointerId) {\n return;\n }\n\n const deltaFromStartX = event.clientX - startX;\n const deltaFromStartY = event.clientY - startY;\n if (!moved && Math.hypot(deltaFromStartX, deltaFromStartY) < 3) {\n return;\n }\n if (!moved) {\n element.setPointerCapture?.(event.pointerId);\n }\n moved = true;\n event.preventDefault();\n\n const rect = element.getBoundingClientRect();\n const viewportWidth = documentRef.documentElement.clientWidth;\n const viewportHeight = documentRef.documentElement.clientHeight;\n const margin = 4;\n\n const proposedX = originX + deltaFromStartX;\n const proposedY = originY + deltaFromStartY;\n const deltaX = proposedX - translateX;\n const deltaY = proposedY - translateY;\n\n const visualLeft = Math.max(margin, Math.min(rect.left + deltaX, viewportWidth - rect.width - margin));\n const visualTop = Math.max(margin, Math.min(rect.top + deltaY, viewportHeight - rect.height - margin));\n\n translateX += visualLeft - rect.left;\n translateY += visualTop - rect.top;\n element.style.transform = `translate(${translateX}px, ${translateY}px)`;\n options?.onPositionChanged?.();\n };\n\n const onPointerUp = (event: PointerEvent) => {\n if (event.pointerId !== activePointerId) {\n return;\n }\n endDrag();\n };\n\n element.addEventListener('pointerdown', onPointerDown);\n const paintHandles = () => {\n if (!options?.handleSelector) {\n element.style.cursor = 'grab';\n element.style.touchAction = 'none';\n return;\n }\n element.querySelectorAll<HTMLElement>(options.handleSelector).forEach((handle) => {\n handle.style.cursor = 'grab';\n });\n };\n paintHandles();\n requestAnimationFrame(paintHandles);\n\n return {\n setEnabled: (next: boolean) => {\n enabled = next;\n if (!next) {\n endDrag();\n resetPosition();\n }\n },\n dispose: () => {\n endDrag();\n element.removeEventListener('pointerdown', onPointerDown);\n },\n };\n}\n\nfunction isInteractiveTarget(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) {\n return false;\n }\n return !!target.closest(\n 'button, a, input, textarea, select, label, ax-button, ax-chrome-button, ax-close-button, ax-check-box, ax-label, ax-switch, ax-radio-button, ax-text-box, ax-text-area, [role=\"button\"], [role=\"checkbox\"]',\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, Injector } 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 /** Enables or disables viewport dragging when the overlay was created with `draggable`. */\n setDragEnabled: (enabled: boolean) => 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 * Moves the overlay within the viewport. Positioned overlays drag their container.\n * Centered overlays (popup) drag `.ax-overlay-content`.\n */\n draggable?: boolean;\n /** CSS selector inside the dragged element. When set, drag starts only from that region. */\n dragHandle?: string;\n /** Fired when the draggable container is mounted; register `[axDragHandle]` nodes via `registerHandle`. */\n onDraggableContainerReady?: (container: HTMLElement, registerHandle: (element: HTMLElement) => void) => void;\n /** Fired when the user moves a draggable overlay container. */\n onDragPositionChanged?: () => void;\n /**\n * Injector for overlay content (required for draggable templates that use `ng-content`, e.g. popover).\n */\n contentInjector?: Injector;\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 * Free vertical space on the anchor side used by a connected position.\n */\nfunction verticalFreeSpaceForPosition(\n anchorRect: DOMRect,\n position: AXConnectedPosition,\n viewportHeight: number,\n): number {\n if (position.originY === 'bottom' && position.overlayY === 'top') {\n return viewportHeight - anchorRect.bottom;\n }\n if (position.originY === 'top' && position.overlayY === 'bottom') {\n return anchorRect.top;\n }\n return viewportHeight;\n}\n\nfunction isVerticalAnchorPlacement(position: AXConnectedPosition): boolean {\n return (\n (position.originY === 'bottom' && position.overlayY === 'top') ||\n (position.originY === 'top' && position.overlayY === 'bottom')\n );\n}\n\nfunction clampHorizontalToViewport(\n coords: { top: number; left: number },\n overlayRect: DOMRect,\n viewportWidth: number,\n margin = 4,\n): { top: number; left: number } {\n const clampedLeft = Math.max(margin, Math.min(coords.left, viewportWidth - overlayRect.width - margin));\n return { top: coords.top, 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: anchor to the side with the most vertical room; do not slide over the anchor.\n let bestPosition = positions[0];\n let bestSpace = verticalFreeSpaceForPosition(anchorRect, bestPosition, viewportHeight);\n for (let i = 1; i < positions.length; i++) {\n const space = verticalFreeSpaceForPosition(anchorRect, positions[i], viewportHeight);\n if (space > bestSpace) {\n bestSpace = space;\n bestPosition = positions[i];\n }\n }\n\n const fallbackCoords = calculateAnchorPosition(anchorRect, overlayRect, bestPosition);\n const clampedCoords = isVerticalAnchorPlacement(bestPosition)\n ? clampHorizontalToViewport(fallbackCoords, overlayRect, viewportWidth)\n : clampToViewport(fallbackCoords, overlayRect, viewportWidth, viewportHeight);\n return { position: bestPosition, 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 { attachOverlayDrag } from './overlay-drag';\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 let detachDrag: (() => void) | null = null;\n let setDragEnabled = (_enabled: boolean) => undefined;\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 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 overlayContainer = this.createOverlayContainer(hostElement, options, zToken.zIndex);\n } else {\n overlayContainer = this.createCenteredOverlayContainer(hostElement, options, zToken.zIndex);\n }\n\n if (options?.draggable && overlayContainer) {\n const dragTarget = this.resolveDragTarget(overlayContainer);\n const drag = attachOverlayDrag(dragTarget, this.document, {\n onPositionChanged: options.onDragPositionChanged,\n handleSelector: options.dragHandle,\n });\n detachDrag = drag.dispose;\n setDragEnabled = drag.setEnabled;\n options.onDraggableContainerReady?.(dragTarget, () => undefined);\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 detachDrag?.();\n detachDrag = null;\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 setDragEnabled: (enabled: boolean) => setDragEnabled(enabled),\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 * Positioned overlays drag their container. Centered overlays drag the window host\n * inside `.ax-overlay-content` so a full-size flex shell does not swallow the gesture.\n */\n private resolveDragTarget(container: HTMLElement): HTMLElement {\n if (!container.classList.contains('ax-overlay-centered')) {\n return container;\n }\n const content = container.querySelector<HTMLElement>(':scope > .ax-overlay-content');\n const windowHost = content?.firstElementChild;\n if (windowHost instanceof HTMLElement) {\n return windowHost;\n }\n return content ?? container;\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 isActionSheetPanel = options.panelClass.some((element) => element === 'ax-action-sheet-panel');\n if (!isActionSheetPanel) {\n pane.classList.add('ax-overlay-pane');\n }\n }\n\n if (options?.actionSheetStyle && this._platform.is('SM')) {\n pane.classList.add('ax-overlay-actionsheet');\n }\n\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 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 pane.appendChild(content);\n container.appendChild(pane);\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,cAAc;IACd,gBAAgB;IAChB,kBAAkB;CACV;AAEV,MAAM,8BAA8B,GAAG,CAAC,gBAAgB,EAAE,iBAAiB,CAAU;AAerF;;;;;;;AAOG;AACG,SAAU,uBAAuB,CAAC,SAA8B,EAAA;IACpE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,KAAK,EAAE;QAClD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACjC;AAEA,IAAA,IAAI,SAAS,KAAK,IAAI,EAAE;QACtB,OAAO;AACL,YAAA,KAAK,EAAE,CAAC,GAAG,kCAAkC,CAAC;AAC9C,YAAA,KAAK,EAAE,CAAC,GAAG,kCAAkC,CAAC;SAC/C;IACH;AAEA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AAC5B,QAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACjC;AACA,QAAA,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7C;IAEA,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,KAAK,KAAK,SAAS,GAAG,CAAC,GAAG,kCAAkC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;QACrG,KAAK,EAAE,SAAS,CAAC,KAAK,KAAK,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AAA;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;;;ACtBD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-overlay.mjs","sources":["../../../../packages/cdk/overlay/src/lib/overlay-animation.ts","../../../../packages/cdk/overlay/src/lib/overlay-drag.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\n/** Same slack `getOverlayAnimationTimeout` adds after duration + delay. */\nconst OVERLAY_ANIMATION_TIMEOUT_PAD_MS = 32;\n\n/**\n * `--animate-fadeIn` is `1s both fadeIn`. The class-duration map returns 500\n * when no duration utility is present, which would cut that fade in half.\n */\nconst OVERLAY_BARE_FADE_IN_DURATION_MS = 1000;\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 + OVERLAY_ANIMATION_TIMEOUT_PAD_MS;\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 + OVERLAY_ANIMATION_TIMEOUT_PAD_MS : 0;\n}\n\n/**\n * How long enter classes may stay on the animation target.\n * Prefers computed `animation-duration` + `animation-delay`. A positive\n * `fallbackMs` passed to `getOverlayAnimationTimeout` ignores computed style,\n * and the class map's 500ms default is shorter than a bare 1s `fadeIn`, so\n * neither is used to arm this timeout.\n * When computed time is 0 the clock is not running; a positive timeout still\n * strips the classes so fill-mode `both` cannot keep opacity at 0.\n */\nexport function getEnterOverlayAnimationTimeout(\n element: HTMLElement,\n documentRef: Document,\n enterClasses: string[],\n): number {\n const computed = getOverlayAnimationTimeout(element, documentRef);\n if (computed > 0) {\n return computed;\n }\n\n const hasDurationUtility = OVERLAY_ANIMATION_DURATION_CLASSES.some((cls) => enterClasses.includes(cls));\n const durationMs = hasDurationUtility\n ? getAnimationDurationFromClasses(enterClasses)\n : OVERLAY_BARE_FADE_IN_DURATION_MS;\n return durationMs + OVERLAY_ANIMATION_TIMEOUT_PAD_MS;\n}\n\n/**\n * Applies enter classes, then removes only those classes after `fadeIn` ends.\n * `prefers-reduced-motion` applies nothing and arms no timer.\n * The returned cancel function leaves classes and inline `animationDuration`\n * untouched so a leave animation can still run.\n */\nexport function startOverlayEnterAnimation(\n element: HTMLElement,\n enterClasses: string[],\n documentRef: Document,\n reduceMotion: boolean,\n): () => void {\n if (reduceMotion || enterClasses.length === 0) {\n return () => undefined;\n }\n\n applyOverlayAnimationClasses(element, enterClasses);\n return scheduleOverlayEnterAnimationCleanup(element, enterClasses, documentRef);\n}\n\n/**\n * Removes `enterClasses` from `element` on its own `fadeIn` `animationend`, or\n * when `getEnterOverlayAnimationTimeout` elapses, whichever is first.\n * Does not clear `element.style.animationDuration` (`waitForOverlayAnimationEnd`\n * does, and that would wipe the duration leave has just set).\n * Cancel is idempotent with the finish path and does not remove classes.\n */\nexport function scheduleOverlayEnterAnimationCleanup(\n element: HTMLElement,\n enterClasses: string[],\n documentRef: Document,\n): () => void {\n if (enterClasses.length === 0) {\n return () => undefined;\n }\n\n const classes = [...enterClasses];\n let settled = false;\n const view = documentRef.defaultView;\n let timeoutId: ReturnType<Window['setTimeout']> | undefined;\n let onAnimationEnd: (event: AnimationEvent) => void = () => undefined;\n\n const disarm = () => {\n element.removeEventListener('animationend', onAnimationEnd);\n if (timeoutId !== undefined) {\n view?.clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n };\n\n const finish = () => {\n if (settled) return;\n settled = true;\n disarm();\n removeOverlayAnimationClasses(element, classes);\n };\n\n const cancel = () => {\n if (settled) return;\n settled = true;\n disarm();\n };\n\n onAnimationEnd = (event: AnimationEvent) => {\n if (settled || event.target !== element) return;\n if (!event.animationName?.toLowerCase().includes('fadein')) return;\n finish();\n };\n\n element.addEventListener('animationend', onAnimationEnd);\n timeoutId = view?.setTimeout(finish, getEnterOverlayAnimationTimeout(element, documentRef, classes));\n\n return cancel;\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","/**\n * Viewport drag for an overlay element.\n * The whole element moves unless `handleSelector` limits the gesture to a region such as a popup header.\n * Pointers that start on buttons, links, or fields are left alone.\n */\nexport function attachOverlayDrag(\n element: HTMLElement,\n documentRef: Document,\n options?: {\n onPositionChanged?: () => void;\n handleSelector?: string;\n },\n): { dispose: () => void; setEnabled: (enabled: boolean) => void } {\n let translateX = 0;\n let translateY = 0;\n let originX = 0;\n let originY = 0;\n let startX = 0;\n let startY = 0;\n let dragging = false;\n let moved = false;\n let enabled = true;\n let activePointerId = -1;\n\n const resetPosition = () => {\n translateX = 0;\n translateY = 0;\n element.style.transform = '';\n };\n\n const endDrag = () => {\n dragging = false;\n moved = false;\n activePointerId = -1;\n documentRef.removeEventListener('pointermove', onPointerMove);\n documentRef.removeEventListener('pointerup', onPointerUp);\n documentRef.removeEventListener('pointercancel', onPointerUp);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (!enabled || event.button !== 0 || dragging || isInteractiveTarget(event.target)) {\n return;\n }\n if (options?.handleSelector) {\n const handle = event.target instanceof Element ? event.target.closest(options.handleSelector) : null;\n if (!handle || !element.contains(handle)) {\n return;\n }\n }\n\n dragging = true;\n moved = false;\n activePointerId = event.pointerId;\n startX = event.clientX;\n startY = event.clientY;\n originX = translateX;\n originY = translateY;\n documentRef.addEventListener('pointermove', onPointerMove);\n documentRef.addEventListener('pointerup', onPointerUp);\n documentRef.addEventListener('pointercancel', onPointerUp);\n };\n\n const onPointerMove = (event: PointerEvent) => {\n if (!dragging || event.pointerId !== activePointerId) {\n return;\n }\n\n const deltaFromStartX = event.clientX - startX;\n const deltaFromStartY = event.clientY - startY;\n if (!moved && Math.hypot(deltaFromStartX, deltaFromStartY) < 3) {\n return;\n }\n if (!moved) {\n element.setPointerCapture?.(event.pointerId);\n }\n moved = true;\n event.preventDefault();\n\n const rect = element.getBoundingClientRect();\n const viewportWidth = documentRef.documentElement.clientWidth;\n const viewportHeight = documentRef.documentElement.clientHeight;\n const margin = 4;\n\n const proposedX = originX + deltaFromStartX;\n const proposedY = originY + deltaFromStartY;\n const deltaX = proposedX - translateX;\n const deltaY = proposedY - translateY;\n\n const visualLeft = Math.max(margin, Math.min(rect.left + deltaX, viewportWidth - rect.width - margin));\n const visualTop = Math.max(margin, Math.min(rect.top + deltaY, viewportHeight - rect.height - margin));\n\n translateX += visualLeft - rect.left;\n translateY += visualTop - rect.top;\n element.style.transform = `translate(${translateX}px, ${translateY}px)`;\n options?.onPositionChanged?.();\n };\n\n const onPointerUp = (event: PointerEvent) => {\n if (event.pointerId !== activePointerId) {\n return;\n }\n endDrag();\n };\n\n element.addEventListener('pointerdown', onPointerDown);\n const paintHandles = () => {\n if (!options?.handleSelector) {\n element.style.cursor = 'grab';\n element.style.touchAction = 'none';\n return;\n }\n element.querySelectorAll<HTMLElement>(options.handleSelector).forEach((handle) => {\n handle.style.cursor = 'grab';\n });\n };\n paintHandles();\n requestAnimationFrame(paintHandles);\n\n return {\n setEnabled: (next: boolean) => {\n enabled = next;\n if (!next) {\n endDrag();\n resetPosition();\n }\n },\n dispose: () => {\n endDrag();\n element.removeEventListener('pointerdown', onPointerDown);\n },\n };\n}\n\nfunction isInteractiveTarget(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) {\n return false;\n }\n return !!target.closest(\n 'button, a, input, textarea, select, label, ax-button, ax-chrome-button, ax-close-button, ax-check-box, ax-label, ax-switch, ax-radio-button, ax-text-box, ax-text-area, [role=\"button\"], [role=\"checkbox\"]',\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, Injector } 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 /** Enables or disables viewport dragging when the overlay was created with `draggable`. */\n setDragEnabled: (enabled: boolean) => 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 * Moves the overlay within the viewport. Positioned overlays drag their container.\n * Centered overlays (popup) drag `.ax-overlay-content`.\n */\n draggable?: boolean;\n /** CSS selector inside the dragged element. When set, drag starts only from that region. */\n dragHandle?: string;\n /** Fired when the draggable container is mounted; register `[axDragHandle]` nodes via `registerHandle`. */\n onDraggableContainerReady?: (container: HTMLElement, registerHandle: (element: HTMLElement) => void) => void;\n /** Fired when the user moves a draggable overlay container. */\n onDragPositionChanged?: () => void;\n /**\n * Injector for overlay content (required for draggable templates that use `ng-content`, e.g. popover).\n */\n contentInjector?: Injector;\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 * Free vertical space on the anchor side used by a connected position.\n */\nfunction verticalFreeSpaceForPosition(\n anchorRect: DOMRect,\n position: AXConnectedPosition,\n viewportHeight: number,\n): number {\n if (position.originY === 'bottom' && position.overlayY === 'top') {\n return viewportHeight - anchorRect.bottom;\n }\n if (position.originY === 'top' && position.overlayY === 'bottom') {\n return anchorRect.top;\n }\n return viewportHeight;\n}\n\nfunction isVerticalAnchorPlacement(position: AXConnectedPosition): boolean {\n return (\n (position.originY === 'bottom' && position.overlayY === 'top') ||\n (position.originY === 'top' && position.overlayY === 'bottom')\n );\n}\n\nfunction clampHorizontalToViewport(\n coords: { top: number; left: number },\n overlayRect: DOMRect,\n viewportWidth: number,\n margin = 4,\n): { top: number; left: number } {\n const clampedLeft = Math.max(margin, Math.min(coords.left, viewportWidth - overlayRect.width - margin));\n return { top: coords.top, 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: anchor to the side with the most vertical room; do not slide over the anchor.\n let bestPosition = positions[0];\n let bestSpace = verticalFreeSpaceForPosition(anchorRect, bestPosition, viewportHeight);\n for (let i = 1; i < positions.length; i++) {\n const space = verticalFreeSpaceForPosition(anchorRect, positions[i], viewportHeight);\n if (space > bestSpace) {\n bestSpace = space;\n bestPosition = positions[i];\n }\n }\n\n const fallbackCoords = calculateAnchorPosition(anchorRect, overlayRect, bestPosition);\n const clampedCoords = isVerticalAnchorPlacement(bestPosition)\n ? clampHorizontalToViewport(fallbackCoords, overlayRect, viewportWidth)\n : clampToViewport(fallbackCoords, overlayRect, viewportWidth, viewportHeight);\n return { position: bestPosition, 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 getOverlayAnimationTarget,\n playOverlayLeaveAnimation,\n prefersReducedMotion,\n resolveOverlayAnimation,\n startOverlayEnterAnimation,\n} from './overlay-animation';\nimport { attachOverlayDrag } from './overlay-drag';\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 let detachDrag: (() => void) | null = null;\n let setDragEnabled = (_enabled: boolean) => undefined;\n let cancelEnterAnimation: () => void = () => undefined;\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 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 overlayContainer = this.createOverlayContainer(hostElement, options, zToken.zIndex);\n } else {\n overlayContainer = this.createCenteredOverlayContainer(hostElement, options, zToken.zIndex);\n }\n\n if (options?.draggable && overlayContainer) {\n const dragTarget = this.resolveDragTarget(overlayContainer);\n const drag = attachOverlayDrag(dragTarget, this.document, {\n onPositionChanged: options.onDragPositionChanged,\n handleSelector: options.dragHandle,\n });\n detachDrag = drag.dispose;\n setDragEnabled = drag.setEnabled;\n options.onDraggableContainerReady?.(dragTarget, () => undefined);\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 // Enter cleanup removes `animate-animated` and must not clear the inline\n // duration leave sets. Disarm it before the leave animation starts.\n cancelEnterAnimation();\n cancelEnterAnimation = () => undefined;\n\n navigationSubscription?.unsubscribe();\n navigationSubscription = null;\n\n const finish = () => {\n detachDrag?.();\n detachDrag = null;\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 && !isDisposed) {\n cancelEnterAnimation = startOverlayEnterAnimation(\n animationTarget,\n animation.enter,\n this.document,\n reduceMotion,\n );\n }\n\n return {\n instance,\n updatePosition,\n dispose,\n overlayElement: overlayContainer,\n backdropElement,\n zToken,\n bringToFront,\n setDragEnabled: (enabled: boolean) => setDragEnabled(enabled),\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 * Positioned overlays drag their container. Centered overlays drag the window host\n * inside `.ax-overlay-content` so a full-size flex shell does not swallow the gesture.\n */\n private resolveDragTarget(container: HTMLElement): HTMLElement {\n if (!container.classList.contains('ax-overlay-centered')) {\n return container;\n }\n const content = container.querySelector<HTMLElement>(':scope > .ax-overlay-content');\n const windowHost = content?.firstElementChild;\n if (windowHost instanceof HTMLElement) {\n return windowHost;\n }\n return content ?? container;\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 isActionSheetPanel = options.panelClass.some((element) => element === 'ax-action-sheet-panel');\n if (!isActionSheetPanel) {\n pane.classList.add('ax-overlay-pane');\n }\n }\n\n if (options?.actionSheetStyle && this._platform.is('SM')) {\n pane.classList.add('ax-overlay-actionsheet');\n }\n\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 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 pane.appendChild(content);\n container.appendChild(pane);\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,cAAc;IACd,gBAAgB;IAChB,kBAAkB;CACV;AAEV;AACA,MAAM,gCAAgC,GAAG,EAAE;AAE3C;;;AAGG;AACH,MAAM,gCAAgC,GAAG,IAAI;AAE7C,MAAM,8BAA8B,GAAG,CAAC,gBAAgB,EAAE,iBAAiB,CAAU;AAerF;;;;;;;AAOG;AACG,SAAU,uBAAuB,CAAC,SAA8B,EAAA;IACpE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,KAAK,EAAE;QAClD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACjC;AAEA,IAAA,IAAI,SAAS,KAAK,IAAI,EAAE;QACtB,OAAO;AACL,YAAA,KAAK,EAAE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AkB,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;8GAncW,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;;;ACtBD;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/cdk",
|
|
3
|
-
"version": "22.4.
|
|
3
|
+
"version": "22.4.50",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/core": "22.4.
|
|
5
|
+
"@acorex/core": "22.4.50",
|
|
6
6
|
"@tiptap/core": ">=3.31.4",
|
|
7
7
|
"@tiptap/extension-color": ">=3.31.4",
|
|
8
8
|
"@tiptap/extension-highlight": ">=3.31.4",
|
|
@@ -32,6 +32,31 @@ declare function parseCssTimeList(value: string): number[];
|
|
|
32
32
|
/** Maps theme duration utility classes to milliseconds (see tailwind-base). */
|
|
33
33
|
declare function getAnimationDurationFromClasses(classes: string[]): number;
|
|
34
34
|
declare function getOverlayAnimationTimeout(element: HTMLElement, documentRef: Document, fallbackMs?: number): number;
|
|
35
|
+
/**
|
|
36
|
+
* How long enter classes may stay on the animation target.
|
|
37
|
+
* Prefers computed `animation-duration` + `animation-delay`. A positive
|
|
38
|
+
* `fallbackMs` passed to `getOverlayAnimationTimeout` ignores computed style,
|
|
39
|
+
* and the class map's 500ms default is shorter than a bare 1s `fadeIn`, so
|
|
40
|
+
* neither is used to arm this timeout.
|
|
41
|
+
* When computed time is 0 the clock is not running; a positive timeout still
|
|
42
|
+
* strips the classes so fill-mode `both` cannot keep opacity at 0.
|
|
43
|
+
*/
|
|
44
|
+
declare function getEnterOverlayAnimationTimeout(element: HTMLElement, documentRef: Document, enterClasses: string[]): number;
|
|
45
|
+
/**
|
|
46
|
+
* Applies enter classes, then removes only those classes after `fadeIn` ends.
|
|
47
|
+
* `prefers-reduced-motion` applies nothing and arms no timer.
|
|
48
|
+
* The returned cancel function leaves classes and inline `animationDuration`
|
|
49
|
+
* untouched so a leave animation can still run.
|
|
50
|
+
*/
|
|
51
|
+
declare function startOverlayEnterAnimation(element: HTMLElement, enterClasses: string[], documentRef: Document, reduceMotion: boolean): () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Removes `enterClasses` from `element` on its own `fadeIn` `animationend`, or
|
|
54
|
+
* when `getEnterOverlayAnimationTimeout` elapses, whichever is first.
|
|
55
|
+
* Does not clear `element.style.animationDuration` (`waitForOverlayAnimationEnd`
|
|
56
|
+
* does, and that would wipe the duration leave has just set).
|
|
57
|
+
* Cancel is idempotent with the finish path and does not remove classes.
|
|
58
|
+
*/
|
|
59
|
+
declare function scheduleOverlayEnterAnimationCleanup(element: HTMLElement, enterClasses: string[], documentRef: Document): () => void;
|
|
35
60
|
declare function playOverlayLeaveAnimation(element: HTMLElement, enter: string[], leave: string[], documentRef: Document): Promise<void>;
|
|
36
61
|
declare function waitForOverlayAnimationEnd(element: HTMLElement, documentRef: Document, options?: {
|
|
37
62
|
fallbackMs?: number;
|
|
@@ -241,5 +266,5 @@ declare class AXOverlayService {
|
|
|
241
266
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
242
267
|
}
|
|
243
268
|
|
|
244
|
-
export { APPEARANCE_CLASSES, AXOverlayService, AX_OVERLAY_DEFAULT_ENTER_ANIMATION, AX_OVERLAY_DEFAULT_LEAVE_ANIMATION, CONTRAST_CLASSES, MANAGED_OVERLAY_VISUAL_CLASSES, SIZE_CLASSES, THEME_CLASSES, applyOverlayAnimationClasses, applyVisualContext, calculateAnchorPosition, clampToViewport, findBestPosition, fitsInViewport, getAnimationDurationFromClasses, getOverlayAnimationTarget, getOverlayAnimationTimeout, parseCssTimeList, playOverlayLeaveAnimation, prefersReducedMotion, removeOverlayAnimationClasses, resolveContextElement, resolveOverlayAnimation, resolveVisualContext, waitForOverlayAnimationEnd };
|
|
269
|
+
export { APPEARANCE_CLASSES, AXOverlayService, AX_OVERLAY_DEFAULT_ENTER_ANIMATION, AX_OVERLAY_DEFAULT_LEAVE_ANIMATION, CONTRAST_CLASSES, MANAGED_OVERLAY_VISUAL_CLASSES, SIZE_CLASSES, THEME_CLASSES, applyOverlayAnimationClasses, applyVisualContext, calculateAnchorPosition, clampToViewport, findBestPosition, fitsInViewport, getAnimationDurationFromClasses, getEnterOverlayAnimationTimeout, getOverlayAnimationTarget, getOverlayAnimationTimeout, parseCssTimeList, playOverlayLeaveAnimation, prefersReducedMotion, removeOverlayAnimationClasses, resolveContextElement, resolveOverlayAnimation, resolveVisualContext, scheduleOverlayEnterAnimationCleanup, startOverlayEnterAnimation, waitForOverlayAnimationEnd };
|
|
245
270
|
export type { AXOverlayAnchorOptions, AXOverlayAnimation, AXOverlayOptions, AXOverlayRef, AXOverlayResolvedAnimation, AXOverlayVisualContext, AXOverlayVisualContextScope };
|