mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
- Markup cleanups, CSS placement improvements for tags. - Better approach to tag layout. - CSS prop migrated to _constants.scss. - Style and layout improvements for `.c-autocomplete*` input. Co-authored-by: Scott Bell <scott@traclabs.com>
This commit is contained in:
parent
6d63339b23
commit
393c801426
@ -99,7 +99,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div>
|
||||
<div class="c-ne__tags c-tag-holder">
|
||||
<div
|
||||
v-for="(tag, index) in entryTags"
|
||||
:key="index"
|
||||
|
@ -94,7 +94,7 @@ $messageListIconD: 32px;
|
||||
$tableResizeColHitareaD: 6px;
|
||||
/*************** Misc */
|
||||
$drawingObjBorderW: 3px;
|
||||
|
||||
$tagBorderRadius: 3px;
|
||||
/************************** MOBILE */
|
||||
$mobileMenuIconD: 24px; // Used
|
||||
$mobileTreeItemH: 35px; // Used
|
||||
|
@ -405,16 +405,18 @@ textarea {
|
||||
|
||||
&--autocomplete {
|
||||
&__wrapper {
|
||||
display: inline-flex;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__input {
|
||||
min-width: 100px;
|
||||
width: 100%;
|
||||
|
||||
// Fend off from afford-arrow
|
||||
min-height: 2em;
|
||||
padding-right: 2.5em !important;
|
||||
}
|
||||
|
||||
@ -437,7 +439,10 @@ textarea {
|
||||
}
|
||||
|
||||
&__afford-arrow {
|
||||
$p: 2px;
|
||||
font-size: 0.8em;
|
||||
padding-bottom: $p;
|
||||
padding-top: $p;
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
z-index: 2;
|
||||
|
@ -21,10 +21,11 @@
|
||||
*****************************************************************************/
|
||||
|
||||
<template>
|
||||
<div class="c-tag-applier">
|
||||
<div class="c-tag-applier has-tag-applier">
|
||||
<TagSelection
|
||||
v-for="(addedTag, index) in addedTags"
|
||||
:key="index"
|
||||
:class="{ 'w-tag-wrapper--tag-selector' : addedTag.newTag }"
|
||||
:selected-tag="addedTag.newTag ? null : addedTag"
|
||||
:new-tag="addedTag.newTag"
|
||||
:added-tags="addedTags"
|
||||
|
@ -21,8 +21,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
<template>
|
||||
<div class="c-tag__parent">
|
||||
<div class="c-tag_selection">
|
||||
<div class="w-tag-wrapper">
|
||||
<template v-if="newTag">
|
||||
<AutoCompleteField
|
||||
v-if="newTag"
|
||||
ref="tagSelection"
|
||||
@ -32,8 +32,9 @@
|
||||
:item-css-class="'icon-circle'"
|
||||
@onChange="tagSelected"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div
|
||||
v-else
|
||||
class="c-tag"
|
||||
:class="{'c-tag-edit': !readOnly}"
|
||||
:style="{ background: selectedBackgroundColor, color: selectedForegroundColor }"
|
||||
@ -48,7 +49,7 @@
|
||||
@click="removeTag"
|
||||
></button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -1,19 +1,30 @@
|
||||
@mixin tagHolder() {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
> * {
|
||||
$m: $interiorMarginSm;
|
||||
|
||||
margin: 0 $m $m 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************* TAGS */
|
||||
.c-tag {
|
||||
border-radius: 10px; //TODO: convert to theme constant
|
||||
border-radius: $tagBorderRadius;
|
||||
display: inline-flex;
|
||||
padding: 1px 10px; //TODO: convert to theme constant
|
||||
|
||||
> * + * {
|
||||
margin-left: $interiorMargin;
|
||||
}
|
||||
overflow: hidden;
|
||||
padding: 1px 6px; //TODO: convert to theme constant
|
||||
transition: $transIn;
|
||||
|
||||
&__remove-btn {
|
||||
color: inherit !important;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
padding: 1px !important;
|
||||
padding: 0; // Overrides default <button> padding
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
transition: $transIn;
|
||||
width: 0;
|
||||
|
||||
@ -28,28 +39,47 @@
|
||||
}
|
||||
}
|
||||
|
||||
/******************************* TAG EDITOR */
|
||||
.c-tag-applier {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
.c-tag-holder {
|
||||
@include tagHolder;
|
||||
}
|
||||
|
||||
> * + * {
|
||||
margin-left: $interiorMargin;
|
||||
.w-tag-wrapper {
|
||||
$m: $interiorMarginSm;
|
||||
|
||||
margin: 0 $m $m 0;
|
||||
}
|
||||
|
||||
/******************************* TAGS IN INSPECTOR / TAG SELECTION & APPLICATION */
|
||||
.c-tag-applier {
|
||||
$tagApplierPadding: 3px 6px;
|
||||
@include tagHolder;
|
||||
grid-column: 1 / 3;
|
||||
|
||||
&__tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&__add-btn {
|
||||
border-radius: $tagBorderRadius;
|
||||
padding: 3px 10px 3px 4px;
|
||||
|
||||
&:before { font-size: 0.9em; }
|
||||
}
|
||||
|
||||
.c-tag {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding-right: 3px !important;
|
||||
padding: $tagApplierPadding;
|
||||
|
||||
&__remove-btn {
|
||||
display: block;
|
||||
> * + * { margin-left: $interiorMarginSm; }
|
||||
}
|
||||
|
||||
.c-tag-selection {
|
||||
.c-input--autocomplete__input {
|
||||
min-height: auto !important;
|
||||
padding: $tagApplierPadding;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -62,10 +92,18 @@
|
||||
.has-tag-applier {
|
||||
// Apply this class to all components that should trigger tag removal btn on hover
|
||||
&:hover {
|
||||
.c-tag__remove-btn {
|
||||
width: 1.1em;
|
||||
opacity: 0.7;
|
||||
.c-tag {
|
||||
padding-right: 17px !important;
|
||||
transition: $transOut;
|
||||
}
|
||||
|
||||
.c-tag__remove-btn {
|
||||
//display: block;
|
||||
//margin-left: $interiorMarginSm;
|
||||
width: 1em;
|
||||
opacity: 0.8;
|
||||
transition: $transOut;
|
||||
//transition-delay: 250ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="c-inspector__properties c-inspect-properties has-tag-applier"
|
||||
class="c-inspector__properties c-inspect-properties"
|
||||
aria-label="Tags Inspector"
|
||||
>
|
||||
<div
|
||||
|
Loading…
Reference in New Issue
Block a user