{"version":3,"file":"data-v-viewer.mjs","sources":["../../src/dataViewer/viewer/WebComponents.js"],"sourcesContent":["import { defineCustomElement } from 'vue'\r\nimport '../libs/prototypes'\r\nimport DataViewViewer from './index.ce.vue'\r\nimport styles from './styles/styles.scss'\r\n//const USE_WORKAROUND = false;\r\n/** \r\n *\r\n * Unfortunately it's error prone and results in poor dev experience:\r\n * - load everything as CE\r\n * - recursively add child element styles to the root element\r\n * - [if TypeScript is set to strict, sort out the \"styles\" prop being set to any] */\r\n\r\n/** Returns the styles of a Vue component including all of its child components'. */\r\n// function deepStylesOf({ styles = [], components = {} }) {\r\n// const unique = array => [...new Set(array)]; \r\n// return unique([...styles, ...Object.values(components).flatMap(deepStylesOf)]);\r\n// }\r\n\r\nDataViewViewer.styles.push(styles);\r\n\r\n// Vue generates a new HTML element class from the component definition.\r\n// export const DataViewer = defineCustomElement(VueDataViewer)\r\n\r\n// // Register the custom element so that it can be used as .\r\n// export function dataViewViewerRegister (tagName = 'data-v') {\r\n// customElements.define(`${tagName}-viewer`, DataViewer)\r\n// }\r\n\r\n// Vue generates a new HTML element class from the component definition.\r\nexport const customDataViewViewer = defineCustomElement(DataViewViewer)\r\n\r\n// Register the custom element so that it can be used as .\r\nexport function dataViewViewerRegister(tagName = 'data-v') {\r\n if(tagName != 'data-v'){\r\n customElements.define(`${tagName}-viewer`, customDataViewViewer)\r\n } \r\n}\r\n\r\n// 注册 Web Component\r\ncustomElements.define('data-v-viewer', customDataViewViewer)\r\n\r\n// 导出组件\r\nexport { customDataViewViewer as DataViewViewer }\r\n\r\n// 默认导出\r\nexport default customDataViewViewer\r\n\r\n// 导出 Vue 组件(如果需要直接使用 Vue 组件)\r\nexport { DataViewViewer as VueComponent }"],"names":["DataViewViewer","styles","customDataViewViewer","defineCustomElement"],"mappings":";;;;;;;EAkBAA,EAAe,OAAO,KAAKC,CAAM,EAW1B,MAAMC,EAAuBC,EAAoBH,CAAc,EAUtE,eAAe,OAAO,gBAAiBE,CAAoB"}