@byteluck-fe/model-driven-engine 5.3.0-1-beta4 → 5.3.1-3-zt
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.
|
@@ -182,11 +182,11 @@ export var ActionManager = /*#__PURE__*/ function() {
|
|
|
182
182
|
_class_call_check(this, ActionManager);
|
|
183
183
|
_define_property(this, "actionMap", new Map());
|
|
184
184
|
_define_property(this, "buildinActions", {});
|
|
185
|
-
/**
|
|
186
|
-
* 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
|
|
185
|
+
/**
|
|
186
|
+
* 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
|
|
187
187
|
*/ _define_property(this, "actionUtils", {});
|
|
188
|
-
/**
|
|
189
|
-
* 用于存储es module解析出来的源码,CustomVueControlPlugin
|
|
188
|
+
/**
|
|
189
|
+
* 用于存储es module解析出来的源码,CustomVueControlPlugin
|
|
190
190
|
*/ _define_property(this, "sources", {});
|
|
191
191
|
}
|
|
192
192
|
_create_class(ActionManager, [
|
|
@@ -185,7 +185,6 @@ export var DataManager = /*#__PURE__*/ function() {
|
|
|
185
185
|
return _async_to_generator(function() {
|
|
186
186
|
return _ts_generator(this, function(_state) {
|
|
187
187
|
if (this.executer === undefined) {
|
|
188
|
-
// @i18n-translate-ignore
|
|
189
188
|
logerror('未初始化executer');
|
|
190
189
|
return [
|
|
191
190
|
2,
|
|
@@ -405,7 +405,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
405
405
|
{
|
|
406
406
|
key: "mount",
|
|
407
407
|
value: function mount() {
|
|
408
|
-
// @i18n-translate-ignore
|
|
409
408
|
this.debugLog("engine的mount方法开始调用");
|
|
410
409
|
var _this_$options = this.$options, _this_$options_plugins = _this_$options.plugins, plugins = _this_$options_plugins === void 0 ? [] : _this_$options_plugins;
|
|
411
410
|
this._handlerProxyState();
|
|
@@ -413,7 +412,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
413
412
|
this.applyPlugins();
|
|
414
413
|
// 触发所有控件的默认值的change事件
|
|
415
414
|
this.setStates(this.getState());
|
|
416
|
-
// @i18n-translate-ignore
|
|
417
415
|
this.debugLog("engine的mount方法调用结束");
|
|
418
416
|
if (this.debug && typeof window !== 'undefined') {
|
|
419
417
|
// @ts-ignore
|
|
@@ -972,10 +970,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
972
970
|
key: "setState",
|
|
973
971
|
value: function setState(controlId, value, rowIndex, options) {
|
|
974
972
|
eventOptionsTemp = options;
|
|
975
|
-
// @i18n-translate-ignore
|
|
976
973
|
this.debugLog('[%o]: 触发setState, 修改的值为%o, rowIndex=%o, options=%o', controlId, value, rowIndex, options);
|
|
977
974
|
this.store.setState(controlId, value, rowIndex);
|
|
978
|
-
// @i18n-translate-ignore
|
|
979
975
|
this.debugLog('[%o]: setState完成, 修改的值为%o, rowIndex=%o', controlId, value, rowIndex);
|
|
980
976
|
eventOptionsTemp = null;
|
|
981
977
|
}
|
|
@@ -1260,7 +1256,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1260
1256
|
*/ key: "setData",
|
|
1261
1257
|
value: function setData(dataSet, options) {
|
|
1262
1258
|
var _this = this;
|
|
1263
|
-
// @i18n-translate-ignore
|
|
1264
1259
|
this.debugLog("engine setData方法执行,参数为%o,%o。", dataSet, options);
|
|
1265
1260
|
var onlySetData = options === null || options === void 0 ? void 0 : options.onlySetData;
|
|
1266
1261
|
var newState = this.store.defaultState;
|
|
@@ -1382,18 +1377,15 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1382
1377
|
}
|
|
1383
1378
|
}
|
|
1384
1379
|
});
|
|
1385
|
-
// @i18n-translate-ignore
|
|
1386
1380
|
_this.debugLog("engine setData方法默认值及表单数据组合完成,参数为%o。", newState);
|
|
1387
1381
|
}
|
|
1388
1382
|
}
|
|
1389
1383
|
});
|
|
1390
|
-
// @i18n-translate-ignore
|
|
1391
1384
|
this.debugLog("engine setData方法数据组合完成,参数为%o。", newState);
|
|
1392
1385
|
this.setStates(newState, undefined, _object_spread({
|
|
1393
1386
|
setData: true
|
|
1394
1387
|
}, options));
|
|
1395
1388
|
this.runtime.getFlatInstances();
|
|
1396
|
-
// @i18n-translate-ignore
|
|
1397
1389
|
this.debugLog("engine setData方法执行完成。");
|
|
1398
1390
|
}
|
|
1399
1391
|
},
|
|
@@ -1524,7 +1516,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1524
1516
|
var instances = this.getInstances(instance, rowIndex === -1);
|
|
1525
1517
|
instances.map(function(_instance) {
|
|
1526
1518
|
if (_instance) {
|
|
1527
|
-
// @i18n-translate-ignore
|
|
1528
1519
|
_this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
|
|
1529
1520
|
updateValueFromKeys(_instance.props, props, value);
|
|
1530
1521
|
_this.schemaEvent('schema-change', {
|
|
@@ -1545,7 +1536,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1545
1536
|
if (!_instance) {
|
|
1546
1537
|
return;
|
|
1547
1538
|
}
|
|
1548
|
-
// @i18n-translate-ignore
|
|
1549
1539
|
this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
|
|
1550
1540
|
updateValueFromKeys(_instance.props, props, value);
|
|
1551
1541
|
this.schemaEvent('schema-change', {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
|
|
3
|
-
* @Date: 2022-04-15 14:06:03
|
|
4
|
-
* @LastEditors: SuperLuckyqi
|
|
5
|
-
* @LastEditTime: 2024-11-08 11:17:53
|
|
6
|
-
* @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
|
|
1
|
+
/*
|
|
2
|
+
* @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
|
|
3
|
+
* @Date: 2022-04-15 14:06:03
|
|
4
|
+
* @LastEditors: SuperLuckyqi
|
|
5
|
+
* @LastEditTime: 2024-11-08 11:17:53
|
|
6
|
+
* @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
|
|
7
7
|
*/ function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -36,9 +36,6 @@ function _define_property(obj, key, value) {
|
|
|
36
36
|
}
|
|
37
37
|
return obj;
|
|
38
38
|
}
|
|
39
|
-
import postcss from 'postcss';
|
|
40
|
-
import prefixSelector from 'postcss-prefix-selector';
|
|
41
|
-
import postcssNested from 'postcss-nested';
|
|
42
39
|
export var StylePlugin = /*#__PURE__*/ function() {
|
|
43
40
|
"use strict";
|
|
44
41
|
function StylePlugin(config) {
|
|
@@ -62,23 +59,19 @@ export var StylePlugin = /*#__PURE__*/ function() {
|
|
|
62
59
|
style.className = 'edit-css-' + engine.id;
|
|
63
60
|
var dom = document.querySelector('head');
|
|
64
61
|
dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
var cssStyleText = postcss(plugins).process(compiledStyle, {
|
|
80
|
-
from: undefined
|
|
81
|
-
}).css;
|
|
62
|
+
// const plugins: any[] = [postcssNested()]
|
|
63
|
+
// if (this.isPc) {
|
|
64
|
+
// plugins.push(prefixSelector({
|
|
65
|
+
// prefix: `.render-engine-${this.engine?.id}`,
|
|
66
|
+
// // 明确将前缀通过空格连接到每个选择器,避免重复前缀
|
|
67
|
+
// transform(prefix, selector) {
|
|
68
|
+
// if (selector.startsWith(prefix)) return selector
|
|
69
|
+
// return `${prefix} ${selector}`
|
|
70
|
+
// },
|
|
71
|
+
// }))
|
|
72
|
+
// }
|
|
73
|
+
// const cssStyleText = postcss(plugins).process(compiledStyle, { from: undefined }).css;
|
|
74
|
+
var cssStyleText = compiledStyle;
|
|
82
75
|
style.appendChild(document.createTextNode(cssStyleText));
|
|
83
76
|
}
|
|
84
77
|
}
|