Fix header columns being misaligned with table columns in item tree

And reindent _virtualized-table.scss
This commit is contained in:
Adomas Venčkauskas 2021-04-23 12:05:00 +03:00 committed by Dan Stillman
parent 431d7e1eaa
commit 55c758c9d0
2 changed files with 228 additions and 211 deletions

View file

@ -1083,7 +1083,10 @@ class VirtualizedTable extends React.Component {
const header = document.querySelector(`#${this.props.id} .virtualized-table-header`); const header = document.querySelector(`#${this.props.id} .virtualized-table-header`);
const scrollbarWidth = Math.max(0, const scrollbarWidth = Math.max(0,
tree.getBoundingClientRect().width - jsWindow.getBoundingClientRect().width); tree.getBoundingClientRect().width - jsWindow.getBoundingClientRect().width);
header.style.width = `calc(100% - ${scrollbarWidth}px)`; // Should be kept up to date with the _virtualized-table.scss value
// for .virtualized-table-header
const paddingInlineStart = 6;
header.style.width = `calc(100% - ${scrollbarWidth+paddingInlineStart}px)`;
} }
/** /**

View file

@ -11,6 +11,7 @@
display: flex; display: flex;
height: 0; height: 0;
flex-direction: column; flex-direction: column;
> div { > div {
display: flex; display: flex;
flex: 1; flex: 1;
@ -32,6 +33,7 @@
&.resizing { &.resizing {
cursor: col-resize; cursor: col-resize;
.cell { .cell {
cursor: col-resize; cursor: col-resize;
} }
@ -80,6 +82,7 @@
&.drop { &.drop {
color: $shade-0 !important; color: $shade-0 !important;
background: $shade-5 !important; background: $shade-5 !important;
* { * {
pointer-events: none !important; pointer-events: none !important;
} }
@ -92,9 +95,11 @@
background-color: $shade-5; background-color: $shade-5;
pointer-events: none; pointer-events: none;
} }
span.drop-before { span.drop-before {
top: 0; top: 0;
} }
span.drop-after { span.drop-after {
bottom: -1px; bottom: -1px;
} }
@ -137,6 +142,7 @@
height: 2em; height: 2em;
overflow: hidden; overflow: hidden;
border-inline-end: 1px solid #ddd; border-inline-end: 1px solid #ddd;
padding-inline-start: 6px;
&.static-columns { &.static-columns {
pointer-events: none; pointer-events: none;
@ -176,10 +182,15 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
&:first-child .label {
margin-inline-start: 4px;
}
&.cell-icon { &.cell-icon {
> .label { > .label {
margin-inline-start: 0; margin-inline-start: 0;
} }
justify-content: center; justify-content: center;
} }
@ -213,6 +224,7 @@
min-height: 90%; min-height: 90%;
} }
} }
.spacer-twisty { .spacer-twisty {
display: inline-block; display: inline-block;
min-width: 8px; min-width: 8px;
@ -240,11 +252,13 @@
left: 10px; left: 10px;
right: initial; right: initial;
} }
.resizer { .resizer {
right: -5px; right: -5px;
left: initial; left: initial;
} }
} }
.twisty svg { .twisty svg {
transform: rotate(90deg); transform: rotate(90deg);
} }