@mw-kit/mw-ui 1.6.14 → 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 +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +14 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -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
|
-
|
|
14395
|
-
|
|
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) {
|