@ishibashi0112/spreadsheet-grid 0.24.0 → 0.26.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,4 +1,4 @@
1
- import type { EditorCommitDirection, EditorCommitResult, GridColumn, GridColumnEditor, GridRowKey } from './model/gridTypes';
1
+ import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove, GridColumn, GridColumnEditor, GridRowKey } from './model/gridTypes';
2
2
  export type { EditorCommitDirection };
3
3
  type CellEditorRect = {
4
4
  left: number;
@@ -27,6 +27,7 @@ type CellEditorLayerProps<T> = {
27
27
  onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
28
28
  onCancel: () => void;
29
29
  align?: 'left' | 'center' | 'right';
30
+ enterMove?: EditorEnterMove;
30
31
  };
31
- export declare function CellEditorLayer<T>({ rect, headerHeight, leadingWidth, baseOffset, initialValue, editor, editorSession, themeClassName, onCommit, onCancel, align, }: CellEditorLayerProps<T>): import("react").JSX.Element | null;
32
+ export declare function CellEditorLayer<T>({ rect, headerHeight, leadingWidth, baseOffset, initialValue, editor, editorSession, themeClassName, onCommit, onCancel, align, enterMove, }: CellEditorLayerProps<T>): import("react").JSX.Element | null;
32
33
  export default CellEditorLayer;
@@ -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, onServerSideLoadError, onServerSideWriteError, columns, onRowsChange, onColumnsChange, rowKeyGetter, createRow, createOverflowColumn, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, headerHeight: headerHeightProp, density, theme, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, undoHistoryLimit, onUndoRedoStateChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, enableColumnFilter, enableSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, enableColumnMenu, noMatchingRowsText, noRowsText, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, showTopBarCounts, showBottomBarCounts, showFilterChipBar, renderTopBar, renderBottomBar, className, classNames, getRowClassName, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, }: SpreadsheetGridProps<T>): import("react").JSX.Element;
3
+ export declare function SpreadsheetGrid<T extends object>({ rows, dataSource, serverSideRefreshToken, onServerSideLoadError, onServerSideWriteError, columns, onRowsChange, onColumnsChange, rowKeyGetter, createRow, createOverflowColumn, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, headerHeight: headerHeightProp, density, theme, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, undoHistoryLimit, onUndoRedoStateChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, enableColumnFilter, enableSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, enableColumnMenu, noMatchingRowsText, noRowsText, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, showTopBarCounts, showBottomBarCounts, showFilterChipBar, renderTopBar, renderBottomBar, className, classNames, getRowClassName, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, }: SpreadsheetGridProps<T>): import("react").JSX.Element;
@@ -1,9 +1,10 @@
1
- import type { EditorCommitDirection, EditorCommitResult } from '../model/gridTypes';
1
+ import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove } from '../model/gridTypes';
2
2
  type DateCellEditorProps = {
3
3
  initialValue: string;
4
4
  onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
5
5
  onCancel: () => void;
6
6
  align?: 'left' | 'center' | 'right';
7
+ enterMove?: EditorEnterMove;
7
8
  };
8
- export declare function DateCellEditor({ initialValue, onCommit, onCancel, align, }: DateCellEditorProps): import("react").JSX.Element;
9
+ export declare function DateCellEditor({ initialValue, onCommit, onCancel, align, enterMove, }: DateCellEditorProps): import("react").JSX.Element;
9
10
  export default DateCellEditor;
