@sheinx/hooks 3.6.7-beta.4 → 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.
- package/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-control/use-form-control.js +6 -2
- package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/esm/components/use-form/use-form-control/use-form-control.js +6 -2
- package/package.json +1 -1
@@ -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;;;;;
|
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
|
-
|
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
|
-
|
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.');
|
@@ -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;;;;;
|
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
|
-
|
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
|
-
|
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.');
|