@@ -2830,6 +2830,57 @@ for (var i = 0; i < DOMIterables.length; i++) {
28302830}
28312831
28322832
2833+ /***/ }),
2834+
2835+ /***/ "../node_modules/chained-function/lib/chained-function.js":
2836+ /***/ (function(module, exports, __webpack_require__) {
2837+
2838+ "use strict";
2839+
2840+
2841+ Object.defineProperty(exports, "__esModule", {
2842+ value: true
2843+ });
2844+
2845+ exports.default = function () {
2846+ for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
2847+ funcs[_key] = arguments[_key];
2848+ }
2849+
2850+ return funcs.filter(function (func) {
2851+ return typeof func === 'function';
2852+ }).reduce(function (accumulator, func) {
2853+ if (accumulator === null) {
2854+ return func;
2855+ }
2856+
2857+ return function chainedFunction() {
2858+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2859+ args[_key2] = arguments[_key2];
2860+ }
2861+
2862+ accumulator.apply(this, args);
2863+ func.apply(this, args);
2864+ };
2865+ }, null);
2866+ };
2867+
2868+ /***/ }),
2869+
2870+ /***/ "../node_modules/chained-function/lib/index.js":
2871+ /***/ (function(module, exports, __webpack_require__) {
2872+
2873+ "use strict";
2874+
2875+
2876+ var _chainedFunction = __webpack_require__("../node_modules/chained-function/lib/chained-function.js");
2877+
2878+ var _chainedFunction2 = _interopRequireDefault(_chainedFunction);
2879+
2880+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2881+
2882+ module.exports = _chainedFunction2.default;
2883+
28332884/***/ }),
28342885
28352886/***/ "../node_modules/classnames/index.js":
@@ -29848,6 +29899,10 @@ var _createClass = function () { function defineProperties(target, props) { for
2984829899
2984929900var _class, _temp2;
2985029901
29902+ var _chainedFunction = __webpack_require__("../node_modules/chained-function/lib/index.js");
29903+
29904+ var _chainedFunction2 = _interopRequireDefault(_chainedFunction);
29905+
2985129906var _propTypes = __webpack_require__("../node_modules/prop-types/index.js");
2985229907
2985329908var _propTypes2 = _interopRequireDefault(_propTypes);
@@ -29938,6 +29993,7 @@ var Repeatable = (_temp2 = _class = function (_PureComponent) {
2993829993 var _this2 = this;
2993929994
2994029995 var _props = this.props,
29996+ disabled = _props.disabled,
2994129997 repeatDelay = _props.repeatDelay,
2994229998 repeatInterval = _props.repeatInterval,
2994329999 repeatCount = _props.repeatCount,
@@ -29946,7 +30002,11 @@ var Repeatable = (_temp2 = _class = function (_PureComponent) {
2994630002 onHold = _props.onHold,
2994730003 onHoldEnd = _props.onHoldEnd,
2994830004 onRelease = _props.onRelease,
29949- props = _objectWithoutProperties(_props, ['repeatDelay', 'repeatInterval', 'repeatCount', 'onPress', 'onHoldStart', 'onHold', 'onHoldEnd', 'onRelease']);
30005+ onMouseDown = _props.onMouseDown,
30006+ onTouchStart = _props.onTouchStart,
30007+ onTouchCancel = _props.onTouchCancel,
30008+ onTouchEnd = _props.onTouchEnd,
30009+ props = _objectWithoutProperties(_props, ['disabled', 'repeatDelay', 'repeatInterval', 'repeatCount', 'onPress', 'onHoldStart', 'onHold', 'onHoldEnd', 'onRelease', 'onMouseDown', 'onTouchStart', 'onTouchCancel', 'onTouchEnd']);
2995030010
2995130011 var release = function release(event) {
2995230012 if (_this2.repeatAmount > 0) {
@@ -29982,16 +30042,39 @@ var Repeatable = (_temp2 = _class = function (_PureComponent) {
2998230042 return _react2.default.createElement('div', _extends({
2998330043 role: 'presentation'
2998430044 }, props, {
29985- onMouseDown: press,
29986- onTouchStart: press,
29987- onTouchCancel: release,
29988- onTouchEnd: release
30045+ onMouseDown: (0, _chainedFunction2.default)(onMouseDown, function (event) {
30046+ if (disabled) {
30047+ return;
30048+ }
30049+ press(event);
30050+ }),
30051+ onTouchStart: (0, _chainedFunction2.default)(onTouchStart, function (event) {
30052+ if (disabled) {
30053+ return;
30054+ }
30055+ press(event);
30056+ }),
30057+ onTouchCancel: (0, _chainedFunction2.default)(onTouchCancel, function (event) {
30058+ if (disabled) {
30059+ return;
30060+ }
30061+ release(event);
30062+ }),
30063+ onTouchEnd: (0, _chainedFunction2.default)(onTouchEnd, function (event) {
30064+ if (disabled) {
30065+ return;
30066+ }
30067+ release(event);
30068+ })
2998930069 }));
2999030070 }
2999130071 }]);
2999230072
2999330073 return Repeatable;
2999430074}(_react.PureComponent), _class.propTypes = {
30075+ // Set it to true to disable event actions.
30076+ disabled: _propTypes2.default.bool,
30077+
2999530078 // The time (in milliseconds) to wait before the first hold action is being triggered.
2999630079 repeatDelay: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
2999730080
@@ -30016,6 +30099,7 @@ var Repeatable = (_temp2 = _class = function (_PureComponent) {
3001630099 // Callback fired when the mouseup, touchcancel, or touchend event is triggered.
3001730100 onRelease: _propTypes2.default.func
3001830101}, _class.defaultProps = {
30102+ disabled: false,
3001930103 repeatDelay: 500,
3002030104 repeatInterval: 32,
3002130105 repeatCount: 0
@@ -30639,7 +30723,7 @@ var App = function (_PureComponent) {
3063930723 {
3064030724 style: { display: 'inline-block', marginLeft: 8 },
3064130725 repeatDelay: Number(this.state.repeatDelay),
30642- repeatInterval: Number(this.state.repeatInterval),
30726+ repeatInterval: Number(this.state.repeatInterval / 5 ),
3064330727 repeatCount: Number(this.state.repeatCount),
3064430728 onPress: function onPress() {
3064530729 console.log('[2] onPress');
@@ -30664,7 +30748,7 @@ var App = function (_PureComponent) {
3066430748 pressed: true,
3066530749 holding: true
3066630750 },
30667- value: Math.min(state.value + 5 , 100)
30751+ value: Math.min(state.value + 1 , 100)
3066830752 };
3066930753 });
3067030754 },
@@ -30713,4 +30797,4 @@ _reactDom2.default.render(_react2.default.createElement(App, null), document.get
3071330797/***/ })
3071430798
3071530799/******/ });
30716- //# sourceMappingURL=bundle.js.map?f0e503d902d5a2530239
30800+ //# sourceMappingURL=bundle.js.map?45e747b5a2e1bdd1df1b
0 commit comments