@byteluck-fe/model-driven-engine 2.8.1-beta.18 → 2.8.1-beta.19

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/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # Engine
2
- 运行态引擎
3
-
4
- ```
5
- │ index.ts // 入口文件
6
-
7
- ├─common // 引擎相关
8
- │ ActionManager.ts // utils操作管理
9
- │ checkerValue.ts // 表单值校验器
10
- │ DataManager.ts // 数据源容器
11
- │ Engine.ts // 引擎
12
- │ index.ts // 入口
13
- │ OkWorker.ts // 无用
14
- │ Plugin.ts // 插件
15
- │ proxyState.ts // 劫持引擎表单数据
16
- │ Runtime.ts // 控件注册和创建
17
- │ Store.ts // 数据管理
18
-
19
- ├─plugins
20
- │ CalcPlugin.ts // 计算公式插件
21
- │ ControlsEventPlugin.ts // 控件二开事件插件
22
- │ ES6ModulePlugin.ts //
23
- │ index.ts
24
- │ LifecycleEventPlugin.ts // 页面生命周期事件
25
- │ StylePlugin.ts // css二开
26
-
27
- └─utils
28
- index.ts
29
- runtimeUtils.ts // 工具函数
30
- ```
1
+ # Engine
2
+ 运行态引擎
3
+
4
+ ```
5
+ │ index.ts // 入口文件
6
+
7
+ ├─common // 引擎相关
8
+ │ ActionManager.ts // utils操作管理
9
+ │ checkerValue.ts // 表单值校验器
10
+ │ DataManager.ts // 数据源容器
11
+ │ Engine.ts // 引擎
12
+ │ index.ts // 入口
13
+ │ OkWorker.ts // 无用
14
+ │ Plugin.ts // 插件
15
+ │ proxyState.ts // 劫持引擎表单数据
16
+ │ Runtime.ts // 控件注册和创建
17
+ │ Store.ts // 数据管理
18
+
19
+ ├─plugins
20
+ │ CalcPlugin.ts // 计算公式插件
21
+ │ ControlsEventPlugin.ts // 控件二开事件插件
22
+ │ ES6ModulePlugin.ts //
23
+ │ index.ts
24
+ │ LifecycleEventPlugin.ts // 页面生命周期事件
25
+ │ StylePlugin.ts // css二开
26
+
27
+ └─utils
28
+ index.ts
29
+ runtimeUtils.ts // 工具函数
30
+ ```
@@ -186,11 +186,11 @@ export var ActionManager = /*#__PURE__*/ function() {
186
186
  _class_call_check(this, ActionManager);
187
187
  _define_property(this, "actionMap", new Map());
188
188
  _define_property(this, "buildinActions", {});
189
- /**
190
- * 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
189
+ /**
190
+ * 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
191
191
  */ _define_property(this, "actionUtils", {});
192
- /**
193
- * 用于存储es module解析出来的源码,CustomVueControlPlugin
192
+ /**
193
+ * 用于存储es module解析出来的源码,CustomVueControlPlugin
194
194
  */ _define_property(this, "sources", {});
195
195
  }
