@cloudbase/framework-plugin-low-code 0.7.0 → 0.7.2-beta.1
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/lib/builder/config/common.js +1 -1
- package/lib/builder/config/index.js +2 -2
- package/lib/builder/config/mp.js +1 -1
- package/lib/builder/core/copy.js +3 -3
- package/lib/builder/core/generate.js +11 -11
- package/lib/builder/core/index.js +13 -13
- package/lib/builder/core/material.js +6 -6
- package/lib/builder/core/plugin.js +3 -3
- package/lib/builder/core/prepare.js +2 -2
- package/lib/builder/core/webpack.js +5 -5
- package/lib/builder/mp/index.d.ts.map +1 -1
- package/lib/builder/mp/index.js +50 -49
- package/lib/builder/mp/lowcode.js +4 -4
- package/lib/builder/mp/materials.js +16 -16
- package/lib/builder/mp/mixMode.js +12 -12
- package/lib/builder/mp/mp_config.js +11 -11
- package/lib/builder/mp/util.js +6 -6
- package/lib/builder/mp/wxml.js +4 -4
- package/lib/builder/service/builder/copy.js +11 -11
- package/lib/builder/service/builder/generate.js +56 -52
- package/lib/builder/service/builder/index.js +2 -2
- package/lib/builder/service/builder/plugin.js +2 -2
- package/lib/builder/service/builder/webpack.js +24 -23
- package/lib/builder/types/common.js +1 -0
- package/lib/builder/util/common.d.ts.map +1 -1
- package/lib/builder/util/common.js +8 -6
- package/lib/builder/util/console.js +1 -1
- package/lib/builder/util/generateFiles.js +2 -2
- package/lib/builder/util/index.js +1 -1
- package/lib/builder/util/junk.js +4 -2
- package/lib/builder/util/mp.js +1 -1
- package/lib/builder/util/net.js +1 -1
- package/lib/builder/util/style.js +1 -1
- package/lib/builder/util/weapp.js +1 -1
- package/lib/generate.js +2 -2
- package/lib/generator/config/index.js +2 -2
- package/lib/generator/core/generate.js +36 -34
- package/lib/generator/core/index.js +4 -4
- package/lib/generator/core/material.js +14 -14
- package/lib/generator/types/common.js +6 -3
- package/lib/generator/util/common.d.ts.map +1 -1
- package/lib/generator/util/common.js +1 -1
- package/lib/generator/util/index.js +1 -1
- package/lib/generator/util/style.js +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +104 -66
- package/lib/utils/common.d.ts +1 -1
- package/lib/utils/common.d.ts.map +1 -1
- package/lib/utils/common.js +2 -2
- package/lib/utils/dataSource.js +2 -2
- package/lib/utils/index.js +1 -1
- package/lib/utils/postProcess.js +3 -3
- package/lib/weapps-core/config/index.js +1 -1
- package/lib/weapps-core/index.js +2 -2
- package/lib/weapps-core/types/index.js +1 -1
- package/lib/weapps-core/utils/appbuild.js +6 -3
- package/lib/weapps-core/utils/common.js +3 -2
- package/lib/weapps-core/utils/formily.js +37 -37
- package/lib/weapps-core/utils/index.js +1 -1
- package/lib/weapps-core/utils/style.js +15 -15
- package/package.json +1 -1
- package/template/html/index.html.ejs +1 -1
- package/template/mp/app/weapps-api.js +16 -6
- package/template/mp/app.js +59 -48
- package/template/mp/common/util.js +52 -4
- package/template/mp/common/weapp-page.js +16 -3
- package/template/mp/package.json +2 -2
- package/template/mp/page/index.js +3 -1
- package/template/package.json +2 -2
- package/template/src/app/global-api.js +20 -5
- package/template/src/handlers/FieldMiddleware/renderer.jsx +411 -321
- package/template/src/handlers/render.jsx +114 -97
- package/template/src/handlers/utils/common.js +28 -22
- package/template/src/index.jsx +3 -2
- package/template/src/pages/app.tpl +26 -25
- package/template/src/utils/formatEnum.js +42 -0
|
@@ -5,6 +5,7 @@ import store, { subPackageName } from '../store';
|
|
|
5
5
|
import computed from '../store/computed';
|
|
6
6
|
import common from './common';
|
|
7
7
|
import { formatDate } from '../utils/date';
|
|
8
|
+
import { formatEnum, enumOptions } from '../utils/formatEnum';
|
|
8
9
|
import { getter, setter, _isMobile } from '../utils';
|
|
9
10
|
import actionMap from './material-actions';
|
|
10
11
|
import { scanCodeApi } from '../utils/scan-code-action';
|
|
@@ -16,6 +17,9 @@ export const app = createGlboalApi();
|
|
|
16
17
|
export const $page = createPageApi();
|
|
17
18
|
|
|
18
19
|
export function setCurrentPage(pageCtx) {
|
|
20
|
+
try {
|
|
21
|
+
app.__internal__.activePage = pageCtx
|
|
22
|
+
} catch(e) { }
|
|
19
23
|
Object.assign($page, pageCtx);
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -24,6 +28,12 @@ function createGlboalApi() {
|
|
|
24
28
|
id: '<%= appId %>',
|
|
25
29
|
domain: '<%= domain %>',
|
|
26
30
|
platform: 'WEB',
|
|
31
|
+
__internal__: {
|
|
32
|
+
activePage: null,
|
|
33
|
+
getConfig: function () {
|
|
34
|
+
return <%= appConfig %>;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
27
37
|
formActions: {},
|
|
28
38
|
pages: {},
|
|
29
39
|
session: {
|
|
@@ -31,12 +41,13 @@ function createGlboalApi() {
|
|
|
31
41
|
request: sdk.request,
|
|
32
42
|
getSessionId: sdk.getSessionId,
|
|
33
43
|
},
|
|
44
|
+
enumOptions: enumOptions,
|
|
34
45
|
state: store,
|
|
35
46
|
computed: createComputed(computed.global),
|
|
36
47
|
common,
|
|
37
48
|
dataSources: DS_SDK,
|
|
38
49
|
relaunchHome: function () {
|
|
39
|
-
const { pages = [] } = globalAPI.
|
|
50
|
+
const { pages = [] } = globalAPI.__internal__.getConfig();
|
|
40
51
|
if (pages[0]) {
|
|
41
52
|
globalAPI.reLaunch({
|
|
42
53
|
pageId: pages[0].id,
|
|
@@ -45,15 +56,19 @@ function createGlboalApi() {
|
|
|
45
56
|
},
|
|
46
57
|
utils: {
|
|
47
58
|
formatDate,
|
|
59
|
+
formatEnum,
|
|
48
60
|
get: getter,
|
|
49
61
|
set: setter,
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
*/
|
|
65
|
+
_getConfig(){
|
|
66
|
+
return globalAPI.__internal__.getConfig()
|
|
52
67
|
},
|
|
53
|
-
getWXContext: function() {
|
|
68
|
+
getWXContext: function () {
|
|
54
69
|
return Promise.resolve({})
|
|
55
70
|
},
|
|
56
|
-
getCurrentPage: function(){
|
|
71
|
+
getCurrentPage: function () {
|
|
57
72
|
return $page
|
|
58
73
|
},
|
|
59
74
|
},
|