@import '../../style/themes/default.less';

.ele-pro-table .ant-table-pagination.ant-pagination {
  margin-bottom: 0;
}

/* 表格空样式优化 */
.ele-pro-table tbody.ant-table-tbody {
  & > tr.ant-table-placeholder > td.ant-table-cell {
    height: var(--table-body-height);
    padding: 0;

    & > div.ant-table-expanded-row-fixed {
      margin: 0;
      height: 100%;
    }
  }
}

/* 斑马线 */
.ele-pro-table-striped .ant-table-tbody {
  tr:nth-child(odd):not(:hover):not(.ant-table-row-selected) td {
    background: @table-header-bg;
  }
}

/* 固定高度 */
.ele-pro-table .ant-table-body {
  min-height: var(--table-body-height);
}

/* 表格全屏样式 */
.ele-pro-table.ele-pro-table-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  padding: 0 0 16px 0;
  box-sizing: border-box;
  background-color: @component-background;

  .ant-table-pagination {
    margin-bottom: 0;
    padding: 0 16px;
  }

  .ele-table-tool:not(.ele-table-tool-default) {
    margin-top: 10px;
    padding: 0 16px;
  }
}

/* 列配置 */
.ele-tool-column {
  .ant-popover-inner-content {
    padding: 0;
    width: @table-tool-column-width;
    max-width: 100%;
  }

  .ant-checkbox-group {
    display: block;
  }
}

.ele-tool-column-header {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 1px solid @border-color-split;
  padding: 10px 16px;
  position: relative;
}

.ele-tool-column-item-body {
  flex: 1;
  overflow: hidden;
}

.ele-tool-column-item {
  display: flex;
  align-items: center;
  position: relative;
  padding: 4px 16px;
  transition: background-color 0.2s;

  .ant-checkbox-wrapper {
    width: 100%;

    .ant-checkbox + span {
      white-space: nowrap;
      word-break: break-all;
      text-overflow: ellipsis;
      overflow: hidden;
    }
  }

  &:not(.sortable-chosen):hover,
  &.sortable-chosen {
    background: @item-active-bg;
  }
}

.ele-tool-column-handle {
  font-size: 13px;
  color: @text-color-secondary;
  margin-right: 4px;
  cursor: move;
}

.ele-tool-column-body {
  padding: 6px 0;
  max-height: @table-tool-column-max-height;
  box-sizing: border-box;
  overflow: auto;
}

.ele-tool-column-sortable {
  .ele-tool-column-item {
    padding-left: 6px;
  }

  .ele-tool-column-header {
    padding-left: 23px;
  }
}

.ele-tool-column-fixed {
  display: flex;
  align-items: center;

  .ele-tool-fixed-item {
    font-size: 13px;
    margin-left: 4px;
    color: @text-color-secondary;
    transition: color 0.2s;
    cursor: pointer;

    &:hover {
      color: @text-color;
    }

    &.active {
      color: @primary-color;
    }
  }
}
