@byteluck-fe/model-driven-core 2.7.0-alpha.2 → 2.7.0-alpha.20
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 +229 -191
- package/dist/esm/common/BaseControl/property.js +29 -4
- package/dist/esm/common/BaseControl/runtime.js +26 -5
- package/dist/esm/common/ColumnControl/designer.js +15 -1
- package/dist/esm/common/ColumnControl/property.js +59 -11
- package/dist/esm/common/ColumnControl/runtime.js +15 -1
- package/dist/esm/common/FormControl/designer.js +18 -3
- package/dist/esm/common/FormControl/property.js +89 -29
- package/dist/esm/common/FormControl/runtime.js +16 -1
- package/dist/esm/common/LayoutControl/designer.js +104 -70
- package/dist/esm/common/LayoutControl/runtime.js +16 -1
- package/dist/esm/common/ListControl/designer.js +95 -61
- package/dist/esm/common/ListControl/property.js +16 -0
- package/dist/esm/common/ListControl/runtime.js +16 -1
- package/dist/esm/common/SearchViewControl/designer.js +15 -1
- package/dist/esm/common/SearchViewControl/property.js +14 -0
- package/dist/esm/common/SearchViewControl/runtime.js +15 -1
- package/dist/esm/common/WrapControl/designer.js +15 -1
- package/dist/esm/common/WrapControl/runtime.js +15 -1
- package/dist/esm/framework/RegisterControls.js +213 -128
- package/dist/esm/framework/index.js +444 -18
- package/dist/esm/framework/isDataBind.js +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/index.umd.js +1 -1
- package/dist/types/common/ListControl/property.d.ts +2 -0
- package/dist/types/framework/index.d.ts +3 -2
- package/dist/types/framework/isDataBind.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -9,6 +9,19 @@ 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
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -81,16 +94,16 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
81
94
|
_classCallCheck(this, ColumnControlPropertyRules);
|
|
82
95
|
var _this;
|
|
83
96
|
_this = _super.call(this, props);
|
|
84
|
-
_this
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "caption", {
|
|
85
98
|
type: "string",
|
|
86
99
|
required: true,
|
|
87
100
|
message: RulesMessage.getMessage("pleaseEnterCaption")
|
|
88
|
-
};
|
|
89
|
-
_this
|
|
101
|
+
});
|
|
102
|
+
_defineProperty(_assertThisInitialized(_this), "width", {
|
|
90
103
|
type: "number",
|
|
91
104
|
required: false,
|
|
92
105
|
message: RulesMessage.getMessage("pleaseEnterColumnWidth")
|
|
93
|
-
};
|
|
106
|
+
});
|
|
94
107
|
_this.width.required = props.widthType === "px";
|
|
95
108
|
return _this;
|
|
96
109
|
}
|
|
@@ -107,6 +120,41 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
107
120
|
_classCallCheck(this, ColumnControlProperty);
|
|
108
121
|
var _this;
|
|
109
122
|
_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);
|
|
110
158
|
var _props_width;
|
|
111
159
|
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
112
160
|
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
|
|
@@ -126,7 +174,7 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
126
174
|
}
|
|
127
175
|
return ColumnControlProperty;
|
|
128
176
|
}(Property);
|
|
129
|
-
ColumnControlProperty
|
|
177
|
+
_defineProperty(ColumnControlProperty, "Rules", ColumnControlPropertyRules);
|
|
130
178
|
var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
|
|
131
179
|
"use strict";
|
|
132
180
|
_inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
|
|
@@ -135,7 +183,7 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
135
183
|
_classCallCheck(this, ColumnOptionAndDataSourcePropertyRules);
|
|
136
184
|
var _this;
|
|
137
185
|
_this = _super.call(this, props);
|
|
138
|
-
_this
|
|
186
|
+
_defineProperty(_assertThisInitialized(_this), "optionConfig", {
|
|
139
187
|
type: "enum",
|
|
140
188
|
enum: [
|
|
141
189
|
"custom",
|
|
@@ -143,19 +191,19 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
143
191
|
"none"
|
|
144
192
|
],
|
|
145
193
|
message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
|
|
146
|
-
};
|
|
147
|
-
_this
|
|
194
|
+
});
|
|
195
|
+
_defineProperty(_assertThisInitialized(_this), "options", [
|
|
148
196
|
{
|
|
149
197
|
type: "array",
|
|
150
198
|
message: RulesMessage.getMessage("isNotArray")
|
|
151
199
|
}
|
|
152
|
-
];
|
|
153
|
-
_this
|
|
200
|
+
]);
|
|
201
|
+
_defineProperty(_assertThisInitialized(_this), "datasourceBind", [
|
|
154
202
|
{
|
|
155
203
|
type: "object",
|
|
156
204
|
message: RulesMessage.getMessage("isNotObject")
|
|
157
205
|
}
|
|
158
|
-
];
|
|
206
|
+
]);
|
|
159
207
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
160
208
|
return _this;
|
|
161
209
|
}
|
|
@@ -9,6 +9,19 @@ 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
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -79,7 +92,8 @@ var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
79
92
|
_classCallCheck(this, ColumnControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "column");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
98
|
return _this;
|
|
85
99
|
}
|
|
@@ -9,6 +9,19 @@ 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
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -79,16 +92,18 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
79
92
|
_classCallCheck(this, FormControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "form");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
98
|
return _this;
|
|
85
99
|
}
|
|
86
100
|
return FormControl;
|
|
87
101
|
}(DesignerControl);
|
|
88
|
-
FormControl
|
|
102
|
+
_defineProperty(FormControl, "controlEventKeys", [
|
|
89
103
|
"on_change",
|
|
90
104
|
"on_focus",
|
|
91
105
|
"on_blur"
|
|
92
|
-
];
|
|
106
|
+
]);
|
|
107
|
+
_defineProperty(FormControl, "controlCustomAttributes", void 0);
|
|
93
108
|
export default FormControl;
|
|
94
109
|
export { FormControl as DesignerFormControl };
|
|
@@ -9,6 +9,19 @@ 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
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -28,13 +41,6 @@ function _inherits(subClass, superClass) {
|
|
|
28
41
|
});
|
|
29
42
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
30
43
|
}
|
|
31
|
-
function _instanceof(left, right) {
|
|
32
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
33
|
-
return !!right[Symbol.hasInstance](left);
|
|
34
|
-
} else {
|
|
35
|
-
return left instanceof right;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
44
|
function _possibleConstructorReturn(self, call) {
|
|
39
45
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
40
46
|
return call;
|
|
@@ -80,6 +86,7 @@ import { RulesMessage, JSONCopy } from "@byteluck-fe/model-driven-shared";
|
|
|
80
86
|
import { Property, PropertyRules, PropertyRuntimeRules } from "../BaseControl";
|
|
81
87
|
import { initOptionAndDataSourceRules } from "../initOptionAndDataSourceRules";
|
|
82
88
|
import { DataBind } from "../../framework";
|
|
89
|
+
import { isDataBind } from "../../framework/isDataBind";
|
|
83
90
|
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
84
91
|
"use strict";
|
|
85
92
|
_inherits(BaseControlPropertyRules, PropertyRules);
|
|
@@ -88,43 +95,43 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
88
95
|
_classCallCheck(this, BaseControlPropertyRules);
|
|
89
96
|
var _this;
|
|
90
97
|
_this = _super.call(this, props);
|
|
91
|
-
_this
|
|
92
|
-
_this
|
|
98
|
+
_defineProperty(_assertThisInitialized(_this), "dataBind", {});
|
|
99
|
+
_defineProperty(_assertThisInitialized(_this), "caption", {
|
|
93
100
|
type: "string",
|
|
94
101
|
required: true,
|
|
95
102
|
message: RulesMessage.getMessage("pleaseEnterCaption")
|
|
96
|
-
};
|
|
97
|
-
_this
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "isHideCaption", {
|
|
98
105
|
type: "boolean"
|
|
99
|
-
};
|
|
100
|
-
_this
|
|
106
|
+
});
|
|
107
|
+
_defineProperty(_assertThisInitialized(_this), "labelPosition", {
|
|
101
108
|
type: "enum",
|
|
102
109
|
enum: [
|
|
103
110
|
"top",
|
|
104
111
|
"left"
|
|
105
112
|
]
|
|
106
|
-
};
|
|
113
|
+
});
|
|
107
114
|
// 去掉placeholder必填校验
|
|
108
115
|
// public placeholder: RuleItem = {
|
|
109
116
|
// required: true,
|
|
110
117
|
// type: 'string',
|
|
111
118
|
// message: RulesMessage.getMessage('pleaseEnterPlaceholder'),
|
|
112
119
|
// }
|
|
113
|
-
_this
|
|
120
|
+
_defineProperty(_assertThisInitialized(_this), "defaultState", {
|
|
114
121
|
type: "enum",
|
|
115
122
|
enum: [
|
|
116
123
|
"default",
|
|
117
124
|
"readonly"
|
|
118
125
|
]
|
|
119
|
-
};
|
|
120
|
-
_this
|
|
126
|
+
});
|
|
127
|
+
_defineProperty(_assertThisInitialized(_this), "required", {
|
|
121
128
|
type: "boolean"
|
|
122
|
-
};
|
|
123
|
-
_this
|
|
129
|
+
});
|
|
130
|
+
_defineProperty(_assertThisInitialized(_this), "captionTip", {
|
|
124
131
|
type: "string",
|
|
125
132
|
required: false,
|
|
126
133
|
message: RulesMessage.getMessage("pleaseEnterCaptionTip")
|
|
127
|
-
};
|
|
134
|
+
});
|
|
128
135
|
// 初始化dataBind的校验规则
|
|
129
136
|
var validateFields = {
|
|
130
137
|
fieldCode: {
|
|
@@ -138,7 +145,8 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
138
145
|
message: RulesMessage.getMessage("pleaseEnterFieldCode")
|
|
139
146
|
}
|
|
140
147
|
};
|
|
141
|
-
if (
|
|
148
|
+
// if (props.dataBind instanceof DataBind) {
|
|
149
|
+
if (isDataBind(props.dataBind)) {
|
|
142
150
|
_this.dataBind = {
|
|
143
151
|
type: "object",
|
|
144
152
|
required: true,
|
|
@@ -199,6 +207,58 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
199
207
|
_classCallCheck(this, BaseControlProperty);
|
|
200
208
|
var _this;
|
|
201
209
|
_this = _super.call(this, props);
|
|
210
|
+
/**
|
|
211
|
+
* 标题
|
|
212
|
+
* @defaultValue ''
|
|
213
|
+
* @public
|
|
214
|
+
*/ _defineProperty(_assertThisInitialized(_this), "caption", void 0);
|
|
215
|
+
/**
|
|
216
|
+
* 隐藏标题
|
|
217
|
+
* @defaultValue false
|
|
218
|
+
* @public
|
|
219
|
+
*/ _defineProperty(_assertThisInitialized(_this), "isHideCaption", void 0);
|
|
220
|
+
/**
|
|
221
|
+
* 显示气泡提示
|
|
222
|
+
* @defaultValue false
|
|
223
|
+
* @public
|
|
224
|
+
*/ _defineProperty(_assertThisInitialized(_this), "isShowCaptionTip", void 0);
|
|
225
|
+
/**
|
|
226
|
+
* 气泡提示语
|
|
227
|
+
* @defaultValue ''
|
|
228
|
+
* @public
|
|
229
|
+
*/ _defineProperty(_assertThisInitialized(_this), "captionTip", void 0);
|
|
230
|
+
/**
|
|
231
|
+
* 标题布局
|
|
232
|
+
* @defaultValue ''
|
|
233
|
+
* @public
|
|
234
|
+
*/ _defineProperty(_assertThisInitialized(_this), "labelPosition", void 0);
|
|
235
|
+
/**
|
|
236
|
+
* 绑定数据项
|
|
237
|
+
* @public
|
|
238
|
+
*/ _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
|
|
239
|
+
/**
|
|
240
|
+
* 默认值
|
|
241
|
+
* @public
|
|
242
|
+
*/ _defineProperty(_assertThisInitialized(_this), "defaultValue", void 0);
|
|
243
|
+
/**
|
|
244
|
+
* 提示文字
|
|
245
|
+
* @defaultValue ''
|
|
246
|
+
* @public
|
|
247
|
+
*/ _defineProperty(_assertThisInitialized(_this), "placeholder", void 0);
|
|
248
|
+
/**
|
|
249
|
+
* 默认状态
|
|
250
|
+
* @defaultValue 'default'
|
|
251
|
+
* @public
|
|
252
|
+
*/ _defineProperty(_assertThisInitialized(_this), "defaultState", void 0);
|
|
253
|
+
/**
|
|
254
|
+
* 必填
|
|
255
|
+
* @defaultValue false
|
|
256
|
+
* @public
|
|
257
|
+
*/ _defineProperty(_assertThisInitialized(_this), "required", void 0);
|
|
258
|
+
/**
|
|
259
|
+
* 必填提示文案
|
|
260
|
+
* @defaultValue ''
|
|
261
|
+
*/ _defineProperty(_assertThisInitialized(_this), "requiredMessage", void 0);
|
|
202
262
|
var _props_caption;
|
|
203
263
|
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
204
264
|
var _props_isHideCaption;
|
|
@@ -225,8 +285,8 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
225
285
|
}
|
|
226
286
|
return BaseControlProperty;
|
|
227
287
|
}(Property);
|
|
228
|
-
BaseControlProperty
|
|
229
|
-
BaseControlProperty
|
|
288
|
+
_defineProperty(BaseControlProperty, "Rules", BaseControlPropertyRules);
|
|
289
|
+
_defineProperty(BaseControlProperty, "RuntimeRules", BaseControlPropertyRuntimeRules);
|
|
230
290
|
var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
|
|
231
291
|
"use strict";
|
|
232
292
|
_inherits(OptionAndDataSourcePropertyRules, BaseControlPropertyRules);
|
|
@@ -235,26 +295,26 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
|
|
|
235
295
|
_classCallCheck(this, OptionAndDataSourcePropertyRules);
|
|
236
296
|
var _this;
|
|
237
297
|
_this = _super.call(this, props);
|
|
238
|
-
_this
|
|
298
|
+
_defineProperty(_assertThisInitialized(_this), "optionConfig", {
|
|
239
299
|
type: "enum",
|
|
240
300
|
enum: [
|
|
241
301
|
"custom",
|
|
242
302
|
"datasource"
|
|
243
303
|
],
|
|
244
304
|
message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
|
|
245
|
-
};
|
|
246
|
-
_this
|
|
305
|
+
});
|
|
306
|
+
_defineProperty(_assertThisInitialized(_this), "options", [
|
|
247
307
|
{
|
|
248
308
|
type: "array",
|
|
249
309
|
message: RulesMessage.getMessage("isNotArray")
|
|
250
310
|
}
|
|
251
|
-
];
|
|
252
|
-
_this
|
|
311
|
+
]);
|
|
312
|
+
_defineProperty(_assertThisInitialized(_this), "datasourceBind", [
|
|
253
313
|
{
|
|
254
314
|
type: "object",
|
|
255
315
|
message: RulesMessage.getMessage("isNotObject")
|
|
256
316
|
}
|
|
257
|
-
];
|
|
317
|
+
]);
|
|
258
318
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
259
319
|
return _this;
|
|
260
320
|
}
|
|
@@ -9,6 +9,19 @@ 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
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -79,7 +92,9 @@ var FormControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
79
92
|
_classCallCheck(this, FormControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "form");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "value", void 0);
|
|
83
98
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
99
|
return _this;
|
|
85
100
|
}
|
|
@@ -46,6 +46,20 @@ 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
|
+
}
|
|
49
63
|
function _defineProperty(obj, key, value) {
|
|
50
64
|
if (key in obj) {
|
|
51
65
|
Object.defineProperty(obj, key, {
|
|
@@ -314,7 +328,11 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
314
328
|
_classCallCheck(this, LayoutControl);
|
|
315
329
|
var _this;
|
|
316
330
|
_this = _super.call(this, props);
|
|
317
|
-
_this
|
|
331
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "layout");
|
|
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);
|
|
318
336
|
var _ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = _ref.excludes, childrenMaxLength = _ref.childrenMaxLength;
|
|
319
337
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
320
338
|
defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
|
|
@@ -322,79 +340,95 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
322
340
|
_this.childrenMaxLength = childrenMaxLength;
|
|
323
341
|
return _this;
|
|
324
342
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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
|
-
];
|
|
343
|
+
_createClass(LayoutControl, [
|
|
344
|
+
{
|
|
345
|
+
key: "judgeExcludesChildren",
|
|
346
|
+
value: function judgeExcludesChildren(type) {
|
|
347
|
+
return this.excludes === false || Array.isArray(this.excludes) && !this.excludes.includes(type);
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
key: "judgeJoinChildren",
|
|
352
|
+
value: function judgeJoinChildren(type) {
|
|
353
|
+
var canJoin = this.judgeExcludesChildren(type);
|
|
354
|
+
if (canJoin) {
|
|
355
|
+
return this.childrenMaxLength > this.children.length;
|
|
363
356
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
357
|
+
return canJoin;
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
key: "validate",
|
|
362
|
+
value: function validate(messages, ignore) {
|
|
363
|
+
var _this = this;
|
|
364
|
+
var _this1 = this, _superprop_get_validate = function() {
|
|
365
|
+
return _get(_getPrototypeOf(LayoutControl.prototype), "validate", _this);
|
|
366
|
+
};
|
|
367
|
+
return _asyncToGenerator(function() {
|
|
368
|
+
return __generator(this, function(_state) {
|
|
369
|
+
switch(_state.label){
|
|
370
|
+
case 0:
|
|
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
|
|
378
425
|
});
|
|
379
|
-
return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
|
|
380
426
|
}
|
|
381
|
-
|
|
382
|
-
|
|
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
|
-
};
|
|
427
|
+
}
|
|
428
|
+
]);
|
|
395
429
|
return LayoutControl;
|
|
396
430
|
}(DesignerControl);
|
|
397
|
-
LayoutControl
|
|
398
|
-
LayoutControl
|
|
431
|
+
_defineProperty(LayoutControl, "excludes", false);
|
|
432
|
+
_defineProperty(LayoutControl, "childrenMaxLength", CHILDREN_MAX_LENGTH);
|
|
399
433
|
export default LayoutControl;
|
|
400
434
|
export { LayoutControl as DesignerLayoutControl };
|
|
@@ -9,6 +9,19 @@ 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
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -80,7 +93,9 @@ var LayoutControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
80
93
|
_classCallCheck(this, LayoutControl);
|
|
81
94
|
var _this;
|
|
82
95
|
_this = _super.call(this, props);
|
|
83
|
-
_this
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "layout");
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "children", void 0);
|
|
98
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
84
99
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
85
100
|
defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
|
|
86
101
|
return _this;
|