@import "../common/var";
@import "../mixins/mixins";
@import "./picker-panel.scss";

@include b(date-picker) {
  width: 322px;

  &.has-sidebar.has-time {
    width: 434px;
  }

  &.has-sidebar {
    width: 438px;
  }

  &.has-time .el-picker-panel__body-wrapper {
    position: relative;
  }

  .el-picker-panel__content {
    width: 280px;
  }

  table {
    table-layout: fixed;
    width: 100%;
  }

  @include e(editor-wrap) {
    position: relative;
    display: table-cell;
    padding: 0 5px;
  }

  @include e(time-header) {
    position: relative;
    border-bottom: 1px solid $--datepicker-inner-border-color;
    font-size: 12px;
    padding: 8px 5px 5px 5px;
    display: table;
    width: 100%;
    box-sizing: border-box;
  }

  @include e(header) {
    margin: 12px;
    margin-bottom: 0;
    text-align: center;

    @include m(bordered) {
      margin-bottom: 0;
      padding-bottom: 12px;
      // border-bottom: solid 1px $--border-color-lighter;

      &+.el-picker-panel__content {
        margin-top: 0;
      }
    }
  }

  &.has-separate {
    width: auto;
  }

  @include e(separate) {
    display: flex;

    &-left {
      border-right: 1px solid $--border-color-light;
    }

    &-right {
      width: 268px;
      height: auto;
      background-color: $--color-white;

      .el-date-picker__separate-time {
        width: 100%;
        padding-top: 12px;
        text-align: center;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
      }

      .time-unfold {
        transform: unset;
        &-popper {
          box-shadow: none;
          border: none;
          margin-top: -5px;
          .el-scrollbar__wrap {
            width: 100%;
            overflow: hidden;
          }
          .el-scrollbar__bar {
            width: 0;
            height: 0;
          }
        }
      }

      .el-time-spinner {
        width: calc(100% - 32px);
        padding-top: 12px;
        margin-left: 16px;
        margin-right: 16px;
        &__wrapper {
          max-height: 250px;

          .el-time-spinner__list {
            &::after,
            &::before {
              content: '';
              display: block;
              width: 100%;
              height: 108px;
            }

            &-block {
              width: calc(100% - 42px);
              left: 21px;
              z-index: 0;
              cursor: pointer;
            }

            .el-time-spinner__item {
              position: relative;
              z-index: 1;
            }
          }
        }
      }
    }
  }

  @include e(header-label) {
    font-family: PingFangSC-Medium, PingFang SC;
    font-size: 16px;
    font-weight: 500;
    padding: 0 5px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    color: $--color-text-regular;

    &:hover {
      color: $--datepicker-hover-font-color;
    }

    &.active {
      color: $--datepicker-active-color;
    }
  }

  @include e(prev-btn) {
    float: left;
  }

  @include e(next-btn) {
    float: right;
  }

  @include e(time-wrap) {
    padding: 10px;
    text-align: center;
  }

  @include e(time-label) {
    float: left;
    cursor: pointer;
    line-height: 30px;
    margin-left: 10px;
  }
}