react-pikaday
Advanced tools
Comparing version 0.5.0 to 0.5.1
## Changelog | ||
### master | ||
* Allow user to specify arbitrary props that will be passed on to the underlying <input> node (eg props: name, placeholder, data-*, ...) | ||
### v0.4.1 (Apr 8 2016) | ||
@@ -4,0 +8,0 @@ |
@@ -60,2 +60,13 @@ 'use strict'; | ||
// user props to pass down to the underlying DOM node | ||
getDomProps: function getDomProps() { | ||
var restProps = {}; | ||
for (var propKey in this.props) { | ||
if (this.props.hasOwnProperty(propKey) && !ReactPikaday.propTypes[propKey]) { | ||
restProps[propKey] = this.props[propKey]; | ||
} | ||
} | ||
return restProps; | ||
}, | ||
componentDidMount: function componentDidMount() { | ||
@@ -80,4 +91,3 @@ var el = this.refs.pikaday; | ||
render: function render() { | ||
return _react2.default.createElement('input', { type: 'text', ref: 'pikaday', className: this.props.className, | ||
placeholder: this.props.placeholder, disabled: this.props.disabled }); | ||
return _react2.default.createElement('input', _extends({ type: 'text', ref: 'pikaday' }, this.getDomProps())); | ||
} | ||
@@ -84,0 +94,0 @@ }); |
{ | ||
"name": "react-pikaday", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "A React component wrapper around Pikaday.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Pikaday.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11197
137
0