igniteui-angular
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
108 lines (107 loc) • 5.96 kB
TypeScript
import { IgxQueryBuilderTreeComponent } from './query-builder-tree.component';
import { ElementRef } from '@angular/core';
import { ExpressionGroupItem, ExpressionItem } from './query-builder.common';
import * as i0 from "@angular/core";
/** @hidden @internal */
export declare class IgxQueryBuilderDragService {
/** The ExpressionItem that's actually the drop ghost's content */
dropGhostExpression: ExpressionItem;
isKeyboardDrag: boolean;
private _queryBuilderTreeComponent;
private _queryBuilderTreeComponentElRef;
private _sourceExpressionItem;
private _sourceElement;
private _targetExpressionItem;
private _dropUnder;
private _ghostChipMousemoveSubscription$;
private _keyboardSubscription$;
private _keyDragCurrentIndex;
private _keyDragInitialIndex;
private _isKeyDragsFirstMove;
/** Stores a flat ordered list of possible drop locations as Tuple <[targetExpression, dropUnder]>, while performing the keyboard drag&drop */
private _possibleDropLocations;
private _timeoutId;
/** Get the dragged ghost as a HTMLElement*/
private get getDragGhostElement();
/** Get the drop ghost chip component */
private get getDropGhostElement();
private get getMainExpressionTree();
register(tree: IgxQueryBuilderTreeComponent, el: ElementRef): void;
/** When chip is picked up for dragging
*
* @param sourceDragElement The HTML element of the chip that's been dragged
* @param sourceExpressionItem The expressionItem of the chip that's been dragged
* @param isKeyboardDrag If it's a mouse drag or keyboard reorder
*
*/
onMoveStart(sourceDragElement: HTMLElement, sourceExpressionItem: ExpressionItem, isKeyboardDrag: boolean): void;
/** When dragged chip is let go outside a proper drop zone */
onMoveEnd(): void;
/** When mouse drag enters a chip's area
* @param targetDragElement The HTML element of the drop area chip that's been dragged to
* @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to
*/
onChipEnter(targetDragElement: HTMLElement, targetExpressionItem: ExpressionItem): void;
/** When mouse drag moves in a div's drop area
* @param targetDragElement The HTML element of the drop area chip that's been dragged to
* @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to
*/
onDivOver(targetDragElement: HTMLElement, targetExpressionItem: ExpressionItem): void;
/** When mouse drag moves in a chip's drop area
* @param targetDragElement The HTML element of the drop area chip that's been dragged to
*/
onChipOver(targetDragElement: HTMLElement): void;
/** When mouse drag leaves a chip's drop area */
onChipLeave(): void;
/** When dragged chip is let go in div's drop area
* @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to
*/
onDivDropped(targetExpressionItem: ExpressionItem): void;
/** When dragged chip is let go in chip's drop area */
onChipDropped(): void;
/** When mouse drag moves in a AND/OR drop area
* @param targetDragElement The HTML element of the drop area chip that's been dragged to
* @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to
*/
onGroupRootOver(targetDragElement: HTMLElement, targetExpressionItem: ExpressionGroupItem): void;
/** When mouse drag moves in 'Add condition' button's drop area
* @param addConditionElement The Add condition button HTML Element
* @param rootGroup The root group of the query tree
*/
onAddConditionEnter(addConditionElement: HTMLElement, rootGroup: ExpressionGroupItem): void;
/** When chip's drag indicator is focused
*
* @param sourceDragElement The HTML element of the chip that's been dragged
* @param sourceExpressionItem The expressionItem of the chip that's been dragged
*
*/
onChipDragIndicatorFocus(sourceDragElement: HTMLElement, sourceExpressionItem: ExpressionItem): void;
/** When chip's drag indicator looses focus*/
onChipDragIndicatorFocusOut(): void;
/** Upon blurring the tree, if Keyboard drag is underway and the next active item is not the drop ghost's drag indicator icon, cancel the drag&drop procedure*/
onDragFocusOut(): void;
/** Checks if the dragged ghost is horizontally on the same line with the drop ghost*/
private dragGhostIsOnDropGhostRow;
/** Checks if the dragged ghost is north or south of a target element's center*/
private ghostInLowerPart;
/** Make a copy of the _sourceExpressionItem's chip and paste it in the tree north or south of the _targetExpressionItem's chip */
private renderDropGhostChip;
/** Set the cursor when dragging a ghost*/
private setDragCursor;
/** Removes the drop ghost expression from the tree and it's chip effectively */
private clearDropGhost;
/** Reset Drag&Drop vars. Optionally the drag source vars too*/
private resetDragAndDrop;
/** Start listening for drag and drop specific keys */
private listenToKeyboard;
/** Perform up/down movement of drop ghost along the expression tree*/
private arrowDrag;
/** Produces a flat ordered list of possible drop locations as Tuple <[targetExpression, dropUnder]>, while performing the keyboard drag&drop */
private getPossibleDropLocations;
/** Counts how many chips will be in the tree (from top to bottom) before the dropped one */
private countChipsBeforeDropLocation;
/** Sets the z-index of the drag ghost with a little delay, since we don't have access to ghostCreated() but we know it's executed right after moveStart() */
private setDragGhostZIndex;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxQueryBuilderDragService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IgxQueryBuilderDragService>;
}