import{_ as t}from"./uni-icons.BmNngUg_.js";import{ak as e,o as a,c as l,w as i,a2 as r,R as n,i as o,Q as s,q as u,t as c,G as h,A as d,v as f,x as g,H as b}from"./index-DL8B2Mxu.js";import{r as _}from"./uni-app.es.BSVEa1f2.js";import{_ as y}from"./_plugin-vue_export-helper.BCo6x5W8.js";const p=t=>"number"==typeof t?t+"px":t;const k=y({name:"UniNavBar",components:{statusBar:y({name:"UniStatusBar",data:()=>({statusBarHeight:e().statusBarHeight+"px"})},[["render",function(t,e,s,u,c,h){const d=o;return a(),l(d,{style:n({height:c.statusBarHeight}),class:"uni-status-bar"},{default:i((()=>[r(t.$slots,"default",{},void 0,!0)])),_:3},8,["style"])}],["__scopeId","data-v-0bfbbc2d"]])},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 p(this.height)},leftIconWidth(){return p(this.leftWidth)},rightIconWidth(){return p(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(e,y,p,k,m,v){const C=s("status-bar"),x=_(u("uni-icons"),t),B=o,S=b;return a(),l(B,{class:h(["uni-navbar",{"uni-dark":p.dark,"uni-nvue-fixed":p.fixed}])},{default:i((()=>[c(B,{class:h(["uni-navbar__content",{"uni-navbar--fixed":p.fixed,"uni-navbar--shadow":p.shadow,"uni-navbar--border":p.border}]),style:n({"background-color":v.themeBgColor,"border-bottom-color":v.themeColor})},{default:i((()=>[p.statusBar?(a(),l(C,{key:0})):d("",!0),c(B,{style:n({color:v.themeColor,backgroundColor:v.themeBgColor,height:v.navbarHeight}),class:"uni-navbar__header"},{default:i((()=>[c(B,{onClick:v.onClickLeft,class:"uni-navbar__header-btns uni-navbar__header-btns-left",style:n({width:v.leftIconWidth})},{default:i((()=>[r(e.$slots,"left",{},(()=>[p.leftIcon.length>0?(a(),l(B,{key:0,class:"uni-navbar__content_view"},{default:i((()=>[c(x,{color:v.themeColor,type:p.leftIcon,size:"20"},null,8,["color","type"])])),_:1})):d("",!0),p.leftText.length?(a(),l(B,{key:1,class:h([{"uni-navbar-btn-icon-left":!p.leftIcon.length>0},"uni-navbar-btn-text"])},{default:i((()=>[c(S,{style:n({color:v.themeColor,fontSize:"12px"})},{default:i((()=>[f(g(p.leftText),1)])),_:1},8,["style"])])),_:1},8,["class"])):d("",!0)]),!0)])),_:3},8,["onClick","style"]),c(B,{class:"uni-navbar__header-container",onClick:v.onClickTitle},{default:i((()=>[r(e.$slots,"default",{},(()=>[p.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:n({color:v.themeColor})},{default:i((()=>[f(g(p.title),1)])),_:1},8,["style"])])),_:1})):d("",!0)]),!0)])),_:3},8,["onClick"]),c(B,{onClick:v.onClickRight,class:"uni-navbar__header-btns uni-navbar__header-btns-right",style:n({width:v.rightIconWidth})},{default:i((()=>[r(e.$slots,"right",{},(()=>[p.rightIcon.length?(a(),l(B,{key:0},{default:i((()=>[c(x,{color:v.themeColor,type:p.rightIcon,size:"22"},null,8,["color","type"])])),_:1})):d("",!0),p.rightText.length&&!p.rightIcon.length?(a(),l(B,{key:1,class:"uni-navbar-btn-text"},{default:i((()=>[c(S,{class:"uni-nav-bar-right-text",style:n({color:v.themeColor})},{default:i((()=>[f(g(p.rightText),1)])),_:1},8,["style"])])),_:1})):d("",!0)]),!0)])),_:3},8,["onClick","style"])])),_:3},8,["style"])])),_:3},8,["class","style"]),p.fixed?(a(),l(B,{key:0,class:"uni-navbar__placeholder"},{default:i((()=>[p.statusBar?(a(),l(C,{key:0})):d("",!0),c(B,{class:"uni-navbar__placeholder-view",style:n({height:v.navbarHeight})},null,8,["style"])])),_:1})):d("",!0)])),_:3},8,["class"])}],["__scopeId","data-v-d8073948"]]);export{k as _};
