// ============================================
// form 表单控件样式
// ============================================

@import './input.less';

// label
.form-label-mixin() {
  display: block;
  position: relative;
  width: 110px !important;
  flex: 0 0 110px;
  line-height: 14px;
  // max-height: 30px;
  color: #666;
  max-height: 28px;
  overflow: hidden;
  padding-left: 24px;
  padding-right: 8px;
  text-align: right;
  word-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  hyphens: auto;

  &.multi-line {
    // padding-top: 2px;
  }
}

// 普通输入框
.basic-input-text-mixin() {
  // height: 28px;
  .u-form-control-affix-wrapper {
    .u-form-control {
      .input-mixin();
    }
    .u-form-control-suffix {
      color: #A7ABB2;
      cursor: pointer;
      line-height: 28px;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 2;
      right: 7px;

      .uf-close-c {
        color: rgba(0, 0, 0, 0.25);
        line-height: 12px;
        font-size: 12px;
        &:before {
          content: "\e66b";
        }
      }
    }
  }
}

// 下拉参照框 list-refer
.basic-list-refer-mixin() {
  // height: 28px;
  .s-popover-inner-span {
    line-height: 0;
    font-size: 0;
    display: block;
    .ant-select:not(.ant-select-disabled) {
      color: #666;
      display: block;

      &.ant-select-open,
      &.ant-select-focused {
        .ant-select-selection {
          border: 1px solid @custom-color;
          box-shadow: none;
        }
      }

      .ant-select-selection {
        height: 28px;
        line-height: 28px;
        overflow: hidden;
        position: relative;
        display: block;
        background-color: #fff;
        border-radius: 4px;
        border: 1px solid #d9d9d9;
        cursor: pointer;

        &:hover {
          border: 1px solid @custom-color;
        }

        .ant-select-selection__rendered {
          margin-right: 38px;
          margin-left: 8px!important;
          position: relative;
          line-height: 26px;
        }
      }
    }
    .ant-select.ant-select-disabled .ant-select-selection{
      background: #f7f7f7;
    }
  }
}

// eg: 物料档案-新增-多条码
.basic-tagarea-mixin() {
  width: 100%;
  overflow: hidden;
  &>.yon-row {
    width: 100%;
    display: block;

    .label-control {
      .form-label-mixin();
      padding-top: 8px;
      max-height: 38px;
      -ms-flex-item-align: start;
      align-self: flex-start;
    }

    .input-control {
      width: 60%!important;
      height: auto;
      line-height: 28px;
      textarea {
        padding: 4px 8px;
        resize: none;
        margin-top: 2px;
      }
    }
  }
  &>.yon-row+.ant-form-explain {
    position: absolute;
    left: 100px;
    top: 48px;
    margin: 0!important;
    line-height: 32px;
  }
}

// label + control
.form-item-mixin() {
  display: flex;
  align-items: center;
  min-height: 32px;
  position: relative;

  .input-control {
    height: 28px;
    line-height: 28px;
    // flex: 1;
    width: 100%;

    .refer-div {
      height: 28px;
      &>.yon-row {
        margin-bottom: 0;
        min-height: 28px;

        .ant-search-input-wrapper {
          width: 100%;
          height: 28px;
          vertical-align: top;

          .u-input-group {
            line-height: 0px;
            display: block;
            .u-input-group-btn {
              top: 1px;
              line-height: 28px;
              min-width: auto;
            }
          } 
        }
      }
    }
  }
}

// group 容器组件dom 结构
.group-buttons {
  .basic-input-text,
  .basic-list-refer,
  .basic-tree-refer {
    & > .yon-row {
      .form-item-mixin();
    }
  }

  .basic-tagarea {
    .basic-tagarea-mixin();
  }

}

div[id='pc_product|detail!businessAttribute']>div,
.basic-tagarea.has-feedback,
.control-radio {
  .form-lable-top-mixin();
}

.label-control {
  .form-label-mixin();
}

.basic-input-text {
  .basic-input-text-mixin();
}

.basic-list-refer {
  .basic-list-refer-mixin();
}

.basic-tree-refer {
  .basic-list-refer-mixin();
}

