indicator-ui 0.0.82 → 0.0.84
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
CHANGED
|
@@ -6276,7 +6276,7 @@ function useFormData(value) {
|
|
|
6276
6276
|
const [formData, setFormData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value || {});
|
|
6277
6277
|
const formDataRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value || {});
|
|
6278
6278
|
const setValue = (value, keyWay, options = { unionToArray: false }) => {
|
|
6279
|
-
|
|
6279
|
+
const proccessFun = (prevState) => {
|
|
6280
6280
|
let newValue = value;
|
|
6281
6281
|
if (options.unionToArray) {
|
|
6282
6282
|
const curValue = (0,_lib__WEBPACK_IMPORTED_MODULE_1__.getDeepValue)(prevState, keyWay);
|
|
@@ -6304,7 +6304,9 @@ function useFormData(value) {
|
|
|
6304
6304
|
const newState = { ...(0,_lib__WEBPACK_IMPORTED_MODULE_1__.setDeepValue)(prevState, newValue, { keysWay: keyWay }) };
|
|
6305
6305
|
formDataRef.current = newState;
|
|
6306
6306
|
return newState;
|
|
6307
|
-
}
|
|
6307
|
+
};
|
|
6308
|
+
formDataRef.current = proccessFun(formDataRef.current);
|
|
6309
|
+
setFormData(proccessFun);
|
|
6308
6310
|
};
|
|
6309
6311
|
const getValue = (keyWay) => {
|
|
6310
6312
|
return (0,_lib__WEBPACK_IMPORTED_MODULE_1__.getDeepValue)(formDataRef.current, keyWay);
|
|
@@ -8485,8 +8487,9 @@ const getValidateFunResponse = (value, fun) => {
|
|
|
8485
8487
|
}
|
|
8486
8488
|
return { status: res, message: '' };
|
|
8487
8489
|
};
|
|
8488
|
-
const getValidateFun = ({ validationProps, keyWay,
|
|
8490
|
+
const getValidateFun = ({ validationProps, keyWay, getValue, schemeRequired, addError, removeError, }) => {
|
|
8489
8491
|
return () => {
|
|
8492
|
+
const value = getValue(keyWay);
|
|
8490
8493
|
let required = schemeRequired;
|
|
8491
8494
|
let fun = () => true;
|
|
8492
8495
|
if (validationProps && 'required' in validationProps && validationProps.required !== undefined) {
|
|
@@ -8510,10 +8513,9 @@ const getValidateFun = ({ validationProps, keyWay, value, schemeRequired, addErr
|
|
|
8510
8513
|
const getOnBlurValidation = (schema, additionProps, keyWay) => {
|
|
8511
8514
|
const props = schema.props.onBlurValidation || schema.props.onChangeValidation;
|
|
8512
8515
|
if (props || schema.props.required) {
|
|
8513
|
-
const value = additionProps.getValue(keyWay);
|
|
8514
8516
|
return getValidateFun({
|
|
8515
8517
|
validationProps: props,
|
|
8516
|
-
|
|
8518
|
+
getValue: additionProps.getValue,
|
|
8517
8519
|
keyWay: keyWay,
|
|
8518
8520
|
schemeRequired: schema.props.required || false,
|
|
8519
8521
|
removeError: additionProps.removeErrorField,
|
|
@@ -8528,10 +8530,9 @@ const getOnChangeValidation = (schema, additionProps, keyWay) => {
|
|
|
8528
8530
|
props = { fun: () => true };
|
|
8529
8531
|
}
|
|
8530
8532
|
if (props || schema.props.required) {
|
|
8531
|
-
const value = additionProps.getValue(keyWay);
|
|
8532
8533
|
return getValidateFun({
|
|
8533
8534
|
validationProps: props,
|
|
8534
|
-
|
|
8535
|
+
getValue: additionProps.getValue,
|
|
8535
8536
|
keyWay: keyWay,
|
|
8536
8537
|
schemeRequired: schema.props.required || false,
|
|
8537
8538
|
removeError: additionProps.removeOnChangeErrorField,
|
|
@@ -9628,7 +9629,7 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
|
|
|
9628
9629
|
}
|
|
9629
9630
|
if (autoClose) {
|
|
9630
9631
|
setIsShowModalWindow(false);
|
|
9631
|
-
|
|
9632
|
+
onBlur && onBlur();
|
|
9632
9633
|
}
|
|
9633
9634
|
};
|
|
9634
9635
|
const getViewField = () => {
|
|
@@ -9649,7 +9650,7 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
|
|
|
9649
9650
|
setIsShowModalWindow(true);
|
|
9650
9651
|
}, onBlur: () => {
|
|
9651
9652
|
setIsFocus(false);
|
|
9652
|
-
onBlur && onBlur()
|
|
9653
|
+
// onBlur && onBlur()
|
|
9653
9654
|
}, onDropdownClick: () => setIsShowModalWindow(prevState => !prevState), isError: isError, placeholder: placeholder, dropdown: true, dropdownState: isShowModalWindow, ref: inputRef, ...props });
|
|
9654
9655
|
}
|
|
9655
9656
|
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FlexField__WEBPACK_IMPORTED_MODULE_2__.FlexField, { value: (0,_lib__WEBPACK_IMPORTED_MODULE_3__.getStringValue)(value, optionsCacheRef.current), isError: isError, disabled: disabled, placeholder: placeholder, notInput: true, onClick: () => setIsShowModalWindow(prevState => !prevState), dropdown: true, dropdownState: isShowModalWindow, ref: inputRef, ...props });
|