@xcelsior/ui-spreadsheets 1.1.4 → 1.1.6

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,5 +1,5 @@
1
1
 
2
- > @xcelsior/ui-spreadsheets@1.0.14 build /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
2
+ > @xcelsior/ui-spreadsheets@1.1.4 build /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
3
3
  > tsup && tsc --noEmit
4
4
 
5
5
  CLI Building entry: src/index.ts, src/styles/globals.css
@@ -11,18 +11,18 @@
11
11
  CJS Build start
12
12
  ESM Build start
13
13
  DTS Build start
14
- ESM dist/index.mjs 147.76 KB
15
- ESM dist/styles/globals.css 33.17 KB
16
- ESM dist/styles/globals.css.map 55.33 KB
17
- ESM dist/index.mjs.map 4.62 MB
18
- ESM ⚡️ Build success in 359ms
19
- CJS dist/styles/globals.css 33.17 KB
20
- CJS dist/index.js 158.96 KB
21
- CJS dist/styles/globals.css.map 55.33 KB
22
- CJS dist/index.js.map 4.62 MB
23
- CJS ⚡️ Build success in 360ms
24
- DTS ⚡️ Build success in 2017ms
14
+ CJS dist/styles/globals.css 33.16 KB
15
+ CJS dist/index.js 173.50 KB
16
+ CJS dist/styles/globals.css.map 55.29 KB
17
+ CJS dist/index.js.map 4.65 MB
18
+ CJS ⚡️ Build success in 397ms
19
+ ESM dist/styles/globals.css 33.16 KB
20
+ ESM dist/index.mjs 162.16 KB
21
+ ESM dist/styles/globals.css.map 55.29 KB
22
+ ESM dist/index.mjs.map 4.65 MB
23
+ ESM ⚡️ Build success in 396ms
24
+ DTS ⚡️ Build success in 2168ms
25
25
  DTS dist/styles/globals.d.ts 13.00 B
26
- DTS dist/index.d.ts 22.84 KB
26
+ DTS dist/index.d.ts 26.27 KB
27
27
  DTS dist/styles/globals.d.mts 13.00 B
28
- DTS dist/index.d.mts 22.84 KB
28
+ DTS dist/index.d.mts 26.27 KB
@@ -1,6 +1,6 @@
1
1
 
2
- > @xcelsior/ui-spreadsheets@1.0.14 lint /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
3
- > biome check . && tsc
2
+ > @xcelsior/ui-spreadsheets@1.1.4 lint /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
3
+ > biome check . && tsc --noEmit
4
4
 
5
5
   at src/components/CommentModals.tsx:57:21 ]8;;https://biomejs.dev/linter/rules/no-autofocus\lint/a11y/noAutofocus]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6
6
 
@@ -22,102 +22,42 @@
22
22
     59  58 │                   <div className="flex justify-end gap-2 mt-4">
23
23
   
24
24
  
