@ishibashi0112/spreadsheet-grid 0.52.0 → 0.53.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.
@@ -0,0 +1,3 @@
1
+ import type { SpreadsheetGridProps } from './model/gridTypes.js';
2
+ import type { GridShellFeatures } from './features/types.js';
3
+ export declare function useGridShell<T extends object>({ rows: rowsProp, dataSource, serverSideRefreshToken, onServerSideLoadError, onServerSideWriteError, columns: columnsProp, onRowsChange, onColumnsChange, rowKeyGetter, isRowExportable, createRow, createOverflowColumn, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, headerHeight: headerHeightProp, density, theme, motion, animateRows, showCopyRange, hoverHighlight, highlightChanges, showSaveStatus, rowDragMotion, columnDragMotion, find, onFindChange, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, imeDirectInput, undoHistoryLimit, onUndoRedoStateChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, enableColumnFilter, renderFilterDateInput, getFilterOptions, enableSorting, manualFiltering, manualSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, hoveredRowIndex: hoveredRowIndexProp, onHoveredRowChange, onCellClick, onCellDoubleClick, onActiveCellChange, enableColumnMenu, noMatchingRowsText, noRowsText, ariaLabel, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, showTopBarCounts, showBottomBarCounts, showSelectionAggregates, showFilterChipBar, renderTopBar, renderBottomBar, className, style, classNames, getRowClassName, detailRow, onExpandedDetailRowKeysChange, labelRow, totalRow, fillHandle, enableRowDrag, isRowDraggable, onRowMove, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, onFiltersChange, onSortChange, onScroll, }: SpreadsheetGridProps<T>, features: GridShellFeatures): import("react").JSX.Element;
@@ -38,4 +38,4 @@ import type { SpreadsheetGridProps } from './model/gridTypes.js';
38
38
  * }