196
196
  _create_class(ActionManager, [
@@ -301,8 +301,8 @@ function loop(control, parentId, callback) {
301
301
  function hasHeaderOrFooterControl(control, checkType) {
302
302
  return checkType in control.props && isArray(control.props[checkType]);
303
303
  }
304
- /**
305
- * 控件是否在视图中隐藏,遍历查找所有parent
304
+ /**
305
+ * 控件是否在视图中隐藏,遍历查找所有parent
306
306
  * */ function getControlIsHide(control) {
307
307
  if (control.props.isHide) {
308
308
  return true;
@@ -101,11 +101,11 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
101
101
  }
102
102
  }
103
103
  }
104
- /**
105
- * 返回proxy操作对象
106
- * @param thisKey 当前对象在上级中的key
107
- * @param callback 需要在修改的时候,触发的回调函数
108
- * @param beforeSetCallback 需要在修改之前触发的回调函数,可以进行校验和对值的修改等等,最终的返回值不为undefined就会使用
104
+ /**
105
+ * 返回proxy操作对象
106
+ * @param thisKey 当前对象在上级中的key
107
+ * @param callback 需要在修改的时候,触发的回调函数
108
+ * @param beforeSetCallback 需要在修改之前触发的回调函数,可以进行校验和对值的修改等等,最终的返回值不为undefined就会使用
109
109
  * */ function handler(thisKey, callback, beforeSetCallback) {
110
110
  return {
111
111
  __engineProxy__: true,
@@ -179,12 +179,12 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
179
179
  }
180
180
  };
181
181
  }
182
- /**
183
- * 代理state数据
184
- * @param state 数据对象
185
- * @param callback 触发set时候的回调函数
186
- * @param beforeSetCallback
187
- * @param prevKey 递归对象的key
182
+ /**
183
+ * 代理state数据
184
+ * @param state 数据对象
185
+ * @param callback 触发set时候的回调函数
186
+ * @param beforeSetCallback
187
+ * @param prevKey 递归对象的key
188
188
  * */ export function proxyState(state, callback, beforeSetCallback) {
189
189
  var prevKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
190
190
  // 冻结的对象不需要再执行proxy,否则会报错
@@ -212,10 +212,10 @@ function flatInstanceForChildren(controls) {
212
212
  });
213
213
  return result;
214
214
  }
215
- /**
216
- * 在flatInstance中通过key查找出对应的instance
217
- * @param flatInstance 拍平的instance数组
218
- * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
215
+ /**
216
+ * 在flatInstance中通过key查找出对应的instance
217
+ * @param flatInstance 拍平的instance数组
218
+ * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
219
219
  * */ export function findItem(flatInstance, key, instanceMap) {
220
220
  if (key === "") return undefined;
221
221
  var keys = key.split(".");
@@ -272,9 +272,9 @@ function getArrayNewArgs(type, args, value) {
272
272
  return args.slice(0, 2).concat(value);
273
273
  }
274
274
  }
275
- /**
276
- * TODO 数组劫持操作需要模仿vue3进行重构,不再直接劫持原生property
277
- * 劫持数组api,达到操作数组api的时候,可以同步操作instance
275
+ /**
276
+ * TODO 数组劫持操作需要模仿vue3进行重构,不再直接劫持原生property
277
+ * 劫持数组api,达到操作数组api的时候,可以同步操作instance
278
278
  * */ function hijackArrayProperty() {
279
279
  proxyArrayApi.forEach(function(key) {
280
280
  var oldApiHandler = Array.prototype[key];
@@ -98,6 +98,10 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
98
98
  if (!action) {
99
99
  return;
100
100
  }
101
+ var res = parseModule(action, engine, this.env);
102
+ if (!res) {
103
+ return;
104
+ }
101
105
  var actionManager = engine.getAction();
102
106
  if (this.eventJs) {
103
107
  this.eventJs.exportsFun({
@@ -125,13 +129,13 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
125
129
  }
126
130
  }
127
131
  } else {
128
- var res = parseModule(action, engine, this.env);
129
- if (!res) {
132
+ var res1 = parseModule(action, engine, this.env);
133
+ if (!res1) {
130
134
  return;
131
135
  }
132
136
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
133
137
  try {
134
- for(var _iterator1 = Object.entries(res.funcMap)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
138
+ for(var _iterator1 = Object.entries(res1.funcMap)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
135
139
  var _step_value1 = _sliced_to_array(_step1.value, 2), key1 = _step_value1[0], value1 = _step_value1[1];
136
140
  actionManager.addAction(key1, value1);
137
141
  }
@@ -1,10 +1,4 @@
1
- /*
2
- * @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
3
- * @Date: 2022-04-15 14:06:03
4
- * @LastEditors: zhaoxiaoyang zhaoxiaoyang@byteluck.com
5
- * @LastEditTime: 2023-11-30 16:38:47
6
- * @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
7
- */ function _class_call_check(instance, Constructor) {
1
+ function _class_call_check(instance, Constructor) {
8
2
  if (!(instance instanceof Constructor)) {
9
3
  throw new TypeError("Cannot call a class as a function");
10
4
  }