/**
 * Copyright (c) 2015 Bosch Software Innovations GmbH and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
// scss-lint:disable ImportantRule, PropertySortOrder

@mixin table-common {

  //Table common style
  .sp-table {

    //Table header background color and fonts
    .v-table-focus {
      outline: none;
    }

    .v-table-table {
      -webkit-box-shadow: none;
      box-shadow: none;
    }

    .v-table-body {
      background-color: $widget-bg;
      overflow-y: auto !important;
      z-index: 0 !important;
      border: 1px solid $widget-border-color;
    }

    .v-table-header-wrap,
    .v-table-header-drag {
      border-top: 1px solid $widget-border-color !important;
    }

    .v-table-resizer {
      margin-left: -8px !important;
    }

    .v-table-cell-content {
      overflow: visible;
      padding-left: 6px !important;
      padding-right: 6px !important;
    }

    //Below style wraps the text and displays ellipses when the text length is more the column width
    .v-table-cell-wrapper {
      line-height: 1.5;
      cursor: move;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      -o-text-overflow: ellipsis;
      -icab-text-overflow: ellipsis;
      -khtml-text-overflow: ellipsis;
      -moz-text-overflow: ellipsis;
      -webkit-text-overflow: ellipsis;
    }

    //Table row icon color when row is selected
    tr.v-selected {

      .sp-table .v-icon {
        color: $widget-bg;
      }

      .tablePin .v-icon {
        color: $widget-bg;
      }
    }

    //Table row icon color when on hover of row
    tr.v-selected:hover {
      .tablePin .v-icon {
        color: $hawkbit-primary-color !important;
      }

      .pin-icon {
        visibility: visible;
      }

      //Icon in software table in distribution view
      .swm-artifact-dtls-icon {
        visibility: visible;
        color: $widget-bg !important;
      }

      div.pin-icon:hover {
        background-color: $widget-bg !important;
        color: $hawkbit-primary-color !important;
      }
    }

    //Icon style - on over of unselected row
    tr:hover {
      .pin-icon {
        visibility: visible;
      }

      .swm-artifact-dtls-icon {
        visibility: visible;
      }
    }

    .v-table-row.v-table-row-highlight-white,
    .v-table-row-odd.v-table-row-highlight-white {
      background-color: $widget-bg;
    }

    //Row color - installed
    .v-table-row.v-table-row-highlight-orange,
    .v-table-row-odd.v-table-row-highlight-orange {
      @include valo-gradient($installed-row-color);
    }

    //Row color - assigned
    .v-table-row.v-table-row-highlight-green,
    .v-table-row-odd.v-table-row-highlight-green {
      @include valo-gradient($assigned-row-color);
    }
  }

  .table-layout {
    background: $widget-bg;
    border-radius: $v-border-radius;
  }

  //Layout - with no bottom border
  .no-border-bottom {
    border-bottom: none !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }

  //Layout - with no top border
  .no-border-top {
    border-top: none !important;
    border-top-right-radius: 0 !important;
    border-top-left-radius: 0 !important;
  }

  .bordered-layout {
    border: 1px solid $widget-border-color;
    border-radius: $v-border-radius;
  }

  .no-stripes .v-grid-row-stripe > td {
    background-color: $v-grid-row-background-color;
  }

  //Table details - tab
  .details-tab {
    margin: 5px !important;
    color: $table-details-tab-font-color !important;

    .v-caption {
      font-size: $v-font-size * $details-tab-caption-font-scale !important;
    }
  }

  //Layout in table details tab
  .details-layout {
    height: 116px;
    padding: 12px;
    overflow-y: auto;
    overflow-x: auto;
  }

  .details-description {
    padding: 0;
    overflow-y: hidden;
    overflow-x: hidden;
  }

  //*Software module table in distribution details tab*
  .sw-module-table {
    .v-table-header-wrap,
    .v-table-header-drag {
      background-color: transparent !important;
      background-image: none;
      font-weight: 400;
      font-size: 12px;
    }

    .v-table-cell-content {
      height: 27px;
      font-size: 12px;
    }
  }

  //Details - Module tab - assigned software module name style before saving
  .assignlabelstyle {
    font-style: italic !important;
  }

  //Distribution view- software module table - icon
  .swm-artifact-dtls-icon {
    visibility: hidden;
    float: right;
  }

  .metadata-details {
    .v-grid-tablewrapper {
      border: none;
    }

    .v-grid-tablewrapper .v-grid-row .v-button{
      padding: 0;
    }
  } 
  
  .metadata-grid {
  	tr {
  		.icon-only {
         visibility: hidden;
         color: $discard-icon-color;
        }
    }
  
  	tr.v-grid-row-selected{
  		.icon-only .v-icon {
  		 color : $widget-bg;
  	    }
  	}
  	
  	tr.v-grid-row-selected:hover {
  	 .icon-only {
        visibility: visible;
        color: $widget-bg !important;
      }
  	 }
  	 
  	 tr:hover {
      .icon-only {
        visibility: visible;
      }
    }
  }
}
