@sheinx/hooks 3.5.2-beta.6 → 3.5.2-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/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 -0
- package/cjs/components/use-form/use-form.js +1 -1
- 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 -0
- package/esm/components/use-form/use-form.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;
|
|
1
|
+
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAyJpC,CAAC,YAAY,GAAG,EAAE;;;;;EAkDrD"}
|
|
@@ -115,6 +115,9 @@ function useFormControl(props) {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
setValueState(nextValue);
|
|
118
|
+
formFunc === null || formFunc === void 0 || formFunc.setValue(_defineProperty({}, name, nextValue), {
|
|
119
|
+
validate: false
|
|
120
|
+
});
|
|
118
121
|
} else {
|
|
119
122
|
var _value2 = getValue(name, formValue);
|
|
120
123
|
var _error2 = getError(name, errors, severErrors);
|
|
@@ -124,6 +127,9 @@ function useFormControl(props) {
|
|
|
124
127
|
if (!(0, _shallowEqual.shallowEqual)(_value2, latestInfo.valueState)) {
|
|
125
128
|
if (_value2 === undefined && defaultValue !== undefined) {
|
|
126
129
|
setValueState(defaultValue);
|
|
130
|
+
formFunc === null || formFunc === void 0 || formFunc.setValue(_defineProperty({}, name, defaultValue), {
|
|
131
|
+
validate: false
|
|
132
|
+
});
|
|
127
133
|
} else {
|
|
128
134
|
setValueState(_value2);
|
|
129
135
|
}
|
|
@@ -368,9 +368,9 @@ var useForm = function useForm(props) {
|
|
|
368
368
|
onChange(function (v) {
|
|
369
369
|
(0, _utils.deepSet)(v, n, df, deepSetOptions);
|
|
370
370
|
});
|
|
371
|
+
update(n);
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
|
-
update(n);
|
|
374
374
|
},
|
|
375
375
|
unbind: function unbind(n, reserveAble, validateFiled, update) {
|
|
376
376
|
var validateFieldSet = context.validateMap[n];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;
|
|
1
|
+
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAyJpC,CAAC,YAAY,GAAG,EAAE;;;;;EAkDrD"}
|
|
@@ -106,6 +106,9 @@ export default function useFormControl(props) {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
setValueState(nextValue);
|
|
109
|
+
formFunc === null || formFunc === void 0 || formFunc.setValue(_defineProperty({}, name, nextValue), {
|
|
110
|
+
validate: false
|
|
111
|
+
});
|
|
109
112
|
} else {
|
|
110
113
|
var _value2 = getValue(name, formValue);
|
|
111
114
|
var _error2 = getError(name, errors, severErrors);
|
|
@@ -115,6 +118,9 @@ export default function useFormControl(props) {
|
|
|
115
118
|
if (!shallowEqual(_value2, latestInfo.valueState)) {
|
|
116
119
|
if (_value2 === undefined && defaultValue !== undefined) {
|
|
117
120
|
setValueState(defaultValue);
|
|
121
|
+
formFunc === null || formFunc === void 0 || formFunc.setValue(_defineProperty({}, name, defaultValue), {
|
|
122
|
+
validate: false
|
|
123
|
+
});
|
|
118
124
|
} else {
|
|
119
125
|
setValueState(_value2);
|
|
120
126
|
}
|
|
@@ -359,9 +359,9 @@ var useForm = function useForm(props) {
|
|
|
359
359
|
onChange(function (v) {
|
|
360
360
|
deepSet(v, n, df, deepSetOptions);
|
|
361
361
|
});
|
|
362
|
+
update(n);
|
|
362
363
|
});
|
|
363
364
|
}
|
|
364
|
-
update(n);
|
|
365
365
|
},
|
|
366
366
|
unbind: function unbind(n, reserveAble, validateFiled, update) {
|
|
367
367
|
var validateFieldSet = context.validateMap[n];
|