<commit_before>//(c) 2014 Indexia, Inc.
import Em from 'ember';
import WithConfigMixin from 'ember-idx-utils/mixin/with-config';
import StyleBindingsMixin from 'ember-idx-utils/mixin/style-bindings';
var computed = Em.computed;

/**
 * AccordionItem component
 *
 * @class AccordionItem
 */
export default Em.Component.extend(WithConfigMixin, {
  classNameBindings: ['styleClasses', 'selectedClass'],
  accordion: computed.alias('parentView'),
  content: Em.computed.alias('accordion.content'),

  /**
   * Bind the specified attributes to the DOM element
   *
   * @property attributeBindings
   * @type Array
   */
  attributeBindings: ['active'],
  selectedClass: (function() {
    var _ref;
    if (this.get('selected')) {
      return (_ref = this.get('config.accordion.itemSelectedClasses')) != null ? _ref.join(" ") : void 0;
    } else {
      return null;
    }
  }).property('selected'),
  styleClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.itemClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelHeaderClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelHeaderClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelTitleClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelTitleClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelTogglerClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelTogglerClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelBodyContainerClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelBodyContainerClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelBodyClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelBodyClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  index: (function() {
    return this.get('accordion.items').indexOf(this);
  }).property('accordion.items.@each'),
  register: (function() {
    return this.get('accordion').addItem(this);
  }).on('init'),
  unregister: (function() {
    return this.get('accordion').removeItem(this);
  }).on('willDestroyElement'),

  /**
   * true if this item is currently selected.
   *
   * @property selected
   * @type Boolean
   */
  selected: (function() {
    return this.get('accordion.selected') === this;
  }).property('accordion.selected'),
  active: (function() {
    if (this.get('selected')) {
      return "true";
    } else {
      return null;
    }
  }).property('selected'),

  /**
   * Select this item.
   *
   * Bound to `click` event.
   *
   * @method select
   */
  select: (function() {
    return this.get('accordion').select(this);
  }).on('click'),

  /**
   * Select this item if it matches the {{#crossLink "Accordiong/select:method"}}selected-idx{{/crossLink}} property set by the Accordion component.<commit_msg>Unregister tries to call removeItem on a parent view that is already destroyed.<commit_after>//(c) 2014 Indexia, Inc.
import Em from 'ember';
import WithConfigMixin from 'ember-idx-utils/mixin/with-config';
import StyleBindingsMixin from 'ember-idx-utils/mixin/style-bindings';
var computed = Em.computed;

/**
 * AccordionItem component
 *
 * @class AccordionItem
 */
export default Em.Component.extend(WithConfigMixin, {
  classNameBindings: ['styleClasses', 'selectedClass'],
  accordion: computed.alias('parentView'),
  content: Em.computed.alias('accordion.content'),

  /**
   * Bind the specified attributes to the DOM element
   *
   * @property attributeBindings
   * @type Array
   */
  attributeBindings: ['active'],
  selectedClass: (function() {
    var _ref;
    if (this.get('selected')) {
      return (_ref = this.get('config.accordion.itemSelectedClasses')) != null ? _ref.join(" ") : void 0;
    } else {
      return null;
    }
  }).property('selected'),
  styleClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.itemClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelHeaderClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelHeaderClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelTitleClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelTitleClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelTogglerClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelTogglerClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelBodyContainerClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelBodyContainerClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  panelBodyClasses: (function() {
    var _ref;
    return (_ref = this.get('config.accordion.panelBodyClasses')) != null ? _ref.join(" ") : void 0;
  }).property(),
  index: (function() {
    return this.get('accordion.items').indexOf(this);
  }).property('accordion.items.@each'),
  register: (function() {
    return this.get('accordion').addItem(this);
  }).on('init'),

  /**
   * true if this item is currently selected.
   *
   * @property selected
   * @type Boolean
   */
  selected: (function() {
    return this.get('accordion.selected') === this;
  }).property('accordion.selected'),
  active: (function() {
    if (this.get('selected')) {
      return "true";
    } else {
      return null;
    }
  }).property('selected'),

  /**
   * Select this item.
   *
   * Bound to `click` event.
   *
   * @method select
   */
  select: (function() {
    return this.get('accordion').select(this);
  }).on('click'),

  /**
   * Select this item if it matches the {{#crossLink "Accordiong/select:method"}}selected-idx{{/crossLink}} property set by the Accordion component.
{'fraction_non_alphanumeric': 0.17276144907723856, 'fraction_numerical': 0.0037593984962406013, 'mean_word_length': 3.641554321966693, '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': '6576346', 'n_tokens_mistral': 1882, 'n_tokens_neox': 1820, 'n_words': 420}