@juantroconisf/lib 2.2.1 → 2.2.2
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.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -146,10 +146,10 @@ function useComponentLanguage() {
|
|
|
146
146
|
function useValidation() {
|
|
147
147
|
const { lang } = useComponentLanguage();
|
|
148
148
|
const getValidation = (value, isTouched, types, errorMessages) => {
|
|
149
|
-
const items = Object.entries(types), isRequired = items.
|
|
149
|
+
const items = Object.entries(types), isRequired = items.some(([key]) => key === "required");
|
|
150
150
|
if (isRequired && !isTouched)
|
|
151
151
|
return {
|
|
152
|
-
isValid:
|
|
152
|
+
isValid: true,
|
|
153
153
|
validationProps: nxError()
|
|
154
154
|
};
|
|
155
155
|
const validations = items.map(([name, opts]) => {
|
package/dist/index.mjs
CHANGED
|
@@ -128,10 +128,10 @@ function useComponentLanguage() {
|
|
|
128
128
|
function useValidation() {
|
|
129
129
|
const { lang } = useComponentLanguage();
|
|
130
130
|
const getValidation = (value, isTouched, types, errorMessages) => {
|
|
131
|
-
const items = Object.entries(types), isRequired = items.
|
|
131
|
+
const items = Object.entries(types), isRequired = items.some(([key]) => key === "required");
|
|
132
132
|
if (isRequired && !isTouched)
|
|
133
133
|
return {
|
|
134
|
-
isValid:
|
|
134
|
+
isValid: true,
|
|
135
135
|
validationProps: nxError()
|
|
136
136
|
};
|
|
137
137
|
const validations = items.map(([name, opts]) => {
|