@@ -1,4 +1,4 @@
1
- import type { EditorCommitDirection, EditorCommitResult } from '../model/gridTypes';
1
+ import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove } from '../model/gridTypes';
2
2
  type NumberCellEditorProps = {
3
3
  initialValue: string;
4
4
  min?: number;
@@ -7,6 +7,7 @@ type NumberCellEditorProps = {
7
7
  onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
8
8
  onCancel: () => void;
9
9
  align?: 'left' | 'center' | 'right';
10
+ enterMove?: EditorEnterMove;
10
11
  };
11
- export declare function NumberCellEditor({ initialValue, min, max, step, onCommit, onCancel, align, }: NumberCellEditorProps): import("react").JSX.Element;
12
+ export declare function NumberCellEditor({ initialValue, min, max, step, onCommit, onCancel, align, enterMove, }: NumberCellEditorProps): import("react").JSX.Element;
12
13
  export default NumberCellEditor;
@@ -1,4 +1,4 @@
1
- import type { EditorCommitDirection, EditorCommitResult, GridSelectEditorOption } from '../model/gridTypes';
1
+ import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove, GridSelectEditorOption } from '../model/gridTypes';
2
2
  type SelectCellEditorProps = {
3
3
  options: GridSelectEditorOption[];
4
4
  value: unknown;
@@ -6,6 +6,7 @@ type SelectCellEditorProps = {
6
6
  onCancel: () => void;
7
7
  align?: 'left' | 'center' | 'right';
8
8
  themeClassName?: string;
9
+ enterMove?: EditorEnterMove;
9
10
  };
10
- export declare function SelectCellEditor({ options, value, onCommit, onCancel, align, themeClassName, }: SelectCellEditorProps): import("react").JSX.Element;
11
+ export declare function SelectCellEditor({ options, value, onCommit, onCancel, align, themeClassName, enterMove, }: SelectCellEditorProps): import("react").JSX.Element;
11
12
  export default SelectCellEditor;
@@ -1,9 +1,10 @@
1
- import type { EditorCommitDirection, EditorCommitResult } from '../model/gridTypes';
1
+ import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove } from '../model/gridTypes';
2
2
  type TextCellEditorProps = {
3
3
  initialValue: string;
4
4
  onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
5
5
  onCancel: () => void;
6
6
  align?: 'left' | 'center' | 'right';
7
+ enterMove?: EditorEnterMove;
7
8
  };
8
- export declare function TextCellEditor({ initialValue, onCommit, onCancel, align, }: TextCellEditorProps): import("react").JSX.Element;
9
+ export declare function TextCellEditor({ initialValue, onCommit, onCancel, align, enterMove, }: TextCellEditorProps): import("react").JSX.Element;
9
10
  export default TextCellEditor;
@@ -1,10 +1,12 @@
1
1
  import type { KeyboardEvent } from 'react';
2
- import type { EditorCommitDirection, EditorCommitResult } from '../model/gridTypes';
2
+ import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove } from '../model/gridTypes';
3
+ export declare const resolveEnterDirection: (enterMove: EditorEnterMove | undefined) => EditorCommitDirection | undefined;
3
4
  type CreateEditorKeyDownHandlerArgs = {
4
5
  value: unknown;
5
6
  onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
6
7
  onCancel: () => void;
7
8
  onRejected?: (message: string) => void;
9
+ enterMove?: EditorEnterMove;
8
10
  };
9
- export declare const createEditorKeyDownHandler: ({ value, onCommit, onCancel, onRejected }: CreateEditorKeyDownHandlerArgs) => (event: KeyboardEvent<HTMLInputElement>) => void;
11
+ export declare const createEditorKeyDownHandler: ({ value, onCommit, onCancel, onRejected, enterMove, }: CreateEditorKeyDownHandlerArgs) => (event: KeyboardEvent<HTMLInputElement>) => void;
10
12
  export {};
@@ -1,10 +1,11 @@
1
1
  import { type RefObject } from 'react';
2
- import type { ColumnFilterValue, GridColumn } from '../model/gridTypes';
2
+ import type { ColumnFilterUiType, ColumnFilterValue, GridColumn } from '../model/gridTypes';
3
3
  import { type NumberFilterConditionDraft } from '../logic/numberFilterCondition';
4
4
  import { type TextFilterConditionDraft } from '../logic/textFilterCondition';
5
5
  import { type DateFilterConditionDraft } from '../logic/dateFilterCondition';
