@byteluck-fe/model-driven-core 2.7.0-alpha.3 → 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 +111 -228
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +14 -42
- package/dist/esm/common/BaseControl/runtime.js +21 -41
- package/dist/esm/common/ColumnControl/designer.js +5 -19
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +49 -97
- package/dist/esm/common/ColumnControl/runtime.js +5 -19
- package/dist/esm/common/ControlArray.js +21 -19
- package/dist/esm/common/FormControl/designer.js +10 -25
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +99 -166
- package/dist/esm/common/FormControl/runtime.js +5 -20
- package/dist/esm/common/LayoutControl/designer.js +30 -158
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +3 -3
- package/dist/esm/common/LayoutControl/runtime.js +7 -22
- package/dist/esm/common/ListControl/designer.js +37 -153
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +7 -20
- package/dist/esm/common/ListControl/runtime.js +8 -23
- package/dist/esm/common/SearchViewControl/designer.js +5 -19
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +4 -18
- package/dist/esm/common/SearchViewControl/runtime.js +5 -19
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +5 -19
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +3 -3
- package/dist/esm/common/WrapControl/runtime.js +5 -19
- 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 +118 -36
- package/dist/esm/framework/index.js +415 -859
- package/dist/esm/framework/isDataBind.js +7 -0
- package/dist/esm/index.js +4 -3
- 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 -62
- package/dist/types/common/BaseControl/index.d.ts +13 -13
- package/dist/types/common/BaseControl/property.d.ts +38 -36
- package/dist/types/common/BaseControl/runtime.d.ts +23 -22
- 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 -8
- 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 -12
- 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 -33
- package/dist/types/framework/index.d.ts +844 -842
- package/dist/types/framework/isDataBind.d.ts +2 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/type.d.ts +91 -91
- package/package.json +3 -3
|
@@ -110,7 +110,7 @@ function _inherits(subClass, superClass) {
|
|
|
110
110
|
}
|
|
111
111
|
function _instanceof(left, right) {
|
|
112
112
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
113
|
-
return
|
|
113
|
+
return right[Symbol.hasInstance](left);
|
|
114
114
|
} else {
|
|
115
115
|
return left instanceof right;
|
|
116
116
|
}
|
|
@@ -136,30 +136,6 @@ function _objectSpread(target) {
|
|
|
136
136
|
}
|
|
137
137
|
return target;
|
|
138
138
|
}
|
|
139
|
-
function ownKeys(object, enumerableOnly) {
|
|
140
|
-
var keys = Object.keys(object);
|
|
141
|
-
if (Object.getOwnPropertySymbols) {
|
|
142
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
143
|
-
if (enumerableOnly) {
|
|
144
|
-
symbols = symbols.filter(function(sym) {
|
|
145
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
keys.push.apply(keys, symbols);
|
|
149
|
-
}
|
|
150
|
-
return keys;
|
|
151
|
-
}
|
|
152
|
-
function _objectSpreadProps(target, source) {
|
|
153
|
-
source = source != null ? source : {};
|
|
154
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
155
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
156
|
-
} else {
|
|
157
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
158
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return target;
|
|
162
|
-
}
|
|
163
139
|
function _possibleConstructorReturn(self, call) {
|
|
164
140
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
165
141
|
return call;
|
|
@@ -219,123 +195,25 @@ function _createSuper(Derived) {
|
|
|
219
195
|
return _possibleConstructorReturn(this, result);
|
|
220
196
|
};
|
|
221
197
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return t[1];
|
|
228
|
-
},
|
|
229
|
-
trys: [],
|
|
230
|
-
ops: []
|
|
231
|
-
};
|
|
232
|
-
return g = {
|
|
233
|
-
next: verb(0),
|
|
234
|
-
"throw": verb(1),
|
|
235
|
-
"return": verb(2)
|
|
236
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
237
|
-
return this;
|
|
238
|
-
}), g;
|
|
239
|
-
function verb(n) {
|
|
240
|
-
return function(v) {
|
|
241
|
-
return step([
|
|
242
|
-
n,
|
|
243
|
-
v
|
|
244
|
-
]);
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
function step(op) {
|
|
248
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
249
|
-
while(_)try {
|
|
250
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
251
|
-
if (y = 0, t) op = [
|
|
252
|
-
op[0] & 2,
|
|
253
|
-
t.value
|
|
254
|
-
];
|
|
255
|
-
switch(op[0]){
|
|
256
|
-
case 0:
|
|
257
|
-
case 1:
|
|
258
|
-
t = op;
|
|
259
|
-
break;
|
|
260
|
-
case 4:
|
|
261
|
-
_.label++;
|
|
262
|
-
return {
|
|
263
|
-
value: op[1],
|
|
264
|
-
done: false
|
|
265
|
-
};
|
|
266
|
-
case 5:
|
|
267
|
-
_.label++;
|
|
268
|
-
y = op[1];
|
|
269
|
-
op = [
|
|
270
|
-
0
|
|
271
|
-
];
|
|
272
|
-
continue;
|
|
273
|
-
case 7:
|
|
274
|
-
op = _.ops.pop();
|
|
275
|
-
_.trys.pop();
|
|
276
|
-
continue;
|
|
277
|
-
default:
|
|
278
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
279
|
-
_ = 0;
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
283
|
-
_.label = op[1];
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
287
|
-
_.label = t[1];
|
|
288
|
-
t = op;
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
if (t && _.label < t[2]) {
|
|
292
|
-
_.label = t[2];
|
|
293
|
-
_.ops.push(op);
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
if (t[2]) _.ops.pop();
|
|
297
|
-
_.trys.pop();
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
op = body.call(thisArg, _);
|
|
301
|
-
} catch (e) {
|
|
302
|
-
op = [
|
|
303
|
-
6,
|
|
304
|
-
e
|
|
305
|
-
];
|
|
306
|
-
y = 0;
|
|
307
|
-
} finally{
|
|
308
|
-
f = t = 0;
|
|
309
|
-
}
|
|
310
|
-
if (op[0] & 5) throw op[1];
|
|
311
|
-
return {
|
|
312
|
-
value: op[0] ? op[1] : void 0,
|
|
313
|
-
done: true
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
import { JSONCopy } from "@byteluck-fe/model-driven-shared";
|
|
318
|
-
import { DesignerControl } from "../BaseControl";
|
|
319
|
-
import LayoutControlProperty from "./property";
|
|
320
|
-
import { defineControlArrayToProperty } from "../ControlArray";
|
|
198
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
199
|
+
import { JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
200
|
+
import { DesignerControl } from '../BaseControl';
|
|
201
|
+
import LayoutControlProperty from './property';
|
|
202
|
+
import { defineControlArrayToProperty } from '../ControlArray';
|
|
321
203
|
// 最大可拖入数量
|
|
322
204
|
var CHILDREN_MAX_LENGTH = 10000;
|
|
323
|
-
var LayoutControl = /*#__PURE__*/ function _target(
|
|
205
|
+
var LayoutControl = /*#__PURE__*/ function _target(DesignerControl1) {
|
|
324
206
|
"use strict";
|
|
325
|
-
_inherits(LayoutControl,
|
|
207
|
+
_inherits(LayoutControl, DesignerControl1);
|
|
326
208
|
var _super = _createSuper(LayoutControl);
|
|
327
209
|
function LayoutControl(props) {
|
|
328
210
|
_classCallCheck(this, LayoutControl);
|
|
329
211
|
var _this;
|
|
330
212
|
_this = _super.call(this, props);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
_defineProperty(_assertThisInitialized(_this), "excludes", void 0);
|
|
334
|
-
_defineProperty(_assertThisInitialized(_this), "childrenMaxLength", void 0);
|
|
335
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
336
|
-
var _ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = _ref.excludes, childrenMaxLength = _ref.childrenMaxLength;
|
|
213
|
+
_this.controlType = 'layout';
|
|
214
|
+
var ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = ref.excludes, childrenMaxLength = ref.childrenMaxLength;
|
|
337
215
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
338
|
-
defineControlArrayToProperty(_assertThisInitialized(_this),
|
|
216
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Designer');
|
|
339
217
|
_this.excludes = JSONCopy(excludes);
|
|
340
218
|
_this.childrenMaxLength = childrenMaxLength;
|
|
341
219
|
return _this;
|
|
@@ -364,31 +242,25 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
364
242
|
var _this1 = this, _superprop_get_validate = function() {
|
|
365
243
|
return _get(_getPrototypeOf(LayoutControl.prototype), "validate", _this);
|
|
366
244
|
};
|
|
367
|
-
return _asyncToGenerator(function() {
|
|
368
|
-
return
|
|
369
|
-
switch(
|
|
245
|
+
return _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
|
|
246
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
247
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
370
248
|
case 0:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
_superprop_get_validate().call(_this1, messages, ignore)
|
|
374
|
-
];
|
|
375
|
-
case 1:
|
|
376
|
-
_state.sent();
|
|
377
|
-
return [
|
|
378
|
-
4,
|
|
379
|
-
Promise.all(_this1.children.map(function(child) {
|
|
380
|
-
return child.validate(messages, ignore);
|
|
381
|
-
}))
|
|
382
|
-
];
|
|
249
|
+
_ctx.next = 2;
|
|
250
|
+
return _superprop_get_validate().call(_this1, messages, ignore);
|
|
383
251
|
case 2:
|
|
384
|
-
|
|
385
|
-
return
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
252
|
+
_ctx.next = 4;
|
|
253
|
+
return Promise.all(_this1.children.map(function(child) {
|
|
254
|
+
return child.validate(messages, ignore);
|
|
255
|
+
}));
|
|
256
|
+
case 4:
|
|
257
|
+
return _ctx.abrupt("return", true);
|
|
258
|
+
case 5:
|
|
259
|
+
case "end":
|
|
260
|
+
return _ctx.stop();
|
|
389
261
|
}
|
|
390
|
-
});
|
|
391
|
-
})();
|
|
262
|
+
}, _callee);
|
|
263
|
+
}))();
|
|
392
264
|
}
|
|
393
265
|
},
|
|
394
266
|
{
|
|
@@ -420,7 +292,7 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
420
292
|
var schema = item.toSchema();
|
|
421
293
|
return schema;
|
|
422
294
|
});
|
|
423
|
-
return
|
|
295
|
+
return _objectSpread({}, superSchema, {
|
|
424
296
|
children: children
|
|
425
297
|
});
|
|
426
298
|
}
|
|
@@ -428,7 +300,7 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
|
|
|
428
300
|
]);
|
|
429
301
|
return LayoutControl;
|
|
430
302
|
}(DesignerControl);
|
|
431
|
-
|
|
432
|
-
|
|
303
|
+
LayoutControl.excludes = false;
|
|
304
|
+
LayoutControl.childrenMaxLength = CHILDREN_MAX_LENGTH;
|
|
433
305
|
export default LayoutControl;
|
|
434
306
|
export { LayoutControl as DesignerLayoutControl };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from './designer';
|
|
2
|
+
import Runtime from './runtime';
|
|
3
|
+
import Property from './property';
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|
|
@@ -69,10 +69,10 @@ function _createSuper(Derived) {
|
|
|
69
69
|
return _possibleConstructorReturn(this, result);
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
import { Property } from
|
|
73
|
-
var LayoutControlProperty = /*#__PURE__*/ function(
|
|
72
|
+
import { Property } from '../BaseControl';
|
|
73
|
+
var LayoutControlProperty = /*#__PURE__*/ function(Property1) {
|
|
74
74
|
"use strict";
|
|
75
|
-
_inherits(LayoutControlProperty,
|
|
75
|
+
_inherits(LayoutControlProperty, Property1);
|
|
76
76
|
var _super = _createSuper(LayoutControlProperty);
|
|
77
77
|
function LayoutControlProperty(props) {
|
|
78
78
|
_classCallCheck(this, LayoutControlProperty);
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -82,22 +69,20 @@ function _createSuper(Derived) {
|
|
|
82
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,
|
|
77
|
+
_inherits(LayoutControl, RuntimeControl1);
|
|
91
78
|
var _super = _createSuper(LayoutControl);
|
|
92
79
|
function LayoutControl(props) {
|
|
93
80
|
_classCallCheck(this, LayoutControl);
|
|
94
81
|
var _this;
|
|
95
82
|
_this = _super.call(this, props);
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "children", void 0);
|
|
98
|
-
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
|
+
_this.controlType = 'layout';
|
|
99
84
|
_this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
|
-
defineControlArrayToProperty(_assertThisInitialized(_this),
|
|
85
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Runtime');
|
|
101
86
|
return _this;
|
|
102
87
|
}
|
|
103
88
|
return LayoutControl;
|
|
@@ -129,30 +129,6 @@ function _objectSpread(target) {
|
|
|
129
129
|
}
|
|
130
130
|
return target;
|
|
131
131
|
}
|
|
132
|
-
function ownKeys(object, enumerableOnly) {
|
|
133
|
-
var keys = Object.keys(object);
|
|
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 _objectSpreadProps(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
132
|
function _possibleConstructorReturn(self, call) {
|
|
157
133
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
158
134
|
return call;
|
|
@@ -212,115 +188,20 @@ function _createSuper(Derived) {
|
|
|
212
188
|
return _possibleConstructorReturn(this, result);
|
|
213
189
|
};
|
|
214
190
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return t[1];
|
|
221
|
-
},
|
|
222
|
-
trys: [],
|
|
223
|
-
ops: []
|
|
224
|
-
};
|
|
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
|
-
};
|
|
310
|
-
import { DesignerControl } from "../BaseControl";
|
|
311
|
-
import ListControlProperty from "./property";
|
|
312
|
-
import { FieldTypes } from "@byteluck-fe/model-driven-shared";
|
|
313
|
-
var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
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,
|
|
197
|
+
_inherits(ListControl, DesignerControl1);
|
|
316
198
|
var _super = _createSuper(ListControl);
|
|
317
199
|
function ListControl(props) {
|
|
318
200
|
_classCallCheck(this, ListControl);
|
|
319
201
|
var _this;
|
|
320
202
|
_this = _super.call(this, props);
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
_this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
|
|
203
|
+
_this.controlType = 'list';
|
|
204
|
+
_this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props, 'Designer');
|
|
324
205
|
return _this;
|
|
325
206
|
}
|
|
326
207
|
_createClass(ListControl, [
|
|
@@ -331,31 +212,25 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
331
212
|
var _this1 = this, _superprop_get_validate = function() {
|
|
332
213
|
return _get(_getPrototypeOf(ListControl.prototype), "validate", _this);
|
|
333
214
|
};
|
|
334
|
-
return _asyncToGenerator(function() {
|
|
335
|
-
return
|
|
336
|
-
switch(
|
|
215
|
+
return _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
|
|
216
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
217
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
337
218
|
case 0:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
_superprop_get_validate().call(_this1, messages)
|
|
341
|
-
];
|
|
342
|
-
case 1:
|
|
343
|
-
_state.sent();
|
|
344
|
-
return [
|
|
345
|
-
4,
|
|
346
|
-
Promise.all(_this1.props.headers.map(function(child) {
|
|
347
|
-
return child.validate(messages, ignore);
|
|
348
|
-
}))
|
|
349
|
-
];
|
|
219
|
+
_ctx.next = 2;
|
|
220
|
+
return _superprop_get_validate().call(_this1, messages);
|
|
350
221
|
case 2:
|
|
351
|
-
|
|
352
|
-
return
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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();
|
|
356
231
|
}
|
|
357
|
-
});
|
|
358
|
-
})();
|
|
232
|
+
}, _callee);
|
|
233
|
+
}))();
|
|
359
234
|
}
|
|
360
235
|
},
|
|
361
236
|
{
|
|
@@ -382,13 +257,22 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
382
257
|
{
|
|
383
258
|
key: "toSchema",
|
|
384
259
|
value: function toSchema() {
|
|
260
|
+
var ref, ref1;
|
|
385
261
|
var superSchema = _get(_getPrototypeOf(ListControl.prototype), "toSchema", this).call(this);
|
|
386
262
|
var headers = this.props.headers.map(function(item) {
|
|
387
263
|
return item.toSchema();
|
|
388
264
|
});
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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) {
|
|
266
|
+
if (item) {
|
|
267
|
+
return item.toSchema();
|
|
268
|
+
} else {
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
return _objectSpread({}, superSchema, {
|
|
273
|
+
props: _objectSpread({}, this.props, {
|
|
274
|
+
headers: headers,
|
|
275
|
+
footers: footers
|
|
392
276
|
})
|
|
393
277
|
});
|
|
394
278
|
}
|
|
@@ -396,6 +280,6 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
396
280
|
]);
|
|
397
281
|
return ListControl;
|
|
398
282
|
}(DesignerControl);
|
|
399
|
-
|
|
283
|
+
ListControl.controlFieldType = FieldTypes.LIST;
|
|
400
284
|
export default ListControl;
|
|
401
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';
|
|
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function _defineProperty(obj, key, value) {
|
|
13
|
-
if (key in obj) {
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
12
|
function _getPrototypeOf(o) {
|
|
26
13
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -82,18 +69,18 @@ function _createSuper(Derived) {
|
|
|
82
69
|
return _possibleConstructorReturn(this, result);
|
|
83
70
|
};
|
|
84
71
|
}
|
|
85
|
-
import { Property } from
|
|
86
|
-
import { defineControlArrayToProperty } from
|
|
87
|
-
var ListControlProperty = /*#__PURE__*/ function(
|
|
72
|
+
import { Property } from '../BaseControl';
|
|
73
|
+
import { defineControlArrayToProperty } from '../ControlArray';
|
|
74
|
+
var ListControlProperty = /*#__PURE__*/ function(Property1) {
|
|
88
75
|
"use strict";
|
|
89
|
-
_inherits(ListControlProperty,
|
|
76
|
+
_inherits(ListControlProperty, Property1);
|
|
90
77
|
var _super = _createSuper(ListControlProperty);
|
|
91
|
-
function ListControlProperty(parent, props) {
|
|
78
|
+
function ListControlProperty(parent, props, mode) {
|
|
92
79
|
_classCallCheck(this, ListControlProperty);
|
|
93
80
|
var _this;
|
|
94
81
|
_this = _super.call(this, props);
|
|
95
|
-
|
|
96
|
-
defineControlArrayToProperty(_assertThisInitialized(_this),
|
|
82
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), 'headers', props === null || props === void 0 ? void 0 : props.headers, parent, mode);
|
|
83
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), 'footers', props === null || props === void 0 ? void 0 : props.footers, parent);
|
|
97
84
|
return _this;
|
|
98
85
|
}
|
|
99
86
|
return ListControlProperty;
|