Skip to content

Commit 7ef32ed

Browse files
committed
Fix CSS for expression columns
1 parent fd69d99 commit 7ef32ed

File tree

6 files changed

+41
-13
lines changed

6 files changed

+41
-13
lines changed

rust/perspective-viewer/src/less/column-selector.less

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
@import "./aggregate-selector.less";
1111

1212
:host {
13+
14+
.column-selector-column-title {
15+
display: flex;
16+
width: 100%;
17+
flex-direction: row !important;
18+
}
19+
20+
#expression-columns .column-selector-column-title {
21+
width: calc(100% - 24px);
22+
}
23+
1324
#side_panel {
1425
& > :not(:last-child) {
1526
margin-bottom: 6px;
@@ -70,8 +81,7 @@
7081
span.expression-edit-button,
7182
span.expression-delete-button {
7283
padding-left: 6px;
73-
padding-right: 4px;
74-
position: absolute;
84+
padding-right: 0px;
7585
font-family: "Material Icons";
7686
cursor: pointer;
7787
opacity: 1;
@@ -83,14 +93,6 @@
8393
}
8494
}
8595

86-
span.expression-edit-button {
87-
right: 0px;
88-
}
89-
90-
span.expression-delete-button {
91-
right: 18px;
92-
}
93-
9496
.column_selector_draggable {
9597
display: flex;
9698
align-items: start;
@@ -120,6 +122,7 @@
120122
overflow: hidden;
121123
text-overflow: ellipsis;
122124
width: 100%;
125+
flex: 1 1 250px;
123126
}
124127

125128
.column_name:before {
@@ -226,6 +229,11 @@
226229
position: relative;
227230
.column_selector_draggable {
228231
width: calc(100% - 24px);
232+
233+
span.expression-edit-button {
234+
margin-left: 18px;
235+
}
236+
229237
}
230238

231239
&:before {

rust/perspective-viewer/src/less/config-selector.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
white-space: nowrap;
4747
}
4848

49+
span:first-child {
50+
text-overflow: ellipsis;
51+
max-width: 250px;
52+
overflow: hidden;
53+
}
54+
4955
// Column is being dragged-over, e.g. this is the drop indicator.
5056
&.config-drop {
5157
display: inline;

rust/perspective-viewer/src/less/viewer.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,12 @@
169169
content: var(--settings-button--content, "\1f527");
170170
}
171171
}
172+
173+
.split-panel {
174+
.split-panel-child {
175+
&:first-child:not(.is-width-override) {
176+
max-width: 250px;
177+
}
178+
}
179+
}
172180
}

rust/perspective-viewer/src/rust/components/active_column.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl Component for ActiveColumn {
285285
ondragstart={ dragstart }
286286
ondragend={ self.props.ondragend.clone() }>
287287

288-
<span>
288+
<span class="column-selector-column-title">
289289
<span
290290
ref={ noderef.clone() }
291291
class={ format!("column_name {}", col_type) }>

rust/perspective-viewer/src/rust/components/containers/split_panel.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,15 @@ impl Component for SplitPanel {
207207
SplitPanelMsg::Reset
208208
});
209209

210+
let class = if style.is_some() {
211+
"split-panel-child is-width-override"
212+
} else {
213+
"split-panel-child"
214+
};
215+
210216
html! {
211217
<div id={ self.props.id.clone() } class="split-panel">
212-
<div class="split-panel-child" ref={ _ref } style={ style }>
218+
<div class={ class } ref={ _ref } style={ style }>
213219
{ iter.next().unwrap() }
214220
</div>
215221
<div

rust/perspective-viewer/src/rust/components/inactive_column.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl Component for InactiveColumn {
170170
onmousedown={ add_column }>
171171
</span>
172172
<div
173-
class="column_selector_draggable"
173+
class="column_selector_draggable column-selector-column-title"
174174
draggable="true"
175175
ref={ self.add_expression_ref.clone() }
176176
ondragstart={ dragstart }

0 commit comments

Comments
 (0)