@byteluck-fe/model-driven-engine 7.0.0-beta.6 → 7.0.0-beta.8
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 +15 -12
- package/dist/esm/common/DataManager.js +16 -13
- package/dist/esm/common/Engine.js +25 -21
- package/dist/esm/common/Store.js +6 -7
- package/dist/esm/common/checkerValue.js +6 -6
- package/dist/esm/common/proxyState.js +3 -3
- package/dist/esm/plugins/CalcPlugin.js +5 -6
- package/dist/esm/plugins/ControlsEventPlugin.js +28 -30
- package/dist/esm/plugins/LifecycleEventPlugin.js +27 -30
- package/dist/esm/plugins/StylePlugin.js +2 -2
- package/dist/index.umd.js +27 -27
- package/package.json +3 -3
|
@@ -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, _ = {
|
|
110
110
|
label: 0,
|
|
111
111
|
sent: function() {
|
|
112
112
|
if (t[0] & 1) throw t[1];
|
|
@@ -114,13 +114,17 @@ function _ts_generator(thisArg, body) {
|
|
|
114
114
|
},
|
|
115
115
|
trys: [],
|
|
116
116
|
ops: []
|
|
117
|
-
};
|
|
118
|
-
return g
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
117
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
118
|
+
return d(g, "next", {
|
|
119
|
+
value: verb(0)
|
|
120
|
+
}), d(g, "throw", {
|
|
121
|
+
value: verb(1)
|
|
122
|
+
}), d(g, "return", {
|
|
123
|
+
value: verb(2)
|
|
124
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
125
|
+
value: function() {
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
124
128
|
}), g;
|
|
125
129
|
function verb(n) {
|
|
126
130
|
return function(v) {
|
|
@@ -132,7 +136,7 @@ function _ts_generator(thisArg, body) {
|
|
|
132
136
|
}
|
|
133
137
|
function step(op) {
|
|
134
138
|
if (f) throw new TypeError("Generator is already executing.");
|
|
135
|
-
while(_)try {
|
|
139
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
136
140
|
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;
|
|
137
141
|
if (y = 0, t) op = [
|
|
138
142
|
op[0] & 2,
|
|
@@ -223,16 +227,15 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
223
227
|
this.engine = engine;
|
|
224
228
|
Object.entries(LifecycleEventKeyMap).forEach(function(param) {
|
|
225
229
|
var _param = _sliced_to_array(param, 2), engineKey = _param[0], lifecycleKey = _param[1];
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
var _ref = _async_to_generator(function(payload) {
|
|
230
|
+
engine.on(engineKey, function(payload) {
|
|
231
|
+
return _async_to_generator(function() {
|
|
229
232
|
var result;
|
|
230
233
|
return _ts_generator(this, function(_state) {
|
|
231
234
|
switch(_state.label){
|
|
232
235
|
case 0:
|
|
233
236
|
return [
|
|
234
237
|
4,
|
|
235
|
-
|
|
238
|
+
this.callLifecycleEvent(lifecycleKey, payload)
|
|
236
239
|
];
|
|
237
240
|
case 1:
|
|
238
241
|
result = _state.sent();
|
|
@@ -252,24 +255,21 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
252
255
|
];
|
|
253
256
|
}
|
|
254
257
|
});
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
return _ref.apply(this, arguments);
|
|
258
|
-
};
|
|
259
|
-
}());
|
|
258
|
+
}).call(_this);
|
|
259
|
+
});
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
key: "callLifecycleEvent",
|
|
265
265
|
value: function callLifecycleEvent(name, payload) {
|
|
266
|
-
var _this = this;
|
|
267
266
|
return _async_to_generator(function() {
|
|
268
|
-
var events, result;
|
|
267
|
+
var _this, events, result;
|
|
269
268
|
return _ts_generator(this, function(_state) {
|
|
270
269
|
switch(_state.label){
|
|
271
270
|
case 0:
|
|
272
|
-
|
|
271
|
+
_this = this;
|
|
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(
|
|
282
|
-
|
|
281
|
+
Promise.all(events[name].map(function(eventName) {
|
|
282
|
+
return _async_to_generator(function() {
|
|
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,11 +299,8 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
299
299
|
];
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
return _ref.apply(this, arguments);
|
|
305
|
-
};
|
|
306
|
-
}()))
|
|
302
|
+
}).call(_this);
|
|
303
|
+
}))
|
|
307
304
|
];
|
|
308
305
|
case 1:
|
|
309
306
|
result = _state.sent();
|
|
@@ -313,7 +310,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
313
310
|
];
|
|
314
311
|
}
|
|
315
312
|
});
|
|
316
|
-
})();
|
|
313
|
+
}).call(this);
|
|
317
314
|
}
|
|
318
315
|
}
|
|
319
316
|
]);
|
|
@@ -54,10 +54,10 @@ export var StylePlugin = /*#__PURE__*/ function() {
|
|
|
54
54
|
{
|
|
55
55
|
key: "apply",
|
|
56
56
|
value: function apply(engine) {
|
|
57
|
+
var _ref;
|
|
57
58
|
var _this_config;
|
|
58
59
|
this.engine = engine;
|
|
59
|
-
var
|
|
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 : '';
|
|
60
|
+
var compiledStyle = (_ref = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.source) !== null && _ref !== void 0 ? _ref : '';
|
|
61
61
|
var style = document.createElement('style');
|
|
62
62
|
style.className = 'edit-css-' + engine.id;
|
|
63
63
|
var dom = document.querySelector('head');
|