@openli1115/lowcode-edit-pro-table 1.0.66 → 1.0.67
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/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/{umi.b73239e9.js → umi.86981331.js} +1 -1
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.js +4 -4
- package/dist/BizComps.js.map +1 -1
- package/es/context/FormProvider.js +22 -3
- package/lib/context/FormProvider.js +22 -3
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
|
@@ -51,6 +51,7 @@ export var FormProvider = function FormProvider(_ref) {
|
|
|
51
51
|
* store 每次 dispatch 都会给新的 screenStructures 引用;previewStore 直接把 onChange 的 payload 设为 state(同引用)。
|
|
52
52
|
* 若 initialValues === 上次 handleFormChange 推出去的对象,说明只是「表单 → store → props」回灌,禁止再 merge,否则大表 + Fusion #185。
|
|
53
53
|
* 逻辑流 / 接口改数会换对象引用,不会与 lastOutbound 全等。
|
|
54
|
+
* 另:setFieldValue 会在微任务里 onChange,回灌前 lastOutbound 已同步为深拷贝对象;若 store 又克隆导致引用不一致,需用深比较兜底。
|
|
54
55
|
*/
|
|
55
56
|
useEffect(function () {
|
|
56
57
|
if (lastOutboundStructuresRef && initialValues === lastOutboundStructuresRef.current) {
|
|
@@ -60,6 +61,13 @@ export var FormProvider = function FormProvider(_ref) {
|
|
|
60
61
|
}
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
64
|
+
if (lastOutboundStructuresRef !== null && lastOutboundStructuresRef !== void 0 && lastOutboundStructuresRef.current && isEqual(initialValues, lastOutboundStructuresRef.current)) {
|
|
65
|
+
initialValuesRef.current = initialValues;
|
|
66
|
+
if (typeof console !== 'undefined' && console.debug) {
|
|
67
|
+
console.debug('[FormProvider] skip merge (deep-equal to last outbound / store echo)');
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
63
71
|
if (isEqual(initialValues, valuesRef.current)) {
|
|
64
72
|
initialValuesRef.current = initialValues;
|
|
65
73
|
return;
|
|
@@ -79,7 +87,7 @@ export var FormProvider = function FormProvider(_ref) {
|
|
|
79
87
|
});
|
|
80
88
|
}, [initialValues]);
|
|
81
89
|
|
|
82
|
-
// 优化 setFieldValue
|
|
90
|
+
// 优化 setFieldValue(lastOutbound 必须在 onChange 微任务之前写入,供 skip-merge 与 Fusion didUpdate 对齐)
|
|
83
91
|
var setFieldValue = useCallback(function (path, value) {
|
|
84
92
|
setValues(function (prev) {
|
|
85
93
|
// 使用浅比较检查值是否实际变化
|
|
@@ -89,14 +97,25 @@ export var FormProvider = function FormProvider(_ref) {
|
|
|
89
97
|
var newValues = cloneDeep(prev);
|
|
90
98
|
set(newValues, path, value);
|
|
91
99
|
console.log("[FormProvider] \uD83D\uDCDD Set field '" + path + "' to:", value);
|
|
100
|
+
if (lastOutboundStructuresRef) {
|
|
101
|
+
lastOutboundStructuresRef.current = newValues;
|
|
102
|
+
}
|
|
92
103
|
if (onChange) {
|
|
93
104
|
Promise.resolve().then(function () {
|
|
94
|
-
|
|
105
|
+
var rd = typeof window !== 'undefined' ? window.ReactDOM : undefined;
|
|
106
|
+
var run = function run() {
|
|
107
|
+
return onChange(newValues);
|
|
108
|
+
};
|
|
109
|
+
if (rd && typeof rd.unstable_batchedUpdates === 'function') {
|
|
110
|
+
rd.unstable_batchedUpdates(run);
|
|
111
|
+
} else {
|
|
112
|
+
run();
|
|
113
|
+
}
|
|
95
114
|
});
|
|
96
115
|
}
|
|
97
116
|
return newValues;
|
|
98
117
|
});
|
|
99
|
-
}, []);
|
|
118
|
+
}, [onChange, lastOutboundStructuresRef]);
|
|
100
119
|
|
|
101
120
|
// 使用 useMemo 缓存 context 值
|
|
102
121
|
var contextValue = useMemo(function () {
|
|
@@ -57,6 +57,7 @@ var FormProvider = exports.FormProvider = function FormProvider(_ref) {
|
|
|
57
57
|
* store 每次 dispatch 都会给新的 screenStructures 引用;previewStore 直接把 onChange 的 payload 设为 state(同引用)。
|
|
58
58
|
* 若 initialValues === 上次 handleFormChange 推出去的对象,说明只是「表单 → store → props」回灌,禁止再 merge,否则大表 + Fusion #185。
|
|
59
59
|
* 逻辑流 / 接口改数会换对象引用,不会与 lastOutbound 全等。
|
|
60
|
+
* 另:setFieldValue 会在微任务里 onChange,回灌前 lastOutbound 已同步为深拷贝对象;若 store 又克隆导致引用不一致,需用深比较兜底。
|
|
60
61
|
*/
|
|
61
62
|
useEffect(function () {
|
|
62
63
|
if (lastOutboundStructuresRef && initialValues === lastOutboundStructuresRef.current) {
|
|
@@ -66,6 +67,13 @@ var FormProvider = exports.FormProvider = function FormProvider(_ref) {
|
|
|
66
67
|
}
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
70
|
+
if (lastOutboundStructuresRef !== null && lastOutboundStructuresRef !== void 0 && lastOutboundStructuresRef.current && (0, _lodash.isEqual)(initialValues, lastOutboundStructuresRef.current)) {
|
|
71
|
+
initialValuesRef.current = initialValues;
|
|
72
|
+
if (typeof console !== 'undefined' && console.debug) {
|
|
73
|
+
console.debug('[FormProvider] skip merge (deep-equal to last outbound / store echo)');
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
69
77
|
if ((0, _lodash.isEqual)(initialValues, valuesRef.current)) {
|
|
70
78
|
initialValuesRef.current = initialValues;
|
|
71
79
|
return;
|
|
@@ -85,7 +93,7 @@ var FormProvider = exports.FormProvider = function FormProvider(_ref) {
|
|
|
85
93
|
});
|
|
86
94
|
}, [initialValues]);
|
|
87
95
|
|
|
88
|
-
// 优化 setFieldValue
|
|
96
|
+
// 优化 setFieldValue(lastOutbound 必须在 onChange 微任务之前写入,供 skip-merge 与 Fusion didUpdate 对齐)
|
|
89
97
|
var setFieldValue = useCallback(function (path, value) {
|
|
90
98
|
setValues(function (prev) {
|
|
91
99
|
// 使用浅比较检查值是否实际变化
|
|
@@ -95,14 +103,25 @@ var FormProvider = exports.FormProvider = function FormProvider(_ref) {
|
|
|
95
103
|
var newValues = (0, _lodash.cloneDeep)(prev);
|
|
96
104
|
(0, _lodash.set)(newValues, path, value);
|
|
97
105
|
console.log("[FormProvider] \uD83D\uDCDD Set field '" + path + "' to:", value);
|
|
106
|
+
if (lastOutboundStructuresRef) {
|
|
107
|
+
lastOutboundStructuresRef.current = newValues;
|
|
108
|
+
}
|
|
98
109
|
if (onChange) {
|
|
99
110
|
Promise.resolve().then(function () {
|
|
100
|
-
|
|
111
|
+
var rd = typeof window !== 'undefined' ? window.ReactDOM : undefined;
|
|
112
|
+
var run = function run() {
|
|
113
|
+
return onChange(newValues);
|
|
114
|
+
};
|
|
115
|
+
if (rd && typeof rd.unstable_batchedUpdates === 'function') {
|
|
116
|
+
rd.unstable_batchedUpdates(run);
|
|
117
|
+
} else {
|
|
118
|
+
run();
|
|
119
|
+
}
|
|
101
120
|
});
|
|
102
121
|
}
|
|
103
122
|
return newValues;
|
|
104
123
|
});
|
|
105
|
-
}, []);
|
|
124
|
+
}, [onChange, lastOutboundStructuresRef]);
|
|
106
125
|
|
|
107
126
|
// 使用 useMemo 缓存 context 值
|
|
108
127
|
var contextValue = useMemo(function () {
|
package/lowcode_es/meta.js
CHANGED
|
@@ -101,7 +101,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
101
101
|
packageName = '@openli1115/lowcode-edit-pro-table';
|
|
102
102
|
}
|
|
103
103
|
if (version === void 0) {
|
|
104
|
-
version = '1.0.
|
|
104
|
+
version = '1.0.67';
|
|
105
105
|
}
|
|
106
106
|
if (basicLibraryVersion === void 0) {
|
|
107
107
|
basicLibraryVersion = {
|
package/lowcode_lib/meta.js
CHANGED
|
@@ -106,7 +106,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
106
106
|
packageName = '@openli1115/lowcode-edit-pro-table';
|
|
107
107
|
}
|
|
108
108
|
if (version === void 0) {
|
|
109
|
-
version = '1.0.
|
|
109
|
+
version = '1.0.67';
|
|
110
110
|
}
|
|
111
111
|
if (basicLibraryVersion === void 0) {
|
|
112
112
|
basicLibraryVersion = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openli1115/lowcode-edit-pro-table",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.67",
|
|
4
4
|
"description": "@openli1115/lowcode-edit-pro-table",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
},
|
|
102
102
|
"componentConfig": {
|
|
103
103
|
"isComponentLibrary": true,
|
|
104
|
-
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.
|
|
104
|
+
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.67/build/lowcode/assets-prod.json"
|
|
105
105
|
},
|
|
106
106
|
"lcMeta": {
|
|
107
107
|
"type": "component"
|
|
108
108
|
},
|
|
109
|
-
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.
|
|
109
|
+
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.67/build/index.html"
|
|
110
110
|
}
|