diff --git a/lib/RIEBase.js b/lib/RIEBase.js index f08ed71..77a35a8 100644 --- a/lib/RIEBase.js +++ b/lib/RIEBase.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; Object.defineProperty(exports, "__esModule", { value: true @@ -6,10 +6,14 @@ Object.defineProperty(exports, "__esModule", { var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _react = require("react"); +var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -67,8 +71,8 @@ var RIEBase = function (_React$Component) { _this.render = function () { return _react2.default.createElement( - "span", - _extends({}, _this.props.defaultProps, { tabindex: "0", className: _this.makeClassString(), onClick: _this.elementClick }), + 'span', + _extends({}, _this.props.defaultProps, { tabindex: '0', className: _this.makeClassString(), onClick: _this.elementClick }), _this.props.value ); }; @@ -90,18 +94,18 @@ var RIEBase = function (_React$Component) { }(_react2.default.Component); RIEBase.propTypes = { - value: _react2.default.PropTypes.any.isRequired, - change: _react2.default.PropTypes.func.isRequired, - propName: _react2.default.PropTypes.string.isRequired, - editProps: _react2.default.PropTypes.object, - defaultProps: _react2.default.PropTypes.object, - isDisabled: _react2.default.PropTypes.bool, - validate: _react2.default.PropTypes.func, - shouldBlockWhileLoading: _react2.default.PropTypes.bool, - classLoading: _react2.default.PropTypes.string, - classEditing: _react2.default.PropTypes.string, - classDisabled: _react2.default.PropTypes.string, - classInvalid: _react2.default.PropTypes.string, - className: _react2.default.PropTypes.string + value: _propTypes2.default.any.isRequired, + change: _propTypes2.default.func.isRequired, + propName: _propTypes2.default.string.isRequired, + editProps: _propTypes2.default.object, + defaultProps: _propTypes2.default.object, + isDisabled: _propTypes2.default.bool, + validate: _propTypes2.default.func, + shouldBlockWhileLoading: _propTypes2.default.bool, + classLoading: _propTypes2.default.string, + classEditing: _propTypes2.default.string, + classDisabled: _propTypes2.default.string, + classInvalid: _propTypes2.default.string, + className: _propTypes2.default.string }; exports.default = RIEBase; \ No newline at end of file diff --git a/lib/RIENumber.js b/lib/RIENumber.js index bd06515..9a5f058 100644 --- a/lib/RIENumber.js +++ b/lib/RIENumber.js @@ -10,6 +10,10 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _RIEStatefulBase2 = require('./RIEStatefulBase'); var _RIEStatefulBase3 = _interopRequireDefault(_RIEStatefulBase2); @@ -73,6 +77,6 @@ var RIENumber = function (_RIEStatefulBase) { }(_RIEStatefulBase3.default); RIENumber.propTypes = { - format: _react2.default.PropTypes.func + format: _propTypes2.default.func }; exports.default = RIENumber; \ No newline at end of file diff --git a/lib/RIESelect.js b/lib/RIESelect.js index 381f865..278403b 100644 --- a/lib/RIESelect.js +++ b/lib/RIESelect.js @@ -14,6 +14,10 @@ var _reactDom = require('react-dom'); var _reactDom2 = _interopRequireDefault(_reactDom); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _RIEStatefulBase2 = require('./RIEStatefulBase'); var _RIEStatefulBase3 = _interopRequireDefault(_RIEStatefulBase2); @@ -89,6 +93,6 @@ var RIESelect = function (_RIEStatefulBase) { }(_RIEStatefulBase3.default); RIESelect.propTypes = { - options: _react2.default.PropTypes.array.isRequired + options: _propTypes2.default.array.isRequired }; exports.default = RIESelect; \ No newline at end of file diff --git a/lib/RIETags.js b/lib/RIETags.js index 351f3b8..a19d78e 100644 --- a/lib/RIETags.js +++ b/lib/RIETags.js @@ -14,6 +14,10 @@ var _reactDom = require('react-dom'); var _reactDom2 = _interopRequireDefault(_reactDom); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _RIEStatefulBase2 = require('./RIEStatefulBase'); var _RIEStatefulBase3 = _interopRequireDefault(_RIEStatefulBase2); @@ -60,9 +64,9 @@ var RIETag = function (_React$Component) { }(_react2.default.Component); RIETag.propTypes = { - text: _react2.default.PropTypes.string.isRequired, - removeHandler: _react2.default.PropTypes.func, - className: _react2.default.PropTypes.string + text: _propTypes2.default.string.isRequired, + removeHandler: _propTypes2.default.func, + className: _propTypes2.default.string }; var RIETags = function (_RIEStatefulBase) { @@ -171,12 +175,12 @@ var RIETags = function (_RIEStatefulBase) { }(_RIEStatefulBase3.default); RIETags.propTyes = { - value: _react2.default.PropTypes.object.isRequired, - maxTags: _react2.default.PropTypes.number, - minTags: _react2.default.PropTypes.number, - separator: _react2.default.PropTypes.string, - elementClass: _react2.default.PropTypes.string, - blurDelay: _react2.default.PropTypes.number, - placeholder: _react2.default.PropTypes.string + value: _propTypes2.default.object.isRequired, + maxTags: _propTypes2.default.number, + minTags: _propTypes2.default.number, + separator: _propTypes2.default.string, + elementClass: _propTypes2.default.string, + blurDelay: _propTypes2.default.number, + placeholder: _propTypes2.default.string }; exports.default = RIETags; \ No newline at end of file diff --git a/lib/RIEToggle.js b/lib/RIEToggle.js index c4ad068..84a0949 100644 --- a/lib/RIEToggle.js +++ b/lib/RIEToggle.js @@ -10,6 +10,10 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _RIEBase2 = require('./RIEBase'); var _RIEBase3 = _interopRequireDefault(_RIEBase2); @@ -58,7 +62,7 @@ var RIEToggle = function (_RIEBase) { }(_RIEBase3.default); RIEToggle.propTypes = { - textTrue: _react2.default.PropTypes.string, - textFalse: _react2.default.PropTypes.string + textTrue: _propTypes2.default.string, + textFalse: _propTypes2.default.string }; exports.default = RIEToggle; \ No newline at end of file diff --git a/package.json b/package.json index fc34be7..2d2fc7c 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ }, "peerDependencies": { "react": "^0.14.0 || ^15.0.0", - "react-dom": "^0.14.0 || ^15.0.0" + "react-dom": "^0.14.0 || ^15.0.0", + "prop-types": "^15.5.8" }, "devDependencies": { "babel-cli": "^6.4.0", diff --git a/src/RIEBase.js b/src/RIEBase.js index cd1f84f..296b6c5 100644 --- a/src/RIEBase.js +++ b/src/RIEBase.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; export default class RIEBase extends React.Component { constructor(props){ @@ -17,21 +18,19 @@ export default class RIEBase extends React.Component { } static propTypes = { - value: React.PropTypes.any.isRequired, - change: React.PropTypes.func.isRequired, - propName: React.PropTypes.string.isRequired, - editProps: React.PropTypes.object, - defaultProps: React.PropTypes.object, - isDisabled: React.PropTypes.bool, - validate: React.PropTypes.func, - shouldBlockWhileLoading: React.PropTypes.bool, - classLoading: React.PropTypes.string, - classEditing: React.PropTypes.string, - classDisabled: React.PropTypes.string, - classInvalid: React.PropTypes.string, - className: React.PropTypes.string, - onFinish: React.PropTypes.func, - onStart: React.PropTypes.func + value: PropTypes.any.isRequired, + change: PropTypes.func.isRequired, + propName: PropTypes.string.isRequired, + editProps: PropTypes.object, + defaultProps: PropTypes.object, + isDisabled: PropTypes.bool, + validate: PropTypes.func, + shouldBlockWhileLoading: PropTypes.bool, + classLoading: PropTypes.string, + classEditing: PropTypes.string, + classDisabled: PropTypes.string, + classInvalid: PropTypes.string, + className: PropTypes.string }; doValidations = (value) => { diff --git a/src/RIENumber.js b/src/RIENumber.js index 4b4f81b..16602bb 100644 --- a/src/RIENumber.js +++ b/src/RIENumber.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import RIEStatefulBase from './RIEStatefulBase'; export default class RIENumber extends RIEStatefulBase { @@ -8,7 +9,7 @@ export default class RIENumber extends RIEStatefulBase { } static propTypes = { - format: React.PropTypes.func + format: PropTypes.func }; validate = (value) => { diff --git a/src/RIESelect.js b/src/RIESelect.js index 74179fd..2b023de 100644 --- a/src/RIESelect.js +++ b/src/RIESelect.js @@ -1,10 +1,11 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import PropTypes from 'prop-types'; import RIEStatefulBase from './RIEStatefulBase'; export default class RIESelect extends RIEStatefulBase { static propTypes = { - options: React.PropTypes.array.isRequired + options: PropTypes.array.isRequired }; finishEditing = () => { diff --git a/src/RIETags.js b/src/RIETags.js index 8c074ab..703493d 100644 --- a/src/RIETags.js +++ b/src/RIETags.js @@ -1,5 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import PropTypes from 'prop-types'; import RIEStatefulBase from './RIEStatefulBase'; class RIETag extends React.Component { @@ -8,9 +9,9 @@ class RIETag extends React.Component { } static propTypes = { - text: React.PropTypes.string.isRequired, - removeHandler: React.PropTypes.func, - className: React.PropTypes.string + text: PropTypes.string.isRequired, + removeHandler: PropTypes.func, + className: PropTypes.string }; remove = () => { @@ -31,13 +32,13 @@ export default class RIETags extends RIEStatefulBase { } static propTyes = { - value: React.PropTypes.object.isRequired, - maxTags: React.PropTypes.number, - minTags: React.PropTypes.number, - separator: React.PropTypes.string, - elementClass: React.PropTypes.string, - blurDelay: React.PropTypes.number, - placeholder: React.PropTypes.string + value: PropTypes.object.isRequired, + maxTags: PropTypes.number, + minTags: PropTypes.number, + separator: PropTypes.string, + elementClass: PropTypes.string, + blurDelay: PropTypes.number, + placeholder: PropTypes.string }; addTag = (tag) => { diff --git a/src/RIEToggle.js b/src/RIEToggle.js index b94c6d8..a9d5431 100644 --- a/src/RIEToggle.js +++ b/src/RIEToggle.js @@ -1,11 +1,12 @@ import React from 'react'; +import PropTypes from 'prop-types'; import RIEBase from './RIEBase'; export default class RIEToggle extends RIEBase { static propTypes = { - textTrue: React.PropTypes.string, - textFalse: React.PropTypes.string + textTrue: PropTypes.string, + textFalse: PropTypes.string }; elementClick = (e) => {