<commit_before>'use strict';

var sepItems    = require('es5-ext/lib/Array/prototype/sep-items')
  , copy        = require('es5-ext/lib/Object/copy')
  , d           = require('es5-ext/lib/Object/descriptor')
  , makeElement = require('dom-ext/lib/Document/prototype/make-element')
  , Input       = require('../_component')

  , defineProperty = Object.defineProperty
  , toDOMInput;

toDOMInput = function (document/*, options*/) {
	var options = Object(arguments[1]), rels = {}, inputs = {}, controlOpts
	  , el = makeElement.bind(document), dom;

	controlOpts = copy(options);
	dom = el('div', sepItems.call(this.triggers.values.map(function (name) {
		return (rels[name] = this.get(name));
	}, this.obj).sort(function (a, b) {
		return a.__order.__value - b.__order.__value;
	}).map(function (rel) {
		return (inputs[rel.name] = rel.toDOMInput(document, controlOpts));
	}), (options.sep != null) ? options.sep : ' '));

	return new Input(this, inputs, rels, dom);
};

module.exports = function (rel) {
	defineProperty(rel, 'toDOMInput', d(toDOMInput));<commit_msg>Display labels in placeholders in line component<commit_after>'use strict';

var sepItems    = require('es5-ext/lib/Array/prototype/sep-items')
  , copy        = require('es5-ext/lib/Object/copy')
  , extend      = require('es5-ext/lib/Object/extend')
  , d           = require('es5-ext/lib/Object/descriptor')
  , makeElement = require('dom-ext/lib/Document/prototype/make-element')
  , Input       = require('../_component')

  , defineProperty = Object.defineProperty
  , toDOMInput;

toDOMInput = function (document/*, options*/) {
	var options = Object(arguments[1]), rels = {}, inputs = {}, controlOpts
	  , el = makeElement.bind(document), dom;

	controlOpts = copy(options);
	dom = el('div', sepItems.call(this.triggers.values.map(function (name) {
		return (rels[name] = this.get(name));
	}, this.obj).sort(function (a, b) {
		return a.__order.__value - b.__order.__value;
	}).map(function (rel) {
		var opts = controlOpts;
		if (rel.__label.__value) {
			opts = extend({ placeholder: rel.__label.__value }, opts);
		}
		return (inputs[rel.name] = rel.toDOMInput(document, opts));
	}), (options.sep != null) ? options.sep : ' '));

	return new Input(this, inputs, rels, dom);
};

module.exports = function (rel) {
	defineProperty(rel, 'toDOMInput', d(toDOMInput));
{'fraction_non_alphanumeric': 0.17591801878736124, 'fraction_numerical': 0.003842869342442357, 'mean_word_length': 4.006410256410256, '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': '2849392', 'n_tokens_mistral': 787, 'n_tokens_neox': 771, 'n_words': 147}