react-hook-form 7.41.2 → 7.41.4
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/controller.d.ts +1 -1
- package/dist/controller.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +8 -9
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/logic/createFormControl.d.ts.map +1 -1
- package/dist/logic/updateFieldArrayRootError.d.ts +1 -1
- package/dist/logic/updateFieldArrayRootError.d.ts.map +1 -1
- package/dist/logic/validateField.d.ts.map +1 -1
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/form.d.ts +5 -5
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/path/eager.d.ts +5 -5
- package/dist/types/path/eager.d.ts.map +1 -1
- package/dist/types/utils.d.ts +0 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/tsdoc-metadata.json +0 -11
package/dist/index.esm.mjs
CHANGED
@@ -593,6 +593,12 @@ var isFileInput = (element) => element.type === 'file';
|
|
593
593
|
|
594
594
|
var isFunction = (value) => typeof value === 'function';
|
595
595
|
|
596
|
+
var isHTMLElement = (value) => {
|
597
|
+
const owner = value ? value.ownerDocument : 0;
|
598
|
+
return (value instanceof
|
599
|
+
(owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));
|
600
|
+
};
|
601
|
+
|
596
602
|
var isMessage = (value) => isString(value) || React.isValidElement(value);
|
597
603
|
|
598
604
|
var isRadioInput = (element) => element.type === 'radio';
|
@@ -675,8 +681,8 @@ var validateField = async (field, inputValue, validateAllFieldCriteria, shouldUs
|
|
675
681
|
const isEmpty = ((valueAsNumber || isFileInput(ref)) &&
|
676
682
|
isUndefined(ref.value) &&
|
677
683
|
isUndefined(inputValue)) ||
|
684
|
+
(isHTMLElement(ref) && ref.value === '') ||
|
678
685
|
inputValue === '' ||
|
679
|
-
ref.value === '' ||
|
680
686
|
(Array.isArray(inputValue) && !inputValue.length);
|
681
687
|
const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
|
682
688
|
const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
|
@@ -1203,12 +1209,6 @@ function deepEqual(object1, object2) {
|
|
1203
1209
|
return true;
|
1204
1210
|
}
|
1205
1211
|
|
1206
|
-
var isHTMLElement = (value) => {
|
1207
|
-
const owner = value ? value.ownerDocument : 0;
|
1208
|
-
return (value instanceof
|
1209
|
-
(owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));
|
1210
|
-
};
|
1211
|
-
|
1212
1212
|
var isMultipleSelect = (element) => element.type === `select-multiple`;
|
1213
1213
|
|
1214
1214
|
var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
|
@@ -1696,8 +1696,7 @@ function createFormControl(props = {}, flushRootRender) {
|
|
1696
1696
|
}
|
1697
1697
|
(options.shouldDirty || options.shouldTouch) &&
|
1698
1698
|
updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);
|
1699
|
-
options.shouldValidate &&
|
1700
|
-
trigger(name);
|
1699
|
+
options.shouldValidate && trigger(name);
|
1701
1700
|
};
|
1702
1701
|
const setValues = (name, value, options) => {
|
1703
1702
|
for (const fieldKey in value) {
|