@faasjs/ant-design 0.0.3-beta.7 → 0.0.3-beta.9

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 CHANGED
@@ -418,12 +418,16 @@ function FormItem(props) {
418
418
  }
419
419
  if (propsCopy.if) {
420
420
  const condition = propsCopy.if;
421
- propsCopy.shouldUpdate = (_, cur) => {
421
+ const originShouldUpdate = propsCopy.shouldUpdate;
422
+ propsCopy.shouldUpdate = (prev, cur) => {
422
423
  const show = condition(cur);
424
+ const shouldUpdate = hidden !== show;
423
425
  setHidden(!show);
424
- return show;
426
+ const origin = originShouldUpdate ? typeof originShouldUpdate === "boolean" ? originShouldUpdate : originShouldUpdate(prev, cur, {}) : true;
427
+ return shouldUpdate || origin;
425
428
  };
426
429
  delete propsCopy.if;
430
+ delete propsCopy.hidden;
427
431
  }
428
432
  setComputedProps(processProps(propsCopy, common2));
429
433
  }, [props]);
package/dist/index.mjs CHANGED
@@ -404,12 +404,16 @@ function FormItem(props) {
404
404
  }
405
405
  if (propsCopy.if) {
406
406
  const condition = propsCopy.if;
407
- propsCopy.shouldUpdate = (_, cur) => {
407
+ const originShouldUpdate = propsCopy.shouldUpdate;
408
+ propsCopy.shouldUpdate = (prev, cur) => {
408
409
  const show = condition(cur);
410
+ const shouldUpdate = hidden !== show;
409
411
  setHidden(!show);
410
- return show;
412
+ const origin = originShouldUpdate ? typeof originShouldUpdate === "boolean" ? originShouldUpdate : originShouldUpdate(prev, cur, {}) : true;
413
+ return shouldUpdate || origin;
411
414
  };
412
415
  delete propsCopy.if;
416
+ delete propsCopy.hidden;
413
417
  }
414
418
  setComputedProps(processProps(propsCopy, common2));
415
419
  }, [props]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.7",
3
+ "version": "0.0.3-beta.9",
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.7",
31
+ "@faasjs/react": "^0.0.3-beta.9",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },