@progress/kendo-vue-common
Version:
Kendo UI for Vue Common Utilities package
51 lines (50 loc) • 1.46 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as s } from "vue";
import * as i from "@progress/kendo-draggable";
import { getDefaultSlots as l } from "./defaultSlots.mjs";
const a = /* @__PURE__ */ s({
emits: {
press: null,
drag: null,
release: null
},
inheritAttrs: !1,
created() {
this.element = null;
const e = i, t = typeof e != "undefined" && e.Draggable ? e : e.default;
this.draggable = new t.Draggable({
press: this.press,
drag: this.drag,
release: this.release
});
},
mounted() {
this.$el && (this.element = this.$el.nodeType === 3 || this.$el.nodeType === 8 ? this.$el.nextElementSibling : this.$el, this.draggable.bindTo(this.element));
},
unmounted() {
this.draggable.destroy();
},
methods: {
press(e) {
this.element && this.$emit("press", e, this.element);
},
drag(e) {
this.element && this.$emit("drag", e, this.element);
},
release(e) {
this.element && this.$emit("release", e, this.element);
}
},
render() {
return l(this);
}
});
export {
a as Draggable
};