"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),a=require("./KeyCode.js"),v={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},C=t.defineComponent({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(u,{slots:r,emit:i,attrs:d,expose:c}){const n=t.shallowRef(),f=e=>{const{keyCode:o}=e;o===a.default.ENTER&&e.preventDefault()},y=e=>{const{keyCode:o}=e;o===a.default.ENTER&&i("click",e)},p=e=>{i("click",e)},s=()=>{n.value&&n.value.focus()},b=()=>{n.value&&n.value.blur()};return t.onMounted(()=>{u.autofocus&&s()}),c({focus:s,blur:b}),()=>{const{noStyle:e,disabled:o,...k}=u;let l={};return e||(l={...v}),o&&(l.pointerEvents="none"),t.createVNode("div",{role:"button",tabindex:0,ref:n,...k,...d,onClick:p,onKeydown:f,onKeyup:y,style:{...l,...d.style||{}}},[r.default?.()])}}});exports.default=C;
