@import url(../../var.less);

@date-editor-prefix: ~"@{prefix}date-editor";
@range-editor-prefix: ~"@{prefix}range-editor";

.@{date-editor-prefix}{
  position: relative;
  display: inline-block;
  text-align: left;

  &.w-input,
  &.w-input__inner {
    width: 196px;
  }

  &--monthrange {
    &.w-input,
    &.w-input__inner {
      width: 300px;
    }
  }

  &--daterange, &--timerange {
    &.w-input,
    &.w-input__inner {
      width: 284px;
    }
  }

  &--datetimerange {
    &.w-input,
    &.w-input__inner {
      width: 400px;
    }
  }

  &--dates {
    .w-input__inner {
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  &.no-border {
    border: 0px;
  }

  .w-icon-circle-close {
    cursor: pointer;
  }

  .w-range__icon {
    font-size: 14px;
    margin-left: -5px;
    color: @placeholder-text-color;
    float: left;
    line-height: 28px;
  }

  .w-range-input {
    appearance: none;
    border: none;
    outline: none;
    display: inline-block;
    height: 100%;
    margin: 0;
    padding: 0;
    width: 39%;
    text-align: center;
    font-size: @font-size-base;
    color: @regular-text-color;

    &::placeholder {
      color: @placeholder-text-color;
    }
  }

  .w-range-separator {
    display: inline-block;
    height: 100%;
    padding: 0 5px;
    margin: 0;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    width: 9%;
    color: @primary-text-color;
  }

  .w-range__close-icon {
    font-size: 14px;
    color: @placeholder-text-color;
    width: 25px;
    float: right;
    display: inline-block;
    line-height: 28px;
  }
}

.@{range-editor-prefix}{
  &.w-input__inner {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    justify-content: space-around;
  }

  .w-range-input {
    line-height: 1;
  }

  &.is-active {
    border-color: @primary-color;

    &:hover {
      border-color: @primary-color;
    }
  }

  &--medium {
    &.w-input__inner {
      height: @input-medium-height;
    }

    .w-range-separator {
      line-height: 28px;
      font-size: @input-medium-font-size;
    }

    .w-range-input {
      font-size: @input-medium-font-size;
    }

    .w-range__icon,
    .w-range__close-icon {
      line-height: 28px;
    }
  }

  &--small {
    &.w-input__inner {
      height: @input-small-height;
    }

    .w-range-separator {
      line-height: 24px;
      font-size: @input-small-font-size;
    }

    .w-range-input {
      font-size: @input-small-font-size;
    }

    .w-range__icon,
    .w-range__close-icon {
      line-height: 24px;
    }
  }

  &.is-disabled {
    background-color: @input-disabled-fill;
    border-color: @input-disabled-border;
    color: @input-disabled-color;
    cursor: not-allowed;

    &:hover, &:focus {
      border-color: @input-disabled-border;
    }

    input {
      background-color: @input-disabled-fill;
      color: @input-disabled-color;
      cursor: not-allowed;
      &::placeholder {
        color: @input-disabled-placeholder-color;
      }
    }

    .w-range-separator {
      color: @input-disabled-color;
    }
  }
}