Mixins / foldkit-mixins-ui

AngleSliderSlots

const · packages/mixins-ui/src/angleSlider.ts:32

const AngleSliderSlots: Slots.Contract<{ readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly [Attr.AttrToken<"role">], readonly Slot.RequirementName[], boolean>; readonly label: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly control: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly needle: Slot.UnnamedSlot<Capability.Capability<"Base", readonly []>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly thumb: Slot.UnnamedSlot<Capability.Capability<"Focusable", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly [Event.EventToken<"keydown">], readonly [Attr.AttrToken<"role">, Attr.AttrToken<"aria-label">, Attr.AttrToken<"aria-disabled">, Attr.AttrToken<"aria-invalid">], readonly Slot.RequirementName[], boolean>; readonly markers: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability. …;

A dial after Zag's angle slider: a value in degrees, 0 at the top and growing clockwise, chosen by dragging a thumb around the control or by the keys. The thumb is the APG's slider (role="slider", the angle in aria-valuetext); a dial has no ends, so the keys go round: Right and Up step clockwise, Left and Down back, Page Up and Page Down (or Shift with an arrow) take the largeStep, Home goes to 0 and End to the last value before a full turn. The dial is a drawing, so its keys and its turn are the same in either direction of text.

The angle and whether it is being dragged are a small Model of this module's, which the application keeps and folds with update(layout), the same step and marks the view draws. A key reaches update as the key pressed, not the value the last frame drew, so keys faster than a frame each step from the value before them. A press or drag on the control, a Mount, says the angle of the pointer from its center.

The root carries --fk-angle (the value, in deg), which the recipe turns the needle and places the thumb by; each marker carries its own as --fk-angle-marker, and data-state: at, under or over the value.