@byteluck-fe/model-driven-driven 2.7.0-alpha.2 → 2.7.0-alpha.21
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/Builder.js +127 -87
- package/dist/esm/Designer.js +160 -105
- package/dist/esm/Driven.js +624 -445
- package/dist/esm/Plugin.js +2 -2
- package/dist/esm/Store.js +174 -118
- package/dist/esm/designerUtils.js +6 -2
- package/dist/esm/utils.js +35 -31
- package/dist/index.umd.js +3 -3
- package/dist/types/Driven.d.ts +4 -4
- package/dist/types/designerUtils.d.ts +1 -0
- package/package.json +6 -6
package/dist/esm/Builder.js
CHANGED
|
@@ -1,99 +1,139 @@
|
|
|
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
|
}
|
|
5
5
|
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
6
33
|
import Designer from "./Designer";
|
|
7
34
|
import { CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
8
35
|
export var Builder = /*#__PURE__*/ function() {
|
|
9
36
|
"use strict";
|
|
10
37
|
function Builder() {
|
|
11
|
-
|
|
12
|
-
this
|
|
38
|
+
_class_call_check(this, Builder);
|
|
39
|
+
_define_property(this, "designer", new Designer());
|
|
13
40
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
41
|
+
_create_class(Builder, [
|
|
42
|
+
{
|
|
43
|
+
key: "ListPageBuilder",
|
|
44
|
+
value: // @ts-ignore
|
|
45
|
+
function ListPageBuilder() {
|
|
46
|
+
var listview = this.designer.createControlInstance(// @ts-ignore
|
|
47
|
+
CONTROL_TYPE.LIST_VIEW);
|
|
48
|
+
var simpleSearch = this.designer.createControlInstance(// @ts-ignore
|
|
49
|
+
CONTROL_TYPE.SIMPLE_SEARCH);
|
|
50
|
+
var gridTable = this.designer.createControlInstance(// @ts-ignore
|
|
51
|
+
CONTROL_TYPE.GRID_TABLE);
|
|
52
|
+
var createBtn = this.designer.createControlInstance(// @ts-ignore
|
|
53
|
+
CONTROL_TYPE.CREATE_FORM_LIST_BUTTON);
|
|
54
|
+
var importBtn = this.designer.createControlInstance(// @ts-ignore
|
|
55
|
+
CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON);
|
|
56
|
+
var exportBtn = this.designer.createControlInstance(// @ts-ignore
|
|
57
|
+
CONTROL_TYPE.EXPORT_LIST_BUTTON);
|
|
58
|
+
var exportRecordBtn = this.designer.createControlInstance(// @ts-ignore
|
|
59
|
+
CONTROL_TYPE.EXPORT_RECORD_LIST_BUTTON);
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
gridTable.children.push(createBtn);
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
gridTable.children.push(importBtn);
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
gridTable.children.push(exportBtn);
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
gridTable.children.push(exportRecordBtn);
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
listview.children.push(simpleSearch);
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
listview.children.push(gridTable);
|
|
72
|
+
return listview;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: "ProListPageBuilder",
|
|
77
|
+
value: // @ts-ignore
|
|
78
|
+
function ProListPageBuilder() {
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
var listview = this.designer.createControlInstance(// @ts-ignore
|
|
81
|
+
CONTROL_TYPE.LIST_VIEW);
|
|
82
|
+
listview.props.countType = "async";
|
|
83
|
+
var simpleSearch = this.designer.createControlInstance(// @ts-ignore
|
|
84
|
+
CONTROL_TYPE.SIMPLE_SEARCH);
|
|
85
|
+
var gridTable = this.designer.createControlInstance(// @ts-ignore
|
|
86
|
+
CONTROL_TYPE.GRID_TABLE);
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
var exportBtn = this.designer.createControlInstance(// @ts-ignore
|
|
89
|
+
CONTROL_TYPE.EXPORT_LIST_BUTTON);
|
|
90
|
+
var exportRecordBtn = this.designer.createControlInstance(// @ts-ignore
|
|
91
|
+
CONTROL_TYPE.EXPORT_RECORD_LIST_BUTTON);
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
gridTable.children.push(exportBtn);
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
gridTable.children.push(exportRecordBtn);
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
listview.children.push(simpleSearch);
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
listview.children.push(gridTable);
|
|
100
|
+
return listview;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: "FormPageBuilder",
|
|
105
|
+
value: // @ts-ignore
|
|
106
|
+
function FormPageBuilder() {
|
|
107
|
+
var dataView = this.designer.createControlInstance(// @ts-ignore
|
|
108
|
+
CONTROL_TYPE.DATA_VIEW);
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
var title = this.designer.createControlInstance(CONTROL_TYPE.TITLE);
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
var grid = this.designer.createControlInstance(CONTROL_TYPE.GRID);
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
dataView.children.push(title);
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
dataView.children.push(grid);
|
|
117
|
+
return dataView;
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
key: "VuePageBuilder",
|
|
122
|
+
value: // @ts-ignore
|
|
123
|
+
function VuePageBuilder() {
|
|
124
|
+
var grid = this.designer.createControlInstance(// @ts-ignore
|
|
125
|
+
CONTROL_TYPE.GRID);
|
|
126
|
+
var vueFormItem = this.designer.createControlInstance(// @ts-ignore
|
|
127
|
+
CONTROL_TYPE.VUE_FORM_ITEM);
|
|
128
|
+
// @ts-ignore
|
|
129
|
+
vueFormItem.props.isHideCaption = true;
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
vueFormItem.props.controlExportName = "VuePage";
|
|
132
|
+
// @ts-ignore
|
|
133
|
+
grid.children.push(vueFormItem);
|
|
134
|
+
return grid;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]);
|
|
98
138
|
return Builder;
|
|
99
139
|
}();
|
package/dist/esm/Designer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
|
7
|
-
if (Array.isArray(arr)) return
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function _assert_this_initialized(self) {
|
|
10
10
|
if (self === void 0) {
|
|
11
11
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
12
12
|
}
|
|
@@ -26,7 +26,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
26
26
|
Promise.resolve(value).then(_next, _throw);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function _async_to_generator(fn) {
|
|
30
30
|
return function() {
|
|
31
31
|
var self = this, args = arguments;
|
|
32
32
|
return new Promise(function(resolve, reject) {
|
|
@@ -41,16 +41,43 @@ function _asyncToGenerator(fn) {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function _class_call_check(instance, Constructor) {
|
|
45
45
|
if (!(instance instanceof Constructor)) {
|
|
46
46
|
throw new TypeError("Cannot call a class as a function");
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
49
|
+
function _defineProperties(target, props) {
|
|
50
|
+
for(var i = 0; i < props.length; i++){
|
|
51
|
+
var descriptor = props[i];
|
|
52
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
53
|
+
descriptor.configurable = true;
|
|
54
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
55
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
59
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
60
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
61
|
+
return Constructor;
|
|
62
|
+
}
|
|
63
|
+
function _define_property(obj, key, value) {
|
|
64
|
+
if (key in obj) {
|
|
65
|
+
Object.defineProperty(obj, key, {
|
|
66
|
+
value: value,
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
obj[key] = value;
|
|
73
|
+
}
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
function _get_prototype_of(o) {
|
|
77
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
51
78
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
52
79
|
};
|
|
53
|
-
return
|
|
80
|
+
return _get_prototype_of(o);
|
|
54
81
|
}
|
|
55
82
|
function _inherits(subClass, superClass) {
|
|
56
83
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -63,7 +90,7 @@ function _inherits(subClass, superClass) {
|
|
|
63
90
|
configurable: true
|
|
64
91
|
}
|
|
65
92
|
});
|
|
66
|
-
if (superClass)
|
|
93
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
67
94
|
}
|
|
68
95
|
function _instanceof(left, right) {
|
|
69
96
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
@@ -72,41 +99,41 @@ function _instanceof(left, right) {
|
|
|
72
99
|
return left instanceof right;
|
|
73
100
|
}
|
|
74
101
|
}
|
|
75
|
-
function
|
|
102
|
+
function _iterable_to_array(iter) {
|
|
76
103
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
77
104
|
}
|
|
78
|
-
function
|
|
105
|
+
function _non_iterable_spread() {
|
|
79
106
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
80
107
|
}
|
|
81
|
-
function
|
|
82
|
-
if (call && (
|
|
108
|
+
function _possible_constructor_return(self, call) {
|
|
109
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
83
110
|
return call;
|
|
84
111
|
}
|
|
85
|
-
return
|
|
112
|
+
return _assert_this_initialized(self);
|
|
86
113
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
114
|
+
function _set_prototype_of(o, p) {
|
|
115
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
89
116
|
o.__proto__ = p;
|
|
90
117
|
return o;
|
|
91
118
|
};
|
|
92
|
-
return
|
|
119
|
+
return _set_prototype_of(o, p);
|
|
93
120
|
}
|
|
94
|
-
function
|
|
95
|
-
return
|
|
121
|
+
function _to_consumable_array(arr) {
|
|
122
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
96
123
|
}
|
|
97
|
-
|
|
124
|
+
function _type_of(obj) {
|
|
98
125
|
"@swc/helpers - typeof";
|
|
99
126
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
100
|
-
}
|
|
101
|
-
function
|
|
127
|
+
}
|
|
128
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
102
129
|
if (!o) return;
|
|
103
|
-
if (typeof o === "string") return
|
|
130
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
104
131
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
105
132
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
106
133
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
107
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
134
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
108
135
|
}
|
|
109
|
-
function
|
|
136
|
+
function _is_native_reflect_construct() {
|
|
110
137
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
111
138
|
if (Reflect.construct.sham) return false;
|
|
112
139
|
if (typeof Proxy === "function") return true;
|
|
@@ -117,20 +144,20 @@ function _isNativeReflectConstruct() {
|
|
|
117
144
|
return false;
|
|
118
145
|
}
|
|
119
146
|
}
|
|
120
|
-
function
|
|
121
|
-
var hasNativeReflectConstruct =
|
|
147
|
+
function _create_super(Derived) {
|
|
148
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
122
149
|
return function _createSuperInternal() {
|
|
123
|
-
var Super =
|
|
150
|
+
var Super = _get_prototype_of(Derived), result;
|
|
124
151
|
if (hasNativeReflectConstruct) {
|
|
125
|
-
var NewTarget =
|
|
152
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
126
153
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
127
154
|
} else {
|
|
128
155
|
result = Super.apply(this, arguments);
|
|
129
156
|
}
|
|
130
|
-
return
|
|
157
|
+
return _possible_constructor_return(this, result);
|
|
131
158
|
};
|
|
132
159
|
}
|
|
133
|
-
|
|
160
|
+
function _ts_generator(thisArg, body) {
|
|
134
161
|
var f, y, t, g, _ = {
|
|
135
162
|
label: 0,
|
|
136
163
|
sent: function() {
|
|
@@ -224,7 +251,7 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
224
251
|
done: true
|
|
225
252
|
};
|
|
226
253
|
}
|
|
227
|
-
}
|
|
254
|
+
}
|
|
228
255
|
import { RegisterControls, controlHooksEmitter } from "@byteluck-fe/model-driven-core";
|
|
229
256
|
import EventLogic from "./EventLogic";
|
|
230
257
|
import { FieldTypes } from "@byteluck-fe/model-driven-shared";
|
|
@@ -232,92 +259,120 @@ import { toSchema, getModelBindInfoList, checkSchema } from "./utils";
|
|
|
232
259
|
var Designer = /*#__PURE__*/ function _target(RegisterControls) {
|
|
233
260
|
"use strict";
|
|
234
261
|
_inherits(Designer, RegisterControls);
|
|
235
|
-
var _super =
|
|
262
|
+
var _super = _create_super(Designer);
|
|
236
263
|
function Designer() {
|
|
237
|
-
|
|
264
|
+
_class_call_check(this, Designer);
|
|
238
265
|
var _this;
|
|
239
266
|
_this = _super.call(this, "Designer");
|
|
240
|
-
_this
|
|
241
|
-
_this
|
|
242
|
-
_this
|
|
243
|
-
_this
|
|
244
|
-
_this
|
|
267
|
+
_define_property(_assert_this_initialized(_this), "toolbox", []);
|
|
268
|
+
_define_property(_assert_this_initialized(_this), "services", {});
|
|
269
|
+
_define_property(_assert_this_initialized(_this), "eventLogic", new EventLogic());
|
|
270
|
+
_define_property(_assert_this_initialized(_this), "fieldTypes", FieldTypes);
|
|
271
|
+
_define_property(_assert_this_initialized(_this), "controlSettingMap", new Map());
|
|
245
272
|
(_instanceof(this, Designer) ? this.constructor : void 0).staticControls.forEach(function(control) {
|
|
246
273
|
var _$Designer = control.Designer, Setting = control.Setting;
|
|
247
274
|
_this.controlSettingMap.set(_$Designer.controlType, Setting);
|
|
248
275
|
});
|
|
249
276
|
return _this;
|
|
250
277
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var setting = this.controlSettingMap.get(type);
|
|
261
|
-
if (!setting) {
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
return setting;
|
|
265
|
-
};
|
|
266
|
-
_proto.setInstance = function setInstance(instance, props, value) {
|
|
267
|
-
try {
|
|
268
|
-
if (!instance) {
|
|
269
|
-
return;
|
|
278
|
+
_create_class(Designer, [
|
|
279
|
+
{
|
|
280
|
+
key: "registerControl",
|
|
281
|
+
value: function registerControl(control) {
|
|
282
|
+
this.constructor.register(control);
|
|
283
|
+
var DesignerClass = control.Designer, Setting = control.Setting;
|
|
284
|
+
this.register(DesignerClass);
|
|
285
|
+
this.registeredControlTypes.add(DesignerClass.controlType);
|
|
286
|
+
this.controlSettingMap.set(DesignerClass.controlType, Setting);
|
|
270
287
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
key: "getControlSetting",
|
|
291
|
+
value: function getControlSetting(type) {
|
|
292
|
+
var setting = this.controlSettingMap.get(type);
|
|
293
|
+
if (!setting) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
return setting;
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
key: "setInstance",
|
|
301
|
+
value: function setInstance(instance, props, value) {
|
|
302
|
+
try {
|
|
303
|
+
if (!instance) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
// @ts-ignore
|
|
307
|
+
instance.updateProps(props, value);
|
|
308
|
+
} catch (e) {
|
|
309
|
+
throw e;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
key: "eachControls",
|
|
315
|
+
value: function eachControls(callback) {
|
|
316
|
+
this.getControls().forEach(callback);
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
key: "getInitControl",
|
|
321
|
+
value: // 获取初始化的数据模型
|
|
322
|
+
function getInitControl() {
|
|
323
|
+
// @ts-ignore
|
|
293
324
|
return [
|
|
294
|
-
|
|
295
|
-
checkSchema.apply(void 0, _toConsumableArray(args))
|
|
325
|
+
this.createControlInstance("grid")
|
|
296
326
|
];
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
key: "checkSchema",
|
|
331
|
+
value: function checkSchema1() {
|
|
332
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
333
|
+
args[_key] = arguments[_key];
|
|
334
|
+
}
|
|
335
|
+
return _async_to_generator(function() {
|
|
336
|
+
return _ts_generator(this, function(_state) {
|
|
337
|
+
return [
|
|
338
|
+
2,
|
|
339
|
+
checkSchema.apply(void 0, _to_consumable_array(args))
|
|
340
|
+
];
|
|
341
|
+
});
|
|
342
|
+
})();
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
key: "getModelBindInfoList",
|
|
347
|
+
value: function getModelBindInfoList1() {
|
|
348
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
349
|
+
args[_key] = arguments[_key];
|
|
350
|
+
}
|
|
351
|
+
return getModelBindInfoList.apply(void 0, _to_consumable_array(args));
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
key: "getSchema",
|
|
356
|
+
value: function getSchema() {
|
|
357
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
358
|
+
args[_key] = arguments[_key];
|
|
359
|
+
}
|
|
360
|
+
return toSchema.apply(void 0, _to_consumable_array(args));
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
key: "listenControlHook",
|
|
365
|
+
value: function listenControlHook() {
|
|
366
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
367
|
+
args[_key] = arguments[_key];
|
|
368
|
+
}
|
|
369
|
+
var _controlHooksEmitter;
|
|
370
|
+
return (_controlHooksEmitter = controlHooksEmitter).on.apply(_controlHooksEmitter, _to_consumable_array(args));
|
|
371
|
+
}
|
|
315
372
|
}
|
|
316
|
-
|
|
317
|
-
return (_controlHooksEmitter = controlHooksEmitter).on.apply(_controlHooksEmitter, _toConsumableArray(args));
|
|
318
|
-
};
|
|
373
|
+
]);
|
|
319
374
|
return Designer;
|
|
320
375
|
}(RegisterControls);
|
|
321
|
-
Designer
|
|
376
|
+
_define_property(Designer, "EventLogic", EventLogic);
|
|
322
377
|
export { Designer as default };
|
|
323
378
|
export { Designer };
|