@byteluck-fe/model-driven-core 2.7.0-alpha.3 → 2.7.0-beta
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 +65 -64
- package/dist/esm/common/BaseControl/property.js +47 -57
- package/dist/esm/common/BaseControl/runtime.js +24 -23
- package/dist/esm/common/ColumnControl/designer.js +27 -26
- package/dist/esm/common/ColumnControl/property.js +55 -54
- package/dist/esm/common/ColumnControl/runtime.js +27 -26
- package/dist/esm/common/ControlArray.js +12 -12
- package/dist/esm/common/FormControl/designer.js +29 -28
- package/dist/esm/common/FormControl/property.js +65 -64
- package/dist/esm/common/FormControl/runtime.js +28 -27
- package/dist/esm/common/LayoutControl/designer.js +63 -62
- package/dist/esm/common/LayoutControl/property.js +22 -22
- package/dist/esm/common/LayoutControl/runtime.js +29 -28
- package/dist/esm/common/ListControl/designer.js +59 -58
- package/dist/esm/common/ListControl/property.js +26 -25
- package/dist/esm/common/ListControl/runtime.js +31 -30
- package/dist/esm/common/SearchViewControl/designer.js +27 -26
- package/dist/esm/common/SearchViewControl/property.js +26 -25
- package/dist/esm/common/SearchViewControl/runtime.js +27 -26
- package/dist/esm/common/WrapControl/designer.js +27 -26
- package/dist/esm/common/WrapControl/property.js +22 -22
- package/dist/esm/common/WrapControl/runtime.js +27 -26
- package/dist/esm/framework/RegisterControls.js +12 -12
- package/dist/esm/framework/index.js +418 -414
- package/dist/index.umd.js +1 -1
- package/dist/types/framework/index.d.ts +3 -31
- package/dist/types/type.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return arr;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
if (Array.isArray(arr)) return
|
|
9
|
+
function _array_without_holes(arr) {
|
|
10
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
11
11
|
}
|
|
12
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
13
13
|
try {
|
|
@@ -23,7 +23,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
23
23
|
Promise.resolve(value).then(_next, _throw);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function _async_to_generator(fn) {
|
|
27
27
|
return function() {
|
|
28
28
|
var self = this, args = arguments;
|
|
29
29
|
return new Promise(function(resolve, reject) {
|
|
@@ -38,7 +38,7 @@ function _asyncToGenerator(fn) {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function _class_call_check(instance, Constructor) {
|
|
42
42
|
if (!(instance instanceof Constructor)) {
|
|
43
43
|
throw new TypeError("Cannot call a class as a function");
|
|
44
44
|
}
|
|
@@ -52,12 +52,12 @@ function _defineProperties(target, props) {
|
|
|
52
52
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
56
56
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
57
57
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
58
58
|
return Constructor;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function _define_property(obj, key, value) {
|
|
61
61
|
if (key in obj) {
|
|
62
62
|
Object.defineProperty(obj, key, {
|
|
63
63
|
value: value,
|
|
@@ -77,16 +77,16 @@ function _instanceof(left, right) {
|
|
|
77
77
|
return left instanceof right;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function _iterable_to_array(iter) {
|
|
81
81
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function _non_iterable_rest() {
|
|
84
84
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function _non_iterable_spread() {
|
|
87
87
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function _object_spread(target) {
|
|
90
90
|
for(var i = 1; i < arguments.length; i++){
|
|
91
91
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
92
92
|
var ownKeys = Object.keys(source);
|
|
@@ -96,26 +96,26 @@ function _objectSpread(target) {
|
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
98
|
ownKeys.forEach(function(key) {
|
|
99
|
-
|
|
99
|
+
_define_property(target, key, source[key]);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
return target;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
104
|
+
function _to_array(arr) {
|
|
105
|
+
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
107
|
+
function _to_consumable_array(arr) {
|
|
108
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
111
111
|
if (!o) return;
|
|
112
|
-
if (typeof o === "string") return
|
|
112
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
113
113
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
114
114
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
115
115
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
116
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
116
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
function _ts_generator(thisArg, body) {
|
|
119
119
|
var f, y, t, g, _ = {
|
|
120
120
|
label: 0,
|
|
121
121
|
sent: function() {
|
|
@@ -209,7 +209,7 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
209
209
|
done: true
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
213
|
import Property from "./property";
|
|
214
214
|
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from "@byteluck-fe/model-driven-shared";
|
|
215
215
|
import { createValidator } from "../Validator";
|
|
@@ -218,45 +218,46 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
218
218
|
"use strict";
|
|
219
219
|
function Control(props) {
|
|
220
220
|
var _this = this;
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
_class_call_check(this, Control);
|
|
222
|
+
var _props, _props1, _props2, _props3, _props4;
|
|
223
|
+
_define_property(this, "id", void 0 // 唯一标识符
|
|
223
224
|
);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
225
|
+
_define_property(this, "name", void 0);
|
|
226
|
+
_define_property(this, "icon", void 0);
|
|
227
|
+
_define_property(this, "type", void 0);
|
|
228
|
+
_define_property(this, "controlType", void 0);
|
|
229
|
+
_define_property(this, "props", void 0);
|
|
230
|
+
_define_property(this, "setting", []);
|
|
231
|
+
_define_property(this, "fieldType", void 0);
|
|
232
|
+
_define_property(this, "eventKeys", []);
|
|
233
|
+
_define_property(this, "customEvents", []);
|
|
234
|
+
_define_property(this, "parent", null);
|
|
235
|
+
_define_property(this, "updateSetting", updateSetting);
|
|
236
|
+
_define_property(this, "removeSetting", removeSetting);
|
|
236
237
|
this._callControlHooks("preInstance", props);
|
|
237
238
|
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref.controlName, controlIcon = _ref.controlIcon, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, controlEventKeys = _ref.controlEventKeys, controlCustomEvents = _ref.controlCustomEvents, name = _ref.name, setting = _ref.setting;
|
|
238
239
|
if (!(controlName && controlIcon && controlType)) {
|
|
239
240
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
240
241
|
}
|
|
241
242
|
var _props_id;
|
|
242
|
-
this.id = (_props_id = props === null ||
|
|
243
|
+
this.id = (_props_id = (_props = props) === null || _props === void 0 ? void 0 : _props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
|
|
243
244
|
this.name = controlName;
|
|
244
245
|
this.icon = controlIcon;
|
|
245
246
|
var _props_type;
|
|
246
|
-
this.type = (_props_type = props === null ||
|
|
247
|
-
this.props = new Property(props === null ||
|
|
247
|
+
this.type = (_props_type = (_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
248
|
+
this.props = new Property((_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.props, (_instanceof(this, Control) ? this.constructor : void 0).controlName);
|
|
248
249
|
var _props_controlType;
|
|
249
|
-
this.controlType = (_props_controlType = props === null ||
|
|
250
|
+
this.controlType = (_props_controlType = (_props3 = props) === null || _props3 === void 0 ? void 0 : _props3.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
|
|
250
251
|
this.setting = JSONCopy(setting);
|
|
251
252
|
var _props_fieldType;
|
|
252
|
-
this.fieldType = (_props_fieldType = props === null ||
|
|
253
|
+
this.fieldType = (_props_fieldType = (_props4 = props) === null || _props4 === void 0 ? void 0 : _props4.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
253
254
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
254
255
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
255
256
|
Promise.resolve().then(function() {
|
|
256
257
|
_this._callControlHooks("postInstance", props);
|
|
257
258
|
});
|
|
258
259
|
}
|
|
259
|
-
|
|
260
|
+
_create_class(Control, [
|
|
260
261
|
{
|
|
261
262
|
key: "rules",
|
|
262
263
|
get: function get() {
|
|
@@ -274,11 +275,11 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
274
275
|
args[_key] = arguments[_key];
|
|
275
276
|
}
|
|
276
277
|
var _controlHooksEmitter;
|
|
277
|
-
var _args =
|
|
278
|
+
var _args = _to_array(args), key = _args[0], arg = _args.slice(1);
|
|
278
279
|
return (_controlHooksEmitter = controlHooksEmitter).emit.apply(_controlHooksEmitter, [
|
|
279
280
|
key,
|
|
280
281
|
this
|
|
281
|
-
].concat(
|
|
282
|
+
].concat(_to_consumable_array(arg)));
|
|
282
283
|
}
|
|
283
284
|
},
|
|
284
285
|
{
|
|
@@ -308,12 +309,13 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
308
309
|
key: "preValidate",
|
|
309
310
|
value: function preValidate() {
|
|
310
311
|
var _this = this;
|
|
311
|
-
return
|
|
312
|
+
return _async_to_generator(function() {
|
|
312
313
|
var rules, results, result;
|
|
313
|
-
return
|
|
314
|
+
return _ts_generator(this, function(_state) {
|
|
314
315
|
switch(_state.label){
|
|
315
316
|
case 0:
|
|
316
|
-
|
|
317
|
+
// 在处理validate之前,预留的钩子函数,允许在validate之前处理一些数据
|
|
318
|
+
rules = _object_spread({}, _this.rules);
|
|
317
319
|
return [
|
|
318
320
|
4,
|
|
319
321
|
_this._callControlHooks("preValidate", rules)
|
|
@@ -335,9 +337,9 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
335
337
|
value: // property校验
|
|
336
338
|
function validate(messages, ignore) {
|
|
337
339
|
var _this = this;
|
|
338
|
-
return
|
|
340
|
+
return _async_to_generator(function() {
|
|
339
341
|
var result, rules, validator, err;
|
|
340
|
-
return
|
|
342
|
+
return _ts_generator(this, function(_state) {
|
|
341
343
|
switch(_state.label){
|
|
342
344
|
case 0:
|
|
343
345
|
return [
|
|
@@ -346,7 +348,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
346
348
|
];
|
|
347
349
|
case 1:
|
|
348
350
|
result = _state.sent();
|
|
349
|
-
rules = result !== undefined ? result :
|
|
351
|
+
rules = result !== undefined ? result : _object_spread({}, _this.rules);
|
|
350
352
|
if (Array.isArray(ignore)) {
|
|
351
353
|
ignore.forEach(function(key) {
|
|
352
354
|
if (rules.hasOwnProperty(key)) {
|
|
@@ -461,7 +463,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
461
463
|
if (key !== "setting") return;
|
|
462
464
|
if (setting.add) {
|
|
463
465
|
var _this_setting;
|
|
464
|
-
(_this_setting = this.setting).push.apply(_this_setting,
|
|
466
|
+
(_this_setting = this.setting).push.apply(_this_setting, _to_consumable_array(setting.add));
|
|
465
467
|
}
|
|
466
468
|
if (setting.remove) {
|
|
467
469
|
this.removeSettingItem(setting.remove);
|
|
@@ -474,20 +476,20 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
474
476
|
]);
|
|
475
477
|
return Control;
|
|
476
478
|
}();
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
_define_property(Control, "controlName", "控件");
|
|
480
|
+
_define_property(Control, "controlIcon", "icon");
|
|
481
|
+
_define_property(Control, "controlType", "control");
|
|
482
|
+
_define_property(Control, "controlFieldType", void 0);
|
|
481
483
|
// 控件可以触发的事件key
|
|
482
|
-
|
|
483
|
-
|
|
484
|
+
_define_property(Control, "controlEventKeys", []);
|
|
485
|
+
_define_property(Control, "controlCustomEvents", []);
|
|
484
486
|
// setting应该是全量的设置项,外部控制,在初始化的时候会deepCopy一份
|
|
485
|
-
|
|
486
|
-
|
|
487
|
+
_define_property(Control, "setting", []);
|
|
488
|
+
_define_property(Control, "__is_control__", true);
|
|
487
489
|
// 删除指定的settingItem
|
|
488
|
-
|
|
490
|
+
_define_property(Control, "removeSettingItem", removeSetting);
|
|
489
491
|
// 修改指定的settingItem的visible
|
|
490
|
-
|
|
492
|
+
_define_property(Control, "updateSettingItem", updateSetting);
|
|
491
493
|
export default Control;
|
|
492
494
|
export { Control as DesignerControl };
|
|
493
495
|
/**
|
|
@@ -500,11 +502,10 @@ export { Control as DesignerControl };
|
|
|
500
502
|
keys
|
|
501
503
|
];
|
|
502
504
|
deleteKeys.forEach(function(deleteKey) {
|
|
503
|
-
var _this_setting;
|
|
504
505
|
// 是否存在子项
|
|
505
506
|
var isHasItem = typeof deleteKey !== "string";
|
|
506
507
|
// @ts-ignore
|
|
507
|
-
var settingIndex =
|
|
508
|
+
var settingIndex = _this.setting.findIndex(function(option) {
|
|
508
509
|
return option.key === (isHasItem ? deleteKey.key : deleteKey);
|
|
509
510
|
});
|
|
510
511
|
// 移除对应选项
|
|
@@ -547,7 +548,7 @@ export { Control as DesignerControl };
|
|
|
547
548
|
settingItem.showItems = value.showItems;
|
|
548
549
|
} else {
|
|
549
550
|
var _settingItem_showItems;
|
|
550
|
-
(_settingItem_showItems = settingItem.showItems).push.apply(_settingItem_showItems,
|
|
551
|
+
(_settingItem_showItems = settingItem.showItems).push.apply(_settingItem_showItems, _to_consumable_array(value.showItems));
|
|
551
552
|
}
|
|
552
553
|
}
|
|
553
554
|
}
|
|
@@ -1,43 +1,32 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assert_this_initialized(self) {
|
|
2
2
|
if (self === void 0) {
|
|
3
3
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function isNativeReflectConstruct() {
|
|
13
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
14
|
-
if (Reflect.construct.sham) return false;
|
|
15
|
-
if (typeof Proxy === "function") return true;
|
|
16
|
-
try {
|
|
17
|
-
Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
|
|
18
|
-
return true;
|
|
19
|
-
} catch (e) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
12
|
function _construct(Parent, args, Class) {
|
|
24
|
-
if (
|
|
13
|
+
if (_is_native_reflect_construct()) {
|
|
25
14
|
_construct = Reflect.construct;
|
|
26
15
|
} else {
|
|
27
|
-
_construct = function
|
|
16
|
+
_construct = function construct(Parent, args, Class) {
|
|
28
17
|
var a = [
|
|
29
18
|
null
|
|
30
19
|
];
|
|
31
20
|
a.push.apply(a, args);
|
|
32
21
|
var Constructor = Function.bind.apply(Parent, a);
|
|
33
22
|
var instance = new Constructor();
|
|
34
|
-
if (Class)
|
|
23
|
+
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
35
24
|
return instance;
|
|
36
25
|
};
|
|
37
26
|
}
|
|
38
27
|
return _construct.apply(null, arguments);
|
|
39
28
|
}
|
|
40
|
-
function
|
|
29
|
+
function _define_property(obj, key, value) {
|
|
41
30
|
if (key in obj) {
|
|
42
31
|
Object.defineProperty(obj, key, {
|
|
43
32
|
value: value,
|
|
@@ -50,11 +39,11 @@ function _defineProperty(obj, key, value) {
|
|
|
50
39
|
}
|
|
51
40
|
return obj;
|
|
52
41
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
42
|
+
function _get_prototype_of(o) {
|
|
43
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
55
44
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
56
45
|
};
|
|
57
|
-
return
|
|
46
|
+
return _get_prototype_of(o);
|
|
58
47
|
}
|
|
59
48
|
function _inherits(subClass, superClass) {
|
|
60
49
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -67,32 +56,32 @@ function _inherits(subClass, superClass) {
|
|
|
67
56
|
configurable: true
|
|
68
57
|
}
|
|
69
58
|
});
|
|
70
|
-
if (superClass)
|
|
59
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
71
60
|
}
|
|
72
|
-
function
|
|
61
|
+
function _is_native_function(fn) {
|
|
73
62
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
74
63
|
}
|
|
75
|
-
function
|
|
76
|
-
if (call && (
|
|
64
|
+
function _possible_constructor_return(self, call) {
|
|
65
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
77
66
|
return call;
|
|
78
67
|
}
|
|
79
|
-
return
|
|
68
|
+
return _assert_this_initialized(self);
|
|
80
69
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
70
|
+
function _set_prototype_of(o, p) {
|
|
71
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
83
72
|
o.__proto__ = p;
|
|
84
73
|
return o;
|
|
85
74
|
};
|
|
86
|
-
return
|
|
75
|
+
return _set_prototype_of(o, p);
|
|
87
76
|
}
|
|
88
|
-
|
|
77
|
+
function _type_of(obj) {
|
|
89
78
|
"@swc/helpers - typeof";
|
|
90
79
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
91
|
-
}
|
|
92
|
-
function
|
|
80
|
+
}
|
|
81
|
+
function _wrap_native_super(Class) {
|
|
93
82
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
94
|
-
|
|
95
|
-
if (Class === null || !
|
|
83
|
+
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
84
|
+
if (Class === null || !_is_native_function(Class)) return Class;
|
|
96
85
|
if (typeof Class !== "function") {
|
|
97
86
|
throw new TypeError("Super expression must either be null or a function");
|
|
98
87
|
}
|
|
@@ -101,7 +90,7 @@ function _wrapNativeSuper(Class) {
|
|
|
101
90
|
_cache.set(Class, Wrapper);
|
|
102
91
|
}
|
|
103
92
|
function Wrapper() {
|
|
104
|
-
return _construct(Class, arguments,
|
|
93
|
+
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
105
94
|
}
|
|
106
95
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
107
96
|
constructor: {
|
|
@@ -111,11 +100,11 @@ function _wrapNativeSuper(Class) {
|
|
|
111
100
|
configurable: true
|
|
112
101
|
}
|
|
113
102
|
});
|
|
114
|
-
return
|
|
103
|
+
return _set_prototype_of(Wrapper, Class);
|
|
115
104
|
};
|
|
116
|
-
return
|
|
105
|
+
return _wrap_native_super(Class);
|
|
117
106
|
}
|
|
118
|
-
function
|
|
107
|
+
function _is_native_reflect_construct() {
|
|
119
108
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
120
109
|
if (Reflect.construct.sham) return false;
|
|
121
110
|
if (typeof Proxy === "function") return true;
|
|
@@ -126,63 +115,64 @@ function _isNativeReflectConstruct() {
|
|
|
126
115
|
return false;
|
|
127
116
|
}
|
|
128
117
|
}
|
|
129
|
-
function
|
|
130
|
-
var hasNativeReflectConstruct =
|
|
118
|
+
function _create_super(Derived) {
|
|
119
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
131
120
|
return function _createSuperInternal() {
|
|
132
|
-
var Super =
|
|
121
|
+
var Super = _get_prototype_of(Derived), result;
|
|
133
122
|
if (hasNativeReflectConstruct) {
|
|
134
|
-
var NewTarget =
|
|
123
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
135
124
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
136
125
|
} else {
|
|
137
126
|
result = Super.apply(this, arguments);
|
|
138
127
|
}
|
|
139
|
-
return
|
|
128
|
+
return _possible_constructor_return(this, result);
|
|
140
129
|
};
|
|
141
130
|
}
|
|
142
131
|
import { BaseStyle } from "../../framework";
|
|
143
132
|
var PropertyRules = function PropertyRules(props) {
|
|
144
133
|
"use strict";
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
_class_call_check(this, PropertyRules);
|
|
135
|
+
_define_property(this, "isHide", {
|
|
147
136
|
type: "boolean"
|
|
148
137
|
});
|
|
149
138
|
};
|
|
150
139
|
var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
151
140
|
"use strict";
|
|
152
141
|
_inherits(PropertyRuntimeRules, Array1);
|
|
153
|
-
var _super =
|
|
142
|
+
var _super = _create_super(PropertyRuntimeRules);
|
|
154
143
|
function PropertyRuntimeRules(props) {
|
|
155
|
-
|
|
144
|
+
_class_call_check(this, PropertyRuntimeRules);
|
|
156
145
|
return _super.call(this);
|
|
157
146
|
}
|
|
158
147
|
return PropertyRuntimeRules;
|
|
159
|
-
}(
|
|
148
|
+
}(_wrap_native_super(Array));
|
|
160
149
|
/**
|
|
161
150
|
* 全局属性
|
|
162
151
|
* @public
|
|
163
152
|
*/ var Property = function Property(props) {
|
|
164
153
|
"use strict";
|
|
165
154
|
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
166
|
-
|
|
155
|
+
_class_call_check(this, Property);
|
|
156
|
+
var _props, _props1, _props2;
|
|
167
157
|
/**
|
|
168
158
|
* 是否隐藏
|
|
169
159
|
* @public
|
|
170
160
|
* @defaultValue false
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
|
|
161
|
+
*/ _define_property(this, "isHide", void 0);
|
|
162
|
+
_define_property(this, "className", void 0);
|
|
163
|
+
_define_property(this, "style", void 0);
|
|
174
164
|
/**
|
|
175
165
|
* 标题
|
|
176
166
|
* @public
|
|
177
167
|
* @defaultValue ''
|
|
178
|
-
*/
|
|
168
|
+
*/ _define_property(this, "caption", void 0);
|
|
179
169
|
var _props_isHide;
|
|
180
|
-
this.isHide = (_props_isHide = props === null ||
|
|
181
|
-
this.style = new BaseStyle(props === null ||
|
|
170
|
+
this.isHide = (_props_isHide = (_props = props) === null || _props === void 0 ? void 0 : _props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
|
|
171
|
+
this.style = new BaseStyle((_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.style);
|
|
182
172
|
var _props_caption;
|
|
183
|
-
this.caption = (_props_caption = props === null ||
|
|
173
|
+
this.caption = (_props_caption = (_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.caption) !== null && _props_caption !== void 0 ? _props_caption : caption;
|
|
184
174
|
};
|
|
185
|
-
|
|
186
|
-
|
|
175
|
+
_define_property(Property, "Rules", PropertyRules);
|
|
176
|
+
_define_property(Property, "RuntimeRules", PropertyRuntimeRules);
|
|
187
177
|
export default Property;
|
|
188
178
|
export { Property, PropertyRules, PropertyRuntimeRules };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
2
|
if (!(instance instanceof Constructor)) {
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
@@ -12,12 +12,12 @@ function _defineProperties(target, props) {
|
|
|
12
12
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
16
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
21
|
if (key in obj) {
|
|
22
22
|
Object.defineProperty(obj, key, {
|
|
23
23
|
value: value,
|
|
@@ -43,34 +43,35 @@ import { PAGE_STATUS } from "../../framework";
|
|
|
43
43
|
var Control = /*#__PURE__*/ function _target() {
|
|
44
44
|
"use strict";
|
|
45
45
|
function Control(props) {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
_class_call_check(this, Control);
|
|
47
|
+
var _props, _props1, _props2, _props3, _props4, _props5;
|
|
48
|
+
_define_property(this, "id", void 0 // 唯一标识符
|
|
48
49
|
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
_define_property(this, "type", void 0);
|
|
51
|
+
_define_property(this, "controlType", void 0);
|
|
52
|
+
_define_property(this, "props", void 0);
|
|
53
|
+
_define_property(this, "fieldType", void 0);
|
|
54
|
+
_define_property(this, "customEvents", []);
|
|
55
|
+
_define_property(this, "pageStatus", void 0);
|
|
56
|
+
_define_property(this, "parent", null);
|
|
56
57
|
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, name = _ref.name, controlCustomEvents = _ref.controlCustomEvents;
|
|
57
58
|
if (!controlType) {
|
|
58
59
|
referenceError("The ".concat(name, " controlType is not define"));
|
|
59
60
|
}
|
|
60
61
|
var _props_id;
|
|
61
|
-
this.id = (_props_id = props === null ||
|
|
62
|
+
this.id = (_props_id = (_props = props) === null || _props === void 0 ? void 0 : _props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
|
|
62
63
|
var _props_type;
|
|
63
|
-
this.type = (_props_type = props === null ||
|
|
64
|
-
this.props = new Property(props === null ||
|
|
64
|
+
this.type = (_props_type = (_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
65
|
+
this.props = new Property((_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.props);
|
|
65
66
|
this.customEvents = controlCustomEvents;
|
|
66
67
|
var _props_controlType;
|
|
67
|
-
this.controlType = (_props_controlType = props === null ||
|
|
68
|
+
this.controlType = (_props_controlType = (_props3 = props) === null || _props3 === void 0 ? void 0 : _props3.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
|
|
68
69
|
var _props_fieldType;
|
|
69
|
-
this.fieldType = (_props_fieldType = props === null ||
|
|
70
|
+
this.fieldType = (_props_fieldType = (_props4 = props) === null || _props4 === void 0 ? void 0 : _props4.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
70
71
|
var _props_pageStatus;
|
|
71
|
-
this.pageStatus = (_props_pageStatus = props === null ||
|
|
72
|
+
this.pageStatus = (_props_pageStatus = (_props5 = props) === null || _props5 === void 0 ? void 0 : _props5.pageStatus) !== null && _props_pageStatus !== void 0 ? _props_pageStatus : PAGE_STATUS.UNKNOWN;
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
_create_class(Control, [
|
|
74
75
|
{
|
|
75
76
|
key: "rules",
|
|
76
77
|
get: function get() {
|
|
@@ -85,9 +86,9 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
85
86
|
]);
|
|
86
87
|
return Control;
|
|
87
88
|
}();
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
_define_property(Control, "controlType", "control");
|
|
90
|
+
_define_property(Control, "controlFieldType", void 0);
|
|
91
|
+
_define_property(Control, "__is_control__", true);
|
|
92
|
+
_define_property(Control, "controlCustomEvents", []);
|
|
92
93
|
export default Control;
|
|
93
94
|
export { Control as RuntimeControl };
|