1 line
3.4 KiB
Plaintext
1 line
3.4 KiB
Plaintext
|
{"version":3,"file":"wd-config-provider.js","sources":["../../../../../../../node_modules/wot-design-uni/components/wd-config-provider/wd-config-provider.vue","../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL25vZGVfbW9kdWxlcy93b3QtZGVzaWduLXVuaS9jb21wb25lbnRzL3dkLWNvbmZpZy1wcm92aWRlci93ZC1jb25maWctcHJvdmlkZXIudnVl"],"sourcesContent":["<!--\n * @Author: weisheng\n * @Date: 2023-06-13 11:34:35\n * @LastEditTime: 2024-03-15 17:00:16\n * @LastEditors: weisheng\n * @Description: \n * @FilePath: \\wot-design-uni\\src\\uni_modules\\wot-design-uni\\components\\wd-config-provider\\wd-config-provider.vue\n * 记得注释\n-->\n<template>\n <view :class=\"themeClass\" :style=\"themeStyle\">\n <slot />\n </view>\n</template>\n\n<script lang=\"ts\">\nexport default {\n name: 'wd-config-provider',\n options: {\n virtualHost: true,\n addGlobalClass: true,\n styleIsolation: 'shared'\n }\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { configProviderProps } from './types'\n\nconst props = defineProps(configProviderProps)\n\nconst themeClass = computed(() => {\n return `wot-theme-${props.theme}`\n})\n\nconst themeStyle = computed(() => {\n return mapThemeVarsToCSSVars(props.themeVars)\n})\n\nconst kebabCase = (str: string): string => {\n str = str.replace(str.charAt(0), str.charAt(0).toLocaleLowerCase())\n return str.replace(/([a-z])([A-Z])/g, (_, p1, p2) => p1 + '-' + p2.toLowerCase())\n}\nconst colorRgb = (str: string) => {\n if (!str) return\n var sColor = str.toLowerCase()\n //十六进制颜色值的正则表达式\n var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/\n // 如果是16进制颜色\n if (sColor && reg.test(sColor)) {\n if (sColor.length === 4) {\n var sColorNew = '#'\n for (let i = 1; i < 4; i += 1) {\n sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))\n }\n sColor = sColorNew\n }\n //处理六位的颜色值\n var sColorChange: number[] = []\n for (let i = 1; i < 7; i += 2) {\n sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))\n }\n return sColorChange.join(',')\n }\n return null\n}\n\nconst mapThemeVarsToCSSVars = (themeVars: Record<string, string>) => {\n if (!themeVars) return\n const cssVars: Record<string, string> = {}\n Object.keys(themeVars).forEach((key) => {\n cssVars[`--wot-${kebabCase(key)}`] = themeVars[key]\n })\n\n return cssVars\n}\n</script>\n\n<style lang=\"scss\" scoped></style>\n","import Component from 'D:/App/Work/addr/acdr-ui/node_modules/wot-design-uni/components/wd-config-provider/wd-config-provider.vue'\nwx.createComponent(Component)"],"names":["computed","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA,MAAA,cAAe;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,IACP,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,EAClB;AACF;;;;AAOA,UAAM,QAAQ;AAER,UAAA,aAAaA,cAAAA,SAAS,MAAM;AACzB,aAAA,aAAa,MAAM,KAAK;AAAA,IAAA,CAChC;AAEK,UAAA,aAAaA,cAAAA,SAAS,MAAM;AACzB,aAAA,sBAAsB,MAAM,SAAS;AAAA,IAAA,CAC7C;AAEK,UAAA,YAAY,CAAC,QAAwB;AACnC,YAAA,IAAI,QAAQ,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,EAAE,kBAAmB,CAAA;AAC3D,aAAA,IAAI,QAAQ,mBAAmB,CAAC,GAAG,IAAI,OAAO,KAAK,MAAM,GAAG,YAAa,CAAA;AAAA,IAAA;AA0B5E,UAAA,wBAAwB,CAAC,cAAsC;AACnE,UAAI,CAAC;AAAW;AAChB,YAAM,UAAkC,CAAA;AACxC,aAAO,KAAK,SAAS,EAAE,QAAQ,CAAC,QAAQ;AACtC,gBAAQ,SAAS,UAAU,GAAG,CAAC,EAAE,IAAI,UAAU,GAAG;AAAA,MAAA,CACnD;AAEM,aAAA;AAAA,IAAA;;;;;;;;;AC1ET,GAAG,gBAAgBC,SAAS;","x_google_ignoreList":[0]}
|