@byteluck-fe/model-driven-core 2.8.2-beta.1 → 2.8.2-beta.13
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/README.md +69 -69
- package/dist/esm/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +39 -35
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +24 -37
- package/dist/esm/common/BaseControl/runtime.js +6 -6
- package/dist/esm/common/ColumnControl/designer.js +105 -27
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +71 -95
- package/dist/esm/common/ColumnControl/runtime.js +16 -27
- package/dist/esm/common/ControlArray.js +5 -5
- package/dist/esm/common/FormControl/designer.js +17 -30
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +119 -147
- package/dist/esm/common/FormControl/runtime.js +14 -28
- package/dist/esm/common/LayoutControl/designer.js +17 -33
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +13 -24
- package/dist/esm/common/LayoutControl/runtime.js +16 -30
- package/dist/esm/common/ListControl/designer.js +16 -29
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +16 -33
- package/dist/esm/common/ListControl/runtime.js +17 -31
- package/dist/esm/common/SearchViewControl/designer.js +14 -27
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +14 -26
- package/dist/esm/common/SearchViewControl/runtime.js +14 -27
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +14 -27
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +13 -24
- package/dist/esm/common/WrapControl/runtime.js +14 -27
- package/dist/esm/common/controlHooksEmitter.js +1 -1
- package/dist/esm/common/index.js +12 -12
- package/dist/esm/common/initLinkOperationRules.js +5 -5
- package/dist/esm/common/initOptionAndDataSourceRules.js +74 -74
- package/dist/esm/framework/RegisterControls.js +9 -8
- package/dist/esm/framework/index.js +144 -174
- package/dist/esm/index.js +4 -4
- package/dist/index.umd.js +1 -1
- package/dist/types/api-doc-index.d.ts +4 -4
- package/dist/types/common/BaseControl/designer.d.ts +63 -63
- package/dist/types/common/BaseControl/index.d.ts +13 -13
- package/dist/types/common/BaseControl/property.d.ts +38 -38
- package/dist/types/common/BaseControl/runtime.d.ts +23 -23
- package/dist/types/common/BaseControl/types.d.ts +35 -35
- package/dist/types/common/ColumnControl/designer.d.ts +20 -10
- package/dist/types/common/ColumnControl/index.d.ts +12 -12
- package/dist/types/common/ColumnControl/property.d.ts +74 -73
- package/dist/types/common/ColumnControl/runtime.d.ts +11 -10
- package/dist/types/common/ControlArray.d.ts +9 -9
- package/dist/types/common/FormControl/designer.d.ts +13 -13
- package/dist/types/common/FormControl/index.d.ts +12 -12
- package/dist/types/common/FormControl/property.d.ts +100 -100
- package/dist/types/common/FormControl/runtime.d.ts +11 -11
- package/dist/types/common/LayoutControl/designer.d.ts +21 -21
- package/dist/types/common/LayoutControl/index.d.ts +12 -12
- package/dist/types/common/LayoutControl/property.d.ts +6 -6
- package/dist/types/common/LayoutControl/runtime.d.ts +11 -11
- package/dist/types/common/ListControl/designer.d.ts +16 -16
- package/dist/types/common/ListControl/index.d.ts +12 -12
- package/dist/types/common/ListControl/property.d.ts +18 -18
- package/dist/types/common/ListControl/runtime.d.ts +12 -12
- package/dist/types/common/SearchViewControl/designer.d.ts +11 -11
- package/dist/types/common/SearchViewControl/index.d.ts +12 -12
- package/dist/types/common/SearchViewControl/property.d.ts +8 -8
- package/dist/types/common/SearchViewControl/runtime.d.ts +11 -11
- package/dist/types/common/Validator.d.ts +15 -15
- package/dist/types/common/WrapControl/designer.d.ts +11 -11
- package/dist/types/common/WrapControl/index.d.ts +12 -12
- package/dist/types/common/WrapControl/property.d.ts +6 -6
- package/dist/types/common/WrapControl/runtime.d.ts +11 -11
- package/dist/types/common/controlHooksEmitter.d.ts +4 -4
- package/dist/types/common/index.d.ts +12 -12
- package/dist/types/common/initLinkOperationRules.d.ts +6 -6
- package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -10
- package/dist/types/framework/RegisterControls.d.ts +37 -37
- package/dist/types/framework/index.d.ts +881 -880
- package/dist/types/framework/isDataBind.d.ts +2 -2
- package/dist/types/index.d.ts +4 -4
- package/dist/types/type.d.ts +91 -91
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
# Core
|
|
2
|
-
引擎控件核心定义
|
|
3
|
-
|
|
4
|
-
定义了控件的基类和一些工具类的实现
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
│ index.ts // 入口文件
|
|
8
|
-
│ type.ts // 类型
|
|
9
|
-
│
|
|
10
|
-
├─common // 基础类
|
|
11
|
-
│ │ ControlArray.ts // 控件数组,管理设计态和运行态的children和headers数组
|
|
12
|
-
│ │ controlHooksEmitter.ts // 旧版设计态的控件事件发布,暂时不可废弃
|
|
13
|
-
│ │ index.ts
|
|
14
|
-
│ │ initOptionAndDataSourceRules.ts // 关联数据源和自定义选项的校验规则
|
|
15
|
-
│ │ Validator.ts // 校验
|
|
16
|
-
│ │
|
|
17
|
-
│ ├─BaseControl // 基础控件
|
|
18
|
-
│ │ designer.ts
|
|
19
|
-
│ │ index.ts
|
|
20
|
-
│ │ property.ts
|
|
21
|
-
│ │ runtime.ts
|
|
22
|
-
│ │ types.ts
|
|
23
|
-
│ │
|
|
24
|
-
│ ├─ColumnControl // 列控件
|
|
25
|
-
│ │ designer.ts
|
|
26
|
-
│ │ index.ts
|
|
27
|
-
│ │ property.ts
|
|
28
|
-
│ │ runtime.ts
|
|
29
|
-
│ │ types.ts
|
|
30
|
-
│ │
|
|
31
|
-
│ ├─FormControl // 表单控件
|
|
32
|
-
│ │ designer.ts
|
|
33
|
-
│ │ index.ts
|
|
34
|
-
│ │ property.ts
|
|
35
|
-
│ │ runtime.ts
|
|
36
|
-
│ │ types.ts
|
|
37
|
-
│ │
|
|
38
|
-
│ ├─LayoutControl // 布局控件
|
|
39
|
-
│ │ designer.ts
|
|
40
|
-
│ │ index.ts
|
|
41
|
-
│ │ property.ts
|
|
42
|
-
│ │ runtime.ts
|
|
43
|
-
│ │ types.ts
|
|
44
|
-
│ │
|
|
45
|
-
│ ├─ListControl // 列表控件
|
|
46
|
-
│ │ designer.ts
|
|
47
|
-
│ │ index.ts
|
|
48
|
-
│ │ property.ts
|
|
49
|
-
│ │ runtime.ts
|
|
50
|
-
│ │ types.ts
|
|
51
|
-
│ │
|
|
52
|
-
│ ├─SearchViewControl // 查询容器控件
|
|
53
|
-
│ │ designer.ts
|
|
54
|
-
│ │ index.ts
|
|
55
|
-
│ │ property.ts
|
|
56
|
-
│ │ runtime.ts
|
|
57
|
-
│ │ types.ts
|
|
58
|
-
│ │
|
|
59
|
-
│ └─WrapControl // 容器控件
|
|
60
|
-
│ designer.ts
|
|
61
|
-
│ index.ts
|
|
62
|
-
│ property.ts
|
|
63
|
-
│ runtime.ts
|
|
64
|
-
│ types.ts
|
|
65
|
-
│
|
|
66
|
-
└─framework // 工具类
|
|
67
|
-
index.ts // 很多工具类
|
|
68
|
-
RegisterControls.ts // 注册和管理控件类,被Runtime和Designer继承
|
|
69
|
-
```
|
|
1
|
+
# Core
|
|
2
|
+
引擎控件核心定义
|
|
3
|
+
|
|
4
|
+
定义了控件的基类和一些工具类的实现
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
│ index.ts // 入口文件
|
|
8
|
+
│ type.ts // 类型
|
|
9
|
+
│
|
|
10
|
+
├─common // 基础类
|
|
11
|
+
│ │ ControlArray.ts // 控件数组,管理设计态和运行态的children和headers数组
|
|
12
|
+
│ │ controlHooksEmitter.ts // 旧版设计态的控件事件发布,暂时不可废弃
|
|
13
|
+
│ │ index.ts
|
|
14
|
+
│ │ initOptionAndDataSourceRules.ts // 关联数据源和自定义选项的校验规则
|
|
15
|
+
│ │ Validator.ts // 校验
|
|
16
|
+
│ │
|
|
17
|
+
│ ├─BaseControl // 基础控件
|
|
18
|
+
│ │ designer.ts
|
|
19
|
+
│ │ index.ts
|
|
20
|
+
│ │ property.ts
|
|
21
|
+
│ │ runtime.ts
|
|
22
|
+
│ │ types.ts
|
|
23
|
+
│ │
|
|
24
|
+
│ ├─ColumnControl // 列控件
|
|
25
|
+
│ │ designer.ts
|
|
26
|
+
│ │ index.ts
|
|
27
|
+
│ │ property.ts
|
|
28
|
+
│ │ runtime.ts
|
|
29
|
+
│ │ types.ts
|
|
30
|
+
│ │
|
|
31
|
+
│ ├─FormControl // 表单控件
|
|
32
|
+
│ │ designer.ts
|
|
33
|
+
│ │ index.ts
|
|
34
|
+
│ │ property.ts
|
|
35
|
+
│ │ runtime.ts
|
|
36
|
+
│ │ types.ts
|
|
37
|
+
│ │
|
|
38
|
+
│ ├─LayoutControl // 布局控件
|
|
39
|
+
│ │ designer.ts
|
|
40
|
+
│ │ index.ts
|
|
41
|
+
│ │ property.ts
|
|
42
|
+
│ │ runtime.ts
|
|
43
|
+
│ │ types.ts
|
|
44
|
+
│ │
|
|
45
|
+
│ ├─ListControl // 列表控件
|
|
46
|
+
│ │ designer.ts
|
|
47
|
+
│ │ index.ts
|
|
48
|
+
│ │ property.ts
|
|
49
|
+
│ │ runtime.ts
|
|
50
|
+
│ │ types.ts
|
|
51
|
+
│ │
|
|
52
|
+
│ ├─SearchViewControl // 查询容器控件
|
|
53
|
+
│ │ designer.ts
|
|
54
|
+
│ │ index.ts
|
|
55
|
+
│ │ property.ts
|
|
56
|
+
│ │ runtime.ts
|
|
57
|
+
│ │ types.ts
|
|
58
|
+
│ │
|
|
59
|
+
│ └─WrapControl // 容器控件
|
|
60
|
+
│ designer.ts
|
|
61
|
+
│ index.ts
|
|
62
|
+
│ property.ts
|
|
63
|
+
│ runtime.ts
|
|
64
|
+
│ types.ts
|
|
65
|
+
│
|
|
66
|
+
└─framework // 工具类
|
|
67
|
+
index.ts // 很多工具类
|
|
68
|
+
RegisterControls.ts // 注册和管理控件类,被Runtime和Designer继承
|
|
69
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { default as BaseControlProperty } from
|
|
3
|
-
export { default as ColumnControlProperty } from
|
|
4
|
-
export { default as FormControlProperty } from
|
|
1
|
+
export * from './framework/index';
|
|
2
|
+
export { default as BaseControlProperty } from './common/BaseControl/property';
|
|
3
|
+
export { default as ColumnControlProperty } from './common/ColumnControl/property';
|
|
4
|
+
export { default as FormControlProperty } from './common/FormControl/property';
|
|
@@ -107,6 +107,10 @@ function _to_array(arr) {
|
|
|
107
107
|
function _to_consumable_array(arr) {
|
|
108
108
|
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
109
109
|
}
|
|
110
|
+
function _type_of(obj) {
|
|
111
|
+
"@swc/helpers - typeof";
|
|
112
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
113
|
+
}
|
|
110
114
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
111
115
|
if (!o) return;
|
|
112
116
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -210,10 +214,10 @@ function _ts_generator(thisArg, body) {
|
|
|
210
214
|
};
|
|
211
215
|
}
|
|
212
216
|
}
|
|
213
|
-
import Property from
|
|
214
|
-
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from
|
|
215
|
-
import { createValidator } from
|
|
216
|
-
import { controlHooksEmitter } from
|
|
217
|
+
import Property from './property';
|
|
218
|
+
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from '@byteluck-fe/model-driven-shared';
|
|
219
|
+
import { createValidator } from '../Validator';
|
|
220
|
+
import { controlHooksEmitter } from '../controlHooksEmitter';
|
|
217
221
|
var Control = /*#__PURE__*/ function _target() {
|
|
218
222
|
"use strict";
|
|
219
223
|
function Control(props) {
|
|
@@ -233,7 +237,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
233
237
|
_define_property(this, "parent", null);
|
|
234
238
|
_define_property(this, "updateSetting", updateSetting);
|
|
235
239
|
_define_property(this, "removeSetting", removeSetting);
|
|
236
|
-
this._callControlHooks(
|
|
240
|
+
this._callControlHooks('preInstance', props);
|
|
237
241
|
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref.controlName, controlIcon = _ref.controlIcon, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, controlEventKeys = _ref.controlEventKeys, controlCustomEvents = _ref.controlCustomEvents, name = _ref.name, setting = _ref.setting;
|
|
238
242
|
if (!(controlName && controlIcon && controlType)) {
|
|
239
243
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
@@ -246,14 +250,14 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
246
250
|
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
247
251
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props, (_instanceof(this, Control) ? this.constructor : void 0).controlName);
|
|
248
252
|
var _props_controlType;
|
|
249
|
-
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType :
|
|
253
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : 'base';
|
|
250
254
|
this.setting = JSONCopy(setting);
|
|
251
255
|
var _props_fieldType;
|
|
252
256
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
253
257
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
254
258
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
255
259
|
Promise.resolve().then(function() {
|
|
256
|
-
_this._callControlHooks(
|
|
260
|
+
_this._callControlHooks('postInstance', props);
|
|
257
261
|
});
|
|
258
262
|
}
|
|
259
263
|
_create_class(Control, [
|
|
@@ -285,14 +289,14 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
285
289
|
key: "preUpdate",
|
|
286
290
|
value: function preUpdate(key, value) {
|
|
287
291
|
// 在修改props之前
|
|
288
|
-
this._callControlHooks(
|
|
292
|
+
this._callControlHooks('preUpdateProps', key, value);
|
|
289
293
|
}
|
|
290
294
|
},
|
|
291
295
|
{
|
|
292
296
|
key: "postUpdate",
|
|
293
297
|
value: function postUpdate(key, value) {
|
|
294
298
|
// 在修改props之后
|
|
295
|
-
this._callControlHooks(
|
|
299
|
+
this._callControlHooks('postUpdateProps', key, value);
|
|
296
300
|
}
|
|
297
301
|
},
|
|
298
302
|
{
|
|
@@ -317,7 +321,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
317
321
|
rules = _object_spread({}, _this.rules);
|
|
318
322
|
return [
|
|
319
323
|
4,
|
|
320
|
-
_this._callControlHooks(
|
|
324
|
+
_this._callControlHooks('preValidate', rules)
|
|
321
325
|
];
|
|
322
326
|
case 1:
|
|
323
327
|
results = _state.sent();
|
|
@@ -410,13 +414,13 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
410
414
|
dataBindModelType.dataBind = dataBind;
|
|
411
415
|
}
|
|
412
416
|
switch(optionConfig){
|
|
413
|
-
case
|
|
417
|
+
case 'datasource':
|
|
414
418
|
case undefined:
|
|
415
419
|
if (datasourceBind) {
|
|
416
420
|
dataBindModelType.datasourceBind = datasourceBind;
|
|
417
421
|
}
|
|
418
422
|
break;
|
|
419
|
-
case
|
|
423
|
+
case 'custom':
|
|
420
424
|
dataBindModelType.props.options = options;
|
|
421
425
|
break;
|
|
422
426
|
}
|
|
@@ -439,7 +443,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
439
443
|
key: "preToSchema",
|
|
440
444
|
value: function preToSchema() {
|
|
441
445
|
// 在处理Schema之前,预留的钩子函数,允许在toSchema之前处理一些数据
|
|
442
|
-
this._callControlHooks(
|
|
446
|
+
this._callControlHooks('preToSchema', this);
|
|
443
447
|
}
|
|
444
448
|
},
|
|
445
449
|
{
|
|
@@ -459,7 +463,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
459
463
|
{
|
|
460
464
|
key: "updateBasicControl",
|
|
461
465
|
value: function updateBasicControl(key, setting) {
|
|
462
|
-
if (key !==
|
|
466
|
+
if (key !== 'setting') return;
|
|
463
467
|
if (setting.add) {
|
|
464
468
|
var _this_setting;
|
|
465
469
|
(_this_setting = this.setting).push.apply(_this_setting, _to_consumable_array(setting.add));
|
|
@@ -475,10 +479,10 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
475
479
|
]);
|
|
476
480
|
return Control;
|
|
477
481
|
}();
|
|
478
|
-
_define_property(Control, "mode",
|
|
479
|
-
_define_property(Control, "controlName",
|
|
480
|
-
_define_property(Control, "controlIcon",
|
|
481
|
-
_define_property(Control, "controlType",
|
|
482
|
+
_define_property(Control, "mode", 'Designer');
|
|
483
|
+
_define_property(Control, "controlName", '控件');
|
|
484
|
+
_define_property(Control, "controlIcon", 'icon');
|
|
485
|
+
_define_property(Control, "controlType", 'control');
|
|
482
486
|
_define_property(Control, "controlFieldType", void 0);
|
|
483
487
|
// 控件可以触发的事件key
|
|
484
488
|
_define_property(Control, "controlEventKeys", []);
|
|
@@ -492,10 +496,10 @@ _define_property(Control, "removeSettingItem", removeSetting);
|
|
|
492
496
|
_define_property(Control, "updateSettingItem", updateSetting);
|
|
493
497
|
export default Control;
|
|
494
498
|
export { Control as DesignerControl };
|
|
495
|
-
/**
|
|
496
|
-
* @function 删除控件或者实例上的setting的方法
|
|
497
|
-
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
498
|
-
* @param keys 需要删除的key或key组成的数组
|
|
499
|
+
/**
|
|
500
|
+
* @function 删除控件或者实例上的setting的方法
|
|
501
|
+
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
502
|
+
* @param keys 需要删除的key或key组成的数组
|
|
499
503
|
* */ function removeSetting(keys) {
|
|
500
504
|
var _this = this;
|
|
501
505
|
var deleteKeys = Array.isArray(keys) ? keys : [
|
|
@@ -504,7 +508,7 @@ export { Control as DesignerControl };
|
|
|
504
508
|
deleteKeys.forEach(function(deleteKey) {
|
|
505
509
|
var _this_setting;
|
|
506
510
|
// 是否存在子项
|
|
507
|
-
var isHasItem = typeof deleteKey !==
|
|
511
|
+
var isHasItem = typeof deleteKey !== 'string';
|
|
508
512
|
// 判断setting是否是自定义控件setting项
|
|
509
513
|
// @ts-ignore
|
|
510
514
|
var settingIndex = (_this_setting = _this.setting) === null || _this_setting === void 0 ? void 0 : _this_setting.findIndex(function(option) {
|
|
@@ -523,16 +527,16 @@ export { Control as DesignerControl };
|
|
|
523
527
|
}
|
|
524
528
|
});
|
|
525
529
|
}
|
|
526
|
-
/**
|
|
527
|
-
* @function 修改控件或者实例上的setting的方法
|
|
528
|
-
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
529
|
-
* @param settingKey 需要修改的key或者key组成的数组
|
|
530
|
-
* @param value 修改之后的visible值
|
|
531
|
-
* @param value.showItems 需要添加或替换的showItems
|
|
532
|
-
* @param value.type 默认是replace替换,可以更改为push新增
|
|
530
|
+
/**
|
|
531
|
+
* @function 修改控件或者实例上的setting的方法
|
|
532
|
+
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
533
|
+
* @param settingKey 需要修改的key或者key组成的数组
|
|
534
|
+
* @param value 修改之后的visible值
|
|
535
|
+
* @param value.showItems 需要添加或替换的showItems
|
|
536
|
+
* @param value.type 默认是replace替换,可以更改为push新增
|
|
533
537
|
* */ function updateSetting(settingKey, value) {
|
|
534
538
|
var _this = this;
|
|
535
|
-
var keys = typeof settingKey ===
|
|
539
|
+
var keys = typeof settingKey === 'string' ? [
|
|
536
540
|
settingKey
|
|
537
541
|
] : settingKey;
|
|
538
542
|
keys.forEach(function(key) {
|
|
@@ -541,12 +545,12 @@ export { Control as DesignerControl };
|
|
|
541
545
|
return item.key === key;
|
|
542
546
|
});
|
|
543
547
|
if (settingItem) {
|
|
544
|
-
if (typeof value ===
|
|
548
|
+
if (typeof value === 'boolean') {
|
|
545
549
|
settingItem.visible = value;
|
|
546
|
-
} else if (typeof value === "
|
|
550
|
+
} else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object') {
|
|
547
551
|
var _value_type;
|
|
548
|
-
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type :
|
|
549
|
-
if (type ===
|
|
552
|
+
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type : 'replace';
|
|
553
|
+
if (type === 'replace') {
|
|
550
554
|
settingItem.showItems = value.showItems;
|
|
551
555
|
} else {
|
|
552
556
|
var _settingItem_showItems;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from './designer';
|
|
2
|
+
import Runtime from './runtime';
|
|
3
|
+
import Property from './property';
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|
|
12
|
+
export * from './types';
|
|
@@ -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");
|
|
@@ -105,65 +109,48 @@ function _wrap_native_super(Class) {
|
|
|
105
109
|
return _wrap_native_super(Class);
|
|
106
110
|
}
|
|
107
111
|
function _is_native_reflect_construct() {
|
|
108
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
109
|
-
if (Reflect.construct.sham) return false;
|
|
110
|
-
if (typeof Proxy === "function") return true;
|
|
111
112
|
try {
|
|
112
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function _create_super(Derived) {
|
|
119
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
120
|
-
return function _createSuperInternal() {
|
|
121
|
-
var Super = _get_prototype_of(Derived), result;
|
|
122
|
-
if (hasNativeReflectConstruct) {
|
|
123
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
124
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
125
|
-
} else {
|
|
126
|
-
result = Super.apply(this, arguments);
|
|
127
|
-
}
|
|
128
|
-
return _possible_constructor_return(this, result);
|
|
129
|
-
};
|
|
113
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
114
|
+
} catch (_) {}
|
|
115
|
+
return (_is_native_reflect_construct = function() {
|
|
116
|
+
return !!result;
|
|
117
|
+
})();
|
|
130
118
|
}
|
|
131
|
-
import { BaseStyle } from
|
|
119
|
+
import { BaseStyle } from '../../framework';
|
|
132
120
|
var PropertyRules = function PropertyRules(props) {
|
|
133
121
|
"use strict";
|
|
134
122
|
_class_call_check(this, PropertyRules);
|
|
135
123
|
_define_property(this, "isHide", {
|
|
136
|
-
type:
|
|
124
|
+
type: 'boolean'
|
|
137
125
|
});
|
|
138
126
|
};
|
|
139
127
|
var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
140
128
|
"use strict";
|
|
141
129
|
_inherits(PropertyRuntimeRules, Array1);
|
|
142
|
-
var _super = _create_super(PropertyRuntimeRules);
|
|
143
130
|
function PropertyRuntimeRules(props) {
|
|
144
131
|
_class_call_check(this, PropertyRuntimeRules);
|
|
145
|
-
return
|
|
132
|
+
return _call_super(this, PropertyRuntimeRules);
|
|
146
133
|
}
|
|
147
134
|
return PropertyRuntimeRules;
|
|
148
135
|
}(_wrap_native_super(Array));
|
|
149
|
-
/**
|
|
150
|
-
* 全局属性
|
|
151
|
-
* @public
|
|
136
|
+
/**
|
|
137
|
+
* 全局属性
|
|
138
|
+
* @public
|
|
152
139
|
*/ var Property = function Property(props) {
|
|
153
140
|
"use strict";
|
|
154
|
-
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
141
|
+
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
155
142
|
_class_call_check(this, Property);
|
|
156
|
-
/**
|
|
157
|
-
* 是否隐藏
|
|
158
|
-
* @public
|
|
159
|
-
* @defaultValue false
|
|
143
|
+
/**
|
|
144
|
+
* 是否隐藏
|
|
145
|
+
* @public
|
|
146
|
+
* @defaultValue false
|
|
160
147
|
*/ _define_property(this, "isHide", void 0);
|
|
161
148
|
_define_property(this, "className", void 0);
|
|
162
149
|
_define_property(this, "style", void 0);
|
|
163
|
-
/**
|
|
164
|
-
* 标题
|
|
165
|
-
* @public
|
|
166
|
-
* @defaultValue ''
|
|
150
|
+
/**
|
|
151
|
+
* 标题
|
|
152
|
+
* @public
|
|
153
|
+
* @defaultValue ''
|
|
167
154
|
*/ _define_property(this, "caption", void 0);
|
|
168
155
|
var _props_isHide;
|
|
169
156
|
this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
|
|
@@ -37,9 +37,9 @@ function _instanceof(left, right) {
|
|
|
37
37
|
return left instanceof right;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
import Property from
|
|
41
|
-
import { genNonDuplicateId, referenceError } from
|
|
42
|
-
import { PAGE_STATUS } from
|
|
40
|
+
import Property from './property';
|
|
41
|
+
import { genNonDuplicateId, referenceError } from '@byteluck-fe/model-driven-shared';
|
|
42
|
+
import { PAGE_STATUS } from '../../framework';
|
|
43
43
|
var Control = /*#__PURE__*/ function _target() {
|
|
44
44
|
"use strict";
|
|
45
45
|
function Control(props) {
|
|
@@ -64,7 +64,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
64
64
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props);
|
|
65
65
|
this.customEvents = controlCustomEvents;
|
|
66
66
|
var _props_controlType;
|
|
67
|
-
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType :
|
|
67
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : 'base';
|
|
68
68
|
var _props_fieldType;
|
|
69
69
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
70
70
|
var _props_pageStatus;
|
|
@@ -85,8 +85,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
85
85
|
]);
|
|
86
86
|
return Control;
|
|
87
87
|
}();
|
|
88
|
-
_define_property(Control, "mode",
|
|
89
|
-
_define_property(Control, "controlType",
|
|
88
|
+
_define_property(Control, "mode", 'Runtime');
|
|
89
|
+
_define_property(Control, "controlType", 'control');
|
|
90
90
|
_define_property(Control, "controlFieldType", void 0);
|
|
91
91
|
_define_property(Control, "__is_control__", true);
|
|
92
92
|
_define_property(Control, "controlCustomEvents", []);
|