@@ -23,7 +23,6 @@ import {
2323 DatabaseLimits ,
2424 MetadataColumns ,
2525 ResizeConfiguration ,
26- StyleVariables ,
2726} from "helpers/Constants" ;
2827import { LOGGER } from "services/Logger" ;
2928import DefaultCell from "components/DefaultCell" ;
@@ -32,6 +31,8 @@ import { c } from "helpers/StylesHelper";
3231import { HeaderNavBar } from "components/NavBar" ;
3332import TableHeader from "components/TableHeader" ;
3433import TableRow from "components/TableRow" ;
34+ import TableFooter from "components/TableFooter" ;
35+ import DefaultFooter from "components/DefaultFooter" ;
3536import getInitialColumnSizing from "components/behavior/InitialColumnSizeRecord" ;
3637import customSortingfns , {
3738 globalDatabaseFilterFn ,
@@ -44,14 +45,15 @@ import {
4445} from "components/obsidianArq/markdownLinks" ;
4546import HeaderContextMenuWrapper from "components/contextMenu/HeaderContextMenuWrapper" ;
4647import TableActions from "components/tableActions/TableActions" ;
47- import PaginationTable from ". /navbar/PaginationTable" ;
48+ import PaginationTable from "components /navbar/PaginationTable" ;
4849
4950const defaultColumn : Partial < ColumnDef < RowDataType > > = {
5051 minSize : DatabaseLimits . MIN_COLUMN_HEIGHT ,
5152 maxSize : DatabaseLimits . MAX_COLUMN_HEIGHT ,
5253 cell : DefaultCell ,
5354 header : DefaultHeader ,
5455 enableResizing : true ,
56+ footer : DefaultFooter ,
5557} ;
5658
5759/**
@@ -229,10 +231,7 @@ export function Table(tableData: TableDataType) {
229231 width : table . getCenterTotalSize ( ) ,
230232 } }
231233 >
232- < div
233- key = { `div-table-header-group-sticky` }
234- className = { c ( `table-header-group ${ "sticky-top" } ` ) }
235- >
234+ < div key = { `div-thead-sticky` } className = { c ( `thead sticky-top` ) } >
236235 { /* INIT HEADERS */ }
237236 { table
238237 . getHeaderGroups ( )
@@ -250,7 +249,7 @@ export function Table(tableData: TableDataType) {
250249 ) ;
251250 return (
252251 < div
253- key = { `${ headerGroup . id } -${ headerGroupIndex } ` }
252+ key = { `header-group- ${ headerGroup . id } -${ headerGroupIndex } ` }
254253 className = { `${ c ( "tr header-group" ) } ` }
255254 >
256255 { /** HEADER CONTEXT */ }
@@ -282,7 +281,7 @@ export function Table(tableData: TableDataType) {
282281 />
283282 )
284283 ) }
285- { /** ADD COLUMN HEADER*/ }
284+ { /** ADD COLUMN HEADER */ }
286285 < HeaderContextMenuWrapper header = { addColumnHeader } />
287286 </ div >
288287 ) ;
@@ -291,13 +290,7 @@ export function Table(tableData: TableDataType) {
291290 { /* ENDS HEADERS */ }
292291 </ div >
293292 { /* INIT BODY */ }
294-
295- < div
296- key = { `div-tbody` }
297- style = { {
298- display : "table-row-group" ,
299- } }
300- >
293+ < div key = { `div-tbody` } className = { c ( `tbody` ) } >
301294 { table . getRowModel ( ) . rows . map ( ( row : Row < RowDataType > ) => (
302295 < TableRow
303296 key = { `table-cell-${ row . index } ` }
@@ -307,6 +300,40 @@ export function Table(tableData: TableDataType) {
307300 ) ) }
308301 { /* ENDS BODY */ }
309302 </ div >
303+ { /* INIT FOOTER */ }
304+ { configInfo . getLocalSettings ( ) . enable_footer && (
305+ < div key = { `div-tfoot` } className = { c ( `tfoot` ) } >
306+ { table
307+ . getFooterGroups ( )
308+ . map (
309+ (
310+ footerGroup : HeaderGroup < RowDataType > ,
311+ footerGroupIndex : number
312+ ) => {
313+ return (
314+ < div
315+ key = { `footer-group-${ footerGroup . id } -${ footerGroupIndex } ` }
316+ className = { `${ c ( "tr footer-group" ) } ` }
317+ >
318+ { footerGroup . headers . map (
319+ (
320+ header : Header < RowDataType , TableColumn > ,
321+ headerIndex : number
322+ ) => (
323+ < TableFooter
324+ table = { table }
325+ header = { header }
326+ headerIndex = { headerIndex + 1 }
327+ />
328+ )
329+ ) }
330+ </ div >
331+ ) ;
332+ }
333+ ) }
334+ { /* ENDS FOOTER */ }
335+ </ div >
336+ ) }
310337 { /* ENDS TABLE */ }
311338 </ div >
312339 { /* ENDS SCROLL PANE */ }
0 commit comments