{"version":3,"file":"data-v-editor.mjs","sources":["../../src/dataViewer/editor/WebComponents.js"],"sourcesContent":["import { defineCustomElement } from 'vue'\r\nimport '../libs/prototypes'\r\nimport DataViewerEditor from './index.ce.vue'\r\nimport editorStyles from './styles/styles.scss'\r\nimport \"../components/index.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\nfunction 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\nDataViewerEditor.styles.push(editorStyles);\r\n\r\n// Vue generates a new HTML element class from the component definition.\r\nconst customDataViewEditor = defineCustomElement(DataViewerEditor)\r\n\r\n// Register the custom element so that it can be used as .\r\nexport function dataViewEditorRegister(tagName = 'data-v'){\r\n if(tagName != 'data-v'){\r\n customElements.define(`${tagName}-editor`, customDataViewEditor)\r\n } \r\n}\r\n\r\n// 注册 Web Component\r\ncustomElements.define('data-v-editor', customDataViewEditor)\r\n\r\n// 导出组件\r\nexport { customDataViewEditor as DataViewerEditor }\r\n\r\n// 默认导出\r\nexport default customDataViewEditor\r\n\r\n// 导出 Vue 组件(如果需要直接使用 Vue 组件)\r\nexport { DataViewerEditor as VueComponent }\r\n"],"names":["DataViewerEditor","editorStyles","customDataViewEditor","defineCustomElement"],"mappings":"oPAmBAA,EAAiB,OAAO,KAAKC,CAAY,EAGzC,MAAMC,EAAuBC,EAAoBH,CAAgB,EAUjE,eAAe,OAAO,gBAAiBE,CAAoB"}