react-composite-events
Version:
A collection of higher-order components (HOCs) to easily create composite events in React components
51 lines (45 loc) • 1.62 kB
JavaScript
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['exports', './compose'], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require('./compose'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.RCE_compose);
global.RCE_generic = mod.exports;
}
})(this, function (exports, _compose) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withRemainBlurred = exports.withRemainFocused = exports.withRemainReleased = exports.withLongPress = undefined;
var _compose2 = babelHelpers.interopRequireDefault(_compose);
var withLongPress = exports.withLongPress = (0, _compose2.default)({
eventPropName: 'onLongPress',
triggerEvent: ['onMouseDown', 'onPressIn'],
defaultDuration: 1250,
cancelEvent: ['onMouseUp', 'onMouseOut', 'onPressOut']
});
var withRemainReleased = exports.withRemainReleased = (0, _compose2.default)({
eventPropName: 'onRemainReleased',
triggerEvent: ['onMouseUp', 'onPressOut'],
defaultDuration: 500,
cancelEvent: ['onMouseDown', 'onPressIn']
});
var withRemainFocused = exports.withRemainFocused = (0, _compose2.default)({
eventPropName: 'onRemainFocused',
triggerEvent: 'onFocus',
defaultDuration: 500,
cancelEvent: 'onBlur'
});
var withRemainBlurred = exports.withRemainBlurred = (0, _compose2.default)({
eventPropName: 'onRemainBlurred',
triggerEvent: 'onBlur',
defaultDuration: 500,
cancelEvent: 'onFocus'
});
});
//# sourceMappingURL=generic.js.map