import * as _angular_core from '@angular/core'; import { OnInit, OnDestroy, TemplateRef, ElementRef, AfterContentInit } from '@angular/core'; import { NXComponent, NXNativeEvent } from '@acorex/cdk/common'; type AXPositionType = { x: number; y: number; }; declare class AXDragDirective implements OnInit, OnDestroy { #private; private zone; private document; private renderer; private cdr; private platformId; private viewContainerRef; private el; private handleDirective; axDrag: _angular_core.InputSignalWithTransform; dragData: _angular_core.InputSignal; dragDisabled: _angular_core.InputSignal; dragTransition: _angular_core.InputSignal; dragElementClone: _angular_core.InputSignal; dropZoneGroup: _angular_core.InputSignal; dragStartDelay: _angular_core.InputSignal; dragResetOnDblClick: _angular_core.InputSignal; dragLockAxis: _angular_core.InputSignal<"x" | "y">; dragClonedTemplate: _angular_core.InputSignal>; dragCursor: _angular_core.InputSignal<"move" | "grab" | "none">; dragBoundary: _angular_core.InputSignal>; dragTransitionDuration: _angular_core.InputSignal; dragPositionChanged: _angular_core.OutputEmitterRef; isMoving: _angular_core.WritableSignal; clonedElement: _angular_core.WritableSignal; currentAxis: _angular_core.WritableSignal; currentCloneAxis: _angular_core.WritableSignal; transitionDuration: _angular_core.WritableSignal; readonly element: _angular_core.WritableSignal; private dragStartTime; private isDragging; private elementOpacity; private movedAfterDelay; private activePointerId; private prevDropZone; private dragStartOffset; private clonePointerOffset; private clonedElementViewRef; private rafId; private pendingPointerEvent; private _parentDropList; private _currentDropList; readonly createCloneElement: _angular_core.Signal; private boundaryElement; readonly elementRect: _angular_core.Signal; private boundaryRect; private handle; private boundHandleDblClick; private boundHandlePointerUp; private boundHandlePointerDown; private boundHandlePointerMove; private listenersAttached; ngOnInit(): void; ngOnDestroy(): void; private setElementTransition; private removeElementTransition; private handlePointerDown; private handleDblClick; private handlePointerMove; private startDrag; private handlePointerUp; private preventClicking; private handleDropListInteractions; private canDropInList; private isCircularReference; private dropZoneHoverHandler; private dropZoneDropHandler; private getDropZonesFromPoint; private getDropListFromPoint; private dropZoneValidation; private leavePrevDropZone; setPosition(x: number, y: number): void; setClonePosition(x: number, y: number): void; private createCloneElementHandler; private copyPseudoElementStyles; private removeCloneElementWithAnimation; private removeCloneElement; private addDocumentListeners; private removeDocumentListeners; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class AXDragHandleDirective { private el; readonly element: _angular_core.WritableSignal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** Event object emitted when an item is dropped into a drop list. */ interface AXDropListDroppedEvent extends NXNativeEvent { item: AXDragDirective; currentIndex: number; previousIndex: number; container: AXDropListDirective; previousContainer: AXDropListDirective; } /** * @Directive axDropList * * Manages a list of draggable items (`axDrag`), enabling sorting within the list * and transferring items between compatible lists. It handles the visual shifting * of items during a drag operation to provide a clear preview of the drop location. * * This directive automatically detects `gap` from flexbox/grid layouts and handles * items with variable sizes and margins. */ declare class AXDropListDirective extends NXComponent implements OnInit, AfterContentInit, OnDestroy { private readonly _zone; private readonly _renderer; private readonly _cdr; private readonly _platformId; private readonly _hostEl; /** Boolean input matching the directive selector name for conditional application. */ axDropList: _angular_core.InputSignalWithTransform; /** Whether sorting within this list is disabled. */ sortingDisabled: _angular_core.InputSignal; /** The group this drop list belongs to. Dragging is only allowed between lists of the same group. */ dropListGroup: _angular_core.InputSignal; /** The layout orientation of the list. */ dropListOrientation: _angular_core.InputSignal<"horizontal" | "vertical">; /** Emits when an item is dropped into the list. */ dropListDropped: _angular_core.OutputEmitterRef; /** The `axDrag` directives that are direct children of this list. */ readonly _draggableItems: _angular_core.Signal; /** The native element of the drop list. */ readonly element: HTMLElement; /** The draggable item currently being moved over this list. */ private readonly _activeDragItem; /** The calculated index where the placeholder/item should be. */ private readonly _placeholderIndex; /** A snapshot of the items' data and geometry at the start of the drag. */ private readonly _cachedItems; /** The list's initial bounding box, used to calculate scroll delta. */ private readonly _listInitialRect; /** The detected `gap` of the list for the current orientation. */ private readonly _listGap; /** A signal-based alias for the orientation input for internal use. */ private readonly _orientation; /** DOM placeholder element for inter-list drags */ private _placeholderElement; ngOnInit(): void; ngAfterContentInit(): void; ngOnDestroy(): void; /** Checks if the given drag item is the one currently active in this list. */ isDragActiveForThisList(dragItem: AXDragDirective): boolean; /** * Prepares the list for sorting when a drag operation starts from within this list. * @param dragItem The item that is being dragged. */ prepareSort(dragItem: AXDragDirective): void; /** * Prepares the list for receiving an item that started dragging from another list. * @param dragItem The item entering this list. */ enter(dragItem: AXDragDirective): void; /** * Calculates the new placeholder index based on the pointer's position and applies visual shifts. * @param event The pointer move event. * @param dragItem The item being dragged. */ sort(event: PointerEvent, dragItem: AXDragDirective): void; /** * Finalizes the drop, emits the drop event, and resets the list's state. * @param event The pointer up event. * @param droppedItem The item that was dropped. * @param sourceList The list where the drag originated. */ finalizeSort(event: PointerEvent, droppedItem: AXDragDirective, sourceList: AXDropListDirective): void; /** Resets the transforms on all items and cancels the current sort operation. */ cancelSort(dragItem?: AXDragDirective): void; /** Resets transforms but keeps the active state, used when moving between lists. */ cancelSortPreview(): void; /** Caches the geometry of the list and its items at the start of a drag. */ private _cacheGeometry; /** Detects and caches the `gap` property from the list's computed styles. */ private _detectAndCacheListGap; /** * Determines the new placeholder index by comparing the pointer position against the * midpoints of the other items in the list. * @param pointerPosition The clientX or clientY of the pointer. * @returns The calculated placeholder index. */ private _calculatePlaceholderIndex; /** Applies visual shifts - uses placeholder for inter-list, transforms for intra-list. */ private _applyVisualShifts; /** Creates or moves the placeholder element for inter-list drags */ private _updatePlaceholderElement; /** Removes the placeholder element if it exists */ private _removePlaceholderElement; /** * Calculates the required transform in pixels for a single item. * @param index The index of the item to transform. * @param originalIndex The original index of the dragged item (-1 if from another list). * @param draggedItemSize The size (including margins) of the item being dragged. * @param getItemSpace A helper function to get an item's size including margins. * @returns The transform value in pixels. */ private _calculateTransform; /** Resets the state of this list and the source list after a drop. */ private resetSortStateAndStyles; /** Removes all `transform` styles from the items in this list. */ private _resetAllTransforms; /** Resets the internal state of the directive to its initial values. */ resetSortState(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface AXDropZoneDropEvent extends NXNativeEvent { dropped: AXDragDirective; } type AXDropZoneHoverEvent = AXDropZoneDropEvent & { state: 'enter' | 'leave'; }; declare class AXDropZoneDirective extends NXComponent implements OnInit { dropZoneGroup: _angular_core.InputSignal; isHovered: _angular_core.WritableSignal; readonly element: _angular_core.WritableSignal; onElementDrop: _angular_core.OutputEmitterRef; onElementHover: _angular_core.OutputEmitterRef; ngOnInit(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class AXDragDropModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } /** * Moves an item one index in an array to another. * @param array Array in which to move the item. * @param fromIndex Starting index of the item. * @param toIndex Index to which the item should be moved. */ declare function moveItemInArray(array: T[], fromIndex: number, toIndex: number): void; /** * Moves an item from one array to another. * @param currentArray Array from which to transfer the item. * @param targetArray Array into which to put the item. * @param currentIndex Index of the item in its current array. * @param targetIndex Index at which to insert the item. */ declare function transferArrayItem(currentArray: T[], targetArray: T[], currentIndex: number, targetIndex: number): void; export { AXDragDirective, AXDragDropModule, AXDragHandleDirective, AXDropListDirective, AXDropZoneDirective, moveItemInArray, transferArrayItem }; export type { AXDropListDroppedEvent, AXDropZoneDropEvent, AXDropZoneHoverEvent };