@mw-kit/mw-ui 1.7.43 → 1.7.45

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
@@ -15203,7 +15203,10 @@ var Component = React__default.forwardRef(function (props, ref) {
15203
15203
  var value = props.value,
15204
15204
  setValue = props.setValue;
15205
15205
 
15206
- var _useState = React.useState(''),
15206
+ var _useState = React.useState(!value ? '' : function () {
15207
+ var details = getPhoneDetails(value);
15208
+ return details ? details.masked : value;
15209
+ }),
15207
15210
  inputValue = _useState[0],
15208
15211
  setInputValue = _useState[1];
15209
15212
 
@@ -15260,7 +15263,7 @@ var Component = React__default.forwardRef(function (props, ref) {
15260
15263
  }, [country]);
15261
15264
  React.useEffect(function () {
15262
15265
  var v = inputValue.replace(/\D+/g, '').substring(0, country.charLimit);
15263
- setValue(country.ddi + " " + v);
15266
+ setValue(v ? country.ddi + " " + v : v);
15264
15267
  }, [inputValue]);
15265
15268
  var placeholder = props.placeholder && props.placeholder[country.iso] ? props.placeholder[country.iso] : country.placeholder;
15266
15269
  return React__default.createElement(RelativeContainer$3, {