Files
openmct/src/styles-new/_forms.scss
Charles Hacskaylo f77c6c821c Migrate styles (#2307)
* Legacy style migration in progress

- Working bottom up, many legacy items commented out. Stopped at
controls/indicators;

* Further migrations and deprecating
- Legacy indicator styles moved;

* WIP Styles migration
- s-button converted to c-button, WIP;
- Other

* Significant progress on migration, but still very WIP

- Mostly constants and overlay styling;
- Also bubbles and splitter;
- TODO: fix tree in overlay and splitter in imagery!

* Fix Summary Widgets UI WIP

- Remove non-working status 'editing' checks;

* Fix Summary Widgets UI WIP

- Remove non-working status 'editing' checks;
- view-control > c-disclosure-triangle;

* Fix Summary Widgets UI WIP

- Markup changes;
- Migrate CSS to styles-new, remove old;

* Fix Summary Widgets UI WIP

- Rule formatting and layout;
- Refinement to _controls / select {} padding;

* Fix Summary Widgets UI WIP

- Toolbar styles made more portable;
- Palette style  migration;
- Very WIP;

* Fix Summary Widgets UI WIP

- Palettes all fixed and functional;
- Conditions layout;
- New c-button--swatched styles;

* Fix Summary Widgets UI WIP

- Clean up code;

* Fix Summary Widgets UI WIP

- Fix button in Test Data area;

* Fix layout in shell left pane due to elements being moved

- Styles fixed and refined;

* Fixed palettes

- Fixed icon palette;
- Significant refinement to general palette styles;

* Significant fixes for Summary Widgets

- Widget editing UI fixed;
- JS cleanups and improvements;
- CSS, JS code cleanup;

* Migrate tree view used in Locator

- Mods to legacy markup;
- Mods to current CSS;
- Removed import of legacy tree CSS in legacy-styles.scss;

* Migrate archetypes

- l-flex-row, l-flex-col, etc. moved to legacy;
- grid-* styles cleaned up and moved, @extends removed;
- WIP on c-object-label, move styles from mct-tree.vue into ObjectLabel
.vue;
- TODO: finish up c-object-label, cleanups in mct-tree.vue;

* Migrate effects and animation mixins

* Object labels, legacy cleanup

- Add and apply .c-object-label for tree node elements;
- Remove legacy class "tree" from markup;
- Tweak color of tree item hover for better contrast in Inspector;

* Fix palettes in Inspector

* Various

- Fix hover color in tree for better mechanics on a variety of bgs;
- Fix object label in Locator tree;
- Remove overlay blocker test color;

* Significant work for Summary Widgets, mctForm, compact form

- Forms in overlay dialogs fixed;
- form, compact-form, other classes migrated into new _forms.scss;
- Fixes for Summary Widgets;
- Theme constants files synced, add form values;
- Removed import of legacy forms/elems SCSS file;

* Migrate various

- Autoflow tabular;
- Datetime;
- Channel selector;
- Form validation;

* Migrate wait spinners, final cleanup

* Remove old src/styles directory

- Remove old Snow and Espresso plugins;
- Remove refs to old Snow and Espresso config'd aliases;

* Update Palette.js

* Update Palette.js

* Removed commented code

* Removed commented code

* Migrate About, startup and splash screen styles
2019-03-14 13:27:13 -07:00

368 lines
9.0 KiB
SCSS

/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
.c-form {
display: flex;
flex-direction: column;
&__section {
display: inherit;
flex-direction: column;
}
&__row {
display: flex;
}
&__header {
border-radius: $basicCr;
background: $colorFormSectionHeaderBg;
color: $colorFormSectionHeaderFg;
font-size: inherit;
font-weight: normal;
margin: $interiorMargin 0;
padding: $formTBPad $formLRPad;
text-transform: uppercase;
}
}
/***************************************************** LEGACY */
.section-header {
border-radius: $basicCr;
color: lighten($colorBodyFg, 20%);
font-size: inherit;
margin: $interiorMargin 0;
padding: $formTBPad $formLRPad;
text-transform: uppercase;
.view-control {
display: inline-block;
margin-right: $interiorMargin;
width: 1em;
height: 1em;
}
}
.form {
color: $colorFormText;
height: 100%;
width: 100%;
.l-form-section {
margin-bottom: $interiorMarginLg * 2;
position: relative;
&.grows {
.l-section-body,
.form-row {
flex: 1 1 auto;
.wrapper {
height: 100%;
}
}
}
}
.form-row {
$m: $interiorMargin;
box-sizing: border-box;
border-top: 1px solid $colorFormLines;
padding: $formTBPad 0;
position: relative;
&.first {
border-top: none;
}
>.label,
>.controls {
box-sizing: border-box;
font-size: 0.8rem;
}
>.label {
// Only style this way for immediate children of .form-row; prevents problems when .label is used in .controls section of a form
min-width: 120px;
order: 1;
position: relative;
white-space: nowrap;
width: $formLabelW;
}
.value {
color: $colorInputFg;
}
.controls {
order: 2;
position: relative;
flex: 1 1 auto;
.l-composite-control {
&.l-checkbox {
display: inline-block;
line-height: $formRowCtrlsH;
margin-right: 5px;
}
}
.select {
margin-right: $interiorMargin;
}
}
.hint, .field-hints { color: $colorFieldHint; }
.selector-list {
// Used in create overlay to display tree view
@include nice-input();
padding: $interiorMargin;
position: relative;
min-height: 150px;
height: 100%;
>.wrapper {
$p: $interiorMargin;
box-sizing: border-box;
overflow: auto;
}
}
}
}
.l-controls-first .form .form-row,
.form .form-row.l-controls-first {
>.label,
>.controls {
line-height: inherit;
min-height: inherit;
}
>.label {
flex: 1 1 auto;
min-width: 0;
width: auto;
order: 2;
}
>.control,
>.controls {
flex: 0 0 auto;
margin-right: $interiorMargin;
order: 1;
}
}
.l-controls-under.l-flex-row {
// Change to use column layout
flex-direction: column;
.flex-elem {
margin-bottom: $interiorMarginLg;
}
}
.l-composite-control {
vertical-align: middle;
&:not(.l-inline) {
margin-bottom: $interiorMargin;
}
&.l-inline {
display: inline-block;
}
&.l-checkbox {
.composite-control-label {
line-height: 18px;
}
}
}
.autocomplete {
input {
width: 226px;
padding: 5px 0px 5px 7px;
}
.icon-arrow-down {
position: absolute;
top: 8px;
left: 210px;
font-size: 10px;
cursor: pointer;
}
.autocompleteOptions {
border: 1px solid $colorFormLines;
border-radius: 5px;
width: 224px;
max-height: 170px;
overflow-y: auto;
overflow-x: hidden;
li {
border: 1px solid $colorFormLines;
padding: 8px 0px 8px 5px;
.optionText {
cursor: pointer;
}
}
.optionPreSelected {
background-color: $colorInspectorSectionHeaderBg;
color: $colorInspectorSectionHeaderFg;
}
}
}
/********* COMPACT FORM */
// ul > li > label, control
// Make a new UL for each form section
// Allow control-first, controls-below
// 3/8/19: Used by Summary Widgets edit UI
.l-compact-form .tree ul li,
.l-compact-form ul li {
padding: 2px 0;
}
.l-compact-form {
$h: $btnStdH;
$labelW: 40%;
$minW: $labelW;
ul {
li {
display: flex;
align-items: stretch;
padding: $interiorMargin 0;
label,
.control {
display: flex;
}
label {
line-height: $h;
width: $labelW;
}
.controls {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
flex-grow: 1;
margin-left: $interiorMargin;
min-height: $h;
line-height: $h;
input[type="text"],
input[type="search"],
input[type="number"],
button,
select {
min-height: $h;
}
> * + * {
margin-left: $interiorMarginSm;
}
}
&.connects-to-previous {
padding-top: 0;
}
&.section-header {
margin-top: $interiorMarginLg;
border-top: 1px solid $colorFormLines;
}
&.controls-first {
.control {
flex-grow: 0;
margin-right: $interiorMargin;
min-width: 0;
order: 1;
width: auto;
}
label {
flex-grow: 1;
order: 2;
width: auto;
}
}
&.controls-under {
display: block;
.control, label {
display: block;
width: auto;
}
ul li {
border-top: none !important;
padding: 0;
}
}
}
}
}
/******** VALIDATION */
.form-error {
// Block element that visually flags an error and contains a message
background-color: $colorFormFieldErrorBg;
color: $colorFormFieldErrorFg;
border-radius: $basicCr;
display: block;
padding: 1px 6px;
&:before {
content: $glyph-icon-alert-triangle;
display: inline-block;
font-family: symbolsfont;
margin-right: $interiorMarginSm;
}
}
@mixin labelValidate($sym, $c) {
> .label {
@include glyphAfter($sym);
&:after {
color: $c;
margin-left: $interiorMargin;
}
}
}
mct-form.validates {
.form-row.validates {
> .label {
padding-right: 1em; // Keep room for validation element
&:after {
font-size: .8em;
}
}
&.invalid,
&.invalid.req { @include labelValidate($glyph-icon-x, $colorFormInvalid); }
&.valid,
&.valid.req { @include labelValidate($glyph-icon-check, $colorFormValid); }
&.req { @include labelValidate($glyph-icon-asterisk, $colorFormRequired); }
}
}
body.desktop .form-row.validates > .label {
&:after {
position: absolute;
right: $interiorMargin;
height: 100%;
line-height: 200%;
}
}