@juantroconisf/lib 9.0.0 → 9.1.0
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 +16 -8
- package/dist/index.mjs +16 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -127,8 +127,7 @@ var translations = {
|
|
|
127
127
|
uuid: "Enter a valid UUID",
|
|
128
128
|
trim: "Remove leading/trailing spaces",
|
|
129
129
|
lowercase: "Must be in lowercase",
|
|
130
|
-
uppercase: "Must be in uppercase"
|
|
131
|
-
password: "Your password doesn't meet the security criteria."
|
|
130
|
+
uppercase: "Must be in uppercase"
|
|
132
131
|
},
|
|
133
132
|
number: {
|
|
134
133
|
min: "Value must be ${min} or greater",
|
|
@@ -174,8 +173,7 @@ var translations = {
|
|
|
174
173
|
uuid: "Ingresa un UUID v\xE1lido",
|
|
175
174
|
trim: "No debe contener espacios al inicio o final",
|
|
176
175
|
lowercase: "Debe estar en min\xFAsculas",
|
|
177
|
-
uppercase: "Debe estar en may\xFAsculas"
|
|
178
|
-
password: "Tu contrase\xF1a no cumple con los requisitos de seguridad."
|
|
176
|
+
uppercase: "Debe estar en may\xFAsculas"
|
|
179
177
|
},
|
|
180
178
|
number: {
|
|
181
179
|
min: "Debe ser mayor o igual a ${min}",
|
|
@@ -207,15 +205,16 @@ var translations = {
|
|
|
207
205
|
// src/hooks/useComponentLang.tsx
|
|
208
206
|
var cookieName = "LOCALE";
|
|
209
207
|
var getClientCookie = () => {
|
|
208
|
+
if (typeof document === "undefined") return "en";
|
|
210
209
|
const value = "; " + document.cookie, decodedValue = decodeURIComponent(value), parts = decodedValue.split("; " + cookieName + "=");
|
|
211
210
|
if (parts.length === 2) return parts.pop()?.split(";").shift();
|
|
212
211
|
};
|
|
212
|
+
var initialLocale = getClientCookie() || "en";
|
|
213
|
+
(0, import_yup.setLocale)(translations[initialLocale] || translations.en);
|
|
213
214
|
function useComponentLanguage() {
|
|
214
215
|
(0, import_react.useEffect)(() => {
|
|
215
216
|
const locale = getClientCookie() || "en";
|
|
216
|
-
|
|
217
|
-
(0, import_yup.setLocale)(translations[locale]);
|
|
218
|
-
}
|
|
217
|
+
(0, import_yup.setLocale)(translations[locale] || translations.en);
|
|
219
218
|
}, []);
|
|
220
219
|
}
|
|
221
220
|
|
|
@@ -843,7 +842,16 @@ function useForm(schema, {
|
|
|
843
842
|
}
|
|
844
843
|
onSubmit?.(stateRef.current, e);
|
|
845
844
|
};
|
|
846
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
846
|
+
import_react3.Form,
|
|
847
|
+
{
|
|
848
|
+
style: {
|
|
849
|
+
display: "contents"
|
|
850
|
+
},
|
|
851
|
+
onSubmit: handleSubmit,
|
|
852
|
+
...rest
|
|
853
|
+
}
|
|
854
|
+
);
|
|
847
855
|
};
|
|
848
856
|
}, []);
|
|
849
857
|
return (0, import_react2.useMemo)(
|
package/dist/index.mjs
CHANGED
|
@@ -101,8 +101,7 @@ var translations = {
|
|
|
101
101
|
uuid: "Enter a valid UUID",
|
|
102
102
|
trim: "Remove leading/trailing spaces",
|
|
103
103
|
lowercase: "Must be in lowercase",
|
|
104
|
-
uppercase: "Must be in uppercase"
|
|
105
|
-
password: "Your password doesn't meet the security criteria."
|
|
104
|
+
uppercase: "Must be in uppercase"
|
|
106
105
|
},
|
|
107
106
|
number: {
|
|
108
107
|
min: "Value must be ${min} or greater",
|
|
@@ -148,8 +147,7 @@ var translations = {
|
|
|
148
147
|
uuid: "Ingresa un UUID v\xE1lido",
|
|
149
148
|
trim: "No debe contener espacios al inicio o final",
|
|
150
149
|
lowercase: "Debe estar en min\xFAsculas",
|
|
151
|
-
uppercase: "Debe estar en may\xFAsculas"
|
|
152
|
-
password: "Tu contrase\xF1a no cumple con los requisitos de seguridad."
|
|
150
|
+
uppercase: "Debe estar en may\xFAsculas"
|
|
153
151
|
},
|
|
154
152
|
number: {
|
|
155
153
|
min: "Debe ser mayor o igual a ${min}",
|
|
@@ -181,15 +179,16 @@ var translations = {
|
|
|
181
179
|
// src/hooks/useComponentLang.tsx
|
|
182
180
|
var cookieName = "LOCALE";
|
|
183
181
|
var getClientCookie = () => {
|
|
182
|
+
if (typeof document === "undefined") return "en";
|
|
184
183
|
const value = "; " + document.cookie, decodedValue = decodeURIComponent(value), parts = decodedValue.split("; " + cookieName + "=");
|
|
185
184
|
if (parts.length === 2) return parts.pop()?.split(";").shift();
|
|
186
185
|
};
|
|
186
|
+
var initialLocale = getClientCookie() || "en";
|
|
187
|
+
setLocale(translations[initialLocale] || translations.en);
|
|
187
188
|
function useComponentLanguage() {
|
|
188
189
|
useEffect(() => {
|
|
189
190
|
const locale = getClientCookie() || "en";
|
|
190
|
-
|
|
191
|
-
setLocale(translations[locale]);
|
|
192
|
-
}
|
|
191
|
+
setLocale(translations[locale] || translations.en);
|
|
193
192
|
}, []);
|
|
194
193
|
}
|
|
195
194
|
|
|
@@ -817,7 +816,16 @@ function useForm(schema, {
|
|
|
817
816
|
}
|
|
818
817
|
onSubmit?.(stateRef.current, e);
|
|
819
818
|
};
|
|
820
|
-
return /* @__PURE__ */ jsx(
|
|
819
|
+
return /* @__PURE__ */ jsx(
|
|
820
|
+
Form,
|
|
821
|
+
{
|
|
822
|
+
style: {
|
|
823
|
+
display: "contents"
|
|
824
|
+
},
|
|
825
|
+
onSubmit: handleSubmit,
|
|
826
|
+
...rest
|
|
827
|
+
}
|
|
828
|
+
);
|
|
821
829
|
};
|
|
822
830
|
}, []);
|
|
823
831
|
return useMemo(
|