@byteluck-fe/model-driven-core 2.7.0-alpha.28a → 2.7.0-alpha.31b
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/README.md +69 -69
- package/dist/esm/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +136 -257
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +61 -80
- package/dist/esm/common/BaseControl/runtime.js +26 -48
- package/dist/esm/common/ColumnControl/designer.js +28 -43
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +80 -129
- package/dist/esm/common/ColumnControl/runtime.js +28 -43
- package/dist/esm/common/ControlArray.js +21 -21
- package/dist/esm/common/FormControl/designer.js +33 -49
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +119 -185
- package/dist/esm/common/FormControl/runtime.js +28 -44
- package/dist/esm/common/LayoutControl/designer.js +78 -207
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +25 -25
- package/dist/esm/common/LayoutControl/runtime.js +30 -46
- package/dist/esm/common/ListControl/designer.js +76 -202
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +28 -44
- package/dist/esm/common/ListControl/runtime.js +32 -48
- package/dist/esm/common/SearchViewControl/designer.js +28 -43
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +27 -42
- package/dist/esm/common/SearchViewControl/runtime.js +28 -43
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +28 -43
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +25 -25
- package/dist/esm/common/WrapControl/runtime.js +28 -43
- 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 +41 -37
- package/dist/esm/framework/index.js +515 -993
- package/dist/esm/framework/isDataBind.js +1 -2
- package/dist/esm/index.js +4 -4
- package/dist/index.umd.js +1 -1
- package/dist/types/api-doc-index.d.ts +4 -4
- package/dist/types/common/BaseControl/designer.d.ts +63 -63
- package/dist/types/common/BaseControl/index.d.ts +13 -13
- package/dist/types/common/BaseControl/property.d.ts +38 -38
- package/dist/types/common/BaseControl/runtime.d.ts +23 -23
- package/dist/types/common/BaseControl/types.d.ts +35 -35
- package/dist/types/common/ColumnControl/designer.d.ts +10 -10
- package/dist/types/common/ColumnControl/index.d.ts +12 -12
- package/dist/types/common/ColumnControl/property.d.ts +73 -73
- package/dist/types/common/ColumnControl/runtime.d.ts +10 -10
- package/dist/types/common/ControlArray.d.ts +9 -9
- package/dist/types/common/FormControl/designer.d.ts +13 -13
- package/dist/types/common/FormControl/index.d.ts +12 -12
- package/dist/types/common/FormControl/property.d.ts +100 -100
- package/dist/types/common/FormControl/runtime.d.ts +11 -11
- package/dist/types/common/LayoutControl/designer.d.ts +21 -21
- package/dist/types/common/LayoutControl/index.d.ts +12 -12
- package/dist/types/common/LayoutControl/property.d.ts +6 -6
- package/dist/types/common/LayoutControl/runtime.d.ts +11 -11
- package/dist/types/common/ListControl/designer.d.ts +16 -16
- package/dist/types/common/ListControl/index.d.ts +12 -12
- package/dist/types/common/ListControl/property.d.ts +14 -14
- package/dist/types/common/ListControl/runtime.d.ts +12 -12
- package/dist/types/common/SearchViewControl/designer.d.ts +11 -11
- package/dist/types/common/SearchViewControl/index.d.ts +12 -12
- package/dist/types/common/SearchViewControl/property.d.ts +8 -8
- package/dist/types/common/SearchViewControl/runtime.d.ts +11 -11
- package/dist/types/common/Validator.d.ts +15 -15
- package/dist/types/common/WrapControl/designer.d.ts +11 -11
- package/dist/types/common/WrapControl/index.d.ts +12 -12
- package/dist/types/common/WrapControl/property.d.ts +6 -6
- package/dist/types/common/WrapControl/runtime.d.ts +11 -11
- package/dist/types/common/controlHooksEmitter.d.ts +4 -4
- package/dist/types/common/index.d.ts +12 -12
- package/dist/types/common/initLinkOperationRules.d.ts +6 -6
- package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -10
- package/dist/types/framework/RegisterControls.d.ts +37 -36
- package/dist/types/framework/index.d.ts +844 -844
- package/dist/types/framework/isDataBind.d.ts +2 -2
- package/dist/types/index.d.ts +4 -4
- package/dist/types/type.d.ts +91 -91
- package/package.json +2 -2
|
@@ -1,32 +1,19 @@
|
|
|
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
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
|
-
function _get_prototype_of(o) {
|
|
26
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
12
|
+
function _getPrototypeOf(o) {
|
|
13
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
28
15
|
};
|
|
29
|
-
return
|
|
16
|
+
return _getPrototypeOf(o);
|
|
30
17
|
}
|
|
31
18
|
function _inherits(subClass, superClass) {
|
|
32
19
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -39,26 +26,26 @@ function _inherits(subClass, superClass) {
|
|
|
39
26
|
configurable: true
|
|
40
27
|
}
|
|
41
28
|
});
|
|
42
|
-
if (superClass)
|
|
29
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
43
30
|
}
|
|
44
|
-
function
|
|
45
|
-
if (call && (
|
|
31
|
+
function _possibleConstructorReturn(self, call) {
|
|
32
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
46
33
|
return call;
|
|
47
34
|
}
|
|
48
|
-
return
|
|
35
|
+
return _assertThisInitialized(self);
|
|
49
36
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
37
|
+
function _setPrototypeOf(o, p) {
|
|
38
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
52
39
|
o.__proto__ = p;
|
|
53
40
|
return o;
|
|
54
41
|
};
|
|
55
|
-
return
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
56
43
|
}
|
|
57
|
-
function
|
|
44
|
+
var _typeof = function(obj) {
|
|
58
45
|
"@swc/helpers - typeof";
|
|
59
46
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
|
-
}
|
|
61
|
-
function
|
|
47
|
+
};
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
62
49
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
50
|
if (Reflect.construct.sham) return false;
|
|
64
51
|
if (typeof Proxy === "function") return true;
|
|
@@ -69,36 +56,33 @@ function _is_native_reflect_construct() {
|
|
|
69
56
|
return false;
|
|
70
57
|
}
|
|
71
58
|
}
|
|
72
|
-
function
|
|
73
|
-
var hasNativeReflectConstruct =
|
|
59
|
+
function _createSuper(Derived) {
|
|
60
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
74
61
|
return function _createSuperInternal() {
|
|
75
|
-
var Super =
|
|
62
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
76
63
|
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget =
|
|
64
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
78
65
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
66
|
} else {
|
|
80
67
|
result = Super.apply(this, arguments);
|
|
81
68
|
}
|
|
82
|
-
return
|
|
69
|
+
return _possibleConstructorReturn(this, result);
|
|
83
70
|
};
|
|
84
71
|
}
|
|
85
|
-
import { RuntimeControl } from
|
|
86
|
-
import LayoutControlProperty from
|
|
87
|
-
import { defineControlArrayToProperty } from
|
|
88
|
-
var LayoutControl = /*#__PURE__*/ function(
|
|
72
|
+
import { RuntimeControl } from '../BaseControl';
|
|
73
|
+
import LayoutControlProperty from './property';
|
|
74
|
+
import { defineControlArrayToProperty } from '../ControlArray';
|
|
75
|
+
var LayoutControl = /*#__PURE__*/ function(RuntimeControl1) {
|
|
89
76
|
"use strict";
|
|
90
|
-
_inherits(LayoutControl,
|
|
91
|
-
var _super =
|
|
77
|
+
_inherits(LayoutControl, RuntimeControl1);
|
|
78
|
+
var _super = _createSuper(LayoutControl);
|
|
92
79
|
function LayoutControl(props) {
|
|
93
|
-
|
|
80
|
+
_classCallCheck(this, LayoutControl);
|
|
94
81
|
var _this;
|
|
95
|
-
var _props, _props1;
|
|
96
82
|
_this = _super.call(this, props);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
_this.props = new LayoutControlProperty((_props = props) === null || _props === void 0 ? void 0 : _props.props);
|
|
101
|
-
defineControlArrayToProperty(_assert_this_initialized(_this), "children", (_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.children, undefined, "Runtime");
|
|
83
|
+
_this.controlType = 'layout';
|
|
84
|
+
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
85
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Runtime');
|
|
102
86
|
return _this;
|
|
103
87
|
}
|
|
104
88
|
return LayoutControl;
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
|
7
|
-
if (Array.isArray(arr)) return
|
|
6
|
+
function _arrayWithoutHoles(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function _assertThisInitialized(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 _asyncToGenerator(fn) {
|
|
30
30
|
return function() {
|
|
31
31
|
var self = this, args = arguments;
|
|
32
32
|
return new Promise(function(resolve, reject) {
|
|
@@ -41,7 +41,7 @@ function _async_to_generator(fn) {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function _classCallCheck(instance, Constructor) {
|
|
45
45
|
if (!(instance instanceof Constructor)) {
|
|
46
46
|
throw new TypeError("Cannot call a class as a function");
|
|
47
47
|
}
|
|
@@ -55,12 +55,12 @@ function _defineProperties(target, props) {
|
|
|
55
55
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
59
59
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
60
60
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
61
61
|
return Constructor;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function _defineProperty(obj, key, value) {
|
|
64
64
|
if (key in obj) {
|
|
65
65
|
Object.defineProperty(obj, key, {
|
|
66
66
|
value: value,
|
|
@@ -77,23 +77,23 @@ function _get(target, property, receiver) {
|
|
|
77
77
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
78
78
|
_get = Reflect.get;
|
|
79
79
|
} else {
|
|
80
|
-
_get = function
|
|
81
|
-
var base =
|
|
80
|
+
_get = function _get(target, property, receiver) {
|
|
81
|
+
var base = _superPropBase(target, property);
|
|
82
82
|
if (!base) return;
|
|
83
83
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
84
84
|
if (desc.get) {
|
|
85
|
-
return desc.get.call(receiver
|
|
85
|
+
return desc.get.call(receiver);
|
|
86
86
|
}
|
|
87
87
|
return desc.value;
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
return _get(target, property, receiver || target);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
92
|
+
function _getPrototypeOf(o) {
|
|
93
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
94
94
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
95
95
|
};
|
|
96
|
-
return
|
|
96
|
+
return _getPrototypeOf(o);
|
|
97
97
|
}
|
|
98
98
|
function _inherits(subClass, superClass) {
|
|
99
99
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -106,15 +106,15 @@ function _inherits(subClass, superClass) {
|
|
|
106
106
|
configurable: true
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
if (superClass)
|
|
109
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function _iterableToArray(iter) {
|
|
112
112
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function _nonIterableSpread() {
|
|
115
115
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function _objectSpread(target) {
|
|
118
118
|
for(var i = 1; i < arguments.length; i++){
|
|
119
119
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
120
120
|
var ownKeys = Object.keys(source);
|
|
@@ -124,71 +124,47 @@ function _object_spread(target) {
|
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
126
126
|
ownKeys.forEach(function(key) {
|
|
127
|
-
|
|
127
|
+
_defineProperty(target, key, source[key]);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
return target;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
if (Object.getOwnPropertySymbols) {
|
|
135
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
136
|
-
if (enumerableOnly) {
|
|
137
|
-
symbols = symbols.filter(function(sym) {
|
|
138
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
keys.push.apply(keys, symbols);
|
|
142
|
-
}
|
|
143
|
-
return keys;
|
|
144
|
-
}
|
|
145
|
-
function _object_spread_props(target, source) {
|
|
146
|
-
source = source != null ? source : {};
|
|
147
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
148
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
149
|
-
} else {
|
|
150
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
151
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
return target;
|
|
155
|
-
}
|
|
156
|
-
function _possible_constructor_return(self, call) {
|
|
157
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
132
|
+
function _possibleConstructorReturn(self, call) {
|
|
133
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
158
134
|
return call;
|
|
159
135
|
}
|
|
160
|
-
return
|
|
136
|
+
return _assertThisInitialized(self);
|
|
161
137
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
138
|
+
function _setPrototypeOf(o, p) {
|
|
139
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
164
140
|
o.__proto__ = p;
|
|
165
141
|
return o;
|
|
166
142
|
};
|
|
167
|
-
return
|
|
143
|
+
return _setPrototypeOf(o, p);
|
|
168
144
|
}
|
|
169
|
-
function
|
|
145
|
+
function _superPropBase(object, property) {
|
|
170
146
|
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
171
|
-
object =
|
|
147
|
+
object = _getPrototypeOf(object);
|
|
172
148
|
if (object === null) break;
|
|
173
149
|
}
|
|
174
150
|
return object;
|
|
175
151
|
}
|
|
176
|
-
function
|
|
177
|
-
return
|
|
152
|
+
function _toConsumableArray(arr) {
|
|
153
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
178
154
|
}
|
|
179
|
-
function
|
|
155
|
+
var _typeof = function(obj) {
|
|
180
156
|
"@swc/helpers - typeof";
|
|
181
157
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
182
|
-
}
|
|
183
|
-
function
|
|
158
|
+
};
|
|
159
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
184
160
|
if (!o) return;
|
|
185
|
-
if (typeof o === "string") return
|
|
161
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
186
162
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
187
163
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
188
164
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
189
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
165
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
190
166
|
}
|
|
191
|
-
function
|
|
167
|
+
function _isNativeReflectConstruct() {
|
|
192
168
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
193
169
|
if (Reflect.construct.sham) return false;
|
|
194
170
|
if (typeof Proxy === "function") return true;
|
|
@@ -199,170 +175,68 @@ function _is_native_reflect_construct() {
|
|
|
199
175
|
return false;
|
|
200
176
|
}
|
|
201
177
|
}
|
|
202
|
-
function
|
|
203
|
-
var hasNativeReflectConstruct =
|
|
178
|
+
function _createSuper(Derived) {
|
|
179
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
204
180
|
return function _createSuperInternal() {
|
|
205
|
-
var Super =
|
|
181
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
206
182
|
if (hasNativeReflectConstruct) {
|
|
207
|
-
var NewTarget =
|
|
183
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
208
184
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
209
185
|
} else {
|
|
210
186
|
result = Super.apply(this, arguments);
|
|
211
187
|
}
|
|
212
|
-
return
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function _ts_generator(thisArg, body) {
|
|
216
|
-
var f, y, t, g, _ = {
|
|
217
|
-
label: 0,
|
|
218
|
-
sent: function() {
|
|
219
|
-
if (t[0] & 1) throw t[1];
|
|
220
|
-
return t[1];
|
|
221
|
-
},
|
|
222
|
-
trys: [],
|
|
223
|
-
ops: []
|
|
188
|
+
return _possibleConstructorReturn(this, result);
|
|
224
189
|
};
|
|
225
|
-
return g = {
|
|
226
|
-
next: verb(0),
|
|
227
|
-
"throw": verb(1),
|
|
228
|
-
"return": verb(2)
|
|
229
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
230
|
-
return this;
|
|
231
|
-
}), g;
|
|
232
|
-
function verb(n) {
|
|
233
|
-
return function(v) {
|
|
234
|
-
return step([
|
|
235
|
-
n,
|
|
236
|
-
v
|
|
237
|
-
]);
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
function step(op) {
|
|
241
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
242
|
-
while(_)try {
|
|
243
|
-
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;
|
|
244
|
-
if (y = 0, t) op = [
|
|
245
|
-
op[0] & 2,
|
|
246
|
-
t.value
|
|
247
|
-
];
|
|
248
|
-
switch(op[0]){
|
|
249
|
-
case 0:
|
|
250
|
-
case 1:
|
|
251
|
-
t = op;
|
|
252
|
-
break;
|
|
253
|
-
case 4:
|
|
254
|
-
_.label++;
|
|
255
|
-
return {
|
|
256
|
-
value: op[1],
|
|
257
|
-
done: false
|
|
258
|
-
};
|
|
259
|
-
case 5:
|
|
260
|
-
_.label++;
|
|
261
|
-
y = op[1];
|
|
262
|
-
op = [
|
|
263
|
-
0
|
|
264
|
-
];
|
|
265
|
-
continue;
|
|
266
|
-
case 7:
|
|
267
|
-
op = _.ops.pop();
|
|
268
|
-
_.trys.pop();
|
|
269
|
-
continue;
|
|
270
|
-
default:
|
|
271
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
272
|
-
_ = 0;
|
|
273
|
-
continue;
|
|
274
|
-
}
|
|
275
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
276
|
-
_.label = op[1];
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
280
|
-
_.label = t[1];
|
|
281
|
-
t = op;
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
if (t && _.label < t[2]) {
|
|
285
|
-
_.label = t[2];
|
|
286
|
-
_.ops.push(op);
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
if (t[2]) _.ops.pop();
|
|
290
|
-
_.trys.pop();
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
op = body.call(thisArg, _);
|
|
294
|
-
} catch (e) {
|
|
295
|
-
op = [
|
|
296
|
-
6,
|
|
297
|
-
e
|
|
298
|
-
];
|
|
299
|
-
y = 0;
|
|
300
|
-
} finally{
|
|
301
|
-
f = t = 0;
|
|
302
|
-
}
|
|
303
|
-
if (op[0] & 5) throw op[1];
|
|
304
|
-
return {
|
|
305
|
-
value: op[0] ? op[1] : void 0,
|
|
306
|
-
done: true
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
190
|
}
|
|
310
|
-
import
|
|
311
|
-
import
|
|
312
|
-
import
|
|
313
|
-
|
|
191
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
192
|
+
import { DesignerControl } from '../BaseControl';
|
|
193
|
+
import ListControlProperty from './property';
|
|
194
|
+
import { FieldTypes } from '@byteluck-fe/model-driven-shared';
|
|
195
|
+
var ListControl = /*#__PURE__*/ function(DesignerControl1) {
|
|
314
196
|
"use strict";
|
|
315
|
-
_inherits(ListControl,
|
|
316
|
-
var _super =
|
|
197
|
+
_inherits(ListControl, DesignerControl1);
|
|
198
|
+
var _super = _createSuper(ListControl);
|
|
317
199
|
function ListControl(props) {
|
|
318
|
-
|
|
200
|
+
_classCallCheck(this, ListControl);
|
|
319
201
|
var _this;
|
|
320
|
-
var _props;
|
|
321
202
|
_this = _super.call(this, props);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
_this.props = new ListControlProperty(_assert_this_initialized(_this), (_props = props) === null || _props === void 0 ? void 0 : _props.props, "Designer");
|
|
203
|
+
_this.controlType = 'list';
|
|
204
|
+
_this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props, 'Designer');
|
|
325
205
|
return _this;
|
|
326
206
|
}
|
|
327
|
-
|
|
207
|
+
_createClass(ListControl, [
|
|
328
208
|
{
|
|
329
209
|
key: "validate",
|
|
330
210
|
value: function validate(messages, ignore) {
|
|
331
211
|
var _this = this;
|
|
332
212
|
var _this1 = this, _superprop_get_validate = function() {
|
|
333
|
-
return _get(
|
|
213
|
+
return _get(_getPrototypeOf(ListControl.prototype), "validate", _this);
|
|
334
214
|
};
|
|
335
|
-
return
|
|
336
|
-
return
|
|
337
|
-
switch(
|
|
215
|
+
return _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
|
|
216
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
217
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
338
218
|
case 0:
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
_superprop_get_validate().call(_this1, messages)
|
|
342
|
-
];
|
|
343
|
-
case 1:
|
|
344
|
-
_state.sent();
|
|
345
|
-
return [
|
|
346
|
-
4,
|
|
347
|
-
Promise.all(_this1.props.headers.map(function(child) {
|
|
348
|
-
return child.validate(messages, ignore);
|
|
349
|
-
}))
|
|
350
|
-
];
|
|
219
|
+
_ctx.next = 2;
|
|
220
|
+
return _superprop_get_validate().call(_this1, messages);
|
|
351
221
|
case 2:
|
|
352
|
-
|
|
353
|
-
return
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
222
|
+
_ctx.next = 4;
|
|
223
|
+
return Promise.all(_this1.props.headers.map(function(child) {
|
|
224
|
+
return child.validate(messages, ignore);
|
|
225
|
+
}));
|
|
226
|
+
case 4:
|
|
227
|
+
return _ctx.abrupt("return", true);
|
|
228
|
+
case 5:
|
|
229
|
+
case "end":
|
|
230
|
+
return _ctx.stop();
|
|
357
231
|
}
|
|
358
|
-
});
|
|
359
|
-
})();
|
|
232
|
+
}, _callee);
|
|
233
|
+
}))();
|
|
360
234
|
}
|
|
361
235
|
},
|
|
362
236
|
{
|
|
363
237
|
key: "toDataBindModel",
|
|
364
238
|
value: function toDataBindModel() {
|
|
365
|
-
var listModel = _get(
|
|
239
|
+
var listModel = _get(_getPrototypeOf(ListControl.prototype), "toDataBindModel", this).call(this);
|
|
366
240
|
var result = listModel ? [
|
|
367
241
|
listModel
|
|
368
242
|
] : [];
|
|
@@ -373,7 +247,7 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
373
247
|
var filteredModel = model.filter(function(item) {
|
|
374
248
|
return !!item;
|
|
375
249
|
});
|
|
376
|
-
return
|
|
250
|
+
return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
|
|
377
251
|
}
|
|
378
252
|
model && arr.push(model);
|
|
379
253
|
return arr;
|
|
@@ -383,20 +257,20 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
383
257
|
{
|
|
384
258
|
key: "toSchema",
|
|
385
259
|
value: function toSchema() {
|
|
386
|
-
var
|
|
387
|
-
var superSchema = _get(
|
|
260
|
+
var ref, ref1;
|
|
261
|
+
var superSchema = _get(_getPrototypeOf(ListControl.prototype), "toSchema", this).call(this);
|
|
388
262
|
var headers = this.props.headers.map(function(item) {
|
|
389
263
|
return item.toSchema();
|
|
390
264
|
});
|
|
391
|
-
var footers = (
|
|
265
|
+
var footers = (ref = this.props) === null || ref === void 0 ? void 0 : (ref1 = ref.footers) === null || ref1 === void 0 ? void 0 : ref1.map(function(item) {
|
|
392
266
|
if (item) {
|
|
393
267
|
return item.toSchema();
|
|
394
268
|
} else {
|
|
395
269
|
return undefined;
|
|
396
270
|
}
|
|
397
271
|
});
|
|
398
|
-
return
|
|
399
|
-
props:
|
|
272
|
+
return _objectSpread({}, superSchema, {
|
|
273
|
+
props: _objectSpread({}, this.props, {
|
|
400
274
|
headers: headers,
|
|
401
275
|
footers: footers
|
|
402
276
|
})
|
|
@@ -406,6 +280,6 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
406
280
|
]);
|
|
407
281
|
return ListControl;
|
|
408
282
|
}(DesignerControl);
|
|
409
|
-
|
|
283
|
+
ListControl.controlFieldType = FieldTypes.LIST;
|
|
410
284
|
export default ListControl;
|
|
411
285
|
export { ListControl as DesignerListControl };
|
|
@@ -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';
|