Enhancements for Derived Telemetry object

- Closes #7823
- Final sanding and polishing.
- New discrete item style `c-output-featured` added to controls.scss
  - Applied to 'Current Output' section of both Derived Telemetry and Condition Sets.
- TODOs:
  - [ ] Check for low-risk regressions in Condition Sets browse and edit modes.
  - [ ] New tests for ObjectPathString.vue component.
This commit is contained in:
Charles Hacskaylo 2024-09-05 17:12:07 -07:00
parent 1615c36b7e
commit 59461d6b06
5 changed files with 1014 additions and 951 deletions

View File

@ -22,10 +22,10 @@
<template> <template>
<div class="c-comps" aria-label="Derived Telemetry"> <div class="c-comps" aria-label="Derived Telemetry">
<section class="c-cs__current-output c-section"> <section class="c-section c-comps-output">
<div class="c-cs__content c-cs__current-output-value"> <div class="c-output-featured">
<span class="c-cs__current-output-value__label">Current Output</span> <span class="c-output-featured__label">Current Output</span>
<span class="c-cs__current-output-value__value" aria-label="Current Output Value"> <span class="c-output-featured__value" aria-label="Current Output Value">
<template <template
v-if="testDataApplied && currentTestOutput !== undefined && currentTestOutput !== null" v-if="testDataApplied && currentTestOutput !== undefined && currentTestOutput !== null"
> >
@ -115,27 +115,30 @@
Drag in telemetry to add references for an expression. Drag in telemetry to add references for an expression.
</div> </div>
<div class="c-cs__content">
<textarea <textarea
v-if="parameters?.length && isEditing" v-if="parameters?.length && isEditing"
v-model="expression" v-model="expression"
class="expression-input" class="c-comps__expression-value"
placeholder="Enter an expression" placeholder="Enter an expression"
@change="updateExpression" @change="updateExpression"
></textarea> ></textarea>
<div v-else> <div v-else>
<div class="c-comps__expression-value">
{{ expression }} {{ expression }}
</div> </div>
<div v-if="expression && expressionOutput && isEditing" class="c-expression-output-bad">
{{ expressionOutput }}
</div> </div>
<div <span
v-else-if="expression && !expressionOutput && isEditing" v-if="expression && expressionOutput"
class="c-expression-output-good" class="icon-alert-triangle c-comps__expression-msg --bad"
> >
Valid Expression Invalid: {{ expressionOutput }}
</div> </span>
</div> <span
v-else-if="expression && !expressionOutput && isEditing"
class="c-comps__expression-msg --good"
>
Expression valid
</span>
</section> </section>
</div> </div>
</template> </template>

View File

@ -19,13 +19,34 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
@mixin expressionMsg($fg, $bg) {
$op: 0.4;
color: rgba($fg, $op * 1.5);
background: rgba($bg, $op);
}
.c-comps { .c-comps {
display: flex;
flex-direction: column;
gap: $interiorMarginLg;
.is-editing & { .is-editing & {
padding: $interiorMargin; padding: $interiorMargin;
} }
&__refs-and-controls { &__output {
display: flex;
align-items: baseline;
gap: $interiorMargin;
&-label {
flex: 0 0 auto;
text-transform: uppercase;
}
&-value {
flex: 0 1 auto;
}
} }
&__section, &__section,
@ -42,20 +63,6 @@
grid-template-columns: max-content max-content min-content 1fr; grid-template-columns: max-content max-content min-content 1fr;
padding: $interiorMargin; padding: $interiorMargin;
line-height: 170%; // Aligns text with controls like selects line-height: 170%; // Aligns text with controls like selects
//&__definition,
//&__test-value {
// display: flex;
// align-items: flex-start;
// gap: $interiorMargin;
//}
//
//&__definition {
//}
//
//&__test-value {
//
//}
} }
&__path-and-field { &__path-and-field {
@ -65,10 +72,37 @@
} }
&__expression { &__expression {
textarea { *[class*=value] {
resize: vertical; font-family: monospace;
//font-size: 1.1em;
resize: vertical; // Only applies to textarea
}
div[class*=value] {
padding: $interiorMargin;
}
} }
&__expression-msg {
@include expressionMsg($colorOkFg, $colorOk);
border-radius: $basicCr;
display: flex; // Creates hanging indent from :before icon
padding: $interiorMarginSm $interiorMarginLg $interiorMarginSm $interiorMargin;
//text-wrap: normal;
max-width: max-content;
&:before {
content: $glyph-icon-check;
font-family: symbolsfont;
margin-right: $interiorMarginSm;
}
&.--bad {
@include expressionMsg($colorErrorFg, $colorError);
&:before {
content: $glyph-icon-alert-triangle;
}
}
} }
.--em { .--em {
@ -76,17 +110,3 @@
//font-weight: bold; //font-weight: bold;
} }
} }
/************************************ OLD */
.c-expression-output-good {
width: 100%;
margin-right: 10px;
color: green;
}
.c-expression-output-bad {
width: 100%;
margin-right: 10px;
color: red;
}

View File

@ -23,9 +23,9 @@
<template> <template>
<div class="c-cs" :class="{ 'is-stale': isStale }" aria-label="Condition Set"> <div class="c-cs" :class="{ 'is-stale': isStale }" aria-label="Condition Set">
<section class="c-cs__current-output c-section"> <section class="c-cs__current-output c-section">
<div class="c-cs__content c-cs__current-output-value"> <div class="c-output-featured">
<span class="c-cs__current-output-value__label">Current Output</span> <span class="c-output-featured__label">Current Output</span>
<span class="c-cs__current-output-value__value" aria-label="Current Output Value"> <span class="c-output-featured__value" aria-label="Current Output Value">
<template v-if="currentConditionOutput"> <template v-if="currentConditionOutput">
{{ currentConditionOutput }} {{ currentConditionOutput }}
</template> </template>