25
-  at src/components/Spreadsheet.stories.tsx:333:34 ]8;;https://biomejs.dev/linter/rules/no-unused-function-parameters\lint/correctness/noUnusedFunctionParameters]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
-
27
-  ⚠ This parameter is unused.
28
-  
29
-   331 │         };
30
-   332 │ 
31
-  > 333 │         const handleRowDelete = (row: User, rowId: string | number) => {
32
-      │                                  ^^^
33
-   334 │             setData((prev) => prev.filter((r) => r.id !== rowId));
34
-   335 │         };
35
-  
36
-  ℹ Unused parameters might be the result of an incomplete refactoring.
37
-  
38
-  ℹ Unsafe fix: If this is intentional, prepend row with an underscore.
39
-  
40
-    331  331 │           };
41
-    332  332 │   
42
-    333      │ - ········const·handleRowDelete·=·(row:·User,·rowId:·string·|·number)·=>·{
43
-         333 │ + ········const·handleRowDelete·=·(_row:·User,·rowId:·string·|·number)·=>·{
44
-    334  334 │               setData((prev) => prev.filter((r) => r.id !== rowId));
45
-    335  335 │           };
46
-  
47
- 
48
-  at src/components/Spreadsheet.stories.tsx:385:34 ]8;;https://biomejs.dev/linter/rules/no-unused-function-parameters\lint/correctness/noUnusedFunctionParameters]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
49
-
50
-  ⚠ This parameter is unused.
51
-  
52
-   383 │         };
53
-   384 │ 
54
-  > 385 │         const handleRowDelete = (row: User, rowId: string | number) => {
55
-      │                                  ^^^
56
-   386 │             setData((prev) => prev.filter((r) => r.id !== rowId));
57
-   387 │         };
58
-  
59
-  ℹ Unused parameters might be the result of an incomplete refactoring.
60
-  
61
-  ℹ Unsafe fix: If this is intentional, prepend row with an underscore.
62
-  
63
-    383  383 │           };
64
-    384  384 │   
65
-    385      │ - ········const·handleRowDelete·=·(row:·User,·rowId:·string·|·number)·=>·{
66
-         385 │ + ········const·handleRowDelete·=·(_row:·User,·rowId:·string·|·number)·=>·{
67
-    386  386 │               setData((prev) => prev.filter((r) => r.id !== rowId));
68
-    387  387 │           };
69
-  
70
- 
71
-  at src/components/Spreadsheet.tsx:829:49 ]8;;https://biomejs.dev/linter/rules/use-key-with-click-events\lint/a11y/useKeyWithClickEvents]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
25
+  at src/components/Spreadsheet.tsx:845:45 ]8;;https://biomejs.dev/linter/rules/use-key-with-click-events\lint/a11y/useKeyWithClickEvents]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72
26
 
73
27
   ⚠ Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
74
28
   
75
-   827 │                                             {/* Row Index Column */}
76
-   828 │                                             {effectiveShowRowIndex && (
77
-  > 829 │                                                 <td
78
-      │                                                 ^^^
79
-  > 830 │                                                     onClick={(e) => handleRowSelect(rowId, e)}
29
+   843 │                                         >
30
+   844 │                                             {/* Row Index Column */}
31
+  > 845 │                                             <td
32
+      │                                             ^^^
33
+  > 846 │                                                 onClick={(e) => handleRowSelect(rowId, e)}
80
34
       ...
81
-  > 856 │                                                     }}
82
-  > 857 │                                                 >
83
-      │                                                 ^
84
-   858 │                                                     <div className="relative flex items-center justify-center">
85
-   859 │                                                         {/* Row number - always centered */}
35
+  > 874 │                                                 }}
36
+  > 875 │                                             >
37
+      │                                             ^
38
+   876 │                                                 <div className="relative flex items-center justify-center w-full h-full">
39
+   877 │                                                     {/* Row number - centered */}
86
40
   
87
41
   ℹ Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
88
42
   
89
43
  
90
-  at src/components/Spreadsheet.tsx:27:15 ]8;;https://biomejs.dev/linter/rules/no-unused-imports\lint/correctness/noUnusedImports]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
44
+  at src/components/Spreadsheet.tsx:29:15 ]8;;https://biomejs.dev/linter/rules/no-unused-imports\lint/correctness/noUnusedImports]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
91
45
 
92
46
   ⚠ Several of these imports are unused.
93
47
   
