@progress/kendo-vue-layout
Version:
9 lines (8 loc) • 1.55 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
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),i=require("@progress/kendo-vue-common"),n=s.defineComponent({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.createVNode(i.Draggable,{onPress:this.handlePress,onDrag:t=>{this.handleResize(t,!1,e)},onRelease:t=>{this.handleResize(t,!0,e)}},{default:()=>[s.createVNode("div",{class:this.handleClass,style:this.handleStyle},null)]})},methods:{handleResize(e,t,r){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:t,direction:r})},handlePress(e){this.$emit("press",e)}}});exports.ResizeHandlers=n;