39
39
  * ```
40
40
  */
41
- export declare function SpreadsheetGrid<T extends object>({ rows: rowsProp, dataSource, serverSideRefreshToken, onServerSideLoadError, onServerSideWriteError, columns: columnsProp, onRowsChange, onColumnsChange, rowKeyGetter, isRowExportable, createRow, createOverflowColumn, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, headerHeight: headerHeightProp, density, theme, motion, animateRows, showCopyRange, hoverHighlight, highlightChanges, showSaveStatus, rowDragMotion, columnDragMotion, find, onFindChange, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, imeDirectInput, undoHistoryLimit, onUndoRedoStateChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, enableColumnFilter, renderFilterDateInput, getFilterOptions, enableSorting, manualFiltering, manualSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, hoveredRowIndex: hoveredRowIndexProp, onHoveredRowChange, onCellClick, onCellDoubleClick, onActiveCellChange, enableColumnMenu, noMatchingRowsText, noRowsText, ariaLabel, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, showTopBarCounts, showBottomBarCounts, showSelectionAggregates, showFilterChipBar, renderTopBar, renderBottomBar, className, style, classNames, getRowClassName, detailRow, onExpandedDetailRowKeysChange, labelRow, totalRow, fillHandle, enableRowDrag, isRowDraggable, onRowMove, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, onFiltersChange, onSortChange, onScroll, }: SpreadsheetGridProps<T>): import("react").JSX.Element;
41
+ export declare function SpreadsheetGrid<T extends object>(props: SpreadsheetGridProps<T>): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { ReactGridFeatures } from './features/types.js';
2
+ import type { SpreadsheetGridProps } from './model/gridTypes.js';
3
+ export type CreateSpreadsheetGridOptions = {
4
+ features: ReactGridFeatures;
5
+ };
6
+ export declare function createSpreadsheetGrid({ features }: CreateSpreadsheetGridOptions): <T extends object>(props: SpreadsheetGridProps<T>) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const columnAutosizeFeature: NonNullable<ReactGridFeatures['columnAutosize']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const columnReorderFeature: NonNullable<ReactGridFeatures['columnReorder']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const conditionalFormatFeature: NonNullable<ReactGridFeatures['conditionalFormat']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const contextMenuFeature: NonNullable<ReactGridFeatures['contextMenu']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const exportFeature: NonNullable<ReactGridFeatures['export']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const fillHandleFeature: NonNullable<ReactGridFeatures['fillHandle']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const findFeature: NonNullable<ReactGridFeatures['find']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const fullGridFeatures: Required<ReactGridFeatures>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const imeDirectInputFeature: NonNullable<ReactGridFeatures['imeDirectInput']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const motionExtrasFeature: NonNullable<ReactGridFeatures['motionExtras']>;
@@ -0,0 +1,2 @@
1
+ import type { GridShellFeatures, ReactGridFeatures } from './types.js';
2
+ export declare const resolveGridShellFeatures: (features: ReactGridFeatures) => GridShellFeatures;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const rowDragFeature: NonNullable<ReactGridFeatures['rowDrag']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const scrollHintFeature: NonNullable<ReactGridFeatures['scrollHint']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const selectionAggregatesFeature: NonNullable<ReactGridFeatures['selectionAggregates']>;
@@ -0,0 +1,2 @@
1
+ import type { ReactGridFeatures } from './types.js';
2
+ export declare const totalRowFeature: NonNullable<ReactGridFeatures['totalRow']>;
@@ -0,0 +1,147 @@
1
+ import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode, RefObject } from 'react';
2
+ import type { GridCoreFeatures } from '@ishibashi0112/spreadsheet-grid-core/engine/features';
3
+ import type { splitTextByFindRanges } from '@ishibashi0112/spreadsheet-grid-core/logic/find';
4
+ import type { resolveScrollHintOptions } from '@ishibashi0112/spreadsheet-grid-core/logic/scrollHint';
5
+ import type { resolveChipSpec, resolveColorScaleBackground, resolveDataBar } from '@ishibashi0112/spreadsheet-grid-core/logic/conditionalFormat';
6
+ import type { formatTotalRowCellText, resolveTotalRowCaption, resolveTotalRowLabelColumnKey } from '@ishibashi0112/spreadsheet-grid-core/logic/totalRow';
7
+ import type { FillHandleControllerArgs } from '@ishibashi0112/spreadsheet-grid-core/controllers/fillHandleController';
8
+ import type { ColumnHeaderDragController } from '@ishibashi0112/spreadsheet-grid-core/controllers/columnHeaderDragController';
9
+ import type { ColumnAutosizeRunnerArgs } from '@ishibashi0112/spreadsheet-grid-core/controllers/columnAutosizeRunner';
10
+ import type { ColumnPane, GridPaneLayout } from '@ishibashi0112/spreadsheet-grid-core/logic/geometry';
11
+ import type { DetailRowExtra, RowMetrics } from '@ishibashi0112/spreadsheet-grid-core/logic/verticalGeometry';
12
+ import type { CellCoord, GridColumn, GridContextMenuItem, GridContextMenuParams, GridResolvedSlots, GridSelection, GridSelectionAggregates, GridUiState, RowModel, SpreadsheetGridProps } from '../model/gridTypes.js';
13
+ import type { GridFindBar } from '../view/GridFindBar.js';
14
+ import type { GridScrollHint } from '../view/GridScrollHint.js';
15
+ import type { GridTotalRow } from '../view/GridTotalRow.js';
16
+ import type { GridChip } from '../view/GridChip.js';
17
+ import type { CopyRangeOverlay } from '../CopyRangeOverlay.js';
18
+ import type { ColumnHoverOverlay } from '../ColumnHoverOverlay.js';
19
+ import type { GridSelectionAggregates as GridSelectionAggregatesView } from '../view/GridSelectionAggregates.js';
20
+ import type { UseSelectionAggregatesArgs } from '../hooks/useSelectionAggregates.js';
21
+ import type { UseColumnHeaderDragControllerArgs } from '../hooks/useColumnHeaderDragController.js';
22
+ import type { UseRowDragControllerArgs } from '../hooks/useRowDragController.js';
23
+ export type FillHandleFeatureArgs<T> = {
24
+ fillHandle: SpreadsheetGridProps<T>['fillHandle'];
25
+ readOnly: boolean;
26
+ isServerSide: boolean;
27
+ rows: FillHandleControllerArgs<T>['rows'];
28
+ rowModel: RowModel<T>;
29
+ orderedColumns: GridColumn<T>[];
30
+ uiState: GridUiState;
31
+ serverSideQueryKey: string;
32
+ serverSideRefreshToken: number | undefined;
33
+ canEditCell: FillHandleControllerArgs<T>['canEditCell'];
34
+ dispatch: FillHandleControllerArgs<T>['dispatch'];
35
+ getCellCoordFromClientPoint: FillHandleControllerArgs<T>['hitTest'];
36
+ scrollContainerRef: FillHandleControllerArgs<T>['scrollContainerRef'];
37
+ gridRootRef: FillHandleControllerArgs<T>['gridRootRef'];
38
+ footerHeight: number;
39
+ handleRowsChange: FillHandleControllerArgs<T>['applyRowsChange'];
40
+ amendRowsChange: FillHandleControllerArgs<T>['amendRowsChange'];
41
+ applyServerSideCellEdits: FillHandleControllerArgs<T>['applyServerSideCellEdits'];
42
+ viewRowCount: number;
43
+ paneLayout: GridPaneLayout<T>;
44
+ rowMetrics: RowMetrics;
45
+ windowFirstRow: number;
46
+ windowLastRow: number;
47
+ detailActive: boolean;
48
+ detailExtras: readonly DetailRowExtra[];
49
+ viewportHeight: number;
50
+ scrollTop: number;
51
+ headerHeight: number;
52
+ overlayBaseOffset: number;
53
+ portalClassName: string | undefined;
54
+ };
55
+ export type FillHandleFeatureResult = {
56
+ filling: boolean;
57
+ renderLayer: (pane: ColumnPane, leadingWidth: number) => ReactNode;
58
+ renderPortals: () => ReactNode;
59
+ };
60
+ export type ColumnReorderFeatureArgs<T> = UseColumnHeaderDragControllerArgs<T>;
61
+ export type ColumnReorderFeatureResult<T> = {
62
+ onColumnDragHandlePointerDown: ColumnHeaderDragController<T>['onColumnDragHandlePointerDown'] | undefined;
63
+ renderDropIndicator: (pane: ColumnPane, style: CSSProperties) => ReactNode;
64
+ };
65
+ export type RowDragFeatureArgs<T> = Omit<UseRowDragControllerArgs, 'getRowDragLabel'> & {
66
+ rowModel: RowModel<T>;
67
+ visibleColumns: GridColumn<T>[];
68
+ isRowDraggable: SpreadsheetGridProps<T>['isRowDraggable'];
69
+ };
70
+ export type RowDragFeatureResult<T> = {
71
+ renderHandleCell: (row: T, rowIndex: number) => ReactNode;
72
+ renderDropIndicator: (pane: ColumnPane, className: string) => ReactNode;
73
+ };
74
+ export type ColumnAutosizeFeatureArgs<T> = ColumnAutosizeRunnerArgs<T>;
75
+ export type ColumnAutosizeFeatureResult<T> = {
76
+ available: boolean;
77
+ isAutosizing: boolean;
78
+ runAutosize: (columns: GridColumn<T>[]) => Promise<void>;
79
+ };
80
+ export type CellContextMenuFeatureArgs = {
81
+ gridRootRef: RefObject<HTMLDivElement | null>;
82
+ };
83
+ export type CellContextMenuFeatureResult<T> = {
84
+ isContextMenuOpen: boolean;
85
+ openContextMenu: (params: GridContextMenuParams<T>, items: GridContextMenuItem[]) => void;
86
+ renderContextMenuPopover: (slots: GridResolvedSlots, themeClassName: string | undefined) => ReactNode;
87
+ };
88
+ export type BodyContextMenuInput<T> = {
89
+ event: ReactMouseEvent<HTMLDivElement>;
90
+ rowModel: RowModel<T>;
91
+ orderedColumns: GridColumn<T>[];
92
+ selection: GridSelection;
93
+ activeCell: CellCoord | null;
94
+ };
95
+ export type ConditionalFormatCellResolvers = {
96
+ resolveDataBar: typeof resolveDataBar;
97
+ resolveColorScaleBackground: typeof resolveColorScaleBackground;
98
+ };
99
+ export type ReactGridFeatures = {
100
+ find?: NonNullable<GridCoreFeatures['find']> & {
101
+ FindBar: typeof GridFindBar;
102
+ splitTextByFindRanges: typeof splitTextByFindRanges;
103
+ };
104
+ fillHandle?: {
105
+ useFillHandle: <T>(args: FillHandleFeatureArgs<T>) => FillHandleFeatureResult;
106
+ };
107
+ columnReorder?: {
108
+ useColumnReorder: <T>(args: ColumnReorderFeatureArgs<T>) => ColumnReorderFeatureResult<T>;
109
+ };
110
+ imeDirectInput?: NonNullable<GridCoreFeatures['imeDirectInput']>;
111
+ export?: NonNullable<GridCoreFeatures['export']>;
112
+ columnAutosize?: {
113
+ useColumnAutosize: <T>(args: ColumnAutosizeFeatureArgs<T>) => ColumnAutosizeFeatureResult<T>;
114
+ };
115
+ totalRow?: NonNullable<GridCoreFeatures['totalRow']> & {
116
+ TotalRow: typeof GridTotalRow;
117
+ formatTotalRowCellText: typeof formatTotalRowCellText;
118
+ resolveTotalRowCaption: typeof resolveTotalRowCaption;
119
+ resolveTotalRowLabelColumnKey: typeof resolveTotalRowLabelColumnKey;
120
+ };
121
+ conditionalFormat?: NonNullable<GridCoreFeatures['conditionalFormat']> & ConditionalFormatCellResolvers & {
122
+ resolveChipSpec: typeof resolveChipSpec;
123
+ GridChip: typeof GridChip;
124
+ };
125
+ selectionAggregates?: {
126
+ useSelectionAggregates: <T>(args: UseSelectionAggregatesArgs<T>) => GridSelectionAggregates | null;
127
+ SelectionAggregates: typeof GridSelectionAggregatesView;
128
+ };
129
+ motionExtras?: NonNullable<GridCoreFeatures['motionExtras']> & {
130
+ CopyRangeOverlay: typeof CopyRangeOverlay;
131
+ ColumnHoverOverlay: typeof ColumnHoverOverlay;
132
+ };
133
+ contextMenu?: {
134
+ useCellContextMenu: <T>(args: CellContextMenuFeatureArgs) => CellContextMenuFeatureResult<T>;
135
+ buildBodyContextMenuParams: <T>(input: BodyContextMenuInput<T>) => GridContextMenuParams<T> | null;
136
+ };
137
+ scrollHint?: {
138
+ resolveScrollHintOptions: typeof resolveScrollHintOptions;
139
+ ScrollHint: typeof GridScrollHint;
140
+ };
141
+ rowDrag?: {
142
+ useRowDrag: <T>(args: RowDragFeatureArgs<T>) => RowDragFeatureResult<T>;
143
+ };
144
+ };
145
+ type HookFeatureName = 'fillHandle' | 'columnReorder' | 'rowDrag' | 'columnAutosize' | 'contextMenu' | 'selectionAggregates';
146
+ export type GridShellFeatures = Omit<ReactGridFeatures, HookFeatureName> & Required<Pick<ReactGridFeatures, HookFeatureName>>;
147
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { type RefObject } from 'react';
2
2
  import { type ColumnHeaderDragArgs } from '@ishibashi0112/spreadsheet-grid-core/controllers/columnHeaderDragController';
3
- type UseColumnHeaderDragControllerArgs<T> = Omit<ColumnHeaderDragArgs<T>, 'leftPaneScrollRef' | 'rightPaneScrollRef' | 'bodyScrollRef' | 'scrollContainerRef' | 'leftIndicatorRef' | 'centerIndicatorRef' | 'rightIndicatorRef'> & {
3
+ export type UseColumnHeaderDragControllerArgs<T> = Omit<ColumnHeaderDragArgs<T>, 'leftPaneScrollRef' | 'rightPaneScrollRef' | 'bodyScrollRef' | 'scrollContainerRef' | 'leftIndicatorRef' | 'centerIndicatorRef' | 'rightIndicatorRef'> & {
4
4
  leftPaneScrollRef: RefObject<HTMLDivElement | null>;
5
5
  rightPaneScrollRef: RefObject<HTMLDivElement | null>;
6
6
  bodyScrollRef: RefObject<HTMLDivElement | null>;
@@ -13,4 +13,3 @@ export declare const useColumnHeaderDragController: <T>(args: UseColumnHeaderDra
13
13
  rightIndicatorRef: RefObject<HTMLDivElement | null>;
14
14
  applyReorderSettle: () => void;
15
15
  };
16
- export {};
@@ -1,6 +1,6 @@
1
1
  import { type RefObject } from 'react';
2
2
  import { type RowDragArgs } from '@ishibashi0112/spreadsheet-grid-core/controllers/rowDragController';
3
- type UseRowDragControllerArgs = Omit<RowDragArgs, 'scrollContainerRef' | 'bodyScrollRef' | 'leftIndicatorRef' | 'centerIndicatorRef' | 'rightIndicatorRef'> & {
3
+ export type UseRowDragControllerArgs = Omit<RowDragArgs, 'scrollContainerRef' | 'bodyScrollRef' | 'leftIndicatorRef' | 'centerIndicatorRef' | 'rightIndicatorRef'> & {
4
4
  scrollContainerRef: RefObject<HTMLDivElement | null>;
5
5
  bodyScrollRef: RefObject<HTMLDivElement | null>;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import type { GridColumn, GridSelection, GridSelectionAggregates, RowModel } from '../model/gridTypes.js';
2
- type UseSelectionAggregatesArgs<T> = {
2
+ export type UseSelectionAggregatesArgs<T> = {
3
3
  enabled: boolean;
4
4
  selection: GridSelection;
5
5
  viewRowCount: number;
@@ -0,0 +1,5 @@
1
+ import type { ReactGridFeatures } from '../features/types.js';
2
+ import type { SpreadsheetGridProps } from '../model/gridTypes.js';
3
+ declare function useUnregisteredFeatureWarningsInDev<T extends object>(props: SpreadsheetGridProps<T>, features: ReactGridFeatures): void;
4
+ export declare const useUnregisteredFeatureWarnings: typeof useUnregisteredFeatureWarningsInDev;
5
+ export {};