3 lines
1.3 KiB
JavaScript

import{u as l}from"./useApp.8bd6dbd4.js";import{_ as d}from"./index.2a9a64ca.js";const m=Vue.defineComponent({props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){var o;l(t);const n=(o=Vue.getCurrentInstance())==null?void 0:o.proxy,c=Vue.reactive([]),f=Vue.computed(()=>[typeof t.config.preAction=="function"?t.config.preAction:()=>!0,...c,typeof t.config.postAction=="function"?t.config.postAction:()=>!0]);function a(e){c.push(e)}async function s(){for(const e of f.value)if(typeof e=="function"&&await e(n,{model:t.model})===!1)break}const i=Vue.computed(()=>{var e,u,r;return{type:"text",text:((e=t.config)==null?void 0:e.text)||"",disabledText:((u=t.config)==null?void 0:u.disabledText)||"",html:((r=t.config)==null?void 0:r.html)||""}});return{pushAction:a,clickHandler:s,textConfig:i}}});function g(t,n,c,f,a,s){const i=Vue.resolveComponent("magic-ui-text");return Vue.openBlock(),Vue.createElementBlock("button",{class:"magic-ui-button",onClick:n[0]||(n[0]=(...o)=>t.clickHandler&&t.clickHandler(...o))},[Vue.renderSlot(t.$slots,"default",{},()=>[Vue.createVNode(i,{config:t.textConfig},null,8,["config"])])])}const V=d(m,[["render",g],["__file","/parisma/github/tmagic-editor/packages/ui/src/button/src/index.vue"]]);export{V as default};
//# sourceMappingURL=index.d9593460.js.map