<commit_before>import Component from '@ember/component';
import { computed } from '@ember/object';
import layout from 'ember-light-table/templates/components/cells/base';
import { htmlSafe } from '@ember/string';

/**
 * @module Light Table
 * @submodule Cell Types
 */

/**
 * @module Cell Types
 * @class Base Cell
 */

const Cell = Component.extend({
  layout,
  tagName: 'td',
  classNames: ['lt-cell'],
  attributeBindings: ['style'],
  classNameBindings: ['align', 'isSorted', 'column.cellClassNames'],

  enableScaffolding: false,

  isSorted: computed.readOnly('column.sorted'),

  style: computed('enableScaffolding', 'column.width', function() {
    let column = this.get('column');
    let columnWidth = column.get('width');

    if (this.get('enableScaffolding') || !column) {
      return '';
    }

    // For performance reasons, it's more interesting to bypass cssStyleify
    // since it leads to a lot of garbage collections
    // when displaying many cells
    return columnWidth ? `width: ${htmlSafe(columnWidth)};` : '';
  }),

  align: computed('column.align', function() {
    return `align-${this.get('column.align')}`;
  }),

  /**
   * @property table
   * @type {Table}
   */
  table: null,

  /**
   * @property column
   * @type {Column}
   */
  column: null,
<commit_msg>FIX - Incomplete use of htmlSafe() on Cell.style (#586)<commit_after>import Component from '@ember/component';
import { computed } from '@ember/object';
import layout from 'ember-light-table/templates/components/cells/base';
import { htmlSafe } from '@ember/string';

/**
 * @module Light Table
 * @submodule Cell Types
 */

/**
 * @module Cell Types
 * @class Base Cell
 */

const Cell = Component.extend({
  layout,
  tagName: 'td',
  classNames: ['lt-cell'],
  attributeBindings: ['style'],
  classNameBindings: ['align', 'isSorted', 'column.cellClassNames'],

  enableScaffolding: false,

  isSorted: computed.readOnly('column.sorted'),

  style: computed('enableScaffolding', 'column.width', function() {
    let column = this.get('column');
    let columnWidth = column.get('width');

    if (this.get('enableScaffolding') || !column) {
      return '';
    }

    // For performance reasons, it's more interesting to bypass cssStyleify
    // since it leads to a lot of garbage collections
    // when displaying many cells
    return columnWidth ? htmlSafe(`width: ${columnWidth};`) : null;
  }),

  align: computed('column.align', function() {
    return `align-${this.get('column.align')}`;
  }),

  /**
   * @property table
   * @type {Table}
   */
  table: null,

  /**
   * @property column
   * @type {Column}
   */
  column: null,

{'fraction_non_alphanumeric': 0.16125377643504532, 'fraction_numerical': 0.0011329305135951663, 'mean_word_length': 3.5909878682842287, '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': '2860666', 'n_tokens_mistral': 822, 'n_tokens_neox': 795, 'n_words': 214}