How to use the dnd-core.DragSource function in dnd-core

To help you get started, we’ve selected a few dnd-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-dnd / react-dnd / dist-modules / backends / HTML5.js View on Github external
});
  }

  _inherits(FileDragSource, _DragSource);

  FileDragSource.prototype.mutateItemByReadingDataTransfer = function mutateItemByReadingDataTransfer(dataTransfer) {
    delete this.item.files;
    this.item.files = Array.prototype.slice.call(dataTransfer.files);
  };

  FileDragSource.prototype.beginDrag = function beginDrag() {
    return this.item;
  };

  return FileDragSource;
})(_DragSource3.DragSource);

var UrlDragSource = (function (_DragSource2) {
  function UrlDragSource() {
    _classCallCheck(this, UrlDragSource);

    _DragSource2.call(this);
    this.item = Object.defineProperties({}, {
      urls: {
        get: function () {
          console.warn('Browser doesn\'t allow reading URL information until the link is dropped.');
          return null;
        },
        configurable: true,
        enumerable: true
      }
    });
github react-dnd / react-dnd / dist-modules / ComponentDragSource.js View on Github external
args[_key4] = arguments[_key4];
    }

    if (this.spec.endDrag) {
      var _spec$endDrag;

      return (_spec$endDrag = this.spec.endDrag).call.apply(_spec$endDrag, [null, this.props].concat(args, [this.getComponentRef()]));
    } else {
      var _DragSource$prototype$endDrag;

      return (_DragSource$prototype$endDrag = _DragSource.prototype.endDrag).call.apply(_DragSource$prototype$endDrag, [this].concat(args));
    }
  };

  return ComponentDragSource;
})(_DragSource2.DragSource);

exports['default'] = ComponentDragSource;
module.exports = exports['default'];

dnd-core

Drag and drop sans the GUI

MIT
Latest version published 3 years ago

Package Health Score

91 / 100
Full package analysis