1- /*! react-sortablejs v0.7 .0 | (c) 2016 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-sortable */
1+ /*! react-sortablejs v1.0 .0 | (c) 2016 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-sortable */
22( function webpackUniversalModuleDefinition ( root , factory ) {
33 if ( typeof exports === 'object' && typeof module === 'object' )
44 module . exports = factory ( require ( "react" ) , require ( "react-dom" ) , require ( "sortablejs" ) ) ;
@@ -82,8 +82,6 @@ return /******/ (function(modules) { // webpackBootstrap
8282
8383 function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
8484
85- function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
86-
8785 function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
8886
8987 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 ; }
@@ -95,6 +93,26 @@ return /******/ (function(modules) { // webpackBootstrap
9593 activeComponent : null
9694 } ;
9795
96+ var extend = function extend ( target ) {
97+ for ( var _len = arguments . length , sources = Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
98+ sources [ _key - 1 ] = arguments [ _key ] ;
99+ }
100+
101+ target = target || { } ;
102+ for ( var index = 0 ; index < sources . length ; index ++ ) {
103+ var obj = sources [ index ] ;
104+ if ( ! obj ) {
105+ continue ;
106+ }
107+ for ( var key in obj ) {
108+ if ( obj . hasOwnProperty ( key ) ) {
109+ target [ key ] = obj [ key ] ;
110+ }
111+ }
112+ }
113+ return target ;
114+ } ;
115+
98116 var _default = ( _temp2 = _class = function ( _React$Component ) {
99117 _inherits ( _default , _React$Component ) ;
100118
@@ -105,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
105123
106124 _classCallCheck ( this , _default ) ;
107125
108- for ( var _len = arguments . length , args = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
109- args [ _key ] = arguments [ _key ] ;
126+ for ( var _len2 = arguments . length , args = Array ( _len2 ) , _key2 = 0 ; _key2 < _len2 ; _key2 ++ ) {
127+ args [ _key2 ] = arguments [ _key2 ] ;
110128 }
111129
112130 return _ret = ( _temp = ( _this = _possibleConstructorReturn ( this , ( _Object$getPrototypeO = Object . getPrototypeOf ( _default ) ) . call . apply ( _Object$getPrototypeO , [ this ] . concat ( args ) ) ) , _this ) , _this . sortable = null , _temp ) , _possibleConstructorReturn ( _this , _ret ) ;
@@ -117,11 +135,7 @@ return /******/ (function(modules) { // webpackBootstrap
117135 value : function componentDidMount ( ) {
118136 var _this2 = this ;
119137
120- var _props = this . props ;
121- var children = _props . children ;
122- var className = _props . className ;
123-
124- var options = _objectWithoutProperties ( _props , [ 'children' , 'className' ] ) ;
138+ var options = extend ( { } , this . props . options ) ;
125139
126140 [ 'onStart' , 'onEnd' , 'onAdd' , 'onSort' , 'onUpdate' , 'onRemove' , 'onFilter' , 'onMove' ] . forEach ( function ( name ) {
127141 var eventHandler = options [ name ] ;
@@ -138,7 +152,9 @@ return /******/ (function(modules) { // webpackBootstrap
138152 evt . from . insertBefore ( evt . item , store . nextSibling ) ;
139153
140154 if ( remote !== _this2 ) {
141- if ( _typeof ( remote . props . group ) === 'object' && remote . props . group . pull === 'clone' ) {
155+ var remoteOptions = remote . props . options || { } ;
156+
157+ if ( _typeof ( remoteOptions . group ) === 'object' && remoteOptions . group . pull === 'clone' ) {
142158 // Remove the node with the same data-reactid
143159 evt . item . parentNode . removeChild ( evt . item ) ;
144160 }
@@ -160,20 +176,22 @@ return /******/ (function(modules) { // webpackBootstrap
160176 } , {
161177 key : 'render' ,
162178 value : function render ( ) {
163- var _props2 = this . props ;
164- var children = _props2 . children ;
165- var className = _props2 . className ;
166- var tag = _props2 . tag ;
179+ var _props = this . props ;
180+ var children = _props . children ;
181+ var className = _props . className ;
182+ var tag = _props . tag ;
167183
168184 return _react2 . default . DOM [ tag ] ( { className : className } , children ) ;
169185 }
170186 } ] ) ;
171187
172188 return _default ;
173189 } ( _react2 . default . Component ) , _class . propTypes = {
190+ options : _react2 . default . PropTypes . object ,
174191 onChange : _react2 . default . PropTypes . func ,
175192 tag : _react2 . default . PropTypes . string
176193 } , _class . defaultProps = {
194+ options : { } ,
177195 tag : 'div'
178196 } , _temp2 ) ;
179197
0 commit comments