react-input-message
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -9,3 +9,3 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -19,12 +19,10 @@ var React = require('react'); | ||
return (function (_React$Component) { | ||
_inherits(MessageListener, _React$Component); | ||
function MessageListener() { | ||
_classCallCheck(this, MessageListener); | ||
if (_React$Component != null) { | ||
_React$Component.apply(this, arguments); | ||
} | ||
_React$Component.apply(this, arguments); | ||
} | ||
_inherits(MessageListener, _React$Component); | ||
MessageListener.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) { | ||
@@ -31,0 +29,0 @@ if (!this.state && nextState) return true; |
@@ -9,3 +9,3 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -25,12 +25,10 @@ var React = require('react'), | ||
var Message = (function (_React$Component) { | ||
_inherits(Message, _React$Component); | ||
function Message() { | ||
_classCallCheck(this, Message); | ||
if (_React$Component != null) { | ||
_React$Component.apply(this, arguments); | ||
} | ||
_React$Component.apply(this, arguments); | ||
} | ||
_inherits(Message, _React$Component); | ||
Message.prototype.render = function render() { | ||
@@ -42,10 +40,4 @@ var _props = this.props; | ||
var delim = _props.delim; | ||
var _props$extract = _props.extract; | ||
var extract = _props$extract === undefined ? function (f) { | ||
return f; | ||
} : _props$extract; | ||
var _props$filter = _props.filter; | ||
var filter = _props$filter === undefined ? function (f) { | ||
return true; | ||
} : _props$filter; | ||
var extract = _props.extract; | ||
var filter = _props.filter; | ||
var fieldFor = _props['for']; | ||
@@ -60,3 +52,5 @@ | ||
props, | ||
values(messages).reduce(flatten, []).filter(filter).map(extract).join(delim) | ||
values(messages).reduce(flatten, []).filter(function (v, i, l) { | ||
return filter(v, i, l, extract); | ||
}).map(extract).join(delim) | ||
); | ||
@@ -69,3 +63,9 @@ }; | ||
component: 'span', | ||
delim: ', ' | ||
delim: ', ', | ||
extract: function extract(f) { | ||
return f; | ||
}, | ||
filter: function filter(f) { | ||
return true; | ||
} | ||
}, | ||
@@ -72,0 +72,0 @@ enumerable: true |
@@ -9,3 +9,3 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,25 @@ var React = require('react'); | ||
module.exports = (function (_React$Component) { | ||
_inherits(ValidationContainer, _React$Component); | ||
_createClass(ValidationContainer, null, [{ | ||
key: 'defaultProps', | ||
value: { | ||
messages: Object.create(null) | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'propTypes', | ||
value: { | ||
messages: React.PropTypes.object, | ||
onValidationNeeded: React.PropTypes.func | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'childContextTypes', | ||
value: { | ||
messageContainer: React.PropTypes.object | ||
}, | ||
enumerable: true | ||
}]); | ||
function ValidationContainer(props, context) { | ||
@@ -35,4 +58,2 @@ _classCallCheck(this, ValidationContainer); | ||
_inherits(ValidationContainer, _React$Component); | ||
ValidationContainer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
@@ -97,3 +118,3 @@ this._emit(nextProps); | ||
var groups = arguments[0] === undefined ? Object.keys(this._groups) : arguments[0]; | ||
var groups = arguments.length <= 0 || arguments[0] === undefined ? Object.keys(this._groups) : arguments[0]; | ||
@@ -127,24 +148,3 @@ groups = [].concat(groups); | ||
_createClass(ValidationContainer, null, [{ | ||
key: 'defaultProps', | ||
value: { | ||
messages: Object.create(null) | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'propTypes', | ||
value: { | ||
messages: React.PropTypes.object, | ||
onValidationNeeded: React.PropTypes.func | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'childContextTypes', | ||
value: { | ||
messageContainer: React.PropTypes.object | ||
}, | ||
enumerable: true | ||
}]); | ||
return ValidationContainer; | ||
})(React.Component); |
@@ -7,3 +7,3 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -17,2 +17,28 @@ var React = require('react'), | ||
var MessageTrigger = (function (_React$Component) { | ||
_inherits(MessageTrigger, _React$Component); | ||
_createClass(MessageTrigger, null, [{ | ||
key: 'propTypes', | ||
value: { | ||
events: stringOrArrayOfStrings, | ||
inject: React.PropTypes.func, | ||
'for': stringOrArrayOfStrings, | ||
group: stringOrArrayOfStrings | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'contextTypes', | ||
value: { | ||
messageContainer: React.PropTypes.object | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'defaultProps', | ||
value: { | ||
events: 'onChange' | ||
}, | ||
enumerable: true | ||
}]); | ||
function MessageTrigger() { | ||
@@ -26,4 +52,2 @@ _classCallCheck(this, MessageTrigger); | ||
_inherits(MessageTrigger, _React$Component); | ||
MessageTrigger.prototype.componentWillMount = function componentWillMount() { | ||
@@ -66,2 +90,5 @@ if (!this.props['for'] || !this.props['for'].length) return; | ||
MessageTrigger.prototype._notify = function _notify(event, handler) { | ||
var container = this.context.messageContainer, | ||
forProps = this.props['for'] ? [].concat(this.props['for']) : []; | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
@@ -71,5 +98,2 @@ args[_key - 2] = arguments[_key]; | ||
var container = this.context.messageContainer, | ||
forProps = this.props['for'] ? [].concat(this.props['for']) : []; | ||
handler && handler.apply(this, args); | ||
@@ -80,26 +104,2 @@ | ||
_createClass(MessageTrigger, null, [{ | ||
key: 'propTypes', | ||
value: { | ||
events: stringOrArrayOfStrings, | ||
inject: React.PropTypes.func, | ||
'for': stringOrArrayOfStrings, | ||
group: stringOrArrayOfStrings | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'contextTypes', | ||
value: { | ||
messageContainer: React.PropTypes.object | ||
}, | ||
enumerable: true | ||
}, { | ||
key: 'defaultProps', | ||
value: { | ||
events: 'onChange' | ||
}, | ||
enumerable: true | ||
}]); | ||
return MessageTrigger; | ||
@@ -106,0 +106,0 @@ })(React.Component); |
{ | ||
"name": "react-input-message", | ||
"description": "unopinionated form input annotation", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"repository": { | ||
@@ -14,2 +14,10 @@ "url": "git://github.com/jquense/react-input-message.git" | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "karma start --single-run", | ||
"tdd": "karma start", | ||
"example": "rimraf ./example/bundle.js && webpack-dev-server --config webpack/example-config.babel.js", | ||
"build:example": "webpack --config webpack/example-config.babel.js", | ||
"build": "npm run test && npm run build:example && babel src --out-dir lib", | ||
"release": "release" | ||
}, | ||
"dependencies": { | ||
@@ -21,4 +29,8 @@ "classnames": "^1.1.4", | ||
"peerDependencies": { | ||
"react": "^0.14.0-alpha1" | ||
"react": "^0.14.0 || ^15.0.0" | ||
}, | ||
"release-script": { | ||
"defaultDryRun": "false", | ||
"altPkgRootFolder": "lib" | ||
} | ||
} |
@@ -17,3 +17,3 @@ 'use strict'; | ||
function shallowEqual(objA, objB) { | ||
var eql = arguments[2] === undefined ? isEql : arguments[2]; | ||
var eql = arguments.length <= 2 || arguments[2] === undefined ? isEql : arguments[2]; | ||
@@ -20,0 +20,0 @@ if (objA === objB) return true; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
23048
0
467