File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
components/QueryResultTable Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const TABLE_SETTINGS: Settings = {
2121 ...DEFAULT_TABLE_SETTINGS ,
2222 stripedRows : true ,
2323 sortable : false ,
24+ displayIndices : true ,
2425} ;
2526
2627export const b = cn ( 'ydb-query-result-table' ) ;
@@ -69,6 +70,9 @@ const prepareGenericColumns = (data: KeyValueRow[]) => {
6970
7071const getRowIndex = ( _ : unknown , index : number ) => index ;
7172
73+ // Display row number in format 1-10 instead of 0-9
74+ const getVisibleRowIndex = ( _ : unknown , index : number ) => index + 1 ;
75+
7276interface QueryResultTableProps
7377 extends Omit < ResizeableDataTableProps < KeyValueRow > , 'data' | 'columns' > {
7478 data ?: KeyValueRow [ ] ;
@@ -100,6 +104,7 @@ export const QueryResultTable = (props: QueryResultTableProps) => {
100104 settings = { TABLE_SETTINGS }
101105 // prevent accessing row.id in case it is present but is not the PK (i.e. may repeat)
102106 rowKey = { getRowIndex }
107+ visibleRowIndex = { getVisibleRowIndex }
103108 { ...restProps }
104109 />
105110 ) ;
Original file line number Diff line number Diff line change 8383 max-width : 600px ;
8484
8585 cursor : pointer ;
86+ vertical-align : middle ;
8687 white-space : nowrap ;
8788 text-overflow : ellipsis ;
8889}
You can’t perform that action at this time.
0 commit comments