react-with-gesture
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -27,2 +27,28 @@ import React from 'react'; | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _assertThisInitialized(self) { | ||
@@ -121,6 +147,13 @@ if (self === void 0) { | ||
_proto.render = function render() { | ||
var _props = this.props, | ||
style = _props.style, | ||
className = _props.className, | ||
props = _objectWithoutProperties(_props, ["style", "className"]); | ||
return React.createElement("div", { | ||
onMouseDown: this.handleMouseDown, | ||
onTouchStart: this.handleTouchStart | ||
}, React.createElement(Wrapped, _extends({}, this.props, this.state))); | ||
onTouchStart: this.handleTouchStart, | ||
style: style, | ||
className: className | ||
}, React.createElement(Wrapped, _extends({}, props, this.state))); | ||
}; | ||
@@ -127,0 +160,0 @@ |
@@ -33,2 +33,28 @@ 'use strict'; | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _assertThisInitialized(self) { | ||
@@ -127,6 +153,13 @@ if (self === void 0) { | ||
_proto.render = function render() { | ||
var _props = this.props, | ||
style = _props.style, | ||
className = _props.className, | ||
props = _objectWithoutProperties(_props, ["style", "className"]); | ||
return React.createElement("div", { | ||
onMouseDown: this.handleMouseDown, | ||
onTouchStart: this.handleTouchStart | ||
}, React.createElement(Wrapped, _extends({}, this.props, this.state))); | ||
onTouchStart: this.handleTouchStart, | ||
style: style, | ||
className: className | ||
}, React.createElement(Wrapped, _extends({}, props, this.state))); | ||
}; | ||
@@ -133,0 +166,0 @@ |
{ | ||
"name": "react-with-gesture", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "hoc for receiving gestures", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-with-gesture", |
@@ -34,9 +34,10 @@ import React from 'react' | ||
const newProps = { ...this.state, x: pageX, y: pageX, xDelta: pageX - this.state.xInitial, yDelta: pageY - this.state.yInitial } | ||
this.setState(this.props.onMove ? this.props.onMove(newProps) : newProps, () => this._busy = false) | ||
this.setState(this.props.onMove ? this.props.onMove(newProps) : newProps, () => (this._busy = false)) | ||
} | ||
render() { | ||
const { style, className, ...props } = this.props | ||
return ( | ||
<div onMouseDown={this.handleMouseDown} onTouchStart={this.handleTouchStart}> | ||
<Wrapped {...this.props} {...this.state} /> | ||
<div onMouseDown={this.handleMouseDown} onTouchStart={this.handleTouchStart} style={style} className={className}> | ||
<Wrapped {...props} {...this.state} /> | ||
</div> | ||
@@ -43,0 +44,0 @@ ) |
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
84720
381