@mw-kit/mw-ui 1.6.13 → 1.6.15

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.
@@ -12644,7 +12644,7 @@ var Input = styled.input(_templateObject3$a || (_templateObject3$a = _taggedTemp
12644
12644
  var theme = _ref10.theme,
12645
12645
  invalid = _ref10.invalid;
12646
12646
  var color = invalid ? theme.getColor('warningRed', 5) : theme.colors.white;
12647
- return css(_templateObject7$4 || (_templateObject7$4 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n /** google chrome blue background */\n -webkit-box-shadow: 0 0 0px 1000px ", "; inset !important;\n "])), color, color);
12647
+ return css(_templateObject7$4 || (_templateObject7$4 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n /** google chrome blue background */\n -webkit-box-shadow: 0 0 0px 1000px ", " inset !important;\n "])), color, color);
12648
12648
  }, function (_ref11) {
12649
12649
  var arrows = _ref11.arrows;
12650
12650
  if (arrows) return;
@@ -14365,10 +14365,6 @@ var Component = React__default.forwardRef(function (props, ref) {
14365
14365
  open = _useState3[0],
14366
14366
  setOpen = _useState3[1];
14367
14367
 
14368
- useEffect(function () {
14369
- var details = getPhoneDetails(value || '');
14370
- setCountry(details ? details.country : countries.br);
14371
- }, [value]);
14372
14368
  var options = Object.keys(countries).map(function (iso) {
14373
14369
  return {
14374
14370
  label: {
@@ -14391,8 +14387,20 @@ var Component = React__default.forwardRef(function (props, ref) {
14391
14387
  };
14392
14388
 
14393
14389
  useEffect(function () {
14394
- var details = getPhoneDetails(value || '');
14395
- setCountry(details ? details.country : countries.br);
14390
+ if (!value) {
14391
+ setInputValue('');
14392
+ return;
14393
+ }
14394
+
14395
+ var details = getPhoneDetails(value);
14396
+
14397
+ if (details) {
14398
+ setCountry(details.country);
14399
+ setInputValue(details.masked);
14400
+ } else {
14401
+ setCountry(countries.br);
14402
+ setInputValue(value);
14403
+ }
14396
14404
  }, [value]);
14397
14405
  useEffect(function () {
14398
14406
  setInputValue(function (prev) {