@byteluck-fe/model-driven-core 2.9.0 → 2.9.1-beta.1
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 +40 -42
- 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 +6 -6
- 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 +489 -516
- 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 -71
- 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 +880 -878
- 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) {
|
|
@@ -231,12 +235,10 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
231
235
|
_define_property(this, "eventKeys", []);
|
|
232
236
|
_define_property(this, "customEvents", []);
|
|
233
237
|
_define_property(this, "parent", null);
|
|
234
|
-
_define_property(this, "slots", void 0);
|
|
235
|
-
_define_property(this, "slotPosition", void 0);
|
|
236
238
|
_define_property(this, "updateSetting", updateSetting);
|
|
237
239
|
_define_property(this, "removeSetting", removeSetting);
|
|
238
|
-
this._callControlHooks(
|
|
239
|
-
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
|
|
240
|
+
this._callControlHooks('preInstance', props);
|
|
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;
|
|
240
242
|
if (!(controlName && controlIcon && controlType)) {
|
|
241
243
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
242
244
|
}
|
|
@@ -248,16 +250,14 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
248
250
|
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
249
251
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props, (_instanceof(this, Control) ? this.constructor : void 0).controlName);
|
|
250
252
|
var _props_controlType;
|
|
251
|
-
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';
|
|
252
254
|
this.setting = JSONCopy(setting);
|
|
253
255
|
var _props_fieldType;
|
|
254
256
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
255
257
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
256
258
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
257
|
-
this.slots = JSONCopy(slots);
|
|
258
|
-
this.slotPosition = JSONCopy(slotPosition);
|
|
259
259
|
Promise.resolve().then(function() {
|
|
260
|
-
_this._callControlHooks(
|
|
260
|
+
_this._callControlHooks('postInstance', props);
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
_create_class(Control, [
|
|
@@ -289,14 +289,14 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
289
289
|
key: "preUpdate",
|
|
290
290
|
value: function preUpdate(key, value) {
|
|
291
291
|
// 在修改props之前
|
|
292
|
-
this._callControlHooks(
|
|
292
|
+
this._callControlHooks('preUpdateProps', key, value);
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
295
|
{
|
|
296
296
|
key: "postUpdate",
|
|
297
297
|
value: function postUpdate(key, value) {
|
|
298
298
|
// 在修改props之后
|
|
299
|
-
this._callControlHooks(
|
|
299
|
+
this._callControlHooks('postUpdateProps', key, value);
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
302
|
{
|
|
@@ -321,7 +321,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
321
321
|
rules = _object_spread({}, _this.rules);
|
|
322
322
|
return [
|
|
323
323
|
4,
|
|
324
|
-
_this._callControlHooks(
|
|
324
|
+
_this._callControlHooks('preValidate', rules)
|
|
325
325
|
];
|
|
326
326
|
case 1:
|
|
327
327
|
results = _state.sent();
|
|
@@ -414,13 +414,13 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
414
414
|
dataBindModelType.dataBind = dataBind;
|
|
415
415
|
}
|
|
416
416
|
switch(optionConfig){
|
|
417
|
-
case
|
|
417
|
+
case 'datasource':
|
|
418
418
|
case undefined:
|
|
419
419
|
if (datasourceBind) {
|
|
420
420
|
dataBindModelType.datasourceBind = datasourceBind;
|
|
421
421
|
}
|
|
422
422
|
break;
|
|
423
|
-
case
|
|
423
|
+
case 'custom':
|
|
424
424
|
dataBindModelType.props.options = options;
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
@@ -443,7 +443,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
443
443
|
key: "preToSchema",
|
|
444
444
|
value: function preToSchema() {
|
|
445
445
|
// 在处理Schema之前,预留的钩子函数,允许在toSchema之前处理一些数据
|
|
446
|
-
this._callControlHooks(
|
|
446
|
+
this._callControlHooks('preToSchema', this);
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
{
|
|
@@ -463,7 +463,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
463
463
|
{
|
|
464
464
|
key: "updateBasicControl",
|
|
465
465
|
value: function updateBasicControl(key, setting) {
|
|
466
|
-
if (key !==
|
|
466
|
+
if (key !== 'setting') return;
|
|
467
467
|
if (setting.add) {
|
|
468
468
|
var _this_setting;
|
|
469
469
|
(_this_setting = this.setting).push.apply(_this_setting, _to_consumable_array(setting.add));
|
|
@@ -479,12 +479,10 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
479
479
|
]);
|
|
480
480
|
return Control;
|
|
481
481
|
}();
|
|
482
|
-
_define_property(Control, "mode",
|
|
483
|
-
_define_property(Control, "
|
|
484
|
-
_define_property(Control, "
|
|
485
|
-
_define_property(Control, "
|
|
486
|
-
_define_property(Control, "controlIcon", "icon");
|
|
487
|
-
_define_property(Control, "controlType", "control");
|
|
482
|
+
_define_property(Control, "mode", 'Designer');
|
|
483
|
+
_define_property(Control, "controlName", '控件');
|
|
484
|
+
_define_property(Control, "controlIcon", 'icon');
|
|
485
|
+
_define_property(Control, "controlType", 'control');
|
|
488
486
|
_define_property(Control, "controlFieldType", void 0);
|
|
489
487
|
// 控件可以触发的事件key
|
|
490
488
|
_define_property(Control, "controlEventKeys", []);
|
|
@@ -498,10 +496,10 @@ _define_property(Control, "removeSettingItem", removeSetting);
|
|
|
498
496
|
_define_property(Control, "updateSettingItem", updateSetting);
|
|
499
497
|
export default Control;
|
|
500
498
|
export { Control as DesignerControl };
|
|
501
|
-
/**
|
|
502
|
-
* @function 删除控件或者实例上的setting的方法
|
|
503
|
-
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
504
|
-
* @param keys 需要删除的key或key组成的数组
|
|
499
|
+
/**
|
|
500
|
+
* @function 删除控件或者实例上的setting的方法
|
|
501
|
+
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
502
|
+
* @param keys 需要删除的key或key组成的数组
|
|
505
503
|
* */ function removeSetting(keys) {
|
|
506
504
|
var _this = this;
|
|
507
505
|
var deleteKeys = Array.isArray(keys) ? keys : [
|
|
@@ -510,7 +508,7 @@ export { Control as DesignerControl };
|
|
|
510
508
|
deleteKeys.forEach(function(deleteKey) {
|
|
511
509
|
var _this_setting;
|
|
512
510
|
// 是否存在子项
|
|
513
|
-
var isHasItem = typeof deleteKey !==
|
|
511
|
+
var isHasItem = typeof deleteKey !== 'string';
|
|
514
512
|
// 判断setting是否是自定义控件setting项
|
|
515
513
|
// @ts-ignore
|
|
516
514
|
var settingIndex = (_this_setting = _this.setting) === null || _this_setting === void 0 ? void 0 : _this_setting.findIndex(function(option) {
|
|
@@ -529,16 +527,16 @@ export { Control as DesignerControl };
|
|
|
529
527
|
}
|
|
530
528
|
});
|
|
531
529
|
}
|
|
532
|
-
/**
|
|
533
|
-
* @function 修改控件或者实例上的setting的方法
|
|
534
|
-
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
535
|
-
* @param settingKey 需要修改的key或者key组成的数组
|
|
536
|
-
* @param value 修改之后的visible值
|
|
537
|
-
* @param value.showItems 需要添加或替换的showItems
|
|
538
|
-
* @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新增
|
|
539
537
|
* */ function updateSetting(settingKey, value) {
|
|
540
538
|
var _this = this;
|
|
541
|
-
var keys = typeof settingKey ===
|
|
539
|
+
var keys = typeof settingKey === 'string' ? [
|
|
542
540
|
settingKey
|
|
543
541
|
] : settingKey;
|
|
544
542
|
keys.forEach(function(key) {
|
|
@@ -547,12 +545,12 @@ export { Control as DesignerControl };
|
|
|
547
545
|
return item.key === key;
|
|
548
546
|
});
|
|
549
547
|
if (settingItem) {
|
|
550
|
-
if (typeof value ===
|
|
548
|
+
if (typeof value === 'boolean') {
|
|
551
549
|
settingItem.visible = value;
|
|
552
|
-
} else if (typeof value === "
|
|
550
|
+
} else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object') {
|
|
553
551
|
var _value_type;
|
|
554
|
-
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type :
|
|
555
|
-
if (type ===
|
|
552
|
+
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type : 'replace';
|
|
553
|
+
if (type === 'replace') {
|
|
556
554
|
settingItem.showItems = value.showItems;
|
|
557
555
|
} else {
|
|
558
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", []);
|