@byteluck-fe/model-driven-engine 2.7.0-alpha.15 → 2.7.0-alpha.16
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/dist/esm/common/ActionManager.js +40 -157
- package/dist/esm/common/DataManager.js +20 -129
- package/dist/esm/common/Engine.js +211 -338
- package/dist/esm/common/OkWorker.js +13 -27
- package/dist/esm/common/Runtime.js +11 -26
- package/dist/esm/common/Store.js +50 -51
- package/dist/esm/common/checkerValue.js +39 -39
- package/dist/esm/common/index.js +2 -2
- package/dist/esm/common/proxyState.js +47 -47
- package/dist/esm/index.js +3 -3
- package/dist/esm/plugins/CalcPlugin.js +59 -67
- package/dist/esm/plugins/ControlsEventPlugin.js +68 -191
- package/dist/esm/plugins/ES6ModulePlugin.js +8 -24
- package/dist/esm/plugins/LifecycleEventPlugin.js +64 -183
- package/dist/esm/plugins/StylePlugin.js +7 -22
- package/dist/esm/plugins/index.js +5 -5
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/runtimeUtils.js +7 -5
- package/dist/index.umd.js +10 -10
- package/dist/types/common/Engine.d.ts +6 -6
- package/dist/types/common/Runtime.d.ts +1 -1
- package/dist/types/common/Store.d.ts +5 -5
- package/dist/types/common/proxyState.d.ts +3 -3
- package/dist/types/plugins/ControlsEventPlugin.d.ts +1 -1
- package/dist/types/plugins/ES6ModulePlugin.d.ts +4 -4
- package/dist/types/plugins/LifecycleEventPlugin.d.ts +1 -1
- package/dist/types/plugins/StylePlugin.d.ts +1 -1
- package/package.json +4 -4
|
@@ -17,40 +17,25 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
-
function _defineProperty(obj, key, value) {
|
|
21
|
-
if (key in obj) {
|
|
22
|
-
Object.defineProperty(obj, key, {
|
|
23
|
-
value: value,
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
20
|
export var StylePlugin = /*#__PURE__*/ function() {
|
|
34
21
|
"use strict";
|
|
35
22
|
function StylePlugin(config) {
|
|
36
23
|
_classCallCheck(this, StylePlugin);
|
|
37
|
-
_defineProperty(this, "config", void 0);
|
|
38
|
-
_defineProperty(this, "engine", void 0);
|
|
39
24
|
this.config = config;
|
|
40
25
|
}
|
|
41
26
|
_createClass(StylePlugin, [
|
|
42
27
|
{
|
|
43
28
|
key: "apply",
|
|
44
29
|
value: function apply(engine) {
|
|
45
|
-
var
|
|
30
|
+
var ref;
|
|
46
31
|
this.engine = engine;
|
|
47
|
-
var
|
|
48
|
-
var compiledStyle = (
|
|
49
|
-
var style = document.createElement(
|
|
50
|
-
style.className =
|
|
51
|
-
style.type =
|
|
32
|
+
var ref1;
|
|
33
|
+
var compiledStyle = (ref1 = (ref = this.config) === null || ref === void 0 ? void 0 : ref.source) !== null && ref1 !== void 0 ? ref1 : '';
|
|
34
|
+
var style = document.createElement('style');
|
|
35
|
+
style.className = 'edit-css';
|
|
36
|
+
style.type = 'text/css';
|
|
52
37
|
style.innerHTML = compiledStyle;
|
|
53
|
-
var dom = document.querySelector(
|
|
38
|
+
var dom = document.querySelector('head');
|
|
54
39
|
dom.appendChild(style);
|
|
55
40
|
}
|
|
56
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './ES6ModulePlugin';
|
|
2
|
+
export * from './LifecycleEventPlugin';
|
|
3
|
+
export * from './ControlsEventPlugin';
|
|
4
|
+
export * from './CalcPlugin';
|
|
5
|
+
export * from './StylePlugin';
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './runtimeUtils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONTROL_BASE_TYPE, CONTROL_TYPE } from
|
|
1
|
+
import { CONTROL_BASE_TYPE, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
|
|
2
2
|
export function hasChildrenControl(instance) {
|
|
3
3
|
return instance.controlType === CONTROL_BASE_TYPE.LAYOUT || instance.controlType === CONTROL_BASE_TYPE.WRAP || instance.controlType === CONTROL_BASE_TYPE.LIST || instance.controlType === CONTROL_BASE_TYPE.SEARCH;
|
|
4
4
|
}
|
|
@@ -12,7 +12,8 @@ export function loopFormControl(control, callback) {
|
|
|
12
12
|
;
|
|
13
13
|
callback(item, children);
|
|
14
14
|
} else if (hasChildrenControl(item)) {
|
|
15
|
-
|
|
15
|
+
var ref;
|
|
16
|
+
loopFormControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
|
|
16
17
|
// @ts-ignore
|
|
17
18
|
} else if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
18
19
|
callback(item);
|
|
@@ -27,8 +28,9 @@ callback) {
|
|
|
27
28
|
if (item.type === CONTROL_TYPE.DATA_VIEW || item.type === CONTROL_TYPE.SIMPLE_SEARCH) {
|
|
28
29
|
callback(item);
|
|
29
30
|
} else if (hasChildrenControl(item)) {
|
|
31
|
+
var ref;
|
|
30
32
|
// @ts-ignore
|
|
31
|
-
loopDataViewControl(item === null ||
|
|
33
|
+
loopDataViewControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
|
|
32
34
|
}
|
|
33
35
|
});
|
|
34
36
|
}
|
|
@@ -36,9 +38,9 @@ callback) {
|
|
|
36
38
|
var unique = 0;
|
|
37
39
|
// uuid生成
|
|
38
40
|
export function buildUUID() {
|
|
39
|
-
var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
41
|
+
var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '';
|
|
40
42
|
var time = Date.now();
|
|
41
43
|
var random = Math.floor(Math.random() * 1000000000);
|
|
42
44
|
unique++;
|
|
43
|
-
return prefix +
|
|
45
|
+
return prefix + '_' + random + unique + String(time);
|
|
44
46
|
}
|