@c8y/style
Version:
Styles for Cumulocity IoT applications
616 lines (536 loc) • 13.2 kB
text/less
.input-group {
position: relative; // For dropdowns
display: flex;
align-items: stretch;
flex-wrap: nowrap;
width: 100%;
// Undo padding and float of grid classes
&[class*='col-'] {
float: none;
padding-right: 0;
padding-left: 0;
}
.form-control + .form-control{
margin-left: -1px;
}
> .form-control,
> .c8y-select-wrapper,
> .form-group,
> div[c8y-device-group-selector] {
position: relative;
z-index: 2;
flex: 1 1 auto;
margin-bottom: 0;
height: @form-control-height-base ;
min-width: 0;
&:not(:first-child) {
margin-left: -1px;
}
}
> .color-input {
flex-grow: 0;
flex-basis: 39px;
}
.form-control.inner-scroll{
box-shadow: none;
border: 1px solid @form-control-border-color-default;
padding-top: 0;
padding-bottom: 0;
align-items: center;
background-color: @form-control-background-default;
> .tag{
align-self: unset;
flex-shrink: 0;
}
}
c8y-software-type {
flex-grow: 1 ;
c8y-typeahead .input-group input {
flex-grow: 1 ;
}
}
&.typeahead > div:not(.input-group-btn) {
flex: 1;
.form-control {
width: 100%;
}
}
}
.input-group-addon {
display: flex;
align-items: center;
padding: @form-control-padding-base-vertical @form-control-padding-base-horizontal;
border-radius: @form-control-border-radius;
background-color: @form-control-border-color-default;
color: @form-control-color-default;
font-weight: @form-control-font-weight;
font-size: @font-size-base;
font-family: @form-control-font-family;
line-height: @form-control-line-height;
height: @form-control-height-base;
&.inner-scroll {
max-width: 230px;
height: 32px;
margin-left: -1px;
}
.form-group-sm &,
.input-group-sm &,
&.input-sm {
padding: @form-control-padding-small-vertical @form-control-padding-small-horizontal;
font-size: @font-size-small;
height: @form-control-height-sm;
}
label.c8y-checkbox,
label.c8y-radio {
margin: 0;
line-height: 1;
input[type='checkbox'] + span::before,
input[type='radio'] + span::before {
margin: 0;
}
}
}
.input-group-btn {
display: flex;
align-items: stretch;
max-height: @form-control-height-base;
&:not(:first-child) {
margin-left: -1px;
}
&--last, + .input-group-btn {
margin-left: -1px;
}
.input-group-sm &{
max-height: @form-control-height-sm;
}
> .btn-default{
--c8y-btn-default-background-default: @form-control-background-default;
}
}
.input-group-addon,
.input-group-btn,
.form-control {
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn{
border-radius: @form-control-border-radius;
}
}
// search with round corners
.input-group.input-group-search {
display: flex ;
.form-control {
&,
&:first-child,
&:last-child {
padding-right: calc(@form-control-height-base + @form-control-padding-base-horizontal);
padding-left: calc(@form-control-padding-base-horizontal * 2);
border-radius: calc(@form-control-height-base * 0.5);
}
}
.form-control.input-lg {
&,
&:first-child,
&:last-child {
padding: @form-control-padding-large-vertical calc(@form-control-padding-large-horizontal * 2);
border-radius: @form-control-height-base;
font-size: @font-size-large;
}
}
.input-group-btn,
.input-group-addon {
position: absolute;
right: 0;
z-index: 2;
display: flex;
align-items: center;
min-width: @form-control-height-base;
height: @form-control-height-base;
border: 0;
background-color: transparent;
.btn {
width: 100%;
height: 100%;
line-height: 1;
border-radius: calc(@form-control-height-base * 0.5);
&:hover {
box-shadow: inset 0 0 0 2px @component-brand-primary;
}
}
}
&.input-group-sm {
.form-control:not(.c8y-radio):not(.c8y-checkbox) {
padding-left: 12px;
}
.input-group-btn,
.input-group-addon, .form-group {
height: @form-control-height-sm;
}
}
&.input-group-lg {
// .form-control:not(.c8y-radio):not(.c8y-checkbox) {
// padding-left: 16px;
// }
.input-group-btn,
.input-group-addon {
height: @form-control-height-lg;
max-height: unset;
.btn{
border-radius: @form-control-height-base;
min-width: @form-control-height-lg;
}
}
}
}
.input-group.input-group-password {
display: flex ;
.form-control {
&,
&:first-child,
&:last-child {
padding-right: calc(@form-control-height-base + @form-control-padding-base-horizontal);
padding-left: @form-control-padding-base-horizontal;
}
}
.input-group-btn,
.input-group-addon {
position: absolute;
right: 0;
z-index: 2;
display: flex;
align-items: center;
min-width: @form-control-height-base;
height: 100%;
max-height: unset;
border: 0;
background-color: transparent;
.btn {
width: 100%;
height: 100%;
}
}
&.input-group-sm {
.form-control:not(.c8y-radio):not(.c8y-checkbox) {
padding-left: 12px;
}
.input-group-btn,
.input-group-addon {
height: @form-control-height-sm;
}
}
}
// dropdown without round corners
.input-group.input-group-dropdown {
.input-group-btn,
.input-group-addon {
position: absolute;
right: 0;
z-index: 2;
display: flex;
align-items: center;
min-width: @form-control-height-base;
height: @form-control-height-base;
border: 0;
background-color: transparent;
.btn {
width: 100%;
height: 100%;
border: 0;
border-radius: @form-control-border-radius;
}
}
&.input-group-sm{
.input-group-btn,
.input-group-addon {
height: @form-control-height-sm;
}
}
}
// Reset rounded corners
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
//Input group editable
// supports a save button and a cancel button inside a input-group
.input-group-editable {
.input-group-btn {
.btn-clean {
position: relative;
padding: 6px;
&::after {
position: absolute;
top: 50%;
right: 0;
display: block;
margin-top: -10px;
width: 1px;
height: 20px;
background-color: fade(@black, 10%);
content: '';
}
}
&:last-child {
.btn-clean::after {
display: none;
}
}
}
}
.input-group-editable {
textarea.form-control {
max-height: unset ;
height: @form-control-height-base;
}
input[type='number']:not(:focus) {
-moz-appearance: textfield;
&::-webkit-inner-spin-button {
margin: 0;
-webkit-appearance: none;
}
}
.form-control:not(.ng-dirty) {
transition: all 0.25s ease;
&[disabled] {
padding-left: 0;
box-shadow: none;
opacity: @component-disabled-opacity;
transition: none;
}
~ .input-group-btn {
display: none;
}
}
&:not(:hover) {
textarea.form-control {
resize: none;
}
.form-control:not(:focus):not(.ng-dirty) {
z-index: 2;
overflow: hidden;
flex: 0 1 auto;
margin-right: 12px;
padding-left: 0;
min-width: 3ch;
max-width: 100%;
field-sizing: content;
width: auto;
background-color: transparent;
box-shadow: none;
text-overflow: ellipsis;
&[disabled],
&[read-only] {
width: 100%;
}
+ span:after {
z-index: 5;
display: inline-block;
margin-left: -16px;
color: @component-brand-primary;
content: @dlt-c8y-icon-pencil;
font: normal normal normal 14px/1 @icon-font-family;
font-size: 12px;
line-height: 32px;
opacity: 0.5;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
.form-group-lg & {
line-height: 40px;
}
}
&[disabled] {
+ span:after {
display: none;
}
}
}
}
&:hover {
.form-control:not(:focus):not(.ng-dirty) {
flex: 0 1 auto;
max-width: 100%;
}
}
}
// Sizing options
// Remix the default form control sizing classes into new ones for easier manipulation.
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
.input-lg();
}
.input-group-lg > .form-group{
height: @form-control-height-lg;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
.input-sm();
}
.input-group-sm > .form-group{
height: @form-control-height-sm;
}
// Text input groups
.input-group-addon {
padding: @form-control-padding-base-vertical @form-control-padding-base-horizontal;
border: 1px solid @input-group-addon-border-color;
border-radius: @form-control-border-radius;
background-color: @input-group-addon-background-default;
color: @form-control-color-default;
text-align: center;
font-weight: normal;
font-size: @font-size-base;
line-height: 1;
&.input-sm {
padding: @form-control-padding-small-vertical @form-control-padding-small-horizontal;
border-radius: @form-control-border-radius;
font-size: @font-size-small;
}
&.input-lg {
padding: @form-control-padding-large-vertical @form-control-padding-large-horizontal;
border-radius: @form-control-border-radius;
font-size: @font-size-large;
}
input[type='radio'],
input[type='checkbox'] {
margin-top: 0;
}
}
// Button input groups
.input-group-btn {
position: relative; // Jankily prevent input button groups from wrapping with `white-space` and
white-space: nowrap; // Negative margin for spacing, position for bringing hovered/focused/actived
// `font-size` in combination with `inline-block` on buttons.
font-size: 0;
// element above the siblings.
> .btn {
position: relative;
padding: 5px 12px;
height: 100%;
+ .btn {
margin-left: -1px;
border-left-color: fade(@black, 15%);
}
// Bring the "active" button to the front
&:hover,
&:focus,
&:active {
z-index: 2;
}
&.btn-default:not(:focus) {
border-color: @form-control-border-color-default;
}
&.btn-link[disabled] {
color: @component-color-disabled ;
opacity: @form-control-disabled-opacity ;
cursor: @cursor-disabled ;
pointer-events: auto ;
}
}
// No negative margins to show the complet input border
&:first-child {
> .btn,
> .btn-group {
margin-right: 0;
border-right-color: fade(@black, 15%);
}
> .btn:last-child {
// border-right: 0;
}
}
&:last-child {
> .btn:not(:focus),
> .btn-group {
z-index: 2;
// border-left-color: fade(@black, 15%);
}
> .btn:focus {
margin-left: -1px;
}
}
&:not(:first-child) {
> .btn:first-child:not(:focus) {
// border-left: 0;
}
}
}
// input-group-array for formly array.type.component
.input-group-array {
@media screen and (min-width: @screen-sm-min) {
display: flex;
}
.form-group {
position: relative;
}
.form-group,
.input-group-btn {
margin-bottom: 4px;
}
// @TODO: JAWI validate
> .input-group-btn.delete-row {
margin-top: 24px;
}
formly-field {
flex-grow: 1;
}
+ .input-group-array {
.input-group-btn {
margin-top: 0;
}
.form-group > label {
display: none;
}
}
}
// modifier classes for formly
.formly-group-array-cols {
.input-group-array {
gap: @margin-base;
> formly-field {
display: contents;
> formly-group {
display: contents;
}
}
formly-field {
flex-basis: 50%;
}
}
}
formly-field label.c8y-checkbox {
margin: @margin-base 0;
}
c8y-lwm2m-legend-wrapper formly-field {
> c8y-field-checkbox {
display: flex;
align-items: center;
margin: 0 0 @margin-8 0;
& label.c8y-switch {
display: flex ;
overflow: visible;
align-items: center;
}
}
}
// EXTENDABLE INPUT LIST
[c8yinputgrouplistcontainer] > li:not(:last-child) .input-group-btn > .btn.text-primary {
display: none;
}