UNPKG

@mui/x-internal-gestures

Version:

The core engine of GestureEvents, a modern and robust multi-pointer gesture detection library for JavaScript.

46 lines (42 loc) 1.11 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { Gesture } from "../../core/index.js"; export class MockGoodGesture extends Gesture { // Define state for the gesture state = { isDragging: false, startPosition: { x: 0, y: 0 }, currentDistance: 0, customValue: '' }; resetState() { this.state = { isDragging: false, startPosition: { x: 0, y: 0 }, currentDistance: 0, customValue: '' }; } // Extra property for coverage extra = () => {}; // Add custom properties for testing complex options clone(overrides) { return new MockGoodGesture(_extends({ name: this.name, preventDefault: this.preventDefault, stopPropagation: this.stopPropagation, preventIf: this.preventIf }, overrides)); } // Override the updateOptions method to handle our custom properties updateOptions(options) { super.updateOptions(options); this.complexOption = options.complexOption ?? this.complexOption; this.arrayOption = options.arrayOption ?? this.arrayOption; } }