WebSharper.SortableJs

SortableJS 1.15 bindings for F# — with WebSharper

Source

${status}

SortableJS ${version}

One group, three lists

Sortable.Create(el, Options(Group = GroupOptions("board"))) with Animation, GhostClass, Handle, Filter, DataIdAttr and the full listener set. Drag the ⠿ grip; the pinned chips are filtered out.

To do

  • ≡Write the binding
  • ≡Add the sample
  • 📌Pinned (filtered)
  • ≡Ship it

Doing

  • ≡Verify in the browser
  • ≡Write the README

Done

  • ≡Bump SortableJS

Plugins: MultiDrag and Swap

Sortable.Mount(MultiDrag(), Swap()) plugs in the two plugins that the sortablejs package does not mount for you. In the first list, Ctrl-click several items (or shift-click a range) and drag them together. In the second list, drop an item onto another one to swap them.

MultiDrag

  • ≡Alpha
  • ≡Beta
  • ≡Gamma
  • ≡Delta

Swap

  • One
  • Two
  • Three
  • Four

OnSpill: revert and remove

RevertOnSpill = true puts a spilled item back where it started; RemoveOnSpill = true removes it from the DOM. Both plugins are already mounted by the sortablejs entry point — drag an item out of a list and drop it on this paragraph.

revertOnSpill

  • Revert me 1
  • Revert me 2
  • Revert me 3

removeOnSpill

  • Remove me 1
  • Remove me 2
  • Remove me 3

AutoScroll

Scroll = true, ScrollSensitivity, ScrollSpeed, BubbleScroll and ForceAutoScrollFallback drive the AutoScroll plugin. Drag an item to the top or bottom edge of the box.

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • Item 6
  • Item 7
  • Item 8
  • Item 9
  • Item 10
  • Item 11
  • Item 12
  • Item 13
  • Item 14

Instance API

toArray, sort, save (with the store option), option, closest, and the statics active, get, dragged, ghost, clone, version.

${info}

Sortable.utils

The DOM helpers SortableJS exposes as Sortable.utils: on, off, css, find, is, closest, toggleClass, extend, throttle, clone, index, nextTick, cancelNextTick, detectDirection, getChild and expando.

Log

Every listener in the sample appends a line here — onStart, onChoose, onUnchoose, onSort, onUpdate, onAdd, onRemove, onChange, onEnd, onClone, onFilter, onMove, onSpill, onSelect and onDeselect.

${logText}