// @import '../_utils.scss';

.#{$editgird-prefix-cls} {
  width: inherit;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  color: $text-color;
  font-size: $font-size-small;
  background-color: $editgrid-background-color;
  @include theme-font-color($__editgird_font-color);
  @include theme-background-color($__editgird_background-color);

  &-wrapper {
    position: relative;
    border: 1px solid $border-color-base;
    border-bottom: 0;
    border-right: 0;
    @include theme-border-color($__editgird-wrapper_border-color);
    &:focus {
      outline: none;
    }
    // asyctreeGird 迁移过来的类
    .h-spin-fix {
      border-bottom: 1px solid $border-color-base;
      border-right: 1px solid $border-color-base;
      @include theme-border-bottom-color($__asycTreeGird_border-bottom-color);
      @include theme-border-right-color($__asycTreeGird_border-right-color);
    }
    // asyctreeGird 迁移过来的类
    .canEdit.#{$select-prefix-cls}.#{$select-prefix-cls}-single {
      vertical-align: text-top;
    }
  }

  &-hide {
    opacity: 0;
  }

  &::before {
    content: "";
    width: 100%;
    height: 1px;
    position: absolute;
    left: 0;
    bottom: 0;
    background-color: $border-color-base;
    z-index: 1;
    @include theme-background-color($__editgird_befor_background-color);
  }

  &::after {
    content: "";
    width: 1px;
    height: 100%;
    position: absolute;
    top: 0;
    right: 0;
    background-color: $border-color-base;
    z-index: 3;
    @include theme-background-color($__editgird_after_background-color);
  }
  // & table{
  //   table-layout: fixed;
  // }
  &-with-header {
    //border-radius: $border-radius-base $border-radius-base 0 0;
  }

  &-with-footer {
    //border: 1px solid $border-color-base;
    //border-radius: 0 0 $border-radius-base $border-radius-base;
  }

  &-with-header.#{$editgird-prefix-cls}-with-footer {
    //border-radius: $border-radius-base;
  }

  &-title,
  &-footer {
    height: $editgrid-title-height;
    line-height: $editgrid-title-height;
    border-bottom: 1px solid $border-color-bottom;
    @include theme-border-bottom-color($__editgird-title_border-bottom-color);
  }

  &-footer {
    border-bottom: none;
    @include theme-border-bottom-color($__editgird-footer_border-bottom-color);
  }

  &-header {
    // width: 100%;
    overflow: hidden;
  }

  &-body {
    overflow: auto;
    @include scrollbar;
    //position: relative;
  }

  &-with-fixed-top.#{$editgird-prefix-cls}-with-footer {
    .#{$editgird-prefix-cls}-footer {
      border-top: 1px solid $border-color-base;
      @include theme-border-top-color($__editgird-footer_border-top-color);
    }

    tbody tr:last-child td {
      border-bottom: none;
      @include theme-border-bottom-color($__editgird-tbody-last-child-td_border-bottom-color);
    }
  }

  th,
  td {
    min-width: 0;
    height: $table-normal-td;
    box-sizing: border-box;
    text-align: left;
    vertical-align: middle;
    border-bottom: $editgrid-th-td-border-bottom;
    @include theme-border-bottom-color($__editgird-td_border-bottom-color);
  }

  th {
    height: $editgrid-th-height;
    // white-space: nowrap;
    overflow: hidden;
    background-color: $table-thead-bg;
    font-size: $font-size-base;
    @include theme-background-color($__editgird-th_background-color);
    @include theme-border-bottom-color($__editgird-th_border-bottom-color);
  }

  td {
    background-color: transparent;
    transition: background-color $transition-time $ease-in-out;
    @include theme-background-color($__editgird-td_background-color);
  }

  th.#{$editgird-prefix-cls}-column,
  td.#{$editgird-prefix-cls}-column {
    &-left {
      text-align: left;
    }

    &-center {
      text-align: center;
    }

    &-right {
      text-align: right;
    }
  }
  th.#{$editgird-prefix-cls}-head-column,
  td.#{$editgird-prefix-cls}-body-column {
    &-left {
      text-align: left;
    }

    &-center {
      text-align: center;
    }

    &-right {
      text-align: right;
    }
  }

  & table {
    //width: 100%;
    table-layout: fixed;
  }

  &-border {
    th,
    td {
      border-right: $editgrid-border-right;
      @include theme-border-right-color($__editgird-border-td_border-right-color);
    }

    th {
      @include theme-border-right-color($__editgird-border-th_border-right-color);
    }
  }

  &-cell {
    width: 100%;
    padding: $editgrid-cell-padding;
    white-space: nowrap;
    word-break: break-all;
    text-overflow: ellipsis;
    overflow: hidden;

    &-ellipsis {
      word-break: keep-all;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    &-with-expand {
      height: $editgrid-with-expand;
      line-height: $editgrid-with-expand;
      padding: 0;
      text-align: center;
    }

    &-with-render {
      overflow: auto;

      div {
        float: left;
      }
      // div:first-child{
      //   padding-right:10px;
      // }
    }

    &-ellipsis-with-render {
      overflow: hidden;
      word-break: keep-all;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    &-group {
      width: 100%;
    }

    &-title {
      margin-left: 10px;
      // 英文很长时间需要换行
      word-break: break-word;
    }

    &-expand {
      display: inline-block;
      margin-left: $editgrid-expand-margin-left;
      cursor: pointer;
      transition: transform $transition-time $ease-in-out;

      i {
        font-size: $font-size-base;
        @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);
      }

      &-expanded {
        transform: rotate(90deg);
      }
    }
  }

  &-icon-click:hover {
    color: $primary-color;
    @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);

    i {
      font-size: $font-size-base;
      @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);
    }
  }

  &-icon-click {
    display: inline-block;
    cursor: pointer;
    font-size: $font-size-base;
    transition: transform $transition-time $ease-in-out;

    i {
      font-size: $font-size-base;
      @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);
    }

    &-expanded {
      transform: rotate(90deg);
    }
  }

  &-hidden {
    visibility: hidden;
  }

  th &-cell {
    white-space: nowrap;
    overflow: hidden;
    vertical-align: middle;
  }

  &-stripe &-body,
  &-stripe &-fixed-body {
    tr:nth-child(2n) {
      td {
        background-color: $table-td-stripe-bg;
        @include theme-background-color($__editgird-stripe-body-td_even_background-color);
      }
    }
  }

  &-stripe &-body tr td.#{$editgird-prefix-cls}-stripe-light {
    background-color: #fff;
    @include theme-background-color($__editgird-stripe-body-td-light_background-color);
  }

  &-stripe &-body tr td.#{$editgird-prefix-cls}-stripe-dark {
    background-color: $table-td-stripe-bg;
    @include theme-background-color($__editgird-stripe-body-td-dark_background-color);
  }

  tr.#{$editgird-prefix-cls}-row-hover,
  &-wrapper &-stripe &-body tr.#{$editgird-prefix-cls}-row-hover {
    td {
      background-color: $table-td-hover-bg;
      @include theme-background-color($__editgird-tr_hover_background-color);
    }
  }
  tr.#{$editgird-prefix-cls}-title-stripe {
    td {
      background-color: $table-td-stripe-bg;
      @include theme-background-color($__editgird-tr-title-stripe-td_background-color);
    }
  }
  tr.#{$editgird-prefix-cls}-title-expand {
    td {
      // color: #111;
      // background-color: $table-td-group-bg !important;
      // font-family: MicrosoftYaHei-Bold;
      color: $editgrid-title-expand-color;
      // text-align: left;
      //line-height: 22px;
      font-weight: bold;
      @include theme-font-color($__editgird-tr-title-expand-td_font-color);
      i {
        @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);
      }
    }
  }

  &-large {
    font-size: $font-size-base;

    th {
      height: 48px;
    }

    td {
      height: $table-large-td;
    }
  }

  &-small {
    th {
      height: 35px;
    }

    td {
      height: $table-small-td;
    }
  }
  &-row-highlight,&-row-checked,
  tr.#{$editgird-prefix-cls}-row-highlight.#{$editgird-prefix-cls}-row-hover,
  tr.#{$editgird-prefix-cls}-row-checked.#{$editgird-prefix-cls}-row-hover,
  &-wrapper &-stripe &-body tr.#{$editgird-prefix-cls}-row-highlight,
  &-wrapper &-stripe &-fixed-body tr.#{$editgird-prefix-cls}-row-highlight,
  &-wrapper &-stripe &-body tr.#{$editgird-prefix-cls}-row-checked,
  &-wrapper &-stripe &-fixed-body tr.#{$editgird-prefix-cls}-row-checked {
    td {
      background-color: $table-td-highlight-bg;
      @include theme-background-color($__editgird-tr_highlight_background-color);
    }
  }

  &-fixed,
  &-fixed-right {
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: $editgrid-fixed-box-shadow;
    border-bottom: none;
    @include theme-border-bottom-color($__editgird-fixed-right_border-bottom-color);
    @include theme-box-shadow($__editgird-fixed_box-shadow);
    @include theme-border-right-color($__editgird-fixed_border-right-color);
    // &::before {
    //   content: '';
    //   width: 100%;
    //   height: 1px;
    //   background-color: $border-color-base;
    //   position: absolute;
    //   left: 0;
    //   bottom: 0;
    //   z-index: 4;
    // }
    th,td {
      @include theme-border-right-color($__editgird-fixed_border-right-color);
    }
  }

  &-fixed-right {
    top: 0;
    left: auto;
    right: 0;
    box-shadow: $editgrid-fixed-right-box-shadow;
    @include theme-box-shadow($__editgird-fixed-right_box-shadow);
  }

  &-fixed-right-patch {
    position: absolute;
    top: 0;
    right: 0;
    background-color: $table-thead-bg;
    border-bottom: 1px solid $border-color-bottom;
    @include theme-background-color($__editgird-fixed-right-patch_background-color);
    @include theme-border-bottom-color($__editgird-fixed-right-patch_border-bottom-color);
    // border-bottom: 1px solid #e6ebf5;
  }

  &-fixed-shadow {
    width: 1px;
    height: 100%;
    position: absolute;
    top: $editgrid-fixed-shadow-top;
    right: $editgrid-fixed-shadow-right;
    box-shadow: $shadow-right;
    overflow: hidden;
    z-index: 1;
    @include theme-box-shadow($__editgird-fixed_box-shadow);
  }

  &-fixed-header {
    overflow: hidden;
  }

  &-fixed-body {
    overflow: hidden;
    position: relative;
    background: $editgrid-fixed-body-background;
    z-index: 3;
    @include theme-background-color($__editgird-fixed-body_background);
  }

  &-summation {
    border-top: 1px solid #dce1e7;
    @include theme-border-top-color($__editgird-summation_border-top-color);
  }

  &-fixed-summation {//注意该样式目前仅用于simpleGroupsTable
    overflow: hidden;
    position: absolute;
    background: $editgrid-fixed-body-background;
    @include theme-background-color($__editgird-fixed-body_background);
    box-shadow: $editgrid-fixed-box-shadow;
    @include theme-box-shadow($__editgird-fixed_box-shadow);
  }

  // SimpleGroupsTable 汇总行上边框
  &-summation-wrap {
    border-top: 1px solid $border-color-bottom;
    @include theme-border-top-color($__editgird-summation_border-top-color);
  }

  &-tip {
    overflow: auto;
    @include scrollbar;

    table {
      width: 100%;
      min-height: $table-tiptext-height;

      td {
        text-align: center;
      }
    }
  }
  // &-can-hover {
  //   .not-child:hover td{
  //     background-color: $table-td-hover-bg;
  //   }
  // }
  &-row-highlight:hover td {
    background-color: $table-td-highlight-bg !important;
    @include theme-background-color($__editgird-row-td_highlight_hover_background-color, $--important);
  }

  &-can-stripe {
    .not-child:nth-child(2n) td {
      background-color: $table-td-stripe-bg;
      @include theme-background-color($__editgird-can-stripe-td_even_background-color);
    }
  }

  &-sort {
    @include sortable();
  }

  &-filter {
    display: inline-block;
    cursor: pointer;
    position: relative;
    top: 2px;

    i {
      color: $btn-disable-color;
      transition: color $transition-time $ease-in-out;
      @include theme-font-color($__editgird-filter_icon-color);

      &:hover {
        color: inherit;
      }

      &.on {
        color: $primary-color;
        @include theme-font-color($__editgird-filter_on_icon-color);
      }
    }

    &-list {
      max-height: 160px;
      padding: $table-filter-list-padding;

      &-item {
        padding: $table-filter-list-item-padding;
        //就是选择某个元素的下一个元素
        // .h-checkbox-wrapper + .h-checkbox-wrapper{
        //     margin: 0;
        // }
        .#{$checkbox-prefix-cls}-wrapper {
          margin: $table-filter-list-checkbox-wrapper-margin;
        }

        label {
          display: block;
          margin-bottom: $table-filter-list-item-label-margin-bottom;

          & > span {
            margin-right: $table-filter-list-item-label-margin-right;
          }
        }
      }

      ul {
        padding-bottom: $table-filter-list-ul-padding-bottom;
      }

      @include select-item($editgird-prefix-cls, $editgird-select-item-prefix-cls);
    }

    &-footer {
      padding: $table-filter-footer-padding;
      border-top: 1px solid $border-color-split;
      @include theme-border-top-color($__editgird-filter-footer_border-top-color);
    }
  }

  .#{$poptip-prefix-cls}-popper {
    min-width: 0;
    text-align: left;
  }

  thead .#{$poptip-prefix-cls}-popper {
    .#{$poptip-prefix-cls}-body {
      padding: 0;
      // position:absolute
    }
  }

  &-selecion-header-cell {
    text-overflow: clip;//修复多选checkbox所在的列宽度设置的过窄时，表头出现点点点的问题
  }

  & .dbClass {
    i {
      @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);
    }
    & .#{$selecttree-prefix-cls} {
      vertical-align: text-top  //修复editgird下selecttree上部边线消失
    }
  }
}

// SimpleGroupsTable column type=selection 不缺省
.#{$editgird-prefix-cls}-no-ellipsis{
  .#{$editgird-prefix-cls}-cell{
    text-overflow: clip;
  }
}

.dbClass {
  min-height: 18px;
  i {
    @include theme-font-color($__editgird-tr-title-expand-td-icon_font-color);
  }

  .no-tree-node::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
  }
}

.asyc-check {
  .#{$checkbox-prefix-cls}-inner {
    width: 15px;
    height: 15px;
  }
}

.expand-icon {
  width: 16px;
  display: inline-block;
  @include theme-font-color($__editgird-expandicon_font-color);
}

.title-span {
  white-space: normal;
  word-break: break-all;
}
// .#{$editgird-prefix-cls} {
//   & .dbClass {
//     & .h-selectTree {
//       vertical-align: text-top  //修复editgird下selecttree上部边线消失
//     }
//   }
// }
