Skip to content

Commit

Permalink
v0.3.1
Browse files Browse the repository at this point in the history
- Remove Unit Component onClick function. Just transfer default props. issue #19
- Fix Rating initialization typo. close #18
  • Loading branch information
jessy1092 committed Apr 3, 2015
2 parents 25e3fef + a2f10a0 commit 0e29a91
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 42 deletions.
4 changes: 4 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

## Version 0.3.1 - 2015/04/03

- Remove Unit Component onClick function. [issue #19](https://github.com/jessy1092/react-semantify/issues/19)

## Version 0.3.0 - 2015/04/01

- Support React v0.13.x
Expand Down
16 changes: 8 additions & 8 deletions docs/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ $('.ui.progress').progress({percent: 22});
### Properties

- *init*: You can see [Progress usage](http://semantic-ui.com/modules/progress.html#/usage) on the Semantic-ui web site.
- *percent*: This is a string type. Use to be a progress `data-percent` state. You can see [Alternate bar labels](http://semantic-ui.com/modules/progress.html#/usage)
- *value*: This is a string type. Use to be a progress `data-value` state. You can see [Alternate bar labels](http://semantic-ui.com/modules/progress.html#/usage)
- *total*: This is a string type. Use to be a progress `data-total` state. You can see [Alternate bar labels](http://semantic-ui.com/modules/progress.html#/usage)
- *percent*: This is a string type. Use to be a progress `data-percent` state. You can see [Progress usage](http://semantic-ui.com/modules/progress.html#/usage) for more detail.
- *value*: This is a string type. Use to be a progress `data-value` state. You can see [Progress usage](http://semantic-ui.com/modules/progress.html#/usage) for more detail.
- *total*: This is a string type. Use to be a progress `data-total` state. You can see [Progress usage](http://semantic-ui.com/modules/progress.html#/usage) for more detail.
- *active*: This is a booling type. If `true`, the `active` would be part of `class` attribute.
- *success*: This is a booling type. If `true`, the `success` would be part of `class` attribute.
- *warning*: This is a booling type. If `true`, the `warning` would be part of `class` attribute.
Expand Down Expand Up @@ -299,20 +299,20 @@ You also can use `init={param}` to transfer parameter.

ex.
```js
<Rating init={{rating: 3, maxRating: 5}}></Rating>
<Rating init={{initialRating: 3, maxRating: 5}}></Rating>
```

will transfer `{rating: 3, maxRating: 5}` to init function.
will transfer `{initialRating: 3, maxRating: 5}` to init function.

```js
$('.ui.rating').rating({rating: 3, maxRating: 5});
$('.ui.rating').rating({initialRating: 3, maxRating: 5});
```

### Properties

- *init*: You can see [Rating usage](http://semantic-ui.com/modules/rating.html#/usage) on the Semantic-ui web site.
- *rating*: This is a string type. Use to be a rating `data-rating` state. You can see [Alternate bar labels](http://semantic-ui.com/modules/rating.html#/usage)
- *maxRating*: This is a string type. Use to be a rating `data-max-rating` state. You can see [Alternate bar labels](http://semantic-ui.com/modules/rating.html#/usage)
- *rating*: This is a string type. Use to be a rating `data-rating` state. You can see [Rating usage](http://semantic-ui.com/modules/rating.html#/usage) for more detail.
- *maxRating*: This is a string type. Use to be a rating `data-max-rating` state. You can see [Rating usage](http://semantic-ui.com/modules/rating.html#/usage) for more detail.


# Search
Expand Down
18 changes: 3 additions & 15 deletions dst/react-semantify.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,22 +583,20 @@ module.exports = function (React) {
propTypes: {
className: React.PropTypes.string.isRequired,
type: React.PropTypes.string.isRequired,
color: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func
color: React.PropTypes.string.isRequired
},

render: function render() {
var _props = this.props;
var className = _props.className;
var type = _props.type;
var color = _props.color;
var onClick = _props.onClick;
var value = _props.value;
var disabled = _props.disabled;
var active = _props.active;
var loading = _props.loading;

var other = _objectWithoutProperties(_props, ["className", "type", "color", "onClick", "value", "disabled", "active", "loading"]);
var other = _objectWithoutProperties(_props, ["className", "type", "color", "value", "disabled", "active", "loading"]);

switch (type) {

Expand All @@ -607,7 +605,6 @@ module.exports = function (React) {
"a",
_extends({}, other, {
className: this._generateClassName(),
onClick: this._onClick,
"data-value": value }),
this.props.children
);
Expand All @@ -617,7 +614,6 @@ module.exports = function (React) {
"i",
_extends({}, other, {
className: this._generateClassName(),
onClick: this._onClick,
"data-value": value }),
this.props.children
);
Expand All @@ -626,8 +622,7 @@ module.exports = function (React) {
return React.createElement(
"img",
_extends({}, other, {
className: this._generateClassName(),
onClick: this._onClick }),
className: this._generateClassName() }),
this.props.children
);

Expand All @@ -637,7 +632,6 @@ module.exports = function (React) {
"div",
_extends({}, other, {
className: this._generateClassName(),
onClick: this._onClick,
"data-value": value }),
this.props.children
);
Expand All @@ -662,12 +656,6 @@ module.exports = function (React) {
});

return className;
},

_onClick: function _onClick() {
if (typeof this.props.onClick != "undefined") {
this.props.onClick();
}
}
});

Expand Down
4 changes: 2 additions & 2 deletions dst/react-semantify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gulp.task('browserify', () => {
});

gulp.task('watch', (done) => {
gulp.watch('./src/**/*', 'build');
gulp.watch('./src/**/*', gulp.series('build'));
done();
});

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "react-semantify",
"description": "Integrate Semantic-ui with react components.",
"version" : "0.3.0",
"version" : "0.3.1",
"keywords": [
"react",
"semantic-ui",
Expand All @@ -26,7 +26,7 @@
"homepage": "http://jessy1092.github.io/react-semantify",
"license": "MIT",
"scripts": {
"start": "gulp dev",
"start": "babel gulpfile.babel.js --out-file gulpfile.js && gulp dev",
"prepublish": "babel gulpfile.babel.js --out-file gulpfile.js && gulp transpile",
"test": "node ./node_modules/jest-cli/bin/jest.js"
},
Expand Down
17 changes: 3 additions & 14 deletions src/commons/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ module.exports = function (React) {
propTypes: {
className: React.PropTypes.string.isRequired,
type: React.PropTypes.string.isRequired,
color: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func
color: React.PropTypes.string.isRequired
},

render: function () {

var {
className, type, color, onClick, value,
className, type, color, value,
disabled, active, loading,
...other
} = this.props;
Expand All @@ -26,7 +25,6 @@ module.exports = function (React) {
return (
<a {...other}
className={this._generateClassName()}
onClick={this._onClick}
data-value={value}>
{this.props.children}
</a>
Expand All @@ -36,7 +34,6 @@ module.exports = function (React) {
return (
<i {...other}
className={this._generateClassName()}
onClick={this._onClick}
data-value={value}>
{this.props.children}
</i>
Expand All @@ -45,8 +42,7 @@ module.exports = function (React) {
case 'img':
return (
<img {...other}
className={this._generateClassName()}
onClick={this._onClick}>
className={this._generateClassName()}>
{this.props.children}
</img>
);
Expand All @@ -56,7 +52,6 @@ module.exports = function (React) {
return (
<div {...other}
className={this._generateClassName()}
onClick={this._onClick}
data-value={value}>
{this.props.children}
</div>
Expand All @@ -82,12 +77,6 @@ module.exports = function (React) {
});

return className;
},

_onClick: function () {
if (typeof this.props.onClick != 'undefined') {
this.props.onClick();
}
}
});

Expand Down

0 comments on commit 0e29a91

Please sign in to comment.