Form / foldkit-mixins-form

FieldInput

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

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 send?:
    | {
        readonly changed: (value: Draft) => unknown
        readonly blurred: unknown
        readonly searched: (text: 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.

Members

FieldInput.control

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

readonly control: FormControl<Key>

FieldInput.field

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

readonly field: FieldValidation.Field<Draft>

FieldInput.invalid

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

readonly invalid: boolean

FieldInput.errors

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

readonly errors: ReadonlyArray<string>

FieldInput.options

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

readonly options: ReadonlyArray<Option>

FieldInput.id

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

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:114

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:116

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:118

readonly checkingWord?: string | undefined

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

FieldInput.send

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

readonly send?:
  | {
      readonly changed: (value: Draft) => unknown
      readonly blurred: unknown
      readonly searched: (text: 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:135

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:137

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:139

readonly locked?: boolean | undefined

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

FieldInput.following

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

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.