@import '../../../theme/theme-default.less';
@st-prefix: ~'.st';

@{st-prefix} {
  display: block;
  &__p-left {
    .@{ant-prefix}-table-pagination {
      display: block;
      float: none;
      text-align: left;
    }
  }
  &__p-center {
    .@{ant-prefix}-table-pagination {
      display: block;
      float: none;
      text-align: center;
    }
  }
  // 修复按钮block
  &__btn {
    &-sub {
      @{st-prefix}__btn-text {
        color: inherit;
      }
    }
    &-disabled {
      @{st-prefix}__btn-text {
        color: @st-btn-disabled-color;
        pointer-events: none;
      }
    }
  }
  // 调整表头宽度
  .nz-resizable-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    > i {
      width: 1px;
      height: 60%;
      background: @border-color-split;
    }
  }
  .nz-resizable-preview {
    border-width: 0;
    border-right-width: 1px;
  }
  // 清除页码底部间距，在大部分列表中会包裹 `nz-card` 导致底部间距过大，若有需求可自行使用 `mb-md` 来调整
  .@{ant-prefix}-table ~ nz-pagination > .@{ant-prefix}-pagination {
    margin-bottom: 0;
  }

  &__filter {
    &-keyword {
      padding: @layout-gutter;
    }
  }
  // Title
  .@{ant-prefix}-table-column-title {
    display: flex;
    align-items: center;
  }
  &__head {
    &-optional,
    &-tip {
      margin-left: 2px;
      color: @st-title-optional-color;
    }
  }
  // 修复自动定义图标无法高亮问题
  .@{ant-prefix}-table-thead > tr > th .@{ant-prefix}-table-filter-selected.@{ant-prefix}-table-filter-icon {
    color: @primary-color;
  }
  // 修复全选与快捷的间距
  &__checkall-selection {
    display: inline-block;
    margin-left: 4px;
  }
  // 修复 `st` 会导致内嵌表格的BUG
  .@{ant-prefix}-table-tbody > tr {
    .@{ant-prefix}-table-wrapper:only-child {
      // 修复 https://github.com/ohayojp/ohayojp/issues/1619
      .ant-table-tbody > tr:last-child > td {
        border-bottom: @border-width-base @border-style-base @border-color-split;
      }
      // 额外产生边距 https://github.com/ohayojp/ohayojp/issues/1608
      .@{ant-prefix}-table {
        margin: 0;
      }
    }
  }
  // 修复无法显示阴影问题
  .@{ant-prefix}-table {
    &-cell-fix-left-first::after,
    &-cell-fix-left-last::after {
      transform: translateX(80%);
    }
    &-cell-fix-right-first::after,
    &-cell-fix-right-last::after {
      transform: translateX(-80%);
    }
  }

  @media screen and (min-width: @nz-table-rep-min-width) {
    &__width {
      &-strict {
        .ant-table-content {
          > table {
            word-wrap: break-word !important;
            table-layout: fixed !important;
          }
        }
      }
    }
  }
}
