@byteluck-fe/model-driven-engine 4.37.0-lx2 → 5.5.0-1-beta1
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/DataManager.js +1 -0
- package/dist/esm/common/Engine.js +69 -136
- package/dist/esm/common/Runtime.js +7 -3
- package/dist/esm/common/Store.js +13 -10
- package/dist/esm/common/checkerValue.js +1 -1
- package/dist/esm/common/proxyState.js +34 -27
- package/dist/esm/plugins/ControlsEventPlugin.js +11 -1
- package/dist/esm/plugins/StylePlugin.js +16 -7
- package/dist/esm/utils/runtimeUtils.js +2 -1
- package/dist/index.umd.js +39 -7
- package/dist/types/common/Engine.d.ts +8 -16
- package/dist/types/common/proxyState.d.ts +3 -6
- package/dist/types/plugins/ControlsEventPlugin.d.ts +3 -1
- package/dist/types/plugins/StylePlugin.d.ts +2 -1
- package/package.json +9 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
|
|
3
3
|
* @Date: 2022-04-15 14:06:03
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: SuperLuckyqi
|
|
5
|
+
* @LastEditTime: 2024-11-08 11:17:53
|
|
6
6
|
* @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
|
|
7
7
|
*/ function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
@@ -36,28 +36,37 @@ 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';
|
|
39
41
|
export var StylePlugin = /*#__PURE__*/ function() {
|
|
40
42
|
"use strict";
|
|
41
43
|
function StylePlugin(config) {
|
|
44
|
+
var isPC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
42
45
|
_class_call_check(this, StylePlugin);
|
|
43
46
|
_define_property(this, "config", void 0);
|
|
44
47
|
_define_property(this, "engine", void 0);
|
|
48
|
+
_define_property(this, "isPc", void 0);
|
|
45
49
|
this.config = config;
|
|
50
|
+
this.isPc = isPC;
|
|
46
51
|
}
|
|
47
52
|
_create_class(StylePlugin, [
|
|
48
53
|
{
|
|
49
54
|
key: "apply",
|
|
50
55
|
value: function apply(engine) {
|
|
51
|
-
var _this_config;
|
|
56
|
+
var _this_config, _this_engine;
|
|
52
57
|
this.engine = engine;
|
|
53
58
|
var _this_config_source;
|
|
54
59
|
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 : '';
|
|
55
60
|
var style = document.createElement('style');
|
|
56
|
-
style.className = 'edit-css';
|
|
57
|
-
style.type = 'text/css';
|
|
58
|
-
style.innerHTML = compiledStyle;
|
|
61
|
+
style.className = 'edit-css-' + engine.id;
|
|
59
62
|
var dom = document.querySelector('head');
|
|
60
|
-
dom.appendChild(style);
|
|
63
|
+
dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
|
|
64
|
+
var cssStyleText = postcss([
|
|
65
|
+
prefixSelector({
|
|
66
|
+
prefix: ".render-engine-".concat((_this_engine = this.engine) === null || _this_engine === void 0 ? void 0 : _this_engine.id)
|
|
67
|
+
})
|
|
68
|
+
]).process(compiledStyle).css;
|
|
69
|
+
style.appendChild(document.createTextNode(cssStyleText));
|
|
61
70
|
}
|
|
62
71
|
}
|
|
63
72
|
]);
|
|
@@ -6,7 +6,8 @@ export function loopFormControl(control, callback) {
|
|
|
6
6
|
if (Array.isArray(control)) {
|
|
7
7
|
control.map(function(item) {
|
|
8
8
|
//TODO 此处需要再抽象一层 datagrid/datalist
|
|
9
|
-
if (item.type === CONTROL_TYPE.SUBTABLE) {
|
|
9
|
+
// if (item.type === CONTROL_TYPE.SUBTABLE) {
|
|
10
|
+
if (item.controlType === CONTROL_BASE_TYPE.LIST) {
|
|
10
11
|
// @ts-ignore
|
|
11
12
|
var children = []//item.getChildrenFormControl() as RuntimeFormControl[]
|
|
12
13
|
;
|