/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{computed as e,openBlock as t,createBlock as o,withCtx as n,createElementBlock as a,createElementVNode as i,toDisplayString as l,unref as d}from"vue";import c from"./basic/SelectMenu.vue.js";import{insertTableIcon as r,addRowIcon as m,deleteRowIcon as u,toggleHeaderIcon as s,mergeCellsIcon as f,splitCellsIcon as g,deleteTableIcon as p,tableIcon as C}from"./icons.js";import './TableButton.css';/* empty css                */import v from"../../../_virtual/_plugin-vue_export-helper.js";const w={class:"flex items-center gap-2"},A=["innerHTML"],h={key:0,class:"h-0.2 w-full bg-gray-400"},b={key:1,class:"flex items-center gap-2 w-full"},x=["innerHTML"],H=/* @__PURE__ */v({__name:"TableButton",props:{editor:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},setup(v){const H=v,R=C,T=e(()=>[{name:"insertTable",title:"Insert Table",icon:r,command:()=>H.editor?.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),isActive:()=>!1,canExecute:()=>!0},{name:"addRowBefore",title:"Add Row Before",icon:m,command:()=>H.editor?.chain().focus().addRowBefore().run(),isActive:()=>!1,canExecute:()=>H.editor?.can().addRowBefore()},{name:"addRowAfter",title:"Add Row After",icon:m,command:()=>H.editor?.chain().focus().addRowAfter().run(),isActive:()=>!1,canExecute:()=>H.editor?.can().addRowAfter()},{name:"deleteRow",title:"Delete Row",icon:u,command:()=>H.editor?.chain().focus().deleteRow().run(),isActive:()=>!1,canExecute:()=>H.editor?.can().deleteRow()},{name:"addColumnBefore",title:"Add Column Before",icon:m,command:()=>H.editor?.chain().focus().addColumnBefore().run(),isActive:()=>!1,canExecute:()=>H.editor?.can().addColumnBefore()},{name:"addColumnAfter",title:"Add Column After",icon:m,command:()=>H.editor?.chain().focus().addColumnAfter().run(),isActive:()=>!1,canExecute:()=>H.editor?.can().addColumnAfter()},{name:"deleteColumn",title:"Delete Column",icon:u,command:()=>H.editor?.chain().focus().deleteColumn().run(),isActive:()=>!1,canExecute:()=>H.editor?.can().deleteColumn()}]),E=e(()=>[{name:"toggleHeaderRow",title:"Toggle Header Row",icon:s,command:()=>H.editor?.chain().focus().toggleHeaderRow().run(),canExecute:()=>H.editor?.can().toggleHeaderRow()},{name:"toggleHeaderColumn",title:"Toggle Header Column",icon:s,command:()=>H.editor?.chain().focus().toggleHeaderColumn().run(),canExecute:()=>H.editor?.can().toggleHeaderColumn()},{name:"toggleHeaderCell",title:"Toggle Header Cell",icon:s,command:()=>H.editor?.chain().focus().toggleHeaderCell().run(),canExecute:()=>H.editor?.can().toggleHeaderCell()},{name:"mergeCells",title:"Merge Cells",icon:f,command:()=>H.editor?.chain().focus().mergeCells().run(),canExecute:()=>H.editor?.can().mergeCells()},{name:"splitCell",title:"Split Cell",icon:g,command:()=>H.editor?.chain().focus().splitCell().run(),canExecute:()=>H.editor?.can().splitCell()},{name:"deleteTable",title:"Delete Table",icon:p,command:()=>H.editor?.chain().focus().deleteTable().run(),canExecute:()=>H.editor?.can().deleteTable()}]),B=e(()=>[...T.value,{type:"divider",name:"divider"},...E.value]),y=e=>{"divider"!==e.type&&e.command&&e.command()};return(e,r)=>(t(),o(c,{items:B.value,disabled:v.disabled,"min-width":180,"trigger-width":100,onSelect:y},{trigger:n(()=>[i("div",w,[i("span",{innerHTML:d(R)},null,8,A),r[0]||(r[0]=i("span",null,"Table",-1))])]),option:n(({item:e})=>["divider"===e.type?(t(),a("div",h)):(t(),a("div",b,[i("span",{innerHTML:e.icon},null,8,x),i("span",null,l(e.title),1)]))]),_:1},8,["items","disabled"]))}},[["__scopeId","data-v-694ec0f6"]]);export{H as default};