@import "../variables.less";
@import "../mixins.less";

// table TableColumnsPopover 样式
.@{prefix}column-popover {
  z-index: 9999;
  .ant-popover-inner-content {
    width: 750px;
    padding: 0;
  }
  &_content {
    position: relative;
    padding-bottom: 10px;
    min-height: 300px;
    transition: all 20ms ease-in;
    .header {
      height: 40px;
      border-top: 1px solid #e9e9e9;
      border-bottom: 1px solid #e9e9e9;
      background: #f6f6f6;
      color: rgba(0, 0, 0, .85);
      font-size: 14px;
    }
    .leftBox {
      padding: 0 16px;
      min-height: 240px;
      max-height: 70vh;
      overflow-y: auto;
    }
    &.@{prefix}column-popover_content-sort {
      padding-right: 182px;
    }
    .rightBox {
      position: absolute;
      right: 0;
      top: 0;
      display: flex;
      flex-direction: column;
      width: 182px;
      height: 100%;
      border-left: 1px solid #e9e9e9;
      //.flip-list {
      //  transition: all 0.3s ease-in-out;
      //}
      //.flip-list-move {
      //  transition: transform 0.3s;
      //}
      .no-move {
        transition: transform 0s;
      }
      // 拖动时候的样式
      .ghost {
        //opacity: 0.5;
        //background: rgba(87, 129, 244, .2);
        //box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 15%);
        //cursor: move;
        //box-shadow: @xpb-color-primary 0 0 6px -2px inset;
        //background: #f00;
        box-shadow: 1px 1px 5px 2px rgba(0,0,0,.15);
        cursor: move;
        transition: .18s ease;
      }
      .chosen {
        box-shadow: 1px 1px 5px 2px rgba(0,0,0,.15);
      }
      .list-group {
        padding-left: 8px;
        //padding-right: 16px;
        flex: 1;
        width: 100%;
        overflow-y: auto;
        .list-group-item {
          .itemWrap {
            display: flex;
            align-items: center;
            line-height: 28px;
            padding-right: 4px;
            color: #333;
            font-size: 12px;
            cursor: pointer;
            transition: .18s ease;
            width: 100%;
            // 不能拖动 不能删除
            &.disabled {
              color: rgba(0, 0, 0, 0.25);
              cursor: not-allowed;
              &.ghost {
                background: unset;
              }
              & > .dragEl {
                cursor: not-allowed;
              }
              opacity: unset;
              box-shadow: none;
              .disabled_fixed {
                width: 28px;
                margin-left: auto;
                cursor: pointer;
                color: @xpb-color-primary;
              }
            }
            .dragEl {
              font-size: 16px;
              cursor: move;
              margin-right: 8px;
            }
            .label_txt{
              display: inline-block;
              flex: 1;
              //width: 80%;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            }
            & > .delEl {
              display: none;
              margin-left: auto;
            }
            &:not(.disabled):hover {
              color: @xpb-color-primary;
              & > .delEl {
                display: inline-block;
              }
            }
          }
        }
      }
      .list-group_empty {
        position: absolute;
        left: 0;
        top: 50px;
        width: 100%;
        padding-top: 20px;
        text-align: center;
      }
    }
  }
  .checkGroup {
    width: 100%;
    padding: 0;
    display: block;
    //flex-wrap: wrap;
    .ant-checkbox-wrapper {
      color: rgba(0, 0, 0, 0.85);
      flex: 1;
      display: inline-flex;
      align-items: center;
      width: 32%;
      min-width: 32%;
      max-width: 32%;
      margin-left: 0;
      margin-right: 8px;
      padding-top: 8px;
      &:nth-child(3n + 3) {
        margin-right: 0;
      }
      span:nth-of-type(2){
        display: inline-block;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        transform: translateY(-1px);
      }
    }
  }
  .header {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 50px;
    font-size: 16px;
    color: #000;
  }
  .boxWrap {
    padding-top: 8px;
    &.no-padding{
      padding-top: 0;
    }
    .title {
      padding: 8px 0;
      &_checkBox {
        //display: flex;
        //align-items: center;
        //justify-content: space-between;
        font-size: 12px;
        color: #000;
        font-weight: bold;
        //.ant-checkbox {
        //  top: 0;
        //}
      }
    }
  }
  .footer {
    padding: 8px 16px;
    border-top: 1px solid #e9e9e9;
    display: flex;
    align-items: center;
  }
}

// table 样式
.@{prefix}table-warp {
  position: relative;
  //z-index: 0;
  padding: 0 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #fff;
  .tableLoading {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.05);
  }
  .tableBody {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    .vxeToolbar { // .vxe-toolbar 同级
      padding-top: 12px;
      //padding-bottom: 12px;
      height: auto;
      align-items: flex-start;
      .vxe-buttons--wrapper {
        display: flex;
        flex-wrap: wrap;
      }
      .vxe-tools--wrapper {
        //align-self: flex-end;
        align-self: flex-start;
      }
      .tool-right {
        // 兼容当搜索组件放置在 toolLeft 的时候
        display: flex;
        align-items: center;
        margin-bottom: 12px;
        > .ant-btn {
          color: rgba(0, 0, 0, 0.45);
          &:hover,
          &:focus,
          &:active,&.active {
            color: @xpb-color-primary;
          }
          //& + .ant-btn {
          margin-left: 8px;
          //}
        }
        // 仅带icon 的button 按钮样式
        .icon-button {
          padding: 0 7px;
        }
        .anticon{
          color: #888;
        }
        .iconfont {
          font-size: 18px;
        }
      }
    }
    .vxeTableParentEl {
      flex: 1;
      overflow-y: hidden;
    }
    .vxeTable { // 与  vxe-table 同级
      //font-family: Verdana,PingFangSC-Regular,PingFang SC,-apple-system,BlinkMacSystemFont,Segoe UI,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
      .vxe-header--column {
        &:hover .vxe-resizable.is--line{
          visibility: visible;
        }
        .vxe-resizable.is--line {
          transition: .2s all;
          visibility: hidden;
        }
        .vxe-resizable.is--line:before {
          width: 2px;
          height: 16px;
          background: #bbb;
        }
      }
      //.vxe-loading.is--visible {
      //  display: none;
      //}
      .vxe-cell {
        padding: 0 8px;
        width: unset !important;
        min-height: 22px;
      }
      .vxe-cell--sort {
        width: 12px;
      }
      // 关闭默认帮助 icon
      //.vxe-cell-help-icon {
      //  display: none;
      //}
      .slot_titleHelpWrap {
        display: flex;
        align-items: center;
        .label {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        .xpb-iconfont {
          margin-left: .2em;
          //margin-left: 6px;
          font-size: 14px;
          cursor: pointer;
          color: #888;
          font-weight: normal;
        }
      }
      .slot_defaultWrap {
      }

      td {
        vertical-align: top;
        padding: 6px 0;
        line-height: 16px;
        //&.col--checkbox,
        //&.col--tree-node {
        //  vertical-align: middle;
        //}
      }
      .vxe-footer--row {
        td {
          line-height: 26px;
          background-color: #fbfbfb;
          color: rgba(0,0,0,.9);
          font-weight: bold;
        }
      }
      //.vxe-table--border-line {
      //  border-left: 0;
      //  border-right: 0;
      //}
      .vxe-table--header-wrapper .vxe-table--header .vxe-header--row th {
        background-color: #f6f6f6;
        height: 40px;
        color: rgba(0,0,0,.9);
        //vxe-header--column
        .vxe-cell {
          height: 100%;
        }
      }
      // hover
      .vxe-body--row.row--hover {
        background-color: rgba(0, 123, 252, 0.1);
      }
      // 选中
      .vxe-body--row.row--current {
        background-color: rgba(0, 123, 252, 0.16);
      }

      .sub_row_bgc{
        background: #fafafa;
      }
    }
  }
  .vxe-pager--wrapper {
    display: flex;
    align-items: center;
    .vxe-pager--left-wrapper {
      flex: 1;
      text-align: left;
    }
  }
  .tableFooterWrap {

    .selectedWrap {
      //display: inline-flex;
      //align-items: flex-end;
      padding-right: 12px;
      line-height: 30px;
      color: @xpb-color_3;
      span {
        color: @xpb-color-primary;
        font-weight: 600;
        padding: 0 3px;
      }
    }
  }

  // 针对 有底部统计 的 left 修复
  .vxe-table--render-default .vxe-table--fixed-left-wrapper .vxe-table--body-wrapper {
    width: unset !important;
  }

  // 提示样式统一
  .vxe-table--tooltip-wrapper.theme--dark {
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 15%);
    border-radius: 2px;
    padding: 6px 8px;
    &.placement--top .vxe-table--tooltip-arrow{
      border-width: 4px;
      bottom: -8px;
      border-top-color: rgba(0, 0, 0, 0.75);
      &:before {
        //border-top-color: rgba(0, 0, 0, 0.75);
        border-width: 0;
      }
    }
    &.is--visible {
      z-index: 6666 !important;
    }
  }
  .vxe-table--render-default .vxe-cell--checkbox .vxe-checkbox--checked-icon:after,
  .vxe-table--filter-option .vxe-checkbox--checked-icon:after,
  .vxe-export--panel-column-option .vxe-checkbox--checked-icon:after,
  .vxe-custom--option .vxe-checkbox--checked-icon:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 22%;
    border: 2px solid #fff;
    border-left: 0;
    border-top: 0;
    width: 5px;
    height: 9px;
    transform: rotate(45deg) scale(1) translate(-50%, -50%);
  }

  .vxe-table--render-default {
    .vxe-cell--checkbox .vxe-checkbox--icon {
      top: 0 !important;
    }
    .vxe-tree--btn-wrapper {
      top: 6px !important;
    }
    .vxe-tree--node-btn {
      // 兼容 treeConfig  > ( > ) iconfont icon-minus_square
      //transform: translateY(-2px);
      &:hover {
        color: @xpb-color-primary;
      }
    }
    .vxe-table--empty-placeholder {
      z-index: 5 !important;
    }
  }
  .vxe-tree--node-btn.iconfont,
  .vxe-table--expand-btn.iconfont {
    font-size: 16px;
  }
  .local_noDataWrap_middle {
    transform: translateY(-50%);
  }

  .vxe-table--body {
    .vxe-cell {
      // 高亮文字样式 （类 超链接）
      .ant-dropdown-link  {
        cursor: pointer;
        color: @xpb-color-primary;
      }
    }
  }
}

// table 自定义 排序
.xpb-iconfont.xpb-custom-sort {
  color: #c0c4cc !important;
  &:hover,
  &.active {
    color: @xpb-color-primary !important;
  }
}
.@{prefix}custom-sort-popover{
  &-content-wrap {
    position: relative;
    margin: 0;
    text-align: left;
    list-style-type: none;
    background-color: #fff;
    background-clip: padding-box;
    border-radius: 2px;
    outline: none;
    width: 198px;
    .title {
      padding-bottom: 8px;
      color: rgba(0,0,0,0.45);
    }
    &_content {
      display: flex;
      .local_select {
        width: calc(100% - 123px);
        //flex: 1;
        margin-right: 12px;
      }
      //.local_radioWrap {
      //  width: 111px;
      //}
    }
    .footer {
      padding-top: 10px;
      text-align: right;
    }
  }
}