Mixins / foldkit-mixins-ui

Slider

namespace · packages/mixins-ui/src/slider.ts:1

export * as Slider from './slider.js'

Members

Slider.resolve

function · packages/mixins-ui/src/slider.ts:42

function resolve<Input, Message>(
  render: SliderAttributes,
  mixins: MixinList<Message>,
  context: ResolveContext<Input, Message>,
): ResolvedSlider<Message>

Resolves the slider's render groups; value and the rest pass through unchanged.

Slider.ResolvedSlider

type · packages/mixins-ui/src/slider.ts:39

type ResolvedSlider<Message> = Resolved<
  SliderAttributes,
  typeof SliderSlots,
  Message
>

The slider's bundles with the attached Mixins applied.

Slider.SliderSlots

const · packages/mixins-ui/src/slider.ts:19

const SliderSlots: Slots.Contract<{ readonly root: 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 track: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly [Event.EventToken<"pointerdown">], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly filledTrack: 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<"pointerdown">], 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 hiddenInput: Slot.UnnamedSlot<Capability.Capability<"Base", readonly []>, readonly Slot.EventName[], readonly [Attr.AttrToken<"value">], readonly Slot.Requir …;

Slider is a Submodel: each published bundle is a ChildAttribute group that carries the boundary's dispatcher. The resolver treats those as opaque and preserves their identity, so spreading a resolved bundle into the parent's markup keeps routing through the slider's toParentMessage.

The base installs the pointer handler on track and thumb only while the slider is interactive. A Behavior adding one of those owns it in the same window, so a second owner is a conflict rather than a silent takeover. Its keyboard handler is OnKeyDownPreventDefault, a distinct tag from KeyDown, so the thumb does not advertise Event.KeyDown (it would falsely imply a conflict the resolver cannot see).

Slider.toView

function · packages/mixins-ui/src/slider.ts:49

function toView<Message>(
  mixins: MixinList<Message>,
  context: ResolveContext<unknown, Message>,
  draw: (resolved: ResolvedSlider<Message>) => Html,
): (render: SliderAttributes) => Html

The slider's toView: draw receives its bundles with mixins applied.