@pdg/react-form 1.0.97 → 1.0.98

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.esm.js CHANGED
@@ -3377,20 +3377,17 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
3377
3377
  * Function
3378
3378
  * ******************************************************************************************************************/
3379
3379
  var changeValue = useCallback(function (newValue) {
3380
- setValue(function (old) {
3381
- if (!equal(old, newValue)) {
3380
+ if (!equal(value, newValue)) {
3381
+ setValue(newValue);
3382
+ nextTick(function () {
3382
3383
  if (error)
3383
3384
  validate(newValue);
3384
3385
  if (onChange)
3385
3386
  onChange(newValue);
3386
3387
  onValueChange(name, newValue);
3387
- return newValue;
3388
- }
3389
- else {
3390
- return old;
3391
- }
3392
- });
3393
- }, [error, name, onChange, onValueChange, validate]);
3388
+ });
3389
+ }
3390
+ }, [error, name, onChange, onValueChange, validate, value]);
3394
3391
  /********************************************************************************************************************
3395
3392
  * Effect
3396
3393
  * ******************************************************************************************************************/
package/dist/index.js CHANGED
@@ -3377,20 +3377,17 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
3377
3377
  * Function
3378
3378
  * ******************************************************************************************************************/
3379
3379
  var changeValue = React.useCallback(function (newValue) {
3380
- setValue(function (old) {
3381
- if (!util.equal(old, newValue)) {
3380
+ if (!util.equal(value, newValue)) {
3381
+ setValue(newValue);
3382
+ util.nextTick(function () {
3382
3383
  if (error)
3383
3384
  validate(newValue);
3384
3385
  if (onChange)
3385
3386
  onChange(newValue);
3386
3387
  onValueChange(name, newValue);
3387
- return newValue;
3388
- }
3389
- else {
3390
- return old;
3391
- }
3392
- });
3393
- }, [error, name, onChange, onValueChange, validate]);
3388
+ });
3389
+ }
3390
+ }, [error, name, onChange, onValueChange, validate, value]);
3394
3391
  /********************************************************************************************************************
3395
3392
  * Effect
3396
3393
  * ******************************************************************************************************************/
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pdg/react-form",
3
3
  "title": "React Form",
4
- "version": "1.0.97",
4
+ "version": "1.0.98",
5
5
  "description": "React Form",
6
6
  "type": "module",
7
7
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "dev": "cd examples && npm run dev",
25
25
  "dev-prd-lib": "cd examples && npm run dev-prd-lib",
26
26
  "build": "rollup -c --bundleConfigAsCjs",
27
- "pub": "npm publish --access=public",
27
+ "pub": "npm i && npm run build && npm publish --access=public && rm ./.git/hooks/pre-commit",
28
28
  "lint": "eslint './src/**/*.{ts,tsx}'",
29
29
  "reinstall-module": "rm -rf node_modules && rm -f package-lock.json && npm i"
30
30
  },