1
1
'use strict' ;
2
2
3
+ 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 ; } ;
4
+
3
5
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 ; } ;
4
6
5
7
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
@@ -33,17 +35,21 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
33
35
}
34
36
35
37
function emit ( evtName , evtData ) {
36
- this . $emit ( evtName . toLowerCase ( ) , evtData ) ;
38
+ var _this = this ;
39
+
40
+ this . $nextTick ( function ( ) {
41
+ return _this . $emit ( evtName . toLowerCase ( ) , evtData ) ;
42
+ } ) ;
37
43
}
38
44
39
45
function delegateAndEmit ( evtName ) {
40
- var _this = this ;
46
+ var _this2 = this ;
41
47
42
48
return function ( evtData ) {
43
- if ( _this . realList !== null ) {
44
- _this [ 'onDrag' + evtName ] ( evtData ) ;
49
+ if ( _this2 . realList !== null ) {
50
+ _this2 [ 'onDrag' + evtName ] ( evtData ) ;
45
51
}
46
- emit . call ( _this , evtName , evtData ) ;
52
+ emit . call ( _this2 , evtName , evtData ) ;
47
53
} ;
48
54
}
49
55
@@ -100,19 +106,19 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
100
106
return h ( this . element , null , this . $slots . default ) ;
101
107
} ,
102
108
mounted : function mounted ( ) {
103
- var _this2 = this ;
109
+ var _this3 = this ;
104
110
105
111
var optionsAdded = { } ;
106
112
eventsListened . forEach ( function ( elt ) {
107
- optionsAdded [ 'on' + elt ] = delegateAndEmit . call ( _this2 , elt ) ;
113
+ optionsAdded [ 'on' + elt ] = delegateAndEmit . call ( _this3 , elt ) ;
108
114
} ) ;
109
115
110
116
eventsToEmit . forEach ( function ( elt ) {
111
- optionsAdded [ 'on' + elt ] = emit . bind ( _this2 , elt ) ;
117
+ optionsAdded [ 'on' + elt ] = emit . bind ( _this3 , elt ) ;
112
118
} ) ;
113
119
114
120
var options = _extends ( { } , this . options , optionsAdded , { onMove : function onMove ( evt ) {
115
- return _this2 . onDragMove ( evt ) ;
121
+ return _this3 . onDragMove ( evt ) ;
116
122
} } ) ;
117
123
this . _sortable = new Sortable ( this . rootContainer , options ) ;
118
124
this . computeIndexes ( ) ;
@@ -127,7 +133,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
127
133
return this . transitionMode ? this . $el . children [ 0 ] : this . $el ;
128
134
} ,
129
135
isCloning : function isCloning ( ) {
130
- return ! ! this . options && ! ! this . options . group && this . options . group . pull === 'clone' ;
136
+ return ! ! this . options && ! ! this . options . group !== null && this . options . group . pull === 'clone' ;
131
137
} ,
132
138
realList : function realList ( ) {
133
139
return ! ! this . list ? this . list : this . value ;
@@ -153,10 +159,10 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
153
159
return this . transitionMode ? rawNodes [ 0 ] . child . $slots . default : rawNodes ;
154
160
} ,
155
161
computeIndexes : function computeIndexes ( ) {
156
- var _this3 = this ;
162
+ var _this4 = this ;
157
163
158
164
this . $nextTick ( function ( ) {
159
- _this3 . visibleIndexes = _computeIndexes ( _this3 . getChildrenNodes ( ) , _this3 . rootContainer . children ) ;
165
+ _this4 . visibleIndexes = _computeIndexes ( _this4 . getChildrenNodes ( ) , _this4 . rootContainer . children ) ;
160
166
} ) ;
161
167
} ,
162
168
getUnderlyingVm : function getUnderlyingVm ( htmlElt ) {
@@ -173,10 +179,10 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
173
179
return __vue__ . $parent ;
174
180
} ,
175
181
emitChanges : function emitChanges ( evt ) {
176
- var _this4 = this ;
182
+ var _this5 = this ;
177
183
178
184
this . $nextTick ( function ( ) {
179
- _this4 . $emit ( 'change' , evt ) ;
185
+ _this5 . $emit ( 'change' , evt ) ;
180
186
} ) ;
181
187
} ,
182
188
alterList : function alterList ( onList ) {
@@ -203,8 +209,8 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
203
209
this . alterList ( updatePosition ) ;
204
210
} ,
205
211
getRelatedContextFromMoveEvent : function getRelatedContextFromMoveEvent ( _ref2 ) {
206
- var to = _ref2 . to ;
207
- var related = _ref2 . related ;
212
+ var to = _ref2 . to ,
213
+ related = _ref2 . related ;
208
214
209
215
var component = this . getUnderlyingPotencialDraggableComponent ( to ) ;
210
216
if ( ! component ) {
@@ -293,7 +299,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
293
299
return draggableComponent ;
294
300
}
295
301
296
- if ( typeof exports == "object" ) {
302
+ if ( ( typeof exports === 'undefined' ? 'undefined' : _typeof ( exports ) ) == "object" ) {
297
303
var Sortable = require ( "sortablejs" ) ;
298
304
module . exports = buildDraggable ( Sortable ) ;
299
305
} else if ( typeof define == "function" && define . amd ) {
0 commit comments