2019-04-30 11:11:25 +08:00
|
|
|
|
.#{$ns}Form {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
font-size: $Form-fontSize;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
&--quickEdit .#{$ns}Form-item:last-child {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--inline {
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}PlainField {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
padding-top: $Form-input-paddingY;
|
|
|
|
|
// padding-bottom: $Form-input-paddingY;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-06-10 17:47:47 +08:00
|
|
|
|
.#{$ns}Form-static {
|
|
|
|
|
min-height: $Form-input-height;
|
|
|
|
|
padding-top: $Form-label-paddingTop;
|
|
|
|
|
padding-bottom: $Form-label-paddingTop;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
|
.#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
font-weight: $fontWeightNormal;
|
|
|
|
|
margin-bottom: px2rem(5px);
|
|
|
|
|
display: inline-block;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
position: relative;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> span {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-star {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
color: $red;
|
|
|
|
|
font-size: $fontSizeXs;
|
|
|
|
|
line-height: 1;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-feedback {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
color: $danger;
|
|
|
|
|
margin: $Form-input-marginBottom 0 0;
|
|
|
|
|
padding-left: $gap-base;
|
|
|
|
|
font-size: $fontSizeSm;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-description {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: block;
|
|
|
|
|
color: $Form-description-color;
|
|
|
|
|
margin: $Form-input-marginBottom 0 0;
|
|
|
|
|
font-size: $Form-description-fontSize;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-hint {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-left: $gap-sm;
|
|
|
|
|
padding-top: $Form-input-paddingY;
|
|
|
|
|
vertical-align: top;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-item {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
margin-bottom: $Form-item-gap;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
.#{$ns}Grid-form > &:last-child {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
.#{$ns}Form--inline > &--inline {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
margin-bottom: $Form-item-gap/2;
|
|
|
|
|
margin-right: $Form-item-gap/2;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
&:last-child {
|
|
|
|
|
margin-right: 0;
|
|
|
|
|
margin-bottom: 0;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-remark {
|
|
|
|
|
margin-top: ($Form-input-height - $fontSizeBase) / 2;
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
&--horizontal {
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
text-align: $Form--horizontal-label-align;
|
|
|
|
|
white-space: $Form--horizontal-label-whiteSpace;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
&--normal {
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: block;
|
2020-06-09 20:28:07 +08:00
|
|
|
|
|
|
|
|
|
.#{$ns}Form-star {
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: px2rem(-6px);
|
|
|
|
|
top: px2rem(3px);
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
&.is-error > .#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
color: $danger;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-placeholder {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
color: $Form-input-placeholderColor;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-03-25 20:26:10 +08:00
|
|
|
|
.#{$ns}Form-caption {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
line-height: $Form-input-height;
|
|
|
|
|
height: $Form-input-height;
|
|
|
|
|
margin-left: px2rem(10px);
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
|
@include media-breakpoint-up(sm) {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-control--sizeXs {
|
2019-12-06 22:24:02 +08:00
|
|
|
|
// min-width: $Form-control-widthXs;
|
|
|
|
|
// width: auto;
|
2020-04-03 10:24:54 +08:00
|
|
|
|
min-width: $Form-control-widthXs;
|
2019-12-06 22:24:02 +08:00
|
|
|
|
max-width: 100%;
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: top;
|
2020-04-03 10:38:36 +08:00
|
|
|
|
|
|
|
|
|
// 非常难受,number 类型的 input 不能设置size
|
|
|
|
|
&.#{$ns}NumberControl {
|
|
|
|
|
width: $Form-control-widthXs;
|
|
|
|
|
}
|
2020-04-09 11:41:54 +08:00
|
|
|
|
|
|
|
|
|
&.#{$ns}TextareaControl {
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-control--sizeSm {
|
2020-04-03 10:24:54 +08:00
|
|
|
|
min-width: $Form-control-widthSm;
|
2019-12-06 22:24:02 +08:00
|
|
|
|
max-width: 100%;
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: top;
|
2020-04-03 10:38:36 +08:00
|
|
|
|
|
|
|
|
|
// 非常难受,number 类型的 input 不能设置size
|
|
|
|
|
&.#{$ns}NumberControl {
|
|
|
|
|
width: $Form-control-widthSm;
|
|
|
|
|
}
|
2020-04-09 11:41:54 +08:00
|
|
|
|
|
|
|
|
|
&.#{$ns}TextareaControl {
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-control--sizeMd {
|
2020-04-03 10:24:54 +08:00
|
|
|
|
min-width: $Form-control-widthMd;
|
2019-12-06 22:24:02 +08:00
|
|
|
|
max-width: 100%;
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: top;
|
2020-04-09 11:41:54 +08:00
|
|
|
|
|
|
|
|
|
&.#{$ns}TextareaControl {
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-control--sizeLg {
|
2020-04-03 10:24:54 +08:00
|
|
|
|
min-width: $Form-control-widthLg;
|
2019-12-06 22:24:02 +08:00
|
|
|
|
max-width: 100%;
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: top;
|
2020-04-03 10:38:36 +08:00
|
|
|
|
|
|
|
|
|
// 非常难受,number 类型的 input 不能设置size
|
|
|
|
|
&.#{$ns}NumberControl {
|
|
|
|
|
width: $Form-control-widthLg;
|
|
|
|
|
}
|
2020-04-09 11:41:54 +08:00
|
|
|
|
|
|
|
|
|
&.#{$ns}TextareaControl {
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-item {
|
|
|
|
|
&--horizontal {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
margin-left: -$Form--horizontal-gutterWidth / 2;
|
|
|
|
|
margin-right: -$Form--horizontal-gutterWidth / 2;
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> * {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
padding-left: $Form--horizontal-gutterWidth / 2;
|
|
|
|
|
padding-right: $Form--horizontal-gutterWidth / 2;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-label,
|
|
|
|
|
> .#{$ns}Form-value {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
flex-basis: 0;
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-itemColumn--xs,
|
|
|
|
|
.#{$ns}Form-itemColumn--sm,
|
|
|
|
|
.#{$ns}Form-itemColumn--normal,
|
|
|
|
|
.#{$ns}Form-itemColumn--md,
|
|
|
|
|
.#{$ns}Form-itemColumn--lg {
|
|
|
|
|
flex-grow: unset;
|
|
|
|
|
flex-basis: unset;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
padding-top: $Form-label-paddingTop;
|
|
|
|
|
margin-bottom: 0;
|
2020-06-09 20:28:07 +08:00
|
|
|
|
|
|
|
|
|
.#{$ns}Form-star {
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: px2rem(-6px);
|
|
|
|
|
top: px2rem(3px);
|
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-itemColumn--xs {
|
|
|
|
|
width: $Form--horizontal-label-widthXs;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-itemColumn--sm {
|
|
|
|
|
width: $Form--horizontal-label-widthSm;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-itemColumn--normal {
|
|
|
|
|
width: $Form--horizontal-label-widthBase;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-itemColumn--md {
|
|
|
|
|
width: $Form--horizontal-label-widthMd;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-itemColumn--lg {
|
|
|
|
|
width: $Form--horizontal-label-widthLg;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
@for $i from (1) through $Form--horizontal-columns {
|
|
|
|
|
.#{$ns}Form-itemColumn--#{$i} {
|
|
|
|
|
flex: 0 0 percentage($i / $Form--horizontal-columns);
|
|
|
|
|
max-width: percentage($i / $Form--horizontal-columns);
|
|
|
|
|
min-height: 1px;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
&--inline {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: top;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
padding-top: $Form-label-paddingTop;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-right: $Form-item-gap/2;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-11-26 19:04:47 +08:00
|
|
|
|
.#{$ns}Form-star {
|
|
|
|
|
position: static;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-value {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-control {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
vertical-align: top;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2020-07-13 18:14:13 +08:00
|
|
|
|
> .#{$ns}Remark {
|
|
|
|
|
padding-top: $Form-label-paddingTop;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-control.#{$ns}InputGroup {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-flex;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}TextControl--withAddOn {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-flex;
|
2019-12-06 15:22:17 +08:00
|
|
|
|
min-width: $Form-control-widthMd;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
margin-left: -$Form-row-gutterWidth / 2;
|
|
|
|
|
margin-right: -$Form-row-gutterWidth / 2;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> * {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
padding-left: $Form-row-gutterWidth / 2;
|
|
|
|
|
padding-right: $Form-row-gutterWidth / 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-col {
|
|
|
|
|
flex-basis: 0;
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
flex-shrink: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}Form-rowInner {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-label {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
padding-top: $Form-label-paddingTop;
|
|
|
|
|
padding-right: $Form-row-gutterWidth;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
|
2019-12-06 15:22:17 +08:00
|
|
|
|
> .#{$ns}Form-control {
|
2019-11-26 19:04:47 +08:00
|
|
|
|
flex-basis: 0;
|
|
|
|
|
flex-grow: 1;
|
2020-04-15 17:11:16 +08:00
|
|
|
|
|
|
|
|
|
&:not(.#{$ns}Form-control--withSize) {
|
|
|
|
|
min-width: unset;
|
|
|
|
|
}
|
2019-11-26 19:04:47 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-12-06 15:22:17 +08:00
|
|
|
|
}
|