Skip to content

Extras

Sortable

Bit.BlazorUI.ExtrasSortableListReorderableListDragAndDropList

BitSortable is a drag-and-drop sortable list, inspired by SortableJS: reorder the items of a list, or drag them between lists that share a Group - with live reordering, slide animations, clone and move pull modes, swap thresholds, drag handles, filters, nested lists, swap mode, multi-drag and the keyboard, every step announced to screen readers.

Rules & validation

Which groups a list takes items from, the most and fewest items it holds, and refusing, confirming or reverting a drop.

PutGroups

PutGroups names the groups whose items a list takes besides its own. Tasks and Bugs are groups of their own and never exchange items, while the Trash takes both. It lets items in only: what is in the Trash stays there. Put, MaxItems, CanDrop and the item type apply to those items as to any other drop, and the events' FromGroup says which group an item came from.

Tasks
Write the docs
Plan the release
Tidy the backlog
Bugs
Crash on save
Typo in the footer
Trash
Drop a task or a bug here.

MaxItems & MinItems

MaxItems is the most items a list holds: once full, it takes nothing from other lists - the pointer passes over it to the list around it, or shows that it cannot drop. MinItems is the fewest it keeps: nothing is moved out of it that would leave fewer, and the other lists do not take the drag, as if they were full. Both lists still sort their own items; a list at its minimum still clones out and swaps, none of which empties it. A multi-drag counts every item it carries, and a swap brings one item and takes one, so it is never refused for room. Drag Deploy to the Shelf - it goes, and two steps are left; Test then stays in the pipeline until a step comes back.

Pipeline (at least 2)
Build
Test
Deploy
Shelf (at most 3)
Lint
Benchmark

CanDrop, ConfirmDrop & RevertOnSpill

CanDrop is asked, as the dragged item reaches a position, whether it may take it - here Done takes cards from In progress only (FromId is the Id of the list the item comes from). ConfirmDrop is asked once the item is dropped, for a check that has to wait: refused, every list goes back as it was. With RevertOnSpill, a card released outside every list that takes it goes back where it came from.
  • CanDrop is the SortableJS onMove: it is asked for a reorder within the list and for an item coming from another list alike, before anything is shown, with the proposed move - Item (and Items for a multi-drag), FromId and FromGroup, OldIndex, and NewIndex, the index the item would have here. Refused, the item stays where it was, nothing is previewed, and the pointer shows that it cannot drop. It runs while the pointer moves: keep it fast and free of side effects.
  • ConfirmDrop lets a server or a dialog have the last word. The drop shows at once and the lists stay as dropped while it runs, and no other drag starts until it answers. True keeps the move, and the usual events follow. False - or a task that throws - slides every list the drag changed back, raises ItemsChanged for them, and OnEnd reports Canceled, with no OnUpdate, OnAdd, OnRemove or OnSort.
  • RevertOnSpill goes on the list the drag starts in. Without it a mouse drag released outside every list keeps what it did, as in SortableJS. A keyboard, touch or pen drag cancelled with Escape is always put back.
  • While a card is dragged, the columns that take it are outlined, and a column that refuses the position turns red: the script marks the lists with attributes, which cost no render, and the --bit-Sortable-accepts-outline, -over-outline and -refused-outline variables set on the board draw them (see Style & Class).
  • Turn the server's approval off and drag a card into Done: it shows there while the server thinks, then slides back. From the keyboard the same rules apply: carry a card toward Done and the refusal is announced ("Plan the launch cannot be moved there."), and the card stays put.

To do
Write the spec
Draw the icons
Plan the launch
In progress
Build the API
Review the PR
Done (from In progress)
Set up CI
Server: idle

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.