kui-complex 0.0.48 → 0.0.50
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/InputPassword/cjs/index.js +1 -9
- package/InputPassword/cjs/index.js.map +1 -1
- package/InputPassword/index.js +1 -9
- package/InputPassword/index.js.map +1 -1
- package/InputPhoneWithForm/cjs/index.js +9 -1
- package/InputPhoneWithForm/cjs/index.js.map +1 -1
- package/InputPhoneWithForm/index.js +10 -2
- package/InputPhoneWithForm/index.js.map +1 -1
- package/InputTextAreaMobile/cjs/index.js +1 -9
- package/InputTextAreaMobile/cjs/index.js.map +1 -1
- package/InputTextAreaMobile/index.js +1 -9
- package/InputTextAreaMobile/index.js.map +1 -1
- package/InputWithController/cjs/index.js +1 -9
- package/InputWithController/cjs/index.js.map +1 -1
- package/InputWithController/index.d.ts +1 -1
- package/InputWithController/index.js +1 -9
- package/InputWithController/index.js.map +1 -1
- package/TestForm/cjs/index.js +10 -10
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +10 -10
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +10 -10
- package/cjs/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
package/TestForm/index.js
CHANGED
|
@@ -65,14 +65,6 @@ var InputWithController = forwardRef(function (_a, ref) {
|
|
|
65
65
|
inputProps.onChange(e);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
var forwardedRef = function (elem, field) {
|
|
69
|
-
if (ref) {
|
|
70
|
-
// eslint-disable-next-line no-param-reassign
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
ref.current = elem;
|
|
73
|
-
}
|
|
74
|
-
field.ref(elem);
|
|
75
|
-
};
|
|
76
68
|
var getError = function (fieldState) {
|
|
77
69
|
var _a;
|
|
78
70
|
return typeof error !== "undefined" && String(error).length > 0
|
|
@@ -83,7 +75,7 @@ var InputWithController = forwardRef(function (_a, ref) {
|
|
|
83
75
|
var field = _a.field, fieldState = _a.fieldState;
|
|
84
76
|
return (jsx(InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
85
77
|
return handleChange(e, field);
|
|
86
|
-
}, value: typeof value !== "undefined" ? value : field.value || "",
|
|
78
|
+
}, value: typeof value !== "undefined" ? value : field.value || "", inputRef: ref })));
|
|
87
79
|
} }));
|
|
88
80
|
});
|
|
89
81
|
|
|
@@ -546,9 +538,17 @@ var InputPhoneWithForm = forwardRef(function (props, ref) {
|
|
|
546
538
|
}
|
|
547
539
|
phoneRegister.field.ref(elem);
|
|
548
540
|
};
|
|
541
|
+
useEffect(function () {
|
|
542
|
+
if (!codeRegister.field.value) {
|
|
543
|
+
codeRegister.field.onChange({
|
|
544
|
+
target: { value: "7", name: "".concat(name, ".phoneCode") },
|
|
545
|
+
type: "change",
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}, []);
|
|
549
549
|
return (jsx(InputWithCountryDropdown, __assign({ message: errorMessage,
|
|
550
550
|
// @ts-ignore
|
|
551
|
-
hiddenInputProps: __assign(__assign({}, codeRegister.field), hiddenInputProps), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
|
|
551
|
+
hiddenInputProps: __assign(__assign(__assign({}, codeRegister.field), hiddenInputProps), { value: codeRegister.field.value || "7" }), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
|
|
552
552
|
});
|
|
553
553
|
InputPhoneWithForm.defaultProps = {
|
|
554
554
|
name: "phone",
|