@invoicebox/ui 0.1.0-alpha.62 → 0.1.0-alpha.63
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,42 +6,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.allCountriesPhoneRules = void 0;
|
|
7
7
|
var allCountriesPhoneRules = exports.allCountriesPhoneRules = {
|
|
8
8
|
RUS: {
|
|
9
|
+
placeholder: '+7 (XXX) XXX-XX-XX',
|
|
9
10
|
mask: '+9 (999) 999-99-99',
|
|
10
11
|
startSubsequence: '7',
|
|
11
12
|
regexp: /^\+?7(9\d{9})$/,
|
|
12
13
|
flag: 'RUS'
|
|
13
14
|
},
|
|
14
15
|
BLR: {
|
|
16
|
+
placeholder: '+375 XX XXX-XX-XX',
|
|
15
17
|
mask: '+999 99 999-99-99',
|
|
16
18
|
startSubsequence: '375',
|
|
17
19
|
regexp: /^(\+?375)?(24|25|29|33|44)\d{7}$/,
|
|
18
20
|
flag: 'BLR'
|
|
19
21
|
},
|
|
20
22
|
AZE: {
|
|
23
|
+
placeholder: '+994 (XX) XXX-XXXX',
|
|
21
24
|
mask: '+999 (99) 999-9999',
|
|
22
25
|
startSubsequence: '994',
|
|
23
26
|
regexp: /^\+?994\d{9}$/,
|
|
24
27
|
flag: 'AZE'
|
|
25
28
|
},
|
|
26
29
|
ARM: {
|
|
30
|
+
placeholder: '+374 (XX) XXX-XXX',
|
|
27
31
|
mask: '+999 (99) 999-999',
|
|
28
32
|
startSubsequence: '374',
|
|
29
33
|
regexp: /\+?374\d{8}/,
|
|
30
34
|
flag: 'ARM'
|
|
31
35
|
},
|
|
32
36
|
KAZ: {
|
|
37
|
+
placeholder: '+7 (XXX) XXX-XX-XX',
|
|
33
38
|
mask: '+9 (999) 999-99-99',
|
|
34
39
|
startSubsequence: '7',
|
|
35
40
|
regexp: /^(\+?7|8)?7\d{9}$/,
|
|
36
41
|
flag: 'KAZ'
|
|
37
42
|
},
|
|
38
43
|
TJK: {
|
|
44
|
+
placeholder: '+992-XX-XXX-XXXX',
|
|
39
45
|
mask: '+999-99-999-9999',
|
|
40
46
|
startSubsequence: '992',
|
|
41
47
|
regexp: /^\+?992\d{9}$/,
|
|
42
48
|
flag: 'TJK'
|
|
43
49
|
},
|
|
44
50
|
UZB: {
|
|
51
|
+
placeholder: '+998 XX XXXXXXX',
|
|
45
52
|
mask: '+999 99 9999999',
|
|
46
53
|
startSubsequence: '998',
|
|
47
54
|
regexp: /\+?998\d{9}/,
|
|
@@ -145,7 +145,8 @@ var PhoneInput = exports.PhoneInput = function PhoneInput(_ref) {
|
|
|
145
145
|
mask: currentCountriesPhoneRules[country].mask,
|
|
146
146
|
maskPlaceholder: null,
|
|
147
147
|
disabled: disabled,
|
|
148
|
-
onPaste: handlePaste
|
|
148
|
+
onPaste: handlePaste,
|
|
149
|
+
placeholder: currentCountriesPhoneRules[country].placeholder
|
|
149
150
|
}, /*#__PURE__*/_react["default"].createElement(_PureInput.PureInput, {
|
|
150
151
|
id: id,
|
|
151
152
|
hasError: hasError || (isFirstBlur ? false : isHaveInputError),
|
|
@@ -2,6 +2,7 @@ export declare const RUS_COUNTRY_CODE = "RUS";
|
|
|
2
2
|
export declare const supportedCountries: readonly ["RUS", "BLR", "AZE", "ARM", "KAZ", "TJK", "UZB"];
|
|
3
3
|
export type TSupportedCountries = (typeof supportedCountries)[number];
|
|
4
4
|
export type TCountryRule = {
|
|
5
|
+
placeholder: string;
|
|
5
6
|
mask: string;
|
|
6
7
|
startSubsequence: string;
|
|
7
8
|
regexp: RegExp;
|