resolver-egretimp-plus 0.0.64 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,3 +238,7 @@ export const META_TYPE_MAP = {
238
238
  'cmi-table': 'CustomComponentTableH5',
239
239
  'cmi-datetime': 'CmiDatetimePicker',
240
240
  }
241
+
242
+ export {
243
+ commonPropsType as componentPropsType
244
+ }
@@ -0,0 +1,48 @@
1
+ import * as Vue from 'vue'
2
+ import { loadModule } from 'vue3-sfc-loader'
3
+
4
+ const options = {
5
+ moduleCache: {
6
+ vue: Vue,
7
+ },
8
+
9
+ async getFile(url) {
10
+ const res = await fetch(url);
11
+ if ( !res.ok )
12
+ throw Object.assign(new Error(url+' '+res.statusText), { res });
13
+ return await res.text();
14
+ },
15
+
16
+ addStyle(textContent) {
17
+ const style = Object.assign(document.createElement('style'), { textContent });
18
+ const ref = document.head.getElementsByTagName('style')[0] || null;
19
+ document.head.insertBefore(style, ref);
20
+ },
21
+ log(type, ...args) {
22
+ console[type](...args);
23
+ },
24
+ compiledCache: {
25
+ set(key, str) {
26
+ for (;;) {
27
+ try {
28
+ window.localStorage.setItem(key, str);
29
+ break;
30
+ } catch(ex) {
31
+ window.localStorage.removeItem(window.localStorage.key(0));
32
+ }
33
+ }
34
+ },
35
+ get(key) {
36
+ return window.localStorage.getItem(key) ?? undefined;
37
+ },
38
+ },
39
+
40
+ handleModule(type, source, path, options) {
41
+ if ( type === '.json' )
42
+ return JSON.parse(source);
43
+ }
44
+ }
45
+
46
+ export default function(url) {
47
+ return loadModule(url, options)
48
+ }
@@ -28,6 +28,7 @@ import CustomComponentPlain from '../components/packages-web/CustomComponentPlai
28
28
  import QuestionFilled from '../components/icons/question-filled.vue'
29
29
  import { dispatchClickEvent, dispatchClickEvents, getTableConfig } from '../components/helper/eventOrchestration.js'
30
30
  import CmiFormItem from '../components/cmiFormItem'
31
+ import loadModule from './loadModule.js'
31
32
 
32
33
  // 解析配置中的defStyle属性
33
34
  export function parseDefStyle(defStyle) {
@@ -328,6 +329,9 @@ export function isPlainColumn(config, disabled) {
328
329
  }
329
330
 
330
331
  export function getComponentForConfig({config, disabled, getNativeComps}) {
332
+ if (config.isCustomComp) {
333
+ return () => loadModule(config.url)
334
+ }
331
335
  // 表格中中的列,是否需要转换为普通形式
332
336
  if (isPlainColumn(config, disabled)) {
333
337
  return CustomComponentPlain