import e from"./KeyCode.mjs";import{createVNode as t,defineComponent as n,onMounted as r,shallowRef as i}from"vue";var a={border:0,background:`transparent`,padding:0,lineHeight:`inherit`,display:`inline-block`},o=n({compatConfig:{MODE:3},name:`TransButton`,inheritAttrs:!1,props:{noStyle:{type:Boolean,default:void 0},onClick:Function,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0}},setup(n,{slots:o,emit:s,attrs:c,expose:l}){let u=i(),d=t=>{let{keyCode:n}=t;n===e.ENTER&&t.preventDefault()},f=t=>{let{keyCode:n}=t;n===e.ENTER&&s(`click`,t)},p=e=>{s(`click`,e)},m=()=>{u.value&&u.value.focus()};return r(()=>{n.autofocus&&m()}),l({focus:m,blur:()=>{u.value&&u.value.blur()}}),()=>{let{noStyle:e,disabled:r,...i}=n,s={};return e||(s={...a}),r&&(s.pointerEvents=`none`),t(`div`,{role:`button`,tabindex:0,ref:u,...i,...c,onClick:p,onKeydown:d,onKeyup:f,style:{...s,...c.style||{}}},[o.default?.()])}}});export{o as default};