@byteluck-fe/model-driven-core 4.36.0-lx1 → 6.1.0-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/common/BaseControl/designer.js +22 -14
- package/dist/esm/common/BaseControl/property.js +16 -11
- package/dist/esm/common/BaseControl/runtime.js +2 -1
- package/dist/esm/common/ColumnControl/property.js +34 -34
- package/dist/esm/common/FormControl/property.js +59 -76
- package/dist/esm/common/ListControl/designer.js +8 -10
- package/dist/esm/common/Validator.js +1 -0
- package/dist/esm/common/initLinkOperationRules.js +2 -2
- package/dist/esm/common/initOptionAndDataSourceRules.js +31 -30
- package/dist/esm/framework/RegisterControls.js +13 -13
- package/dist/esm/framework/index.js +114 -23
- 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 +71 -63
- package/dist/types/common/BaseControl/index.d.ts +13 -13
- package/dist/types/common/BaseControl/property.d.ts +44 -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 -20
- package/dist/types/common/ColumnControl/index.d.ts +12 -12
- package/dist/types/common/ColumnControl/property.d.ts +74 -74
- package/dist/types/common/ColumnControl/runtime.d.ts +11 -11
- 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 -118
- 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 +944 -898
- 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
|
+
```
|
|
@@ -210,6 +210,7 @@ function _ts_generator(thisArg, body) {
|
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
213
214
|
import Property from './property';
|
|
214
215
|
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from '@byteluck-fe/model-driven-shared';
|
|
215
216
|
import { createValidator } from '../Validator';
|
|
@@ -219,7 +220,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
219
220
|
function Control(props) {
|
|
220
221
|
var _this = this;
|
|
221
222
|
_class_call_check(this, Control);
|
|
222
|
-
_define_property(this, "id", void 0
|
|
223
|
+
_define_property(this, "id", void 0 // 唯一标识符
|
|
224
|
+
);
|
|
223
225
|
_define_property(this, "name", void 0);
|
|
224
226
|
_define_property(this, "icon", void 0);
|
|
225
227
|
_define_property(this, "type", void 0);
|
|
@@ -230,10 +232,12 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
230
232
|
_define_property(this, "eventKeys", []);
|
|
231
233
|
_define_property(this, "customEvents", []);
|
|
232
234
|
_define_property(this, "parent", null);
|
|
235
|
+
_define_property(this, "slots", void 0);
|
|
236
|
+
_define_property(this, "slotPosition", void 0);
|
|
233
237
|
_define_property(this, "updateSetting", updateSetting);
|
|
234
238
|
_define_property(this, "removeSetting", removeSetting);
|
|
235
239
|
this._callControlHooks('preInstance', props);
|
|
236
|
-
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
|
+
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, slots = _ref.slots, slotPosition = _ref.slotPosition;
|
|
237
241
|
if (!(controlName && controlIcon && controlType)) {
|
|
238
242
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
239
243
|
}
|
|
@@ -251,6 +255,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
251
255
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
252
256
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
253
257
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
258
|
+
this.slots = JSONCopy(slots);
|
|
259
|
+
this.slotPosition = JSONCopy(slotPosition);
|
|
254
260
|
Promise.resolve().then(function() {
|
|
255
261
|
_this._callControlHooks('postInstance', props);
|
|
256
262
|
});
|
|
@@ -473,7 +479,9 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
473
479
|
return Control;
|
|
474
480
|
}();
|
|
475
481
|
_define_property(Control, "mode", 'Designer');
|
|
476
|
-
_define_property(Control, "
|
|
482
|
+
_define_property(Control, "slots", void 0);
|
|
483
|
+
_define_property(Control, "slotPosition", void 0);
|
|
484
|
+
_define_property(Control, "controlName", getLocaleText('CMD.c81c1751969095754'));
|
|
477
485
|
_define_property(Control, "controlIcon", 'icon');
|
|
478
486
|
_define_property(Control, "controlType", 'control');
|
|
479
487
|
_define_property(Control, "controlFieldType", void 0);
|
|
@@ -489,10 +497,10 @@ _define_property(Control, "removeSettingItem", removeSetting);
|
|
|
489
497
|
_define_property(Control, "updateSettingItem", updateSetting);
|
|
490
498
|
export default Control;
|
|
491
499
|
export { Control as DesignerControl };
|
|
492
|
-
/**
|
|
493
|
-
* @function 删除控件或者实例上的setting的方法
|
|
494
|
-
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
495
|
-
* @param keys 需要删除的key或key组成的数组
|
|
500
|
+
/**
|
|
501
|
+
* @function 删除控件或者实例上的setting的方法
|
|
502
|
+
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
503
|
+
* @param keys 需要删除的key或key组成的数组
|
|
496
504
|
* */ function removeSetting(keys) {
|
|
497
505
|
var _this = this;
|
|
498
506
|
var deleteKeys = Array.isArray(keys) ? keys : [
|
|
@@ -520,13 +528,13 @@ export { Control as DesignerControl };
|
|
|
520
528
|
}
|
|
521
529
|
});
|
|
522
530
|
}
|
|
523
|
-
/**
|
|
524
|
-
* @function 修改控件或者实例上的setting的方法
|
|
525
|
-
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
526
|
-
* @param settingKey 需要修改的key或者key组成的数组
|
|
527
|
-
* @param value 修改之后的visible值
|
|
528
|
-
* @param value.showItems 需要添加或替换的showItems
|
|
529
|
-
* @param value.type 默认是replace替换,可以更改为push新增
|
|
531
|
+
/**
|
|
532
|
+
* @function 修改控件或者实例上的setting的方法
|
|
533
|
+
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
534
|
+
* @param settingKey 需要修改的key或者key组成的数组
|
|
535
|
+
* @param value 修改之后的visible值
|
|
536
|
+
* @param value.showItems 需要添加或替换的showItems
|
|
537
|
+
* @param value.type 默认是replace替换,可以更改为push新增
|
|
530
538
|
* */ function updateSetting(settingKey, value) {
|
|
531
539
|
var _this = this;
|
|
532
540
|
var keys = typeof settingKey === 'string' ? [
|
|
@@ -133,25 +133,30 @@ var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
|
133
133
|
}
|
|
134
134
|
return PropertyRuntimeRules;
|
|
135
135
|
}(_wrap_native_super(Array));
|
|
136
|
-
/**
|
|
137
|
-
* 全局属性
|
|
138
|
-
* @public
|
|
136
|
+
/**
|
|
137
|
+
* 全局属性
|
|
138
|
+
* @public
|
|
139
139
|
*/ var Property = function Property(props) {
|
|
140
140
|
"use strict";
|
|
141
141
|
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
142
142
|
_class_call_check(this, Property);
|
|
143
|
-
/**
|
|
144
|
-
* 是否隐藏
|
|
145
|
-
* @public
|
|
146
|
-
* @defaultValue false
|
|
143
|
+
/**
|
|
144
|
+
* 是否隐藏
|
|
145
|
+
* @public
|
|
146
|
+
* @defaultValue false
|
|
147
147
|
*/ _define_property(this, "isHide", void 0);
|
|
148
148
|
_define_property(this, "className", void 0);
|
|
149
149
|
_define_property(this, "style", void 0);
|
|
150
|
-
/**
|
|
151
|
-
* 标题
|
|
152
|
-
* @public
|
|
153
|
-
* @defaultValue ''
|
|
150
|
+
/**
|
|
151
|
+
* 标题
|
|
152
|
+
* @public
|
|
153
|
+
* @defaultValue ''
|
|
154
154
|
*/ _define_property(this, "caption", void 0);
|
|
155
|
+
/**
|
|
156
|
+
* 标题
|
|
157
|
+
* @public
|
|
158
|
+
* @defaultValue ''
|
|
159
|
+
*/ _define_property(this, "defaultState", void 0);
|
|
155
160
|
var _props_isHide;
|
|
156
161
|
this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
|
|
157
162
|
this.style = new BaseStyle(props === null || props === void 0 ? void 0 : props.style);
|
|
@@ -44,7 +44,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
44
44
|
"use strict";
|
|
45
45
|
function Control(props) {
|
|
46
46
|
_class_call_check(this, Control);
|
|
47
|
-
_define_property(this, "id", void 0
|
|
47
|
+
_define_property(this, "id", void 0 // 唯一标识符
|
|
48
|
+
);
|
|
48
49
|
_define_property(this, "type", void 0);
|
|
49
50
|
_define_property(this, "controlType", void 0);
|
|
50
51
|
_define_property(this, "props", void 0);
|
|
@@ -71,9 +71,9 @@ function _is_native_reflect_construct() {
|
|
|
71
71
|
})();
|
|
72
72
|
}
|
|
73
73
|
import { Property, PropertyRules } from '../BaseControl';
|
|
74
|
-
import { RulesMessage } from '@byteluck-fe/model-driven-shared';
|
|
75
74
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
76
75
|
import { DataBind, AutoWidth } from '../../framework';
|
|
76
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
77
77
|
var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
78
78
|
"use strict";
|
|
79
79
|
_inherits(ColumnControlPropertyRules, PropertyRules);
|
|
@@ -85,20 +85,20 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
85
85
|
]), _define_property(_this, "caption", {
|
|
86
86
|
type: 'string',
|
|
87
87
|
required: true,
|
|
88
|
-
message:
|
|
88
|
+
message: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
|
|
89
89
|
}), _define_property(_this, "width", {
|
|
90
90
|
type: 'number',
|
|
91
91
|
required: false,
|
|
92
|
-
message:
|
|
92
|
+
message: getLocaleText('CMD.pleaseEnterColumnWidth', null, '请输入列宽')
|
|
93
93
|
});
|
|
94
94
|
_this.width.required = props.widthType === 'px';
|
|
95
95
|
return _this;
|
|
96
96
|
}
|
|
97
97
|
return ColumnControlPropertyRules;
|
|
98
98
|
}(PropertyRules);
|
|
99
|
-
/**
|
|
100
|
-
* 列基本属性
|
|
101
|
-
* @public
|
|
99
|
+
/**
|
|
100
|
+
* 列基本属性
|
|
101
|
+
* @public
|
|
102
102
|
*/ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
|
|
103
103
|
"use strict";
|
|
104
104
|
_inherits(ColumnControlProperty, Property);
|
|
@@ -107,31 +107,31 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
107
107
|
var _this;
|
|
108
108
|
_this = _call_super(this, ColumnControlProperty, [
|
|
109
109
|
props
|
|
110
|
-
]), /**
|
|
111
|
-
* 宽度类型
|
|
112
|
-
* @defaultValue 'auto'
|
|
113
|
-
*/ _define_property(_this, "widthType", void 0), /**
|
|
114
|
-
* 宽度
|
|
115
|
-
* @defaultValue 150
|
|
116
|
-
*/ _define_property(_this, "width", void 0), /**
|
|
117
|
-
* 标题
|
|
118
|
-
*/ _define_property(_this, "caption", void 0), /**
|
|
119
|
-
* 绑定数据项
|
|
120
|
-
*/ _define_property(_this, "dataBind", void 0), /**
|
|
121
|
-
* 自适应页面宽度
|
|
122
|
-
*/ _define_property(_this, "autoWidth", void 0), /**
|
|
123
|
-
* 冻结
|
|
124
|
-
* @defaultValue 'none'
|
|
125
|
-
*/ _define_property(_this, "fixed", void 0), /**
|
|
126
|
-
* 表头排序
|
|
127
|
-
* @defaultValue true
|
|
128
|
-
*/ _define_property(_this, "sort", void 0), /**
|
|
129
|
-
* 对齐
|
|
130
|
-
*/ _define_property(_this, "align", void 0), /**
|
|
131
|
-
* @internal
|
|
132
|
-
*/ _define_property(_this, "colSpan", void 0), /**
|
|
133
|
-
* 自动高度
|
|
134
|
-
* @defaultValue false
|
|
110
|
+
]), /**
|
|
111
|
+
* 宽度类型
|
|
112
|
+
* @defaultValue 'auto'
|
|
113
|
+
*/ _define_property(_this, "widthType", void 0), /**
|
|
114
|
+
* 宽度
|
|
115
|
+
* @defaultValue 150
|
|
116
|
+
*/ _define_property(_this, "width", void 0), /**
|
|
117
|
+
* 标题
|
|
118
|
+
*/ _define_property(_this, "caption", void 0), /**
|
|
119
|
+
* 绑定数据项
|
|
120
|
+
*/ _define_property(_this, "dataBind", void 0), /**
|
|
121
|
+
* 自适应页面宽度
|
|
122
|
+
*/ _define_property(_this, "autoWidth", void 0), /**
|
|
123
|
+
* 冻结
|
|
124
|
+
* @defaultValue 'none'
|
|
125
|
+
*/ _define_property(_this, "fixed", void 0), /**
|
|
126
|
+
* 表头排序
|
|
127
|
+
* @defaultValue true
|
|
128
|
+
*/ _define_property(_this, "sort", void 0), /**
|
|
129
|
+
* 对齐
|
|
130
|
+
*/ _define_property(_this, "align", void 0), /**
|
|
131
|
+
* @internal
|
|
132
|
+
*/ _define_property(_this, "colSpan", void 0), /**
|
|
133
|
+
* 自动高度
|
|
134
|
+
* @defaultValue false
|
|
135
135
|
*/ _define_property(_this, "autoHeight", void 0), _define_property(_this, "children", void 0);
|
|
136
136
|
var _props_width;
|
|
137
137
|
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
@@ -168,16 +168,16 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
168
168
|
'datasource',
|
|
169
169
|
'none'
|
|
170
170
|
],
|
|
171
|
-
message:
|
|
171
|
+
message: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
|
|
172
172
|
}), _define_property(_this, "options", [
|
|
173
173
|
{
|
|
174
174
|
type: 'array',
|
|
175
|
-
message:
|
|
175
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
176
176
|
}
|
|
177
177
|
]), _define_property(_this, "datasourceBind", [
|
|
178
178
|
{
|
|
179
179
|
type: 'object',
|
|
180
|
-
message:
|
|
180
|
+
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
181
181
|
}
|
|
182
182
|
]);
|
|
183
183
|
initOptionAndDataSourceRules.call(_this, props);
|
|
@@ -70,11 +70,12 @@ function _is_native_reflect_construct() {
|
|
|
70
70
|
return !!result;
|
|
71
71
|
})();
|
|
72
72
|
}
|
|
73
|
-
import {
|
|
73
|
+
import { JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
74
74
|
import { Property, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
|
|
75
75
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
76
76
|
import { DataBind } from '../../framework';
|
|
77
77
|
import { isDataBind } from '../../framework/isDataBind';
|
|
78
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
78
79
|
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
79
80
|
"use strict";
|
|
80
81
|
_inherits(BaseControlPropertyRules, PropertyRules);
|
|
@@ -86,7 +87,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
86
87
|
]), _define_property(_this, "dataBind", {}), _define_property(_this, "caption", {
|
|
87
88
|
type: 'string',
|
|
88
89
|
required: true,
|
|
89
|
-
message:
|
|
90
|
+
message: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
|
|
90
91
|
}), _define_property(_this, "isHideCaption", {
|
|
91
92
|
type: 'boolean'
|
|
92
93
|
}), _define_property(_this, "labelPosition", {
|
|
@@ -99,7 +100,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
99
100
|
// public placeholder: RuleItem = {
|
|
100
101
|
// required: true,
|
|
101
102
|
// type: 'string',
|
|
102
|
-
// message:
|
|
103
|
+
// message: getLocaleText('CMD.pleaseEnterPlaceholder',null,'请输入提示文字'),
|
|
103
104
|
// }
|
|
104
105
|
_define_property(_this, "defaultState", {
|
|
105
106
|
type: 'enum',
|
|
@@ -112,19 +113,19 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
112
113
|
}), _define_property(_this, "captionTip", {
|
|
113
114
|
type: 'string',
|
|
114
115
|
required: false,
|
|
115
|
-
message:
|
|
116
|
+
message: getLocaleText('CMD.pleaseEnterCaptionTip', null, '请输入气泡提示语')
|
|
116
117
|
});
|
|
117
118
|
// 初始化dataBind的校验规则
|
|
118
119
|
var validateFields = {
|
|
119
120
|
fieldCode: {
|
|
120
121
|
type: 'string',
|
|
121
122
|
required: true,
|
|
122
|
-
message:
|
|
123
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
123
124
|
},
|
|
124
125
|
dataCode: {
|
|
125
126
|
type: 'string',
|
|
126
127
|
required: true,
|
|
127
|
-
message:
|
|
128
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
131
|
// if (props.dataBind instanceof DataBind) {
|
|
@@ -133,14 +134,14 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
133
134
|
type: 'object',
|
|
134
135
|
required: true,
|
|
135
136
|
fields: JSONCopy(validateFields),
|
|
136
|
-
message:
|
|
137
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
137
138
|
};
|
|
138
139
|
} else {
|
|
139
140
|
var dataBind = {
|
|
140
141
|
type: 'object',
|
|
141
142
|
required: true,
|
|
142
143
|
fields: {},
|
|
143
|
-
message:
|
|
144
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
144
145
|
};
|
|
145
146
|
Object.keys(props.dataBind).forEach(function(key) {
|
|
146
147
|
;
|
|
@@ -148,7 +149,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
148
149
|
type: 'object',
|
|
149
150
|
required: true,
|
|
150
151
|
fields: JSONCopy(validateFields),
|
|
151
|
-
message:
|
|
152
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
152
153
|
};
|
|
153
154
|
});
|
|
154
155
|
_this.dataBind = dataBind;
|
|
@@ -174,18 +175,18 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
174
175
|
_this.push({
|
|
175
176
|
type: 'string',
|
|
176
177
|
required: isRequired,
|
|
177
|
-
message: props.requiredMessage !== '' ? props.requiredMessage :
|
|
178
|
+
message: props.requiredMessage !== '' ? props.requiredMessage : getLocaleText('CMD.runtimeRequired', {
|
|
178
179
|
caption: props.caption
|
|
179
|
-
})
|
|
180
|
+
}, '{caption}必填')
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
return _this;
|
|
183
184
|
}
|
|
184
185
|
return BaseControlPropertyRuntimeRules;
|
|
185
186
|
}(PropertyRuntimeRules);
|
|
186
|
-
/**
|
|
187
|
-
* 表单控件公共属性
|
|
188
|
-
* @public
|
|
187
|
+
/**
|
|
188
|
+
* 表单控件公共属性
|
|
189
|
+
* @public
|
|
189
190
|
*/ var BaseControlProperty = /*#__PURE__*/ function(Property) {
|
|
190
191
|
"use strict";
|
|
191
192
|
_inherits(BaseControlProperty, Property);
|
|
@@ -194,68 +195,50 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
194
195
|
var _this;
|
|
195
196
|
_this = _call_super(this, BaseControlProperty, [
|
|
196
197
|
props
|
|
197
|
-
]), /**
|
|
198
|
-
* 标题
|
|
199
|
-
* @defaultValue ''
|
|
200
|
-
* @public
|
|
201
|
-
*/ _define_property(_this, "caption", void 0), /**
|
|
202
|
-
*
|
|
203
|
-
* @defaultValue
|
|
204
|
-
* @public
|
|
205
|
-
*/ _define_property(_this, "
|
|
206
|
-
*
|
|
207
|
-
* @defaultValue
|
|
208
|
-
* @public
|
|
209
|
-
*/ _define_property(_this, "
|
|
210
|
-
*
|
|
211
|
-
* @defaultValue
|
|
212
|
-
* @public
|
|
213
|
-
*/ _define_property(_this, "
|
|
214
|
-
*
|
|
215
|
-
* @defaultValue
|
|
216
|
-
* @public
|
|
217
|
-
*/ _define_property(_this, "
|
|
218
|
-
*
|
|
219
|
-
* @
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*
|
|
223
|
-
|
|
224
|
-
*
|
|
225
|
-
|
|
226
|
-
*
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
|
|
230
|
-
*
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
*
|
|
234
|
-
* @public
|
|
235
|
-
*/ _define_property(_this, "
|
|
236
|
-
*
|
|
237
|
-
* @defaultValue ''
|
|
238
|
-
* @public
|
|
239
|
-
*/ _define_property(_this, "placeholder", void 0), /**
|
|
240
|
-
* 默认状态
|
|
241
|
-
* @defaultValue 'default'
|
|
242
|
-
* @public
|
|
243
|
-
*/ _define_property(_this, "defaultState", void 0), /**
|
|
244
|
-
* 必填
|
|
245
|
-
* @defaultValue false
|
|
246
|
-
* @public
|
|
247
|
-
*/ _define_property(_this, "required", void 0), /**
|
|
248
|
-
* 必填提示文案
|
|
249
|
-
* @defaultValue ''
|
|
198
|
+
]), /**
|
|
199
|
+
* 标题
|
|
200
|
+
* @defaultValue ''
|
|
201
|
+
* @public
|
|
202
|
+
*/ _define_property(_this, "caption", void 0), /**
|
|
203
|
+
* 隐藏标题
|
|
204
|
+
* @defaultValue false
|
|
205
|
+
* @public
|
|
206
|
+
*/ _define_property(_this, "isHideCaption", void 0), /**
|
|
207
|
+
* 显示气泡提示
|
|
208
|
+
* @defaultValue false
|
|
209
|
+
* @public
|
|
210
|
+
*/ _define_property(_this, "isShowCaptionTip", void 0), /**
|
|
211
|
+
* 气泡提示语
|
|
212
|
+
* @defaultValue ''
|
|
213
|
+
* @public
|
|
214
|
+
*/ _define_property(_this, "captionTip", void 0), /**
|
|
215
|
+
* 标题布局
|
|
216
|
+
* @defaultValue ''
|
|
217
|
+
* @public
|
|
218
|
+
*/ _define_property(_this, "labelPosition", void 0), /**
|
|
219
|
+
* 绑定数据项
|
|
220
|
+
* @public
|
|
221
|
+
*/ _define_property(_this, "dataBind", void 0), /**
|
|
222
|
+
* 默认值
|
|
223
|
+
* @public
|
|
224
|
+
*/ _define_property(_this, "defaultValue", void 0), /**
|
|
225
|
+
* 提示文字
|
|
226
|
+
* @defaultValue ''
|
|
227
|
+
* @public
|
|
228
|
+
*/ _define_property(_this, "placeholder", void 0), /**
|
|
229
|
+
* 默认状态
|
|
230
|
+
* @defaultValue 'default'
|
|
231
|
+
* @public
|
|
232
|
+
*/ _define_property(_this, "defaultState", void 0), /**
|
|
233
|
+
* 必填
|
|
234
|
+
* @defaultValue false
|
|
235
|
+
* @public
|
|
236
|
+
*/ _define_property(_this, "required", void 0), /**
|
|
237
|
+
* 必填提示文案
|
|
238
|
+
* @defaultValue ''
|
|
250
239
|
*/ _define_property(_this, "requiredMessage", void 0);
|
|
251
240
|
var _props_caption;
|
|
252
241
|
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : '';
|
|
253
|
-
var _props_captionSize;
|
|
254
|
-
_this.captionSize = (_props_captionSize = props === null || props === void 0 ? void 0 : props.captionSize) !== null && _props_captionSize !== void 0 ? _props_captionSize : '';
|
|
255
|
-
var _props_captionColor;
|
|
256
|
-
_this.captionColor = (_props_captionColor = props === null || props === void 0 ? void 0 : props.captionColor) !== null && _props_captionColor !== void 0 ? _props_captionColor : '';
|
|
257
|
-
var _props_isCaptionItalic;
|
|
258
|
-
_this.isCaptionItalic = (_props_isCaptionItalic = props === null || props === void 0 ? void 0 : props.isCaptionItalic) !== null && _props_isCaptionItalic !== void 0 ? _props_isCaptionItalic : false;
|
|
259
242
|
var _props_isHideCaption;
|
|
260
243
|
_this.isHideCaption = (_props_isHideCaption = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _props_isHideCaption !== void 0 ? _props_isHideCaption : false;
|
|
261
244
|
var _props_isShowCaptionTip;
|
|
@@ -296,16 +279,16 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
|
|
|
296
279
|
'custom',
|
|
297
280
|
'datasource'
|
|
298
281
|
],
|
|
299
|
-
message:
|
|
282
|
+
message: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
|
|
300
283
|
}), _define_property(_this, "options", [
|
|
301
284
|
{
|
|
302
285
|
type: 'array',
|
|
303
|
-
message:
|
|
286
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
304
287
|
}
|
|
305
288
|
]), _define_property(_this, "datasourceBind", [
|
|
306
289
|
{
|
|
307
290
|
type: 'object',
|
|
308
|
-
message:
|
|
291
|
+
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
309
292
|
}
|
|
310
293
|
]);
|
|
311
294
|
initOptionAndDataSourceRules.call(_this, props);
|
|
@@ -365,22 +365,20 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
365
365
|
{
|
|
366
366
|
key: "toSchema",
|
|
367
367
|
value: function toSchema() {
|
|
368
|
-
var _this_props_footers, _this_props;
|
|
369
368
|
var superSchema = _get(_get_prototype_of(ListControl.prototype), "toSchema", this).call(this);
|
|
370
369
|
var headers = this.props.headers.map(function(item) {
|
|
371
370
|
return item.toSchema();
|
|
372
371
|
});
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
})
|
|
372
|
+
// const footers = this.props?.footers?.map((item) => {
|
|
373
|
+
// if (item) {
|
|
374
|
+
// return item.toSchema()
|
|
375
|
+
// } else {
|
|
376
|
+
// return undefined
|
|
377
|
+
// }
|
|
378
|
+
// })
|
|
380
379
|
return _object_spread_props(_object_spread({}, superSchema), {
|
|
381
380
|
props: _object_spread_props(_object_spread({}, this.props), {
|
|
382
|
-
headers: headers
|
|
383
|
-
footers: footers
|
|
381
|
+
headers: headers
|
|
384
382
|
})
|
|
385
383
|
});
|
|
386
384
|
}
|