94
-   25 │ import { useSpreadsheetKeyboardShortcuts } from '../hooks/useSpreadsheetKeyboardShortcuts';
95
-   26 │ import { useSpreadsheetSelection } from '../hooks/useSpreadsheetSelection';
96
-  > 27 │ import type { CellEdit, CellPosition, SpreadsheetProps } from '../types';
97
-     │               ^^^^^^^^^^^^^^^^^^^^^^
98
-   28 │ 
99
-   29 │ type SingleCellEdit = {
48
+   27 │ import { useSpreadsheetKeyboardShortcuts } from '../hooks/useSpreadsheetKeyboardShortcuts';
49
+   28 │ import { useSpreadsheetSelection } from '../hooks/useSpreadsheetSelection';
50
+  > 29 │ import type { CellEdit, SpreadsheetProps } from '../types';
51
+     │               ^^^^^^^^
52
+   30 │ 
53
+   31 │ type SingleCellEdit = {
100
54
   
101
55
   ℹ Unused imports might be the result of an incomplete refactoring.
102
56
   
103
57
   ℹ Unsafe fix: Remove the unused imports.
104
58
   
105
-   27 │ import·type·{·CellEdit,·CellPosition,·SpreadsheetProps·}·from·'../types';
106
-   │               ------------------------                                   
107
- 
108
-  at src/components/Spreadsheet.tsx:329:9 ]8;;https://biomejs.dev/linter/rules/no-unused-variables\lint/correctness/noUnusedVariables]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109
-
110
-  ⚠ This variable setFocusedCell is unused.
111
-  
112
-   327 │     const {
113
-   328 │         focusedCell,
114
-  > 329 │         setFocusedCell,
115
-      │         ^^^^^^^^^^^^^^
116
-   330 │         editingCell,
117
-   331 │         setEditingCell,
118
-  
119
-  ℹ Unused variables are often the result of typos, incomplete refactors, or other sources of bugs.
120
-  
59
+   29 │ import·type·{·CellEdit,·SpreadsheetProps·}·from·'../types';
60
+   │               ----------                                   
121
61
  
122
62
   at src/components/SpreadsheetCell.tsx:54:5 ]8;;https://biomejs.dev/linter/rules/no-unused-function-parameters\lint/correctness/noUnusedFunctionParameters]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
123
63
 
@@ -192,5 +132,54 @@
192
132
    604 604 │   
193
133
   
194
134
  
195
- Checked 31 files in 18ms. No fixes applied.
196
- Found 10 warnings.
135
+  at src/components/Spreadsheet.stories.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
+
137
+  ✖ Formatter would have printed the following content:
138
+  
139
+    489  489 │                   icon: <HiEye className="h-4 w-4" />,
140
+    490  490 │                   onClick: (row) => {
141
+    491      │ - ····················alert(`Viewing·user:·${row.name}\nEmail:·${row.email}\nDepartment:·${row.department}`);
142
+         491 │ + ····················alert(
143
+         492 │ + ························`Viewing·user:·${row.name}\nEmail:·${row.email}\nDepartment:·${row.department}`
144
+         493 │ + ····················);
145
+    492  494 │                   },
146
+    493  495 │               },
147
+   ········· │
148
+    533  535 │                   <div className="mb-4 text-sm text-gray-600">
149
+    534  536 │                       <p className="font-medium mb-2">Row Context Menu Example</p>
150
+    535      │ - ····················<p>Hover·over·a·row·and·click·the·3-dot·icon·(⋮)·to·see·the·context·menu·with·actions.</p>
151
+    536      │ - ····················<p·className="text-xs·mt-1·text-gray-500">Note:·Delete·is·only·visible·for·non-Active·users.</p>
152
+         537 │ + ····················<p>
153
+         538 │ + ························Hover·over·a·row·and·click·the·3-dot·icon·(⋮)·to·see·the·context·menu·with
154
+         539 │ + ························actions.
155
+         540 │ + ····················</p>
156
+         541 │ + ····················<p·className="text-xs·mt-1·text-gray-500">
157
+         542 │ + ························Note:·Delete·is·only·visible·for·non-Active·users.
158
+         543 │ + ····················</p>
159
+    537  544 │                   </div>
160
+    538  545 │                   <Spreadsheet
161
+  
162
+ 
163
+  at src/components/Spreadsheet.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
164
+
165
+  ✖ Formatter would have printed the following content:
166
+  
167
+    887  887 │                                                                       rowId={rowId}
168
+    888  888 │                                                                       items={rowContextMenuItems}
169
+    889      │ - ····································································compactMode={effectiveCompactMode}
170
+         889 │ + ····································································compactMode={
171
+         890 │ + ········································································effectiveCompactMode
172
+         891 │ + ····································································}
173
+    890  892 │                                                                   />
174
+    891  893 │                                                               )}
175
+  
176
+ 
177
+ Checked 31 files in 25ms. No fixes applied.
178
+ Found 2 errors.
179
+ Found 7 warnings.
180
+ check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
181
+
182
+  ✖ Some errors were emitted while running checks.
183
+  
184
+ 
185
+  ELIFECYCLE  Command failed with exit code 1.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @xcelsior/ui-spreadsheets
2
2
 
