@import '../../../globals/vars';
@import './table-toolbar-svg-button';
@import './advanced-filter-flyout';

div.#{$prefix}--toolbar-action.#{$prefix}--toolbar-search-container-expandable {
  > div.#{$prefix}--search.#{$prefix}--search--sm.table-toolbar-search {
    flex-grow: 2;
  }
}

.#{$iot-prefix}--table-toolbar-secondary-title {
  padding: $spacing-05;
  @include type-style('productive-heading-01');
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.#{$iot-prefix}--table-toolbar {
  width: 100%;
  padding-top: $spacing-01;
}

.#{$iot-prefix}--table-toolbar-content {
  flex: 1;
  font-size: 0.875rem;
  // Z-index higher than 1 is needed to have Dropdown components correctly show
  // the listbox on top of the relatively positioned table columns and reszie handle.
  z-index: 2;
}

.#{$prefix}--batch-actions:not(.#{$prefix}--batch-actions--active) ~ .#{$prefix}--toolbar-content {
  // The carbon clip-path is hiding the menus for Dropdowns placed in the toolbar,
  // but the clip-path is only needed when batch actions are active.
  clip-path: unset;
}

.#{$iot-prefix}--table-batch-actions {
  z-index: 3;

  & + .bx--toolbar-action {
    padding: 0;
  }

  // TODO - remove this entire selector once we've upgraded to Carbon v10.18.0+
  // https://github.com/carbon-design-system/carbon/pull/6660
  .#{$prefix}--action-list {
    position: absolute;
    right: 0;
  }

  // TODO - remove this entire selector once we've upgraded to Carbon v10.18.0+
  // https://github.com/carbon-design-system/carbon/pull/6660
  .#{$prefix}--batch-summary {
    position: absolute;
    left: 0;
  }
}

.#{$iot-prefix}--table-tooltip-container {
  padding: $spacing-05 0;
}

.#{$iot-prefix}--table-row-edit-actions {
  display: flex;
  justify-content: flex-end;
  flex-grow: 1;
  padding: $spacing-03;
}

html[dir='rtl'] {
  .#{$iot-prefix}--table-batch-actions {
    .#{$prefix}--action-list {
      left: 0;
      right: auto;
    }

    .#{$prefix}--batch-summary {
      left: auto;
      margin-left: 0;
      margin-right: $spacing-05;
      right: 0;
    }

    .#{$prefix}--btn--primary.#{$prefix}--batch-summary__cancel::before {
      left: auto;
      right: 0;
    }
  }
}

.#{$iot-prefix}--table-toolbar-aggregations__overflow-menu {
  min-height: $spacing-09;
  width: $spacing-09;
}

.#{$iot-prefix}--table-toolbar-aggregations__overflow-icon {
  height: initial;
  width: initial;
}
