@zhubangyun/lowcode-core 5.12.91 → 5.12.161
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/es/components/load-materials/index.js +12 -12
- package/es/demo/index.js +8 -8
- package/es/utils/api/file-api.js +21 -21
- package/es/utils/api/form-api.d.ts +1 -1
- package/es/utils/api/form-api.js +38 -36
- package/es/utils/api/form-api.utils.js +5 -4
- package/es/utils/api/index.d.ts +1 -1
- package/es/utils/api/rest-api.js +116 -116
- package/es/utils/api/schema-api.js +5 -5
- package/es/utils/api/script-api.js +12 -12
- package/es/utils/api/user-info.js +7 -7
- package/es/utils/cache/index.js +14 -14
- package/es/utils/common/LoadPlugins.js +33 -33
- package/es/utils/common/SingletonInstanceMap.js +21 -21
- package/es/utils/designer/assets/assets.parse.js +15 -15
- package/es/utils/designer/assets/assets.typing.js +6 -0
- package/es/utils/designer/engine/index.js +23 -23
- package/es/utils/designer/index.js +7 -7
- package/es/utils/page/index.js +18 -18
- package/es/utils/page/page-form-data-manager-group.js +7 -4
- package/es/utils/page/page-form-data-manager.js +7 -4
- package/es/utils/page/page-form-group.js +6 -5
- package/es/utils/page/page-form.js +12 -11
- package/es/utils/page/page-layout.d.ts +2 -0
- package/es/utils/page/page-layout.js +14 -7
- package/es/utils/page/page-render.js +4 -4
- package/es/utils/page/page-show.js +3 -3
- package/es/utils/page/print-form.js +36 -36
- package/lib/components/load-materials/index.js +13 -14
- package/lib/demo/index.js +9 -10
- package/lib/index.js +1 -2
- package/lib/utils/api/file-api.js +21 -21
- package/lib/utils/api/form-api.d.ts +1 -1
- package/lib/utils/api/form-api.js +38 -36
- package/lib/utils/api/form-api.utils.js +5 -4
- package/lib/utils/api/index.d.ts +1 -1
- package/lib/utils/api/index.js +1 -2
- package/lib/utils/api/rest-api.js +116 -116
- package/lib/utils/api/schema-api.js +5 -5
- package/lib/utils/api/script-api.js +12 -12
- package/lib/utils/api/user-info.js +7 -7
- package/lib/utils/cache/index.js +14 -14
- package/lib/utils/common/LoadPlugins.js +33 -33
- package/lib/utils/common/SingletonInstanceMap.js +21 -21
- package/lib/utils/designer/assets/assets.parse.js +16 -17
- package/lib/utils/designer/assets/assets.typing.js +6 -0
- package/lib/utils/designer/engine/index.js +23 -23
- package/lib/utils/designer/index.js +7 -7
- package/lib/utils/index.js +1 -2
- package/lib/utils/page/index.js +18 -18
- package/lib/utils/page/page-form-data-manager-group.js +8 -6
- package/lib/utils/page/page-form-data-manager.js +8 -6
- package/lib/utils/page/page-form-group.js +7 -7
- package/lib/utils/page/page-form.js +13 -13
- package/lib/utils/page/page-layout.d.ts +2 -0
- package/lib/utils/page/page-layout.js +15 -9
- package/lib/utils/page/page-render.js +4 -4
- package/lib/utils/page/page-show.js +4 -5
- package/lib/utils/page/print-form.js +36 -36
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
function _createForOfIteratorHelperLoose(
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
6
|
var doc = document;
|
|
7
7
|
export function loadPlugins(_x) {
|
|
8
8
|
return _loadPlugins.apply(this, arguments);
|
|
9
9
|
}
|
|
10
10
|
function _loadPlugins() {
|
|
11
|
-
_loadPlugins = _asyncToGenerator(
|
|
11
|
+
_loadPlugins = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(plugins) {
|
|
12
12
|
var _iterator, _step, plugin, _iterator2, _step2, _plugin;
|
|
13
|
-
return _regeneratorRuntime.wrap(function
|
|
13
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
14
14
|
while (1) switch (_context.prev = _context.next) {
|
|
15
15
|
case 0:
|
|
16
16
|
_iterator = _createForOfIteratorHelperLoose(plugins);
|
|
17
17
|
case 1:
|
|
18
18
|
if ((_step = _iterator()).done) {
|
|
19
|
-
_context.next =
|
|
19
|
+
_context.next = 3;
|
|
20
20
|
break;
|
|
21
21
|
}
|
|
22
22
|
plugin = _step.value;
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 2;
|
|
24
24
|
return loadStyle(plugin);
|
|
25
|
-
case
|
|
25
|
+
case 2:
|
|
26
26
|
_context.next = 1;
|
|
27
27
|
break;
|
|
28
|
-
case
|
|
28
|
+
case 3:
|
|
29
29
|
_iterator2 = _createForOfIteratorHelperLoose(plugins);
|
|
30
|
-
case
|
|
30
|
+
case 4:
|
|
31
31
|
if ((_step2 = _iterator2()).done) {
|
|
32
|
-
_context.next =
|
|
32
|
+
_context.next = 6;
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
_plugin = _step2.value;
|
|
36
|
-
_context.next =
|
|
36
|
+
_context.next = 5;
|
|
37
37
|
return loadScript(_plugin);
|
|
38
|
-
case
|
|
39
|
-
_context.next =
|
|
38
|
+
case 5:
|
|
39
|
+
_context.next = 4;
|
|
40
40
|
break;
|
|
41
|
-
case
|
|
41
|
+
case 6:
|
|
42
42
|
case "end":
|
|
43
43
|
return _context.stop();
|
|
44
44
|
}
|
|
@@ -50,20 +50,20 @@ function loadStyle(_x2) {
|
|
|
50
50
|
return _loadStyle.apply(this, arguments);
|
|
51
51
|
}
|
|
52
52
|
function _loadStyle() {
|
|
53
|
-
_loadStyle = _asyncToGenerator(
|
|
54
|
-
return _regeneratorRuntime.wrap(function
|
|
53
|
+
_loadStyle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(src) {
|
|
54
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
55
55
|
while (1) switch (_context3.prev = _context3.next) {
|
|
56
56
|
case 0:
|
|
57
57
|
if (src.endsWith("css")) {
|
|
58
|
-
_context3.next =
|
|
58
|
+
_context3.next = 1;
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
return _context3.abrupt("return", true);
|
|
62
|
-
case
|
|
63
|
-
return _context3.abrupt("return", new Promise(
|
|
64
|
-
var _ref = _asyncToGenerator(
|
|
62
|
+
case 1:
|
|
63
|
+
return _context3.abrupt("return", new Promise(/*#__PURE__*/function () {
|
|
64
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve) {
|
|
65
65
|
var callback, target;
|
|
66
|
-
return _regeneratorRuntime.wrap(function
|
|
66
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
67
67
|
while (1) switch (_context2.prev = _context2.next) {
|
|
68
68
|
case 0:
|
|
69
69
|
callback = function _callback(status) {
|
|
@@ -87,7 +87,7 @@ function _loadStyle() {
|
|
|
87
87
|
} else {
|
|
88
88
|
callback(true);
|
|
89
89
|
}
|
|
90
|
-
case
|
|
90
|
+
case 1:
|
|
91
91
|
case "end":
|
|
92
92
|
return _context2.stop();
|
|
93
93
|
}
|
|
@@ -97,7 +97,7 @@ function _loadStyle() {
|
|
|
97
97
|
return _ref.apply(this, arguments);
|
|
98
98
|
};
|
|
99
99
|
}()));
|
|
100
|
-
case
|
|
100
|
+
case 2:
|
|
101
101
|
case "end":
|
|
102
102
|
return _context3.stop();
|
|
103
103
|
}
|
|
@@ -109,20 +109,20 @@ function loadScript(_x3) {
|
|
|
109
109
|
return _loadScript.apply(this, arguments);
|
|
110
110
|
}
|
|
111
111
|
function _loadScript() {
|
|
112
|
-
_loadScript = _asyncToGenerator(
|
|
113
|
-
return _regeneratorRuntime.wrap(function
|
|
112
|
+
_loadScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(src) {
|
|
113
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
114
114
|
while (1) switch (_context5.prev = _context5.next) {
|
|
115
115
|
case 0:
|
|
116
116
|
if (src.endsWith("js")) {
|
|
117
|
-
_context5.next =
|
|
117
|
+
_context5.next = 1;
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
return _context5.abrupt("return", true);
|
|
121
|
-
case
|
|
122
|
-
return _context5.abrupt("return", new Promise(
|
|
123
|
-
var _ref2 = _asyncToGenerator(
|
|
121
|
+
case 1:
|
|
122
|
+
return _context5.abrupt("return", new Promise(/*#__PURE__*/function () {
|
|
123
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(resolve, reject) {
|
|
124
124
|
var callback, target;
|
|
125
|
-
return _regeneratorRuntime.wrap(function
|
|
125
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
126
126
|
while (1) switch (_context4.prev = _context4.next) {
|
|
127
127
|
case 0:
|
|
128
128
|
callback = function _callback2(status) {
|
|
@@ -148,7 +148,7 @@ function _loadScript() {
|
|
|
148
148
|
} else {
|
|
149
149
|
callback(true);
|
|
150
150
|
}
|
|
151
|
-
case
|
|
151
|
+
case 1:
|
|
152
152
|
case "end":
|
|
153
153
|
return _context4.stop();
|
|
154
154
|
}
|
|
@@ -158,7 +158,7 @@ function _loadScript() {
|
|
|
158
158
|
return _ref2.apply(this, arguments);
|
|
159
159
|
};
|
|
160
160
|
}()));
|
|
161
|
-
case
|
|
161
|
+
case 2:
|
|
162
162
|
case "end":
|
|
163
163
|
return _context5.stop();
|
|
164
164
|
}
|
|
@@ -7,25 +7,25 @@ export var SingletonInstanceMap = /*#__PURE__*/function () {
|
|
|
7
7
|
}
|
|
8
8
|
var _proto = SingletonInstanceMap.prototype;
|
|
9
9
|
_proto.getInstance = /*#__PURE__*/function () {
|
|
10
|
-
var _getInstance = _asyncToGenerator(
|
|
11
|
-
var self, value;
|
|
12
|
-
return _regeneratorRuntime.wrap(function
|
|
10
|
+
var _getInstance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(key, options) {
|
|
11
|
+
var self, value, _t;
|
|
12
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
13
13
|
while (1) switch (_context2.prev = _context2.next) {
|
|
14
14
|
case 0:
|
|
15
15
|
self = this;
|
|
16
16
|
if (!this.valueMap.has(key)) {
|
|
17
|
-
_context2.next =
|
|
17
|
+
_context2.next = 1;
|
|
18
18
|
break;
|
|
19
19
|
}
|
|
20
20
|
return _context2.abrupt("return", Promise.resolve(this.valueMap.get(key)));
|
|
21
|
-
case
|
|
21
|
+
case 1:
|
|
22
22
|
if (!this.lockMap.get(key)) {
|
|
23
|
-
_context2.next =
|
|
23
|
+
_context2.next = 2;
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
27
|
-
setTimeout(
|
|
28
|
-
return _regeneratorRuntime.wrap(function
|
|
27
|
+
setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
28
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
31
31
|
resolve(self.getInstance(key, options));
|
|
@@ -36,29 +36,29 @@ export var SingletonInstanceMap = /*#__PURE__*/function () {
|
|
|
36
36
|
}, _callee);
|
|
37
37
|
})), 500);
|
|
38
38
|
}));
|
|
39
|
-
case
|
|
40
|
-
_context2.prev =
|
|
39
|
+
case 2:
|
|
40
|
+
_context2.prev = 2;
|
|
41
41
|
this.lockMap.set(key, true);
|
|
42
|
-
_context2.next =
|
|
42
|
+
_context2.next = 3;
|
|
43
43
|
return this.createInstance(key, options);
|
|
44
|
-
case
|
|
44
|
+
case 3:
|
|
45
45
|
value = _context2.sent;
|
|
46
46
|
this.valueMap.set(key, value);
|
|
47
47
|
this.lockMap.set(key, false);
|
|
48
48
|
return _context2.abrupt("return", Promise.resolve(value));
|
|
49
|
-
case
|
|
50
|
-
_context2.prev =
|
|
51
|
-
|
|
52
|
-
throw
|
|
53
|
-
case
|
|
54
|
-
_context2.prev =
|
|
49
|
+
case 4:
|
|
50
|
+
_context2.prev = 4;
|
|
51
|
+
_t = _context2["catch"](2);
|
|
52
|
+
throw _t;
|
|
53
|
+
case 5:
|
|
54
|
+
_context2.prev = 5;
|
|
55
55
|
this.lockMap.set(key, false);
|
|
56
|
-
return _context2.finish(
|
|
57
|
-
case
|
|
56
|
+
return _context2.finish(5);
|
|
57
|
+
case 6:
|
|
58
58
|
case "end":
|
|
59
59
|
return _context2.stop();
|
|
60
60
|
}
|
|
61
|
-
}, _callee2, this, [[
|
|
61
|
+
}, _callee2, this, [[2, 4, 5, 6]]);
|
|
62
62
|
}));
|
|
63
63
|
function getInstance(_x, _x2) {
|
|
64
64
|
return _getInstance.apply(this, arguments);
|
|
@@ -26,9 +26,9 @@ export function assetsParse(_x) {
|
|
|
26
26
|
return _assetsParse.apply(this, arguments);
|
|
27
27
|
}
|
|
28
28
|
function _assetsParse() {
|
|
29
|
-
_assetsParse = _asyncToGenerator(
|
|
29
|
+
_assetsParse = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(assets) {
|
|
30
30
|
var rawComponents, packages, libraryAsset, libraryMap, packagesMap, assetLoader, newComponents, componentDescriptions, remoteComponentDescriptions, lowcodeComponentsArray, proCodeComponentsMap, genLowCodeComponentsMap, components, lowCodeComponents;
|
|
31
|
-
return _regeneratorRuntime.wrap(function
|
|
31
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
32
32
|
while (1) switch (_context2.prev = _context2.next) {
|
|
33
33
|
case 0:
|
|
34
34
|
genLowCodeComponentsMap = function _genLowCodeComponents(components) {
|
|
@@ -62,12 +62,12 @@ function _assetsParse() {
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
assetLoader = new AssetLoader();
|
|
65
|
-
_context2.next =
|
|
65
|
+
_context2.next = 1;
|
|
66
66
|
return assetLoader.load(libraryAsset);
|
|
67
|
-
case
|
|
67
|
+
case 1:
|
|
68
68
|
newComponents = rawComponents;
|
|
69
69
|
if (!(rawComponents && rawComponents.length)) {
|
|
70
|
-
_context2.next =
|
|
70
|
+
_context2.next = 2;
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
componentDescriptions = [];
|
|
@@ -85,14 +85,14 @@ function _assetsParse() {
|
|
|
85
85
|
newComponents = [].concat(componentDescriptions);
|
|
86
86
|
// 如果有远程组件描述协议,则自动加载并补充到资产包中,同时出发 designer.incrementalAssetsReady 通知组件面板更新数据
|
|
87
87
|
if (!(remoteComponentDescriptions && remoteComponentDescriptions.length)) {
|
|
88
|
-
_context2.next =
|
|
88
|
+
_context2.next = 2;
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
|
-
_context2.next =
|
|
92
|
-
return Promise.all(remoteComponentDescriptions.map(
|
|
93
|
-
var _ref = _asyncToGenerator(
|
|
91
|
+
_context2.next = 2;
|
|
92
|
+
return Promise.all(remoteComponentDescriptions.map(/*#__PURE__*/function () {
|
|
93
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(component) {
|
|
94
94
|
var exportName, url, npm, setAssetsComponent, setArrayAssets;
|
|
95
|
-
return _regeneratorRuntime.wrap(function
|
|
95
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
96
96
|
while (1) switch (_context.prev = _context.next) {
|
|
97
97
|
case 0:
|
|
98
98
|
setArrayAssets = function _setArrayAssets(value, preExportName, preSubName) {
|
|
@@ -134,9 +134,9 @@ function _assetsParse() {
|
|
|
134
134
|
// assets.componentList = assets.componentList.concat(component.componentList || []);
|
|
135
135
|
};
|
|
136
136
|
exportName = component.exportName, url = component.url, npm = component.npm;
|
|
137
|
-
_context.next =
|
|
137
|
+
_context.next = 1;
|
|
138
138
|
return new AssetLoader().load(url);
|
|
139
|
-
case
|
|
139
|
+
case 1:
|
|
140
140
|
if (window[exportName]) {
|
|
141
141
|
if (Array.isArray(window[exportName])) {
|
|
142
142
|
setArrayAssets(window[exportName]);
|
|
@@ -145,7 +145,7 @@ function _assetsParse() {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
return _context.abrupt("return", window[exportName]);
|
|
148
|
-
case
|
|
148
|
+
case 2:
|
|
149
149
|
case "end":
|
|
150
150
|
return _context.stop();
|
|
151
151
|
}
|
|
@@ -155,7 +155,7 @@ function _assetsParse() {
|
|
|
155
155
|
return _ref.apply(this, arguments);
|
|
156
156
|
};
|
|
157
157
|
}()));
|
|
158
|
-
case
|
|
158
|
+
case 2:
|
|
159
159
|
lowcodeComponentsArray = [];
|
|
160
160
|
proCodeComponentsMap = newComponents.reduce(function (acc, cur) {
|
|
161
161
|
if ((cur.devMode || '').toLowerCase() === 'lowcode') {
|
|
@@ -174,7 +174,7 @@ function _assetsParse() {
|
|
|
174
174
|
return _context2.abrupt("return", {
|
|
175
175
|
components: _extends({}, components, lowCodeComponents)
|
|
176
176
|
});
|
|
177
|
-
case
|
|
177
|
+
case 3:
|
|
178
178
|
case "end":
|
|
179
179
|
return _context2.stop();
|
|
180
180
|
}
|
|
@@ -15,28 +15,28 @@ export var Engine = function Engine() {
|
|
|
15
15
|
* 注入资产
|
|
16
16
|
*/
|
|
17
17
|
this.injectAssets = /*#__PURE__*/function () {
|
|
18
|
-
var _ref = _asyncToGenerator(
|
|
18
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(types) {
|
|
19
19
|
var assetsData, asserts, _yield$assetsParse, components;
|
|
20
|
-
return _regeneratorRuntime.wrap(function
|
|
20
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
22
22
|
case 0:
|
|
23
23
|
_this.assets.addDefaultAssets(types);
|
|
24
24
|
assetsData = _this.assets.data; // @ts-ignore
|
|
25
|
-
_context.next =
|
|
25
|
+
_context.next = 1;
|
|
26
26
|
return _this._engine.injectAssets(assetsData);
|
|
27
|
-
case
|
|
27
|
+
case 1:
|
|
28
28
|
asserts = _context.sent;
|
|
29
|
-
_context.next =
|
|
29
|
+
_context.next = 2;
|
|
30
30
|
return _this._engine.material.setAssets(asserts);
|
|
31
|
-
case
|
|
32
|
-
_context.next =
|
|
31
|
+
case 2:
|
|
32
|
+
_context.next = 3;
|
|
33
33
|
return assetsParse(assetsData);
|
|
34
|
-
case
|
|
34
|
+
case 3:
|
|
35
35
|
_yield$assetsParse = _context.sent;
|
|
36
36
|
components = _yield$assetsParse.components;
|
|
37
37
|
// @ts-ignore
|
|
38
38
|
window.components = components;
|
|
39
|
-
case
|
|
39
|
+
case 4:
|
|
40
40
|
case "end":
|
|
41
41
|
return _context.stop();
|
|
42
42
|
}
|
|
@@ -47,8 +47,8 @@ export var Engine = function Engine() {
|
|
|
47
47
|
};
|
|
48
48
|
}();
|
|
49
49
|
this.loadIncrementalAssets = /*#__PURE__*/function () {
|
|
50
|
-
var _ref2 = _asyncToGenerator(
|
|
51
|
-
return _regeneratorRuntime.wrap(function
|
|
50
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(incrementalAssets) {
|
|
51
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
52
52
|
while (1) switch (_context2.prev = _context2.next) {
|
|
53
53
|
case 0:
|
|
54
54
|
return _context2.abrupt("return", _this.material.loadIncrementalAssets(incrementalAssets));
|
|
@@ -63,8 +63,8 @@ export var Engine = function Engine() {
|
|
|
63
63
|
};
|
|
64
64
|
}();
|
|
65
65
|
this.registerPlugin = /*#__PURE__*/function () {
|
|
66
|
-
var _ref3 = _asyncToGenerator(
|
|
67
|
-
return _regeneratorRuntime.wrap(function
|
|
66
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(pluginModel, options, registerOptions) {
|
|
67
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
68
68
|
while (1) switch (_context3.prev = _context3.next) {
|
|
69
69
|
case 0:
|
|
70
70
|
return _context3.abrupt("return", _this.plugins.register(pluginModel, options, registerOptions));
|
|
@@ -84,11 +84,11 @@ export var Engine = function Engine() {
|
|
|
84
84
|
* @param schema
|
|
85
85
|
*/
|
|
86
86
|
this.init = /*#__PURE__*/function () {
|
|
87
|
-
var _ref4 = _asyncToGenerator(
|
|
88
|
-
return _regeneratorRuntime.wrap(function
|
|
87
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(container, schema) {
|
|
88
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
89
89
|
while (1) switch (_context4.prev = _context4.next) {
|
|
90
90
|
case 0:
|
|
91
|
-
_context4.next =
|
|
91
|
+
_context4.next = 1;
|
|
92
92
|
return _this._engine.init(container, {
|
|
93
93
|
designMode: "design",
|
|
94
94
|
enableCondition: true,
|
|
@@ -98,14 +98,14 @@ export var Engine = function Engine() {
|
|
|
98
98
|
fetch: createFetchHandler()
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
case
|
|
101
|
+
case 1:
|
|
102
102
|
if (!schema) {
|
|
103
|
-
_context4.next =
|
|
103
|
+
_context4.next = 2;
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
|
-
_context4.next =
|
|
106
|
+
_context4.next = 2;
|
|
107
107
|
return _this.openDocument(schema);
|
|
108
|
-
case
|
|
108
|
+
case 2:
|
|
109
109
|
case "end":
|
|
110
110
|
return _context4.stop();
|
|
111
111
|
}
|
|
@@ -116,15 +116,15 @@ export var Engine = function Engine() {
|
|
|
116
116
|
};
|
|
117
117
|
}();
|
|
118
118
|
this.openDocument = /*#__PURE__*/function () {
|
|
119
|
-
var _ref5 = _asyncToGenerator(
|
|
120
|
-
return _regeneratorRuntime.wrap(function
|
|
119
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(schema) {
|
|
120
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
121
121
|
while (1) switch (_context5.prev = _context5.next) {
|
|
122
122
|
case 0:
|
|
123
123
|
if (schema === void 0) {
|
|
124
124
|
schema = {};
|
|
125
125
|
}
|
|
126
126
|
_this._engine.project.openDocument(schema);
|
|
127
|
-
case
|
|
127
|
+
case 1:
|
|
128
128
|
case "end":
|
|
129
129
|
return _context5.stop();
|
|
130
130
|
}
|
|
@@ -7,26 +7,26 @@ export function initEngine() {
|
|
|
7
7
|
return _initEngine.apply(this, arguments);
|
|
8
8
|
}
|
|
9
9
|
function _initEngine() {
|
|
10
|
-
_initEngine = _asyncToGenerator(
|
|
10
|
+
_initEngine = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
11
11
|
var _window$AntdProMateri, _window$AntdProMateri2;
|
|
12
|
-
return _regeneratorRuntime.wrap(function
|
|
12
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
13
13
|
while (1) switch (_context.prev = _context.next) {
|
|
14
14
|
case 0:
|
|
15
|
-
_context.next =
|
|
15
|
+
_context.next = 1;
|
|
16
16
|
return loadPlugins(["next.min.js", "variables.css", "next.var.min.css",
|
|
17
17
|
/* "react.production.min.js",
|
|
18
18
|
"react-dom.production.min.js",*/
|
|
19
19
|
"prop-types.js", "react15-polyfill.js", "lodash.min.js", "moment.min.js", "engine-core.css", "engine-core.js", "engine-ext.js", "engine-ext.css", "index.css", "index.js"].map(function (uri) {
|
|
20
20
|
return "https://cdn.zhiyunhe.com/lowcode/designer/" + uri;
|
|
21
21
|
}));
|
|
22
|
-
case
|
|
23
|
-
_context.next =
|
|
22
|
+
case 1:
|
|
23
|
+
_context.next = 2;
|
|
24
24
|
return loadPlugins(["https://cdn.zhiyunhe.com/plugin/dayjs/dayjs.min.js", "https://cdn.zhiyunhe.com/plugin/antd/latest/reset.css", "https://cdn.zhiyunhe.com/plugin/antd/latest/antd.min.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd-pro/view.css", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd-pro/view.js"]);
|
|
25
|
-
case
|
|
25
|
+
case 2:
|
|
26
26
|
//注册setter
|
|
27
27
|
(_window$AntdProMateri = window.AntdProMaterial) === null || _window$AntdProMateri === void 0 ? void 0 : (_window$AntdProMateri2 = _window$AntdProMateri.registerSetters) === null || _window$AntdProMateri2 === void 0 ? void 0 : _window$AntdProMateri2.call(_window$AntdProMateri);
|
|
28
28
|
return _context.abrupt("return", new Engine());
|
|
29
|
-
case
|
|
29
|
+
case 3:
|
|
30
30
|
case "end":
|
|
31
31
|
return _context.stop();
|
|
32
32
|
}
|
package/es/utils/page/index.js
CHANGED
|
@@ -22,9 +22,9 @@ export function showLoading() {
|
|
|
22
22
|
return _showLoading.apply(this, arguments);
|
|
23
23
|
}
|
|
24
24
|
function _showLoading() {
|
|
25
|
-
_showLoading = _asyncToGenerator(
|
|
25
|
+
_showLoading = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
26
26
|
var loading, div;
|
|
27
|
-
return _regeneratorRuntime.wrap(function
|
|
27
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
30
|
loading = document.getElementById("fullscreen-loading");
|
|
@@ -36,7 +36,7 @@ function _showLoading() {
|
|
|
36
36
|
div.innerHTML = "\n <div class=\"atom-spinner\">\n <div class=\"spinner-inner\">\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-circle\"></div>\n </div>\n </div>\n ";
|
|
37
37
|
document.body.appendChild(div);
|
|
38
38
|
}
|
|
39
|
-
case
|
|
39
|
+
case 1:
|
|
40
40
|
case "end":
|
|
41
41
|
return _context.stop();
|
|
42
42
|
}
|
|
@@ -48,16 +48,16 @@ export function hideLoading() {
|
|
|
48
48
|
return _hideLoading.apply(this, arguments);
|
|
49
49
|
}
|
|
50
50
|
function _hideLoading() {
|
|
51
|
-
_hideLoading = _asyncToGenerator(
|
|
51
|
+
_hideLoading = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
52
52
|
var loading;
|
|
53
|
-
return _regeneratorRuntime.wrap(function
|
|
53
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
54
54
|
while (1) switch (_context2.prev = _context2.next) {
|
|
55
55
|
case 0:
|
|
56
56
|
loading = document.getElementById("fullscreen-loading");
|
|
57
57
|
if (loading) {
|
|
58
58
|
loading.style.display = "none";
|
|
59
59
|
}
|
|
60
|
-
case
|
|
60
|
+
case 1:
|
|
61
61
|
case "end":
|
|
62
62
|
return _context2.stop();
|
|
63
63
|
}
|
|
@@ -69,33 +69,33 @@ export function openPage(_x, _x2) {
|
|
|
69
69
|
return _openPage.apply(this, arguments);
|
|
70
70
|
}
|
|
71
71
|
function _openPage() {
|
|
72
|
-
_openPage = _asyncToGenerator(
|
|
72
|
+
_openPage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url, target) {
|
|
73
73
|
var _window$parent;
|
|
74
74
|
var page, func;
|
|
75
|
-
return _regeneratorRuntime.wrap(function
|
|
75
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
76
76
|
while (1) switch (_context3.prev = _context3.next) {
|
|
77
77
|
case 0:
|
|
78
78
|
// @ts-ignore
|
|
79
79
|
func = (_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.openWorkPlatformTab;
|
|
80
80
|
if (!func) {
|
|
81
|
-
_context3.next =
|
|
81
|
+
_context3.next = 2;
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
|
-
_context3.next =
|
|
84
|
+
_context3.next = 1;
|
|
85
85
|
return func({
|
|
86
86
|
value: target,
|
|
87
87
|
url: url
|
|
88
88
|
});
|
|
89
|
-
case
|
|
89
|
+
case 1:
|
|
90
90
|
page = _context3.sent;
|
|
91
|
-
_context3.next =
|
|
91
|
+
_context3.next = 3;
|
|
92
92
|
break;
|
|
93
|
-
case
|
|
93
|
+
case 2:
|
|
94
94
|
page = window.open(url, target);
|
|
95
|
-
case
|
|
95
|
+
case 3:
|
|
96
96
|
console.debug("openPage", page, target);
|
|
97
97
|
return _context3.abrupt("return", page);
|
|
98
|
-
case
|
|
98
|
+
case 4:
|
|
99
99
|
case "end":
|
|
100
100
|
return _context3.stop();
|
|
101
101
|
}
|
|
@@ -107,10 +107,10 @@ export function closePage(_x3, _x4) {
|
|
|
107
107
|
return _closePage.apply(this, arguments);
|
|
108
108
|
}
|
|
109
109
|
function _closePage() {
|
|
110
|
-
_closePage = _asyncToGenerator(
|
|
110
|
+
_closePage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, target) {
|
|
111
111
|
var _window$parent2;
|
|
112
112
|
var func;
|
|
113
|
-
return _regeneratorRuntime.wrap(function
|
|
113
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
114
114
|
while (1) switch (_context4.prev = _context4.next) {
|
|
115
115
|
case 0:
|
|
116
116
|
// @ts-ignore
|
|
@@ -123,7 +123,7 @@ function _closePage() {
|
|
|
123
123
|
} else {
|
|
124
124
|
window.close();
|
|
125
125
|
}
|
|
126
|
-
case
|
|
126
|
+
case 1:
|
|
127
127
|
case "end":
|
|
128
128
|
return _context4.stop();
|
|
129
129
|
}
|
|
@@ -14,9 +14,9 @@ export function showFormDataManagerGroup(_x) {
|
|
|
14
14
|
return _showFormDataManagerGroup.apply(this, arguments);
|
|
15
15
|
}
|
|
16
16
|
function _showFormDataManagerGroup() {
|
|
17
|
-
_showFormDataManagerGroup = _asyncToGenerator(
|
|
17
|
+
_showFormDataManagerGroup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
18
18
|
var container, onClose, props;
|
|
19
|
-
return _regeneratorRuntime.wrap(function
|
|
19
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
20
20
|
while (1) switch (_context.prev = _context.next) {
|
|
21
21
|
case 0:
|
|
22
22
|
container = options.container, onClose = options.onClose, props = _objectWithoutPropertiesLoose(options, _excluded2);
|
|
@@ -28,7 +28,7 @@ function _showFormDataManagerGroup() {
|
|
|
28
28
|
props: props
|
|
29
29
|
}
|
|
30
30
|
}));
|
|
31
|
-
case
|
|
31
|
+
case 1:
|
|
32
32
|
case "end":
|
|
33
33
|
return _context.stop();
|
|
34
34
|
}
|
|
@@ -72,9 +72,12 @@ var FormDataManagerRender = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
onSelectOk === null || onSelectOk === void 0 ? void 0 : onSelectOk(data);
|
|
73
73
|
};
|
|
74
74
|
return /*#__PURE__*/React.createElement(PageLayout, {
|
|
75
|
-
layout: layout,
|
|
76
75
|
ref: function ref(layout) {
|
|
77
76
|
return _this2.layoutRef = layout;
|
|
77
|
+
},
|
|
78
|
+
layout: layout,
|
|
79
|
+
onClose: function onClose() {
|
|
80
|
+
onSelectOk === null || onSelectOk === void 0 ? void 0 : onSelectOk(undefined);
|
|
78
81
|
}
|
|
79
82
|
}, /*#__PURE__*/React.createElement(ReactRender, _extends({}, restProps, {
|
|
80
83
|
components: window._components || window.components || window.__components,
|
|
@@ -16,9 +16,9 @@ export function showFormDataManager(_x) {
|
|
|
16
16
|
return _showFormDataManager.apply(this, arguments);
|
|
17
17
|
}
|
|
18
18
|
function _showFormDataManager() {
|
|
19
|
-
_showFormDataManager = _asyncToGenerator(
|
|
19
|
+
_showFormDataManager = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
20
20
|
var container, onClose, props;
|
|
21
|
-
return _regeneratorRuntime.wrap(function
|
|
21
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
24
|
container = options.container, onClose = options.onClose, props = _objectWithoutPropertiesLoose(options, _excluded2);
|
|
@@ -30,7 +30,7 @@ function _showFormDataManager() {
|
|
|
30
30
|
props: props
|
|
31
31
|
}
|
|
32
32
|
}));
|
|
33
|
-
case
|
|
33
|
+
case 1:
|
|
34
34
|
case "end":
|
|
35
35
|
return _context.stop();
|
|
36
36
|
}
|
|
@@ -75,9 +75,12 @@ var FormDataManagerRender = /*#__PURE__*/function (_Component) {
|
|
|
75
75
|
};
|
|
76
76
|
var dataView = cloneDataView(this.props.dataView, this.props.extraProps);
|
|
77
77
|
return /*#__PURE__*/React.createElement(PageLayout, {
|
|
78
|
-
layout: layout,
|
|
79
78
|
ref: function ref(layout) {
|
|
80
79
|
return _this2.layoutRef = layout;
|
|
80
|
+
},
|
|
81
|
+
layout: layout,
|
|
82
|
+
onClose: function onClose() {
|
|
83
|
+
onSelectOk === null || onSelectOk === void 0 ? void 0 : onSelectOk(undefined);
|
|
81
84
|
}
|
|
82
85
|
}, /*#__PURE__*/React.createElement(PageLoadSchema, {
|
|
83
86
|
pageId: form === null || form === void 0 ? void 0 : form.id
|