@byteluck-fe/model-driven-engine 1.8.0-beta.1 → 1.8.0-beta.12

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.
@@ -64,8 +64,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
64
64
  /**
65
65
  * @description 获取显隐控制的需要被记住值的控件id
66
66
  * */ _proto.getNeedHideRememberControlIds = function getNeedHideRememberControlIds() {
67
- var ref;
68
- if (!((ref = this.options) === null || ref === void 0 ? void 0 : ref.displayBoList)) {
67
+ var _this_options;
68
+ if (!((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.displayBoList)) {
69
69
  return;
70
70
  }
71
71
  this.hideNotRememberControlIds = this.options.displayBoList.reduce(function(result, current) {
@@ -79,8 +79,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
79
79
  /**
80
80
  * @description 获取权限控制的隐藏的字段,不需要参与计算
81
81
  * */ _proto.getDontHasPermissionControlIds = function getDontHasPermissionControlIds() {
82
- var ref;
83
- if (!((ref = this.options) === null || ref === void 0 ? void 0 : ref.behavior)) {
82
+ var _this_options;
83
+ if (!((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.behavior)) {
84
84
  return;
85
85
  }
86
86
  this.dontHasPermissionControlIds = this.options.behavior.reduce(function(result, current) {
@@ -206,8 +206,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
206
206
  var _this = this;
207
207
  this.engine.on("schema-change", function(payload) {
208
208
  if (payload.props === "isHide") {
209
- var ref;
210
- var calcControls = (ref = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && ref !== void 0 ? ref : [];
209
+ var _this_dependenciesTriggerMap_get;
210
+ var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
211
211
  calcControls.forEach(function(calc) {
212
212
  _this.computedCalcValue(calc);
213
213
  });
@@ -219,18 +219,18 @@ export var CalcPlugin = /*#__PURE__*/ function() {
219
219
  * */ _proto.watchSubtableChange = function watchSubtableChange() {
220
220
  var _this = this;
221
221
  this.engine.on("list-change", function(payload) {
222
- var ref;
222
+ var _payload_options;
223
223
  _this.resetDependencies();
224
- var ref1;
225
- var changedRows = (ref1 = (ref = payload.options) === null || ref === void 0 ? void 0 : ref.changed) !== null && ref1 !== void 0 ? ref1 : [];
224
+ var _payload_options_changed;
225
+ var changedRows = (_payload_options_changed = (_payload_options = payload.options) === null || _payload_options === void 0 ? void 0 : _payload_options.changed) !== null && _payload_options_changed !== void 0 ? _payload_options_changed : [];
226
226
  // 对发生改变的行进行重新计算
227
227
  var changedCalc = _this.getCalcControlsFromSubtableRows(changedRows);
228
228
  // @ts-ignore
229
229
  changedCalc.forEach(function(calcControl) {
230
230
  _this.computedCalcValue(calcControl);
231
231
  });
232
- var ref2;
233
- var calcControls = (ref2 = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && ref2 !== void 0 ? ref2 : [];
232
+ var _this_dependenciesTriggerMap_get;
233
+ var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
234
234
  // @ts-ignore
235
235
  calcControls.forEach(function(calcControl) {
236
236
  _this.computedCalcValue(calcControl);
@@ -246,8 +246,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
246
246
  if (!_this.dependenciesTriggerMap.has(instance.id)) {
247
247
  return;
248
248
  }
249
- var ref;
250
- var calcControls = (ref = _this.dependenciesTriggerMap.get(instance.id)) !== null && ref !== void 0 ? ref : [];
249
+ var _this_dependenciesTriggerMap_get;
250
+ var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
251
251
  // 在明细子表中的控件,如果计算公式也在明细子表,那只触发同一行的计算公式的计算
252
252
  if (payload.rowIndex !== undefined && payload.rowIndex > -1) {
253
253
  // @ts-ignore
@@ -271,8 +271,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
271
271
  /**
272
272
  * @description 控件在明细子表内
273
273
  * */ _proto.controlInSubtable = function controlInSubtable(control) {
274
- var ref;
275
- return ((ref = control.parent) === null || ref === void 0 ? void 0 : ref.type) === CONTROL_TYPE.SUBTABLE_COLUMN;
274
+ var _control_parent;
275
+ return ((_control_parent = control.parent) === null || _control_parent === void 0 ? void 0 : _control_parent.type) === CONTROL_TYPE.SUBTABLE_COLUMN;
276
276
  };
277
277
  /**
278
278
  * @description 执行计算公式的计算
@@ -352,10 +352,10 @@ export var CalcPlugin = /*#__PURE__*/ function() {
352
352
  if (result === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.result)) {
353
353
  return;
354
354
  }
355
- var ref;
355
+ var _oldValue_unit;
356
356
  this.engine.setState(control.id, {
357
357
  result: result,
358
- unit: (ref = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && ref !== void 0 ? ref : ""
358
+ unit: (_oldValue_unit = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && _oldValue_unit !== void 0 ? _oldValue_unit : ""
359
359
  }, rowIndex);
360
360
  };
361
361
  /**
@@ -71,7 +71,7 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
71
71
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72
72
  try {
73
73
  for(var _iterator = Object.entries(res.funcMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
74
- var _value = _slicedToArray(_step.value, 2), key = _value[0], value = _value[1];
74
+ var _step_value = _slicedToArray(_step.value, 2), key = _step_value[0], value = _step_value[1];
75
75
  actionManager.addAction(key, value);
76
76
  }
77
77
  } catch (err) {
@@ -117,7 +117,7 @@ export function parseModule(action, engine) {
117
117
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
118
118
  try {
119
119
  for(var _iterator = Object.entries(module.exports)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
120
- var _value = _slicedToArray(_step.value, 2), key = _value[0], value = _value[1];
120
+ var _step_value = _slicedToArray(_step.value, 2), key = _step_value[0], value = _step_value[1];
121
121
  if (typeof value === "function") {
122
122
  funcMap[key] = value;
123
123
  } else {
@@ -11,10 +11,10 @@ export var StylePlugin = /*#__PURE__*/ function() {
11
11
  }
12
12
  var _proto = StylePlugin.prototype;
13
13
  _proto.apply = function apply(engine) {
14
- var ref;
14
+ var _this_config;
15
15
  this.engine = engine;
16
- var ref1;
17
- var compiledStyle = (ref1 = (ref = this.config) === null || ref === void 0 ? void 0 : ref.source) !== null && ref1 !== void 0 ? ref1 : "";
16
+ var _this_config_source;
17
+ 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 : "";
18
18
  var style = document.createElement("style");
19
19
  style.className = "edit-css";
20
20
  style.type = "text/css";