@intl-tel-input/react 28.0.1 → 28.0.3

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 CHANGED
@@ -1,9 +1,19 @@
1
- # IntlTelInput React Component
1
+ # React component for intl-tel-input
2
2
 
3
- A React component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript plugin. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/packages/react/src/IntlTelInput.tsx).
3
+ For entering, formatting, and validating international telephone numbers.
4
4
 
5
5
  [Explore docs »](https://intl-tel-input.com/docs/react-component)
6
6
 
7
+ <picture>
8
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/iti-github-dark.png">
9
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/iti-github-light.png">
10
+ <img width="271" height="279" alt="intl-tel-input screenshot showing country dropdown open" src="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/iti-github-light.png">
11
+ </picture>
12
+
13
+ ## Resources
14
+
15
+ Check out the [website](https://intl-tel-input.com), where you can find [a full set of docs](https://intl-tel-input.com/docs/react-component), a [live playground](https://intl-tel-input.com/playground/) where you can try out all of the options, as well as plenty of [examples](https://intl-tel-input.com/examples/react-component/validation) of different setups.
16
+
7
17
  ## Running the demos locally
8
18
 
9
19
  1. Initialise the submodules: `git submodule update --init --recursive`
@@ -11,3 +21,11 @@ A React component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-
11
21
  3. Build: `npm run build`
12
22
 
13
23
  You can then open `packages/react/demo/validation/index.html` in your browser to try the validation demo. View the full list of [available demos](https://github.com/jackocnr/intl-tel-input/tree/master/packages/react/demo).
24
+
25
+ ## Issues and contributing
26
+
27
+ Please report issues and open pull requests on the [main repository](https://github.com/jackocnr/intl-tel-input).
28
+
29
+ ## License
30
+
31
+ MIT
@@ -1738,7 +1738,7 @@ var allCountries = [];
1738
1738
  for (const c of rawCountryData) {
1739
1739
  allCountries.push({
1740
1740
  name: "",
1741
- // populated in the plugin
1741
+ // populated in the core library
1742
1742
  iso2: c[0],
1743
1743
  dialCode: c[1],
1744
1744
  priority: c[2] || 0,
@@ -1958,14 +1958,14 @@ var defaults = {
1958
1958
  geoIpLookup: null,
1959
1959
  //* Inject a hidden input with the name returned from this function, and on submit, populate it with the result of getNumber.
1960
1960
  hiddenInput: null,
1961
- //* Internationalise the plugin text e.g. search input placeholder, country names.
1961
+ //* Internationalise the core library text e.g. search input placeholder, country names.
1962
1962
  i18n: {},
1963
1963
  //* Initial country.
1964
1964
  initialCountry: "",
1965
1965
  //* A function to load the utils script.
1966
1966
  loadUtils: null,
1967
1967
  //* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
1968
- nationalMode: true,
1968
+ nationalMode: false,
1969
1969
  //* Display only these countries.
1970
1970
  onlyCountries: null,
1971
1971
  //* Number type to use for placeholders.
@@ -2447,7 +2447,7 @@ var UI = class _UI {
2447
2447
  );
2448
2448
  }
2449
2449
  }
2450
- //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
2450
+ //* Generate all of the markup for the core library: the selected country overlay, and the dropdown.
2451
2451
  buildMarkup(countries, searchTokens) {
2452
2452
  this.#countries = countries;
2453
2453
  this.#searchTokens = searchTokens;
@@ -4374,7 +4374,7 @@ var Iti = class _Iti {
4374
4374
  //********************
4375
4375
  //* PUBLIC METHODS
4376
4376
  //********************
4377
- //* Remove plugin.
4377
+ //* Remove core library.
4378
4378
  destroy() {
4379
4379
  if (!this.#isActive) {
4380
4380
  return;
@@ -4623,7 +4623,7 @@ var intlTelInput = Object.assign(
4623
4623
  documentReady: () => document.readyState === "complete",
4624
4624
  //* Get the country data object.
4625
4625
  getCountryData: () => data_default,
4626
- //* A getter for the plugin instance.
4626
+ //* A getter for the core library instance.
4627
4627
  getInstance: (input) => {
4628
4628
  const id = input.dataset[DATA_KEYS.INSTANCE_ID];
4629
4629
  return id ? intlTelInput.instances.get(id) ?? null : null;
@@ -4633,7 +4633,7 @@ var intlTelInput = Object.assign(
4633
4633
  attachUtils,
4634
4634
  startedLoadingUtils: false,
4635
4635
  startedLoadingAutoCountry: false,
4636
- version: "28.0.1",
4636
+ version: "28.0.3",
4637
4637
  NUMBER_FORMAT,
4638
4638
  NUMBER_TYPE,
4639
4639
  VALIDATION_ERROR
@@ -4671,7 +4671,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
4671
4671
  }, ref) {
4672
4672
  const inputRef = useRef(null);
4673
4673
  const itiRef = useRef(null);
4674
- const pluginInputClassesRef = useRef("");
4674
+ const libraryInputClassesRef = useRef("");
4675
4675
  const lastEmittedNumberRef = useRef(void 0);
4676
4676
  const lastEmittedCountryRef = useRef(void 0);
4677
4677
  const lastEmittedValidityRef = useRef(void 0);
@@ -4738,7 +4738,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
4738
4738
  return void 0;
4739
4739
  }
4740
4740
  itiRef.current = intlTelInput_default(inputEl, initOptions);
4741
- pluginInputClassesRef.current = inputEl.className;
4741
+ libraryInputClassesRef.current = inputEl.className;
4742
4742
  const handleOpen = () => onOpenCountryDropdownRef.current?.();
4743
4743
  const handleClose = () => onCloseCountryDropdownRef.current?.();
4744
4744
  const handleStrictReject = (e) => {
@@ -4802,7 +4802,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
4802
4802
  if (ignoredInputProps.has(key)) {
4803
4803
  warnInputProp(key);
4804
4804
  } else if (key === "className") {
4805
- sanitizedInputProps[key] = `${pluginInputClassesRef.current} ${val}`;
4805
+ sanitizedInputProps[key] = `${libraryInputClassesRef.current} ${val}`;
4806
4806
  } else {
4807
4807
  sanitizedInputProps[key] = val;
4808
4808
  }
@@ -1738,7 +1738,7 @@ var allCountries = [];
1738
1738
  for (const c of rawCountryData) {
1739
1739
  allCountries.push({
1740
1740
  name: "",
1741
- // populated in the plugin
1741
+ // populated in the core library
1742
1742
  iso2: c[0],
1743
1743
  dialCode: c[1],
1744
1744
  priority: c[2] || 0,
@@ -1958,14 +1958,14 @@ var defaults = {
1958
1958
  geoIpLookup: null,
1959
1959
  //* Inject a hidden input with the name returned from this function, and on submit, populate it with the result of getNumber.
1960
1960
  hiddenInput: null,
1961
- //* Internationalise the plugin text e.g. search input placeholder, country names.
1961
+ //* Internationalise the core library text e.g. search input placeholder, country names.
1962
1962
  i18n: {},
1963
1963
  //* Initial country.
1964
1964
  initialCountry: "",
1965
1965
  //* A function to load the utils script.
1966
1966
  loadUtils: null,
1967
1967
  //* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
1968
- nationalMode: true,
1968
+ nationalMode: false,
1969
1969
  //* Display only these countries.
1970
1970
  onlyCountries: null,
1971
1971
  //* Number type to use for placeholders.
@@ -2447,7 +2447,7 @@ var UI = class _UI {
2447
2447
  );
2448
2448
  }
2449
2449
  }
2450
- //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
2450
+ //* Generate all of the markup for the core library: the selected country overlay, and the dropdown.
2451
2451
  buildMarkup(countries, searchTokens) {
2452
2452
  this.#countries = countries;
2453
2453
  this.#searchTokens = searchTokens;
@@ -4374,7 +4374,7 @@ var Iti = class _Iti {
4374
4374
  //********************
4375
4375
  //* PUBLIC METHODS
4376
4376
  //********************
4377
- //* Remove plugin.
4377
+ //* Remove core library.
4378
4378
  destroy() {
4379
4379
  if (!this.#isActive) {
4380
4380
  return;
@@ -4623,7 +4623,7 @@ var intlTelInput = Object.assign(
4623
4623
  documentReady: () => document.readyState === "complete",
4624
4624
  //* Get the country data object.
4625
4625
  getCountryData: () => data_default,
4626
- //* A getter for the plugin instance.
4626
+ //* A getter for the core library instance.
4627
4627
  getInstance: (input) => {
4628
4628
  const id = input.dataset[DATA_KEYS.INSTANCE_ID];
4629
4629
  return id ? intlTelInput.instances.get(id) ?? null : null;
@@ -4633,7 +4633,7 @@ var intlTelInput = Object.assign(
4633
4633
  attachUtils,
4634
4634
  startedLoadingUtils: false,
4635
4635
  startedLoadingAutoCountry: false,
4636
- version: "28.0.1",
4636
+ version: "28.0.3",
4637
4637
  NUMBER_FORMAT,
4638
4638
  NUMBER_TYPE,
4639
4639
  VALIDATION_ERROR
@@ -11025,7 +11025,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
11025
11025
  }, ref) {
11026
11026
  const inputRef = useRef(null);
11027
11027
  const itiRef = useRef(null);
11028
- const pluginInputClassesRef = useRef("");
11028
+ const libraryInputClassesRef = useRef("");
11029
11029
  const lastEmittedNumberRef = useRef(void 0);
11030
11030
  const lastEmittedCountryRef = useRef(void 0);
11031
11031
  const lastEmittedValidityRef = useRef(void 0);
@@ -11092,7 +11092,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
11092
11092
  return void 0;
11093
11093
  }
11094
11094
  itiRef.current = intlTelInput_default(inputEl, initOptions);
11095
- pluginInputClassesRef.current = inputEl.className;
11095
+ libraryInputClassesRef.current = inputEl.className;
11096
11096
  const handleOpen = () => onOpenCountryDropdownRef.current?.();
11097
11097
  const handleClose = () => onCloseCountryDropdownRef.current?.();
11098
11098
  const handleStrictReject = (e) => {
@@ -11156,7 +11156,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
11156
11156
  if (ignoredInputProps.has(key)) {
11157
11157
  warnInputProp(key);
11158
11158
  } else if (key === "className") {
11159
- sanitizedInputProps[key] = `${pluginInputClassesRef.current} ${val}`;
11159
+ sanitizedInputProps[key] = `${libraryInputClassesRef.current} ${val}`;
11160
11160
  } else {
11161
11161
  sanitizedInputProps[key] = val;
11162
11162
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intl-tel-input/react",
3
- "version": "28.0.1",
4
- "description": "A React component for the intl-tel-input JavaScript plugin",
3
+ "version": "28.0.3",
4
+ "description": "A React component for intl-tel-input, for entering, formatting, and validating international telephone numbers",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Jack O'Connor (http://jackocnr.com)",
@@ -34,7 +34,7 @@
34
34
  "README.md"
35
35
  ],
36
36
  "dependencies": {
37
- "intl-tel-input": "^28.0.1"
37
+ "intl-tel-input": "^28.0.3"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=18",