3
+ ## 1.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 8db1f10: improve row context menu
8
+ - Updated dependencies [8db1f10]
9
+ - @xcelsior/design-system@1.0.8
10
+
3
11
  ## 1.0.15
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -247,6 +247,28 @@ interface RowAction<T = any> {
247
247
  /** Custom className */
248
248
  className?: string;
249
249
  }
250
+ /**
251
+ * Row context menu item configuration
252
+ * Used for the 3-dot menu that appears on row hover
253
+ */
254
+ interface RowContextMenuItem<T = any> {
255
+ /** Unique identifier */
256
+ id: string;
257
+ /** Display label for the menu item */
258
+ label: string;
259
+ /** Icon component to display next to the label */
260
+ icon?: React$1.ReactNode;
261
+ /** Callback when menu item is clicked */
262
+ onClick: (row: T, rowId: string | number) => void;
263
+ /** Whether the menu item is visible */
264
+ visible?: (row: T) => boolean;
265
+ /** Whether the menu item is disabled */
266
+ disabled?: (row: T) => boolean;
267
+ /** Variant for styling (e.g., destructive for delete actions) */
268
+ variant?: 'default' | 'destructive';
269
+ /** Custom className */
270
+ className?: string;
271
+ }
250
272
  /**
251
273
  * Props for the main Spreadsheet component
252
274
  */
