@elemental/ui / Class

LmnDraggableDirective

Decorators:@Directive
Generic types:DRAGGABLE_DATA DROP_AREA_DATA
Selectors:[lmnDraggable]
Implements:OnInitOnDestroy

No documentation has been provided.

Properties

NameTypeDescription
data
r
InputSignal<DRAGGABLE_DATA | undefined>

Data passed through all the drag and drop events.

disabled
r
InputSignalWithTransform<boolean, unknown>

Disable the element drag action.

dragDrop
r
OutputEmitterRef<LmnDropEvent<DRAGGABLE_DATA, DROP_AREA_DATA>>

Emit an event only when the drop operation has been performed.

If the drop area is disabled, or the drop operation is not allowed on the specific drop area, no event is fired.

dragEnd
r
OutputEmitterRef<Prettify<Omit<LmnDropAreaEvent<DRAGGABLE_DATA, DROP_AREA_DATA>, "previewWrapper"> & { success: boolean; }>>

Emit an event when the drag and drop operation has completed, successfully or not.

dragEnter
r
OutputEmitterRef<Prettify<LmnDragDropEvent<DRAGGABLE_DATA, DROP_AREA_DATA> & { dropArea: LmnDropAreaRef<DRAGGABLE_DATA, DROP_AREA_DATA>; previewWrapper: HTMLElement; } & { disableDrop: () => void; }>>

Emit an event every time the cursor enter is a drop area.

If the drop area is disabled, no event is fired.

dragLeave
r
OutputEmitterRef<Prettify<LmnDropAreaEvent<DRAGGABLE_DATA, DROP_AREA_DATA>>>

Emit an event every time the cursor leave a drop area.

If the drop area is disabled, no event is fired.

dragOver
r
OutputEmitterRef<Prettify<LmnDropAreaEvent<DRAGGABLE_DATA, DROP_AREA_DATA>>>

Emit an event every few hundred millisecond if the cursor is in a drop area.

If the drop area is disabled, no event is fired.

dragStart
r
OutputEmitterRef<Prettify<LmnDragDropEvent<DRAGGABLE_DATA, DROP_AREA_DATA> & { setAllowedEffect: (effect: "link" | "none" | "all" | "copy" | "copyLink" | "copyMove" | "linkMove" | "move" | "uninitialized") => void; previewWrapper: HTMLElement; }>>

Emit an event every time a drag operation is started on this draggable, also if the trigger is another draggable in the group.

grouped
r
InputSignalWithTransform<string | boolean, unknown>

Used to drag multiple elements together. If a string is passed, it will be used as group ID and only the draggable with the same ID will be moved.

groupScope
r
InputSignal<string | HTMLElement | ElementRef<unknown> | undefined>

If set, the engine will restrict the research of grouped draggables to the children of the scope’s element.

id
r
InputSignal<string>

The id of the draggable element.

placeholderClass
r
InputSignal<string | undefined>

Class applied to the placeholder element in addition to the default one lmn-draggable-placeholder.

previewClass
r
InputSignal<string | undefined>

Class applied to the preview element in addition to the default one lmn-draggable-preview.

restrictTo
r
InputSignal<string | string[] | LmnDropAreaDirective<DRAGGABLE_DATA, DROP_AREA_DATA> | LmnDropAreaDirective<DRAGGABLE_DATA, DROP_AREA_DATA>[] | undefined>

Used to restrict the drop area which could accept the element drop action. Could be an id/list of id or a drop area instance/list of drop area instances.

rootElement
r
InputSignalWithTransform<HTMLElement | undefined, string | HTMLElement | undefined>

Possibility to add a selector which will be searched in the ancestors of the current element. If found, it will be the draggable element.

Static Methods

static

isDraggable()

Whether an element is a draggable

Presentation
static isDraggable(element: HTMLElement): boolean;
Parameters
NameTypeDescription
element
HTMLElement

@param element

Returns
boolean

Methods

registerHandle()

Register a custom handle

Presentation
registerHandle(handle: LmnDragHandleDirective): void;
Parameters
NameTypeDescription
handle
LmnDragHandleDirective

@param handle

Returns
void

registerPlaceholderCreator()

Register a function to create a custom placeholder element.

Presentation
registerPlaceholderCreator(placeholderCreator: () => HTMLElement): void;
Parameters
NameTypeDescription
placeholderCreator
() => HTMLElement

@param placeholderCreator

Returns
void

registerPreviewCreator()

Register a function to create a custom preview element.

Presentation
registerPreviewCreator(previewCreator: () => HTMLElement): void;
Parameters
NameTypeDescription
previewCreator
() => HTMLElement

@param previewCreator

Returns
void