var compose = require('ksf/utils/compose');
/**
Layouter qui positionne et dimensionne tous les enfants à la même position et dimension que lui-même
*/
module.exports = compose(function(axis) {
	this._children = {};
	this._sizeProp = (axis === 'vertical' ? 'height' : 'width');
	this._positionProp = (axis === 'vertical' ? 'top' : 'left');
}, {
	content: function(cmps) {
		Object.keys(this._children).forEach(this.remove, this);
		Object.keys(cmps).forEach(function(key) {
			this.add(key, cmps[key]);
		}, this);
		return this;
	},
	add: function(key, cmp) {
		this._children[key] = cmp;
		this._applySize(key);
		this._applyPosition(key);
	},
	remove: function(key) {
		delete this._children[key];
	},
	_applySize: function(key) {
		if (this._size !== undefined) {
			this._children[key][this._sizeProp](this._size);
		}
	},
	_applyPosition: function(key) {
		if (typeof this._position === 'number') {
			this._children[key][this._positionProp](this._position);
		}
	},
	size: function(size) {
		if (arguments.length) {
			this._size = size;
			Object.keys(this._children).forEach(this._applySize, this);
			return this;
		} else {
			return this._size;
		}
	},
	position: function(position) {
		if (arguments.length) {
			this._position = position;
			Object.keys(this._children).forEach(this._applyPosition, this);
			return this;
		} else {
			return this._position;
		}
	},
});
@@ -554,16 +554,114 @@
  cmp) %7B%0A
+%09%09// TODO: remove check in build?%0A%09%09if (key in this._children) %7B%0A%09%09%09throw 'key already used';%0A%09%09%7D%0A
 %09%09this._
@@ -1475,8 +1475,9 @@
 %0A%09%7D,%0A%7D);
+%0A

Check Full.add if key already used