@import './token.less';


.@{ns}-Draggable{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;

  // 线
  .sash-container{
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;

    .code-sash-mask{
      position: fixed;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      z-index: 30;

      &.active{
        pointer-events: auto;
      }

      &.vertical{
        cursor: col-resize;// ew-resize

        &.minimum{
          cursor: e-resize;
        }
        &.maximum{
          cursor: w-resize;
        }
      }

      &.horizontal{
        cursor: row-resize;// ew-resize

        &.minimum{
          cursor: s-resize;
        }
        &.maximum{
          cursor: n-resize;
        }
      }
    }

    .code-sash{
      position: absolute;
      z-index: 35;
      touch-action: none;
      pointer-events: auto;

      &::before{
        content: "";
        pointer-events: none;
        position: absolute;
        width: 100%;
        height: 100%;
        transition: background-color .1s ease-out;
        background: transparent;
        user-select: none;
      }
      &:hover, &.active{
        &::before{
          background: var(--primary-color);
        }
      }

      &.vertical{
        cursor: col-resize;
        top: 0;
        width: @pd-draggable-sash-width;
        height: 100%;

        &::before{
          width: @pd-draggable-sash-width;
          left: calc(50% - @pd-draggable-sash-width/2);
        }
      }

      &.horizontal{
        cursor: row-resize;
        left: 0;
        width: 100%;
        height: @pd-draggable-sash-width;
        &::before{
          top: calc(50% - @pd-draggable-sash-width/2);
          height: @pd-draggable-sash-width;
        }
      }
    }
  }

  // 内容
  .split-view-container{
    position: relative;
    width: 100%;
    height: 100%;
    white-space: nowrap;
    overflow: hidden;

    .split-view-view{
      position: absolute;
      white-space: normal;
      &:not(.visible){
        display: none;
      }
    }
  }

  &.horizontal{
    > .split-view-container{
      > .split-view-view{
        height: 100%;
      }
    }
  }

  &.vertical{
    > .split-view-container{
      > .split-view-view{
        width: 100%;
      }
    }
  }
}
