@byteluck-fe/model-driven-engine 2.3.1-beta.12 → 2.3.1-beta.13
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/Store.js
CHANGED
|
@@ -23,9 +23,48 @@ function _instanceof(left, right) {
|
|
|
23
23
|
return left instanceof right;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
function _objectSpread(target) {
|
|
27
|
+
for(var i = 1; i < arguments.length; i++){
|
|
28
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
29
|
+
var ownKeys = Object.keys(source);
|
|
30
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
31
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
32
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
ownKeys.forEach(function(key) {
|
|
36
|
+
_defineProperty(target, key, source[key]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
}
|
|
41
|
+
function ownKeys(object, enumerableOnly) {
|
|
42
|
+
var keys = Object.keys(object);
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
45
|
+
if (enumerableOnly) {
|
|
46
|
+
symbols = symbols.filter(function(sym) {
|
|
47
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
keys.push.apply(keys, symbols);
|
|
51
|
+
}
|
|
52
|
+
return keys;
|
|
53
|
+
}
|
|
54
|
+
function _objectSpreadProps(target, source) {
|
|
55
|
+
source = source != null ? source : {};
|
|
56
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
57
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
58
|
+
} else {
|
|
59
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
60
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
26
65
|
import { DataBind, ObjectDataBind } from "@byteluck-fe/model-driven-core";
|
|
27
66
|
import { loopFormSchema, JSONCopy, warn, CONTROL_TYPE, CONTROL_BASE_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
28
|
-
import { loopDataViewControl, loopFormControl } from "../utils/runtimeUtils";
|
|
67
|
+
import { loopDataViewControl, loopFormControl, buildUUID } from "../utils/runtimeUtils";
|
|
29
68
|
var Store = /*#__PURE__*/ function() {
|
|
30
69
|
"use strict";
|
|
31
70
|
function Store(props) {
|
|
@@ -141,7 +180,9 @@ var Store = /*#__PURE__*/ function() {
|
|
|
141
180
|
if (children !== undefined) {
|
|
142
181
|
Object.keys(children).map(function(childControlId) {
|
|
143
182
|
if (childControlId === controlId) {
|
|
144
|
-
state = _this.emptyState[dataViewId][subtableId][controlId]
|
|
183
|
+
state = _objectSpreadProps(_objectSpread({}, _this.emptyState[dataViewId][subtableId][controlId]), {
|
|
184
|
+
uid: "new:" + buildUUID("uid")
|
|
185
|
+
});
|
|
145
186
|
}
|
|
146
187
|
});
|
|
147
188
|
}
|
|
@@ -32,3 +32,12 @@ callback) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
var unique = 0;
|
|
36
|
+
// uuid生成
|
|
37
|
+
export function buildUUID() {
|
|
38
|
+
var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
39
|
+
var time = Date.now();
|
|
40
|
+
var random = Math.floor(Math.random() * 1000000000);
|
|
41
|
+
unique++;
|
|
42
|
+
return prefix + "_" + random + unique + String(time);
|
|
43
|
+
}
|