From 90c2c9972610dc3d8f772a3681a966800c9cd720 Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Mon, 3 Aug 2015 15:50:55 +0200 Subject: [PATCH 1/7] [field] built in components, all built in components pass all the props to the son component, rewrite es6 style, Fix #156 , Fix 159 --- common/field/mixin/built-in-components.js | 132 +++++++++++----------- 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/common/field/mixin/built-in-components.js b/common/field/mixin/built-in-components.js index dda2bc2ac..e296dd9eb 100644 --- a/common/field/mixin/built-in-components.js +++ b/common/field/mixin/built-in-components.js @@ -4,7 +4,7 @@ let React = require('react'); let type = require('focus').component.types; let find = require('lodash/collection/find'); let result = require('lodash/object/result'); - +let assign = require('object-assign'); // Components let InputText = require('../../input/text').component; @@ -62,75 +62,78 @@ let fieldBuiltInComponentsMixin = { SelectComponent: type(['object', 'function']), DisplayComponent: type(['object', 'function']) }, + _buildStyle(){ + let {style} = this.props; + style = style || {}; + style.className = style && style.className ? style.className : ''; + return style; + }, /** * Render the label part of the component. - * @returns {[type]} [description] + * @returns {Component} - The builded label component. */ label() { if (this.props.FieldComponent || this.props.InputLabelComponent) { return undefined; } if (this.props.hasLabel) { + //In the labelCasen there is no reason to pass all props. let labelClassName = this._getLabelGridClassName(); + let {isEdit, isRequired, name} = this.props; return (