NativeFieldArrayRenderer
A field of `type: "array"`: one card per item, each with the field's `arrayFields`, and Add / Remove within `arrayMin` and `arrayMax`.
packages/ui-native/src/data/NativeFormFields.tsx
@marktiderman/genesis-ui-native/dataimport { NativeFieldArrayRenderer } from "@marktiderman/genesis-ui-native/data";react-docgen-typescript.NativeFieldArrayRenderer
A field of `type: "array"`: one card per item, each with the field's `arrayFields`, and Add / Remove within `arrayMin` and `arrayMax`.
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | enum | — | |
| control* | Control<Record<string, unknown>> | — | |
| field* | ResourceFormFieldDef | — | |
| labels | { item?: string; remove?: string; removeButton?: string | undefined; add?: string | undefined; } | undefined | {} | The words. `{n}`: the item's number. `remove` is what a screen reader hears, `removeButton` the button's visible word. |
| watchedValues | Record<string, unknown> | — |
NativeFileUploadField
A field of `type: "file"` or `"image"`: a button that opens the system picker, then the picked files with their size and a Remove each.
| Prop | Type | Default | Description |
|---|---|---|---|
| field* | ResourceFormFieldDef | — | |
| onChange* | (value: NativePickedFile | NativePickedFile[] | null) => void | — | |
| value* | NativePickedFile | NativePickedFile[] | null | — | |
| disabled | boolean | — | |
| error | string | — | |
| labels | { choose?: string; chooseMore?: string; remove?: string | undefined; noPicker?: string | undefined; pickFailed?: string | undefined; } | undefined | {} | The words. `pickFailed`: the picker rejected (a permission denied, a download that failed). |
| pickFiles | GenesisFilePicker | — | Opens the picker. Default `GenesisModules.filePicker`. |
| testID | string | `file-upload-${field.key}` |
NativeRelationField
A field of `type: "relation"`: the linked resource's rows through the data provider, searched and paged on the server. The same picker NativeResourceView's form uses (NativeLinkPicker), fed from the field's `relation`.
| Prop | Type | Default | Description |
|---|---|---|---|
| field* | ResourceFormFieldDef | — | |
| onChange* | (value: string | number | null) => void | — | The key as the field's `relation.keys` says: a string (`""` for none), or the row's own (`null` for none). |
| value* | unknown | — | |
| error | string | — | |
| testID | string | `relation-${field.key}` | |
| values | Readonly<Record<string, unknown>> | {} |
NativeWizardForm
A form in steps (genesis-core's `useWizard`): the step's fields, its progress, Back and Next, and Create or Save on the last step.
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | enum | — | |
| fields* | ResourceFormFieldDef[] | — | |
| form* | UseFormReturn<Record<string, unknown>> | — | |
| isSaving* | boolean | — | |
| onSubmit* | (data: Record<string, unknown>) => Promise<void> | — | |
| steps* | WizardStep[] | — | |
| labels | { back?: string; next?: string; create?: string | undefined; save?: string | undefined; } | undefined | {} | |
| onInvalid | ((errors: FieldErrors) => void) | — | |
| renderField | ((field: ResourceFormFieldDef, control: Control<Record<string, unknown>, any, Record<string, unknown>>, action: "create" | "edit", watchedValues: Record<...>) => ReactNode) | — | |
| testID | string | wizard-form |