react-idle-timer
Advanced tools
Comparing version
'use strict'; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _redboxReact2 = require('redbox-react'); | ||
var _react = require('react'); | ||
var _redboxReact3 = _interopRequireDefault(_redboxReact2); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactTransformCatchErrors3 = require('react-transform-catch-errors'); | ||
var _reactTransformCatchErrors4 = _interopRequireDefault(_reactTransformCatchErrors3); | ||
var _react2 = require('react'); | ||
var _react3 = _interopRequireDefault(_react2); | ||
var _reactTransformHmr3 = require('react-transform-hmr'); | ||
var _reactTransformHmr4 = _interopRequireDefault(_reactTransformHmr3); | ||
var _moment = require('moment'); | ||
@@ -35,37 +23,11 @@ | ||
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; } | ||
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; } /** | ||
* React Idle Timer | ||
* | ||
* @author Randy Lebeau | ||
* @class IdleTimer | ||
* | ||
*/ | ||
var _components = { | ||
IdleTimer: { | ||
displayName: 'IdleTimer' | ||
} | ||
}; | ||
var _reactTransformHmr2 = (0, _reactTransformHmr4.default)({ | ||
filename: 'src/index.js', | ||
components: _components, | ||
locals: [module], | ||
imports: [_react3.default] | ||
}); | ||
var _reactTransformCatchErrors2 = (0, _reactTransformCatchErrors4.default)({ | ||
filename: 'src/index.js', | ||
components: _components, | ||
locals: [], | ||
imports: [_react3.default, _redboxReact3.default] | ||
}); | ||
function _wrapComponent(id) { | ||
return function (Component) { | ||
return _reactTransformHmr2(_reactTransformCatchErrors2(Component, id), id); | ||
}; | ||
} /** | ||
* React Idle Timer | ||
* | ||
* @author Randy Lebeau | ||
* @class IdleTimer | ||
* | ||
*/ | ||
var IdleTimer = _wrapComponent('IdleTimer')((function (_Component) { | ||
var IdleTimer = function (_Component) { | ||
_inherits(IdleTimer, _Component); | ||
@@ -112,3 +74,3 @@ | ||
value: function render() { | ||
return _react3.default.createElement( | ||
return _react2.default.createElement( | ||
'div', | ||
@@ -314,10 +276,10 @@ null, | ||
return IdleTimer; | ||
})(_react2.Component)); | ||
}(_react.Component); | ||
IdleTimer.propTypes = { timeout: _react2.PropTypes.number // Activity timeout | ||
, events: _react2.PropTypes.arrayOf(_react2.PropTypes.string) // Activity events to bind | ||
, idleAction: _react2.PropTypes.func // Action to call when user becomes inactive | ||
, activeAction: _react2.PropTypes.func // Action to call when user becomes active | ||
, element: _react2.PropTypes.oneOfType([_react2.PropTypes.object, _react2.PropTypes.string]) // Element ref to watch activty on | ||
, format: _react2.PropTypes.string | ||
IdleTimer.propTypes = { timeout: _react.PropTypes.number // Activity timeout | ||
, events: _react.PropTypes.arrayOf(_react.PropTypes.string) // Activity events to bind | ||
, idleAction: _react.PropTypes.func // Action to call when user becomes inactive | ||
, activeAction: _react.PropTypes.func // Action to call when user becomes active | ||
, element: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.string]) // Element ref to watch activty on | ||
, format: _react.PropTypes.string | ||
}; | ||
@@ -324,0 +286,0 @@ |
'use strict'; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -63,3 +63,3 @@ var _redboxReact2 = require('redbox-react'); | ||
var App = _wrapComponent('App')((function (_Component) { | ||
var App = _wrapComponent('App')(function (_Component) { | ||
_inherits(App, _Component); | ||
@@ -203,5 +203,5 @@ | ||
return App; | ||
})(_react2.Component)); | ||
}(_react2.Component)); | ||
module.exports = App; | ||
module.exports['default'] = App; |
{ | ||
"name": "react-idle-timer", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"description": "Activity detection for React.js", | ||
@@ -12,5 +12,5 @@ "main": "build/index.js", | ||
"clean": "rimraf build && rimraf examples/App.js && rimraf examples/init.js && rimraf examples/server.js", | ||
"build": "babel src -d build && babel src_examples -d examples", | ||
"build": "NODE_ENV=production babel src -d build && babel src_examples -d examples", | ||
"rebuild": "npm run clean && npm run build", | ||
"start": "node examples/server", | ||
"start": "NODE_ENV=development node examples/server", | ||
"test": "npm test", | ||
@@ -39,2 +39,3 @@ "prepublish": "in-publish && npm shrinkwrap || not-in-publish", | ||
"dependencies": { | ||
"lodash.bindall": "^3.1.0", | ||
"in-publish": "^2.0.0", | ||
@@ -65,3 +66,2 @@ "moment": "^2.10.3", | ||
"jest-cli": "^0.4.13", | ||
"lodash.bindall": "^3.1.0", | ||
"react-transform-catch-errors": "^1.0.0", | ||
@@ -68,0 +68,0 @@ "react-transform-hmr": "^1.0.1", |
25297
8.37%26
-3.7%5
25%453
-5.82%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added