@import 'mixins/mixins';
@import 'common/var';

@include b(input-range) {
  position: relative;
  font-size: $--font-size-base;
  display: inline-block;
  border-radius: $--input-border-radius;
  border: $--input-border;
  box-sizing: border-box;
  color: $--input-font-color;
  width: 300px;
  height: $--input-height;
  background-color: $--color-white;
  transition: $--border-transition-base;
  &:hover {
    border-color: $--input-hover-border;
  }
  .el-input-range__clear{
    display: none;
    color: $--input-hover-border;
    cursor: pointer;
  }
  &.is-clear:not(.is-disabled):not(.is-readonly){
    &:hover {
      .end-suffix{
        visibility: hidden;
      }
      .el-input-range__clear{
        display: block;
      }
    }
  }
  @include when(focus) {
    &.is-clear{
      .end-suffix{
        visibility: hidden;
      }
      .el-input-range__clear{
        display: block;
      }
    }
    border-color: $--input-focus-border;
  }
  &:focus {
    outline: none;
  }

  @include e(wrapper) {
    display: flex;
    padding: 0 10px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  @include e(separator) {
    line-height: calc(#{$--input-height} - 2px);
    padding: 0 5px;
  }

  @include e(inner) {
    -webkit-appearance: none;
    background-color: transparent;
    background-image: none;
    border: none;
    flex: 1;
    width: 100%;
    line-height: 1;
    font-size: inherit;
    outline: none;
    &::-ms-reveal {
      display: none;
    }
    &::placeholder {
      color: $--input-placeholder-color;
    }
  }

  @include e((prefix, suffix, clear)) {
    text-align: center;
    line-height: calc(#{$--input-height} - 2px);
    color: inherit;
  }
  @include e(clear) {
    position: absolute;
    right: 10px;
  }

  @include when(disabled) {
    background-color: $--input-disabled-fill;
    border-color: $--input-disabled-border;
    color: $--input-disabled-color;
    cursor: not-allowed;
    .el-input-range__inner {
      cursor: not-allowed;
      &::placeholder {
        color: $--input-disabled-placeholder-color;
      }
      &:hover {
        border-color: $--input-disabled-border;
      }
    }
  }

  @include m(medium) {
    font-size: $--input-medium-font-size;
    height: $--input-medium-height;
    line-height: $--input-medium-height;
    @include e(inner) {
      line-height: $--input-medium-height;
    }
    @include e(separator) {
      line-height: calc(#{$--input-medium-height} - 2px);
    }
    @include e((prefix, suffix, clear)) {
      line-height: calc(#{$--input-medium-height} - 2px);
    }
  }
  @include m(small) {
    font-size: $--input-small-font-size;
    height: $--input-small-height;
    line-height: $--input-small-height;
    @include e(inner) {
      line-height: $--input-small-height;
    }
    @include e(separator) {
      line-height: calc(#{$--input-small-height} - 2px);
    }
    @include e((prefix, suffix, clear)) {
      line-height: calc(#{$--input-small-height} - 2px);
    }
  }
  @include m(mini) {
    font-size: $--input-mini-font-size;
    height: $--input-mini-height;
    line-height: $--input-mini-height;
    @include e(inner) {
      line-height: $--input-mini-height;
    }
    @include e(separator) {
      line-height: calc(#{$--input-mini-height} - 2px);
    }
    @include e((prefix, suffix, clear)) {
      line-height: calc(#{$--input-mini-height} - 2px);
    }
  }
}

/** disalbe default clear on IE */
.el-input-range__inner::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

.el-input-range__inner::-webkit-outer-spin-button,
.el-input-range__inner::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
 
.el-input-range__inner[type="number"] {
    -moz-appearance: textfield;
}