Skip to content

Commit

Permalink
Remove mixin, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrookes committed Jan 17, 2016
1 parent 08bcc82 commit e110e0e
Show file tree
Hide file tree
Showing 16 changed files with 117 additions and 81 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Changelog

* 0.3.5 Support composable SelctField (@rblakeley), update REDME SelectField example, remove mixin
* 0.3.4 Fix for #35 - Treat MUI Checkbox as a controlled component to address MUI 0.14.0-rc2 regression
* 0.3.3 Fix default (ISO8601 style) date for formatDate to respect client timezone
* 0.3.2 Remove explicit files declaration from package.json (the npm docs lie!)
Expand Down
19 changes: 0 additions & 19 deletions lib/FormComponentMixin.js

This file was deleted.

17 changes: 11 additions & 6 deletions lib/FormsyCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ var _materialUiLibCheckbox = require('material-ui/lib/checkbox');

var _materialUiLibCheckbox2 = _interopRequireDefault(_materialUiLibCheckbox);

var _FormComponentMixin = require('./FormComponentMixin');

var _FormComponentMixin2 = _interopRequireDefault(_FormComponentMixin);

var FormsyCheckbox = _react2['default'].createClass({
displayName: 'FormsyCheckbox',

mixins: [_formsyReact2['default'].Mixin, _FormComponentMixin2['default']],
mixins: [_formsyReact2['default'].Mixin],

propTypes: {
name: _react2['default'].PropTypes.string.isRequired
},

handleValueChange: function handleValueChange(event, value) {
this.setValue(value);
},

componentDidMount: function componentDidMount() {
this.setValue(this._checkbox.isChecked());
Expand All @@ -37,7 +41,8 @@ var FormsyCheckbox = _react2['default'].createClass({
return _this._checkbox = c;
},
onCheck: this.handleValueChange,
checked: this.getValue() }));
checked: this.getValue()
}));
}
});

Expand Down
17 changes: 11 additions & 6 deletions lib/FormsyDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ var _materialUiLibDatePickerDatePicker = require('material-ui/lib/date-picker/da

var _materialUiLibDatePickerDatePicker2 = _interopRequireDefault(_materialUiLibDatePickerDatePicker);

var _FormComponentMixin = require('./FormComponentMixin');

var _FormComponentMixin2 = _interopRequireDefault(_FormComponentMixin);

var FormsyDate = _react2['default'].createClass({
displayName: 'FormsyDate',

mixins: [_formsyReact2['default'].Mixin, _FormComponentMixin2['default']],
mixins: [_formsyReact2['default'].Mixin],

propTypes: {
name: _react2['default'].PropTypes.string.isRequired
},

handleValueChange: function handleValueChange(event, value) {
this.setValue(value);
},

render: function render() {
return _react2['default'].createElement(_materialUiLibDatePickerDatePicker2['default'],
Expand All @@ -35,7 +39,8 @@ var FormsyDate = _react2['default'].createClass({
defaultValue: this.props.value,
onChange: this.handleValueChange,
errorText: this.getErrorMessage(),
value: this.getValue() }));
value: this.getValue()
}));
}
});

Expand Down
17 changes: 11 additions & 6 deletions lib/FormsyRadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ var _materialUiLibRadioButtonGroup = require('material-ui/lib/radio-button-group

var _materialUiLibRadioButtonGroup2 = _interopRequireDefault(_materialUiLibRadioButtonGroup);

var _FormComponentMixin = require('./FormComponentMixin');

var _FormComponentMixin2 = _interopRequireDefault(_FormComponentMixin);

var FormsyRadioGroup = _react2['default'].createClass({
displayName: 'FormsyRadioGroup',

mixins: [_formsyReact2['default'].Mixin, _FormComponentMixin2['default']],
mixins: [_formsyReact2['default'].Mixin],

propTypes: {
name: _react2['default'].PropTypes.string.isRequired
},

handleValueChange: function handleValueChange(event, value) {
this.setValue(value);
},

componentDidMount: function componentDidMount() {
this.setValue(this._radio.getSelectedValue());
Expand All @@ -38,7 +42,8 @@ var FormsyRadioGroup = _react2['default'].createClass({
ref: function (c) {
return _this._radio = c;
},
onChange: this.handleValueChange }),
onChange: this.handleValueChange
}),
this.props.children
);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/FormsyText.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ var FormsyText = _react2['default'].createClass({
onBlur: this.handleBlur,
onEnterKeyDown: this.handleEnterKeyDown,
errorText: this.getErrorMessage(),
value: this.getValue() }));
value: this.getValue()
}));
}
});

