UNPKG

@progress/kendo-vue-editor

Version:
9 lines (8 loc) 1.73 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),w=require("../utils.js"),M="k-ct-cell k-disabled",m="k-selected",k=t.defineComponent({name:"KendoPopupGrid",props:{rows:Number,columns:Number,createTableMessage:String,createTableHintMessage:String,onCellclick:Function,onDown:Function},data(){return{row:-1,col:-1}},render(){const e=[],s=this.$props.columns*this.$props.rows,{row:c,col:n}=this.$data;let i=this.$props.createTableMessage;n>-1&&(i=w.formatString(this.$props.createTableHintMessage,c+1,n+1));const a=function(o,d,h){const l=Math.floor(o/this.$props.columns),r=o%this.$props.columns,p=r<=h&&l<=d;return t.createVNode("span",{class:M+(p?` ${m}`:""),onMouseenter:()=>this.cellMouseEnter({row:l,col:r}),onClick:()=>this.onCellClick(l,r),key:o},null)};for(let o=0;o<s;o++)e.push(a.call(this,o,c,n));const u=[t.createVNode("div",{onMouseleave:()=>this.handleMouseLeave(),key:"cells",style:{borderColor:"inherit"},onPointerdown:this.onMouseDown},[e]),t.createVNode("div",{class:"k-status",key:"status",onPointerdown:this.onMouseDown},[i])];return t.createVNode("span",null,[u])},methods:{cellMouseEnter({row:e,col:s}){this.row=e,this.col=s},handleMouseLeave(){this.row=-1,this.col=-1},onCellClick(e,s){this.$emit("cellclick",e,s)},onMouseDown(e){this.$emit("down",e)}}});exports.PopupGrid=k;