-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow grouped table headers #769
Conversation
type Props< | ||
C extends ReadonlyArray<SimpleColumnType<string, {}, any>>, | ||
D extends ReadonlyArray<GroupedColumnType<string, {}, any>> | ||
> = { |
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.
@gabro I think this makes the PR breaking, but I'm not sure. What do you think?
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.
The types are 99% of the times inferred, so I would ignore it
f1945bf
to
e413f9d
Compare
type Props< | ||
C extends ReadonlyArray<SimpleColumnType<string, {}, any>>, | ||
D extends ReadonlyArray<GroupedColumnType<string, {}, any>> | ||
> = { |
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.
The types are 99% of the times inferred, so I would ignore it
[columns, headerGroups] | ||
headerGroups[0].headers | ||
.filter((h) => h.sticky) | ||
.flatMap((h) => h.columns || [h]) |
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.
.flatMap((h) => h.columns || [h]) | |
.flatMap((h) => h.columns ?? [h]) |
}} | ||
lastLeftSticky={ | ||
header.columns | ||
? header.id === stickyLeftColumnGroupsIds[stickyLeftColumnGroupsIds.length - 1] |
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.
? header.id === stickyLeftColumnGroupsIds[stickyLeftColumnGroupsIds.length - 1] | |
? header.id === stickyLeftColumnGroupsIds.at(-1) |
🪄
e413f9d
to
1ff9df8
Compare
Approved offline |
This PR adds support for grouped headers. The following options for simple headers are available:
sticky: "left"
, the whole group will be sticky, stickiness on singular columns will be ignored