{"version":3,"file":"static/js/5745e87991.js","mappings":"+MAWA,YACA,YACA,WAUO,MAAMA,gBAAkB,SAAUC,EAAIC,GAE3C,MAAM,MAAEC,GAAUD,EACZE,EAAYC,OAAOC,KAAKH,GAAS,CAAC,GAOxC,OALIC,EAAUG,OAAS,GACrBH,EAAUI,SAAQC,IAChBR,EAAGQ,GAAON,EAAMM,EAAI,KAGjB,CACT,EAEaC,UAAYC,IACvBA,EAAIC,UAAU,UAAWZ,kBAClB,E","sources":["webpack://ad_lite_mobile/./src/plugin/webComponents.ts"],"sourcesContent":["// @ts-nocheck\n// web component 业务组件库,本身为 loader 按需加载,使用时才会动态加载和注册组件,所以需要用的地方直接使用即可\n// gitlab: https://code.byted.org/ad/byted-web-components/tree/master/ui/wc-business-ui\n// 此步骤会将组件资源同步引用到该文件。\nimport {\n defineCustomElementBytedWcAntiDiscriminationDialog,\n defineCustomElementBytedWcBusinessConfigProvider,\n defineCustomElementBytedWcConfigProvider,\n} from '@byted/wc-business-ui/components';\n\n// 此步骤将组件注册为web component\ndefineCustomElementBytedWcAntiDiscriminationDialog();\ndefineCustomElementBytedWcBusinessConfigProvider();\ndefineCustomElementBytedWcConfigProvider();\n\n/**\n * 对 web component 传复杂类型的指令封装(对象/函数)\n * 因为在为 html 元素 web component 传输 props 时,会使用 toString parse,使得对象类型的数据变为 \"[Object Object]\"\n * 这个在 vue3 版本后已支持(检查元素时,元素上不展示该 attr),在未升级 vue3 前,有两种做法:\n * 1. JSON.stringify 转换后传输,缺点是 wc 组件需要适配,元素上也会有数据的展示,不够优雅\n * 2. 获取到元素后,使用【el.data = obj】的形式传递复杂类型,响应到 data 改变时再重新赋值\n * 该指令用于封装动态为 el 设置属性的逻辑\n */\nexport const wcBindDirective = function (el, binding) {\n // v-wc-bind=\"{k1: v1, k2: v2, event1: handleEvent1}\"\n const { value } = binding;\n const valueKeys = Object.keys(value || {});\n\n if (valueKeys.length > 0) {\n valueKeys.forEach(key => {\n el[key] = value[key];\n });\n }\n return true;\n};\n\nexport const installWc = Vue => {\n Vue.directive('wc-bind', wcBindDirective);\n return true;\n};\n"],"names":["wcBindDirective","el","binding","value","valueKeys","Object","keys","length","forEach","key","installWc","Vue","directive"],"sourceRoot":""}