Mixins / foldkit-mixins-ui

InputView

interface · packages/mixins-ui/src/input.ts:45

interface InputView<Message> {
  readonly id: string
  readonly value?: string | undefined
  readonly onInput?: ((value: string) => Message) | undefined
  readonly disabled?: boolean | undefined
  readonly invalid?: boolean | undefined
  readonly described?: boolean | undefined
  readonly type?: string | undefined
  readonly placeholder?: string | undefined
  readonly style?: NamedStyle<typeof InputSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
  readonly input?: unknown
  readonly draw: (
    resolved: ResolvedInput<Message>,
    h: HtmlBuilder<Message>,
  ) => Html
}

An input in one call: its value and Messages, a style for its slots, and the rest of @foldkit/ui's own config. draw places the resolved input, label, and description bundles; this covers the common case, while toView stays for one drawn as something else.

Members

InputView.id

property · packages/mixins-ui/src/input.ts:46

readonly id: string

InputView.value

property · packages/mixins-ui/src/input.ts:47

readonly value?: string | undefined

InputView.onInput

property · packages/mixins-ui/src/input.ts:48

readonly onInput?: ((value: string) => Message) | undefined

InputView.disabled

property · packages/mixins-ui/src/input.ts:49

readonly disabled?: boolean | undefined

InputView.invalid

property · packages/mixins-ui/src/input.ts:50

readonly invalid?: boolean | undefined

InputView.described

property · packages/mixins-ui/src/input.ts:51

readonly described?: boolean | undefined

InputView.type

property · packages/mixins-ui/src/input.ts:52

readonly type?: string | undefined

InputView.placeholder

property · packages/mixins-ui/src/input.ts:53

readonly placeholder?: string | undefined

InputView.style

property · packages/mixins-ui/src/input.ts:55

readonly style?: NamedStyle<typeof InputSlots> | undefined

A style of InputSlots, for the input's own look.

InputView.mixins

property · packages/mixins-ui/src/input.ts:57

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style, for state or behavior the style does not own.

InputView.input

property · packages/mixins-ui/src/input.ts:59

readonly input?: unknown

What an input-driven Mixin reads; omit it when no attached Mixin reads one.

InputView.draw

property · packages/mixins-ui/src/input.ts:60

readonly draw: (
  resolved: ResolvedInput<Message>,
  h: HtmlBuilder<Message>,
) => Html