@ishibashi0112/spreadsheet-grid 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import './styles.css';
2
2
  import type { SpreadsheetGridProps } from './model/gridTypes';
3
- export declare function SpreadsheetGrid<T extends object>({ rows, dataSource, serverSideRefreshToken, columns, onRowsChange, onColumnsChange, rowKeyGetter, createRow, createOverflowColumn, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, headerHeight: headerHeightProp, density, theme, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, enableColumnFilter, enableSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, enableRowHover, enableColumnHeaderHover, enableColumnMenu, noMatchingRowsText, noRowsText, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, showTopBarCounts, showBottomBarCounts, showFilterChipBar, renderTopBar, renderBottomBar, className, classNames, getRowClassName, enableContextMenu, getContextMenuItems, onContextMenuOpen, ref, onStateChange, }: SpreadsheetGridProps<T>): import("react").JSX.Element;
3
+ export declare function SpreadsheetGrid<T extends object>({ rows, dataSource, serverSideRefreshToken, columns, onRowsChange, onColumnsChange, rowKeyGetter, createRow, createOverflowColumn, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, headerHeight: headerHeightProp, density, theme, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell, enableUndoRedo, undoHistoryLimit, onUndoRedoStateChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, enableColumnFilter, enableSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, enableRowHover, enableColumnHeaderHover, enableColumnMenu, noMatchingRowsText, noRowsText, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, showTopBarCounts, showBottomBarCounts, showFilterChipBar, renderTopBar, renderBottomBar, className, classNames, getRowClassName, enableContextMenu, getContextMenuItems, onContextMenuOpen, ref, onStateChange, }: SpreadsheetGridProps<T>): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import type { Dispatch } from 'react';
2
+ import { type GridUiAction } from '../model/gridActions';
3
+ import type { CellCoord, GridSelection, UndoRedoState } from '../model/gridTypes';
4
+ type UseGridHistoryControllerArgs<T> = {
5
+ rows: T[];
6
+ selection: GridSelection;
7
+ activeCell: CellCoord | null;
8
+ onRowsChange?: (nextRows: T[]) => void;
9
+ dispatch: Dispatch<GridUiAction>;
10
+ enabled: boolean;
11
+ limit: number;
12
+ onUndoRedoStateChange?: (state: UndoRedoState) => void;
13
+ onAfterRestore?: (activeCell: CellCoord | null) => void;
14
+ };
15
+ export declare const useGridHistoryController: <T>({ rows, selection, activeCell, onRowsChange, dispatch, enabled, limit, onUndoRedoStateChange, onAfterRestore, }: UseGridHistoryControllerArgs<T>) => {
16
+ handleRowsChange: ((nextRows: T[]) => void) | undefined;
17
+ undo: () => void;
18
+ redo: () => void;
19
+ canUndo: () => boolean;
20
+ canRedo: () => boolean;
21
+ clearHistory: () => void;
22
+ };
23
+ export default useGridHistoryController;
@@ -13,8 +13,11 @@ type UseGridKeyboardInteractionsArgs<T> = {
13
13
  handleCellDoubleClick: (cell: CellCoord) => void;
14
14
  isWholeGridSelected: boolean;
15
15
  selectEntireGrid: () => void;
16
+ onUndo: () => void;
17
+ onRedo: () => void;
18
+ onClearSelection: () => void;
16
19
  };
17
- export declare const useGridKeyboardInteractions: <T>({ uiState, rowModel, visibleColumns, readOnly, canEditCell, setEditorInitialValue, dispatch, handleCopy, handleCellDoubleClick, isWholeGridSelected, selectEntireGrid, }: UseGridKeyboardInteractionsArgs<T>) => {
20
+ export declare const useGridKeyboardInteractions: <T>({ uiState, rowModel, visibleColumns, readOnly, canEditCell, setEditorInitialValue, dispatch, handleCopy, handleCellDoubleClick, isWholeGridSelected, selectEntireGrid, onUndo, onRedo, onClearSelection, }: UseGridKeyboardInteractionsArgs<T>) => {
18
21
  getMovedCell: (baseCell: CellCoord, deltaRow: number, deltaCol: number) => CellCoord;
19
22
  handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => Promise<void>;
20
23
  };