@faasjs/ant-design 0.0.3-beta.6 → 0.0.3-beta.8
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/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -418,10 +418,14 @@ function FormItem(props) {
|
|
|
418
418
|
}
|
|
419
419
|
if (propsCopy.if) {
|
|
420
420
|
const condition = propsCopy.if;
|
|
421
|
-
propsCopy.shouldUpdate
|
|
421
|
+
const originShouldUpdate = propsCopy.shouldUpdate;
|
|
422
|
+
propsCopy.shouldUpdate = (prev, cur) => {
|
|
422
423
|
const show = condition(cur);
|
|
424
|
+
console.debug("Form:if", props.id, !show);
|
|
425
|
+
const shouldUpdate = hidden !== show;
|
|
423
426
|
setHidden(!show);
|
|
424
|
-
|
|
427
|
+
const origin = originShouldUpdate ? typeof originShouldUpdate === "boolean" ? originShouldUpdate : originShouldUpdate(prev, cur, {}) : true;
|
|
428
|
+
return shouldUpdate || origin;
|
|
425
429
|
};
|
|
426
430
|
delete propsCopy.if;
|
|
427
431
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -404,10 +404,14 @@ function FormItem(props) {
|
|
|
404
404
|
}
|
|
405
405
|
if (propsCopy.if) {
|
|
406
406
|
const condition = propsCopy.if;
|
|
407
|
-
propsCopy.shouldUpdate
|
|
407
|
+
const originShouldUpdate = propsCopy.shouldUpdate;
|
|
408
|
+
propsCopy.shouldUpdate = (prev, cur) => {
|
|
408
409
|
const show = condition(cur);
|
|
410
|
+
console.debug("Form:if", props.id, !show);
|
|
411
|
+
const shouldUpdate = hidden !== show;
|
|
409
412
|
setHidden(!show);
|
|
410
|
-
|
|
413
|
+
const origin = originShouldUpdate ? typeof originShouldUpdate === "boolean" ? originShouldUpdate : originShouldUpdate(prev, cur, {}) : true;
|
|
414
|
+
return shouldUpdate || origin;
|
|
411
415
|
};
|
|
412
416
|
delete propsCopy.if;
|
|
413
417
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.3-beta.
|
|
3
|
+
"version": "0.0.3-beta.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lodash-es": "*",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-dom": "*",
|
|
31
|
-
"@faasjs/react": "^0.0.3-beta.
|
|
31
|
+
"@faasjs/react": "^0.0.3-beta.8",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|