indicator-ui 0.0.73 → 0.0.75
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 +20 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8482,7 +8482,7 @@ const getValidateFunResponse = (value, fun) => {
|
|
|
8482
8482
|
}
|
|
8483
8483
|
return { status: res, message: '' };
|
|
8484
8484
|
};
|
|
8485
|
-
const getValidateFun = (validationProps,
|
|
8485
|
+
const getValidateFun = ({ validationProps, keyWay, value, schemeRequired, addError, removeError, }) => {
|
|
8486
8486
|
return () => {
|
|
8487
8487
|
let required = schemeRequired;
|
|
8488
8488
|
let fun = () => true;
|
|
@@ -8506,20 +8506,34 @@ const getValidateFun = (validationProps, value, keyWay, schemeRequired, removeEr
|
|
|
8506
8506
|
};
|
|
8507
8507
|
const getOnBlurValidation = (schema, additionProps, keyWay) => {
|
|
8508
8508
|
const props = schema.props.onBlurValidation || schema.props.onChangeValidation;
|
|
8509
|
-
if (props) {
|
|
8509
|
+
if (props || schema.props.required) {
|
|
8510
8510
|
const value = additionProps.getValue(keyWay);
|
|
8511
|
-
return getValidateFun(
|
|
8511
|
+
return getValidateFun({
|
|
8512
|
+
validationProps: props,
|
|
8513
|
+
value: value,
|
|
8514
|
+
keyWay: keyWay,
|
|
8515
|
+
schemeRequired: schema.props.required || false,
|
|
8516
|
+
removeError: additionProps.removeErrorField,
|
|
8517
|
+
addError: additionProps.addErrorField
|
|
8518
|
+
});
|
|
8512
8519
|
}
|
|
8513
8520
|
return undefined;
|
|
8514
8521
|
};
|
|
8515
8522
|
const getOnChangeValidation = (schema, additionProps, keyWay) => {
|
|
8516
8523
|
let props = schema.props.onChangeValidation;
|
|
8517
8524
|
if (!props && schema.props.required === true) {
|
|
8518
|
-
props = { fun: (
|
|
8525
|
+
props = { fun: () => true };
|
|
8519
8526
|
}
|
|
8520
|
-
if (props) {
|
|
8527
|
+
if (props || schema.props.required) {
|
|
8521
8528
|
const value = additionProps.getValue(keyWay);
|
|
8522
|
-
return getValidateFun(
|
|
8529
|
+
return getValidateFun({
|
|
8530
|
+
validationProps: props,
|
|
8531
|
+
value: value,
|
|
8532
|
+
keyWay: keyWay,
|
|
8533
|
+
schemeRequired: schema.props.required || false,
|
|
8534
|
+
removeError: additionProps.removeOnChangeErrorField,
|
|
8535
|
+
addError: additionProps.addOnChangeErrorField
|
|
8536
|
+
});
|
|
8523
8537
|
}
|
|
8524
8538
|
return undefined;
|
|
8525
8539
|
};
|