"use strict";

exports.__esModule = true;
exports.default = void 0;
var _dragAndDropDriverFactory = require("../../utils/DragAndDrop/dragAndDropDriverFactory");
var draggableDriverFactory = _ref => {
  var {
    element,
    wrapper,
    component
  } = _ref;
  var dragAndDropDriver = (0, _dragAndDropDriverFactory.dragAndDropDriverFactory)({
    element
  });
  return {
    wrapper,
    exists: () => !!element,
    childByHook: hook => element.querySelector("[data-hook=\"".concat(hook, "\"]")),
    component,
    /** fire dragstart event for the provided draggable item */
    beginDrag: _ref2 => {
      var {
        dataHook
      } = _ref2;
      return dragAndDropDriver.beginDrag({
        dataHook
      });
    },
    /** fire dragover event for the provided draggable item */
    dragOver: _ref3 => {
      var {
        dataHook
      } = _ref3;
      return dragAndDropDriver.dragOver({
        dataHook
      });
    },
    /** fire drop and dragend events for the provided draggable item */
    endDrag: draggableItemDetails => dragAndDropDriver.endDrag(draggableItemDetails)
  };
};
var _default = exports.default = draggableDriverFactory;
//# sourceMappingURL=Draggable.driver.js.map