mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
tests for all properties in v14
This commit is contained in:
Vendored
+3
-3
@@ -21,10 +21,10 @@ export interface IntlTelInputStatic {
|
||||
* initialise the plugin with optional options.
|
||||
* @param options options that can be provided during initialization.
|
||||
*/
|
||||
(node: Element, options?: IntlTelInputOptions): IntlTelInput;
|
||||
(node: Element, options?: Options): Plugin;
|
||||
}
|
||||
|
||||
export interface IntlTelInput {
|
||||
export interface Plugin {
|
||||
/**
|
||||
* Remove the plugin from the input, and unbind any event listeners.
|
||||
*/
|
||||
@@ -103,7 +103,7 @@ export interface IntlTelInput {
|
||||
setPlaceholderNumberType(type: NumberType): void;
|
||||
}
|
||||
|
||||
export interface IntlTelInputOptions {
|
||||
export interface Options {
|
||||
/**
|
||||
* Whether or not to allow the dropdown. If disabled, there is no dropdown
|
||||
* arrow, and the selected flag is not clickable. Also we display the
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import IntlTelInput = require("intl-tel-input");
|
||||
import { NumberFormat } from "intl-tel-input";
|
||||
|
||||
const input = document.querySelector("#phone");
|
||||
window.intlTelInput(input);
|
||||
@@ -41,7 +42,13 @@ window.intlTelInput(input).setCountry('gb');
|
||||
|
||||
window.intlTelInput(input).setNumber('+447733123456');
|
||||
|
||||
window.intlTelInput(input).setPlaceholderNumberType(IntlTelInput.NumberType.FIXED_LINE);
|
||||
|
||||
const countryData = window.intlTelInput.getCountryData();
|
||||
const country = countryData[0];
|
||||
const dialCode = country.dialCode;
|
||||
const iso2 = country.iso2;
|
||||
const name = country.name;
|
||||
|
||||
window.intlTelInput.loadUtils('build/js/utils.js');
|
||||
|
||||
@@ -67,3 +74,16 @@ window.intlTelInput(input, {
|
||||
onlyCountries: ['al'],
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
});
|
||||
|
||||
window.intlTelInput(input, {
|
||||
allowDropdown: false,
|
||||
autoHideDialCode: false,
|
||||
autoPlaceholder: "aggressive",
|
||||
dropdownContainer: document.body,
|
||||
excludeCountries: [ "us", "uk" ],
|
||||
formatOnDisplay: false,
|
||||
hiddenInput: "hidden-input",
|
||||
localizedCountries: { de: "Deutschland"},
|
||||
preferredCountries: ["us", "gb"],
|
||||
separateDialCode: false
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user