<commit_before>import React from 'react'
import DropDownSearchFilter from './DropDownSearchFilter'

export default class AbstractSingleSelectDropDownSearchFilter extends DropDownSearchFilter {
  setupBoundMethods () {
    super.setupBoundMethods()
    this.onClickSelectedItemBody = this.onClickSelectedItemBody.bind(this)
  }

  onClickClearButton () {
    this.props.childExposedApi.deselectAllItems()
    super.onClickClearButton()
  }

  onClickSelectedItemBody () {
    this.onClickClearButton()
  }

  renderSelectedLabel () {
    throw new Error('renderSelectedLabel must be overridden by subclasses!')
  }

  get selectedItemKey () {
    if (this.props.selectedListItemsMap.size === 0) {
      return null
    }
    return this.props.selectedListItemsMap.keys().next().value
  }

  get selectedItemValue () {
    if (this.props.selectedListItemsMap.size === 0) {
      return null
    }
    return this.props.selectedListItemsMap.get(this.selectedItemKey)
  }

  renderSelectedValue (extraProps) {
    return <span {...extraProps} className={'searchinput__selected searchinput__selected--single'} key={'selected value'}>
      <span className={'searchinput__selected_preview'}>
        {this.renderSelectedLabel()}
      </span>
    </span>
  }

  renderBodyContent () {
    const blockStyle = {
      style: {
        display: 'block'
      }
    }
    const noneStyle = {
      style: {
        display: 'none'
      }
    }

    if (this.props.selectedListItemsMap.size === 0) {
      return [
        this.renderSearchInput(blockStyle),
        this.renderSelectedValue(noneStyle)
      ]
    }
    return [
      this.renderSearchInput(noneStyle),
      this.renderSelectedValue(blockStyle)
    ]
  }
}<commit_msg>cradmin_js..filterlist..AbstractSingleSelectDropDownSearchFilter: fix styling on selected item<commit_after>import React from 'react'
import DropDownSearchFilter from './DropDownSearchFilter'

export default class AbstractSingleSelectDropDownSearchFilter extends DropDownSearchFilter {
  setupBoundMethods () {
    super.setupBoundMethods()
    this.onClickSelectedItemBody = this.onClickSelectedItemBody.bind(this)
  }

  onClickClearButton () {
    this.props.childExposedApi.deselectAllItems()
    super.onClickClearButton()
  }

  onClickSelectedItemBody () {
    this.onClickClearButton()
  }

  renderSelectedLabel () {
    throw new Error('renderSelectedLabel must be overridden by subclasses!')
  }

  get selectedItemKey () {
    if (this.props.selectedListItemsMap.size === 0) {
      return null
    }
    return this.props.selectedListItemsMap.keys().next().value
  }

  get selectedItemValue () {
    if (this.props.selectedListItemsMap.size === 0) {
      return null
    }
    return this.props.selectedListItemsMap.get(this.selectedItemKey)
  }

  renderSelectedValue (extraProps) {
    return <span
      className={'searchinput__selected searchinput__selected--single'}
      key={'selected value'}
      onClick={this.onClickSelectedItemBody}
      {...extraProps}>
      <span className={'searchinput__selected_preview'}>
        {this.renderSelectedLabel()}
      </span>
    </span>
  }

  renderBodyContent () {
    const noneStyle = {
      style: {
        display: 'none'
      }
    }

    if (this.props.selectedListItemsMap.size === 0) {
      return [
        this.renderSearchInput(),
        this.renderSelectedValue(noneStyle)
      ]
    }
    return [
      this.renderSearchInput(noneStyle),
      this.renderSelectedValue()
    ]
  }
}
{'fraction_non_alphanumeric': 0.10631609031151758, 'fraction_numerical': 0.0017147756501857674, 'mean_word_length': 3.23728813559322, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1096262', 'n_tokens_mistral': 1018, 'n_tokens_neox': 1005, 'n_words': 169}