best-unit 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@
42
42
  padding: 4px;
43
43
  color: ${i.closeColor};
44
44
  font-size: 12px;
45
- `,l.onclick=()=>{document.body.removeChild(a)},a.appendChild(l)}document.body.appendChild(a),o!==0&&setTimeout(()=>{document.body.contains(a)&&document.body.removeChild(a)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const Xe=new xo;function So(e={}){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log("fundUnitParams",t);const{env:n}=t;let r;switch(n){case X.DEV:case X.DEVELOPMENT:r="/api";break;case X.TEST:r="https://fund.bestfulfill.tech/api/sdk";break;case X.PROD:case X.PRODUCTION:default:r="https://fund.bestfulfill.com/api/sdk";break}const{baseURL:o=r,timeout:s=1e4,onError:i}=e,a=R.create({baseURL:o,timeout:s});return a.interceptors.request.use(u=>{const{token:l,locale:f}=t;return u.headers={...u.headers,Authorization:l,"x-locale":f===Pe.ZH?"zh-CN":"en-US"},u}),a.interceptors.response.use(u=>{if(u.data&&u.data.code===0)return u.data;const l=u.data?.msg||u.data?.message||"未知错误";return Xe.error(l),i&&i(l,u),Promise.reject(u.data||{message:"未知错误"})},u=>{const l=u.response?.data?.msg||u.response?.data?.message||u.message||"网络请求失败";return Xe.error(l),i&&i(l,u),Promise.reject(u)}),a}let xe=null;function te(){return xe||(xe=So()),xe}function Lo(){xe=null}function vn(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return te().get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType,fund_balance_id:e.fundBalanceId}}).then(t=>{const n=t.data,r={fundBalanceId:n.fund_balance_id,merchantId:n.merchant_id,bizType:n.biz_type,currency:n.currency,totalAmount:n.total_amount,frozenAmount:n.frozen_amount,creditLimit:n.credit_config?.credit_limit,creditUsed:n.credit_used,isCredit:!!n.credit_config,availableAmount:n.available_amount,currBalance:n.curr_balance,pendingAmount:n.pending_amount,status:n.status,createdAt:n.created_at};return sessionStorage.setItem("balanceData",JSON.stringify(r)),r})}const wo=async()=>te().get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),Ao=async(e,t)=>te().post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),Eo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return te().post("/offline/recharge/create",n,{})},vo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return te().post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},ko=async e=>te().get("/calc-payment-amount",{params:e}).then(t=>{const n=t.data;return{paymentAmount:n.payment_amount,fee:n.fee,currency:n.currency}});async function To(){let e=JSON.parse(sessionStorage.getItem("balanceData")||"{}");return e&&Object.keys(e).length>0||(e=await vn()),e}function Co(e){const{merchant_id:t,biz_type:n,fund_balance_id:r,user_id:o,theme:s=N.WHITE,locale:i=Pe.ZH,env:a,size:u,themeConfig:l}=e;console.log(e,"InitParams1111");const f="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,fundBalanceId:r,userId:o,token:f,theme:s,locale:i,env:a,size:u,themeConfig:l})),Lo(),wo(),{token:f,merchantId:t,bizType:n,fundBalanceId:r,userId:o,theme:s,locale:i,env:a,size:u}}function k(e){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");if(!e)return t;if(Array.isArray(e)){const n={};return e.forEach(r=>{n[r]=t[r]}),n}return t[e]}function kn(){const e=new CustomEvent("refresh-balance",{detail:{},bubbles:!0,composed:!0});document.dispatchEvent(e)}const Mo={"/api":{target:"https://fund.bestfulfill.tech/api/sdk",changeOrigin:!0,rewrite:e=>e.replace(/^\/api/,""),secure:!1}};function Ro(){const e=k("size");return{white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600}}}function Bo(e){const t=k("theme"),n=k("themeConfig"),r=t===N.WHITE,o=Ro();let s=e;return!s&&n&&(s=(r?n.white:n.dark)?.color),r?{...o.white,background:s||o.white.background}:{...o.dark,background:s||o.dark.background}}function Tn({onClick:e,color:t,children:n}){const r=Bo(t);return h("button",{style:r,onClick:e,type:"button",children:n})}const Fo={"额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。":"额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。","手续费约为:":"手续费约为:",确定:"确定",提交成功:"提交成功",余额详情:"余额详情",真实金额:"真实金额",冻结金额:"冻结金额",信用额度:"信用额度",已用额度:"已用额度",可用余额:"可用余额",暂无数据:"暂无数据","金额需在1到999999.99之间":"金额需在1到999999.99之间","充值 / 转账":"充值 / 转账",在线充值:"在线充值",线下转账:"线下转账",充值币种:"充值币种",充值金额:"充值金额",支付平台:"支付平台",请选择充值币种:"请选择充值币种",请输入充值金额:"请输入充值金额",请选择支付平台:"请选择支付平台","需要收取手续费,实际支付金额约为:":"需要收取手续费,实际支付金额约为:","提交失败,请重试":"提交失败,请重试","提交中...":"提交中...",去支付:"去支付",取消:"取消",关闭:"关闭",第三方支付平台:"第三方支付平台",交易ID:"交易ID",请输入转账交易ID:"请输入转账交易ID",上传文件:"上传文件",请上传转账凭证:"请上传转账凭证","加载中...":"加载中...",错误:"错误",成功:"成功",必填:"必填","充值/转账":"充值/转账",切换为暗黑主题:"切换为暗黑主题",切换为白色主题:"切换为白色主题",点击或拖拽文件到此处上传:"点击或拖拽文件到此处上传","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传",个文件:"个文件","正在上传...":"正在上传...",已上传:"已上传",移除:"移除"};function Oo(e){return Fo[e]||e}const Po={"额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。":"Additional note: Your region, currency, and card type may affect the processing fee; the final fee is determined by the provider.","手续费约为:":"Fee approximately: ",确定:"Confirm",提交成功:"Submit Success",余额详情:"Balance Details",真实金额:"Real Balance",冻结金额:"Frozen Amount",信用额度:"Credit Limit",已用额度:"Credit Used",可用余额:"Available Balance",暂无数据:"No Data","金额需在1到999999.99之间":"Amount must be between 1 and 999999.99","充值 / 转账":"Recharge / Transfer",在线充值:"Online Recharge",线下转账:"Offline Transfer",充值币种:"Recharge Currency",充值金额:"Recharge Amount",支付平台:"Payment Platform",请选择充值币种:"Please select recharge currency",请输入充值金额:"Please enter recharge amount",请选择支付平台:"Please select payment platform","需要收取手续费,实际支付金额约为:":"requires a handling fee, the actual payment amount is approximately: ","提交失败,请重试":"Submit failed, please try again","提交中...":"Submitting...",去支付:"Go to Pay",取消:"Cancel",关闭:"Close",第三方支付平台:"Third-party Payment Platform",交易ID:"Transaction ID",请输入转账交易ID:"Please enter transfer transaction ID",上传文件:"Upload Files",请上传转账凭证:"Please upload transfer voucher","加载中...":"Loading...",错误:"Error",成功:"Success",必填:"Required","充值/转账":"Recharge/Transfer",切换为暗黑主题:"Switch to Dark Theme",切换为白色主题:"Switch to Light Theme",点击或拖拽文件到此处上传:"Click or drag files here to upload","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"Supports JPG, PNG, PDF formats, single file not exceeding 20MB, maximum",个文件:"files can be uploaded","正在上传...":"Uploading...",已上传:"Uploaded",移除:"Remove"};function Do(e){return Po[e]||e}function Io(){return JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").locale||Pe.ZH}function L(e){return Io()==="zh"?Oo(e):Do(e)}const Ot={white:{trigger:{background:"#fff",color:"#222",border:"1px solid #d9d9d9"},triggerDisabled:{background:"#f5f5f5",color:"#bfbfbf",border:"1px solid #f0f0f0"},triggerError:{background:"#fff",color:"#222",border:"1px solid #ff4d4f"},dropdown:{background:"#fff",border:"1px solid #d9d9d9",color:"#222"},option:(e,t,n)=>({color:t?"#bfbfbf":e?"#1890ff":"#222",background:e?"#e6f7ff":n&&!t||t?"#f5f5f5":"#fff"}),placeholder:{color:"#bfbfbf"},scrollbarThumb:"#e5e5e5",scrollbarTrack:"#f5f5f5",boxShadow:"0 2px 8px rgba(0,0,0,0.08)"},dark:{trigger:{background:"#23262F",color:"#fff",border:"1px solid #374151"},triggerDisabled:{background:"#23262F",color:"#666",border:"1px solid #374151"},triggerError:{background:"#23262F",color:"#fff",border:"1px solid #ff4d4f"},dropdown:{background:"#23262F",border:"1px solid #374151",color:"#fff"},option:(e,t,n)=>({color:t?"#666":e?"#00E8C6":"#fff",background:e?"#23262F":n&&!t?"#333843":"#23262F"}),placeholder:{color:"#666"},scrollbarThumb:"#444C5C",scrollbarTrack:"#23262F",boxShadow:"0 2px 8px rgba(0,0,0,0.32)"}};function No(){const e=k("theme"),t=k("themeConfig"),n=e===N.WHITE,r=n?Ot.white:Ot.dark;if(t){const o=n?t.white:t.dark;if(o?.color)return{...r,option:(s,i,a)=>({...r.option(s,i,a),color:i?r.option(s,i,a).color:s?o.color:r.option(s,i,a).color})}}return r}const Ze=({value:e,onChange:t,options:n,placeholder:r,style:o,error:s,disabled:i,dropdownStyle:a,className:u,dropdownClassName:l,children:f})=>{const[c,x]=O(!1),_=Ee(null),[m,b]=O(null),g=No(),y=k("size");le(()=>{if(!c)return;const w=E=>{_.current&&!_.current.contains(E.target)&&x(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);const S=n.find(w=>w.value===e),v=()=>s?g.triggerError:i?g.triggerDisabled:g.trigger;return h("div",{ref:_,className:u,style:{position:"relative",...o},children:[h("style",{children:`
45
+ `,l.onclick=()=>{document.body.removeChild(a)},a.appendChild(l)}document.body.appendChild(a),o!==0&&setTimeout(()=>{document.body.contains(a)&&document.body.removeChild(a)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const Xe=new xo;function So(e={}){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log("fundUnitParams",t);const{env:n}=t;let r;switch(n){case X.DEV:case X.DEVELOPMENT:r="/api";break;case X.TEST:r="https://fund.bestfulfill.tech/api/sdk";break;case X.PROD:case X.PRODUCTION:default:r="https://fund.bestfulfill.com/api/sdk";break}const{baseURL:o=r,timeout:s=1e4,onError:i}=e,a=R.create({baseURL:o,timeout:s});return a.interceptors.request.use(u=>{const{token:l,locale:f}=t;return u.headers={...u.headers,Authorization:l,"x-locale":f===Pe.ZH?"zh-CN":"en-US"},u}),a.interceptors.response.use(u=>{if(u.data&&u.data.code===0)return u.data;const l=u.data?.msg||u.data?.message||"未知错误";return Xe.error(l),i&&i(l,u),Promise.reject(u.data||{message:"未知错误"})},u=>{const l=u.response?.data?.msg||u.response?.data?.message||u.message||"网络请求失败";return Xe.error(l),i&&i(l,u),Promise.reject(u)}),a}let xe=null;function te(){return xe||(xe=So()),xe}function Lo(){xe=null}function vn(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return te().get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType,fund_balance_id:e.fundBalanceId}}).then(t=>{const n=t.data,r={fundBalanceId:n.fund_balance_id,merchantId:n.merchant_id,bizType:n.biz_type,currency:n.currency,totalAmount:n.total_amount,frozenAmount:n.frozen_amount,creditLimit:n.credit_config?.credit_limit,creditUsed:n.credit_used,isCredit:!!n.credit_config,availableAmount:n.available_amount,currBalance:n.curr_balance,pendingAmount:n.pending_amount,status:n.status,createdAt:n.created_at};return sessionStorage.setItem("balanceData",JSON.stringify(r)),r})}const wo=async()=>te().get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),Ao=async(e,t)=>te().post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),Eo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return te().post("/offline/recharge/create",n,{})},vo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return te().post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},ko=async e=>te().get("/calc-payment-amount",{params:e}).then(t=>{const n=t.data;return{paymentAmount:n.payment_amount,fee:n.fee,currency:n.currency}});async function To(){let e=JSON.parse(sessionStorage.getItem("balanceData")||"{}");return e&&Object.keys(e).length>0||(e=await vn()),e}function Co(e){const{merchant_id:t,biz_type:n,fund_balance_id:r,user_id:o,theme:s=N.WHITE,locale:i=Pe.ZH,env:a,size:u,themeConfig:l}=e;console.log(e,"InitParams1111");const f="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,fundBalanceId:r,userId:o,token:f,theme:s,locale:i,env:a,size:u,themeConfig:l})),Lo(),wo(),{token:f,merchantId:t,bizType:n,fundBalanceId:r,userId:o,theme:s,locale:i,env:a,size:u}}function k(e){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");if(!e)return t;if(Array.isArray(e)){const n={};return e.forEach(r=>{n[r]=t[r]}),n}return t[e]}function kn(){console.log("refreshBalance");const e=new CustomEvent("refresh-balance",{detail:{},bubbles:!0,composed:!0});document.dispatchEvent(e)}const Mo={"/api":{target:"https://fund.bestfulfill.tech/api/sdk",changeOrigin:!0,rewrite:e=>e.replace(/^\/api/,""),secure:!1}};function Ro(){const e=k("size");return{white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600}}}function Bo(e){const t=k("theme"),n=k("themeConfig"),r=t===N.WHITE,o=Ro();let s=e;return!s&&n&&(s=(r?n.white:n.dark)?.color),r?{...o.white,background:s||o.white.background}:{...o.dark,background:s||o.dark.background}}function Tn({onClick:e,color:t,children:n}){const r=Bo(t);return h("button",{style:r,onClick:e,type:"button",children:n})}const Fo={"额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。":"额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。","手续费约为:":"手续费约为:",确定:"确定",提交成功:"提交成功",余额详情:"余额详情",真实金额:"真实金额",冻结金额:"冻结金额",信用额度:"信用额度",已用额度:"已用额度",可用余额:"可用余额",暂无数据:"暂无数据","金额需在1到999999.99之间":"金额需在1到999999.99之间","充值 / 转账":"充值 / 转账",在线充值:"在线充值",线下转账:"线下转账",充值币种:"充值币种",充值金额:"充值金额",支付平台:"支付平台",请选择充值币种:"请选择充值币种",请输入充值金额:"请输入充值金额",请选择支付平台:"请选择支付平台","需要收取手续费,实际支付金额约为:":"需要收取手续费,实际支付金额约为:","提交失败,请重试":"提交失败,请重试","提交中...":"提交中...",去支付:"去支付",取消:"取消",关闭:"关闭",第三方支付平台:"第三方支付平台",交易ID:"交易ID",请输入转账交易ID:"请输入转账交易ID",上传文件:"上传文件",请上传转账凭证:"请上传转账凭证","加载中...":"加载中...",错误:"错误",成功:"成功",必填:"必填","充值/转账":"充值/转账",切换为暗黑主题:"切换为暗黑主题",切换为白色主题:"切换为白色主题",点击或拖拽文件到此处上传:"点击或拖拽文件到此处上传","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传",个文件:"个文件","正在上传...":"正在上传...",已上传:"已上传",移除:"移除"};function Oo(e){return Fo[e]||e}const Po={"额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。":"Additional note: Your region, currency, and card type may affect the processing fee; the final fee is determined by the provider.","手续费约为:":"Fee approximately: ",确定:"Confirm",提交成功:"Submit Success",余额详情:"Balance Details",真实金额:"Real Balance",冻结金额:"Frozen Amount",信用额度:"Credit Limit",已用额度:"Credit Used",可用余额:"Available Balance",暂无数据:"No Data","金额需在1到999999.99之间":"Amount must be between 1 and 999999.99","充值 / 转账":"Recharge / Transfer",在线充值:"Online Recharge",线下转账:"Offline Transfer",充值币种:"Recharge Currency",充值金额:"Recharge Amount",支付平台:"Payment Platform",请选择充值币种:"Please select recharge currency",请输入充值金额:"Please enter recharge amount",请选择支付平台:"Please select payment platform","需要收取手续费,实际支付金额约为:":"requires a handling fee, the actual payment amount is approximately: ","提交失败,请重试":"Submit failed, please try again","提交中...":"Submitting...",去支付:"Go to Pay",取消:"Cancel",关闭:"Close",第三方支付平台:"Third-party Payment Platform",交易ID:"Transaction ID",请输入转账交易ID:"Please enter transfer transaction ID",上传文件:"Upload Files",请上传转账凭证:"Please upload transfer voucher","加载中...":"Loading...",错误:"Error",成功:"Success",必填:"Required","充值/转账":"Recharge/Transfer",切换为暗黑主题:"Switch to Dark Theme",切换为白色主题:"Switch to Light Theme",点击或拖拽文件到此处上传:"Click or drag files here to upload","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"Supports JPG, PNG, PDF formats, single file not exceeding 20MB, maximum",个文件:"files can be uploaded","正在上传...":"Uploading...",已上传:"Uploaded",移除:"Remove"};function Do(e){return Po[e]||e}function Io(){return JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").locale||Pe.ZH}function L(e){return Io()==="zh"?Oo(e):Do(e)}const Ot={white:{trigger:{background:"#fff",color:"#222",border:"1px solid #d9d9d9"},triggerDisabled:{background:"#f5f5f5",color:"#bfbfbf",border:"1px solid #f0f0f0"},triggerError:{background:"#fff",color:"#222",border:"1px solid #ff4d4f"},dropdown:{background:"#fff",border:"1px solid #d9d9d9",color:"#222"},option:(e,t,n)=>({color:t?"#bfbfbf":e?"#1890ff":"#222",background:e?"#e6f7ff":n&&!t||t?"#f5f5f5":"#fff"}),placeholder:{color:"#bfbfbf"},scrollbarThumb:"#e5e5e5",scrollbarTrack:"#f5f5f5",boxShadow:"0 2px 8px rgba(0,0,0,0.08)"},dark:{trigger:{background:"#23262F",color:"#fff",border:"1px solid #374151"},triggerDisabled:{background:"#23262F",color:"#666",border:"1px solid #374151"},triggerError:{background:"#23262F",color:"#fff",border:"1px solid #ff4d4f"},dropdown:{background:"#23262F",border:"1px solid #374151",color:"#fff"},option:(e,t,n)=>({color:t?"#666":e?"#00E8C6":"#fff",background:e?"#23262F":n&&!t?"#333843":"#23262F"}),placeholder:{color:"#666"},scrollbarThumb:"#444C5C",scrollbarTrack:"#23262F",boxShadow:"0 2px 8px rgba(0,0,0,0.32)"}};function No(){const e=k("theme"),t=k("themeConfig"),n=e===N.WHITE,r=n?Ot.white:Ot.dark;if(t){const o=n?t.white:t.dark;if(o?.color)return{...r,option:(s,i,a)=>({...r.option(s,i,a),color:i?r.option(s,i,a).color:s?o.color:r.option(s,i,a).color})}}return r}const Ze=({value:e,onChange:t,options:n,placeholder:r,style:o,error:s,disabled:i,dropdownStyle:a,className:u,dropdownClassName:l,children:f})=>{const[c,x]=O(!1),_=Ee(null),[m,b]=O(null),g=No(),y=k("size");le(()=>{if(!c)return;const w=E=>{_.current&&!_.current.contains(E.target)&&x(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);const S=n.find(w=>w.value===e),v=()=>s?g.triggerError:i?g.triggerDisabled:g.trigger;return h("div",{ref:_,className:u,style:{position:"relative",...o},children:[h("style",{children:`
46
46
  .custom-select-dropdown {
47
47
  scrollbar-width: thin;
48
48
  scrollbar-color: ${g.scrollbarThumb} ${g.scrollbarTrack};
package/dist/best-unit.js CHANGED
@@ -2392,6 +2392,7 @@ function k(e) {
2392
2392
  return t[e];
2393
2393
  }
2394
2394
  function Eo() {
2395
+ console.log("refreshBalance");
2395
2396
  const e = new CustomEvent("refresh-balance", {
2396
2397
  detail: {},
2397
2398
  bubbles: !0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "1.4.5",
4
+ "version": "1.4.6",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
@@ -121,6 +121,7 @@ export function getInitParams<T = InitParams>(key?: string | string[]): T {
121
121
  * 触发余额刷新事件
122
122
  */
123
123
  export function refreshBalance() {
124
+ console.log("refreshBalance");
124
125
  const refreshEvent = new CustomEvent("refresh-balance", {
125
126
  detail: {},
126
127
  bubbles: true,