import{_ as t,a3 as e,o as a,p as l,w as i,aq as n,B as r,i as s,am as o,b as u,h,d,f as c,a4 as f,v as g,k as b,t as y,C as _}from"./index-2PZN6pGH.js";const k=t=>"number"==typeof t?t+"px":t;const p=t({name:"UniNavBar",components:{statusBar:t({name:"UniStatusBar",data:()=>({statusBarHeight:20}),mounted(){this.statusBarHeight=e().statusBarHeight+"px"}},[["render",function(t,e,o,u,h,d){const c=s;return a(),l(c,{style:r({height:h.statusBarHeight}),class:"uni-status-bar"},{default:i((()=>[n(t.$slots,"default",{},void 0,!0)])),_:3},8,["style"])}],["__scopeId","data-v-40847dd0"]])},emits:["clickLeft","clickRight","clickTitle"],props:{dark:{type:Boolean,default:!1},title:{type:String,default:""},leftText:{type:String,default:""},rightText:{type:String,default:""},leftIcon:{type:String,default:""},rightIcon:{type:String,default:""},fixed:{type:[Boolean,String],default:!1},color:{type:String,default:""},backgroundColor:{type:String,default:""},statusBar:{type:[Boolean,String],default:!1},shadow:{type:[Boolean,String],default:!1},border:{type:[Boolean,String],default:!0},height:{type:[Number,String],default:44},leftWidth:{type:[Number,String],default:60},rightWidth:{type:[Number,String],default:60},stat:{type:[Boolean,String],default:""}},computed:{themeBgColor(){return this.dark?this.backgroundColor?this.backgroundColor:this.dark?"#333":"#FFF":this.backgroundColor||"#FFF"},themeColor(){return this.dark?this.color?this.color:this.dark?"#fff":"#333":this.color||"#333"},navbarHeight(){return k(this.height)},leftIconWidth(){return k(this.leftWidth)},rightIconWidth(){return k(this.rightWidth)}},mounted(){uni.report&&this.stat&&""!==this.title&&uni.report("title",this.title)},methods:{onClickLeft(){this.$emit("clickLeft")},onClickRight(){this.$emit("clickRight")},onClickTitle(){this.$emit("clickTitle")}}},[["render",function(t,e,k,p,v,m){const C=o("status-bar"),x=u(d("uni-icons"),h),B=s,S=_;return a(),l(B,{class:f(["uni-navbar",{"uni-dark":k.dark,"uni-nvue-fixed":k.fixed}])},{default:i((()=>[c(B,{class:f(["uni-navbar__content",{"uni-navbar--fixed":k.fixed,"uni-navbar--shadow":k.shadow,"uni-navbar--border":k.border}]),style:r({"background-color":m.themeBgColor})},{default:i((()=>[k.statusBar?(a(),l(C,{key:0})):g("",!0),c(B,{style:r({color:m.themeColor,backgroundColor:m.themeBgColor,height:m.navbarHeight}),class:"uni-navbar__header"},{default:i((()=>[c(B,{onClick:m.onClickLeft,class:"uni-navbar__header-btns uni-navbar__header-btns-left",style:r({width:m.leftIconWidth})},{default:i((()=>[n(t.$slots,"left",{},(()=>[k.leftIcon.length>0?(a(),l(B,{key:0,class:"uni-navbar__content_view"},{default:i((()=>[c(x,{color:m.themeColor,type:k.leftIcon,size:"20"},null,8,["color","type"])])),_:1})):g("",!0),k.leftText.length?(a(),l(B,{key:1,class:f([{"uni-navbar-btn-icon-left":!k.leftIcon.length>0},"uni-navbar-btn-text"])},{default:i((()=>[c(S,{style:r({color:m.themeColor,fontSize:"12px"})},{default:i((()=>[b(y(k.leftText),1)])),_:1},8,["style"])])),_:1},8,["class"])):g("",!0)]),!0)])),_:3},8,["onClick","style"]),c(B,{class:"uni-navbar__header-container",onClick:m.onClickTitle},{default:i((()=>[n(t.$slots,"default",{},(()=>[k.title.length>0?(a(),l(B,{key:0,class:"uni-navbar__header-container-inner"},{default:i((()=>[c(S,{class:"uni-nav-bar-text uni-ellipsis-1",style:r({color:m.themeColor})},{default:i((()=>[b(y(k.title),1)])),_:1},8,["style"])])),_:1})):g("",!0)]),!0)])),_:3},8,["onClick"]),c(B,{onClick:m.onClickRight,class:"uni-navbar__header-btns uni-navbar__header-btns-right",style:r({width:m.rightIconWidth})},{default:i((()=>[n(t.$slots,"right",{},(()=>[k.rightIcon.length?(a(),l(B,{key:0},{default:i((()=>[c(x,{color:m.themeColor,type:k.rightIcon,size:"22"},null,8,["color","type"])])),_:1})):g("",!0),k.rightText.length&&!k.rightIcon.length?(a(),l(B,{key:1,class:"uni-navbar-btn-text"},{default:i((()=>[c(S,{class:"uni-nav-bar-right-text",style:r({color:m.themeColor})},{default:i((()=>[b(y(k.rightText),1)])),_:1},8,["style"])])),_:1})):g("",!0)]),!0)])),_:3},8,["onClick","style"])])),_:3},8,["style"])])),_:3},8,["class","style"]),k.fixed?(a(),l(B,{key:0,class:"uni-navbar__placeholder"},{default:i((()=>[k.statusBar?(a(),l(C,{key:0})):g("",!0),c(B,{class:"uni-navbar__placeholder-view",style:r({height:m.navbarHeight})},null,8,["style"])])),_:1})):g("",!0)])),_:3},8,["class"])}],["__scopeId","data-v-e825e9eb"]]);export{p as _};
