Form / foldkit-mixins-form

FormViewInputs

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

interface FormViewInputs<Key extends string = string> {
  readonly options?:
    | {
        readonly [K in Key]?: ReadonlyArray<Option>
      }
    | undefined
  readonly nestedOptions?:
    Readonly<Record<string, ReadonlyArray<Option>>> | undefined
  readonly controls?: Readonly<Record<string, unknown>> | undefined
  readonly words?: FormViewWords | undefined
  readonly submits?: boolean | undefined
  readonly locked?: ReadonlyArray<Key> | undefined
  readonly submitting?: boolean | undefined
}

What the view needs that the form does not own: the choices of each relation picker (a query the application makes), and the submit button's words.

Members

FormViewInputs.options

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

readonly options?:
  | {
      readonly [K in Key]?: ReadonlyArray<Option>
    }
  | undefined

FormViewInputs.nestedOptions

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

readonly nestedOptions?:
  Readonly<Record<string, ReadonlyArray<Option>>> | undefined

The choices of a picker inside a nested key, by its path, the same for every row: 'author.country'.

FormViewInputs.controls

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

readonly controls?: Readonly<Record<string, unknown>> | undefined

What a control backed by a Bundle is drawn with, by key: its view's inputs, such as the page Builder's BuilderView.inputs({ data }). A key in a nested row is named by its path, as in nestedOptions. Keyed by text, as those paths are, and typed where each entry is made, since only the control's Bundle knows its view's inputs.

FormViewInputs.words

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

readonly words?: FormViewWords | undefined

The view's own words, for wording and for translation.

FormViewInputs.submits

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

readonly submits?: boolean | undefined

Whether the form is drawn with its submit button. Default: it is. false for someone who may not submit it, such as a writer where submitting publishes, so what would be refused is not offered.

FormViewInputs.locked

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

readonly locked?: ReadonlyArray<Key> | undefined

Keys shown but not editable, drawn disabled: one the person may not set, such as a member foldkit-guard's May.canSet says no to. A hint, not a check: the server checks the write. A key edited by a Bundle draws as its Bundle does, and a key in a nested row is not locked by this.

FormViewInputs.submitting

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

readonly submitting?: boolean | undefined

Whether the application's own work with a submitted value is in flight, such as its request: the form hands the value over and cannot see what follows.