@byteluck-fe/model-driven-core 2.5.0-alpha.9 → 2.5.0-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/dist/esm/common/BaseControl/designer.js +189 -228
- package/dist/esm/common/BaseControl/property.js +8 -22
- package/dist/esm/common/BaseControl/runtime.js +5 -26
- package/dist/esm/common/ColumnControl/designer.js +1 -15
- package/dist/esm/common/ColumnControl/property.js +11 -59
- package/dist/esm/common/ColumnControl/runtime.js +1 -15
- package/dist/esm/common/FormControl/designer.js +3 -18
- package/dist/esm/common/FormControl/property.js +25 -88
- package/dist/esm/common/FormControl/runtime.js +1 -16
- package/dist/esm/common/LayoutControl/designer.js +70 -104
- package/dist/esm/common/LayoutControl/runtime.js +1 -16
- package/dist/esm/common/ListControl/designer.js +61 -86
- package/dist/esm/common/ListControl/property.js +0 -14
- package/dist/esm/common/ListControl/runtime.js +1 -16
- package/dist/esm/common/SearchViewControl/designer.js +1 -15
- package/dist/esm/common/SearchViewControl/property.js +0 -14
- package/dist/esm/common/SearchViewControl/runtime.js +1 -15
- package/dist/esm/common/WrapControl/designer.js +1 -15
- package/dist/esm/common/WrapControl/runtime.js +1 -15
- package/dist/esm/framework/RegisterControls.js +128 -197
- package/dist/esm/framework/index.js +101 -312
- 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 +62 -62
- package/dist/types/common/BaseControl/index.d.ts +13 -13
- package/dist/types/common/BaseControl/property.d.ts +36 -22
- package/dist/types/common/BaseControl/runtime.d.ts +22 -22
- package/dist/types/common/BaseControl/types.d.ts +35 -35
- package/dist/types/common/ColumnControl/designer.d.ts +10 -10
- package/dist/types/common/ColumnControl/index.d.ts +12 -12
- package/dist/types/common/ColumnControl/property.d.ts +73 -73
- package/dist/types/common/ColumnControl/runtime.d.ts +10 -10
- package/dist/types/common/ControlArray.d.ts +8 -8
- 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 -96
- 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 +12 -12
- 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 +33 -33
- package/dist/types/framework/index.d.ts +812 -574
- package/dist/types/index.d.ts +3 -3
- package/dist/types/type.d.ts +91 -91
- package/package.json +3 -3
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -94,16 +81,16 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
94
81
|
_classCallCheck(this, ColumnControlPropertyRules);
|
|
95
82
|
var _this;
|
|
96
83
|
_this = _super.call(this, props);
|
|
97
|
-
|
|
84
|
+
_this.caption = {
|
|
98
85
|
type: "string",
|
|
99
86
|
required: true,
|
|
100
87
|
message: RulesMessage.getMessage("pleaseEnterCaption")
|
|
101
|
-
}
|
|
102
|
-
|
|
88
|
+
};
|
|
89
|
+
_this.width = {
|
|
103
90
|
type: "number",
|
|
104
91
|
required: false,
|
|
105
92
|
message: RulesMessage.getMessage("pleaseEnterColumnWidth")
|
|
106
|
-
}
|
|
93
|
+
};
|
|
107
94
|
_this.width.required = props.widthType === "px";
|
|
108
95
|
return _this;
|
|
109
96
|
}
|
|
@@ -120,41 +107,6 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
120
107
|
_classCallCheck(this, ColumnControlProperty);
|
|
121
108
|
var _this;
|
|
122
109
|
_this = _super.call(this, props);
|
|
123
|
-
/**
|
|
124
|
-
* 宽度类型
|
|
125
|
-
* @defaultValue 'auto'
|
|
126
|
-
*/ _defineProperty(_assertThisInitialized(_this), "widthType", void 0);
|
|
127
|
-
/**
|
|
128
|
-
* 宽度
|
|
129
|
-
* @defaultValue 150
|
|
130
|
-
*/ _defineProperty(_assertThisInitialized(_this), "width", void 0);
|
|
131
|
-
/**
|
|
132
|
-
* 标题
|
|
133
|
-
*/ _defineProperty(_assertThisInitialized(_this), "caption", void 0);
|
|
134
|
-
/**
|
|
135
|
-
* 绑定数据项
|
|
136
|
-
*/ _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
|
|
137
|
-
/**
|
|
138
|
-
* 自适应页面宽度
|
|
139
|
-
*/ _defineProperty(_assertThisInitialized(_this), "autoWidth", void 0);
|
|
140
|
-
/**
|
|
141
|
-
* 冻结
|
|
142
|
-
* @defaultValue 'none'
|
|
143
|
-
*/ _defineProperty(_assertThisInitialized(_this), "fixed", void 0);
|
|
144
|
-
/**
|
|
145
|
-
* 表头排序
|
|
146
|
-
* @defaultValue true
|
|
147
|
-
*/ _defineProperty(_assertThisInitialized(_this), "sort", void 0);
|
|
148
|
-
/**
|
|
149
|
-
* 对齐
|
|
150
|
-
*/ _defineProperty(_assertThisInitialized(_this), "align", void 0);
|
|
151
|
-
/**
|
|
152
|
-
* @internal
|
|
153
|
-
*/ _defineProperty(_assertThisInitialized(_this), "colSpan", void 0);
|
|
154
|
-
/**
|
|
155
|
-
* 自动高度
|
|
156
|
-
* @defaultValue false
|
|
157
|
-
*/ _defineProperty(_assertThisInitialized(_this), "autoHeight", void 0);
|
|
158
110
|
var _props_width;
|
|
159
111
|
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
160
112
|
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
|
|
@@ -174,7 +126,7 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
174
126
|
}
|
|
175
127
|
return ColumnControlProperty;
|
|
176
128
|
}(Property);
|
|
177
|
-
|
|
129
|
+
ColumnControlProperty.Rules = ColumnControlPropertyRules;
|
|
178
130
|
var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
|
|
179
131
|
"use strict";
|
|
180
132
|
_inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
|
|
@@ -183,7 +135,7 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
183
135
|
_classCallCheck(this, ColumnOptionAndDataSourcePropertyRules);
|
|
184
136
|
var _this;
|
|
185
137
|
_this = _super.call(this, props);
|
|
186
|
-
|
|
138
|
+
_this.optionConfig = {
|
|
187
139
|
type: "enum",
|
|
188
140
|
enum: [
|
|
189
141
|
"custom",
|
|
@@ -191,19 +143,19 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
191
143
|
"none"
|
|
192
144
|
],
|
|
193
145
|
message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
|
|
194
|
-
}
|
|
195
|
-
|
|
146
|
+
};
|
|
147
|
+
_this.options = [
|
|
196
148
|
{
|
|
197
149
|
type: "array",
|
|
198
150
|
message: RulesMessage.getMessage("isNotArray")
|
|
199
151
|
}
|
|
200
|
-
]
|
|
201
|
-
|
|
152
|
+
];
|
|
153
|
+
_this.datasourceBind = [
|
|
202
154
|
{
|
|
203
155
|
type: "object",
|
|
204
156
|
message: RulesMessage.getMessage("isNotObject")
|
|
205
157
|
}
|
|
206
|
-
]
|
|
158
|
+
];
|
|
207
159
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
208
160
|
return _this;
|
|
209
161
|
}
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -92,8 +79,7 @@ var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
92
79
|
_classCallCheck(this, ColumnControl);
|
|
93
80
|
var _this;
|
|
94
81
|
_this = _super.call(this, props);
|
|
95
|
-
|
|
96
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
82
|
+
_this.controlType = "column";
|
|
97
83
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
98
84
|
return _this;
|
|
99
85
|
}
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -92,18 +79,16 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
92
79
|
_classCallCheck(this, FormControl);
|
|
93
80
|
var _this;
|
|
94
81
|
_this = _super.call(this, props);
|
|
95
|
-
|
|
96
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
82
|
+
_this.controlType = "form";
|
|
97
83
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
98
84
|
return _this;
|
|
99
85
|
}
|
|
100
86
|
return FormControl;
|
|
101
87
|
}(DesignerControl);
|
|
102
|
-
|
|
88
|
+
FormControl.controlEventKeys = [
|
|
103
89
|
"on_change",
|
|
104
90
|
"on_focus",
|
|
105
91
|
"on_blur"
|
|
106
|
-
]
|
|
107
|
-
_defineProperty(FormControl, "controlCustomAttributes", void 0);
|
|
92
|
+
];
|
|
108
93
|
export default FormControl;
|
|
109
94
|
export { FormControl as DesignerFormControl };
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -101,43 +88,43 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
101
88
|
_classCallCheck(this, BaseControlPropertyRules);
|
|
102
89
|
var _this;
|
|
103
90
|
_this = _super.call(this, props);
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
_this.dataBind = {};
|
|
92
|
+
_this.caption = {
|
|
106
93
|
type: "string",
|
|
107
94
|
required: true,
|
|
108
95
|
message: RulesMessage.getMessage("pleaseEnterCaption")
|
|
109
|
-
}
|
|
110
|
-
|
|
96
|
+
};
|
|
97
|
+
_this.isHideCaption = {
|
|
111
98
|
type: "boolean"
|
|
112
|
-
}
|
|
113
|
-
|
|
99
|
+
};
|
|
100
|
+
_this.labelPosition = {
|
|
114
101
|
type: "enum",
|
|
115
102
|
enum: [
|
|
116
103
|
"top",
|
|
117
104
|
"left"
|
|
118
105
|
]
|
|
119
|
-
}
|
|
106
|
+
};
|
|
120
107
|
// 去掉placeholder必填校验
|
|
121
108
|
// public placeholder: RuleItem = {
|
|
122
109
|
// required: true,
|
|
123
110
|
// type: 'string',
|
|
124
111
|
// message: RulesMessage.getMessage('pleaseEnterPlaceholder'),
|
|
125
112
|
// }
|
|
126
|
-
|
|
113
|
+
_this.defaultState = {
|
|
127
114
|
type: "enum",
|
|
128
115
|
enum: [
|
|
129
116
|
"default",
|
|
130
117
|
"readonly"
|
|
131
118
|
]
|
|
132
|
-
}
|
|
133
|
-
|
|
119
|
+
};
|
|
120
|
+
_this.required = {
|
|
134
121
|
type: "boolean"
|
|
135
|
-
}
|
|
136
|
-
|
|
122
|
+
};
|
|
123
|
+
_this.captionTip = {
|
|
137
124
|
type: "string",
|
|
138
125
|
required: false,
|
|
139
126
|
message: RulesMessage.getMessage("pleaseEnterCaptionTip")
|
|
140
|
-
}
|
|
127
|
+
};
|
|
141
128
|
// 初始化dataBind的校验规则
|
|
142
129
|
var validateFields = {
|
|
143
130
|
fieldCode: {
|
|
@@ -201,8 +188,10 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
201
188
|
}
|
|
202
189
|
return BaseControlPropertyRuntimeRules;
|
|
203
190
|
}(PropertyRuntimeRules);
|
|
204
|
-
|
|
205
|
-
|
|
191
|
+
/**
|
|
192
|
+
* 表单控件公共属性
|
|
193
|
+
* @public
|
|
194
|
+
*/ var BaseControlProperty = /*#__PURE__*/ function(Property) {
|
|
206
195
|
"use strict";
|
|
207
196
|
_inherits(BaseControlProperty, Property);
|
|
208
197
|
var _super = _createSuper(BaseControlProperty);
|
|
@@ -210,58 +199,6 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
|
|
|
210
199
|
_classCallCheck(this, BaseControlProperty);
|
|
211
200
|
var _this;
|
|
212
201
|
_this = _super.call(this, props);
|
|
213
|
-
/**
|
|
214
|
-
* 标题
|
|
215
|
-
* @defaultValue ''
|
|
216
|
-
* @public
|
|
217
|
-
*/ _defineProperty(_assertThisInitialized(_this), "caption", void 0);
|
|
218
|
-
/**
|
|
219
|
-
* 隐藏标题
|
|
220
|
-
* @defaultValue false
|
|
221
|
-
* @public
|
|
222
|
-
*/ _defineProperty(_assertThisInitialized(_this), "isHideCaption", void 0);
|
|
223
|
-
/**
|
|
224
|
-
* 显示气泡提示
|
|
225
|
-
* @defaultValue false
|
|
226
|
-
* @public
|
|
227
|
-
*/ _defineProperty(_assertThisInitialized(_this), "isShowCaptionTip", void 0);
|
|
228
|
-
/**
|
|
229
|
-
* 气泡提示语
|
|
230
|
-
* @defaultValue ''
|
|
231
|
-
* @public
|
|
232
|
-
*/ _defineProperty(_assertThisInitialized(_this), "captionTip", void 0);
|
|
233
|
-
/**
|
|
234
|
-
* 标题布局
|
|
235
|
-
* @defaultValue ''
|
|
236
|
-
* @public
|
|
237
|
-
*/ _defineProperty(_assertThisInitialized(_this), "labelPosition", void 0);
|
|
238
|
-
/**
|
|
239
|
-
* 绑定数据项
|
|
240
|
-
* @public
|
|
241
|
-
*/ _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
|
|
242
|
-
/**
|
|
243
|
-
* 默认值
|
|
244
|
-
* @public
|
|
245
|
-
*/ _defineProperty(_assertThisInitialized(_this), "defaultValue", void 0);
|
|
246
|
-
/**
|
|
247
|
-
* 提示文字
|
|
248
|
-
* @defaultValue ''
|
|
249
|
-
* @public
|
|
250
|
-
*/ _defineProperty(_assertThisInitialized(_this), "placeholder", void 0);
|
|
251
|
-
/**
|
|
252
|
-
* 默认状态
|
|
253
|
-
* @defaultValue 'default'
|
|
254
|
-
* @public
|
|
255
|
-
*/ _defineProperty(_assertThisInitialized(_this), "defaultState", void 0);
|
|
256
|
-
/**
|
|
257
|
-
* 必填
|
|
258
|
-
* @defaultValue false
|
|
259
|
-
* @public
|
|
260
|
-
*/ _defineProperty(_assertThisInitialized(_this), "required", void 0);
|
|
261
|
-
/**
|
|
262
|
-
* 必填提示文案
|
|
263
|
-
* @defaultValue ''
|
|
264
|
-
*/ _defineProperty(_assertThisInitialized(_this), "requiredMessage", void 0);
|
|
265
202
|
var _props_caption;
|
|
266
203
|
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
267
204
|
var _props_isHideCaption;
|
|
@@ -288,8 +225,8 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
|
|
|
288
225
|
}
|
|
289
226
|
return BaseControlProperty;
|
|
290
227
|
}(Property);
|
|
291
|
-
|
|
292
|
-
|
|
228
|
+
BaseControlProperty.Rules = BaseControlPropertyRules;
|
|
229
|
+
BaseControlProperty.RuntimeRules = BaseControlPropertyRuntimeRules;
|
|
293
230
|
var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
|
|
294
231
|
"use strict";
|
|
295
232
|
_inherits(OptionAndDataSourcePropertyRules, BaseControlPropertyRules);
|
|
@@ -298,26 +235,26 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
|
|
|
298
235
|
_classCallCheck(this, OptionAndDataSourcePropertyRules);
|
|
299
236
|
var _this;
|
|
300
237
|
_this = _super.call(this, props);
|
|
301
|
-
|
|
238
|
+
_this.optionConfig = {
|
|
302
239
|
type: "enum",
|
|
303
240
|
enum: [
|
|
304
241
|
"custom",
|
|
305
242
|
"datasource"
|
|
306
243
|
],
|
|
307
244
|
message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
|
|
308
|
-
}
|
|
309
|
-
|
|
245
|
+
};
|
|
246
|
+
_this.options = [
|
|
310
247
|
{
|
|
311
248
|
type: "array",
|
|
312
249
|
message: RulesMessage.getMessage("isNotArray")
|
|
313
250
|
}
|
|
314
|
-
]
|
|
315
|
-
|
|
251
|
+
];
|
|
252
|
+
_this.datasourceBind = [
|
|
316
253
|
{
|
|
317
254
|
type: "object",
|
|
318
255
|
message: RulesMessage.getMessage("isNotObject")
|
|
319
256
|
}
|
|
320
|
-
]
|
|
257
|
+
];
|
|
321
258
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
322
259
|
return _this;
|
|
323
260
|
}
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -92,9 +79,7 @@ var FormControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
92
79
|
_classCallCheck(this, FormControl);
|
|
93
80
|
var _this;
|
|
94
81
|
_this = _super.call(this, props);
|
|
95
|
-
|
|
96
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "value", void 0);
|
|
82
|
+
_this.controlType = "form";
|
|
98
83
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
99
84
|
return _this;
|
|
100
85
|
}
|
|
@@ -46,20 +46,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
46
46
|
throw new TypeError("Cannot call a class as a function");
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function _defineProperties(target, props) {
|
|
50
|
-
for(var i = 0; i < props.length; i++){
|
|
51
|
-
var descriptor = props[i];
|
|
52
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
53
|
-
descriptor.configurable = true;
|
|
54
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
55
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
59
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
60
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
61
|
-
return Constructor;
|
|
62
|
-
}
|
|
63
49
|
function _defineProperty(obj, key, value) {
|
|
64
50
|
if (key in obj) {
|
|
65
51
|
Object.defineProperty(obj, key, {
|
|
@@ -328,11 +314,7 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
328
314
|
_classCallCheck(this, LayoutControl);
|
|
329
315
|
var _this;
|
|
330
316
|
_this = _super.call(this, props);
|
|
331
|
-
|
|
332
|
-
_defineProperty(_assertThisInitialized(_this), "children", void 0);
|
|
333
|
-
_defineProperty(_assertThisInitialized(_this), "excludes", void 0);
|
|
334
|
-
_defineProperty(_assertThisInitialized(_this), "childrenMaxLength", void 0);
|
|
335
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
317
|
+
_this.controlType = "layout";
|
|
336
318
|
var _ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = _ref.excludes, childrenMaxLength = _ref.childrenMaxLength;
|
|
337
319
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
338
320
|
defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
|
|
@@ -340,95 +322,79 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
340
322
|
_this.childrenMaxLength = childrenMaxLength;
|
|
341
323
|
return _this;
|
|
342
324
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
325
|
+
var _proto = LayoutControl.prototype;
|
|
326
|
+
_proto.judgeExcludesChildren = function judgeExcludesChildren(type) {
|
|
327
|
+
return this.excludes === false || Array.isArray(this.excludes) && !this.excludes.includes(type);
|
|
328
|
+
};
|
|
329
|
+
_proto.judgeJoinChildren = function judgeJoinChildren(type) {
|
|
330
|
+
var canJoin = this.judgeExcludesChildren(type);
|
|
331
|
+
if (canJoin) {
|
|
332
|
+
return this.childrenMaxLength > this.children.length;
|
|
333
|
+
}
|
|
334
|
+
return canJoin;
|
|
335
|
+
};
|
|
336
|
+
_proto.validate = function validate(messages, ignore) {
|
|
337
|
+
var _this = this;
|
|
338
|
+
var _this1 = this, _superprop_get_validate = function() {
|
|
339
|
+
return _get(_getPrototypeOf(LayoutControl.prototype), "validate", _this);
|
|
340
|
+
};
|
|
341
|
+
return _asyncToGenerator(function() {
|
|
342
|
+
return __generator(this, function(_state) {
|
|
343
|
+
switch(_state.label){
|
|
344
|
+
case 0:
|
|
345
|
+
return [
|
|
346
|
+
4,
|
|
347
|
+
_superprop_get_validate().call(_this1, messages, ignore)
|
|
348
|
+
];
|
|
349
|
+
case 1:
|
|
350
|
+
_state.sent();
|
|
351
|
+
return [
|
|
352
|
+
4,
|
|
353
|
+
Promise.all(_this1.children.map(function(child) {
|
|
354
|
+
return child.validate(messages, ignore);
|
|
355
|
+
}))
|
|
356
|
+
];
|
|
357
|
+
case 2:
|
|
358
|
+
_state.sent();
|
|
359
|
+
return [
|
|
360
|
+
2,
|
|
361
|
+
true
|
|
362
|
+
];
|
|
356
363
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return [
|
|
372
|
-
4,
|
|
373
|
-
_superprop_get_validate().call(_this1, messages, ignore)
|
|
374
|
-
];
|
|
375
|
-
case 1:
|
|
376
|
-
_state.sent();
|
|
377
|
-
return [
|
|
378
|
-
4,
|
|
379
|
-
Promise.all(_this1.children.map(function(child) {
|
|
380
|
-
return child.validate(messages, ignore);
|
|
381
|
-
}))
|
|
382
|
-
];
|
|
383
|
-
case 2:
|
|
384
|
-
_state.sent();
|
|
385
|
-
return [
|
|
386
|
-
2,
|
|
387
|
-
true
|
|
388
|
-
];
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
})();
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
key: "toDataBindModel",
|
|
396
|
-
value: function toDataBindModel() {
|
|
397
|
-
var parentId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
398
|
-
var dataBindModel = _get(_getPrototypeOf(LayoutControl.prototype), "toDataBindModel", this).call(this);
|
|
399
|
-
var result = dataBindModel ? [
|
|
400
|
-
dataBindModel
|
|
401
|
-
] : [];
|
|
402
|
-
return this.children.reduce(function(arr, current) {
|
|
403
|
-
var model = current.toDataBindModel(parentId);
|
|
404
|
-
if (Array.isArray(model)) {
|
|
405
|
-
var filteredModel = model.filter(function(item) {
|
|
406
|
-
return !!item;
|
|
407
|
-
});
|
|
408
|
-
return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
|
|
409
|
-
}
|
|
410
|
-
model && arr.push(model);
|
|
411
|
-
return arr;
|
|
412
|
-
}, result);
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
key: "toSchema",
|
|
417
|
-
value: function toSchema() {
|
|
418
|
-
var superSchema = _get(_getPrototypeOf(LayoutControl.prototype), "toSchema", this).call(this);
|
|
419
|
-
var children = this.children.map(function(item) {
|
|
420
|
-
var schema = item.toSchema();
|
|
421
|
-
return schema;
|
|
422
|
-
});
|
|
423
|
-
return _objectSpreadProps(_objectSpread({}, superSchema), {
|
|
424
|
-
children: children
|
|
364
|
+
});
|
|
365
|
+
})();
|
|
366
|
+
};
|
|
367
|
+
_proto.toDataBindModel = function toDataBindModel() {
|
|
368
|
+
var parentId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
369
|
+
var dataBindModel = _get(_getPrototypeOf(LayoutControl.prototype), "toDataBindModel", this).call(this);
|
|
370
|
+
var result = dataBindModel ? [
|
|
371
|
+
dataBindModel
|
|
372
|
+
] : [];
|
|
373
|
+
return this.children.reduce(function(arr, current) {
|
|
374
|
+
var model = current.toDataBindModel(parentId);
|
|
375
|
+
if (Array.isArray(model)) {
|
|
376
|
+
var filteredModel = model.filter(function(item) {
|
|
377
|
+
return !!item;
|
|
425
378
|
});
|
|
379
|
+
return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
|
|
426
380
|
}
|
|
427
|
-
|
|
428
|
-
|
|
381
|
+
model && arr.push(model);
|
|
382
|
+
return arr;
|
|
383
|
+
}, result);
|
|
384
|
+
};
|
|
385
|
+
_proto.toSchema = function toSchema() {
|
|
386
|
+
var superSchema = _get(_getPrototypeOf(LayoutControl.prototype), "toSchema", this).call(this);
|
|
387
|
+
var children = this.children.map(function(item) {
|
|
388
|
+
var schema = item.toSchema();
|
|
389
|
+
return schema;
|
|
390
|
+
});
|
|
391
|
+
return _objectSpreadProps(_objectSpread({}, superSchema), {
|
|
392
|
+
children: children
|
|
393
|
+
});
|
|
394
|
+
};
|
|
429
395
|
return LayoutControl;
|
|
430
396
|
}(DesignerControl);
|
|
431
|
-
|
|
432
|
-
|
|
397
|
+
LayoutControl.excludes = false;
|
|
398
|
+
LayoutControl.childrenMaxLength = CHILDREN_MAX_LENGTH;
|
|
433
399
|
export default LayoutControl;
|
|
434
400
|
export { LayoutControl as DesignerLayoutControl };
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -93,9 +80,7 @@ var LayoutControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
93
80
|
_classCallCheck(this, LayoutControl);
|
|
94
81
|
var _this;
|
|
95
82
|
_this = _super.call(this, props);
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "children", void 0);
|
|
98
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
|
+
_this.controlType = "layout";
|
|
99
84
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
85
|
defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
|
|
101
86
|
return _this;
|