@helpdice/ui 2.1.8 → 2.1.9

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.
Files changed (100) hide show
  1. package/dist/auto-complete/index.js +2147 -8
  2. package/dist/button/index.js +2 -2
  3. package/dist/carousal/index.js +2 -2
  4. package/dist/container/box.d.ts +42 -0
  5. package/dist/container/index.d.ts +2 -0
  6. package/dist/container/index.js +948 -0
  7. package/dist/copy-to-clipboard/clipboard.d.ts +13 -1
  8. package/dist/copy-to-clipboard/index.d.ts +1 -1
  9. package/dist/copy-to-clipboard/index.js +142 -157
  10. package/dist/grid/index.d.ts +2 -3
  11. package/dist/grid/index.js +0 -1
  12. package/dist/index.d.ts +3 -4
  13. package/dist/index.js +15389 -15350
  14. package/dist/input/index.d.ts +4 -0
  15. package/dist/input/index.js +2151 -9
  16. package/dist/input/phone-input/phone.d.ts +13 -0
  17. package/dist/modal/index.js +2 -2
  18. package/dist/placeholder/index.js +643 -8
  19. package/dist/table/index.js +3515 -1368
  20. package/dist/text/child.d.ts +1 -0
  21. package/dist/text/index.js +686 -8
  22. package/dist/text/text.d.ts +1 -0
  23. package/esm/button/button.js +2 -2
  24. package/esm/container/box.d.ts +42 -0
  25. package/esm/container/box.js +39 -0
  26. package/esm/container/index.d.ts +2 -0
  27. package/esm/container/index.js +2 -0
  28. package/esm/copy-to-clipboard/clipboard.d.ts +13 -1
  29. package/esm/copy-to-clipboard/clipboard.js +91 -0
  30. package/esm/copy-to-clipboard/index.d.ts +1 -1
  31. package/esm/copy-to-clipboard/index.js +1 -1
  32. package/esm/grid/index.d.ts +2 -3
  33. package/esm/grid/index.js +5 -3
  34. package/esm/index.d.ts +3 -4
  35. package/esm/index.js +4 -3
  36. package/esm/input/index.d.ts +4 -0
  37. package/esm/input/index.js +4 -0
  38. package/esm/input/phone-input/phone.d.ts +13 -0
  39. package/esm/input/phone-input/phone.js +166 -0
  40. package/esm/text/child.d.ts +1 -0
  41. package/esm/text/text.d.ts +1 -0
  42. package/esm/text/text.js +25 -3
  43. package/package.json +8 -15
  44. package/dist/currency-input/index.js +0 -862
  45. package/dist/phone-input/index.js +0 -2033
  46. package/dist/phone-input/phone.d.ts +0 -11
  47. package/esm/phone-input/phone.d.ts +0 -11
  48. package/esm/phone-input/phone.js +0 -161
  49. /package/dist/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
  50. /package/dist/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
  51. /package/dist/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
  52. /package/dist/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
  53. /package/dist/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
  54. /package/dist/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
  55. /package/dist/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
  56. /package/dist/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
  57. /package/dist/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
  58. /package/dist/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
  59. /package/dist/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
  60. /package/dist/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
  61. /package/dist/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
  62. /package/dist/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
  63. /package/dist/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
  64. /package/dist/{currency-input → input/currency-input}/index.d.ts +0 -0
  65. /package/dist/{phone-input → input/phone-input}/index.d.ts +0 -0
  66. /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
  67. /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.js +0 -0
  68. /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
  69. /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.js +0 -0
  70. /package/esm/{currency-input → input/currency-input}/components/utils/addSeparators.js +0 -0
  71. /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
  72. /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.js +0 -0
  73. /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
  74. /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.js +0 -0
  75. /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
  76. /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.js +0 -0
  77. /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
  78. /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.js +0 -0
  79. /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
  80. /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.js +0 -0
  81. /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
  82. /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.js +0 -0
  83. /package/esm/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
  84. /package/esm/{currency-input → input/currency-input}/components/utils/index.js +0 -0
  85. /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
  86. /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.js +0 -0
  87. /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
  88. /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.js +0 -0
  89. /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
  90. /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.js +0 -0
  91. /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
  92. /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.js +0 -0
  93. /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
  94. /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.js +0 -0
  95. /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
  96. /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.js +0 -0
  97. /package/esm/{currency-input → input/currency-input}/index.d.ts +0 -0
  98. /package/esm/{currency-input → input/currency-input}/index.js +0 -0
  99. /package/esm/{phone-input → input/phone-input}/index.d.ts +0 -0
  100. /package/esm/{phone-input → input/phone-input}/index.js +0 -0
