react-input-position
Advanced tools
Comparing version 1.3.1 to 1.3.2
# Changelog | ||
## 1.3.2 (November 6th, 2020) | ||
- Fix undefined itemDimensions error. | ||
## 1.3.1 (February 6th, 2020) | ||
@@ -4,0 +8,0 @@ |
@@ -34,9 +34,11 @@ "use strict"; | ||
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 _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
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 _typeof(obj) { "@babel/helpers - typeof"; 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); } | ||
@@ -49,11 +51,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
@@ -95,10 +101,8 @@ 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; } | ||
var ReactInputPosition = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
var ReactInputPosition = /*#__PURE__*/function (_Component) { | ||
_inherits(ReactInputPosition, _Component); | ||
var _super = _createSuper(ReactInputPosition); | ||
function ReactInputPosition() { | ||
var _getPrototypeOf2; | ||
var _this; | ||
@@ -112,9 +116,9 @@ | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ReactInputPosition)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "state", defaultState); | ||
_defineProperty(_assertThisInitialized(_this), "containerRef", _react["default"].createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/_react["default"].createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "itemRef", _react["default"].createRef()); | ||
_defineProperty(_assertThisInitialized(_this), "itemRef", /*#__PURE__*/_react["default"].createRef()); | ||
@@ -566,3 +570,3 @@ _defineProperty(_assertThisInitialized(_this), "mouseDown", false); | ||
var combinedStyle = _objectSpread({}, style, { | ||
var combinedStyle = _objectSpread(_objectSpread({}, style), {}, { | ||
WebkitUserSelect: "none", | ||
@@ -575,7 +579,7 @@ MozUserSelect: "none", | ||
return _react["default"].createElement("div", { | ||
return /*#__PURE__*/_react["default"].createElement("div", { | ||
style: combinedStyle, | ||
className: className, | ||
ref: this.containerRef | ||
}, _utils["default"].decorateChildren(children, _objectSpread({}, this.getState(), { | ||
}, _utils["default"].decorateChildren(children, _objectSpread(_objectSpread({}, this.getState()), {}, { | ||
itemRef: this.itemRef, | ||
@@ -582,0 +586,0 @@ onLoadRefresh: this.onLoadRefresh |
@@ -12,3 +12,3 @@ "use strict"; | ||
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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
@@ -22,3 +22,3 @@ 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; } | ||
function decorateChild(child, props) { | ||
return (0, _react.cloneElement)(child, props); | ||
return /*#__PURE__*/(0, _react.cloneElement)(child, props); | ||
} | ||
@@ -45,3 +45,5 @@ | ||
function limitPosition(minX, maxX, minY, maxY, itemPosition) { | ||
function limitPosition(minX, maxX, minY, maxY) { | ||
var itemPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; | ||
var position = _objectSpread({}, itemPosition); | ||
@@ -64,3 +66,7 @@ | ||
function createAdjustedLimits(minX, maxX, minY, maxY, elemDimensions, itemDimensions, limitBySize, internal) { | ||
function createAdjustedLimits(minX, maxX, minY, maxY) { | ||
var elemDimensions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; | ||
var itemDimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; | ||
var limitBySize = arguments.length > 6 ? arguments[6] : undefined; | ||
var internal = arguments.length > 7 ? arguments[7] : undefined; | ||
var limits = { | ||
@@ -110,3 +116,8 @@ minX: minX, | ||
function calculateItemPosition(itemPosition, prevActivePosition, activePosition, multiplier) { | ||
function calculateItemPosition() { | ||
var itemPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var prevActivePosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var activePosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
var multiplier = arguments.length > 3 ? arguments[3] : undefined; | ||
var newItemPosition = _objectSpread({}, itemPosition); | ||
@@ -121,3 +132,6 @@ | ||
function alignItemOnPosition(elemDimensions, itemDimensions, position) { | ||
function alignItemOnPosition() { | ||
var elemDimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var itemDimensions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var position = arguments.length > 2 ? arguments[2] : undefined; | ||
var oldMaxX = elemDimensions.width; | ||
@@ -133,3 +147,6 @@ var newMaxX = -(itemDimensions.width || 0) + elemDimensions.width; | ||
function centerItemOnPosition(elemDimensions, itemDimensions, position) { | ||
function centerItemOnPosition() { | ||
var elemDimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var itemDimensions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var position = arguments.length > 2 ? arguments[2] : undefined; | ||
var itemPosition = alignItemOnPosition(elemDimensions, itemDimensions, position); | ||
@@ -136,0 +153,0 @@ itemPosition.x += elemDimensions.width / 2 - position.x; |
{ | ||
"name": "react-input-position", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "A React component that decorates it's children with mouse/touch position tracking, a status toggle fired by click/gesture events, and more.", | ||
@@ -44,14 +44,14 @@ "keywords": [ | ||
"devDependencies": { | ||
"@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/cli": "^7.12.1", | ||
"@babel/core": "^7.12.3", | ||
"@babel/plugin-proposal-class-properties": "^7.12.1", | ||
"@babel/preset-env": "^7.12.1", | ||
"@babel/preset-react": "^7.12.5", | ||
"@types/jest": "^24.9.1", | ||
"babel-eslint": "^9.0.0", | ||
"babel-jest": "^24.8.0", | ||
"babel-loader": "^8.0.6", | ||
"babel-jest": "^24.9.0", | ||
"babel-loader": "^8.1.0", | ||
"css-loader": "^2.1.1", | ||
"enzyme": "^3.10.0", | ||
"enzyme-adapter-react-16": "^1.14.0", | ||
"enzyme": "^3.11.0", | ||
"enzyme-adapter-react-16": "^1.15.5", | ||
"eslint": "^5.16.0", | ||
@@ -61,16 +61,16 @@ "eslint-config-react-app": "^3.0.8", | ||
"eslint-plugin-flowtype": "^2.50.3", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-react": "^7.14.3", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jsx-a11y": "^6.4.1", | ||
"eslint-plugin-react": "^7.21.5", | ||
"file-loader": "^3.0.1", | ||
"gh-pages": "^2.0.1", | ||
"gh-pages": "^2.2.0", | ||
"html-webpack-plugin": "^3.2.0", | ||
"jest": "^24.8.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"rimraf": "^2.6.3", | ||
"jest": "^24.9.0", | ||
"react": "^16.14.0", | ||
"react-dom": "^16.14.0", | ||
"rimraf": "^2.7.1", | ||
"style-loader": "^0.23.1", | ||
"webpack": "^4.37.0", | ||
"webpack-cli": "^3.3.6", | ||
"webpack-dev-server": "^3.7.2" | ||
"webpack": "^4.44.2", | ||
"webpack-cli": "^3.3.12", | ||
"webpack-dev-server": "^3.11.0" | ||
}, | ||
@@ -77,0 +77,0 @@ "dependencies": { |
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
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
59284
1115