From 4dc5d83d93bf8d0dedf1fea14f68cdc4f025b49a Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 26 Apr 2018 11:50:11 +1000 Subject: [PATCH 1/6] Port to pure 2.0 component. --- PUBLISH.md | 6 +- bower.json | 37 +- iron-swipeable-pages.html | 841 +++++++++++++++++++------------------- 3 files changed, 451 insertions(+), 433 deletions(-) diff --git a/PUBLISH.md b/PUBLISH.md index 6e216f2..b24fa65 100644 --- a/PUBLISH.md +++ b/PUBLISH.md @@ -1,14 +1,14 @@ ## Registering to Bower -`bower register iron-swipeable-pages git://github.com/GeoloeG/iron-swipeable-pages.git` +`bower register iron-swipeable-pages git://github.com/socceroos/iron-swipeable-pages.git` ## Registering to Gemnasium -https://gemnasium.com/GeoloeG/ +https://gemnasium.com/socceroos/ ## Registering to Waffle -https://waffle.io/GeoloeG/iron-swipeable-pages +https://waffle.io/socceroos/iron-swipeable-pages ## Registering to Travis diff --git a/bower.json b/bower.json index da5f246..03108bf 100644 --- a/bower.json +++ b/bower.json @@ -1,10 +1,11 @@ { "name": "iron-swipeable-pages", - "version": "1.2.10", + "version": "2.0", "authors": [ - "Pascal Gula aka MeTaNoV " + "Pascal Gula aka MeTaNoV ", + "Sam Duff " ], - "description": "[Polymer 1.x] Element that enables switching between different pages by swiping gesture.", + "description": "[Polymer 2.x] Element that enables switching between different pages by swiping gesture.", "keywords": [ "web-component", "web-components", @@ -26,30 +27,30 @@ "private": false, "repository": { "type": "git", - "url": "git://github.com/GeoloeG/iron-swipeable-pages.git" + "url": "git://github.com/socceroos/iron-swipeable-pages.git" }, "license": "MIT", - "homepage": "https://github.com/GeoloeG/iron-swipeable-pages/", + "homepage": "https://github.com/socceroos/iron-swipeable-pages/", "ignore": [ "/.*", "/test/" ], "dependencies": { - "polymer": "Polymer/polymer#^1.2.0", - "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0", - "iron-selector": "PolymerElements/iron-selector#^1.4.0" + "polymer": "Polymer/polymer#^2.0.0", + "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^2.0.0", + "iron-selector": "PolymerElements/iron-selector#^2.0.0" }, "devDependencies": { - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0", "web-component-tester": "^4.0.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", - "paper-checkbox": "PolymerElements/paper-checkbox#^1.1.0", - "paper-drawer-panel": "PolymerElements/paper-drawer-panel#^1.0.0", - "paper-input": "PolymerElements/paper-input#^1.1.0", - "paper-tabs": "PolymerElements/paper-tabs#^1.3.0", - "app-route": "PolymerElements/app-route#v1.0.1", - "dom-repeat-n": "dom-repeat-n#^1.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", + "paper-checkbox": "PolymerElements/paper-checkbox#^2.1.0", + "paper-drawer-panel": "PolymerElements/paper-drawer-panel#^2.0.0", + "paper-input": "PolymerElements/paper-input#^2.0.0", + "paper-tabs": "PolymerElements/paper-tabs#^2.0.0", + "app-route": "PolymerElements/app-route#v2.0.0", + "dom-repeat-n": "dom-repeat-n#^2.0.0" } } diff --git a/iron-swipeable-pages.html b/iron-swipeable-pages.html index 2ab4deb..62eabbf 100644 --- a/iron-swipeable-pages.html +++ b/iron-swipeable-pages.html @@ -1,80 +1,54 @@ - + - - - + } + :host > ::slotted > * { + position: absolute; + width: 100%; + height: 100%; + overflow-y: auto; + will-change: left, transform; + } + :host > ::slotted > :not(.iron-selected):not(.iron-swiping) { + left: -100% !important; + } + + + - - + \ No newline at end of file From 1d79c1921b4c4c51b361593039043b9d26ff04f4 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 26 Apr 2018 12:34:31 +1000 Subject: [PATCH 2/6] New 2.0.1 release --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 03108bf..068d3da 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "iron-swipeable-pages", - "version": "2.0", + "version": "2.0.1", "authors": [ "Pascal Gula aka MeTaNoV ", "Sam Duff " From 8c0c59c0e98f43448ec7fe407b9a992313adea8c Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 26 Apr 2018 12:35:11 +1000 Subject: [PATCH 3/6] Added Gesture Events dependency, fixed listener bugs. --- iron-swipeable-pages.html | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/iron-swipeable-pages.html b/iron-swipeable-pages.html index 62eabbf..cfa1ea1 100644 --- a/iron-swipeable-pages.html +++ b/iron-swipeable-pages.html @@ -1,4 +1,5 @@ - + + @@ -11,14 +12,14 @@ display: block; overflow-x: hidden; } - :host > ::slotted > * { + :host > ::slotted(*) { position: absolute; width: 100%; height: 100%; overflow-y: auto; will-change: left, transform; } - :host > ::slotted > :not(.iron-selected):not(.iron-swiping) { + :host > ::slotted(:not(.iron-selected):not(.iron-swiping)) { left: -100% !important; } @@ -36,7 +37,7 @@ * @polymer * @extends {Polymer.Element} */ - class IronSwipeablePages extends Polymer.mixinBehaviors([Polymer.IronResizableBehavior, Polymer.IronSelectableBehavior], Polymer.Element) { + class IronSwipeablePages extends Polymer.GestureEventListeners(Polymer.mixinBehaviors([Polymer.IronResizableBehavior, Polymer.IronSelectableBehavior], Polymer.Element)) { /** * String providing the tag name to register the element under. */ @@ -186,11 +187,11 @@ connectedCallback() { super.connectedCallback(); - this.addEventListener('iron-resize', e => _onResize); - this.addEventListener('iron-items-changed', e => _onItemsChanged); - this.addEventListener('iron-deselect', e => _onIronDeselectItem); - this.addEventListener('iron-select', e => _onIronSelectItem); - this.addEventListener('track', e => _onTrack); + this.addEventListener('iron-resize', e => this._onResize(e)); + this.addEventListener('iron-items-changed', e => this._onItemsChanged(e)); + this.addEventListener('iron-deselect', e => this._onIronDeselectItem(e)); + this.addEventListener('iron-select', e => this._onIronSelectItem(e)); + Polymer.Gestures.addListener(this, 'track', e => this._onTrack(e)); } /** @@ -200,11 +201,11 @@ disconnectedCallback() { super.disconnectedCallback(); - this.removeEventListener('iron-resize', e => _onResize); - this.removeEventListener('iron-items-changed', e => _onItemsChanged); - this.removeEventListener('iron-deselect', e => _onIronDeselectItem); - this.removeEventListener('iron-select', e => _onIronSelectItem); - this.removeEventListener('track', e => _onTrack); + this.removeEventListener('iron-resize', e => this._onResize(e)); + this.removeEventListener('iron-items-changed', e => this._onItemsChanged(e)); + this.removeEventListener('iron-deselect', e => this._onIronDeselectItem(e)); + this.removeEventListener('iron-select', e => this._onIronSelectItem(e)); + this.removeEventListener('track', e => this._onTrack(e)); } /** From 8fffb69a8015f10efa0b5c37e871760038f6c0fa Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 26 Apr 2018 13:56:26 +1000 Subject: [PATCH 4/6] Revert --- PUBLISH.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PUBLISH.md b/PUBLISH.md index b24fa65..6e216f2 100644 --- a/PUBLISH.md +++ b/PUBLISH.md @@ -1,14 +1,14 @@ ## Registering to Bower -`bower register iron-swipeable-pages git://github.com/socceroos/iron-swipeable-pages.git` +`bower register iron-swipeable-pages git://github.com/GeoloeG/iron-swipeable-pages.git` ## Registering to Gemnasium -https://gemnasium.com/socceroos/ +https://gemnasium.com/GeoloeG/ ## Registering to Waffle -https://waffle.io/socceroos/iron-swipeable-pages +https://waffle.io/GeoloeG/iron-swipeable-pages ## Registering to Travis From bf3bab934392ab7a9acacbd40916dfc94eda193f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 26 Apr 2018 14:57:09 +1000 Subject: [PATCH 5/6] Fixed bower for pull request. --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 068d3da..01ee495 100644 --- a/bower.json +++ b/bower.json @@ -27,10 +27,10 @@ "private": false, "repository": { "type": "git", - "url": "git://github.com/socceroos/iron-swipeable-pages.git" + "url": "git://github.com/GeoloeG/iron-swipeable-pages.git" }, "license": "MIT", - "homepage": "https://github.com/socceroos/iron-swipeable-pages/", + "homepage": "https://github.com/GeoloeG/iron-swipeable-pages/", "ignore": [ "/.*", "/test/" From 39981804a91a05a96be43e92bd21c4d5453b0c3c Mon Sep 17 00:00:00 2001 From: Ben Hermans Date: Sat, 1 Sep 2018 02:21:14 +0200 Subject: [PATCH 6/6] Converted to a Polymer 3 element --- .gitignore | 2 + .travis.yml | 11 +- bower.json | 56 --- demo/conditional.html | 265 +++++----- demo/disabled.html | 118 +++-- demo/drawerpanel.html | 158 +++--- demo/index.html | 115 ++--- demo/mobile.html | 120 +++-- demo/repeat.html | 139 +++--- demo/routing.html | 216 +++++---- index.html | 21 +- iron-swipeable-pages.html | 585 ---------------------- iron-swipeable-pages.js | 579 ++++++++++++++++++++++ package-lock.json | 989 ++++++++++++++++++++++++++++++++++++++ package.json | 55 +++ test/basic-test.html | 79 +-- test/index.html | 38 +- 17 files changed, 2389 insertions(+), 1157 deletions(-) delete mode 100644 bower.json delete mode 100644 iron-swipeable-pages.html create mode 100644 iron-swipeable-pages.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 66595f4..aba835a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ bower_components/ tmp-* + +node_modules diff --git a/.travis.yml b/.travis.yml index 8137a3c..cc2912a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: node_js sudo: required before_script: - - npm install -g bower polylint web-component-tester - - bower install + - npm install + - npm install -g polylint + - npm install -g polymer-cli - polylint env: global: @@ -10,12 +11,12 @@ env: - secure: nh65tvhnhOrK05qKvDJKMV7Jm9yiCoG1wFkP3ZnqOHix9Ny+KmcTa41Bl6NXQdvYaMTFtzS7lMZX5cqIziyKyGWHVN30LzGMHJNz12fhcMi3nJ84trhQGcu/9qR9yDv16q9ouGlcz1VxnDOHaRAHnIKjLIbhN3aJtMtZBbnWihA= node_js: stable addons: - firefox: '46.0' + chrome: stable + firefox: latest apt: sources: - google-chrome packages: - google-chrome-stable -script: - - xvfb-run wct +script: xvfb-run polymer test --module-resolution=node --npm dist: trusty \ No newline at end of file diff --git a/bower.json b/bower.json deleted file mode 100644 index 01ee495..0000000 --- a/bower.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "iron-swipeable-pages", - "version": "2.0.1", - "authors": [ - "Pascal Gula aka MeTaNoV ", - "Sam Duff " - ], - "description": "[Polymer 2.x] Element that enables switching between different pages by swiping gesture.", - "keywords": [ - "web-component", - "web-components", - "web", - "component", - "components", - "custom", - "element", - "polymer", - "iron", - "page", - "pages", - "swipe", - "swipeable", - "content", - "mobile" - ], - "main": "iron-swipeable-pages.html", - "private": false, - "repository": { - "type": "git", - "url": "git://github.com/GeoloeG/iron-swipeable-pages.git" - }, - "license": "MIT", - "homepage": "https://github.com/GeoloeG/iron-swipeable-pages/", - "ignore": [ - "/.*", - "/test/" - ], - "dependencies": { - "polymer": "Polymer/polymer#^2.0.0", - "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^2.0.0", - "iron-selector": "PolymerElements/iron-selector#^2.0.0" - }, - "devDependencies": { - "webcomponentsjs": "webcomponents/webcomponentsjs#^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", - "paper-checkbox": "PolymerElements/paper-checkbox#^2.1.0", - "paper-drawer-panel": "PolymerElements/paper-drawer-panel#^2.0.0", - "paper-input": "PolymerElements/paper-input#^2.0.0", - "paper-tabs": "PolymerElements/paper-tabs#^2.0.0", - "app-route": "PolymerElements/app-route#v2.0.0", - "dom-repeat-n": "dom-repeat-n#^2.0.0" - } -} diff --git a/demo/conditional.html b/demo/conditional.html index 6d5a4c6..c5ea793 100644 --- a/demo/conditional.html +++ b/demo/conditional.html @@ -1,37 +1,40 @@ - - iron-swipeable-pages demo: conditional with `dom-if`s - - - + + iron-swipeable-pages demo: conditional with `dom-if`s - + + + - - - - + - + - - - -