.form-left.Manual-calculation-left {
  .yon-row.left-tree-select.meta-default-container>.yon-row>.col-float {
    margin-top: 14px;

    .viewSetting {
      .u-select-show-search {
        width: auto;
        font-size: 14px;
        color: #333;

        .u-select-selection {
          border: none;
        }

        .u-select-selection-rendered {
          margin-left: 0;

          .u-select-selection-selected-value {
            padding-left: 0;
          }

          .u-select-search.u-select-search--inline .u-select-search-field-wrap {
            display: none; // 隐藏select 自带输入框
          }
        }

        &.u-select-focused .u-select-selection,
        .u-select-selection:active,
        .u-select-selection:focus {
          border: none !important;
        }

        .u-select-selection:hover .u-select-selection-clear {
          display: none;
        }
      }
    }
  }

  .bg-white.border-r {
    .search-tree-3 .u-tree {
      padding-bottom: 60px;
    }
  }

  .search-tree-3.edit {
    height: calc(100% - 100px);
    margin-top: 10px;

    .u-tree {
      padding: 0 20px !important;

      &>li:first-child {
        padding-top: 0;
      }
    }
  }

  .left-tree-select-count.meta-default-container {
    height: 100%;
  }
}
//树结构按钮的调整
.editable_tree{
  padding:0 !important;
  overflow: auto;
  min-width: auto !important;
  .u-tree-node-content-wrapper{
    width: calc(~'100% - 22px') !important;
    .u-tree-title{
      width: 100%;
      .treebody_button{
        padding:0 !important;
        i.yonicon{
          margin-right: 8px;
          &:last-child{
            margin-right: 0;
          }
          &:hover{
            color:#588CE9;
          }
        }
        .yonicon-self-jia:before{
          content: "\e749"
        }
      }
    } 
  }
  .u-tree-node-content-wrapper-open{
    .u-tree-title{
      >span{
        display: block;
        width: 100%;
        .treebody_button{
          background: #fff;
          position: absolute;
          right: 0;
          padding:0;
        }
      }
      &:hover{
        >span{
          .treebody_button{
            background: #edf1f7;
          }
        }
      }
    }
  }
}
// 左树右表各占50%特殊处理
.balanceadjust-list {
  .form-left.Manual-calculation-left {
    width: 50%;
  }

  .form-base {
    width: 50%;

    >.group-container>.group-container {
      padding-top: 0;
    }

  }
}

.listheadRow {
  .filter-hide {

    .yon-row {
      .form-item-mixin();
      .input-control{
        flex:1;
        max-width: calc(~'100% - 110px') !important;
      }
    }
  }
}

// TODO：待确定
.cargo-location-count {
  height: calc(~'100% - 72px') !important;

  .form-left.Manual-calculation-left {
    overflow: hidden;

    .bg-white.border-r {
      height: 100% !important;
    }

    .search-tree-2 {
      height: 40px;
      margin-top: 0px !important;
      padding-top: 0px;

      .ant-btn {
        top: 2px !important;
      }
    }
  }

  .form-base.Manual-calculation {
    height: calc(~'100% - 60px') !important;
  }
}


//零售管理 - 微信配置、支付宝、兴业银行配置、开票配置
.alipay_page,
.wechat_page,
.wft_page,
.electroinvoice_page {
  .form-left + .form-base{
    width: 550px;
    flex-shrink: 0;
  }
  .form-left.Manual-calculation-left {
    display: table-cell;
    width: inherit;
    border: none;
    float: none;

    .basic-input-textarea {
      .input-control {
        height: inherit;
      }

      textarea {
        line-height: 18px;
      }
    }
    .width-percent-100{
        .control-width{
            .u-input-group,
            .ac-input-locale{
                width: 400px!important;
            }
        }
    }
  }

  .Manual-calculation {
    display: table-cell;

    .alipaysetting {
      line-height: 26px;
      border: none;
      background: #f7f9fd !important;
      border-radius: 0;
      padding: 20px 30px;
      margin-right: 20px;

      .control-width {
        height: inherit;

        .invoice-remark {
          min-height: 120px;
          line-height: 22px !important;
          overflow-y: hidden;
          border: none;
          width: 340px!important;
        }
      }
    }
  }
}

//自助大屏设置
.aa_selfscreensetting {
  .meta-default-container.group-container {
    display: block !important;

    .form-left.Manual-calculation-left {
      display: block;
      width: 100%;
    }
  }
}