6
6
  type HeaderFilterPopoverState = {
7
7
  columnKey: string;
8
+ filterType: ColumnFilterUiType;
8
9
  draftValue: string;
9
10
  numberDraft: NumberFilterConditionDraft | null;
10
11
  textDraft: TextFilterConditionDraft | null;
@@ -20,8 +21,9 @@ type UseFilterPopoverControllerArgs<T> = {
20
21
  columnFilterValues: Record<string, ColumnFilterValue>;
21
22
  enableColumnFilter: boolean;
22
23
  gridRootRef: RefObject<HTMLDivElement | null>;
24
+ resolveColumnFilterType?: (column: GridColumn<T>) => ColumnFilterUiType;
23
25
  };
24
- export declare const useFilterPopoverController: <T>({ visibleColumns, columnFilterValues, enableColumnFilter, gridRootRef, }: UseFilterPopoverControllerArgs<T>) => {
26
+ export declare const useFilterPopoverController: <T>({ visibleColumns, columnFilterValues, enableColumnFilter, gridRootRef, resolveColumnFilterType, }: UseFilterPopoverControllerArgs<T>) => {
25
27
  filterPopoverState: HeaderFilterPopoverState | null;
26
28
  filterPopoverLayout: FilterPopoverLayout | null;
27
29
  filterPopoverRef: RefObject<HTMLDivElement | null>;
@@ -29,6 +31,7 @@ export declare const useFilterPopoverController: <T>({ visibleColumns, columnFil
29
31
  filterSelectRef: RefObject<HTMLSelectElement | null>;
30
32
  isFilterPopoverOpen: boolean;
31
33
  openedFilterColumn: GridColumn<T> | null;
34
+ openedFilterType: ColumnFilterUiType | null;
32
35
  openColumnFilterPopover: (column: GridColumn<T>) => void;
33
36
  closeColumnFilterPopover: () => void;
34
37
  updateFilterPopoverDraft: (value: string) => void;
@@ -11,11 +11,10 @@ type UseGridEditControllerArgs<T extends object> = {
11
11
  onRowsChange?: (nextRows: T[]) => void;
12
12
  applyServerSideCellEdits?: (edits: ServerSideCellEditInput<T>[]) => number;
13
13
  dispatch: Dispatch<GridUiAction>;
14
- getMovedCell: (baseCell: CellCoord, deltaRow: number, deltaCol: number) => CellCoord;
15
14
  gridRootRef: RefObject<HTMLDivElement | null>;
16
15
  editorActionGuardRef: RefObject<boolean>;
17
16
  };
18
- export declare const useGridEditController: <T extends object>({ uiState, rows, visibleColumns, rowModel, setEditorInitialValue, onRowsChange, applyServerSideCellEdits, dispatch, getMovedCell, gridRootRef, editorActionGuardRef, }: UseGridEditControllerArgs<T>) => {
17
+ export declare const useGridEditController: <T extends object>({ uiState, rows, visibleColumns, rowModel, setEditorInitialValue, onRowsChange, applyServerSideCellEdits, dispatch, gridRootRef, editorActionGuardRef, }: UseGridEditControllerArgs<T>) => {
19
18
  activateSingleCell: (cell: CellCoord) => void;
20
19
  startEditWithValue: (cell: CellCoord, initialValue: string) => void;
21
20
  commitEdit: (committedValue: unknown, direction?: EditorCommitDirection) => EditorCommitResult;
@@ -21,7 +21,6 @@ type UseGridKeyboardInteractionsArgs<T> = {
21
21
  onToggleGroup: (groupKey: string) => void;
22
22
  };
23
23
  export declare const useGridKeyboardInteractions: <T>({ uiState, rowModel, visibleColumns, readOnly, canEditCell, setEditorInitialValue, dispatch, handleCopy, handleCellDoubleClick, isWholeGridSelected, selectEntireGrid, onUndo, onRedo, onClearSelection, enableClearOnDelete, onToggleCheckboxCell, onToggleGroup, }: UseGridKeyboardInteractionsArgs<T>) => {
24
- getMovedCell: (baseCell: CellCoord, deltaRow: number, deltaCol: number) => CellCoord;
25
24
  handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => Promise<void>;
26
25
  };
27
26
  export default useGridKeyboardInteractions;