UNPKG

@progress/kendo-vue-layout

Version:
103 lines (102 loc) 2.34 kB
/** * @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 r, createVNode as s } from "vue"; import { Draggable as n } from "@progress/kendo-vue-common"; const o = /* @__PURE__ */ r({ name: "KendoResizeHandlers", props: { direction: String, rtl: Boolean, onResize: Function, onPress: Function }, computed: { handleClass() { return "k-resize-handle k-cursor-" + this.direction + "-resize"; }, dirStyles() { const { direction: e } = this.$props; switch (e) { case "ew": return this.rtl ? { top: 0, width: "9px", left: 0, right: "" } : { top: 0, width: "9px", right: 0, left: "" }; case "ns": return { left: 0, height: "9px" }; case "nesw": case "nwse": return this.rtl ? { width: "9px", height: "9px", right: "", left: 0 } : { width: "9px", height: "9px", right: 0, left: "" }; default: return {}; } }, handleStyle() { return { bottom: 0, right: 0, ...this.dirStyles }; } }, render() { const { direction: e } = this.$props; return s(n, { onPress: this.handlePress, onDrag: (t) => { this.handleResize(t, !1, e); }, onRelease: (t) => { this.handleResize(t, !0, e); } }, { default: () => [s("div", { class: this.handleClass, style: this.handleStyle }, null)] }); }, methods: { handleResize(e, t, i) { e.originalEvent.preventDefault(), this.$emit("resize", e, { end: t, direction: i }); }, handlePress(e) { this.$emit("press", e); } } }); export { o as ResizeHandlers };