Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('reuses DragDropManager provided to it', () => {
let capturedManager
const manager = createDragDropManager(TestBackend, {}, {})
const ManagerCapture = () => (
{({ dragDropManager }) => {
capturedManager = dragDropManager
return null
}}
)
TestUtils.renderIntoDocument()
expect(capturedManager).toBe(manager)
})
})
it('reuses DragDropManager provided to it', () => {
let capturedManager
const manager = createDragDropManager(TestBackend, {})
const ManagerCapture = () => (
{({ dragDropManager }) => {
capturedManager = dragDropManager
return null
}}
)
TestUtils.renderIntoDocument()
expect(capturedManager).toBe(manager)
})
})
});
}
_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
}
});
const getDndContext = () => {
if (defaultManager) return defaultManager
defaultManager = new DragDropManager(HTML5Backend)
return defaultManager
}
var createChildContext = exports.createChildContext = function createChildContext(backend, context) {
return {
dragDropManager: new _dndCore.DragDropManager(backend, context)
};
};
Object.keys(backendFactories).forEach(function (key) {
childContextTypes[key] = _React$Component$PropTypes.PropTypes.object.isRequired;
childContext[key] = new _DragDropManager.DragDropManager(backendFactories[key]);
});
return zone.runOutsideAngular(() => new DragDropManager(unpackBackendForEs5Users(backend), context))
}
provide () {
return {
dragDropManager: new DragDropManager(this.getBackend(), {
window: this.getWindow()
})
}
},
methods: {
export default (): DragDropManager => {
if (defaultManager) {
return defaultManager
}
defaultManager = new DragDropManager(HTML5Backend)
return defaultManager
}