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