react-input-position
Advanced tools
Comparing version 1.1.5 to 1.1.6
# Changelog | ||
## 1.1.6 (August 8th, 2019) | ||
- Removed unused properties in mouse and touch event handlers | ||
- Removed unnecessary rounding in alignItemOnPosition | ||
- Added tests for index, utils, and event handlers | ||
- Added CircleCi | ||
- Added CircleCi and downloads badges to README | ||
## 1.1.5 (May 16th, 2019) | ||
@@ -4,0 +12,0 @@ |
@@ -18,3 +18,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -33,10 +33,12 @@ var _react = _interopRequireWildcard(require("react")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -111,10 +113,8 @@ | ||
_defineProperty(_assertThisInitialized(_this), "containerRef", _react.default.createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "containerRef", _react["default"].createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "itemRef", _react.default.createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "itemRef", _react["default"].createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "mouseDown", false); | ||
_defineProperty(_assertThisInitialized(_this), "mouseJustDown", false); | ||
_defineProperty(_assertThisInitialized(_this), "touched", false); | ||
@@ -207,3 +207,3 @@ | ||
value: function setMouseInteractionMethods() { | ||
var mouseInteractionMethods = _mouseActivation.default[this.props.mouseActivationMethod]; | ||
var mouseInteractionMethods = _mouseActivation["default"][this.props.mouseActivationMethod]; | ||
this.mouseHandlers = []; | ||
@@ -221,3 +221,3 @@ | ||
value: function setTouchInteractionMethods() { | ||
var touchInteractionMethods = _touchActivation.default[this.props.touchActivationMethod]; | ||
var touchInteractionMethods = _touchActivation["default"][this.props.touchActivationMethod]; | ||
this.touchHandlers = []; | ||
@@ -302,3 +302,3 @@ | ||
var limits = _utils.default.createAdjustedLimits(itemPositionMinX, itemPositionMaxX, itemPositionMinY, itemPositionMaxY, stateUpdate.elementDimensions, stateUpdate.itemDimensions, itemPositionLimitBySize, itemPositionLimitInternal); // Center item | ||
var limits = _utils["default"].createAdjustedLimits(itemPositionMinX, itemPositionMaxX, itemPositionMinY, itemPositionMaxY, stateUpdate.elementDimensions, stateUpdate.itemDimensions, itemPositionLimitBySize, itemPositionLimitInternal); // Center item | ||
@@ -323,7 +323,7 @@ | ||
} else if (trackItemPosition && alignItemOnActivePos) { | ||
stateUpdate.itemPosition = _utils.default.alignItemOnPosition(stateUpdate.elementDimensions, stateUpdate.itemDimensions, stateUpdate.activePosition); | ||
stateUpdate.itemPosition = _utils["default"].alignItemOnPosition(stateUpdate.elementDimensions, stateUpdate.itemDimensions, stateUpdate.activePosition); | ||
} else if (trackItemPosition && activate && centerItemOnActivatePos) { | ||
stateUpdate.itemPosition = _utils.default.centerItemOnPosition(stateUpdate.elementDimensions, stateUpdate.itemDimensions, stateUpdate.activePosition); | ||
stateUpdate.itemPosition = _utils["default"].centerItemOnPosition(stateUpdate.elementDimensions, stateUpdate.itemDimensions, stateUpdate.activePosition); | ||
} else if (trackItemPosition && updateItemPosition) { | ||
stateUpdate.itemPosition = _utils.default.calculateItemPosition(this.state.itemPosition, stateUpdate.prevActivePosition, stateUpdate.activePosition, itemMovementMultiplier); | ||
stateUpdate.itemPosition = _utils["default"].calculateItemPosition(this.state.itemPosition, stateUpdate.prevActivePosition, stateUpdate.activePosition, itemMovementMultiplier); | ||
} else { | ||
@@ -335,3 +335,3 @@ shouldLimitItem = false; | ||
if (shouldLimitItem) { | ||
stateUpdate.itemPosition = _utils.default.limitPosition(limits.minX, limits.maxX, limits.minY, limits.maxY, stateUpdate.itemPosition); | ||
stateUpdate.itemPosition = _utils["default"].limitPosition(limits.minX, limits.maxX, limits.minY, limits.maxY, stateUpdate.itemPosition); | ||
} | ||
@@ -499,7 +499,7 @@ | ||
return _react.default.createElement("div", { | ||
return _react["default"].createElement("div", { | ||
style: combinedStyle, | ||
className: className, | ||
ref: this.containerRef | ||
}, _utils.default.decorateChildren(children, _objectSpread({}, this.state, { | ||
}, _utils["default"].decorateChildren(children, _objectSpread({}, this.state, { | ||
itemRef: this.itemRef, | ||
@@ -515,29 +515,29 @@ onLoadRefresh: this.onLoadRefresh | ||
_defineProperty(ReactInputPosition, "propTypes", { | ||
mouseActivationMethod: _propTypes.default.oneOf([_constants.MOUSE_ACTIVATION.CLICK, _constants.MOUSE_ACTIVATION.DOUBLE_CLICK, _constants.MOUSE_ACTIVATION.HOVER, _constants.MOUSE_ACTIVATION.MOUSE_DOWN]).isRequired, | ||
touchActivationMethod: _propTypes.default.oneOf([_constants.TOUCH_ACTIVATION.DOUBLE_TAP, _constants.TOUCH_ACTIVATION.LONG_TOUCH, _constants.TOUCH_ACTIVATION.TAP, _constants.TOUCH_ACTIVATION.TOUCH]).isRequired, | ||
tapDurationInMs: _propTypes.default.number, | ||
doubleTapDurationInMs: _propTypes.default.number, | ||
longTouchDurationInMs: _propTypes.default.number, | ||
longTouchMoveLimit: _propTypes.default.number, | ||
clickMoveLimit: _propTypes.default.number, | ||
itemPositionMinX: _propTypes.default.number, | ||
itemPositionMaxX: _propTypes.default.number, | ||
itemPositionMinY: _propTypes.default.number, | ||
itemPositionMaxY: _propTypes.default.number, | ||
itemPositionLimitBySize: _propTypes.default.bool, | ||
itemPositionLimitInternal: _propTypes.default.bool, | ||
linkItemToActive: _propTypes.default.bool, | ||
className: _propTypes.default.string, | ||
style: _propTypes.default.object, | ||
minUpdateSpeedInMs: _propTypes.default.number, | ||
trackPassivePosition: _propTypes.default.bool, | ||
trackItemPosition: _propTypes.default.bool, | ||
trackPreviousPosition: _propTypes.default.bool, | ||
centerItemOnActivate: _propTypes.default.bool, | ||
centerItemOnActivatePos: _propTypes.default.bool, | ||
centerItemOnLoad: _propTypes.default.bool, | ||
alignItemOnActivePos: _propTypes.default.bool, | ||
itemMovementMultiplier: _propTypes.default.number, | ||
cursorStyle: _propTypes.default.string, | ||
cursorStyleActive: _propTypes.default.string | ||
mouseActivationMethod: _propTypes["default"].oneOf([_constants.MOUSE_ACTIVATION.CLICK, _constants.MOUSE_ACTIVATION.DOUBLE_CLICK, _constants.MOUSE_ACTIVATION.HOVER, _constants.MOUSE_ACTIVATION.MOUSE_DOWN]).isRequired, | ||
touchActivationMethod: _propTypes["default"].oneOf([_constants.TOUCH_ACTIVATION.DOUBLE_TAP, _constants.TOUCH_ACTIVATION.LONG_TOUCH, _constants.TOUCH_ACTIVATION.TAP, _constants.TOUCH_ACTIVATION.TOUCH]).isRequired, | ||
tapDurationInMs: _propTypes["default"].number, | ||
doubleTapDurationInMs: _propTypes["default"].number, | ||
longTouchDurationInMs: _propTypes["default"].number, | ||
longTouchMoveLimit: _propTypes["default"].number, | ||
clickMoveLimit: _propTypes["default"].number, | ||
itemPositionMinX: _propTypes["default"].number, | ||
itemPositionMaxX: _propTypes["default"].number, | ||
itemPositionMinY: _propTypes["default"].number, | ||
itemPositionMaxY: _propTypes["default"].number, | ||
itemPositionLimitBySize: _propTypes["default"].bool, | ||
itemPositionLimitInternal: _propTypes["default"].bool, | ||
linkItemToActive: _propTypes["default"].bool, | ||
className: _propTypes["default"].string, | ||
style: _propTypes["default"].object, | ||
minUpdateSpeedInMs: _propTypes["default"].number, | ||
trackPassivePosition: _propTypes["default"].bool, | ||
trackItemPosition: _propTypes["default"].bool, | ||
trackPreviousPosition: _propTypes["default"].bool, | ||
centerItemOnActivate: _propTypes["default"].bool, | ||
centerItemOnActivatePos: _propTypes["default"].bool, | ||
centerItemOnLoad: _propTypes["default"].bool, | ||
alignItemOnActivePos: _propTypes["default"].bool, | ||
itemMovementMultiplier: _propTypes["default"].number, | ||
cursorStyle: _propTypes["default"].string, | ||
cursorStyleActive: _propTypes["default"].string | ||
}); | ||
@@ -560,2 +560,2 @@ | ||
var _default = ReactInputPosition; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,11 +6,10 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
var _utils = _interopRequireDefault(require("../utils")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function mouseDown(e) { | ||
this.mouseDown = true; | ||
this.mouseJustDown = false; | ||
this.clickMoveStartRef = e.clientX + e.clientY; | ||
@@ -22,3 +21,2 @@ } | ||
this.mouseDown = false; | ||
this.mouseJustDown = false; | ||
var position = { | ||
@@ -46,4 +44,3 @@ x: e.clientX, | ||
this.setPosition(position, this.mouseDown && !this.mouseJustDown); | ||
this.mouseJustDown = false; | ||
this.setPosition(position, this.mouseDown); | ||
} | ||
@@ -53,3 +50,2 @@ | ||
this.mouseDown = false; | ||
this.mouseJustDown = false; | ||
} | ||
@@ -62,4 +58,4 @@ | ||
mouseLeave: mouseLeave, | ||
dragStart: _utils.default.preventDefault | ||
dragStart: _utils["default"].preventDefault | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,11 +6,10 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
var _utils = _interopRequireDefault(require("../utils")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function mouseDown() { | ||
this.mouseDown = true; | ||
this.mouseJustDown = true; | ||
} | ||
@@ -20,3 +19,2 @@ | ||
this.mouseDown = false; | ||
this.mouseJustDown = false; | ||
} | ||
@@ -42,4 +40,3 @@ | ||
this.setPosition(position, this.mouseDown && !this.mouseJustDown); | ||
this.mouseJustDown = false; | ||
this.setPosition(position, this.mouseDown); | ||
} | ||
@@ -49,3 +46,2 @@ | ||
this.mouseDown = false; | ||
this.mouseJustDown = false; | ||
} | ||
@@ -59,4 +55,4 @@ | ||
mouseLeave: mouseLeave, | ||
dragStart: _utils.default.preventDefault | ||
dragStart: _utils["default"].preventDefault | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,11 +6,10 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
var _utils = _interopRequireDefault(require("../utils")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function mouseDown() { | ||
this.mouseDown = true; | ||
this.mouseJustDown = true; | ||
} | ||
@@ -20,3 +19,2 @@ | ||
this.mouseDown = false; | ||
this.mouseJustDown = false; | ||
} | ||
@@ -34,4 +32,3 @@ | ||
this.setPosition(position, this.mouseDown && !this.mouseJustDown); | ||
this.mouseJustDown = false; | ||
this.setPosition(position, this.mouseDown); | ||
} | ||
@@ -50,3 +47,2 @@ | ||
this.mouseDown = false; | ||
this.mouseJustDown = false; | ||
} | ||
@@ -60,4 +56,4 @@ | ||
mouseLeave: mouseLeave, | ||
dragStart: _utils.default.preventDefault | ||
dragStart: _utils["default"].preventDefault | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -17,10 +17,10 @@ var _click = _interopRequireDefault(require("./click")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _default = { | ||
click: _click.default, | ||
doubleClick: _doubleClick.default, | ||
hover: _hover.default, | ||
mouseDown: _mouseDown.default | ||
click: _click["default"], | ||
doubleClick: _doubleClick["default"], | ||
hover: _hover["default"], | ||
mouseDown: _mouseDown["default"] | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,10 +6,9 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
var _utils = _interopRequireDefault(require("../utils")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function mouseDown(e) { | ||
this.mouseJustDown = true; | ||
var position = { | ||
@@ -23,3 +22,2 @@ x: e.clientX, | ||
function mouseUp() { | ||
this.mouseJustDown = false; | ||
this.deactivate(); | ||
@@ -38,4 +36,3 @@ } | ||
this.setPosition(position, !this.mouseJustDown); | ||
this.mouseJustDown = false; | ||
this.setPosition(position); | ||
} | ||
@@ -47,4 +44,2 @@ | ||
} | ||
this.mouseJustDown = false; | ||
} | ||
@@ -57,4 +52,4 @@ | ||
mouseLeave: mouseLeave, | ||
dragStart: _utils.default.preventDefault | ||
dragStart: _utils["default"].preventDefault | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,7 +6,6 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
function touchStart() { | ||
this.touched = true; | ||
this.justTouched = true; | ||
this.startTapTimer(); | ||
@@ -18,3 +17,2 @@ } | ||
this.touched = false; | ||
this.justTouched = false; | ||
@@ -48,3 +46,3 @@ if (this.tapTimedOut) { | ||
if (!this.state.active) return; | ||
e.preventDefault(); | ||
if (e.cancelable) e.preventDefault(); | ||
var touch = e.touches[0]; | ||
@@ -55,4 +53,3 @@ var position = { | ||
}; | ||
this.setPosition(position, this.touched && !this.justTouched); | ||
this.justTouched = false; | ||
this.setPosition(position, this.touched); | ||
} | ||
@@ -70,2 +67,2 @@ | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -17,10 +17,10 @@ var _doubleTap = _interopRequireDefault(require("./doubleTap")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _default = { | ||
doubleTap: _doubleTap.default, | ||
longTouch: _longTouch.default, | ||
tap: _tap.default, | ||
touch: _touch.default | ||
doubleTap: _doubleTap["default"], | ||
longTouch: _longTouch["default"], | ||
tap: _tap["default"], | ||
touch: _touch["default"] | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,7 +6,6 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
function touchStart(e) { | ||
this.touched = true; | ||
this.justTouched = true; | ||
clearTimeout(this.longTouchTimer); | ||
@@ -25,3 +24,2 @@ var touch = e.touches[0]; | ||
this.touched = false; | ||
this.justTouched = false; | ||
} | ||
@@ -44,4 +42,3 @@ | ||
if (e.cancelable) e.preventDefault(); | ||
this.setPosition(position, this.touched && !this.justTouched); | ||
this.justTouched = false; | ||
this.setPosition(position, this.touched); | ||
} | ||
@@ -59,2 +56,2 @@ | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,7 +6,6 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
function touchStart() { | ||
this.touched = true; | ||
this.justTouched = true; | ||
this.startTapTimer(); | ||
@@ -18,3 +17,2 @@ } | ||
this.touched = false; | ||
this.justTouched = false; | ||
@@ -44,4 +42,3 @@ if (this.tapTimedOut) { | ||
}; | ||
this.setPosition(position, this.touched && !this.justTouched); | ||
this.justTouched = false; | ||
this.setPosition(position, this.touched); | ||
} | ||
@@ -59,2 +56,2 @@ | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,7 +6,6 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
function touchStart(e) { | ||
this.touched = true; | ||
this.justTouched = true; | ||
var touch = e.touches[0]; | ||
@@ -23,3 +22,2 @@ var position = { | ||
this.touched = false; | ||
this.justTouched = false; | ||
this.deactivate(); | ||
@@ -36,4 +34,3 @@ } | ||
}; | ||
this.setPosition(position, this.touched && !this.justTouched); | ||
this.justTouched = false; | ||
this.setPosition(position, this.touched); | ||
} | ||
@@ -51,2 +48,2 @@ | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,8 +6,10 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
var _react = require("react"); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
@@ -116,5 +118,5 @@ | ||
function alignItemOnPosition(elemDimensions, itemDimensions, position) { | ||
var oldMaxX = Math.ceil(elemDimensions.width) - 1; | ||
var oldMaxX = elemDimensions.width; | ||
var newMaxX = -(itemDimensions.width || 0) + elemDimensions.width; | ||
var oldMaxY = Math.ceil(elemDimensions.height) - 1; | ||
var oldMaxY = elemDimensions.height; | ||
var newMaxY = -(itemDimensions.height || 0) + elemDimensions.height; | ||
@@ -144,2 +146,2 @@ return { | ||
}; | ||
exports.default = _default; | ||
exports["default"] = _default; |
{ | ||
"name": "react-input-position", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "A React component that decorates it's children with mouse/touch position tracking, a status toggle fired by click/gesture events, and more.", | ||
@@ -30,2 +30,5 @@ "keywords": [ | ||
"start": "webpack-dev-server --mode development", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:coverage": "jest --coverage", | ||
"transpile": "rimraf dist && babel src -d dist", | ||
@@ -42,31 +45,36 @@ "prepublishOnly": "npm run transpile", | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.3.4", | ||
"@babel/plugin-proposal-class-properties": "^7.3.4", | ||
"@babel/preset-env": "^7.3.4", | ||
"@babel/cli": "^7.5.5", | ||
"@babel/core": "^7.5.5", | ||
"@babel/plugin-proposal-class-properties": "^7.5.5", | ||
"@babel/preset-env": "^7.5.5", | ||
"@babel/preset-react": "^7.0.0", | ||
"@types/jest": "^24.0.15", | ||
"babel-eslint": "^9.0.0", | ||
"babel-loader": "^8.0.5", | ||
"css-loader": "^2.1.0", | ||
"eslint": "^5.15.2", | ||
"babel-jest": "^24.8.0", | ||
"babel-loader": "^8.0.6", | ||
"css-loader": "^2.1.1", | ||
"enzyme": "^3.10.0", | ||
"enzyme-adapter-react-16": "^1.14.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-react-app": "^3.0.8", | ||
"eslint-loader": "^2.1.2", | ||
"eslint-loader": "^2.2.1", | ||
"eslint-plugin-flowtype": "^2.50.3", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-jsx-a11y": "^6.2.1", | ||
"eslint-plugin-react": "^7.12.4", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-react": "^7.14.3", | ||
"file-loader": "^3.0.1", | ||
"gh-pages": "^2.0.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"react": "^16.7.0", | ||
"react-dom": "^16.7.0", | ||
"jest": "^24.8.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"rimraf": "^2.6.3", | ||
"style-loader": "^0.23.1", | ||
"webpack": "^4.28.3", | ||
"webpack-cli": "^3.2.0", | ||
"webpack-dev-server": "^3.1.14" | ||
"webpack": "^4.37.0", | ||
"webpack-cli": "^3.3.6", | ||
"webpack-dev-server": "^3.7.2" | ||
}, | ||
"dependencies": { | ||
"prop-types": "^15.6.2" | ||
"prop-types": "^15.7.2" | ||
} | ||
} |
@@ -10,2 +10,4 @@ # react-input-position | ||
[![npm version](https://img.shields.io/npm/v/react-input-position.svg?style=flat)](https://npmjs.org/package/react-input-position "View this project on npm") | ||
[![CircleCI Status](https://circleci.com/gh/AdamRisberg/react-input-position.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/AdamRisberg/react-input-position) | ||
[![npm downloads](https://img.shields.io/npm/dm/react-input-position.svg?style=flat-square)](https://www.npmjs.com/package/react-input-position) | ||
[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) | ||
@@ -12,0 +14,0 @@ |
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
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
243077
34
2996
190
30
Updatedprop-types@^15.7.2