2019-04-30 11:11:25 +08:00
|
|
|
.#{$ns}RangeControl {
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
|
|
|
@include clearfix();
|
2019-05-19 11:45:40 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
padding-top: 1rem;
|
|
|
|
padding-bottom: 1.1rem;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--withInput {
|
2019-04-30 11:11:25 +08:00
|
|
|
.#{$ns}InputRange {
|
2019-12-06 09:58:08 +08:00
|
|
|
width: calc(100% - 120px);
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
.#{$ns}InputRange-label--mid {
|
|
|
|
left: calc(50% - 60px);
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&.is-multiple {
|
|
|
|
.#{$ns}InputRange {
|
|
|
|
width: calc(100% - 210px);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
.#{$ns}InputRange {
|
|
|
|
&-input {
|
2020-12-21 10:08:40 +08:00
|
|
|
font-size: var(--fontSizeSm);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: absolute;
|
|
|
|
right: px2rem(26px);
|
|
|
|
top: px2rem(12px);
|
|
|
|
height: px2rem(30px);
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
input {
|
|
|
|
padding: px2rem(10px);
|
|
|
|
width: px2rem(74px);
|
|
|
|
height: 100%;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
2020-12-21 10:08:40 +08:00
|
|
|
border: var(--borderWidth) solid var(--info);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-separator {
|
|
|
|
display: inline-block;
|
|
|
|
padding: 0 5px;
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-unit {
|
|
|
|
position: absolute;
|
|
|
|
right: px2rem(10px);
|
|
|
|
top: px2rem(7px);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-clear {
|
|
|
|
position: absolute;
|
|
|
|
top: px2rem(18px);
|
|
|
|
right: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
svg {
|
|
|
|
height: px2rem(16px);
|
|
|
|
width: px2rem(16px);
|
|
|
|
fill: #999;
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
.#{$ns}InputRange {
|
2020-12-21 10:08:40 +08:00
|
|
|
height: var(--InputRange-slider-height);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
// slider
|
|
|
|
&-slider {
|
|
|
|
appearance: none;
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--InputRange-slider-bg);
|
|
|
|
border: var(--InputRange-slider-border);
|
2019-12-06 09:58:08 +08:00
|
|
|
// border-radius: 100%;
|
|
|
|
cursor: pointer;
|
|
|
|
display: block;
|
2020-12-21 10:08:40 +08:00
|
|
|
width: var(--InputRange-slider-width);
|
|
|
|
height: var(--InputRange-slider-height);
|
|
|
|
margin-left: calc(var(--InputRange-slider-width) / -2);
|
|
|
|
margin-top: calc(
|
|
|
|
var(--InputRange-slider-height) / -2 + var(--InputRange-track-height) / -2
|
|
|
|
);
|
2019-12-06 09:58:08 +08:00
|
|
|
outline: none;
|
|
|
|
position: absolute;
|
|
|
|
z-index: 2;
|
|
|
|
top: 50%;
|
2020-12-21 10:08:40 +08:00
|
|
|
transition: var(--InputRange-slider-transition);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
|
|
|
&:active {
|
2020-12-21 10:08:40 +08:00
|
|
|
transform: var(--InputRange-slider-onActive-transform);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&:focus {
|
2020-12-21 10:08:40 +08:00
|
|
|
box-shadow: var(--InputRange-slider-onFocus-boxShadow);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
.input-range--disabled & {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--InputRange-slider-onDisabled-bg);
|
|
|
|
border: var(--InputRange-slider-onDisabled-border);
|
2019-12-06 09:58:08 +08:00
|
|
|
box-shadow: none;
|
|
|
|
transform: none;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&:before {
|
|
|
|
content: '||';
|
|
|
|
color: #fff;
|
|
|
|
display: block;
|
|
|
|
line-height: px2rem(22px);
|
|
|
|
text-align: center;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-sliderContainer {
|
2020-12-21 10:08:40 +08:00
|
|
|
transition: var(--InputRange-sliderContainer-transition);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// label
|
|
|
|
&-label {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--InputRange-label-color);
|
|
|
|
font-size: var(--InputRange-label-fontSize);
|
2019-12-06 09:58:08 +08:00
|
|
|
transform: translateZ(0);
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-label--min,
|
|
|
|
&-label--max,
|
|
|
|
&-label--mid {
|
2020-12-21 10:08:40 +08:00
|
|
|
bottom: var(--InputRange-label-positionBottom);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-label--mid {
|
|
|
|
left: 50%;
|
2021-04-08 23:19:23 +08:00
|
|
|
bottom: calc(var(--gap-xs) * -1);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-label--max {
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-label--value {
|
|
|
|
position: absolute;
|
2020-12-21 10:08:40 +08:00
|
|
|
display: var(--InputRange-label--value-display);
|
|
|
|
top: var(--InputRange-label--value-positionTop);
|
2021-01-07 23:35:03 +08:00
|
|
|
left: var(--InputRange-label--value-positionLeft);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// label Container
|
|
|
|
|
|
|
|
// &-labelContainer {
|
|
|
|
// left: -50%;
|
|
|
|
// position: relative;
|
|
|
|
// .#{$ns}InputRange-label--max & {
|
|
|
|
// left: 50%;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// track
|
|
|
|
&-track {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--InputRange-track-bg);
|
2019-12-06 09:58:08 +08:00
|
|
|
// border-radius: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
display: block;
|
2020-12-21 10:08:40 +08:00
|
|
|
height: var(--InputRange-track-height);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
2020-12-21 10:08:40 +08:00
|
|
|
transition: var(--InputRange-track-transition);
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
.#{$ns}InputRange.is-disabled & {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--InputRange-track-onDisabled-bg);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&.is-active {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--InputRange-track-onActive-bg);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-track--background {
|
|
|
|
left: 0.5rem;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-top: calc(-0.5 * var(--InputRange-track-height));
|
2019-12-06 09:58:08 +08:00
|
|
|
position: absolute;
|
|
|
|
right: 0.5rem;
|
|
|
|
top: 50%;
|
|
|
|
|
|
|
|
&::before,
|
|
|
|
&::after {
|
|
|
|
content: '';
|
|
|
|
width: 0.5rem;
|
|
|
|
height: 100%;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
background: inherit;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&::before {
|
|
|
|
left: -0.5rem;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&::after {
|
|
|
|
right: -0.5rem;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-track--active {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--InputRange-track-onActive-bg);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|