From a03c21c082185a1587aa93a9088c5f4de78c6557 Mon Sep 17 00:00:00 2001 From: GeoloeG-IsT Date: Sun, 24 Sep 2017 22:30:56 +0200 Subject: [PATCH] migration to 2.0 --- .gitignore | 4 +- .travis.yml | 19 ++-- bower.json | 56 +++++++--- gold-password-input.html | 227 +++++++++++++++++++++++++++++++++------ 4 files changed, 245 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index 66595f4..2be39e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -bower_components/ -tmp-* +bower_components* +bower-*.json diff --git a/.travis.yml b/.travis.yml index 8137a3c..1052e28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,24 @@ 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 + - 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: TcDqx+YdNCa/DRQjdKt9dgYCPgXtPl2EZ7Nnv6bRvbcmUjW2eSr7Zwb+e0fO8wgwms/RqFaVx+u5jo7D1lnC4Ybcg1HKiMOvCyzY36MjF9oB/VKSEUC+p4tMVQfw1IZ/RmK3dD+WEWaoT/EKmNfctz7v5kR+yk2lZo44D9I7rrc= - - secure: nh65tvhnhOrK05qKvDJKMV7Jm9yiCoG1wFkP3ZnqOHix9Ny+KmcTa41Bl6NXQdvYaMTFtzS7lMZX5cqIziyKyGWHVN30LzGMHJNz12fhcMi3nJ84trhQGcu/9qR9yDv16q9ouGlcz1VxnDOHaRAHnIKjLIbhN3aJtMtZBbnWihA= + - secure: >- + TcDqx+YdNCa/DRQjdKt9dgYCPgXtPl2EZ7Nnv6bRvbcmUjW2eSr7Zwb+e0fO8wgwms/RqFaVx+u5jo7D1lnC4Ybcg1HKiMOvCyzY36MjF9oB/VKSEUC+p4tMVQfw1IZ/RmK3dD+WEWaoT/EKmNfctz7v5kR+yk2lZo44D9I7rrc= + - secure: >- + nh65tvhnhOrK05qKvDJKMV7Jm9yiCoG1wFkP3ZnqOHix9Ny+KmcTa41Bl6NXQdvYaMTFtzS7lMZX5cqIziyKyGWHVN30LzGMHJNz12fhcMi3nJ84trhQGcu/9qR9yDv16q9ouGlcz1VxnDOHaRAHnIKjLIbhN3aJtMtZBbnWihA= node_js: stable addons: - firefox: '46.0' + firefox: latest apt: sources: - google-chrome packages: - - google-chrome-stable + - google-chrome-beta script: - - xvfb-run wct + - xvfb-run polymer test dist: trusty \ No newline at end of file diff --git a/bower.json b/bower.json index 8773610..29aedfc 100644 --- a/bower.json +++ b/bower.json @@ -1,10 +1,10 @@ { "name": "gold-password-input", - "version": "1.1.6", + "version": "2.0.0", + "description": "[Polymer 2.x] Input element with Material Design that allows password with an optional strength meter.", "authors": [ "Pascal Gula aka MeTaNoV " ], - "description": "[Polymer 1.x] Input element with Material Design that allows password with an optional strength meter.", "keywords": [ "web-component", "web-components", @@ -34,22 +34,44 @@ "/test/" ], "dependencies": { - "polymer": "Polymer/polymer#^1.2.0", - "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0", - "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0", - "iron-icon": "PolymerElements/iron-icon#^1.0.0", - "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.0", - "paper-input": "PolymerElements/paper-input#^1.0.0", - "paper-tooltip": "PolymerElements/paper-tooltip#^1.1.0", - "paper-styles": "PolymerElements/paper-styles#^1.0.0", - "toggle-icon": "toggle-icon#^1.0.3", - "zxcvbn": "zxcvbn#^4.2.0" + "polymer": "Polymer/polymer#^2.0.0", + "iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0", + "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^2.0.0", + "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^2.0.0", + "iron-icon": "PolymerElements/iron-icon#^2.0.0", + "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0", + "paper-input": "PolymerElements/paper-input#^2.0.0", + "paper-tooltip": "PolymerElements/paper-tooltip#^2.0.0", + "paper-styles": "PolymerElements/paper-styles#^2.0.0", + "toggle-icon": "RoXus/toggle-icon#master", + "zxcvbn": "zxcvbn#^4.4.0" }, "devDependencies": { - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", - "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", - "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", - "web-component-tester": "^4.0.0" + "iron-component-page": "PolymerElements/iron-component-page#^2.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^2.0.0", + "iron-test-helpers": "PolymerElements/iron-test-helpers#^2.0.0", + "web-component-tester": "Polymer/web-component-tester#^6.0.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0" + }, + "variants": { + "dependencies": { + "polymer": "Polymer/polymer#^1.2.0", + "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0", + "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0", + "iron-icon": "PolymerElements/iron-icon#^1.0.0", + "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.0", + "paper-input": "PolymerElements/paper-input#^1.0.0", + "paper-tooltip": "PolymerElements/paper-tooltip#^1.1.0", + "paper-styles": "PolymerElements/paper-styles#^1.0.0", + "toggle-icon": "toggle-icon#^1.0.3", + "zxcvbn": "zxcvbn#^4.2.0" + }, + "devDependencies": { + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", + "web-component-tester": "^4.0.0" + } } } diff --git a/gold-password-input.html b/gold-password-input.html index 55859be..046cf2f 100644 --- a/gold-password-input.html +++ b/gold-password-input.html @@ -2,6 +2,7 @@ + @@ -26,7 +27,7 @@ ***Note**: You need to add the dependency to the `polymer.json` configuration file like follow: - + "includeDependencies": [ "bower_components/zxcvbn/dist/zxcvbn.js" ] It may include an optional label, which by default is "Password". @@ -89,6 +90,47 @@ display: block; } + /* TODO: This should be a dropdown */ + span { + @apply --paper-font-subhead; + @apply --paper-input-container-input; + } + + input { + @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)); + } + toggle-icon { color: gray; --paper-icon-button: { @@ -102,50 +144,44 @@ - + - + - - + + + + + + + +