<commit_before>import Em from 'ember';
import { join } from 'llama-table/computed';
var get = Em.get;
var set = Em.set;
var observer = Em.observer;
var computed = Em.computed;
var alias = computed.alias;
var bool = computed.bool;
var not = computed.not;

var LlamaColumn = Em.CollectionView.extend({
	classNames: 'llama-column',
	classNameBindings: ['textAlignClass', 'columnClassNames', 'isVisible', 'isHidden'],
	attributeBindings: ['columnName:data-column-name', 'columnType:data-column-type'],
	width: alias('column.width'),
	isHidden: bool('column.isHidden'),
	isVisible: not('isHidden'),
	columnClassNames: join('column.classNames', ' '),
	columnName: alias('column.name'),
	columnType: alias('column.type'),

	rows: null,
	column: null,

	config: computed('columnType', 'columnName', 'controller.config.types', function () {
		var types = this.get('controller.config.types');
		if (!Em.isArray(types)) {
			return null;
		}
		var name = this.get('columnType') || this.get('columnName');
		var type = types.findBy('name', name);
		return type;
	}),

	setWidth: observer('width', function () {
		var width = this.get('width');
		var $column = Em.$(this.$());
		$column.width(width);
	}).on('didInsertElement'),

	cellViews: alias('childViews'),

	createChildView: function (View, attrs) {
		var column = this.get('column');
		set(attrs, 'column', column);
		return this._super(View, attrs);
	},

	textAlignClass: computed('column.textAlign', function () {
		var textAlign = this.get('column.textAlign');
		switch (textAlign) {
			case 'left': return 'text-left';
			case 'right': return 'text-right';
			case 'center': return 'text-center';
			case 'justify': return 'text-justify';
		}
	})
});

export default LlamaColumn;<commit_msg>Fixed column type text align<commit_after>import Em from 'ember';
import { join } from 'llama-table/computed';
var get = Em.get;
var set = Em.set;
var observer = Em.observer;
var computed = Em.computed;
var alias = computed.alias;
var bool = computed.bool;
var not = computed.not;

var LlamaColumn = Em.CollectionView.extend({
	classNames: 'llama-column',
	classNameBindings: ['textAlignClass', 'columnClassNames', 'isVisible', 'isHidden'],
	attributeBindings: ['columnName:data-column-name', 'columnType:data-column-type'],
	width: alias('column.width'),
	isHidden: bool('column.isHidden'),
	isVisible: not('isHidden'),
	columnClassNames: join('column.classNames', ' '),
	columnName: alias('column.name'),
	columnType: alias('column.type'),

	rows: null,
	column: null,

	config: computed('columnType', 'columnName', 'controller.config.types', function () {
		var types = this.get('controller.config.types');
		if (!Em.isArray(types)) {
			return null;
		}
		var name = this.get('columnType') || this.get('columnName');
		var type = types.findBy('name', name);
		return type;
	}),

	setWidth: observer('width', function () {
		var width = this.get('width');
		var $column = Em.$(this.$());
		$column.width(width);
	}).on('didInsertElement'),

	cellViews: alias('childViews'),

	createChildView: function (View, attrs) {
		var column = this.get('column');
		set(attrs, 'column', column);
		return this._super(View, attrs);
	},

	textAlignClass: computed('config.textAlign', 'column.textAlign', function () {
		var textAlign = this.get('config.textAlign') || this.get('column.textAlign');
		switch (textAlign) {
			case 'left': return 'text-left';
			case 'right': return 'text-right';
			case 'center': return 'text-center';
			case 'justify': return 'text-justify';
		}
	})
});

export default LlamaColumn;
{'fraction_non_alphanumeric': 0.17705102903862419, 'fraction_numerical': 0.0, 'mean_word_length': 5.127806563039724, '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': '7431188', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1143, 'n_words': 271}