var t,e;import{x as a,y as l,ai as o,g as s,o as r,c as i,w as n,A as u,m as g,a as d,n as c,j as f,h,t as v,d as _,i as b,B as p}from"./index-3714412c.js";import{_ as y}from"./uv-status-bar.b515a02d.js";import{r as m}from"./useRouter.f44141c1.js";import{_ as C}from"./uv-icon.c593f91d.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";const k=x({name:"uv-navbar",mixins:[a,l,{props:{safeAreaInsetTop:{type:Boolean,default:!0},placeholder:{type:Boolean,default:!1},fixed:{type:Boolean,default:!0},border:{type:Boolean,default:!1},leftIcon:{type:String,default:"arrow-left"},leftText:{type:String,default:""},rightText:{type:String,default:""},rightIcon:{type:String,default:""},title:{type:[String,Number],default:""},bgColor:{type:String,default:"#ffffff"},imgMode:{type:String,default:"aspectFill"},titleWidth:{type:[String,Number],default:"400rpx"},height:{type:[String,Number],default:"44px"},leftIconSize:{type:[String,Number],default:20},leftIconColor:{type:String,default:"#303133"},autoBack:{type:Boolean,default:!1},titleStyle:{type:[String,Object],default:""},...null==(e=null==(t=uni.$uv)?void 0:t.props)?void 0:e.navbar}}],data:()=>({}),computed:{getBgColor(){const t={};return this.bgColor&&(this.bgColor.indexOf("gradient")>-1?t.backgroundImage=this.bgColor:this.isImg?t.background="transparent":t.background=this.bgColor),t},getStatusbgColor(){if(this.bgColor)return this.isImg?"transparent":this.bgColor},isImg(){const t=this.bgColor.indexOf("data:")>-1&&this.bgColor.indexOf("base64")>-1;return-1!==this.bgColor.indexOf("/")||t},bgImgStyle(){const t={};return this.safeAreaInsetTop?t.height=this.$uv.addUnit(this.$uv.sys().statusBarHeight+44,"px"):t.height="44px",t}},methods:{leftClick(){this.$emit("leftClick"),this.autoBack&&o()},rightClick(){this.$emit("rightClick")}}},[["render",function(t,e,a,l,o,x){const k=_,I=b,S=m(s("uv-status-bar"),y),$=m(s("uv-icon"),C),B=p;return r(),i(k,{class:"uv-navbar"},{default:n((()=>[t.fixed&&t.placeholder?(r(),i(k,{key:0,class:"uv-navbar__placeholder",style:u({height:t.$uv.addUnit(t.$uv.getPx(t.height)+t.$uv.sys().statusBarHeight,"px")})},null,8,["style"])):g("",!0),d(k,{class:c([t.fixed&&"uv-navbar--fixed"])},{default:n((()=>[x.isImg?(r(),i(I,{key:0,class:"uv-navbar--bgimg",src:t.bgColor,mode:t.imgMode,style:u([x.bgImgStyle])},null,8,["src","mode","style"])):g("",!0),t.safeAreaInsetTop?(r(),i(S,{key:1,bgColor:x.getStatusbgColor},null,8,["bgColor"])):g("",!0),d(k,{class:c(["uv-navbar__content",[t.border&&"uv-border-bottom"]]),style:u([{height:t.$uv.addUnit(t.height)},x.getBgColor])},{default:n((()=>[d(k,{class:"uv-navbar__content__left","hover-class":"uv-navbar__content__left--hover","hover-start-time":"150",onClick:x.leftClick},{default:n((()=>[f(t.$slots,"left",{},(()=>[t.leftIcon?(r(),i($,{key:0,name:t.leftIcon,size:t.leftIconSize,color:t.leftIconColor},null,8,["name","size","color"])):g("",!0),t.leftText?(r(),i(B,{key:1,style:u({color:t.leftIconColor}),class:"uv-navbar__content__left__text"},{default:n((()=>[h(v(t.leftText),1)])),_:1},8,["style"])):g("",!0)]),!0)])),_:3},8,["onClick"]),f(t.$slots,"center",{},(()=>[d(B,{class:"uv-line-1 uv-navbar__content__title",style:u([{width:t.$uv.addUnit(t.titleWidth),flex:"0 1 auto"},t.$uv.addStyle(t.titleStyle)])},{default:n((()=>[h(v(t.title),1)])),_:1},8,["style"])]),!0),d(k,{class:"uv-navbar__content__right",onClick:x.rightClick},{default:n((()=>[f(t.$slots,"right",{},(()=>[t.rightIcon?(r(),i($,{key:0,name:t.rightIcon,size:"20"},null,8,["name"])):g("",!0),t.rightText?(r(),i(B,{key:1,class:"uv-navbar__content__right__text"},{default:n((()=>[h(v(t.rightText),1)])),_:1})):g("",!0)]),!0)])),_:3},8,["onClick"])])),_:3},8,["class","style"])])),_:3},8,["class"])])),_:3})}],["__scopeId","data-v-4c301e25"]]);export{k as _};
