2016-06-16 22:04:17 +08:00
|
|
|
@import "../../style/themes/default";
|
2016-04-27 20:44:36 +08:00
|
|
|
@import "../../style/mixins/index";
|
|
|
|
|
2017-01-05 15:19:42 +08:00
|
|
|
@input-presuffix-width: 17;
|
2017-01-01 01:06:19 +08:00
|
|
|
|
2015-07-07 11:32:08 +08:00
|
|
|
// size mixins for input
|
2015-06-15 11:43:18 +08:00
|
|
|
.input-lg() {
|
2015-08-04 14:41:30 +08:00
|
|
|
padding: @input-padding-vertical-lg @input-padding-horizontal;
|
2015-07-07 11:32:08 +08:00
|
|
|
height: @input-height-lg;
|
2015-06-15 11:43:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.input-sm() {
|
|
|
|
padding: @input-padding-vertical-sm @input-padding-horizontal;
|
2015-07-07 11:32:08 +08:00
|
|
|
height: @input-height-sm;
|
2015-06-15 11:43:18 +08:00
|
|
|
}
|
|
|
|
|
2015-07-09 17:19:01 +08:00
|
|
|
// input status
|
|
|
|
// == when focus or actived
|
2016-08-31 17:04:24 +08:00
|
|
|
.active(@color: @outline-color) {
|
2017-01-01 22:20:06 +08:00
|
|
|
border-color: ~`colorPalette("@{color}", 5)`;
|
2015-07-09 17:19:01 +08:00
|
|
|
outline: 0;
|
2016-08-31 17:04:24 +08:00
|
|
|
box-shadow: 0 0 @outline-blur-size @outline-width fade(@color, 20%);
|
2015-07-09 17:19:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// == when hoverd
|
2015-11-26 19:32:55 +08:00
|
|
|
.hover(@color: @input-hover-border-color) {
|
2017-01-01 22:20:06 +08:00
|
|
|
border-color: ~`colorPalette("@{color}", 5)`;
|
2015-07-09 17:19:01 +08:00
|
|
|
}
|
|
|
|
|
2015-07-09 20:06:03 +08:00
|
|
|
.disabled() {
|
|
|
|
background-color: @input-disabled-bg;
|
|
|
|
opacity: 1;
|
2016-11-08 20:45:56 +08:00
|
|
|
cursor: not-allowed;
|
2017-01-01 22:20:06 +08:00
|
|
|
color: @disabled-color;
|
2015-07-09 20:06:03 +08:00
|
|
|
&:hover {
|
|
|
|
.hover(@input-border-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-11 09:57:37 +08:00
|
|
|
// Basic style for input
|
2015-06-09 19:45:18 +08:00
|
|
|
.input() {
|
|
|
|
position: relative;
|
2015-07-07 16:18:14 +08:00
|
|
|
display: inline-block;
|
2015-06-09 19:45:18 +08:00
|
|
|
padding: @input-padding-vertical-base @input-padding-horizontal;
|
|
|
|
width: 100%;
|
2015-07-07 11:32:08 +08:00
|
|
|
height: @input-height-base;
|
2015-07-08 20:12:49 +08:00
|
|
|
cursor: text;
|
2015-08-04 14:41:30 +08:00
|
|
|
font-size: @font-size-base;
|
2015-06-09 19:45:18 +08:00
|
|
|
line-height: @line-height-base;
|
|
|
|
color: @input-color;
|
|
|
|
background-color: @input-bg;
|
|
|
|
background-image: none;
|
2017-01-31 16:05:10 +08:00
|
|
|
border: @border-width-base @border-style-base @input-border-color;
|
2015-07-07 11:32:08 +08:00
|
|
|
border-radius: @border-radius-base;
|
|
|
|
.placeholder(); // Reset placeholder
|
2016-12-05 00:27:03 +08:00
|
|
|
transition: all .3s;
|
2015-06-09 19:45:18 +08:00
|
|
|
|
2015-06-15 20:24:01 +08:00
|
|
|
&:hover {
|
2015-07-09 17:19:01 +08:00
|
|
|
.hover();
|
2015-06-09 19:45:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
2015-07-09 17:19:01 +08:00
|
|
|
.active();
|
2015-06-09 19:45:18 +08:00
|
|
|
}
|
|
|
|
|
2016-10-14 09:12:10 +08:00
|
|
|
&[disabled] {
|
|
|
|
.disabled();
|
2015-06-09 19:45:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Reset height for `textarea`s
|
|
|
|
textarea& {
|
2015-07-27 08:52:47 +08:00
|
|
|
max-width: 100%; // prevent textearea resize from coming out of its container
|
2015-06-09 19:45:18 +08:00
|
|
|
height: auto;
|
2015-07-20 16:44:39 +08:00
|
|
|
vertical-align: bottom;
|
2015-06-09 19:45:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Size
|
|
|
|
&-lg {
|
2015-06-15 11:43:18 +08:00
|
|
|
.input-lg();
|
2015-06-09 19:45:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-sm {
|
2015-06-15 11:43:18 +08:00
|
|
|
.input-sm();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-08 20:12:49 +08:00
|
|
|
// label input
|
2015-07-21 14:54:49 +08:00
|
|
|
.input-group(@inputClass) {
|
2015-06-15 11:43:18 +08:00
|
|
|
position: relative;
|
|
|
|
display: table;
|
|
|
|
border-collapse: separate;
|
2016-12-10 01:03:16 +08:00
|
|
|
border-spacing: 0;
|
2016-05-19 14:43:01 +08:00
|
|
|
width: 100%;
|
2015-06-15 11:43:18 +08:00
|
|
|
|
|
|
|
// Undo padding and float of grid classes
|
|
|
|
&[class*="col-"] {
|
|
|
|
float: none;
|
|
|
|
padding-left: 0;
|
|
|
|
padding-right: 0;
|
|
|
|
}
|
|
|
|
|
2015-07-09 13:48:24 +08:00
|
|
|
> [class*="col-"] {
|
|
|
|
padding-right: 8px;
|
|
|
|
}
|
|
|
|
|
2015-07-20 22:56:43 +08:00
|
|
|
&-addon,
|
2015-07-21 14:54:49 +08:00
|
|
|
&-wrap,
|
2015-07-09 13:48:24 +08:00
|
|
|
> .@{inputClass} {
|
2015-06-15 11:43:18 +08:00
|
|
|
display: table-cell;
|
|
|
|
|
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
2015-06-09 19:45:18 +08:00
|
|
|
}
|
2015-06-15 11:43:18 +08:00
|
|
|
|
2015-07-20 22:56:43 +08:00
|
|
|
&-addon,
|
2015-07-21 14:54:49 +08:00
|
|
|
&-wrap {
|
2016-10-21 15:04:55 +08:00
|
|
|
width: 1px; // To make addon/wrap as small as possible
|
2015-06-15 11:43:18 +08:00
|
|
|
white-space: nowrap;
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
2016-01-22 14:56:35 +08:00
|
|
|
&-wrap > * {
|
2016-05-24 20:08:13 +08:00
|
|
|
display: block !important;
|
2016-01-22 14:56:35 +08:00
|
|
|
}
|
|
|
|
|
2015-06-15 11:43:18 +08:00
|
|
|
.@{inputClass} {
|
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
|
|
float: left;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-addon {
|
|
|
|
padding: @input-padding-vertical-base @input-padding-horizontal;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
font-weight: normal;
|
|
|
|
line-height: 1;
|
|
|
|
color: @input-color;
|
|
|
|
text-align: center;
|
|
|
|
background-color: #eee;
|
2017-01-31 16:05:10 +08:00
|
|
|
border: @border-width-base @border-style-base @input-border-color;
|
2015-07-07 11:32:08 +08:00
|
|
|
border-radius: @border-radius-base;
|
2016-11-08 11:46:41 +08:00
|
|
|
position: relative;
|
2016-12-02 14:04:44 +08:00
|
|
|
transition: all .3s;
|
2016-06-16 21:15:59 +08:00
|
|
|
|
|
|
|
// Reset Select's style in addon
|
2016-09-14 16:18:33 +08:00
|
|
|
.@{ant-prefix}-select {
|
2016-07-18 22:24:53 +08:00
|
|
|
margin: -(@input-padding-vertical-base + 1) (-@input-padding-horizontal); // lesshint spaceAroundOperator: false
|
2016-06-16 21:15:59 +08:00
|
|
|
|
2016-09-14 16:18:33 +08:00
|
|
|
.@{ant-prefix}-select-selection {
|
2016-06-16 21:15:59 +08:00
|
|
|
background-color: inherit;
|
2016-06-16 22:04:17 +08:00
|
|
|
margin: -1px;
|
2017-01-31 16:05:10 +08:00
|
|
|
border: @border-width-base @border-style-base transparent;
|
2016-11-09 22:25:39 +08:00
|
|
|
box-shadow: none;
|
2016-06-16 22:04:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-open,
|
|
|
|
&-focused {
|
2016-09-14 16:18:33 +08:00
|
|
|
.@{ant-prefix}-select-selection {
|
2016-11-09 22:25:39 +08:00
|
|
|
color: @primary-color;
|
2016-06-16 22:04:17 +08:00
|
|
|
}
|
2016-06-16 21:15:59 +08:00
|
|
|
}
|
|
|
|
}
|
2016-11-08 11:46:41 +08:00
|
|
|
|
|
|
|
// Expand addon icon click area
|
|
|
|
// https://github.com/ant-design/ant-design/issues/3714
|
|
|
|
> i:only-child:after {
|
|
|
|
position: absolute;
|
|
|
|
content: '';
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
}
|
2015-06-15 11:43:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Reset rounded corners
|
2015-12-02 15:55:02 +08:00
|
|
|
> span > .@{inputClass}:first-child,
|
2015-07-20 22:56:43 +08:00
|
|
|
> .@{inputClass}:first-child,
|
2015-07-09 13:48:24 +08:00
|
|
|
&-addon:first-child {
|
2015-06-15 11:43:18 +08:00
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
2016-06-16 21:15:59 +08:00
|
|
|
|
|
|
|
// Reset Select's style in addon
|
2016-09-14 16:18:33 +08:00
|
|
|
.@{ant-prefix}-select .@{ant-prefix}-select-selection {
|
2016-06-16 21:15:59 +08:00
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
}
|
2015-06-15 11:43:18 +08:00
|
|
|
}
|
2015-07-07 16:18:14 +08:00
|
|
|
|
2017-01-01 01:06:19 +08:00
|
|
|
> .@{inputClass}-preSuffix-wrapper {
|
|
|
|
&:not(:first-child) .@{inputClass} {
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:not(:last-child) .@{inputClass} {
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-15 11:43:18 +08:00
|
|
|
&-addon:first-child {
|
|
|
|
border-right: 0;
|
|
|
|
}
|
2015-07-08 20:12:49 +08:00
|
|
|
&-addon:last-child {
|
|
|
|
border-left: 0;
|
|
|
|
}
|
2015-07-07 16:18:14 +08:00
|
|
|
|
2015-07-09 13:48:24 +08:00
|
|
|
> .@{inputClass}:last-child,
|
2015-07-21 14:54:49 +08:00
|
|
|
&-addon:last-child {
|
2015-06-15 11:43:18 +08:00
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
2016-06-16 21:15:59 +08:00
|
|
|
|
|
|
|
// Reset Select's style in addon
|
2016-09-14 16:18:33 +08:00
|
|
|
.@{ant-prefix}-select .@{ant-prefix}-select-selection {
|
2016-06-16 21:15:59 +08:00
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
}
|
2015-06-15 11:43:18 +08:00
|
|
|
}
|
2015-07-07 16:18:14 +08:00
|
|
|
|
2015-06-15 11:43:18 +08:00
|
|
|
// Sizing options
|
2015-07-09 13:48:24 +08:00
|
|
|
&-lg .@{inputClass},
|
2015-07-21 14:54:49 +08:00
|
|
|
&-lg > &-addon {
|
2015-06-15 11:43:18 +08:00
|
|
|
.input-lg();
|
|
|
|
}
|
|
|
|
|
2015-07-09 13:48:24 +08:00
|
|
|
&-sm .@{inputClass},
|
2015-07-21 14:54:49 +08:00
|
|
|
&-sm > &-addon {
|
2015-06-15 11:43:18 +08:00
|
|
|
.input-sm();
|
|
|
|
}
|
2017-01-01 01:06:19 +08:00
|
|
|
|
|
|
|
.@{inputClass}-preSuffix-wrapper {
|
|
|
|
display: table-cell;
|
|
|
|
width: 100%;
|
|
|
|
float: left;
|
|
|
|
}
|
2017-01-02 00:12:41 +08:00
|
|
|
|
|
|
|
&&-compact {
|
|
|
|
& > * {
|
|
|
|
border-radius: 0;
|
|
|
|
border-right-width: 0;
|
2017-01-22 18:48:57 +08:00
|
|
|
vertical-align: middle;
|
2017-01-02 00:12:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Undo float for .ant-input-group .ant-input
|
|
|
|
.@{inputClass} {
|
|
|
|
float: none;
|
|
|
|
z-index: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
// reset border for Select, datePicker
|
|
|
|
& > .@{ant-prefix}-select > .@{ant-prefix}-select-selection,
|
|
|
|
& > .@{ant-prefix}-calendar-picker .@{ant-prefix}-input {
|
|
|
|
border-radius: 0;
|
|
|
|
border-right-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > *:first-child,
|
|
|
|
& > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selection,
|
|
|
|
& > .@{ant-prefix}-calendar-picker:first-child .@{ant-prefix}-input {
|
|
|
|
border-top-left-radius: @border-radius-base;
|
|
|
|
border-bottom-left-radius: @border-radius-base;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > *:last-child,
|
|
|
|
& > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selection,
|
|
|
|
& > .@{ant-prefix}-calendar-picker:last-child .@{ant-prefix}-input {
|
|
|
|
border-top-right-radius: @border-radius-base;
|
|
|
|
border-bottom-right-radius: @border-radius-base;
|
|
|
|
border-right-width: 1px;
|
|
|
|
}
|
|
|
|
}
|
2017-01-01 01:06:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.input-preSuffix-wrapper(@inputClass) {
|
|
|
|
position: relative;
|
2017-01-10 15:11:43 +08:00
|
|
|
display: inline-block;
|
|
|
|
width: 100%;
|
2017-01-01 01:06:19 +08:00
|
|
|
|
|
|
|
.@{inputClass} {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
2017-01-05 15:19:42 +08:00
|
|
|
&:hover .@{inputClass} {
|
|
|
|
.hover();
|
|
|
|
}
|
|
|
|
|
2017-01-01 01:06:19 +08:00
|
|
|
.@{inputClass}-prefix,
|
|
|
|
.@{inputClass}-suffix {
|
|
|
|
position: absolute;
|
2017-01-10 15:11:43 +08:00
|
|
|
top: 50%;
|
2017-01-05 15:19:42 +08:00
|
|
|
transform: translateY(-50%);
|
2017-01-01 01:06:19 +08:00
|
|
|
z-index: 2;
|
2017-01-05 15:19:42 +08:00
|
|
|
line-height: 1.2;
|
2017-01-01 01:06:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.@{inputClass}-prefix {
|
|
|
|
left: @input-padding-horizontal;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{inputClass}-suffix {
|
|
|
|
right: @input-padding-horizontal;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{inputClass}:not(:first-child) {
|
|
|
|
padding-left: @input-padding-horizontal + @input-presuffix-width;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{inputClass}:not(:last-child) {
|
|
|
|
padding-right: @input-padding-horizontal + @input-presuffix-width;
|
|
|
|
}
|
2015-06-12 18:37:03 +08:00
|
|
|
}
|