1 line
6.9 KiB
Plaintext
1 line
6.9 KiB
Plaintext
{"version":3,"file":"wd-button.js","sources":["../../../../../../../node_modules/wot-design-uni/components/wd-button/wd-button.vue","../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL25vZGVfbW9kdWxlcy93b3QtZGVzaWduLXVuaS9jb21wb25lbnRzL3dkLWJ1dHRvbi93ZC1idXR0b24udnVl"],"sourcesContent":["<template>\n <button\n :hover-class=\"`${disabled || loading ? '' : 'wd-button--active'}`\"\n :style=\"customStyle\"\n :class=\"[\n 'wd-button',\n 'is-' + type,\n 'is-' + size,\n plain ? 'is-plain' : '',\n disabled ? 'is-disabled' : '',\n round ? 'is-round' : '',\n hairline ? 'is-hairline' : '',\n block ? 'is-block' : '',\n loading ? 'is-loading' : '',\n customClass\n ]\"\n :hover-start-time=\"hoverStartTime\"\n :hover-stay-time=\"hoverStayTime\"\n :open-type=\"openType\"\n :send-message-title=\"sendMessageTitle\"\n :send-message-path=\"sendMessagePath\"\n :send-message-img=\"sendMessageImg\"\n :app-parameter=\"appParameter\"\n :show-message-card=\"showMessageCard\"\n :session-from=\"sessionFrom\"\n :lang=\"lang\"\n :hover-stop-propagation=\"hoverStopPropagation\"\n :form-type=\"formType\"\n @click=\"handleClick\"\n @getuserinfo=\"handleGetuserinfo\"\n @contact=\"handleConcat\"\n @getphonenumber=\"handleGetphonenumber\"\n @error=\"handleError\"\n @launchapp=\"handleLaunchapp\"\n @opensetting=\"handleOpensetting\"\n @chooseavatar=\"handleChooseavatar\"\n @agreeprivacyauthorization=\"handleAgreePrivacyAuthorization\"\n >\n <view v-if=\"loading\" class=\"wd-button__loading\">\n <view class=\"wd-button__loading-svg\" :style=\"loadingStyle\"></view>\n </view>\n <wd-icon v-else-if=\"icon\" custom-class=\"wd-button__icon\" :name=\"icon\"></wd-icon>\n <view class=\"wd-button__text\"><slot /></view>\n </button>\n</template>\n\n<script lang=\"ts\">\nexport default {\n name: 'wd-button',\n options: {\n addGlobalClass: true,\n virtualHost: true,\n styleIsolation: 'shared'\n }\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, watch } from 'vue'\nimport { ref } from 'vue'\nimport base64 from '../common/base64'\nimport { buttonProps } from './types'\n\nconst loadingIcon = (color = '#4D80F0', reverse = true) => {\n return `<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=\"${\n reverse ? color : '#fff'\n }\" offset=\"0%\" stop-opacity=\"0\"/><stop stop-color=\"${\n reverse ? color : '#fff'\n }\" 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=\"${\n reverse ? '#fff' : color\n }\"/><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>`\n}\nconst props = defineProps(buttonProps)\nconst emit = defineEmits([\n 'click',\n 'getuserinfo',\n 'contact',\n 'getphonenumber',\n 'error',\n 'launchapp',\n 'opensetting',\n 'chooseavatar',\n 'agreeprivacyauthorization'\n])\n\nconst hoverStartTime = ref<number>(20)\nconst hoverStayTime = ref<number>(70)\nconst loadingIconSvg = ref<string>('')\n\nconst loadingStyle = computed(() => {\n return `background-image: url(${loadingIconSvg.value});`\n})\n\nwatch(\n () => props.loading,\n () => {\n buildLoadingSvg()\n },\n { deep: true, immediate: true }\n)\n\nfunction handleClick(event: any) {\n if (!props.disabled && !props.loading) {\n emit('click', event.detail)\n }\n}\n\nfunction handleGetuserinfo(event: any) {\n emit('getuserinfo', event.detail)\n}\n\nfunction handleConcat(event: any) {\n emit('contact', event.detail)\n}\n\nfunction handleGetphonenumber(event: any) {\n emit('getphonenumber', event.detail)\n}\n\nfunction handleError(event: any) {\n emit('error', event.detail)\n}\n\nfunction handleLaunchapp(event: any) {\n emit('launchapp', event.detail)\n}\n\nfunction handleOpensetting(event: any) {\n emit('opensetting', event.detail)\n}\n\nfunction handleChooseavatar(event: any) {\n emit('chooseavatar', event.detail)\n}\n\nfunction handleAgreePrivacyAuthorization(event: any) {\n emit('agreeprivacyauthorization', event.detail)\n}\nfunction buildLoadingSvg() {\n const { loadingColor, type, plain } = props\n let color = loadingColor\n if (!color) {\n switch (type) {\n case 'primary':\n color = '#4D80F0'\n break\n case 'success':\n color = '#34d19d'\n break\n case 'info':\n color = '#333'\n break\n case 'warning':\n color = '#f0883a'\n break\n case 'error':\n color = '#fa4350'\n break\n case 'default':\n color = '#333'\n break\n }\n }\n\n const svg = loadingIcon(color, !plain)\n loadingIconSvg.value = `\"data:image/svg+xml;base64,${base64(svg)}\"`\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import './index.scss';\n</style>\n","import Component from 'D:/App/Work/addr/acdr-ui/node_modules/wot-design-uni/components/wd-button/wd-button.vue'\nwx.createComponent(Component)"],"names":["ref","computed","watch","base64"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAA,cAAe;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,IACP,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,gBAAgB;AAAA,EAClB;AACF;;;;;;;;;;;;;;;AASA,UAAM,cAAc,CAAC,QAAQ,WAAW,UAAU,SAAS;AAClD,aAAA,gJACL,UAAU,QAAQ,MACpB,qDACE,UAAU,QAAQ,MACpB,4OACE,UAAU,SAAS,KACrB;AAAA,IAAA;AAEF,UAAM,QAAQ;AACd,UAAM,OAAO;AAYP,UAAA,iBAAiBA,kBAAY,EAAE;AAC/B,UAAA,gBAAgBA,kBAAY,EAAE;AAC9B,UAAA,iBAAiBA,kBAAY,EAAE;AA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