@pisell/materials 1.0.2 → 1.0.3
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/es/components/auto-complete/index.d.ts +3 -0
- package/es/components/auto-complete/index.js +4 -0
- package/es/components/button/index.d.ts +3 -0
- package/es/components/button/index.js +15 -0
- package/es/components/calendar/index.d.ts +3 -0
- package/es/components/calendar/index.js +4 -0
- package/es/components/cascader/index.d.ts +3 -0
- package/es/components/cascader/index.js +4 -0
- package/es/components/checkbox/index.d.ts +3 -0
- package/es/components/checkbox/index.js +5 -0
- package/es/components/config-provider/index.d.ts +4 -0
- package/es/components/config-provider/index.js +30 -0
- package/es/components/date-picker/index.d.ts +3 -0
- package/es/components/date-picker/index.js +7 -0
- package/es/components/drawer/index.d.ts +2 -0
- package/es/components/drawer/index.js +13 -0
- package/es/components/dropdown/index.d.ts +3 -0
- package/es/components/dropdown/index.js +13 -0
- package/es/components/form/index.d.ts +8 -0
- package/es/components/form/index.js +132 -0
- package/es/components/icon/index.d.ts +12 -0
- package/es/components/icon/index.js +40 -0
- package/es/components/input/index.d.ts +3 -0
- package/es/components/input/index.js +12 -0
- package/es/components/modal/index.d.ts +2 -0
- package/es/components/modal/index.js +18 -0
- package/es/components/radio/index.d.ts +3 -0
- package/es/components/radio/index.js +5 -0
- package/es/components/select/index.d.ts +3 -0
- package/es/components/select/index.js +4 -0
- package/es/components/skeleton/index.d.ts +3 -0
- package/es/components/skeleton/index.js +5 -0
- package/es/components/slider/index.d.ts +3 -0
- package/es/components/slider/index.js +16 -0
- package/es/components/table/index.d.ts +3 -0
- package/es/components/table/index.js +12 -0
- package/es/components/tabs/index.d.ts +11 -0
- package/es/components/tabs/index.js +93 -0
- package/es/components/time-picker/index.d.ts +3 -0
- package/es/components/time-picker/index.js +4 -0
- package/es/components/tree-select/index.d.ts +2 -0
- package/es/components/tree-select/index.js +6 -0
- package/es/components/upload/index.d.ts +3 -0
- package/es/components/upload/index.js +4 -0
- package/{src/index.tsx → es/index.d.ts} +2 -80
- package/es/index.js +85 -0
- package/es/utils/hoc.d.ts +17 -0
- package/es/utils/hoc.js +80 -0
- package/es/utils/warning.d.ts +1 -0
- package/es/utils/warning.js +6 -0
- package/lib/components/auto-complete/index.d.ts +3 -0
- package/lib/components/auto-complete/index.js +28 -0
- package/lib/components/button/index.d.ts +3 -0
- package/lib/components/button/index.js +45 -0
- package/lib/components/calendar/index.d.ts +3 -0
- package/lib/components/calendar/index.js +32 -0
- package/lib/components/cascader/index.d.ts +3 -0
- package/lib/components/cascader/index.js +28 -0
- package/lib/components/checkbox/index.d.ts +3 -0
- package/lib/components/checkbox/index.js +29 -0
- package/lib/components/config-provider/index.d.ts +4 -0
- package/lib/components/config-provider/index.js +54 -0
- package/lib/components/date-picker/index.d.ts +3 -0
- package/lib/components/date-picker/index.js +41 -0
- package/lib/components/drawer/index.d.ts +2 -0
- package/lib/components/drawer/index.js +45 -0
- package/lib/components/dropdown/index.d.ts +3 -0
- package/lib/components/dropdown/index.js +45 -0
- package/lib/components/form/index.d.ts +8 -0
- package/lib/components/form/index.js +114 -0
- package/lib/components/icon/index.d.ts +12 -0
- package/lib/components/icon/index.js +52 -0
- package/lib/components/input/index.d.ts +3 -0
- package/lib/components/input/index.js +38 -0
- package/lib/components/modal/index.d.ts +2 -0
- package/lib/components/modal/index.js +50 -0
- package/lib/components/radio/index.d.ts +3 -0
- package/lib/components/radio/index.js +29 -0
- package/lib/components/select/index.d.ts +3 -0
- package/lib/components/select/index.js +28 -0
- package/lib/components/skeleton/index.d.ts +3 -0
- package/lib/components/skeleton/index.js +29 -0
- package/lib/components/slider/index.d.ts +3 -0
- package/lib/components/slider/index.js +47 -0
- package/lib/components/table/index.d.ts +3 -0
- package/lib/components/table/index.js +41 -0
- package/lib/components/tabs/index.d.ts +11 -0
- package/lib/components/tabs/index.js +92 -0
- package/lib/components/time-picker/index.d.ts +3 -0
- package/lib/components/time-picker/index.js +31 -0
- package/lib/components/tree-select/index.d.ts +2 -0
- package/lib/components/tree-select/index.js +40 -0
- package/lib/components/upload/index.d.ts +3 -0
- package/lib/components/upload/index.js +28 -0
- package/lib/index.d.ts +63 -0
- package/lib/index.js +225 -0
- package/lib/utils/hoc.d.ts +17 -0
- package/lib/utils/hoc.js +101 -0
- package/lib/utils/warning.d.ts +1 -0
- package/lib/utils/warning.js +31 -0
- package/package.json +10 -2
- package/.fatherrc.ts +0 -7
- package/.tmp/assets-daily.json +0 -93
- package/.tmp/assets-dev.json +0 -93
- package/.tmp/assets-prod.json +0 -93
- package/.tmp/default.view.js +0 -24
- package/.tmp/index.jsx +0 -279
- package/.tmp/meta.js +0 -251
- package/.tmp/preview.jsx +0 -72
- package/.tmp/view.js +0 -25
- package/CHANGELOG.md +0 -13
- package/build.lowcode.js +0 -46
- package/src/components/auto-complete/index.tsx +0 -6
- package/src/components/button/index.tsx +0 -12
- package/src/components/calendar/index.tsx +0 -10
- package/src/components/cascader/index.tsx +0 -6
- package/src/components/checkbox/index.tsx +0 -7
- package/src/components/config-provider/index.tsx +0 -27
- package/src/components/date-picker/index.tsx +0 -22
- package/src/components/drawer/index.tsx +0 -13
- package/src/components/dropdown/index.tsx +0 -13
- package/src/components/form/index.tsx +0 -97
- package/src/components/icon/index.tsx +0 -34
- package/src/components/input/index.tsx +0 -18
- package/src/components/modal/index.tsx +0 -18
- package/src/components/radio/index.tsx +0 -7
- package/src/components/select/index.tsx +0 -6
- package/src/components/skeleton/index.tsx +0 -6
- package/src/components/slider/index.tsx +0 -18
- package/src/components/table/index.tsx +0 -10
- package/src/components/tabs/index.tsx +0 -67
- package/src/components/time-picker/index.tsx +0 -9
- package/src/components/tree-select/index.tsx +0 -8
- package/src/components/upload/index.tsx +0 -5
- package/src/utils/hoc.tsx +0 -92
- package/src/utils/warning.ts +0 -3
- package/tsconfig.json +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"father": "^4.1.6",
|
|
6
6
|
"lodash": "^4.17.21",
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
|
+
"files": [
|
|
23
|
+
"es",
|
|
24
|
+
"lib",
|
|
25
|
+
"package.json",
|
|
26
|
+
"README.md",
|
|
27
|
+
"build",
|
|
28
|
+
"lowcode"
|
|
29
|
+
],
|
|
22
30
|
"dependencies": {
|
|
23
31
|
"antd": "^5.6.3",
|
|
24
32
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -34,7 +42,7 @@
|
|
|
34
42
|
"scripts": {
|
|
35
43
|
"build": "father build",
|
|
36
44
|
"dev": "father dev",
|
|
37
|
-
"lowcode:build": "build-scripts build --config ./build.lowcode.js",
|
|
45
|
+
"lowcode:build": "npm run build && build-scripts build --config ./build.lowcode.js",
|
|
38
46
|
"lowcode:dev": "build-scripts start --config ./build.lowcode.js"
|
|
39
47
|
}
|
|
40
48
|
}
|
package/.fatherrc.ts
DELETED
package/.tmp/assets-daily.json
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"packages": [
|
|
3
|
-
{
|
|
4
|
-
"package": "dayjs",
|
|
5
|
-
"version": "1.11.7",
|
|
6
|
-
"urls": "https://g.alicdn.com/code/lib/dayjs/1.11.7/dayjs.min.js",
|
|
7
|
-
"library": "dayjs"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"package": "iconfont-icons",
|
|
11
|
-
"urls": "//at.alicdn.com/t/font_2369445_ukrtsovd92r.js"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"package": "@ant-design/icons",
|
|
15
|
-
"version": "4.7.0",
|
|
16
|
-
"urls": [
|
|
17
|
-
"//g.alicdn.com/code/npm/@ali/ant-design-icons-cdn/4.5.0/index.umd.min.js"
|
|
18
|
-
],
|
|
19
|
-
"library": "icons"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"package": "antd",
|
|
23
|
-
"version": "5.6.2",
|
|
24
|
-
"urls": [
|
|
25
|
-
"https://g.alicdn.com/code/lib/antd/5.6.2/antd.min.js"
|
|
26
|
-
],
|
|
27
|
-
"library": "antd"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"package": "@pisell/materials",
|
|
31
|
-
"version": "1.0.1",
|
|
32
|
-
"library": "BaseMaterials",
|
|
33
|
-
"urls": [
|
|
34
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.js",
|
|
35
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.css"
|
|
36
|
-
],
|
|
37
|
-
"editUrls": [
|
|
38
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/view.js",
|
|
39
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/view.css"
|
|
40
|
-
],
|
|
41
|
-
"advancedUrls": {
|
|
42
|
-
"default": [
|
|
43
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.js",
|
|
44
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.css"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"advancedEditUrls": {}
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"components": [
|
|
51
|
-
{
|
|
52
|
-
"exportName": "PisellMaterialsMeta",
|
|
53
|
-
"npm": {
|
|
54
|
-
"package": "@pisell/materials",
|
|
55
|
-
"version": "1.0.1"
|
|
56
|
-
},
|
|
57
|
-
"url": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/meta.js",
|
|
58
|
-
"urls": {
|
|
59
|
-
"default": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/meta.js"
|
|
60
|
-
},
|
|
61
|
-
"advancedUrls": {
|
|
62
|
-
"default": [
|
|
63
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/meta.js"
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"sort": {
|
|
69
|
-
"groupList": [
|
|
70
|
-
"精选组件",
|
|
71
|
-
"原子组件"
|
|
72
|
-
],
|
|
73
|
-
"categoryList": [
|
|
74
|
-
"基础元素",
|
|
75
|
-
"布局容器类",
|
|
76
|
-
"表格类",
|
|
77
|
-
"表单详情类",
|
|
78
|
-
"帮助类",
|
|
79
|
-
"对话框类",
|
|
80
|
-
"业务类",
|
|
81
|
-
"通用",
|
|
82
|
-
"引导",
|
|
83
|
-
"信息输入",
|
|
84
|
-
"信息展示",
|
|
85
|
-
"信息反馈"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"groupList": [
|
|
89
|
-
"精选组件",
|
|
90
|
-
"原子组件"
|
|
91
|
-
],
|
|
92
|
-
"ignoreComponents": {}
|
|
93
|
-
}
|
package/.tmp/assets-dev.json
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"packages": [
|
|
3
|
-
{
|
|
4
|
-
"package": "dayjs",
|
|
5
|
-
"version": "1.11.7",
|
|
6
|
-
"urls": "https://g.alicdn.com/code/lib/dayjs/1.11.7/dayjs.min.js",
|
|
7
|
-
"library": "dayjs"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"package": "iconfont-icons",
|
|
11
|
-
"urls": "//at.alicdn.com/t/font_2369445_ukrtsovd92r.js"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"package": "@ant-design/icons",
|
|
15
|
-
"version": "4.7.0",
|
|
16
|
-
"urls": [
|
|
17
|
-
"//g.alicdn.com/code/npm/@ali/ant-design-icons-cdn/4.5.0/index.umd.min.js"
|
|
18
|
-
],
|
|
19
|
-
"library": "icons"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"package": "antd",
|
|
23
|
-
"version": "5.6.2",
|
|
24
|
-
"urls": [
|
|
25
|
-
"https://g.alicdn.com/code/lib/antd/5.6.2/antd.min.js"
|
|
26
|
-
],
|
|
27
|
-
"library": "antd"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"package": "@pisell/materials",
|
|
31
|
-
"version": "1.0.1",
|
|
32
|
-
"library": "BaseMaterials",
|
|
33
|
-
"urls": [
|
|
34
|
-
"./render/default/view.js",
|
|
35
|
-
"./render/default/view.css"
|
|
36
|
-
],
|
|
37
|
-
"editUrls": [
|
|
38
|
-
"./view.js",
|
|
39
|
-
"./view.css"
|
|
40
|
-
],
|
|
41
|
-
"advancedUrls": {
|
|
42
|
-
"default": [
|
|
43
|
-
"./render/default/view.js",
|
|
44
|
-
"./render/default/view.css"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"advancedEditUrls": {}
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"components": [
|
|
51
|
-
{
|
|
52
|
-
"exportName": "PisellMaterialsMeta",
|
|
53
|
-
"npm": {
|
|
54
|
-
"package": "@pisell/materials",
|
|
55
|
-
"version": "1.0.1"
|
|
56
|
-
},
|
|
57
|
-
"url": "./meta.js",
|
|
58
|
-
"urls": {
|
|
59
|
-
"default": "./meta.js"
|
|
60
|
-
},
|
|
61
|
-
"advancedUrls": {
|
|
62
|
-
"default": [
|
|
63
|
-
"./meta.js"
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"sort": {
|
|
69
|
-
"groupList": [
|
|
70
|
-
"精选组件",
|
|
71
|
-
"原子组件"
|
|
72
|
-
],
|
|
73
|
-
"categoryList": [
|
|
74
|
-
"基础元素",
|
|
75
|
-
"布局容器类",
|
|
76
|
-
"表格类",
|
|
77
|
-
"表单详情类",
|
|
78
|
-
"帮助类",
|
|
79
|
-
"对话框类",
|
|
80
|
-
"业务类",
|
|
81
|
-
"通用",
|
|
82
|
-
"引导",
|
|
83
|
-
"信息输入",
|
|
84
|
-
"信息展示",
|
|
85
|
-
"信息反馈"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"groupList": [
|
|
89
|
-
"精选组件",
|
|
90
|
-
"原子组件"
|
|
91
|
-
],
|
|
92
|
-
"ignoreComponents": {}
|
|
93
|
-
}
|
package/.tmp/assets-prod.json
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"packages": [
|
|
3
|
-
{
|
|
4
|
-
"package": "dayjs",
|
|
5
|
-
"version": "1.11.7",
|
|
6
|
-
"urls": "https://g.alicdn.com/code/lib/dayjs/1.11.7/dayjs.min.js",
|
|
7
|
-
"library": "dayjs"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"package": "iconfont-icons",
|
|
11
|
-
"urls": "//at.alicdn.com/t/font_2369445_ukrtsovd92r.js"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"package": "@ant-design/icons",
|
|
15
|
-
"version": "4.7.0",
|
|
16
|
-
"urls": [
|
|
17
|
-
"//g.alicdn.com/code/npm/@ali/ant-design-icons-cdn/4.5.0/index.umd.min.js"
|
|
18
|
-
],
|
|
19
|
-
"library": "icons"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"package": "antd",
|
|
23
|
-
"version": "5.6.2",
|
|
24
|
-
"urls": [
|
|
25
|
-
"https://g.alicdn.com/code/lib/antd/5.6.2/antd.min.js"
|
|
26
|
-
],
|
|
27
|
-
"library": "antd"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"package": "@pisell/materials",
|
|
31
|
-
"version": "1.0.1",
|
|
32
|
-
"library": "BaseMaterials",
|
|
33
|
-
"urls": [
|
|
34
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.js",
|
|
35
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.css"
|
|
36
|
-
],
|
|
37
|
-
"editUrls": [
|
|
38
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/view.js",
|
|
39
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/view.css"
|
|
40
|
-
],
|
|
41
|
-
"advancedUrls": {
|
|
42
|
-
"default": [
|
|
43
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.js",
|
|
44
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/render/default/view.css"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"advancedEditUrls": {}
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"components": [
|
|
51
|
-
{
|
|
52
|
-
"exportName": "PisellMaterialsMeta",
|
|
53
|
-
"npm": {
|
|
54
|
-
"package": "@pisell/materials",
|
|
55
|
-
"version": "1.0.1"
|
|
56
|
-
},
|
|
57
|
-
"url": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/meta.js",
|
|
58
|
-
"urls": {
|
|
59
|
-
"default": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/meta.js"
|
|
60
|
-
},
|
|
61
|
-
"advancedUrls": {
|
|
62
|
-
"default": [
|
|
63
|
-
"https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/meta.js"
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"sort": {
|
|
69
|
-
"groupList": [
|
|
70
|
-
"精选组件",
|
|
71
|
-
"原子组件"
|
|
72
|
-
],
|
|
73
|
-
"categoryList": [
|
|
74
|
-
"基础元素",
|
|
75
|
-
"布局容器类",
|
|
76
|
-
"表格类",
|
|
77
|
-
"表单详情类",
|
|
78
|
-
"帮助类",
|
|
79
|
-
"对话框类",
|
|
80
|
-
"业务类",
|
|
81
|
-
"通用",
|
|
82
|
-
"引导",
|
|
83
|
-
"信息输入",
|
|
84
|
-
"信息展示",
|
|
85
|
-
"信息反馈"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"groupList": [
|
|
89
|
-
"精选组件",
|
|
90
|
-
"原子组件"
|
|
91
|
-
],
|
|
92
|
-
"ignoreComponents": {}
|
|
93
|
-
}
|
package/.tmp/default.view.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { default } from '/Users/zuoshengjie/Desktop/project/pisell/packages/materials/src/index.tsx';
|
|
4
|
-
|
|
5
|
-
import * as componentInstances from '/Users/zuoshengjie/Desktop/project/pisell/packages/materials/src/index.tsx';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export * from '/Users/zuoshengjie/Desktop/project/pisell/packages/materials/src/index.tsx';
|
|
10
|
-
|
|
11
|
-
const coveredComponents = {};
|
|
12
|
-
|
|
13
|
-
const library = 'BaseMaterials';
|
|
14
|
-
const execCompile = !!true;
|
|
15
|
-
|
|
16
|
-
if (!execCompile) {
|
|
17
|
-
window[library] = Object.assign({__esModule: true}, componentInstances || {}, coveredComponents || {});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function getRealComponent(component, componentName) {
|
|
21
|
-
if (component.default) return component.default;
|
|
22
|
-
if (component[componentName]) return component[componentName];
|
|
23
|
-
return component;
|
|
24
|
-
}
|
package/.tmp/index.jsx
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import init, { editor, project, material, setters, config } from '@alifd/lowcode-preset-plugin';
|
|
2
|
-
import mergeWith from 'lodash/mergeWith';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const queryObject = new URLSearchParams(window.location.search);
|
|
6
|
-
const fullbackMeta = 'default' || '';
|
|
7
|
-
let platform = queryObject.get('platform') || '';
|
|
8
|
-
let metaType = queryObject.get('metaType') || platform || '';
|
|
9
|
-
const metaPathMap = {"meta":"/Users/zuoshengjie/Desktop/project/pisell/packages/materials/.tmp/meta.js"};
|
|
10
|
-
const key = metaType ? `meta.${metaType}` : 'meta';
|
|
11
|
-
if (!metaPathMap[key]) {
|
|
12
|
-
console.warn(`[@alifd/build-plugin-lowcode] metaType can only in [${Object.keys(metaPathMap)}], current metaType is ${key}, fullback to ${fullbackMeta || 'default'}.`);
|
|
13
|
-
metaType = fullbackMeta === 'default' ? '' : fullbackMeta;
|
|
14
|
-
}
|
|
15
|
-
const isNewEngineVersion = !!material;
|
|
16
|
-
const devMode = !!false;
|
|
17
|
-
const baseLibrary = 'react';
|
|
18
|
-
const basePackages = [
|
|
19
|
-
{
|
|
20
|
-
package: 'moment',
|
|
21
|
-
version: '2.24.0',
|
|
22
|
-
urls: ['https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js'],
|
|
23
|
-
library: 'moment',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
package: 'dayjs',
|
|
27
|
-
version: '1.11.7',
|
|
28
|
-
urls: ['https://g.alicdn.com/code/lib/dayjs/1.11.7/dayjs.min.js'],
|
|
29
|
-
library: 'dayjs',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
package: "lodash",
|
|
33
|
-
library: "_",
|
|
34
|
-
urls: [
|
|
35
|
-
"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js"
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
title: 'fusion组件库',
|
|
40
|
-
package: '@alifd/next',
|
|
41
|
-
version: '1.25.23',
|
|
42
|
-
urls: [
|
|
43
|
-
'https://g.alicdn.com/code/lib/alifd__next/1.25.23/next.min.css',
|
|
44
|
-
'https://g.alicdn.com/code/lib/alifd__next/1.25.23/next-with-locales.min.js',
|
|
45
|
-
],
|
|
46
|
-
library: 'Next',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
package: 'antd',
|
|
50
|
-
version: '5.6.2',
|
|
51
|
-
urls: [
|
|
52
|
-
'https://g.alicdn.com/code/lib/antd/5.6.2/antd.min.js',
|
|
53
|
-
],
|
|
54
|
-
library: 'antd',
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
if (baseLibrary === 'rax') {
|
|
59
|
-
basePackages.push({
|
|
60
|
-
title: 'meet',
|
|
61
|
-
package: '@alifd/meet',
|
|
62
|
-
version: 'meet@2.4.2-beta.6',
|
|
63
|
-
urls: [
|
|
64
|
-
'https://mc-fusion.alibaba-inc.com/unpkg/@alifd/meet@2.4.2-beta.6/umd/meet.lowcode.js',
|
|
65
|
-
'https://mc-fusion.alibaba-inc.com/unpkg/@alifd/meet@2.4.2-beta.6/umd/meet.min.css',
|
|
66
|
-
],
|
|
67
|
-
library: 'Meet',
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const assets = {
|
|
72
|
-
packages: []
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
let assetsName = './assets-dev.json';
|
|
76
|
-
|
|
77
|
-
const setterMap = {
|
|
78
|
-
};
|
|
79
|
-
const presetConfig = {};
|
|
80
|
-
const customPlugins = [];
|
|
81
|
-
|
|
82
|
-
const type = 'component';
|
|
83
|
-
|
|
84
|
-
if (devMode && type !== 'setter') {
|
|
85
|
-
assets.packages.push({
|
|
86
|
-
"package": "@pisell/materials",
|
|
87
|
-
"version": "1.0.1",
|
|
88
|
-
"library": "BaseMaterials",
|
|
89
|
-
"urls": ["build/lowcode/view.js","build/lowcode/view.css"],
|
|
90
|
-
"editUrls": ["build/lowcode/view.js","build/lowcode/view.css"],
|
|
91
|
-
"advancedUrls": {"default":["./render/default/view.js","./render/default/view.css"]},
|
|
92
|
-
});
|
|
93
|
-
assets.groupList = ["精选组件","原子组件"];
|
|
94
|
-
assets.sort = {
|
|
95
|
-
"groupList": ["精选组件","原子组件"],
|
|
96
|
-
"categoryList": ["基础元素","布局容器类","表格类","表单详情类","帮助类","对话框类","业务类","通用","引导","信息输入","信息展示","信息反馈"]
|
|
97
|
-
};
|
|
98
|
-
assets.ignoreComponents = {};
|
|
99
|
-
|
|
100
|
-
assets.components = [{
|
|
101
|
-
exportName: 'PisellMaterialsMeta',
|
|
102
|
-
url: metaType ? `/meta.${metaType}.js` : '/meta.js',
|
|
103
|
-
}];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const schema = getPageSchema() || {
|
|
107
|
-
componentName: 'Page',
|
|
108
|
-
id: 'node_dockcviv8fo1',
|
|
109
|
-
props: {
|
|
110
|
-
ref: 'outterView',
|
|
111
|
-
style: {
|
|
112
|
-
height: '100%',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
fileName: 'lowcode',
|
|
116
|
-
dataSource: {
|
|
117
|
-
list: [],
|
|
118
|
-
},
|
|
119
|
-
state: {
|
|
120
|
-
text: 'outter',
|
|
121
|
-
isShowDialog: false,
|
|
122
|
-
},
|
|
123
|
-
css: 'body {font-size: 12px;} .botton{width:100px;color:#ff00ff}',
|
|
124
|
-
lifeCycles: {
|
|
125
|
-
componentDidMount: {
|
|
126
|
-
type: 'JSFunction',
|
|
127
|
-
value: "function() {\n console.log('did mount');\n }",
|
|
128
|
-
},
|
|
129
|
-
componentWillUnmount: {
|
|
130
|
-
type: 'JSFunction',
|
|
131
|
-
value: "function() {\n console.log('will umount');\n }",
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
methods: {
|
|
135
|
-
testFunc: {
|
|
136
|
-
type: 'JSFunction',
|
|
137
|
-
value: "function() {\n console.log('test func');\n }",
|
|
138
|
-
},
|
|
139
|
-
onClick: {
|
|
140
|
-
type: 'JSFunction',
|
|
141
|
-
value: 'function() {\n this.setState({\n isShowDialog: true\n })\n }',
|
|
142
|
-
},
|
|
143
|
-
closeDialog: {
|
|
144
|
-
type: 'JSFunction',
|
|
145
|
-
value: 'function() {\n this.setState({\n isShowDialog: false\n })\n }',
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
children: [],
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const LCE_CONTAINER = document.getElementById('lce-container');
|
|
152
|
-
|
|
153
|
-
init(() => {
|
|
154
|
-
return {
|
|
155
|
-
name: 'editor-init',
|
|
156
|
-
async init() {
|
|
157
|
-
if (typeof setterMap === 'object' && Object.keys(setterMap).length) {
|
|
158
|
-
setters.registerSetter(setterMap);
|
|
159
|
-
}
|
|
160
|
-
if (!devMode) {
|
|
161
|
-
const devAssets = await (await fetch(assetsName)).json();
|
|
162
|
-
const packages = devAssets.packages;
|
|
163
|
-
assets.packages = assets.packages.concat(packages);
|
|
164
|
-
assets.components = devAssets.components.map(item => {
|
|
165
|
-
if (item.advancedUrls && metaType && item.advancedUrls[metaType] && item.advancedUrls[metaType].length) {
|
|
166
|
-
item.url = item.advancedUrls[metaType][0];
|
|
167
|
-
} else if (item.urls && metaType && item.urls[metaType]) {
|
|
168
|
-
item.url = item.urls[metaType];
|
|
169
|
-
}
|
|
170
|
-
return item;
|
|
171
|
-
});
|
|
172
|
-
assets.groupList = devAssets.groupList;
|
|
173
|
-
} else {
|
|
174
|
-
const extraAssets = false;
|
|
175
|
-
const builtinAssets = false;
|
|
176
|
-
extraAssets && await handleExtraAssets(assets, extraAssets);
|
|
177
|
-
builtinAssets && await handleExtraAssets(assets, builtinAssets);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Overwrite the same library in basePackages
|
|
181
|
-
const packagesMap = new Map();
|
|
182
|
-
const sortedKeys = [...new Set(
|
|
183
|
-
[...basePackages, ...assets.packages].map((item) => {
|
|
184
|
-
const { library } = item;
|
|
185
|
-
packagesMap.set(library, item);
|
|
186
|
-
return library;
|
|
187
|
-
})
|
|
188
|
-
)];
|
|
189
|
-
assets.packages = sortedKeys.map((key) => packagesMap.get(key));
|
|
190
|
-
|
|
191
|
-
assets.packages = assets.packages.map(item => {
|
|
192
|
-
if (item.editUrls && item.editUrls.length) {
|
|
193
|
-
item.renderUrls = item.urls;
|
|
194
|
-
item.urls = item.editUrls;
|
|
195
|
-
}
|
|
196
|
-
return item;
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
if (baseLibrary && baseLibrary === 'rax') {
|
|
200
|
-
if (isNewEngineVersion) {
|
|
201
|
-
config.set('renderEnv', 'rax');
|
|
202
|
-
config.set('simulatorUrl', undefined);
|
|
203
|
-
} else {
|
|
204
|
-
editor.set('renderEnv', 'rax');
|
|
205
|
-
project.onRendererReady(() => {
|
|
206
|
-
editor.get('designer').currentDocument.simulator._iframe.onload = () => {
|
|
207
|
-
editor.get('designer').currentDocument.simulator.set('device', 'phone');
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (isNewEngineVersion) {
|
|
214
|
-
material.setAssets(assets);
|
|
215
|
-
project.openDocument(schema);
|
|
216
|
-
} else {
|
|
217
|
-
editor.setAssets(assets);
|
|
218
|
-
project.open(schema);
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
}
|
|
222
|
-
}, customPlugins || [], LCE_CONTAINER, {
|
|
223
|
-
supportVariableGlobally: true,
|
|
224
|
-
presetConfig
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
function getPageSchema() {
|
|
228
|
-
const schema = JSON.parse(
|
|
229
|
-
window.localStorage.getItem('projectSchema') || '{}'
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
const pageSchema = schema?.componentsTree?.[0];
|
|
233
|
-
return pageSchema;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
async function handleExtraAssets(assets, extraAssets) {
|
|
237
|
-
if (extraAssets && Array.isArray(extraAssets) && extraAssets.length) {
|
|
238
|
-
const baseSchemas = await Promise.all(
|
|
239
|
-
extraAssets.map(async (url) => {
|
|
240
|
-
if (typeof url === 'object') {
|
|
241
|
-
return url;
|
|
242
|
-
} else {
|
|
243
|
-
try {
|
|
244
|
-
return (await fetch(url)).json();
|
|
245
|
-
} catch (e) {
|
|
246
|
-
console.error(`get assets data from builtin assets ${url} failed: `, e);
|
|
247
|
-
return {};
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
})
|
|
251
|
-
);
|
|
252
|
-
baseSchemas.forEach((item) => {
|
|
253
|
-
const _assets = {
|
|
254
|
-
...item,
|
|
255
|
-
packages: item.packages || [item.package],
|
|
256
|
-
components: item.components,
|
|
257
|
-
componentList: (item.componentList || []).map((comp) => {
|
|
258
|
-
if (comp.children) {
|
|
259
|
-
comp.children = comp.children.map((snippet) => {
|
|
260
|
-
if (!snippet.sort) {
|
|
261
|
-
snippet.sort = {
|
|
262
|
-
category: comp.title,
|
|
263
|
-
group: '原子组件',
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
return snippet;
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
return comp;
|
|
270
|
-
}),
|
|
271
|
-
};
|
|
272
|
-
mergeWith(assets, _assets, (objValue, srcValue) => {
|
|
273
|
-
if (Array.isArray(objValue) && Array.isArray(srcValue)) {
|
|
274
|
-
return srcValue.concat(objValue);
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
}
|