-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
CSS cleanups, fixes, and reimplementations #1780
Merged
Changes from 24 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
87c520c
Clean up a bit of the core css, and Header type
nstepien 1dd80a0
Row css cleanup
nstepien 0f4217b
Fix fragment id prop warning in dev mode
nstepien 4a1539a
context menu styling
nstepien f1831ae
Fix missing background color on frozen cells
nstepien 3274cdc
Use flex to align cells vertically, small optimizations
nstepien 68319b5
header cells = cells
nstepien 8f7b035
Use sticky position for frozen header cells as well
nstepien 847aaa4
Fix tests
nstepien f1bfc57
Editor styling
nstepien 0946abc
Fix tests
nstepien 8df3097
bit more padding
nstepien 39e3df2
small fixes
nstepien e551156
Merge remote-tracking branch 'origin/canary' into ns-css
nstepien 0b62bf3
Redo checkbox styling
nstepien d1d0632
Merge remote-tracking branch 'origin/canary' into ns-css
nstepien a798e63
Merge branch 'canary' into ns-css
nstepien a71bb68
Merge branch 'canary' into ns-css
nstepien 2655198
more draggable header cell fixes
nstepien 69e0d31
fix NumericFilter style
nstepien 9a2039b
Align cells vertically using line-height
nstepien 1c726b2
pull header sort arrows to the right
nstepien 6992bc7
Fix tests
nstepien 1733bf2
set line-height on the root
nstepien fae14e1
Couple cleanups
nstepien b24647b
rdg-cell
nstepien c7be8ee
more renaming
nstepien fe6abab
center filters again
nstepien 242f370
Add MUI icons package
nstepien ccb75df
Replace glyphicons
nstepien 644eb2a
harmonize frozen cell styles
nstepien 1616b74
Fix jest performance
nstepien 54d387d
Merge branch 'canary' into ns-css
nstepien 51bb092
Scroll the header as a whole, skip some refs
nstepien 5f6e2f6
Fix tests
nstepien ed99436
Fix sortable header cell text overflow
nstepien 10b0028
Fix tests
nstepien 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
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
39 changes: 39 additions & 0 deletions
39
packages/react-data-grid-addons/style/rdg-contextmenu.less
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.react-contextmenu { | ||
cursor: pointer; | ||
background-color: #fff; | ||
border: 1px solid #ddd; | ||
border-radius: 3px; | ||
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.24); | ||
|
||
font-size: 14px; | ||
line-height: 2; | ||
white-space: nowrap; | ||
|
||
> .react-contextmenu-item:not(:last-child) { | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
.react-contextmenu-submenu > & { | ||
margin-top: -1px; | ||
} | ||
} | ||
|
||
.react-contextmenu-item:not(.react-contextmenu-submenu) { | ||
padding: 0 12px; | ||
} | ||
|
||
.react-contextmenu-item--selected { | ||
background-color: darken(#fff, 4%); | ||
} | ||
|
||
.react-contextmenu-submenu > .react-contextmenu-item { | ||
&::after { | ||
content: "▶"; | ||
margin-left: 12px; | ||
margin-right: -6px; | ||
} | ||
|
||
&:not(.react-contextmenu-item--active) + .react-contextmenu { | ||
display: none; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
display: inline-block; | ||
height: 40px; | ||
width: 40px; | ||
} | ||
vertical-align: middle; | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/react-data-grid-addons/style/react-data-grid-addons.less
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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
@import 'rdg-contextmenu.less'; | ||
@import 'rdg-drop-target.less'; | ||
@import 'rdg-image.less'; | ||
@import 'rdg-toolbar.less'; | ||
|
||
.rdg-dragging { | ||
cursor: grabbing; | ||
} | ||
|
||
.rdg-draggable-header-cell { | ||
cursor: move; | ||
display: inline-block; | ||
height: inherit; | ||
background-color: inherit; | ||
} | ||
|
||
.rdg-can-drop { | ||
background-color: #ececec; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import React, { forwardRef, useRef, useState, useMemo, useImperativeHandle } from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
import HeaderRow from './HeaderRow'; | ||
import { getColumnMetrics } from './utils/columnUtils'; | ||
|
@@ -26,7 +25,6 @@ export interface HeaderProps<R> extends SharedDataGridProps<R> { | |
columnMetrics: ColumnMetrics<R>; | ||
headerRows: [HeaderRowData<R>, HeaderRowData<R> | undefined]; | ||
cellMetaData: CellMetaData<R>; | ||
rowOffsetHeight: number; | ||
onSort?(columnKey: keyof R, direction: DEFINE_SORT): void; | ||
onColumnResize(idx: number, width: number): void; | ||
} | ||
|
@@ -124,17 +122,12 @@ export default forwardRef(function Header<R>(props: HeaderProps<R>, ref: React.R | |
props.cellMetaData.onCellClick({ rowIdx: -1, idx: -1 }); | ||
} | ||
|
||
const className = classNames('react-grid-Header', { | ||
'react-grid-Header--resizing': resizing !== 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. no more this? 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. Doesn't look like we need it no. |
||
}); | ||
|
||
return ( | ||
<div | ||
className="rdg-header" | ||
style={{ | ||
height: props.rowOffsetHeight, | ||
paddingRight: getScrollbarSize() | ||
}} | ||
className={className} | ||
onClick={onHeaderClick} | ||
> | ||
{getHeaderRows()} | ||
|
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.
https://github.com/adazzle/react-data-grid/pull/1773/files/cba04c56c295e32fa3f036cb6cd9dbd5f8d5ec60#r333000852
Thoughts about removing this here? Since the style is touched, if we want to remove, I bet it's better in this PR. Or we keep it for revisiting.
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.
Let's do it in a separate PR.