@ishibashi0112/spreadsheet-grid 1.7.0 → 1.9.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.
Files changed (42) hide show
  1. package/API_REFERENCE.md +158 -19
  2. package/README.md +2 -2
  3. package/dist/CellEditorLayer.d.ts +2 -1
  4. package/dist/GridShell.d.ts +1 -1
  5. package/dist/common.d.ts +1 -1
  6. package/dist/features/changeTracking.d.ts +2 -0
  7. package/dist/features/treeData.d.ts +2 -0
  8. package/dist/features/types.d.ts +13 -1
  9. package/dist/hooks/useGridBarContext.d.ts +4 -3
  10. package/dist/index.cjs +9 -6
  11. package/dist/index.js +3073 -2709
  12. package/dist/lite/createSpreadsheetGrid-B8ove8hh.js +4857 -0
  13. package/dist/lite/createSpreadsheetGrid-M3WJSRoB.cjs +9 -0
  14. package/dist/lite/createSpreadsheetGrid.cjs +1 -1
  15. package/dist/lite/createSpreadsheetGrid.js +1 -1
  16. package/dist/lite/features/changeTracking.cjs +1 -0
  17. package/dist/lite/features/changeTracking.js +13 -0
  18. package/dist/lite/features/pinnedRows.cjs +1 -1
  19. package/dist/lite/features/pinnedRows.js +1 -1
  20. package/dist/lite/features/treeData.cjs +1 -0
  21. package/dist/lite/features/treeData.js +2 -0
  22. package/dist/lite/{pinnedRows-BtvLVkLa.js → pinnedRows-C0z2lLC4.js} +1 -0
  23. package/dist/lite/pinnedRows-CrwRr7W0.cjs +1 -0
  24. package/dist/lite/treeData-2RQEs57C.js +64 -0
  25. package/dist/lite/treeData-X3RTdPnL.cjs +1 -0
  26. package/dist/lite.cjs +1 -1
  27. package/dist/lite.d.ts +2 -0
  28. package/dist/lite.js +16 -14
  29. package/dist/style.css +1 -1
  30. package/dist/style.layer.css +1 -1
  31. package/dist/themes/astryx.css +3 -0
  32. package/dist/themes/heroui.css +3 -0
  33. package/dist/themes/mantine.css +5 -1
  34. package/dist/themes/shadcn.css +3 -0
  35. package/dist/view/DefaultGridBottomBar.d.ts +2 -1
  36. package/dist/view/GridBodyLayer.d.ts +14 -2
  37. package/dist/view/GridTreeCell.d.ts +16 -0
  38. package/package.json +2 -2
  39. package/skills/spreadsheet-grid/SKILL.md +4 -2
  40. package/dist/lite/createSpreadsheetGrid-B4_L9K--.cjs +0 -6
  41. package/dist/lite/createSpreadsheetGrid-BlYZzGf-.js +0 -4547
  42. package/dist/lite/pinnedRows-CBgirKjW.cjs +0 -1
@@ -10,17 +10,19 @@ 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';
23
24
  import type { SearchSelectCellEditor } from '../editors/SearchSelectCellEditor.js';
25
+ import type { GridTreeAggregateValue, GridTreeCellPrefix } from '../view/GridTreeCell.js';
24
26
  import type { GridBodyLabelRow } from '../view/GridBodyLabelRow.js';
25
27
  import type { GridBodyGroupRow } from '../view/GridBodyGroupRow.js';
26
28
  import type { GridStickyLabelLayer } from '../view/GridStickyLabelLayer.js';
@@ -203,6 +205,7 @@ export type BodyContextMenuInput<T> = {
203
205
  orderedColumns: GridColumn<T>[];
204
206
  selection: GridSelection;
205
207
  activeCell: CellCoord | null;
208
+ resolveRevertItems?: ((target: GridContextMenuTarget<T>, isTargetSelected: boolean) => GridContextMenuItem[]) | undefined;
206
209
  };
207
210
  export type CellContextMenuInput<T> = Omit<BodyContextMenuInput<T>, 'event'> & {
208
211
  cell: CellCoord;
@@ -275,6 +278,15 @@ export type ReactGridFeatures = {
275
278
  selectSearch?: FeatureLocaleDefaults & {
276
279
  SearchSelectCellEditor: typeof SearchSelectCellEditor;
277
280
  } | undefined;
281
+ changeTracking?: NonNullable<GridCoreFeatures['changeTracking']> & FeatureLocaleDefaults & {
282
+ describeUnsavedCell: typeof describeUnsavedCell;
283
+ formatUnsavedSummary: typeof formatUnsavedSummary;
284
+ buildRevertMenuItems: typeof buildRevertMenuItems;
285
+ } | undefined;
286
+ treeData?: NonNullable<GridCoreFeatures['treeData']> & FeatureLocaleDefaults & {
287
+ TreeCellPrefix: typeof GridTreeCellPrefix;
288
+ TreeAggregateValue: typeof GridTreeAggregateValue;
289
+ } | undefined;
278
290
  conditionalFormat?: NonNullable<GridCoreFeatures['conditionalFormat']> & ConditionalFormatCellResolvers & {
279
291
  resolveChipSpec: typeof resolveChipSpec;
280
292
  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>;