Skip to main content

DragAndDropFeatureConfig <T>

Index

Properties

optionalcanDrag

canDrag?: (items: ItemInstance<T>[]) => boolean

Type declaration

optionalcanDragForeignDragObjectOver

canDragForeignDragObjectOver?: (dataTransfer: DataTransfer, target: DragTarget<T>) => boolean

Checks if a droppable visualization should be displayed when dragging a foreign object over a target. Since this is executed on a dragover event, dataTransfer.getData() is not available, so dataTransfer.effectAllowed or dataTransfer.types should be used instead. Before actually completing the drag, @{link canDropForeignDragObject} will be called by HT before applying the drop.


Type declaration

    • (dataTransfer: DataTransfer, target: DragTarget<T>): boolean
    • Parameters

      Returns boolean

optionalcanDrop

canDrop?: (items: ItemInstance<T>[], target: DragTarget<T>) => boolean

Type declaration

optionalcanDropForeignDragObject

canDropForeignDragObject?: (dataTransfer: DataTransfer, target: DragTarget<T>) => boolean

Checks if a foreign drag object can be dropped on a target, validating that an actual drop can commence based on the data in the DataTransfer object.


Type declaration

    • (dataTransfer: DataTransfer, target: DragTarget<T>): boolean
    • Parameters

      Returns boolean

optionalcanReorder

canReorder?: boolean

optionalcreateForeignDragObject

createForeignDragObject?: (items: ItemInstance<T>[]) => { data: any; dropEffect?: none | copy | link | move; effectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized; format: string }

Type declaration

    • (items: ItemInstance<T>[]): { data: any; dropEffect?: none | copy | link | move; effectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized; format: string }
    • Parameters

      Returns { data: any; dropEffect?: none | copy | link | move; effectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized; format: string }

      • data: any
      • optionaldropEffect?: none | copy | link | move
      • optionaleffectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized
      • format: string

optionalindent

indent?: number

optionalonCompleteForeignDrop

onCompleteForeignDrop?: (items: ItemInstance<T>[]) => void

Type declaration

optionalonDrop

onDrop?: (items: ItemInstance<T>[], target: DragTarget<T>) => void | Promise<void>

Type declaration

optionalonDropForeignDragObject

onDropForeignDragObject?: (dataTransfer: DataTransfer, target: DragTarget<T>) => void | Promise<void>

Type declaration

    • (dataTransfer: DataTransfer, target: DragTarget<T>): void | Promise<void>
    • Parameters

      Returns void | Promise<void>

optionalopenOnDropDelay

openOnDropDelay?: number

When dragging for this many ms on a closed folder, the folder will automatically open. Set to zero to disable.

optionalreorderAreaPercentage

reorderAreaPercentage?: number

Defines the size of the area at the top and bottom of an item where, when an item is dropped, the item willö be placed above or below the item within the same parent, as opposed to being placed inside the item. If canReorder is false, this is ignored.

optionalsetDndState

setDndState?: SetStateFn<undefined | null | DndState<T>>

optionalsetDragImage

setDragImage?: (items: ItemInstance<T>[]) => { imgElement: Element; xOffset?: number; yOffset?: number }

Type declaration

    • (items: ItemInstance<T>[]): { imgElement: Element; xOffset?: number; yOffset?: number }
    • Parameters

      Returns { imgElement: Element; xOffset?: number; yOffset?: number }

      • imgElement: Element
      • optionalxOffset?: number
      • optionalyOffset?: number