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