"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("@aplus-frontend/antdv"),l=require("lodash-unified");require("../config-provider/index.js");require("../utils/index.js");const S=require("./context.js"),P=require("./style/index.js"),h=require("../config-provider/hooks/use-namespace.js"),x=require("../utils/is.js"),q=e.defineComponent({name:"ApText",__name:"index",props:{ellipsis:{type:[Boolean,Object]},delete:{type:Boolean},type:{},code:{type:Boolean},mark:{type:Boolean},strong:{type:Boolean},content:{},underline:{type:Boolean},disabled:{type:Boolean},prefixCls:{},keyboard:{type:Boolean},editable:{type:[Boolean,Object]},copyable:{type:[Boolean,Object]},"onUpdate:content":{},label:{},colon:{type:Boolean,default:void 0},vertical:{type:Boolean,default:void 0},labelStyle:{default:void 0},link:{type:[Boolean,String]},linkProps:{default:()=>({})},onClickContent:{},class:{},style:{}},setup(o){const a=e.useSlots(),n=o,{b:p,e:r,em:f,m}=h.useNamespace("ap-text"),k=P.default("ap-text"),{colon:s,vertical:i,labelStyle:y}=S.useInjectApTextGroup(),b=e.computed(()=>l.isUndefined(n.colon)?l.isUndefined(s?.value)?!0:s.value:n.colon),v=e.computed(()=>l.isUndefined(n.vertical)?l.isUndefined(i?.value)?!1:i.value:n.vertical),B=e.computed(()=>{const t=e.unref(y)||{};return Object.assign(t,n.labelStyle||{}),t}),c=e.computed(()=>{if(n.label)return e.isVNode(n.label)?n.label:e.createVNode(e.Fragment,null,[n.label])}),C=e.computed(()=>{const t=x.isDef(n.linkProps.ellipsis)?n.linkProps.ellipsis:!!n.ellipsis;return{href:l.isString(n.link)?n.link:void 0,...l.omit(n,["linkProps"]),...n.linkProps,ellipsis:t}});return(t,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(p)(),{[e.unref(m)("vertical")]:v.value},e.unref(k)])},[c.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(r)("label"),{[e.unref(f)("label","no-colon")]:!b.value}]),style:e.normalizeStyle(B.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value)))],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("content"))},[o.link?(e.openBlock(),e.createBlock(e.unref(d.TypographyLink),e.mergeProps({key:0},C.value,{onClick:o.onClickContent}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["onClick"])):(e.openBlock(),e.createBlock(e.unref(d.TypographyText),e.mergeProps({key:1},e.unref(l.omit)(n,["label","colon","link","linkProps","vertical","labelStyle"]),{onClick:o.onClickContent}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.content||"--"),1)])]),_:2},[e.renderList(e.unref(l.omit)(a,["default","addonAfter"]),(T,u)=>({name:u,fn:e.withCtx(g=>[e.renderSlot(t.$slots,u,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1040,["onClick"])),a.addonAfter?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(r)("content-addon-after"))},[e.renderSlot(t.$slots,"addonAfter")],2)):e.createCommentVNode("",!0)],2)],2))}});exports.default=q;
