Skip to content

Commit 43791fc

Browse files
committed
Merge branch 'develop'
2 parents 9535c17 + c4803b5 commit 43791fc

File tree

8 files changed

+328
-18
lines changed

8 files changed

+328
-18
lines changed

.babelrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"presets": [
3-
"es2015",
3+
["es2015", {
4+
"modules": false
5+
}],
46
"stage-0",
57
"react"
68
],

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,5 @@ cert.txt
112112

113113
lib
114114
/react-*/
115-
/polyfills/
115+
/polyfills/
116+
lib_esnext/

package-lock.json

+304-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"name": "chayns-components",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "some standalone react components",
55
"main": "lib/index.js",
6+
"jsnext:main": "lib_esnext/index.js",
67
"scripts": {
78
"start": "webpack-dev-server --config ./webpack/dev.babel.js",
89
"prepublish": "npm run eslint & npm run build",
910
"build": "npm run build:js && npm run build:sass",
10-
"build:js": "babel src/ --out-dir ./lib",
11+
"build:js": "npm run build:es5 & npm run build:es-next",
12+
"build:es5": "babel src/ --out-dir ./lib",
13+
"build:es-next": "babel --no-babelrc src/ --out-dir ./lib_esnext --presets=es2016,stage-0,react,minify --plugins=transform-decorators-legacy",
1114
"build:sass": "node-sass src/ -o ./lib",
1215
"eslint": "./node_modules/.bin/eslint src --ext .jsx --ext .js"
1316
},
@@ -22,9 +25,11 @@
2225
"babel-core": "^6.26.0",
2326
"babel-eslint": "^8.2.1",
2427
"babel-loader": "^7.1.2",
28+
"babel-minify": "^0.2.0",
2529
"babel-plugin-transform-decorators-legacy": "^1.3.4",
2630
"babel-preset-env": "^1.6.1",
2731
"babel-preset-es2015": "^6.24.0",
32+
"babel-preset-es2016": "^6.24.1",
2833
"babel-preset-react": "^6.23.0",
2934
"babel-preset-stage-0": "^6.22.0",
3035
"css-loader": "^0.28.8",

src/react-chayns-amountcontrol/component/AmountInput.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export default class AmountInput extends React.Component {
174174

175175
return (
176176
<Input
177+
type="number"
177178
value={this.getInputValue()}
178179
onChange={this.onInputChange}
179180
className="cc__amount-control__input"

src/react-chayns-checkbox/component/Checkbox.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ export default class Checkbox extends React.Component {
112112
className="switch"
113113
ref={(ref) => { this._node = ref; }}
114114
onChange={this.onChange}
115-
disabled={disabled}
116115
id={this.id}
116+
disabled={disabled}
117+
checked={checked}
118+
defaultChecked={defaultChecked}
117119
/>
118120
<label
119121
htmlFor={this.id}

src/react-chayns-input/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The following properties can be set on the Input-Component
2323

2424
| Property | Description | Type | Default Value |
2525
|--------------|-----------------------------------------------------------------------------------|---------------|---------------|
26+
| type | The type that should be set on the input (e.g. text, password, number) | string | "text" |
2627
| style | Additional styles that should be set to the input | object | |
2728
| className | Additional CSS-Classes that should be set to the button | string | |
2829
| placeholder | Animated placeholder that will be shown inside the input | string | |

src/react-chayns-input/component/Input.jsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export default class Input extends React.Component {
2020
onBlur: PropTypes.func,
2121
responsive: PropTypes.bool,
2222
regExp: PropTypes.string,
23-
inputRef: PropTypes.func
23+
inputRef: PropTypes.func,
24+
type: PropTypes.string,
2425
};
2526

2627
static defaultProps = {
@@ -34,7 +35,8 @@ export default class Input extends React.Component {
3435
onChange: null,
3536
onBlur: null,
3637
regExp: null,
37-
inputRef: null
38+
inputRef: null,
39+
type: 'text',
3840
};
3941

4042
constructor(props) {
@@ -85,6 +87,7 @@ export default class Input extends React.Component {
8587

8688
render() {
8789
const {
90+
type,
8891
value,
8992
defaultValue,
9093
placeholder,
@@ -128,7 +131,7 @@ export default class Input extends React.Component {
128131
onChange={this.onChange}
129132
onBlur={this.onBlur}
130133
className="input"
131-
type="text"
134+
type={type || 'text'}
132135
required
133136
{...other}
134137
/>
@@ -153,7 +156,7 @@ export default class Input extends React.Component {
153156
onKeyUp={this.onKeyUp}
154157
onChange={this.onChange}
155158
onBlur={this.onBlur}
156-
type="text"
159+
type={type || 'text'}
157160
required
158161
{...other}
159162
/>

0 commit comments

Comments
 (0)