You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
3.8 KiB

{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nfunction _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); }; }\nfunction _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; } }\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nimport { BaseGesture } from \"./gesture\";\nexport var LongPressGesture = function (_BaseGesture) {\n _inherits(LongPressGesture, _BaseGesture);\n var _super = _createSuper(LongPressGesture);\n function LongPressGesture() {\n var _this;\n _classCallCheck(this, LongPressGesture);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"config\", {});\n _this.handlerName = 'LongPressGestureHandler';\n _this.shouldCancelWhenOutside(true);\n return _this;\n }\n _createClass(LongPressGesture, [{\n key: \"minDuration\",\n value: function minDuration(duration) {\n this.config.minDurationMs = duration;\n return this;\n }\n }, {\n key: \"maxDistance\",\n value: function maxDistance(distance) {\n this.config.maxDist = distance;\n return this;\n }\n }]);\n return LongPressGesture;\n}(BaseGesture);","map":{"version":3,"sources":["longPressGesture.ts"],"names":["BaseGesture","LongPressGesture","constructor","handlerName","shouldCancelWhenOutside","minDuration","duration","config","minDurationMs","maxDistance","distance","maxDist"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,WAAT;AAMA,WAAaC,gBAAN;EAAA;EAAA;EAGLC,4BAAc;IAAA;IAAA;IACZ;IADY,eAAA,gCAAA,QAAA,EAF8C,CAAA,CAE9C,CAAA;IAGZ,MAAKC,WAAL,GAAmB,yBAAnB;IACA,MAAKC,uBAAL,CAA6B,IAA7B,CAAA;IAAA;EACD;EAAA;IAAA;IAAA,OAEDC,qBAAYC,QAAD,EAAmB;MAC5B,IAAA,CAAKC,MAAL,CAAYC,aAAZ,GAA4BF,QAA5B;MACA,OAAO,IAAP;IACD;EAAA;IAAA;IAAA,OAEDG,qBAAYC,QAAD,EAAmB;MAC5B,IAAA,CAAKH,MAAL,CAAYI,OAAZ,GAAsBD,QAAtB;MACA,OAAO,IAAP;IACD;EAAA;EAAA;AAAA,EAlBmCV,WAA/B","sourcesContent":["import { BaseGesture, BaseGestureConfig } from './gesture';\nimport {\n LongPressGestureConfig,\n LongPressGestureHandlerEventPayload,\n} from '../LongPressGestureHandler';\n\nexport class LongPressGesture extends BaseGesture<LongPressGestureHandlerEventPayload> {\n public config: BaseGestureConfig & LongPressGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'LongPressGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n minDuration(duration: number) {\n this.config.minDurationMs = duration;\n return this;\n }\n\n maxDistance(distance: number) {\n this.config.maxDist = distance;\n return this;\n }\n}\n\nexport type LongPressGestureType = InstanceType<typeof LongPressGesture>;\n"]},"metadata":{},"sourceType":"module"}