@acorex/cdk 22.4.43 → 22.4.45
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.
|
@@ -565,6 +565,7 @@ class AXDragDirective {
|
|
|
565
565
|
this.clonedElementViewRef = signal(null, /* @ts-ignore */
|
|
566
566
|
...(ngDevMode ? [{ debugName: "clonedElementViewRef" }] : /* istanbul ignore next */ []));
|
|
567
567
|
this.rafId = null;
|
|
568
|
+
this.appliedTranslate = { x: 0, y: 0 };
|
|
568
569
|
this.pendingPointerEvent = null;
|
|
569
570
|
this.savedBodyCursor = null;
|
|
570
571
|
this.holdDelayTimer = null;
|
|
@@ -1143,11 +1144,12 @@ class AXDragDirective {
|
|
|
1143
1144
|
setPosition(x, y) {
|
|
1144
1145
|
let constrainedX = x;
|
|
1145
1146
|
let constrainedY = y;
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
const
|
|
1150
|
-
const
|
|
1147
|
+
const boundaryRect = this.boundaryElement()?.getBoundingClientRect();
|
|
1148
|
+
if (boundaryRect) {
|
|
1149
|
+
// Measured on every move: the element or boundary may have been resized or re-laid out since the last drag.
|
|
1150
|
+
const elementRect = this.element().getBoundingClientRect();
|
|
1151
|
+
const minX = boundaryRect.left - (elementRect.left - this.appliedTranslate.x);
|
|
1152
|
+
const minY = boundaryRect.top - (elementRect.top - this.appliedTranslate.y);
|
|
1151
1153
|
const maxX = minX + boundaryRect.width - elementRect.width;
|
|
1152
1154
|
const maxY = minY + boundaryRect.height - elementRect.height;
|
|
1153
1155
|
constrainedX = clamp(x, minX, maxX);
|
|
@@ -1159,6 +1161,7 @@ class AXDragDirective {
|
|
|
1159
1161
|
constrainedX = this.currentAxis().x;
|
|
1160
1162
|
// Direct DOM manipulation without triggering change detection
|
|
1161
1163
|
this.renderer.setStyle(this.element(), 'translate', `${constrainedX}px ${constrainedY}px`);
|
|
1164
|
+
this.appliedTranslate = { x: constrainedX, y: constrainedY };
|
|
1162
1165
|
// Only update signal and emit if position actually changed significantly (throttle)
|
|
1163
1166
|
const current = this.currentAxis();
|
|
1164
1167
|
if (Math.abs(current.x - constrainedX) > 0.5 || Math.abs(current.y - constrainedY) > 0.5) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-drag-drop.mjs","sources":["../../../../packages/cdk/drag-drop/src/lib/drag-parent.ts","../../../../packages/cdk/drag-drop/src/lib/drag-handle.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drop-list.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drag.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drop-zone.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drag-drop.module.ts","../../../../packages/cdk/drag-drop/src/lib/drag-drop.utils.ts","../../../../packages/cdk/drag-drop/src/acorex-cdk-drag-drop.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { AXDragHandleDirective } from './drag-handle.directive';\n\n/**\n * Parent drag instance that nested `axDragHandle` directives register with.\n * Provided by `AXDragDirective` so handles work inside dynamically created content.\n */\nexport const AX_DRAG_PARENT = new InjectionToken<AXDragParent>('AX_DRAG_PARENT');\n\nexport interface AXDragParent {\n registerHandle(handle: AXDragHandleDirective | HTMLElement): void;\n unregisterHandle(handle: AXDragHandleDirective | HTMLElement): void;\n}\n","import { DestroyRef, Directive, ElementRef, inject, signal } from '@angular/core';\nimport { AX_DRAG_PARENT } from './drag-parent';\n\n@Directive({\n selector: '[axDragHandle]',\n})\nexport class AXDragHandleDirective {\n private el = inject(ElementRef<HTMLElement>);\n private parent = inject(AX_DRAG_PARENT, { optional: true });\n readonly element = signal(this.el.nativeElement);\n\n constructor() {\n this.parent?.registerHandle(this);\n inject(DestroyRef).onDestroy(() => this.parent?.unregisterHandle(this));\n }\n}\n","import { NXComponent, NXNativeEvent } from '@acorex/cdk/common';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n PLATFORM_ID,\n Renderer2,\n signal,\n} from '@angular/core';\nimport { AXDragDirective } from './drag.directive';\n\n/** Describes the cached geometric data of a draggable item within the list. */\ninterface DropListItemData {\n item: AXDragDirective;\n element: HTMLElement;\n initialRect: DOMRect;\n width: number;\n height: number;\n margins: { top: number; bottom: number; left: number; right: number };\n}\n\n/** Event object emitted when an item is dropped into a drop list. */\nexport interface AXDropListDroppedEvent extends NXNativeEvent<AXDropListDirective, MouseEvent> {\n item: AXDragDirective;\n currentIndex: number;\n previousIndex: number;\n container: AXDropListDirective;\n previousContainer: AXDropListDirective;\n}\n\n/**\n * @Directive axDropList\n *\n * Manages a list of draggable items (`axDrag`), enabling sorting within the list\n * and transferring items between compatible lists. It handles the visual shifting\n * of items during a drag operation to provide a clear preview of the drop location.\n *\n * This directive automatically detects `gap` from flexbox/grid layouts and handles\n * items with variable sizes and margins.\n */\n@Directive({\n selector: '[axDropList]',\n exportAs: 'axDropList',\n})\nexport class AXDropListDirective extends NXComponent implements OnInit, AfterContentInit, OnDestroy {\n private readonly _zone = inject(NgZone);\n private readonly _renderer = inject(Renderer2);\n private readonly _cdr = inject(ChangeDetectorRef);\n private readonly _platformId = inject(PLATFORM_ID);\n private readonly _hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n // --- Public API: Inputs and Outputs ---\n\n /** Boolean input matching the directive selector name for conditional application. */\n axDropList = input(true, { transform: (value: boolean | string) => value === '' || value === true });\n /** Whether sorting within this list is disabled. */\n sortingDisabled = input(false);\n /** The group this drop list belongs to. Dragging is only allowed between lists of the same group. */\n dropListGroup = input<string>();\n /** The layout orientation of the list. */\n dropListOrientation = input<'horizontal' | 'vertical'>('vertical');\n /** Emits when an item is dropped into the list. */\n dropListDropped = output<AXDropListDroppedEvent>();\n /** Emits when the sort preview transforms change during an active drag. */\n sortPreviewChanged = output<void>();\n\n /** The `axDrag` directives that are direct children of this list. */\n readonly _draggableItems = contentChildren(AXDragDirective, { descendants: false });\n\n // --- Internal State Management ---\n\n /** The native element of the drop list. */\n readonly element = this._hostEl.nativeElement;\n\n /** The draggable item currently being moved over this list. */\n private readonly _activeDragItem = signal<AXDragDirective | null>(null);\n /** The calculated index where the placeholder/item should be. */\n private readonly _placeholderIndex = signal(-1);\n /** A snapshot of the items' data and geometry at the start of the drag. */\n private readonly _cachedItems = signal<readonly DropListItemData[]>([]);\n /** The list's initial bounding box, used to calculate scroll delta. */\n private readonly _listInitialRect = signal<DOMRect | null>(null);\n /** The detected `gap` of the list for the current orientation. */\n private readonly _listGap = signal(0);\n /** Whether the list is in RTL direction (cached at drag start). */\n private readonly _isRtl = signal(false);\n\n /** Internal orientation state; can be overridden programmatically by host components. */\n readonly orientation = linkedSignal(() => this.dropListOrientation());\n /** Internal sorting-disabled state; can be overridden programmatically by host components. */\n readonly isSortingDisabled = linkedSignal(() => this.sortingDisabled());\n\n /** DOM placeholder element for inter-list drags */\n private _placeholderElement: HTMLElement | null = null;\n\n ngOnInit(): void {\n if (isPlatformBrowser(this._platformId)) {\n this.element.dataset['axDropList'] = 'true';\n this.element.classList.add('ax-drop-list-sorting-transition');\n // Store reference to this directive instance on the element for drag directive access\n (this.element as HTMLElement & { __axContext__?: AXDropListDirective })['__axContext__'] = this;\n }\n }\n\n ngAfterContentInit(): void {\n this._cdr.detectChanges();\n }\n\n ngOnDestroy(): void {\n // Clean up placeholder element if directive destroyed during drag\n this._removePlaceholderElement();\n }\n\n // --- Public Methods (for internal library use) ---\n\n /** Checks if the given drag item is the one currently active in this list. */\n isDragActiveForThisList(dragItem: AXDragDirective): boolean {\n return this._activeDragItem() === dragItem;\n }\n\n /** Whether the list is horizontal and in RTL direction. */\n private isHorizontalRtl(): boolean {\n return this.orientation() === 'horizontal' && this._isRtl();\n }\n\n /**\n * Prepares the list for sorting when a drag operation starts from within this list.\n * @param dragItem The item that is being dragged.\n */\n prepareSort(dragItem: AXDragDirective): void {\n if (!this.axDropList() || this.isSortingDisabled() || this._activeDragItem() || dragItem.isDragDisabled()) return;\n\n this._activeDragItem.set(dragItem);\n this.element.classList.add('ax-drop-list-sorting-active');\n\n requestAnimationFrame(() => {\n this._zone.run(() => {\n this._cacheGeometry();\n const placeholderIdx = this._cachedItems().findIndex((data) => data.item === dragItem);\n this._placeholderIndex.set(placeholderIdx);\n });\n });\n }\n\n /**\n * Prepares the list for receiving an item that started dragging from another list.\n * @param dragItem The item entering this list.\n */\n enter(dragItem: AXDragDirective): void {\n if (!this.axDropList() || this.isSortingDisabled() || this.isDragActiveForThisList(dragItem)) return;\n\n // Clean up any existing placeholder from previous list\n this._removePlaceholderElement();\n\n this._activeDragItem.set(dragItem);\n this.element.classList.add('ax-drop-list-sorting-active');\n requestAnimationFrame(() => this._zone.run(() => this._cacheGeometry()));\n }\n\n /**\n * Calculates the new placeholder index based on the pointer's position and applies visual shifts.\n * @param event The pointer move event.\n * @param dragItem The item being dragged.\n */\n sort(event: PointerEvent, dragItem: AXDragDirective): void {\n if (\n !this.axDropList() ||\n !this.isDragActiveForThisList(dragItem) ||\n this.isSortingDisabled() ||\n !this._listInitialRect()\n )\n return;\n\n const pointerPosition = this.orientation() === 'vertical' ? event.clientY : event.clientX;\n const newPlaceholderIndex = this._calculatePlaceholderIndex(pointerPosition);\n\n if (this._placeholderIndex() !== newPlaceholderIndex) {\n this._placeholderIndex.set(newPlaceholderIndex);\n this._applyVisualShifts();\n }\n }\n\n /**\n * Finalizes the drop, emits the drop event, and resets the list's state.\n * @param event The pointer up event.\n * @param droppedItem The item that was dropped.\n * @param sourceList The list where the drag originated.\n */\n finalizeSort(event: PointerEvent, droppedItem: AXDragDirective, sourceList: AXDropListDirective): void {\n if (!this.axDropList() || !this.isDragActiveForThisList(droppedItem) || this.isSortingDisabled()) {\n this.resetSortStateAndStyles(sourceList);\n return;\n }\n\n const activeItem = this._activeDragItem();\n const targetSlotIndex = this._placeholderIndex();\n if (!activeItem || targetSlotIndex === -1) {\n this.resetSortStateAndStyles(sourceList);\n return;\n }\n\n const previousIndex = sourceList._cachedItems().findIndex((d) => d.item === activeItem);\n // Adjust the index for array mutation if moving an item to a later position in the same list.\n const currentIndex =\n sourceList === this && previousIndex !== -1 && targetSlotIndex > previousIndex\n ? targetSlotIndex - 1\n : targetSlotIndex;\n\n this.dropListDropped.emit({\n nativeEvent: event,\n sender: this,\n item: activeItem,\n previousIndex,\n currentIndex,\n container: this,\n previousContainer: sourceList,\n });\n\n this.resetSortStateAndStyles(sourceList);\n }\n\n /** Resets the transforms on all items and cancels the current sort operation. */\n cancelSort(dragItem?: AXDragDirective): void {\n if (dragItem && !this.isDragActiveForThisList(dragItem)) return;\n this._resetAllTransforms();\n this.resetSortState();\n }\n\n /** Resets transforms but keeps the active state, used when moving between lists. */\n cancelSortPreview(): void {\n if (!this._activeDragItem()) return;\n this._resetAllTransforms();\n const originalIndex = this._cachedItems().findIndex((d) => d.item === this._activeDragItem());\n this._placeholderIndex.set(originalIndex > -1 ? originalIndex : -1);\n }\n\n // --- Private Helper Methods ---\n\n /** Caches the geometry of the list and its items at the start of a drag. */\n private _cacheGeometry(): void {\n this._listInitialRect.set(this.element.getBoundingClientRect());\n this._isRtl.set(AXHtmlUtil.isRtl(this.element));\n this._detectAndCacheListGap();\n\n const items = [...this._draggableItems()]\n .sort((a, b) =>\n a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n )\n .map((itemDraggable) => {\n const el = itemDraggable.element();\n const style = window.getComputedStyle(el);\n const rect = el.getBoundingClientRect();\n return {\n item: itemDraggable,\n element: el,\n initialRect: rect,\n width: rect.width,\n height: rect.height,\n margins: {\n top: parseFloat(style.marginTop),\n bottom: parseFloat(style.marginBottom),\n left: parseFloat(style.marginLeft),\n right: parseFloat(style.marginRight),\n },\n };\n });\n this._cachedItems.set(items);\n }\n\n /** Detects and caches the `gap` property from the list's computed styles. */\n private _detectAndCacheListGap(): void {\n const listStyle = window.getComputedStyle(this.element);\n const gapValue = listStyle.getPropertyValue('gap');\n if (gapValue && gapValue !== 'normal') {\n const gapParts = gapValue.split(' ');\n const rowGap = parseFloat(gapParts[0]);\n const columnGap = parseFloat(gapParts[1] || gapParts[0]);\n this._listGap.set(this.orientation() === 'vertical' ? rowGap : columnGap);\n } else {\n this._listGap.set(0);\n }\n }\n\n /**\n * Determines the new placeholder index by comparing the pointer position against the\n * midpoints of the other items in the list.\n * @param pointerPosition The clientX or clientY of the pointer.\n * @returns The calculated placeholder index.\n */\n private _calculatePlaceholderIndex(pointerPosition: number): number {\n const activeItem = this._activeDragItem();\n const listRect = this._listInitialRect();\n if (!activeItem || !listRect) return -1;\n\n const cachedItems = this._cachedItems();\n const originalIndex = cachedItems.findIndex((d) => d.item === activeItem);\n const siblings = cachedItems.filter((d) => d.item !== activeItem);\n const scrollDelta =\n this.orientation() === 'vertical'\n ? this.element.getBoundingClientRect().top - listRect.top\n : this.element.getBoundingClientRect().left - listRect.left;\n\n let newIndexInSiblings = -1;\n for (let i = 0; i < siblings.length; i++) {\n const sibling = siblings[i];\n const itemMidPoint =\n (this.orientation() === 'vertical' ? sibling.initialRect.top : sibling.initialRect.left) +\n scrollDelta +\n (this.orientation() === 'vertical' ? sibling.height : sibling.width) / 2;\n\n const isBeforeSibling = this.isHorizontalRtl()\n ? pointerPosition > itemMidPoint\n : pointerPosition < itemMidPoint;\n if (isBeforeSibling) {\n newIndexInSiblings = i;\n break;\n }\n }\n\n if (newIndexInSiblings === -1) {\n newIndexInSiblings = siblings.length;\n }\n\n // Map the index from the 'siblings' array back to the original `_cachedItems` array.\n const potentialPlaceholderIndex =\n originalIndex > -1 && newIndexInSiblings >= originalIndex ? newIndexInSiblings + 1 : newIndexInSiblings;\n\n // A drag starting from outside the list doesn't have an original index.\n if (originalIndex === -1) {\n return potentialPlaceholderIndex;\n }\n\n // --- New logic: Prevent crossing disabled items ---\n const start = Math.min(originalIndex, potentialPlaceholderIndex);\n const end = Math.max(originalIndex, potentialPlaceholderIndex);\n\n for (let i = start; i < end; i++) {\n const itemData = cachedItems[i];\n if (itemData.item !== activeItem && itemData.item.isDragDisabled()) {\n // We've hit a disabled \"wall\". Stop the placeholder at the boundary.\n if (potentialPlaceholderIndex > originalIndex) {\n return i; // Dragging down/right: stop *before* the wall.\n } else {\n return i + 1; // Dragging up/left: stop *after* the wall.\n }\n }\n }\n return potentialPlaceholderIndex;\n }\n\n /** Applies visual shifts - uses placeholder for inter-list, transforms for intra-list. */\n private _applyVisualShifts(): void {\n const activeItem = this._activeDragItem();\n const originalIndex = this._cachedItems().findIndex((d) => d.item === activeItem);\n const isIntraListDrag = originalIndex > -1;\n const placeholderIndex = this._placeholderIndex();\n\n // Check if this is an \"onto-node\" drop list (no items, just a drop target)\n const isOntoNodeList = this.element.dataset['dropType'] === 'onto-node';\n\n if (!isIntraListDrag && activeItem && !isOntoNodeList && this._cachedItems().length > 0) {\n // --- INTER-LIST DRAG: Use DOM placeholder for reorder lists with items ---\n this._updatePlaceholderElement(activeItem, placeholderIndex);\n } else {\n // --- INTRA-LIST DRAG: Use transforms (works well for same-list reordering) ---\n this._removePlaceholderElement();\n\n const getItemSpace = (itemData: DropListItemData) =>\n this.orientation() === 'vertical'\n ? itemData.height + itemData.margins.top + itemData.margins.bottom\n : itemData.width + itemData.margins.left + itemData.margins.right;\n\n const draggedItemSize = isIntraListDrag ? getItemSpace(this._cachedItems()[originalIndex]) : 0;\n\n const axisSign = this.isHorizontalRtl() ? -1 : 1;\n\n this._cachedItems().forEach((data, index) => {\n if (data.item.isDragDisabled()) {\n this._renderer.removeStyle(data.element, 'transform');\n return;\n }\n const transform = this._calculateTransform(index, originalIndex, draggedItemSize, getItemSpace);\n const signedTransform = transform * axisSign;\n this._renderer.setStyle(\n data.element,\n 'transform',\n transform\n ? `${this.orientation() === 'vertical' ? 'translateY' : 'translateX'}(${signedTransform}px)`\n : '',\n );\n });\n }\n\n this.sortPreviewChanged.emit();\n }\n\n /** Creates or moves the placeholder element for inter-list drags */\n private _updatePlaceholderElement(activeItem: AXDragDirective, targetIndex: number): void {\n const rect = activeItem.elementRect();\n if (!rect) return;\n\n // Create placeholder as a clone of the dragged element\n if (!this._placeholderElement) {\n // Clone the entire dragged element\n const sourceElement = activeItem.element();\n this._placeholderElement = sourceElement.cloneNode(true) as HTMLElement;\n \n // Mark it as a placeholder\n this._renderer.addClass(this._placeholderElement, 'ax-drop-placeholder');\n this._renderer.addClass(this._placeholderElement, 'ax-drag-placeholder');\n \n // Prevent interaction with cloned content\n this._renderer.setStyle(this._placeholderElement, 'pointerEvents', 'none');\n \n // Add faded styling to indicate it's a placeholder\n this._renderer.setStyle(this._placeholderElement, 'opacity', '0.4');\n this._renderer.setStyle(this._placeholderElement, 'transition', 'all 200ms ease');\n }\n\n // Insert/move placeholder at target index\n const items = this._cachedItems();\n if (targetIndex >= 0 && targetIndex < items.length) {\n const targetItem = items[targetIndex];\n if (targetItem && targetItem.element) {\n this._renderer.insertBefore(this.element, this._placeholderElement, targetItem.element);\n } else {\n // Fallback: append at end if target item invalid\n this._renderer.appendChild(this.element, this._placeholderElement);\n }\n } else {\n // Insert at end\n this._renderer.appendChild(this.element, this._placeholderElement);\n }\n }\n\n /** Removes the placeholder element if it exists */\n private _removePlaceholderElement(): void {\n if (this._placeholderElement) {\n this._renderer.removeChild(this.element, this._placeholderElement);\n this._placeholderElement = null;\n }\n }\n\n /**\n * Calculates the required transform in pixels for a single item.\n * @param index The index of the item to transform.\n * @param originalIndex The original index of the dragged item (-1 if from another list).\n * @param draggedItemSize The size (including margins) of the item being dragged.\n * @param getItemSpace A helper function to get an item's size including margins.\n * @returns The transform value in pixels.\n */\n private _calculateTransform(\n index: number,\n originalIndex: number,\n draggedItemSize: number,\n getItemSpace: (item: DropListItemData) => number,\n ): number {\n const targetIndex = this._placeholderIndex();\n const listGap = this._listGap();\n\n if (originalIndex > -1) {\n // --- Intra-list Drag ---\n if (index === originalIndex) {\n // The dragged item moves by the sum of the sizes of the items it passes over, PLUS the gaps between them.\n let offset = 0;\n if (targetIndex > originalIndex) {\n // Dragging down/right\n for (let i = originalIndex + 1; i < targetIndex; i++) {\n offset += getItemSpace(this._cachedItems()[i]) + listGap;\n }\n } else {\n // Dragging up/left\n for (let i = targetIndex; i < originalIndex; i++) {\n offset -= getItemSpace(this._cachedItems()[i]) + listGap;\n }\n }\n return offset;\n } else {\n // It's a sibling item that needs to make space.\n // It moves by the size of the dragged item, plus ONE gap to fill the void.\n const shift = draggedItemSize + listGap;\n if (originalIndex < targetIndex && index > originalIndex && index < targetIndex) {\n return -shift;\n } else if (originalIndex > targetIndex && index >= targetIndex && index < originalIndex) {\n return shift;\n }\n }\n } else {\n // --- Inter-list Drag (from another list) ---\n if (index >= targetIndex) {\n // An item from another list enters. Siblings shift by its size plus ONE gap.\n return draggedItemSize + listGap;\n }\n }\n return 0;\n }\n\n /** Resets the state of this list and the source list after a drop. */\n private resetSortStateAndStyles(sourceList: AXDropListDirective): void {\n const listsToReset = new Set([this, sourceList]);\n listsToReset.forEach((list) => {\n if (list) {\n list._resetAllTransforms();\n list.resetSortState();\n }\n });\n }\n\n /** Removes all `transform` styles from the items in this list. */\n private _resetAllTransforms(): void {\n this._cachedItems().forEach((data) => this._renderer.setStyle(data.element, 'transform', ''));\n this._removePlaceholderElement(); // Clean up inter-list placeholder\n this.sortPreviewChanged.emit();\n }\n\n /** Resets the internal state of the directive to its initial values. */\n resetSortState(): void {\n this.element.classList.remove('ax-drop-list-sorting-active');\n this._activeDragItem.set(null);\n this._cachedItems.set([]);\n this._placeholderIndex.set(-1);\n this._listInitialRect.set(null);\n this._listGap.set(0);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectorRef,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n NgZone,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n Renderer2,\n RendererStyleFlags2,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n} from '@angular/core';\nimport { clamp } from 'lodash-es';\nimport { AXDragHandleDirective } from './drag-handle.directive';\nimport { AX_DRAG_PARENT, AXDragParent } from './drag-parent';\nimport { AXDropListDirective } from './drop-list.directive';\nimport { AXDropZoneDirective } from './drop-zone.directive';\n\ntype AXPositionType = { x: number; y: number };\n\n// Zone detection constants for nested drop lists (tree nodes)\nconst ZONE_TOP_THRESHOLD = 0.3; // Top 30% triggers reorder BEFORE\nconst ZONE_BOTTOM_THRESHOLD = 0.7; // Bottom 30% triggers reorder AFTER\n// Middle 40% (between thresholds) triggers drop INTO\n\n@Directive({\n selector: '[axDrag]',\n providers: [{ provide: AX_DRAG_PARENT, useExisting: AXDragDirective }],\n})\nexport class AXDragDirective implements OnInit, OnDestroy, AXDragParent {\n private zone = inject(NgZone);\n private document = inject(DOCUMENT);\n private renderer = inject(Renderer2);\n private cdr = inject(ChangeDetectorRef);\n private platformId = inject(PLATFORM_ID);\n private viewContainerRef = inject(ViewContainerRef);\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private registeredHandleElements = signal<HTMLElement[]>([]);\n\n axDrag = input(true, { transform: (value: boolean | string) => value === '' || value === true });\n dragData = input();\n dragDisabled = input(false);\n dragTransition = input(true);\n dragElementClone = input(false);\n dropZoneGroup = input<string>();\n dragStartDelay = input<number>();\n dragResetOnDblClick = input(true);\n dragLockAxis = input<'x' | 'y' | null>(null);\n dragClonedTemplate = input<TemplateRef<unknown>>();\n dragCursor = input<'move' | 'grab' | 'grab-on-drag' | 'none'>('move');\n dragBoundary = input<string | ElementRef<HTMLElement> | HTMLElement>();\n dragTransitionDuration = input<number>(150);\n\n readonly isDragDisabled = linkedSignal(() => this.dragDisabled());\n readonly lockAxis = linkedSignal(() => this.dragLockAxis());\n readonly dragBoundaryOverride = linkedSignal<\n string | ElementRef<HTMLElement> | HTMLElement | null | undefined\n >(() => this.dragBoundary());\n readonly startDelay = linkedSignal(() => this.dragStartDelay() ?? 0);\n readonly dragTouchAction = linkedSignal<'none' | 'pan-x' | 'pan-y'>(() => 'none');\n readonly dragCursorOverride = linkedSignal<'move' | 'grab' | 'grab-on-drag' | 'none'>(() => this.dragCursor());\n\n dragPositionChanged = output<AXPositionType>();\n\n isMoving = signal<boolean>(false);\n clonedElement = signal<HTMLElement | null>(null);\n currentAxis = signal<AXPositionType>({ x: 0, y: 0 });\n currentCloneAxis = signal<AXPositionType>({ x: 0, y: 0 });\n transitionDuration = linkedSignal(() => this.dragTransitionDuration());\n readonly element = signal<HTMLElement>(this.el.nativeElement);\n private dragStartTime = signal<number>(0);\n private isDragging = signal<boolean>(false);\n private elementOpacity = signal<string>('1');\n private movedAfterDelay = signal<boolean>(false);\n private activePointerId = signal<number | null>(null);\n private prevDropZone = signal<AXDropZoneDirective | null>(null);\n private dragStartOffset = signal<AXPositionType>({ x: 0, y: 0 });\n private pointerDownPosition = signal<AXPositionType>({ x: 0, y: 0 });\n private clonePointerOffset = signal<AXPositionType>({ x: 0, y: 0 });\n private clonedElementViewRef = signal<EmbeddedViewRef<unknown> | null>(null);\n private rafId: number | null = null;\n private pendingPointerEvent: PointerEvent | null = null;\n private savedBodyCursor: string | null = null;\n private holdDelayTimer: ReturnType<typeof setTimeout> | null = null;\n private holdDelayReady = signal(false);\n\n private _parentDropList = inject(AXDropListDirective, { optional: true, skipSelf: true, host: false });\n private _currentDropList = signal<AXDropListDirective | null>(null);\n readonly createCloneElement = computed<boolean>(() => this.dragElementClone() || !!this._parentDropList);\n\n private boundaryElement = computed<HTMLElement | null>(() => {\n const boundary = this.dragBoundaryOverride();\n if (!boundary) {\n return null;\n }\n if (typeof boundary === 'string') {\n return this.document.querySelector<HTMLElement>(boundary);\n }\n return boundary instanceof ElementRef ? boundary.nativeElement : boundary;\n });\n\n readonly elementRect = computed(() => {\n if (!isPlatformBrowser(this.platformId)) {\n return null;\n }\n return this.element().getBoundingClientRect();\n });\n\n private boundaryRect = computed(() => {\n if (!isPlatformBrowser(this.platformId)) {\n return null;\n }\n return this.boundaryElement()?.getBoundingClientRect();\n });\n\n private handleElements = computed(() => {\n const registered = this.registeredHandleElements().filter(Boolean);\n return registered.length ? registered : [this.element()];\n });\n\n private handle = computed(() => this.activeHandleElement() ?? this.handleElements()[0] ?? this.element());\n\n private boundHandleDblClick = this.handleDblClick.bind(this);\n private boundHandlePointerUp = this.handlePointerUp.bind(this);\n private boundHandlePointerDown = this.handlePointerDown.bind(this);\n private boundHandlePointerMove = this.handlePointerMove.bind(this);\n private attachedHandleElements: HTMLElement[] = [];\n private styledHandleElements: HTMLElement[] = [];\n private activeHandleElement = signal<HTMLElement | null>(null);\n\n #dragDisabledEffect = effect(() => {\n const cursor = this.dragCursorOverride();\n const disabled = this.isDragDisabled();\n const handles = this.handleElements();\n const moving = this.isMoving();\n const holdReady = this.holdDelayReady();\n\n for (const previous of this.styledHandleElements) {\n if (!handles.includes(previous)) {\n this.renderer.removeStyle(previous, 'cursor');\n this.renderer.removeStyle(previous, 'touch-action');\n }\n }\n this.styledHandleElements = handles;\n\n for (const handle of handles) {\n if (disabled || cursor === 'none' || cursor === 'grab-on-drag') {\n if (!moving && !holdReady) {\n this.renderer.removeStyle(handle, 'cursor');\n }\n if (disabled) {\n this.renderer.removeStyle(handle, 'touch-action');\n } else {\n this.renderer.setStyle(handle, 'touch-action', this.dragTouchAction());\n }\n continue;\n }\n\n if (!moving && !holdReady) {\n this.renderer.setStyle(handle, 'cursor', cursor);\n }\n this.renderer.setStyle(handle, 'touch-action', this.dragTouchAction());\n }\n });\n\n #handleChangeEffect = effect(() => {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const currentHandles = this.handleElements();\n const previousHandles = this.attachedHandleElements;\n\n for (const previous of previousHandles) {\n if (!currentHandles.includes(previous)) {\n previous.removeEventListener('dblclick', this.boundHandleDblClick);\n previous.removeEventListener('pointerdown', this.boundHandlePointerDown);\n }\n }\n\n this.zone.runOutsideAngular(() => {\n for (const current of currentHandles) {\n if (!previousHandles.includes(current)) {\n current.addEventListener('dblclick', this.boundHandleDblClick);\n current.addEventListener('pointerdown', this.boundHandlePointerDown, { passive: false });\n }\n }\n });\n\n this.attachedHandleElements = currentHandles;\n });\n\n registerHandle(handle: AXDragHandleDirective | HTMLElement): void {\n const element = this.resolveHandleElement(handle);\n if (!element) return;\n this.registeredHandleElements.update((handles) => (handles.includes(element) ? handles : [...handles, element]));\n }\n\n unregisterHandle(handle: AXDragHandleDirective | HTMLElement): void {\n const element = this.resolveHandleElement(handle);\n if (!element) return;\n this.registeredHandleElements.update((handles) => handles.filter((item) => item !== element));\n if (this.activeHandleElement() === element) {\n this.activeHandleElement.set(null);\n }\n }\n\n private resolveHandleElement(handle: AXDragHandleDirective | HTMLElement): HTMLElement | null {\n return handle instanceof HTMLElement ? handle : handle.element();\n }\n\n ngOnInit() {\n if (isPlatformBrowser(this.platformId)) {\n if (this._parentDropList) {\n this.setElementTransition(this.element());\n }\n this.elementOpacity.set(getComputedStyle(this.element()).opacity);\n }\n }\n\n ngOnDestroy() {\n if (isPlatformBrowser(this.platformId)) {\n for (const handle of this.attachedHandleElements) {\n handle.removeEventListener('dblclick', this.boundHandleDblClick);\n handle.removeEventListener('pointerdown', this.boundHandlePointerDown);\n }\n this.attachedHandleElements = [];\n this.removeDocumentListeners();\n if (this.createCloneElement()) {\n this.removeCloneElement();\n }\n if (this._parentDropList && this.isDragging()) {\n this._parentDropList.cancelSort();\n }\n this.clearActiveDragCursor();\n this.clearHoldDelayTimer();\n this.renderer.removeStyle(this.element(), 'z-index');\n }\n }\n\n private usesGrabDragCursor(): boolean {\n const cursor = this.dragCursorOverride();\n return cursor === 'grab' || cursor === 'grab-on-drag';\n }\n\n private resolveDropCursor(canDrop: boolean): string {\n if (this.usesGrabDragCursor()) {\n return canDrop ? 'grabbing' : 'not-allowed';\n }\n return canDrop ? 'move' : 'not-allowed';\n }\n\n private setActiveDragCursor(cursor: string): void {\n if (!isPlatformBrowser(this.platformId)) return;\n\n if (this.savedBodyCursor === null) {\n this.savedBodyCursor = this.document.body.style.cursor;\n }\n this.document.body.style.cursor = cursor;\n }\n\n private clearActiveDragCursor(): void {\n if (!isPlatformBrowser(this.platformId) || this.savedBodyCursor === null) return;\n\n this.document.body.style.cursor = this.savedBodyCursor;\n this.savedBodyCursor = null;\n }\n\n private clearHoldDelayTimer(): void {\n if (this.holdDelayTimer !== null) {\n clearTimeout(this.holdDelayTimer);\n this.holdDelayTimer = null;\n }\n this.holdDelayReady.set(false);\n }\n\n private scheduleHoldDelayFeedback(): void {\n this.clearHoldDelayTimer();\n const delay = this.startDelay();\n const cursorMode = this.dragCursorOverride();\n if (delay <= 0 || (cursorMode !== 'grab' && cursorMode !== 'grab-on-drag')) {\n return;\n }\n\n const readyCursor = cursorMode === 'grab-on-drag' ? 'grab' : 'grabbing';\n\n this.holdDelayTimer = setTimeout(() => {\n this.holdDelayTimer = null;\n if (!this.isDragging() || this.isMoving() || this.isDragDisabled()) {\n return;\n }\n\n this.holdDelayReady.set(true);\n this.renderer.setStyle(this.handle(), 'cursor', readyCursor);\n this.setActiveDragCursor(readyCursor);\n }, delay);\n }\n\n private setElementDropCursor(element: HTMLElement, cursor: string): void {\n this.renderer.setStyle(element, 'cursor', cursor);\n }\n\n private setElementTransition(element: HTMLElement) {\n this.renderer.setStyle(element, 'transition-property', 'transform, opacity, translate');\n this.renderer.setStyle(\n element,\n 'transition-duration',\n `var(--ax-sys-transition-duration,${this.transitionDuration()}ms)`,\n );\n this.renderer.setStyle(element, 'transition-timing-function', 'var(--ax-sys-transition-timing-function)');\n }\n\n private removeElementTransition(element: HTMLElement) {\n this.renderer.setStyle(element, 'transition-property', 'opacity');\n }\n\n private handlePointerDown(e: PointerEvent) {\n if (!isPlatformBrowser(this.platformId)) return;\n if (!this.axDrag() || this.isDragDisabled() || e.button !== 0 || this._parentDropList?.isSortingDisabled()) return;\n\n const handle = e.currentTarget instanceof HTMLElement ? e.currentTarget : this.handle();\n this.activeHandleElement.set(handle);\n\n this.isDragging.set(true);\n this.movedAfterDelay.set(false);\n\n if (this.dragCursorOverride() === 'move') {\n this.renderer.setStyle(handle, 'cursor', 'move');\n }\n\n this.dragStartOffset.set({ x: e.clientX - this.currentAxis().x, y: e.clientY - this.currentAxis().y });\n this.pointerDownPosition.set({ x: e.clientX, y: e.clientY });\n this.renderer.setStyle(handle, 'userSelect', 'none');\n this.activePointerId.set(e.pointerId);\n this.addDocumentListeners();\n\n this.dragStartTime.set(Date.now());\n this.scheduleHoldDelayFeedback();\n }\n\n private handleDblClick() {\n if (!this.dragResetOnDblClick() || this.isDragDisabled()) return;\n this.setPosition(0, 0);\n }\n\n private handlePointerMove(e: PointerEvent) {\n if (!this.isDragging() || !isPlatformBrowser(this.platformId) || e.pointerId !== this.activePointerId()) {\n return;\n }\n\n if (!this.isMoving()) {\n const delay = this.startDelay();\n const down = this.pointerDownPosition();\n const movedX = e.clientX - down.x;\n const movedY = e.clientY - down.y;\n const movedDistance = Math.sqrt(movedX * movedX + movedY * movedY);\n\n if (delay > 0 && !this.holdDelayReady() && Date.now() - this.dragStartTime() < delay) {\n if (movedDistance > 8) {\n this.abortDragSequence();\n }\n return;\n }\n\n e.preventDefault();\n this.isMoving.set(true);\n this.handle().setPointerCapture(e.pointerId);\n this.startDrag(e);\n } else {\n e.preventDefault();\n }\n\n // Run position updates outside Angular zone for better performance\n this.zone.runOutsideAngular(() => {\n if (this.createCloneElement()) {\n const newCloneX = e.clientX - this.clonePointerOffset().x;\n const newCloneY = e.clientY - this.clonePointerOffset().y;\n this.setClonePosition(newCloneX, newCloneY);\n } else {\n const newX = e.clientX - this.dragStartOffset().x;\n const newY = e.clientY - this.dragStartOffset().y;\n this.setPosition(newX, newY);\n }\n });\n\n // Throttle drop list interactions using requestAnimationFrame\n if (this._parentDropList) {\n this.pendingPointerEvent = e;\n if (this.rafId === null) {\n this.rafId = requestAnimationFrame(() => {\n if (this.pendingPointerEvent) {\n this.handleDropListInteractions(this.pendingPointerEvent);\n this.pendingPointerEvent = null;\n }\n this.rafId = null;\n });\n }\n } else {\n this.dropZoneHoverHandler(e);\n }\n }\n\n private abortDragSequence(): void {\n this.clearHoldDelayTimer();\n this.isDragging.set(false);\n this.isMoving.set(false);\n this.activePointerId.set(null);\n this.removeDocumentListeners();\n this.renderer.removeStyle(this.handle(), 'userSelect');\n this.resetHandleCursorAfterDrag();\n this.clearActiveDragCursor();\n this.activeHandleElement.set(null);\n }\n\n private resetHandleCursorAfterDrag(): void {\n const cursorMode = this.dragCursorOverride();\n if (cursorMode === 'grab') {\n this.renderer.setStyle(this.handle(), 'cursor', 'grab');\n } else if (cursorMode === 'grab-on-drag') {\n this.renderer.removeStyle(this.handle(), 'cursor');\n }\n }\n\n private startDrag(e: PointerEvent) {\n if (this.usesGrabDragCursor()) {\n this.renderer.setStyle(this.handle(), 'cursor', 'grabbing');\n this.setActiveDragCursor('grabbing');\n }\n\n this.renderer.setStyle(this.element(), 'z-index', '1');\n\n // Add CDK-style classes\n this.renderer.addClass(this.element(), 'ax-dragging');\n this.renderer.addClass(this.element(), 'ax-drag-placeholder');\n\n if (this._parentDropList) {\n this._currentDropList.set(this._parentDropList);\n this._parentDropList.prepareSort(this);\n } else {\n this.dropZoneHoverHandler(e);\n }\n\n if (this.createCloneElement()) {\n const elementRect = this.element().getBoundingClientRect();\n this.clonePointerOffset.set({\n x: e.clientX - elementRect.left,\n y: e.clientY - elementRect.top,\n });\n const clone = this.createCloneElementHandler(this.element());\n if (clone) {\n this.renderer.addClass(clone, 'ax-drag-preview');\n this.renderer.addClass(clone, 'ax-dragging');\n }\n }\n }\n\n private handlePointerUp(e: PointerEvent) {\n if (e.pointerId !== this.activePointerId() || !isPlatformBrowser(this.platformId) || !this.isDragging()) {\n return;\n }\n\n this.clearHoldDelayTimer();\n\n this.resetHandleCursorAfterDrag();\n this.clearActiveDragCursor();\n\n const wasMoving = this.isMoving();\n this.isMoving.set(false);\n this.isDragging.set(false);\n\n // Remove CDK-style classes\n this.renderer.removeClass(this.element(), 'ax-dragging');\n this.renderer.removeClass(this.element(), 'ax-drag-placeholder');\n\n if (!wasMoving) {\n this.activePointerId.set(null);\n this.removeDocumentListeners();\n this._currentDropList.set(null);\n this.renderer.removeStyle(this.handle(), 'userSelect');\n this.activeHandleElement.set(null);\n return;\n }\n\n this.renderer.removeStyle(this.element(), 'z-index');\n this.preventClicking();\n\n const transform = this.element().style.transform;\n let x = 0;\n let y = 0;\n if (transform) {\n x = Number(transform.split('translateX(')[1]?.split('px)')[0]);\n y = Number(transform.split('translateY(')[1]?.split('px)')[0]);\n }\n\n const droppedIntoList = this._currentDropList();\n if (droppedIntoList && this._parentDropList) {\n droppedIntoList.finalizeSort(e, this, this._parentDropList);\n } else if (this._parentDropList) {\n this._parentDropList.cancelSort(this);\n } else {\n this.dropZoneDropHandler(e);\n }\n\n // Cancel any pending RAF callbacks\n if (this.rafId !== null) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n this.pendingPointerEvent = null;\n\n this.activePointerId.set(null);\n this.removeDocumentListeners();\n this._currentDropList.set(null);\n this.renderer.removeStyle(this.handle(), 'userSelect');\n this.activeHandleElement.set(null);\n\n if (this.createCloneElement()) {\n const listUnderPointer = this.getDropListFromPoint(e.clientX, e.clientY);\n this.removeCloneElementWithAnimation(x || 0, y || 0, listUnderPointer);\n } else {\n this.renderer.setStyle(this.element(), 'opacity', this.elementOpacity());\n }\n }\n\n private preventClicking() {\n const blockClick = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n this.document.addEventListener('click', blockClick, { capture: true, once: true });\n }\n\n private handleDropListInteractions(e: PointerEvent) {\n const listUnderPointer = this.getDropListFromPoint(e.clientX, e.clientY);\n const previousList = this._currentDropList();\n let targetList: AXDropListDirective | null = null;\n const canDrop = listUnderPointer && this.canDropInList(listUnderPointer);\n\n if (canDrop) {\n targetList = listUnderPointer;\n }\n\n // Update cursor based on whether drop is allowed\n if (listUnderPointer) {\n const cloneEl = this.clonedElement();\n const cursor = this.resolveDropCursor(!!canDrop);\n if (this.usesGrabDragCursor()) {\n this.setActiveDragCursor(cursor);\n } else if (cloneEl) {\n this.setElementDropCursor(cloneEl, cursor);\n } else {\n this.setElementDropCursor(this.element(), cursor);\n }\n }\n\n if (targetList !== previousList) {\n if (previousList) {\n previousList.cancelSortPreview();\n if (previousList !== this._parentDropList) {\n previousList.resetSortState();\n }\n }\n if (targetList) {\n targetList.enter(this);\n }\n this._currentDropList.set(targetList);\n }\n\n this._currentDropList()?.sort(e, this);\n }\n\n private canDropInList(list: AXDropListDirective): boolean {\n if (!list || list.isSortingDisabled() || !this._parentDropList) {\n return false;\n }\n if (list === this._parentDropList) {\n return true;\n }\n const dragGroup = this._parentDropList.dropListGroup();\n const targetGroup = list.dropListGroup();\n\n if (!dragGroup || dragGroup !== targetGroup) {\n return false;\n }\n\n // Check for circular reference (tree-specific validation)\n const draggedNode = this.dragData();\n const targetNodeId = list.element.getAttribute('data-node-id');\n\n if (draggedNode && this.isCircularReference(targetNodeId, draggedNode)) {\n return false;\n }\n\n return true;\n }\n\n private isCircularReference(targetNodeId: string | null, draggedNode: unknown): boolean {\n if (!draggedNode || typeof draggedNode !== 'object') {\n return false;\n }\n\n const node = draggedNode as { id?: string; children?: unknown[] };\n\n // Check if dropping into itself\n if (targetNodeId === node.id) {\n return true;\n }\n\n // Check if targetNodeId is in draggedNode's descendants\n if (!node.children || !Array.isArray(node.children)) {\n return false;\n }\n\n for (const child of node.children) {\n const childNode = child as { id?: string };\n if (childNode.id === targetNodeId) {\n return true;\n }\n if (this.isCircularReference(targetNodeId, child)) {\n return true;\n }\n }\n\n return false;\n }\n\n private dropZoneHoverHandler(e: PointerEvent) {\n const dropZones = this.getDropZonesFromPoint(e.clientX, e.clientY);\n const dropZone = dropZones[0];\n\n if (!dropZone) {\n if (this.prevDropZone()) {\n this.leavePrevDropZone(e);\n }\n return;\n }\n\n if (this.prevDropZone() && this.prevDropZone() !== dropZone) {\n this.leavePrevDropZone(e);\n }\n\n if (this.dropZoneValidation(dropZone) && !dropZone.isHovered()) {\n this.prevDropZone.set(dropZone);\n dropZone.onElementHover.emit({ sender: dropZone, dropped: this, nativeEvent: e, state: 'enter' });\n dropZone.isHovered.set(true);\n }\n }\n\n private dropZoneDropHandler(e: PointerEvent) {\n const dropZones = this.getDropZonesFromPoint(e.clientX, e.clientY);\n const dropZone = dropZones[0];\n if (!this.dropZoneValidation(dropZone)) {\n return;\n }\n dropZone.isHovered.set(false);\n dropZone.onElementDrop.emit({ sender: dropZone, dropped: this, nativeEvent: e });\n }\n\n private getDropZonesFromPoint(x: number, y: number): AXDropZoneDirective[] {\n const elements = this.document.elementsFromPoint(x, y);\n\n return elements\n .filter((el): el is HTMLElement => el instanceof HTMLElement && el.dataset['axDropZone'] === 'true')\n .map((el) => el['__axContext__'] as AXDropZoneDirective);\n }\n\n private getDropListFromPoint(x: number, y: number): AXDropListDirective | null {\n const dropListElements = this.document\n .elementsFromPoint(x, y)\n .filter((el): el is HTMLElement => el instanceof HTMLElement && el.dataset['axDropList'] === 'true');\n\n if (dropListElements.length === 0) {\n return null;\n }\n\n // If only one drop list, use it\n if (dropListElements.length === 1) {\n return dropListElements[0]['__axContext__'] as AXDropListDirective;\n }\n\n // Multiple drop lists detected (nested scenario like tree2)\n // Prioritize based on pointer position and drop type\n const ontoNodeList = dropListElements.find((el) => el.dataset['dropType'] === 'onto-node');\n const reorderList = dropListElements.find((el) => el.dataset['dropType'] !== 'onto-node');\n\n // If no special handling needed, return first\n if (!ontoNodeList || !reorderList) {\n return dropListElements[0]['__axContext__'] as AXDropListDirective;\n }\n\n // Calculate pointer position relative to the \"onto-node\" element\n const ontoNodeRect = ontoNodeList.getBoundingClientRect();\n const relativeY = y - ontoNodeRect.top;\n const heightRatio = relativeY / ontoNodeRect.height;\n\n // Smart zone detection based on pointer position\n if (heightRatio < ZONE_TOP_THRESHOLD || heightRatio > ZONE_BOTTOM_THRESHOLD) {\n // Top or bottom zone: reorder (drop BEFORE/AFTER node)\n return reorderList['__axContext__'] as AXDropListDirective;\n } else {\n // Center zone: onto-node (drop INTO node as child)\n return ontoNodeList['__axContext__'] as AXDropListDirective;\n }\n }\n\n private dropZoneValidation(dropZone: AXDropZoneDirective): boolean {\n if (!dropZone) return false;\n const dragGroup = this.dropZoneGroup();\n const dropGroup = dropZone.dropZoneGroup();\n if (dropGroup && dragGroup !== dropGroup) {\n return false;\n }\n return true;\n }\n\n private leavePrevDropZone(e: PointerEvent) {\n if (this.prevDropZone()) {\n this.prevDropZone().onElementHover.emit({\n dropped: this,\n state: 'leave',\n nativeEvent: e,\n sender: this.prevDropZone(),\n });\n this.prevDropZone().isHovered.set(false);\n this.prevDropZone.set(null);\n }\n }\n\n setPosition(x: number, y: number) {\n let constrainedX = x;\n let constrainedY = y;\n\n const elementRect = this.elementRect();\n const boundaryRect = this.boundaryRect();\n\n if (boundaryRect && elementRect) {\n const minX = boundaryRect.left - elementRect.left;\n const minY = boundaryRect.top - elementRect.top;\n const maxX = minX + boundaryRect.width - elementRect.width;\n const maxY = minY + boundaryRect.height - elementRect.height;\n constrainedX = clamp(x, minX, maxX);\n constrainedY = clamp(y, minY, maxY);\n }\n\n if (this.lockAxis() === 'x') constrainedY = this.currentAxis().y;\n if (this.lockAxis() === 'y') constrainedX = this.currentAxis().x;\n\n // Direct DOM manipulation without triggering change detection\n this.renderer.setStyle(this.element(), 'translate', `${constrainedX}px ${constrainedY}px`);\n\n // Only update signal and emit if position actually changed significantly (throttle)\n const current = this.currentAxis();\n if (Math.abs(current.x - constrainedX) > 0.5 || Math.abs(current.y - constrainedY) > 0.5) {\n this.currentAxis.set({ x: constrainedX, y: constrainedY });\n this.dragPositionChanged.emit({ x: constrainedX, y: constrainedY });\n }\n }\n\n setClonePosition(x: number, y: number) {\n let constrainedX = x;\n let constrainedY = y;\n\n const cloneEl = this.clonedElement();\n const boundaryRect = this.boundaryRect();\n\n if (boundaryRect && cloneEl) {\n const cloneWidth = cloneEl.offsetWidth;\n const cloneHeight = cloneEl.offsetHeight;\n\n constrainedX = clamp(x, boundaryRect.left, boundaryRect.right - cloneWidth);\n constrainedY = clamp(y, boundaryRect.top, boundaryRect.bottom - cloneHeight);\n }\n\n if (this.lockAxis() === 'x') constrainedY = this.currentCloneAxis().y;\n if (this.lockAxis() === 'y') constrainedX = this.currentCloneAxis().x;\n\n // Direct DOM manipulation without triggering change detection\n this.renderer.setStyle(cloneEl, 'translate', `${constrainedX}px ${constrainedY}px`);\n\n // Only update signal and emit if position actually changed significantly (throttle)\n const current = this.currentCloneAxis();\n if (Math.abs(current.x - constrainedX) > 0.5 || Math.abs(current.y - constrainedY) > 0.5) {\n this.currentCloneAxis.set({ x: constrainedX, y: constrainedY });\n this.dragPositionChanged.emit({ x: constrainedX, y: constrainedY });\n }\n }\n\n private createCloneElementHandler(originalElement: HTMLElement): HTMLElement | null {\n if (!isPlatformBrowser(this.platformId)) {\n this.clonedElement.set(null);\n return null;\n }\n\n let clonedElement: HTMLElement;\n const customTemplate = this.dragClonedTemplate();\n\n const applyComputedStylesRecursive = (source: HTMLElement, target: HTMLElement) => {\n if (!isPlatformBrowser(this.platformId)) return;\n const computedStyles = window.getComputedStyle(source);\n\n if (computedStyles.cssText && target.style.cssText !== undefined) {\n let tempCssText = computedStyles.cssText;\n if (target === clonedElement) {\n tempCssText = tempCssText\n .replace(/position:[^;]+;/gi, '')\n .replace(/top:[^;]+;/gi, '')\n .replace(/left:[^;]+;/gi, '')\n .replace(/right:[^;]+;/gi, '')\n .replace(/bottom:[^;]+;/gi, '')\n .replace(/width:[^;]+;/gi, '')\n .replace(/height:[^;]+;/gi, '')\n .replace(/margin[^;]*:[^;]+;/gi, '')\n .replace(/transition[^;]*:[^;]+;/gi, '')\n .replace(/transform:[^;]+;/gi, '')\n .replace(/translate:[^;]+;/gi, '')\n .replace(/z-index:[^;]+;/gi, '')\n .replace(/opacity:[^;]+;/gi, '');\n }\n tempCssText = tempCssText.replace(/pointer-events:[^;]+;/gi, '');\n target.style.cssText = tempCssText;\n } else {\n for (let i = 0; i < computedStyles.length; i++) {\n const propName = computedStyles[i];\n if (propName === 'pointer-events') {\n continue;\n }\n if (\n target === clonedElement &&\n (propName === 'position' ||\n propName === 'top' ||\n propName === 'left' ||\n propName === 'right' ||\n propName === 'bottom' ||\n propName === 'width' ||\n propName === 'height' ||\n propName.startsWith('margin') ||\n propName.startsWith('transition') ||\n propName === 'transform' ||\n propName === 'translate' ||\n propName === 'z-index' ||\n propName === 'opacity')\n ) {\n continue;\n }\n try {\n target.style.setProperty(\n propName,\n computedStyles.getPropertyValue(propName),\n computedStyles.getPropertyPriority(propName),\n );\n } catch {\n // Some CSS properties cannot be set directly, skip silently\n }\n }\n }\n const sourceChildren = Array.from(source.children);\n const targetChildren = Array.from(target.children);\n for (let i = 0; i < sourceChildren.length; i++) {\n if (sourceChildren[i] instanceof HTMLElement && targetChildren[i] instanceof HTMLElement) {\n applyComputedStylesRecursive(sourceChildren[i] as HTMLElement, targetChildren[i] as HTMLElement);\n }\n }\n };\n\n if (customTemplate) {\n const viewRef = this.viewContainerRef.createEmbeddedView(customTemplate);\n this.clonedElementViewRef.set(viewRef);\n\n if (viewRef.rootNodes.length > 0 && viewRef.rootNodes[0] instanceof HTMLElement) {\n clonedElement = viewRef.rootNodes[0] as HTMLElement;\n\n const viewIndex = this.viewContainerRef.indexOf(viewRef);\n if (viewIndex !== -1) {\n this.viewContainerRef.detach(viewIndex);\n }\n } else {\n if (this.clonedElementViewRef()) {\n this.clonedElementViewRef().destroy();\n this.clonedElementViewRef.set(null);\n }\n console.warn(\n 'AXDragDirective: dragClonedTemplate did not produce a valid HTMLElement root node. Falling back to default cloning.',\n );\n clonedElement = originalElement.cloneNode(true) as HTMLElement;\n applyComputedStylesRecursive(originalElement, clonedElement);\n }\n } else {\n clonedElement = originalElement.cloneNode(true) as HTMLElement;\n applyComputedStylesRecursive(originalElement, clonedElement);\n }\n\n if (clonedElement.id) {\n this.renderer.removeAttribute(clonedElement, 'id');\n }\n this.renderer.setStyle(originalElement, 'opacity', '0.5');\n\n const originalRect = originalElement.getBoundingClientRect();\n this.renderer.setStyle(clonedElement, 'position', 'fixed', RendererStyleFlags2.Important);\n this.renderer.setStyle(clonedElement, 'left', '0px');\n this.renderer.setStyle(clonedElement, 'top', '0px');\n if (!customTemplate) {\n this.renderer.setStyle(clonedElement, 'width', `${originalRect.width}px`);\n this.renderer.setStyle(clonedElement, 'height', `${originalRect.height}px`);\n }\n this.renderer.setStyle(clonedElement, 'margin', '0');\n this.renderer.setStyle(clonedElement, 'box-sizing', 'border-box');\n this.renderer.setStyle(clonedElement, 'opacity', '0.75');\n this.renderer.setStyle(clonedElement, 'z-index', '9999');\n this.renderer.setStyle(clonedElement, 'pointer-events', 'none', RendererStyleFlags2.Important);\n this.renderer.setStyle(clonedElement, 'user-select', 'none');\n this.renderer.setStyle(clonedElement, 'touch-action', 'none');\n\n this.renderer.setStyle(clonedElement, 'translate', `${originalRect.left}px ${originalRect.top}px`);\n this.renderer.removeStyle(clonedElement, 'transition');\n this.renderer.removeStyle(clonedElement, 'transition-property');\n\n this.copyPseudoElementStyles(originalElement, clonedElement, '::before');\n this.copyPseudoElementStyles(originalElement, clonedElement, '::after');\n\n this.renderer.appendChild(this.document.body, clonedElement);\n this.clonedElement.set(clonedElement);\n this.setClonePosition(originalRect.left, originalRect.top);\n\n return clonedElement;\n }\n\n private copyPseudoElementStyles(source: HTMLElement, target: HTMLElement, pseudo: '::before' | '::after'): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n const pseudoStyles = window.getComputedStyle(source, pseudo);\n const content = pseudoStyles.getPropertyValue('content');\n const display = pseudoStyles.getPropertyValue('display');\n if (!content || content === 'none' || display === 'none') {\n return;\n }\n const pseudoElement = this.renderer.createElement('span');\n for (let i = 0; i < pseudoStyles.length; i++) {\n const propName = pseudoStyles[i];\n try {\n pseudoElement.style.setProperty(\n propName,\n pseudoStyles.getPropertyValue(propName),\n pseudoStyles.getPropertyPriority(propName),\n );\n } catch (e) {\n // Some properties might fail to set, which is usually fine.\n }\n }\n if (content.startsWith('\"') && content.endsWith('\"')) {\n this.renderer.setProperty(pseudoElement, 'textContent', content.slice(1, -1));\n } else {\n this.renderer.setProperty(pseudoElement, 'textContent', content);\n }\n this.renderer.setStyle(pseudoElement, 'pointer-events', 'none');\n if (pseudo === '::before') {\n this.renderer.insertBefore(target, pseudoElement, target.firstChild);\n } else {\n this.renderer.appendChild(target, pseudoElement);\n }\n }\n\n private removeCloneElementWithAnimation(x: number, y: number, dropList?: AXDropListDirective) {\n dropList?._draggableItems().forEach((item) => {\n this.removeElementTransition(item.element());\n });\n const clone = this.clonedElement();\n if (!clone) return;\n\n this.renderer.setStyle(this.element(), 'opacity', this.elementOpacity());\n\n const elementRect = this.element().getBoundingClientRect();\n if (elementRect) {\n this.setElementTransition(clone);\n this.renderer.setStyle(clone, 'opacity', '0');\n this.setClonePosition(elementRect.left + x, elementRect.top + y);\n }\n\n if (!this.dragTransition()) {\n this.removeCloneElement();\n } else {\n setTimeout(() => {\n this.removeCloneElement();\n dropList?._draggableItems().forEach((item) => {\n this.setElementTransition(item.element());\n });\n }, this.transitionDuration());\n }\n }\n\n private removeCloneElement() {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const clone = this.clonedElement();\n if (clone?.parentNode) {\n // Remove classes before removing element\n this.renderer.removeClass(clone, 'ax-drag-preview');\n this.renderer.removeClass(clone, 'ax-dragging');\n this.renderer.removeChild(clone.parentNode, clone);\n }\n this.clonedElement.set(null);\n\n if (this.clonedElementViewRef()) {\n this.clonedElementViewRef().destroy();\n this.clonedElementViewRef.set(null);\n }\n this.cdr.markForCheck();\n }\n\n private addDocumentListeners(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n this.zone.runOutsideAngular(() => {\n this.document.addEventListener('pointermove', this.boundHandlePointerMove, { passive: false });\n this.document.addEventListener('pointerup', this.boundHandlePointerUp);\n this.document.addEventListener('pointercancel', this.boundHandlePointerUp);\n });\n }\n\n private removeDocumentListeners(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n this.zone.runOutsideAngular(() => {\n this.document.removeEventListener('pointermove', this.boundHandlePointerMove);\n this.document.removeEventListener('pointerup', this.boundHandlePointerUp);\n this.document.removeEventListener('pointercancel', this.boundHandlePointerUp);\n });\n }\n}\n","import { NXComponent, NXNativeEvent } from '@acorex/cdk/common';\nimport { Directive, OnInit, input, output, signal } from '@angular/core';\nimport { AXDragDirective } from './drag.directive';\n\nexport interface AXDropZoneDropEvent extends NXNativeEvent<AXDropZoneDirective, MouseEvent> {\n dropped: AXDragDirective;\n}\nexport type AXDropZoneHoverEvent = AXDropZoneDropEvent & { state: 'enter' | 'leave' };\n\n@Directive({\n selector: '[axDropZone]',\n exportAs: 'axDropZone',\n})\nexport class AXDropZoneDirective extends NXComponent implements OnInit {\n dropZoneGroup = input<string>();\n\n isHovered = signal(false);\n readonly element = signal(this.nativeElement);\n\n onElementDrop = output<AXDropZoneDropEvent>();\n onElementHover = output<AXDropZoneHoverEvent>();\n\n ngOnInit(): void {\n this.element().dataset['axDropZone'] = 'true';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AXDragHandleDirective } from './drag-handle.directive';\nimport { AXDragDirective } from './drag.directive';\nimport { AXDropListDirective } from './drop-list.directive';\nimport { AXDropZoneDirective } from './drop-zone.directive';\n\nconst COMPONENT = [AXDragDirective, AXDragHandleDirective, AXDropListDirective, AXDropZoneDirective];\n\n@NgModule({\n imports: [...COMPONENT],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXDragDropModule {}\n","import { clamp } from 'lodash-es';\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;MACU,cAAc,GAAG,IAAI,cAAc,CAAe,gBAAgB;;MCDlE,qBAAqB,CAAA;AAKhC,IAAA,WAAA,GAAA;AAJQ,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,EAAC,UAAuB,EAAC;QACpC,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa;oFAAC;AAG9C,QAAA,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC;AACjC,QAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACzE;8GARW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAA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W,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D;AACF;;AC7CA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-drag-drop.mjs","sources":["../../../../packages/cdk/drag-drop/src/lib/drag-parent.ts","../../../../packages/cdk/drag-drop/src/lib/drag-handle.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drop-list.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drag.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drop-zone.directive.ts","../../../../packages/cdk/drag-drop/src/lib/drag-drop.module.ts","../../../../packages/cdk/drag-drop/src/lib/drag-drop.utils.ts","../../../../packages/cdk/drag-drop/src/acorex-cdk-drag-drop.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { AXDragHandleDirective } from './drag-handle.directive';\n\n/**\n * Parent drag instance that nested `axDragHandle` directives register with.\n * Provided by `AXDragDirective` so handles work inside dynamically created content.\n */\nexport const AX_DRAG_PARENT = new InjectionToken<AXDragParent>('AX_DRAG_PARENT');\n\nexport interface AXDragParent {\n registerHandle(handle: AXDragHandleDirective | HTMLElement): void;\n unregisterHandle(handle: AXDragHandleDirective | HTMLElement): void;\n}\n","import { DestroyRef, Directive, ElementRef, inject, signal } from '@angular/core';\nimport { AX_DRAG_PARENT } from './drag-parent';\n\n@Directive({\n selector: '[axDragHandle]',\n})\nexport class AXDragHandleDirective {\n private el = inject(ElementRef<HTMLElement>);\n private parent = inject(AX_DRAG_PARENT, { optional: true });\n readonly element = signal(this.el.nativeElement);\n\n constructor() {\n this.parent?.registerHandle(this);\n inject(DestroyRef).onDestroy(() => this.parent?.unregisterHandle(this));\n }\n}\n","import { NXComponent, NXNativeEvent } from '@acorex/cdk/common';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n PLATFORM_ID,\n Renderer2,\n signal,\n} from '@angular/core';\nimport { AXDragDirective } from './drag.directive';\n\n/** Describes the cached geometric data of a draggable item within the list. */\ninterface DropListItemData {\n item: AXDragDirective;\n element: HTMLElement;\n initialRect: DOMRect;\n width: number;\n height: number;\n margins: { top: number; bottom: number; left: number; right: number };\n}\n\n/** Event object emitted when an item is dropped into a drop list. */\nexport interface AXDropListDroppedEvent extends NXNativeEvent<AXDropListDirective, MouseEvent> {\n item: AXDragDirective;\n currentIndex: number;\n previousIndex: number;\n container: AXDropListDirective;\n previousContainer: AXDropListDirective;\n}\n\n/**\n * @Directive axDropList\n *\n * Manages a list of draggable items (`axDrag`), enabling sorting within the list\n * and transferring items between compatible lists. It handles the visual shifting\n * of items during a drag operation to provide a clear preview of the drop location.\n *\n * This directive automatically detects `gap` from flexbox/grid layouts and handles\n * items with variable sizes and margins.\n */\n@Directive({\n selector: '[axDropList]',\n exportAs: 'axDropList',\n})\nexport class AXDropListDirective extends NXComponent implements OnInit, AfterContentInit, OnDestroy {\n private readonly _zone = inject(NgZone);\n private readonly _renderer = inject(Renderer2);\n private readonly _cdr = inject(ChangeDetectorRef);\n private readonly _platformId = inject(PLATFORM_ID);\n private readonly _hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n // --- Public API: Inputs and Outputs ---\n\n /** Boolean input matching the directive selector name for conditional application. */\n axDropList = input(true, { transform: (value: boolean | string) => value === '' || value === true });\n /** Whether sorting within this list is disabled. */\n sortingDisabled = input(false);\n /** The group this drop list belongs to. Dragging is only allowed between lists of the same group. */\n dropListGroup = input<string>();\n /** The layout orientation of the list. */\n dropListOrientation = input<'horizontal' | 'vertical'>('vertical');\n /** Emits when an item is dropped into the list. */\n dropListDropped = output<AXDropListDroppedEvent>();\n /** Emits when the sort preview transforms change during an active drag. */\n sortPreviewChanged = output<void>();\n\n /** The `axDrag` directives that are direct children of this list. */\n readonly _draggableItems = contentChildren(AXDragDirective, { descendants: false });\n\n // --- Internal State Management ---\n\n /** The native element of the drop list. */\n readonly element = this._hostEl.nativeElement;\n\n /** The draggable item currently being moved over this list. */\n private readonly _activeDragItem = signal<AXDragDirective | null>(null);\n /** The calculated index where the placeholder/item should be. */\n private readonly _placeholderIndex = signal(-1);\n /** A snapshot of the items' data and geometry at the start of the drag. */\n private readonly _cachedItems = signal<readonly DropListItemData[]>([]);\n /** The list's initial bounding box, used to calculate scroll delta. */\n private readonly _listInitialRect = signal<DOMRect | null>(null);\n /** The detected `gap` of the list for the current orientation. */\n private readonly _listGap = signal(0);\n /** Whether the list is in RTL direction (cached at drag start). */\n private readonly _isRtl = signal(false);\n\n /** Internal orientation state; can be overridden programmatically by host components. */\n readonly orientation = linkedSignal(() => this.dropListOrientation());\n /** Internal sorting-disabled state; can be overridden programmatically by host components. */\n readonly isSortingDisabled = linkedSignal(() => this.sortingDisabled());\n\n /** DOM placeholder element for inter-list drags */\n private _placeholderElement: HTMLElement | null = null;\n\n ngOnInit(): void {\n if (isPlatformBrowser(this._platformId)) {\n this.element.dataset['axDropList'] = 'true';\n this.element.classList.add('ax-drop-list-sorting-transition');\n // Store reference to this directive instance on the element for drag directive access\n (this.element as HTMLElement & { __axContext__?: AXDropListDirective })['__axContext__'] = this;\n }\n }\n\n ngAfterContentInit(): void {\n this._cdr.detectChanges();\n }\n\n ngOnDestroy(): void {\n // Clean up placeholder element if directive destroyed during drag\n this._removePlaceholderElement();\n }\n\n // --- Public Methods (for internal library use) ---\n\n /** Checks if the given drag item is the one currently active in this list. */\n isDragActiveForThisList(dragItem: AXDragDirective): boolean {\n return this._activeDragItem() === dragItem;\n }\n\n /** Whether the list is horizontal and in RTL direction. */\n private isHorizontalRtl(): boolean {\n return this.orientation() === 'horizontal' && this._isRtl();\n }\n\n /**\n * Prepares the list for sorting when a drag operation starts from within this list.\n * @param dragItem The item that is being dragged.\n */\n prepareSort(dragItem: AXDragDirective): void {\n if (!this.axDropList() || this.isSortingDisabled() || this._activeDragItem() || dragItem.isDragDisabled()) return;\n\n this._activeDragItem.set(dragItem);\n this.element.classList.add('ax-drop-list-sorting-active');\n\n requestAnimationFrame(() => {\n this._zone.run(() => {\n this._cacheGeometry();\n const placeholderIdx = this._cachedItems().findIndex((data) => data.item === dragItem);\n this._placeholderIndex.set(placeholderIdx);\n });\n });\n }\n\n /**\n * Prepares the list for receiving an item that started dragging from another list.\n * @param dragItem The item entering this list.\n */\n enter(dragItem: AXDragDirective): void {\n if (!this.axDropList() || this.isSortingDisabled() || this.isDragActiveForThisList(dragItem)) return;\n\n // Clean up any existing placeholder from previous list\n this._removePlaceholderElement();\n\n this._activeDragItem.set(dragItem);\n this.element.classList.add('ax-drop-list-sorting-active');\n requestAnimationFrame(() => this._zone.run(() => this._cacheGeometry()));\n }\n\n /**\n * Calculates the new placeholder index based on the pointer's position and applies visual shifts.\n * @param event The pointer move event.\n * @param dragItem The item being dragged.\n */\n sort(event: PointerEvent, dragItem: AXDragDirective): void {\n if (\n !this.axDropList() ||\n !this.isDragActiveForThisList(dragItem) ||\n this.isSortingDisabled() ||\n !this._listInitialRect()\n )\n return;\n\n const pointerPosition = this.orientation() === 'vertical' ? event.clientY : event.clientX;\n const newPlaceholderIndex = this._calculatePlaceholderIndex(pointerPosition);\n\n if (this._placeholderIndex() !== newPlaceholderIndex) {\n this._placeholderIndex.set(newPlaceholderIndex);\n this._applyVisualShifts();\n }\n }\n\n /**\n * Finalizes the drop, emits the drop event, and resets the list's state.\n * @param event The pointer up event.\n * @param droppedItem The item that was dropped.\n * @param sourceList The list where the drag originated.\n */\n finalizeSort(event: PointerEvent, droppedItem: AXDragDirective, sourceList: AXDropListDirective): void {\n if (!this.axDropList() || !this.isDragActiveForThisList(droppedItem) || this.isSortingDisabled()) {\n this.resetSortStateAndStyles(sourceList);\n return;\n }\n\n const activeItem = this._activeDragItem();\n const targetSlotIndex = this._placeholderIndex();\n if (!activeItem || targetSlotIndex === -1) {\n this.resetSortStateAndStyles(sourceList);\n return;\n }\n\n const previousIndex = sourceList._cachedItems().findIndex((d) => d.item === activeItem);\n // Adjust the index for array mutation if moving an item to a later position in the same list.\n const currentIndex =\n sourceList === this && previousIndex !== -1 && targetSlotIndex > previousIndex\n ? targetSlotIndex - 1\n : targetSlotIndex;\n\n this.dropListDropped.emit({\n nativeEvent: event,\n sender: this,\n item: activeItem,\n previousIndex,\n currentIndex,\n container: this,\n previousContainer: sourceList,\n });\n\n this.resetSortStateAndStyles(sourceList);\n }\n\n /** Resets the transforms on all items and cancels the current sort operation. */\n cancelSort(dragItem?: AXDragDirective): void {\n if (dragItem && !this.isDragActiveForThisList(dragItem)) return;\n this._resetAllTransforms();\n this.resetSortState();\n }\n\n /** Resets transforms but keeps the active state, used when moving between lists. */\n cancelSortPreview(): void {\n if (!this._activeDragItem()) return;\n this._resetAllTransforms();\n const originalIndex = this._cachedItems().findIndex((d) => d.item === this._activeDragItem());\n this._placeholderIndex.set(originalIndex > -1 ? originalIndex : -1);\n }\n\n // --- Private Helper Methods ---\n\n /** Caches the geometry of the list and its items at the start of a drag. */\n private _cacheGeometry(): void {\n this._listInitialRect.set(this.element.getBoundingClientRect());\n this._isRtl.set(AXHtmlUtil.isRtl(this.element));\n this._detectAndCacheListGap();\n\n const items = [...this._draggableItems()]\n .sort((a, b) =>\n a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n )\n .map((itemDraggable) => {\n const el = itemDraggable.element();\n const style = window.getComputedStyle(el);\n const rect = el.getBoundingClientRect();\n return {\n item: itemDraggable,\n element: el,\n initialRect: rect,\n width: rect.width,\n height: rect.height,\n margins: {\n top: parseFloat(style.marginTop),\n bottom: parseFloat(style.marginBottom),\n left: parseFloat(style.marginLeft),\n right: parseFloat(style.marginRight),\n },\n };\n });\n this._cachedItems.set(items);\n }\n\n /** Detects and caches the `gap` property from the list's computed styles. */\n private _detectAndCacheListGap(): void {\n const listStyle = window.getComputedStyle(this.element);\n const gapValue = listStyle.getPropertyValue('gap');\n if (gapValue && gapValue !== 'normal') {\n const gapParts = gapValue.split(' ');\n const rowGap = parseFloat(gapParts[0]);\n const columnGap = parseFloat(gapParts[1] || gapParts[0]);\n this._listGap.set(this.orientation() === 'vertical' ? rowGap : columnGap);\n } else {\n this._listGap.set(0);\n }\n }\n\n /**\n * Determines the new placeholder index by comparing the pointer position against the\n * midpoints of the other items in the list.\n * @param pointerPosition The clientX or clientY of the pointer.\n * @returns The calculated placeholder index.\n */\n private _calculatePlaceholderIndex(pointerPosition: number): number {\n const activeItem = this._activeDragItem();\n const listRect = this._listInitialRect();\n if (!activeItem || !listRect) return -1;\n\n const cachedItems = this._cachedItems();\n const originalIndex = cachedItems.findIndex((d) => d.item === activeItem);\n const siblings = cachedItems.filter((d) => d.item !== activeItem);\n const scrollDelta =\n this.orientation() === 'vertical'\n ? this.element.getBoundingClientRect().top - listRect.top\n : this.element.getBoundingClientRect().left - listRect.left;\n\n let newIndexInSiblings = -1;\n for (let i = 0; i < siblings.length; i++) {\n const sibling = siblings[i];\n const itemMidPoint =\n (this.orientation() === 'vertical' ? sibling.initialRect.top : sibling.initialRect.left) +\n scrollDelta +\n (this.orientation() === 'vertical' ? sibling.height : sibling.width) / 2;\n\n const isBeforeSibling = this.isHorizontalRtl()\n ? pointerPosition > itemMidPoint\n : pointerPosition < itemMidPoint;\n if (isBeforeSibling) {\n newIndexInSiblings = i;\n break;\n }\n }\n\n if (newIndexInSiblings === -1) {\n newIndexInSiblings = siblings.length;\n }\n\n // Map the index from the 'siblings' array back to the original `_cachedItems` array.\n const potentialPlaceholderIndex =\n originalIndex > -1 && newIndexInSiblings >= originalIndex ? newIndexInSiblings + 1 : newIndexInSiblings;\n\n // A drag starting from outside the list doesn't have an original index.\n if (originalIndex === -1) {\n return potentialPlaceholderIndex;\n }\n\n // --- New logic: Prevent crossing disabled items ---\n const start = Math.min(originalIndex, potentialPlaceholderIndex);\n const end = Math.max(originalIndex, potentialPlaceholderIndex);\n\n for (let i = start; i < end; i++) {\n const itemData = cachedItems[i];\n if (itemData.item !== activeItem && itemData.item.isDragDisabled()) {\n // We've hit a disabled \"wall\". Stop the placeholder at the boundary.\n if (potentialPlaceholderIndex > originalIndex) {\n return i; // Dragging down/right: stop *before* the wall.\n } else {\n return i + 1; // Dragging up/left: stop *after* the wall.\n }\n }\n }\n return potentialPlaceholderIndex;\n }\n\n /** Applies visual shifts - uses placeholder for inter-list, transforms for intra-list. */\n private _applyVisualShifts(): void {\n const activeItem = this._activeDragItem();\n const originalIndex = this._cachedItems().findIndex((d) => d.item === activeItem);\n const isIntraListDrag = originalIndex > -1;\n const placeholderIndex = this._placeholderIndex();\n\n // Check if this is an \"onto-node\" drop list (no items, just a drop target)\n const isOntoNodeList = this.element.dataset['dropType'] === 'onto-node';\n\n if (!isIntraListDrag && activeItem && !isOntoNodeList && this._cachedItems().length > 0) {\n // --- INTER-LIST DRAG: Use DOM placeholder for reorder lists with items ---\n this._updatePlaceholderElement(activeItem, placeholderIndex);\n } else {\n // --- INTRA-LIST DRAG: Use transforms (works well for same-list reordering) ---\n this._removePlaceholderElement();\n\n const getItemSpace = (itemData: DropListItemData) =>\n this.orientation() === 'vertical'\n ? itemData.height + itemData.margins.top + itemData.margins.bottom\n : itemData.width + itemData.margins.left + itemData.margins.right;\n\n const draggedItemSize = isIntraListDrag ? getItemSpace(this._cachedItems()[originalIndex]) : 0;\n\n const axisSign = this.isHorizontalRtl() ? -1 : 1;\n\n this._cachedItems().forEach((data, index) => {\n if (data.item.isDragDisabled()) {\n this._renderer.removeStyle(data.element, 'transform');\n return;\n }\n const transform = this._calculateTransform(index, originalIndex, draggedItemSize, getItemSpace);\n const signedTransform = transform * axisSign;\n this._renderer.setStyle(\n data.element,\n 'transform',\n transform\n ? `${this.orientation() === 'vertical' ? 'translateY' : 'translateX'}(${signedTransform}px)`\n : '',\n );\n });\n }\n\n this.sortPreviewChanged.emit();\n }\n\n /** Creates or moves the placeholder element for inter-list drags */\n private _updatePlaceholderElement(activeItem: AXDragDirective, targetIndex: number): void {\n const rect = activeItem.elementRect();\n if (!rect) return;\n\n // Create placeholder as a clone of the dragged element\n if (!this._placeholderElement) {\n // Clone the entire dragged element\n const sourceElement = activeItem.element();\n this._placeholderElement = sourceElement.cloneNode(true) as HTMLElement;\n \n // Mark it as a placeholder\n this._renderer.addClass(this._placeholderElement, 'ax-drop-placeholder');\n this._renderer.addClass(this._placeholderElement, 'ax-drag-placeholder');\n \n // Prevent interaction with cloned content\n this._renderer.setStyle(this._placeholderElement, 'pointerEvents', 'none');\n \n // Add faded styling to indicate it's a placeholder\n this._renderer.setStyle(this._placeholderElement, 'opacity', '0.4');\n this._renderer.setStyle(this._placeholderElement, 'transition', 'all 200ms ease');\n }\n\n // Insert/move placeholder at target index\n const items = this._cachedItems();\n if (targetIndex >= 0 && targetIndex < items.length) {\n const targetItem = items[targetIndex];\n if (targetItem && targetItem.element) {\n this._renderer.insertBefore(this.element, this._placeholderElement, targetItem.element);\n } else {\n // Fallback: append at end if target item invalid\n this._renderer.appendChild(this.element, this._placeholderElement);\n }\n } else {\n // Insert at end\n this._renderer.appendChild(this.element, this._placeholderElement);\n }\n }\n\n /** Removes the placeholder element if it exists */\n private _removePlaceholderElement(): void {\n if (this._placeholderElement) {\n this._renderer.removeChild(this.element, this._placeholderElement);\n this._placeholderElement = null;\n }\n }\n\n /**\n * Calculates the required transform in pixels for a single item.\n * @param index The index of the item to transform.\n * @param originalIndex The original index of the dragged item (-1 if from another list).\n * @param draggedItemSize The size (including margins) of the item being dragged.\n * @param getItemSpace A helper function to get an item's size including margins.\n * @returns The transform value in pixels.\n */\n private _calculateTransform(\n index: number,\n originalIndex: number,\n draggedItemSize: number,\n getItemSpace: (item: DropListItemData) => number,\n ): number {\n const targetIndex = this._placeholderIndex();\n const listGap = this._listGap();\n\n if (originalIndex > -1) {\n // --- Intra-list Drag ---\n if (index === originalIndex) {\n // The dragged item moves by the sum of the sizes of the items it passes over, PLUS the gaps between them.\n let offset = 0;\n if (targetIndex > originalIndex) {\n // Dragging down/right\n for (let i = originalIndex + 1; i < targetIndex; i++) {\n offset += getItemSpace(this._cachedItems()[i]) + listGap;\n }\n } else {\n // Dragging up/left\n for (let i = targetIndex; i < originalIndex; i++) {\n offset -= getItemSpace(this._cachedItems()[i]) + listGap;\n }\n }\n return offset;\n } else {\n // It's a sibling item that needs to make space.\n // It moves by the size of the dragged item, plus ONE gap to fill the void.\n const shift = draggedItemSize + listGap;\n if (originalIndex < targetIndex && index > originalIndex && index < targetIndex) {\n return -shift;\n } else if (originalIndex > targetIndex && index >= targetIndex && index < originalIndex) {\n return shift;\n }\n }\n } else {\n // --- Inter-list Drag (from another list) ---\n if (index >= targetIndex) {\n // An item from another list enters. Siblings shift by its size plus ONE gap.\n return draggedItemSize + listGap;\n }\n }\n return 0;\n }\n\n /** Resets the state of this list and the source list after a drop. */\n private resetSortStateAndStyles(sourceList: AXDropListDirective): void {\n const listsToReset = new Set([this, sourceList]);\n listsToReset.forEach((list) => {\n if (list) {\n list._resetAllTransforms();\n list.resetSortState();\n }\n });\n }\n\n /** Removes all `transform` styles from the items in this list. */\n private _resetAllTransforms(): void {\n this._cachedItems().forEach((data) => this._renderer.setStyle(data.element, 'transform', ''));\n this._removePlaceholderElement(); // Clean up inter-list placeholder\n this.sortPreviewChanged.emit();\n }\n\n /** Resets the internal state of the directive to its initial values. */\n resetSortState(): void {\n this.element.classList.remove('ax-drop-list-sorting-active');\n this._activeDragItem.set(null);\n this._cachedItems.set([]);\n this._placeholderIndex.set(-1);\n this._listInitialRect.set(null);\n this._listGap.set(0);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectorRef,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n NgZone,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n Renderer2,\n RendererStyleFlags2,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n} from '@angular/core';\nimport { clamp } from 'lodash-es';\nimport { AXDragHandleDirective } from './drag-handle.directive';\nimport { AX_DRAG_PARENT, AXDragParent } from './drag-parent';\nimport { AXDropListDirective } from './drop-list.directive';\nimport { AXDropZoneDirective } from './drop-zone.directive';\n\ntype AXPositionType = { x: number; y: number };\n\n// Zone detection constants for nested drop lists (tree nodes)\nconst ZONE_TOP_THRESHOLD = 0.3; // Top 30% triggers reorder BEFORE\nconst ZONE_BOTTOM_THRESHOLD = 0.7; // Bottom 30% triggers reorder AFTER\n// Middle 40% (between thresholds) triggers drop INTO\n\n@Directive({\n selector: '[axDrag]',\n providers: [{ provide: AX_DRAG_PARENT, useExisting: AXDragDirective }],\n})\nexport class AXDragDirective implements OnInit, OnDestroy, AXDragParent {\n private zone = inject(NgZone);\n private document = inject(DOCUMENT);\n private renderer = inject(Renderer2);\n private cdr = inject(ChangeDetectorRef);\n private platformId = inject(PLATFORM_ID);\n private viewContainerRef = inject(ViewContainerRef);\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private registeredHandleElements = signal<HTMLElement[]>([]);\n\n axDrag = input(true, { transform: (value: boolean | string) => value === '' || value === true });\n dragData = input();\n dragDisabled = input(false);\n dragTransition = input(true);\n dragElementClone = input(false);\n dropZoneGroup = input<string>();\n dragStartDelay = input<number>();\n dragResetOnDblClick = input(true);\n dragLockAxis = input<'x' | 'y' | null>(null);\n dragClonedTemplate = input<TemplateRef<unknown>>();\n dragCursor = input<'move' | 'grab' | 'grab-on-drag' | 'none'>('move');\n dragBoundary = input<string | ElementRef<HTMLElement> | HTMLElement>();\n dragTransitionDuration = input<number>(150);\n\n readonly isDragDisabled = linkedSignal(() => this.dragDisabled());\n readonly lockAxis = linkedSignal(() => this.dragLockAxis());\n readonly dragBoundaryOverride = linkedSignal<\n string | ElementRef<HTMLElement> | HTMLElement | null | undefined\n >(() => this.dragBoundary());\n readonly startDelay = linkedSignal(() => this.dragStartDelay() ?? 0);\n readonly dragTouchAction = linkedSignal<'none' | 'pan-x' | 'pan-y'>(() => 'none');\n readonly dragCursorOverride = linkedSignal<'move' | 'grab' | 'grab-on-drag' | 'none'>(() => this.dragCursor());\n\n dragPositionChanged = output<AXPositionType>();\n\n isMoving = signal<boolean>(false);\n clonedElement = signal<HTMLElement | null>(null);\n currentAxis = signal<AXPositionType>({ x: 0, y: 0 });\n currentCloneAxis = signal<AXPositionType>({ x: 0, y: 0 });\n transitionDuration = linkedSignal(() => this.dragTransitionDuration());\n readonly element = signal<HTMLElement>(this.el.nativeElement);\n private dragStartTime = signal<number>(0);\n private isDragging = signal<boolean>(false);\n private elementOpacity = signal<string>('1');\n private movedAfterDelay = signal<boolean>(false);\n private activePointerId = signal<number | null>(null);\n private prevDropZone = signal<AXDropZoneDirective | null>(null);\n private dragStartOffset = signal<AXPositionType>({ x: 0, y: 0 });\n private pointerDownPosition = signal<AXPositionType>({ x: 0, y: 0 });\n private clonePointerOffset = signal<AXPositionType>({ x: 0, y: 0 });\n private clonedElementViewRef = signal<EmbeddedViewRef<unknown> | null>(null);\n private rafId: number | null = null;\n private appliedTranslate: AXPositionType = { x: 0, y: 0 };\n private pendingPointerEvent: PointerEvent | null = null;\n private savedBodyCursor: string | null = null;\n private holdDelayTimer: ReturnType<typeof setTimeout> | null = null;\n private holdDelayReady = signal(false);\n\n private _parentDropList = inject(AXDropListDirective, { optional: true, skipSelf: true, host: false });\n private _currentDropList = signal<AXDropListDirective | null>(null);\n readonly createCloneElement = computed<boolean>(() => this.dragElementClone() || !!this._parentDropList);\n\n private boundaryElement = computed<HTMLElement | null>(() => {\n const boundary = this.dragBoundaryOverride();\n if (!boundary) {\n return null;\n }\n if (typeof boundary === 'string') {\n return this.document.querySelector<HTMLElement>(boundary);\n }\n return boundary instanceof ElementRef ? boundary.nativeElement : boundary;\n });\n\n readonly elementRect = computed(() => {\n if (!isPlatformBrowser(this.platformId)) {\n return null;\n }\n return this.element().getBoundingClientRect();\n });\n\n private boundaryRect = computed(() => {\n if (!isPlatformBrowser(this.platformId)) {\n return null;\n }\n return this.boundaryElement()?.getBoundingClientRect();\n });\n\n private handleElements = computed(() => {\n const registered = this.registeredHandleElements().filter(Boolean);\n return registered.length ? registered : [this.element()];\n });\n\n private handle = computed(() => this.activeHandleElement() ?? this.handleElements()[0] ?? this.element());\n\n private boundHandleDblClick = this.handleDblClick.bind(this);\n private boundHandlePointerUp = this.handlePointerUp.bind(this);\n private boundHandlePointerDown = this.handlePointerDown.bind(this);\n private boundHandlePointerMove = this.handlePointerMove.bind(this);\n private attachedHandleElements: HTMLElement[] = [];\n private styledHandleElements: HTMLElement[] = [];\n private activeHandleElement = signal<HTMLElement | null>(null);\n\n #dragDisabledEffect = effect(() => {\n const cursor = this.dragCursorOverride();\n const disabled = this.isDragDisabled();\n const handles = this.handleElements();\n const moving = this.isMoving();\n const holdReady = this.holdDelayReady();\n\n for (const previous of this.styledHandleElements) {\n if (!handles.includes(previous)) {\n this.renderer.removeStyle(previous, 'cursor');\n this.renderer.removeStyle(previous, 'touch-action');\n }\n }\n this.styledHandleElements = handles;\n\n for (const handle of handles) {\n if (disabled || cursor === 'none' || cursor === 'grab-on-drag') {\n if (!moving && !holdReady) {\n this.renderer.removeStyle(handle, 'cursor');\n }\n if (disabled) {\n this.renderer.removeStyle(handle, 'touch-action');\n } else {\n this.renderer.setStyle(handle, 'touch-action', this.dragTouchAction());\n }\n continue;\n }\n\n if (!moving && !holdReady) {\n this.renderer.setStyle(handle, 'cursor', cursor);\n }\n this.renderer.setStyle(handle, 'touch-action', this.dragTouchAction());\n }\n });\n\n #handleChangeEffect = effect(() => {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const currentHandles = this.handleElements();\n const previousHandles = this.attachedHandleElements;\n\n for (const previous of previousHandles) {\n if (!currentHandles.includes(previous)) {\n previous.removeEventListener('dblclick', this.boundHandleDblClick);\n previous.removeEventListener('pointerdown', this.boundHandlePointerDown);\n }\n }\n\n this.zone.runOutsideAngular(() => {\n for (const current of currentHandles) {\n if (!previousHandles.includes(current)) {\n current.addEventListener('dblclick', this.boundHandleDblClick);\n current.addEventListener('pointerdown', this.boundHandlePointerDown, { passive: false });\n }\n }\n });\n\n this.attachedHandleElements = currentHandles;\n });\n\n registerHandle(handle: AXDragHandleDirective | HTMLElement): void {\n const element = this.resolveHandleElement(handle);\n if (!element) return;\n this.registeredHandleElements.update((handles) => (handles.includes(element) ? handles : [...handles, element]));\n }\n\n unregisterHandle(handle: AXDragHandleDirective | HTMLElement): void {\n const element = this.resolveHandleElement(handle);\n if (!element) return;\n this.registeredHandleElements.update((handles) => handles.filter((item) => item !== element));\n if (this.activeHandleElement() === element) {\n this.activeHandleElement.set(null);\n }\n }\n\n private resolveHandleElement(handle: AXDragHandleDirective | HTMLElement): HTMLElement | null {\n return handle instanceof HTMLElement ? handle : handle.element();\n }\n\n ngOnInit() {\n if (isPlatformBrowser(this.platformId)) {\n if (this._parentDropList) {\n this.setElementTransition(this.element());\n }\n this.elementOpacity.set(getComputedStyle(this.element()).opacity);\n }\n }\n\n ngOnDestroy() {\n if (isPlatformBrowser(this.platformId)) {\n for (const handle of this.attachedHandleElements) {\n handle.removeEventListener('dblclick', this.boundHandleDblClick);\n handle.removeEventListener('pointerdown', this.boundHandlePointerDown);\n }\n this.attachedHandleElements = [];\n this.removeDocumentListeners();\n if (this.createCloneElement()) {\n this.removeCloneElement();\n }\n if (this._parentDropList && this.isDragging()) {\n this._parentDropList.cancelSort();\n }\n this.clearActiveDragCursor();\n this.clearHoldDelayTimer();\n this.renderer.removeStyle(this.element(), 'z-index');\n }\n }\n\n private usesGrabDragCursor(): boolean {\n const cursor = this.dragCursorOverride();\n return cursor === 'grab' || cursor === 'grab-on-drag';\n }\n\n private resolveDropCursor(canDrop: boolean): string {\n if (this.usesGrabDragCursor()) {\n return canDrop ? 'grabbing' : 'not-allowed';\n }\n return canDrop ? 'move' : 'not-allowed';\n }\n\n private setActiveDragCursor(cursor: string): void {\n if (!isPlatformBrowser(this.platformId)) return;\n\n if (this.savedBodyCursor === null) {\n this.savedBodyCursor = this.document.body.style.cursor;\n }\n this.document.body.style.cursor = cursor;\n }\n\n private clearActiveDragCursor(): void {\n if (!isPlatformBrowser(this.platformId) || this.savedBodyCursor === null) return;\n\n this.document.body.style.cursor = this.savedBodyCursor;\n this.savedBodyCursor = null;\n }\n\n private clearHoldDelayTimer(): void {\n if (this.holdDelayTimer !== null) {\n clearTimeout(this.holdDelayTimer);\n this.holdDelayTimer = null;\n }\n this.holdDelayReady.set(false);\n }\n\n private scheduleHoldDelayFeedback(): void {\n this.clearHoldDelayTimer();\n const delay = this.startDelay();\n const cursorMode = this.dragCursorOverride();\n if (delay <= 0 || (cursorMode !== 'grab' && cursorMode !== 'grab-on-drag')) {\n return;\n }\n\n const readyCursor = cursorMode === 'grab-on-drag' ? 'grab' : 'grabbing';\n\n this.holdDelayTimer = setTimeout(() => {\n this.holdDelayTimer = null;\n if (!this.isDragging() || this.isMoving() || this.isDragDisabled()) {\n return;\n }\n\n this.holdDelayReady.set(true);\n this.renderer.setStyle(this.handle(), 'cursor', readyCursor);\n this.setActiveDragCursor(readyCursor);\n }, delay);\n }\n\n private setElementDropCursor(element: HTMLElement, cursor: string): void {\n this.renderer.setStyle(element, 'cursor', cursor);\n }\n\n private setElementTransition(element: HTMLElement) {\n this.renderer.setStyle(element, 'transition-property', 'transform, opacity, translate');\n this.renderer.setStyle(\n element,\n 'transition-duration',\n `var(--ax-sys-transition-duration,${this.transitionDuration()}ms)`,\n );\n this.renderer.setStyle(element, 'transition-timing-function', 'var(--ax-sys-transition-timing-function)');\n }\n\n private removeElementTransition(element: HTMLElement) {\n this.renderer.setStyle(element, 'transition-property', 'opacity');\n }\n\n private handlePointerDown(e: PointerEvent) {\n if (!isPlatformBrowser(this.platformId)) return;\n if (!this.axDrag() || this.isDragDisabled() || e.button !== 0 || this._parentDropList?.isSortingDisabled()) return;\n\n const handle = e.currentTarget instanceof HTMLElement ? e.currentTarget : this.handle();\n this.activeHandleElement.set(handle);\n\n this.isDragging.set(true);\n this.movedAfterDelay.set(false);\n\n if (this.dragCursorOverride() === 'move') {\n this.renderer.setStyle(handle, 'cursor', 'move');\n }\n\n this.dragStartOffset.set({ x: e.clientX - this.currentAxis().x, y: e.clientY - this.currentAxis().y });\n this.pointerDownPosition.set({ x: e.clientX, y: e.clientY });\n this.renderer.setStyle(handle, 'userSelect', 'none');\n this.activePointerId.set(e.pointerId);\n this.addDocumentListeners();\n\n this.dragStartTime.set(Date.now());\n this.scheduleHoldDelayFeedback();\n }\n\n private handleDblClick() {\n if (!this.dragResetOnDblClick() || this.isDragDisabled()) return;\n this.setPosition(0, 0);\n }\n\n private handlePointerMove(e: PointerEvent) {\n if (!this.isDragging() || !isPlatformBrowser(this.platformId) || e.pointerId !== this.activePointerId()) {\n return;\n }\n\n if (!this.isMoving()) {\n const delay = this.startDelay();\n const down = this.pointerDownPosition();\n const movedX = e.clientX - down.x;\n const movedY = e.clientY - down.y;\n const movedDistance = Math.sqrt(movedX * movedX + movedY * movedY);\n\n if (delay > 0 && !this.holdDelayReady() && Date.now() - this.dragStartTime() < delay) {\n if (movedDistance > 8) {\n this.abortDragSequence();\n }\n return;\n }\n\n e.preventDefault();\n this.isMoving.set(true);\n this.handle().setPointerCapture(e.pointerId);\n this.startDrag(e);\n } else {\n e.preventDefault();\n }\n\n // Run position updates outside Angular zone for better performance\n this.zone.runOutsideAngular(() => {\n if (this.createCloneElement()) {\n const newCloneX = e.clientX - this.clonePointerOffset().x;\n const newCloneY = e.clientY - this.clonePointerOffset().y;\n this.setClonePosition(newCloneX, newCloneY);\n } else {\n const newX = e.clientX - this.dragStartOffset().x;\n const newY = e.clientY - this.dragStartOffset().y;\n this.setPosition(newX, newY);\n }\n });\n\n // Throttle drop list interactions using requestAnimationFrame\n if (this._parentDropList) {\n this.pendingPointerEvent = e;\n if (this.rafId === null) {\n this.rafId = requestAnimationFrame(() => {\n if (this.pendingPointerEvent) {\n this.handleDropListInteractions(this.pendingPointerEvent);\n this.pendingPointerEvent = null;\n }\n this.rafId = null;\n });\n }\n } else {\n this.dropZoneHoverHandler(e);\n }\n }\n\n private abortDragSequence(): void {\n this.clearHoldDelayTimer();\n this.isDragging.set(false);\n this.isMoving.set(false);\n this.activePointerId.set(null);\n this.removeDocumentListeners();\n this.renderer.removeStyle(this.handle(), 'userSelect');\n this.resetHandleCursorAfterDrag();\n this.clearActiveDragCursor();\n this.activeHandleElement.set(null);\n }\n\n private resetHandleCursorAfterDrag(): void {\n const cursorMode = this.dragCursorOverride();\n if (cursorMode === 'grab') {\n this.renderer.setStyle(this.handle(), 'cursor', 'grab');\n } else if (cursorMode === 'grab-on-drag') {\n this.renderer.removeStyle(this.handle(), 'cursor');\n }\n }\n\n private startDrag(e: PointerEvent) {\n if (this.usesGrabDragCursor()) {\n this.renderer.setStyle(this.handle(), 'cursor', 'grabbing');\n this.setActiveDragCursor('grabbing');\n }\n\n this.renderer.setStyle(this.element(), 'z-index', '1');\n\n // Add CDK-style classes\n this.renderer.addClass(this.element(), 'ax-dragging');\n this.renderer.addClass(this.element(), 'ax-drag-placeholder');\n\n if (this._parentDropList) {\n this._currentDropList.set(this._parentDropList);\n this._parentDropList.prepareSort(this);\n } else {\n this.dropZoneHoverHandler(e);\n }\n\n if (this.createCloneElement()) {\n const elementRect = this.element().getBoundingClientRect();\n this.clonePointerOffset.set({\n x: e.clientX - elementRect.left,\n y: e.clientY - elementRect.top,\n });\n const clone = this.createCloneElementHandler(this.element());\n if (clone) {\n this.renderer.addClass(clone, 'ax-drag-preview');\n this.renderer.addClass(clone, 'ax-dragging');\n }\n }\n }\n\n private handlePointerUp(e: PointerEvent) {\n if (e.pointerId !== this.activePointerId() || !isPlatformBrowser(this.platformId) || !this.isDragging()) {\n return;\n }\n\n this.clearHoldDelayTimer();\n\n this.resetHandleCursorAfterDrag();\n this.clearActiveDragCursor();\n\n const wasMoving = this.isMoving();\n this.isMoving.set(false);\n this.isDragging.set(false);\n\n // Remove CDK-style classes\n this.renderer.removeClass(this.element(), 'ax-dragging');\n this.renderer.removeClass(this.element(), 'ax-drag-placeholder');\n\n if (!wasMoving) {\n this.activePointerId.set(null);\n this.removeDocumentListeners();\n this._currentDropList.set(null);\n this.renderer.removeStyle(this.handle(), 'userSelect');\n this.activeHandleElement.set(null);\n return;\n }\n\n this.renderer.removeStyle(this.element(), 'z-index');\n this.preventClicking();\n\n const transform = this.element().style.transform;\n let x = 0;\n let y = 0;\n if (transform) {\n x = Number(transform.split('translateX(')[1]?.split('px)')[0]);\n y = Number(transform.split('translateY(')[1]?.split('px)')[0]);\n }\n\n const droppedIntoList = this._currentDropList();\n if (droppedIntoList && this._parentDropList) {\n droppedIntoList.finalizeSort(e, this, this._parentDropList);\n } else if (this._parentDropList) {\n this._parentDropList.cancelSort(this);\n } else {\n this.dropZoneDropHandler(e);\n }\n\n // Cancel any pending RAF callbacks\n if (this.rafId !== null) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n this.pendingPointerEvent = null;\n\n this.activePointerId.set(null);\n this.removeDocumentListeners();\n this._currentDropList.set(null);\n this.renderer.removeStyle(this.handle(), 'userSelect');\n this.activeHandleElement.set(null);\n\n if (this.createCloneElement()) {\n const listUnderPointer = this.getDropListFromPoint(e.clientX, e.clientY);\n this.removeCloneElementWithAnimation(x || 0, y || 0, listUnderPointer);\n } else {\n this.renderer.setStyle(this.element(), 'opacity', this.elementOpacity());\n }\n }\n\n private preventClicking() {\n const blockClick = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n this.document.addEventListener('click', blockClick, { capture: true, once: true });\n }\n\n private handleDropListInteractions(e: PointerEvent) {\n const listUnderPointer = this.getDropListFromPoint(e.clientX, e.clientY);\n const previousList = this._currentDropList();\n let targetList: AXDropListDirective | null = null;\n const canDrop = listUnderPointer && this.canDropInList(listUnderPointer);\n\n if (canDrop) {\n targetList = listUnderPointer;\n }\n\n // Update cursor based on whether drop is allowed\n if (listUnderPointer) {\n const cloneEl = this.clonedElement();\n const cursor = this.resolveDropCursor(!!canDrop);\n if (this.usesGrabDragCursor()) {\n this.setActiveDragCursor(cursor);\n } else if (cloneEl) {\n this.setElementDropCursor(cloneEl, cursor);\n } else {\n this.setElementDropCursor(this.element(), cursor);\n }\n }\n\n if (targetList !== previousList) {\n if (previousList) {\n previousList.cancelSortPreview();\n if (previousList !== this._parentDropList) {\n previousList.resetSortState();\n }\n }\n if (targetList) {\n targetList.enter(this);\n }\n this._currentDropList.set(targetList);\n }\n\n this._currentDropList()?.sort(e, this);\n }\n\n private canDropInList(list: AXDropListDirective): boolean {\n if (!list || list.isSortingDisabled() || !this._parentDropList) {\n return false;\n }\n if (list === this._parentDropList) {\n return true;\n }\n const dragGroup = this._parentDropList.dropListGroup();\n const targetGroup = list.dropListGroup();\n\n if (!dragGroup || dragGroup !== targetGroup) {\n return false;\n }\n\n // Check for circular reference (tree-specific validation)\n const draggedNode = this.dragData();\n const targetNodeId = list.element.getAttribute('data-node-id');\n\n if (draggedNode && this.isCircularReference(targetNodeId, draggedNode)) {\n return false;\n }\n\n return true;\n }\n\n private isCircularReference(targetNodeId: string | null, draggedNode: unknown): boolean {\n if (!draggedNode || typeof draggedNode !== 'object') {\n return false;\n }\n\n const node = draggedNode as { id?: string; children?: unknown[] };\n\n // Check if dropping into itself\n if (targetNodeId === node.id) {\n return true;\n }\n\n // Check if targetNodeId is in draggedNode's descendants\n if (!node.children || !Array.isArray(node.children)) {\n return false;\n }\n\n for (const child of node.children) {\n const childNode = child as { id?: string };\n if (childNode.id === targetNodeId) {\n return true;\n }\n if (this.isCircularReference(targetNodeId, child)) {\n return true;\n }\n }\n\n return false;\n }\n\n private dropZoneHoverHandler(e: PointerEvent) {\n const dropZones = this.getDropZonesFromPoint(e.clientX, e.clientY);\n const dropZone = dropZones[0];\n\n if (!dropZone) {\n if (this.prevDropZone()) {\n this.leavePrevDropZone(e);\n }\n return;\n }\n\n if (this.prevDropZone() && this.prevDropZone() !== dropZone) {\n this.leavePrevDropZone(e);\n }\n\n if (this.dropZoneValidation(dropZone) && !dropZone.isHovered()) {\n this.prevDropZone.set(dropZone);\n dropZone.onElementHover.emit({ sender: dropZone, dropped: this, nativeEvent: e, state: 'enter' });\n dropZone.isHovered.set(true);\n }\n }\n\n private dropZoneDropHandler(e: PointerEvent) {\n const dropZones = this.getDropZonesFromPoint(e.clientX, e.clientY);\n const dropZone = dropZones[0];\n if (!this.dropZoneValidation(dropZone)) {\n return;\n }\n dropZone.isHovered.set(false);\n dropZone.onElementDrop.emit({ sender: dropZone, dropped: this, nativeEvent: e });\n }\n\n private getDropZonesFromPoint(x: number, y: number): AXDropZoneDirective[] {\n const elements = this.document.elementsFromPoint(x, y);\n\n return elements\n .filter((el): el is HTMLElement => el instanceof HTMLElement && el.dataset['axDropZone'] === 'true')\n .map((el) => el['__axContext__'] as AXDropZoneDirective);\n }\n\n private getDropListFromPoint(x: number, y: number): AXDropListDirective | null {\n const dropListElements = this.document\n .elementsFromPoint(x, y)\n .filter((el): el is HTMLElement => el instanceof HTMLElement && el.dataset['axDropList'] === 'true');\n\n if (dropListElements.length === 0) {\n return null;\n }\n\n // If only one drop list, use it\n if (dropListElements.length === 1) {\n return dropListElements[0]['__axContext__'] as AXDropListDirective;\n }\n\n // Multiple drop lists detected (nested scenario like tree2)\n // Prioritize based on pointer position and drop type\n const ontoNodeList = dropListElements.find((el) => el.dataset['dropType'] === 'onto-node');\n const reorderList = dropListElements.find((el) => el.dataset['dropType'] !== 'onto-node');\n\n // If no special handling needed, return first\n if (!ontoNodeList || !reorderList) {\n return dropListElements[0]['__axContext__'] as AXDropListDirective;\n }\n\n // Calculate pointer position relative to the \"onto-node\" element\n const ontoNodeRect = ontoNodeList.getBoundingClientRect();\n const relativeY = y - ontoNodeRect.top;\n const heightRatio = relativeY / ontoNodeRect.height;\n\n // Smart zone detection based on pointer position\n if (heightRatio < ZONE_TOP_THRESHOLD || heightRatio > ZONE_BOTTOM_THRESHOLD) {\n // Top or bottom zone: reorder (drop BEFORE/AFTER node)\n return reorderList['__axContext__'] as AXDropListDirective;\n } else {\n // Center zone: onto-node (drop INTO node as child)\n return ontoNodeList['__axContext__'] as AXDropListDirective;\n }\n }\n\n private dropZoneValidation(dropZone: AXDropZoneDirective): boolean {\n if (!dropZone) return false;\n const dragGroup = this.dropZoneGroup();\n const dropGroup = dropZone.dropZoneGroup();\n if (dropGroup && dragGroup !== dropGroup) {\n return false;\n }\n return true;\n }\n\n private leavePrevDropZone(e: PointerEvent) {\n if (this.prevDropZone()) {\n this.prevDropZone().onElementHover.emit({\n dropped: this,\n state: 'leave',\n nativeEvent: e,\n sender: this.prevDropZone(),\n });\n this.prevDropZone().isHovered.set(false);\n this.prevDropZone.set(null);\n }\n }\n\n setPosition(x: number, y: number) {\n let constrainedX = x;\n let constrainedY = y;\n\n const boundaryRect = this.boundaryElement()?.getBoundingClientRect();\n\n if (boundaryRect) {\n // Measured on every move: the element or boundary may have been resized or re-laid out since the last drag.\n const elementRect = this.element().getBoundingClientRect();\n const minX = boundaryRect.left - (elementRect.left - this.appliedTranslate.x);\n const minY = boundaryRect.top - (elementRect.top - this.appliedTranslate.y);\n const maxX = minX + boundaryRect.width - elementRect.width;\n const maxY = minY + boundaryRect.height - elementRect.height;\n constrainedX = clamp(x, minX, maxX);\n constrainedY = clamp(y, minY, maxY);\n }\n\n if (this.lockAxis() === 'x') constrainedY = this.currentAxis().y;\n if (this.lockAxis() === 'y') constrainedX = this.currentAxis().x;\n\n // Direct DOM manipulation without triggering change detection\n this.renderer.setStyle(this.element(), 'translate', `${constrainedX}px ${constrainedY}px`);\n this.appliedTranslate = { x: constrainedX, y: constrainedY };\n\n // Only update signal and emit if position actually changed significantly (throttle)\n const current = this.currentAxis();\n if (Math.abs(current.x - constrainedX) > 0.5 || Math.abs(current.y - constrainedY) > 0.5) {\n this.currentAxis.set({ x: constrainedX, y: constrainedY });\n this.dragPositionChanged.emit({ x: constrainedX, y: constrainedY });\n }\n }\n\n setClonePosition(x: number, y: number) {\n let constrainedX = x;\n let constrainedY = y;\n\n const cloneEl = this.clonedElement();\n const boundaryRect = this.boundaryRect();\n\n if (boundaryRect && cloneEl) {\n const cloneWidth = cloneEl.offsetWidth;\n const cloneHeight = cloneEl.offsetHeight;\n\n constrainedX = clamp(x, boundaryRect.left, boundaryRect.right - cloneWidth);\n constrainedY = clamp(y, boundaryRect.top, boundaryRect.bottom - cloneHeight);\n }\n\n if (this.lockAxis() === 'x') constrainedY = this.currentCloneAxis().y;\n if (this.lockAxis() === 'y') constrainedX = this.currentCloneAxis().x;\n\n // Direct DOM manipulation without triggering change detection\n this.renderer.setStyle(cloneEl, 'translate', `${constrainedX}px ${constrainedY}px`);\n\n // Only update signal and emit if position actually changed significantly (throttle)\n const current = this.currentCloneAxis();\n if (Math.abs(current.x - constrainedX) > 0.5 || Math.abs(current.y - constrainedY) > 0.5) {\n this.currentCloneAxis.set({ x: constrainedX, y: constrainedY });\n this.dragPositionChanged.emit({ x: constrainedX, y: constrainedY });\n }\n }\n\n private createCloneElementHandler(originalElement: HTMLElement): HTMLElement | null {\n if (!isPlatformBrowser(this.platformId)) {\n this.clonedElement.set(null);\n return null;\n }\n\n let clonedElement: HTMLElement;\n const customTemplate = this.dragClonedTemplate();\n\n const applyComputedStylesRecursive = (source: HTMLElement, target: HTMLElement) => {\n if (!isPlatformBrowser(this.platformId)) return;\n const computedStyles = window.getComputedStyle(source);\n\n if (computedStyles.cssText && target.style.cssText !== undefined) {\n let tempCssText = computedStyles.cssText;\n if (target === clonedElement) {\n tempCssText = tempCssText\n .replace(/position:[^;]+;/gi, '')\n .replace(/top:[^;]+;/gi, '')\n .replace(/left:[^;]+;/gi, '')\n .replace(/right:[^;]+;/gi, '')\n .replace(/bottom:[^;]+;/gi, '')\n .replace(/width:[^;]+;/gi, '')\n .replace(/height:[^;]+;/gi, '')\n .replace(/margin[^;]*:[^;]+;/gi, '')\n .replace(/transition[^;]*:[^;]+;/gi, '')\n .replace(/transform:[^;]+;/gi, '')\n .replace(/translate:[^;]+;/gi, '')\n .replace(/z-index:[^;]+;/gi, '')\n .replace(/opacity:[^;]+;/gi, '');\n }\n tempCssText = tempCssText.replace(/pointer-events:[^;]+;/gi, '');\n target.style.cssText = tempCssText;\n } else {\n for (let i = 0; i < computedStyles.length; i++) {\n const propName = computedStyles[i];\n if (propName === 'pointer-events') {\n continue;\n }\n if (\n target === clonedElement &&\n (propName === 'position' ||\n propName === 'top' ||\n propName === 'left' ||\n propName === 'right' ||\n propName === 'bottom' ||\n propName === 'width' ||\n propName === 'height' ||\n propName.startsWith('margin') ||\n propName.startsWith('transition') ||\n propName === 'transform' ||\n propName === 'translate' ||\n propName === 'z-index' ||\n propName === 'opacity')\n ) {\n continue;\n }\n try {\n target.style.setProperty(\n propName,\n computedStyles.getPropertyValue(propName),\n computedStyles.getPropertyPriority(propName),\n );\n } catch {\n // Some CSS properties cannot be set directly, skip silently\n }\n }\n }\n const sourceChildren = Array.from(source.children);\n const targetChildren = Array.from(target.children);\n for (let i = 0; i < sourceChildren.length; i++) {\n if (sourceChildren[i] instanceof HTMLElement && targetChildren[i] instanceof HTMLElement) {\n applyComputedStylesRecursive(sourceChildren[i] as HTMLElement, targetChildren[i] as HTMLElement);\n }\n }\n };\n\n if (customTemplate) {\n const viewRef = this.viewContainerRef.createEmbeddedView(customTemplate);\n this.clonedElementViewRef.set(viewRef);\n\n if (viewRef.rootNodes.length > 0 && viewRef.rootNodes[0] instanceof HTMLElement) {\n clonedElement = viewRef.rootNodes[0] as HTMLElement;\n\n const viewIndex = this.viewContainerRef.indexOf(viewRef);\n if (viewIndex !== -1) {\n this.viewContainerRef.detach(viewIndex);\n }\n } else {\n if (this.clonedElementViewRef()) {\n this.clonedElementViewRef().destroy();\n this.clonedElementViewRef.set(null);\n }\n console.warn(\n 'AXDragDirective: dragClonedTemplate did not produce a valid HTMLElement root node. Falling back to default cloning.',\n );\n clonedElement = originalElement.cloneNode(true) as HTMLElement;\n applyComputedStylesRecursive(originalElement, clonedElement);\n }\n } else {\n clonedElement = originalElement.cloneNode(true) as HTMLElement;\n applyComputedStylesRecursive(originalElement, clonedElement);\n }\n\n if (clonedElement.id) {\n this.renderer.removeAttribute(clonedElement, 'id');\n }\n this.renderer.setStyle(originalElement, 'opacity', '0.5');\n\n const originalRect = originalElement.getBoundingClientRect();\n this.renderer.setStyle(clonedElement, 'position', 'fixed', RendererStyleFlags2.Important);\n this.renderer.setStyle(clonedElement, 'left', '0px');\n this.renderer.setStyle(clonedElement, 'top', '0px');\n if (!customTemplate) {\n this.renderer.setStyle(clonedElement, 'width', `${originalRect.width}px`);\n this.renderer.setStyle(clonedElement, 'height', `${originalRect.height}px`);\n }\n this.renderer.setStyle(clonedElement, 'margin', '0');\n this.renderer.setStyle(clonedElement, 'box-sizing', 'border-box');\n this.renderer.setStyle(clonedElement, 'opacity', '0.75');\n this.renderer.setStyle(clonedElement, 'z-index', '9999');\n this.renderer.setStyle(clonedElement, 'pointer-events', 'none', RendererStyleFlags2.Important);\n this.renderer.setStyle(clonedElement, 'user-select', 'none');\n this.renderer.setStyle(clonedElement, 'touch-action', 'none');\n\n this.renderer.setStyle(clonedElement, 'translate', `${originalRect.left}px ${originalRect.top}px`);\n this.renderer.removeStyle(clonedElement, 'transition');\n this.renderer.removeStyle(clonedElement, 'transition-property');\n\n this.copyPseudoElementStyles(originalElement, clonedElement, '::before');\n this.copyPseudoElementStyles(originalElement, clonedElement, '::after');\n\n this.renderer.appendChild(this.document.body, clonedElement);\n this.clonedElement.set(clonedElement);\n this.setClonePosition(originalRect.left, originalRect.top);\n\n return clonedElement;\n }\n\n private copyPseudoElementStyles(source: HTMLElement, target: HTMLElement, pseudo: '::before' | '::after'): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n const pseudoStyles = window.getComputedStyle(source, pseudo);\n const content = pseudoStyles.getPropertyValue('content');\n const display = pseudoStyles.getPropertyValue('display');\n if (!content || content === 'none' || display === 'none') {\n return;\n }\n const pseudoElement = this.renderer.createElement('span');\n for (let i = 0; i < pseudoStyles.length; i++) {\n const propName = pseudoStyles[i];\n try {\n pseudoElement.style.setProperty(\n propName,\n pseudoStyles.getPropertyValue(propName),\n pseudoStyles.getPropertyPriority(propName),\n );\n } catch (e) {\n // Some properties might fail to set, which is usually fine.\n }\n }\n if (content.startsWith('\"') && content.endsWith('\"')) {\n this.renderer.setProperty(pseudoElement, 'textContent', content.slice(1, -1));\n } else {\n this.renderer.setProperty(pseudoElement, 'textContent', content);\n }\n this.renderer.setStyle(pseudoElement, 'pointer-events', 'none');\n if (pseudo === '::before') {\n this.renderer.insertBefore(target, pseudoElement, target.firstChild);\n } else {\n this.renderer.appendChild(target, pseudoElement);\n }\n }\n\n private removeCloneElementWithAnimation(x: number, y: number, dropList?: AXDropListDirective) {\n dropList?._draggableItems().forEach((item) => {\n this.removeElementTransition(item.element());\n });\n const clone = this.clonedElement();\n if (!clone) return;\n\n this.renderer.setStyle(this.element(), 'opacity', this.elementOpacity());\n\n const elementRect = this.element().getBoundingClientRect();\n if (elementRect) {\n this.setElementTransition(clone);\n this.renderer.setStyle(clone, 'opacity', '0');\n this.setClonePosition(elementRect.left + x, elementRect.top + y);\n }\n\n if (!this.dragTransition()) {\n this.removeCloneElement();\n } else {\n setTimeout(() => {\n this.removeCloneElement();\n dropList?._draggableItems().forEach((item) => {\n this.setElementTransition(item.element());\n });\n }, this.transitionDuration());\n }\n }\n\n private removeCloneElement() {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const clone = this.clonedElement();\n if (clone?.parentNode) {\n // Remove classes before removing element\n this.renderer.removeClass(clone, 'ax-drag-preview');\n this.renderer.removeClass(clone, 'ax-dragging');\n this.renderer.removeChild(clone.parentNode, clone);\n }\n this.clonedElement.set(null);\n\n if (this.clonedElementViewRef()) {\n this.clonedElementViewRef().destroy();\n this.clonedElementViewRef.set(null);\n }\n this.cdr.markForCheck();\n }\n\n private addDocumentListeners(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n this.zone.runOutsideAngular(() => {\n this.document.addEventListener('pointermove', this.boundHandlePointerMove, { passive: false });\n this.document.addEventListener('pointerup', this.boundHandlePointerUp);\n this.document.addEventListener('pointercancel', this.boundHandlePointerUp);\n });\n }\n\n private removeDocumentListeners(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n this.zone.runOutsideAngular(() => {\n this.document.removeEventListener('pointermove', this.boundHandlePointerMove);\n this.document.removeEventListener('pointerup', this.boundHandlePointerUp);\n this.document.removeEventListener('pointercancel', this.boundHandlePointerUp);\n });\n }\n}\n","import { NXComponent, NXNativeEvent } from '@acorex/cdk/common';\nimport { Directive, OnInit, input, output, signal } from '@angular/core';\nimport { AXDragDirective } from './drag.directive';\n\nexport interface AXDropZoneDropEvent extends NXNativeEvent<AXDropZoneDirective, MouseEvent> {\n dropped: AXDragDirective;\n}\nexport type AXDropZoneHoverEvent = AXDropZoneDropEvent & { state: 'enter' | 'leave' };\n\n@Directive({\n selector: '[axDropZone]',\n exportAs: 'axDropZone',\n})\nexport class AXDropZoneDirective extends NXComponent implements OnInit {\n dropZoneGroup = input<string>();\n\n isHovered = signal(false);\n readonly element = signal(this.nativeElement);\n\n onElementDrop = output<AXDropZoneDropEvent>();\n onElementHover = output<AXDropZoneHoverEvent>();\n\n ngOnInit(): void {\n this.element().dataset['axDropZone'] = 'true';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AXDragHandleDirective } from './drag-handle.directive';\nimport { AXDragDirective } from './drag.directive';\nimport { AXDropListDirective } from './drop-list.directive';\nimport { AXDropZoneDirective } from './drop-zone.directive';\n\nconst COMPONENT = [AXDragDirective, AXDragHandleDirective, AXDropListDirective, AXDropZoneDirective];\n\n@NgModule({\n imports: [...COMPONENT],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXDragDropModule {}\n","import { clamp } from 'lodash-es';\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;MACU,cAAc,GAAG,IAAI,cAAc,CAAe,gBAAgB;;MCDlE,qBAAqB,CAAA;AAKhC,IAAA,WAAA,GAAA;AAJQ,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,EAAC,UAAuB,EAAC;QACpC,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa;oFAAC;AAG9C,QAAA,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC;AACjC,QAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACzE;8GARW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA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AAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;IAC7B;AAEA,IAAA,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM;AACpB;AAEA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAC/B,YAAiB,EACjB,WAAgB,EAChB,YAAoB,EACpB,WAAmB,EAAA;AAEnB,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;IACzD,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;AAEjD,IAAA,IAAI,YAAY,CAAC,MAAM,EAAE;AACvB,QAAA,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D;AACF;;AC7CA;;AAEG;;"}
|
|
@@ -207,7 +207,6 @@ function attachOverlayDrag(element, documentRef, options) {
|
|
|
207
207
|
startY = event.clientY;
|
|
208
208
|
originX = translateX;
|
|
209
209
|
originY = translateY;
|
|
210
|
-
element.setPointerCapture?.(event.pointerId);
|
|
211
210
|
documentRef.addEventListener('pointermove', onPointerMove);
|
|
212
211
|
documentRef.addEventListener('pointerup', onPointerUp);
|
|
213
212
|
documentRef.addEventListener('pointercancel', onPointerUp);
|
|
@@ -221,6 +220,9 @@ function attachOverlayDrag(element, documentRef, options) {
|
|
|
221
220
|
if (!moved && Math.hypot(deltaFromStartX, deltaFromStartY) < 3) {
|
|
222
221
|
return;
|
|
223
222
|
}
|
|
223
|
+
if (!moved) {
|
|
224
|
+
element.setPointerCapture?.(event.pointerId);
|
|
225
|
+
}
|
|
224
226
|
moved = true;
|
|
225
227
|
event.preventDefault();
|
|
226
228
|
const rect = element.getBoundingClientRect();
|
|
@@ -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 element.setPointerCapture?.(event.pointerId);\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 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,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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;8GAxbW,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;;"}
|
|
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,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AA,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.45",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/core": "22.4.
|
|
5
|
+
"@acorex/core": "22.4.45",
|
|
6
6
|
"@tiptap/core": ">=3.31.4",
|
|
7
7
|
"@tiptap/extension-color": ">=3.31.4",
|
|
8
8
|
"@tiptap/extension-highlight": ">=3.31.4",
|
|
@@ -72,6 +72,7 @@ declare class AXDragDirective implements OnInit, OnDestroy, AXDragParent {
|
|
|
72
72
|
private clonePointerOffset;
|
|
73
73
|
private clonedElementViewRef;
|
|
74
74
|
private rafId;
|
|
75
|
+
private appliedTranslate;
|
|
75
76
|
private pendingPointerEvent;
|
|
76
77
|
private savedBodyCursor;
|
|
77
78
|
private holdDelayTimer;
|