////////表单样式////////
////富单选与多选////
.d-form-radio,.d-form-checkbox {
  @unit: 24px;
  .d-form-check-input {
    display: none;
    overflow: hidden;
    width: 0;
    height: 0;
    & + .d-form-check-icon ~ .d-form-check-icon {
      display: none;
    }
    &:checked + .d-form-check-icon {
      display: none;
    }
    &:checked + .d-form-check-icon ~ .d-form-check-icon {
      display: inline-block;
      color: @color-theme;
    }
    &:disabled ~ .d-form-check-icon,
    &:disabled ~ .d-form-check-label {
      .sys-disabled();
    }
  }
  .d-form-check-icon {
    display: inline-block;
    margin-right: 4px;
    fill: currentColor;
    height: @unit;
    width: @unit;
    user-select: none;
    color: @color-border;
    vertical-align: middle;
  }
}

////富开关////
.d-form-switch {
  overflow: hidden;
  position: relative;
  display: inline-block;
  height: 30px;
  line-height: 30px;
  min-width: 52px;
  // 表单项
  .d-form-switch-input {
    display: none;
    //单选框选中后改变的样式
    &:checked + .d-switch-slider{
      background: #2196F3;
      &:before{
        float: right;
        margin: 4px 0 0 0;
      }
      .d-switch-text {
        &:first-child {
          display: inline-block;
        }
        &:last-child {
          display: none;
        }
      }
    }
  }
  // 开关按钮
  .d-switch-slider {
    background: #ccc;
    display: block;
    padding: 0 4px;
    height: 100%;
    color: #fff;
    transition: all .4s;
    cursor: pointer;
    border-radius: 24px;
    // 小圆点
    &:before{
      content: "";
      float: left;
      margin: 4px 0 0 0;
      width: 22px;
      height: 22px;
      display: block;
      border-radius: 50%;
      background-color: #FFFFFF;
      transition: all .4s;
    }
  }
  // 文本
  .d-switch-text {
    display: none;
    padding: 0 4px;
    &:last-child {
      display: inline-block;
    }
  }
}
////尺寸////
.d-form-switch-xs {
  height: 20px;
  line-height: 20px;
  min-width: 40px;
  // 表单项
  .d-form-switch-input {
    //单选框选中后改变的样式
    &:checked + .d-switch-slider{
      &:before{
        margin: 2px 0 0 0;
      }
    }
  }
  // 开关按钮
  .d-switch-slider {
    padding: 0 2px;
    border-radius: 24px;
    // 小圆点
    &:before{
      margin: 2px 0 0 0;
      width: 16px;
      height: 16px;
    }
  }
}

////选择器////
.d-form-selecter {
  .d-selecter-text {
    position: relative;
  }
  .d-selecter-input {
    .d-form-input {
      display: block;
      background-color: #fff;
    }
  }
  .d-selecter-tail {
    position: absolute;
    display: flex;
    height: 100%;
    right: 0;
    top: 0;
    width: 32px;
    color: #c0c4cc;
    transition: all .3s;
    pointer-events: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }
  .d-list-menu {
    right: 0;
    background-color: #fff;
  }
}
.d-form-selecter-list-menu {
  display: none;
  background-color: #fff;
  &.active {
    display: block;
  }
}

////输入框组////
.d-input-group {
  display: flex;
  border-collapse: separate;
  font-size: 0;
  .d-form-input:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .d-form-input:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  .d-form-input:not(:first-child):not(:last-child) {
    border-radius: 0;
  }
}
// 输入框组文本,输入框组按钮
.d-input-group-addon,
.d-input-group-btn {
  white-space: nowrap;
  vertical-align: middle;
}
//输入框组文本
.d-input-group-addon {
  padding: @base-padding-vertical @base-padding-horizontal / 2;
  font-size: @base-font-size;
  font-weight: 400;
  line-height: @base-line-height;
  color: @sys-color-gray;
  text-align: center;
  background-color: #eee;
  border: 1px solid @color-border;
  &:first-child {
    border-right: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
  &:last-child{
    border-left: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
  }
}
// 输入框组按钮
.d-input-group-btn {
  &:first-child>.d-btn-group:not(:first-child)>.btn,
  &:first-child>.d-btn:not(:first-child),
  &:last-child>.d-btn,
  &:last-child>.d-btn-group>.d-btn {
    // border-left-width: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  &:first-child>.d-btn,
  &:first-child>.d-btn-group>.d-btn,
  &:last-child>.d-btn-group:not(:last-child)>.d-btn,
  &:last-child>.d-btn:not(:last-child) {
    // border-right-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  &:not(:first-child):not(:last-child) {
    .d-btn {
      border-radius: 0;
    }
  }
}
