Options
All
  • Public
  • Public/Protected
  • All
Menu

Module tableScope

Index

Type Aliases

AuditChangeFunction: ((type: "ADD_ROW" | "UPDATE_CELL" | "DELETE_ROW", rowId: string, data?: { updatedField?: string }) => Promise<any>)

Type declaration

    • (type: "ADD_ROW" | "UPDATE_CELL" | "DELETE_ROW", rowId: string, data?: { updatedField?: string }): Promise<any>
    • Parameters

      • type: "ADD_ROW" | "UPDATE_CELL" | "DELETE_ROW"
      • rowId: string
      • Optional data: { updatedField?: string }
        • Optional updatedField?: string

      Returns Promise<any>

CloudLogFilters: { auditRowId?: string; buildLogExpanded?: number; severity?: (keyof typeof SEVERITY_LEVELS)[]; timeRange: { type: "seconds" | "minutes" | "hours" | "days"; value: number } | { end: Date; start: Date; type: "range" }; type: "webhook" | "functions" | "audit" | "build"; webhook?: string[] }

Type declaration

  • Optional auditRowId?: string
  • Optional buildLogExpanded?: number
  • Optional severity?: (keyof typeof SEVERITY_LEVELS)[]
  • timeRange: { type: "seconds" | "minutes" | "hours" | "days"; value: number } | { end: Date; start: Date; type: "range" }
  • type: "webhook" | "functions" | "audit" | "build"
  • Optional webhook?: string[]
ImportCsvData: { columns: string[]; rows: Record<string, any>[] }

Type declaration

  • columns: string[]
  • rows: Record<string, any>[]
SelectedCell: { columnKey: string; path: string }

Type declaration

  • columnKey: string
  • path: string
TableFiltersPopoverState: { defaultQuery?: TableFilter; open: boolean }

Type declaration

  • Optional defaultQuery?: TableFilter
  • open: boolean

Variables

_bulkWriteDbAtom: Atom<undefined | BulkWriteFunction<Partial<TableRow>>> & { onMount?: OnMount<SetStateAction<undefined | BulkWriteFunction<Partial<TableRow>>>, void>; write: Write<SetStateAction<undefined | BulkWriteFunction<Partial<TableRow>>>, void> } & WithInitialValue<undefined | BulkWriteFunction<Partial<TableRow>>> = ...

Store function to bulk write to db

internal

Use bulkAddRowsAtom instead

_deleteRowDbAtom: Atom<undefined | DeleteCollectionDocFunction> & { onMount?: OnMount<SetStateAction<undefined | DeleteCollectionDocFunction>, void>; write: Write<SetStateAction<undefined | DeleteCollectionDocFunction>, void> } & WithInitialValue<undefined | DeleteCollectionDocFunction> = ...

Store function to delete row in db directly

internal

Use deleteRowAtom instead

_updateRowDbAtom: Atom<undefined | UpdateCollectionDocFunction<TableRow>> & { onMount?: OnMount<SetStateAction<undefined | UpdateCollectionDocFunction<TableRow>>, void>; write: Write<SetStateAction<undefined | UpdateCollectionDocFunction<TableRow>>, void> } & WithInitialValue<undefined | UpdateCollectionDocFunction<TableRow>> = ...

Store function to add or update row in db directly. Has same behaviour as Firestore setDoc with merge.

see
internal

Use addRowAtom or {@link updateRowAtom} instead

addColumnAtom: Atom<null> & { onMount?: OnMount<IAddColumnOptions, Promise<void>>; write: Write<IAddColumnOptions, Promise<void>> } & WithInitialValue<null> = ...

Set function adds a column to tableSchema, to the end or by index. Also fixes any issues with column indexes, so they go from 0 to length - 1

param options

IAddColumnOptions

example

Basic usage:

const addColumn = useSetAtom(addColumnAtom, tableScope);
addColumn({ config: {...}, index?: 0 });
addRowAtom: Atom<null> & { onMount?: OnMount<IAddRowOptions, Promise<void>>; write: Write<IAddRowOptions, Promise<void>> } & WithInitialValue<null> = ...

Set function adds a row or an array of rows. Adds to rowsDb if it has no missing required fields, otherwise to rowsLocal.

param options

IAddRowOptions

example

Basic usage:

const addRow = useSetAtom(addRowAtom, tableScope);
addRow({ row: [ {...}, ... ] });
auditChangeAtom: Atom<undefined | AuditChangeFunction> & { onMount?: OnMount<SetStateAction<undefined | AuditChangeFunction>, void>; write: Write<SetStateAction<undefined | AuditChangeFunction>, void> } & WithInitialValue<undefined | AuditChangeFunction> = ...

Store function to write auditing logs when user makes changes to the table. Silently fails if auditing is disabled for the table or Rowy Run version not compatible.

param type

Action type: "ADD_ROW" | "UPDATE_CELL" | "DELETE_ROW"

