Skip to main content

Reorder

shadow

Reorder je komponent, ktorý umožňuje pomocou funkcionality Drag&Drop, zmeniť poradie položky ReorderItem v skupine.

Základné použitie

Atribút Disabled

Atribút disabled sa používa na zakázanie možnosti preusporiadania položiek v rámci Reorder. Keď je tento atribút nastavený, používateľ nebude môcť ťahať položky na zmenu ich poradia.

Rukoväť pre ťahanie

Pridaním elementu do slotu handle položky ReorderItem, môžete definovať špecifickú oblasť, ktorá bude slúžiť ako rukoväť pre ťahanie a preusporiadanie položiek. Toto umožňuje používateľom intuitívnejšie interakcie pri zmene poradia položiek.

Atribút Reverse - Opačné poradie

Atribút reverse sa používa na zmenu smeru preusporiadania položiek v rámci Reorder.

Drop Zóny

DropZone je komponent, ktorý predstavuje zónu určenú pre preusporiadanie obsahu.

Atribúty a Vlastnosti

disabled

DescriptionIf true, rearrangement is disabled.
Attributedisabled
Typeboolean
Defaultfalse

reverse

DescriptionIf true, the direction of rearrangement is reversed (bottom-up).
Attributereverse
Typeboolean
Defaultfalse

Eventy

NameDescription
wje-reorder:changeInvoked when changing the order of elements.

Metódy

attachEventListeners

DescriptionConnects event listeners to the element.
SignatureattachEventListeners(element) => void

startDragging

DescriptionInitializes the pull process for the reorderable element.
SignaturestartDragging(clientX, clientY, target) => void

moveElement

DescriptionUpdates the position of the dragged element and manages the reordering logic based on the mouse position.
SignaturemoveElement(pageX, pageY) => void

StopDragging

DescriptionStops the element from dragging.
SignaturestopDragging() => void

dispatchChange

DescriptionTransmits a custom event signaling that a rearrangement has occurred.
SignaturedispatchChange(from, to, order) => void

CSS Shadow Parts

NameDescription
nativeThe native part of the reorder component, containing the slot.

CSS Custom Vlastnosti

NameDescription
--flex-directionDirection of flexbox for container

Sloty

NameDescription
``The default location of the element content. This includes elements of type wje-reorder-item.