Expand Down
17 changes: 11 additions & 6 deletions lib/FormsyTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ var _materialUiLibTimePickerTimePicker = require('material-ui/lib/time-picker/ti

var _materialUiLibTimePickerTimePicker2 = _interopRequireDefault(_materialUiLibTimePickerTimePicker);

var _FormComponentMixin = require('./FormComponentMixin');

var _FormComponentMixin2 = _interopRequireDefault(_FormComponentMixin);

var FormsyTime = _react2['default'].createClass({
displayName: 'FormsyTime',

mixins: [_formsyReact2['default'].Mixin, _FormComponentMixin2['default']],
mixins: [_formsyReact2['default'].Mixin],

propTypes: {
name: _react2['default'].PropTypes.string.isRequired
},

handleValueChange: function handleValueChange(event, value) {
this.setValue(value);
},

render: function render() {
return _react2['default'].createElement(_materialUiLibTimePickerTimePicker2['default'], _extends({}, this.props, {
onChange: this.handleValueChange }));
onChange: this.handleValueChange
}));
}
});

Expand Down
17 changes: 11 additions & 6 deletions lib/FormsyToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ var _materialUiLibToggle = require('material-ui/lib/toggle');

var _materialUiLibToggle2 = _interopRequireDefault(_materialUiLibToggle);

var _FormComponentMixin = require('./FormComponentMixin');

var _FormComponentMixin2 = _interopRequireDefault(_FormComponentMixin);

