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