Genesis
@stable

screenValues

The values a create takes from the screen: every non-null equality filter, the screen's over the tab's.

packages/ui-native/src/data/resource-view/use-native-resource-view.ts

Import
Subpath export: @marktiderman/genesis-ui-native/data
import { screenValues } from "@marktiderman/genesis-ui-native/data";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

screenValues

The values a create takes from the screen: every non-null equality filter, the screen's over the tab's.

No declared props.

screenLists

The list (`in`) filters a screen holds fields to, the screen's over the tab's.

No declared props.

serverSorts

The server sorts: the `groupBy` field first, so every page arrives in section order and a later page never lands in the middle of an earlier section, then the view's `orderBy` within each group. A provider without `multiSort` applies only the first.

PropTypeDefaultDescription
actions*() => readonly ResolvedViewAction[]—The view's actions, in order, frozen.
can*{ (action: "create", viewer?: Viewer | undefined): Allowed; (action: "update" | "delete", row: T & DataRow, viewer?: Viewer | undefined): Allowed; }—Whether the view's guard allows it for this viewer: `true`, or the guard's reason. Without a viewer, guards get `NO_VIEWER` (no one), so one that needs the viewer refuses.
canAction*(name: string, row: T & DataRow, viewer?: Viewer | undefined) => Allowed—Whether this row allows the named action: `true`, or the guard's reason. Only narrows what the server allows. Throws {@link ViewDefinitionError } for a name the view doesn't define.
column*(name: string) => ResolvedColumn<T & DataRow> | undefined—One field as a column, resolved as a preset lists it (a board card's fields, say). Undefined for a name that isn't a field or one the viewer can't read (`permissions.read: false`).
columns*(preset?: string | undefined) => readonly ResolvedColumn<T & DataRow>[]—
contract*any—
definition*Readonly<ViewDefinition<any, T & DataRow>>—
display*(name: string) => DisplayHint—
exportPlan*(preset?: string | undefined) => { readonly columns: readonly ResolvedColumn<T & DataRow>[]; readonly filename: string; readonly maxRows: number; readonly raw: boolean; } | undefined—What "Export CSV" writes for a column preset, or undefined when the view has no `export`. @stability Beta
field*(name: string) => FieldSchema | undefined—
filterParams*(values: Readonly<Record<string, ViewFilterValue | undefined>> | null | undefined, zone?: string | undefined) => FilterParam[]—Declared filters' values as provider filters. Only declared filters count, and a value a filter doesn't accept (a choice it doesn't offer, a malformed range) is dropped: the URL is an allow-list, never a way to send any field. Days and times on a timestamp column are read on `zone`'s clock (the viewer's; default the device's): a day runs from its start to the next day's start, and a time with no offset is that zone's. @stability Beta
filters*() => readonly ResolvedFilter[]—The declared filters, resolved (ADR 0017). Empty without `filters`. @stability Beta
form*(mode: "create" | "edit") => readonly ResolvedFormField[]—
galleryItem*(row: T & DataRow, override?: Partial<ViewGallery<string>> | undefined) => GalleryItem | undefined—The row as a gallery photo, by the view's `gallery` block and any `override` a screen passes (ResourceView's `gallery`): undefined without a gallery block. Its `id` is the row's key, its `alt` the row's label unless the block names a field; a row without an image has an empty `src`, which GalleryGrid and NativeGalleryGrid draw as a placeholder tile; leave those out of a Lightbox.
inboxActions*() => { readonly done?: string | undefined; readonly markRead?: string | undefined; }—The inbox's `done` and `markRead` actions, when the view declares them. @stability Beta
inboxRow*(row: T & DataRow) => InboxRow—The row as an inbox draws it, by the view's `inbox` block (its title from `labelField` when the block says none). Works without a block too: the summary's title. @stability Beta
label*(name: string) => string—
labelField*string | undefined—The field that names a row, for links, pickers and the peek's title.
noun*string—
nounPlural*string—
presets*readonly string[]—The column presets this view has, `default` first.
resource*string—The resource name the provider addresses.
rowTone*(row: T & DataRow) => ChipTone | undefined—The row's tone (`rowTone`), or undefined. @stability Beta
segmentFilters*(id: string, viewer?: Viewer | undefined) => FilterParam[]—A segment's rows as provider filters, for this viewer. Throws {@link ViewDefinitionError } for an id the view doesn't define. @stability Beta
segments*() => readonly ResolvedSegment[]—The declared segments, resolved. Empty without `segments`. @stability Beta
summary*(row: T & DataRow) => RowSummary—
title*string—
types*() => readonly string[]—The view types a person may switch between, in order (`types`, or the derived default). @stability Beta
valueLabel*(name: string, value: unknown) => string—A value in words: the field's `labels`, else title case. For badges, choices and group titles.
writable*(mode: "create" | "edit") => readonly string[]—Fields a writer may send: the form's, never generated, read-only, key or scope fields.

serverSort

The first of {@link serverSorts}: what a provider that sorts by one field gets.

PropTypeDefaultDescription
actions*() => readonly ResolvedViewAction[]—The view's actions, in order, frozen.
can*{ (action: "create", viewer?: Viewer | undefined): Allowed; (action: "update" | "delete", row: T & DataRow, viewer?: Viewer | undefined): Allowed; }—Whether the view's guard allows it for this viewer: `true`, or the guard's reason. Without a viewer, guards get `NO_VIEWER` (no one), so one that needs the viewer refuses.
canAction*(name: string, row: T & DataRow, viewer?: Viewer | undefined) => Allowed—Whether this row allows the named action: `true`, or the guard's reason. Only narrows what the server allows. Throws {@link ViewDefinitionError } for a name the view doesn't define.
column*(name: string) => ResolvedColumn<T & DataRow> | undefined—One field as a column, resolved as a preset lists it (a board card's fields, say). Undefined for a name that isn't a field or one the viewer can't read (`permissions.read: false`).
columns*(preset?: string | undefined) => readonly ResolvedColumn<T & DataRow>[]—
contract*any—
definition*Readonly<ViewDefinition<any, T & DataRow>>—
display*(name: string) => DisplayHint—
exportPlan*(preset?: string | undefined) => { readonly columns: readonly ResolvedColumn<T & DataRow>[]; readonly filename: string; readonly maxRows: number; readonly raw: boolean; } | undefined—What "Export CSV" writes for a column preset, or undefined when the view has no `export`. @stability Beta
field*(name: string) => FieldSchema | undefined—
filterParams*(values: Readonly<Record<string, ViewFilterValue | undefined>> | null | undefined, zone?: string | undefined) => FilterParam[]—Declared filters' values as provider filters. Only declared filters count, and a value a filter doesn't accept (a choice it doesn't offer, a malformed range) is dropped: the URL is an allow-list, never a way to send any field. Days and times on a timestamp column are read on `zone`'s clock (the viewer's; default the device's): a day runs from its start to the next day's start, and a time with no offset is that zone's. @stability Beta
filters*() => readonly ResolvedFilter[]—The declared filters, resolved (ADR 0017). Empty without `filters`. @stability Beta
form*(mode: "create" | "edit") => readonly ResolvedFormField[]—
galleryItem*(row: T & DataRow, override?: Partial<ViewGallery<string>> | undefined) => GalleryItem | undefined—The row as a gallery photo, by the view's `gallery` block and any `override` a screen passes (ResourceView's `gallery`): undefined without a gallery block. Its `id` is the row's key, its `alt` the row's label unless the block names a field; a row without an image has an empty `src`, which GalleryGrid and NativeGalleryGrid draw as a placeholder tile; leave those out of a Lightbox.
inboxActions*() => { readonly done?: string | undefined; readonly markRead?: string | undefined; }—The inbox's `done` and `markRead` actions, when the view declares them. @stability Beta
inboxRow*(row: T & DataRow) => InboxRow—The row as an inbox draws it, by the view's `inbox` block (its title from `labelField` when the block says none). Works without a block too: the summary's title. @stability Beta
label*(name: string) => string—
labelField*string | undefined—The field that names a row, for links, pickers and the peek's title.
noun*string—
nounPlural*string—
presets*readonly string[]—The column presets this view has, `default` first.
resource*string—The resource name the provider addresses.
rowTone*(row: T & DataRow) => ChipTone | undefined—The row's tone (`rowTone`), or undefined. @stability Beta
segmentFilters*(id: string, viewer?: Viewer | undefined) => FilterParam[]—A segment's rows as provider filters, for this viewer. Throws {@link ViewDefinitionError } for an id the view doesn't define. @stability Beta
segments*() => readonly ResolvedSegment[]—The declared segments, resolved. Empty without `segments`. @stability Beta
summary*(row: T & DataRow) => RowSummary—
title*string—
types*() => readonly string[]—The view types a person may switch between, in order (`types`, or the derived default). @stability Beta
valueLabel*(name: string, value: unknown) => string—A value in words: the field's `labels`, else title case. For badges, choices and group titles.
writable*(mode: "create" | "edit") => readonly string[]—Fields a writer may send: the form's, never generated, read-only, key or scope fields.

recordKey

A row's key from the view's key fields (its id when they can't encode it): the list keys rows by it.

No declared props.

SEARCH_DEBOUNCE_MS

How long typing waits before the search goes to the server.

No declared props.

DEFAULT_MAX_PAGES

Pages kept loaded by default (cursor paging).

No declared props.