@onesy/ui-react 1.0.115 → 1.0.116
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/esm/index.js +1 -1
- package/esm/useForm/useForm.js +2 -2
- package/esm/useForm/validate.js +1 -1
- package/package.json +1 -1
- package/useForm/useForm.js +2 -2
- package/useForm/validate.js +1 -1
package/esm/index.js
CHANGED
package/esm/useForm/useForm.js
CHANGED
|
@@ -80,7 +80,7 @@ const useForm = props => {
|
|
|
80
80
|
// Validate the property
|
|
81
81
|
if (property.required && property.value === undefined) {
|
|
82
82
|
const name = is('function', property.propertyNameUpdate) ? property.propertyNameUpdate(property.name) : property.capitalize !== false ? capitalize(property.name) : property.name;
|
|
83
|
-
property.error = `${name} ${l('is required')}`;
|
|
83
|
+
property.error = `${l(name)} ${l('is required')}`;
|
|
84
84
|
} else {
|
|
85
85
|
property.error = undefined;
|
|
86
86
|
|
|
@@ -133,7 +133,7 @@ const useForm = props => {
|
|
|
133
133
|
// Validate the property
|
|
134
134
|
if (property.required && property.value === undefined) {
|
|
135
135
|
const name = is('function', property.propertyNameUpdate) ? property.propertyNameUpdate(property.name) : property.capitalize !== false ? capitalize(property.name) : property.name;
|
|
136
|
-
property.error = `${name} ${l('is required')}`;
|
|
136
|
+
property.error = `${l(name)} ${l('is required')}`;
|
|
137
137
|
} else {
|
|
138
138
|
property.error = undefined;
|
|
139
139
|
|
package/esm/useForm/validate.js
CHANGED
|
@@ -19,7 +19,7 @@ const validate = async (model, property, form, options_) => {
|
|
|
19
19
|
parse: true
|
|
20
20
|
});
|
|
21
21
|
const l = options?.l || (item => item);
|
|
22
|
-
const name = is('function', model.propertyNameUpdate) ? model.propertyNameUpdate(model.name) : model.capitalize !== false ? capitalize(model.name) : model.name;
|
|
22
|
+
const name = l(is('function', model.propertyNameUpdate) ? model.propertyNameUpdate(model.name) : model.capitalize !== false ? capitalize(model.name) : model.name);
|
|
23
23
|
const value = model.value;
|
|
24
24
|
|
|
25
25
|
// value validate
|
package/package.json
CHANGED
package/useForm/useForm.js
CHANGED
|
@@ -71,7 +71,7 @@ const useForm = (props) => {
|
|
|
71
71
|
// Validate the property
|
|
72
72
|
if (property.required && property.value === undefined) {
|
|
73
73
|
const name = (0, utils_1.is)('function', property.propertyNameUpdate) ? property.propertyNameUpdate(property.name) : property.capitalize !== false ? (0, utils_1.capitalize)(property.name) : property.name;
|
|
74
|
-
property.error = `${name} ${l('is required')}`;
|
|
74
|
+
property.error = `${l(name)} ${l('is required')}`;
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
property.error = undefined;
|
|
@@ -122,7 +122,7 @@ const useForm = (props) => {
|
|
|
122
122
|
// Validate the property
|
|
123
123
|
if (property.required && property.value === undefined) {
|
|
124
124
|
const name = (0, utils_1.is)('function', property.propertyNameUpdate) ? property.propertyNameUpdate(property.name) : property.capitalize !== false ? (0, utils_1.capitalize)(property.name) : property.name;
|
|
125
|
-
property.error = `${name} ${l('is required')}`;
|
|
125
|
+
property.error = `${l(name)} ${l('is required')}`;
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
128
|
property.error = undefined;
|
package/useForm/validate.js
CHANGED
|
@@ -24,7 +24,7 @@ const validate = async (model, property, form, options_) => {
|
|
|
24
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
25
25
|
const options = (0, utils_1.merge)((options_ && (0, is_1.default)('object', options_)) ? options_ : {}, { uriDecode: true, parse: true });
|
|
26
26
|
const l = (options === null || options === void 0 ? void 0 : options.l) || (item => item);
|
|
27
|
-
const name = (0, is_1.default)('function', model.propertyNameUpdate) ? model.propertyNameUpdate(model.name) : model.capitalize !== false ? (0, utils_1.capitalize)(model.name) : model.name;
|
|
27
|
+
const name = l((0, is_1.default)('function', model.propertyNameUpdate) ? model.propertyNameUpdate(model.name) : model.capitalize !== false ? (0, utils_1.capitalize)(model.name) : model.name);
|
|
28
28
|
const value = model.value;
|
|
29
29
|
// value validate
|
|
30
30
|
// with options above
|