|
|
@ -11,27 +11,28 @@ |
|
|
|
is: "sortable-js", |
|
|
|
is: "sortable-js", |
|
|
|
|
|
|
|
|
|
|
|
properties: { |
|
|
|
properties: { |
|
|
|
group : { type: String, value: () => Math.random(), observer: "groupChanged" }, |
|
|
|
group : { type: String, value: () => Math.random(), observer: "groupChanged" }, |
|
|
|
sort : { type: Boolean, value: true, observer: "sortChanged" }, |
|
|
|
sort : { type: Boolean, value: true, observer: "sortChanged" }, |
|
|
|
disabled : { type: Boolean, value: false, observer: "disabledChanged" }, |
|
|
|
disabled : { type: Boolean, value: false, observer: "disabledChanged" }, |
|
|
|
store : { type: Object, value: null, observer: "storeChanged" }, |
|
|
|
store : { type: Object, value: null, observer: "storeChanged" }, |
|
|
|
handle : { type: String, value: null, observer: "handleChanged" }, |
|
|
|
handle : { type: String, value: null, observer: "handleChanged" }, |
|
|
|
scrollSensitivity : { type: Number, value: 30, observer: "scrollSensitivityChanged" }, |
|
|
|
scrollSensitivity : { type: Number, value: 30, observer: "scrollSensitivityChanged" }, |
|
|
|
scrollSpeed : { type: Number, value: 10, observer: "scrollSpeedChanged" }, |
|
|
|
scrollSpeed : { type: Number, value: 10, observer: "scrollSpeedChanged" }, |
|
|
|
ghostClass : { type: String, value: "sortable-ghost", observer: "ghostClassChanged" }, |
|
|
|
ghostClass : { type: String, value: "sortable-ghost", observer: "ghostClassChanged" }, |
|
|
|
chosenClass : { type: String, value: "sortable-chosen", observer: "chosenClassChanged" }, |
|
|
|
chosenClass : { type: String, value: "sortable-chosen", observer: "chosenClassChanged" }, |
|
|
|
ignore : { type: String, value: "a, img", observer: "ignoreChanged" }, |
|
|
|
ignore : { type: String, value: "a, img", observer: "ignoreChanged" }, |
|
|
|
filter : { type: Object, value: null, observer: "filterChanged" }, |
|
|
|
filter : { type: Object, value: null, observer: "filterChanged" }, |
|
|
|
animation : { type: Number, value: 0, observer: "animationChanged" }, |
|
|
|
animation : { type: Number, value: 0, observer: "animationChanged" }, |
|
|
|
dropBubble : { type: Boolean, value: false, observer: "dropBubbleChanged" }, |
|
|
|
dropBubble : { type: Boolean, value: false, observer: "dropBubbleChanged" }, |
|
|
|
dragoverBubble : { type: Boolean, value: false, observer: "dragoverBubbleChanged" }, |
|
|
|
dragoverBubble : { type: Boolean, value: false, observer: "dragoverBubbleChanged" }, |
|
|
|
dataIdAttr : { type: String, value: "data-id", observer: "dataIdAttrChanged" }, |
|
|
|
dataIdAttr : { type: String, value: "data-id", observer: "dataIdAttrChanged" }, |
|
|
|
delay : { type: Number, value: 0, observer: "delayChanged" }, |
|
|
|
delay : { type: Number, value: 0, observer: "delayChanged" }, |
|
|
|
forceFallback : { type: Boolean, value: false, observer: "forceFallbackChanged" }, |
|
|
|
forceFallback : { type: Boolean, value: false, observer: "forceFallbackChanged" }, |
|
|
|
fallbackClass : { type: String, value: "sortable-fallback", observer: "fallbackClassChanged" }, |
|
|
|
fallbackClass : { type: String, value: "sortable-fallback", observer: "fallbackClassChanged" }, |
|
|
|
fallbackOnBody : { type: Boolean, value: false, observer: "fallbackOnBodyChanged" }, |
|
|
|
fallbackOnBody : { type: Boolean, value: false, observer: "fallbackOnBodyChanged" }, |
|
|
|
draggable : {}, |
|
|
|
manuallyHandleUpdateEvents : { type: Boolean, value: false }, |
|
|
|
scroll : {} |
|
|
|
draggable : {}, |
|
|
|
|
|
|
|
scroll : {} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
created() { |
|
|
|
created() { |
|
|
@ -78,7 +79,11 @@ |
|
|
|
this.sortable = Sortable.create(this, Object.assign(options, { |
|
|
|
this.sortable = Sortable.create(this, Object.assign(options, { |
|
|
|
onUpdate: e => { |
|
|
|
onUpdate: e => { |
|
|
|
if (template) { |
|
|
|
if (template) { |
|
|
|
template.items.splice(e.newIndex, 0, template.items.splice(e.oldIndex, 1)[0]); |
|
|
|
if(manuallyHandleUpdateEvents) { |
|
|
|
|
|
|
|
template.items.splice(e.newIndex, 0, template.items.splice(e.oldIndex, 1)[0]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
template.splice("items", e.newIndex, 0, template.splice("items", e.oldIndex, 1)[0]) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.fire("update", e) |
|
|
|
this.fire("update", e) |
|
|
|
}, |
|
|
|
}, |
|
|
|