Mixins / foldkit-mixins-ui

VirtualListSlots

const · packages/mixins-ui/src/virtualList.ts:18

const VirtualListSlots: 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 row: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
}>

@foldkit/ui's virtual list, which draws only the rows in view and spacers for the rest, so a list of thousands scrolls as one of thirty. The list's Model is upstream's, which the application keeps and folds with VirtualList.update from @foldkit/ui/virtualList, as it does a Menu's.

Upstream draws its own scrolling ul and rows, and takes no toView, so the slots are around and inside them: root is the box the list scrolls within, which gives it its height, and row is each row's content. A row is drawn inside the list's submodel, so its mixins may style it but not handle its events: a handler there would speak the list's Messages.