@import '../../style/variables.less';

.pro-edit-table {
  .pro-edit-table-drag-wrapper-cell {
    .@{ant-prefix}-btn {
      &:hover {
        background: transparent;
      }
    }
  }
  td[rowspan] {
    vertical-align: middle !important;
  }
  .@{ant-prefix}-table-content {
    .@{ant-prefix}-table-tbody {
      .pro-form-item-add .pro-form-view-container {
        padding: 0;
        border-radius: 0;
      }
    }
  }

  .@{ant-prefix}-pagination .@{ant-prefix}-pagination-item .pro-edit-table-pagination-item-badge {
    position: relative;
    .@{ant-prefix}-badge {
      position: absolute;
      top: -10px;
      right: -10px;
    }
  }

  .pro-edit-table-tooltip {
    display: inline-flex;
    align-items: center;

    .icon-tip {
      height: 16px;
      margin-left: var(--zaui-space-size-xs, 4px);
      > div {
        height: 16px;
        svg {
          width: 16px;
          height: 16px;
          fill: var(--zaui-aide-text, #909090);
        }
      }
      svg {
        width: 16px;
        height: 16px;
        fill: var(--zaui-aide-text, #909090);
      }
    }
  }

  .com-empty {
    text-align: center;

    .img {
      width: 80px;
      height: 80px;
    }

    .content {
      display: flex;
      justify-content: center;
      margin-top: var(--zaui-space-size-md, 16px);

      .@{ant-prefix}-btn-link {
        padding: 0;
      }
    }
  }

  .is-hidden {
    position: absolute;
    left: -9999px;
  }

  .pro-edit-table-drag-wrapper {
    display: flex;
    align-items: center;
    .anticon {
      margin-right: 8px;
      cursor: pointer;
    }
    .drag-icon {
      font-size: 18px;
      color: #949599;
    }
  }
  .pro-edit-table-drag-wrapper.no-check {
    .anticon {
      margin-right: 0;
    }
  }

  &.pro-table-no-stripe {
    .@{ant-prefix}-table-tbody tr:nth-child(n) > td {
      background-color: var(--zaui-base-bg, #fff);
    }
  }

  .pro-group {
    .@{ant-prefix}-space-compact {
      gap: 0;
    }
  }

  .@{ant-prefix}-space {
    gap: var(--zaui-space-size-sm, 8px);

    .@{ant-prefix}-btn-link {
      padding: 0 var(--zaui-space-size-xs, 4px);

      &:first-child {
        padding-left: 0;
      }
    }
  }

  .@{ant-prefix}-table-header
    > table
    .@{ant-prefix}-table-thead
    > tr
    > th:not(.@{ant-prefix}-table-selection-column):not(
      .@{ant-prefix}-table-row-expand-icon-cell
    ):not([colspan]).is-required {
    &.is-required-right {
      .pro-edit-table-title {
        &::before {
          position: static;
          top: 0;
          display: inline-block;
          text-indent: -8px;
          color: #ff5050;
          font-size: var(--zaui-font-size-md, 14px);
          line-height: 1;
          content: '*';
        }
      }
    }
    &.is-required-left {
      .pro-edit-table-title {
        &::after {
          width: auto;
          position: static;
          top: 0;
          display: inline-block;
          margin-left: var(--zaui-space-size-xs, 4px);
          color: #ff5050;
          font-size: 14px;
          line-height: 1;
          content: '*';
        }
      }
    }
  }

  .@{ant-prefix}-table-scroll-horizontal {
    .@{ant-prefix}-table-cell-fix-right-first {
      &::after {
        box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
      }
    }
  }

  .@{ant-prefix}-table-content {
    > table {
      .@{ant-prefix}-table-summary {
        background-color: var(--zaui-table-header-bg, #f2f3f5);
        color: var(--zaui-text, #343434);
        font-weight: 600;
        td {
          padding: 8px 16px;
          &:first-child {
            // 左下角圆角8px
            border-bottom-left-radius: 6px;
          }
          &:last-child {
            // 右下角圆角8px
            border-bottom-right-radius: 6px;
          }
        }
        .@{ant-prefix}-table-cell-fix-left,
        .@{ant-prefix}-table-cell-fix-right {
          background-color: var(--zaui-table-header-bg, #f2f3f5);
        }
      }

      th.@{ant-prefix}-table-selection-column {
        width: 48px;
      }
      .@{ant-prefix}-table-cell-fix {
        background-color: var(--zaui-table-header-bg, #f2f3f5);
      }

      td {
        .pro-form-view-container_nowrap {
          white-space: normal;
        }
      }

      .@{ant-prefix}-table-thead
        > tr
        > th:not(.@{ant-prefix}-table-selection-column):not(
          .@{ant-prefix}-table-row-expand-icon-cell
        ):not([colspan]).is-required {
        &.is-required-right {
          .pro-edit-table-title {
            &::before {
              position: static;
              top: 0;
              display: inline-block;
              text-indent: -8px;
              color: #ff5050;
              font-size: var(--zaui-font-size-md, 14px);
              line-height: 1;
              content: '*';
            }
          }
        }
        &.is-required-left {
          .pro-edit-table-title {
            &::after {
              width: auto;
              position: static;
              top: 0;
              display: inline-block;
              margin-left: var(--zaui-space-size-xs, 4px);
              color: #ff5050;
              font-size: 14px;
              line-height: 1;
              content: '*';
            }
          }
        }
      }
    }
  }

  .@{ant-prefix}-table-cell {
    .@{ant-prefix}-form-item {
      margin-bottom: 0px !important;
    }
  }

  .@{ant-prefix}-table.@{ant-prefix}-table-bordered > .@{ant-prefix}-table-container {
    border: 0;
  }

  .@{ant-prefix}-table-thead > tr > th {
    border: 0;
    background-color: var(--zaui-table-header-bg, #f2f3f5);
  }

  .@{ant-prefix}-table-thead
    > tr
    > th:not(:last-child):not(.@{ant-prefix}-table-selection-column):not(
      .@{ant-prefix}-table-row-expand-icon-cell
    ):not([colspan])::before {
    height: 0;
  }

  .@{ant-prefix}-table-tbody > tr:not(.@{ant-prefix}-table-placeholder) > td {
    border-bottom: 0;
    border-right: 0;
    border-top: 0;
  }

  .@{ant-prefix}-table-tbody > .is-editing:not(.@{ant-prefix}-table-measure-row) > td {
    border-bottom: 0;
    // vertical-align: top;
    vertical-align: middle;
  }

  .@{ant-prefix}-table-tbody tr:nth-child(n) > td {
    background-color: var(--zaui-base-bg, #ffffff);
  }

  .@{ant-prefix}-table-tbody tr:nth-child(2n) > td {
    background-color: var(--zaui-table-strip-bg, #fafafa);
  }

  .@{ant-prefix}-table-tbody > .@{ant-prefix}-table-placeholder > td {
    background-color: var(--zaui-base-bg, #ffffff);
  }

  .@{ant-prefix}-table-tbody {
    > tr:hover:not(.@{ant-prefix}-table-expanded-row) > td,
    .@{ant-prefix}-table-row-hover,
    .@{ant-prefix}-table-row-hover > td {
      background: #fafafa;
    }
    > tr:hover:not(.@{ant-prefix}-table-placeholder) > td,
    .@{ant-prefix}-table-row-hover,
    .@{ant-prefix}-table-row-hover > td {
      background: #fafafa;
    }
  }

  .@{ant-prefix}-table-fixed {
    .@{ant-prefix}-table-row-hover,
    .@{ant-prefix}-table-row-hover > td {
      background: #fafafa;
    }
  }

  .@{ant-prefix}-table-fixed-header {
    .@{ant-prefix}-table-tbody tr:nth-child(n) > td {
      background-color: #fafafa;
    }

    .@{ant-prefix}-table-tbody tr:nth-child(2n) > td {
      background-color: var(--zaui-base-bg, #ffffff);
    }
  }

  .@{ant-prefix}-table-summary > tr > td {
    border-bottom: none;
  }

  .@{ant-prefix}-table-pagination {
    .@{ant-prefix}-pagination-options {
      .@{ant-prefix}-select.@{ant-prefix}-select-in-form-item {
        width: auto;
      }
    }
  }

  .@{ant-prefix}-table table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td,
  .@{ant-prefix}-table
    table
    .@{ant-prefix}-table-tbody
    .is-new-row.@{ant-prefix}-table-row
    td.@{ant-prefix}-table-cell-fix-left,
  .@{ant-prefix}-table
    table
    .@{ant-prefix}-table-tbody
    .is-new-row.@{ant-prefix}-table-row
    td.@{ant-prefix}-table-cell-fix-right,
  .@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal
    table
    .@{ant-prefix}-table-tbody
    .is-new-row.@{ant-prefix}-table-row
    td,
  .@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal
    table
    .@{ant-prefix}-table-tbody
    .is-new-row.@{ant-prefix}-table-row
    td.@{ant-prefix}-table-cell-fix-left,
  .@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal
    table
    .@{ant-prefix}-table-tbody
    .is-new-row.@{ant-prefix}-table-row
    td.@{ant-prefix}-table-cell-fix-right {
    background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
    border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
  }
  .@{ant-prefix}-table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row:hover,
  .@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal
    table
    .@{ant-prefix}-table-tbody
    .is-new-row.@{ant-prefix}-table-row:hover {
    td,
    .@{ant-prefix}-table-cell-row-hover {
      background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
    }
  }

  * {
    // ie浏览器
    scrollbar-face-color: #d2d3d7;
    scrollbar-highlight-color: #979797;
    scrollbar-3dlight-color: #979797;

    // 悬浮轨道
    ::-webkit-scrollbar-thumb {
      background-color: #979797;
      background-clip: padding-box;
      border-color: transparent;
      border-style: dashed;
      border-width: 4px;
      border-radius: 10px;
      -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background-color: #d2d3d7;
      background-clip: padding-box;
      border-color: transparent;
      border-style: dashed;
      border-width: 4px;
      border-radius: 10px;
      -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
    }

    ::-webkit-scrollbar-thumb {
      background-color: #979797;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }
  }
}

.pro-edit-table-footer {
  margin-top: 12px;
}

.pro-edit-table-header {
  margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
}

.pro-edit-table-toolbar-fixed {
  position: absolute;
  bottom: var(--zaui-space-size-md, 16px);
}

.pro-edit-table-toolbar {
  background-color: #fff;
  .@{ant-prefix}-space {
    gap: var(--zaui-space-size-sm, 8px);

    .@{ant-prefix}-space-item {
      .@{ant-prefix}-btn-link {
        display: flex;
        align-items: center;
        padding: 0 var(--zaui-space-size-xs, 4px);
        gap: 4px;
        &:first-child {
          padding-left: 0;
        }
      }
    }
  }
}

.pro-edit-table-drag {
  table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left {
    text-align: right;
  }
  table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-start {
    text-align: right;
  }
  table .@{ant-prefix}-table-thead {
    th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-start {
      text-align: left;
      .@{ant-prefix}-table-selection {
        padding-left: 27px;
      }
    }
  }
  table .@{ant-prefix}-table-tbody {
    td.@{ant-prefix}-table-selection-column {
      padding-left: 38px;
    }
  }
}

.pro-edit-table {
  .pro-tree-modal .pro-tree-modal-isView .pro-enum-input-addonAfter {
    border: none;
    padding-left: 0;
  }
}
