index.4d16ec29.js 1.4 KB

1
  1. import{E as v,a0 as u,ab as B,H as S,d as y,i as t,N as T,B as I,O as A}from"./index.7994470a.js";const[C,e,N]=v("submit-bar"),P={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:u("\xA5"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:u("danger"),buttonColor:String,suffixLabel:String,decimalLength:B(2),safeAreaInsetBottom:S};var h=y({name:C,props:P,emits:["submit"],setup(n,{emit:b,slots:a}){const d=()=>{const{price:i,label:r,currency:l,textAlign:g,suffixLabel:o,decimalLength:c}=n;if(typeof i=="number"){const s=(i/100).toFixed(+c).split("."),x=c?`.${s[1]}`:"";return t("div",{class:e("text"),style:{textAlign:g}},[t("span",null,[r||N("label")]),t("span",{class:e("price")},[l,t("span",{class:e("price-integer")},[s[0]]),x]),o&&t("span",{class:e("suffix-label")},[o])])}},m=()=>{var i;const{tip:r,tipIcon:l}=n;if(a.tip||r)return t("div",{class:e("tip")},[l&&t(T,{class:e("tip-icon"),name:l},null),r&&t("span",{class:e("tip-text")},[r]),(i=a.tip)==null?void 0:i.call(a)])},p=()=>b("submit"),f=()=>a.button?a.button():t(I,{round:!0,type:n.buttonType,text:n.buttonText,class:e("button",n.buttonType),color:n.buttonColor,loading:n.loading,disabled:n.disabled,onClick:p},null);return()=>{var i,r;return t("div",{class:[e(),{"van-safe-area-bottom":n.safeAreaInsetBottom}]},[(i=a.top)==null?void 0:i.call(a),m(),t("div",{class:e("bar")},[(r=a.default)==null?void 0:r.call(a),d(),f()])])}}});const L=A(h);export{L as S};