@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.
package/dist/index.js CHANGED
@@ -12647,7 +12647,7 @@ var Input = styled__default.input(_templateObject3$a || (_templateObject3$a = _t
12647
12647
  var theme = _ref10.theme,
12648
12648
  invalid = _ref10.invalid;
12649
12649
  var color = invalid ? theme.getColor('warningRed', 5) : theme.colors.white;
12650
- return styled.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);
12650
+ return styled.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);
12651
12651
  }, function (_ref11) {
12652
12652
  var arrows = _ref11.arrows;
12653
12653
  if (arrows) return;
@@ -14368,10 +14368,6 @@ var Component = React__default.forwardRef(function (props, ref) {
14368
14368
  open = _useState3[0],
14369
14369
  setOpen = _useState3[1];
14370
14370
 
14371
- React.useEffect(function () {
14372
- var details = getPhoneDetails(value || '');
14373
- setCountry(details ? details.country : countries.br);
14374
- }, [value]);
14375
14371
  var options = Object.keys(countries).map(function (iso) {
14376
14372
  return {
14377
14373
  label: {
@@ -14394,8 +14390,20 @@ var Component = React__default.forwardRef(function (props, ref) {
14394
14390
  };
14395
14391
 
14396
14392
  React.useEffect(function () {
14397
- var details = getPhoneDetails(value || '');
14398
- setCountry(details ? details.country : countries.br);
14393
+ if (!value) {
14394
+ setInputValue('');
14395
+ return;
14396
+ }
14397
+
14398
+ var details = getPhoneDetails(value);
14399
+
14400
+ if (details) {
14401
+ setCountry(details.country);
14402
+ setInputValue(details.masked);
14403
+ } else {
14404
+ setCountry(countries.br);
14405
+ setInputValue(value);
14406
+ }
14399
14407
  }, [value]);
14400
14408
  React.useEffect(function () {
14401
14409
  setInputValue(function (prev) {