Mixins / foldkit-mixins-ui

ComboboxView

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

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 the view, and ends a leave only once it is drawn (#400); 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.ComboboxChipRender

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

type ComboboxChipRender = Readonly<{
  key: string
  label: string
  remove: ReadonlyArray<ChildAttribute>
}>

One chosen value drawn as a chip: its label, and its remove button's bundle.

ComboboxView.ComboboxGroupRender

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

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:28

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

ComboboxView.ComboboxItemRender

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

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

ComboboxView.ComboboxRenderInfo

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

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>
  chips: ReadonlyArray<ComboboxChipRender>
  clearButton:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
        content: Html
      }
    | undefined
  empty:
    | {
        key: string
        attributes: ReadonlyArray<ChildAttribute>
        content: Html
      }
    | undefined
}>

ComboboxView.create

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

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:37

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

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

ComboboxView.ExtraInputs

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

type ExtraInputs = Readonly<{
  empty?: Html | undefined
  clearContent?: Html | undefined
  clearLabel?: string | undefined
  chips?: Readonly<Record<string, never>> | undefined
  words?: Partial<ComboboxWords> | undefined
}>

The view inputs this package adds beside upstream's.

ComboboxView.Multi

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

const Multi = { create }

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

ComboboxView.MultiBundle

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

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:74

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

Upstream multi view inputs plus the seam and this package's extras.

ComboboxView.SharedBehavior

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

type SharedBehavior = Readonly<{
  ariaMultiSelectable: boolean
}>

ComboboxView.SharedViewInputs

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

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

ComboboxView.SingleBundle

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

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:69

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

Upstream single view inputs plus the seam and this package's extras.