/**
 * Copyright © 2016-2023 The Thingsboard Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../../../../../../../scss/constants';

.tb-data-key-row {
  .mat-mdc-form-field.tb-inline-field.tb-key-field {
    .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) {
      padding-left: 8px;
      padding-right: 0;
      .mat-mdc-form-field-infix {
        padding-top: 0;
        padding-bottom: 6px;
        .mdc-evolution-chip-set .mdc-evolution-chip {
          margin: 0;
        }
        input.mat-mdc-chip-input {
          height: 32px;
          margin-left: 0;
        }
      }
    }
    .mat-mdc-chip.mat-mdc-standard-chip.tb-datakey-chip {
      .tb-attribute-chip {
        .tb-chip-labels {
          background: transparent;
        }
      }
    }
  }

  .tb-source-field {
    width: 108px;
    min-width: 108px;
  }

  .tb-key-field {
    flex: 1;
    min-width: 150px;
    @media #{$mat-gt-sm} {
      flex: 1 1 60%;
    }
  }

  .tb-label-field {
    flex: 1 1 40%;
    min-width: 100px;
  }

  .tb-color-field, .tb-units-field, .tb-decimals-field {
    display: flex;
    flex-direction: row;
    place-content: center;
    align-items: center;
  }

  .tb-units-field {
    width: 80px;
    min-width: 80px;
  }

  .tb-color-field {
    width: 40px;
    min-width: 40px;
  }

  .tb-decimals-field {
    width: 60px;
    min-width: 60px;
  }

  .tb-label-field, .tb-units-field, .tb-color-field, .tb-decimals-field {
    display: none;
    @media #{$mat-gt-sm} {
      display: block;
    }
  }

  .tb-settings-button {
    width: 40px;
    min-width: 40px;
  }

  &.tb-single-row {
    padding: 0;
    .tb-units-field, .tb-decimals-field {
      min-width: 0;
      width: auto;
    }
    .tb-units-field {
      tb-unit-input {
        width: auto;
        max-width: 140px;
      }
    }
    .tb-decimals-field {
      .mat-mdc-form-field {
        width: auto;
        max-width: 140px;
      }
    }
  }
}
