-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(DataTable): add support for table row statuses #2073
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #2073 +/- ##
==========================================
+ Coverage 97.08% 97.10% +0.02%
==========================================
Files 111 111
Lines 2740 2766 +26
Branches 726 738 +12
==========================================
+ Hits 2660 2686 +26
Misses 77 77
Partials 3 3 ☔ View full report in Codecov by Sentry. |
size-limit report 📦
|
bc8ffc1
to
a357050
Compare
columnHelper.accessor(DataTable.__StatusColumnId__, { | ||
header: () => <DataTable.StatusHeaderCell />, | ||
cell: (info) => <DataTable.StatusCell status={info.getValue()} />, | ||
size: 32, |
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.
TODO add / use some token here?
style={{ | ||
width: `${header.getSize()}px`, | ||
}} | ||
<DataTableContext.Provider value={{ size }}> |
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.
Most of this diff is whitespace changes. Use the ⚙️ above to update the view to hide whitespace changes.
const columnWidth = | ||
header.getSize() !== 150 | ||
? `${header.getSize()}px` | ||
: undefined; |
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.
Need to investigate how TanStack Table sets the column width. .getSize
is always defined, and defaults to 150px. Marking this value as special here b/c all sizings will be based on token unit sizes (16 * x) and 150 doesn't land on one of those boundaries (... 144, 160, 176, ...)
export type { | ||
DataTableProps, | ||
DataTableRowProps, | ||
DataTableWithStatus, |
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.
Utility type for augmenting table model data with the details of the status type in the type object.
- component to support standard EDS statuses per row - update tests and snapshots (new story for comparison)
a357050
to
1ea5726
Compare
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.
looks good to me!
thanks @timzchang ! |
## [15.5.0](v15.4.1...v15.5.0) (2024-10-18) [Storybook](https://61313967cde49b003ae2a860-gtyxxzokxd.chromatic.com/) ### Features * **DataTable:** add support for table row statuses ([#2073](#2073)) ([c109f52](c109f52)) * re-export HeadlessUI's Transition component ([#2069](#2069)) ([a4a5fc8](a4a5fc8)) ### Bug Fixes * **DataTable:** fix cell size and border in FF ([#2072](#2072)) ([7ffbd56](7ffbd56)) * **Select:** remove label checks from component ([#2068](#2068)) ([8ede09d](8ede09d))
Test Plan: