<commit_before>import Ember from 'ember';
import podNames from 'ember-component-css/pod-names';
import getOwner from 'ember-getowner-polyfill';

const {
  Component,
  ComponentLookup,
} = Ember;

ComponentLookup.reopen({
  componentFor(name, owner) {
    owner = Boolean(owner.hasRegistration) ? owner : getOwner(this);

    if (podNames[name] && !owner.hasRegistration('component:' + name)) {
      owner.register('component:' + name, Component);
    }
    return this._super(...arguments);
  }
});

Component.reopen({
  init() {
    this._super(...arguments);
    if (this.get('tagName') !== '' && this._debugContainerKey) {
      const name = this._debugContainerKey.replace('component:', '');
      if (podNames[name]) {
        this.classNames.push(podNames[name]);
      }
    }
  }
});

export function initialize() {}

export default {
  name: 'component-styles',
  initialize
};<commit_msg>moving the class name that gets used for a given component into it's own computed property so that it can get overwritten<commit_after>import Ember from 'ember';
import podNames from 'ember-component-css/pod-names';
import getOwner from 'ember-getowner-polyfill';

const {
  Component,
  ComponentLookup,
  computed,
} = Ember;

ComponentLookup.reopen({
  componentFor(name, owner) {
    owner = Boolean(owner.hasRegistration) ? owner : getOwner(this);

    if (podNames[name] && !owner.hasRegistration('component:' + name)) {
      owner.register('component:' + name, Component);
    }
    return this._super(...arguments);
  }
});

Component.reopen({
  _componentIdentifier: computed({
    get() {
      return (this._debugContainerKey || '').replace('component:', '');
    }
  }),

  componentCssClassName: computed({
    get() {
      return podNames[this.get('_componentIdentifier')] || '';
    }
  }),

  init() {
    this._super(...arguments);

    const name = this.get('componentCssClassName');

    if (this.get('tagName') !== '' && name) {
      this.classNames.push(name);
    }
  }
});

export function initialize() {}

export default {
  name: 'component-styles',
  initialize
};
{'fraction_non_alphanumeric': 0.1581462016244625, 'fraction_numerical': 0.0, 'mean_word_length': 3.737556561085973, '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': '2633715', 'n_tokens_mistral': 637, 'n_tokens_neox': 629, 'n_words': 135}