Mixins / foldkit-mixins-ui

ComboboxView

namespace · packages/mixins-ui/src/comboboxView.ts:9

export * as ComboboxView from './comboboxView.js'

Forked combobox views: the single and multi variants over the shared transcription in ./comboboxShared.js. Each create binds the upstream bundle for the item type and swaps in only the view; state, Messages, update, Commands, Mounts, and subscriptions stay upstream. If upstream gains a seam, delete both modules; on a bump, re-transcribe and re-run the battery.

In the guides

Members

ComboboxView.ComboboxGroupRender

type · packages/mixins-ui/src/comboboxShared.ts:31

type ComboboxGroupRender = Readonly<{
  key: string
  heading: ComboboxHeadingRender | undefined
  group:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
      }
    | undefined
  separator:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
      }
    | undefined
  items: ReadonlyArray<ComboboxItemRender>
}>

ComboboxView.ComboboxHeadingRender

type · packages/mixins-ui/src/comboboxShared.ts:25

type ComboboxHeadingRender = Readonly<{
  id: string
  attributes: ReadonlyArray<ChildAttribute>
  content: Html
}>

ComboboxView.ComboboxItemRender

type · packages/mixins-ui/src/comboboxShared.ts:19

type ComboboxItemRender = Readonly<{
  key: string
  attributes: ReadonlyArray<ChildAttribute>
  content: Html
}>

ComboboxView.ComboboxRenderInfo

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

type ComboboxRenderInfo = Readonly<{
  id: string
  isVisible: boolean
  wrapper: ReadonlyArray<ChildAttribute>
  inputWrapper: ReadonlyArray<ChildAttribute>
  input: ReadonlyArray<ChildAttribute>
  toggleButton:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
        content: Html
      }
    | undefined
  backdrop:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
      }
    | undefined
  items:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
      }
    | undefined
  scroll: ReadonlyArray<ChildAttribute> | undefined
  groups: ReadonlyArray<ComboboxGroupRender>
  hiddenInputs: ReadonlyArray<Html>
}>

ComboboxView.create

function · packages/mixins-ui/src/comboboxView.ts:94

function create<Item extends string = string>(): SingleBundle<Item>

Pairs the forked single view with upstream's update and helpers.

ComboboxView.defaultToView

function · packages/mixins-ui/src/comboboxView.ts:36

function defaultToView(
  h: HtmlBuilder<Message>,
): (render: ComboboxRenderInfo) => Html

Upstream's markup from the computed bundles: the default toView.

ComboboxView.Multi

const · packages/mixins-ui/src/comboboxView.ts:113

const Multi = { create }

Pairs the forked multi view with upstream's update and helpers.

ComboboxView.MultiBundle

type · packages/mixins-ui/src/comboboxView.ts:108

type MultiBundle<Item extends string = string> = Omit<
  UpstreamMultiBundle<Item>,
  'view'
> & {
  readonly view: SubmodelView<MultiModel, Message, MultiViewInputs<Item>>
}

Upstream multi Bundle with the forked view.

ComboboxView.MultiViewInputs

type · packages/mixins-ui/src/comboboxView.ts:65

type MultiViewInputs<Item extends string> =
  UpstreamCombobox.Multi.ViewInputs<Item> &
    Readonly<{
      toView?: (render: ComboboxRenderInfo) => Html
    }>

Upstream multi view inputs plus the seam.

ComboboxView.SharedBehavior

type · packages/mixins-ui/src/comboboxView.ts:33

type SharedBehavior = Readonly<{
  ariaMultiSelectable: boolean
}>

ComboboxView.SharedViewInputs

type · packages/mixins-ui/src/comboboxView.ts:29

type SharedViewInputs = NormalizedInputs<string> & {
  toView?: ((render: ComboboxRenderInfo) => Html) | undefined
}

ComboboxView.SingleBundle

type · packages/mixins-ui/src/comboboxView.ts:86

type SingleBundle<Item extends string = string> = Omit<
  UpstreamSingleBundle<Item>,
  'view'
> & {
  readonly view: SubmodelView<SingleModel, Message, SingleViewInputs<Item>>
}

Upstream single Bundle with the forked view.

ComboboxView.SingleViewInputs

type · packages/mixins-ui/src/comboboxView.ts:61

type SingleViewInputs<Item extends string> = UpstreamSingleInputs<Item> &
  Readonly<{
    toView?: (render: ComboboxRenderInfo) => Html
  }>

Upstream single view inputs plus the seam.