intl-tel-input 19.2.7 → 19.2.8
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/README.md +2 -0
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput-jquery.js +6 -3
- package/build/js/intlTelInput-jquery.min.js +3 -3
- package/build/js/intlTelInput.js +6 -3
- package/build/js/intlTelInput.min.js +3 -3
- package/composer.json +1 -1
- package/package.json +1 -1
- package/react/build/IntlTelInput.cjs.js +2 -2
- package/react/build/IntlTelInput.cjs.js.map +3 -3
- package/react/build/IntlTelInput.esm.js +2 -2
- package/react/build/IntlTelInput.esm.js.map +3 -3
- package/react/demo/SimpleApp.js +6 -4
- package/react/demo/ValidationApp.js +4 -4
- package/react/demo/simple-bundle.js +124 -123
- package/react/demo/simple.html +3 -2
- package/react/demo/validation-bundle.js +116 -114
- package/react/demo/validation.html +4 -2
- package/react/src/IntlTelInput.js +54 -38
- package/src/js/intlTelInput.js +4 -1
|
@@ -10,6 +10,10 @@ const IntlTelInput = ({
|
|
|
10
10
|
onChangeValidity,
|
|
11
11
|
onChangeErrorCode,
|
|
12
12
|
initOptions,
|
|
13
|
+
className,
|
|
14
|
+
disabled,
|
|
15
|
+
onFocus,
|
|
16
|
+
onBlur,
|
|
13
17
|
}) => {
|
|
14
18
|
const inputRef = useRef(null);
|
|
15
19
|
const itiRef = useRef(null);
|
|
@@ -44,54 +48,66 @@ const IntlTelInput = ({
|
|
|
44
48
|
|
|
45
49
|
return (
|
|
46
50
|
<input
|
|
47
|
-
type="
|
|
51
|
+
type="tel"
|
|
48
52
|
ref={inputRef}
|
|
49
53
|
onInput={update}
|
|
50
54
|
defaultValue={initialValue}
|
|
51
|
-
|
|
55
|
+
className={className}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
onFocus={onFocus}
|
|
58
|
+
onBlur={onBlur}
|
|
59
|
+
/>
|
|
52
60
|
);
|
|
53
61
|
};
|
|
54
62
|
|
|
55
63
|
IntlTelInput.propTypes = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
initialValue: PropTypes.string,
|
|
65
|
+
onChangeNumber: PropTypes.func,
|
|
66
|
+
onChangeCountry: PropTypes.func,
|
|
67
|
+
onChangeValidity: PropTypes.func,
|
|
68
|
+
onChangeErrorCode: PropTypes.func,
|
|
69
|
+
initOptions: PropTypes.shape({
|
|
70
|
+
allowDropdown: PropTypes.bool,
|
|
71
|
+
autoInsertDialCode: PropTypes.bool,
|
|
72
|
+
autoPlaceholder: PropTypes.string,
|
|
73
|
+
containerClass: PropTypes.string,
|
|
74
|
+
countrySearch: PropTypes.bool,
|
|
75
|
+
customPlaceholder: PropTypes.func,
|
|
76
|
+
dropdownContainer: PropTypes.node,
|
|
77
|
+
excludeCountries: PropTypes.arrayOf(PropTypes.string),
|
|
78
|
+
fixDropdownWidth: PropTypes.bool,
|
|
79
|
+
formatAsYouType: PropTypes.bool,
|
|
80
|
+
formatOnDisplay: PropTypes.bool,
|
|
81
|
+
geoIpLookup: PropTypes.func,
|
|
82
|
+
hiddenInput: PropTypes.func,
|
|
83
|
+
i18n: PropTypes.objectOf(PropTypes.string),
|
|
84
|
+
initialCountry: PropTypes.string,
|
|
85
|
+
nationalMode: PropTypes.bool,
|
|
86
|
+
onlyCountries: PropTypes.arrayOf(PropTypes.string),
|
|
87
|
+
placeholderNumberType: PropTypes.string,
|
|
88
|
+
preferredCountries: PropTypes.arrayOf(PropTypes.string),
|
|
89
|
+
showFlags: PropTypes.bool,
|
|
90
|
+
showSelectedDialCode: PropTypes.bool,
|
|
91
|
+
useFullscreenPopup: PropTypes.bool,
|
|
92
|
+
utilsScript: PropTypes.string,
|
|
93
|
+
}),
|
|
94
|
+
className: PropTypes.string,
|
|
95
|
+
disabled: PropTypes.bool,
|
|
96
|
+
onFocus: PropTypes.func,
|
|
97
|
+
onBlur: PropTypes.func,
|
|
86
98
|
};
|
|
87
99
|
|
|
88
100
|
IntlTelInput.defaultProps = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
initialValue: "",
|
|
102
|
+
onChangeNumber: () => {},
|
|
103
|
+
onChangeCountry: () => {},
|
|
104
|
+
onChangeValidity: () => {},
|
|
105
|
+
onChangeErrorCode: () => {},
|
|
106
|
+
initOptions: {},
|
|
107
|
+
className: "",
|
|
108
|
+
disabled: false,
|
|
109
|
+
onFocus: () => {},
|
|
110
|
+
onBlur: () => {},
|
|
95
111
|
};
|
|
96
112
|
|
|
97
113
|
export default IntlTelInput;
|
package/src/js/intlTelInput.js
CHANGED
|
@@ -886,7 +886,10 @@ class Iti {
|
|
|
886
886
|
|
|
887
887
|
if (this.options.countrySearch) {
|
|
888
888
|
// start by highlighting the first item in the list
|
|
889
|
-
this.
|
|
889
|
+
const { firstElementChild } = this.countryList;
|
|
890
|
+
if (firstElementChild) {
|
|
891
|
+
this._highlightListItem(firstElementChild, false);
|
|
892
|
+
}
|
|
890
893
|
this.searchInput.focus();
|
|
891
894
|
} else if (this.activeItem) {
|
|
892
895
|
// update highlighting and scroll to active list item
|