UNPKG

@makeen.io/material-ui-kit

Version:
14 lines 1.12 kB
import _extends from "@babel/runtime/helpers/extends";import _slicedToArray from "@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";import React from "react"; import classNames from "classnames"; import { useDrag } from "react-dnd"; export default (function (_ref) {var data = _ref.data,className = _ref.className,children = _ref.children,style = _ref.style,onDrag = _ref.onDrag,onDrop = _ref.onDrop,type = _ref.type,rest = _objectWithoutProperties(_ref, ["data", "className", "children", "style", "onDrag", "onDrop", "type"]);var _useDrag = useDrag({ begin: function begin(monitor) { onDrag === null || onDrag === void 0 ? void 0 : onDrag({ data: data, type: type }, monitor); }, end: onDrop, item: { type: type, data: data } }),_useDrag2 = _slicedToArray(_useDrag, 2),drag = _useDrag2[1]; return /*#__PURE__*/React.createElement("div", _extends({ className: classNames(className), style: _extends({ display: "inline-block" }, style), ref: drag }, rest), children); }); //# sourceMappingURL=index.js.map