Skip to content

Commit 02e2358

Browse files
committed
Merge pull request ismaelga#13 from ismaelga/rebase-react-json-editor
Merge from ismaelga/plexus-form
2 parents e2ca95f + 3090f35 commit 02e2358

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

dist/plexus-form.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-json-editor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,12 +823,18 @@ return /******/ (function(modules) { // webpackBootstrap
823823
};
824824

825825
exports.section = function(props, fields) {
826+
if (React.isValidElement(props.sectionWrapper)) {
827+
return React.cloneElement(props.sectionWrapper, propsForWrapper(props, true), fields);
828+
}
826829
return React.createElement(props.sectionWrapper || SectionWrapper,
827830
propsForWrapper(props, true),
828831
fields);
829832
};
830833

831834
exports.field = function(props, field) {
835+
if (React.isValidElement(props.fieldWrapper)) {
836+
return React.cloneElement(props.fieldWrapper, propsForWrapper(props), field);
837+
}
832838
return React.createElement(props.fieldWrapper || FieldWrapper,
833839
propsForWrapper(props),
834840
field);

lib/alternative.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports.schema = function(value, schema, context) {
1414
var dereferenced = schema.oneOf.map(function(alt) {
1515
return resolve(alt, context);
1616
});
17-
17+
1818
options = dereferenced.map(function(alt) {
1919
return ou.getIn(alt, [ 'properties', selector, 'enum', 0 ]) || "";
2020
});

lib/fields/checkbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var CheckBox = React.createClass({
88
displayName: 'CheckBox',
99

1010
handleChange: function(event) {
11-
var val = event.target.checked;
11+
var val = event.target.checked ? true : null;
1212
this.props.update(this.props.path, val, val);
1313
},
1414
render: function() {

lib/fields/input.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ var InputField = React.createClass({
3636
});
3737

3838
module.exports = InputField;
39-

lib/fields/utils/wrapped.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,18 @@ var propsForWrapper = function(props, section) {
114114
};
115115

116116
exports.section = function(props, fields) {
117+
if (React.isValidElement(props.sectionWrapper)) {
118+
return React.cloneElement(props.sectionWrapper, propsForWrapper(props, true), fields);
119+
}
117120
return React.createElement(props.sectionWrapper || SectionWrapper,
118121
propsForWrapper(props, true),
119122
fields);
120123
};
121124

122125
exports.field = function(props, field) {
126+
if (React.isValidElement(props.fieldWrapper)) {
127+
return React.cloneElement(props.fieldWrapper, propsForWrapper(props), field);
128+
}
123129
return React.createElement(props.fieldWrapper || FieldWrapper,
124130
propsForWrapper(props),
125131
field);

lib/types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ var types = {
1313
},
1414
array: function(fields, props) {
1515
var move = function(props, i, n) {
16-
return function(to) {
16+
return function(to) {
1717
if(!canMoveUp(i, n) && !canMoveDown(i, n)) return;
1818
var newList = props.getValue(props.path);
1919
var value = newList.splice(to, 1);
2020

2121
newList.splice(i, 0, value[0]);
2222
props.update(props.path, newList, newList);
2323
};
24-
};
24+
};
2525
var canMoveUp = function(i, n) {
2626
return i > 0 && i < n - 1;
2727
};

0 commit comments

Comments
 (0)