react-virtual-kanban
Advanced tools
Comparing version 0.0.11 to 0.0.12
Changelog | ||
--------- | ||
### 0.0.12 | ||
Now `Kanban` component gets `DragDropManager` from context or creates a new one. This is useful for scenarios where react-dnd is used inside decorators. | ||
### 0.0.11 | ||
@@ -5,0 +8,0 @@ Added guard in SortableList component when list reference is not set. |
@@ -35,4 +35,2 @@ 'use strict'; | ||
var _reactDnd = require('react-dnd'); | ||
var _reactDndHtml5Backend = require('react-dnd-html5-backend'); | ||
@@ -66,2 +64,4 @@ | ||
var _dndCore = require('dnd-core'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -74,2 +74,15 @@ | ||
/** | ||
* Grab dragDropManager from context | ||
* | ||
* More info: https://github.com/gaearon/react-dnd/issues/186 | ||
*/ | ||
var getDndContext = function () { | ||
var dragDropManager = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _dndCore.DragDropManager(_reactDndHtml5Backend2.default); | ||
return function (context) { | ||
return context.dragDropManager || dragDropManager; | ||
}; | ||
}(); | ||
var Kanban = function (_Component) { | ||
@@ -96,2 +109,9 @@ (0, _inherits3.default)(Kanban, _Component); | ||
(0, _createClass3.default)(Kanban, [{ | ||
key: 'getChildContext', | ||
value: function getChildContext() { | ||
return { | ||
dragDropManager: getDndContext(this.context) | ||
}; | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -236,2 +256,8 @@ value: function componentWillReceiveProps(nextProps) { | ||
}; | ||
exports.default = (0, _reactDnd.DragDropContext)(_reactDndHtml5Backend2.default)(Kanban); | ||
Kanban.childContextTypes = { | ||
dragDropManager: _react2.default.PropTypes.object.isRequired | ||
}; | ||
Kanban.contextTypes = { | ||
dragDropManager: _react2.default.PropTypes.object.isRequired | ||
}; | ||
exports.default = Kanban; |
{ | ||
"name": "react-virtual-kanban", | ||
"description": "A Kanban component in React", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"author": "Eduardo Lanchares <eduardo@elanchares.com>", | ||
@@ -82,2 +82,3 @@ "homepage": "https://edulan.github.io/react-virtual-kanban/", | ||
"classnames": "2.2.5", | ||
"dnd-core": "^2.2.3", | ||
"dom-helpers": "^2.4.0", | ||
@@ -84,0 +85,0 @@ "react-addons-update": "15.4.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2304006
13837
12
+ Addeddnd-core@^2.2.3