@byteluck-fe/model-driven-core 2.5.0-alpha.9 → 2.5.0-beta.4
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/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +96 -215
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +13 -30
- package/dist/esm/common/BaseControl/runtime.js +20 -41
- package/dist/esm/common/ColumnControl/designer.js +5 -19
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +47 -95
- package/dist/esm/common/ColumnControl/runtime.js +5 -19
- package/dist/esm/common/ControlArray.js +8 -8
- package/dist/esm/common/FormControl/designer.js +10 -25
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +89 -152
- package/dist/esm/common/FormControl/runtime.js +5 -20
- package/dist/esm/common/LayoutControl/designer.js +30 -158
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +3 -3
- package/dist/esm/common/LayoutControl/runtime.js +7 -22
- package/dist/esm/common/ListControl/designer.js +26 -151
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +5 -19
- package/dist/esm/common/ListControl/runtime.js +7 -22
- package/dist/esm/common/SearchViewControl/designer.js +5 -19
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +4 -18
- package/dist/esm/common/SearchViewControl/runtime.js +5 -19
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +5 -19
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +3 -3
- package/dist/esm/common/WrapControl/runtime.js +5 -19
- package/dist/esm/common/controlHooksEmitter.js +1 -1
- package/dist/esm/common/index.js +12 -12
- package/dist/esm/common/initLinkOperationRules.js +6 -6
- package/dist/esm/common/initOptionAndDataSourceRules.js +82 -82
- package/dist/esm/framework/RegisterControls.js +15 -27
- package/dist/esm/framework/index.js +399 -613
- package/dist/esm/index.js +3 -3
- package/dist/index.umd.js +1 -1
- package/dist/types/common/BaseControl/property.d.ts +14 -0
- package/dist/types/common/FormControl/property.d.ts +4 -0
- package/dist/types/common/Validator.d.ts +1 -1
- package/dist/types/common/controlHooksEmitter.d.ts +1 -1
- package/dist/types/framework/index.d.ts +239 -1
- package/dist/types/type.d.ts +23 -23
- 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);
|
|
@@ -43,7 +30,7 @@ function _inherits(subClass, superClass) {
|
|
|
43
30
|
}
|
|
44
31
|
function _instanceof(left, right) {
|
|
45
32
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
46
|
-
return
|
|
33
|
+
return right[Symbol.hasInstance](left);
|
|
47
34
|
} else {
|
|
48
35
|
return left instanceof right;
|
|
49
36
|
}
|
|
@@ -89,88 +76,88 @@ function _createSuper(Derived) {
|
|
|
89
76
|
return _possibleConstructorReturn(this, result);
|
|
90
77
|
};
|
|
91
78
|
}
|
|
92
|
-
import { RulesMessage, JSONCopy } from
|
|
93
|
-
import { Property, PropertyRules, PropertyRuntimeRules } from
|
|
94
|
-
import { initOptionAndDataSourceRules } from
|
|
95
|
-
import { DataBind } from
|
|
96
|
-
var BaseControlPropertyRules = /*#__PURE__*/ function(
|
|
79
|
+
import { RulesMessage, JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
80
|
+
import { Property, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
|
|
81
|
+
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
82
|
+
import { DataBind } from '../../framework';
|
|
83
|
+
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules1) {
|
|
97
84
|
"use strict";
|
|
98
|
-
_inherits(BaseControlPropertyRules,
|
|
85
|
+
_inherits(BaseControlPropertyRules, PropertyRules1);
|
|
99
86
|
var _super = _createSuper(BaseControlPropertyRules);
|
|
100
87
|
function BaseControlPropertyRules(props) {
|
|
101
88
|
_classCallCheck(this, BaseControlPropertyRules);
|
|
102
89
|
var _this;
|
|
103
90
|
_this = _super.call(this, props);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
type:
|
|
91
|
+
_this.dataBind = {};
|
|
92
|
+
_this.caption = {
|
|
93
|
+
type: 'string',
|
|
107
94
|
required: true,
|
|
108
|
-
message: RulesMessage.getMessage(
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
type:
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
type:
|
|
95
|
+
message: RulesMessage.getMessage('pleaseEnterCaption')
|
|
96
|
+
};
|
|
97
|
+
_this.isHideCaption = {
|
|
98
|
+
type: 'boolean'
|
|
99
|
+
};
|
|
100
|
+
_this.labelPosition = {
|
|
101
|
+
type: 'enum',
|
|
115
102
|
enum: [
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
'top',
|
|
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
|
-
|
|
127
|
-
type:
|
|
113
|
+
_this.defaultState = {
|
|
114
|
+
type: 'enum',
|
|
128
115
|
enum: [
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
'default',
|
|
117
|
+
'readonly'
|
|
131
118
|
]
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
type:
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
type:
|
|
119
|
+
};
|
|
120
|
+
_this.required = {
|
|
121
|
+
type: 'boolean'
|
|
122
|
+
};
|
|
123
|
+
_this.captionTip = {
|
|
124
|
+
type: 'string',
|
|
138
125
|
required: false,
|
|
139
|
-
message: RulesMessage.getMessage(
|
|
140
|
-
}
|
|
126
|
+
message: RulesMessage.getMessage('pleaseEnterCaptionTip')
|
|
127
|
+
};
|
|
141
128
|
// 初始化dataBind的校验规则
|
|
142
129
|
var validateFields = {
|
|
143
130
|
fieldCode: {
|
|
144
|
-
type:
|
|
131
|
+
type: 'string',
|
|
145
132
|
required: true,
|
|
146
|
-
message: RulesMessage.getMessage(
|
|
133
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
147
134
|
},
|
|
148
135
|
dataCode: {
|
|
149
|
-
type:
|
|
136
|
+
type: 'string',
|
|
150
137
|
required: true,
|
|
151
|
-
message: RulesMessage.getMessage(
|
|
138
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
152
139
|
}
|
|
153
140
|
};
|
|
154
141
|
if (_instanceof(props.dataBind, DataBind)) {
|
|
155
142
|
_this.dataBind = {
|
|
156
|
-
type:
|
|
143
|
+
type: 'object',
|
|
157
144
|
required: true,
|
|
158
145
|
fields: JSONCopy(validateFields),
|
|
159
|
-
message: RulesMessage.getMessage(
|
|
146
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
160
147
|
};
|
|
161
148
|
} else {
|
|
162
149
|
var dataBind = {
|
|
163
|
-
type:
|
|
150
|
+
type: 'object',
|
|
164
151
|
required: true,
|
|
165
152
|
fields: {},
|
|
166
|
-
message: RulesMessage.getMessage(
|
|
153
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
167
154
|
};
|
|
168
155
|
Object.keys(props.dataBind).forEach(function(key) {
|
|
169
156
|
dataBind.fields[key] = {
|
|
170
|
-
type:
|
|
157
|
+
type: 'object',
|
|
171
158
|
required: true,
|
|
172
159
|
fields: JSONCopy(validateFields),
|
|
173
|
-
message: RulesMessage.getMessage(
|
|
160
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
174
161
|
};
|
|
175
162
|
});
|
|
176
163
|
_this.dataBind = dataBind;
|
|
@@ -182,18 +169,18 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
182
169
|
}
|
|
183
170
|
return BaseControlPropertyRules;
|
|
184
171
|
}(PropertyRules);
|
|
185
|
-
var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(
|
|
172
|
+
var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRules1) {
|
|
186
173
|
"use strict";
|
|
187
|
-
_inherits(BaseControlPropertyRuntimeRules,
|
|
174
|
+
_inherits(BaseControlPropertyRuntimeRules, PropertyRuntimeRules1);
|
|
188
175
|
var _super = _createSuper(BaseControlPropertyRuntimeRules);
|
|
189
176
|
function BaseControlPropertyRuntimeRules(props) {
|
|
190
177
|
_classCallCheck(this, BaseControlPropertyRuntimeRules);
|
|
191
178
|
var _this;
|
|
192
179
|
_this = _super.call(this, props);
|
|
193
180
|
_this.push({
|
|
194
|
-
type:
|
|
181
|
+
type: 'string',
|
|
195
182
|
required: props.isHide ? false : props.required,
|
|
196
|
-
message: props.requiredMessage !==
|
|
183
|
+
message: props.requiredMessage !== '' ? props.requiredMessage : RulesMessage.getMessage('runtimeRequired', {
|
|
197
184
|
caption: props.caption
|
|
198
185
|
})
|
|
199
186
|
});
|
|
@@ -201,95 +188,45 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
201
188
|
}
|
|
202
189
|
return BaseControlPropertyRuntimeRules;
|
|
203
190
|
}(PropertyRuntimeRules);
|
|
204
|
-
|
|
205
|
-
|
|
191
|
+
var BaseControlProperty = /**
|
|
192
|
+
* 表单控件公共属性
|
|
193
|
+
* @public
|
|
194
|
+
*/ /*#__PURE__*/ function(Property1) {
|
|
206
195
|
"use strict";
|
|
207
|
-
_inherits(BaseControlProperty,
|
|
196
|
+
_inherits(BaseControlProperty, Property1);
|
|
208
197
|
var _super = _createSuper(BaseControlProperty);
|
|
209
198
|
function BaseControlProperty(props) {
|
|
210
199
|
_classCallCheck(this, BaseControlProperty);
|
|
211
200
|
var _this;
|
|
212
201
|
_this = _super.call(this, props);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
var _props_caption;
|
|
266
|
-
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
267
|
-
var _props_isHideCaption;
|
|
268
|
-
_this.isHideCaption = (_props_isHideCaption = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _props_isHideCaption !== void 0 ? _props_isHideCaption : false;
|
|
269
|
-
var _props_isShowCaptionTip;
|
|
270
|
-
_this.isShowCaptionTip = (_props_isShowCaptionTip = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && _props_isShowCaptionTip !== void 0 ? _props_isShowCaptionTip : false;
|
|
271
|
-
var _props_captionTip;
|
|
272
|
-
_this.captionTip = (_props_captionTip = props === null || props === void 0 ? void 0 : props.captionTip) !== null && _props_captionTip !== void 0 ? _props_captionTip : "";
|
|
273
|
-
var _props_defaultState;
|
|
274
|
-
_this.defaultState = (_props_defaultState = props === null || props === void 0 ? void 0 : props.defaultState) !== null && _props_defaultState !== void 0 ? _props_defaultState : "default";
|
|
275
|
-
var _props_labelPosition;
|
|
276
|
-
_this.labelPosition = (_props_labelPosition = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && _props_labelPosition !== void 0 ? _props_labelPosition : "top";
|
|
277
|
-
var _props_placeholder;
|
|
278
|
-
_this.placeholder = (_props_placeholder = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
279
|
-
var _props_required;
|
|
280
|
-
_this.required = (_props_required = props === null || props === void 0 ? void 0 : props.required) !== null && _props_required !== void 0 ? _props_required : false;
|
|
281
|
-
var _props_requiredMessage;
|
|
282
|
-
_this.requiredMessage = (_props_requiredMessage = props === null || props === void 0 ? void 0 : props.requiredMessage) !== null && _props_requiredMessage !== void 0 ? _props_requiredMessage : "";
|
|
202
|
+
var ref;
|
|
203
|
+
_this.caption = (ref = props === null || props === void 0 ? void 0 : props.caption) !== null && ref !== void 0 ? ref : '';
|
|
204
|
+
var ref1;
|
|
205
|
+
_this.isHideCaption = (ref1 = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && ref1 !== void 0 ? ref1 : false;
|
|
206
|
+
var ref2;
|
|
207
|
+
_this.isShowCaptionTip = (ref2 = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && ref2 !== void 0 ? ref2 : false;
|
|
208
|
+
var ref3;
|
|
209
|
+
_this.captionTip = (ref3 = props === null || props === void 0 ? void 0 : props.captionTip) !== null && ref3 !== void 0 ? ref3 : '';
|
|
210
|
+
var ref4;
|
|
211
|
+
_this.defaultState = (ref4 = props === null || props === void 0 ? void 0 : props.defaultState) !== null && ref4 !== void 0 ? ref4 : 'default';
|
|
212
|
+
var ref5;
|
|
213
|
+
_this.labelPosition = (ref5 = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && ref5 !== void 0 ? ref5 : 'top';
|
|
214
|
+
var ref6;
|
|
215
|
+
_this.placeholder = (ref6 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref6 !== void 0 ? ref6 : '';
|
|
216
|
+
var ref7;
|
|
217
|
+
_this.required = (ref7 = props === null || props === void 0 ? void 0 : props.required) !== null && ref7 !== void 0 ? ref7 : false;
|
|
218
|
+
var ref8;
|
|
219
|
+
_this.requiredMessage = (ref8 = props === null || props === void 0 ? void 0 : props.requiredMessage) !== null && ref8 !== void 0 ? ref8 : '';
|
|
283
220
|
//form 组件优先初始化DataBind
|
|
284
221
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
285
|
-
var
|
|
286
|
-
_this.defaultValue = (
|
|
222
|
+
var ref9;
|
|
223
|
+
_this.defaultValue = (ref9 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && ref9 !== void 0 ? ref9 : '';
|
|
287
224
|
return _this;
|
|
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
|
-
|
|
302
|
-
type:
|
|
238
|
+
_this.optionConfig = {
|
|
239
|
+
type: 'enum',
|
|
303
240
|
enum: [
|
|
304
|
-
|
|
305
|
-
|
|
241
|
+
'custom',
|
|
242
|
+
'datasource'
|
|
306
243
|
],
|
|
307
|
-
message: RulesMessage.getMessage(
|
|
308
|
-
}
|
|
309
|
-
|
|
244
|
+
message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
|
|
245
|
+
};
|
|
246
|
+
_this.options = [
|
|
310
247
|
{
|
|
311
|
-
type:
|
|
312
|
-
message: RulesMessage.getMessage(
|
|
313
|
-
}
|
|
314
|
-
]
|
|
315
|
-
|
|
248
|
+
type: 'array',
|
|
249
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
250
|
+
},
|
|
251
|
+
];
|
|
252
|
+
_this.datasourceBind = [
|
|
316
253
|
{
|
|
317
|
-
type:
|
|
318
|
-
message: RulesMessage.getMessage(
|
|
319
|
-
}
|
|
320
|
-
]
|
|
254
|
+
type: 'object',
|
|
255
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
256
|
+
},
|
|
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);
|
|
@@ -82,19 +69,17 @@ function _createSuper(Derived) {
|
|
|
82
69
|
return _possibleConstructorReturn(this, result);
|
|
83
70
|
};
|
|
84
71
|
}
|
|
85
|
-
import { RuntimeControl } from
|
|
86
|
-
import BaseControlProperty from
|
|
87
|
-
var FormControl = /*#__PURE__*/ function(
|
|
72
|
+
import { RuntimeControl } from '../BaseControl';
|
|
73
|
+
import BaseControlProperty from './property';
|
|
74
|
+
var FormControl = /*#__PURE__*/ function(RuntimeControl1) {
|
|
88
75
|
"use strict";
|
|
89
|
-
_inherits(FormControl,
|
|
76
|
+
_inherits(FormControl, RuntimeControl1);
|
|
90
77
|
var _super = _createSuper(FormControl);
|
|
91
78
|
function FormControl(props) {
|
|
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
|
}
|
|
@@ -110,7 +110,7 @@ function _inherits(subClass, superClass) {
|
|
|
110
110
|
}
|
|
111
111
|
function _instanceof(left, right) {
|
|
112
112
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
113
|
-
return
|
|
113
|
+
return right[Symbol.hasInstance](left);
|
|
114
114
|
} else {
|
|
115
115
|
return left instanceof right;
|
|
116
116
|
}
|
|
@@ -136,30 +136,6 @@ function _objectSpread(target) {
|
|
|
136
136
|
}
|
|
137
137
|
return target;
|
|
138
138
|
}
|
|
139
|
-
function ownKeys(object, enumerableOnly) {
|
|
140
|
-
var keys = Object.keys(object);
|
|
141
|
-
if (Object.getOwnPropertySymbols) {
|
|
142
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
143
|
-
if (enumerableOnly) {
|
|
144
|
-
symbols = symbols.filter(function(sym) {
|
|
145
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
keys.push.apply(keys, symbols);
|
|
149
|
-
}
|
|
150
|
-
return keys;
|
|
151
|
-
}
|
|
152
|
-
function _objectSpreadProps(target, source) {
|
|
153
|
-
source = source != null ? source : {};
|
|
154
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
155
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
156
|
-
} else {
|
|
157
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
158
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return target;
|
|
162
|
-
}
|
|
163
139
|
function _possibleConstructorReturn(self, call) {
|
|
164
140
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
165
141
|
return call;
|
|
@@ -219,123 +195,25 @@ function _createSuper(Derived) {
|
|
|
219
195
|
return _possibleConstructorReturn(this, result);
|
|
220
196
|
};
|
|
221
197
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return t[1];
|
|
228
|
-
},
|
|
229
|
-
trys: [],
|
|
230
|
-
ops: []
|
|
231
|
-
};
|
|
232
|
-
return g = {
|
|
233
|
-
next: verb(0),
|
|
234
|
-
"throw": verb(1),
|
|
235
|
-
"return": verb(2)
|
|
236
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
237
|
-
return this;
|
|
238
|
-
}), g;
|
|
239
|
-
function verb(n) {
|
|
240
|
-
return function(v) {
|
|
241
|
-
return step([
|
|
242
|
-
n,
|
|
243
|
-
v
|
|
244
|
-
]);
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
function step(op) {
|
|
248
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
249
|
-
while(_)try {
|
|
250
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
251
|
-
if (y = 0, t) op = [
|
|
252
|
-
op[0] & 2,
|
|
253
|
-
t.value
|
|
254
|
-
];
|
|
255
|
-
switch(op[0]){
|
|
256
|
-
case 0:
|
|
257
|
-
case 1:
|
|
258
|
-
t = op;
|
|
259
|
-
break;
|
|
260
|
-
case 4:
|
|
261
|
-
_.label++;
|
|
262
|
-
return {
|
|
263
|
-
value: op[1],
|
|
264
|
-
done: false
|
|
265
|
-
};
|
|
266
|
-
case 5:
|
|
267
|
-
_.label++;
|
|
268
|
-
y = op[1];
|
|
269
|
-
op = [
|
|
270
|
-
0
|
|
271
|
-
];
|
|
272
|
-
continue;
|
|
273
|
-
case 7:
|
|
274
|
-
op = _.ops.pop();
|
|
275
|
-
_.trys.pop();
|
|
276
|
-
continue;
|
|
277
|
-
default:
|
|
278
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
279
|
-
_ = 0;
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
283
|
-
_.label = op[1];
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
287
|
-
_.label = t[1];
|
|
288
|
-
t = op;
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
if (t && _.label < t[2]) {
|
|
292
|
-
_.label = t[2];
|
|
293
|
-
_.ops.push(op);
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
if (t[2]) _.ops.pop();
|
|
297
|
-
_.trys.pop();
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
op = body.call(thisArg, _);
|
|
301
|
-
} catch (e) {
|
|
302
|
-
op = [
|
|
303
|
-
6,
|
|
304
|
-
e
|
|
305
|
-
];
|
|
306
|
-
y = 0;
|
|
307
|
-
} finally{
|
|
308
|
-
f = t = 0;
|
|
309
|
-
}
|
|
310
|
-
if (op[0] & 5) throw op[1];
|
|
311
|
-
return {
|
|
312
|
-
value: op[0] ? op[1] : void 0,
|
|
313
|
-
done: true
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
import { JSONCopy } from "@byteluck-fe/model-driven-shared";
|
|
318
|
-
import { DesignerControl } from "../BaseControl";
|
|
319
|
-
import LayoutControlProperty from "./property";
|
|
320
|
-
import { defineControlArrayToProperty } from "../ControlArray";
|
|
198
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
199
|
+
import { JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
200
|
+
import { DesignerControl } from '../BaseControl';
|
|
201
|
+
import LayoutControlProperty from './property';
|
|
202
|
+
import { defineControlArrayToProperty } from '../ControlArray';
|
|
321
203
|
// 最大可拖入数量
|
|
322
204
|
var CHILDREN_MAX_LENGTH = 10000;
|
|
323
|
-
var LayoutControl = /*#__PURE__*/ function _target(
|
|
205
|
+
var LayoutControl = /*#__PURE__*/ function _target(DesignerControl1) {
|
|
324
206
|
"use strict";
|
|
325
|
-
_inherits(LayoutControl,
|
|
207
|
+
_inherits(LayoutControl, DesignerControl1);
|
|
326
208
|
var _super = _createSuper(LayoutControl);
|
|
327
209
|
function LayoutControl(props) {
|
|
328
210
|
_classCallCheck(this, LayoutControl);
|
|
329
211
|
var _this;
|
|
330
212
|
_this = _super.call(this, props);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
_defineProperty(_assertThisInitialized(_this), "excludes", void 0);
|
|
334
|
-
_defineProperty(_assertThisInitialized(_this), "childrenMaxLength", void 0);
|
|
335
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
336
|
-
var _ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = _ref.excludes, childrenMaxLength = _ref.childrenMaxLength;
|
|
213
|
+
_this.controlType = 'layout';
|
|
214
|
+
var ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = ref.excludes, childrenMaxLength = ref.childrenMaxLength;
|
|
337
215
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
338
|
-
defineControlArrayToProperty(_assertThisInitialized(_this),
|
|
216
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children);
|
|
339
217
|
_this.excludes = JSONCopy(excludes);
|
|
340
218
|
_this.childrenMaxLength = childrenMaxLength;
|
|
341
219
|
return _this;
|
|
@@ -364,31 +242,25 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
364
242
|
var _this1 = this, _superprop_get_validate = function() {
|
|
365
243
|
return _get(_getPrototypeOf(LayoutControl.prototype), "validate", _this);
|
|
366
244
|
};
|
|
367
|
-
return _asyncToGenerator(function() {
|
|
368
|
-
return
|
|
369
|
-
switch(
|
|
245
|
+
return _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
|
|
246
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
247
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
370
248
|
case 0:
|
|
371
|
-
|
|
372
|
-
|
|
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
|
-
];
|
|
249
|
+
_ctx.next = 2;
|
|
250
|
+
return _superprop_get_validate().call(_this1, messages, ignore);
|
|
383
251
|
case 2:
|
|
384
|
-
|
|
385
|
-
return
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
252
|
+
_ctx.next = 4;
|
|
253
|
+
return Promise.all(_this1.children.map(function(child) {
|
|
254
|
+
return child.validate(messages, ignore);
|
|
255
|
+
}));
|
|
256
|
+
case 4:
|
|
257
|
+
return _ctx.abrupt("return", true);
|
|
258
|
+
case 5:
|
|
259
|
+
case "end":
|
|
260
|
+
return _ctx.stop();
|
|
389
261
|
}
|
|
390
|
-
});
|
|
391
|
-
})();
|
|
262
|
+
}, _callee);
|
|
263
|
+
}))();
|
|
392
264
|
}
|
|
393
265
|
},
|
|
394
266
|
{
|
|
@@ -420,7 +292,7 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
420
292
|
var schema = item.toSchema();
|
|
421
293
|
return schema;
|
|
422
294
|
});
|
|
423
|
-
return
|
|
295
|
+
return _objectSpread({}, superSchema, {
|
|
424
296
|
children: children
|
|
425
297
|
});
|
|
426
298
|
}
|
|
@@ -428,7 +300,7 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
428
300
|
]);
|
|
429
301
|
return LayoutControl;
|
|
430
302
|
}(DesignerControl);
|
|
431
|
-
|
|
432
|
-
|
|
303
|
+
LayoutControl.excludes = false;
|
|
304
|
+
LayoutControl.childrenMaxLength = CHILDREN_MAX_LENGTH;
|
|
433
305
|
export default LayoutControl;
|
|
434
306
|
export { LayoutControl as DesignerLayoutControl };
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|