diff --git a/README.md b/README.md index 139a667..fe8320d 100644 --- a/README.md +++ b/README.md @@ -155,31 +155,31 @@ render(){ ### Properties: -| Property Name | Type | Default | Description | -| ------------------------- | ---------------- | --------- | ------------------------------------------------------------------------------ | -| autoFormat | boolean | false | Format while typing | -| initialCountry | string | 'us' | initial selected country | -| allowZeroAfterCountryCode | bool | true | allow user input 0 after country code | -| disabled | bool | false | if true, disable all interaction of this component | -| initialValue | string | null | initial phone number | -| style | object | null | custom styles to be applied if supplied | -| flagStyle | object | null | custom styles for flag image eg. {{width: 50, height: 30, borderWidth:0}} | -| textStyle | object | null | custom styles for phone number text input eg. {{fontSize: 14}} | -| textProps | object | null | properties for phone number text input eg. {{placeholder: 'Telephone number'}} | -| textComponent | function | TextField | the input component to use | -| offset | int | 10 | distance between flag and phone number | -| pickerButtonColor | string | '#007AFF' | set button color of country picker | -| pickerBackgroundColor | string | 'white' | set background color of country picker | -| pickerItemStyle | object | null | custom styles for text in country picker eg. {{fontSize: 14}} | -| cancelText | string | 'Cancel' | cancel word | -| confirmText | string | 'Confirm' | confirm word | -| cancelTextStyle | object | null | custom styles for country picker cancel button | -| confirmTextStyle | object | null | custom styles for country picker confirm button | -| onChangePhoneNumber | function(number) | null | function to be invoked when phone number is changed | -| onSelectCountry | function(iso2) | null | function to be invoked when country picker is selected | -| onPressFlag | function() | null | function to be invoked when press on flag image | -| countriesList | array | null | custom countries list | -| autoFormat | bool | false | automatically format phone number as it is entered | +| Property Name | Type | Default | Description | +| ------------------------- | ---------------- | ------------------| ------------------------------------------------------------------------------ | +| autoFormat | boolean | false | Format phone number while typing | +| accessibilityLabel | string | 'Telephone input' | Label for accessibility purposes | +| initialCountry | string | 'us' | initial selected country | +| allowZeroAfterCountryCode | bool | true | allow user input 0 after country code | +| disabled | bool | false | if true, disable all interaction of this component | +| initialValue | string | null | initial phone number | +| style | object | null | custom styles to be applied if supplied | +| flagStyle | object | null | custom styles for flag image eg. {{width: 50, height: 30, borderWidth:0}} | +| textStyle | object | null | custom styles for phone number text input eg. {{fontSize: 14}} | +| textProps | object | null | properties for phone number text input eg. {{placeholder: 'Telephone number'}} | +| textComponent | function | TextField | the input component to use | +| offset | int | 10 | distance between flag and phone number | +| pickerButtonColor | string | '#007AFF' | set button color of country picker | +| pickerBackgroundColor | string | 'white' | set background color of country picker | +| pickerItemStyle | object | null | custom styles for text in country picker eg. {{fontSize: 14}} | +| cancelText | string | 'Cancel' | cancel word | +| confirmText | string | 'Confirm' | confirm word | +| cancelTextStyle | object | null | custom styles for country picker cancel button | +| confirmTextStyle | object | null | custom styles for country picker confirm button | +| onChangePhoneNumber | function(number) | null | function to be invoked when phone number is changed | +| onSelectCountry | function(iso2) | null | function to be invoked when country picker is selected | +| onPressFlag | function() | null | function to be invoked when press on flag image | +| countriesList | array | null | custom countries list | ### Functions: diff --git a/package-lock.json b/package-lock.json index 278564a..2ec024f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,11 @@ { "name": "react-native-phone-input", - "version": "1.2.1", + "version": "1.2.2", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "react-native-phone-input", - "version": "1.2.1", + "version": "1.2.2", "license": "MIT", "dependencies": { "google-libphonenumber": "^3.2.2", diff --git a/package.json b/package.json index 68b8922..ac0c829 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-phone-input", - "version": "1.2.1", + "version": "1.2.2", "description": "Phone input box for React Native", "main": "dist/index.js", "scripts": { diff --git a/tests/PhoneNumber.test.ts b/tests/PhoneNumber.test.ts index 763a8e8..0d2d0c5 100644 --- a/tests/PhoneNumber.test.ts +++ b/tests/PhoneNumber.test.ts @@ -2,24 +2,24 @@ import { expect } from 'chai'; import PhoneNumber from '../src/PhoneNumber'; describe('getNumberType', () => { - it('returns UNKNOWN type', () => { - const number = '+44000'; - const iso2 = 'gb'; - const numberType = PhoneNumber.getNumberType(number, iso2); - expect(numberType).to.equal('UNKNOWN'); - }); + it('returns UNKNOWN type', () => { + const number = '+44000'; + const iso2 = 'gb'; + const numberType = PhoneNumber.getNumberType(number, iso2); + expect(numberType).to.equal('UNKNOWN'); + }); - it('returns MOBILE type', () => { - const number = '+447900000001'; - const iso2 = 'gb'; - const numberType = PhoneNumber.getNumberType(number, iso2); - expect(numberType).to.equal('MOBILE'); - }); + it('returns MOBILE type', () => { + const number = '+447900000001'; + const iso2 = 'gb'; + const numberType = PhoneNumber.getNumberType(number, iso2); + expect(numberType).to.equal('MOBILE'); + }); - it('returns FIXED_LINE type', () => { - const number = '+442072212217'; - const iso2 = 'gb'; - const numberType = PhoneNumber.getNumberType(number, iso2); - expect(numberType).to.equal('FIXED_LINE'); - }); -}); \ No newline at end of file + it('returns FIXED_LINE type', () => { + const number = '+442072212217'; + const iso2 = 'gb'; + const numberType = PhoneNumber.getNumberType(number, iso2); + expect(numberType).to.equal('FIXED_LINE'); + }); +});