@ishibashi0112/spreadsheet-grid 1.6.0 → 1.8.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.
- package/API_REFERENCE.md +161 -20
- package/README.md +2 -2
- package/dist/CellEditorLayer.d.ts +5 -3
- package/dist/GridShell.d.ts +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/editors/SearchSelectCellEditor.d.ts +24 -0
- package/dist/editors/SelectCellEditor.d.ts +1 -1
- package/dist/features/changeTracking.d.ts +2 -0
- package/dist/features/selectSearch.d.ts +2 -0
- package/dist/features/types.d.ts +12 -1
- package/dist/hooks/useGridBarContext.d.ts +4 -3
- package/dist/hooks/useGridEditController.d.ts +1 -1
- package/dist/index.cjs +9 -6
- package/dist/index.js +3368 -3027
- package/dist/lite/createSpreadsheetGrid-Dk8_KZ1L.js +4657 -0
- package/dist/lite/createSpreadsheetGrid-wGOM8DxG.cjs +9 -0
- package/dist/lite/createSpreadsheetGrid.cjs +1 -1
- package/dist/lite/createSpreadsheetGrid.js +1 -1
- package/dist/lite/features/changeTracking.cjs +1 -0
- package/dist/lite/features/changeTracking.js +13 -0
- package/dist/lite/features/selectSearch.cjs +1 -0
- package/dist/lite/features/selectSearch.js +2 -0
- package/dist/lite/selectSearch-B1OSCMbw.js +204 -0
- package/dist/lite/selectSearch-BIeA4Xhg.cjs +1 -0
- package/dist/lite/useTopAlignedInput-BAL_0rjw.cjs +1 -0
- package/dist/lite/useTopAlignedInput-CAagCTj-.js +37 -0
- package/dist/lite.cjs +1 -1
- package/dist/lite.d.ts +2 -0
- package/dist/lite.js +15 -13
- package/dist/model/gridTypes.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/themes/mantine.css +2 -1
- package/dist/view/DefaultGridBottomBar.d.ts +2 -1
- package/dist/view/GridBodyLayer.d.ts +11 -2
- package/package.json +2 -2
- package/skills/spreadsheet-grid/SKILL.md +4 -2
- package/dist/lite/createSpreadsheetGrid-CvNJLEhA.js +0 -4536
- package/dist/lite/createSpreadsheetGrid-iAPCKb03.cjs +0 -6
|
@@ -4,7 +4,7 @@ type SelectCellEditorProps = {
|
|
|
4
4
|
ariaLabel?: string;
|
|
5
5
|
options: readonly GridSelectEditorOption[];
|
|
6
6
|
value: unknown;
|
|
7
|
-
onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
|
|
7
|
+
onCommit: (value: unknown, direction?: EditorCommitDirection, option?: GridSelectEditorOption) => EditorCommitResult | void;
|
|
8
8
|
onCancel: () => void;
|
|
9
9
|
onRegisterFlush?: ((flush: (() => void) | null) => void) | undefined;
|
|
10
10
|
align?: 'left' | 'center' | 'right';
|
package/dist/features/types.d.ts
CHANGED
|
@@ -10,16 +10,18 @@ import type { buildColumnGroupTree, columnHeaderSpanRows, createColumnChooserDro
|
|
|
10
10
|
import type { ColumnAutosizeRunnerArgs } from '@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnAutosizeRunner';
|
|
11
11
|
import type { DateRolloverStore } from '@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore';
|
|
12
12
|
import type { RowOrder } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering';
|
|
13
|
+
import type { buildRevertMenuItems, describeUnsavedCell, formatUnsavedSummary } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/changeTracking';
|
|
13
14
|
import type { ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText';
|
|
14
15
|
import type { GridUiAction } from '@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions';
|
|
15
16
|
import type { ColumnPane, GridPaneLayout } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry';
|
|
16
17
|
import type { DetailRowExtra, RowMetrics } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry';
|
|
17
|
-
import type { CellCoord, ColumnFilterValue, GridColumn, GridContextMenuItem, GridContextMenuParams, GridResolvedSlots, GridSelection, GridSelectionAggregates, GridLocaleText, GridUiState, GlobalFilterStatus, GridGlobalFilterMatch, GridRowKey, RowModel, SpreadsheetGridProps } from '../model/gridTypes.js';
|
|
18
|
+
import type { CellCoord, ColumnFilterValue, GridColumn, GridContextMenuItem, GridContextMenuParams, GridContextMenuTarget, GridResolvedSlots, GridSelection, GridSelectionAggregates, GridLocaleText, GridUiState, GlobalFilterStatus, GridGlobalFilterMatch, GridRowKey, RowModel, SpreadsheetGridProps } from '../model/gridTypes.js';
|
|
18
19
|
import type { GridFindBar } from '../view/GridFindBar.js';
|
|
19
20
|
import type { GridScrollHint } from '../view/GridScrollHint.js';
|
|
20
21
|
import type { GridTotalRow } from '../view/GridTotalRow.js';
|
|
21
22
|
import type { GridPinnedRows } from '../view/GridPinnedRows.js';
|
|
22
23
|
import type { GridColumnGroupHeader } from '../view/GridColumnGroupHeader.js';
|
|
24
|
+
import type { SearchSelectCellEditor } from '../editors/SearchSelectCellEditor.js';
|
|
23
25
|
import type { GridBodyLabelRow } from '../view/GridBodyLabelRow.js';
|
|
24
26
|
import type { GridBodyGroupRow } from '../view/GridBodyGroupRow.js';
|
|
25
27
|
import type { GridStickyLabelLayer } from '../view/GridStickyLabelLayer.js';
|
|
@@ -202,6 +204,7 @@ export type BodyContextMenuInput<T> = {
|
|
|
202
204
|
orderedColumns: GridColumn<T>[];
|
|
203
205
|
selection: GridSelection;
|
|
204
206
|
activeCell: CellCoord | null;
|
|
207
|
+
resolveRevertItems?: ((target: GridContextMenuTarget<T>, isTargetSelected: boolean) => GridContextMenuItem[]) | undefined;
|
|
205
208
|
};
|
|
206
209
|
export type CellContextMenuInput<T> = Omit<BodyContextMenuInput<T>, 'event'> & {
|
|
207
210
|
cell: CellCoord;
|
|
@@ -271,6 +274,14 @@ export type ReactGridFeatures = {
|
|
|
271
274
|
createColumnChooserDropClamp: typeof createColumnChooserDropClamp;
|
|
272
275
|
ColumnGroupHeader: typeof GridColumnGroupHeader;
|
|
273
276
|
} | undefined;
|
|
277
|
+
selectSearch?: FeatureLocaleDefaults & {
|
|
278
|
+
SearchSelectCellEditor: typeof SearchSelectCellEditor;
|
|
279
|
+
} | undefined;
|
|
280
|
+
changeTracking?: NonNullable<GridCoreFeatures['changeTracking']> & FeatureLocaleDefaults & {
|
|
281
|
+
describeUnsavedCell: typeof describeUnsavedCell;
|
|
282
|
+
formatUnsavedSummary: typeof formatUnsavedSummary;
|
|
283
|
+
buildRevertMenuItems: typeof buildRevertMenuItems;
|
|
284
|
+
} | undefined;
|
|
274
285
|
conditionalFormat?: NonNullable<GridCoreFeatures['conditionalFormat']> & ConditionalFormatCellResolvers & {
|
|
275
286
|
resolveChipSpec: typeof resolveChipSpec;
|
|
276
287
|
GridChip: typeof GridChip;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GlobalFilterStatus, GridColumn, GridSelectionAggregates, GridUiState, SpreadsheetGridSlotContext } from '../model/gridTypes.js';
|
|
1
|
+
import type { GlobalFilterStatus, GridChangesSummary, GridColumn, GridSelectionAggregates, GridUiState, SpreadsheetGridSlotContext } from '../model/gridTypes.js';
|
|
2
2
|
import type { ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText';
|
|
3
|
-
type GridSlotContextBase<T> = Omit<SpreadsheetGridSlotContext<T>, 'setGlobalFilterText' | 'derivedSummary' | 'filteredRows' | 'globalFilterStatus' | 'globalFilterProgress' | 'selectionAggregates'>;
|
|
3
|
+
type GridSlotContextBase<T> = Omit<SpreadsheetGridSlotContext<T>, 'setGlobalFilterText' | 'derivedSummary' | 'filteredRows' | 'globalFilterStatus' | 'globalFilterProgress' | 'selectionAggregates' | 'unsavedChanges'>;
|
|
4
4
|
type UseGridBarContextArgs<T> = {
|
|
5
5
|
rows: T[];
|
|
6
6
|
localeTexts: ResolvedGridLocaleText;
|
|
@@ -16,10 +16,11 @@ type UseGridBarContextArgs<T> = {
|
|
|
16
16
|
globalFilterStatus: GlobalFilterStatus;
|
|
17
17
|
globalFilterProgress: number;
|
|
18
18
|
selectionAggregates?: GridSelectionAggregates | null;
|
|
19
|
+
unsavedChanges?: GridChangesSummary | null;
|
|
19
20
|
filtersApplied?: boolean;
|
|
20
21
|
columnTitles?: ReadonlyMap<string, string> | null;
|
|
21
22
|
};
|
|
22
|
-
export declare const useGridBarContext: <T>({ rows, localeTexts, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, filtersApplied, columnTitles, }: UseGridBarContextArgs<T>) => {
|
|
23
|
+
export declare const useGridBarContext: <T>({ rows, localeTexts, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges, filtersApplied, columnTitles, }: UseGridBarContextArgs<T>) => {
|
|
23
24
|
slotContextBase: GridSlotContextBase<T>;
|
|
24
25
|
derivedSummary: import("@ishibashi0112/spreadsheet-grid-core").SpreadsheetGridDerivedSummary;
|
|
25
26
|
slotContext: SpreadsheetGridSlotContext<T>;
|
|
@@ -2,7 +2,7 @@ import { type EditController, type EditControllerArgs } from '@ishibashi0112/spr
|
|
|
2
2
|
export declare const useGridEditController: <T extends object>(args: EditControllerArgs<T>, created?: EditController<T>) => {
|
|
3
3
|
activateSingleCell: (cell: import("@ishibashi0112/spreadsheet-grid-core").CellCoord) => void;
|
|
4
4
|
startEditWithValue: (cell: import("@ishibashi0112/spreadsheet-grid-core").CellCoord, initialValue: string) => void;
|
|
5
|
-
commitEdit: (committedValue: unknown, direction?: import("@ishibashi0112/spreadsheet-grid-core").EditorCommitDirection) => import("@ishibashi0112/spreadsheet-grid-core").EditorCommitResult;
|
|
5
|
+
commitEdit: (committedValue: unknown, direction?: import("@ishibashi0112/spreadsheet-grid-core").EditorCommitDirection, option?: import("@ishibashi0112/spreadsheet-grid-core").GridSelectEditorOption, forwardText?: string) => import("@ishibashi0112/spreadsheet-grid-core").EditorCommitResult;
|
|
6
6
|
cancelEdit: () => void;
|
|
7
7
|
registerDraftFlush: (flush: (() => void) | null) => void;
|
|
8
8
|
};
|