acdr-ui/dist/dev/mp-weixin/node-modules/wot-design-uni/components/wd-button/wd-button.js.map

1 line
6.9 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"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 handleLa