@alfalab/core-components-intl-phone-input 6.4.0 → 6.5.2
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/CHANGELOG.md +35 -0
- package/dist/{component-7d88f33a.d.ts → component-fbf58e08.d.ts} +0 -0
- package/dist/{component-7d88f33a.js → component-fbf58e08.js} +1 -1
- package/dist/component.d.ts +9 -0
- package/dist/component.js +133 -64
- package/dist/components/flag-icon/component.js +1 -1
- package/dist/components/flag-icon/index.css +261 -261
- package/dist/components/index.js +1 -1
- package/dist/components/select/component.js +2 -2
- package/dist/components/select/index.css +6 -6
- package/dist/components/select/index.js +1 -1
- package/dist/components/select-field/component.js +1 -1
- package/dist/components/select-field/index.css +8 -8
- package/dist/components/select-field/index.d.ts +1 -1
- package/dist/components/select-field/index.js +1 -1
- package/dist/cssm/component.d.ts +9 -0
- package/dist/cssm/component.js +131 -62
- package/dist/cssm/index.js +1 -1
- package/dist/cssm/{libphonenumber-js.min-d3a9d490.d.ts → libphonenumber-js.min-903db150.d.ts} +0 -0
- package/dist/cssm/libphonenumber-js.min-903db150.js +2227 -0
- package/dist/cssm/useCaretAvoidCountryCode.js +24 -20
- package/dist/cssm/utils/calculateCaretPos.d.ts +7 -0
- package/dist/cssm/utils/calculateCaretPos.js +27 -0
- package/dist/esm/{component-32da0c87.d.ts → component-25b3eb47.d.ts} +0 -0
- package/dist/esm/{component-32da0c87.js → component-25b3eb47.js} +1 -1
- package/dist/esm/component.d.ts +9 -0
- package/dist/esm/component.js +134 -65
- package/dist/esm/components/flag-icon/component.js +1 -1
- package/dist/esm/components/flag-icon/index.css +261 -261
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/select/component.js +2 -2
- package/dist/esm/components/select/index.css +6 -6
- package/dist/esm/components/select/index.js +1 -1
- package/dist/esm/components/select-field/component.js +1 -1
- package/dist/esm/components/select-field/index.css +8 -8
- package/dist/esm/components/select-field/index.d.ts +1 -1
- package/dist/esm/components/select-field/index.js +1 -1
- package/dist/esm/index.css +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/{libphonenumber-js.min-c49027d7.d.ts → libphonenumber-js.min-24f2609b.d.ts} +0 -0
- package/dist/esm/libphonenumber-js.min-24f2609b.js +2225 -0
- package/dist/esm/useCaretAvoidCountryCode.js +25 -21
- package/dist/esm/utils/calculateCaretPos.d.ts +7 -0
- package/dist/esm/utils/calculateCaretPos.js +23 -0
- package/dist/index.css +3 -3
- package/dist/index.js +2 -2
- package/dist/{libphonenumber-js.min-13d3dc00.d.ts → libphonenumber-js.min-6d8f77f6.d.ts} +0 -0
- package/dist/libphonenumber-js.min-6d8f77f6.js +2227 -0
- package/dist/modern/component.d.ts +9 -0
- package/dist/modern/component.js +131 -61
- package/dist/modern/components/flag-icon/component.js +1 -1
- package/dist/modern/components/flag-icon/index.css +261 -261
- package/dist/modern/components/select/component.js +1 -1
- package/dist/modern/components/select/index.css +6 -6
- package/dist/modern/components/select-field/component.js +1 -1
- package/dist/modern/components/select-field/index.css +8 -8
- package/dist/modern/index.css +3 -3
- package/dist/modern/index.js +1 -1
- package/dist/modern/{libphonenumber-js.min-c49027d7.d.ts → libphonenumber-js.min-24f2609b.d.ts} +0 -0
- package/dist/modern/libphonenumber-js.min-24f2609b.js +2225 -0
- package/dist/modern/useCaretAvoidCountryCode.js +25 -21
- package/dist/modern/utils/calculateCaretPos.d.ts +7 -0
- package/dist/modern/utils/calculateCaretPos.js +23 -0
- package/dist/useCaretAvoidCountryCode.js +24 -20
- package/dist/utils/calculateCaretPos.d.ts +7 -0
- package/dist/utils/calculateCaretPos.js +27 -0
- package/package.json +6 -6
- package/dist/cssm/libphonenumber-js.min-d3a9d490.js +0 -1569
- package/dist/cssm/usePreventCaretReset.d.ts +0 -8
- package/dist/cssm/usePreventCaretReset.js +0 -36
- package/dist/esm/libphonenumber-js.min-c49027d7.js +0 -1567
- package/dist/esm/usePreventCaretReset.d.ts +0 -8
- package/dist/esm/usePreventCaretReset.js +0 -32
- package/dist/libphonenumber-js.min-13d3dc00.js +0 -1569
- package/dist/modern/libphonenumber-js.min-c49027d7.js +0 -1567
- package/dist/modern/usePreventCaretReset.d.ts +0 -8
- package/dist/modern/usePreventCaretReset.js +0 -31
- package/dist/usePreventCaretReset.d.ts +0 -8
- package/dist/usePreventCaretReset.js +0 -36
|
@@ -4,6 +4,7 @@ import { CountryCode } from 'libphonenumber-js';
|
|
|
4
4
|
import { SelectProps } from "@alfalab/core-components-select";
|
|
5
5
|
import { Country } from '@alfalab/utils';
|
|
6
6
|
import { InputAutocompleteProps } from "@alfalab/core-components-input-autocomplete";
|
|
7
|
+
type MaxPhoneLenByCountry = Record<string, number>;
|
|
7
8
|
type IntlPhoneInputProps = Partial<Omit<InputAutocompleteProps, 'onChange'>> & Pick<SelectProps, 'preventFlip'> & {
|
|
8
9
|
/**
|
|
9
10
|
* Значение
|
|
@@ -33,6 +34,10 @@ type IntlPhoneInputProps = Partial<Omit<InputAutocompleteProps, 'onChange'>> & P
|
|
|
33
34
|
* Возможность стереть код страны
|
|
34
35
|
*/
|
|
35
36
|
clearableCountryCode?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Ограничение длин вводимых номеров по странам.
|
|
39
|
+
*/
|
|
40
|
+
maxPhoneLen?: MaxPhoneLenByCountry;
|
|
36
41
|
};
|
|
37
42
|
declare const IntlPhoneInput: React.ForwardRefExoticComponent<Partial<Pick<InputAutocompleteProps, "selected" | "valueRenderer" | "Optgroup" | "size" | "value" | "disabled" | "multiple" | "name" | "placeholder" | "readOnly" | "className" | "id" | "onFocus" | "onBlur" | "onInput" | "onScroll" | "optionsListWidth" | "options" | "visibleOptions" | "open" | "label" | "error" | "hint" | "Arrow" | "dataTestId" | "fieldClassName" | "success" | "block" | "optionGroupClassName" | "Option" | "inputProps" | "optionsListClassName" | "optionClassName" | "popperClassName" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "circularNavigation" | "defaultOpen" | "popoverPosition" | "preventFlip" | "optionsSize" | "fieldProps" | "optionsListProps" | "optionProps" | "onOpen" | "OptionsList" | "updatePopover" | "zIndexPopover" | "showEmptyOptionsList" | "Input">> & Pick<SelectProps, "preventFlip"> & {
|
|
38
43
|
/**
|
|
@@ -63,5 +68,9 @@ declare const IntlPhoneInput: React.ForwardRefExoticComponent<Partial<Pick<Input
|
|
|
63
68
|
* Возможность стереть код страны
|
|
64
69
|
*/
|
|
65
70
|
clearableCountryCode?: boolean | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Ограничение длин вводимых номеров по странам.
|
|
73
|
+
*/
|
|
74
|
+
maxPhoneLen?: Record<string, number> | undefined;
|
|
66
75
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
67
76
|
export { IntlPhoneInputProps, IntlPhoneInput };
|
package/dist/modern/component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useState, useRef,
|
|
1
|
+
import React, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { getCountriesHash, getCountries } from '@alfalab/utils';
|
|
4
4
|
import { InputAutocomplete } from '@alfalab/core-components-input-autocomplete/dist/modern';
|
|
@@ -9,97 +9,91 @@ import './components/select-field/component.js';
|
|
|
9
9
|
import '@alfalab/core-components-select/dist/modern';
|
|
10
10
|
import { CountriesSelect } from './components/select/component.js';
|
|
11
11
|
import { formatPhoneWithUnclearableCountryCode } from './utils/format-phone-with-unclearable-country-code.js';
|
|
12
|
+
import { calculateCaretPos } from './utils/calculateCaretPos.js';
|
|
12
13
|
import { useCaretAvoidCountryCode } from './useCaretAvoidCountryCode.js';
|
|
13
|
-
import { usePreventCaretReset } from './usePreventCaretReset.js';
|
|
14
14
|
|
|
15
|
-
var styles = {"addons":"intl-phone-
|
|
15
|
+
var styles = {"addons":"intl-phone-input__addons_rhr68","l":"intl-phone-input__l_rhr68","xl":"intl-phone-input__xl_rhr68"};
|
|
16
16
|
require('./index.css')
|
|
17
17
|
|
|
18
18
|
const countriesHash = getCountriesHash();
|
|
19
19
|
const MAX_DIAL_CODE_LENGTH = 4;
|
|
20
|
-
const
|
|
20
|
+
const MASK_SYMBOLS = [' ', '-', '(', ')'];
|
|
21
|
+
const MAX_PHONE_LEN = 15;
|
|
22
|
+
const DEFAULT_MAX_PHONE_LEN_BY_COUNTRY = { RU: 11 };
|
|
23
|
+
const IntlPhoneInput = forwardRef(({ disabled = false, readOnly = false, size = 'm', colors = 'default', options = [], countries = getCountries(), clearableCountryCode = true, className, value, onChange, onCountryChange, defaultCountryIso2 = 'ru', preventFlip, inputProps, maxPhoneLen = DEFAULT_MAX_PHONE_LEN_BY_COUNTRY, ...restProps }, ref) => {
|
|
21
24
|
const [countryIso2, setCountryIso2] = useState(defaultCountryIso2.toLowerCase());
|
|
22
25
|
const inputRef = useRef(null);
|
|
23
26
|
const [inputWrapperRef, setInputWrapperRef] = useState(null);
|
|
27
|
+
const [caretPos, setCaretPos] = useState();
|
|
24
28
|
const phoneLibUtils = useRef();
|
|
25
|
-
const
|
|
26
|
-
const country = countriesHash[iso2];
|
|
27
|
-
const inputValue = `+${country.dialCode}`;
|
|
28
|
-
onChange(inputValue);
|
|
29
|
-
setCountryIso2(country.iso2);
|
|
30
|
-
return country;
|
|
31
|
-
}, [onChange]);
|
|
32
|
-
const setValue = useCallback(inputValue => {
|
|
29
|
+
const formatPhone = (inputValue) => {
|
|
33
30
|
let newValue = inputValue;
|
|
34
31
|
if (phoneLibUtils.current) {
|
|
35
32
|
const Utils = phoneLibUtils.current;
|
|
36
33
|
const utils = new Utils(countryIso2.toUpperCase());
|
|
37
34
|
newValue = utils.input(inputValue);
|
|
38
35
|
}
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
const
|
|
36
|
+
return newValue;
|
|
37
|
+
};
|
|
38
|
+
const setCountryByIso2 = (iso2) => {
|
|
39
|
+
const country = countriesHash[iso2];
|
|
40
|
+
const inputValue = `+${country.dialCode}`;
|
|
41
|
+
onChange(inputValue);
|
|
42
|
+
setCountryIso2(country.iso2);
|
|
43
|
+
return country;
|
|
44
|
+
};
|
|
45
|
+
const handleCountryChange = (countryCode) => {
|
|
42
46
|
if (onCountryChange) {
|
|
43
47
|
onCountryChange(countryCode.toUpperCase());
|
|
44
48
|
}
|
|
45
|
-
}
|
|
46
|
-
const setCountryByDialCode =
|
|
49
|
+
};
|
|
50
|
+
const setCountryByDialCode = (inputValue) => {
|
|
47
51
|
for (let i = 0; i < countries.length; i++) {
|
|
48
52
|
const country = countries[i];
|
|
49
53
|
if (new RegExp(`^\\+${country.dialCode}`).test(inputValue)) {
|
|
50
54
|
// Сначала проверяем, если приоритет не указан
|
|
51
55
|
if (country.priority === undefined) {
|
|
52
|
-
|
|
56
|
+
onChange(formatPhone(inputValue));
|
|
53
57
|
setCountryIso2(country.iso2);
|
|
54
58
|
handleCountryChange(country.iso2);
|
|
55
59
|
break;
|
|
56
60
|
}
|
|
57
61
|
// Если страна уже была выставлена через селект, и коды совпадают
|
|
58
62
|
if (countryIso2 === country.iso2) {
|
|
59
|
-
|
|
63
|
+
onChange(formatPhone(inputValue));
|
|
60
64
|
setCountryIso2(country.iso2);
|
|
61
65
|
handleCountryChange(country.iso2);
|
|
62
66
|
break;
|
|
63
67
|
// Если не совпадают - выбираем по приоритету
|
|
64
68
|
}
|
|
65
69
|
else if (country.priority === 0) {
|
|
66
|
-
|
|
70
|
+
onChange(formatPhone(inputValue));
|
|
67
71
|
setCountryIso2(country.iso2);
|
|
68
72
|
handleCountryChange(country.iso2);
|
|
69
73
|
break;
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
|
-
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.catch(error => `An error occurred while loading libphonenumber-js:\n${error}`);
|
|
81
|
-
}, []);
|
|
82
|
-
const handleInputChange = useCallback((event) => {
|
|
83
|
-
const { target: { value: targetValue }, } = event;
|
|
77
|
+
};
|
|
78
|
+
const setCountryByDialCodeWithLengthCheck = (inputValue) => {
|
|
79
|
+
if (value.length < MAX_DIAL_CODE_LENGTH) {
|
|
80
|
+
setCountryByDialCode(inputValue);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const addCountryCode = (inputValue) => {
|
|
84
84
|
const country = countriesHash[countryIso2];
|
|
85
85
|
if (clearableCountryCode) {
|
|
86
|
-
|
|
87
|
-
? `+${
|
|
88
|
-
:
|
|
89
|
-
setValue(newValue);
|
|
90
|
-
if (value.length < MAX_DIAL_CODE_LENGTH) {
|
|
91
|
-
setCountryByDialCode(newValue);
|
|
92
|
-
}
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (!clearableCountryCode) {
|
|
96
|
-
const newValue = formatPhoneWithUnclearableCountryCode(targetValue, country);
|
|
97
|
-
setValue(newValue);
|
|
98
|
-
return;
|
|
86
|
+
return inputValue.length === 1 && inputValue !== '+'
|
|
87
|
+
? `+${inputValue}`
|
|
88
|
+
: inputValue;
|
|
99
89
|
}
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
const
|
|
90
|
+
return formatPhoneWithUnclearableCountryCode(inputValue, country);
|
|
91
|
+
};
|
|
92
|
+
const handleInputChange = (event) => {
|
|
93
|
+
setCountryByDialCodeWithLengthCheck(event.target.value);
|
|
94
|
+
onChange(formatPhone(addCountryCode(event.target.value)));
|
|
95
|
+
};
|
|
96
|
+
const handleSelectChange = ({ selected }) => {
|
|
103
97
|
if (selected) {
|
|
104
98
|
const country = setCountryByIso2(selected.value);
|
|
105
99
|
const inputValue = `+${country.dialCode}`;
|
|
@@ -109,27 +103,102 @@ const IntlPhoneInput = forwardRef(({ disabled = false, readOnly = false, size =
|
|
|
109
103
|
}
|
|
110
104
|
handleCountryChange(country.iso2);
|
|
111
105
|
}
|
|
112
|
-
}
|
|
113
|
-
const handleChange =
|
|
106
|
+
};
|
|
107
|
+
const handleChange = (payload) => {
|
|
114
108
|
const { selected } = payload;
|
|
115
109
|
if (!selected)
|
|
116
110
|
return;
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
setCountryByDialCodeWithLengthCheck(selected.key);
|
|
112
|
+
onChange(formatPhone(selected.key));
|
|
113
|
+
};
|
|
114
|
+
const country = countriesHash[countryIso2];
|
|
115
|
+
const countryCodeLength = `+${country.dialCode}`.length;
|
|
116
|
+
const handleInputNewChar = (event, caretPosition) => {
|
|
117
|
+
const input = event.target;
|
|
118
|
+
const currentValue = input.value;
|
|
119
|
+
const maxPhoneLength = maxPhoneLen?.[countryIso2.toUpperCase()] || MAX_PHONE_LEN;
|
|
120
|
+
// Если номер полностью заполнен, то перезатираем цифры, если каретка не в самом конце.
|
|
121
|
+
const shouldReplace = maxPhoneLength === currentValue.replace(/\D/g, '').length;
|
|
122
|
+
let endPhonePart = currentValue.slice(caretPosition);
|
|
123
|
+
if (shouldReplace) {
|
|
124
|
+
let cursor = 0;
|
|
125
|
+
while (MASK_SYMBOLS.includes(endPhonePart.charAt(cursor))) {
|
|
126
|
+
cursor += 1;
|
|
127
|
+
}
|
|
128
|
+
endPhonePart = endPhonePart.slice(cursor + 1);
|
|
129
|
+
}
|
|
130
|
+
let newValue = currentValue.slice(0, caretPosition) + event.key + endPhonePart;
|
|
131
|
+
// Запрещаем ввод, если номер уже заполнен.
|
|
132
|
+
if (newValue.replace(/\D/g, '').length > maxPhoneLength) {
|
|
133
|
+
newValue = newValue.slice(0, -1);
|
|
134
|
+
}
|
|
135
|
+
newValue = formatPhone(addCountryCode(newValue));
|
|
136
|
+
let phonePartWithoutMask = currentValue.slice(0, caretPosition).replace(/\D/g, '') + event.key;
|
|
137
|
+
if (shouldReplace && phonePartWithoutMask.length > maxPhoneLength) {
|
|
138
|
+
phonePartWithoutMask = phonePartWithoutMask.slice(0, -1);
|
|
139
|
+
}
|
|
140
|
+
setCaretPos(calculateCaretPos(phonePartWithoutMask, newValue));
|
|
141
|
+
setCountryByDialCodeWithLengthCheck(newValue);
|
|
142
|
+
onChange(newValue);
|
|
143
|
+
};
|
|
144
|
+
const handleDeleteChar = (event, caretPosition) => {
|
|
145
|
+
const input = event.target;
|
|
146
|
+
if (!clearableCountryCode && caretPosition <= countryCodeLength)
|
|
147
|
+
return;
|
|
148
|
+
const currentValue = input.value;
|
|
149
|
+
const isMaskSymbol = (count) => {
|
|
150
|
+
const isMask = MASK_SYMBOLS.includes(currentValue.charAt(caretPosition - count));
|
|
151
|
+
const isPossibleToRemove = clearableCountryCode
|
|
152
|
+
? caretPosition - count > 0
|
|
153
|
+
: caretPosition - count > countryCodeLength;
|
|
154
|
+
return isMask && isPossibleToRemove;
|
|
155
|
+
};
|
|
156
|
+
let deletedCharsCount = 1;
|
|
157
|
+
// Высчитываем кол-во символов, которые нужно удалить.
|
|
158
|
+
while (isMaskSymbol(deletedCharsCount)) {
|
|
159
|
+
deletedCharsCount += 1;
|
|
160
|
+
}
|
|
161
|
+
const phonePart = currentValue.slice(0, caretPosition - deletedCharsCount);
|
|
162
|
+
const newValue = formatPhone(addCountryCode(phonePart + currentValue.slice(caretPosition)));
|
|
163
|
+
const phonePartWithoutMask = phonePart.replace(/[^0-9+]+/g, '');
|
|
164
|
+
setCaretPos(calculateCaretPos(phonePartWithoutMask, newValue));
|
|
165
|
+
setCountryByDialCodeWithLengthCheck(newValue);
|
|
166
|
+
onChange(newValue);
|
|
167
|
+
};
|
|
168
|
+
const handleKeyDown = (event) => {
|
|
169
|
+
const input = event.target;
|
|
170
|
+
const caretPosition = input.selectionStart || 0;
|
|
171
|
+
// Нажат только Backspace, не сочетание клавиш с ним.
|
|
172
|
+
if (!event.shiftKey && !event.ctrlKey && !event.metaKey && event.key === 'Backspace') {
|
|
173
|
+
if (!caretPosition)
|
|
174
|
+
return;
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
handleDeleteChar(event, caretPosition);
|
|
119
177
|
}
|
|
120
|
-
|
|
121
|
-
|
|
178
|
+
if (event.key.length === 1 && /[0-9+]/.test(event.key)) {
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
handleInputNewChar(event, caretPosition);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
122
183
|
useEffect(() => {
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
});
|
|
184
|
+
if (inputRef.current && caretPos !== undefined) {
|
|
185
|
+
inputRef.current.setSelectionRange(caretPos, caretPos);
|
|
186
|
+
setCaretPos(undefined);
|
|
127
187
|
}
|
|
128
|
-
}, [
|
|
129
|
-
|
|
130
|
-
|
|
188
|
+
}, [caretPos]);
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
if (phoneLibUtils.current)
|
|
191
|
+
return;
|
|
192
|
+
import(
|
|
193
|
+
/* webpackChunkName: "libphonenumber" */ './libphonenumber-js.min-24f2609b.js')
|
|
194
|
+
.then(utils => {
|
|
195
|
+
phoneLibUtils.current = utils.AsYouType;
|
|
196
|
+
setCountryByDialCode(value);
|
|
197
|
+
})
|
|
198
|
+
.catch(error => `An error occurred while loading libphonenumber-js:\n${error}`);
|
|
199
|
+
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
200
|
+
}, [value]);
|
|
131
201
|
useCaretAvoidCountryCode({ inputRef, countryCodeLength, clearableCountryCode });
|
|
132
|
-
usePreventCaretReset({ inputRef, countryCodeLength, clearableCountryCode });
|
|
133
202
|
return (React.createElement(InputAutocomplete, Object.assign({}, restProps, { ref: ref, inputProps: {
|
|
134
203
|
...inputProps,
|
|
135
204
|
ref: inputRef,
|
|
@@ -138,6 +207,7 @@ const IntlPhoneInput = forwardRef(({ disabled = false, readOnly = false, size =
|
|
|
138
207
|
colors,
|
|
139
208
|
className: cn(className, styles[size]),
|
|
140
209
|
addonsClassName: styles.addons,
|
|
210
|
+
onKeyDown: handleKeyDown,
|
|
141
211
|
leftAddons: countries.length > 1 && (React.createElement(CountriesSelect, { dataTestId: 'countries-select', disabled: disabled || readOnly, size: size, selected: countryIso2, countries: countries, onChange: handleSelectChange, fieldWidth: inputWrapperRef && inputWrapperRef.getBoundingClientRect().width, preventFlip: preventFlip })),
|
|
142
212
|
}, optionsListWidth: 'field', closeOnSelect: true, onInput: handleInputChange, onChange: handleChange, options: options, disabled: disabled, readOnly: readOnly, size: size, className: className, value: value })));
|
|
143
213
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
var styles = {"flagIcon":"intl-phone-
|
|
4
|
+
var styles = {"flagIcon":"intl-phone-input__flagIcon_2sxng","ac":"intl-phone-input__ac_2sxng","ad":"intl-phone-input__ad_2sxng","ae":"intl-phone-input__ae_2sxng","af":"intl-phone-input__af_2sxng","ag":"intl-phone-input__ag_2sxng","ai":"intl-phone-input__ai_2sxng","al":"intl-phone-input__al_2sxng","am":"intl-phone-input__am_2sxng","ao":"intl-phone-input__ao_2sxng","aq":"intl-phone-input__aq_2sxng","ar":"intl-phone-input__ar_2sxng","as":"intl-phone-input__as_2sxng","at":"intl-phone-input__at_2sxng","au":"intl-phone-input__au_2sxng","aw":"intl-phone-input__aw_2sxng","ax":"intl-phone-input__ax_2sxng","az":"intl-phone-input__az_2sxng","ba":"intl-phone-input__ba_2sxng","bb":"intl-phone-input__bb_2sxng","bd":"intl-phone-input__bd_2sxng","be":"intl-phone-input__be_2sxng","bf":"intl-phone-input__bf_2sxng","bg":"intl-phone-input__bg_2sxng","bh":"intl-phone-input__bh_2sxng","bi":"intl-phone-input__bi_2sxng","bj":"intl-phone-input__bj_2sxng","bl":"intl-phone-input__bl_2sxng","bm":"intl-phone-input__bm_2sxng","bn":"intl-phone-input__bn_2sxng","bo":"intl-phone-input__bo_2sxng","bq":"intl-phone-input__bq_2sxng","br":"intl-phone-input__br_2sxng","bs":"intl-phone-input__bs_2sxng","bt":"intl-phone-input__bt_2sxng","bv":"intl-phone-input__bv_2sxng","bw":"intl-phone-input__bw_2sxng","by":"intl-phone-input__by_2sxng","bz":"intl-phone-input__bz_2sxng","ca":"intl-phone-input__ca_2sxng","cc":"intl-phone-input__cc_2sxng","cd":"intl-phone-input__cd_2sxng","cf":"intl-phone-input__cf_2sxng","cg":"intl-phone-input__cg_2sxng","ch":"intl-phone-input__ch_2sxng","ci":"intl-phone-input__ci_2sxng","ck":"intl-phone-input__ck_2sxng","cl":"intl-phone-input__cl_2sxng","cm":"intl-phone-input__cm_2sxng","cn":"intl-phone-input__cn_2sxng","co":"intl-phone-input__co_2sxng","cp":"intl-phone-input__cp_2sxng","cr":"intl-phone-input__cr_2sxng","cu":"intl-phone-input__cu_2sxng","cv":"intl-phone-input__cv_2sxng","cw":"intl-phone-input__cw_2sxng","cx":"intl-phone-input__cx_2sxng","cy":"intl-phone-input__cy_2sxng","cz":"intl-phone-input__cz_2sxng","de":"intl-phone-input__de_2sxng","dg":"intl-phone-input__dg_2sxng","dj":"intl-phone-input__dj_2sxng","dk":"intl-phone-input__dk_2sxng","dm":"intl-phone-input__dm_2sxng","do":"intl-phone-input__do_2sxng","dz":"intl-phone-input__dz_2sxng","ea":"intl-phone-input__ea_2sxng","ec":"intl-phone-input__ec_2sxng","ee":"intl-phone-input__ee_2sxng","eg":"intl-phone-input__eg_2sxng","eh":"intl-phone-input__eh_2sxng","er":"intl-phone-input__er_2sxng","es":"intl-phone-input__es_2sxng","et":"intl-phone-input__et_2sxng","eu":"intl-phone-input__eu_2sxng","fi":"intl-phone-input__fi_2sxng","fj":"intl-phone-input__fj_2sxng","fk":"intl-phone-input__fk_2sxng","fm":"intl-phone-input__fm_2sxng","fo":"intl-phone-input__fo_2sxng","fr":"intl-phone-input__fr_2sxng","ga":"intl-phone-input__ga_2sxng","gb":"intl-phone-input__gb_2sxng","gd":"intl-phone-input__gd_2sxng","ge":"intl-phone-input__ge_2sxng","gf":"intl-phone-input__gf_2sxng","gg":"intl-phone-input__gg_2sxng","gh":"intl-phone-input__gh_2sxng","gi":"intl-phone-input__gi_2sxng","gl":"intl-phone-input__gl_2sxng","gm":"intl-phone-input__gm_2sxng","gn":"intl-phone-input__gn_2sxng","gp":"intl-phone-input__gp_2sxng","gq":"intl-phone-input__gq_2sxng","gr":"intl-phone-input__gr_2sxng","gs":"intl-phone-input__gs_2sxng","gt":"intl-phone-input__gt_2sxng","gu":"intl-phone-input__gu_2sxng","gw":"intl-phone-input__gw_2sxng","gy":"intl-phone-input__gy_2sxng","hk":"intl-phone-input__hk_2sxng","hm":"intl-phone-input__hm_2sxng","hn":"intl-phone-input__hn_2sxng","hr":"intl-phone-input__hr_2sxng","ht":"intl-phone-input__ht_2sxng","hu":"intl-phone-input__hu_2sxng","ic":"intl-phone-input__ic_2sxng","id":"intl-phone-input__id_2sxng","ie":"intl-phone-input__ie_2sxng","il":"intl-phone-input__il_2sxng","im":"intl-phone-input__im_2sxng","in":"intl-phone-input__in_2sxng","io":"intl-phone-input__io_2sxng","iq":"intl-phone-input__iq_2sxng","ir":"intl-phone-input__ir_2sxng","is":"intl-phone-input__is_2sxng","it":"intl-phone-input__it_2sxng","je":"intl-phone-input__je_2sxng","jm":"intl-phone-input__jm_2sxng","jo":"intl-phone-input__jo_2sxng","jp":"intl-phone-input__jp_2sxng","ke":"intl-phone-input__ke_2sxng","kg":"intl-phone-input__kg_2sxng","kh":"intl-phone-input__kh_2sxng","ki":"intl-phone-input__ki_2sxng","km":"intl-phone-input__km_2sxng","kn":"intl-phone-input__kn_2sxng","kp":"intl-phone-input__kp_2sxng","kr":"intl-phone-input__kr_2sxng","kw":"intl-phone-input__kw_2sxng","ky":"intl-phone-input__ky_2sxng","kz":"intl-phone-input__kz_2sxng","la":"intl-phone-input__la_2sxng","lb":"intl-phone-input__lb_2sxng","lc":"intl-phone-input__lc_2sxng","li":"intl-phone-input__li_2sxng","lk":"intl-phone-input__lk_2sxng","lr":"intl-phone-input__lr_2sxng","ls":"intl-phone-input__ls_2sxng","lt":"intl-phone-input__lt_2sxng","lu":"intl-phone-input__lu_2sxng","lv":"intl-phone-input__lv_2sxng","ly":"intl-phone-input__ly_2sxng","ma":"intl-phone-input__ma_2sxng","mc":"intl-phone-input__mc_2sxng","md":"intl-phone-input__md_2sxng","me":"intl-phone-input__me_2sxng","mf":"intl-phone-input__mf_2sxng","mg":"intl-phone-input__mg_2sxng","mh":"intl-phone-input__mh_2sxng","mk":"intl-phone-input__mk_2sxng","ml":"intl-phone-input__ml_2sxng","mm":"intl-phone-input__mm_2sxng","mn":"intl-phone-input__mn_2sxng","mo":"intl-phone-input__mo_2sxng","mp":"intl-phone-input__mp_2sxng","mq":"intl-phone-input__mq_2sxng","mr":"intl-phone-input__mr_2sxng","ms":"intl-phone-input__ms_2sxng","mt":"intl-phone-input__mt_2sxng","mu":"intl-phone-input__mu_2sxng","mv":"intl-phone-input__mv_2sxng","mw":"intl-phone-input__mw_2sxng","mx":"intl-phone-input__mx_2sxng","my":"intl-phone-input__my_2sxng","mz":"intl-phone-input__mz_2sxng","na":"intl-phone-input__na_2sxng","nc":"intl-phone-input__nc_2sxng","ne":"intl-phone-input__ne_2sxng","nf":"intl-phone-input__nf_2sxng","ng":"intl-phone-input__ng_2sxng","ni":"intl-phone-input__ni_2sxng","nl":"intl-phone-input__nl_2sxng","no":"intl-phone-input__no_2sxng","np":"intl-phone-input__np_2sxng","nr":"intl-phone-input__nr_2sxng","nu":"intl-phone-input__nu_2sxng","nz":"intl-phone-input__nz_2sxng","om":"intl-phone-input__om_2sxng","pa":"intl-phone-input__pa_2sxng","pe":"intl-phone-input__pe_2sxng","pf":"intl-phone-input__pf_2sxng","pg":"intl-phone-input__pg_2sxng","ph":"intl-phone-input__ph_2sxng","pk":"intl-phone-input__pk_2sxng","pl":"intl-phone-input__pl_2sxng","pm":"intl-phone-input__pm_2sxng","pn":"intl-phone-input__pn_2sxng","pr":"intl-phone-input__pr_2sxng","ps":"intl-phone-input__ps_2sxng","pt":"intl-phone-input__pt_2sxng","pw":"intl-phone-input__pw_2sxng","py":"intl-phone-input__py_2sxng","qa":"intl-phone-input__qa_2sxng","re":"intl-phone-input__re_2sxng","ro":"intl-phone-input__ro_2sxng","rs":"intl-phone-input__rs_2sxng","ru":"intl-phone-input__ru_2sxng","rw":"intl-phone-input__rw_2sxng","sa":"intl-phone-input__sa_2sxng","sb":"intl-phone-input__sb_2sxng","sc":"intl-phone-input__sc_2sxng","sd":"intl-phone-input__sd_2sxng","se":"intl-phone-input__se_2sxng","sg":"intl-phone-input__sg_2sxng","sh":"intl-phone-input__sh_2sxng","si":"intl-phone-input__si_2sxng","sj":"intl-phone-input__sj_2sxng","sk":"intl-phone-input__sk_2sxng","sl":"intl-phone-input__sl_2sxng","sm":"intl-phone-input__sm_2sxng","sn":"intl-phone-input__sn_2sxng","so":"intl-phone-input__so_2sxng","sr":"intl-phone-input__sr_2sxng","ss":"intl-phone-input__ss_2sxng","st":"intl-phone-input__st_2sxng","sv":"intl-phone-input__sv_2sxng","sx":"intl-phone-input__sx_2sxng","sy":"intl-phone-input__sy_2sxng","sz":"intl-phone-input__sz_2sxng","ta":"intl-phone-input__ta_2sxng","tc":"intl-phone-input__tc_2sxng","td":"intl-phone-input__td_2sxng","tf":"intl-phone-input__tf_2sxng","tg":"intl-phone-input__tg_2sxng","th":"intl-phone-input__th_2sxng","tj":"intl-phone-input__tj_2sxng","tk":"intl-phone-input__tk_2sxng","tl":"intl-phone-input__tl_2sxng","tm":"intl-phone-input__tm_2sxng","tn":"intl-phone-input__tn_2sxng","to":"intl-phone-input__to_2sxng","tr":"intl-phone-input__tr_2sxng","tt":"intl-phone-input__tt_2sxng","tv":"intl-phone-input__tv_2sxng","tw":"intl-phone-input__tw_2sxng","tz":"intl-phone-input__tz_2sxng","ua":"intl-phone-input__ua_2sxng","ug":"intl-phone-input__ug_2sxng","um":"intl-phone-input__um_2sxng","un":"intl-phone-input__un_2sxng","us":"intl-phone-input__us_2sxng","uy":"intl-phone-input__uy_2sxng","uz":"intl-phone-input__uz_2sxng","va":"intl-phone-input__va_2sxng","vc":"intl-phone-input__vc_2sxng","ve":"intl-phone-input__ve_2sxng","vg":"intl-phone-input__vg_2sxng","vi":"intl-phone-input__vi_2sxng","vn":"intl-phone-input__vn_2sxng","vu":"intl-phone-input__vu_2sxng","wf":"intl-phone-input__wf_2sxng","ws":"intl-phone-input__ws_2sxng","xk":"intl-phone-input__xk_2sxng","ye":"intl-phone-input__ye_2sxng","yt":"intl-phone-input__yt_2sxng","za":"intl-phone-input__za_2sxng","zm":"intl-phone-input__zm_2sxng","zw":"intl-phone-input__zw_2sxng"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
/**
|