diff --git a/js/sky/src/phonefield/docs/demo.md b/js/sky/src/phonefield/docs/demo.md index 243b7cdd..e92c9032 100644 --- a/js/sky/src/phonefield/docs/demo.md +++ b/js/sky/src/phonefield/docs/demo.md @@ -8,7 +8,7 @@ summary: The phone field directive creates a text box to format and validate int The phone field directive creates a text box for users to enter phone numbers. It wraps up the [intl-tel-input jQuery plugin](http://jackocnr.com/intl-tel-input.html) to format and validate international phone numbers. This plugin adds a dropdown for users to select a country and specifies the desired format and dial code. Users can also enter a dial code to select a country. You use the `bb-phone-field` directive in conjunction with the `ng-model` directive and bind the phone number value to `ng-model`. ### Dependencies ### -- **[intl-tel-input](http://jackocnr.com/intl-tel-input.html) (8.5.2 or higher)** Enhances a text box to format and validate international phone numbers. +- **[intl-tel-input](http://jackocnr.com/intl-tel-input.html) (12.4.0)** Enhances a text box to format and validate international phone numbers. --- diff --git a/js/sky/src/phonefield/phonefield.directive.js b/js/sky/src/phonefield/phonefield.directive.js index 89a0267c..ce3dd2ae 100644 --- a/js/sky/src/phonefield/phonefield.directive.js +++ b/js/sky/src/phonefield/phonefield.directive.js @@ -34,7 +34,7 @@ // So, its dial code should just be 1 because the area code includes the dial code. // Example countries: Bahamas, Cayman Islands, Barbados. if (selectedCountryData.dialCode.toString()[0] === '1') { - selectedCountryData.dialCode = 1; + selectedCountryData.dialCode = '1'; } return '+' + selectedCountryData.dialCode + ' ' + formattedNumber; diff --git a/js/sky/src/phonefield/test/phonefield.spec.js b/js/sky/src/phonefield/test/phonefield.spec.js index 42ca5699..360876d9 100644 --- a/js/sky/src/phonefield/test/phonefield.spec.js +++ b/js/sky/src/phonefield/test/phonefield.spec.js @@ -423,4 +423,28 @@ describe('Phone field directive', function () { el.remove(); }); + it('should handle new Brazil phone number format', function () { + // ** arrange ** + var el, + $scope = $rootScope.$new(); + + $scope.phoneFieldConfig = { + countryIso2: nationalCountryData.iso2 + }; + + el = compileDirective($scope); + el.appendTo(document.body); + $scope.$digest(); + + // ** act ** + setCountry(el, 'br'); // 'br' is Brazil + setNumber(el, '5548998386090'); + + // ** assert ** + expect($scope.phoneNumber).toBe('+55 (48) 99838-6090'); + + // ** clean up ** + el.remove(); + }); + }); diff --git a/package.json b/package.json index dc351eea..9df49852 100644 --- a/package.json +++ b/package.json @@ -89,11 +89,11 @@ "angular-ui-router": "0.4.2", "autonumeric": "1.9.39", "block-ui": "2.70.1", - "bootstrap": "3.3.5", + "bootstrap": "3.4.0", "enquire.js": "git+https://github.com/WickyNilliams/enquire.js.git#v2.1.2", "fastclick": "1.0.6", "free-jqgrid": "git+https://github.com/blackbaud/jqGrid.git#v4.7.0", - "intl-tel-input": "8.5.2", + "intl-tel-input": "12.4.0", "jquery": "2.1.3", "jquery-ui-bundle": "1.11.4", "jquery-ui-touch-punch": "0.2.3", diff --git a/webdriver-screenshots/MAC_chrome/MAC_chrome_phonefield_flag_select_full.phonefield_flag_select.1280px.baseline.png b/webdriver-screenshots/MAC_chrome/MAC_chrome_phonefield_flag_select_full.phonefield_flag_select.1280px.baseline.png deleted file mode 100644 index e909dc89..00000000 Binary files a/webdriver-screenshots/MAC_chrome/MAC_chrome_phonefield_flag_select_full.phonefield_flag_select.1280px.baseline.png and /dev/null differ diff --git a/webdriver-screenshots/MAC_chrome/MAC_chrome_phonefield_full.phonefield.1280px.baseline.png b/webdriver-screenshots/MAC_chrome/MAC_chrome_phonefield_full.phonefield.1280px.baseline.png deleted file mode 100644 index 0cabec29..00000000 Binary files a/webdriver-screenshots/MAC_chrome/MAC_chrome_phonefield_full.phonefield.1280px.baseline.png and /dev/null differ diff --git a/webdriver-screenshots/MAC_firefox/MAC_firefox_phonefield_flag_select_full.phonefield_flag_select.1280px.baseline.png b/webdriver-screenshots/MAC_firefox/MAC_firefox_phonefield_flag_select_full.phonefield_flag_select.1280px.baseline.png deleted file mode 100644 index 665ac104..00000000 Binary files a/webdriver-screenshots/MAC_firefox/MAC_firefox_phonefield_flag_select_full.phonefield_flag_select.1280px.baseline.png and /dev/null differ diff --git a/webdriver-screenshots/MAC_firefox/MAC_firefox_phonefield_full.phonefield.1280px.baseline.png b/webdriver-screenshots/MAC_firefox/MAC_firefox_phonefield_full.phonefield.1280px.baseline.png deleted file mode 100644 index dee01ed3..00000000 Binary files a/webdriver-screenshots/MAC_firefox/MAC_firefox_phonefield_full.phonefield.1280px.baseline.png and /dev/null differ diff --git a/webdrivertest/test/phonefield/phonefield.visual.js b/webdrivertest/test/phonefield/phonefield.visual.js index 81a864f9..7a90b52c 100644 --- a/webdrivertest/test/phonefield/phonefield.visual.js +++ b/webdrivertest/test/phonefield/phonefield.visual.js @@ -7,7 +7,7 @@ describe('Phone Field directive', function () { selectors = { flagContainer: '.flag-container', countryList: '.country-list', - localCountryTextbox: 'input[placeholder="(201) 555-5555"]', + localCountryTextbox: 'input[placeholder="(201) 555-0123"]', intlCountryTextbox: 'input[placeholder="01812-345678"]', intlCountrySelect: 'li[data-dial-code="880"]', wrapper: '#screenshot-phone-field'