From ab1ad5be8f59d1df2698aaab1286a1e2e1ad6546 Mon Sep 17 00:00:00 2001 From: Becky Siegel Date: Fri, 24 Mar 2017 14:16:35 -0700 Subject: [PATCH 1/8] 2.0-preview --- .gitignore | 3 +- .travis.yml | 13 +- bower.json | 43 ++++-- gold-phone-input.html | 164 +++++++++++++++++---- test/basic.html | 328 +++++++++++++++++++++++++----------------- test/index.html | 2 +- 6 files changed, 372 insertions(+), 181 deletions(-) diff --git a/.gitignore b/.gitignore index 8d4ae25..2be39e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -bower_components +bower_components* +bower-*.json diff --git a/.travis.yml b/.travis.yml index e6132bc..cb64e3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ language: node_js sudo: required before_script: - - npm install -g bower polylint web-component-tester - - bower install - - polylint + - npm install -g bower polymer-cli@next + - polymer install --variants env: global: - - secure: >- + - secure: fviqObsjTcudSB+jLADACiHgRXQLw3s0myKUpVSbRnNlvcwzfXulFTpwV3vRftieBfj1vupwhJOTjFWtD9MYTRS6tcSSE6ShUNLOcyiZmb4kR9Ox3rQAvUfME9Yj2dh2txFYgMhhLEuGQkdM3BvxPTPmWEoKjGCSnqvga26Kddm4++GPE7+s14t5Iq0q+KWiqJ0rscaQrEwYKrBTPiv93abkPkajKN9nMZD1EfUYo03wDBMHGzF7RCV5cfZQUqhpK64DvTRpvtErZOvJX2dSz3GbhuYH1lDHMIHIEFMhGk/Ayu9lzEfnExbWYQydxW3yfmeGRmSnpmKcz3eTdlMCB9sX9k8IY8RCCjG4jS9iPpcDh/0aGHw+S7v0iyx9X7eq1hOz6n8ZouUVYGZEf7gt4EtWEsYVxSANQkvBhDhfJMCWdz/uv+AOV6SMjh9pwakifdDNGF/PifcFsfgbYaJyyEPH0faQs+0PQG+jciuUAd3W/5DO6Iilbc7rJJENaDNNucjx+eYwSNuW7vKj3XkyEMT8R1t7t041gXTgjElowI35kUkBTI7HZTI4RwTb/+rDqyncBk6x9BdYkq2EGM1zaqQzTD7PlrJ686IRRL2WmA1dOQYzlOv4muyPmnNKnRLYyMjF6niANrXXoZn7rTI6AcsieUUoyyonZ62Fg9mjcrs= - - secure: >- + - secure: jH5Cn/56zXgH14Y0+0X6YhqVqabe47VLWD5zPePIpRDust4SBDJ6mqalAIWfT3+RLZR5x5+dQIBO3V3BQ5KFOB5E+EEserzqNbqIEHx+crkhztg+lBmedMgGU8+gTa8D3Htd1kYNN+KMnsxShCQbWd+psIb6Uje9BhdMBVgoBAkitvTYDMI69qU14UgNYpE6qvf28K9WZBPxSWeRVa5OtS4I4QixYLRy9zcmIWWsesAqd+84Hj5hybIL9iZgo4UzddYd0GBwiaAXwIKnb7DpQDOsomuQaoKWI3HWZSlXEP+9cvWQ6UafaaeKifob5PtnPeVq2E4m8CVseuFN5h5mSnA3RX0EQUz+e6BJJeWPQ684MDrda3A3yfbG47jYrzQ8iQWY7nfUOKPR2sDdDAPBQh7kjnS8VtAvALCnlDi79y08UPSrsQXOYkJNYBSabmguGVOKNPrfFz3ct0Q9KWhCK5MEA7hArIvYW9K3YpGOYBdJmx8vr+BNGVb/45mBYh57Fgw0ij+Di37AvAR3BWJJIifBqfML8MBEUjqfr1Gkjli1rLuvgis4OFmmcIqM5ZvO8gG3gzOf1Ma/YjFraCESnoyjH30W4pF7uzeLcRjNb3clWyCQeYqptD4UgQfBH4oIyddhqwfDJOfV32zrm/woGFo0Z5vb0kD0F8uBKiodh/I= node_js: '6' addons: @@ -19,6 +18,6 @@ addons: packages: - google-chrome-stable script: - - xvfb-run wct - - 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s ''default''; fi' + - xvfb-run polymer test + - 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s ''default''; fi' dist: trusty diff --git a/bower.json b/bower.json index 057d9c5..56f3aea 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gold-phone-input", - "version": "1.1.0", + "version": "2.0.0", "description": "A validating input for a phone number", "authors": [ "The Polymer Authors" @@ -21,18 +21,37 @@ "homepage": "https://github.com/PolymerElements/gold-phone-input", "ignore": [], "dependencies": { - "iron-input": "PolymerElements/iron-input#^1.0.0", - "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", - "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0", - "paper-input": "PolymerElements/paper-input#^1.0.0", - "paper-styles": "PolymerElements/paper-styles#^1.0.0", - "polymer": "Polymer/polymer#^1.2.0" + "iron-input": "PolymerElements/iron-input#2.0-preview", + "iron-flex-layout": "PolymerElements/iron-flex-layout#2.0-preview", + "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#2.0-preview", + "paper-input": "PolymerElements/paper-input#2.0-preview", + "paper-styles": "PolymerElements/paper-styles#2.0-preview", + "polymer": "Polymer/polymer#^2.0.0-rc.2" }, "devDependencies": { - "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", - "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", - "web-component-tester": "^4.0.0", - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" + "iron-component-page": "PolymerElements/iron-component-page#2.0-preview", + "iron-test-helpers": "PolymerElements/iron-test-helpers#2.0-preview", + "test-fixture": "PolymerElements/test-fixture#^3.0.0-rc.1", + "web-component-tester": "Polymer/web-component-tester#^6.0.0-prerelease.6", + "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0-rc.1" + }, + "variants": { + "1.x": { + "dependencies": { + "iron-input": "PolymerElements/iron-input#^1.0.0", + "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", + "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0", + "paper-input": "PolymerElements/paper-input#^1.0.0", + "paper-styles": "PolymerElements/paper-styles#^1.0.0", + "polymer": "Polymer/polymer#^1.2.0" + }, + "devDependencies": { + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", + "test-fixture": "PolymerElements/test-fixture#^1.0.0", + "web-component-tester": "^4.0.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" + } + } } } diff --git a/gold-phone-input.html b/gold-phone-input.html index fe8bf22..1d3cde0 100644 --- a/gold-phone-input.html +++ b/gold-phone-input.html @@ -68,17 +68,48 @@ /* TODO: This should be a dropdown */ span { - @apply(--paper-font-subhead); - @apply(--paper-input-container-input); + @apply --paper-font-subhead; + @apply --paper-input-container-input; } .country-code { width: 40px; - @apply(--gold-phone-input-country-code); + @apply --gold-phone-input-country-code; } input { - @apply(--layout-flex); + @apply --layout-flex; + } + input + { + position: relative; /* to make a stacking context */ + outline: none; + box-shadow: none; + padding: 0; + width: 100%; + max-width: 100%; + background: transparent; + border: none; + color: var(--paper-input-container-input-color, var(--primary-text-color)); + -webkit-appearance: none; + text-align: inherit; + vertical-align: bottom; + /* Firefox sets a min-width on the input, which can cause layout issues */ + min-width: 0; + @apply --paper-font-subhead; + @apply --paper-input-container-input; + } + input::-webkit-input-placeholder { + color: var(--paper-input-container-color, var(--secondary-text-color)); + } + input:-moz-placeholder { + color: var(--paper-input-container-color, var(--secondary-text-color)); + } + input::-moz-placeholder { + color: var(--paper-input-container-color, var(--secondary-text-color)); + } + input:-ms-input-placeholder { + color: var(--paper-input-container-color, var(--secondary-text-color)); } - + - +[[countryCode]] + +[[countryCode]] - + + + + From 78897d9b4763c1ebce8bc3a430022dbdfce7afbe Mon Sep 17 00:00:00 2001 From: Polymer Format Bot Date: Thu, 6 Apr 2017 17:18:08 -0700 Subject: [PATCH 2/8] Update travis config --- .travis.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb64e3a..1ec5a69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,21 +3,25 @@ sudo: required before_script: - npm install -g bower polymer-cli@next - polymer install --variants + - sudo mv /usr/bin/google-chrome /usr/bin/google-chrome-old + - sudo mv /usr/bin/google-chrome-beta /usr/bin/google-chrome env: global: - - secure: + - secure: >- fviqObsjTcudSB+jLADACiHgRXQLw3s0myKUpVSbRnNlvcwzfXulFTpwV3vRftieBfj1vupwhJOTjFWtD9MYTRS6tcSSE6ShUNLOcyiZmb4kR9Ox3rQAvUfME9Yj2dh2txFYgMhhLEuGQkdM3BvxPTPmWEoKjGCSnqvga26Kddm4++GPE7+s14t5Iq0q+KWiqJ0rscaQrEwYKrBTPiv93abkPkajKN9nMZD1EfUYo03wDBMHGzF7RCV5cfZQUqhpK64DvTRpvtErZOvJX2dSz3GbhuYH1lDHMIHIEFMhGk/Ayu9lzEfnExbWYQydxW3yfmeGRmSnpmKcz3eTdlMCB9sX9k8IY8RCCjG4jS9iPpcDh/0aGHw+S7v0iyx9X7eq1hOz6n8ZouUVYGZEf7gt4EtWEsYVxSANQkvBhDhfJMCWdz/uv+AOV6SMjh9pwakifdDNGF/PifcFsfgbYaJyyEPH0faQs+0PQG+jciuUAd3W/5DO6Iilbc7rJJENaDNNucjx+eYwSNuW7vKj3XkyEMT8R1t7t041gXTgjElowI35kUkBTI7HZTI4RwTb/+rDqyncBk6x9BdYkq2EGM1zaqQzTD7PlrJ686IRRL2WmA1dOQYzlOv4muyPmnNKnRLYyMjF6niANrXXoZn7rTI6AcsieUUoyyonZ62Fg9mjcrs= - - secure: + - secure: >- jH5Cn/56zXgH14Y0+0X6YhqVqabe47VLWD5zPePIpRDust4SBDJ6mqalAIWfT3+RLZR5x5+dQIBO3V3BQ5KFOB5E+EEserzqNbqIEHx+crkhztg+lBmedMgGU8+gTa8D3Htd1kYNN+KMnsxShCQbWd+psIb6Uje9BhdMBVgoBAkitvTYDMI69qU14UgNYpE6qvf28K9WZBPxSWeRVa5OtS4I4QixYLRy9zcmIWWsesAqd+84Hj5hybIL9iZgo4UzddYd0GBwiaAXwIKnb7DpQDOsomuQaoKWI3HWZSlXEP+9cvWQ6UafaaeKifob5PtnPeVq2E4m8CVseuFN5h5mSnA3RX0EQUz+e6BJJeWPQ684MDrda3A3yfbG47jYrzQ8iQWY7nfUOKPR2sDdDAPBQh7kjnS8VtAvALCnlDi79y08UPSrsQXOYkJNYBSabmguGVOKNPrfFz3ct0Q9KWhCK5MEA7hArIvYW9K3YpGOYBdJmx8vr+BNGVb/45mBYh57Fgw0ij+Di37AvAR3BWJJIifBqfML8MBEUjqfr1Gkjli1rLuvgis4OFmmcIqM5ZvO8gG3gzOf1Ma/YjFraCESnoyjH30W4pF7uzeLcRjNb3clWyCQeYqptD4UgQfBH4oIyddhqwfDJOfV32zrm/woGFo0Z5vb0kD0F8uBKiodh/I= -node_js: '6' +node_js: stable addons: firefox: latest apt: sources: - google-chrome packages: - - google-chrome-stable + - google-chrome-beta script: - xvfb-run polymer test - - 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s ''default''; fi' + - >- + if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default'; + fi dist: trusty From b99107d5fe474b3461c83e3e3b36719c64ecf9e3 Mon Sep 17 00:00:00 2001 From: Becky Siegel Date: Fri, 21 Apr 2017 06:54:10 -0700 Subject: [PATCH 3/8] 2.0-preview fixes --- .idea/gold-phone-input.iml | 9 ++ .idea/misc.xml | 42 ++++++++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 195 +++++++++++++++++++++++++++++++++++++ .travis.yml | 2 +- gold-phone-input.html | 79 +++++++++++++-- 7 files changed, 330 insertions(+), 11 deletions(-) create mode 100644 .idea/gold-phone-input.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/gold-phone-input.iml b/.idea/gold-phone-input.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/gold-phone-input.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b47f194 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..47fa05d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..641a217 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1493193570149 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 1ec5a69..7eaa88c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,4 +24,4 @@ script: - >- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default'; fi -dist: trusty +dist: trusty \ No newline at end of file diff --git a/gold-phone-input.html b/gold-phone-input.html index 1d3cde0..e1de532 100644 --- a/gold-phone-input.html +++ b/gold-phone-input.html @@ -167,6 +167,7 @@ autocomplete="tel" maxlength="[[maxlength]]" name="[[name]]" + prevent-invalid-input value="{{value}}" disabled="[[disabled]]" autofocus="[[autofocus]]" @@ -175,6 +176,60 @@ readonly="[[readonly]]" size="[[size]]"> + + + + + + + + + +