@byteluck-fe/model-driven-engine 7.0.0-beta.4 → 7.0.0-beta.6
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 +12 -15
- package/dist/esm/common/DataManager.js +13 -16
- package/dist/esm/common/Engine.js +23 -26
- package/dist/esm/common/Store.js +7 -6
- package/dist/esm/common/checkerValue.js +6 -6
- package/dist/esm/common/proxyState.js +3 -3
- package/dist/esm/plugins/CalcPlugin.js +6 -5
- package/dist/esm/plugins/ControlsEventPlugin.js +30 -28
- package/dist/esm/plugins/LifecycleEventPlugin.js +30 -27
- package/dist/esm/plugins/StylePlugin.js +2 -2
- package/dist/index.umd.js +27 -27
- package/package.json +2 -2
|
@@ -106,7 +106,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
106
106
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
107
107
|
}
|
|
108
108
|
function _ts_generator(thisArg, body) {
|
|
109
|
-
var f, y, t, _ = {
|
|
109
|
+
var f, y, t, g, _ = {
|
|
110
110
|
label: 0,
|
|
111
111
|
sent: function() {
|
|
112
112
|
if (t[0] & 1) throw t[1];
|
|
@@ -114,17 +114,13 @@ function _ts_generator(thisArg, body) {
|
|
|
114
114
|
},
|
|
115
115
|
trys: [],
|
|
116
116
|
ops: []
|
|
117
|
-
}
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
125
|
-
value: function() {
|
|
126
|
-
return this;
|
|
127
|
-
}
|
|
117
|
+
};
|
|
118
|
+
return g = {
|
|
119
|
+
next: verb(0),
|
|
120
|
+
"throw": verb(1),
|
|
121
|
+
"return": verb(2)
|
|
122
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
123
|
+
return this;
|
|
128
124
|
}), g;
|
|
129
125
|
function verb(n) {
|
|
130
126
|
return function(v) {
|
|
@@ -136,7 +132,7 @@ function _ts_generator(thisArg, body) {
|
|
|
136
132
|
}
|
|
137
133
|
function step(op) {
|
|
138
134
|
if (f) throw new TypeError("Generator is already executing.");
|
|
139
|
-
while(
|
|
135
|
+
while(_)try {
|
|
140
136
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
141
137
|
if (y = 0, t) op = [
|
|
142
138
|
op[0] & 2,
|
|
@@ -227,15 +223,16 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
227
223
|
this.engine = engine;
|
|
228
224
|
Object.entries(LifecycleEventKeyMap).forEach(function(param) {
|
|
229
225
|
var _param = _sliced_to_array(param, 2), engineKey = _param[0], lifecycleKey = _param[1];
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
var _this1 = _this;
|
|
227
|
+
engine.on(engineKey, /*#__PURE__*/ function() {
|
|
228
|
+
var _ref = _async_to_generator(function(payload) {
|
|
232
229
|
var result;
|
|
233
230
|
return _ts_generator(this, function(_state) {
|
|
234
231
|
switch(_state.label){
|
|
235
232
|
case 0:
|
|
236
233
|
return [
|
|
237
234
|
4,
|
|
238
|
-
|
|
235
|
+
_this1.callLifecycleEvent(lifecycleKey, payload)
|
|
239
236
|
];
|
|
240
237
|
case 1:
|
|
241
238
|
result = _state.sent();
|
|
@@ -255,21 +252,24 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
255
252
|
];
|
|
256
253
|
}
|
|
257
254
|
});
|
|
258
|
-
})
|
|
259
|
-
|
|
255
|
+
});
|
|
256
|
+
return function(payload) {
|
|
257
|
+
return _ref.apply(this, arguments);
|
|
258
|
+
};
|
|
259
|
+
}());
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
key: "callLifecycleEvent",
|
|
265
265
|
value: function callLifecycleEvent(name, payload) {
|
|
266
|
+
var _this = this;
|
|
266
267
|
return _async_to_generator(function() {
|
|
267
|
-
var
|
|
268
|
+
var events, result;
|
|
268
269
|
return _ts_generator(this, function(_state) {
|
|
269
270
|
switch(_state.label){
|
|
270
271
|
case 0:
|
|
271
|
-
|
|
272
|
-
events = this.config;
|
|
272
|
+
events = _this.config;
|
|
273
273
|
if (!events || !Array.isArray(events[name])) {
|
|
274
274
|
return [
|
|
275
275
|
2,
|
|
@@ -278,15 +278,15 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
278
278
|
}
|
|
279
279
|
return [
|
|
280
280
|
4,
|
|
281
|
-
Promise.all(events[name].map(function(
|
|
282
|
-
|
|
281
|
+
Promise.all(events[name].map(/*#__PURE__*/ function() {
|
|
282
|
+
var _ref = _async_to_generator(function(eventName) {
|
|
283
283
|
var execResult;
|
|
284
284
|
return _ts_generator(this, function(_state) {
|
|
285
285
|
switch(_state.label){
|
|
286
286
|
case 0:
|
|
287
287
|
return [
|
|
288
288
|
4,
|
|
289
|
-
|
|
289
|
+
_this.engine.getAction().execAction(eventName, //qiyu 注释掉的两个参数变为全局参数
|
|
290
290
|
// this.engine,
|
|
291
291
|
// this.engine.getAction().actionUtils, //以前是params,空的
|
|
292
292
|
payload)
|
|
@@ -299,8 +299,11 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
299
299
|
];
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
|
-
})
|
|
303
|
-
|
|
302
|
+
});
|
|
303
|
+
return function(eventName) {
|
|
304
|
+
return _ref.apply(this, arguments);
|
|
305
|
+
};
|
|
306
|
+
}()))
|
|
304
307
|
];
|
|
305
308
|
case 1:
|
|
306
309
|
result = _state.sent();
|
|
@@ -310,7 +313,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
310
313
|
];
|
|
311
314
|
}
|
|
312
315
|
});
|
|
313
|
-
})
|
|
316
|
+
})();
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
319
|
]);
|
|
@@ -54,10 +54,10 @@ export var StylePlugin = /*#__PURE__*/ function() {
|
|
|
54
54
|
{
|
|
55
55
|
key: "apply",
|
|
56
56
|
value: function apply(engine) {
|
|
57
|
-
var _ref;
|
|
58
57
|
var _this_config;
|
|
59
58
|
this.engine = engine;
|
|
60
|
-
var
|
|
59
|
+
var _this_config_source;
|
|
60
|
+
var compiledStyle = (_this_config_source = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.source) !== null && _this_config_source !== void 0 ? _this_config_source : '';
|
|
61
61
|
var style = document.createElement('style');
|
|
62
62
|
style.className = 'edit-css-' + engine.id;
|
|
63
63
|
var dom = document.querySelector('head');
|