param rowId

ID of row updated

param data

Optional additional data to log

bulkAddRowsAtom: Atom<null> & { onMount?: OnMount<IBulkAddRowsOptions, Promise<void>>; write: Write<IBulkAddRowsOptions, Promise<void>> } & WithInitialValue<null> = ...
cloudLogFiltersAtom: WritableAtom<CloudLogFilters, typeof RESET | SetStateAction<CloudLogFilters>, void> = ...

Store cloud log modal filters in URL

columnMenuAtom: Atom<null | { anchorEl: undefined | null | Element | ((element: Element) => Element); column: ColumnConfig }> & { onMount?: OnMount<SetStateAction<null | { anchorEl: undefined | null | Element | ((element: Element) => Element); column: ColumnConfig }>, void>; write: Write<SetStateAction<null | { anchorEl: undefined | null | Element | ((element: Element) => Element); column: ColumnConfig }>, void> } & WithInitialValue<null | { anchorEl: undefined | null | Element | ((element: Element) => Element); column: ColumnConfig }> = ...

Open table column menu. Set to null to close.

example

Basic usage:

const openColumnMenu = useSetAtom(columnMenuAtom, globalScope);
openColumnMenu({ column, anchorEl: ... });
example

Close:

openColumnMenu(null)
columnModalAtom: WritableAtom<null | { columnKey?: string; index?: number; type: "name" | "type" | "config" | "new" }, typeof RESET | SetStateAction<null | { columnKey?: string; index?: number; type: "name" | "type" | "config" | "new" }>, void> = ...

Opens a table column modal. Set to null to close. Modals: new column, name change, type change, column settings.

example

Basic usage:

const openColumnModal = useSetAtom(columnModalAtom, globalScope);
openColumnModal({ type: "...", column });
example

Close:

import { RESET } from "jotai/utils";
openColumnModal(RESET)
contextMenuTargetAtom: Atom<null | HTMLElement> & { onMount?: OnMount<SetStateAction<null | HTMLElement>, void>; write: Write<SetStateAction<null | HTMLElement>, void> } & WithInitialValue<null | HTMLElement> = ...

Store context menu target atom for positioning. If not null, menu open.

deleteColumnAtom: Atom<null> & { onMount?: OnMount<string, Promise<void>>; write: Write<string, Promise<void>> } & WithInitialValue<null> = ...

Set function deletes a column in tableSchema

param key

Unique key of column to delete

example

Basic usage:

const deleteColumn = useSetAtom(deleteColumnAtom, tableScope);
deleteColumn(" ... ");
deleteRowAtom: Atom<null> & { onMount?: OnMount<string | string[], Promise<void>>; write: Write<string | string[], Promise<void>> } & WithInitialValue<null> = ...

Set function deletes a row or an array of rows from rowsDb or rowsLocal.

param path

A single path or array of paths of rows to delete

example

Basic usage:

const deleteRow = useSetAtom(deleteRowAtom, tableScope);
deleteRow( path );
importCsvAtom: Atom<{ csvData: null | ImportCsvData; importType: "csv" | "tsv" }> & { onMount?: OnMount<SetStateAction<{ csvData: null | ImportCsvData; importType: "csv" | "tsv" }>, void>; write: Write<SetStateAction<{ csvData: null | ImportCsvData; importType: "csv" | "tsv" }>, void> } & WithInitialValue<{ csvData: null | ImportCsvData; importType: "csv" | "tsv" }> = ...

Store import CSV popover and wizard state

selectedCellAtom: Atom<null | SelectedCell> & { onMount?: OnMount<SetStateAction<null | SelectedCell>, void>; write: Write<SetStateAction<null | SelectedCell>, void> } & WithInitialValue<null | SelectedCell> = ...

Store selected cell in table. Used in side drawer and context menu

sideDrawerOpenAtom: Atom<boolean> & { onMount?: OnMount<SetStateAction<boolean>, void>; write: Write<SetStateAction<boolean>, void> } & WithInitialValue<boolean> = ...

Store side drawer open state

sideDrawerShowHiddenFieldsAtom: WritableAtom<boolean, typeof RESET | SetStateAction<boolean>, void> = ...

Store whether to show hidden fields (override) in side drawer

tableColumnsOrderedAtom: Atom<ColumnConfig[]> = ...

Store the table columns as an ordered array. Puts frozen columns at the start, then sorts by ascending index.

tableFiltersAtom: Atom<TableFilter[]> & { onMount?: OnMount<SetStateAction<TableFilter[]>, void>; write: Write<SetStateAction<TableFilter[]>, void> } & WithInitialValue<TableFilter[]> = ...

Filters applied to the local view

tableFiltersPopoverAtom: Atom<TableFiltersPopoverState> & { onMount?: OnMount<Partial<TableFiltersPopoverState>, void>; write: Write<Partial<TableFiltersPopoverState>, void> } & WithInitialValue<TableFiltersPopoverState> = ...

