@@ -132,83 +132,85 @@ export interface DataGridProps<R, SR = unknown, K extends Key = Key> extends Sha
132132 columns : readonly ColumnOrColumnGroup < NoInfer < R > , NoInfer < SR > > [ ] ;
133133 /** A function called for each rendered row that should return a plain key/value pair object */
134134 rows : readonly R [ ] ;
135- /**
136- * Rows to be pinned at the top of the rows view for summary, the vertical scroll bar will not scroll these rows.
137- */
135+ /** Rows pinned at the top of the grid for summary purposes */
138136 topSummaryRows ?: Maybe < readonly SR [ ] > ;
139- /**
140- * Rows to be pinned at the bottom of the rows view for summary, the vertical scroll bar will not scroll these rows.
141- */
137+ /** Rows pinned at the bottom of the grid for summary purposes */
142138 bottomSummaryRows ?: Maybe < readonly SR [ ] > ;
143- /** The getter should return a unique key for each row */
139+ /** Function to return a unique key/identifier for each row */
144140 rowKeyGetter ?: Maybe < ( row : NoInfer < R > ) => K > ;
141+ /** Callback triggered when rows are updated */
145142 onRowsChange ?: Maybe < ( rows : NoInfer < R > [ ] , data : RowsChangeData < NoInfer < R > , NoInfer < SR > > ) => void > ;
146143
147144 /**
148145 * Dimensions props
149146 */
150147 /**
151- * The height of each row in pixels
148+ * Height of each row in pixels
152149 * @default 35
153150 */
154151 rowHeight ?: Maybe < number | ( ( row : NoInfer < R > ) => number ) > ;
155152 /**
156- * The height of the header row in pixels
153+ * Height of the header row in pixels
157154 * @default 35
158155 */
159156 headerRowHeight ?: Maybe < number > ;
160157 /**
161- * The height of each summary row in pixels
158+ * Height of each summary row in pixels
162159 * @default 35
163160 */
164161 summaryRowHeight ?: Maybe < number > ;
165162
166163 /**
167164 * Feature props
168165 */
169- /** Set of selected row keys */
166+ /** A set of selected row keys */
170167 selectedRows ?: Maybe < ReadonlySet < K > > ;
171- /** Determines if row selection is disabled, per row */
168+ /** Function to determine if row selection is disabled for a specific row */
172169 isRowSelectionDisabled ?: Maybe < ( row : NoInfer < R > ) => boolean > ;
173170 /** Function called whenever row selection is changed */
174171 onSelectedRowsChange ?: Maybe < ( selectedRows : Set < NoInfer < K > > ) => void > ;
175- /** Used for multi column sorting */
172+ /** An array of sorted columns */
176173 sortColumns ?: Maybe < readonly SortColumn [ ] > ;
174+ /** Callback triggered when sorting changes */
177175 onSortColumnsChange ?: Maybe < ( sortColumns : SortColumn [ ] ) => void > ;
176+ /** Default options applied to all columns */
178177 defaultColumnOptions ?: Maybe < DefaultColumnOptions < NoInfer < R > , NoInfer < SR > > > ;
179178 onFill ?: Maybe < ( event : FillEvent < NoInfer < R > > ) => NoInfer < R > > ;
180179
181180 /**
182181 * Event props
183182 */
184- /** Function called whenever a cell is clicked */
183+ /** Callback triggered when a cell is clicked */
185184 onCellClick ?: Maybe <
186185 ( args : CellClickArgs < NoInfer < R > , NoInfer < SR > > , event : CellMouseEvent ) => void
187186 > ;
188- /** Function called whenever a cell is double clicked */
187+ /** Callback triggered when a cell is double- clicked */
189188 onCellDoubleClick ?: Maybe <
190189 ( args : CellClickArgs < NoInfer < R > , NoInfer < SR > > , event : CellMouseEvent ) => void
191190 > ;
192- /** Function called whenever a cell is right clicked */
191+ /** Callback triggered when a cell is right- clicked */
193192 onCellContextMenu ?: Maybe <
194193 ( args : CellClickArgs < NoInfer < R > , NoInfer < SR > > , event : CellMouseEvent ) => void
195194 > ;
195+ /** Callback triggered when a key is pressed in a cell */
196196 onCellKeyDown ?: Maybe <
197197 ( args : CellKeyDownArgs < NoInfer < R > , NoInfer < SR > > , event : CellKeyboardEvent ) => void
198198 > ;
199+ /** Callback triggered when a cell's content is copied */
199200 onCellCopy ?: Maybe <
200201 ( args : CellCopyEvent < NoInfer < R > , NoInfer < SR > > , event : CellClipboardEvent ) => void
201202 > ;
203+ /** Callback triggered when content is pasted into a cell */
202204 onCellPaste ?: Maybe <
203205 ( args : CellPasteEvent < NoInfer < R > , NoInfer < SR > > , event : CellClipboardEvent ) => NoInfer < R >
204206 > ;
205207 /** Function called whenever cell selection is changed */
206208 onSelectedCellChange ?: Maybe < ( args : CellSelectArgs < NoInfer < R > , NoInfer < SR > > ) => void > ;
207- /** Called when the grid is scrolled */
209+ /** Callback triggered when the grid is scrolled */
208210 onScroll ?: Maybe < ( event : React . UIEvent < HTMLDivElement > ) => void > ;
209- /** Called when a column is resized */
211+ /** Callback triggered when column is resized */
210212 onColumnResize ?: Maybe < ( column : CalculatedColumn < R , SR > , width : number ) => void > ;
211- /** Called when a column is reordered */
213+ /** Callback triggered when columns are reordered */
212214 onColumnsReorder ?: Maybe < ( sourceColumnKey : string , targetColumnKey : string ) => void > ;
213215
214216 /**
@@ -220,10 +222,16 @@ export interface DataGridProps<R, SR = unknown, K extends Key = Key> extends Sha
220222 /**
221223 * Miscellaneous
222224 */
225+ /** Custom renderers for cells, rows, and other components */
223226 renderers ?: Maybe < Renderers < NoInfer < R > , NoInfer < SR > > > ;
227+ /** Function to apply custom class names to rows */
224228 rowClass ?: Maybe < ( row : NoInfer < R > , rowIdx : number ) => Maybe < string > > ;
229+ /** Custom class name for the header row */
225230 headerRowClass ?: Maybe < string > ;
226- /** @default 'ltr' */
231+ /**
232+ * Text direction of the grid ('ltr' or 'rtl')
233+ * @default 'ltr'
234+ * */
227235 direction ?: Maybe < Direction > ;
228236 'data-testid' ?: Maybe < string > ;
229237 'data-cy' ?: Maybe < string > ;
0 commit comments