mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-07 09:38:44 +08:00
2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
var e=Object.defineProperty,a=Object.defineProperties,s=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,i=(a,s,t)=>s in a?e(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t,r=(e,a)=>{for(var s in a||(a={}))o.call(a,s)&&i(e,s,a[s]);if(t)for(var s of t(a))n.call(a,s)&&i(e,s,a[s]);return e},l=(e,t)=>a(e,s(t));import{d,r as c,c as p,C as g,b as u,g as m,w as f,h as b,i as h,z as v,E as y,D as w,q as _,am as S}from"./index-ChV97F5w.js";import{c as k,a as P,b as x,w as C,g as M,_ as O}from"./base64.D3gEw_Hf.js";const z=l(r({},x),{plain:k(!1),round:k(!0),disabled:k(!1),hairline:k(!1),block:k(!1),type:P("primary"),size:P("medium"),icon:String,classPrefix:P("wd-icon"),loading:k(!1),loadingColor:String,openType:String,hoverStopPropagation:Boolean,lang:String,sessionFrom:String,sendMessageTitle:String,sendMessagePath:String,sendMessageImg:String,appParameter:String,showMessageCard:Boolean,buttonId:String,scope:String}),j=O(d(l(r({},{name:"wd-button",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}}),{props:z,emits:["click","getuserinfo","contact","getphonenumber","getrealtimephonenumber","error","launchapp","opensetting","chooseavatar","agreeprivacyauthorization"],setup(e,{emit:a}){const s=(e="#4D80F0",a=!0)=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${a?e:"#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${a?e:"#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${a?"#fff":e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`,t=e,o=a,n=c(20),i=c(70),r=c(""),l=p((()=>`background-image: url(${r.value});`));function d(e){t.disabled||t.loading||o("click",e)}function k(e){"phoneNumber"===t.scope?O(e):"userInfo"===t.scope&&P(e)}function P(e){o("getuserinfo",e.detail)}function x(e){o("contact",e.detail)}function O(e){o("getphonenumber",e.detail)}function z(e){o("getrealtimephonenumber",e.detail)}function j(e){o("error",e.detail)}function I(e){o("launchapp",e.detail)}function G(e){o("opensetting",e.detail)}function $(e){o("chooseavatar",e.detail)}function D(e){o("agreeprivacyauthorization",e.detail)}return g((()=>t.loading),(()=>{!function(){const{loadingColor:e,type:a,plain:o}=t;let n=e;if(!n)switch(a){case"primary":n="#4D80F0";break;case"success":n="#34d19d";break;case"info":case"default":n="#333";break;case"warning":n="#f0883a";break;case"error":n="#fa4350"}const i=s(n,!o);r.value=`"data:image/svg+xml;base64,${M(i)}"`}()}),{deep:!0,immediate:!0}),(e,a)=>{const s=h,t=S;return m(),u(t,{id:e.buttonId,"hover-class":""+(e.disabled||e.loading?"":"wd-button--active"),style:y(e.customStyle),class:_(["wd-button","is-"+e.type,"is-"+e.size,e.round?"is-round":"",e.hairline?"is-hairline":"",e.plain?"is-plain":"",e.disabled?"is-disabled":"",e.block?"is-block":"",e.loading?"is-loading":"",e.customClass]),"hover-start-time":n.value,"hover-stay-time":i.value,"open-type":e.disabled||e.loading?void 0:e.openType,"send-message-title":e.sendMessageTitle,"send-message-path":e.sendMessagePath,"send-message-img":e.sendMessageImg,"app-parameter":e.appParameter,"show-message-card":e.showMessageCard,"session-from":e.sessionFrom,lang:e.lang,"hover-stop-propagation":e.hoverStopPropagation,scope:e.scope,onClick:d,onGetAuthorize:k,onGetuserinfo:P,onContact:x,onGetphonenumber:O,onGetrealtimephonenumber:z,onError:j,onLaunchapp:I,onOpensetting:G,onChooseavatar:$,onAgreeprivacyauthorization:D},{default:f((()=>[b(s,{class:"wd-button__content"},{default:f((()=>[e.loading?(m(),u(s,{key:0,class:"wd-button__loading"},{default:f((()=>[b(s,{class:"wd-button__loading-svg",style:y(l.value)},null,8,["style"])])),_:1})):e.icon?(m(),u(C,{key:1,"custom-class":"wd-button__icon",name:e.icon,classPrefix:e.classPrefix},null,8,["name","classPrefix"])):v("",!0),b(s,{class:"wd-button__text"},{default:f((()=>[w(e.$slots,"default",{},void 0,!0)])),_:3})])),_:3})])),_:3},8,["id","hover-class","style","class","hover-start-time","hover-stay-time","open-type","send-message-title","send-message-path","send-message-img","app-parameter","show-message-card","session-from","lang","hover-stop-propagation","scope"])}}})),[["__scopeId","data-v-e9d67137"]]);export{j as _};
|