var FormsyToggle = _react2['default'].createClass({
displayName: 'FormsyToggle',

mixins: [_formsyReact2['default'].Mixin, _FormComponentMixin2['default']],
mixins: [_formsyReact2['default'].Mixin],

propTypes: {
name: _react2['default'].PropTypes.string.isRequired
},

handleValueChange: function handleValueChange(event, value) {
this.setValue(value);
},

componentDidMount: function componentDidMount() {
this.setValue(this._toggle.isToggled());
Expand All @@ -36,7 +40,8 @@ var FormsyToggle = _react2['default'].createClass({
ref: function (c) {
return _this._toggle = c;
},
onToggle: this.handleValueChange }));
onToggle: this.handleValueChange
}));
}
});

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formsy-material-ui",
"version": "0.3.4",
"version": "0.3.5",
"description": "A formsy-react compatibility wrapper for Material-UI form components.",
"main": "./lib/index.js",
"scripts": {
Expand All @@ -19,7 +19,7 @@
"keywords": [
"formsy",
"formsy-react",
"form,",
"form",
"MUI",
"Material-UI",
"React",
Expand Down
13 changes: 0 additions & 13 deletions src/FormComponentMixin.js

This file was deleted.

14 changes: 11 additions & 3 deletions src/FormsyCheckbox.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import Formsy from 'formsy-react';
import Checkbox from 'material-ui/lib/checkbox';
import FormComponentMixin from './FormComponentMixin';

let FormsyCheckbox = React.createClass({
mixins: [ Formsy.Mixin, FormComponentMixin ],
mixins: [ Formsy.Mixin ],

propTypes: {
name: React.PropTypes.string.isRequired
},

handleValueChange: function (event, value) {
this.setValue(value);
},

componentDidMount: function () {
this.setValue(this._checkbox.isChecked());
Expand All @@ -16,7 +23,8 @@ let FormsyCheckbox = React.createClass({
{...this.props}
ref={(c) => this._checkbox = c}
onCheck={this.handleValueChange}
checked={this.getValue()} />
checked={this.getValue()}
/>
);
}
});
Expand Down
14 changes: 11 additions & 3 deletions src/FormsyDate.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import Formsy from 'formsy-react';
import DatePicker from 'material-ui/lib/date-picker/date-picker';
import FormComponentMixin from './FormComponentMixin';

let FormsyDate = React.createClass({
mixins: [ Formsy.Mixin, FormComponentMixin ],
mixins: [ Formsy.Mixin ],

propTypes: {
name: React.PropTypes.string.isRequired
},

handleValueChange: function (event, value) {
this.setValue(value);
},

render: function () {
return (
Expand All @@ -15,7 +22,8 @@ let FormsyDate = React.createClass({
defaultValue={this.props.value}
onChange={this.handleValueChange}
errorText={this.getErrorMessage()}
value={this.getValue()} />
value={this.getValue()}
/>
);
}
});
Expand Down
14 changes: 11 additions & 3 deletions src/FormsyRadioGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import Formsy from 'formsy-react';
import RadioButtonGroup from 'material-ui/lib/radio-button-group';
import FormComponentMixin from './FormComponentMixin';

let FormsyRadioGroup = React.createClass({
mixins: [ Formsy.Mixin, FormComponentMixin ],
mixins: [ Formsy.Mixin ],

propTypes: {
name: React.PropTypes.string.isRequired
},

handleValueChange: function (event, value) {
this.setValue(value);
},

componentDidMount: function () {
this.setValue(this._radio.getSelectedValue());
Expand All @@ -15,7 +22,8 @@ let FormsyRadioGroup = React.createClass({
<RadioButtonGroup
{...this.props}
ref={(c) => this._radio = c}
onChange={this.handleValueChange} >
onChange={this.handleValueChange}
>
{this.props.children}
</RadioButtonGroup>
);
Expand Down
3 changes: 2 additions & 1 deletion src/FormsyText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ let FormsyText = React.createClass({
onBlur={this.handleBlur}
onEnterKeyDown={this.handleEnterKeyDown}
errorText={this.getErrorMessage()}
value={this.getValue()} />
value={this.getValue()}
/>
);
}
});
Expand Down
14 changes: 11 additions & 3 deletions src/FormsyTime.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import React from 'react';
import Formsy from 'formsy-react';
import TimePicker from 'material-ui/lib/time-picker/time-picker';
import FormComponentMixin from './FormComponentMixin';

let FormsyTime = React.createClass({
mixins: [ Formsy.Mixin, FormComponentMixin ],
mixins: [ Formsy.Mixin ],

propTypes: {
name: React.PropTypes.string.isRequired
},

handleValueChange: function (event, value) {
this.setValue(value);
},

render: function () {
return (
<TimePicker
{...this.props}
onChange={this.handleValueChange} />
onChange={this.handleValueChange}
/>
);
}
});
Expand Down
14 changes: 11 additions & 3 deletions src/FormsyToggle.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import Formsy from 'formsy-react';
import Toggle from 'material-ui/lib/toggle';
import FormComponentMixin from './FormComponentMixin';

let FormsyToggle = React.createClass({
mixins: [ Formsy.Mixin, FormComponentMixin ],
mixins: [ Formsy.Mixin ],

propTypes: {
name: React.PropTypes.string.isRequired
},

handleValueChange: function (event, value) {
this.setValue(value);
},

componentDidMount: function () {
this.setValue(this._toggle.isToggled());
Expand All @@ -15,7 +22,8 @@ let FormsyToggle = React.createClass({
<Toggle
{...this.props}
ref={(c) => this._toggle = c}
onToggle={this.handleValueChange} />
onToggle={this.handleValueChange}
/>
);
}
});
Expand Down

0 comments on commit e110e0e

Please sign in to comment.