@@ -271,10 +293,6 @@ interface SpreadsheetProps<T = any> {
271
293
  onRowClick?: (row: T, rowIndex: number) => void;
272
294
  /** Callback for row double click */
273
295
  onRowDoubleClick?: (row: T, rowIndex: number) => void;
274
- /** Callback when a row is cloned/duplicated */
275
- onRowClone?: (row: T, rowId: string | number) => void;
276
- /** Callback when a row is deleted */
277
- onRowDelete?: (row: T, rowId: string | number) => void;
278
296
  /** Callback when a cell comment is added */
279
297
  onAddCellComment?: (rowId: string | number, columnId: string, comment: string) => void;
280
298
  /** Callback when a comment's resolved status is toggled */
@@ -343,6 +361,12 @@ interface SpreadsheetProps<T = any> {
343
361
  cellComments?: CellComment[];
344
362
  /** Custom row actions to display in the index column */
345
363
  rowActions?: RowAction<T>[];
364
+ /**
365
+ * Context menu items to display in the 3-dot menu for each row.
366
+ * These appear in a dropdown when the user clicks the 3-dot icon on row hover.
367
+ * Use this for actions like clone, delete, view, edit, etc.
368
+ */
369
+ rowContextMenuItems?: RowContextMenuItem<T>[];
346
370
  /** Custom menu items to display in the toolbar's "More" dropdown menu */
347
371
  toolbarMenuItems?: ToolbarMenuItem[];
348
372
  /**
@@ -630,7 +654,7 @@ interface SpreadsheetColumnGroupHeaderProps {
630
654
  * />
631
655
  * ```
632
656
  */
633
- declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onRowClone, onRowDelete, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
657
+ declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, rowContextMenuItems, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
634
658
  declare namespace Spreadsheet {
635
659
  var displayName: string;
636
660
  }
@@ -740,4 +764,25 @@ interface SpreadsheetSettingsModalProps {
740
764
  */
741
765
  declare const SpreadsheetSettingsModal: React.FC<SpreadsheetSettingsModalProps>;
742
766
 
743
- export { type CellComment, type CellEdit, type CellHighlight, type CellPosition, type CellRange, type PaginationState, type RowAction, type SelectionEdge, type SelectionState, Spreadsheet, MemoizedSpreadsheetCell as SpreadsheetCell, type SpreadsheetCellProps, type SpreadsheetColumn, type SpreadsheetColumnFilter, type SpreadsheetColumnGroup, type SpreadsheetColumnGroupHeaderProps, SpreadsheetFilterDropdown, type SpreadsheetFilterDropdownProps, SpreadsheetHeader, type SpreadsheetHeaderProps, type SpreadsheetProps, type SpreadsheetSettings, SpreadsheetSettingsModal, type SpreadsheetSortConfig, type SpreadsheetState, SpreadsheetToolbar, type SpreadsheetToolbarProps, type ToolbarMenuItem };
767
+ interface RowContextMenuProps<T = any> {
768
+ /** The row data */
769
+ row: T;
770
+ /** The row ID */
771
+ rowId: string | number;
772
+ /** Menu items to display */
773
+ items: RowContextMenuItem<T>[];
774
+ /** Whether compact mode is enabled */
775
+ compactMode?: boolean;
776
+ /** Custom className for the trigger button */
777
+ className?: string;
778
+ }
779
+ /**
780
+ * RowContextMenu component - A 3-dot menu that appears on row hover
781
+ * Displays a dropdown with action items (icons + text)
782
+ */
783
+ declare function RowContextMenu<T>({ row, rowId, items, compactMode, className, }: RowContextMenuProps<T>): react_jsx_runtime.JSX.Element | null;
784
+ declare namespace RowContextMenu {
785
+ var displayName: string;
786
+ }
787
+
788
+ export { type CellComment, type CellEdit, type CellHighlight, type CellPosition, type CellRange, type PaginationState, type RowAction, RowContextMenu, type RowContextMenuItem, type SelectionEdge, type SelectionState, Spreadsheet, MemoizedSpreadsheetCell as SpreadsheetCell, type SpreadsheetCellProps, type SpreadsheetColumn, type SpreadsheetColumnFilter, type SpreadsheetColumnGroup, type SpreadsheetColumnGroupHeaderProps, SpreadsheetFilterDropdown, type SpreadsheetFilterDropdownProps, SpreadsheetHeader, type SpreadsheetHeaderProps, type SpreadsheetProps, type SpreadsheetSettings, SpreadsheetSettingsModal, type SpreadsheetSortConfig, type SpreadsheetState, SpreadsheetToolbar, type SpreadsheetToolbarProps, type ToolbarMenuItem };
package/dist/index.d.ts CHANGED
@@ -247,6 +247,28 @@ interface RowAction<T = any> {
247
247
  /** Custom className */
248
248
  className?: string;
249
249
  }
250
+ /**
251
+ * Row context menu item configuration
252
+ * Used for the 3-dot menu that appears on row hover
253
+ */
254
+ interface RowContextMenuItem<T = any> {
255
+ /** Unique identifier */
256
+ id: string;
257
+ /** Display label for the menu item */
258
+ label: string;
259
+ /** Icon component to display next to the label */
260
+ icon?: React$1.ReactNode;
261
+ /** Callback when menu item is clicked */
262
+ onClick: (row: T, rowId: string | number) => void;
263
+ /** Whether the menu item is visible */
264
+ visible?: (row: T) => boolean;
265
+ /** Whether the menu item is disabled */
266
+ disabled?: (row: T) => boolean;
267
+ /** Variant for styling (e.g., destructive for delete actions) */
268
+ variant?: 'default' | 'destructive';
269
+ /** Custom className */
270
+ className?: string;
271
+ }
250
272
  /**
251
273
  * Props for the main Spreadsheet component
252
274
  */
@@ -271,10 +293,6 @@ interface SpreadsheetProps<T = any> {
271
293
  onRowClick?: (row: T, rowIndex: number) => void;
272
294
  /** Callback for row double click */
273
295
  onRowDoubleClick?: (row: T, rowIndex: number) => void;
274
- /** Callback when a row is cloned/duplicated */
275
- onRowClone?: (row: T, rowId: string | number) => void;
276
- /** Callback when a row is deleted */
277
- onRowDelete?: (row: T, rowId: string | number) => void;
278
296
  /** Callback when a cell comment is added */
279
297
  onAddCellComment?: (rowId: string | number, columnId: string, comment: string) => void;
280
298
  /** Callback when a comment's resolved status is toggled */
@@ -343,6 +361,12 @@ interface SpreadsheetProps<T = any> {
343
361
  cellComments?: CellComment[];
344
362
  /** Custom row actions to display in the index column */
345
363
  rowActions?: RowAction<T>[];
364
+ /**
365
+ * Context menu items to display in the 3-dot menu for each row.
366
+ * These appear in a dropdown when the user clicks the 3-dot icon on row hover.
367
+ * Use this for actions like clone, delete, view, edit, etc.
368
+ */
369
+ rowContextMenuItems?: RowContextMenuItem<T>[];
346
370
  /** Custom menu items to display in the toolbar's "More" dropdown menu */
347
371
  toolbarMenuItems?: ToolbarMenuItem[];
348
372
  /**
@@ -630,7 +654,7 @@ interface SpreadsheetColumnGroupHeaderProps {
630
654
  * />
631
655
  * ```
632
656
  */
633
- declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onRowClone, onRowDelete, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
657
+ declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, rowContextMenuItems, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
634
658
  declare namespace Spreadsheet {
635
659
  var displayName: string;
636
660
  }
@@ -740,4 +764,25 @@ interface SpreadsheetSettingsModalProps {
740
764
  */
741
765
  declare const SpreadsheetSettingsModal: React.FC<SpreadsheetSettingsModalProps>;
742
766
 
743
- export { type CellComment, type CellEdit, type CellHighlight, type CellPosition, type CellRange, type PaginationState, type RowAction, type SelectionEdge, type SelectionState, Spreadsheet, MemoizedSpreadsheetCell as SpreadsheetCell, type SpreadsheetCellProps, type SpreadsheetColumn, type SpreadsheetColumnFilter, type SpreadsheetColumnGroup, type SpreadsheetColumnGroupHeaderProps, SpreadsheetFilterDropdown, type SpreadsheetFilterDropdownProps, SpreadsheetHeader, type SpreadsheetHeaderProps, type SpreadsheetProps, type SpreadsheetSettings, SpreadsheetSettingsModal, type SpreadsheetSortConfig, type SpreadsheetState, SpreadsheetToolbar, type SpreadsheetToolbarProps, type ToolbarMenuItem };
767
+ interface RowContextMenuProps<T = any> {
768
+ /** The row data */
769
+ row: T;
770
+ /** The row ID */
771
+ rowId: string | number;
772
+ /** Menu items to display */
773
+ items: RowContextMenuItem<T>[];
774
+ /** Whether compact mode is enabled */
775
+ compactMode?: boolean;
776
+ /** Custom className for the trigger button */
777
+ className?: string;
778
+ }
779
+ /**
780
+ * RowContextMenu component - A 3-dot menu that appears on row hover
781
+ * Displays a dropdown with action items (icons + text)
782
+ */
783
+ declare function RowContextMenu<T>({ row, rowId, items, compactMode, className, }: RowContextMenuProps<T>): react_jsx_runtime.JSX.Element | null;
784
+ declare namespace RowContextMenu {
785
+ var displayName: string;
786
+ }
787
+
788
+ export { type CellComment, type CellEdit, type CellHighlight, type CellPosition, type CellRange, type PaginationState, type RowAction, RowContextMenu, type RowContextMenuItem, type SelectionEdge, type SelectionState, Spreadsheet, MemoizedSpreadsheetCell as SpreadsheetCell, type SpreadsheetCellProps, type SpreadsheetColumn, type SpreadsheetColumnFilter, type SpreadsheetColumnGroup, type SpreadsheetColumnGroupHeaderProps, SpreadsheetFilterDropdown, type SpreadsheetFilterDropdownProps, SpreadsheetHeader, type SpreadsheetHeaderProps, type SpreadsheetProps, type SpreadsheetSettings, SpreadsheetSettingsModal, type SpreadsheetSortConfig, type SpreadsheetState, SpreadsheetToolbar, type SpreadsheetToolbarProps, type ToolbarMenuItem };