/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';

@grid-toolbar-prefix-cls: ~'@{css-prefix}grid-toolbar';
@grid-tools-prefix-cls: ~'@{css-prefix}grid-tools';
@grid-fullscreen-prefix-cls: ~'@{css-prefix}grid-fullscreen';
@grid-refresh-prefix-cls: ~'@{css-prefix}grid-refresh';
@grid-custom-prefix-cls: ~'@{css-prefix}grid-custom';
@grid-checkbox-prefix-cls: ~'@{css-prefix}grid-checkbox';
@grid-select-toolbar-prefix-cls: ~'@{css-prefix}grid__select-toolbar';

// toolbar
.@{grid-toolbar-prefix-cls} {
  padding: var(--tv-Grid-toolbar-padding-y) 0;

  + .@{grid-toolbar-prefix-cls} {
    padding-top: 0;
  }
  // Tiny 新增，工具栏容器为空则不需要占位
  &:empty {
    display: none;
  }

  &:after {
    content: '';
    display: block;
    clear: both;
    height: 0;
    overflow: hidden;
    visibility: hidden;
  }

  svg {
    fill: var(--tv-Grid-toolbar-btn-icon-color);
    font-size: var(--tv-Grid-toolbar-btn-icon-size);
  }

  &.is__loading {
    position: relative;

    &:before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      background-color: var(--tv-Grid-loading-mask-bg-color);
    }
  }

  &.size__small,
  &.size__mini {
    padding: 8px 0;
  }

  &.size__medium {
    .@{grid-refresh-prefix-cls}__btn,
    .@{grid-custom-prefix-cls}__setting-btn {
      font-size: 17px;
    }
  }

  &.size__small {
    .@{grid-refresh-prefix-cls}__btn,
    .@{grid-custom-prefix-cls}__setting-btn {
      font-size: 15px;
    }
  }

  &.size__mini {
    .@{grid-refresh-prefix-cls}__btn,
    .@{grid-custom-prefix-cls}__setting-btn {
      font-size: 14px;
    }
  }

  .@{grid-tools-prefix-cls}__wrapper,
  .@{grid-fullscreen-prefix-cls}__wrapper,
  .@{grid-refresh-prefix-cls}__wrapper,
  .@{grid-custom-prefix-cls}__wrapper {
    float: right;
    width: var(--tv-Grid-toolbar-btn-container-size);
    height: var(--tv-Grid-toolbar-btn-container-size);
    line-height: var(--tv-Grid-toolbar-btn-container-size);
    border: solid 1px var(--tv-Grid-toolbar-btn-icon-border-color);
    border-radius: var(--tv-Grid-toolbar-btn-icon-border-radius);
    text-align: center;
    margin: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      border-color: var(--tv-Grid-toolbar-btn-icon-border-color-hover);
    }
  }

  .@{grid-custom-prefix-cls}__wrapper {
    position: relative;
  }

  .@{grid-refresh-prefix-cls}__btn,
  .@{grid-fullscreen-prefix-cls}__btn,
  .@{grid-custom-prefix-cls}__setting-btn {
    vertical-align: middle;
    width: 100%;
    cursor: pointer;
    user-select: none;
  }

  .@{grid-custom-prefix-cls}__option-wrapper {
    display: none;
    position: absolute;
  }
}

.@{grid-select-toolbar-prefix-cls} {
  position: absolute;
  background-color: #fff;

  .@{grid-toolbar-prefix-cls} {
    padding: 2px 0 2px 6px;
  }
}
