<commit_before>/**
 * Component Class
 * The base class for all ui components
 *
 * @class UI.Component
 * @extends {UI}
 * @return {parent} Class
 * @example (start code)	new UI.Context(object); (end)
 * @author [moolego,r2d2]
 * @copyright © 1999-2015 - <NAME>. All Rights reserved.
 */
define([
	'UI/Component/Binding',
	'UI/Component/Method',
	'UI/Component/Location',
	'UI/Component/Drag',
	'UI/Component/Resize'
], function(
	Binding,
	Method,
	Location,
	Drag,
	Resize
) {

	var _log = __debug('ui:component');

	var exports = new Class({

		Implements: [
			Events,
			Options,
			Binding,
			Method,
			Location,
			Drag,
			Resize
		],

		name: 'component',

		component: 'component',

		options: {
			lib: 'ui',
			prefix: 'ui-',

			component: 'component',
			name: 'component',
			type: null,
			element: {
				attr: ['class', 'styles', 'events', 'id', 'name', 'html', 'title'],
				tag: 'span',
				type: null
			}
		},

		/**
		 * Constructor
		 * @param  {Object} options [description]
		 * @return {Object}         [description]
		 */
		initialize: function(options) {
			this.setOptions(options);

			this.fireEvent('init');

			this._initOptions();
			this._initElement();
			this._initEvents();
			this._initBinding();

			return this;
		},

		/**
		 * Setter for the state of the component
		 * @param {string} state active/disable etc...
		 */
		setState: function(state) {
			_log.debug('setState', state, this);

			if (state === null) {
				state = 'disabled';
			}

			this.element.removeClass('state-' + this.state);

			if (state) {
				this.element.addClass('state-' + state);
			}

			this.state = state;
			this.fireEvent('state', state);

			return this;
		},

		/**
		 * [addComponent description]
		 * @param {Object} node
		 */
		addComponent: function(node) {
			_log.debug('addComponent', node);
			if (!node.component) {
				node.component = 'container';
			}

			node.container = this.element;
			node.main = this.main;
<commit_msg>fix component set state<commit_after>/**
 * Component Class
 * The base class for all ui components
 *
 * @class UI.Component
 * @extends {UI}
 * @return {parent} Class
 * @example (start code)	new UI.Context(object); (end)
 * @author [moolego,r2d2]
 * @copyright © 1999-2015 - <NAME>. All Rights reserved.
 */
define([
	'UI/Component/Binding',
	'UI/Component/Method',
	'UI/Component/Location',
	'UI/Component/Drag',
	'UI/Component/Resize'
], function(
	Binding,
	Method,
	Location,
	Drag,
	Resize
) {

	var _log = __debug('ui:component');

	var exports = new Class({

		Implements: [
			Events,
			Options,
			Binding,
			Method,
			Location,
			Drag,
			Resize
		],

		name: 'component',

		component: 'component',

		options: {
			lib: 'ui',
			prefix: 'ui-',

			component: 'component',
			name: 'component',
			type: null,
			element: {
				attr: ['class', 'styles', 'events', 'id', 'name', 'html', 'title'],
				tag: 'span',
				type: null
			}
		},

		/**
		 * Constructor
		 * @param  {Object} options [description]
		 * @return {Object}         [description]
		 */
		initialize: function(options) {
			this.setOptions(options);

			this.fireEvent('init');

			this._initOptions();
			this._initElement();
			this._initEvents();
			this._initBinding();

			return this;
		},

		/**
		 * Setter for the state of the component
		 * @param {string} state active/disable etc...
		 */
		setState: function(state) {
			_log.debug('setState', state, this);

			this.element.removeClass('state-' + this.state);

			if (state) {
				this.element.addClass('state-' + state);
			}

			this.state = state;
			this.fireEvent('state', state);

			return this;
		},

		/**
		 * [addComponent description]
		 * @param {Object} node
		 */
		addComponent: function(node) {
			_log.debug('addComponent', node);
			if (!node.component) {
				node.component = 'container';
			}

			node.container = this.element;
			node.main = this.main;

{'fraction_non_alphanumeric': 0.16653836284321272, 'fraction_numerical': 0.005132152938157557, 'mean_word_length': 2.9694501018329937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4911974', 'n_tokens_mistral': 1565, 'n_tokens_neox': 1284, 'n_words': 310}