<commit_before>import Ember from 'ember';

export default Ember.Component.extend({
  classNames: ['multiselect-checkbox-option'],

  tagName: 'li',

  value: null,

  selection: [],

  labelProperty: null,

  isSelected: function () {
    return this.get('selection').contains(this.get('value'));
  }.property('value', 'selection'),

  label: function () {
    var labelProperty = this.get('labelProperty');
    var value = this.get('value');

    if (labelProperty) {
      if (typeof value.get === 'function') {
        return value.get(labelProperty);
      } else {
        return value[labelProperty];
      }
    } else {
      return String(value);
    }
  }.property('value', 'labelProperty'),

  isSelectedChanged: function () {
    if (this.get('isSelected') && !this.get('selection').contains(this.get('value'))) {
      this.get('selection').addObject(this.get('value'));
    } else {
      this.get('selection').removeObject(this.get('value'));
    }
  }.observes('isSelected')
});
<commit_msg>Add checked class to checkbox option<commit_after>import Ember from 'ember';

export default Ember.Component.extend({
  classNames: ['multiselect-checkbox-option'],
  classNameBindings: ['isSelected:checked'],

  tagName: 'li',

  value: null,

  selection: [],

  labelProperty: null,

  isSelected: function () {
    return this.get('selection').contains(this.get('value'));
  }.property('value', 'selection'),

  label: function () {
    var labelProperty = this.get('labelProperty');
    var value = this.get('value');

    if (labelProperty) {
      if (typeof value.get === 'function') {
        return value.get(labelProperty);
      } else {
        return value[labelProperty];
      }
    } else {
      return String(value);
    }
  }.property('value', 'labelProperty'),

  isSelectedChanged: function () {
    if (this.get('isSelected') && !this.get('selection').contains(this.get('value'))) {
      this.get('selection').addObject(this.get('value'));
    } else {
      this.get('selection').removeObject(this.get('value'));
    }
  }.observes('isSelected')
});

{'fraction_non_alphanumeric': 0.1781940441882805, 'fraction_numerical': 0.0, 'mean_word_length': 3.5881057268722465, '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': '3130204', 'n_tokens_mistral': 635, 'n_tokens_neox': 611, 'n_words': 117}