@byteluck-fe/model-driven-core 1.3.0-beta.26 → 1.3.0-beta.29
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 +409 -0
- package/dist/esm/common/BaseControl/index.js +12 -0
- package/dist/esm/common/BaseControl/property.js +160 -0
- package/dist/esm/common/BaseControl/runtime.js +72 -0
- package/dist/esm/common/BaseControl/types.js +1 -0
- package/dist/esm/common/ColumnControl/designer.js +89 -0
- package/dist/esm/common/ColumnControl/index.js +11 -0
- package/dist/esm/common/ColumnControl/property.js +157 -0
- package/dist/esm/common/ColumnControl/runtime.js +89 -0
- package/dist/esm/common/ColumnControl/types.js +0 -0
- package/dist/esm/common/ControlArray.js +100 -0
- package/dist/esm/common/FormControl/designer.js +94 -0
- package/dist/esm/common/FormControl/index.js +11 -0
- package/dist/esm/common/FormControl/property.js +262 -0
- package/dist/esm/common/FormControl/runtime.js +89 -0
- package/dist/esm/common/FormControl/types.js +0 -0
- package/dist/esm/common/LayoutControl/designer.js +300 -0
- package/dist/esm/common/LayoutControl/index.js +11 -0
- package/dist/esm/common/LayoutControl/property.js +84 -0
- package/dist/esm/common/LayoutControl/runtime.js +91 -0
- package/dist/esm/common/LayoutControl/types.js +0 -0
- package/dist/esm/common/ListControl/designer.js +276 -0
- package/dist/esm/common/ListControl/index.js +11 -0
- package/dist/esm/common/ListControl/property.js +88 -0
- package/dist/esm/common/ListControl/runtime.js +113 -0
- package/dist/esm/common/ListControl/types.js +0 -0
- package/dist/esm/common/SearchViewControl/designer.js +89 -0
- package/dist/esm/common/SearchViewControl/index.js +11 -0
- package/dist/esm/common/SearchViewControl/property.js +88 -0
- package/dist/esm/common/SearchViewControl/runtime.js +89 -0
- package/dist/esm/common/SearchViewControl/types.js +0 -0
- package/dist/esm/common/Validator.js +16 -0
- package/dist/esm/common/WrapControl/designer.js +89 -0
- package/dist/esm/common/WrapControl/index.js +11 -0
- package/dist/esm/common/WrapControl/property.js +84 -0
- package/dist/esm/common/WrapControl/runtime.js +89 -0
- package/dist/esm/common/WrapControl/types.js +0 -0
- package/dist/esm/common/controlHooksEmitter.js +3 -0
- package/dist/esm/common/index.js +11 -0
- package/dist/esm/common/initOptionAndDataSourceRules.js +227 -0
- package/dist/esm/framework/RegisterControls.js +149 -0
- package/dist/esm/framework/index.js +690 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/type.js +1 -0
- package/dist/index.umd.js +1 -0
- package/dist/types/common/BaseControl/designer.d.ts +62 -0
- package/dist/types/common/BaseControl/index.d.ts +13 -0
- package/dist/types/common/BaseControl/property.d.ts +22 -0
- package/dist/types/common/BaseControl/runtime.d.ts +22 -0
- package/dist/types/common/BaseControl/types.d.ts +35 -0
- package/dist/types/common/ColumnControl/designer.d.ts +10 -0
- package/dist/types/common/ColumnControl/index.d.ts +12 -0
- package/dist/types/common/ColumnControl/property.d.ts +30 -0
- package/dist/types/common/ColumnControl/runtime.d.ts +10 -0
- package/dist/types/common/ColumnControl/types.d.ts +0 -0
- package/dist/types/common/ControlArray.d.ts +8 -0
- package/dist/types/common/FormControl/designer.d.ts +13 -0
- package/dist/types/common/FormControl/index.d.ts +12 -0
- package/dist/types/common/FormControl/property.d.ts +44 -0
- package/dist/types/common/FormControl/runtime.d.ts +11 -0
- package/dist/types/common/FormControl/types.d.ts +0 -0
- package/dist/types/common/LayoutControl/designer.d.ts +21 -0
- package/dist/types/common/LayoutControl/index.d.ts +12 -0
- package/dist/types/common/LayoutControl/property.d.ts +6 -0
- package/dist/types/common/LayoutControl/runtime.d.ts +11 -0
- package/dist/types/common/LayoutControl/types.d.ts +0 -0
- package/dist/types/common/ListControl/designer.d.ts +16 -0
- package/dist/types/common/ListControl/index.d.ts +12 -0
- package/dist/types/common/ListControl/property.d.ts +12 -0
- package/dist/types/common/ListControl/runtime.d.ts +12 -0
- package/dist/types/common/ListControl/types.d.ts +0 -0
- package/dist/types/common/SearchViewControl/designer.d.ts +11 -0
- package/dist/types/common/SearchViewControl/index.d.ts +12 -0
- package/dist/types/common/SearchViewControl/property.d.ts +8 -0
- package/dist/types/common/SearchViewControl/runtime.d.ts +11 -0
- package/dist/types/common/SearchViewControl/types.d.ts +0 -0
- package/dist/types/common/Validator.d.ts +15 -0
- package/dist/types/common/WrapControl/designer.d.ts +11 -0
- package/dist/types/common/WrapControl/index.d.ts +12 -0
- package/dist/types/common/WrapControl/property.d.ts +6 -0
- package/dist/types/common/WrapControl/runtime.d.ts +11 -0
- package/dist/types/common/WrapControl/types.d.ts +0 -0
- package/dist/types/common/controlHooksEmitter.d.ts +4 -0
- package/dist/types/common/index.d.ts +11 -0
- package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -0
- package/dist/types/framework/RegisterControls.d.ts +33 -0
- package/dist/types/framework/index.d.ts +349 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/type.d.ts +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
function _assertThisInitialized(self) {
|
|
2
|
+
if (self === void 0) {
|
|
3
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
+
}
|
|
5
|
+
return self;
|
|
6
|
+
}
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _getPrototypeOf(o) {
|
|
13
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
15
|
+
};
|
|
16
|
+
return _getPrototypeOf(o);
|
|
17
|
+
}
|
|
18
|
+
function _inherits(subClass, superClass) {
|
|
19
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
20
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
21
|
+
}
|
|
22
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
23
|
+
constructor: {
|
|
24
|
+
value: subClass,
|
|
25
|
+
writable: true,
|
|
26
|
+
configurable: true
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
30
|
+
}
|
|
31
|
+
function _possibleConstructorReturn(self, call) {
|
|
32
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
33
|
+
return call;
|
|
34
|
+
}
|
|
35
|
+
return _assertThisInitialized(self);
|
|
36
|
+
}
|
|
37
|
+
function _setPrototypeOf(o, p) {
|
|
38
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
39
|
+
o.__proto__ = p;
|
|
40
|
+
return o;
|
|
41
|
+
};
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
43
|
+
}
|
|
44
|
+
var _typeof = function(obj) {
|
|
45
|
+
"@swc/helpers - typeof";
|
|
46
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
47
|
+
};
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
49
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
50
|
+
if (Reflect.construct.sham) return false;
|
|
51
|
+
if (typeof Proxy === "function") return true;
|
|
52
|
+
try {
|
|
53
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
54
|
+
return true;
|
|
55
|
+
} catch (e) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function _createSuper(Derived) {
|
|
60
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
61
|
+
return function _createSuperInternal() {
|
|
62
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
63
|
+
if (hasNativeReflectConstruct) {
|
|
64
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
65
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
66
|
+
} else {
|
|
67
|
+
result = Super.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
return _possibleConstructorReturn(this, result);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
import { Property } from "../BaseControl";
|
|
73
|
+
var LayoutControlProperty = /*#__PURE__*/ function(Property) {
|
|
74
|
+
"use strict";
|
|
75
|
+
_inherits(LayoutControlProperty, Property);
|
|
76
|
+
var _super = _createSuper(LayoutControlProperty);
|
|
77
|
+
function LayoutControlProperty(props) {
|
|
78
|
+
_classCallCheck(this, LayoutControlProperty);
|
|
79
|
+
return _super.call(this, props);
|
|
80
|
+
}
|
|
81
|
+
return LayoutControlProperty;
|
|
82
|
+
}(Property);
|
|
83
|
+
export default LayoutControlProperty;
|
|
84
|
+
export { LayoutControlProperty };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
function _assertThisInitialized(self) {
|
|
2
|
+
if (self === void 0) {
|
|
3
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
+
}
|
|
5
|
+
return self;
|
|
6
|
+
}
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _getPrototypeOf(o) {
|
|
13
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
15
|
+
};
|
|
16
|
+
return _getPrototypeOf(o);
|
|
17
|
+
}
|
|
18
|
+
function _inherits(subClass, superClass) {
|
|
19
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
20
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
21
|
+
}
|
|
22
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
23
|
+
constructor: {
|
|
24
|
+
value: subClass,
|
|
25
|
+
writable: true,
|
|
26
|
+
configurable: true
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
30
|
+
}
|
|
31
|
+
function _possibleConstructorReturn(self, call) {
|
|
32
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
33
|
+
return call;
|
|
34
|
+
}
|
|
35
|
+
return _assertThisInitialized(self);
|
|
36
|
+
}
|
|
37
|
+
function _setPrototypeOf(o, p) {
|
|
38
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
39
|
+
o.__proto__ = p;
|
|
40
|
+
return o;
|
|
41
|
+
};
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
43
|
+
}
|
|
44
|
+
var _typeof = function(obj) {
|
|
45
|
+
"@swc/helpers - typeof";
|
|
46
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
47
|
+
};
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
49
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
50
|
+
if (Reflect.construct.sham) return false;
|
|
51
|
+
if (typeof Proxy === "function") return true;
|
|
52
|
+
try {
|
|
53
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
54
|
+
return true;
|
|
55
|
+
} catch (e) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function _createSuper(Derived) {
|
|
60
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
61
|
+
return function _createSuperInternal() {
|
|
62
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
63
|
+
if (hasNativeReflectConstruct) {
|
|
64
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
65
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
66
|
+
} else {
|
|
67
|
+
result = Super.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
return _possibleConstructorReturn(this, result);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
import { RuntimeControl } from "../BaseControl";
|
|
73
|
+
import LayoutControlProperty from "./property";
|
|
74
|
+
import { defineControlArrayToProperty } from "../ControlArray";
|
|
75
|
+
var LayoutControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
76
|
+
"use strict";
|
|
77
|
+
_inherits(LayoutControl, RuntimeControl);
|
|
78
|
+
var _super = _createSuper(LayoutControl);
|
|
79
|
+
function LayoutControl(props) {
|
|
80
|
+
_classCallCheck(this, LayoutControl);
|
|
81
|
+
var _this;
|
|
82
|
+
_this = _super.call(this, props);
|
|
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);
|
|
86
|
+
return _this;
|
|
87
|
+
}
|
|
88
|
+
return LayoutControl;
|
|
89
|
+
}(RuntimeControl);
|
|
90
|
+
export default LayoutControl;
|
|
91
|
+
export { LayoutControl as RuntimeLayoutControl };
|
|
File without changes
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
function _arrayLikeToArray(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithoutHoles(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
8
|
+
}
|
|
9
|
+
function _assertThisInitialized(self) {
|
|
10
|
+
if (self === void 0) {
|
|
11
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
12
|
+
}
|
|
13
|
+
return self;
|
|
14
|
+
}
|
|
15
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
16
|
+
try {
|
|
17
|
+
var info = gen[key](arg);
|
|
18
|
+
var value = info.value;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
reject(error);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (info.done) {
|
|
24
|
+
resolve(value);
|
|
25
|
+
} else {
|
|
26
|
+
Promise.resolve(value).then(_next, _throw);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function _asyncToGenerator(fn) {
|
|
30
|
+
return function() {
|
|
31
|
+
var self = this, args = arguments;
|
|
32
|
+
return new Promise(function(resolve, reject) {
|
|
33
|
+
var gen = fn.apply(self, args);
|
|
34
|
+
function _next(value) {
|
|
35
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
36
|
+
}
|
|
37
|
+
function _throw(err) {
|
|
38
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
39
|
+
}
|
|
40
|
+
_next(undefined);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function _classCallCheck(instance, Constructor) {
|
|
45
|
+
if (!(instance instanceof Constructor)) {
|
|
46
|
+
throw new TypeError("Cannot call a class as a function");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function _defineProperty(obj, key, value) {
|
|
50
|
+
if (key in obj) {
|
|
51
|
+
Object.defineProperty(obj, key, {
|
|
52
|
+
value: value,
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
obj[key] = value;
|
|
59
|
+
}
|
|
60
|
+
return obj;
|
|
61
|
+
}
|
|
62
|
+
function _get(target, property, receiver) {
|
|
63
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
64
|
+
_get = Reflect.get;
|
|
65
|
+
} else {
|
|
66
|
+
_get = function _get(target, property, receiver) {
|
|
67
|
+
var base = _superPropBase(target, property);
|
|
68
|
+
if (!base) return;
|
|
69
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
70
|
+
if (desc.get) {
|
|
71
|
+
return desc.get.call(receiver);
|
|
72
|
+
}
|
|
73
|
+
return desc.value;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return _get(target, property, receiver || target);
|
|
77
|
+
}
|
|
78
|
+
function _getPrototypeOf(o) {
|
|
79
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
80
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
81
|
+
};
|
|
82
|
+
return _getPrototypeOf(o);
|
|
83
|
+
}
|
|
84
|
+
function _inherits(subClass, superClass) {
|
|
85
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
86
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
87
|
+
}
|
|
88
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
89
|
+
constructor: {
|
|
90
|
+
value: subClass,
|
|
91
|
+
writable: true,
|
|
92
|
+
configurable: true
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
96
|
+
}
|
|
97
|
+
function _iterableToArray(iter) {
|
|
98
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
99
|
+
}
|
|
100
|
+
function _nonIterableSpread() {
|
|
101
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
102
|
+
}
|
|
103
|
+
function _objectSpread(target) {
|
|
104
|
+
for(var i = 1; i < arguments.length; i++){
|
|
105
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
106
|
+
var ownKeys = Object.keys(source);
|
|
107
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
108
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
109
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
ownKeys.forEach(function(key) {
|
|
113
|
+
_defineProperty(target, key, source[key]);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return target;
|
|
117
|
+
}
|
|
118
|
+
function ownKeys(object, enumerableOnly) {
|
|
119
|
+
var keys = Object.keys(object);
|
|
120
|
+
if (Object.getOwnPropertySymbols) {
|
|
121
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
122
|
+
if (enumerableOnly) {
|
|
123
|
+
symbols = symbols.filter(function(sym) {
|
|
124
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
keys.push.apply(keys, symbols);
|
|
128
|
+
}
|
|
129
|
+
return keys;
|
|
130
|
+
}
|
|
131
|
+
function _objectSpreadProps(target, source) {
|
|
132
|
+
source = source != null ? source : {};
|
|
133
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
134
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
135
|
+
} else {
|
|
136
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
137
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return target;
|
|
141
|
+
}
|
|
142
|
+
function _possibleConstructorReturn(self, call) {
|
|
143
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
144
|
+
return call;
|
|
145
|
+
}
|
|
146
|
+
return _assertThisInitialized(self);
|
|
147
|
+
}
|
|
148
|
+
function _setPrototypeOf(o, p) {
|
|
149
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
150
|
+
o.__proto__ = p;
|
|
151
|
+
return o;
|
|
152
|
+
};
|
|
153
|
+
return _setPrototypeOf(o, p);
|
|
154
|
+
}
|
|
155
|
+
function _superPropBase(object, property) {
|
|
156
|
+
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
157
|
+
object = _getPrototypeOf(object);
|
|
158
|
+
if (object === null) break;
|
|
159
|
+
}
|
|
160
|
+
return object;
|
|
161
|
+
}
|
|
162
|
+
function _toConsumableArray(arr) {
|
|
163
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
164
|
+
}
|
|
165
|
+
var _typeof = function(obj) {
|
|
166
|
+
"@swc/helpers - typeof";
|
|
167
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
168
|
+
};
|
|
169
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
170
|
+
if (!o) return;
|
|
171
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
172
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
173
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
174
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
175
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
176
|
+
}
|
|
177
|
+
function _isNativeReflectConstruct() {
|
|
178
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
179
|
+
if (Reflect.construct.sham) return false;
|
|
180
|
+
if (typeof Proxy === "function") return true;
|
|
181
|
+
try {
|
|
182
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
183
|
+
return true;
|
|
184
|
+
} catch (e) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function _createSuper(Derived) {
|
|
189
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
190
|
+
return function _createSuperInternal() {
|
|
191
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
192
|
+
if (hasNativeReflectConstruct) {
|
|
193
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
194
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
195
|
+
} else {
|
|
196
|
+
result = Super.apply(this, arguments);
|
|
197
|
+
}
|
|
198
|
+
return _possibleConstructorReturn(this, result);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
202
|
+
import { DesignerControl } from "../BaseControl";
|
|
203
|
+
import ListControlProperty from "./property";
|
|
204
|
+
import { FieldTypes } from "@byteluck-fe/model-driven-shared";
|
|
205
|
+
var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
206
|
+
"use strict";
|
|
207
|
+
_inherits(ListControl, DesignerControl);
|
|
208
|
+
var _super = _createSuper(ListControl);
|
|
209
|
+
function ListControl(props) {
|
|
210
|
+
_classCallCheck(this, ListControl);
|
|
211
|
+
var _this;
|
|
212
|
+
_this = _super.call(this, props);
|
|
213
|
+
_this.controlType = "list";
|
|
214
|
+
_this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
|
|
215
|
+
return _this;
|
|
216
|
+
}
|
|
217
|
+
var _proto = ListControl.prototype;
|
|
218
|
+
_proto.validate = function validate(messages, ignore) {
|
|
219
|
+
var _this = this;
|
|
220
|
+
var _this1 = this, _superprop_get_validate = function() {
|
|
221
|
+
return _get(_getPrototypeOf(ListControl.prototype), "validate", _this);
|
|
222
|
+
};
|
|
223
|
+
return _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
224
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
225
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
226
|
+
case 0:
|
|
227
|
+
_ctx.next = 2;
|
|
228
|
+
return _superprop_get_validate().call(_this1, messages);
|
|
229
|
+
case 2:
|
|
230
|
+
_ctx.next = 4;
|
|
231
|
+
return Promise.all(_this1.props.headers.map(function(child) {
|
|
232
|
+
return child.validate(messages, ignore);
|
|
233
|
+
}));
|
|
234
|
+
case 4:
|
|
235
|
+
return _ctx.abrupt("return", true);
|
|
236
|
+
case 5:
|
|
237
|
+
case "end":
|
|
238
|
+
return _ctx.stop();
|
|
239
|
+
}
|
|
240
|
+
}, _callee);
|
|
241
|
+
}))();
|
|
242
|
+
};
|
|
243
|
+
_proto.toDataBindModel = function toDataBindModel() {
|
|
244
|
+
var listModel = _get(_getPrototypeOf(ListControl.prototype), "toDataBindModel", this).call(this);
|
|
245
|
+
var result = listModel ? [
|
|
246
|
+
listModel
|
|
247
|
+
] : [];
|
|
248
|
+
var parentId = this.id;
|
|
249
|
+
return this.props.headers.reduce(function(arr, current) {
|
|
250
|
+
var model = current.toDataBindModel(parentId);
|
|
251
|
+
if (Array.isArray(model)) {
|
|
252
|
+
var filteredModel = model.filter(function(item) {
|
|
253
|
+
return !!item;
|
|
254
|
+
});
|
|
255
|
+
return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
|
|
256
|
+
}
|
|
257
|
+
model && arr.push(model);
|
|
258
|
+
return arr;
|
|
259
|
+
}, result);
|
|
260
|
+
};
|
|
261
|
+
_proto.toSchema = function toSchema() {
|
|
262
|
+
var superSchema = _get(_getPrototypeOf(ListControl.prototype), "toSchema", this).call(this);
|
|
263
|
+
var headers = this.props.headers.map(function(item) {
|
|
264
|
+
return item.toSchema();
|
|
265
|
+
});
|
|
266
|
+
return _objectSpreadProps(_objectSpread({}, superSchema), {
|
|
267
|
+
props: _objectSpreadProps(_objectSpread({}, this.props), {
|
|
268
|
+
headers: headers
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
return ListControl;
|
|
273
|
+
}(DesignerControl);
|
|
274
|
+
ListControl.controlFieldType = FieldTypes.LIST;
|
|
275
|
+
export default ListControl;
|
|
276
|
+
export { ListControl as DesignerListControl };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Designer from "./designer";
|
|
2
|
+
import Runtime from "./runtime";
|
|
3
|
+
import Property from "./property";
|
|
4
|
+
export default {
|
|
5
|
+
Designer: Designer,
|
|
6
|
+
Runtime: Runtime,
|
|
7
|
+
Property: Property
|
|
8
|
+
};
|
|
9
|
+
export * from "./designer";
|
|
10
|
+
export * from "./runtime";
|
|
11
|
+
export * from "./property";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
function _assertThisInitialized(self) {
|
|
2
|
+
if (self === void 0) {
|
|
3
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
+
}
|
|
5
|
+
return self;
|
|
6
|
+
}
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _getPrototypeOf(o) {
|
|
13
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
15
|
+
};
|
|
16
|
+
return _getPrototypeOf(o);
|
|
17
|
+
}
|
|
18
|
+
function _inherits(subClass, superClass) {
|
|
19
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
20
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
21
|
+
}
|
|
22
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
23
|
+
constructor: {
|
|
24
|
+
value: subClass,
|
|
25
|
+
writable: true,
|
|
26
|
+
configurable: true
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
30
|
+
}
|
|
31
|
+
function _possibleConstructorReturn(self, call) {
|
|
32
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
33
|
+
return call;
|
|
34
|
+
}
|
|
35
|
+
return _assertThisInitialized(self);
|
|
36
|
+
}
|
|
37
|
+
function _setPrototypeOf(o, p) {
|
|
38
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
39
|
+
o.__proto__ = p;
|
|
40
|
+
return o;
|
|
41
|
+
};
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
43
|
+
}
|
|
44
|
+
var _typeof = function(obj) {
|
|
45
|
+
"@swc/helpers - typeof";
|
|
46
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
47
|
+
};
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
49
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
50
|
+
if (Reflect.construct.sham) return false;
|
|
51
|
+
if (typeof Proxy === "function") return true;
|
|
52
|
+
try {
|
|
53
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
54
|
+
return true;
|
|
55
|
+
} catch (e) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function _createSuper(Derived) {
|
|
60
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
61
|
+
return function _createSuperInternal() {
|
|
62
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
63
|
+
if (hasNativeReflectConstruct) {
|
|
64
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
65
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
66
|
+
} else {
|
|
67
|
+
result = Super.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
return _possibleConstructorReturn(this, result);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
import { Property } from "../BaseControl";
|
|
73
|
+
import { defineControlArrayToProperty } from "../ControlArray";
|
|
74
|
+
var ListControlProperty = /*#__PURE__*/ function(Property) {
|
|
75
|
+
"use strict";
|
|
76
|
+
_inherits(ListControlProperty, Property);
|
|
77
|
+
var _super = _createSuper(ListControlProperty);
|
|
78
|
+
function ListControlProperty(parent, props) {
|
|
79
|
+
_classCallCheck(this, ListControlProperty);
|
|
80
|
+
var _this;
|
|
81
|
+
_this = _super.call(this, props);
|
|
82
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), "headers", props === null || props === void 0 ? void 0 : props.headers, parent);
|
|
83
|
+
return _this;
|
|
84
|
+
}
|
|
85
|
+
return ListControlProperty;
|
|
86
|
+
}(Property);
|
|
87
|
+
export default ListControlProperty;
|
|
88
|
+
export { ListControlProperty };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
function _assertThisInitialized(self) {
|
|
2
|
+
if (self === void 0) {
|
|
3
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
+
}
|
|
5
|
+
return self;
|
|
6
|
+
}
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _defineProperties(target, props) {
|
|
13
|
+
for(var i = 0; i < props.length; i++){
|
|
14
|
+
var descriptor = props[i];
|
|
15
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
16
|
+
descriptor.configurable = true;
|
|
17
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
18
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
22
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
24
|
+
return Constructor;
|
|
25
|
+
}
|
|
26
|
+
function _getPrototypeOf(o) {
|
|
27
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
28
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
29
|
+
};
|
|
30
|
+
return _getPrototypeOf(o);
|
|
31
|
+
}
|
|
32
|
+
function _inherits(subClass, superClass) {
|
|
33
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
34
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
35
|
+
}
|
|
36
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
37
|
+
constructor: {
|
|
38
|
+
value: subClass,
|
|
39
|
+
writable: true,
|
|
40
|
+
configurable: true
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
44
|
+
}
|
|
45
|
+
function _possibleConstructorReturn(self, call) {
|
|
46
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
47
|
+
return call;
|
|
48
|
+
}
|
|
49
|
+
return _assertThisInitialized(self);
|
|
50
|
+
}
|
|
51
|
+
function _setPrototypeOf(o, p) {
|
|
52
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
53
|
+
o.__proto__ = p;
|
|
54
|
+
return o;
|
|
55
|
+
};
|
|
56
|
+
return _setPrototypeOf(o, p);
|
|
57
|
+
}
|
|
58
|
+
var _typeof = function(obj) {
|
|
59
|
+
"@swc/helpers - typeof";
|
|
60
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
61
|
+
};
|
|
62
|
+
function _isNativeReflectConstruct() {
|
|
63
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
64
|
+
if (Reflect.construct.sham) return false;
|
|
65
|
+
if (typeof Proxy === "function") return true;
|
|
66
|
+
try {
|
|
67
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
+
return true;
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function _createSuper(Derived) {
|
|
74
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
75
|
+
return function _createSuperInternal() {
|
|
76
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
77
|
+
if (hasNativeReflectConstruct) {
|
|
78
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
79
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
80
|
+
} else {
|
|
81
|
+
result = Super.apply(this, arguments);
|
|
82
|
+
}
|
|
83
|
+
return _possibleConstructorReturn(this, result);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
import { RuntimeControl } from "../BaseControl";
|
|
87
|
+
import ListControlProperty from "./property";
|
|
88
|
+
import { defineControlArrayToProperty } from "../ControlArray";
|
|
89
|
+
var ListControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
90
|
+
"use strict";
|
|
91
|
+
_inherits(ListControl, RuntimeControl);
|
|
92
|
+
var _super = _createSuper(ListControl);
|
|
93
|
+
function ListControl(props) {
|
|
94
|
+
_classCallCheck(this, ListControl);
|
|
95
|
+
var _this;
|
|
96
|
+
_this = _super.call(this, props);
|
|
97
|
+
_this.controlType = "list";
|
|
98
|
+
_this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
|
|
99
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
|
|
100
|
+
return _this;
|
|
101
|
+
}
|
|
102
|
+
_createClass(ListControl, [
|
|
103
|
+
{
|
|
104
|
+
key: "length",
|
|
105
|
+
get: function get() {
|
|
106
|
+
return this.children.length;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
]);
|
|
110
|
+
return ListControl;
|
|
111
|
+
}(RuntimeControl);
|
|
112
|
+
export default ListControl;
|
|
113
|
+
export { ListControl as RuntimeListControl };
|
|
File without changes
|