ReorderController: its internal types

Classes

PassEnds

onPassEnd(listener) runs listener at the end of every Measure pass, and returns the unsubscribe.

Extends

  • Context.Service

Properties

onPassEnd
readonly onPassEnd: (listener) => () => void;

Run listener at the end of every Measure pass: once per pass, after every round's boxes are stored (a blocked pass and one whose flush triggered more rounds included). A listener that throws is logged and doesn't stop the pass or the others.

Parameters
listener

() => void

Returns

() => void

Interfaces

ReorderController

A Reorder group on the DOM.

Type Parameters

V

V

Properties

attach
readonly attach: (element) => void;

The group's element: its direction, and the scroller Auto-scroll looks for from it.

Parameters
element

Element

Returns

void

axis
readonly axis: () => Axis;

The app's axis, else the last detected one ("y" before the first).

Returns

Axis

detect
readonly detect: () => Axis;

The axis now: the app's, else detected from the items' boxes as they are, reporting nothing. A binding derives its axis with it when the app's is cleared.

Returns

Axis

dispose
readonly dispose: () => void;

Stops listening to measures and ends the auto-scroll. The Scope calls it.

Returns

void

group
readonly group: Group<V>;

Core's Reorder group (Reorder.move(group, value, toIndex) reorders in code).

item
readonly item: (value, element, onLift?) => ItemDriver;

The driver for the item with value; element is its element (for Auto-scroll, its label, its focus and its reveal), and onLift hears its keyboard lift start and end (the binding's whileDrag).

Parameters
value

V

element

() => Option<Element>

onLift?

(lifted) => void

Returns

ItemDriver

move
readonly move: (value, toIndex) => void;

Move value to toIndex in code (Reorder.move), and announce it.

Parameters
value

V

toIndex

number

Returns

void

valuesChanged
readonly valuesChanged: () => void;

The app's values changed: re-measure, so the items animate to their slots.

Returns

void


ReorderControllerOptions

What a binding hands its group's controller.

Type Parameters

V

V

Properties

announcements?
readonly announcements?: () => Option<Announcements<V>>;

The group's announcements over the defaults, read at each announcement.

Returns

Option<Announcements<V>>

axis?
readonly axis?: () => Option<Axis>;

The app's axis, overriding detection; None to detect.

Returns

Option<Axis>

keyboard?
readonly keyboard?: () => boolean;

Whether the items reorder by keyboard, read at each key; false turns it off. On when left out.

Returns

boolean

keyedWith?
readonly keyedWith?: string;

How the binding keys its items, for the warning logged once per controller when an item registers with a value an item of this group unregistered in the same task (the signature of a list keyed by index): "key items with keyedWith". Solid's is "<For>"; by default "their value".

onAxis?
readonly onAxis?: (axis) => void;

Called when the detected axis changes (after a Measure pass, or ReorderController.resolve).

Parameters
axis

Axis

Returns

void

onHoldEnd?
readonly onHoldEnd?: (end) => void;

Hears each Reorder hold's end, once, whatever ended it; after onReorderEnd when it moved.

Parameters
end

HoldEnd<V>

Returns

void

onHoldStart?
readonly onHoldStart?: (start) => void;

Hears each Reorder hold's start: a drag of an item past its threshold, or a keyboard lift.

Parameters
start

HoldStart<V>

Returns

void

onReorder
readonly onReorder: (values) => void;

Receives a new order; the app sets values from it.

Parameters
values

V[]

Returns

void

onReorderEnd?
readonly onReorderEnd?: (end) => void;

Hears a user's reorder that changed the order, at its end: once a gesture, not at each step, as onReorder is. Not a keyboard cancel, which puts the order back, nor move.

Parameters
end

End<V>

Returns

void

values
readonly values: () => readonly V[];

The app's values, in order.

Returns

readonly V[]