@import '../../style/mixins';
@import '../../style/themes/default';

@listPrefixCls: fm-list;
@inputPrefixCls: fm-input;

.@{inputPrefixCls} {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: @list-item-height;
  background-color: @fill-base;
  //vertical-align: middle;
  overflow: hidden;
  padding: @v-spacing-md @h-spacing-lg @v-spacing-md @h-spacing-lg;
  position: relative;
  .hairline('bottom');
  input {
    color: @color-text-base;
    font-size: @font-size-heading;
    appearance: none;
    background-color: transparent;
    line-height: @line-height-base;
    box-sizing: border-box;
    border: 0;
    // flex布局下input的最小宽度被限制为195px
    min-width: 0;
    flex-grow: 1;

    &::placeholder {
      color: @color-text-placeholder;
      line-height: 1.2;
    }

    &:disabled {
      color: @color-text-disabled;
      background-color: #fff;
    }
  }

  &-sm {
    min-height: @list-item-height-sm;
    height: @list-item-height-sm;
    input {
      font-size: @font-size-caption-sm;
    }
  }
  // 清除按钮
  .@{inputPrefixCls}-clear {
    display: none;
    width: @icon-size-sm;
    height: @icon-size-sm;
    border-radius: @radius-circle;
    overflow: hidden;
    font-style: normal;
    color: @fill-base;
    background-color: @input-color-icon;
    background-repeat: no-repeat;
    flex-shrink: 0;
    .encoded-svg-background('input_item_delete');

    background-size: @icon-size-sm auto;
    background-position: 2 * @hd 2 * @hd;

    &-active {
      background-color: @input-color-icon-tap;
    }
  }

  &.@{inputPrefixCls}-focus {
    .@{inputPrefixCls}-clear {
      display: block;
    }
  }

  // 前后缀
  &-prefix,
  &-suffix {
    padding: 2 * @hd;
  }
}

// List.Item包裹后
.@{listPrefixCls}-item {
  &.@{inputPrefixCls}-item {
    .@{inputPrefixCls} {
      min-height: 24 * @hd;
      padding: 0;
      .hairline-remove('bottom');
    }

    .@{listPrefixCls}-label {
      flex: none;
      width: 60 * @hd;
    }
  }

  &-active {
    background-color: #fff!important;
  }
}
