Skip to content

Commit

Permalink
Build dist and .min files for 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhathaway committed Nov 25, 2016
1 parent d85165c commit 3c18f45
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
54 changes: 27 additions & 27 deletions dist/index.js
Expand Up @@ -22,20 +22,43 @@ var Winterfell = (function (_React$Component) {

_get(Object.getPrototypeOf(Winterfell.prototype), 'constructor', this).call(this, props);

// Set our default values for props.
var props = _.extend({
schema: {
formPanels: [],
questionPanels: [],
questionSets: [],
classes: {}
},
questionAnswers: {},
ref: 'form',
encType: 'application/x-www-form-urlencoded',
method: 'POST',
action: '',
panelId: undefined,
disableSubmit: false,
renderError: undefined,
renderRequiredAsterisk: undefined,
onSubmit: function onSubmit() {},
onUpdate: function onUpdate() {},
onSwitchPanel: function onSwitchPanel() {},
onRender: function onRender() {}
}, this.props);

this.panelHistory = [];

var schema = _.extend({
classes: {},
formPanels: [],
questionPanels: [],
questionSets: []
}, this.props.schema);
}, props.schema);

schema.formPanels = schema.formPanels.sort(function (a, b) {
return a.index > b.index;
});

var panelId = typeof this.props.panelId !== 'undefined' ? this.props.panelId : schema.formPanels.length > 0 ? schema.formPanels[0].panelId : undefined;
var panelId = typeof props.panelId !== 'undefined' ? props.panelId : schema.formPanels.length > 0 ? schema.formPanels[0].panelId : undefined;

var currentPanel = typeof schema !== 'undefined' && typeof schema.formPanels !== 'undefined' && typeof panelId !== 'undefined' ? _.find(schema.formPanels, function (panel) {
return panel.panelId == panelId;
Expand All @@ -48,8 +71,8 @@ var Winterfell = (function (_React$Component) {
this.state = {
schema: schema,
currentPanel: currentPanel,
action: this.props.action,
questionAnswers: this.props.questionAnswers
action: props.action,
questionAnswers: props.questionAnswers
};
}

Expand Down Expand Up @@ -170,29 +193,6 @@ var Winterfell = (function (_React$Component) {

;

// @todo: Proptypes
Winterfell.defaultProps = {
schema: {
formPanels: [],
questionPanels: [],
questionSets: [],
classes: {}
},
questionAnswers: {},
ref: 'form',
encType: 'application/x-www-form-urlencoded',
method: 'POST',
action: '',
panelId: undefined,
disableSubmit: false,
renderError: undefined,
renderRequiredAsterisk: undefined,
onSubmit: function onSubmit() {},
onUpdate: function onUpdate() {},
onSwitchPanel: function onSwitchPanel() {},
onRender: function onRender() {}
};

Winterfell.inputTypes = require('./inputTypes');
Winterfell.errorMessages = require('./lib/errors');
Winterfell.validation = require('./lib/validation');
Expand Down
16 changes: 8 additions & 8 deletions dist/inputTypes/checkboxOptionsInput.js
Expand Up @@ -27,20 +27,20 @@ var CheckboxOptionsInput = (function (_React$Component) {

_createClass(CheckboxOptionsInput, [{
key: 'handleChange',
value: function handleChange(e) {
var value = this.state.value;
value: function handleChange(newVal, e) {
var currentValue = this.state.value;

if (e.target.checked) {
value.push(e.target.value);
currentValue.push(newVal);
} else {
value = value.filter(function (val) {
return val != e.target.value;
currentValue = currentValue.filter(function (v) {
return v != newVal;
});
}

this.setState({
value: value
}, this.props.onChange.bind(null, value));
value: currentValue
}, this.props.onChange.bind(null, currentValue));
}
}, {
key: 'render',
Expand All @@ -66,7 +66,7 @@ var CheckboxOptionsInput = (function (_React$Component) {
checked: _this.state.value.indexOf(opt.value) > -1,
className: _this.props.classes.checkbox,
required: _this.props.required ? 'required' : undefined,
onChange: _this.handleChange.bind(_this),
onChange: _this.handleChange.bind(_this, opt.value),
onBlur: _this.props.onBlur.bind(null, _this.state.value) }),
opt.text
)
Expand Down

0 comments on commit 3c18f45

Please sign in to comment.