@sheinx/hooks 3.6.7-beta.3 → 3.6.7-beta.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA2BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAiJpC,CAAC,YAAY,GAAG,EAAE;;;;;EAwDrD"}
1
+ {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA2BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAiJpC,CAAC,YAAY,GAAG,EAAE;;;;;EA4DrD"}
@@ -226,10 +226,14 @@ function useFormControl(props) {
226
226
  if ((0, _is.isArray)(name)) {
227
227
  var dv = (0, _is.isArray)(defaultValue) ? defaultValue : [];
228
228
  name.forEach(function (n, index) {
229
- controlFunc.bind(n, dv[index], validateField, update);
229
+ var v = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(n);
230
+ var bindedValue = v === undefined ? dv[index] : v;
231
+ controlFunc.bind(n, context.mounted ? bindedValue : dv[index], validateField, update);
230
232
  });
231
233
  } else {
232
- controlFunc.bind(name, defaultValue, validateField, update);
234
+ var v = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
235
+ var bindedValue = v === undefined ? defaultValue : v;
236
+ controlFunc.bind(name, context.mounted ? bindedValue : defaultValue, validateField, update);
233
237
  }
234
238
  if (context.mounted) {
235
239
  _warning.devUseWarning.warn('Please avoid modifying the name property after the component has mounted, as this may result in unintended behavior or errors.');
@@ -644,7 +644,7 @@ var useTree = function useTree(props) {
644
644
  updateExpanded(nextExpanded);
645
645
  }
646
646
  updateInnerCheckStatus();
647
- }, [data]);
647
+ }, [props.data]);
648
648
  (0, _react.useEffect)(function () {
649
649
  if (props.datum) return;
650
650
  setValue(value);
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA2BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAiJpC,CAAC,YAAY,GAAG,EAAE;;;;;EAwDrD"}
1
+ {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA2BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAiJpC,CAAC,YAAY,GAAG,EAAE;;;;;EA4DrD"}
@@ -217,10 +217,14 @@ export default function useFormControl(props) {
217
217
  if (isArray(name)) {
218
218
  var dv = isArray(defaultValue) ? defaultValue : [];
219
219
  name.forEach(function (n, index) {
220
- controlFunc.bind(n, dv[index], validateField, update);
220
+ var v = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(n);
221
+ var bindedValue = v === undefined ? dv[index] : v;
222
+ controlFunc.bind(n, context.mounted ? bindedValue : dv[index], validateField, update);
221
223
  });
222
224
  } else {
223
- controlFunc.bind(name, defaultValue, validateField, update);
225
+ var v = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
226
+ var bindedValue = v === undefined ? defaultValue : v;
227
+ controlFunc.bind(name, context.mounted ? bindedValue : defaultValue, validateField, update);
224
228
  }
225
229
  if (context.mounted) {
226
230
  devUseWarning.warn('Please avoid modifying the name property after the component has mounted, as this may result in unintended behavior or errors.');
@@ -637,7 +637,7 @@ var useTree = function useTree(props) {
637
637
  updateExpanded(nextExpanded);
638
638
  }
639
639
  updateInnerCheckStatus();
640
- }, [data]);
640
+ }, [props.data]);
641
641
  useEffect(function () {
642
642
  if (props.datum) return;
643
643
  setValue(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.6.7-beta.3",
3
+ "version": "3.6.7-beta.5",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",