@invoicebox/ui 0.1.0-alpha.106 → 0.1.0-alpha.109

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.
@@ -6,13 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.allCountriesPhoneRules = exports.MASK_DIGIT_ITEM = void 0;
7
7
  var MASK_DIGIT_ITEM = exports.MASK_DIGIT_ITEM = '9';
8
8
  var allCountriesPhoneRules = exports.allCountriesPhoneRules = {
9
- RUS: {
10
- placeholder: '+7 (XXX) XXX-XX-XX',
11
- mask: '+9 (999) 999-99-99',
12
- startSubsequence: '7',
13
- regexp: /^\+?7(9\d{9})$/,
14
- flag: 'RUS'
15
- },
16
9
  BLR: {
17
10
  placeholder: '+375 XX XXX-XX-XX',
18
11
  mask: '+999 99 999-99-99',
@@ -37,10 +30,17 @@ var allCountriesPhoneRules = exports.allCountriesPhoneRules = {
37
30
  KAZ: {
38
31
  placeholder: '+7 (XXX) XXX-XX-XX',
39
32
  mask: '+9 (999) 999-99-99',
40
- startSubsequence: '7',
41
- regexp: /^(\+?7|8)?7\d{9}$/,
33
+ startSubsequence: '77',
34
+ regexp: /^77\d{9}$/,
42
35
  flag: 'KAZ'
43
36
  },
37
+ RUS: {
38
+ placeholder: '+7 (XXX) XXX-XX-XX',
39
+ mask: '+9 (999) 999-99-99',
40
+ startSubsequence: '7',
41
+ regexp: /^\+?7(9\d{9})$/,
42
+ flag: 'RUS'
43
+ },
44
44
  KGZ: {
45
45
  placeholder: '+996 XXX-XX-XX-XX',
46
46
  mask: '+999 999-99-99-99',
@@ -92,7 +92,7 @@ var PhoneInput = exports.PhoneInput = function PhoneInput(_ref) {
92
92
  var getNewCountryByInputValue = (0, _react.useCallback)(function (currentValue) {
93
93
  var currentCountry = currentCountriesPhoneRules[country];
94
94
  var newCountry = Object.entries(currentCountriesPhoneRules).find(function (item) {
95
- return _phoneInputLogic.phoneInputLogic.getIsHaveStartSequenceInString(currentValue, item[1].startSubsequence) && currentCountry.flag !== item[1].flag;
95
+ return _phoneInputLogic.phoneInputLogic.getIsHaveStartSequenceInString(currentValue, item[1].startSubsequence);
96
96
  });
97
97
  var isNeedChangeCountry = _phoneInputLogic.phoneInputLogic.getIsNeedChangeCountry(currentValue, currentCountry, newCountry);
98
98
  var isNeedAndCanChangeCountry = isNeedChangeCountry && !!newCountry;
@@ -95,6 +95,9 @@ var MultiCountryWithUnknown = exports.MultiCountryWithUnknown = {
95
95
  countries: [{
96
96
  label: 'Россия',
97
97
  value: 'RUS'
98
+ }, {
99
+ label: 'Казахстан',
100
+ value: 'KAZ'
98
101
  }, {
99
102
  label: 'Армения',
100
103
  value: 'ARM'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invoicebox/ui",
3
- "version": "0.1.0-alpha.106",
3
+ "version": "0.1.0-alpha.109",
4
4
  "description": "Invoicebox UI",
5
5
  "license": "Apache License 2.0",
6
6
  "scripts": {