CRUD / foldkit-mixins-crud

ListInput

interface · packages/mixins-crud/src/index.ts:55

interface ListInput<Row, Message, Key extends string = string> {
  readonly page: RemoteData<Page<Row>>
  readonly onOpen?: ((row: Row) => Message) | undefined
  readonly onMore?: Message | undefined
  readonly onRetry?: Message | undefined
  readonly sort?:
    | {
        readonly [K in Key]?: SortedColumn<Message>
      }
    | undefined
  readonly renderers?: DisplayRenderers<Message> | undefined
  readonly cells?:
    | {
        readonly [K in Key]?: (row: Row, h: HtmlBuilder<Message>) => Html
      }
    | undefined
  readonly rowKey?: ((row: Row) => string) | undefined
  readonly words?: ViewWords | undefined
}

What a list's Style and Behavior attachments may read, and what the application gives it.

Members

ListInput.page

property · packages/mixins-crud/src/index.ts:56

readonly page: RemoteData<Page<Row>>

ListInput.onOpen

property · packages/mixins-crud/src/index.ts:58

readonly onOpen?: ((row: Row) => Message) | undefined

Opens a row. Given, the first shown cell of each row is a button that sends it.

ListInput.onMore

property · packages/mixins-crud/src/index.ts:60

readonly onMore?: Message | undefined

Loads the next page. Shown while the page has one.

ListInput.onRetry

property · packages/mixins-crud/src/index.ts:66

readonly onRetry?: Message | undefined

Asks again after a failed read, usually a Message whose update returns Data.refresh. Given, a failed list shows a button that sends it; a failed read is not retried on its own.

ListInput.sort

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

readonly sort?:
  | {
      readonly [K in Key]?: SortedColumn<Message>
    }
  | undefined

The columns that sort, each with its state and its Message.

ListInput.renderers

property · packages/mixins-crud/src/index.ts:70

readonly renderers?: DisplayRenderers<Message> | undefined

Renderers by Display kind, for every column of that kind.

ListInput.cells

property · packages/mixins-crud/src/index.ts:72

readonly cells?:
  | {
      readonly [K in Key]?: (row: Row, h: HtmlBuilder<Message>) => Html
    }
  | undefined

One column drawn specially; it wins over a renderer. Every other cell says Display.show.

ListInput.rowKey

property · packages/mixins-crud/src/index.ts:74

readonly rowKey?: ((row: Row) => string) | undefined

What identifies a row across renders. Default its id, else its position.

ListInput.words

property · packages/mixins-crud/src/index.ts:75

readonly words?: ViewWords | undefined