@byteluck-fe/model-driven-engine 2.2.2-beta.9 → 2.2.3
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/Engine.js +0 -17
- package/dist/esm/common/Runtime.js +0 -25
- package/dist/esm/common/Store.js +3 -0
- package/dist/esm/utils/runtimeUtils.js +0 -1
- package/dist/index.umd.js +7 -7
- package/dist/types/common/ActionManager.d.ts +14 -14
- package/dist/types/common/DataManager.d.ts +10 -10
- package/dist/types/common/Engine.d.ts +176 -180
- package/dist/types/common/OkWorker.d.ts +13 -13
- package/dist/types/common/Plugin.d.ts +6 -6
- package/dist/types/common/Runtime.d.ts +21 -25
- package/dist/types/common/Store.d.ts +49 -49
- package/dist/types/common/checkerValue.d.ts +3 -3
- package/dist/types/common/index.d.ts +2 -2
- package/dist/types/common/proxyState.d.ts +30 -30
- package/dist/types/index.d.ts +3 -3
- package/dist/types/plugins/CalcPlugin.d.ts +121 -121
- package/dist/types/plugins/ControlsEventPlugin.d.ts +15 -15
- package/dist/types/plugins/ES6ModulePlugin.d.ts +26 -26
- package/dist/types/plugins/LifecycleEventPlugin.d.ts +14 -14
- package/dist/types/plugins/StylePlugin.d.ts +12 -12
- package/dist/types/plugins/index.d.ts +5 -5
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/runtimeUtils.d.ts +4 -4
- package/package.json +5 -6
|
@@ -738,18 +738,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
738
738
|
_proto.updateInstanceProps = function updateInstanceProps(instance, props, value, rowIndex) {
|
|
739
739
|
return this.setInstance(instance, props, value, rowIndex);
|
|
740
740
|
};
|
|
741
|
-
_proto.getAllRules = function getAllRules(controlId) {
|
|
742
|
-
var rules = this.runtime.allRules;
|
|
743
|
-
if (controlId === undefined) {
|
|
744
|
-
return rules;
|
|
745
|
-
} else {
|
|
746
|
-
var _rules_rules_controlId, _rules_antdRules_controlId;
|
|
747
|
-
return {
|
|
748
|
-
rules: (_rules_rules_controlId = rules.rules[controlId]) === null || _rules_rules_controlId === void 0 ? void 0 : _rules_rules_controlId.fields,
|
|
749
|
-
antdRules: (_rules_antdRules_controlId = rules.antdRules[controlId]) === null || _rules_antdRules_controlId === void 0 ? void 0 : _rules_antdRules_controlId.fields
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
741
|
_proto.getRules = function getRules(controlId) {
|
|
754
742
|
if (controlId === undefined) {
|
|
755
743
|
return this.runtime.rules;
|
|
@@ -1150,11 +1138,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1150
1138
|
* @param header 明细表内是否获取表头的控件
|
|
1151
1139
|
*/ _proto.getInstances = function getInstances(controlId) {
|
|
1152
1140
|
var header = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
1153
|
-
// const cc = console
|
|
1154
|
-
// const label = '🐑 genInstances ' + controlId + ' ' + Date.now()
|
|
1155
|
-
// cc.time(label)
|
|
1156
1141
|
if (controlId === undefined) {
|
|
1157
|
-
// cc.timeEnd(label)
|
|
1158
1142
|
return this.runtime.flatInstances;
|
|
1159
1143
|
}
|
|
1160
1144
|
var instances = this.runtime.instanceMap[controlId] || [];
|
|
@@ -1358,4 +1342,3 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1358
1342
|
return Engine;
|
|
1359
1343
|
}(Watcher);
|
|
1360
1344
|
export { Engine };
|
|
1361
|
-
console.log("a");
|
|
@@ -146,31 +146,6 @@ export var Runtime = /*#__PURE__*/ function(RegisterControls) {
|
|
|
146
146
|
return this._instanceMap;
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
|
-
{
|
|
150
|
-
key: "allRules",
|
|
151
|
-
get: function get() {
|
|
152
|
-
var antdRules = {};
|
|
153
|
-
var ruleItems = {};
|
|
154
|
-
loopDataViewControl(this._instance, function(dataView) {
|
|
155
|
-
ruleItems[dataView.id] = dataView.rules[0];
|
|
156
|
-
antdRules[dataView.id] = dataView.rules[0];
|
|
157
|
-
loopFormControl(dataView.children, function(item) {
|
|
158
|
-
// if (
|
|
159
|
-
// item instanceof RuntimeFormControl ||
|
|
160
|
-
// item instanceof RuntimeListControl
|
|
161
|
-
// ) {
|
|
162
|
-
if (item.controlType === CONTROL_BASE_TYPE.FORM || item.controlType === CONTROL_BASE_TYPE.LIST) {
|
|
163
|
-
buildControlRules(ruleItems[dataView.id].fields, item);
|
|
164
|
-
buildControlAntdRules(antdRules[dataView.id].fields, item);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
return {
|
|
169
|
-
rules: ruleItems,
|
|
170
|
-
antdRules: antdRules
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
149
|
{
|
|
175
150
|
key: "rules",
|
|
176
151
|
get: function get() {
|
package/dist/esm/common/Store.js
CHANGED
|
@@ -222,6 +222,7 @@ function buildDataBindMapping(data, dataViewId, // @ts-ignore
|
|
|
222
222
|
item) {
|
|
223
223
|
// if (item instanceof RuntimeFormControl) {
|
|
224
224
|
if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
225
|
+
var _item_props, _item_props_dataBind;
|
|
225
226
|
if (_instanceof(item.props.dataBind, ObjectDataBind)) {
|
|
226
227
|
// 特殊的dataBind,比如:金额是currency+amount两个key组成的,日期区间,继承自ObjectDataBind的需要通过Object.keys拿到多个databind
|
|
227
228
|
Object.keys(item.props.dataBind).map(function(key) {
|
|
@@ -245,6 +246,8 @@ item) {
|
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
248
|
});
|
|
249
|
+
} else if (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : (_item_props_dataBind = _item_props.dataBind) === null || _item_props_dataBind === void 0 ? void 0 : _item_props_dataBind.dataCode) === undefined) {
|
|
250
|
+
//qiyu 2023-2-27 为空跳过。form自定义组件加载失败时,hack的组件props为空。
|
|
248
251
|
} else {
|
|
249
252
|
if (data[item.props.dataBind.dataCode] === undefined) {
|
|
250
253
|
data[item.props.dataBind.dataCode] = {
|
|
@@ -12,7 +12,6 @@ export function loopFormControl(control, callback) {
|
|
|
12
12
|
callback(item, children);
|
|
13
13
|
} else if (hasChildrenControl(item)) {
|
|
14
14
|
loopFormControl(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
15
|
-
// @ts-ignore
|
|
16
15
|
} else if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
17
16
|
callback(item);
|
|
18
17
|
}
|