@@ -14,6 +14,9 @@ function _arrayLikeToArray(r, a) {
14
14
  function _arrayWithHoles(r) {
15
15
  if (Array.isArray(r)) return r;
16
16
  }
17
+ function _arrayWithoutHoles(r) {
18
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
19
+ }
17
20
  function _createForOfIteratorHelper(r, e) {
18
21
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
19
22
  if (!t) {
@@ -79,6 +82,9 @@ function _extends() {
79
82
  return n;
80
83
  }, _extends.apply(null, arguments);
81
84
  }
85
+ function _iterableToArray(r) {
86
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
87
+ }
82
88
  function _iterableToArrayLimit(r, l) {
83
89
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
84
90
  if (null != t) {
@@ -109,6 +115,9 @@ function _iterableToArrayLimit(r, l) {
109
115
  function _nonIterableRest() {
110
116
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
111
117
  }
118
+ function _nonIterableSpread() {
119
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
120
+ }
112
121
  function ownKeys(e, r) {
113
122
  var t = Object.keys(e);
114
123
  if (Object.getOwnPropertySymbols) {
@@ -153,6 +162,9 @@ function _objectWithoutPropertiesLoose(r, e) {
153
162
  function _slicedToArray(r, e) {
154
163
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
155
164
  }
165
+ function _toConsumableArray(r) {
166
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
167
+ }
156
168
  function _toPrimitive(t, r) {
157
169
  if ("object" != typeof t || !t) return t;
158
170
  var e = t[Symbol.toPrimitive];
@@ -933,7 +945,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
933
945
  return getAllScaleProps;
934
946
  };
935
947
 
936
- var _excluded$5 = ["children"];
948
+ var _excluded$6 = ["children"];
937
949
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
938
950
  if (scale === 1) return scale;
939
951
  var diff = Math.abs((scale - 1) / 2);
@@ -943,7 +955,7 @@ var withScale = function withScale(Render) {
943
955
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
944
956
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
945
957
  var children = _ref.children,
946
- props = _objectWithoutProperties(_ref, _excluded$5);
958
+ props = _objectWithoutProperties(_ref, _excluded$6);
947
959
  var _useTheme = theme.useTheme(),
948
960
  layout = _useTheme.layout;
949
961
  var paddingLeft = props.paddingLeft,
@@ -1026,7 +1038,7 @@ var withScale = function withScale(Render) {
1026
1038
  return ScaleFC;
1027
1039
  };
1028
1040
 
1029
- var _excluded$4 = ["label", "labelRight", "color", "error", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
1041
+ var _excluded$5 = ["label", "labelRight", "color", "error", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
1030
1042
  var simulateChangeEvent = function simulateChangeEvent(el, event) {
1031
1043
  return _objectSpread2(_objectSpread2({}, event), {}, {
1032
1044
  target: el,
@@ -1070,7 +1082,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1070
1082
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1071
1083
  _ref$fullWidth = _ref.fullWidth,
1072
1084
  fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
1073
- props = _objectWithoutProperties(_ref, _excluded$4);
1085
+ props = _objectWithoutProperties(_ref, _excluded$5);
1074
1086
  var theme$1 = theme.useTheme();
1075
1087
  var _useScale = useScale(),
1076
1088
  SCALES = _useScale.SCALES;
@@ -1214,7 +1226,7 @@ tuple('hover', 'click');
1214
1226
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1215
1227
  tuple('start', 'center', 'end', 'left', 'right');
1216
1228
 
1217
- var _excluded$3 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1229
+ var _excluded$4 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1218
1230
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
1219
1231
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1220
1232
  var _ref$type = _ref.type,
@@ -1234,7 +1246,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1234
1246
  placeholder = _ref.placeholder,
1235
1247
  _ref$resize = _ref.resize,
1236
1248
  resize = _ref$resize === void 0 ? 'none' : _ref$resize,
1237
- props = _objectWithoutProperties(_ref, _excluded$3);
1249
+ props = _objectWithoutProperties(_ref, _excluded$4);
1238
1250
  var theme$1 = theme.useTheme();
1239
1251
  var _useScale = useScale(),
1240
1252
  SCALES = _useScale.SCALES;
@@ -1334,11 +1346,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
1334
1346
  };
1335
1347
  var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1336
1348
 
1337
- var _excluded$2 = ["hideToggle", "children"];
1349
+ var _excluded$3 = ["hideToggle", "children"];
1338
1350
  var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1339
1351
  var hideToggle = _ref.hideToggle,
1340
1352
  children = _ref.children,
1341
- props = _objectWithoutProperties(_ref, _excluded$2);
1353
+ props = _objectWithoutProperties(_ref, _excluded$3);
1342
1354
  var _useScale = useScale(),
1343
1355
  getAllScaleProps = _useScale.getAllScaleProps;
1344
1356
  var inputRef = React.useRef(null);
@@ -1380,9 +1392,2136 @@ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref)
1380
1392
  InputPasswordComponent.displayName = 'InputPassword';
1381
1393
  var InputPassword = withScale(InputPasswordComponent);
1382
1394
 
1395
+ var countries = [
1396
+ {
1397
+ code: "AD",
1398
+ label: "Andorra",
1399
+ phone: "+376"
1400
+ },
1401
+ {
1402
+ code: "AE",
1403
+ label: "United Arab Emirates",
1404
+ phone: "+971"
1405
+ },
1406
+ {
1407
+ code: "AF",
1408
+ label: "Afghanistan",
1409
+ phone: "+93"
1410
+ },
1411
+ {
1412
+ code: "AG",
1413
+ label: "Antigua and Barbuda",
1414
+ phone: "+1-268"
1415
+ },
1416
+ {
1417
+ code: "AI",
1418
+ label: "Anguilla",
1419
+ phone: "+1-264"
1420
+ },
1421
+ {
1422
+ code: "AL",
1423
+ label: "Albania",
1424
+ phone: "+355"
1425
+ },
1426
+ {
1427
+ code: "AM",
1428
+ label: "Armenia",
1429
+ phone: "+374"
1430
+ },
1431
+ {
1432
+ code: "AO",
1433
+ label: "Angola",
1434
+ phone: "+244"
1435
+ },
1436
+ {
1437
+ code: "AQ",
1438
+ label: "Antarctica",
1439
+ phone: "+672"
1440
+ },
1441
+ {
1442
+ code: "AR",
1443
+ label: "Argentina",
1444
+ phone: "+54"
1445
+ },
1446
+ {
1447
+ code: "AS",
1448
+ label: "American Samoa",
1449
+ phone: "+1-684"
1450
+ },
1451
+ {
1452
+ code: "AT",
1453
+ label: "Austria",
1454
+ phone: "+43"
1455
+ },
1456
+ {
1457
+ code: "AU",
1458
+ label: "Australia",
1459
+ phone: "+61",
1460
+ suggested: true
1461
+ },
1462
+ {
1463
+ code: "AW",
1464
+ label: "Aruba",
1465
+ phone: "+297"
1466
+ },
1467
+ {
1468
+ code: "AX",
1469
+ label: "Alland Islands",
1470
+ phone: "+358"
1471
+ },
1472
+ {
1473
+ code: "AZ",
1474
+ label: "Azerbaijan",
1475
+ phone: "+994"
1476
+ },
1477
+ {
1478
+ code: "BA",
1479
+ label: "Bosnia and Herzegovina",
1480
+ phone: "+387"
1481
+ },
1482
+ {
1483
+ code: "BB",
1484
+ label: "Barbados",
1485
+ phone: "+1-246"
1486
+ },
1487
+ {
1488
+ code: "BD",
1489
+ label: "Bangladesh",
1490
+ phone: "+880"
1491
+ },
1492
+ {
1493
+ code: "BE",
1494
+ label: "Belgium",
1495
+ phone: "+32"
1496
+ },
1497
+ {
1498
+ code: "BF",
1499
+ label: "Burkina Faso",
1500
+ phone: "+226"
1501
+ },
1502
+ {
1503
+ code: "BG",
1504
+ label: "Bulgaria",
1505
+ phone: "+359"
1506
+ },
1507
+ {
1508
+ code: "BH",
1509
+ label: "Bahrain",
1510
+ phone: "+973"
1511
+ },
1512
+ {
1513
+ code: "BI",
1514
+ label: "Burundi",
1515
+ phone: "+257"
1516
+ },
1517
+ {
1518
+ code: "BJ",
1519
+ label: "Benin",
1520
+ phone: "+229"
1521
+ },
1522
+ {
1523
+ code: "BL",
1524
+ label: "Saint Barthelemy",
1525
+ phone: "+590"
1526
+ },
1527
+ {
1528
+ code: "BM",
1529
+ label: "Bermuda",
1530
+ phone: "+1-441"
1531
+ },
1532
+ {
1533
+ code: "BN",
1534
+ label: "Brunei Darussalam",
1535
+ phone: "+673"
1536
+ },
1537
+ {
1538
+ code: "BO",
1539
+ label: "Bolivia",
1540
+ phone: "+591"
1541
+ },
1542
+ {
1543
+ code: "BR",
1544
+ label: "Brazil",
1545
+ phone: "+55"
1546
+ },
1547
+ {
1548
+ code: "BS",
1549
+ label: "Bahamas",
1550
+ phone: "+1-242"
1551
+ },
1552
+ {
1553
+ code: "BT",
1554
+ label: "Bhutan",
1555
+ phone: "+975"
1556
+ },
1557
+ {
1558
+ code: "BV",
1559
+ label: "Bouvet Island",
1560
+ phone: "+47"
1561
+ },
1562
+ {
1563
+ code: "BW",
1564
+ label: "Botswana",
1565
+ phone: "+267"
1566
+ },
1567
+ {
1568
+ code: "BY",
1569
+ label: "Belarus",
1570
+ phone: "+375"
1571
+ },
1572
+ {
1573
+ code: "BZ",
1574
+ label: "Belize",
1575
+ phone: "+501"
1576
+ },
1577
+ {
1578
+ code: "CA",
1579
+ label: "Canada",
1580
+ phone: "+1",
1581
+ suggested: true
1582
+ },
1583
+ {
1584
+ code: "CC",
1585
+ label: "Cocos (Keeling) Islands",
1586
+ phone: "+61"
1587
+ },
1588
+ {
1589
+ code: "CD",
1590
+ label: "Congo, Democratic Republic of the",
1591
+ phone: "+243"
1592
+ },
1593
+ {
1594
+ code: "CF",
1595
+ label: "Central African Republic",
1596
+ phone: "+236"
1597
+ },
1598
+ {
1599
+ code: "CG",
1600
+ label: "Congo, Republic of the",
1601
+ phone: "+242"
1602
+ },
1603
+ {
1604
+ code: "CH",
1605
+ label: "Switzerland",
1606
+ phone: "+41"
1607
+ },
1608
+ {
1609
+ code: "CI",
1610
+ label: "Cote d'Ivoire",
1611
+ phone: "+225"
1612
+ },
1613
+ {
1614
+ code: "CK",
1615
+ label: "Cook Islands",
1616
+ phone: "+682"
1617
+ },
1618
+ {
1619
+ code: "CL",
1620
+ label: "Chile",
1621
+ phone: "+56"
1622
+ },
1623
+ {
1624
+ code: "CM",
1625
+ label: "Cameroon",
1626
+ phone: "+237"
1627
+ },
1628
+ {
1629
+ code: "CN",
1630
+ label: "China",
1631
+ phone: "+86"
1632
+ },
1633
+ {
1634
+ code: "CO",
1635
+ label: "Colombia",
1636
+ phone: "+57"
1637
+ },
1638
+ {
1639
+ code: "CR",
1640
+ label: "Costa Rica",
1641
+ phone: "+506"
1642
+ },
1643
+ {
1644
+ code: "CU",
1645
+ label: "Cuba",
1646
+ phone: "+53"
1647
+ },
1648
+ {
1649
+ code: "CV",
1650
+ label: "Cape Verde",
1651
+ phone: "+238"
1652
+ },
1653
+ {
1654
+ code: "CW",
1655
+ label: "Curacao",
1656
+ phone: "+599"
1657
+ },
1658
+ {
1659
+ code: "CX",
1660
+ label: "Christmas Island",
1661
+ phone: "+61"
1662
+ },
1663
+ {
1664
+ code: "CY",
1665
+ label: "Cyprus",
1666
+ phone: "+357"
1667
+ },
1668
+ {
1669
+ code: "CZ",
1670
+ label: "Czech Republic",
1671
+ phone: "+420"
1672
+ },
1673
+ {
1674
+ code: "DE",
1675
+ label: "Germany",
1676
+ phone: "+49",
1677
+ suggested: true
1678
+ },
1679
+ {
1680
+ code: "DJ",
1681
+ label: "Djibouti",
1682
+ phone: "+253"
1683
+ },
1684
+ {
1685
+ code: "DK",
1686
+ label: "Denmark",
1687
+ phone: "+45"
1688
+ },
1689
+ {
1690
+ code: "DM",
1691
+ label: "Dominica",
1692
+ phone: "+1-767"
1693
+ },
1694
+ {
1695
+ code: "DO",
1696
+ label: "Dominican Republic",
1697
+ phone: "+1-809"
1698
+ },
1699
+ {
1700
+ code: "DZ",
1701
+ label: "Algeria",
1702
+ phone: "+213"
1703
+ },
1704
+ {
1705
+ code: "EC",
1706
+ label: "Ecuador",
1707
+ phone: "+593"
1708
+ },
1709
+ {
1710
+ code: "EE",
1711
+ label: "Estonia",
1712
+ phone: "+372"
1713
+ },
1714
+ {
1715
+ code: "EG",
1716
+ label: "Egypt",
1717
+ phone: "+20"
1718
+ },
1719
+ {
1720
+ code: "EH",
1721
+ label: "Western Sahara",
1722
+ phone: "+212"
1723
+ },
1724
+ {
1725
+ code: "ER",
1726
+ label: "Eritrea",
1727
+ phone: "+291"
1728
+ },
1729
+ {
1730
+ code: "ES",
1731
+ label: "Spain",
1732
+ phone: "+34"
1733
+ },
1734
+ {
1735
+ code: "ET",
1736
+ label: "Ethiopia",
1737
+ phone: "+251"
1738
+ },
1739
+ {
1740
+ code: "FI",
1741
+ label: "Finland",
1742
+ phone: "+358"
1743
+ },
1744
+ {
1745
+ code: "FJ",
1746
+ label: "Fiji",
1747
+ phone: "+679"
1748
+ },
1749
+ {
1750
+ code: "FK",
1751
+ label: "Falkland Islands (Malvinas)",
1752
+ phone: "+500"
1753
+ },
1754
+ {
1755
+ code: "FM",
1756
+ label: "Micronesia, Federated States of",
1757
+ phone: "+691"
1758
+ },
1759
+ {
1760
+ code: "FO",
1761
+ label: "Faroe Islands",
1762
+ phone: "+298"
1763
+ },
1764
+ {
1765
+ code: "FR",
1766
+ label: "France",
1767
+ phone: "+33",
1768
+ suggested: true
1769
+ },
1770
+ {
1771
+ code: "GA",
1772
+ label: "Gabon",
1773
+ phone: "+241"
1774
+ },
1775
+ {
1776
+ code: "GB",
1777
+ label: "United Kingdom",
1778
+ phone: "+44"
1779
+ },
1780
+ {
1781
+ code: "GD",
1782
+ label: "Grenada",
1783
+ phone: "+1-473"
1784
+ },
1785
+ {
1786
+ code: "GE",
1787
+ label: "Georgia",
1788
+ phone: "+995"
1789
+ },
1790
+ {
1791
+ code: "GF",
1792
+ label: "French Guiana",
1793
+ phone: "+594"
1794
+ },
1795
+ {
1796
+ code: "GG",
1797
+ label: "Guernsey",
1798
+ phone: "+44"
1799
+ },
1800
+ {
1801
+ code: "GH",
1802
+ label: "Ghana",
1803
+ phone: "+233"
1804
+ },
1805
+ {
1806
+ code: "GI",
1807
+ label: "Gibraltar",
1808
+ phone: "+350"
1809
+ },
1810
+ {
1811
+ code: "GL",
1812
+ label: "Greenland",
1813
+ phone: "+299"
1814
+ },
1815
+ {
1816
+ code: "GM",
1817
+ label: "Gambia",
1818
+ phone: "+220"
1819
+ },
1820
+ {
1821
+ code: "GN",
1822
+ label: "Guinea",
1823
+ phone: "+224"
1824
+ },
1825
+ {
1826
+ code: "GP",
1827
+ label: "Guadeloupe",
1828
+ phone: "+590"
1829
+ },
1830
+ {
1831
+ code: "GQ",
1832
+ label: "Equatorial Guinea",
1833
+ phone: "+240"
1834
+ },
1835
+ {
1836
+ code: "GR",
1837
+ label: "Greece",
1838
+ phone: "+30"
1839
+ },
1840
+ {
1841
+ code: "GS",
1842
+ label: "South Georgia and the South Sandwich Islands",
1843
+ phone: "+500"
1844
+ },
1845
+ {
1846
+ code: "GT",
1847
+ label: "Guatemala",
1848
+ phone: "+502"
1849
+ },
1850
+ {
1851
+ code: "GU",
1852
+ label: "Guam",
1853
+ phone: "+1-671"
1854
+ },
1855
+ {
1856
+ code: "GW",
1857
+ label: "Guinea-Bissau",
1858
+ phone: "+245"
1859
+ },
1860
+ {
1861
+ code: "GY",
1862
+ label: "Guyana",
1863
+ phone: "+592"
1864
+ },
1865
+ {
1866
+ code: "HK",
1867
+ label: "Hong Kong",
1868
+ phone: "+852"
1869
+ },
1870
+ {
1871
+ code: "HM",
1872
+ label: "Heard Island and McDonald Islands",
1873
+ phone: "+672"
1874
+ },
1875
+ {
1876
+ code: "HN",
1877
+ label: "Honduras",
1878
+ phone: "+504"
1879
+ },
1880
+ {
1881
+ code: "HR",
1882
+ label: "Croatia",
1883
+ phone: "+385"
1884
+ },
1885
+ {
1886
+ code: "HT",
1887
+ label: "Haiti",
1888
+ phone: "+509"
1889
+ },
1890
+ {
1891
+ code: "HU",
1892
+ label: "Hungary",
1893
+ phone: "+36"
1894
+ },
1895
+ {
1896
+ code: "ID",
1897
+ label: "Indonesia",
1898
+ phone: "+62"
1899
+ },
1900
+ {
1901
+ code: "IE",
1902
+ label: "Ireland",
1903
+ phone: "+353"
1904
+ },
1905
+ {
1906
+ code: "IL",
1907
+ label: "Israel",
1908
+ phone: "+972"
1909
+ },
1910
+ {
1911
+ code: "IM",
1912
+ label: "Isle of Man",
1913
+ phone: "+44"
1914
+ },
1915
+ {
1916
+ code: "IN",
1917
+ label: "India",
1918
+ phone: "+91"
1919
+ },
1920
+ {
1921
+ code: "IO",
1922
+ label: "British Indian Ocean Territory",
1923
+ phone: "+246"
1924
+ },
1925
+ {
1926
+ code: "IQ",
1927
+ label: "Iraq",
1928
+ phone: "+964"
1929
+ },
1930
+ {
1931
+ code: "IR",
1932
+ label: "Iran, Islamic Republic of",
1933
+ phone: "+98"
1934
+ },
1935
+ {
1936
+ code: "IS",
1937
+ label: "Iceland",
1938
+ phone: "+354"
1939
+ },
1940
+ {
1941
+ code: "IT",
1942
+ label: "Italy",
1943
+ phone: "+39"
1944
+ },
1945
+ {
1946
+ code: "JE",
1947
+ label: "Jersey",
1948
+ phone: "+44"
1949
+ },
1950
+ {
1951
+ code: "JM",
1952
+ label: "Jamaica",
1953
+ phone: "+1-876"
1954
+ },
1955
+ {
1956
+ code: "JO",
1957
+ label: "Jordan",
1958
+ phone: "+962"
1959
+ },
1960
+ {
1961
+ code: "JP",
1962
+ label: "Japan",
1963
+ phone: "+81",
1964
+ suggested: true
1965
+ },
1966
+ {
1967
+ code: "KE",
1968
+ label: "Kenya",
1969
+ phone: "+254"
1970
+ },
1971
+ {
1972
+ code: "KG",
1973
+ label: "Kyrgyzstan",
1974
+ phone: "+996"
1975
+ },
1976
+ {
1977
+ code: "KH",
1978
+ label: "Cambodia",
1979
+ phone: "+855"
1980
+ },
1981
+ {
1982
+ code: "KI",
1983
+ label: "Kiribati",
1984
+ phone: "+686"
1985
+ },
1986
+ {
1987
+ code: "KM",
1988
+ label: "Comoros",
1989
+ phone: "+269"
1990
+ },
1991
+ {
1992
+ code: "KN",
1993
+ label: "Saint Kitts and Nevis",
1994
+ phone: "+1-869"
1995
+ },
1996
+ {
1997
+ code: "KP",
1998
+ label: "Korea, Democratic People's Republic of",
1999
+ phone: "+850"
2000
+ },
2001
+ {
2002
+ code: "KR",
2003
+ label: "Korea, Republic of",
2004
+ phone: "+82"
2005
+ },
2006
+ {
2007
+ code: "KW",
2008
+ label: "Kuwait",
2009
+ phone: "+965"
2010
+ },
2011
+ {
2012
+ code: "KY",
2013
+ label: "Cayman Islands",
2014
+ phone: "+1-345"
2015
+ },
2016
+ {
2017
+ code: "KZ",
2018
+ label: "Kazakhstan",
2019
+ phone: "+7"
2020
+ },
2021
+ {
2022
+ code: "LA",
2023
+ label: "Lao People's Democratic Republic",
2024
+ phone: "+856"
2025
+ },
2026
+ {
2027
+ code: "LB",
2028
+ label: "Lebanon",
2029
+ phone: "+961"
2030
+ },
2031
+ {
2032
+ code: "LC",
2033
+ label: "Saint Lucia",
2034
+ phone: "+1-758"
2035
+ },
2036
+ {
2037
+ code: "LI",
2038
+ label: "Liechtenstein",
2039
+ phone: "+423"
2040
+ },
2041
+ {
2042
+ code: "LK",
2043
+ label: "Sri Lanka",
2044
+ phone: "+94"
2045
+ },
2046
+ {
2047
+ code: "LR",
2048
+ label: "Liberia",
2049
+ phone: "+231"
2050
+ },
2051
+ {
2052
+ code: "LS",
2053
+ label: "Lesotho",
2054
+ phone: "+266"
2055
+ },
2056
+ {
2057
+ code: "LT",
2058
+ label: "Lithuania",
2059
+ phone: "+370"
2060
+ },
2061
+ {
2062
+ code: "LU",
2063
+ label: "Luxembourg",
2064
+ phone: "+352"
2065
+ },
2066
+ {
2067
+ code: "LV",
2068
+ label: "Latvia",
2069
+ phone: "+371"
2070
+ },
2071
+ {
2072
+ code: "LY",
2073
+ label: "Libya",
2074
+ phone: "+218"
2075
+ },
2076
+ {
2077
+ code: "MA",
2078
+ label: "Morocco",
2079
+ phone: "+212"
2080
+ },
2081
+ {
2082
+ code: "MC",
2083
+ label: "Monaco",
2084
+ phone: "+377"
2085
+ },
2086
+ {
2087
+ code: "MD",
2088
+ label: "Moldova, Republic of",
2089
+ phone: "+373"
2090
+ },
2091
+ {
2092
+ code: "ME",
2093
+ label: "Montenegro",
2094
+ phone: "+382"
2095
+ },
2096
+ {
2097
+ code: "MF",
2098
+ label: "Saint Martin (French part)",
2099
+ phone: "+590"
2100
+ },
2101
+ {
2102
+ code: "MG",
2103
+ label: "Madagascar",
2104
+ phone: "+261"
2105
+ },
2106
+ {
2107
+ code: "MH",
2108
+ label: "Marshall Islands",
2109
+ phone: "+692"
2110
+ },
2111
+ {
2112
+ code: "MK",
2113
+ label: "Macedonia, the Former Yugoslav Republic of",
2114
+ phone: "+389"
2115
+ },
2116
+ {
2117
+ code: "ML",
2118
+ label: "Mali",
2119
+ phone: "+223"
2120
+ },
2121
+ {
2122
+ code: "MM",
2123
+ label: "Myanmar",
2124
+ phone: "+95"
2125
+ },
2126
+ {
2127
+ code: "MN",
2128
+ label: "Mongolia",
2129
+ phone: "+976"
2130
+ },
2131
+ {
2132
+ code: "MO",
2133
+ label: "Macao",
2134
+ phone: "+853"
2135
+ },
2136
+ {
2137
+ code: "MP",
2138
+ label: "Northern Mariana Islands",
2139
+ phone: "+1-670"
2140
+ },
2141
+ {
2142
+ code: "MQ",
2143
+ label: "Martinique",
2144
+ phone: "+596"
2145
+ },
2146
+ {
2147
+ code: "MR",
2148
+ label: "Mauritania",
2149
+ phone: "+222"
2150
+ },
2151
+ {
2152
+ code: "MS",
2153
+ label: "Montserrat",
2154
+ phone: "+1-664"
2155
+ },
2156
+ {
2157
+ code: "MT",
2158
+ label: "Malta",
2159
+ phone: "+356"
2160
+ },
2161
+ {
2162
+ code: "MU",
2163
+ label: "Mauritius",
2164
+ phone: "+230"
2165
+ },
2166
+ {
2167
+ code: "MV",
2168
+ label: "Maldives",
2169
+ phone: "+960"
2170
+ },
2171
+ {
2172
+ code: "MW",
2173
+ label: "Malawi",
2174
+ phone: "+265"
2175
+ },
2176
+ {
2177
+ code: "MX",
2178
+ label: "Mexico",
2179
+ phone: "+52"
2180
+ },
2181
+ {
2182
+ code: "MY",
2183
+ label: "Malaysia",
2184
+ phone: "+60"
2185
+ },
2186
+ {
2187
+ code: "MZ",
2188
+ label: "Mozambique",
2189
+ phone: "+258"
2190
+ },
2191
+ {
2192
+ code: "NA",
2193
+ label: "Namibia",
2194
+ phone: "+264"
2195
+ },
2196
+ {
2197
+ code: "NC",
2198
+ label: "New Caledonia",
2199
+ phone: "+687"
2200
+ },
2201
+ {
2202
+ code: "NE",
2203
+ label: "Niger",
2204
+ phone: "+227"
2205
+ },
2206
+ {
2207
+ code: "NF",
2208
+ label: "Norfolk Island",
2209
+ phone: "+672"
2210
+ },
2211
+ {
2212
+ code: "NG",
2213
+ label: "Nigeria",
2214
+ phone: "+234"
2215
+ },
2216
+ {
2217
+ code: "NI",
2218
+ label: "Nicaragua",
2219
+ phone: "+505"
2220
+ },
2221
+ {
2222
+ code: "NL",
2223
+ label: "Netherlands",
2224
+ phone: "+31"
2225
+ },
2226
+ {
2227
+ code: "NO",
2228
+ label: "Norway",
2229
+ phone: "+47"
2230
+ },
2231
+ {
2232
+ code: "NP",
2233
+ label: "Nepal",
2234
+ phone: "+977"
2235
+ },
2236
+ {
2237
+ code: "NR",
2238
+ label: "Nauru",
2239
+ phone: "+674"
2240
+ },
2241
+ {
2242
+ code: "NU",
2243
+ label: "Niue",
2244
+ phone: "+683"
2245
+ },
2246
+ {
2247
+ code: "NZ",
2248
+ label: "New Zealand",
2249
+ phone: "+64"
2250
+ },
2251
+ {
2252
+ code: "OM",
2253
+ label: "Oman",
2254
+ phone: "+968"
2255
+ },
2256
+ {
2257
+ code: "PA",
2258
+ label: "Panama",
2259
+ phone: "+507"
2260
+ },
2261
+ {
2262
+ code: "PE",
2263
+ label: "Peru",
2264
+ phone: "+51"
2265
+ },
2266
+ {
2267
+ code: "PF",
2268
+ label: "French Polynesia",
2269
+ phone: "+689"
2270
+ },
2271
+ {
2272
+ code: "PG",
2273
+ label: "Papua New Guinea",
2274
+ phone: "+675"
2275
+ },
2276
+ {
2277
+ code: "PH",
2278
+ label: "Philippines",
2279
+ phone: "+63"
2280
+ },
2281
+ {
2282
+ code: "PK",
2283
+ label: "Pakistan",
2284
+ phone: "+92"
2285
+ },
2286
+ {
2287
+ code: "PL",
2288
+ label: "Poland",
2289
+ phone: "+48"
2290
+ },
2291
+ {
2292
+ code: "PM",
2293
+ label: "Saint Pierre and Miquelon",
2294
+ phone: "+508"
2295
+ },
2296
+ {
2297
+ code: "PN",
2298
+ label: "Pitcairn",
2299
+ phone: "+870"
2300
+ },
2301
+ {
2302
+ code: "PR",
2303
+ label: "Puerto Rico",
2304
+ phone: "+1"
2305
+ },
2306
+ {
2307
+ code: "PS",
2308
+ label: "Palestine, State of",
2309
+ phone: "+970"
2310
+ },
2311
+ {
2312
+ code: "PT",
2313
+ label: "Portugal",
2314
+ phone: "+351"
2315
+ },
2316
+ {
2317
+ code: "PW",
2318
+ label: "Palau",
2319
+ phone: "+680"
2320
+ },
2321
+ {
2322
+ code: "PY",
2323
+ label: "Paraguay",
2324
+ phone: "+595"
2325
+ },
2326
+ {
2327
+ code: "QA",
2328
+ label: "Qatar",
2329
+ phone: "+974"
2330
+ },
2331
+ {
2332
+ code: "RE",
2333
+ label: "Reunion",
2334
+ phone: "+262"
2335
+ },
2336
+ {
2337
+ code: "RO",
2338
+ label: "Romania",
2339
+ phone: "+40"
2340
+ },
2341
+ {
2342
+ code: "RS",
2343
+ label: "Serbia",
2344
+ phone: "+381"
2345
+ },
2346
+ {
2347
+ code: "RU",
2348
+ label: "Russian Federation",
2349
+ phone: "+7"
2350
+ },
2351
+ {
2352
+ code: "RW",
2353
+ label: "Rwanda",
2354
+ phone: "+250"
2355
+ },
2356
+ {
2357
+ code: "SA",
2358
+ label: "Saudi Arabia",
2359
+ phone: "+966"
2360
+ },
2361
+ {
2362
+ code: "SB",
2363
+ label: "Solomon Islands",
2364
+ phone: "+677"
2365
+ },
2366
+ {
2367
+ code: "SC",
2368
+ label: "Seychelles",
2369
+ phone: "+248"
2370
+ },
2371
+ {
2372
+ code: "SD",
2373
+ label: "Sudan",
2374
+ phone: "+249"
2375
+ },
2376
+ {
2377
+ code: "SE",
2378
+ label: "Sweden",
2379
+ phone: "+46"
2380
+ },
2381
+ {
2382
+ code: "SG",
2383
+ label: "Singapore",
2384
+ phone: "+65"
2385
+ },
2386
+ {
2387
+ code: "SH",
2388
+ label: "Saint Helena",
2389
+ phone: "+290"
2390
+ },
2391
+ {
2392
+ code: "SI",
2393
+ label: "Slovenia",
2394
+ phone: "+386"
2395
+ },
2396
+ {
2397
+ code: "SJ",
2398
+ label: "Svalbard and Jan Mayen",
2399
+ phone: "+47"
2400
+ },
2401
+ {
2402
+ code: "SK",
2403
+ label: "Slovakia",
2404
+ phone: "+421"
2405
+ },
2406
+ {
2407
+ code: "SL",
2408
+ label: "Sierra Leone",
2409
+ phone: "+232"
2410
+ },
2411
+ {
2412
+ code: "SM",
2413
+ label: "San Marino",
2414
+ phone: "+378"
2415
+ },
2416
+ {
2417
+ code: "SN",
2418
+ label: "Senegal",
2419
+ phone: "+221"
2420
+ },
2421
+ {
2422
+ code: "SO",
2423
+ label: "Somalia",
2424
+ phone: "+252"
2425
+ },
2426
+ {
2427
+ code: "SR",
2428
+ label: "Suriname",
2429
+ phone: "+597"
2430
+ },
2431
+ {
2432
+ code: "SS",
2433
+ label: "South Sudan",
2434
+ phone: "+211"
2435
+ },
2436
+ {
2437
+ code: "ST",
2438
+ label: "Sao Tome and Principe",
2439
+ phone: "+239"
2440
+ },
2441
+ {
2442
+ code: "SV",
2443
+ label: "El Salvador",
2444
+ phone: "+503"
2445
+ },
2446
+ {
2447
+ code: "SX",
2448
+ label: "Sint Maarten (Dutch part)",
2449
+ phone: "+1-721"
2450
+ },
2451
+ {
2452
+ code: "SY",
2453
+ label: "Syrian Arab Republic",
2454
+ phone: "+963"
2455
+ },
2456
+ {
2457
+ code: "SZ",
2458
+ label: "Swaziland",
2459
+ phone: "+268"
2460
+ },
2461
+ {
2462
+ code: "TC",
2463
+ label: "Turks and Caicos Islands",
2464
+ phone: "+1-649"
2465
+ },
2466
+ {
2467
+ code: "TD",
2468
+ label: "Chad",
2469
+ phone: "+235"
2470
+ },
2471
+ {
2472
+ code: "TF",
2473
+ label: "French Southern Territories",
2474
+ phone: "+262"
2475
+ },
2476
+ {
2477
+ code: "TG",
2478
+ label: "Togo",
2479
+ phone: "+228"
2480
+ },
2481
+ {
2482
+ code: "TH",
2483
+ label: "Thailand",
2484
+ phone: "+66"
2485
+ },
2486
+ {
2487
+ code: "TJ",
2488
+ label: "Tajikistan",
2489
+ phone: "+992"
2490
+ },
2491
+ {
2492
+ code: "TK",
2493
+ label: "Tokelau",
2494
+ phone: "+690"
2495
+ },
2496
+ {
2497
+ code: "TL",
2498
+ label: "Timor-Leste",
2499
+ phone: "+670"
2500
+ },
2501
+ {
2502
+ code: "TM",
2503
+ label: "Turkmenistan",
2504
+ phone: "+993"
2505
+ },
2506
+ {
2507
+ code: "TN",
2508
+ label: "Tunisia",
2509
+ phone: "+216"
2510
+ },
2511
+ {
2512
+ code: "TO",
2513
+ label: "Tonga",
2514
+ phone: "+676"
2515
+ },
2516
+ {
2517
+ code: "TR",
2518
+ label: "Turkey",
2519
+ phone: "+90"
2520
+ },
2521
+ {
2522
+ code: "TT",
2523
+ label: "Trinidad and Tobago",
2524
+ phone: "+1-868"
2525
+ },
2526
+ {
2527
+ code: "TV",
2528
+ label: "Tuvalu",
2529
+ phone: "+688"
2530
+ },
2531
+ {
2532
+ code: "TW",
2533
+ label: "Taiwan, Province of China",
2534
+ phone: "+886"
2535
+ },
2536
+ {
2537
+ code: "TZ",
2538
+ label: "United Republic of Tanzania",
2539
+ phone: "+255"
2540
+ },
2541
+ {
2542
+ code: "UA",
2543
+ label: "Ukraine",
2544
+ phone: "+380"
2545
+ },
2546
+ {
2547
+ code: "UG",
2548
+ label: "Uganda",
2549
+ phone: "+256"
2550
+ },
2551
+ {
2552
+ code: "US",
2553
+ label: "United States",
2554
+ phone: "+1",
2555
+ suggested: true
2556
+ },
2557
+ {
2558
+ code: "UY",
2559
+ label: "Uruguay",
2560
+ phone: "+598"
2561
+ },
2562
+ {
2563
+ code: "UZ",
2564
+ label: "Uzbekistan",
2565
+ phone: "+998"
2566
+ },
2567
+ {
2568
+ code: "VA",
2569
+ label: "Holy See (Vatican City State)",
2570
+ phone: "+379"
2571
+ },
2572
+ {
2573
+ code: "VC",
2574
+ label: "Saint Vincent and the Grenadines",
2575
+ phone: "+1-784"
2576
+ },
2577
+ {
2578
+ code: "VE",
2579
+ label: "Venezuela",
2580
+ phone: "+58"
2581
+ },
2582
+ {
2583
+ code: "VG",
2584
+ label: "British Virgin Islands",
2585
+ phone: "+1-284"
2586
+ },
2587
+ {
2588
+ code: "VI",
2589
+ label: "US Virgin Islands",
2590
+ phone: "+1-340"
2591
+ },
2592
+ {
2593
+ code: "VN",
2594
+ label: "Vietnam",
2595
+ phone: "+84"
2596
+ },
2597
+ {
2598
+ code: "VU",
2599
+ label: "Vanuatu",
2600
+ phone: "+678"
2601
+ },
2602
+ {
2603
+ code: "WF",
2604
+ label: "Wallis and Futuna",
2605
+ phone: "+681"
2606
+ },
2607
+ {
2608
+ code: "WS",
2609
+ label: "Samoa",
2610
+ phone: "+685"
2611
+ },
2612
+ {
2613
+ code: "XK",
2614
+ label: "Kosovo",
2615
+ phone: "+383"
2616
+ },
2617
+ {
2618
+ code: "YE",
2619
+ label: "Yemen",
2620
+ phone: "+967"
2621
+ },
2622
+ {
2623
+ code: "YT",
2624
+ label: "Mayotte",
2625
+ phone: "+262"
2626
+ },
2627
+ {
2628
+ code: "ZA",
2629
+ label: "South Africa",
2630
+ phone: "+27"
2631
+ },
2632
+ {
2633
+ code: "ZM",
2634
+ label: "Zambia",
2635
+ phone: "+260"
2636
+ },
2637
+ {
2638
+ code: "ZW",
2639
+ label: "Zimbabwe",
2640
+ phone: "+263"
2641
+ }
2642
+ ];
2643
+
2644
+ function PhoneInput(_ref) {
2645
+ var onChange = _ref.onChange,
2646
+ _ref$value = _ref.value,
2647
+ value = _ref$value === void 0 ? '' : _ref$value,
2648
+ country = _ref.country,
2649
+ _ref$placeholder = _ref.placeholder,
2650
+ placeholder = _ref$placeholder === void 0 ? 'Enter phone number' : _ref$placeholder,
2651
+ _ref$color = _ref.color,
2652
+ _color = _ref$color === void 0 ? 'default' : _ref$color,
2653
+ children = _ref.children,
2654
+ fullWidth = _ref.fullWidth;
2655
+ var theme$1 = theme.useTheme();
2656
+ var _useScale = useScale(),
2657
+ SCALES = _useScale.SCALES;
2658
+ var defaultValue = country ? countries.findIndex(function (cn) {
2659
+ return cn.code == country;
2660
+ }) : 103;
2661
+ var _useState = React.useState(countries[defaultValue]),
2662
+ _useState2 = _slicedToArray(_useState, 2),
2663
+ selectedCountry = _useState2[0],
2664
+ setSelectedCountry = _useState2[1];
2665
+ var _useState3 = React.useState(value),
2666
+ _useState4 = _slicedToArray(_useState3, 2),
2667
+ phoneNumber = _useState4[0],
2668
+ setPhoneNumber = _useState4[1];
2669
+ var _useState5 = React.useState(false),
2670
+ _useState6 = _slicedToArray(_useState5, 2),
2671
+ isFocused = _useState6[0],
2672
+ setIsFocused = _useState6[1];
2673
+ var _useState7 = React.useState(false),
2674
+ _useState8 = _slicedToArray(_useState7, 2),
2675
+ dropdownOpen = _useState8[0],
2676
+ setDropdownOpen = _useState8[1];
2677
+ var _useState9 = React.useState(''),
2678
+ _useState0 = _slicedToArray(_useState9, 2),
2679
+ searchTerm = _useState0[0],
2680
+ setSearchTerm = _useState0[1];
2681
+ var dropdownRef = React.useRef(null);
2682
+ var _useMemo = React.useMemo(function () {
2683
+ return getColors(theme$1.palette, _color);
2684
+ }, [theme$1.palette]),
2685
+ borderColor = _useMemo.borderColor,
2686
+ hoverBorder = _useMemo.hoverBorder;
2687
+ var handleSelectCountry = function handleSelectCountry(country) {
2688
+ setSelectedCountry(country);
2689
+ setDropdownOpen(false);
2690
+ setSearchTerm('');
2691
+ if (onChange) onChange("".concat(country.code, ":").concat(phoneNumber));
2692
+ };
2693
+ var handlePhoneChange = function handlePhoneChange(e) {
2694
+ var value = e.target.value.replace(/[^\d]/g, '');
2695
+ setPhoneNumber(value);
2696
+ if (onChange) onChange("".concat(selectedCountry.phone, ",").concat(value));
2697
+ };
2698
+ var handleClickOutside = function handleClickOutside(e) {
2699
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
2700
+ setDropdownOpen(false);
2701
+ setSearchTerm('');
2702
+ }
2703
+ };
2704
+ React.useEffect(function () {
2705
+ document.addEventListener('mousedown', handleClickOutside);
2706
+ return function () {
2707
+ return document.removeEventListener('mousedown', handleClickOutside);
2708
+ };
2709
+ }, []);
2710
+ var filteredCountries = countries.filter(function (c) {
2711
+ return "".concat(c.label, " ").concat(c.code, " ").concat(c.phone).toLowerCase().includes(searchTerm.toLowerCase());
2712
+ });
2713
+ var defaultWidth = fullWidth ? '100%' : 'initial';
2714
+ return /*#__PURE__*/React.createElement("div", {
2715
+ ref: dropdownRef,
2716
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input-container ".concat(isFocused ? 'focused' : '')
2717
+ }, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
2718
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "input-wrapper"
2719
+ }, /*#__PURE__*/React.createElement("div", {
2720
+ onClick: function onClick() {
2721
+ return setDropdownOpen(!dropdownOpen);
2722
+ },
2723
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-toggle"
2724
+ }, /*#__PURE__*/React.createElement("span", {
2725
+ style: {
2726
+ display: 'flex',
2727
+ alignItems: 'center',
2728
+ gap: 5
2729
+ },
2730
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2731
+ }, /*#__PURE__*/React.createElement("img", {
2732
+ loading: "lazy",
2733
+ width: "20",
2734
+ height: "20",
2735
+ src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
2736
+ srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
2737
+ alt: "Flag of ".concat(selectedCountry.label),
2738
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2739
+ }), /*#__PURE__*/React.createElement("span", {
2740
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2741
+ }, selectedCountry.phone))), /*#__PURE__*/React.createElement("input", {
2742
+ type: "tel",
2743
+ placeholder: placeholder,
2744
+ value: phoneNumber,
2745
+ onChange: handlePhoneChange,
2746
+ onFocus: function onFocus() {
2747
+ return setIsFocused(true);
2748
+ },
2749
+ onBlur: function onBlur() {
2750
+ return setIsFocused(false);
2751
+ },
2752
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input"
2753
+ })), dropdownOpen && /*#__PURE__*/React.createElement("div", {
2754
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown"
2755
+ }, /*#__PURE__*/React.createElement("input", {
2756
+ type: "text",
2757
+ placeholder: "Search country...",
2758
+ value: searchTerm,
2759
+ onChange: function onChange(e) {
2760
+ return setSearchTerm(e.target.value);
2761
+ },
2762
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "search-input"
2763
+ }), /*#__PURE__*/React.createElement("div", {
2764
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "country-list"
2765
+ }, filteredCountries.length > 0 ? filteredCountries.map(function (c) {
2766
+ return /*#__PURE__*/React.createElement("div", {
2767
+ key: c.code,
2768
+ onClick: function onClick() {
2769
+ return handleSelectCountry(c);
2770
+ },
2771
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item"
2772
+ }, /*#__PURE__*/React.createElement("span", {
2773
+ style: {
2774
+ display: 'flex',
2775
+ alignItems: 'center',
2776
+ gap: 5
2777
+ },
2778
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2779
+ }, /*#__PURE__*/React.createElement("img", {
2780
+ loading: "lazy",
2781
+ width: "23",
2782
+ height: "23",
2783
+ src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
2784
+ srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
2785
+ alt: "Flag of ".concat(c.label),
2786
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2787
+ }), c.phone, " ", /*#__PURE__*/React.createElement("span", {
2788
+ style: {
2789
+ color: 'grey'
2790
+ },
2791
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2792
+ }, c.label)));
2793
+ }) : /*#__PURE__*/React.createElement("div", {
2794
+ className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item disabled"
2795
+ }, "No results"))), /*#__PURE__*/React.createElement(_JSXStyle, {
2796
+ id: "3237870810",
2797
+ dynamic: [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']
2798
+ }, ".phone-input-container.__jsx-style-dynamic-selector{position:relative;width:".concat(SCALES.width(1, defaultWidth), ";height:").concat(SCALES.height(2.25), ";}.phone-input-container.focused.__jsx-style-dynamic-selector{outline:1px solid ").concat(hoverBorder, ";border-radius:6px;}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid ").concat(borderColor, ";border-radius:6px;overflow:hidden;}.dropdown-toggle.__jsx-style-dynamic-selector{padding:7px 12px;border-radius:6px 0px 0px 6px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;border-right:1px solid ").concat(borderColor, ";}.phone-input.__jsx-style-dynamic-selector{width:100%;min-width:0;padding:5px 10px;background-color:transparent;font-size:14px;border:none;}.phone-input.__jsx-style-dynamic-selector:focus{outline:none;}.dropdown.__jsx-style-dynamic-selector{position:absolute;top:100%;left:0;width:").concat(SCALES.width(1, defaultWidth), ";background:").concat(theme$1.type == 'dark' ? 'black' : 'white', ";border:1px solid ").concat(borderColor, ";border-radius:6px;margin-top:4px;z-index:999;box-shadow:0 4px 10px rgba(0,0,0,0.1);}.search-input.__jsx-style-dynamic-selector{width:100%;padding:8px 10px;border:none;background-color:transparent;border-bottom:1px solid ").concat(borderColor, ";font-size:14px;}.search-input.__jsx-style-dynamic-selector:focus{outline:none;}.country-list.__jsx-style-dynamic-selector{max-height:200px;overflow-y:auto;}.dropdown-item.__jsx-style-dynamic-selector{padding:10px;cursor:pointer;font-size:14px;}.dropdown-item.__jsx-style-dynamic-selector:hover{background:").concat(theme$1.type == 'dark' ? '#3a3d3d' : '#efefef', ";}.dropdown-item.disabled.__jsx-style-dynamic-selector{color:#888;cursor:default;}")));
2799
+ }
2800
+
2801
+ /**
2802
+ * Escape regex char
2803
+ *
2804
+ * See: https://stackoverflow.com/questions/17885855/use-dynamic-variable-string-as-regex-pattern-in-javascript
2805
+ */
2806
+ var escapeRegExp = function escapeRegExp(stringToGoIntoTheRegex) {
2807
+ return stringToGoIntoTheRegex.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
2808
+ };
2809
+
2810
+ var abbrMap = {
2811
+ k: 1000,
2812
+ m: 1000000,
2813
+ b: 1000000000
2814
+ };
2815
+
2816
+ /**
2817
+ * Parse a value with abbreviation e.g 1k = 1000
2818
+ */
2819
+ var parseAbbrValue = function parseAbbrValue(value) {
2820
+ var decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
2821
+ var reg = new RegExp("(\\d+(".concat(escapeRegExp(decimalSeparator), "\\d*)?)([kmb])$"), 'i');
2822
+ var match = value.match(reg);
2823
+ if (match) {
2824
+ var _match = _slicedToArray(match, 4),
2825
+ digits = _match[1],
2826
+ abbr = _match[3];
2827
+ var multiplier = abbrMap[abbr.toLowerCase()];
2828
+ return Number(digits.replace(decimalSeparator, '.')) * multiplier;
2829
+ }
2830
+ return undefined;
2831
+ };
2832
+
2833
+ /**
2834
+ * Remove group separator from value eg. 1,000 > 1000
2835
+ */
2836
+ var removeSeparators = function removeSeparators(value) {
2837
+ var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
2838
+ var reg = new RegExp(escapeRegExp(separator), 'g');
2839
+ return value.replace(reg, '');
2840
+ };
2841
+
2842
+ /**
2843
+ * Remove invalid characters
2844
+ */
2845
+ var removeInvalidChars = function removeInvalidChars(value, validChars) {
2846
+ var chars = escapeRegExp(validChars.join(''));
2847
+ var reg = new RegExp("[^\\d".concat(chars, "]"), 'gi');
2848
+ return value.replace(reg, '');
2849
+ };
2850
+
2851
+ /**
2852
+ * Remove prefix, separators and extra decimals from value
2853
+ */
2854
+ var cleanValue = function cleanValue(_ref) {
2855
+ var value = _ref.value,
2856
+ _ref$groupSeparator = _ref.groupSeparator,
2857
+ groupSeparator = _ref$groupSeparator === void 0 ? ',' : _ref$groupSeparator,
2858
+ _ref$decimalSeparator = _ref.decimalSeparator,
2859
+ decimalSeparator = _ref$decimalSeparator === void 0 ? '.' : _ref$decimalSeparator,
2860
+ _ref$allowDecimals = _ref.allowDecimals,
2861
+ allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
2862
+ _ref$decimalsLimit = _ref.decimalsLimit,
2863
+ decimalsLimit = _ref$decimalsLimit === void 0 ? 2 : _ref$decimalsLimit,
2864
+ _ref$allowNegativeVal = _ref.allowNegativeValue,
2865
+ allowNegativeValue = _ref$allowNegativeVal === void 0 ? true : _ref$allowNegativeVal,
2866
+ _ref$disableAbbreviat = _ref.disableAbbreviations,
2867
+ disableAbbreviations = _ref$disableAbbreviat === void 0 ? false : _ref$disableAbbreviat,
2868
+ _ref$prefix = _ref.prefix,
2869
+ prefix = _ref$prefix === void 0 ? '' : _ref$prefix,
2870
+ _ref$transformRawValu = _ref.transformRawValue,
2871
+ transformRawValue = _ref$transformRawValu === void 0 ? function (rawValue) {
2872
+ return rawValue;
2873
+ } : _ref$transformRawValu;
2874
+ var transformedValue = transformRawValue(value);
2875
+ if (transformedValue === '-') {
2876
+ return transformedValue;
2877
+ }
2878
+ var abbreviations = disableAbbreviations ? [] : ['k', 'm', 'b'];
2879
+ var reg = new RegExp("((^|\\D)-\\d)|(-".concat(escapeRegExp(prefix), ")"));
2880
+ var isNegative = reg.test(transformedValue);
2881
+
2882
+ // Is there a digit before the prefix? eg. 1$
2883
+ var _ref2 = RegExp("(\\d+)-?".concat(escapeRegExp(prefix))).exec(value) || [],
2884
+ _ref3 = _slicedToArray(_ref2, 2),
2885
+ prefixWithValue = _ref3[0],
2886
+ preValue = _ref3[1];
2887
+ var withoutPrefix = prefix ? prefixWithValue ? transformedValue.replace(prefixWithValue, '').concat(preValue) : transformedValue.replace(prefix, '') : transformedValue;
2888
+ var withoutSeparators = removeSeparators(withoutPrefix, groupSeparator);
2889
+ var withoutInvalidChars = removeInvalidChars(withoutSeparators, [groupSeparator, decimalSeparator].concat(abbreviations));
2890
+ var valueOnly = withoutInvalidChars;
2891
+ if (!disableAbbreviations) {
2892
+ // disallow letter without number
2893
+ if (abbreviations.some(function (letter) {
2894
+ return letter === withoutInvalidChars.toLowerCase().replace(decimalSeparator, '');
2895
+ })) {
2896
+ return '';
2897
+ }
2898
+ var parsed = parseAbbrValue(withoutInvalidChars, decimalSeparator);
2899
+ if (parsed) {
2900
+ valueOnly = String(parsed);
2901
+ }
2902
+ }
2903
+ var includeNegative = isNegative && allowNegativeValue ? '-' : '';
2904
+ if (decimalSeparator && valueOnly.includes(decimalSeparator)) {
2905
+ var _withoutInvalidChars$ = withoutInvalidChars.split(decimalSeparator),
2906
+ _withoutInvalidChars$2 = _slicedToArray(_withoutInvalidChars$, 2),
2907
+ _int = _withoutInvalidChars$2[0],
2908
+ decimals = _withoutInvalidChars$2[1];
2909
+ var trimmedDecimals = decimalsLimit && decimals ? decimals.slice(0, decimalsLimit) : decimals;
2910
+ var includeDecimals = allowDecimals ? "".concat(decimalSeparator).concat(trimmedDecimals) : '';
2911
+ return "".concat(includeNegative).concat(_int).concat(includeDecimals);
2912
+ }
2913
+ return "".concat(includeNegative).concat(valueOnly);
2914
+ };
2915
+
2916
+ var fixedDecimalValue = function fixedDecimalValue(value, decimalSeparator, fixedDecimalLength) {
2917
+ if (fixedDecimalLength !== undefined && value.length > 1) {
2918
+ if (fixedDecimalLength === 0) {
2919
+ return value.replace(decimalSeparator, '');
2920
+ }
2921
+ if (value.includes(decimalSeparator)) {
2922
+ var _value$split = value.split(decimalSeparator),
2923
+ _value$split2 = _slicedToArray(_value$split, 2),
2924
+ _int = _value$split2[0],
2925
+ decimals = _value$split2[1];
2926
+ if (decimals.length === fixedDecimalLength) {
2927
+ return value;
2928
+ }
2929
+ if (decimals.length > fixedDecimalLength) {
2930
+ return "".concat(_int).concat(decimalSeparator).concat(decimals.slice(0, fixedDecimalLength));
2931
+ }
2932
+ }
2933
+ var reg = value.length > fixedDecimalLength ? new RegExp("(\\d+)(\\d{".concat(fixedDecimalLength, "})")) : new RegExp("(\\d)(\\d+)");
2934
+ var match = value.match(reg);
2935
+ if (match) {
2936
+ var _match = _slicedToArray(match, 3),
2937
+ _int2 = _match[1],
2938
+ _decimals = _match[2];
2939
+ return "".concat(_int2).concat(decimalSeparator).concat(_decimals);
2940
+ }
2941
+ }
2942
+ return value;
2943
+ };
2944
+
2945
+ var getSuffix = function getSuffix(value, _ref) {
2946
+ var _ref$groupSeparator = _ref.groupSeparator,
2947
+ groupSeparator = _ref$groupSeparator === void 0 ? ',' : _ref$groupSeparator,
2948
+ _ref$decimalSeparator = _ref.decimalSeparator,
2949
+ decimalSeparator = _ref$decimalSeparator === void 0 ? '.' : _ref$decimalSeparator;
2950
+ var suffixReg = new RegExp("\\d([^".concat(escapeRegExp(groupSeparator)).concat(escapeRegExp(decimalSeparator), "0-9]+)"));
2951
+ var suffixMatch = value.match(suffixReg);
2952
+ return suffixMatch ? suffixMatch[1] : undefined;
2953
+ };
2954
+
2955
+ /**
2956
+ * Format value with decimal separator, group separator and prefix
2957
+ */
2958
+ var formatValue = function formatValue(options) {
2959
+ var _value = options.value,
2960
+ decimalSeparator = options.decimalSeparator,
2961
+ intlConfig = options.intlConfig,
2962
+ decimalScale = options.decimalScale,
2963
+ _options$prefix = options.prefix,
2964
+ prefix = _options$prefix === void 0 ? '' : _options$prefix,
2965
+ _options$suffix = options.suffix,
2966
+ suffix = _options$suffix === void 0 ? '' : _options$suffix;
2967
+ if (_value === '' || _value === undefined) {
2968
+ return '';
2969
+ }
2970
+ if (_value === '-') {
2971
+ return '-';
2972
+ }
2973
+ var isNegative = new RegExp("^\\d?-".concat(prefix ? "".concat(escapeRegExp(prefix), "?") : '', "\\d")).test(_value);
2974
+ var value = decimalSeparator !== '.' ? replaceDecimalSeparator(_value, decimalSeparator, isNegative) : _value;
2975
+ if (decimalSeparator && decimalSeparator !== '-' && value.startsWith(decimalSeparator)) {
2976
+ value = '0' + value;
2977
+ }
2978
+ var defaultNumberFormatOptions = {
2979
+ minimumFractionDigits: decimalScale || 0,
2980
+ maximumFractionDigits: 20
2981
+ };
2982
+ var numberFormatter = intlConfig ? new Intl.NumberFormat(intlConfig.locale, intlConfig.currency ? _objectSpread2(_objectSpread2({}, defaultNumberFormatOptions), {}, {
2983
+ style: 'currency',
2984
+ currency: intlConfig.currency
2985
+ }) : defaultNumberFormatOptions) : new Intl.NumberFormat(undefined, defaultNumberFormatOptions);
2986
+ var parts = numberFormatter.formatToParts(Number(value));
2987
+ var formatted = replaceParts(parts, options);
2988
+
2989
+ // Does intl formatting add a suffix?
2990
+ var intlSuffix = getSuffix(formatted, _objectSpread2({}, options));
2991
+
2992
+ // Include decimal separator if user input ends with decimal separator
2993
+ var includeDecimalSeparator = _value.slice(-1) === decimalSeparator ? decimalSeparator : '';
2994
+ var _ref = value.match(RegExp('\\d+\\.(\\d+)')) || [],
2995
+ _ref2 = _slicedToArray(_ref, 2),
2996
+ decimals = _ref2[1];
2997
+
2998
+ // Keep original decimal padding if no decimalScale
2999
+ if (decimalScale === undefined && decimals && decimalSeparator) {
3000
+ if (formatted.includes(decimalSeparator)) {
3001
+ formatted = formatted.replace(RegExp("(\\d+)(".concat(escapeRegExp(decimalSeparator), ")(\\d+)"), 'g'), "$1$2".concat(decimals));
3002
+ } else {
3003
+ if (intlSuffix && !suffix) {
3004
+ formatted = formatted.replace(intlSuffix, "".concat(decimalSeparator).concat(decimals).concat(intlSuffix));
3005
+ } else {
3006
+ formatted = "".concat(formatted).concat(decimalSeparator).concat(decimals);
3007
+ }
3008
+ }
3009
+ }
3010
+ if (suffix && includeDecimalSeparator) {
3011
+ return "".concat(formatted).concat(includeDecimalSeparator).concat(suffix);
3012
+ }
3013
+ if (intlSuffix && includeDecimalSeparator) {
3014
+ return formatted.replace(intlSuffix, "".concat(includeDecimalSeparator).concat(intlSuffix));
3015
+ }
3016
+ if (intlSuffix && suffix) {
3017
+ return formatted.replace(intlSuffix, "".concat(includeDecimalSeparator).concat(suffix));
3018
+ }
3019
+ return [formatted, includeDecimalSeparator, suffix].join('');
3020
+ };
3021
+
3022
+ /**
3023
+ * Before converting to Number, decimal separator has to be .
3024
+ */
3025
+ var replaceDecimalSeparator = function replaceDecimalSeparator(value, decimalSeparator, isNegative) {
3026
+ var newValue = value;
3027
+ if (decimalSeparator && decimalSeparator !== '.') {
3028
+ newValue = newValue.replace(RegExp(escapeRegExp(decimalSeparator), 'g'), '.');
3029
+ if (isNegative && decimalSeparator === '-') {
3030
+ newValue = "-".concat(newValue.slice(1));
3031
+ }
3032
+ }
3033
+ return newValue;
3034
+ };
3035
+ var replaceParts = function replaceParts(parts, _ref3) {
3036
+ var prefix = _ref3.prefix,
3037
+ groupSeparator = _ref3.groupSeparator,
3038
+ decimalSeparator = _ref3.decimalSeparator,
3039
+ decimalScale = _ref3.decimalScale,
3040
+ _ref3$disableGroupSep = _ref3.disableGroupSeparators,
3041
+ disableGroupSeparators = _ref3$disableGroupSep === void 0 ? false : _ref3$disableGroupSep;
3042
+ return parts.reduce(function (prev, _ref4, i) {
3043
+ var type = _ref4.type,
3044
+ value = _ref4.value;
3045
+ if (i === 0 && prefix) {
3046
+ if (type === 'minusSign') {
3047
+ return [value, prefix];
3048
+ }
3049
+ if (type === 'currency') {
3050
+ return [].concat(_toConsumableArray(prev), [prefix]);
3051
+ }
3052
+ return [prefix, value];
3053
+ }
3054
+ if (type === 'currency') {
3055
+ return prefix ? prev : [].concat(_toConsumableArray(prev), [value]);
3056
+ }
3057
+ if (type === 'group') {
3058
+ return !disableGroupSeparators ? [].concat(_toConsumableArray(prev), [groupSeparator !== undefined ? groupSeparator : value]) : prev;
3059
+ }
3060
+ if (type === 'decimal') {
3061
+ if (decimalScale !== undefined && decimalScale === 0) {
3062
+ return prev;
3063
+ }
3064
+ return [].concat(_toConsumableArray(prev), [decimalSeparator !== undefined ? decimalSeparator : value]);
3065
+ }
3066
+ if (type === 'fraction') {
3067
+ return [].concat(_toConsumableArray(prev), [decimalScale !== undefined ? value.slice(0, decimalScale) : value]);
3068
+ }
3069
+ return [].concat(_toConsumableArray(prev), [value]);
3070
+ }, ['']).join('');
3071
+ };
3072
+
3073
+ var defaultConfig = {
3074
+ currencySymbol: '',
3075
+ groupSeparator: '',
3076
+ decimalSeparator: '',
3077
+ prefix: '',
3078
+ suffix: ''
3079
+ };
3080
+
3081
+ /**
3082
+ * Get locale config from input or default
3083
+ */
3084
+ var getLocaleConfig = function getLocaleConfig(intlConfig) {
3085
+ var _ref = intlConfig || {},
3086
+ locale = _ref.locale,
3087
+ currency = _ref.currency;
3088
+ var numberFormatter = locale ? new Intl.NumberFormat(locale, currency ? {
3089
+ currency: currency,
3090
+ style: 'currency'
3091
+ } : undefined) : new Intl.NumberFormat();
3092
+ return numberFormatter.formatToParts(1000.1).reduce(function (prev, curr, i) {
3093
+ if (curr.type === 'currency') {
3094
+ if (i === 0) {
3095
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
3096
+ currencySymbol: curr.value,
3097
+ prefix: curr.value
3098
+ });
3099
+ } else {
3100
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
3101
+ currencySymbol: curr.value,
3102
+ suffix: curr.value
3103
+ });
3104
+ }
3105
+ }
3106
+ if (curr.type === 'group') {
3107
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
3108
+ groupSeparator: curr.value
3109
+ });
3110
+ }
3111
+ if (curr.type === 'decimal') {
3112
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
3113
+ decimalSeparator: curr.value
3114
+ });
3115
+ }
3116
+ return prev;
3117
+ }, defaultConfig);
3118
+ };
3119
+
3120
+ var isNumber = function isNumber(input) {
3121
+ return RegExp(/\d/, 'gi').test(input);
3122
+ };
3123
+
3124
+ var padTrimValue = function padTrimValue(value) {
3125
+ var decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
3126
+ var decimalScale = arguments.length > 2 ? arguments[2] : undefined;
3127
+ if (decimalScale === undefined || value === '' || value === undefined) {
3128
+ return value;
3129
+ }
3130
+ if (!value.match(/\d/g)) {
3131
+ return '';
3132
+ }
3133
+ var _value$split = value.split(decimalSeparator),
3134
+ _value$split2 = _slicedToArray(_value$split, 2),
3135
+ _int = _value$split2[0],
3136
+ decimals = _value$split2[1];
3137
+ if (decimalScale === 0) {
3138
+ return _int;
3139
+ }
3140
+ var newValue = decimals || '';
3141
+ if (newValue.length < decimalScale) {
3142
+ while (newValue.length < decimalScale) {
3143
+ newValue += '0';
3144
+ }
3145
+ } else {
3146
+ newValue = newValue.slice(0, decimalScale);
3147
+ }
3148
+ return "".concat(_int).concat(decimalSeparator).concat(newValue);
3149
+ };
3150
+
3151
+ /**
3152
+ * Based on the last key stroke and the cursor position, update the value
3153
+ * and reposition the cursor to the right place
3154
+ */
3155
+ var repositionCursor = function repositionCursor(_ref) {
3156
+ var selectionStart = _ref.selectionStart,
3157
+ value = _ref.value,
3158
+ lastKeyStroke = _ref.lastKeyStroke,
3159
+ stateValue = _ref.stateValue,
3160
+ groupSeparator = _ref.groupSeparator;
3161
+ var cursorPosition = selectionStart;
3162
+ var modifiedValue = value;
3163
+ if (stateValue && cursorPosition) {
3164
+ var splitValue = value.split('');
3165
+ // if cursor is to right of groupSeparator and backspace pressed, delete the character to the left of the separator and reposition the cursor
3166
+ if (lastKeyStroke === 'Backspace' && stateValue[cursorPosition] === groupSeparator) {
3167
+ splitValue.splice(cursorPosition - 1, 1);
3168
+ cursorPosition -= 1;
3169
+ }
3170
+ // if cursor is to left of groupSeparator and delete pressed, delete the character to the right of the separator and reposition the cursor
3171
+ if (lastKeyStroke === 'Delete' && stateValue[cursorPosition] === groupSeparator) {
3172
+ splitValue.splice(cursorPosition, 1);
3173
+ cursorPosition += 1;
3174
+ }
3175
+ modifiedValue = splitValue.join('');
3176
+ return {
3177
+ modifiedValue: modifiedValue,
3178
+ cursorPosition: cursorPosition
3179
+ };
3180
+ }
3181
+ return {
3182
+ modifiedValue: modifiedValue,
3183
+ cursorPosition: selectionStart
3184
+ };
3185
+ };
3186
+
3187
+ var _excluded$2 = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
3188
+ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3189
+ var _ref$allowDecimals = _ref.allowDecimals,
3190
+ allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
3191
+ _ref$allowNegativeVal = _ref.allowNegativeValue,
3192
+ allowNegativeValue = _ref$allowNegativeVal === void 0 ? true : _ref$allowNegativeVal,
3193
+ id = _ref.id,
3194
+ name = _ref.name,
3195
+ className = _ref.className,
3196
+ customInput = _ref.customInput,
3197
+ decimalsLimit = _ref.decimalsLimit,
3198
+ defaultValue = _ref.defaultValue,
3199
+ _ref$disabled = _ref.disabled,
3200
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
3201
+ userMaxLength = _ref.maxLength,
3202
+ userValue = _ref.value,
3203
+ onValueChange = _ref.onValueChange,
3204
+ fixedDecimalLength = _ref.fixedDecimalLength,
3205
+ placeholder = _ref.placeholder,
3206
+ decimalScale = _ref.decimalScale,
3207
+ prefix = _ref.prefix,
3208
+ suffix = _ref.suffix,
3209
+ intlConfig = _ref.intlConfig,
3210
+ step = _ref.step,
3211
+ min = _ref.min,
3212
+ max = _ref.max,
3213
+ _ref$disableGroupSepa = _ref.disableGroupSeparators,
3214
+ disableGroupSeparators = _ref$disableGroupSepa === void 0 ? false : _ref$disableGroupSepa,
3215
+ _ref$disableAbbreviat = _ref.disableAbbreviations,
3216
+ disableAbbreviations = _ref$disableAbbreviat === void 0 ? false : _ref$disableAbbreviat,
3217
+ _decimalSeparator = _ref.decimalSeparator,
3218
+ _groupSeparator = _ref.groupSeparator,
3219
+ onChange = _ref.onChange,
3220
+ onFocus = _ref.onFocus,
3221
+ onBlur = _ref.onBlur,
3222
+ onKeyDown = _ref.onKeyDown,
3223
+ onKeyUp = _ref.onKeyUp,
3224
+ transformRawValue = _ref.transformRawValue,
3225
+ _ref$formatValueOnBlu = _ref.formatValueOnBlur,
3226
+ formatValueOnBlur = _ref$formatValueOnBlu === void 0 ? true : _ref$formatValueOnBlu,
3227
+ children = _ref.children,
3228
+ props = _objectWithoutProperties(_ref, _excluded$2);
3229
+ var theme$1 = theme.useTheme();
3230
+ if (_decimalSeparator && isNumber(_decimalSeparator)) {
3231
+ throw new Error('decimalSeparator cannot be a number');
3232
+ }
3233
+ if (_groupSeparator && isNumber(_groupSeparator)) {
3234
+ throw new Error('groupSeparator cannot be a number');
3235
+ }
3236
+ var localeConfig = React.useMemo(function () {
3237
+ return getLocaleConfig(intlConfig);
3238
+ }, [intlConfig]);
3239
+ var decimalSeparator = _decimalSeparator || localeConfig.decimalSeparator || '';
3240
+ var groupSeparator = _groupSeparator || localeConfig.groupSeparator || '';
3241
+ if (decimalSeparator && groupSeparator && decimalSeparator === groupSeparator && disableGroupSeparators === false) {
3242
+ throw new Error('decimalSeparator cannot be the same as groupSeparator');
3243
+ }
3244
+ var formatValueOptions = {
3245
+ decimalSeparator: decimalSeparator,
3246
+ groupSeparator: groupSeparator,
3247
+ disableGroupSeparators: disableGroupSeparators,
3248
+ intlConfig: intlConfig,
3249
+ prefix: prefix || localeConfig.prefix,
3250
+ suffix: suffix
3251
+ };
3252
+ var cleanValueOptions = {
3253
+ decimalSeparator: decimalSeparator,
3254
+ groupSeparator: groupSeparator,
3255
+ allowDecimals: allowDecimals,
3256
+ decimalsLimit: decimalsLimit || fixedDecimalLength || 2,
3257
+ allowNegativeValue: allowNegativeValue,
3258
+ disableAbbreviations: disableAbbreviations,
3259
+ prefix: prefix || localeConfig.prefix,
3260
+ transformRawValue: transformRawValue
3261
+ };
3262
+ var _useState = React.useState(function () {
3263
+ return defaultValue != null ? formatValue(_objectSpread2(_objectSpread2({}, formatValueOptions), {}, {
3264
+ decimalScale: decimalScale,
3265
+ value: String(defaultValue)
3266
+ })) : userValue != null ? formatValue(_objectSpread2(_objectSpread2({}, formatValueOptions), {}, {
3267
+ decimalScale: decimalScale,
3268
+ value: String(userValue)
3269
+ })) : '';
3270
+ }),
3271
+ _useState2 = _slicedToArray(_useState, 2),
3272
+ stateValue = _useState2[0],
3273
+ setStateValue = _useState2[1];
3274
+ var _useState3 = React.useState(false),
3275
+ _useState4 = _slicedToArray(_useState3, 2),
3276
+ dirty = _useState4[0],
3277
+ setDirty = _useState4[1];
3278
+ var _useState5 = React.useState(0),
3279
+ _useState6 = _slicedToArray(_useState5, 2),
3280
+ cursor = _useState6[0],
3281
+ setCursor = _useState6[1];
3282
+ var _useState7 = React.useState(0),
3283
+ _useState8 = _slicedToArray(_useState7, 2),
3284
+ changeCount = _useState8[0],
3285
+ setChangeCount = _useState8[1];
3286
+ var _useState9 = React.useState(null),
3287
+ _useState0 = _slicedToArray(_useState9, 2),
3288
+ lastKeyStroke = _useState0[0],
3289
+ setLastKeyStroke = _useState0[1];
3290
+ var inputRef = React.useRef(null);
3291
+ React.useImperativeHandle(ref, function () {
3292
+ return inputRef.current;
3293
+ });
3294
+
3295
+ /**
3296
+ * Process change in value
3297
+ */
3298
+ var processChange = function processChange(value, selectionStart) {
3299
+ setDirty(true);
3300
+ var _repositionCursor = repositionCursor({
3301
+ selectionStart: selectionStart,
3302
+ value: value,
3303
+ lastKeyStroke: lastKeyStroke,
3304
+ stateValue: stateValue,
3305
+ groupSeparator: groupSeparator
3306
+ }),
3307
+ modifiedValue = _repositionCursor.modifiedValue,
3308
+ cursorPosition = _repositionCursor.cursorPosition;
3309
+ var stringValue = cleanValue(_objectSpread2({
3310
+ value: modifiedValue
3311
+ }, cleanValueOptions));
3312
+ if (userMaxLength && stringValue.replace(/-/g, '').length > userMaxLength) {
3313
+ return;
3314
+ }
3315
+ if (stringValue === '' || stringValue === '-' || stringValue === decimalSeparator) {
3316
+ onValueChange && onValueChange(undefined, name, {
3317
+ "float": null,
3318
+ formatted: '',
3319
+ value: ''
3320
+ });
3321
+ setStateValue(stringValue);
3322
+ // Always sets cursor after '-' or decimalSeparator input
3323
+ setCursor(1);
3324
+ return;
3325
+ }
3326
+ var stringValueWithoutSeparator = decimalSeparator ? stringValue.replace(decimalSeparator, '.') : stringValue;
3327
+ var numberValue = parseFloat(stringValueWithoutSeparator);
3328
+ var formattedValue = formatValue(_objectSpread2({
3329
+ value: stringValue
3330
+ }, formatValueOptions));
3331
+ if (cursorPosition != null) {
3332
+ // Prevent cursor jumping
3333
+ var newCursor = cursorPosition + (formattedValue.length - value.length);
3334
+ newCursor = newCursor <= 0 ? prefix ? prefix.length : 0 : newCursor;
3335
+ setCursor(newCursor);
3336
+ setChangeCount(changeCount + 1);
3337
+ }
3338
+ setStateValue(formattedValue);
3339
+ if (onValueChange) {
3340
+ var values = {
3341
+ "float": numberValue,
3342
+ formatted: formattedValue,
3343
+ value: stringValue
3344
+ };
3345
+ onValueChange(stringValue, name, values);
3346
+ }
3347
+ };
3348
+
3349
+ /**
3350
+ * Handle change event
3351
+ */
3352
+ var handleOnChange = function handleOnChange(event) {
3353
+ var _event$target = event.target,
3354
+ value = _event$target.value,
3355
+ selectionStart = _event$target.selectionStart;
3356
+ processChange(value, selectionStart);
3357
+ onChange && onChange(event);
3358
+ };
3359
+
3360
+ /**
3361
+ * Handle focus event
3362
+ */
3363
+ var handleOnFocus = function handleOnFocus(event) {
3364
+ onFocus && onFocus(event);
3365
+ return stateValue ? stateValue.length : 0;
3366
+ };
3367
+
3368
+ /**
3369
+ * Handle blur event
3370
+ *
3371
+ * Format value by padding/trimming decimals if required by
3372
+ */
3373
+ var handleOnBlur = function handleOnBlur(event) {
3374
+ var value = event.target.value;
3375
+ var valueOnly = cleanValue(_objectSpread2({
3376
+ value: value
3377
+ }, cleanValueOptions));
3378
+ if (valueOnly === '-' || valueOnly === decimalSeparator || !valueOnly) {
3379
+ setStateValue('');
3380
+ onBlur && onBlur(event);
3381
+ return;
3382
+ }
3383
+ var fixedDecimals = fixedDecimalValue(valueOnly, decimalSeparator, fixedDecimalLength);
3384
+ var newValue = padTrimValue(fixedDecimals, decimalSeparator, decimalScale !== undefined ? decimalScale : fixedDecimalLength);
3385
+ var numberValue = parseFloat(newValue.replace(decimalSeparator, '.'));
3386
+ var formattedValue = formatValue(_objectSpread2(_objectSpread2({}, formatValueOptions), {}, {
3387
+ value: newValue
3388
+ }));
3389
+ if (onValueChange && formatValueOnBlur) {
3390
+ onValueChange(newValue, name, {
3391
+ "float": numberValue,
3392
+ formatted: formattedValue,
3393
+ value: newValue
3394
+ });
3395
+ }
3396
+ setStateValue(formattedValue);
3397
+ onBlur && onBlur(event);
3398
+ };
3399
+
3400
+ /**
3401
+ * Handle key down event
3402
+ *
3403
+ * Increase or decrease value by step
3404
+ */
3405
+ var handleOnKeyDown = function handleOnKeyDown(event) {
3406
+ var key = event.key;
3407
+ setLastKeyStroke(key);
3408
+ if (step && (key === 'ArrowUp' || key === 'ArrowDown')) {
3409
+ event.preventDefault();
3410
+ setCursor(stateValue.length);
3411
+ var currentValue = parseFloat(userValue != null ? String(userValue).replace(decimalSeparator, '.') : cleanValue(_objectSpread2({
3412
+ value: stateValue
3413
+ }, cleanValueOptions))) || 0;
3414
+ var newValue = key === 'ArrowUp' ? currentValue + step : currentValue - step;
3415
+ if (min !== undefined && newValue < Number(min)) {
3416
+ return;
3417
+ }
3418
+ if (max !== undefined && newValue > Number(max)) {
3419
+ return;
3420
+ }
3421
+ var fixedLength = String(step).includes('.') ? Number(String(step).split('.')[1].length) : undefined;
3422
+ processChange(String(fixedLength ? newValue.toFixed(fixedLength) : newValue).replace('.', decimalSeparator));
3423
+ }
3424
+ onKeyDown && onKeyDown(event);
3425
+ };
3426
+
3427
+ /**
3428
+ * Handle key up event
3429
+ *
3430
+ * Move cursor if there is a suffix to prevent user typing past suffix
3431
+ */
3432
+ var handleOnKeyUp = function handleOnKeyUp(event) {
3433
+ var key = event.key,
3434
+ selectionStart = event.currentTarget.selectionStart;
3435
+ if (key !== 'ArrowUp' && key !== 'ArrowDown' && stateValue !== '-') {
3436
+ var _suffix = getSuffix(stateValue, {
3437
+ groupSeparator: groupSeparator,
3438
+ decimalSeparator: decimalSeparator
3439
+ });
3440
+ if (_suffix && selectionStart && selectionStart > stateValue.length - _suffix.length) {
3441
+ /* istanbul ignore else */
3442
+ if (inputRef.current) {
3443
+ var newCursor = stateValue.length - _suffix.length;
3444
+ inputRef.current.setSelectionRange(newCursor, newCursor);
3445
+ }
3446
+ }
3447
+ }
3448
+ onKeyUp && onKeyUp(event);
3449
+ };
3450
+
3451
+ // Update state if userValue changes to undefined
3452
+ React.useEffect(function () {
3453
+ if (userValue == null && defaultValue == null) {
3454
+ setStateValue('');
3455
+ }
3456
+ }, [defaultValue, userValue]);
3457
+ React.useEffect(function () {
3458
+ // prevent cursor jumping if editing value
3459
+ if (dirty && stateValue !== '-' && inputRef.current && document.activeElement === inputRef.current) {
3460
+ inputRef.current.setSelectionRange(cursor, cursor);
3461
+ }
3462
+ }, [stateValue, cursor, inputRef, dirty, changeCount]);
3463
+
3464
+ /**
3465
+ * If user has only entered "-" or decimal separator,
3466
+ * keep the char to allow them to enter next value
3467
+ */
3468
+ var getRenderValue = function getRenderValue() {
3469
+ if (userValue != null && stateValue !== '-' && (!decimalSeparator || stateValue !== decimalSeparator)) {
3470
+ return formatValue(_objectSpread2(_objectSpread2({}, formatValueOptions), {}, {
3471
+ decimalScale: dirty ? undefined : decimalScale,
3472
+ value: String(userValue)
3473
+ }));
3474
+ }
3475
+ return stateValue;
3476
+ };
3477
+ var inputProps = _objectSpread2({
3478
+ type: 'text',
3479
+ inputMode: 'decimal',
3480
+ id: id,
3481
+ name: name,
3482
+ className: className,
3483
+ onChange: handleOnChange,
3484
+ onBlur: handleOnBlur,
3485
+ onFocus: handleOnFocus,
3486
+ onKeyDown: handleOnKeyDown,
3487
+ onKeyUp: handleOnKeyUp,
3488
+ placeholder: placeholder,
3489
+ disabled: disabled,
3490
+ value: getRenderValue(),
3491
+ ref: inputRef
3492
+ }, props);
3493
+ if (customInput) {
3494
+ var CustomInput = customInput;
3495
+ return /*#__PURE__*/React.createElement(CustomInput, inputProps);
3496
+ }
3497
+ return /*#__PURE__*/React.createElement("div", null, children && /*#__PURE__*/React.createElement("label", {
3498
+ style: {
3499
+ display: 'block',
3500
+ marginBottom: '0.7rem',
3501
+ fontSize: '14px',
3502
+ fontWeight: 'light'
3503
+ }
3504
+ }, children), /*#__PURE__*/React.createElement("input", _extends({}, inputProps, {
3505
+ style: {
3506
+ textAlign: 'right',
3507
+ border: "1px solid ".concat(theme$1.palette.border),
3508
+ fontSize: '14px',
3509
+ borderRadius: '5px',
3510
+ height: '35px',
3511
+ padding: '5px 10px',
3512
+ fontWeight: 'light',
3513
+ width: 'auto',
3514
+ background: 'transparent',
3515
+ minWidth: '200px'
3516
+ }
3517
+ })));
3518
+ });
3519
+
1383
3520
  /* "use client" */
1384
3521
  Input.Textarea = Textarea;
1385
3522
  Input.Password = InputPassword;
3523
+ Input.Phone = PhoneInput;
3524
+ Input.Currency = InputCurrency;
1386
3525
 
1387
3526
  /* "use client" */
1388
3527