@byteluck-fe/model-driven-engine 2.23.0-beta.4 → 2.23.0-beta.7
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 +66 -93
- package/dist/esm/common/Runtime.js +12 -28
- package/dist/esm/common/Store.js +14 -9
- package/dist/esm/common/checkerValue.js +17 -37
- package/dist/esm/plugins/ControlsEventPlugin.js +2 -2
- package/dist/esm/plugins/LifecycleEventPlugin.js +2 -2
- package/dist/index.umd.js +27 -29
- package/package.json +4 -4
|
@@ -44,6 +44,10 @@ function _async_to_generator(fn) {
|
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
function _call_super(_this, derived, args) {
|
|
48
|
+
derived = _get_prototype_of(derived);
|
|
49
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
50
|
+
}
|
|
47
51
|
function _class_call_check(instance, Constructor) {
|
|
48
52
|
if (!(instance instanceof Constructor)) {
|
|
49
53
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -222,28 +226,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
222
226
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
223
227
|
}
|
|
224
228
|
function _is_native_reflect_construct() {
|
|
225
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
226
|
-
if (Reflect.construct.sham) return false;
|
|
227
|
-
if (typeof Proxy === "function") return true;
|
|
228
229
|
try {
|
|
229
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function _create_super(Derived) {
|
|
236
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
237
|
-
return function _createSuperInternal() {
|
|
238
|
-
var Super = _get_prototype_of(Derived), result;
|
|
239
|
-
if (hasNativeReflectConstruct) {
|
|
240
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
241
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
242
|
-
} else {
|
|
243
|
-
result = Super.apply(this, arguments);
|
|
244
|
-
}
|
|
245
|
-
return _possible_constructor_return(this, result);
|
|
246
|
-
};
|
|
230
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
231
|
+
} catch (_) {}
|
|
232
|
+
return (_is_native_reflect_construct = function() {
|
|
233
|
+
return !!result;
|
|
234
|
+
})();
|
|
247
235
|
}
|
|
248
236
|
function _ts_generator(thisArg, body) {
|
|
249
237
|
var f, y, t, g, _ = {
|
|
@@ -361,30 +349,14 @@ var applyingPluginName = '';
|
|
|
361
349
|
var Engine = /*#__PURE__*/ function(Watcher) {
|
|
362
350
|
"use strict";
|
|
363
351
|
_inherits(Engine, Watcher);
|
|
364
|
-
var _super = _create_super(Engine);
|
|
365
352
|
function Engine(props) {
|
|
366
353
|
_class_call_check(this, Engine);
|
|
367
354
|
var _this;
|
|
368
|
-
_this =
|
|
369
|
-
_define_property(
|
|
370
|
-
_define_property(_assert_this_initialized(_this), "rawStore", {});
|
|
371
|
-
_define_property(_assert_this_initialized(_this), "parent", void 0);
|
|
372
|
-
// 提供注册运行态控件以及实例化控件的能力
|
|
373
|
-
_define_property(_assert_this_initialized(_this), "runtime", void 0);
|
|
374
|
-
// 提供子线程处理脚本以及修改数据的能力
|
|
355
|
+
_this = _call_super(this, Engine), _define_property(_this, "store", void 0), _define_property(_this, "rawStore", {}), _define_property(_this, "parent", void 0), // 提供注册运行态控件以及实例化控件的能力
|
|
356
|
+
_define_property(_this, "runtime", void 0), // 提供子线程处理脚本以及修改数据的能力
|
|
375
357
|
// public worker: OkWorker
|
|
376
|
-
_define_property(
|
|
377
|
-
_define_property(
|
|
378
|
-
_define_property(_assert_this_initialized(_this), "externalParams", void 0);
|
|
379
|
-
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
380
|
-
// 提供外部注册插件,在不同的hooks触发时执行固定函数的能力
|
|
381
|
-
_define_property(_assert_this_initialized(_this), "__plugins", void 0);
|
|
382
|
-
_define_property(_assert_this_initialized(_this), "__pluginsApplied", false);
|
|
383
|
-
_define_property(_assert_this_initialized(_this), "$options", void 0);
|
|
384
|
-
_define_property(_assert_this_initialized(_this), "actionManager", new ActionManager());
|
|
385
|
-
_define_property(_assert_this_initialized(_this), "dataManager", void 0);
|
|
386
|
-
_define_property(_assert_this_initialized(_this), "_jobTasks", []);
|
|
387
|
-
_define_property(_assert_this_initialized(_this), "createControlInstance", _this.createInstance);
|
|
358
|
+
_define_property(_this, "isMounted", false), _define_property(_this, "id", genNonDuplicateId(8)), _define_property(_this, "externalParams", void 0), _define_property(_this, "children", void 0), // 提供外部注册插件,在不同的hooks触发时执行固定函数的能力
|
|
359
|
+
_define_property(_this, "__plugins", void 0), _define_property(_this, "__pluginsApplied", false), _define_property(_this, "$options", void 0), _define_property(_this, "actionManager", new ActionManager()), _define_property(_this, "dataManager", void 0), _define_property(_this, "_jobTasks", []), _define_property(_this, "createControlInstance", _this.createInstance);
|
|
388
360
|
_this.$options = Object.freeze(props);
|
|
389
361
|
var _this_$options = _this.$options, _this_$options_autoMount = _this_$options.autoMount, autoMount = _this_$options_autoMount === void 0 ? true : _this_$options_autoMount, schema = _this_$options.schema, beforeCreateInstance = _this_$options.beforeCreateInstance, externalParams = _this_$options.externalParams, _this_$options_language = _this_$options.// fieldModel,
|
|
390
362
|
language, language = _this_$options_language === void 0 ? DEFAULT_LOCALE : _this_$options_language, _this_$options_debug = _this_$options.debug, debug = _this_$options_debug === void 0 ? false : _this_$options_debug, messagesI18n = _this_$options.messagesI18n, children = _this_$options.children;
|
|
@@ -625,6 +597,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
625
597
|
{
|
|
626
598
|
key: "_handlerSubtableUpdateUid",
|
|
627
599
|
value: function _handlerSubtableUpdateUid(subtableData) {
|
|
600
|
+
;
|
|
628
601
|
subtableData.forEach(function(item) {
|
|
629
602
|
if (!item.uid) {
|
|
630
603
|
Object.assign(item, {
|
|
@@ -978,9 +951,9 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
978
951
|
}
|
|
979
952
|
},
|
|
980
953
|
{
|
|
981
|
-
/**
|
|
982
|
-
* 设置payload的options,提供在不是使用标准api修改state的时候可以传递options,会在本次任务执行完成之后清空
|
|
983
|
-
* @param options 需要携带的options
|
|
954
|
+
/**
|
|
955
|
+
* 设置payload的options,提供在不是使用标准api修改state的时候可以传递options,会在本次任务执行完成之后清空
|
|
956
|
+
* @param options 需要携带的options
|
|
984
957
|
* */ key: "setPayloadOptions",
|
|
985
958
|
value: function setPayloadOptions(options) {
|
|
986
959
|
eventOptionsTemp = options;
|
|
@@ -997,9 +970,9 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
997
970
|
}
|
|
998
971
|
},
|
|
999
972
|
{
|
|
1000
|
-
/**
|
|
1001
|
-
* 向Store设置一组值,明细表必须全量赋值,并触发事件(触发事件是根据组件在页面中的顺序逐个触发)
|
|
1002
|
-
* @param states
|
|
973
|
+
/**
|
|
974
|
+
* 向Store设置一组值,明细表必须全量赋值,并触发事件(触发事件是根据组件在页面中的顺序逐个触发)
|
|
975
|
+
* @param states
|
|
1003
976
|
*/ key: "setStates",
|
|
1004
977
|
value: function setStates(states, rowIndex, options) {
|
|
1005
978
|
var _this = this;
|
|
@@ -1026,11 +999,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1026
999
|
}
|
|
1027
1000
|
},
|
|
1028
1001
|
{
|
|
1029
|
-
/**
|
|
1030
|
-
* 通过dataCode和fieldCode来获取控件的值
|
|
1031
|
-
* @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
|
|
1032
|
-
* @param fieldCode 字段编码 - 控件绑定的数据项的编码
|
|
1033
|
-
* @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
|
|
1002
|
+
/**
|
|
1003
|
+
* 通过dataCode和fieldCode来获取控件的值
|
|
1004
|
+
* @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
|
|
1005
|
+
* @param fieldCode 字段编码 - 控件绑定的数据项的编码
|
|
1006
|
+
* @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
|
|
1034
1007
|
* */ key: "getField",
|
|
1035
1008
|
value: function getField(dataCode, fieldCode, rowIndex) {
|
|
1036
1009
|
if (!fieldCode) {
|
|
@@ -1145,13 +1118,13 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1145
1118
|
}
|
|
1146
1119
|
},
|
|
1147
1120
|
{
|
|
1148
|
-
/**
|
|
1149
|
-
* 通过dataCode和fieldCode来设置控件的值
|
|
1150
|
-
* @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
|
|
1151
|
-
* @param fieldCode 字段编码 - 控件绑定的数据项的编码
|
|
1152
|
-
* @param value 修改的值
|
|
1153
|
-
* @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
|
|
1154
|
-
* @param options 触发事件携带的参数
|
|
1121
|
+
/**
|
|
1122
|
+
* 通过dataCode和fieldCode来设置控件的值
|
|
1123
|
+
* @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
|
|
1124
|
+
* @param fieldCode 字段编码 - 控件绑定的数据项的编码
|
|
1125
|
+
* @param value 修改的值
|
|
1126
|
+
* @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
|
|
1127
|
+
* @param options 触发事件携带的参数
|
|
1155
1128
|
* */ key: "setField",
|
|
1156
1129
|
value: function setField(dataCode, fieldCode, value, rowIndex, options) {
|
|
1157
1130
|
var dataBindMapping = this.getDataBindMapping(dataCode, fieldCode);
|
|
@@ -1179,12 +1152,12 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1179
1152
|
}
|
|
1180
1153
|
},
|
|
1181
1154
|
{
|
|
1182
|
-
/**
|
|
1183
|
-
* 通过dataCode和 state来给一组控件赋值,并触发事件携带options
|
|
1184
|
-
* @param dataCode 需要赋值的目标模型
|
|
1185
|
-
* @param state 赋值对象,以fieldCode为key组成的对象
|
|
1186
|
-
* @param rowIndex 行下标,给明细子表赋值时指定赋值某行
|
|
1187
|
-
* @param options 触发事件携带的参数
|
|
1155
|
+
/**
|
|
1156
|
+
* 通过dataCode和 state来给一组控件赋值,并触发事件携带options
|
|
1157
|
+
* @param dataCode 需要赋值的目标模型
|
|
1158
|
+
* @param state 赋值对象,以fieldCode为key组成的对象
|
|
1159
|
+
* @param rowIndex 行下标,给明细子表赋值时指定赋值某行
|
|
1160
|
+
* @param options 触发事件携带的参数
|
|
1188
1161
|
* */ key: "setFields",
|
|
1189
1162
|
value: function setFields(dataCode, state, rowIndex, options) {
|
|
1190
1163
|
var _this = this;
|
|
@@ -1225,10 +1198,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1225
1198
|
}
|
|
1226
1199
|
},
|
|
1227
1200
|
{
|
|
1228
|
-
/**
|
|
1229
|
-
* 通过dataCode来将state转化为标准的state结构
|
|
1230
|
-
* @param dataCode 需要转换的目标模型code
|
|
1231
|
-
* @param state 值对象,以fieldCode为key组成的对象
|
|
1201
|
+
/**
|
|
1202
|
+
* 通过dataCode来将state转化为标准的state结构
|
|
1203
|
+
* @param dataCode 需要转换的目标模型code
|
|
1204
|
+
* @param state 值对象,以fieldCode为key组成的对象
|
|
1232
1205
|
* */ key: "buildFields",
|
|
1233
1206
|
value: function buildFields(dataCode, state) {
|
|
1234
1207
|
var _this = this;
|
|
@@ -1269,10 +1242,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1269
1242
|
}
|
|
1270
1243
|
},
|
|
1271
1244
|
{
|
|
1272
|
-
/**
|
|
1273
|
-
* 向Store设置一组值,并触发事件携带options
|
|
1274
|
-
* @param dataSet
|
|
1275
|
-
* @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
|
|
1245
|
+
/**
|
|
1246
|
+
* 向Store设置一组值,并触发事件携带options
|
|
1247
|
+
* @param dataSet
|
|
1248
|
+
* @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
|
|
1276
1249
|
*/ key: "setData",
|
|
1277
1250
|
value: function setData(dataSet, options) {
|
|
1278
1251
|
var _this = this;
|
|
@@ -1410,19 +1383,19 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1410
1383
|
}
|
|
1411
1384
|
},
|
|
1412
1385
|
{
|
|
1413
|
-
/**
|
|
1414
|
-
* 获取控件的dataBind
|
|
1415
|
-
* @param controlId
|
|
1386
|
+
/**
|
|
1387
|
+
* 获取控件的dataBind
|
|
1388
|
+
* @param controlId
|
|
1416
1389
|
* */ key: "getDataBind",
|
|
1417
1390
|
value: function getDataBind(controlId) {
|
|
1418
1391
|
return this.store.getDataBind(controlId);
|
|
1419
1392
|
}
|
|
1420
1393
|
},
|
|
1421
1394
|
{
|
|
1422
|
-
/**
|
|
1423
|
-
* 获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
|
|
1424
|
-
* @param controlId
|
|
1425
|
-
* @param rowIndex
|
|
1395
|
+
/**
|
|
1396
|
+
* 获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
|
|
1397
|
+
* @param controlId
|
|
1398
|
+
* @param rowIndex
|
|
1426
1399
|
*/ key: "getInstance",
|
|
1427
1400
|
value: function getInstance(controlId, rowIndex) {
|
|
1428
1401
|
var instances = this.getInstances(controlId, rowIndex === -1);
|
|
@@ -1441,10 +1414,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1441
1414
|
}
|
|
1442
1415
|
},
|
|
1443
1416
|
{
|
|
1444
|
-
/**
|
|
1445
|
-
* 获取组件实例,明细表中的组件将会得到数组, 第二个参数为(false/不传入)则获取到的是明细表内不包含表头内实例的所有控件实例,传入true则获取到包含表头内实例的所有控件实例,表头内实例永远在下标0的位置
|
|
1446
|
-
* @param controlId
|
|
1447
|
-
* @param header 明细表内是否获取表头的控件
|
|
1417
|
+
/**
|
|
1418
|
+
* 获取组件实例,明细表中的组件将会得到数组, 第二个参数为(false/不传入)则获取到的是明细表内不包含表头内实例的所有控件实例,传入true则获取到包含表头内实例的所有控件实例,表头内实例永远在下标0的位置
|
|
1419
|
+
* @param controlId
|
|
1420
|
+
* @param header 明细表内是否获取表头的控件
|
|
1448
1421
|
*/ // getInstances(
|
|
1449
1422
|
// controlId?: string,
|
|
1450
1423
|
// header: boolean = false
|
|
@@ -1620,27 +1593,27 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1620
1593
|
},
|
|
1621
1594
|
{
|
|
1622
1595
|
key: "assertInstance",
|
|
1623
|
-
value: /**
|
|
1624
|
-
* 判断控件的类型,返回当前控件的正确类型
|
|
1596
|
+
value: /**
|
|
1597
|
+
* 判断控件的类型,返回当前控件的正确类型
|
|
1625
1598
|
* */ function assertInstance(instance, types) {
|
|
1626
1599
|
return isString(types) ? instance.type === types : types.includes(instance.type);
|
|
1627
1600
|
}
|
|
1628
1601
|
},
|
|
1629
1602
|
{
|
|
1630
1603
|
key: "assertInstanceIsCustomControl",
|
|
1631
|
-
value: /**
|
|
1632
|
-
* 判断控件或控件类型是一个自定义控件
|
|
1604
|
+
value: /**
|
|
1605
|
+
* 判断控件或控件类型是一个自定义控件
|
|
1633
1606
|
* */ function assertInstanceIsCustomControl(instance) {
|
|
1634
1607
|
return !isBuiltInControls(isString(instance) ? instance : instance.type);
|
|
1635
1608
|
}
|
|
1636
1609
|
},
|
|
1637
1610
|
{
|
|
1638
1611
|
key: "getInstanceRowIndex",
|
|
1639
|
-
value: /**
|
|
1640
|
-
* 获取控件在明细子表中的行下标,
|
|
1641
|
-
* 如果控件在表头内,则返回-1
|
|
1642
|
-
* 如果控件在表内,则返回行下标
|
|
1643
|
-
* 如果控件不在明细表内,则返回undefined
|
|
1612
|
+
value: /**
|
|
1613
|
+
* 获取控件在明细子表中的行下标,
|
|
1614
|
+
* 如果控件在表头内,则返回-1
|
|
1615
|
+
* 如果控件在表内,则返回行下标
|
|
1616
|
+
* 如果控件不在明细表内,则返回undefined
|
|
1644
1617
|
* */ // public getInstanceRowIndex(
|
|
1645
1618
|
// instance: ControlRuntimeInstance<ControlsKeys> | RuntimeControl
|
|
1646
1619
|
// ) {
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -73,28 +77,12 @@ function _type_of(obj) {
|
|
|
73
77
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
74
78
|
}
|
|
75
79
|
function _is_native_reflect_construct() {
|
|
76
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
77
|
-
if (Reflect.construct.sham) return false;
|
|
78
|
-
if (typeof Proxy === "function") return true;
|
|
79
80
|
try {
|
|
80
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function _create_super(Derived) {
|
|
87
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
88
|
-
return function _createSuperInternal() {
|
|
89
|
-
var Super = _get_prototype_of(Derived), result;
|
|
90
|
-
if (hasNativeReflectConstruct) {
|
|
91
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
92
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
93
|
-
} else {
|
|
94
|
-
result = Super.apply(this, arguments);
|
|
95
|
-
}
|
|
96
|
-
return _possible_constructor_return(this, result);
|
|
97
|
-
};
|
|
81
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
+
} catch (_) {}
|
|
83
|
+
return (_is_native_reflect_construct = function() {
|
|
84
|
+
return !!result;
|
|
85
|
+
})();
|
|
98
86
|
}
|
|
99
87
|
import { RegisterControls, isDataBind } from '@byteluck-fe/model-driven-core';
|
|
100
88
|
import { CONTROL_BASE_TYPE, CONTROL_TYPE, JSONCopy, loopFormSchema, isArray } from '@byteluck-fe/model-driven-shared';
|
|
@@ -102,16 +90,12 @@ import { hasChildrenControl, loopDataViewControl, loopFormControl } from '../uti
|
|
|
102
90
|
export var Runtime = /*#__PURE__*/ function(RegisterControls) {
|
|
103
91
|
"use strict";
|
|
104
92
|
_inherits(Runtime, RegisterControls);
|
|
105
|
-
var _super = _create_super(Runtime);
|
|
106
93
|
function Runtime(props) {
|
|
107
94
|
_class_call_check(this, Runtime);
|
|
108
95
|
var _this;
|
|
109
|
-
_this =
|
|
110
|
-
|
|
111
|
-
_define_property(
|
|
112
|
-
_define_property(_assert_this_initialized(_this), "_flatInstances", []);
|
|
113
|
-
_define_property(_assert_this_initialized(_this), "_instanceMap", {});
|
|
114
|
-
_define_property(_assert_this_initialized(_this), "_controlParentIdMap", {});
|
|
96
|
+
_this = _call_super(this, Runtime, [
|
|
97
|
+
'Runtime'
|
|
98
|
+
]), _define_property(_this, "_schema", void 0), _define_property(_this, "_instance", void 0), _define_property(_this, "_flatInstances", []), _define_property(_this, "_instanceMap", {}), _define_property(_this, "_controlParentIdMap", {});
|
|
115
99
|
var schema = props.schema;
|
|
116
100
|
_this._schema = schema;
|
|
117
101
|
_this._instance = _this.createControl(schema, props.beforeCreateInstance);
|
package/dist/esm/common/Store.js
CHANGED
|
@@ -81,6 +81,7 @@ var Store = /*#__PURE__*/ function() {
|
|
|
81
81
|
if (controlInfo !== undefined) {
|
|
82
82
|
//明细表
|
|
83
83
|
if (controlInfo.children) {
|
|
84
|
+
;
|
|
84
85
|
value.forEach(function(item) {
|
|
85
86
|
if (!item.uid) {
|
|
86
87
|
Object.assign(item, {
|
|
@@ -109,6 +110,7 @@ var Store = /*#__PURE__*/ function() {
|
|
|
109
110
|
Object.keys(children).map(function(childControlId) {
|
|
110
111
|
if (childControlId === controlId) {
|
|
111
112
|
if (_this.state[dataView][subtableId][rowIndex]) {
|
|
113
|
+
;
|
|
112
114
|
_this.state[dataView][subtableId][rowIndex][controlId] = noProxyValue;
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -167,6 +169,7 @@ var Store = /*#__PURE__*/ function() {
|
|
|
167
169
|
if (children !== undefined) {
|
|
168
170
|
Object.keys(children).map(function(childControlId) {
|
|
169
171
|
if (childControlId === controlId) {
|
|
172
|
+
;
|
|
170
173
|
_this.state[dataViewId][subtableId].map(function(item) {
|
|
171
174
|
states.push(item[controlId]);
|
|
172
175
|
});
|
|
@@ -364,15 +367,17 @@ item) {
|
|
|
364
367
|
Object.keys(item.props.dataBind).map(function(key) {
|
|
365
368
|
var dataBind = item.props.dataBind;
|
|
366
369
|
var dataCode = dataBind[key].dataCode;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
dataViewId
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
370
|
+
if (dataBind[key].fieldCode !== '') {
|
|
371
|
+
data[dataCode].fields.push({
|
|
372
|
+
fieldCode: dataBind[key].fieldCode,
|
|
373
|
+
controlId: item.id,
|
|
374
|
+
dataBind: dataBind,
|
|
375
|
+
dataViewId: [
|
|
376
|
+
dataViewId,
|
|
377
|
+
subtableId
|
|
378
|
+
]
|
|
379
|
+
});
|
|
380
|
+
}
|
|
376
381
|
});
|
|
377
382
|
} else {
|
|
378
383
|
if (data[item.props.dataBind.dataCode] === undefined) {
|
|
@@ -12,6 +12,10 @@ function _assert_this_initialized(self) {
|
|
|
12
12
|
}
|
|
13
13
|
return self;
|
|
14
14
|
}
|
|
15
|
+
function _call_super(_this, derived, args) {
|
|
16
|
+
derived = _get_prototype_of(derived);
|
|
17
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
18
|
+
}
|
|
15
19
|
function _class_call_check(instance, Constructor) {
|
|
16
20
|
if (!(instance instanceof Constructor)) {
|
|
17
21
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -134,28 +138,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
134
138
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
135
139
|
}
|
|
136
140
|
function _is_native_reflect_construct() {
|
|
137
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
138
|
-
if (Reflect.construct.sham) return false;
|
|
139
|
-
if (typeof Proxy === "function") return true;
|
|
140
141
|
try {
|
|
141
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
function _create_super(Derived) {
|
|
148
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
149
|
-
return function _createSuperInternal() {
|
|
150
|
-
var Super = _get_prototype_of(Derived), result;
|
|
151
|
-
if (hasNativeReflectConstruct) {
|
|
152
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
153
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
154
|
-
} else {
|
|
155
|
-
result = Super.apply(this, arguments);
|
|
156
|
-
}
|
|
157
|
-
return _possible_constructor_return(this, result);
|
|
158
|
-
};
|
|
142
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
143
|
+
} catch (_) {}
|
|
144
|
+
return (_is_native_reflect_construct = function() {
|
|
145
|
+
return !!result;
|
|
146
|
+
})();
|
|
159
147
|
}
|
|
160
148
|
import { isArray, isFunction, isString, isJSONArray, isJSONObject, isNumber, isNumberAndEmptyStringArray, isPlainObject, isStringArray, FieldTypes, isObject } from '@byteluck-fe/model-driven-shared';
|
|
161
149
|
import { AddressValue, AmountValue, CalcValue, RangeDateValue } from '@byteluck-fe/model-driven-core';
|
|
@@ -167,10 +155,9 @@ var ValueChecker = function ValueChecker() {
|
|
|
167
155
|
var StringValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
168
156
|
"use strict";
|
|
169
157
|
_inherits(StringValueChecker, ValueChecker);
|
|
170
|
-
var _super = _create_super(StringValueChecker);
|
|
171
158
|
function StringValueChecker() {
|
|
172
159
|
_class_call_check(this, StringValueChecker);
|
|
173
|
-
return
|
|
160
|
+
return _call_super(this, StringValueChecker, arguments);
|
|
174
161
|
}
|
|
175
162
|
_create_class(StringValueChecker, [
|
|
176
163
|
{
|
|
@@ -200,10 +187,9 @@ var StringValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
200
187
|
var NumberValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
201
188
|
"use strict";
|
|
202
189
|
_inherits(NumberValueChecker, ValueChecker);
|
|
203
|
-
var _super = _create_super(NumberValueChecker);
|
|
204
190
|
function NumberValueChecker() {
|
|
205
191
|
_class_call_check(this, NumberValueChecker);
|
|
206
|
-
return
|
|
192
|
+
return _call_super(this, NumberValueChecker, arguments);
|
|
207
193
|
}
|
|
208
194
|
_create_class(NumberValueChecker, [
|
|
209
195
|
{
|
|
@@ -232,10 +218,9 @@ var NumberValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
232
218
|
var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
233
219
|
"use strict";
|
|
234
220
|
_inherits(StringArrayValueChecker, ValueChecker);
|
|
235
|
-
var _super = _create_super(StringArrayValueChecker);
|
|
236
221
|
function StringArrayValueChecker() {
|
|
237
222
|
_class_call_check(this, StringArrayValueChecker);
|
|
238
|
-
return
|
|
223
|
+
return _call_super(this, StringArrayValueChecker, arguments);
|
|
239
224
|
}
|
|
240
225
|
_create_class(StringArrayValueChecker, [
|
|
241
226
|
{
|
|
@@ -277,10 +262,9 @@ var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
277
262
|
var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
278
263
|
"use strict";
|
|
279
264
|
_inherits(NumberArrayValueChecker, ValueChecker);
|
|
280
|
-
var _super = _create_super(NumberArrayValueChecker);
|
|
281
265
|
function NumberArrayValueChecker() {
|
|
282
266
|
_class_call_check(this, NumberArrayValueChecker);
|
|
283
|
-
return
|
|
267
|
+
return _call_super(this, NumberArrayValueChecker, arguments);
|
|
284
268
|
}
|
|
285
269
|
_create_class(NumberArrayValueChecker, [
|
|
286
270
|
{
|
|
@@ -328,10 +312,9 @@ var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
328
312
|
var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
329
313
|
"use strict";
|
|
330
314
|
_inherits(MoneyValueChecker, ValueChecker);
|
|
331
|
-
var _super = _create_super(MoneyValueChecker);
|
|
332
315
|
function MoneyValueChecker() {
|
|
333
316
|
_class_call_check(this, MoneyValueChecker);
|
|
334
|
-
return
|
|
317
|
+
return _call_super(this, MoneyValueChecker, arguments);
|
|
335
318
|
}
|
|
336
319
|
_create_class(MoneyValueChecker, [
|
|
337
320
|
{
|
|
@@ -379,10 +362,9 @@ var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
379
362
|
var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
380
363
|
"use strict";
|
|
381
364
|
_inherits(TimeScopeValueChecker, ValueChecker);
|
|
382
|
-
var _super = _create_super(TimeScopeValueChecker);
|
|
383
365
|
function TimeScopeValueChecker() {
|
|
384
366
|
_class_call_check(this, TimeScopeValueChecker);
|
|
385
|
-
return
|
|
367
|
+
return _call_super(this, TimeScopeValueChecker, arguments);
|
|
386
368
|
}
|
|
387
369
|
_create_class(TimeScopeValueChecker, [
|
|
388
370
|
{
|
|
@@ -427,10 +409,9 @@ var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
427
409
|
var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
428
410
|
"use strict";
|
|
429
411
|
_inherits(CalcValueChecker, ValueChecker);
|
|
430
|
-
var _super = _create_super(CalcValueChecker);
|
|
431
412
|
function CalcValueChecker() {
|
|
432
413
|
_class_call_check(this, CalcValueChecker);
|
|
433
|
-
return
|
|
414
|
+
return _call_super(this, CalcValueChecker, arguments);
|
|
434
415
|
}
|
|
435
416
|
_create_class(CalcValueChecker, [
|
|
436
417
|
{
|
|
@@ -478,10 +459,9 @@ var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
|
478
459
|
var AddressValueChecker = /*#__PURE__*/ function(ValueChecker) {
|
|
479
460
|
"use strict";
|
|
480
461
|
_inherits(AddressValueChecker, ValueChecker);
|
|
481
|
-
var _super = _create_super(AddressValueChecker);
|
|
482
462
|
function AddressValueChecker() {
|
|
483
463
|
_class_call_check(this, AddressValueChecker);
|
|
484
|
-
return
|
|
464
|
+
return _call_super(this, AddressValueChecker, arguments);
|
|
485
465
|
}
|
|
486
466
|
_create_class(AddressValueChecker, [
|
|
487
467
|
{
|
|
@@ -217,7 +217,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
217
217
|
key: "engineAddEventListener",
|
|
218
218
|
value: function engineAddEventListener(eventKey, controlEventKey) {
|
|
219
219
|
var _this = this;
|
|
220
|
-
this.engine.on(eventKey, function() {
|
|
220
|
+
this.engine.on(eventKey, /*#__PURE__*/ function() {
|
|
221
221
|
var _ref = _async_to_generator(function(payload) {
|
|
222
222
|
return _ts_generator(this, function(_state) {
|
|
223
223
|
switch(_state.label){
|
|
@@ -272,7 +272,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
272
272
|
}
|
|
273
273
|
return [
|
|
274
274
|
4,
|
|
275
|
-
Promise.all(events[name].map(function() {
|
|
275
|
+
Promise.all(events[name].map(/*#__PURE__*/ function() {
|
|
276
276
|
var _ref = _async_to_generator(function(eventName) {
|
|
277
277
|
var execResult;
|
|
278
278
|
return _ts_generator(this, function(_state) {
|
|
@@ -224,7 +224,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
224
224
|
Object.entries(LifecycleEventKeyMap).forEach(function(param) {
|
|
225
225
|
var _param = _sliced_to_array(param, 2), engineKey = _param[0], lifecycleKey = _param[1];
|
|
226
226
|
var _this1 = _this;
|
|
227
|
-
engine.on(engineKey, function() {
|
|
227
|
+
engine.on(engineKey, /*#__PURE__*/ function() {
|
|
228
228
|
var _ref = _async_to_generator(function(payload) {
|
|
229
229
|
var result;
|
|
230
230
|
return _ts_generator(this, function(_state) {
|
|
@@ -278,7 +278,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
278
278
|
}
|
|
279
279
|
return [
|
|
280
280
|
4,
|
|
281
|
-
Promise.all(events[name].map(function() {
|
|
281
|
+
Promise.all(events[name].map(/*#__PURE__*/ function() {
|
|
282
282
|
var _ref = _async_to_generator(function(eventName) {
|
|
283
283
|
var execResult;
|
|
284
284
|
return _ts_generator(this, function(_state) {
|