.split_container {
  .form-left.Manual-calculation-left {
    width: 100%;
  }
  .form-left+.form-base{
    flex: 1;
  }
}

.u-tabs-content .meta-default-container .split_container .split_right .form-left.Manual-calculation-left {
  width: auto;
}

.u-tabs-content .meta-default-container .split_container .split_right{
  .auth-user-select,.auth-role-select {
    .form-left.Manual-calculation-left{
      width:40%;
    }
  }
}

// 左树右表结构
.form-left.Manual-calculation-left {
  height: 100%;
  display: block !important;
  overflow: auto;
  width: 240px;
  .left-tree-select-count.meta-default-container {
    height: 100%;
  }

  .bg-white.border-r {
    overflow: initial; // fix: zhangkunk 折叠效果样式调整

    .search-tree-3 {
      height: calc(~'100% - 52px');
      overflow-y: auto;
      overflow-x: hidden;
    }
  }
  .viewCell.width-percent-100{
    //编辑态输入框
    .u-input-group,.ant-select,.ac-input-locale,.u-select{
        width: 100%!important;
    }
    //浏览态输入框
    .control-text{
        width: 100%;
    }  
  }
  .filter-tree-enum {
    padding: 8px;
    &.readonly .control-text{
      border: none;
    }
  }
}

// 电商通 - 仓库配送范围
.tree-include {
  .Manual-calculation-left {
    .tree-left {
      float: left;
      width: 100%;
    }
  }
}

.control-text {
  border: 1px solid #eee;
  height: 28px;
  min-height: 28px;
  line-height: 26px;
  border-radius: 4px;
  padding: 0 10px;
  overflow: hidden;
  width: 100%;
  word-wrap: break-word;
  .text-wrapper{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

//QDJM-5999-滑动出现input编辑框
.meta-table.listTable{
  .editCol{
    padding: 3px 10px 0 2px!important;
  }
  .public_fixedDataTable_bodyRow .textCol >div.has-feedback {
    margin-left: -8px;
    margin-top: -1px!important;
  }
  //出现校验错误的时候
  .public_fixedDataTable_bodyRow:hover{
    .s-popover-inner-span{
      .textCol{
        padding-left: 2px!important;
        padding-right: 2px!important;
      }
      .textCol>div.has-feedback{
        margin-top: -2px!important;
        margin-left: 0!important;
        .ant-input{
          border: none;
        }
      }
    }
  }
  .s-popover-inner-span{
    .textCol{
      height: 28px!important;
      background: #fff;
      .ant-input{
        border: none;
      }
    }
    .editCol{
      padding: 0!important;
      height: 28px!important;
      .u-input-number.u-input-number-focused{
        border: none;
        height: 26px;
      }
      .u-input-group.simple .u-form-control{
        border: none;
        height: 26px;
      }
      .basic-input-text .u-form-control-affix-wrapper .u-form-control.input_focused{
        border: none;
        height: 26px;
      }
      .basic-list-refer .s-popover-inner-span .ant-select:not(.ant-select-disabled) .ant-select-selection{
        border: none;
        height: 26px;
      }
    }
  }
}

.meta-table.listTable.ap_adjustprice_sunbody_page_ml_data{
  .editCol{
    padding: 3px 10px 0 2px!important;
    &>.refer-div{
      margin-top: -2px!important;
    }
  }
}
//UISJ-5-滑动出现input编辑框
.u-modal{
  .bill-setting-modal {
    .ant-search-input-wrapper {
      .u-input-group.simple {
        .u-form-control:not(:last-child){
          padding-right:45px!important;
        }
      }
    }
    .public_fixedDataTableCell_cellContent{
      .textCol{
        .basic-input-text{
          margin-left: -8px;
        }
      }
      .editCol{
        // .number-control{
        //   margin-left: -8px;
        // }
        // .edit-input-number>.u-select{
        //   margin-left: -8px; 
        // }
        // .basic-input-text>.ac-input-locale{
        //    margin-left: -8px;
        // }
        .u-form-control {
          display: block;
        }
      }
    }
    .public_fixedDataTable_bodyRow:hover{
      .textCol{
        .basic-input-text{
          margin-left: -8px;
        }
      }
    }
    .editCol .checkradio-container {
      padding-left: 8px;
    }
    .editCol .edit-input-number {
      padding-top: 1px;
    }
  }
}