This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-32
lines changed
Expand file tree Collapse file tree 3 files changed +26
-32
lines changed Original file line number Diff line number Diff line change @@ -243,20 +243,23 @@ export function Table(tableData: TableDataType) {
243243 const addColumnHeader = headerGroup . headers . find (
244244 ( h ) => h . id === MetadataColumns . ADD_COLUMN
245245 ) ;
246- console . log ( "headerGroup" ) ;
247246 return (
248247 < div
249248 key = { `${ headerGroup . id } -${ headerGroupIndex } ` }
250249 className = { `${ c ( "tr header-group" ) } ` }
251250 >
252251 { /** HEADER CONTEXT */ }
253- { < HeaderContextMenuWrapper { ...headerContext } /> }
252+ < HeaderContextMenuWrapper
253+ header = { headerContext }
254+ style = { {
255+ width : "30px" ,
256+ } }
257+ />
254258 { /** LIST OF COLUMNS */ }
255259 { headerGroup . headers
256260 . filter (
257261 ( h ) =>
258- h . id !== MetadataColumns . ROW_CONTEXT_MENU &&
259- h . id !== MetadataColumns . ADD_COLUMN
262+ ! [ headerContext . id , addColumnHeader . id ] . includes ( h . id )
260263 )
261264 . map (
262265 (
@@ -273,14 +276,7 @@ export function Table(tableData: TableDataType) {
273276 )
274277 ) }
275278 { /** ADD COLUMN HEADER*/ }
276- < div key = { `${ addColumnHeader . id } ` } className = { `${ c ( "th" ) } ` } >
277- { addColumnHeader . isPlaceholder
278- ? null
279- : flexRender (
280- addColumnHeader . column . columnDef . header ,
281- addColumnHeader . getContext ( )
282- ) }
283- </ div >
279+ < HeaderContextMenuWrapper header = { addColumnHeader } />
284280 </ div >
285281 ) ;
286282 }
Original file line number Diff line number Diff line change @@ -23,21 +23,18 @@ export default function HeaderContextMenu(
2323 enable_columns_filter : ! columnsFilterAreEnabled ,
2424 } ) ;
2525 } ;
26- console . log ( "HeaderContextMenu" ) ;
2726 return (
28- < Button
29- size = "small "
27+ < span
28+ className = "svg-icon svg-gray "
3029 onClick = { enableColumnsFilterHandler }
3130 key = { `Button-Enabled-DataviewFilters` }
32- style = { { minWidth : "0px " , padding : "2px" , borderRadius : "0px " } }
31+ style = { { width : "30px " , height : "100% " } }
3332 >
34- < span className = "svg-icon svg-gray" >
35- { columnsFilterAreEnabled ? (
36- < SearchOffIcon { ...MenuButtonStyle } />
37- ) : (
38- < ManageSearchIcon { ...MenuButtonStyle } />
39- ) }
40- </ span >
41- </ Button >
33+ { columnsFilterAreEnabled ? (
34+ < SearchOffIcon { ...MenuButtonStyle } fontSize = "small" />
35+ ) : (
36+ < ManageSearchIcon { ...MenuButtonStyle } fontSize = "small" />
37+ ) }
38+ </ span >
4239 ) ;
4340}
Original file line number Diff line number Diff line change 11import { flexRender , Header } from "@tanstack/react-table" ;
22import { RowDataType } from "cdm/FolderModel" ;
33import { c } from "helpers/StylesHelper" ;
4- import React from "react" ;
5-
6- export default function HeaderContextMenuWrapper (
7- header : Header < RowDataType , unknown >
8- ) {
9- console . log ( "HeaderContextMenuWrapper" ) ;
4+ import React , { HTMLAttributes , HTMLProps } from "react" ;
5+ interface HeaderWrapperProps extends React . HTMLAttributes < HTMLDivElement > {
6+ header : Header < RowDataType , unknown > ;
7+ }
8+ const HeaderContextMenuWrapper = ( { header, ...props } : HeaderWrapperProps ) => {
109 return (
11- < div key = { `${ header . id } ` } className = { `${ c ( "th" ) } ` } >
10+ < div key = { `${ header . id } ` } className = { `${ c ( "th" ) } ` } { ... props } >
1211 { header . isPlaceholder
1312 ? null
1413 : flexRender ( header . column . columnDef . header , header . getContext ( ) ) }
1514 </ div >
1615 ) ;
17- }
16+ } ;
17+
18+ export default HeaderContextMenuWrapper ;
You can’t perform that action at this time.
0 commit comments