react-tapper
Advanced tools
Comparing version 0.1.20 to 0.1.23
@@ -1,30 +0,34 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var TAGNAMES = { | ||
'select': 'input', | ||
'change': 'input', | ||
'submit': 'form', | ||
'reset': 'form', | ||
'error': 'img', | ||
'load': 'img', | ||
'abort': 'img' | ||
'select': 'input', | ||
'change': 'input', | ||
'submit': 'form', | ||
'reset': 'form', | ||
'error': 'img', | ||
'load': 'img', | ||
'abort': 'img' | ||
}; | ||
var eventSupport = function eventSupport(eventName) { | ||
//to support compilation in server-side | ||
if (typeof window === "undefined" || typeof document === "undefined") return false; | ||
var el = document.createElement(TAGNAMES[eventName] || 'div'); | ||
eventName = 'on' + eventName; | ||
var isSupported = eventName in el; | ||
if (!isSupported) { | ||
el.setAttribute(eventName, 'return;'); | ||
isSupported = typeof el[eventName] == 'function'; | ||
} | ||
el = null; | ||
return isSupported; | ||
//to support compilation in server-side | ||
if (typeof window === "undefined" || typeof document === "undefined") return false; | ||
var el = document.createElement(TAGNAMES[eventName] || 'div'); | ||
eventName = 'on' + eventName; | ||
var isSupported = (eventName in el); | ||
if (!isSupported) { | ||
el.setAttribute(eventName, 'return;'); | ||
isSupported = typeof el[eventName] == 'function'; | ||
} | ||
el = null; | ||
return isSupported; | ||
}; | ||
exports.default = eventSupport; | ||
var _default = eventSupport; | ||
exports["default"] = _default; |
@@ -1,274 +0,291 @@ | ||
'use strict'; | ||
"use strict"; | ||
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); } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
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 _react = _interopRequireWildcard(require("react")); | ||
var _react = require('react'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _touchSupport = _interopRequireDefault(require("./touch-support")); | ||
var _propTypes = require('prop-types'); | ||
var _touchStyles = _interopRequireDefault(require("./touch-styles")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _touchSupport = require('./touch-support'); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
var _touchSupport2 = _interopRequireDefault(_touchSupport); | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; } | ||
var _touchStyles = require('./touch-styles'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _touchStyles2 = _interopRequireDefault(_touchStyles); | ||
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); } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
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 _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); }; } | ||
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; | ||
}; | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var Tappable = function (_Component) { | ||
_inherits(Tappable, _Component); | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function Tappable(props, context) { | ||
_classCallCheck(this, Tappable); | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
var _this = _possibleConstructorReturn(this, (Tappable.__proto__ || Object.getPrototypeOf(Tappable)).call(this, props, context)); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
_this.state = _this.getInitialState(); | ||
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; } | ||
_this.touchable = (0, _touchSupport2.default)(); | ||
return _this; | ||
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]; | ||
} | ||
} | ||
} | ||
_createClass(Tappable, [{ | ||
key: 'getInitialState', | ||
value: function getInitialState() { | ||
return { | ||
x: null, | ||
y: null, | ||
swiping: false, | ||
start: 0 | ||
}; | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var props = this.props, | ||
style = {}; | ||
_extends(style, _touchStyles2.default, props.style); | ||
return target; | ||
}; | ||
var newComponentProps = _extends({}, props, { | ||
style: style, | ||
className: props.className, | ||
disabled: props.disabled | ||
//, handlers: this.handlers | ||
}, this.handlers()); | ||
var Tappable = /*#__PURE__*/function (_Component) { | ||
_inherits(Tappable, _Component); | ||
delete newComponentProps.onTap; | ||
delete newComponentProps.onPress; | ||
delete newComponentProps.onPinchStart; | ||
delete newComponentProps.onPinchMove; | ||
delete newComponentProps.onPinchEnd; | ||
delete newComponentProps.moveThreshold; | ||
delete newComponentProps.pressDelay; | ||
delete newComponentProps.pressMoveThreshold; | ||
delete newComponentProps.preventDefault; | ||
delete newComponentProps.stopPropagation; | ||
delete newComponentProps.component; | ||
delete newComponentProps.flickThreshold; | ||
delete newComponentProps.delta; | ||
//delete newComponentProps.handlers | ||
var _super = _createSuper(Tappable); | ||
return (0, _react.createElement)(props.component, newComponentProps, props.children); | ||
} | ||
}, { | ||
key: 'calculatePos', | ||
value: function calculatePos(e) { | ||
var x = e.changedTouches[0].clientX; | ||
var y = e.changedTouches[0].clientY; | ||
function Tappable(props, context) { | ||
var _this; | ||
var xd = this.state.x - x; | ||
var yd = this.state.y - y; | ||
_classCallCheck(this, Tappable); | ||
var axd = Math.abs(xd); | ||
var ayd = Math.abs(yd); | ||
_this = _super.call(this, props, context); | ||
_this.state = _this.getInitialState(); | ||
_this.touchable = (0, _touchSupport["default"])(); | ||
return _this; | ||
} | ||
return { | ||
deltaX: xd, | ||
deltaY: yd, | ||
absX: axd, | ||
absY: ayd | ||
}; | ||
} | ||
}, { | ||
key: 'touchStart', | ||
value: function touchStart(e) { | ||
if (e.touches.length > 1) { | ||
return; | ||
} | ||
_createClass(Tappable, [{ | ||
key: "getInitialState", | ||
value: function getInitialState() { | ||
return { | ||
x: null, | ||
y: null, | ||
swiping: false, | ||
start: 0 | ||
}; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var props = this.props, | ||
style = {}; | ||
if (!this.touchable) { | ||
console.debug('Damn! You are using a non-touchable browser simulating touch events!'); | ||
this.touchable = true; | ||
} | ||
_extends(style, _touchStyles["default"], props.style); | ||
this.setState({ | ||
start: Date.now(), | ||
x: e.touches[0].clientX, | ||
y: e.touches[0].clientY, | ||
swiping: false | ||
}); | ||
} | ||
}, { | ||
key: 'touchMove', | ||
value: function touchMove(e) { | ||
if (!this.state.x || !this.state.y || e.touches.length > 1) { | ||
return; | ||
} | ||
var newComponentProps = _extends({}, props, { | ||
style: style, | ||
className: props.className, | ||
disabled: props.disabled //, handlers: this.handlers | ||
var cancelPageSwipe = false; | ||
var pos = this.calculatePos(e); | ||
}, this.handlers()); | ||
if (pos.absX < this.props.delta && pos.absY < this.props.delta) { | ||
return; | ||
} | ||
delete newComponentProps.onTap; | ||
delete newComponentProps.onPress; | ||
delete newComponentProps.onPinchStart; | ||
delete newComponentProps.onPinchMove; | ||
delete newComponentProps.onPinchEnd; | ||
delete newComponentProps.moveThreshold; | ||
delete newComponentProps.pressDelay; | ||
delete newComponentProps.pressMoveThreshold; | ||
delete newComponentProps.preventDefault; | ||
delete newComponentProps.stopPropagation; | ||
delete newComponentProps.component; | ||
delete newComponentProps.flickThreshold; | ||
delete newComponentProps.delta; //delete newComponentProps.handlers | ||
if (pos.absX > pos.absY) { | ||
if (pos.deltaX > 0) { | ||
if (this.props.onSwipingLeft) { | ||
this.props.onSwipingLeft(e, pos.absX); | ||
cancelPageSwipe = true; | ||
} | ||
} else { | ||
if (this.props.onSwipingRight) { | ||
this.props.onSwipingRight(e, pos.absX); | ||
cancelPageSwipe = true; | ||
} | ||
} | ||
} else { | ||
if (pos.deltaY > 0) { | ||
if (this.props.onSwipingUp) { | ||
this.props.onSwipingUp(e, pos.absY); | ||
cancelPageSwipe = true; | ||
} | ||
} else { | ||
if (this.props.onSwipingDown) { | ||
this.props.onSwipingDown(e, pos.absY); | ||
cancelPageSwipe = true; | ||
} | ||
} | ||
} | ||
return /*#__PURE__*/(0, _react.createElement)(props.component, newComponentProps, props.children); | ||
} | ||
}, { | ||
key: "calculatePos", | ||
value: function calculatePos(e) { | ||
var x = e.changedTouches[0].clientX; | ||
var y = e.changedTouches[0].clientY; | ||
var xd = this.state.x - x; | ||
var yd = this.state.y - y; | ||
var axd = Math.abs(xd); | ||
var ayd = Math.abs(yd); | ||
return { | ||
deltaX: xd, | ||
deltaY: yd, | ||
absX: axd, | ||
absY: ayd | ||
}; | ||
} | ||
}, { | ||
key: "touchStart", | ||
value: function touchStart(e) { | ||
if (e.touches.length > 1) { | ||
return; | ||
} | ||
this.setState({ swiping: true }); | ||
if (!this.touchable) { | ||
console.debug('Damn! You are using a non-touchable browser simulating touch events!'); | ||
this.touchable = true; | ||
} | ||
if (cancelPageSwipe) { | ||
e.preventDefault(); | ||
} | ||
} | ||
}, { | ||
key: 'touchEnd', | ||
value: function touchEnd(ev) { | ||
if (this.state.swiping) { | ||
var pos = this.calculatePos(ev); | ||
this.setState({ | ||
start: Date.now(), | ||
x: e.touches[0].clientX, | ||
y: e.touches[0].clientY, | ||
swiping: false | ||
}); | ||
} | ||
}, { | ||
key: "touchMove", | ||
value: function touchMove(e) { | ||
if (!this.state.x || !this.state.y || e.touches.length > 1) { | ||
return; | ||
} | ||
var time = Date.now() - this.state.start; | ||
var velocity = Math.sqrt(pos.absX * pos.absX + pos.absY * pos.absY) / time; | ||
var isFlick = velocity > this.props.flickThreshold; | ||
var cancelPageSwipe = false; | ||
var pos = this.calculatePos(e); | ||
this.props.onSwiped && this.props.onSwiped(ev, pos.deltaX, pos.deltaY, isFlick); | ||
if (pos.absX < this.props.delta && pos.absY < this.props.delta) { | ||
return; | ||
} | ||
if (pos.absX > pos.absY) { | ||
if (pos.deltaX > 0) { | ||
this.props.onSwipedLeft && this.props.onSwipedLeft(ev, pos.deltaX); | ||
} else { | ||
this.props.onSwipedRight && this.props.onSwipedRight(ev, pos.deltaX); | ||
} | ||
} else { | ||
if (pos.deltaY > 0) { | ||
this.props.onSwipedUp && this.props.onSwipedUp(ev, pos.deltaY); | ||
} else { | ||
this.props.onSwipedDown && this.props.onSwipedDown(ev, pos.deltaY); | ||
} | ||
} | ||
} else { | ||
this._handleTap(ev); | ||
} | ||
this.setState(this.getInitialState()); | ||
if (pos.absX > pos.absY) { | ||
if (pos.deltaX > 0) { | ||
if (this.props.onSwipingLeft) { | ||
this.props.onSwipingLeft(e, pos.absX); | ||
cancelPageSwipe = true; | ||
} | ||
} else { | ||
if (this.props.onSwipingRight) { | ||
this.props.onSwipingRight(e, pos.absX); | ||
cancelPageSwipe = true; | ||
} | ||
} | ||
}, { | ||
key: 'touchCancel', | ||
value: function touchCancel(ev) { | ||
this.setState(this.getInitialState()); | ||
} else { | ||
if (pos.deltaY > 0) { | ||
if (this.props.onSwipingUp) { | ||
this.props.onSwipingUp(e, pos.absY); | ||
cancelPageSwipe = true; | ||
} | ||
} else { | ||
if (this.props.onSwipingDown) { | ||
this.props.onSwipingDown(e, pos.absY); | ||
cancelPageSwipe = true; | ||
} | ||
} | ||
}, { | ||
key: '_handleClick', | ||
value: function _handleClick(ev) { | ||
var _this2 = this; | ||
} | ||
//!this.touchable && this._handleTap(ev) | ||
if (this.state.start === 0) { | ||
this._handleTap(ev); | ||
} else { | ||
setTimeout(function () { | ||
_this2.state.start === 0 && _this2._handleTap(ev); | ||
}, 300); | ||
} | ||
this.setState({ | ||
swiping: true | ||
}); | ||
if (cancelPageSwipe) { | ||
e.preventDefault(); | ||
} | ||
} | ||
}, { | ||
key: "touchEnd", | ||
value: function touchEnd(ev) { | ||
if (this.state.swiping) { | ||
var pos = this.calculatePos(ev); | ||
var time = Date.now() - this.state.start; | ||
var velocity = Math.sqrt(pos.absX * pos.absX + pos.absY * pos.absY) / time; | ||
var isFlick = velocity > this.props.flickThreshold; | ||
this.props.onSwiped && this.props.onSwiped(ev, pos.deltaX, pos.deltaY, isFlick); | ||
if (pos.absX > pos.absY) { | ||
if (pos.deltaX > 0) { | ||
this.props.onSwipedLeft && this.props.onSwipedLeft(ev, pos.deltaX); | ||
} else { | ||
this.props.onSwipedRight && this.props.onSwipedRight(ev, pos.deltaX); | ||
} | ||
} else { | ||
if (pos.deltaY > 0) { | ||
this.props.onSwipedUp && this.props.onSwipedUp(ev, pos.deltaY); | ||
} else { | ||
this.props.onSwipedDown && this.props.onSwipedDown(ev, pos.deltaY); | ||
} | ||
} | ||
}, { | ||
key: '_handleTap', | ||
value: function _handleTap(ev) { | ||
this.props.onTap && this.props.onTap(ev); | ||
} | ||
}, { | ||
key: 'handlers', | ||
value: function handlers() { | ||
return { | ||
onTouchStart: this.touchStart.bind(this), | ||
onTouchMove: this.touchMove.bind(this), | ||
onTouchEnd: this.touchEnd.bind(this), | ||
onTouchCancel: this.touchCancel.bind(this), | ||
onClick: this._handleClick.bind(this) | ||
}; | ||
} | ||
}]); | ||
} else { | ||
this._handleTap(ev); | ||
} | ||
return Tappable; | ||
this.setState(this.getInitialState()); | ||
} | ||
}, { | ||
key: "touchCancel", | ||
value: function touchCancel(ev) { | ||
this.setState(this.getInitialState()); | ||
} | ||
}, { | ||
key: "_handleClick", | ||
value: function _handleClick(ev) { | ||
var _this2 = this; | ||
//!this.touchable && this._handleTap(ev) | ||
if (this.state.start === 0) { | ||
this._handleTap(ev); | ||
} else { | ||
setTimeout(function () { | ||
_this2.state.start === 0 && _this2._handleTap(ev); | ||
}, 300); | ||
} | ||
} | ||
}, { | ||
key: "_handleTap", | ||
value: function _handleTap(ev) { | ||
this.props.onTap && this.props.onTap(ev); | ||
} | ||
}, { | ||
key: "handlers", | ||
value: function handlers() { | ||
return { | ||
onTouchStart: this.touchStart.bind(this), | ||
onTouchMove: this.touchMove.bind(this), | ||
onTouchEnd: this.touchEnd.bind(this), | ||
onTouchCancel: this.touchCancel.bind(this), | ||
onClick: this._handleClick.bind(this) | ||
}; | ||
} | ||
}]); | ||
return Tappable; | ||
}(_react.Component); | ||
Tappable.propTypes = { | ||
component: _propTypes2.default.any, | ||
onTap: _propTypes2.default.func, | ||
exports["default"] = Tappable; | ||
onSwiped: _propTypes2.default.func, | ||
onSwipingUp: _propTypes2.default.func, | ||
onSwipingRight: _propTypes2.default.func, | ||
onSwipingDown: _propTypes2.default.func, | ||
onSwipingLeft: _propTypes2.default.func, | ||
onSwipedUp: _propTypes2.default.func, | ||
onSwipedRight: _propTypes2.default.func, | ||
onSwipedDown: _propTypes2.default.func, | ||
onSwipedLeft: _propTypes2.default.func, | ||
flickThreshold: _propTypes2.default.number, | ||
delta: _propTypes2.default.number | ||
}; | ||
Tappable.defaultProps = { | ||
component: 'div', | ||
flickThreshold: 0.6, | ||
delta: 10 | ||
}; | ||
exports.default = Tappable; | ||
_defineProperty(Tappable, "propTypes", { | ||
component: _propTypes["default"].any, | ||
onTap: _propTypes["default"].func, | ||
onSwiped: _propTypes["default"].func, | ||
onSwipingUp: _propTypes["default"].func, | ||
onSwipingRight: _propTypes["default"].func, | ||
onSwipingDown: _propTypes["default"].func, | ||
onSwipingLeft: _propTypes["default"].func, | ||
onSwipedUp: _propTypes["default"].func, | ||
onSwipedRight: _propTypes["default"].func, | ||
onSwipedDown: _propTypes["default"].func, | ||
onSwipedLeft: _propTypes["default"].func, | ||
flickThreshold: _propTypes["default"].number, | ||
delta: _propTypes["default"].number | ||
}); | ||
_defineProperty(Tappable, "defaultProps", { | ||
component: 'div', | ||
flickThreshold: 0.6, | ||
delta: 10 | ||
}); |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var touchStyles = { | ||
WebkitTapHighlightColor: 'rgba(0,0,0,0)', | ||
WebkitTouchCallout: 'none', | ||
WebkitUserSelect: 'none', | ||
KhtmlUserSelect: 'none', | ||
MozUserSelect: 'none', | ||
msUserSelect: 'none', | ||
userSelect: 'none' | ||
//cursor: 'pointer' | ||
WebkitTapHighlightColor: 'rgba(0,0,0,0)', | ||
WebkitTouchCallout: 'none', | ||
WebkitUserSelect: 'none', | ||
KhtmlUserSelect: 'none', | ||
MozUserSelect: 'none', | ||
msUserSelect: 'none', | ||
userSelect: 'none' //cursor: 'pointer' | ||
}; | ||
exports.default = touchStyles; | ||
var _default = touchStyles; | ||
exports["default"] = _default; |
@@ -1,21 +0,22 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _eventSupport = require('./event-support'); | ||
var _eventSupport = _interopRequireDefault(require("./event-support")); | ||
var _eventSupport2 = _interopRequireDefault(_eventSupport); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var __TouchSupported; | ||
var __TouchSupported = void 0; | ||
var touchSupport = function touchSupport() { | ||
if (typeof __TouchSupported === 'boolean') return __TouchSupported; | ||
if (typeof __TouchSupported === 'boolean') return __TouchSupported; | ||
__TouchSupported = (0, _eventSupport["default"])("touchstart"); //("ontouchstart" in document.documentElement) | ||
__TouchSupported = (0, _eventSupport2.default)("touchstart"); //("ontouchstart" in document.documentElement) | ||
return __TouchSupported; | ||
return __TouchSupported; | ||
}; | ||
exports.default = touchSupport; | ||
var _default = touchSupport; | ||
exports["default"] = _default; |
@@ -13,3 +13,3 @@ { | ||
"author": "Nickel Jianhui Zhu <nickeljew@hotmail.com>", | ||
"version": "0.1.20", | ||
"version": "0.1.23", | ||
"license": "MIT", | ||
@@ -21,29 +21,29 @@ "private": false, | ||
"plugins": [ | ||
"transform-react-jsx", | ||
"transform-class-properties" | ||
"@babel/plugin-transform-react-jsx" | ||
], | ||
"presets": [ | ||
"env", | ||
"react" | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
] | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"prop-types": "^15.7.2", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1" | ||
"prop-types": "^15.6.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.3", | ||
"babel-loader": "7.1.5", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-react-jsx": "^6.24.1", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-react": "^6.24.1", | ||
"@babel/core": "^7.14.0", | ||
"@babel/plugin-transform-react-jsx": "^7.13.12", | ||
"@babel/preset-env": "^7.14.1", | ||
"@babel/preset-react": "^7.13.13", | ||
"babel-loader": "^8.2.2", | ||
"es6-docready": "^1.0.0", | ||
"es6-dom": "^1.0.0", | ||
"grunt": "^1.1.0", | ||
"grunt-babel": "7", | ||
"es6-dom": "^1.1.2", | ||
"grunt": "^1.4.0", | ||
"grunt-babel": "^8.0.0", | ||
"grunt-contrib-concat": "^1.0.1", | ||
"grunt-webpack": "^3.1.3", | ||
"webpack": "^4.43.0" | ||
"grunt-webpack": "^4.0.3", | ||
"webpack": "^5.36.2", | ||
"webpack-dev-server": "^3.11.2" | ||
}, | ||
@@ -50,0 +50,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
249488
18
311