diff --git a/src/behaviours/field.js b/src/behaviours/field.js index 01e7dd4..7520e0c 100644 --- a/src/behaviours/field.js +++ b/src/behaviours/field.js @@ -51,7 +51,7 @@ const fieldForBuilder = (props, textOnly = false, multiple = false, list = false if (get(definitions, `${entityPath}.${propertyName}`).validateOnBlur !== false) onInputBlur(propertyName, entityPath, rawInputValue); if (userDefinedOnBlur) userDefinedOnBlur(); }; - const fieldForLine = list ? fieldForListBuilder(entityPath, propertyName, false, false, options.listOnly)(props): {}; + const fieldForLine = list ? fieldForListBuilder(entityPath, propertyName, false, false, options.isRaw, options.listOnly)(props): {}; const selectForLine = list ? fieldForListBuilder(entityPath, propertyName, true)(props): {}; const textForLine = list ? fieldForListBuilder(entityPath, propertyName, false, true)(props): {}; @@ -72,7 +72,7 @@ const fieldForBuilder = (props, textOnly = false, multiple = false, list = false } -const fieldForListBuilder = (entityPathList, propertyNameList, multiple= false, textOnly= false, listOnly) => { +const fieldForListBuilder = (entityPathList, propertyNameList, multiple= false, textOnly= false, isRaw, listOnly) => { const fieldForLineBuilder = (connectedComponentProps) => (propertyName, {FieldComponent = DefaultFieldComponent, entityPath, onBlur: userDefinedOnBlur,onChange: userDefinedOnChange, ...options} = {}, index) => { const {fields, definitions, domains, onInputChange, onInputBlur, entityPathArray, editing, onInputBlurList} = connectedComponentProps; const {onChange: optionsOnChange, ...otherOptions} = options; @@ -107,6 +107,7 @@ const fieldForListBuilder = (entityPathList, propertyNameList, multiple= false, onChange={onChange} onBlur={onBlur} fields={fields} + isRaw={isRaw} {...connectedComponentProps} {...options} />; } diff --git a/src/components/field.js b/src/components/field.js index 436a579..59ccc82 100644 --- a/src/components/field.js +++ b/src/components/field.js @@ -12,7 +12,9 @@ const FieldLabelValueComponent = ({editing, isRequired, label, name, valid, Valu
+ className={(isRaw && index === undefined && !listOnly && label != undefined) ? '' + : (isRaw && index != undefined || isRaw && listOnly || isRaw && label === undefined) ? 'mdl-cell mdl-cell--top mdl-cell--2-col' + : 'mdl-cell mdl-cell--top mdl-cell--4-col'} style={(index != undefined || isRaw) ? {marginTop: '0px'} : {}}> {(displayLabel || (displayLabel === false && index != undefined) || displayLabel === undefined) &&
@@ -35,7 +37,6 @@ class Field extends PureComponent { SelectComponentDisplay = DefaultSelectDisplayComponent, ListComponent = DefaultListComponent } = otherProps.metadata; - console.log(listOnly); const renderConsult = () => list ? : (multiple ? : ); const renderEdit = () => list ? : (multiple ? : ); const ValueComponent = otherProps.editing ? renderEdit() : renderConsult(); diff --git a/src/components/list.js b/src/components/list.js index 47226b9..3ebe875 100644 --- a/src/components/list.js +++ b/src/components/list.js @@ -2,7 +2,7 @@ import React, {PropTypes} from 'react'; function List({fieldForLine, selectForLine, textForLine, LineComponent, children, options, error, values, ...otherProps}) { - const renderLine = () => { debugger + const renderLine = () => { return (values ? values.map((element, index) => { // fieldFor which wrapp the index. const lineFieldFor = (linePropertyName, lineOptions) => fieldForLine(linePropertyName, lineOptions, index)