-
Notifications
You must be signed in to change notification settings - Fork 782
feat(Table): add footer
support to display column summary
#4194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3
Are you sure you want to change the base?
Changes from all commits
2e7f61f
69a7e95
5e70307
0b342f1
5bee32e
b34b78c
38928c8
2d1b670
918d25d
2c22061
9a4281d
5143846
6f70bd4
9ce2af8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ export default (options: Required<ModuleOptions>) => ({ | |
caption: 'sr-only', | ||
thead: 'relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:bottom-0 [&>tr]:after:h-px [&>tr]:after:bg-(--ui-border-accented)', | ||
tbody: 'divide-y divide-default [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:focus-visible:outline-primary', | ||
tfoot: 'relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:top-0 [&>tr]:after:h-px [&>tr]:after:bg-(--ui-border-accented) [&>tr>th]:empty:p-0 [&>tr>th]:empty:border-none', | ||
tr: 'data-[selected=true]:bg-elevated/50', | ||
th: 'px-4 py-3.5 text-sm text-highlighted text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0', | ||
td: 'p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0', | ||
|
@@ -25,6 +26,11 @@ export default (options: Required<ModuleOptions>) => ({ | |
thead: 'sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur' | ||
} | ||
}, | ||
stickyFooter: { | ||
true: { | ||
tfoot: 'sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this should go inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to control sticky footer and header individually, so table could have stuck header, but not footer or vice versa. I map prop.sticky to to separate variants on lines 209-210 |
||
} | ||
}, | ||
loading: { | ||
true: { | ||
thead: 'after:absolute after:bottom-0 after:inset-x-0 after:h-px' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind explaining the logic of this? Wouldn't it be simpler with
columns.value.map
? π€There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Columns can be multi-leveled to create few rows of table headers or footers. For example:
This traverses the list of columns, if it finds a footer definition, it stops and returns true, if it finds sub columns, it adds them to the list it needs to check. Not sure, how to accomplish this with map considering we don't know the depth of the tree.