/**Variable**/
@import './base/checked.scss';

/*筛选*/
.vhb-cell--filter {
  padding: 0 0.1em 0 0.25em;
  text-align: center;
  vertical-align: middle;
  display: inline-block;
  line-height: 0;
  &.col--active {
    .vhb-filter--btn {
      color: $vhb-table-font-color;
    }
  }
  .vhb-filter--btn {
    color: $vhb-table-column-icon-border-color;
    cursor: pointer;
    &:hover {
      color: $vhb-table-font-color;
    }
  }
}
.is--filter-active {
  .vhb-cell--filter {
    .vhb-filter--btn {
      color: $vhb-primary-color;
    }
  }
}

/*筛选容器*/
.vhb-table--filter-wrapper {
  display: none;
  position: absolute;
  top: 0;
  min-width: 100px;
  border-radius: $vhb-border-radius;
  background-color: $vhb-table-filter-panel-background-color;
  border: 1px solid $vhb-table-popup-border-color;
  box-shadow: 0 1px 6px rgba(0,0,0,.2);
  z-index: 10;
  &:not(.is--multiple) {
    text-align: center;
  }
  &.is--active {
    display: block;
  }
  .vhb-table--filter-header,
  .vhb-table--filter-body {
    & > li {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 360px;
      padding: 0.25em 0.8em;
      cursor: pointer;
      &.is--checked {
        color: $vhb-primary-color;
      }
      &:hover {
        background-color: $vhb-table-row-hover-background-color;
      }
    }
  }
  .vhb-table--filter-header {
    padding-top: 0.2em;
  }
  .vhb-table--filter-body {
    max-height: 200px;
    padding-bottom: 0.2em;
  }
  & > ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow: auto;
    user-select: none;
  }
  &.is--multiple {
    & > ul {
      & > li {
        padding: 0.25em 0.8em 0.25em 2.3em;
      }
    }
  }
  .vhb-table--filter-footer {
    border-top: 1px solid $vhb-table-popup-border-color;
    padding: 0.6em;
    user-select: none;
    button {
      background-color: transparent;
      padding: 0 0.4em;
      border: 0;
      color: $vhb-table-font-color;
      cursor: pointer;
      &:focus {
        outline: none;
      }
      &:hover {
        color: $vhb-primary-color;
      }
      &.is--disabled {
        color: $vhb-disabled-color;
        cursor: not-allowed;
      }
    }
  }
}

.vhb-table--filter-option {
  @extend %XECheckbox;
  .vhb-checkbox--icon {
    left: 0.6em;
    top: 0.38em;
  }
}

.vhb-table {
  .vhb-table--filter-option {
    & > .vhb-checkbox--icon {
      font-size: $vhb-checkbox-font-size-default;
    }
  }
  &.size--medium {
    .vhb-table--filter-option {
      & > .vhb-checkbox--icon {
        font-size: $vhb-checkbox-font-size-medium;
      }
    }
  }
  &.size--small {
    .vhb-table--filter-option {
      & > .vhb-checkbox--icon {
        font-size: $vhb-checkbox-font-size-small;
      }
    }
  }
  &.size--mini {
    .vhb-table--filter-option {
      & > .vhb-checkbox--icon {
        font-size: $vhb-checkbox-font-size-mini;
      }
    }
  }
}