Mixins / foldkit-mixins-ui

CascadeSelectView

interface · packages/mixins-ui/src/cascadeSelect.ts:563

interface CascadeSelectView<ParentMessage> {
  readonly model: Model
  readonly config: Config
  readonly onMessage: (message: Message) => NoInfer<ParentMessage>
  readonly label: string
  readonly placeholder?: string | undefined
  readonly separator?: string | undefined
  readonly triggerText?: ((labels: ReadonlyArray<string>) => string) | undefined
  readonly layout?: 'columns' | 'drill' | undefined
  readonly expandOn?: 'click' | 'hover' | undefined
  readonly levels?: ReadonlyArray<string> | undefined
  readonly clear?:
    | true
    | {
        readonly content: Html
      }
    | undefined
  readonly option?: ((node: Node) => RowContent) | undefined
  readonly words?: Partial<CascadeSelectWords> | undefined
  readonly name?: string | undefined
  readonly disabled?: boolean | undefined
  readonly invalid?: boolean | undefined
  readonly direction?: 'ltr' | 'rtl' | undefined
  readonly anchor?: AnchorConfig | undefined
  readonly routes?: ReadonlyArray<Route<NoInfer<ParentMessage>>> | undefined
  readonly style?: NamedStyle<typeof CascadeSelectSlots> | undefined
  readonly mixins?: MixinList<ParentMessage> | undefined
}

Members

CascadeSelectView.model

property · packages/mixins-ui/src/cascadeSelect.ts:564

readonly model: Model

CascadeSelectView.config

property · packages/mixins-ui/src/cascadeSelect.ts:566

readonly config: Config

The options; the same as update's, with its parents when set.

CascadeSelectView.onMessage

property · packages/mixins-ui/src/cascadeSelect.ts:567

readonly onMessage: (message: Message) => NoInfer<ParentMessage>

CascadeSelectView.label

property · packages/mixins-ui/src/cascadeSelect.ts:569

readonly label: string

What is chosen, the trigger's and the panel's accessible name.

CascadeSelectView.placeholder

property · packages/mixins-ui/src/cascadeSelect.ts:571

readonly placeholder?: string | undefined

Shown while nothing is chosen; default words.placeholder.

CascadeSelectView.separator

property · packages/mixins-ui/src/cascadeSelect.ts:573

readonly separator?: string | undefined

Between the labels of the chosen path on the trigger; default /.

CascadeSelectView.triggerText

property · packages/mixins-ui/src/cascadeSelect.ts:575

readonly triggerText?: ((labels: ReadonlyArray<string>) => string) | undefined

The trigger's text for the chosen path's labels, such as a long path collapsed to its ends; default the labels joined by separator.

CascadeSelectView.layout

property · packages/mixins-ui/src/cascadeSelect.ts:580

readonly layout?: 'columns' | 'drill' | undefined

One column per level (default), or one level at a time with a way back. Columns drill in by themselves when the window is too narrow for them.

CascadeSelectView.expandOn

property · packages/mixins-ui/src/cascadeSelect.ts:582

readonly expandOn?: 'click' | 'hover' | undefined

Whether the pointer resting on a row opens its children, or only a press; default click.

CascadeSelectView.levels

property · packages/mixins-ui/src/cascadeSelect.ts:584

readonly levels?: ReadonlyArray<string> | undefined

A name per level, such as ['Country', 'Region', 'City'], heading each column.

CascadeSelectView.clear

property · packages/mixins-ui/src/cascadeSelect.ts:589

readonly clear?:
  | true
  | {
      readonly content: Html
    }
  | undefined

A button that clears the value while there is one, named by words.clear: true draws a cross, { content } a mark of your own.

CascadeSelectView.option

property · packages/mixins-ui/src/cascadeSelect.ts:591

readonly option?: ((node: Node) => RowContent) | undefined

A row's content: its icon, description and trailing are drawn in their Slots, content in place of the label, which still names it. The node's disabled is the row's.

CascadeSelectView.words

property · packages/mixins-ui/src/cascadeSelect.ts:592

readonly words?: Partial<CascadeSelectWords> | undefined

CascadeSelectView.name

property · packages/mixins-ui/src/cascadeSelect.ts:594

readonly name?: string | undefined

Submits the value with a form under this name, its ids joined by /.

CascadeSelectView.disabled

property · packages/mixins-ui/src/cascadeSelect.ts:595

readonly disabled?: boolean | undefined

CascadeSelectView.invalid

property · packages/mixins-ui/src/cascadeSelect.ts:596

readonly invalid?: boolean | undefined

CascadeSelectView.direction

property · packages/mixins-ui/src/cascadeSelect.ts:598

readonly direction?: 'ltr' | 'rtl' | undefined

Default 'ltr'; under 'rtl' ArrowLeft goes into a row's children.

CascadeSelectView.anchor

property · packages/mixins-ui/src/cascadeSelect.ts:600

readonly anchor?: AnchorConfig | undefined

Where the panel opens against the trigger; default below it, at its start.

CascadeSelectView.routes

property · packages/mixins-ui/src/cascadeSelect.ts:608

readonly routes?: ReadonlyArray<Route<NoInfer<ParentMessage>>> | undefined

Keys the application answers on the open panel, such as Ctrl+A choosing every option. They share one keydown owner with the panel's own: the arrows, Home, End, Enter, Escape and every printable character (the typeahead's, Space included); a route on the same gesture is a diagnostic naming both. The closed trigger's keys are not open to routes.

CascadeSelectView.style

property · packages/mixins-ui/src/cascadeSelect.ts:610

readonly style?: NamedStyle<typeof CascadeSelectSlots> | undefined

A style of CascadeSelectSlots, for the look.

CascadeSelectView.mixins

property · packages/mixins-ui/src/cascadeSelect.ts:612

readonly mixins?: MixinList<ParentMessage> | undefined

Mixins beside the style.