UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

51 lines 2.2 kB
import { Row, SelectColumn } from '@sage-bionetworks/synapse-types'; export declare function getRowSelectionEqualityComparator(row: Row, selectColumns?: SelectColumn[], rowSelectionPrimaryKey?: string[]): (r1: Row, r2: Row) => boolean; /** * Use Jotai atoms to manage table row selection state. We use Jotai instead of React context because subscribing to atoms * is more performant than subscribing to a frequently-changing context object, which causes undesirable re-renders. */ /** * Whether row selection is visible for the current component */ export declare const isRowSelectionVisibleAtom: import("jotai").PrimitiveAtom<boolean> & { init: boolean; }; /** * Whether row selection UI should float or be shown inline */ export declare const isRowSelectionUIFloatingAtom: import("jotai").PrimitiveAtom<boolean> & { init: boolean; }; /** * A unique key that identifies a row. If two selected rows have the same key values, then they are considered equal and would both be selected/deselected together. */ export declare const rowSelectionPrimaryKeyAtom: import("jotai").PrimitiveAtom<string[] | undefined> & { init: string[] | undefined; }; /** * A unique key that identifies a row. If two selected rows have the same key values, then they are considered equal and would both be selected/deselected together. */ export declare function useRowSelectionPrimaryKeyAtomValue(): string[] | undefined; /** * The set of selected rows */ export declare const selectedRowsAtom: import("jotai").PrimitiveAtom<Row[]> & { init: Row[]; }; /** * The set of selected rows */ export declare function useSelectedRowsAtomValue(): Row[]; /** * Can be used to determine if a row is selected. If a `rowSelectionPrimaryKey` is defined, then the row is selected if it has a matching PK. */ export declare const isRowSelectedAtom: import("jotai").Atom<(row: Row, selectColumns: SelectColumn[]) => boolean>; /** * Whether rows are currently selected */ export declare const hasSelectedRowsAtom: import("jotai").Atom<boolean>; /** * Whether rows are currently selected */ export declare function useHasSelectedRowsAtomValue(): boolean; //# sourceMappingURL=TableRowSelectionState.d.ts.map