Store table filter popover state. Calling the set function resets props.

example

Basic usage:

const openTableFiltersPopover = useSetAtom(tableFiltersPopoverAtom, globalScope);
openTableFiltersPopover({ query: ... });
example

Close:

openTableFiltersPopover({ open: false })
tableIdAtom: Atom<string> & { onMount?: OnMount<SetStateAction<string>, void>; write: Write<SetStateAction<string>, void> } & WithInitialValue<string> = ...

Root atom from which others are derived

tableModalAtom: WritableAtom<null | "cloudLogs" | "extensions" | "webhooks" | "export" | "importExisting" | "importCsv", typeof RESET | SetStateAction<null | "cloudLogs" | "extensions" | "webhooks" | "export" | "importExisting" | "importCsv">, void> = ...

Opens a table modal. Set to null to close. Modals: cloud logs, extensions, webhooks, export, import, import CSV.

example

Basic usage:

const openTableModal = useSetAtom(tableModalAtom, globalScope);
openTableModal("...");
example

Close:

openTableModal(null)
tableNextPageAtom: Atom<NextPageState> & { onMount?: OnMount<SetStateAction<NextPageState>, void>; write: Write<SetStateAction<NextPageState>, void> } & WithInitialValue<NextPageState> = ...

Store next page state for infinite scroll

tablePageAtom: WritableAtom<number, number | ((p: number) => number), void> = ...

Set the page for the table query. Stops updating if we’ve loaded all rows.

tablePageHashAtom: WritableAtom<number, typeof RESET | SetStateAction<number>, void> = ...

Store current page in URL

tableRowsAtom: Atom<TableRow[]> = ...

Combine tableRowsLocal and tableRowsDb

tableRowsDbAtom: Atom<TableRow[]> & { onMount?: OnMount<SetStateAction<TableRow[]>, void>; write: Write<SetStateAction<TableRow[]>, void> } & WithInitialValue<TableRow[]> = ...

Store rows from the db listener

tableRowsLocalAtom: WritableAtom<TableRow[], TableRowsLocalAction, void> = ...

Store rows that are out of order or not ready to be written to the db. See {@link TableRowsLocalAction} for reducer actions.

tableSchemaAtom: Atom<TableSchema> & { onMount?: OnMount<SetStateAction<TableSchema>, void>; write: Write<SetStateAction<TableSchema>, void> } & WithInitialValue<TableSchema> = ...

Store tableSchema from schema document

tableScope: typeof tableScope = ...

Scope for atoms stored at the table level

tableSettingsAtom: Atom<TableSettings> & { onMount?: OnMount<SetStateAction<TableSettings>, void>; write: Write<SetStateAction<TableSettings>, void> } & WithInitialValue<TableSettings> = ...

Store tableSettings from project settings document

tableSortsAtom: Atom<TableSort[]> & { onMount?: OnMount<SetStateAction<TableSort[]>, void>; write: Write<SetStateAction<TableSort[]>, void> } & WithInitialValue<TableSort[]> = ...

Sorts applied to the local view

updateColumnAtom: Atom<null> & { onMount?: OnMount<IUpdateColumnOptions, Promise<void>>; write: Write<IUpdateColumnOptions, Promise<void>> } & WithInitialValue<null> = ...

Set function updates a column in tableSchema

throws

Error if column not found

param options

IUpdateColumnOptions

example

Basic usage:

const updateColumn = useSetAtom(updateColumnAtom, tableScope);
updateColumn({ key: "", config: {...}, index?: 0 });
updateFieldAtom: Atom<null> & { onMount?: OnMount<IUpdateFieldOptions, Promise<void>>; write: Write<IUpdateFieldOptions, Promise<void>> } & WithInitialValue<null> = ...

Set function updates or deletes a field in a row. Adds to rowsDb if it has no missing required fields, otherwise keeps in rowsLocal.

param options

IUpdateFieldOptions

example

Basic usage:

const updateField = useSetAtom(updateFieldAtom, tableScope);
updateField({ path, fieldName: "", value: null, deleteField: true });
updateTableSchemaAtom: Atom<undefined | UpdateDocFunction<TableSchema>> & { onMount?: OnMount<SetStateAction<undefined | UpdateDocFunction<TableSchema>>, void>; write: Write<SetStateAction<undefined | UpdateDocFunction<TableSchema>>, void> } & WithInitialValue<undefined | UpdateDocFunction<TableSchema>> = ...

Store function to update tableSchema

Functions

  • tableColumnsReducer(a: Record<string, ColumnConfig>, c: ColumnConfig, index: number): Record<string, ColumnConfig>
  • Reducer function to convert from array of columns to columns object

    Parameters

    • a: Record<string, ColumnConfig>
    • c: ColumnConfig
    • index: number

    Returns Record<string, ColumnConfig>

Generated using TypeDoc