UNPKG

tyh-ui2

Version:

The next generation ui component library of tyh-ui is based on vue3 Version, fully embrace vue3.

2 lines (1 loc) 45.1 kB
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.tyhUi2={},d.Vue))})(this,function(d,e){"use strict";const ce="4.4.0",de={type:{type:String,default:()=>"default",validator:t=>["default","primary","success","danger","warning",""].includes(t)},round:Boolean,disabled:Boolean,icon:String,size:{type:String,validator:t=>["large","small","mini",""].includes(t)},square:Boolean,simple:Boolean,loading:Boolean,block:Boolean},me=["disabled"],pe=e.defineComponent({name:"TyhButton"}),g=e.defineComponent({...pe,props:de,setup(t){const o=t,n=e.computed(()=>{const a={primary:"#3a6ff4",success:"#54c600",danger:"#d10f1b",warning:"#fbcc30",default:"#3f536e"};return o.simple?a[o.type]:o.type==="default"||!o.type?"#333":"#fff"}),l=e.computed(()=>["tyh-button",`tyh-button-${o.type}`,{[`tyh-button-${o.size}`]:o.size,"tyh-button-round":o.round,"tyh-button-square":o.square,"tyh-button-simple":o.simple,"tyh-button-disabled":o.disabled||o.loading,"tyh-button-block":o.block}]);return(a,r)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(e.unref(l)),disabled:a.disabled||a.loading,style:e.normalizeStyle({color:e.unref(n)})},[a.loading||a.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["tyh-icon",a.loading?"tyh-ui-loading":a.icon]),style:e.normalizeStyle({color:e.unref(n)})},null,6)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")],14,me))}});g.install=t=>{t.component(g.name,g)};const he={header:String,content:{type:Array,default:()=>[]},keys:String,footer:String,zebra:Boolean,num:Boolean,hoverShow:Boolean},ye={class:"tyh-list"},fe={key:0,class:"tyh-list-header"},ge={key:1},ke={key:1,class:"tyh-list-content"},ue={class:"tyh-list-ul"},$e={key:0,class:"tyh-list-num"},Be={key:2,class:"tyh-list-not"},_e={key:3,class:"tyh-list-footer"},Ce={key:1},Se=e.defineComponent({name:"TyhList"}),_=e.defineComponent({...Se,props:he,setup(t){const o=t,n=e.computed(()=>["tyh-list-li",{"tyh-list-zebra":o.zebra,"tyh-list-hoverShow":o.hoverShow}]);return(l,a)=>(e.openBlock(),e.createElementBlock("div",ye,[l.header||l.$slots.header?(e.openBlock(),e.createElementBlock("div",fe,[l.$slots.header?e.renderSlot(l.$slots,"header",{key:0}):(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(l.header),1))])):e.createCommentVNode("",!0),l.content.length?(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("ul",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.content,(r,s)=>(e.openBlock(),e.createElementBlock("li",{key:s,class:e.normalizeClass(e.unref(n))},[l.num?(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(s+1),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.keys?r[l.keys]:r),1)],2))),128))])])):(e.openBlock(),e.createElementBlock("div",Be,"\u6682\u65E0\u5185\u5BB9...")),l.footer||l.$slots.footer?(e.openBlock(),e.createElementBlock("div",_e,[l.$slots.footer?e.renderSlot(l.$slots,"footer",{key:0}):(e.openBlock(),e.createElementBlock("span",Ce,e.toDisplayString(l.footer),1))])):e.createCommentVNode("",!0)]))}});_.install=t=>{t.component(_.name,_)};const be={shadow:{type:String,validator:t=>["always","hover",""].includes(t)},bodyStyle:{type:Object,default:()=>null}},Te={key:0,class:"tyh-card-header"},Ee={key:0,class:"tyh-card-title"},we={key:1,class:"tyh-card-subtitle"},Ve=e.defineComponent({name:"TyhCard"}),C=e.defineComponent({...Ve,props:be,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tyh-card",`tyh-card-shadow-${o.shadow}`])},[o.$slots.title||o.$slots.subtitle?(e.openBlock(),e.createElementBlock("div",Te,[o.$slots.title?(e.openBlock(),e.createElementBlock("span",Ee,[e.renderSlot(o.$slots,"title")])):e.createCommentVNode("",!0),o.$slots.subtitle?(e.openBlock(),e.createElementBlock("span",we,[e.renderSlot(o.$slots,"subtitle")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"tyh-card-body",style:e.normalizeStyle(o.bodyStyle)},[e.renderSlot(o.$slots,"default")],4)],2))}});C.install=t=>{t.component(C.name,C)};const ze={type:{type:String,default:()=>"default",validator:t=>["default","primary","success","danger","warning",""].includes(t)},size:{type:String,validator:t=>["small","mini",""].includes(t)},round:Boolean,isClose:Boolean},Ne=e.defineComponent({name:"TyhTag"}),S=e.defineComponent({...Ne,props:ze,emits:["close"],setup(t,{emit:o}){const n=t,l=e.computed(()=>["tyh-tag",`tyh-tag-${n.type}`,{[`tyh-tag-${n.size}`]:n.size,"tyh-tag-round":n.round}]);return(a,r)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(l))},[e.renderSlot(a.$slots,"default"),a.isClose?(e.openBlock(),e.createElementBlock("i",{key:0,class:"tyh-icon tyh-ui-close",onClick:r[0]||(r[0]=s=>o("close"))})):e.createCommentVNode("",!0)],2))}});S.install=t=>{t.component(S.name,S)};const De={type:{type:String,default:()=>"default",validator:t=>["default","primary","success","danger","warning",""].includes(t)},prohibit:Boolean,url:String,underline:{type:Boolean,default:()=>!0},target:String,icon:String},Pe=["href","target"],Ie=e.defineComponent({name:"TyhLink"}),u=e.defineComponent({...Ie,props:De,setup(t){const o=t,n=e.computed(()=>["tyh-link",`tyh-link-${o.type}`,{"tyh-link-prohibit":o.prohibit}]);return(l,a)=>(e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass(e.unref(n)),style:e.normalizeStyle({textDecoration:l.underline?"none":"underline"}),href:l.prohibit?"":l.url,target:l.target},[l.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["tyh-icon",`tyh-icon-${l.type}`,l.icon])},null,2)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")],14,Pe))}});u.install=t=>{t.component(u.name,u)};const Me={theme:{type:String,default:()=>"dark",validator:t=>["dark","light",""].includes(t)},shadow:Boolean,mode:{type:String,default:()=>"horizontal",validator:t=>["horizontal","vertical",""].includes(t)},backgroundColor:String,textColor:String,collapse:Boolean},Ae=e.defineComponent({name:"TyhMenu"}),b=e.defineComponent({...Ae,props:Me,setup(t){const o=t;e.provide("theme",o.theme),e.provide("mode",o.mode),e.provide("textColor",o.textColor);const n=e.computed(()=>o.mode==="horizontal"&&"tyh-menu-flex"),l=e.computed(()=>["tyh-menu",n.value,{"tyh-menu-shadow":o.shadow,[`tyh-menu-${o.theme}`]:o.theme}]),a=e.computed(()=>[{"tyh-menu-collapse":o.collapse&&o.mode==="vertical"}]);return(r,s)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass([...e.unref(l),...e.unref(a)]),style:e.normalizeStyle({backgroundColor:r.backgroundColor})},[r.$slots.left?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tyh-menu-left",e.unref(n)])},[e.renderSlot(r.$slots,"left")],2)):e.createCommentVNode("",!0),r.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["tyh-menu-default",e.unref(n)])},[e.renderSlot(r.$slots,"default")],2)):e.createCommentVNode("",!0),r.$slots.right?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["tyh-menu-right",e.unref(n)])},[e.renderSlot(r.$slots,"right")],2)):e.createCommentVNode("",!0)],6))}});b.install=t=>{t.component(b.name,b)};const Fe={route:String,title:String,prohibit:Boolean,link:String},Le={key:1},Oe=e.defineComponent({name:"TyhMenuItem"}),T=e.defineComponent({...Oe,props:Fe,setup(t){const o=t,n=e.inject("theme"),l=e.inject("mode"),a=e.inject("textColor"),r=e.computed(()=>[{color:a||(n==="dark"?"#fff":"#333")}]),{proxy:s}=e.getCurrentInstance(),i=()=>{if(!o.prohibit){if(o.link){window.open(o.link,"link");return}if(o.route)try{s.$router.push(o.route)}catch(m){console.log(m)}}},c=e.computed(()=>["tyh-menu-item",`tyh-menu-item-hover-${l}`,{"tyh-menu-item-prohibit":o.prohibit}]);return(m,y)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(e.unref(c)),style:e.normalizeStyle(e.unref(r)),onClick:i},[m.$slots.default?e.renderSlot(m.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",Le,e.toDisplayString(m.title),1))],6))}});T.install=t=>{t.component(T.name,T)};const je={position:{type:String,default:()=>"left",validator:t=>["left","center","right",""].includes(t)},color:{type:String,default:()=>"#515a6e"},margin:{type:String,default:()=>"25px"},icon:String},He=e.defineComponent({name:"TyhDivision"}),E=e.defineComponent({...He,props:je,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"tyh-division",style:e.normalizeStyle({margin:`${o.margin} 0`})},[e.createElementVNode("span",{class:e.normalizeClass(["tyh-division-text",`tyh-division-text-${o.position}`]),style:e.normalizeStyle({color:o.color})},[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,style:e.normalizeStyle({color:o.color}),class:e.normalizeClass(["tyh-icon",o.icon])},null,6)):e.renderSlot(o.$slots,"default",{key:1})],6)],4))}});E.install=t=>{t.component(E.name,E)};const qe={icon:String,color:String,size:{type:String,default:()=>"16px"}},We=e.defineComponent({name:"TyhIcon"}),$=e.defineComponent({...We,props:qe,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["tyh-icon",o.icon]),style:e.normalizeStyle({color:o.color,fontSize:o.size})},null,6))}});$.install=t=>{t.component($.name,$)};const Re={separator:{type:String,default:()=>"tyh-ui-xiexian"}},Ue={class:"tyh-crumbs"},Ge=e.defineComponent({name:"TyhCrumbs"}),w=e.defineComponent({...Ge,props:Re,setup(t){const o=t;return e.provide("Crumbs-separator",o.separator),(n,l)=>(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(n.$slots,"default")]))}});w.install=t=>{t.component(w.name,w)};const Ye={class:"tyh-crumbs-item"},Ke={class:"tyh-crumbs-item-text"},Je=e.defineComponent({name:"TyhCrumbsItem"}),V=e.defineComponent({...Je,setup(t){const o=e.ref("");return o.value=e.inject("Crumbs-separator"),(n,l)=>(e.openBlock(),e.createElementBlock("span",Ye,[e.createElementVNode("span",Ke,[e.renderSlot(n.$slots,"default")]),e.createElementVNode("i",{class:e.normalizeClass(["tyh-icon",o.value])},null,2)]))}});V.install=t=>{t.component(V.name,V)};const Qe={modelValue:{type:String,set(){return!0}},placeholder:String,type:{type:String,default:()=>"text",validator:t=>["text","password",""].includes(t)},size:{type:String,default:()=>"medium",validator:t=>["large","medium","small","mini",""].includes(t)},max:String,clear:Boolean,icon:String,disabled:Boolean,autofocus:Boolean,name:String,showPassword:Boolean,set(){return!0}},Xe=["type","value","placeholder","maxlength","disabled","autofocus","name"],Ze=e.defineComponent({name:"TyhInput"}),z=e.defineComponent({...Ze,props:Qe,emits:["update:modelValue","clear","enter","onblur","onfocus"],setup(t,{emit:o}){const n=t,l=e.ref(n.type),a=e.ref(!1),r=p=>{o("update:modelValue",p.target.value)},s=()=>{n.disabled||(o("update:modelValue",""),o("clear"))},i=e.computed(()=>["tyh-input-input",`tyh-input-input-${n.size}`,{"tyh-input-icon-padding":n.icon,"tyh-input-clear-padding":n.clear,"tyh-input-disabled":n.disabled}]),c=()=>{a.value=!a.value,l.value=a.value?"text":"password"},m=e.computed(()=>n.clear?!!n.showPassword:!0),y=e.computed(()=>m.value?a.value?"tyh-ui-browse":"tyh-ui-eye-close":"tyh-ui-guanbi"),v=()=>{m.value?c():s()};return(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tyh-input",{"tyh-input-disabled":p.disabled}])},[p.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["tyh-icon","tyh-input-icon",`tyh-input-icon-${p.size}`,p.icon]),style:e.normalizeStyle({cursor:p.disabled?"not-allowed":"Default"})},null,6)):e.createCommentVNode("",!0),e.createElementVNode("input",{class:e.normalizeClass(e.unref(i)),type:l.value,value:p.modelValue,placeholder:p.placeholder,maxlength:p.max,disabled:p.disabled,autofocus:p.autofocus,name:p.name,onInput:r,onKeyup:f[0]||(f[0]=e.withKeys(h=>o("enter"),["enter"])),onBlur:f[1]||(f[1]=h=>o("onblur")),onFocus:f[2]||(f[2]=h=>o("onfocus"))},null,42,Xe),p.clear||p.showPassword?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(["tyh-icon","tyh-input-clear",`tyh-input-icon-${p.size}`,e.unref(y)]),style:e.normalizeStyle({cursor:p.disabled?"not-allowed":"pointer"}),onClick:v},null,6)):e.createCommentVNode("",!0)],2))}});z.install=t=>{t.component(z.name,z)};const xe={bottom:{type:String,default:()=>"50px"},right:{type:String,default:()=>"50px"},beyond:{type:Number,default:()=>100},behavior:{type:String,default:()=>"smooth",validator:t=>["smooth","auto"].includes(t)}},ve=e.defineComponent({name:"TyhBackTop"}),ee=e.defineComponent({...ve,props:xe,setup(t){const o=t,n=e.ref(!1),l=()=>{let r=null;return()=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{document.documentElement.scrollTop>o.beyond?n.value=!0:n.value=!1},188)}},a=()=>{window.scrollTo({top:0,behavior:o.behavior})};return e.onMounted(()=>addEventListener("scroll",l())),(r,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"tyh-back-top",style:e.normalizeStyle({bottom:r.bottom,right:r.right}),onClick:a},[e.renderSlot(r.$slots,"default")],4)),[[e.vShow,n.value]])}});ee.install=t=>{t.component("TyhBackTop",ee)};const et={round:Boolean,width:String,height:String,animation:Boolean},tt=e.defineComponent({name:"TyhSkeleton"}),N=e.defineComponent({...tt,props:et,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tyh-skeleton",{"tyh-skeleton-round":o.round,"tyh-skeleton-animation":o.animation}]),style:e.normalizeStyle({width:o.width,height:o.height})},null,6))}});N.install=t=>{t.component(N.name,N)};const ot={type:{type:String,default:()=>"default",validator:t=>["default","primary","success","danger","warning"].includes(t)},message:String,icon:String,close:Boolean,center:Boolean,simple:Boolean},nt={class:"tyh-alert-message"},lt=e.defineComponent({name:"TyhAlert"}),D=e.defineComponent({...lt,props:ot,emits:["close"],setup(t,{emit:o}){const n=t,l=e.computed(()=>{const{type:r,center:s,simple:i}=n;return["tyh-alert",`tyh-alert-${r}`,{"tyh-alert-center":s,[`tyh-alert-bac-${r}`]:!i}]}),a=()=>o("close");return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l))},[e.createElementVNode("div",nt,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["tyh-icon","tyh-message-icon",r.icon])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.message),1)]),a?(e.openBlock(),e.createElementBlock("i",{key:0,class:"tyh-icon tyh-ui-guanbi",onClick:a})):e.createCommentVNode("",!0)],2))}});D.install=t=>{t.component(D.name,D)};const at={modelValue:{type:Number,default:()=>0},color:{type:String,default:()=>"#fbcc30"},voidColor:{type:String,default:()=>"#C6D1DE"},showText:Boolean,sayText:{type:Array,default:()=>["\u6781\u5DEE","\u5931\u671B","\u4E00\u822C","\u60CA\u559C","\u6EE1\u610F"]}},rt={class:"tyh-rate"},st=["onMouseover"],it=["onMouseover"],ct={key:0,class:"show-text"},dt=e.defineComponent({name:"TyhRate"}),P=e.defineComponent({...dt,props:at,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,l=e.ref(n.modelValue);e.watch(()=>n.modelValue,s=>l.value=s);const a=()=>{o("update:modelValue",l.value),l.value!==n.modelValue&&o("change")},r=e.computed(()=>{if(!n.showText)return;let s="";return e.watch(()=>l.value,()=>{switch(l.value){case 1:s=n.sayText[0];break;case 2:s=n.sayText[1];break;case 3:s=n.sayText[2];break;case 4:s=n.sayText[3];break;case 5:s=n.sayText[4];break;default:s=""}},{immediate:!0}),s});return(s,i)=>(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",{class:"tyh-rate-mouseout",onMouseout:i[0]||(i[0]=c=>l.value=s.modelValue)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,c=>e.createElementVNode("i",{key:c,class:"tyh-icon tyh-ui-favorite",onMouseover:m=>l.value=c},null,40,st)),64)),e.createElementVNode("span",{class:"solid",style:e.normalizeStyle(`width:${l.value*18}px;`)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,c=>e.createElementVNode("i",{key:c,class:"tyh-icon tyh-ui-favorite-filling",style:e.normalizeStyle({color:s.color}),onMouseover:m=>l.value=c,onClick:a},null,44,it)),64))],4)],32),s.showText?(e.openBlock(),e.createElementBlock("div",ct,e.toDisplayString(e.unref(r)),1)):e.createCommentVNode("",!0)]))}});P.install=t=>{t.component(P.name,P)};const mt={src:String,alt:String,fit:{type:String,validator:t=>["fill","contain","cover","none","scale-down",""].includes(t)},width:String,height:String,select:Boolean,draggable:Boolean},pt={class:"tyh-image"},ht={key:0,class:"tyh-image-error"},yt=e.createElementVNode("span",{class:"tyh-image-error-text"},"\u52A0\u8F7D\u5931\u8D25",-1),ft=["draggable","src","alt"],gt=e.defineComponent({name:"TyhImage"}),I=e.defineComponent({...gt,props:mt,emits:["error","load"],setup(t,{emit:o}){const n=e.ref(!1),l=()=>{o("error"),n.value=!0};return(a,r)=>(e.openBlock(),e.createElementBlock("div",pt,[n.value?(e.openBlock(),e.createElementBlock("div",ht,[e.renderSlot(a.$slots,"error",{},()=>[yt])])):(e.openBlock(),e.createElementBlock("img",{key:1,draggable:a.draggable,class:e.normalizeClass([`tyh-image-${a.fit}`,{"tyh-image-select":a.select}]),style:e.normalizeStyle({width:a.width,height:a.height}),src:a.src,alt:a.alt,onError:l,onLoad:r[0]||(r[0]=s=>o("load"))},null,46,ft))]))}});I.install=t=>{t.component(I.name,I)};const kt={src:String,alt:String,size:{type:Number,default:()=>8},fit:{type:String,validator:t=>["fill","contain","cover","none","scale-down",""].includes(t)},round:Boolean,border:Boolean,select:Boolean,draggable:Boolean,errorIcon:String},ut={class:"tyh-avatar"},$t=["draggable","src","alt"],Bt=e.defineComponent({name:"TyhAvatar"}),te=e.defineComponent({...Bt,props:kt,emits:["error","load"],setup(t,{emit:o}){const n=t,l=e.ref(!1),a=()=>{o("error"),l.value=!0},r=e.computed(()=>({width:`${n.size*10}px`,height:`${n.size*10}px`})),s=e.computed(()=>["tyh-avatar-error",{"tyh-avatar-round":n.round}]),i=e.computed(()=>[{[`tyh-avatar-${n.fit}`]:n.fit,"tyh-avatar-round":n.round,"tyh-avatar-border":n.border,"tyh-avatar-select":n.select}]);return(c,m)=>(e.openBlock(),e.createElementBlock("div",ut,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s)),style:e.normalizeStyle(e.unref(r))},[e.renderSlot(c.$slots,"error",{},()=>[e.createElementVNode("i",{class:e.normalizeClass(["tyh-icon",c.errorIcon||"tyh-ui-user"])},null,2)])],6)):(e.openBlock(),e.createElementBlock("img",{key:1,draggable:c.draggable,class:e.normalizeClass(e.unref(i)),style:e.normalizeStyle(e.unref(r)),src:c.src,alt:c.alt,onError:a,onLoad:m[0]||(m[0]=y=>o("load"))},null,46,$t))]))}});te.install=t=>{t.component("TyhAvatar",te)};const _t={name:"TyhAside"},M=e.defineComponent({..._t,props:{width:{type:String,default:()=>"200px"}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("aside",{class:"tyh-aside",style:e.normalizeStyle({width:o.width})},[e.renderSlot(o.$slots,"default")],4))}});M.install=t=>{t.component(M.name,M)};const Ct={name:"TyhContainer"},A=e.defineComponent({...Ct,props:{direction:{type:String,validator(t){return["horizontal","vertical",""].includes(t)}}},setup(t){const o=t,{isClass:n}=l();function l(){const a=e.useSlots(),r=e.computed(()=>o.direction==="vertical"?!0:o.direction==="horizontal"?!1:a&&a.default?a.default().some(i=>{const c=i.type&&i.type.name;return c==="TyhHeader"||c==="TyhFooter"}):!1);return{isClass:e.computed(()=>["tyh-container",r.value?"tyh-container-horizontal":"tyh-container-vertical"])}}return(a,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(e.unref(n))},[e.renderSlot(a.$slots,"default")],2))}});A.install=t=>{t.component(A.name,A)};const St={name:"TyhFooter"},F=e.defineComponent({...St,props:{height:{type:String,default:()=>"60px"}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("footer",{class:"tyh-footer",style:e.normalizeStyle({height:o.height})},[e.renderSlot(o.$slots,"default")],4))}});F.install=t=>{t.component(F.name,F)};const bt={name:"TyhHeader"},L=e.defineComponent({...bt,props:{height:{type:String,default:()=>"60px"}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("header",{class:"tyh-header",style:e.normalizeStyle({height:o.height})},[e.renderSlot(o.$slots,"default")],4))}});L.install=t=>{t.component(L.name,L)};const re=(t,o)=>{const n=t.__vccOpts||t;for(const[l,a]of o)n[l]=a;return n},Tt={name:"TyhMain"},Et={class:"tyh-main"};function wt(t,o,n,l,a,r){return e.openBlock(),e.createElementBlock("main",Et,[e.renderSlot(t.$slots,"default")])}const O=re(Tt,[["render",wt]]);O.install=t=>{t.component(O.name,O)};const Vt={type:{type:String,default:()=>"default",validator:t=>["default","primary","success","danger","warning",""].includes(t)},size:{type:String,default:()=>"16"},block:Boolean,color:String},zt=e.defineComponent({name:"TyhText"}),j=e.defineComponent({...zt,props:Vt,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["tyh-text",{[`tyh-text-${o.type}`]:o.type,"tyh-text-block":o.block}]),style:e.normalizeStyle({color:o.color,fontSize:`${o.size}px`})},[e.renderSlot(o.$slots,"default")],6))}});j.install=t=>{t.component(j.name,j)};const Nt={data:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},trHeight:{type:String,default:()=>"40px"},align:{type:String,default:()=>"left",validator:t=>["left","right","center",""].includes(t)},zebra:Boolean,border:Boolean,width:{type:String,default:()=>"100%"},height:{type:String,default:()=>"auto"},num:Boolean,important:{type:Array,default:()=>[]},importantColor:{type:String,default:()=>"#fdf5e6"}},Dt=["width"],Pt={class:"tyh-thead"},It=["height"],Mt=["align"],At=["width","align"],Ft={class:"tyh-tbody"},Lt=["height"],Ot=["align"],jt=["align"],Ht=e.defineComponent({name:"TyhTable"}),H=e.defineComponent({...Ht,props:Nt,setup(t){const o=t,n=a=>{const r=o.important;for(const s of r)if(s===a+1)return{background:o.importantColor};return{}},l=a=>[`tyh-${a}-td`,{"tyh-table-border":o.border}];return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"tyh-table",style:e.normalizeStyle({height:a.height})},[e.createElementVNode("table",{class:"tyh-table-table",border:"0",cellspacing:"0",cellpadding:"0",width:a.width},[e.createElementVNode("thead",Pt,[e.createElementVNode("tr",{class:"tyh-thead-th",height:a.trHeight},[a.num?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(l("thead")),align:a.align||"left"},null,10,Mt)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,(s,i)=>(e.openBlock(),e.createElementBlock("th",{key:i,class:e.normalizeClass(l("thead")),width:s.width,align:a.align||"left"},e.toDisplayString(s.title),11,At))),128))],8,It)]),e.createElementVNode("tbody",Ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.data,(s,i)=>(e.openBlock(),e.createElementBlock("tr",{key:i,class:e.normalizeClass(["tyh-tbody-tr",{"tyh-tbody-tr-zebra":a.zebra}]),height:a.trHeight,style:e.normalizeStyle(n(i))},[a.num?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(l("tbody")),align:a.align||"left"},e.toDisplayString(i+1),11,Ot)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,(c,m)=>(e.openBlock(),e.createElementBlock("td",{key:m,class:e.normalizeClass(l("tbody")),align:a.align||"left"},e.toDisplayString(s[c.key]),11,jt))),128))],14,Lt))),128))])],8,Dt)],4))}});H.install=t=>{t.component(H.name,H)};const qt={name:"TyhButtonGroup"},Wt={class:"tyh-button-group"};function Rt(t,o,n,l,a,r){return e.openBlock(),e.createElementBlock("div",Wt,[e.renderSlot(t.$slots,"default")])}const B=re(qt,[["render",Rt]]);B.install=t=>{t.component(B.name,B)};const Ut={modelValue:{type:Object,required:!0},cellWidth:{type:Number,default:()=>50}},Gt={class:"tyh-calendar"},Yt={class:"tyh-calendar-header"},Kt={class:"tyh-calendar-isDay"},Jt={class:"tyh-calendar-week"},Qt={class:"tyh-calendar-month"},Xt=e.defineComponent({name:"TyhCalendar"}),q=e.defineComponent({...Xt,props:Ut,setup(t){const o=t,n=e.ref(o.modelValue.getMonth()),l=e.ref(o.modelValue.getFullYear()),a=o.modelValue.getDate(),r=e.computed(()=>{const h=new Date(`${l.value}/${n.value+1}/1`).getDay();return h===0?7-1:h-1}),s=(h=n.value,oe)=>h!==1?[31,0,31,30,31,30,31,31,30,31,30,31][h]:oe%4==0&&oe%100!=0||oe%400==0?29:28,i=()=>{if(n.value>0){n.value--;return}l.value--,n.value=11},c=()=>{if(n.value<11){n.value++;return}l.value++,n.value=0},m=()=>{n.value=o.modelValue.getMonth(),l.value=o.modelValue.getFullYear()},y=h=>["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"][h-1],v=h=>h+1===o.modelValue.getDate()?{backgroundColor:"#3a6ff4",color:"#fff"}:{},p=e.computed(()=>({width:`${((o.cellWidth<28?28:o.cellWidth)+2)*7}px`})),f=e.computed(()=>{const h=o.cellWidth<28?28:o.cellWidth;return{width:`${h}px`,height:`${h}px`}});return(h,oe)=>(e.openBlock(),e.createElementBlock("span",Gt,[e.createElementVNode("div",{class:"tyh-calendar-container",style:e.normalizeStyle(e.unref(p))},[e.createElementVNode("div",Yt,[e.createElementVNode("span",Kt,e.toDisplayString(l.value)+"\u5E74 "+e.toDisplayString(n.value+1)+"\u6708 "+e.toDisplayString(e.unref(a))+"\u65E5 ",1),e.createVNode(e.unref(B),null,{default:e.withCtx(()=>[e.createVNode(e.unref(g),{size:"mini",icon:"tyh-ui-arrow-left-bold",onClick:i}),e.createVNode(e.unref(g),{size:"mini",simple:"",type:"primary",icon:"tyh-ui-time",onClick:m}),e.createVNode(e.unref(g),{size:"mini",icon:"tyh-ui-arrow-right",onClick:c})]),_:1})]),e.createElementVNode("tr",Jt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(ne,k)=>e.createElementVNode("td",{key:k,class:"tyh-calendar-week-item",style:e.normalizeStyle({width:`${h.cellWidth<28?28:h.cellWidth}px`})},e.toDisplayString(y(ne)),5)),64))]),e.createElementVNode("tr",Qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(ne,k)=>(e.openBlock(),e.createElementBlock("td",{key:k,class:"tyh-calendar-day",style:e.normalizeStyle(e.unref(f))},null,4))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s(n.value,l.value),(ne,k)=>(e.openBlock(),e.createElementBlock("td",{key:k,class:"tyh-calendar-day",style:e.normalizeStyle([v(k),e.unref(f)])},e.toDisplayString(k+1),5))),128))])],4)]))}});q.install=t=>{t.component(q.name,q)};const Zt={modelValue:Boolean,closeColor:{type:String,default:()=>"#dcdfe6"},openColor:{type:String,default:()=>"#3a6ff4"},closeText:String,openText:String,disabled:Boolean,width:{type:Number,default:()=>40}},xt=e.defineComponent({name:"TyhSwitch"}),W=e.defineComponent({...xt,props:Zt,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,l=e.ref(n.modelValue),a=()=>{n.disabled||(l.value=!l.value,o("update:modelValue",l.value),o("change",l.value))},r=e.computed(()=>n.modelValue?n.openColor:n.closeColor),s=e.computed(()=>{const c=e.ref(n.width);return c.value<20&&(c.value=20),{width:`${c.value}px`,height:`${c.value/2}px`,backgroundColor:r.value}}),i=e.computed(()=>{const c=e.ref(n.width);return c.value<20&&(c.value=20),{width:`${c.value/2}px`,height:`${c.value/2}px`,left:n.modelValue?`${c.value/2}px`:"0px",border:`2px solid ${r.value}`}});return(c,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.closeText?(e.openBlock(),e.createElementBlock("span",{key:0,class:"tyh-switch-closeText",style:e.normalizeStyle([`color:${l.value?"#333":"#3a6ff4"}`])},e.toDisplayString(c.closeText),5)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["tyh-switch",{"tyh-switch-disabled":c.disabled}]),style:e.normalizeStyle(e.unref(s)),onClick:a},[e.createElementVNode("span",{class:"tyh-switch-roll",style:e.normalizeStyle(e.unref(i))},null,4)],6),c.openText?(e.openBlock(),e.createElementBlock("span",{key:1,class:"tyh-switch-openText",style:e.normalizeStyle([`color:${c.modelValue?"#3a6ff4":"#333"}`])},e.toDisplayString(c.openText),5)):e.createCommentVNode("",!0)],64))}});W.install=t=>{t.component(W.name,W)};const vt={modelValue:String,label:String,name:String,disabled:Boolean,border:Boolean,size:{type:String,default:()=>"large",validator:t=>["large","medium","small","mini",""].includes(t)}},eo=["name","value","disabled"],to=e.defineComponent({name:"TyhRadio"}),R=e.defineComponent({...to,props:vt,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,l=new Proxy(n,{set(){return!0}}),a=m=>{o("update:modelValue",m.target.value),o("change",m.target.value)},r=e.computed(()=>n.modelValue===n.label),s=e.computed(()=>["tyh-radio-o",r.value?n.disabled?"tyh-radio-disabled":"tyh-radio-hig":""]),i=e.computed(()=>({color:r.value?n.disabled?"#b6b5b5":"#3a6ff4":n.disabled?"#b6b5b5":"#333"})),c=e.computed(()=>({cursor:n.disabled?"no-drop":"pointer",border:n.border?` 1px solid ${r.value?n.disabled?"#b6b5b5":"#3a6ff4":"#b6b5b5"}`:""}));return(m,y)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["tyh-radio",{[`tyh-radio-${m.size}`]:m.border,"tyh-radio-border":m.border}]),style:e.normalizeStyle(e.unref(c))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(s))},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=v=>e.unref(l).modelValue=v),type:"radio",name:m.name,value:m.label,disabled:m.disabled,onInput:a},null,40,eo),[[e.vModelRadio,e.unref(l).modelValue]])],2),e.createElementVNode("span",{class:"tyh-radio-text",style:e.normalizeStyle(e.unref(i))},[e.renderSlot(m.$slots,"default")],4)],6))}});R.install=t=>{t.component(R.name,R)};const oo={data:{type:Array,default:()=>[]}},no={class:"tyh-three"},lo=["onClick"],ao={class:"tyh-three-label-text"},ro={key:0,class:"tyh-three-children"},so=e.defineComponent({name:"TyhTree"}),U=e.defineComponent({...so,props:oo,setup(t){const o=e.ref(!1),n=l=>{l.children&&l.children.length&&(o.value=!o.value)};return(l,a)=>{const r=e.resolveComponent("tyh-icon"),s=e.resolveComponent("tyh-tree");return e.openBlock(),e.createElementBlock("div",no,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.data,(i,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:"tyh-three-list"},[e.createElementVNode("div",{class:"tyh-three-label",onClick:m=>n(i)},[e.createVNode(r,{icon:"tyh-ui-arrow-right-filling",color:"#c0c4cc",class:e.normalizeClass([{"tyh-three-icon":o.value}])},null,8,["class"]),e.createElementVNode("span",ao,e.toDisplayString(i.label),1)],8,lo),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[i.children?e.withDirectives((e.openBlock(),e.createElementBlock("div",ro,[e.createVNode(s,{data:i.children},null,8,["data"])],512)),[[e.vShow,o.value]]):e.createCommentVNode("",!0)]),_:2},1024)]))),128))])}}});U.install=t=>{t.component(U.name,U)};const io={title:{type:String,default:()=>"\u8FD4\u56DE"},content:String,icon:{type:String,default:()=>"tyh-ui-direction-left"}},co={class:"tyh-page-header"},mo={class:"tyh-page-header-title"},po={class:"tyh-page-header-content"},ho=e.defineComponent({name:"TyhPageHeader"}),G=e.defineComponent({...ho,props:io,emits:["back"],setup(t,{emit:o}){return(n,l)=>(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",{class:"tyh-page-header-title-box",onClick:l[0]||(l[0]=a=>o("back"))},[e.createVNode(e.unref($),{icon:n.icon,size:"14"},null,8,["icon"]),e.createElementVNode("span",mo,e.toDisplayString(n.title),1)]),e.createElementVNode("div",po,e.toDisplayString(n.content),1)]))}});G.install=t=>{t.component(G.name,G)};const yo={userInfo:String,describe:String,linkUrl:String},fo={class:"tyh-info"},go={class:"tyh-info-header"},ko={class:"tyh-info-left"},uo={key:0,class:"tyh-info-photo"},$o={class:"tyh-info-data"},Bo={class:"tyh-info-userInfo"},_o={key:1,class:"tyh-info-userInfo"},Co={class:"tyh-info-describe"},So={key:0,class:"tyh-info-right"},bo={key:0,class:"tyh-info-body"},To={key:1,class:"tyh-info-footer"},Eo=e.defineComponent({name:"TyhInfo"}),Y=e.defineComponent({...Eo,props:yo,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",fo,[e.createElementVNode("div",go,[e.createElementVNode("div",ko,[o.$slots.photo?(e.openBlock(),e.createElementBlock("div",uo,[e.renderSlot(o.$slots,"photo")])):e.createCommentVNode("",!0),e.createElementVNode("div",$o,[o.linkUrl?(e.openBlock(),e.createBlock(e.unref(u),{key:0,url:o.linkUrl},{default:e.withCtx(()=>[e.createElementVNode("span",Bo,e.toDisplayString(o.userInfo),1)]),_:1},8,["url"])):(e.openBlock(),e.createElementBlock("span",_o,e.toDisplayString(o.userInfo),1)),e.createElementVNode("span",Co,e.toDisplayString(o.describe),1)])]),o.$slots.right?(e.openBlock(),e.createElementBlock("div",So,[e.renderSlot(o.$slots,"right")])):e.createCommentVNode("",!0)]),o.$slots.body?(e.openBlock(),e.createElementBlock("div",bo,[e.renderSlot(o.$slots,"body")])):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",To,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)]))}});Y.install=t=>{t.component(Y.name,Y)};const wo={modelValue:String,placeholder:String,max:[Number,String],rows:{type:String,default:()=>"3"},cols:String,resize:{type:String,default:()=>"none",validator:t=>["vertical","horizontal","none",""].includes(t)},disabled:Boolean,autofocus:Boolean,name:String},Vo={class:"tyh-textarea"},zo=["rows","autofocus","value","placeholder","disabled","name","maxlength"],No=e.defineComponent({name:"TyhTextarea"}),K=e.defineComponent({...No,props:wo,emits:["update:modelValue","onfocus","onblur"],setup(t,{emit:o}){const n=t,l=r=>o("update:modelValue",r.target.value),a=e.computed(()=>["tyh-textarea-textarea",{"tyh-textarea-disabled":n.disabled}]);return(r,s)=>(e.openBlock(),e.createElementBlock("div",Vo,[e.createElementVNode("textarea",{cols:"30",rows:r.rows,class:e.normalizeClass(e.unref(a)),autofocus:r.autofocus,value:r.modelValue,placeholder:r.placeholder,disabled:r.disabled,name:r.name,maxlength:r.max,style:e.normalizeStyle({resize:r.resize}),onInput:l,onBlur:s[0]||(s[0]=i=>o("onblur")),onFocus:s[1]||(s[1]=i=>o("onfocus"))},null,46,zo)]))}});K.install=t=>{t.component(K.name,K)};const Do={modelValue:String,name:String},Po=["name"],Io=e.defineComponent({name:"TyhSelect"}),J=e.defineComponent({...Io,props:Do,emits:["update:modelValue"],setup(t,{emit:o}){const n=t,l=new Proxy(n,{set(){return!0}}),a=r=>{o("update:modelValue",r.target.value)};return(r,s)=>r.$slots.default?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,"onUpdate:modelValue":s[0]||(s[0]=i=>e.unref(l).modelValue=i),class:"tyh-select",name:r.name,onInput:a},[e.renderSlot(r.$slots,"default")],40,Po)),[[e.vModelSelect,e.unref(l).modelValue]]):e.createCommentVNode("",!0)}});J.install=t=>{t.component(J.name,J)};const Mo={value:String,label:String},Ao=["value"],Fo={key:0},Lo={key:1},Oo=e.defineComponent({name:"TyhOption"}),Q=e.defineComponent({...Oo,props:Mo,setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("option",{value:o.value},[o.label?(e.openBlock(),e.createElementBlock("span",Fo,e.toDisplayString(o.label),1)):(e.openBlock(),e.createElementBlock("span",Lo,[e.renderSlot(o.$slots,"default")]))],8,Ao))}});Q.install=t=>{t.component(Q.name,Q)};const jo={type:{type:String,default:()=>"default",validator:t=>["default","primary","success","danger","warning",""].includes(t)},size:{type:String,default:()=>"13"},color:String},Ho=e.defineComponent({name:"TyhTagging"}),X=e.defineComponent({...Ho,props:jo,setup(t){const o=t,n=e.computed(()=>["tyh-tagging",`tyh-tagging-${o.type}`]),l=e.computed(()=>({fontSize:`${o.size}px`,color:o.color}));return(a,r)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(n)),style:e.normalizeStyle(e.unref(l))},[e.renderSlot(a.$slots,"default")],6))}});X.install=t=>{t.component(X.name,X)};const qo={modelValue:Boolean,direction:{type:String,default:()=>"right",validator:t=>["top","left","bottom","right",""].includes(t)},size:{type:String,default:()=>"30%"},title:String,appendToBody:Boolean,modal:{type:Boolean,default:()=>!0},modalClose:{type:Boolean,default:()=>!0},showClose:{type:Boolean,default:()=>!0},showHeader:{type:Boolean,default:()=>!0},zIndex:{type:Number,default:()=>3500}},Wo=["onClick"],Ro={key:0,class:"tyh-drawer-header"},Uo={key:0,class:"tyh-drawer-title"},Go={key:1,class:"tyh-drawer-title"},Yo=["onClick"],Ko={key:1,class:"tyh-drawer-body"},Jo=e.defineComponent({name:"TyhDrawer"}),Z=e.defineComponent({...Jo,props:qo,emits:["update:modelValue","open","close","onOpen","onClose"],setup(t,{emit:o}){const n=t,l=()=>{o("close"),o("update:modelValue",!1)},a=e.computed(()=>{const i=n.direction;return i==="left"||i==="right"||i===""}),r=()=>{!n.modalClose||l()},{proxy:s}=e.getCurrentInstance();return e.watch(()=>n.modelValue,i=>{i&&o("open");const c=s.$el;i&&n.appendToBody&&document.body.appendChild(c)}),(i,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"tyh-drawer",onAfterEnter:c[0]||(c[0]=m=>o("onOpen")),onAfterLeave:c[1]||(c[1]=m=>o("onClose"))},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["tyh-drawer-packing",{"tyh-drawer-modal":i.modal}]),style:e.normalizeStyle({zIndex:i.zIndex}),onClick:e.withModifiers(r,["self"])},[e.createElementVNode("div",{class:e.normalizeClass(["tyh-drawer",`tyh-drawer-${i.direction}`]),style:e.normalizeStyle(e.unref(a)?`width: ${i.size}`:`height: ${i.size}`)},[i.showHeader?(e.openBlock(),e.createElementBlock("div",Ro,[i.$slots.title?(e.openBlock(),e.createElementBlock("span",Uo,[e.renderSlot(i.$slots,"title")])):(e.openBlock(),e.createElementBlock("span",Go,e.toDisplayString(i.title),1)),i.showClose?(e.openBlock(),e.createElementBlock("i",{key:2,class:"tyh-icon tyh-ui-close",onClick:e.withModifiers(l,["stop"])},null,8,Yo)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),i.$slots.default?(e.openBlock(),e.createElementBlock("div",Ko,[e.renderSlot(i.$slots,"default")])):e.createCommentVNode("",!0)],6)],14,Wo),[[e.vShow,i.modelValue]])]),_:3}))}});Z.install=t=>{t.component(Z.name,Z)};const Qo={modelValue:Boolean,width:{type:String,default:()=>"30%"},top:{type:String,default:()=>"15vh"},title:String,appendToBody:Boolean,modal:{type:Boolean,default:()=>!0},modalClose:{type:Boolean,default:()=>!0},showClose:{type:Boolean,default:()=>!0},showHeader:{type:Boolean,default:()=>!0},zIndex:{type:Number,default:()=>3500}},Xo=["onClick"],Zo={key:0,class:"tyh-dialog-header"},xo={key:0,class:"tyh-dialog-title"},vo={key:1,class:"tyh-dialog-title"},en=["onClick"],tn={key:1,class:"tyh-dialog-body"},on={key:2,class:"tyh-dialog-footer"},nn=e.defineComponent({name:"TyhDialog"}),x=e.defineComponent({...nn,props:Qo,emits:["update:modelValue","open","close","onOpen","onClose"],setup(t,{emit:o}){const n=t,l=()=>{o("close"),o("update:modelValue",!1)},a=()=>{!n.modalClose||l()},{proxy:r}=e.getCurrentInstance();return e.watch(()=>n.modelValue,s=>{s&&o("open");const i=r.$el;s&&n.appendToBody&&document.body.appendChild(i)}),(s,i)=>(e.openBlock(),e.createBlock(e.Transition,{name:"tyh-dialog",onAfterEnter:i[0]||(i[0]=c=>o("onOpen")),onAfterLeave:i[1]||(i[1]=c=>o("onClose"))},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["tyh-dialog-packing",{"tyh-dialog-modal":s.modal}]),style:e.normalizeStyle({zIndex:s.zIndex}),onClick:e.withModifiers(a,["self"])},[e.createElementVNode("div",{class:"tyh-dialog",style:e.normalizeStyle({width:s.width,marginTop:s.top})},[s.showHeader?(e.openBlock(),e.createElementBlock("div",Zo,[s.$slots.title?(e.openBlock(),e.createElementBlock("span",xo,[e.renderSlot(s.$slots,"title")])):(e.openBlock(),e.createElementBlock("span",vo,e.toDisplayString(s.title),1)),s.showClose?(e.openBlock(),e.createElementBlock("i",{key:2,class:"tyh-icon tyh-ui-close",onClick:e.withModifiers(l,["stop"])},null,8,en)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.$slots.default?(e.openBlock(),e.createElementBlock("div",tn,[e.renderSlot(s.$slots,"default")])):e.createCommentVNode("",!0),s.$slots.footer?(e.openBlock(),e.createElementBlock("div",on,[e.renderSlot(s.$slots,"footer")])):e.createCommentVNode("",!0)],4)],14,Xo),[[e.vShow,s.modelValue]])]),_:3}))}});x.install=t=>{t.component(x.name,x)};const ln={message:String,type:{type:String,default:()=>"default",validator:t=>["primary","success","danger","warning","default",""].includes(t)},showClose:Boolean,time:{type:Number,default:()=>200},offset:{type:Number,default:()=>20},icon:String,round:Boolean},an={class:"tyh-message-content"},rn=e.defineComponent({name:"TyhMessage"}),sn=e.defineComponent({...rn,props:ln,setup(t){const o=t,n=e.ref(!0);let l;o.time>0&&(l=setTimeout(()=>{a()},o.time));const a=()=>{clearTimeout(l),n.value=!1},r=e.getCurrentInstance(),s=()=>{r.vnode.el.parentElement.removeChild(r.vnode.el)},i=e.computed(()=>["tyh-message",`tyh-message-${o.type}`,{"tyh-message-round":o.round}]);return(c,m)=>(e.openBlock(),e.createBlock(e.Transition,{name:"tyh-message-fade",appear:"",onAfterLeave:s},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(i)),style:e.normalizeStyle({top:`${c.offset}px`})},[e.createElementVNode("div",an,[c.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["tyh-icon","lef-icon",c.icon,`tyh-message-${c.type}`])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(c.message),1),c.showClose?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(["tyh-icon","tyh-ui-close",`tyh-message-${c.type}`]),onClick:a},null,2)):e.createCommentVNode("",!0)])],6),[[e.vShow,n.value]])]),_:1}))}}),se=(t,o)=>{const n=cn(t,o);return document.body.append(n.vnode.el),n.proxy},ie=(t,o)=>Object.assign(t,o),cn=(t,o)=>{const n=e.h(t,o),l=document.createElement("div");return e.render(n,l),n.component},le=t=>se(sn,ie({time:2e3,offset:20},t)),dn={title:String,message:String,time:{type:Number,default:()=>3500},position:{type:String,default:()=>"top-right",validator:t=>["top-left","top-right","bottom-left","bottom-right",""].includes(t)},close:Boolean,type:{type:String,validator:t=>["primary","success","danger","warning",""].includes(t)}},mn={class:"tyh-notification-body"},pn={class:"tyh-notification-content"},hn={class:"tyh-notification-title"},yn={class:"tyh-notification-message"},fn=e.defineComponent({name:"TyhNotification"}),gn=e.defineComponent({...fn,props:dn,setup(t){const o=t,n=e.ref(!0);let l;(function(){o.time>0&&(l=setTimeout(()=>{a()},o.time))})();const a=()=>{clearTimeout(l),n.value=!1},r=e.computed(()=>{let m="";switch(o.type){case"primary":m="tyh-ui-smile";break;case"success":m="tyh-ui-success-filling";break;case"danger":m="tyh-ui-error";break;case"warning":m="tyh-ui-warning-filling";break}return m}),s=e.computed(()=>["tyh-icon","tyh-notification-icon",r.value,`tyh-notification-icon-${o.type}`]),i=e.getCurrentInstance(),c=()=>{i.vnode.el.parentElement.removeChild(i.vnode.el)};return(m,y)=>(e.openBlock(),e.createBlock(e.Transition,{name:"tyh-notification-fade",appear:"",onAfterLeave:c},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["tyh-notification",`tyh-notification-${m.position}`])},[e.createElementVNode("div",mn,[m.type?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(e.unref(s))},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",pn,[e.createElementVNode("h3",hn,e.toDisplayString(m.title),1),e.createElementVNode("div",yn,[e.createElementVNode("p",null,e.toDisplayString(m.message),1)])]),m.close?(e.openBlock(),e.createElementBlock("i",{key:1,class:"tyh-icon tyh-ui-close",onClick:a})):e.createCommentVNode("",!0)])],2),[[e.vShow,n.value]])]),_:1}))}}),ae=t=>se(gn,ie({time:3500,position:"top-right",close:!0},t)),kn=Object.freeze(Object.defineProperty({__proto__:null,TyhButton:g,TyhList:_,TyhCard:C,TyhTag:S,TyhLink:u,TyhMenu:b,TyhMenuItem:T,TyhDivision:E,TyhIcon:$,TyhCrumbs:w,TyhCrumbsItem:V,TyhInput:z,TyhBackTop:ee,TyhSkeleton:N,TyhAlert:D,TyhRate:P,TyhImage:I,TyhAvatar:te,TyhAside:M,TyhContainer:A,TyhFooter:F,TyhHeader:L,TyhMain:O,TyhText:j,TyhTable:H,TyhButtonGroup:B,TyhCalendar:q,TyhSwitch:W,TyhRadio:R,TyhTree:U,TyhPageHeader:G,TyhInfo:Y,TyhTextarea:K,TyhSelect:J,TyhOption:Q,TyhTagging:X,TyhDrawer:Z,TyhDialog:x,Message:le,Notification:ae},Symbol.toStringTag,{value:"Module"})),un={version:ce,install:t=>(Object.entries(kn).forEach(([o,n])=>{t.component(o,n)}),t.config.globalProperties.FMessage=le,t.config.globalProperties.FNotification=ae,t)};d.Message=le,d.Notification=ae,d.TyhAlert=D,d.TyhAside=M,d.TyhAvatar=te,d.TyhBackTop=ee,d.TyhButton=g,d.TyhButtonGroup=B,d.TyhCalendar=q,d.TyhCard=C,d.TyhContainer=A,d.TyhCrumbs=w,d.TyhCrumbsItem=V,d.TyhDialog=x,d.TyhDivision=E,d.TyhDrawer=Z,d.TyhFooter=F,d.TyhHeader=L,d.TyhIcon=$,d.TyhImage=I,d.TyhInfo=Y,d.TyhInput=z,d.TyhLink=u,d.TyhList=_,d.TyhMain=O,d.TyhMenu=b,d.TyhMenuItem=T,d.TyhOption=Q,d.TyhPageHeader=G,d.TyhRadio=R,d.TyhRate=P,d.TyhSelect=J,d.TyhSkeleton=N,d.TyhSwitch=W,d.TyhTable=H,d.TyhTag=S,d.TyhTagging=X,d.TyhText=j,d.TyhTextarea=K,d.TyhTree=U,d.default=un,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});