Mixins / foldkit-mixins-ui

TextareaField

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

interface TextareaField<Message> {
  readonly id: string
  readonly label: string
  readonly field: FieldValidation.Field<unknown>
  readonly changed: (value: string) => Message
  readonly rows?: number | undefined
  readonly maxRows?: number | undefined
  readonly maxLength?: number | undefined
  readonly count?: boolean | undefined
  readonly footer?: ReadonlyArray<Html> | undefined
  readonly placeholder?: string | undefined
  readonly style?: NamedStyle<typeof TextareaSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
  readonly draw?:
    ((parts: TextareaParts, h: HtmlBuilder<Message>) => Html) | undefined
}

A textarea field in one call: a field's state drawn through view with its label, control, and description placed. The value is drawn with String(), as the base field view draws any draft. draw places the parts; the default stacks them, the description and the count sharing the row under the field. With a footer, the control is a frame holding the text and the footer under it, the count at the footer's end. rows, maxRows, maxLength and placeholder ride through only where given.

Members

TextareaField.id

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

readonly id: string

TextareaField.label

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

readonly label: string

TextareaField.field

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

readonly field: FieldValidation.Field<unknown>

TextareaField.changed

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

readonly changed: (value: string) => Message

TextareaField.rows

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

readonly rows?: number | undefined

TextareaField.maxRows

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

readonly maxRows?: number | undefined

TextareaField.maxLength

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

readonly maxLength?: number | undefined

TextareaField.count

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

readonly count?: boolean | undefined

Whether to draw how many characters are written; default whether there is a maxLength.

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

readonly footer?: ReadonlyArray<Html> | undefined

Controls in a row under the text, inside the field's box: a toolbar, a send button.

TextareaField.placeholder

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

readonly placeholder?: string | undefined

TextareaField.style

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

readonly style?: NamedStyle<typeof TextareaSlots> | undefined

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

TextareaField.mixins

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

readonly mixins?: MixinList<Message> | undefined

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

TextareaField.draw

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

readonly draw?:
  ((parts: TextareaParts, h: HtmlBuilder<Message>) => Html) | undefined

Places the parts: control holds the footer, and the count when the footer does.