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.
@@ -94,14 +94,6 @@ var InputWithController = react.forwardRef(function (_a, ref) {
94
94
  inputProps.onChange(e);
95
95
  }
96
96
  };
97
- var forwardedRef = function (elem, field) {
98
- if (ref) {
99
- // eslint-disable-next-line no-param-reassign
100
- // @ts-ignore
101
- ref.current = elem;
102
- }
103
- field.ref(elem);
104
- };
105
97
  var getError = function (fieldState) {
106
98
  var _a;
107
99
  return typeof error !== "undefined" && String(error).length > 0
@@ -112,7 +104,7 @@ var InputWithController = react.forwardRef(function (_a, ref) {
112
104
  var field = _a.field, fieldState = _a.fieldState;
113
105
  return (jsxRuntime.jsx(kuiBasic.InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
114
106
  return handleChange(e, field);
115
- }, value: typeof value !== "undefined" ? value : field.value || "", ref: function (e) { return forwardedRef(e, field); } })));
107
+ }, value: typeof value !== "undefined" ? value : field.value || "", inputRef: ref })));
116
108
  } }));
117
109
  });
118
110
 
@@ -575,9 +567,17 @@ var InputPhoneWithForm = react.forwardRef(function (props, ref) {
575
567
  }
576
568
  phoneRegister.field.ref(elem);
577
569
  };
570
+ react.useEffect(function () {
571
+ if (!codeRegister.field.value) {
572
+ codeRegister.field.onChange({
573
+ target: { value: "7", name: "".concat(name, ".phoneCode") },
574
+ type: "change",
575
+ });
576
+ }
577
+ }, []);
578
578
  return (jsxRuntime.jsx(kuiBasic.InputWithCountryDropdown, __assign({ message: errorMessage,
579
579
  // @ts-ignore
580
- hiddenInputProps: __assign(__assign({}, codeRegister.field), hiddenInputProps), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
580
+ hiddenInputProps: __assign(__assign(__assign({}, codeRegister.field), hiddenInputProps), { value: codeRegister.field.value || "7" }), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
581
581
  });
582
582
  InputPhoneWithForm.defaultProps = {
583
583
  name: "phone",