@import (reference) "../theme/variables/antdVariables.less";
@input-prefix-cls: ~"@{ant-prefix}-input";

.ued-input-wrap {
  &.@{input-prefix-cls} {
    line-height: 22px;
  }
  &.greyStyle {
    .@{input-prefix-cls}-group-addon:first-child {
      background: #f7f7f7;
    }
  }
  &.blueStyle {
    .@{input-prefix-cls}-group-addon:first-child {
      color: #fff;
      background: @primary-color;
      border: 1px solid @primary-color !important;
    }
  }
  &.whiteStyle {
    .@{input-prefix-cls}-group-addon:first-child {
      background: #fff;
    }
  }

  &.postfixGreyStyle {
    .@{input-prefix-cls}-group-addon:last-child {
      background: #f7f7f7;
    }
    .@{input-prefix-cls}-group-addon-disabled {
      background-color: @disabled-bg !important;
      color: @disabled-color;
    }
    &:hover {
      .@{input-prefix-cls}-group-addon:last-child {
        border-color: @primary-color !important;
      }
      .@{input-prefix-cls}-group-addon-disabled {
        background-color: @disabled-bg !important;
        color: @disabled-color;
        border-color: @border-color-base !important;
      }
    }
  }

  &.postfixBlueStyle {
    .@{input-prefix-cls}-group-addon:last-child {
      color: #fff;
      background: @primary-color;
      border: 1px solid @primary-color !important;
    }
    .@{input-prefix-cls}-group-addon-disabled {
      background-color: @disabled-bg !important;
      color: @disabled-color;
      border-color: @border-color-base !important;
    }
    &:hover {
      .@{input-prefix-cls}-group-addon:last-child {
        border-color: @primary-color !important;
      }
      .@{input-prefix-cls}-group-addon-disabled {
        background-color: @disabled-bg !important;
        color: @disabled-color;
        border-color: @border-color-base !important;
      }
    }
  }

  &.postfixWhiteStyle {
    .@{input-prefix-cls}-group-addon:last-child {
      background: #fff;
    }
    .@{input-prefix-cls}-group-addon-disabled {
      background-color: @disabled-bg !important;
      color: @disabled-color;
    }
    &:hover {
      .@{input-prefix-cls}-group-addon:last-child {
        border-color: @primary-color !important;
      }
      .@{input-prefix-cls}-group-addon-disabled {
        background-color: @disabled-bg !important;
        color: @disabled-color;
        border-color: @border-color-base !important;
      }
    }
  }
  &.postfixNoBorderStyle {
    .@{input-prefix-cls} {
      border-right: none;
    }
    .@{input-prefix-cls}-affix-wrapper {
      border-right: none;
    }

    .@{input-prefix-cls}-group-addon:last-child {
      background: #fff;
    }
    .@{input-prefix-cls}-group-addon-disabled {
      background-color: @disabled-bg !important;
      color: @disabled-color;
    }
    &:hover {
      .@{input-prefix-cls}-group-addon:last-child {
        border-color: @primary-color !important;
      }
      .@{input-prefix-cls}-group-addon-disabled {
        background-color: @disabled-bg !important;
        color: @disabled-color;
        border-color: @border-color-base !important;
      }
    }
  }

  &.postfixGreyStyle,
  &.postfixBlueStyle,
  &.postfixWhiteStyle,
  &.postfixNoBorderStyle {
    .@{input-prefix-cls}-group-addon:first-child:hover {
      & ~ .@{input-prefix-cls}-group-addon:last-child {
        border-color: @border-color-base !important;
      }
    }
    .postfix {
      display: flex;
      align-items: center;
      .postfixIcon:first-child {
        margin-right: 4px;
      }
      .postfixIcon:last-child {
        margin-left: 4px;

      }
    }
  }

  &.greyStyle,
  &.blueStyle,
  &.whiteStyle {
    .@{input-prefix-cls}-group-addon:first-child {
      border-top-left-radius: 2px;
      border-bottom-left-radius: 2px;
    }
    .postfix {
      display: flex;
      align-items: center;
      .postfixIcon:first-child {
        margin-right: 4px;
      }
      .postfixIcon:last-child {
        margin-left: 4px;
      }
    }
  }

  &.postfixGreyStyle,
  &.postfixBlueStyle,
  &.postfixWhiteStyle,
  &.postfixNoBorderStyle,
  &.nonePostfixStyle {
    .@{input-prefix-cls}-group-addon:last-child {
      border-top-right-radius: 2px;
      border-bottom-right-radius: 2px;
      border-left-width: 1px;
      border-left-style: solid;
      border-left-color: @border-color-base;
    }
  }

  &.postfixNoBorderStyle {
    .@{input-prefix-cls}-group-addon:last-child {
      border-left-width: 0 !important;;
    }
  }

  .disabled {
    cursor: not-allowed;
  }

  .@{input-prefix-cls}-wrapper.@{input-prefix-cls}-group {
    display: flex;
    .@{input-prefix-cls}-group-addon {
      width: auto;
      display: inline-flex;
      align-items: center;
    }
  }

  .@{input-prefix-cls}-show-count-suffix {
    font-size: 12px;
  }
}

// 带前后缀图标的输入框通用样式
.@{input-prefix-cls}-affix-wrapper {
  .@{input-prefix-cls}:not(:first-child) {
    padding-left: @input-affix-padding;
  }
  .@{input-prefix-cls}:not(:last-child) {
    padding-right: @input-affix-padding;
  }
}
.@{input-prefix-cls}-after-border-right-width {
  .@{input-prefix-cls}-affix-wrapper {
    border-right-width: 0px !important;
  }
}
.@{input-prefix-cls}-affix-wrapper.ued-input-wrap.@{input-prefix-cls}-affix-wrapper-sm {
  padding: 0 8px;
  input {
    line-height: 26px;
    height: auto;
  }
}
// .@{input-prefix-cls}-affix-wrapper.ued-input-wrap.@{input-prefix-cls}-affix-wrapper-lg {
//   font-size: 14px;
// }


