Mixins / foldkit-mixins-ui

TextareaView

interface · packages/mixins-ui/src/textarea.ts:76

interface TextareaView<Message> {
  readonly id: string
  readonly value?: string | undefined
  readonly onInput?: ((value: string) => Message) | undefined
  readonly disabled?: boolean | undefined
  readonly readOnly?: boolean | undefined
  readonly invalid?: boolean | undefined
  readonly described?: boolean | undefined
  readonly rows?: number | undefined
  readonly maxRows?: number | undefined
  readonly maxLength?: number | undefined
  readonly count?: boolean | undefined
  readonly name?: string | undefined
  readonly required?: boolean | undefined
  readonly autocomplete?: string | undefined
  readonly placeholder?: string | undefined
  readonly attributes?:
    | ({
        readonly textarea?: ReadonlyArray<TextareaAttribute<NoInfer<Message>>>
      } & {
        readonly [
          K in Exclude<keyof typeof TextareaSlots, 'textarea'>
        ]?: ReadonlyArray<Attribute<NoInfer<Message>>>
      })
    | undefined
  readonly style?: NamedStyle<typeof TextareaSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
  readonly input?: unknown
  readonly draw: (
    resolved: ResolvedTextarea<Message>,
    h: HtmlBuilder<Message>,
  ) => Html
}

A textarea 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 bundles: textarea, label and description, and where the field has them count (its text is countOf), frame and footer (the box around the text and a row of controls under it), and meta (the row under the field).

Members

TextareaView.id

property · packages/mixins-ui/src/textarea.ts:77

readonly id: string

TextareaView.value

property · packages/mixins-ui/src/textarea.ts:78

readonly value?: string | undefined

TextareaView.onInput

property · packages/mixins-ui/src/textarea.ts:79

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

TextareaView.disabled

property · packages/mixins-ui/src/textarea.ts:80

readonly disabled?: boolean | undefined

TextareaView.readOnly

property · packages/mixins-ui/src/textarea.ts:81

readonly readOnly?: boolean | undefined

TextareaView.invalid

property · packages/mixins-ui/src/textarea.ts:82

readonly invalid?: boolean | undefined

TextareaView.described

property · packages/mixins-ui/src/textarea.ts:83

readonly described?: boolean | undefined

TextareaView.rows

property · packages/mixins-ui/src/textarea.ts:85

readonly rows?: number | undefined

The lines it shows; under the recipe's resize: 'auto', the fewest it shrinks to.

TextareaView.maxRows

property · packages/mixins-ui/src/textarea.ts:87

readonly maxRows?: number | undefined

Under the recipe's resize: 'auto', the most lines it grows to before it scrolls.

TextareaView.maxLength

property · packages/mixins-ui/src/textarea.ts:89

readonly maxLength?: number | undefined

The most characters it takes (maxlength).

TextareaView.count

property · packages/mixins-ui/src/textarea.ts:91

readonly count?: boolean | undefined

Whether a count is drawn: the textarea is then described by it as well.

TextareaView.name

property · packages/mixins-ui/src/textarea.ts:92

readonly name?: string | undefined

TextareaView.required

property · packages/mixins-ui/src/textarea.ts:94

readonly required?: boolean | undefined

The field must be filled to submit: the native required and aria-required.

TextareaView.autocomplete

property · packages/mixins-ui/src/textarea.ts:96

readonly autocomplete?: string | undefined

What the browser may fill in, as the HTML autocomplete attribute takes it.

TextareaView.placeholder

property · packages/mixins-ui/src/textarea.ts:97

readonly placeholder?: string | undefined

TextareaView.attributes

property · packages/mixins-ui/src/textarea.ts:103

readonly attributes?:
  | ({
      readonly textarea?: ReadonlyArray<TextareaAttribute<NoInfer<Message>>>
    } & {
      readonly [
        K in Exclude<keyof typeof TextareaSlots, 'textarea'>
      ]?: ReadonlyArray<Attribute<NoInfer<Message>>>
    })
  | undefined

Attributes added to a Slot before the mixins resolve, as Input.view's are. A class among them joins the recipe's, and an owned event or attribute among them is a conflict.

TextareaView.style

property · packages/mixins-ui/src/textarea.ts:111

readonly style?: NamedStyle<typeof TextareaSlots> | undefined

A style of TextareaSlots, for the textarea's own look.

TextareaView.mixins

property · packages/mixins-ui/src/textarea.ts:113

readonly mixins?: MixinList<Message> | undefined

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

TextareaView.input

property · packages/mixins-ui/src/textarea.ts:115

readonly input?: unknown

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

TextareaView.draw

property · packages/mixins-ui/src/textarea.ts:116

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