-
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
fixed layout
#2545
Open
shaneeza
wants to merge
123
commits into
table-refactor-integration
Choose a base branch
from
shaneeza/table-fixed
base: table-refactor-integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+79
−41
Open
Table
fixed layout
#2545
Changes from all commits
Commits
Show all changes
123 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 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 34a0055
add table-layout:fixed
shaneeza 7743700
make table fixed, fix shadow and aligment
shaneeza 4357b6d
line height
shaneeza 97de5f2
merge conflict
shaneeza f304b79
remove ?
shaneeza b541582
Merge branch 'shaneeza/table-sticky-shadow' of github.com:mongodb/lea…
shaneeza d7c5333
fix error
shaneeza 0cc8c50
fix broken stories
shaneeza cf14e8b
interaction rename and args
shaneeza 8cfbc88
story heights
shaneeza 7ef9651
merge conflict
shaneeza 3b47aff
Merge branch 'shaneeza/table-sticky-shadow' of github.com:mongodb/lea…
shaneeza 09f2332
merge conflict
shaneeza 4a2458e
revert row style changes
shaneeza 23cb494
update sizes
shaneeza 0970103
add comment
shaneeza dbd8b4b
update story
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,18 @@ export const getTableContainerStyles = (isVirtual = false) => | |
}, | ||
); | ||
|
||
export const getTableStyles = (theme: Theme, baseFontSize: BaseFontSize) => | ||
cx(baseStyles, themeStyles[theme], bodyTypeScaleStyles[baseFontSize]); | ||
export const getTableStyles = ( | ||
theme: Theme, | ||
baseFontSize: BaseFontSize, | ||
isVirtual = false, | ||
shouldTruncate = false, | ||
) => | ||
cx(baseStyles, themeStyles[theme], bodyTypeScaleStyles[baseFontSize], { | ||
[css` | ||
//TODO: add to documentation | ||
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. Will add in documentation PR |
||
// If this is a virtual table that does not truncate the table needs to have a fixed layout. | ||
// Without a fixed layout, column widths may change during scrolling, which can cause row heights to shift. This can lead to an infinite loop, ultimately crashing the application. 🙃 | ||
// A fixed layout prevents this because it prevents columns widths from changing. | ||
table-layout: fixed; | ||
`]: isVirtual && !shouldTruncate, | ||
}); |
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.
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.
curious why this is added? also seeing an explicit height set in
headerCellContentStyles
so wondering if only 1 is neededThere 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.
Rob asked me to add it - he felt the spacing could be tighter. I tried
1
, but it's tighter than16px
. Also, we don't have any tokens that match this line-height.