Module "hooks/useEditable"
Functions
Const DefaultEditor
- DefaultEditor(props: EditorProps & { children?: ReactNode }): Element
-
Parameters
Returns Element
Const useEditable
-
Parameters
-
__namedParameters: { activeCell: null | CellInterface; getEditor: (cell: CellInterface | null) => React.ElementType; getValue: (cell: CellInterface) => any; gridRef: MutableRefObject<{ container: HTMLDivElement | null; focus: () => void; getCellBounds: (coords: CellInterface) => AreaProps; getCellCoordsFromOffset: (x: number, y: number) => CellInterface; getCellOffsetFromCoords: (coords: CellInterface) => CellPosition; getScrollPosition: () => ScrollCoords; getViewPort: () => ViewPortProps; isMergedCell: (coords: CellInterface) => boolean; resetAfterIndices: (coords: CellInterface, shouldForceUpdate?: undefined | false | true) => void; resizeColumns: (indices: number[]) => void; resizeRows: (indices: number[]) => void; scrollTo: (scrollPosition: ScrollCoords) => void; scrollToItem: (coords: OptionalCellInterface, align?: Align) => void; stage: typeof Stage | null }>; onBeforeEdit: undefined | ((coords: CellInterface) => boolean); onCancel: undefined | ((e?: React.KeyboardEvent<HTMLInputElement>) => void); onChange: (value: string, activeCell: CellInterface) => void; onDelete: undefined | ((activeCell: CellInterface, selections: SelectionArea[]) => void); onSubmit: undefined | ((value: string, activeCell: CellInterface, nextActiveCell?: CellInterface | null) => void); selections: SelectionArea[] }
-
-
getEditor: (cell: CellInterface | null) => React.ElementType
-
-
Parameters
Returns React.ElementType
-
-
gridRef: MutableRefObject<{ container: HTMLDivElement | null; focus: () => void; getCellBounds: (coords: CellInterface) => AreaProps; getCellCoordsFromOffset: (x: number, y: number) => CellInterface; getCellOffsetFromCoords: (coords: CellInterface) => CellPosition; getScrollPosition: () => ScrollCoords; getViewPort: () => ViewPortProps; isMergedCell: (coords: CellInterface) => boolean; resetAfterIndices: (coords: CellInterface, shouldForceUpdate?: undefined | false | true) => void; resizeColumns: (indices: number[]) => void; resizeRows: (indices: number[]) => void; scrollTo: (scrollPosition: ScrollCoords) => void; scrollToItem: (coords: OptionalCellInterface, align?: Align) => void; stage: typeof Stage | null }>
-
onBeforeEdit: undefined | ((coords: CellInterface) => boolean)
-
onCancel: undefined | ((e?: React.KeyboardEvent<HTMLInputElement>) => void)
-
onChange: (value: string, activeCell: CellInterface) => void
-
onDelete: undefined | ((activeCell: CellInterface, selections: SelectionArea[]) => void)
-
onSubmit: undefined | ((value: string, activeCell: CellInterface, nextActiveCell?: CellInterface | null) => void)
-
Default cell editor