Compare commits

...

7 Commits

Author SHA1 Message Date
charlesh88
d9e2125bbc Merge branch 'topic-conditionals' into conditionals-styling-2 2020-03-17 15:51:22 -07:00
charlesh88
c7b326e3f2 Merge branch 'topic-conditionals' into conditionals-styling-2 2020-03-16 16:06:05 -07:00
charlesh88
f6d2f9f578 Merge remote-tracking branch 'origin' into conditionals-styling-2 2020-03-12 09:28:09 -07:00
charlesh88
408e27c796 Conditionals styling WIP
- Tweaks for layout/overflow issues;
- Better header alignment;
- Much better approach to "accordion" spacing;
2020-03-09 14:44:50 -07:00
Deep Tailor
5fcc4eebe1 Add a re-calculate column width button (#2719)
* Add a recalculate Column width button

* Tweaks to telemetry table for recalculateColumnWidths

- Recalc button now hidden if isAutosizeEnabled === false;
- Recalc button label, title edited for clarity;
- Normalized button titles for other table buttons;
- Fixed `.c-separator` height issue;

* toggle between expand and autosize

* Tweaked button title text

* remove nested loop

* fix lint errors

* remove unecessary promise and use clientWidth instead of offsetWidth

Co-authored-by: charlesh88 <charlesh88@gmail.com>
2020-03-09 10:31:26 -07:00
Nikhil
8d86c914a1 Merge pull request #2732 from nasa/minmax-fix-382020
Revert minMax to minmax
2020-03-09 10:05:42 -07:00
Deep Tailor
fab04519c6 fix minmax typo 2020-03-08 20:11:04 -07:00
4 changed files with 78 additions and 16 deletions

View File

@@ -11,6 +11,7 @@
.c-condition { .c-condition {
flex-direction: column; flex-direction: column;
min-width: 400px;
> * + * { > * + * {
margin-top: $interiorMarginSm; margin-top: $interiorMarginSm;
@@ -24,10 +25,13 @@
/***************************** HEADER */ /***************************** HEADER */
&__header { &__header {
$h: 22px;
display: flex; display: flex;
align-items: flex-start; align-items: start;
align-content: stretch; align-content: stretch;
overflow: hidden; overflow: hidden;
min-height: $h;
line-height: $h;
> * { > * {
flex: 0 0 auto; flex: 0 0 auto;
@@ -36,6 +40,11 @@
} }
} }
} }
&__drag-grippy {
transform: translateY(50%);
}
&__name { &__name {
font-weight: bold; font-weight: bold;
align-self: baseline; // Fixes bold line-height offset problem align-self: baseline; // Fixes bold line-height offset problem

View File

@@ -143,7 +143,7 @@ define([
let strategy; let strategy;
if (this.model.interpolate !== 'none') { if (this.model.interpolate !== 'none') {
strategy = 'minMax'; strategy = 'minmax';
} }
options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {}); options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {});

View File

@@ -28,7 +28,7 @@
<button <button
v-if="allowExport" v-if="allowExport"
class="c-button icon-download labeled" class="c-button icon-download labeled"
title="Export This View's Data" title="Export this view's data"
@click="exportAllDataAsCSV()" @click="exportAllDataAsCSV()"
> >
<span class="c-button__label">Export Table Data</span> <span class="c-button__label">Export Table Data</span>
@@ -37,7 +37,7 @@
v-if="allowExport" v-if="allowExport"
v-show="markedRows.length" v-show="markedRows.length"
class="c-button icon-download labeled" class="c-button icon-download labeled"
title="Export Marked Rows As CSV" title="Export marked rows as CSV"
@click="exportMarkedDataAsCSV()" @click="exportMarkedDataAsCSV()"
> >
<span class="c-button__label">Export Marked Rows</span> <span class="c-button__label">Export Marked Rows</span>
@@ -45,7 +45,7 @@
<button <button
v-show="markedRows.length" v-show="markedRows.length"
class="c-button icon-x labeled" class="c-button icon-x labeled"
title="Unmark All Rows" title="Unmark all rows"
@click="unmarkAllRows()" @click="unmarkAllRows()"
> >
<span class="c-button__label">Unmark All Rows</span> <span class="c-button__label">Unmark All Rows</span>
@@ -58,7 +58,7 @@
v-if="marking.enable" v-if="marking.enable"
class="c-button icon-pause pause-play labeled" class="c-button icon-pause pause-play labeled"
:class=" paused ? 'icon-play is-paused' : 'icon-pause'" :class=" paused ? 'icon-play is-paused' : 'icon-pause'"
:title="paused ? 'Continue Data Flow' : 'Pause Data Flow'" :title="paused ? 'Continue real-time data flow' : 'Pause real-time data flow'"
@click="togglePauseByButton()" @click="togglePauseByButton()"
> >
<span class="c-button__label"> <span class="c-button__label">
@@ -66,6 +66,29 @@
</span> </span>
</button> </button>
<template v-if="!isEditing">
<div
class="c-separator"
>
</div>
<button
v-if="isAutosizeEnabled"
class="c-button icon-arrows-right-left labeled"
title="Increase column widths to fit currently available data."
@click="recalculateColumnWidths"
>
<span class="c-button__label">Expand Columns</span>
</button>
<button
v-else
class="c-button icon-expand labeled"
title="Automatically size columns to fit the table into the available space."
@click="autosizeColumns"
>
<span class="c-button__label">Autosize Columns</span>
</button>
</template>
<slot name="buttons"></slot> <slot name="buttons"></slot>
</div> </div>
<!-- main controlbar end --> <!-- main controlbar end -->
@@ -461,17 +484,20 @@ export default {
this.scrollW = (this.scrollable.offsetWidth - this.scrollable.clientWidth) + 1; this.scrollW = (this.scrollable.offsetWidth - this.scrollable.clientWidth) + 1;
}, },
calculateColumnWidths() { calculateColumnWidths() {
let columnWidths = {}; let columnWidths = {},
let totalWidth = 0; totalWidth = 0,
let sizingRowEl = this.sizingTable.children[0]; headerKeys = Object.keys(this.headers),
let sizingCells = Array.from(sizingRowEl.children); sizingTableRow = this.sizingTable.children[0],
let headerKeys = Object.keys(this.headers); sizingCells = sizingTableRow.children;
headerKeys.forEach((headerKey, headerIndex)=>{ headerKeys.forEach((headerKey, headerIndex, array)=>{
let cell = sizingCells[headerIndex]; if (this.isAutosizeEnabled) {
let columnWidth = cell.offsetWidth; columnWidths[headerKey] = this.sizingTable.clientWidth / array.length;
columnWidths[headerKey] = columnWidth; } else {
totalWidth += columnWidth; let cell = sizingCells[headerIndex];
columnWidths[headerKey] = cell.offsetWidth;
}
totalWidth += columnWidths[headerKey];
}); });
this.columnWidths = columnWidths; this.columnWidths = columnWidths;
@@ -818,6 +844,31 @@ export default {
this.setHeight(); this.setHeight();
this.scrollable.scrollTop = this.userScroll; this.scrollable.scrollTop = this.userScroll;
} }
},
updateWidthsAndClearSizingTable() {
this.calculateColumnWidths();
this.configuredColumnWidths = this.columnWidths;
this.visibleRows.forEach((row, i) => {
this.$set(this.sizingRows, i, undefined);
delete this.sizingRows[i];
});
},
recalculateColumnWidths() {
this.visibleRows.forEach((row,i) => {
this.$set(this.sizingRows, i, row);
});
this.configuredColumnWidths = {};
this.isAutosizeEnabled = false;
this.$nextTick()
.then(this.updateWidthsAndClearSizingTable);
},
autosizeColumns() {
this.isAutosizeEnabled = true;
this.$nextTick().then(this.calculateColumnWidths);
} }
} }
} }

View File

@@ -229,6 +229,7 @@ section {
&.is-expanded { &.is-expanded {
flex: 1 1 100%; flex: 1 1 100%;
max-height: max-content;
} }
.c-section__header { .c-section__header {
@@ -676,6 +677,7 @@ select {
.c-separator { .c-separator {
@include cToolbarSeparator(); @include cToolbarSeparator();
height: 100%;
} }
.c-row-separator { .c-row-separator {