@true-engineering/true-react-common-ui-kit 3.45.4 → 3.45.6

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.
@@ -1989,15 +1989,11 @@
1989
1989
  countryEn: "Abkhazia",
1990
1990
  countryRu: "Абхазия",
1991
1991
  countryCode: "AB",
1992
- phoneMask: "999 999-99-99",
1992
+ phoneMask: "(999) 999-99-99",
1993
1993
  dialCode: "7",
1994
- areaCodes: [
1995
- "840",
1996
- "940"
1997
- ],
1994
+ dialCodePriority: 1,
1998
1995
  fullCodes: [
1999
- "7840",
2000
- "7940"
1996
+ "7"
2001
1997
  ]
2002
1998
  },
2003
1999
  {
@@ -2996,39 +2992,10 @@
2996
2992
  countryRu: "Казахстан",
2997
2993
  countryCode: "KZ",
2998
2994
  dialCode: "7",
2999
- phoneMask: "999 999-99-99",
2995
+ phoneMask: "(999) 999-99-99",
3000
2996
  dialCodePriority: 1,
3001
- areaCodes: [
3002
- "310",
3003
- "311",
3004
- "312",
3005
- "313",
3006
- "315",
3007
- "318",
3008
- "321",
3009
- "324",
3010
- "325",
3011
- "326",
3012
- "327",
3013
- "336",
3014
- "7172",
3015
- "73622"
3016
- ],
3017
2997
  fullCodes: [
3018
- "7310",
3019
- "7311",
3020
- "7312",
3021
- "7313",
3022
- "7315",
3023
- "7318",
3024
- "7321",
3025
- "7324",
3026
- "7325",
3027
- "7326",
3028
- "7327",
3029
- "7336",
3030
- "77172",
3031
- "773622"
2998
+ "7"
3032
2999
  ]
3033
3000
  },
3034
3001
  {
@@ -3801,8 +3768,9 @@
3801
3768
  countryCode: "OS",
3802
3769
  countryEn: "South Ossetia",
3803
3770
  countryRu: "Южная Осетия",
3804
- phoneMask: "999 999-99-99",
3771
+ phoneMask: "(999) 999-99-99",
3805
3772
  dialCode: "7",
3773
+ dialCodePriority: 1,
3806
3774
  fullCodes: [
3807
3775
  "7"
3808
3776
  ]
@@ -4764,22 +4732,25 @@
4764
4732
  return ((_phone_dialCode = phone === null || phone === void 0 ? void 0 : phone.dialCode) !== null && _phone_dialCode !== void 0 ? _phone_dialCode : "") + ((_phone_phoneNumber = phone === null || phone === void 0 ? void 0 : phone.phoneNumber) !== null && _phone_phoneNumber !== void 0 ? _phone_phoneNumber : "");
4765
4733
  };
4766
4734
  var getCountryCodeFromPhone = function(phoneWithCode) {
4767
- var _phoneInfo_find;
4768
- var countryCode = (_phoneInfo_find = phoneInfo.find(function(info) {
4769
- return info.fullCodes.some(function(code) {
4770
- return phoneWithCode.startsWith(code);
4771
- });
4772
- })) === null || _phoneInfo_find === void 0 ? void 0 : _phoneInfo_find.countryCode;
4773
- if (trueReactPlatformHelpers.isEmpty(countryCode) && trueReactPlatformHelpers.isNotEmpty(phoneWithCode)) {
4774
- var _phoneInfo_filter_sort_;
4775
- countryCode = (_phoneInfo_filter_sort_ = phoneInfo.filter(function(info) {
4776
- return phoneWithCode.startsWith(info.dialCode);
4777
- }).sort(function(infoA, infoB) {
4778
- var _infoA_dialCodePriority, _infoB_dialCodePriority;
4779
- return ((_infoA_dialCodePriority = infoA.dialCodePriority) !== null && _infoA_dialCodePriority !== void 0 ? _infoA_dialCodePriority : 1e3) - ((_infoB_dialCodePriority = infoB.dialCodePriority) !== null && _infoB_dialCodePriority !== void 0 ? _infoB_dialCodePriority : 1e3);
4780
- })[0]) === null || _phoneInfo_filter_sort_ === void 0 ? void 0 : _phoneInfo_filter_sort_.countryCode;
4781
- }
4782
- return countryCode;
4735
+ var _highestPriorityCountries_at;
4736
+ if (trueReactPlatformHelpers.isStringEmpty(phoneWithCode)) {
4737
+ return;
4738
+ }
4739
+ var matchedCountries = phoneInfo.filter(function(info) {
4740
+ return info.fullCodes.some(function(fullCode) {
4741
+ return phoneWithCode.startsWith(fullCode);
4742
+ });
4743
+ });
4744
+ if (matchedCountries.length === 1) {
4745
+ return matchedCountries[0].countryCode;
4746
+ }
4747
+ var highestPriorityCountries = phoneInfo.filter(function(info) {
4748
+ return phoneWithCode.startsWith(info.dialCode);
4749
+ }).sort(function(a, b) {
4750
+ var _a_dialCodePriority, _b_dialCodePriority;
4751
+ return ((_a_dialCodePriority = a.dialCodePriority) !== null && _a_dialCodePriority !== void 0 ? _a_dialCodePriority : 1e3) - ((_b_dialCodePriority = b.dialCodePriority) !== null && _b_dialCodePriority !== void 0 ? _b_dialCodePriority : 1e3);
4752
+ });
4753
+ return (_highestPriorityCountries_at = highestPriorityCountries.at(0)) === null || _highestPriorityCountries_at === void 0 ? void 0 : _highestPriorityCountries_at.countryCode;
4783
4754
  };
4784
4755
  var getPhoneObjFromString = function(fullPhone, countryCode) {
4785
4756
  var _findCountryByCode;
@@ -13441,6 +13412,7 @@
13441
13412
  color: colors.CLASSIC_WHITE,
13442
13413
  letterSpacing: 0.2
13443
13414
  },
13415
+ custom: {},
13444
13416
  info: {},
13445
13417
  error: {
13446
13418
  "&$tooltip": {
@@ -28794,7 +28766,7 @@
28794
28766
  var handleSelect = function(newPhoneInfo, event) {
28795
28767
  if (newPhoneInfo.countryCode !== countryCode) {
28796
28768
  onChange({
28797
- phoneNumber: "",
28769
+ phoneNumber: newPhoneInfo.dialCode !== value.dialCode ? "" : getPhoneObjFromString(phoneWithCode).phoneNumber,
28798
28770
  dialCode: newPhoneInfo.dialCode,
28799
28771
  countryCode: newPhoneInfo.countryCode
28800
28772
  }, event);