@import "../styles/common";

@tableHeaderBgColor:#eee;
@trHoverBgColor:#fafafa;

.w-table{
  position: relative;
}

.w-table-header{
  height: 40px;
  .w-table-tr{
    overflow: hidden;
  }
  .w-table-td{
    background: #f5f6f6;
  }
}

.w-table-body{
  overflow: hidden;

  .w-table-tr{
    &:nth-child(even),
    &.w-table-tr-hover{
      .w-table-td{
        background-color: @trHoverBgColor;
      }
    }
  }
}

.w-table-tr{
  .flex_parent();
}

.w-table-td{
  .flex_child();
  padding: 8px 10px;
  min-height: 40px;
  .flex_parent();
  align-items: center;

  &:first-child{
    padding-left: 20px;

    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
  }

  &:last-child{
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
  }
}

.w-table-fit{
  .flex_parent_column();
  overflow: hidden;
  min-height: 200px;

  .w-table-body{
    .flex_child_column();
    overflow: hidden;
  }
}

.w-table-fixed{
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;

  .w-table-fixed-left,
  .w-table-fixed-right{
    left: 0;
    top: 0;
    position: absolute;
    height: 100%;
    overflow: hidden;
    pointer-events: auto;
    .flex_parent_column();
    background-color: #fff;
    box-shadow: 6px 0 6px -4px rgba(0,0,0,0.15);
  }

  .w-table-fixed-left{
    .w-table-td{
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }

  .w-table-fixed-right{
    left: auto;
    right: 0;
    box-shadow: -6px 0 6px -4px rgba(0,0,0,0.15);

    .w-table-td{
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }

  .w-table-body{
    overflow: hidden !important;
  }
}

.w-table-scroll-y{

  .w-table-body{
    overflow-y: auto;
  }

  .w-table-header{
    padding-right: @scrollbarWidth;
  }

  .w-table-fixed{
    .w-table-header{
      padding-right: 0;
    }
  }

  .w-table-fixed-right{
    right: @scrollbarWidth;
  }
}

.w-table-scroll-x{

  .w-table-body{
    overflow-x:auto;
  }

  .w-table-fixed{
    padding-bottom: @scrollbarWidth;
  }
  .w-table-fixed-left,
  .w-table-fixed-right{
    height:calc(100% - @scrollbarWidth);
  }
}

.w-table-fixed-scroll-left-min{
  .w-table-fixed-left{
    box-shadow: none;
  }
}



.w-table-fixed-scroll-left-max{
  .w-table-fixed-right{
    box-shadow: none;
  }
}

.w-table-td-content{
  white-space: normal;
  width: 100%;
}

.w-table-select{
  cursor: pointer;
  position: relative;
  display: inline-block;

  &:after{
    content: '';
    .pos_abs();
    .full();
    z-index: 2;
    //background: red;
  }

  &:hover{
    .ant-checkbox-inner,
    .ant-radio-inner{
      border-color:@activeColor;
    }
  }
}