View File

@ -51,6 +51,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1 1 auto; flex: 1 1 auto;
gap: $interiorMargin;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
@ -89,23 +90,24 @@
&__conditions { &__conditions {
flex: 1 1 auto; flex: 1 1 auto;
> * + * { //> * + * {
margin-top: $interiorMarginSm; // margin-top: $interiorMarginSm;
} //}
} }
&__content { &__content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: $interiorMarginSm;
flex: 0 1 auto; flex: 0 1 auto;
overflow: hidden; overflow: hidden;
> * { > * {
flex: 0 0 auto; flex: 0 0 auto;
overflow: hidden; overflow: hidden;
+ * { //+ * {
margin-top: $interiorMarginSm; // margin-top: $interiorMarginSm;
} //}
} }
.c-button { .c-button {
@ -121,6 +123,7 @@
section { section {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: $interiorMargin;
overflow: hidden; overflow: hidden;
} }

View File

@ -154,6 +154,7 @@ button {
color: inherit; color: inherit;
display: block; display: block;
transition: transform $transOutTime; transition: transform $transOutTime;
&:before { &:before {
content: $glyph-icon-arrow-down; content: $glyph-icon-arrow-down;
font-family: symbolsfont; font-family: symbolsfont;
@ -268,6 +269,7 @@ button {
font-size: 0.7em; font-size: 0.7em;
} }
} }
/********* Disclosure Triangle */ /********* Disclosure Triangle */
// Provides an arrow icon that when clicked expands an element to reveal its contents. // Provides an arrow icon that when clicked expands an element to reveal its contents.
// Used in tree items, plot legends. Always placed BEFORE an element. // Used in tree items, plot legends. Always placed BEFORE an element.
@ -322,8 +324,9 @@ button {
section { section {
flex: 0 1 auto; flex: 0 1 auto;
overflow: hidden; overflow: hidden;
+ section { + section {
margin-top: $interiorMargin; //margin-top: $interiorMargin;
} }
.c-section__header { .c-section__header {
@ -331,11 +334,12 @@ section {
display: flex; display: flex;
flex: 0 0 auto; flex: 0 0 auto;
align-items: center; align-items: center;
margin-bottom: $interiorMargin; gap: $interiorMarginSm;
//margin-bottom: $interiorMargin;
> * + * { //
margin-left: $interiorMarginSm; //> * + * {
} // margin-left: $interiorMarginSm;
//}
} }
> [class*='__label'] { > [class*='__label'] {
@ -359,6 +363,7 @@ input[type='password'],
input[type='date'], input[type='date'],
textarea { textarea {
@include reactive-input(); @include reactive-input();
&.numeric { &.numeric {
text-align: right; text-align: right;
} }
@ -475,6 +480,7 @@ input[type='number'].c-input-number--no-spinners {
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }
-moz-appearance: textfield; -moz-appearance: textfield;
} }
@ -505,8 +511,7 @@ select {
color: $colorSelectFg; color: $colorSelectFg;
box-shadow: $shdwSelect; box-shadow: $shdwSelect;
background-repeat: no-repeat, no-repeat; background-repeat: no-repeat, no-repeat;
background-position: background-position: right 0.4em top 80%,
right 0.4em top 80%,
0 0; 0 0;
border: none; border: none;
border-radius: $controlCr; border-radius: $controlCr;
@ -937,6 +942,7 @@ select {
.c-labeled-input { .c-labeled-input {
font-size: 0.9em; font-size: 0.9em;
input[type='number'] { input[type='number'] {
width: 40px; // Number input sucks and must have size set using this method width: 40px; // Number input sucks and must have size set using this method
} }
@ -1054,6 +1060,7 @@ select {
/******************************************************** SLIDERS */ /******************************************************** SLIDERS */
.c-slider { .c-slider {
@include cControl(); @include cControl();
> * + * { > * + * {
margin-left: $interiorMargin; margin-left: $interiorMargin;
} }
@ -1096,10 +1103,12 @@ input[type='range'] {
-webkit-appearance: none; -webkit-appearance: none;
@include sliderKnobRound($knobH); @include sliderKnobRound($knobH);
} }
&::-moz-range-thumb { &::-moz-range-thumb {
border: none; border: none;
@include sliderKnobRound($knobH); @include sliderKnobRound($knobH);
} }
&::-ms-thumb { &::-ms-thumb {
border: none; border: none;
@include sliderKnobRound($knobH); @include sliderKnobRound($knobH);
@ -1209,6 +1218,34 @@ input[type='range'] {
} }
} }
/***************************************************** DISCRETE ITEMS */
// OUTPUT
// Element that showcases an output value. Used in Condition Sets and Derived Telemetry
.c-output-featured {
display: flex;
gap: $interiorMargin;
padding: 0 $interiorMargin;
> * {
padding: $interiorMargin;
}
&__label {
flex: 0 0 auto;
text-transform: uppercase;
}
&__value {
$p: $interiorMargin * 2;
//font-size: 1.25em;
padding-left: $p;
padding-right: $p;
background: rgba(black, 0.2);
border-radius: $basicCr;
}
}
/***************************************************** LEGACY */ /***************************************************** LEGACY */
.l-btn-set { .l-btn-set {
display: flex; display: flex;