UNPKG

t-fighting-design

Version:

Fighting design can quickly build interactive interfaces in vue3 applications, which looks good.

2 lines (1 loc) 2.07 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("./index3.js"),k=require("../../close-btn/index.js"),C=require("../../svg-icon/index.js"),i=require("../../_utils/index3.js"),v={key:0,class:"f-alert__title"},b={key:1,class:"f-alert__sub-title"},S=e.defineComponent({name:"FAlert"}),y=e.defineComponent({...S,props:p.Props,setup(a){const o=a,c=e.ref(!0),d=e.computed(()=>{const{type:t,bold:l,simple:n,center:r,round:s,fixed:_}=o;return["f-alert",{[`f-alert__${t}`]:t,"f-alert__bold":l,"f-alert__simple":n,"f-alert__center":r,"f-alert__round":s,"f-alert__fixed":_}]}),u=e.computed(()=>{const{overflow:t}=o;return["f-alert__content",{[`f-alert__content-${t}`]:t}]}),f=e.computed(()=>{const{fontSize:t,color:l,background:n,titleSize:r,titleColor:s}=o;return{"--f-alert-color":l,"--f-alert-title-color":s,"--f-alert-background":n,"--f-alert-font-size":i.sizeChange(t),"--f-alert-title-size":i.sizeChange(r)}}),m=t=>{c.value=!1,o.closeEnd&&o.closeEnd(t)};return(t,l)=>c.value?(e.openBlock(),e.createElementBlock("div",{key:0,role:"alert",class:e.normalizeClass(e.unref(d)),style:e.normalizeStyle(e.unref(f))},[t.$slots.beforeIcon||t.beforeIcon?(e.openBlock(),e.createBlock(e.unref(C.FSvgIcon),{key:0,icon:t.beforeIcon},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"beforeIcon")]),_:3},8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u))},[t.title?(e.openBlock(),e.createElementBlock("div",v,[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])])):e.createCommentVNode("",!0),t.$slots.default?(e.openBlock(),e.createElementBlock("div",b,[e.renderSlot(t.$slots,"default")])):e.createCommentVNode("",!0)],2),t.close?(e.openBlock(),e.createBlock(e.unref(k.FCloseBtn),{key:1,icon:t.closeIcon,onClick:e.withModifiers(m,["stop"])},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"closeIcon")]),_:3},8,["icon","onClick"])):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0)}});exports.default=y;