-
Notifications
You must be signed in to change notification settings - Fork 64
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
Table
column vertical alignment
#2547
Merged
shaneeza
merged 128 commits into
table-refactor-integration
from
shaneeza/table-column-vertical-alignment
Nov 22, 2024
Merged
Changes from all commits
Commits
Show all changes
128 commits
Select commit
Hold shift + click to select a range
5c393c7
wip
shaneeza 82f8e10
wip
shaneeza 8a87597
updating stories
shaneeza 1c9e15d
lg virtual item
shaneeza c1747ba
top styles
shaneeza efd7bf0
remove padding from TableBody
shaneeza 981d823
expanded row background color
shaneeza b2d94ba
removing stuff
shaneeza 7c81d49
row context
shaneeza 4a10d1a
memoizing stuff
shaneeza 55e5503
wip
shaneeza cf208fb
styled components
shaneeza cadf46f
comments
shaneeza fa7777e
more cleanup
shaneeza 55021a4
clean up
shaneeza c0bf556
comments
shaneeza c4dcada
wip, memoize regular table
shaneeza 26d5ff0
testing
shaneeza e8505d8
huh
shaneeza 75b42d1
why does this work?
shaneeza 90bf2ab
testing why nothing works
shaneeza c48994f
clean up
shaneeza 4b3ac8c
update virtual stories
shaneeza dd1f7f9
clean up
shaneeza be313d9
cleanup
shaneeza 3e77d51
row types
shaneeza 3046147
types
shaneeza 1486a8f
should truncate support
shaneeza 187cfe2
remove memo from useLeafyGreenVirtualTable
shaneeza 8daa4c4
remove unsed exports
shaneeza af75a49
merge conflict
shaneeza 3848ba5
add a new story
shaneeza 60d4ff1
widths and vertical align
shaneeza 9dd750d
dynamic ellipsis
shaneeza da227e3
comment
shaneeza 205ff31
combined components
shaneeza 23fdecc
cell generic type
shaneeza b530196
update types
shaneeza 6bb4c39
align styles
shaneeza d283f01
Merge branch 'main' of github.com:mongodb/leafygreen-ui into shaneeza…
shaneeza 9bbeb3c
Prerelease version packages 13.0.0-beta.0
shaneeza f3f1838
fix install error
shaneeza ddeec2d
Prerelease version packages 13.0.0-beta.1
shaneeza 53c1b2c
comment, wip
shaneeza 4059eeb
Merge branch 'main' of github.com:mongodb/leafygreen-ui into shaneeza…
shaneeza d8fdc80
Merge branch 'table-refactor-integration' of github.com:mongodb/leafy…
shaneeza 342708c
Merge branch 'shaneeza/table-memoized' of github.com:mongodb/leafygre…
shaneeza bcb7804
revert useLeafyGreenTable hook so its consistent with a virtual table
shaneeza a4a25f0
merge conflict
shaneeza c8cc460
add getItemKey
shaneeza a89ca4a
small fix
shaneeza ca150d9
stop mapping columns def
shaneeza 55fbe3e
testing
shaneeza 30517cf
debugging
shaneeza b5474aa
tbody updates
shaneeza d1571f0
css vars
shaneeza 9c78c25
add virtual context
shaneeza ece7167
remove comment
shaneeza 960be7b
remove measureElement from hook
shaneeza 36a02ee
row context updates
shaneeza d1fe64c
remove overflow from regular table
shaneeza a71ca53
updates virtual types
shaneeza 54b2cca
more TS docs
shaneeza ee73090
ts fixes
shaneeza 317f254
row TS docs
shaneeza d9bd8f7
TS docs stuff
shaneeza 5d70435
fix comment
shaneeza 52eaa5f
add react-intersection-observer
shaneeza 70d8399
wip
shaneeza 89dbb96
remove original from rowCopy
shaneeza f311b39
story clean up
shaneeza 59474ee
remove v10 and v11 adapter
shaneeza e16bbfb
remove react-virtual
shaneeza 252d969
cell styles
shaneeza 275805f
interrowwithRT style updates
shaneeza 1201b29
table styles
shaneeza b1c5af1
comment
shaneeza 6118304
comment
shaneeza a0e59b1
merge conflict
shaneeza e138a50
wip
shaneeza 20f4aa7
story with less rows
shaneeza d2d782d
move box-shadow to headerRow
shaneeza 94f3ebd
darken darkmode scroll shadow
shaneeza 9f82e9b
move styles
shaneeza 54efb57
Merge branch 'shaneeza/table-memoized' of github.com:mongodb/leafygre…
shaneeza 65897df
alignment
shaneeza cee55af
remove comment
shaneeza 56de09a
add test
shaneeza 4387ebd
remove comments
shaneeza 617860e
testing removing styled components
shaneeza a663b4c
add back styled
shaneeza 5cff7c4
diff react-intersection-observer version
shaneeza 7bae512
yarn lonk
shaneeza 21d4742
cell ternary, headercell util, expandedcontent styles
shaneeza c3568f4
fb - toggleExpand, isVirtual boolean, type casting, tsdocs
shaneeza 9dd632b
virtual scrolling padding util
shaneeza d1037c2
forgot to save
shaneeza 9366b3b
fb - remove virtual context
shaneeza 15ff06b
custom row model
shaneeza 06ecf7d
styledcomponent stuff, TS still not correct
shaneeza bbf5642
callable virtual items
shaneeza 6d86ca3
update ts docs
shaneeza 53792c0
token
shaneeza de6b74a
use classname
shaneeza 407af03
move interaction test
shaneeza deb0160
merge conflict
shaneeza 787300b
use a classname
shaneeza 8c32d84
remove id
shaneeza 44ccd73
merge conflict
shaneeza 97de5f2
merge conflict
shaneeza f304b79
remove ?
shaneeza 10294cc
Merge branch 'shaneeza/table-sticky-shadow' of github.com:mongodb/lea…
shaneeza 0cc8c50
fix broken stories
shaneeza cf14e8b
interaction rename and args
shaneeza 8cfbc88
story heights
shaneeza 7ef9651
merge conflict
shaneeza 99d748c
merge conflict
shaneeza 9e518b8
add back color
shaneeza a82ddf9
Merge branch 'table-refactor-integration' of github.com:mongodb/leafy…
shaneeza aa24f10
update stories
shaneeza a6ee472
remove InternalCell file
shaneeza e0c26d6
new story
shaneeza 7c7f942
fix row stories
shaneeza f9ca7dd
update rows stories
shaneeza 3a13fbc
revert some story changes
shaneeza 4de7e7b
revert some more story changes
shaneeza 46209e3
use classname
shaneeza 4fef4a6
revert some story changes
shaneeza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import { | |
import { StoryFn } from '@storybook/react'; | ||
|
||
import Button from '@leafygreen-ui/button'; | ||
import { css } from '@leafygreen-ui/emotion'; | ||
import LeafyGreenProvider from '@leafygreen-ui/leafygreen-provider'; | ||
import { DarkModeProps } from '@leafygreen-ui/lib'; | ||
|
||
|
@@ -33,21 +34,22 @@ import { | |
RowProps, | ||
} from '..'; | ||
|
||
// TODO: UPDATE ME | ||
|
||
const meta: StoryMetaType<typeof Row> = { | ||
title: 'Components/Table/Row', | ||
component: Row, | ||
argTypes: { | ||
virtualRow: { control: 'none' }, | ||
row: { control: 'none' }, | ||
className: { control: 'none' }, | ||
disabled: { control: 'boolean' }, | ||
}, | ||
parameters: { | ||
default: null, | ||
controls: { | ||
exclude: [...storybookExcludedControlParams, 'ref', 'children'], | ||
exclude: [ | ||
...storybookExcludedControlParams, | ||
'ref', | ||
'children', | ||
'row', | ||
'virtualRow', | ||
], | ||
}, | ||
chromatic: { | ||
disableSnapshot: true, | ||
|
@@ -61,18 +63,45 @@ const meta: StoryMetaType<typeof Row> = { | |
combineArgs: { | ||
darkMode: [false, true], | ||
disabled: [false, true], | ||
// @ts-ignore - this is a table prop | ||
shouldTruncate: [false, true], | ||
verticalAlignment: ['top', 'center'], | ||
}, | ||
args: { | ||
children: makeData(false, 1).map(rowData => | ||
Object.values(rowData).map(c => <Cell>{c}</Cell>), | ||
), | ||
}, | ||
excludeCombinations: [ | ||
{ | ||
// @ts-ignore - this is a table prop | ||
shouldTruncate: true, | ||
verticalAlignment: 'center', | ||
}, | ||
], | ||
decorator: (Instance, ctx) => { | ||
return ( | ||
<LeafyGreenProvider darkMode={ctx?.args.darkMode}> | ||
<Table> | ||
<Table | ||
shouldTruncate={ctx?.args.shouldTruncate} | ||
verticalAlignment={ctx?.args.verticalAlignment} | ||
> | ||
<TableBody> | ||
<Instance /> | ||
<Instance> | ||
<Cell | ||
className={css` | ||
width: 60px; | ||
`} | ||
> | ||
1 | ||
</Cell> | ||
<Cell | ||
className={css` | ||
width: 200px; | ||
`} | ||
> | ||
Est mollitia laborum dolores dolorem corporis explicabo | ||
nobis enim omnis. Minima excepturi accusantium iure culpa. | ||
</Cell> | ||
<Cell>MongoDB</Cell> | ||
<Cell>7.85</Cell> | ||
<Cell>Complicated</Cell> | ||
</Instance> | ||
</TableBody> | ||
</Table> | ||
</LeafyGreenProvider> | ||
|
@@ -242,7 +271,6 @@ DisabledClickableRows.args = { | |
export const DisabledSelectableRows: StoryFn< | ||
RowProps<Person> & DarkModeProps | ||
> = ({ darkMode, ...args }: DarkModeProps & RowProps<Person>) => { | ||
const tableContainerRef = React.useRef<HTMLDivElement>(null); | ||
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. why is this removed? 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. It's not necessary for a regular table |
||
const data = React.useState(() => makeData(false, 100))[0]; | ||
const [rowSelection, setRowSelection] = React.useState({}); | ||
|
||
|
@@ -326,7 +354,6 @@ export const DisabledSelectableRows: StoryFn< | |
<Table | ||
darkMode={darkMode} | ||
table={table} | ||
ref={tableContainerRef} | ||
data-total-rows={table.getRowModel().rows.length} | ||
> | ||
<TableHead> | ||
|
@@ -371,4 +398,8 @@ DisabledSelectableRows.argTypes = { | |
darkMode: storybookArgTypes.darkMode, | ||
}; | ||
|
||
DisabledSelectableRows.args = { | ||
disabled: true, | ||
}; | ||
|
||
export const Generated = () => <></>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: lately, I've been consuming
@leafygreen-ui/emotion
only in the*.styles.ts
file and passing all variables includingclassName
into the style function. In this case, you end up with something likegetCellStyles(className, verticalAlignment)
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.
I like this pattern. However, I'm going to keep it as is. If I have extra time, I'll go back and update all table styles to match this pattern.