react-sortablejs
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -13,3 +13,3 @@ { | ||
"react": "^0.14.0 || ^15.0.0", | ||
"sortablejs": ">=1.5.0-rc1 || ^1.5.0" | ||
"sortablejs": "^1.5.1" | ||
}, | ||
@@ -16,0 +16,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
/*! react-sortablejs v1.3.0 | (c) 2017 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-sortable */ | ||
/*! react-sortablejs v1.3.1 | (c) 2017 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-sortable */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -11,3 +11,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
root["ReactSortable"] = factory(root["React"], root["ReactDOM"], root["Sortable"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) { | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
@@ -26,5 +26,5 @@ /******/ // The module cache | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
@@ -36,3 +36,3 @@ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ module.l = true; | ||
@@ -50,2 +50,28 @@ /******/ // Return the exports of the module | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ // __webpack_public_path__ | ||
@@ -55,3 +81,3 @@ /******/ __webpack_require__.p = ""; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ return __webpack_require__(__webpack_require__.s = 3); | ||
/******/ }) | ||
@@ -61,168 +87,168 @@ /************************************************************************/ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports) { | ||
'use strict'; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_0__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports) { | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports) { | ||
var _class, _temp2; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; | ||
var _react = __webpack_require__(1); | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var _react2 = _interopRequireDefault(_react); | ||
"use strict"; | ||
var _reactDom = __webpack_require__(2); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _sortablejs = __webpack_require__(3); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _sortablejs2 = _interopRequireDefault(_sortablejs); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _class, _temp2; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _react = __webpack_require__(0); | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
var _react2 = _interopRequireDefault(_react); | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _reactDom = __webpack_require__(1); | ||
var store = { | ||
nextSibling: null, | ||
activeComponent: null | ||
}; | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
module.exports = (_temp2 = _class = function (_React$Component) { | ||
_inherits(_class, _React$Component); | ||
var _sortablejs = __webpack_require__(2); | ||
function _class() { | ||
var _ref; | ||
var _sortablejs2 = _interopRequireDefault(_sortablejs); | ||
var _temp, _this, _ret; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
_classCallCheck(this, _class); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = _class.__proto__ || Object.getPrototypeOf(_class)).call.apply(_ref, [this].concat(args))), _this), _this.sortable = null, _temp), _possibleConstructorReturn(_this, _ret); | ||
} | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
_createClass(_class, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
var _this2 = this; | ||
var store = { | ||
nextSibling: null, | ||
activeComponent: null | ||
}; | ||
var options = _extends({}, this.props.options); | ||
module.exports = (_temp2 = _class = function (_React$Component) { | ||
_inherits(_class, _React$Component); | ||
['onChoose', 'onStart', 'onEnd', 'onAdd', 'onUpdate', 'onSort', 'onRemove', 'onFilter', 'onMove', 'onClone'].forEach(function (name) { | ||
var eventHandler = options[name]; | ||
function _class() { | ||
var _ref; | ||
options[name] = function () { | ||
for (var _len2 = arguments.length, params = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
params[_key2] = arguments[_key2]; | ||
} | ||
var _temp, _this, _ret; | ||
var evt = params[0]; | ||
_classCallCheck(this, _class); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
if (name === 'onChoose') { | ||
store.nextSibling = evt.item.nextElementSibling; | ||
store.activeComponent = _this2; | ||
} else if ((name === 'onAdd' || name === 'onUpdate') && _this2.props.onChange) { | ||
var items = _this2.sortable.toArray(); | ||
var remote = store.activeComponent; | ||
var remoteItems = remote.sortable.toArray(); | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = _class.__proto__ || Object.getPrototypeOf(_class)).call.apply(_ref, [this].concat(args))), _this), _this.sortable = null, _temp), _possibleConstructorReturn(_this, _ret); | ||
} | ||
evt.from.insertBefore(evt.item, store.nextSibling); | ||
_createClass(_class, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
var _this2 = this; | ||
if (remote !== _this2) { | ||
var remoteOptions = remote.props.options || {}; | ||
var options = _extends({}, this.props.options); | ||
if (_typeof(remoteOptions.group) === 'object' && remoteOptions.group.pull === 'clone') { | ||
// Remove the node with the same data-reactid | ||
evt.item.parentNode.removeChild(evt.item); | ||
} | ||
['onChoose', 'onStart', 'onEnd', 'onAdd', 'onUpdate', 'onSort', 'onRemove', 'onFilter', 'onMove', 'onClone'].forEach(function (name) { | ||
var eventHandler = options[name]; | ||
remote.props.onChange && remote.props.onChange(remoteItems, remote.sortable, evt); | ||
} | ||
options[name] = function () { | ||
for (var _len2 = arguments.length, params = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
params[_key2] = arguments[_key2]; | ||
} | ||
_this2.props.onChange && _this2.props.onChange(items, _this2.sortable, evt); | ||
} | ||
var evt = params[0]; | ||
if (evt.type === 'move') { | ||
var _evt = params[0], | ||
originalEvent = params[1]; | ||
var canMove = eventHandler ? eventHandler(_evt, originalEvent) : true; | ||
return canMove; | ||
} | ||
if (name === 'onChoose') { | ||
store.nextSibling = evt.item.nextElementSibling; | ||
store.activeComponent = _this2; | ||
} else if ((name === 'onAdd' || name === 'onUpdate') && _this2.props.onChange) { | ||
var items = _this2.sortable.toArray(); | ||
var remote = store.activeComponent; | ||
var remoteItems = remote.sortable.toArray(); | ||
setTimeout(function () { | ||
eventHandler && eventHandler(evt); | ||
}, 0); | ||
}; | ||
}); | ||
evt.from.insertBefore(evt.item, store.nextSibling); | ||
this.sortable = _sortablejs2.default.create(_reactDom2.default.findDOMNode(this), options); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
if (this.sortable) { | ||
this.sortable.destroy(); | ||
this.sortable = null; | ||
} | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var _props = this.props, | ||
children = _props.children, | ||
className = _props.className, | ||
tag = _props.tag, | ||
style = _props.style; | ||
if (remote !== _this2) { | ||
var remoteOptions = remote.props.options || {}; | ||
return _react2.default.DOM[tag]({ className: className, style: style }, children); | ||
} | ||
}]); | ||
if (_typeof(remoteOptions.group) === 'object' && remoteOptions.group.pull === 'clone') { | ||
// Remove the node with the same data-reactid | ||
evt.item.parentNode.removeChild(evt.item); | ||
} | ||
return _class; | ||
}(_react2.default.Component), _class.propTypes = { | ||
options: _react2.default.PropTypes.object, | ||
onChange: _react2.default.PropTypes.func, | ||
tag: _react2.default.PropTypes.string, | ||
style: _react2.default.PropTypes.object | ||
}, _class.defaultProps = { | ||
options: {}, | ||
tag: 'div', | ||
style: {} | ||
}, _temp2); | ||
remote.props.onChange && remote.props.onChange(remoteItems, remote.sortable, evt); | ||
} | ||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
_this2.props.onChange && _this2.props.onChange(items, _this2.sortable, evt); | ||
} | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__; | ||
if (evt.type === 'move') { | ||
var _evt = params[0], | ||
originalEvent = params[1]; | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports) { | ||
var canMove = eventHandler ? eventHandler(_evt, originalEvent) : true; | ||
return canMove; | ||
} | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; | ||
setTimeout(function () { | ||
eventHandler && eventHandler(evt); | ||
}, 0); | ||
}; | ||
}); | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
this.sortable = _sortablejs2.default.create(_reactDom2.default.findDOMNode(this), options); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
if (this.sortable) { | ||
this.sortable.destroy(); | ||
this.sortable = null; | ||
} | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var _props = this.props, | ||
children = _props.children, | ||
className = _props.className, | ||
tag = _props.tag, | ||
style = _props.style; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_3__; | ||
return _react2.default.DOM[tag]({ className: className, style: style }, children); | ||
} | ||
}]); | ||
/***/ } | ||
/******/ ]) | ||
}); | ||
; | ||
return _class; | ||
}(_react2.default.Component), _class.propTypes = { | ||
options: _react2.default.PropTypes.object, | ||
onChange: _react2.default.PropTypes.func, | ||
tag: _react2.default.PropTypes.string, | ||
style: _react2.default.PropTypes.object | ||
}, _class.defaultProps = { | ||
options: {}, | ||
tag: 'div', | ||
style: {} | ||
}, _temp2); | ||
/***/ }) | ||
/******/ ]); | ||
}); |
@@ -1,2 +0,2 @@ | ||
/*! react-sortablejs v1.3.0 | (c) 2017 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-sortable */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("sortablejs")):"function"==typeof define&&define.amd?define(["react","react-dom","sortablejs"],t):"object"==typeof exports?exports.ReactSortable=t(require("react"),require("react-dom"),require("sortablejs")):e.ReactSortable=t(e.React,e.ReactDOM,e.Sortable)}(this,function(e,t,o){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s,p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),f=o(1),y=n(f),b=o(2),d=n(b),m=o(3),h=n(m),v={nextSibling:null,activeComponent:null};e.exports=(s=l=function(e){function t(){var e,o,n,i;r(this,t);for(var l=arguments.length,s=Array(l),p=0;p<l;p++)s[p]=arguments[p];return o=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n.sortable=null,i=o,a(n,i)}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this,t=u({},this.props.options);["onChoose","onStart","onEnd","onAdd","onUpdate","onSort","onRemove","onFilter","onMove","onClone"].forEach(function(o){var n=t[o];t[o]=function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];var i=r[0];if("onChoose"===o)v.nextSibling=i.item.nextElementSibling,v.activeComponent=e;else if(("onAdd"===o||"onUpdate"===o)&&e.props.onChange){var l=e.sortable.toArray(),s=v.activeComponent,u=s.sortable.toArray();if(i.from.insertBefore(i.item,v.nextSibling),s!==e){var c=s.props.options||{};"object"===p(c.group)&&"clone"===c.group.pull&&i.item.parentNode.removeChild(i.item),s.props.onChange&&s.props.onChange(u,s.sortable,i)}e.props.onChange&&e.props.onChange(l,e.sortable,i)}if("move"===i.type){var f=r[0],y=r[1],b=!n||n(f,y);return b}setTimeout(function(){n&&n(i)},0)}}),this.sortable=h.default.create(d.default.findDOMNode(this),t)}},{key:"componentWillUnmount",value:function(){this.sortable&&(this.sortable.destroy(),this.sortable=null)}},{key:"render",value:function(){var e=this.props,t=e.children,o=e.className,n=e.tag,r=e.style;return y.default.DOM[n]({className:o,style:r},t)}}]),t}(y.default.Component),l.propTypes={options:y.default.PropTypes.object,onChange:y.default.PropTypes.func,tag:y.default.PropTypes.string,style:y.default.PropTypes.object},l.defaultProps={options:{},tag:"div",style:{}},s)},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){e.exports=o}])}); | ||
/*! react-sortablejs v1.3.1 | (c) 2017 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-sortable */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("sortablejs")):"function"==typeof define&&define.amd?define(["react","react-dom","sortablejs"],t):"object"==typeof exports?exports.ReactSortable=t(require("react"),require("react-dom"),require("sortablejs")):e.ReactSortable=t(e.React,e.ReactDOM,e.Sortable)}(this,function(e,t,o){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){e.exports=o},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u,l,p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),f=o(0),y=n(f),b=o(1),d=n(b),m=o(2),h=n(m),v={nextSibling:null,activeComponent:null};e.exports=(l=u=function(e){function t(){var e,o,n,i;r(this,t);for(var u=arguments.length,l=Array(u),p=0;p<u;p++)l[p]=arguments[p];return o=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),n.sortable=null,i=o,a(n,i)}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this,t=s({},this.props.options);["onChoose","onStart","onEnd","onAdd","onUpdate","onSort","onRemove","onFilter","onMove","onClone"].forEach(function(o){var n=t[o];t[o]=function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];var i=r[0];if("onChoose"===o)v.nextSibling=i.item.nextElementSibling,v.activeComponent=e;else if(("onAdd"===o||"onUpdate"===o)&&e.props.onChange){var u=e.sortable.toArray(),l=v.activeComponent,s=l.sortable.toArray();if(i.from.insertBefore(i.item,v.nextSibling),l!==e){var c=l.props.options||{};"object"===p(c.group)&&"clone"===c.group.pull&&i.item.parentNode.removeChild(i.item),l.props.onChange&&l.props.onChange(s,l.sortable,i)}e.props.onChange&&e.props.onChange(u,e.sortable,i)}if("move"===i.type){var f=r[0],y=r[1],b=!n||n(f,y);return b}setTimeout(function(){n&&n(i)},0)}}),this.sortable=h.default.create(d.default.findDOMNode(this),t)}},{key:"componentWillUnmount",value:function(){this.sortable&&(this.sortable.destroy(),this.sortable=null)}},{key:"render",value:function(){var e=this.props,t=e.children,o=e.className,n=e.tag,r=e.style;return y.default.DOM[n]({className:o,style:r},t)}}]),t}(y.default.Component),u.propTypes={options:y.default.PropTypes.object,onChange:y.default.PropTypes.func,tag:y.default.PropTypes.string,style:y.default.PropTypes.object},u.defaultProps={options:{},tag:"div",style:{}},l)}])}); |
@@ -60,3 +60,3 @@ import extend from 'lodash/extend'; | ||
<div> | ||
<div className="container-fluid" style={{marginTop: 50}}> | ||
<div style={{marginTop: 50}}> | ||
<div className="title">Simple List</div> | ||
@@ -94,3 +94,3 @@ <div className="form-group"> | ||
</div> | ||
<div className="container-fluid"> | ||
<div> | ||
<div className="title" style={{marginTop: 50}}>Shared Group</div> | ||
@@ -147,3 +147,3 @@ <div className="form-group"> | ||
</div> | ||
<div className="container-fluid"> | ||
<div> | ||
<div className="title" style={{marginTop: 50}}>Uncontrolled Component</div> | ||
@@ -186,3 +186,3 @@ <h4>Clone items from left to right. DOM elements are duplicated.</h4> | ||
</div> | ||
<div className="container-fluid"> | ||
<div> | ||
<div className="title" style={{marginTop: 50}}>Controlled Component</div> | ||
@@ -189,0 +189,0 @@ <h4>Clone items from left to right without duplication.</h4> |
@@ -0,18 +1,51 @@ | ||
/* eslint no-var: 0 */ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
var nib = require('nib'); | ||
var stylusLoader = require('stylus-loader'); | ||
module.exports = { | ||
debug: true, | ||
devtool: 'source-map', | ||
entry: path.resolve(__dirname, 'index.jsx'), | ||
output: { | ||
path: path.join(__dirname), | ||
path: path.join(__dirname, '../docs'), | ||
filename: 'bundle.js' | ||
}, | ||
module: { | ||
loaders: [ | ||
rules: [ | ||
{ | ||
test: /\.json$/, | ||
loader: 'json-loader' | ||
}, | ||
{ | ||
test: /\.jsx?$/, | ||
loader: 'babel', | ||
loader: 'babel-loader', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /\.styl$/, | ||
loader: 'style-loader!css-loader!stylus-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loader: 'style-loader!css-loader' | ||
}, | ||
{ | ||
test: /\.(png|jpg)$/, | ||
loader: 'url-loader', | ||
query: { | ||
limit: 8192 | ||
} | ||
}, | ||
{ | ||
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'url-loader', | ||
query: { | ||
limit: 10000, | ||
mimetype: 'application/font-woff' | ||
} | ||
}, | ||
{ | ||
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'file-loader' | ||
} | ||
@@ -22,5 +55,22 @@ ] | ||
plugins: [ | ||
new webpack.LoaderOptionsPlugin({ | ||
debug: true | ||
}), | ||
new stylusLoader.OptionsPlugin({ | ||
default: { | ||
// nib - CSS3 extensions for Stylus | ||
use: [nib()], | ||
// no need to have a '@import "nib"' in the stylesheet | ||
import: ['~nib/lib/nib/index.styl'] | ||
} | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
}, | ||
mangle: false | ||
}) | ||
], | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'] | ||
extensions: ['.js', '.json', '.jsx'] | ||
}, | ||
@@ -30,3 +80,2 @@ // https://webpack.github.io/docs/webpack-dev-server.html#additional-configuration-options | ||
noInfo: false, | ||
quite: false, | ||
lazy: false, | ||
@@ -33,0 +82,0 @@ // https://webpack.github.io/docs/node.js-api.html#compiler |
{ | ||
"name": "react-sortablejs", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A React component built on top of Sortable (https://github.com/RubaXa/Sortable).", | ||
@@ -17,3 +17,3 @@ "main": "lib/index.js", | ||
"coveralls": "./babel-tap --coverage --coverage-report=text-lcov test/*.js | node_modules/.bin/coveralls", | ||
"webpack-dev-server": "cd examples; webpack-dev-server --hot --inline --host 0.0.0.0 --port 8000" | ||
"dev": "cd examples; webpack-dev-server --hot --inline --host 0.0.0.0 --port 8000 --content-base ../docs" | ||
}, | ||
@@ -44,28 +44,32 @@ "pre-commit": [ | ||
"react-dom": "^0.14.0 || ^15.0.0", | ||
"sortablejs": ">=1.5.0-rc1 || ^1.5.0" | ||
"sortablejs": "^1.5.1" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.21.0", | ||
"babel-cli": "^6.22.2", | ||
"babel-core": "^6.22.1", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.2.10", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"coveralls": "^2.11.15", | ||
"eslint": "^3.13.0", | ||
"eslint-config-airbnb": "^13.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^3.0.1", | ||
"eslint-plugin-react": "^6.9.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-react": "^6.22.0", | ||
"babel-preset-stage-0": "^6.22.0", | ||
"coveralls": "^2.11.16", | ||
"eslint": "~3.15.0", | ||
"eslint-config-trendmicro": "~0.5.1", | ||
"eslint-loader": "~1.6.1", | ||
"eslint-plugin-import": "~2.2.0", | ||
"eslint-plugin-jsx-a11y": "~2.2.3", | ||
"eslint-plugin-react": "~6.9.0", | ||
"lodash": "^4.17.4", | ||
"react": "^0.14.0 || ^15.0.0", | ||
"react-dom": "^0.14.0 || ^15.0.0", | ||
"sortablejs": ">=1.5.0-rc1 || ^1.5.0", | ||
"tap": "^9.0.2", | ||
"webpack": "^1.14.0", | ||
"webpack-dev-server": "^1.16.2" | ||
"nib": "^1.1.2", | ||
"react": "^15.4.2", | ||
"react-dom": "^15.4.2", | ||
"sortablejs": "^1.5.1", | ||
"stylus": "^0.54.5", | ||
"stylus-loader": "^2.4.0", | ||
"tap": "^10.1.0", | ||
"webpack": "^2.2.1", | ||
"webpack-dev-server": "^2.3.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 4 instances in 1 package
1
488960
25
21
2390