@import './var';

.param-text-selector {
  position: relative;
  flex: 1;
  max-width: 100%;
  min-width: calc(7em + 24px + 2px);
  padding: calc((#{$input-height} - 22px) / 2) calc(1em + 14px) calc((#{$input-height} - 22px) / 2)
    10px;
  line-height: 0;
  border: 1px solid $border-color;
  border-radius: 2px;
  cursor: pointer;
  background: $bg;

  &.readonly {
    padding: calc((#{$input-readonly-height} - 20px) / 2) 0;
    border-color: transparent;
    overflow: initial;
    white-space: initial;
    cursor: default;
    background: transparent;

    &.multiple {
      white-space: pre-wrap;
    }
  }

  &.multiple {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
}

.param-text-selector-arrow {
  position: absolute;
  top: 50%;
  right: 7px;
  margin: -0.5em 0 0;
  color: $border-color !important;
}

.param-text-selector-val {
  display: inline-block;
  margin: 0 6px 0 0;
  line-height: 20px;
  white-space: initial;
  vertical-align: middle;
}

.param-text-selector-placeholder {
  display: inline-block;
  margin: 0 6px 0 0;
  line-height: 20px;
  color: $placeholder-color;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  vertical-align: middle;
}

.param-text-selector-multi-val {
  display: inline-block;
  margin: 0 6px 0 0;
  padding: 0 3px 0 8px;
  line-height: 20px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
  vertical-align: middle;

  svg {
    display: inline-block;
    margin: 0 0 0 4px;
    color: #999;
    cursor: pointer;
  }
}

.param-text-selector-popover {
  .ant-popover-inner-content {
    max-height: 50vh;
    overflow-y: auto;
  }
}

.param-text-selector-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 240px;
  margin: 0 -16px;
  padding: 0 16px;
  line-height: 30px;
  color: rgba($text-color, 0.6);
  cursor: pointer;

  &.param-text-selector-option-checked {
    font-weight: bold;
    color: $text-color;
  }

  &.param-text-selector-option-disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }

  &:hover {
    color: $text-color;
    background: rgba(0, 0, 0, 0.1);
  }

  svg {
    color: #57be6a;
  }
}
