<commit_before>/**
 * @module ember-paper
 */
import Ember from 'ember';
import PowerSelect from 'ember-power-select/components/power-select';
import layout from '../templates/components/paper-autocomplete';
import ValidationMixin from 'ember-paper/mixins/validation-mixin';
import ChildMixin from 'ember-paper/mixins/child-mixin';
import { indexOfOption } from 'ember-power-select/utils/group-utils';
import calculatePosition from '../utils/calculate-ac-position';

const { assert, computed, inject, isNone, defineProperty } = Ember;

/**
 * @class PaperAutocomplete
 * @extends PowerSelectComponent
 */
export default PowerSelect.extend(ValidationMixin, ChildMixin, {
  layout,
  calculatePosition,

  util: inject.service(),
  constants: inject.service(),
  triggerComponent: 'paper-autocomplete-trigger',
  contentComponent: 'paper-autocomplete-content',
  optionsComponent: 'paper-autocomplete-options',
  triggerWrapperComponent: 'paper-autocomplete-trigger-container',
  onfocus: computed.alias('onFocus'),
  onblur: computed.alias('onBlur'),
  onchange: null,
  oninput: null,
  searchText: '',
  defaultHighlighted: null, // Don't automatically highlight any option
  _onChangeNop() { },

  extra: computed('labelPath', 'label', function() {
    return this.getProperties('label', 'labelPath');
  }),

  validationProperty: computed('onSearchTextChange', 'onSelectionChange', function() {
    if (this.get('onSearchTextChange')) {
      return 'searchText';
    } else {
      return 'selected';
    }
  }),

  concatenatedDropdownClasses: computed('dropdownClass', function() {
    let classes = ['md-autocomplete-suggestions-container md-virtual-repeat-container dude'];
    if (this.get('dropdownClass')) {
      classes.push(this.get('dropdownClass'));
    }
    return classes.join(' ');<commit_msg>chore(ac): cleanup leftover class (#869)<commit_after>/**
 * @module ember-paper
 */
import Ember from 'ember';
import PowerSelect from 'ember-power-select/components/power-select';
import layout from '../templates/components/paper-autocomplete';
import ValidationMixin from 'ember-paper/mixins/validation-mixin';
import ChildMixin from 'ember-paper/mixins/child-mixin';
import { indexOfOption } from 'ember-power-select/utils/group-utils';
import calculatePosition from '../utils/calculate-ac-position';

const { assert, computed, inject, isNone, defineProperty } = Ember;

/**
 * @class PaperAutocomplete
 * @extends PowerSelectComponent
 */
export default PowerSelect.extend(ValidationMixin, ChildMixin, {
  layout,
  calculatePosition,

  util: inject.service(),
  constants: inject.service(),
  triggerComponent: 'paper-autocomplete-trigger',
  contentComponent: 'paper-autocomplete-content',
  optionsComponent: 'paper-autocomplete-options',
  triggerWrapperComponent: 'paper-autocomplete-trigger-container',
  onfocus: computed.alias('onFocus'),
  onblur: computed.alias('onBlur'),
  onchange: null,
  oninput: null,
  searchText: '',
  defaultHighlighted: null, // Don't automatically highlight any option
  _onChangeNop() { },

  extra: computed('labelPath', 'label', function() {
    return this.getProperties('label', 'labelPath');
  }),

  validationProperty: computed('onSearchTextChange', 'onSelectionChange', function() {
    if (this.get('onSearchTextChange')) {
      return 'searchText';
    } else {
      return 'selected';
    }
  }),

  concatenatedDropdownClasses: computed('dropdownClass', function() {
    let classes = ['md-autocomplete-suggestions-container md-virtual-repeat-container'];
    if (this.get('dropdownClass')) {
      classes.push(this.get('dropdownClass'));
    }
    return classes.join(' ');
{'fraction_non_alphanumeric': 0.14035087719298245, 'fraction_numerical': 0.0008223684210526315, 'mean_word_length': 5.041390728476821, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2477130', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1030, 'n_words': 219}