Form / foldkit-mixins-form

FieldInput

interface · packages/mixins-form/src/index.ts:164

interface FieldInput<Key extends string = string> {
  readonly control: FormControl<Key>
  readonly field: FieldValidation.Field<Draft>
  readonly invalid: boolean
  readonly errors: ReadonlyArray<string>
  readonly options: ReadonlyArray<Option>
  readonly id: string
  readonly searchWord?: string | undefined
  readonly noneWord?: string | undefined
  readonly checkingWord?: string | undefined
  readonly quiet?: boolean | undefined
  readonly more?: unknown
  readonly moreWord?: string | undefined
  readonly send?:
    | {
        readonly changed: (value: Draft) => unknown
        readonly blurred: unknown
        readonly searched: (text: string) => unknown
        readonly toggled: (choice?: string) => unknown
      }
    | undefined
  readonly bundle?: BundleInput | undefined
  readonly search: string
  readonly locked?: boolean | undefined
  readonly following: boolean
}

What a field's Style and Behavior attachments may read.

In the guides

Members

FieldInput.control

property · packages/mixins-form/src/index.ts:165

readonly control: FormControl<Key>

FieldInput.field

property · packages/mixins-form/src/index.ts:166

readonly field: FieldValidation.Field<Draft>

FieldInput.invalid

property · packages/mixins-form/src/index.ts:167

readonly invalid: boolean

FieldInput.errors

property · packages/mixins-form/src/index.ts:168

readonly errors: ReadonlyArray<string>

FieldInput.options

property · packages/mixins-form/src/index.ts:169

readonly options: ReadonlyArray<Option>

FieldInput.id

property · packages/mixins-form/src/index.ts:171

readonly id: string

Unique within the form, for label for, and as the prefix of the ids beside it.

FieldInput.searchWord

property · packages/mixins-form/src/index.ts:173

readonly searchWord?: string | undefined

The word before the label on its search box: the view's words.search.

FieldInput.noneWord

property · packages/mixins-form/src/index.ts:175

readonly noneWord?: string | undefined

The choice of nothing in a picker: the view's words.none.

FieldInput.checkingWord

property · packages/mixins-form/src/index.ts:177

readonly checkingWord?: string | undefined

What is said while the key's check runs: the view's words.checking.

FieldInput.quiet

property · packages/mixins-form/src/index.ts:182

readonly quiet?: boolean | undefined

The form's list of fields to fix announces this failure, so the error beside the field is drawn without its own role="alert".

FieldInput.more

property · packages/mixins-form/src/index.ts:184

readonly more?: unknown

The Message a press of the picker's "more" button sends; none draws no button.

FieldInput.moreWord

property · packages/mixins-form/src/index.ts:186

readonly moreWord?: string | undefined

On that button: the view's words.more.

FieldInput.send

property · packages/mixins-form/src/index.ts:191

readonly send?:
  | {
      readonly changed: (value: Draft) => unknown
      readonly blurred: unknown
      readonly searched: (text: string) => unknown
      readonly toggled: (choice?: string) => unknown
    }
  | undefined

Set for a field in a row of a nested key: its Messages, wrapped for the row. A field of the form itself sends the form's own.

FieldInput.bundle

property · packages/mixins-form/src/index.ts:204

readonly bundle?: BundleInput | undefined

Set for a key edited by a control backed by a Bundle (Input.bundle): the Bundle's Model, and the Message that carries one of its own. Such a key has no draft, so field.value is ''; its validation state is field's.

property · packages/mixins-form/src/index.ts:206

readonly search: string

What was typed to find a choice, for a relation picker that searches.

FieldInput.locked

property · packages/mixins-form/src/index.ts:208

readonly locked?: boolean | undefined

Shown but not editable: the view's locked names the key.

FieldInput.following

property · packages/mixins-form/src/index.ts:213

readonly following: boolean

Whether the key is still written from the key it follows. A renderer offers "regenerate" when it is not, by sending the key an empty draft.