From d3090238be5465186fb991d306b4911c407bc6b8 Mon Sep 17 00:00:00 2001 From: michaelpg Date: Mon, 21 Sep 2015 19:16:32 -0700 Subject: [PATCH] Update Polymer and pull in iron-list Added "iron-list" to bower.json and ran reproduce.sh. Review URL: https://codereview.chromium.org/1360653003 Cr-Commit-Position: refs/heads/master@{#350091} --- third_party/polymer/v1_0/bower.json | 1 + .../iron-a11y-keys-behavior-extracted.js | 5 +- .../iron-autogrow-textarea-extracted.js | 6 +- .../iron-behaviors/iron-button-state-extracted.js | 7 +- .../iron-behaviors/iron-control-state-extracted.js | 7 +- .../iron-checked-element-behavior-extracted.js | 7 +- .../iron-collapse/iron-collapse-extracted.js | 7 +- .../iron-dropdown/iron-dropdown-extracted.js | 6 +- .../iron-dropdown-scroll-manager-extracted.js | 5 +- .../iron-fit-behavior-extracted.js | 5 +- .../iron-form-element-behavior-extracted.js | 6 +- .../iron-icon/iron-icon-extracted.js | 8 +- .../iron-iconset-svg/iron-iconset-svg-extracted.js | 5 +- .../iron-input/iron-input-extracted.js | 5 +- .../v1_0/components-chromium/iron-list/.bower.json | 41 + .../v1_0/components-chromium/iron-list/.gitignore | 1 + .../v1_0/components-chromium/iron-list/README.md | 84 ++ .../v1_0/components-chromium/iron-list/bower.json | 32 + .../v1_0/components-chromium/iron-list/index.html | 26 + .../iron-list/iron-list-extracted.js | 1122 ++++++++++++++++++++ .../components-chromium/iron-list/iron-list.html | 128 +++ .../iron-media-query/iron-media-query-extracted.js | 7 +- .../iron-menu-behavior-extracted.js | 7 +- .../iron-menubar-behavior-extracted.js | 7 +- .../iron-meta/iron-meta-extracted.js | 6 +- .../iron-overlay-backdrop-extracted.js | 5 +- .../iron-overlay-behavior-extracted.js | 6 +- .../iron-overlay-manager-extracted.js | 7 +- .../iron-pages/iron-pages-extracted.js | 7 +- .../iron-range-behavior-extracted.js | 6 +- .../iron-resizable-behavior-extracted.js | 5 +- .../components-chromium/iron-selector/.bower.json | 12 +- .../components-chromium/iron-selector/bower.json | 5 +- .../iron-multi-selectable-extracted.js | 6 +- .../iron-selector/iron-selectable-extracted.js | 61 +- .../iron-selector/iron-selection-extracted.js | 7 +- .../iron-selector/iron-selector-extracted.js | 6 +- .../iron-test-helpers-extracted.js | 5 +- .../iron-validatable-behavior-extracted.js | 7 +- .../animations/cascaded-animation-extracted.js | 7 +- .../animations/fade-in-animation-extracted.js | 7 +- .../animations/fade-out-animation-extracted.js | 7 +- .../animations/hero-animation-extracted.js | 7 +- .../animations/opaque-animation-extracted.js | 7 +- .../reverse-ripple-animation-extracted.js | 5 +- .../animations/ripple-animation-extracted.js | 7 +- .../animations/scale-down-animation-extracted.js | 7 +- .../animations/scale-up-animation-extracted.js | 7 +- .../animations/slide-down-animation-extracted.js | 7 +- .../slide-from-left-animation-extracted.js | 7 +- .../slide-from-right-animation-extracted.js | 7 +- .../animations/slide-left-animation-extracted.js | 7 +- .../animations/slide-right-animation-extracted.js | 7 +- .../animations/slide-up-animation-extracted.js | 7 +- .../animations/transform-animation-extracted.js | 7 +- .../neon-animatable-behavior-extracted.js | 7 +- .../neon-animation/neon-animatable-extracted.js | 7 +- .../neon-animated-pages-extracted.js | 3 +- .../neon-animation-behavior-extracted.js | 7 +- .../neon-animation-runner-behavior-extracted.js | 6 +- ...shared-element-animatable-behavior-extracted.js | 7 +- ...-shared-element-animation-behavior-extracted.js | 7 +- .../paper-button-behavior-extracted.js | 7 +- .../paper-inky-focus-behavior-extracted.js | 7 +- .../paper-button/paper-button-extracted.js | 5 +- .../paper-checkbox/paper-checkbox-extracted.js | 6 +- .../paper-dialog-behavior-extracted.js | 5 +- .../paper-dialog/paper-dialog-extracted.js | 5 +- .../paper-drawer-panel-extracted.js | 7 +- .../paper-dropdown-menu-extracted.js | 5 +- .../paper-fab/paper-fab-extracted.js | 5 +- .../paper-header-panel-extracted.js | 7 +- .../paper-icon-button-extracted.js | 5 +- .../components-chromium/paper-input/.bower.json | 10 +- .../components-chromium/paper-input/bower.json | 4 +- .../paper-input-addon-behavior-extracted.js | 7 +- .../paper-input/paper-input-behavior-extracted.js | 25 +- .../paper-input-char-counter-extracted.js | 5 +- .../paper-input/paper-input-container-extracted.js | 5 +- .../paper-input/paper-input-error-extracted.js | 5 +- .../paper-input/paper-input-extracted.js | 5 +- .../paper-input/paper-input.html | 2 +- .../paper-input/paper-textarea-extracted.js | 5 +- .../paper-input/paper-textarea.html | 2 +- .../paper-item/paper-icon-item-extracted.js | 5 +- .../paper-item/paper-item-body-extracted.js | 5 +- .../paper-item/paper-item-extracted.js | 5 +- .../paper-material/paper-material-extracted.js | 5 +- .../paper-menu-button-animations-extracted.js | 5 +- .../paper-menu-button-extracted.js | 5 +- .../paper-menu/paper-menu-extracted.js | 5 +- .../paper-menu/paper-submenu-extracted.js | 5 +- .../components-chromium/paper-progress/.bower.json | 8 +- .../components-chromium/paper-progress/bower.json | 2 +- .../paper-progress/paper-progress-extracted.js | 6 +- .../paper-progress/paper-progress.html | 3 +- .../paper-radio-button-extracted.js | 6 +- .../paper-radio-group-extracted.js | 5 +- .../paper-ripple/paper-ripple-extracted.js | 5 +- .../paper-slider/paper-slider-extracted.js | 7 +- .../paper-spinner/paper-spinner-extracted.js | 8 +- .../paper-tabs/paper-tab-extracted.js | 7 +- .../paper-tabs/paper-tabs-extracted.js | 7 +- .../paper-toggle-button-extracted.js | 6 +- .../paper-toolbar/paper-toolbar-extracted.js | 7 +- .../paper-tooltip/paper-tooltip-extracted.js | 6 +- 106 files changed, 1901 insertions(+), 201 deletions(-) create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/.bower.json create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/.gitignore create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/README.md create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/bower.json create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/index.html create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js create mode 100644 third_party/polymer/v1_0/components-chromium/iron-list/iron-list.html diff --git a/third_party/polymer/v1_0/bower.json b/third_party/polymer/v1_0/bower.json index 1beadb36ce84..baa781eebe8a 100644 --- a/third_party/polymer/v1_0/bower.json +++ b/third_party/polymer/v1_0/bower.json @@ -18,6 +18,7 @@ "iron-icons": "PolymerElements/iron-icons#^1.0.0", "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.0", "iron-input": "PolymerElements/iron-input#^1.0.0", + "iron-list": "PolymerElements/iron-list#^1.0.0", "iron-media-query": "PolymerElements/iron-media-query#^1.0.0", "iron-menu-behavior": "PolymerElements/iron-menu-behavior#^1.0.0", "iron-meta": "PolymerElements/iron-meta#^1.0.0", diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js index e426d7677da2..0511da98e619 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js @@ -1,4 +1,5 @@ -(function() { + + (function() { 'use strict'; /** @@ -404,4 +405,4 @@ })); } }; - })(); \ No newline at end of file + })(); diff --git a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js index 216df53b92ff..4ab09882fb4c 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'iron-autogrow-textarea', @@ -197,4 +199,4 @@ Polymer({ _computeValue: function() { return this.bindValue; } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js index ae97f5cd1395..c1ea1ed6128a 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * @demo demo/index.html * @polymerBehavior Polymer.IronButtonState */ @@ -212,4 +214,5 @@ Polymer.IronButtonState = [ Polymer.IronA11yKeysBehavior, Polymer.IronButtonStateImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js index e5dc06b7d991..bdd4c2eeec5e 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * @demo demo/index.html * @polymerBehavior */ @@ -88,4 +90,5 @@ } } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js index 17cc73d48b40..fd001f606b35 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.IronCheckedElementBehavior` to implement a custom element * that has a `checked` property, which can be used for validation if the * element is also `required`. Element instances implementing this behavior @@ -85,4 +87,5 @@ Polymer.IronFormElementBehavior, Polymer.IronValidatableBehavior, Polymer.IronCheckedElementBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js index f0ee2425b047..776190dcd688 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'iron-collapse', @@ -115,4 +117,5 @@ Polymer({ }, - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js index 2d39dfeb8bd3..4423a426ed97 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js @@ -1,4 +1,5 @@ -(function() { + + (function() { 'use strict'; Polymer({ @@ -369,4 +370,5 @@ }); } }); - })(); \ No newline at end of file + })(); + \ No newline at end of file diff --git a/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-scroll-manager-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-scroll-manager-extracted.js index 1a5f64949229..5dbb0ddc7088 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-scroll-manager-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-scroll-manager-extracted.js @@ -1,4 +1,5 @@ -(function() { + + (function() { 'use strict'; /** @@ -204,4 +205,4 @@ document.removeEventListener('keydown', this._scrollInteractionHandler, true); } }; - })(); \ No newline at end of file + })(); diff --git a/third_party/polymer/v1_0/components-chromium/iron-fit-behavior/iron-fit-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-fit-behavior/iron-fit-behavior-extracted.js index 8ef6b4adbda6..8a390077efce 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-fit-behavior/iron-fit-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-fit-behavior/iron-fit-behavior-extracted.js @@ -1,3 +1,5 @@ + + /** Polymer.IronFitBehavior fits an element in another element using `max-height` and `max-width`, and optionally centers it in the window or another element. @@ -237,4 +239,5 @@ CSS properties | Action } } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-form-element-behavior/iron-form-element-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-form-element-behavior/iron-form-element-behavior-extracted.js index 051050ba3dbd..51b2c11565e9 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-form-element-behavior/iron-form-element-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-form-element-behavior/iron-form-element-behavior-extracted.js @@ -1,4 +1,5 @@ -/** + + /** Polymer.IronFormElementBehavior enables a custom element to be included in an `iron-form`. @@ -68,4 +69,5 @@ } } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon-extracted.js index 7ff1c46ccb45..75fd9c706b0b 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'iron-icon', @@ -79,4 +81,6 @@ Polymer({ } } - }); \ No newline at end of file + }); + + \ No newline at end of file diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js index a020ee47c5e7..e7fd402ab0a4 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js @@ -1,4 +1,5 @@ -/** + + /** * The `iron-iconset-svg` element allows users to define their own icon sets * that contain svg icons. The svg icon elements should be children of the * `iron-iconset-svg` element. Multiple icons should be given distinct id's. @@ -174,4 +175,4 @@ return null; } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js index c72907b6e3e0..4472ddc13291 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js @@ -1,3 +1,5 @@ + + /* `` adds two-way binding and custom validators using `Polymer.IronValidatorBehavior` to ``. @@ -226,4 +228,5 @@ is separate from validation, and `allowed-pattern` does not affect how the input /* The `iron-input-validate` event is fired whenever `validate()` is called. @event iron-input-validate - */ \ No newline at end of file + */ + diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-list/.bower.json new file mode 100644 index 000000000000..34b9b0aa3e9b --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/.bower.json @@ -0,0 +1,41 @@ +{ + "name": "iron-list", + "version": "1.1.1", + "homepage": "https://github.com/PolymerElements/iron-list", + "authors": [ + "The Polymer Authors" + ], + "main": "iron-list.html", + "license": "http://polymer.github.io/LICENSE.txt", + "dependencies": { + "polymer": "Polymer/polymer#^1.1.0", + "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0" + }, + "devDependencies": { + "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0", + "iron-component-page": "polymerelements/iron-component-page#^1.0.0", + "paper-scroll-header-panel": "polymerelements/paper-scroll-header-panel#^1.0.0", + "paper-menu": "polymerelements/paper-menu#^1.0.0", + "paper-item": "polymerelements/paper-item#^1.0.0", + "paper-icon-button": "polymerelements/paper-icon-button#^1.0.0", + "paper-button": "polymerelements/paper-button#^1.0.0", + "iron-ajax": "polymerelements/iron-ajax#^1.0.0", + "iron-icon": "polymerelements/iron-icon#^1.0.0", + "iron-icons": "polymerelements/iron-icons#^1.0.0", + "paper-badge": "polymerelements/paper-badge#^1.0.0", + "paper-toolbar": "polymerelements/paper-toolbar#^1.0.0", + "test-fixture": "polymerelements/test-fixture#^1.0.0", + "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.2", + "web-component-tester": "*" + }, + "_release": "1.1.1", + "_resolution": { + "type": "version", + "tag": "v1.1.1", + "commit": "29b36794e05c421435b2f83fed5709ea7407726c" + }, + "_source": "git://github.com/PolymerElements/iron-list.git", + "_target": "^1.0.0", + "_originalSource": "PolymerElements/iron-list" +} \ No newline at end of file diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/.gitignore b/third_party/polymer/v1_0/components-chromium/iron-list/.gitignore new file mode 100644 index 000000000000..8d4ae2536ae4 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/.gitignore @@ -0,0 +1 @@ +bower_components diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/README.md b/third_party/polymer/v1_0/components-chromium/iron-list/README.md new file mode 100644 index 000000000000..ec6e6bd6e650 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/README.md @@ -0,0 +1,84 @@ +iron-list +======================== + +`iron-list` displays a virtual, *'infinite'* list. The template inside +the iron-list element represents the DOM to create for each list item. +The `items` property specifies an array of list item data. + +For performance reasons, not every item in the list is rendered at once; +instead a small subset of actual template elements *(enough to fill the viewport)* +are rendered and reused as the user scrolls. As such, it is important that all +state of the list template be bound to the model driving it, since the view may +be reused with a new model at any time. Particularly, any state that may change +as the result of a user interaction with the list item must be bound to the model +to avoid view state inconsistency. + +__Important:__ `iron-list` must ether be explicitly sized, or delegate scrolling to an +explicitly sized parent. By "explicitly sized", we mean it either has an explicit +CSS `height` property set via a class or inline style, or else is sized by other +layout means (e.g. the `flex` or `fit` classes). + +### Template model + +List item templates should bind to template models of the following structure: + +```js +{ + index: 0, // data index for this item + item: { // user data corresponding to items[index] + /* user item data */ + } +} +``` + +Alternatively, you can change the property name used as data index by changing the +`indexAs` property. The `as` property defines the name of the variable to add to the binding +scope for the array. + +For example, given the following `data` array: + +##### data.json + +```js +[ + {"name": "Bob"}, + {"name": "Tim"}, + {"name": "Mike"} +] +``` + +The following code would render the list (note the name and checked properties are +bound from the model object provided to the template scope): + +```html + +``` + +### Resizing + +`iron-list` lays out the items when it recives a notification via the `resize` event. +This event is fired by any element that implements `IronResizableBehavior`. + +By default, elements such as `iron-pages`, `paper-tabs` or `paper-dialog` will trigger +this event automatically. If you hide the list manually (e.g. you use `display: none`) +you might want to implement `IronResizableBehavior` or fire this event manually right +after the list became visible again. e.g. + +```js +document.querySelector('iron-list').fire('resize'); +``` + +### When should `` be used? + +`iron-list` should be used when a page has significantly more DOM nodes than the ones visible on the screen. e.g. the page has 500 nodes, but only 20 are visible at the time. This is why we refer to it as a `virtual` list. In this case, a `dom-repeat` will still create 500 nodes which could slow down the web app, but `iron-list` will only create 20. + +However, having an `iron-list` does not mean that you can load all the data at once. Say, you have a million records in the database, you want to split the data into pages so you can bring a page at the time. The page could contain 500 items, and iron-list will only render 20. diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/bower.json b/third_party/polymer/v1_0/components-chromium/iron-list/bower.json new file mode 100644 index 000000000000..a0ef228cda2e --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/bower.json @@ -0,0 +1,32 @@ +{ + "name": "iron-list", + "version": "1.1.1", + "homepage": "https://github.com/PolymerElements/iron-list", + "authors": [ + "The Polymer Authors" + ], + "main": "iron-list.html", + "license": "http://polymer.github.io/LICENSE.txt", + "dependencies": { + "polymer": "Polymer/polymer#^1.1.0", + "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0" + }, + "devDependencies": { + "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0", + "iron-component-page": "polymerelements/iron-component-page#^1.0.0", + "paper-scroll-header-panel": "polymerelements/paper-scroll-header-panel#^1.0.0", + "paper-menu": "polymerelements/paper-menu#^1.0.0", + "paper-item": "polymerelements/paper-item#^1.0.0", + "paper-icon-button": "polymerelements/paper-icon-button#^1.0.0", + "paper-button": "polymerelements/paper-button#^1.0.0", + "iron-ajax": "polymerelements/iron-ajax#^1.0.0", + "iron-icon": "polymerelements/iron-icon#^1.0.0", + "iron-icons": "polymerelements/iron-icons#^1.0.0", + "paper-badge": "polymerelements/paper-badge#^1.0.0", + "paper-toolbar": "polymerelements/paper-toolbar#^1.0.0", + "test-fixture": "polymerelements/test-fixture#^1.0.0", + "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.2", + "web-component-tester": "*" + } +} diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/index.html b/third_party/polymer/v1_0/components-chromium/iron-list/index.html new file mode 100644 index 000000000000..536371c6f059 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/index.html @@ -0,0 +1,26 @@ + + + + + + iron-list + + + + + + + + + + + + + diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js new file mode 100644 index 000000000000..f3e261c78197 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js @@ -0,0 +1,1122 @@ + + +(function() { + + var IOS = navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/); + var IOS_TOUCH_SCROLLING = IOS && IOS[1] >= 8; + var DEFAULT_PHYSICAL_COUNT = 20; + var MAX_PHYSICAL_COUNT = 500; + + Polymer({ + + is: 'iron-list', + + properties: { + + /** + * An array containing items determining how many instances of the template + * to stamp and that that each template instance should bind to. + */ + items: { + type: Array + }, + + /** + * The name of the variable to add to the binding scope for the array + * element associated with a given template instance. + */ + as: { + type: String, + value: 'item' + }, + + /** + * The name of the variable to add to the binding scope with the index + * for the row. If `sort` is provided, the index will reflect the + * sorted order (rather than the original array order). + */ + indexAs: { + type: String, + value: 'index' + }, + + /** + * The name of the variable to add to the binding scope to indicate + * if the row is selected. + */ + selectedAs: { + type: String, + value: 'selected' + }, + + /** + * When true, tapping a row will select the item, placing its data model + * in the set of selected items retrievable via the selection property. + * + * Note that tapping focusable elements within the list item will not + * result in selection, since they are presumed to have their * own action. + */ + selectionEnabled: { + type: Boolean, + value: false + }, + + /** + * When `multiSelection` is false, this is the currently selected item, or `null` + * if no item is selected. + */ + selectedItem: { + type: Object, + notify: true + }, + + /** + * When `multiSelection` is true, this is an array that contains the selected items. + */ + selectedItems: { + type: Object, + notify: true + }, + + /** + * When `true`, multiple items may be selected at once (in this case, + * `selected` is an array of currently selected items). When `false`, + * only one item may be selected at a time. + */ + multiSelection: { + type: Boolean, + value: false + } + }, + + observers: [ + '_itemsChanged(items.*)', + '_selectionEnabledChanged(selectionEnabled)', + '_multiSelectionChanged(multiSelection)' + ], + + behaviors: [ + Polymer.Templatizer, + Polymer.IronResizableBehavior + ], + + listeners: { + 'iron-resize': '_resizeHandler' + }, + + /** + * The ratio of hidden tiles that should remain in the scroll direction. + * Recommended value ~0.5, so it will distribute tiles evely in both directions. + */ + _ratio: 0.5, + + /** + * The element that controls the scroll + */ + _scroller: null, + + /** + * The padding-top value of the `scroller` element + */ + _scrollerPaddingTop: 0, + + /** + * This value is the same as `scrollTop`. + */ + _scrollPosition: 0, + + /** + * The number of tiles in the DOM. + */ + _physicalCount: 0, + + /** + * The k-th tile that is at the top of the scrolling list. + */ + _physicalStart: 0, + + /** + * The k-th tile that is at the bottom of the scrolling list. + */ + _physicalEnd: 0, + + /** + * The sum of the heights of all the tiles in the DOM. + */ + _physicalSize: 0, + + /** + * The average `offsetHeight` of the tiles observed till now. + */ + _physicalAverage: 0, + + /** + * The number of tiles which `offsetHeight` > 0 observed until now. + */ + _physicalAverageCount: 0, + + /** + * The Y position of the item rendered in the `_physicalStart` + * tile relative to the scrolling list. + */ + _physicalTop: 0, + + /** + * The number of items in the list. + */ + _virtualCount: 0, + + /** + * The n-th item rendered in the `_physicalStart` tile. + */ + _virtualStartVal: 0, + + /** + * A map between an item key and its physical item index + */ + _physicalIndexForKey: null, + + /** + * The estimated scroll height based on `_physicalAverage` + */ + _estScrollHeight: 0, + + /** + * The scroll height of the dom node + */ + _scrollHeight: 0, + + /** + * The size of the viewport + */ + _viewportSize: 0, + + /** + * An array of DOM nodes that are currently in the tree + */ + _physicalItems: null, + + /** + * An array of heights for each item in `_physicalItems` + */ + _physicalSizes: null, + + /** + * A cached value for the visible index. + * See `firstVisibleIndex` + */ + _firstVisibleIndexVal: null, + + /** + * A Polymer collection for the items. + */ + _collection: null, + + /** + * True if the current item list was rendered for the first time + * after attached. + */ + _itemsRendered: false, + + /** + * The bottom of the physical content. + */ + get _physicalBottom() { + return this._physicalTop + this._physicalSize; + }, + + /** + * The n-th item rendered in the last physical item. + */ + get _virtualEnd() { + return this._virtualStartVal + this._physicalCount - 1; + }, + + /** + * The lowest n-th value for an item such that it can be rendered in `_physicalStart`. + */ + _minVirtualStart: 0, + + /** + * The largest n-th value for an item such that it can be rendered in `_physicalStart`. + */ + get _maxVirtualStart() { + return this._virtualCount < this._physicalCount ? + this._virtualCount : this._virtualCount - this._physicalCount; + }, + + /** + * The height of the physical content that isn't on the screen. + */ + get _hiddenContentSize() { + return this._physicalSize - this._viewportSize; + }, + + /** + * The maximum scroll top value. + */ + get _maxScrollTop() { + return this._estScrollHeight - this._viewportSize; + }, + + /** + * Sets the n-th item rendered in `_physicalStart` + */ + set _virtualStart(val) { + // clamp the value so that _minVirtualStart <= val <= _maxVirtualStart + this._virtualStartVal = Math.min(this._maxVirtualStart, Math.max(this._minVirtualStart, val)); + this._physicalStart = this._virtualStartVal % this._physicalCount; + this._physicalEnd = (this._physicalStart + this._physicalCount - 1) % this._physicalCount; + }, + + /** + * Gets the n-th item rendered in `_physicalStart` + */ + get _virtualStart() { + return this._virtualStartVal; + }, + + /** + * An optimal physical size such that we will have enough physical items + * to fill up the viewport and recycle when the user scrolls. + * + * This default value assumes that we will at least have the equivalent + * to a viewport of physical items above and below the user's viewport. + */ + get _optPhysicalSize() { + return this._viewportSize * 3; + }, + + /** + * True if the current list is visible. + */ + get _isVisible() { + return this._scroller && Boolean(this._scroller.offsetWidth || this._scroller.offsetHeight); + }, + + /** + * Gets the first visible item in the viewport. + * + * @property firstVisibleIndex + */ + get firstVisibleIndex() { + var physicalOffset; + + if (this._firstVisibleIndexVal === null) { + physicalOffset = this._physicalTop; + + this._firstVisibleIndexVal = this._iterateItems( + function(pidx, vidx) { + physicalOffset += this._physicalSizes[pidx]; + + if (physicalOffset > this._scrollPosition) { + return vidx; + } + }) || 0; + } + + return this._firstVisibleIndexVal; + }, + + ready: function() { + if (IOS_TOUCH_SCROLLING) { + this._scrollListener = function() { + requestAnimationFrame(this._scrollHandler.bind(this)); + }.bind(this); + } else { + this._scrollListener = this._scrollHandler.bind(this); + } + }, + + /** + * When the element has been attached to the DOM tree. + */ + attached: function() { + // delegate to the parent's scroller + // e.g. paper-scroll-header-panel + var el = Polymer.dom(this); + + if (el.parentNode && el.parentNode.scroller) { + this._scroller = el.parentNode.scroller; + } else { + this._scroller = this; + this.classList.add('has-scroller'); + } + + if (IOS_TOUCH_SCROLLING) { + this._scroller.style.webkitOverflowScrolling = 'touch'; + } + + this._scroller.addEventListener('scroll', this._scrollListener); + + this.updateViewportBoundaries(); + this._render(); + }, + + /** + * When the element has been removed from the DOM tree. + */ + detached: function() { + this._itemsRendered = false; + if (this._scroller) { + this._scroller.removeEventListener('scroll', this._scrollListener); + } + }, + + /** + * Invoke this method if you dynamically update the viewport's + * size or CSS padding. + * + * @method updateViewportBoundaries + */ + updateViewportBoundaries: function() { + var scrollerStyle = window.getComputedStyle(this._scroller); + this._scrollerPaddingTop = parseInt(scrollerStyle['padding-top']); + this._viewportSize = this._scroller.offsetHeight; + }, + + /** + * Update the models, the position of the + * items in the viewport and recycle tiles as needed. + */ + _refresh: function() { + var SCROLL_DIRECTION_UP = -1; + var SCROLL_DIRECTION_DOWN = 1; + var SCROLL_DIRECTION_NONE = 0; + + // clamp the `scrollTop` value + // IE 10|11 scrollTop may go above `_maxScrollTop` + // iOS `scrollTop` may go below 0 and above `_maxScrollTop` + var scrollTop = Math.max(0, Math.min(this._maxScrollTop, this._scroller.scrollTop)); + + var tileHeight, kth, recycledTileSet; + var ratio = this._ratio; + var delta = scrollTop - this._scrollPosition; + var direction = SCROLL_DIRECTION_NONE; + var recycledTiles = 0; + var hiddenContentSize = this._hiddenContentSize; + var currentRatio = ratio; + var movingUp = []; + + // track the last `scrollTop` + this._scrollPosition = scrollTop; + + // clear cached visible index + this._firstVisibleIndexVal = null; + + // random access + if (Math.abs(delta) > this._physicalSize) { + this._physicalTop += delta; + direction = SCROLL_DIRECTION_NONE; + recycledTiles = Math.round(delta / this._physicalAverage); + } + // scroll up + else if (delta < 0) { + var topSpace = scrollTop - this._physicalTop; + var virtualStart = this._virtualStart; + + direction = SCROLL_DIRECTION_UP; + recycledTileSet = []; + + kth = this._physicalEnd; + currentRatio = topSpace / hiddenContentSize; + + // move tiles from bottom to top + while ( + // approximate `currentRatio` to `ratio` + currentRatio < ratio && + // recycle less physical items than the total + recycledTiles < this._physicalCount && + // ensure that these recycled tiles are needed + virtualStart - recycledTiles > 0 + ) { + + tileHeight = this._physicalSizes[kth] || this._physicalAverage; + currentRatio += tileHeight / hiddenContentSize; + + recycledTileSet.push(kth); + recycledTiles++; + kth = (kth === 0) ? this._physicalCount - 1 : kth - 1; + } + + movingUp = recycledTileSet; + recycledTiles = -recycledTiles; + + } + // scroll down + else if (delta > 0) { + var bottomSpace = this._physicalBottom - (scrollTop + this._viewportSize); + var virtualEnd = this._virtualEnd; + var lastVirtualItemIndex = this._virtualCount-1; + + direction = SCROLL_DIRECTION_DOWN; + recycledTileSet = []; + + kth = this._physicalStart; + currentRatio = bottomSpace / hiddenContentSize; + + // move tiles from top to bottom + while ( + // approximate `currentRatio` to `ratio` + currentRatio < ratio && + // recycle less physical items than the total + recycledTiles < this._physicalCount && + // ensure that these recycled tiles are needed + virtualEnd + recycledTiles < lastVirtualItemIndex + ) { + + tileHeight = this._physicalSizes[kth] || this._physicalAverage; + currentRatio += tileHeight / hiddenContentSize; + + this._physicalTop += tileHeight; + recycledTileSet.push(kth); + recycledTiles++; + kth = (kth + 1) % this._physicalCount; + } + } + + if (recycledTiles !== 0) { + this._virtualStart = this._virtualStart + recycledTiles; + this._update(recycledTileSet, movingUp); + } + }, + + /** + * Update the list of items, starting from the `_virtualStartVal` item. + */ + _update: function(itemSet, movingUp) { + // update models + this._assignModels(itemSet); + + // measure heights + // TODO(blasten) pass `recycledTileSet` + this._updateMetrics(); + + // adjust offset after measuring + if (movingUp) { + while (movingUp.length) { + this._physicalTop -= this._physicalSizes[movingUp.pop()]; + } + } + + // update the position of the items + this._positionItems(); + + // set the scroller size + this._updateScrollerSize(); + + // increase the pool of physical items if needed + if (itemSet = this._increasePoolIfNeeded()) { + // set models to the new items + this.async(this._update.bind(this, itemSet)); + } + }, + + /** + * Creates a pool of DOM elements and attaches them to the local dom. + */ + _createPool: function(size) { + var physicalItems = new Array(size); + + this._ensureTemplatized(); + + for (var i = 0; i < size; i++) { + var inst = this.stamp(null); + + // First element child is item; Safari doesn't support children[0] + // on a doc fragment + physicalItems[i] = inst.root.querySelector('*'); + Polymer.dom(this).appendChild(inst.root); + } + + return physicalItems; + }, + + /** + * Increases the pool size. That is, the physical items in the DOM. + * This function will allocate additional physical items + * (limited by `MAX_PHYSICAL_COUNT`) if the content size is shorter than + * `_optPhysicalSize` + * + * @return Array + */ + _increasePoolIfNeeded: function() { + if (this._physicalSize >= this._optPhysicalSize || this._physicalAverage === 0) { + return null; + } + + // the estimated number of physical items that we will need to reach + // the cap established by `_optPhysicalSize`. + var missingItems = Math.round( + (this._optPhysicalSize - this._physicalSize) * 1.2 / this._physicalAverage + ); + + // limit the size + var nextPhysicalCount = Math.min( + this._physicalCount + missingItems, + this._virtualCount, + MAX_PHYSICAL_COUNT + ); + + var prevPhysicalCount = this._physicalCount; + var delta = nextPhysicalCount - prevPhysicalCount; + + if (delta <= 0) { + return null; + } + + var newPhysicalItems = this._createPool(delta); + var emptyArray = new Array(delta); + + [].push.apply(this._physicalItems, newPhysicalItems); + [].push.apply(this._physicalSizes, emptyArray); + + this._physicalCount = prevPhysicalCount + delta; + + // fill the array with the new item pos + while (delta > 0) { + emptyArray[--delta] = prevPhysicalCount + delta; + } + + return emptyArray; + }, + + /** + * Render a new list of items. This method does exactly the same as `update`, + * but it also ensures that only one `update` cycle is created. + */ + _render: function() { + var requiresUpdate = this._virtualCount > 0 || this._physicalCount > 0; + + if (this.isAttached && !this._itemsRendered && this._isVisible && requiresUpdate) { + this._update(); + this._itemsRendered = true; + } + }, + + /** + * Templetizes the user template. + */ + _ensureTemplatized: function() { + if (!this.ctor) { + // Template instance props that should be excluded from forwarding + var props = {}; + + props.__key__ = true; + props[this.as] = true; + props[this.indexAs] = true; + props[this.selectedAs] = true; + + this._instanceProps = props; + this._userTemplate = Polymer.dom(this).querySelector('template'); + + if (this._userTemplate) { + this.templatize(this._userTemplate); + } else { + console.warn('iron-list requires a template to be provided in light-dom'); + } + } + }, + + /** + * Implements extension point from Templatizer mixin. + */ + _getStampedChildren: function() { + return this._physicalItems; + }, + + /** + * Implements extension point from Templatizer + * Called as a side effect of a template instance path change, responsible + * for notifying items.. change up to host. + */ + _forwardInstancePath: function(inst, path, value) { + if (path.indexOf(this.as + '.') === 0) { + this.notifyPath('items.' + inst.__key__ + '.' + + path.slice(this.as.length + 1), value); + } + }, + + /** + * Implements extension point from Templatizer mixin + * Called as side-effect of a host property change, responsible for + * notifying parent path change on each row. + */ + _forwardParentProp: function(prop, value) { + if (this._physicalItems) { + this._physicalItems.forEach(function(item) { + item._templateInstance[prop] = value; + }, this); + } + }, + + /** + * Implements extension point from Templatizer + * Called as side-effect of a host path change, responsible for + * notifying parent. path change on each row. + */ + _forwardParentPath: function(path, value) { + if (this._physicalItems) { + this._physicalItems.forEach(function(item) { + item._templateInstance.notifyPath(path, value, true); + }, this); + } + }, + + /** + * Called as a side effect of a host items.. path change, + * responsible for notifying item. changes to row for key. + */ + _forwardItemPath: function(path, value) { + if (this._physicalIndexForKey) { + var dot = path.indexOf('.'); + var key = path.substring(0, dot < 0 ? path.length : dot); + var idx = this._physicalIndexForKey[key]; + var row = this._physicalItems[idx]; + if (row) { + var inst = row._templateInstance; + if (dot >= 0) { + path = this.as + '.' + path.substring(dot+1); + inst.notifyPath(path, value, true); + } else { + inst[this.as] = value; + } + } + } + }, + + /** + * Called when the items have changed. That is, ressignments + * to `items`, splices or updates to a single item. + */ + _itemsChanged: function(change) { + if (change.path === 'items') { + // render the new set + this._itemsRendered = false; + + // update the whole set + this._virtualStartVal = 0; + this._physicalTop = 0; + this._virtualCount = this.items ? this.items.length : 0; + this._collection = this.items ? Polymer.Collection.get(this.items) : null; + this._physicalIndexForKey = {}; + + // scroll to the top + this._resetScrollPosition(0); + + // create the initial physical items + if (!this._physicalItems) { + this._physicalCount = Math.max(1, Math.min(DEFAULT_PHYSICAL_COUNT, this._virtualCount)); + this._physicalItems = this._createPool(this._physicalCount); + this._physicalSizes = new Array(this._physicalCount); + } + + this.debounce('refresh', this._render); + + } else if (change.path === 'items.splices') { + // render the new set + this._itemsRendered = false; + + this._adjustVirtualIndex(change.value.indexSplices); + this._virtualCount = this.items ? this.items.length : 0; + + this.debounce('refresh', this._render); + + } else { + // update a single item + this._forwardItemPath(change.path.split('.').slice(1).join('.'), change.value); + } + }, + + _adjustVirtualIndex: function(splices) { + var i, splice, idx; + + for (i = 0; i < splices.length; i++) { + splice = splices[i]; + + // deselect removed items + splice.removed.forEach(this.$.selector.deselect, this.$.selector); + + idx = splice.index; + // We only need to care about changes happening above the current position + if (idx >= this._virtualStartVal) { + break; + } + + this._virtualStart = this._virtualStart + + Math.max(splice.addedCount - splice.removed.length, idx - this._virtualStartVal); + } + }, + + _scrollHandler: function() { + this._refresh(); + }, + + /** + * Executes a provided function per every physical index in `itemSet` + * `itemSet` default value is equivalent to the entire set of physical indexes. + */ + _iterateItems: function(fn, itemSet) { + var pidx, vidx, rtn, i; + + if (arguments.length === 2 && itemSet) { + for (i = 0; i < itemSet.length; i++) { + pidx = itemSet[i]; + if (pidx >= this._physicalStart) { + vidx = this._virtualStartVal + (pidx - this._physicalStart); + } else { + vidx = this._virtualStartVal + (this._physicalCount - this._physicalStart) + pidx; + } + if ((rtn = fn.call(this, pidx, vidx)) != null) { + return rtn; + } + } + } else { + pidx = this._physicalStart; + vidx = this._virtualStartVal; + + for (; pidx < this._physicalCount; pidx++, vidx++) { + if ((rtn = fn.call(this, pidx, vidx)) != null) { + return rtn; + } + } + + pidx = 0; + + for (; pidx < this._physicalStart; pidx++, vidx++) { + if ((rtn = fn.call(this, pidx, vidx)) != null) { + return rtn; + } + } + } + }, + + /** + * Assigns the data models to a given set of items. + */ + _assignModels: function(itemSet) { + this._iterateItems(function(pidx, vidx) { + var el = this._physicalItems[pidx]; + var inst = el._templateInstance; + var item = this.items && this.items[vidx]; + + if (item) { + inst[this.as] = item; + inst.__key__ = this._collection.getKey(item); + inst[this.selectedAs] = this.$.selector.isSelected(item); + inst[this.indexAs] = vidx; + el.removeAttribute('hidden'); + this._physicalIndexForKey[inst.__key__] = pidx; + } else { + inst.__key__ = null; + el.setAttribute('hidden', ''); + } + + }, itemSet); + }, + + /** + * Updates the height for a given set of items. + */ + _updateMetrics: function() { + var total = 0; + var prevAvgCount = this._physicalAverageCount; + var prevPhysicalAvg = this._physicalAverage; + + // Make sure we distributed all the physical items + // so we can measure them + Polymer.dom.flush(); + + for (var i = 0; i < this._physicalCount; i++) { + this._physicalSizes[i] = this._physicalItems[i].offsetHeight; + total += this._physicalSizes[i]; + this._physicalAverageCount += this._physicalSizes[i] ? 1 : 0; + } + + this._physicalSize = total; + this._viewportSize = this._scroller.offsetHeight; + + if (this._physicalAverageCount !== prevAvgCount) { + this._physicalAverage = Math.round( + ((prevPhysicalAvg * prevAvgCount) + total) / + this._physicalAverageCount); + } + }, + + /** + * Updates the position of the physical items. + */ + _positionItems: function(itemSet) { + this._adjustScrollPosition(); + + var y = this._physicalTop; + + this._iterateItems(function(pidx) { + + this.transform('translate3d(0, ' + y + 'px, 0)', this._physicalItems[pidx]); + y += this._physicalSizes[pidx]; + + }, itemSet); + }, + + /** + * Adjusts the scroll position when it was overestimated. + */ + _adjustScrollPosition: function() { + var deltaHeight = this._virtualStartVal === 0 ? this._physicalTop : + Math.min(this._scrollPosition + this._physicalTop, 0); + + if (deltaHeight) { + this._physicalTop = this._physicalTop - deltaHeight; + + // juking scroll position during interial scrolling on iOS is no bueno + if (!IOS_TOUCH_SCROLLING) { + this._resetScrollPosition(this._scroller.scrollTop - deltaHeight); + } + } + }, + + /** + * Sets the position of the scroll. + */ + _resetScrollPosition: function(pos) { + if (this._scroller) { + this._scroller.scrollTop = pos; + this._scrollPosition = this._scroller.scrollTop; + } + }, + + /** + * Sets the scroll height, that's the height of the content, + */ + _updateScrollerSize: function(forceUpdate) { + this._estScrollHeight = (this._physicalBottom + + Math.max(this._virtualCount - this._physicalCount - this._virtualStartVal, 0) * this._physicalAverage); + + forceUpdate = forceUpdate || this._scrollHeight === 0; + forceUpdate = forceUpdate || this._scrollPosition >= this._estScrollHeight - this._physicalSize; + + // amortize height adjustment, so it won't trigger repaints very often + if (forceUpdate || Math.abs(this._estScrollHeight - this._scrollHeight) >= this._optPhysicalSize) { + this.$.items.style.height = this._estScrollHeight + 'px'; + this._scrollHeight = this._estScrollHeight; + } + }, + + /** + * Scroll to a specific item in the virtual list regardless + * of the physical items in the DOM tree. + * + * @method scrollToIndex + * @param {number} idx The index of the item + */ + scrollToIndex: function(idx) { + if (typeof idx !== 'number') { + return; + } + + var itemSet; + var firstVisible = this.firstVisibleIndex; + + idx = Math.min(Math.max(idx, 0), this._virtualCount-1); + + // start at the previous virtual item + // so we have a item above the first visible item + this._virtualStart = idx - 1; + + // assign new models + this._assignModels(); + + // measure the new sizes + this._updateMetrics(); + + // estimate new physical offset + this._physicalTop = this._virtualStart * this._physicalAverage; + + var currentTopItem = this._physicalStart; + var currentVirtualItem = this._virtualStart; + var targetOffsetTop = 0; + var hiddenContentSize = this._hiddenContentSize; + + // scroll to the item as much as we can + while (currentVirtualItem !== idx && targetOffsetTop < hiddenContentSize) { + targetOffsetTop = targetOffsetTop + this._physicalSizes[currentTopItem]; + currentTopItem = (currentTopItem + 1) % this._physicalCount; + currentVirtualItem++; + } + + // update the scroller size + this._updateScrollerSize(true); + + // update the position of the items + this._positionItems(); + + // set the new scroll position + this._resetScrollPosition(this._physicalTop + targetOffsetTop + 1); + + // increase the pool of physical items if needed + if (itemSet = this._increasePoolIfNeeded()) { + // set models to the new items + this.async(this._update.bind(this, itemSet)); + } + + // clear cached visible index + this._firstVisibleIndexVal = null; + }, + + /** + * Reset the physical average and the average count. + */ + _resetAverage: function() { + this._physicalAverage = 0; + this._physicalAverageCount = 0; + }, + + /** + * A handler for the `resize` event triggered by `IronResizableBehavior` + * when the element is resized. + */ + _resizeHandler: function() { + this.debounce('resize', function() { + this._render(); + if (this._itemsRendered && this._physicalItems && this._isVisible) { + this._resetAverage(); + this.updateViewportBoundaries(); + this.scrollToIndex(this.firstVisibleIndex); + } + }); + }, + + _getModelFromItem: function(item) { + var key = this._collection.getKey(item); + var pidx = this._physicalIndexForKey[key]; + + if (pidx !== undefined) { + return this._physicalItems[pidx]._templateInstance; + } + return null; + }, + + /** + * Select the list item at the given index. + * + * @method selectItem + * @param {(Object|number)} item the item object or its index + */ + selectItem: function(item) { + if (typeof item === 'number') { + item = this.items[item]; + if (!item) { + throw new RangeError(' not found'); + } + } else { + if (this._collection.getKey(item) === undefined) { + throw new TypeError(' should be a valid item'); + } + } + + var model = this._getModelFromItem(item); + + if (!this.multiSelection && this.selectedItem) { + this.deselectItem(this.selectedItem); + } + if (model) { + model[this.selectedAs] = true; + } + this.$.selector.select(item); + }, + + /** + * Deselects the given item list if it is already selected. + * + * @method deselect + * @param {(Object|number)} item the item object or its index + */ + deselectItem: function(item) { + if (typeof item === 'number') { + item = this.items[item]; + if (!item) { + throw new RangeError(' not found'); + } + } else { + if (this._collection.getKey(item) === undefined) { + throw new TypeError(' should be a valid item'); + } + } + + var model = this._getModelFromItem(item); + + if (model) { + model[this.selectedAs] = false; + } + this.$.selector.deselect(item); + }, + + /** + * Select or deselect a given item depending on whether the item + * has already been selected. + * + * @method toggleSelectionForItem + * @param {(Object|number)} item the item object or its index + */ + toggleSelectionForItem: function(item) { + var item = typeof item === 'number' ? this.items[item] : item; + if (this.$.selector.isSelected(item)) { + this.deselectItem(item); + } else { + this.selectItem(item); + } + }, + + /** + * Clears the current selection state of the list. + * + * @method clearSelection + */ + clearSelection: function() { + function unselect(item) { + var model = this._getModelFromItem(item); + if (model) { + model[this.selectedAs] = false; + } + } + + if (Array.isArray(this.selectedItems)) { + this.selectedItems.forEach(unselect, this); + } else if (this.selectedItem) { + unselect.call(this, this.selectedItem); + } + + this.$.selector.clearSelection(); + }, + + /** + * Add an event listener to `tap` if `selectionEnabled` is true, + * it will remove the listener otherwise. + */ + _selectionEnabledChanged: function(selectionEnabled) { + if (selectionEnabled) { + this.listen(this, 'tap', '_selectionHandler'); + } else { + this.unlisten(this, 'tap', '_selectionHandler'); + } + }, + + /** + * Select an item from an event object. + */ + _selectionHandler: function(e) { + var model = this.modelForElement(e.target); + if (model) { + this.toggleSelectionForItem(model[this.as]); + } + }, + + _multiSelectionChanged: function(multiSelection) { + this.clearSelection(); + this.$.selector.multi = multiSelection; + } + }); + +})(); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/iron-list.html b/third_party/polymer/v1_0/components-chromium/iron-list/iron-list.html new file mode 100644 index 000000000000..3cd50be93585 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/iron-list/iron-list.html @@ -0,0 +1,128 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/third_party/polymer/v1_0/components-chromium/iron-media-query/iron-media-query-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-media-query/iron-media-query-extracted.js index fb72e85f069f..a827c28bd170 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-media-query/iron-media-query-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-media-query/iron-media-query-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'iron-media-query', @@ -44,4 +46,5 @@ Polymer({ this._setQueryMatches(mq.matches); } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js index 6353283bad54..b6238162a8c2 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * `Polymer.IronMenuBehavior` implements accessible menu behavior. * * @demo demo/index.html @@ -189,4 +191,5 @@ Polymer.IronMultiSelectableBehavior, Polymer.IronA11yKeysBehavior, Polymer.IronMenuBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menubar-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menubar-behavior-extracted.js index a5b4c6e4e40c..744a158d66f1 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menubar-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menubar-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * `Polymer.IronMenubarBehavior` implements accessible menubar behavior. * * @polymerBehavior Polymer.IronMenubarBehavior @@ -45,4 +47,5 @@ Polymer.IronMenubarBehavior = [ Polymer.IronMenuBehavior, Polymer.IronMenubarBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-meta/iron-meta-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-meta/iron-meta-extracted.js index ea81812061b0..e9a74f079a44 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-meta/iron-meta-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-meta/iron-meta-extracted.js @@ -1,4 +1,6 @@ -(function() { + + + (function() { // monostate data var metaDatas = {}; @@ -258,4 +260,4 @@ }); - })(); \ No newline at end of file + })(); diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-backdrop-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-backdrop-extracted.js index fe3616380659..f3fd930bb916 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-backdrop-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-backdrop-extracted.js @@ -1,3 +1,5 @@ + + (function() { Polymer({ @@ -65,4 +67,5 @@ }); -})(); \ No newline at end of file +})(); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js index eaf45191f6fc..380ab4259dfd 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js @@ -1,3 +1,5 @@ + + /** Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or shown, and displays on top of other content. It includes an optional backdrop, and can be used to implement a variety @@ -409,4 +411,6 @@ context. You should place this element as a child of `` whenever possible. }; /** @polymerBehavior */ - Polymer.IronOverlayBehavior = [Polymer.IronFitBehavior, Polymer.IronResizableBehavior, Polymer.IronOverlayBehaviorImpl]; \ No newline at end of file + Polymer.IronOverlayBehavior = [Polymer.IronFitBehavior, Polymer.IronResizableBehavior, Polymer.IronOverlayBehaviorImpl]; + + diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js index 128a38229d81..0d97ded63522 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js @@ -1,4 +1,6 @@ -Polymer.IronOverlayManager = (function() { + + + Polymer.IronOverlayManager = (function() { var overlays = []; var DEFAULT_Z = 10; @@ -92,4 +94,5 @@ Polymer.IronOverlayManager = (function() { getBackdrops: getBackdrops }; - })(); \ No newline at end of file + })(); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-pages/iron-pages-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-pages/iron-pages-extracted.js index 9e8ccb5d86c5..c1952fcb4639 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-pages/iron-pages-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-pages/iron-pages-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'iron-pages', @@ -27,4 +29,5 @@ Polymer({ _selectedPageChanged: function(selected, old) { this.async(this.notifyResize); } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-range-behavior/iron-range-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-range-behavior/iron-range-behavior-extracted.js index 8d681e8b0c75..c16f335fbfac 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-range-behavior/iron-range-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-range-behavior/iron-range-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * `iron-range-behavior` provides the behavior for something with a minimum to maximum range. * * @demo demo/index.html @@ -91,4 +93,4 @@ this._setRatio(this._calcRatio(this.value) * 100); } -}; \ No newline at end of file +}; diff --git a/third_party/polymer/v1_0/components-chromium/iron-resizable-behavior/iron-resizable-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-resizable-behavior/iron-resizable-behavior-extracted.js index ee0b4bf9ff18..37efb02d4aaf 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-resizable-behavior/iron-resizable-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-resizable-behavior/iron-resizable-behavior-extracted.js @@ -1,4 +1,5 @@ -/** + + /** * `IronResizableBehavior` is a behavior that can be used in Polymer elements to * coordinate the flow of resize events between "resizers" (elements that control the * size or hidden state of their children) and "resizables" (elements that need to be @@ -175,4 +176,4 @@ descendant.notifyResize(); this._notifyingDescendant = false; } - }; \ No newline at end of file + }; diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json index 31050826e9e0..85d168eb46ab 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json +++ b/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-selector", - "version": "1.0.2", + "version": "1.0.3", "description": "Manages a set of elements that can be selected", "private": true, "license": "http://polymer.github.io/LICENSE.txt", @@ -19,21 +19,23 @@ "type": "git", "url": "git://github.com/PolymerElements/iron-selector.git" }, + "homepage": "https://github.com/PolymerElements/iron-selector", + "ignore": [], "dependencies": { "polymer": "Polymer/polymer#^1.0.0" }, "devDependencies": { + "paper-styles": "PolymerElements/paper-styles#^1.0.4", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/PolymerElements/iron-selector", - "_release": "1.0.2", + "_release": "1.0.3", "_resolution": { "type": "version", - "tag": "v1.0.2", - "commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf" + "tag": "v1.0.3", + "commit": "d93b02871f790b6bcb1fff52f24757e9c2eb04a5" }, "_source": "git://github.com/PolymerElements/iron-selector.git", "_target": "^1.0.0", diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json b/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json index b9751df1288e..25324a685a29 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json +++ b/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json @@ -1,6 +1,6 @@ { "name": "iron-selector", - "version": "1.0.2", + "version": "1.0.3", "description": "Manages a set of elements that can be selected", "private": true, "license": "http://polymer.github.io/LICENSE.txt", @@ -19,10 +19,13 @@ "type": "git", "url": "git://github.com/PolymerElements/iron-selector.git" }, + "homepage": "https://github.com/PolymerElements/iron-selector", + "ignore": [], "dependencies": { "polymer": "Polymer/polymer#^1.0.0" }, "devDependencies": { + "paper-styles": "PolymerElements/paper-styles#^1.0.4", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", "web-component-tester": "*", diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js index 2ed4c21bdd78..a595e492e827 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js @@ -1,4 +1,5 @@ -/** @polymerBehavior Polymer.IronMultiSelectableBehavior */ + + /** @polymerBehavior Polymer.IronMultiSelectableBehavior */ Polymer.IronMultiSelectableBehaviorImpl = { properties: { @@ -101,4 +102,5 @@ Polymer.IronMultiSelectableBehavior = [ Polymer.IronSelectableBehavior, Polymer.IronMultiSelectableBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js index 9b5a4b33b280..5c1031b49b8a 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js @@ -1,6 +1,29 @@ -/** @polymerBehavior */ + + + /** @polymerBehavior */ Polymer.IronSelectableBehavior = { + /** + * Fired when iron-selector is activated (selected or deselected). + * It is fired before the selected items are changed. + * Cancel the event to abort selection. + * + * @event iron-activate + * + **/ + /** + * Fired when an item is selected + * + * @event iron-select + * + **/ + /** + * Fired when an item is deselected + * + * @event iron-deselect + * + **/ + properties: { /** @@ -54,7 +77,7 @@ }, /** - * This is a CSS selector sting. If this is set, only items that matches the CSS selector + * This is a CSS selector string. If this is set, only items that match the CSS selector * are selectable. * * @attribute selectable @@ -82,18 +105,30 @@ selectedAttribute: { type: String, value: null - } + }, + + /** + * The set of excluded elements where the key is the `localName` + * of the element that will be ignored from the item list. + * + * @type {object} + * @default {template: 1} + */ + excludedLocalNames: { + type: Object, + value: function() { + return { + 'template': 1 + }; + } + } }, observers: [ '_updateSelected(attrForSelected, selected)' ], - excludedLocalNames: { - 'template': 1 - }, - created: function() { this._bindFilterItem = this._filterItem.bind(this); this._selection = new Polymer.IronSelection(this._applySelection.bind(this)); @@ -172,9 +207,7 @@ }, _removeListener: function(eventName) { - // There is no unlisten yet... - // https://github.com/Polymer/polymer/issues/1639 - //this.removeEventListener(eventName, this._bindActivateHandler); + this.unlisten(this, eventName, '_activateHandler'); }, _activateEventChanged: function(eventName, old) { @@ -263,11 +296,6 @@ }, _activateHandler: function(e) { - // TODO: remove this when https://github.com/Polymer/polymer/issues/1639 is fixed so we - // can just remove the old event listener. - if (e.type !== this.activateEvent) { - return; - } var t = e.target; var items = this.items; while (t && t != this) { @@ -288,4 +316,5 @@ } } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js index 11ec5e5dcee2..2758326eff5b 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * @param {!Function} selectCallback * @constructor */ @@ -96,4 +98,5 @@ this.setItemSelected(item, !this.isSelected(item)); } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selector-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selector-extracted.js index ca0a5f852b64..d4306554fb59 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selector-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selector-extracted.js @@ -1,4 +1,5 @@ -/** + + /** `iron-selector` is an element which can be used to manage a list of elements that can be selected. Tapping on the item will make the item selected. The `selected` indicates which item is being selected. The default is to use the index of the item. @@ -52,4 +53,5 @@ Polymer.IronMultiSelectableBehavior ] - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/iron-test-helpers/iron-test-helpers-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-test-helpers/iron-test-helpers-extracted.js index d2d1627b258b..4143fa59c731 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-test-helpers/iron-test-helpers-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-test-helpers/iron-test-helpers-extracted.js @@ -1,4 +1,5 @@ -(function(global) { + + (function(global) { 'use strict'; var TestHelpers = global.TestHelpers = global.TestHelpers || {}; @@ -6,4 +7,4 @@ TestHelpers.flushAsynchronousOperations = flushAsynchronousOperations; TestHelpers.forceXIfStamp = forceXIfStamp; TestHelpers.fireEvent = fireEvent; - })(this); \ No newline at end of file + })(this); diff --git a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js index 33319ad9e7cb..2a46c879e192 100644 --- a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.IronValidatableBehavior` to implement an element that validates user input. * * ### Accessibility @@ -101,4 +103,5 @@ } return true; } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/cascaded-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/cascaded-animation-extracted.js index fa03fb948bf4..d2761228b173 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/cascaded-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/cascaded-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'cascaded-animation', @@ -65,4 +67,5 @@ Polymer({ } } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-in-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-in-animation-extracted.js index 378ad14d04f1..28666b1301fd 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-in-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-in-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'fade-in-animation', @@ -15,4 +17,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-out-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-out-animation-extracted.js index 6e596cf1bfe7..3f06ec54b9a4 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-out-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/fade-out-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'fade-out-animation', @@ -15,4 +17,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/hero-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/hero-animation-extracted.js index 33a11b22998a..19616b9628de 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/hero-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/hero-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'hero-animation', @@ -41,4 +43,5 @@ Polymer({ shared.from.style.visibility = ''; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/opaque-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/opaque-animation-extracted.js index 6dfbb95f8146..c5a4b5cf1f4d 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/opaque-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/opaque-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'opaque-animation', @@ -20,4 +22,5 @@ Polymer({ config.node.style.opacity = ''; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/reverse-ripple-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/reverse-ripple-animation-extracted.js index 70b20cc5e20e..7629865e1b98 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/reverse-ripple-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/reverse-ripple-animation-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'reverse-ripple-animation', behaviors: [ @@ -45,4 +46,4 @@ Polymer({ this.sharedElements.from.style.borderRadius = ''; } } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/ripple-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/ripple-animation-extracted.js index 6bbaacda59a1..96b4b812baa1 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/ripple-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/ripple-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'ripple-animation', @@ -47,4 +49,5 @@ Polymer({ } } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-down-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-down-animation-extracted.js index 8520e4a1aa17..c87a64c3674f 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-down-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-down-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'scale-down-animation', @@ -28,4 +30,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-up-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-up-animation-extracted.js index 902909356662..c94708c1faea 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-up-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/scale-up-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'scale-up-animation', @@ -28,4 +30,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-down-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-down-animation-extracted.js index 1e105bae42e6..e711b4094357 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-down-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-down-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'slide-down-animation', @@ -23,4 +25,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-left-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-left-animation-extracted.js index d5ae23b213dc..56cd846937c1 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-left-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-left-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'slide-from-left-animation', @@ -23,4 +25,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-right-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-right-animation-extracted.js index 760ff33109e1..02f5b84ef748 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-right-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-from-right-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'slide-from-right-animation', @@ -23,4 +25,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-left-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-left-animation-extracted.js index 2acf0c1150c3..194884912c4b 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-left-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-left-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'slide-left-animation', @@ -23,4 +25,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-right-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-right-animation-extracted.js index 3605eeac7fbd..057b16b9f155 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-right-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-right-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'slide-right-animation', @@ -23,4 +25,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-up-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-up-animation-extracted.js index 02c59feb5c4d..5030ad58a3b6 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-up-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/slide-up-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'slide-up-animation', @@ -23,4 +25,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/transform-animation-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/transform-animation-extracted.js index 39fde38a7836..048e3a142dc3 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/animations/transform-animation-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/animations/transform-animation-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'transform-animation', @@ -32,4 +34,5 @@ Polymer({ return this._effect; } - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-behavior-extracted.js index 9c9ad978b518..366388eee212 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * `Polymer.NeonAnimatableBehavior` is implemented by elements containing animations for use with * elements implementing `Polymer.NeonAnimationRunnerBehavior`. * @polymerBehavior @@ -137,4 +139,5 @@ return allConfigs; } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-extracted.js index acab9f1989cb..8fb41affc942 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animatable-extracted.js @@ -1,4 +1,6 @@ -Polymer({ + + + Polymer({ is: 'neon-animatable', @@ -6,4 +8,5 @@ Polymer({ Polymer.NeonAnimatableBehavior ] - }); \ No newline at end of file + }); + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js index 7673d9225313..37a4a3f36578 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js @@ -1,3 +1,4 @@ + (function() { Polymer({ @@ -160,4 +161,4 @@ }) -})(); \ No newline at end of file +})(); diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-behavior-extracted.js index a54bec692207..8b8f9dc92a5a 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.NeonAnimationBehavior` to implement an animation. * @polymerBehavior */ @@ -65,4 +67,5 @@ */ complete: function() {} - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-runner-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-runner-behavior-extracted.js index 1c88739c9961..1c06f05e3ccb 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-runner-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animation-runner-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * `Polymer.NeonAnimationRunnerBehavior` adds a method to run animations. * * @polymerBehavior Polymer.NeonAnimationRunnerBehavior @@ -101,4 +103,4 @@ Polymer.NeonAnimationRunnerBehavior = [ Polymer.NeonAnimatableBehavior, Polymer.NeonAnimationRunnerBehaviorImpl - ]; \ No newline at end of file + ]; diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animatable-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animatable-behavior-extracted.js index b179ff0d4432..19fe4988c1a6 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animatable-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animatable-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.NeonSharedElementAnimatableBehavior` to implement elements containing shared element * animations. * @polymerBehavior Polymer.NeonSharedElementAnimatableBehavior @@ -23,4 +25,5 @@ Polymer.NeonSharedElementAnimatableBehavior = [ Polymer.NeonAnimatableBehavior, Polymer.NeonSharedElementAnimatableBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animation-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animation-behavior-extracted.js index dd799aa91fc1..28f7617aaf82 100644 --- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animation-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-shared-element-animation-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.NeonSharedElementAnimationBehavior` to implement shared element animations. * @polymerBehavior Polymer.NeonSharedElementAnimationBehavior */ @@ -52,4 +54,5 @@ Polymer.NeonSharedElementAnimationBehavior = [ Polymer.NeonAnimationBehavior, Polymer.NeonSharedElementAnimationBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js index 91386dee7893..b830c52b3da2 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js @@ -1,4 +1,6 @@ -/** @polymerBehavior */ + + + /** @polymerBehavior */ Polymer.PaperButtonBehaviorImpl = { properties: { @@ -36,4 +38,5 @@ Polymer.IronButtonState, Polymer.IronControlState, Polymer.PaperButtonBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js index c4a8aa843338..9130ec1070ff 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus. * * @polymerBehavior Polymer.PaperInkyFocusBehavior @@ -24,4 +26,5 @@ Polymer.IronButtonState, Polymer.IronControlState, Polymer.PaperInkyFocusBehaviorImpl - ]; \ No newline at end of file + ]; + diff --git a/third_party/polymer/v1_0/components-chromium/paper-button/paper-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-button/paper-button-extracted.js index e5598731ae12..22c5fd0b32e5 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-button/paper-button-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-button/paper-button-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-button', behaviors: [ @@ -32,4 +33,4 @@ Polymer({ } return className; } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js index e9219ee28d30..6264cf9d8b8a 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-checkbox', behaviors: [ @@ -75,4 +76,5 @@ Polymer({ _computeCheckmarkClass: function(checked) { return checked ? '' : 'hidden'; } - }); \ No newline at end of file + }); + \ No newline at end of file diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js index 78887d4c5e00..099e60760a11 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js @@ -1,3 +1,5 @@ + + /** Use `Polymer.PaperDialogBehavior` and `paper-dialog-common.css` to implement a Material Design dialog. @@ -218,4 +220,5 @@ The `aria-labelledby` attribute will be set to the header element, if one exists }; /** @polymerBehavior */ - Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialogBehaviorImpl]; \ No newline at end of file + Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialogBehaviorImpl]; + diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js index a91d6ce17e38..6e3705c7eb15 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js @@ -1,3 +1,5 @@ + + (function() { Polymer({ @@ -37,4 +39,5 @@ }); -})(); \ No newline at end of file +})(); + diff --git a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js index 11d316408b5e..6305886a5ffa 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js @@ -1,4 +1,6 @@ -(function() { + + + (function() { 'use strict'; @@ -450,4 +452,5 @@ }); - }()); \ No newline at end of file + }()); + diff --git a/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js index ced348a6bc24..ba644826c6f0 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js @@ -1,4 +1,5 @@ -(function() { + + (function() { 'use strict'; Polymer({ @@ -191,4 +192,4 @@ return noLabelFloat ? -4 : 16; } }); - })(); \ No newline at end of file + })(); diff --git a/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js index 25c09c963eb8..0e261f9ec5d1 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-fab', behaviors: [ @@ -55,4 +56,4 @@ Polymer({ return className; } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js index a8db4e51030d..814e0b1dbaf8 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js @@ -1,4 +1,6 @@ -(function() { + + + (function() { 'use strict'; @@ -244,4 +246,5 @@ }); - })(); \ No newline at end of file + })(); + diff --git a/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js index ec51fd04602a..c04bcd6ad314 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-icon-button', hostAttributes: { @@ -45,4 +46,4 @@ Polymer({ this.setAttribute('aria-label', newValue); } } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json index 7a4033515fed..8387d1f61023 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json +++ b/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json @@ -1,6 +1,6 @@ { "name": "paper-input", - "version": "1.0.13", + "version": "1.0.14", "description": "Material design text fields", "authors": [ "The Polymer Authors" @@ -36,7 +36,7 @@ }, "devDependencies": { "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "web-component-tester": "*", + "web-component-tester": "Polymer/web-component-tester#^3.3.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-icon": "PolymerElements/iron-icon#^1.0.0", @@ -44,11 +44,11 @@ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0", "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0" }, - "_release": "1.0.13", + "_release": "1.0.14", "_resolution": { "type": "version", - "tag": "v1.0.13", - "commit": "3f3d09f47b77e33ea4a0c531a1b95567563528a0" + "tag": "v1.0.14", + "commit": "120a0610aca5c86194977e30f696b09716f93bbc" }, "_source": "git://github.com/PolymerElements/paper-input.git", "_target": "^1.0.0", diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/bower.json b/third_party/polymer/v1_0/components-chromium/paper-input/bower.json index ce50fb4df061..ad9a70a40d07 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/bower.json +++ b/third_party/polymer/v1_0/components-chromium/paper-input/bower.json @@ -1,6 +1,6 @@ { "name": "paper-input", - "version": "1.0.13", + "version": "1.0.14", "description": "Material design text fields", "authors": [ "The Polymer Authors" @@ -36,7 +36,7 @@ }, "devDependencies": { "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "web-component-tester": "*", + "web-component-tester": "Polymer/web-component-tester#^3.3.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-icon": "PolymerElements/iron-icon#^1.0.0", diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js index d3e469c2c323..14a5f1ab57ea 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.PaperInputAddonBehavior` to implement an add-on for ``. A * add-on appears below the input, and may display information based on the input value and * validity such as a character counter or an error message. @@ -28,4 +30,5 @@ update: function(state) { } - }; \ No newline at end of file + }; + diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js index cef44440e6d0..94a0515af3bc 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js @@ -1,4 +1,6 @@ -/** + + + /** * Use `Polymer.PaperInputBehavior` to implement inputs with ``. This * behavior is implemented by ``. It exposes a number of properties from * `` and `` and they should be bound in your @@ -11,6 +13,11 @@ Polymer.PaperInputBehaviorImpl = { properties: { + /** + * Fired when the input changes due to user interaction. + * + * @event change + */ /** * The label for this input. Bind this to ``'s `label` property. @@ -381,9 +388,23 @@ label.id = labelledBy; } this._ariaLabelledBy = labelledBy; + }, + + _onChange:function(event) { + // In the Shadow DOM, the `change` event is not leaked into the + // ancestor tree, so we must do this manually. + // See https://w3c.github.io/webcomponents/spec/shadow/#events-that-are-not-leaked-into-ancestor-trees. + if (this.shadowRoot) { + this.fire(event.type, {sourceEvent: event}, { + node: this, + bubbles: event.bubbles, + cancelable: event.cancelable + }); + } } }; /** @polymerBehavior */ - Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBehaviorImpl]; \ No newline at end of file + Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBehaviorImpl]; + diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-char-counter-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-char-counter-extracted.js index 6577627933ed..7c889f0bde46 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-char-counter-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-char-counter-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-input-char-counter', behaviors: [ @@ -27,4 +28,4 @@ Polymer({ } this._charCounterStr = str; } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js index d214ad6774be..35205cb682c3 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-input-container', properties: { @@ -277,4 +278,4 @@ Polymer({ } return cls; } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-error-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-error-extracted.js index ac6fe00b81b0..4fc1676519d1 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-error-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-error-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-input-error', behaviors: [ @@ -19,4 +20,4 @@ Polymer({ update: function(state) { this._setInvalid(state.invalid); } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-extracted.js index 5a4b8b50514a..352680ba61d8 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-input', behaviors: [ @@ -6,4 +7,4 @@ Polymer({ Polymer.PaperInputBehavior, Polymer.IronControlState ] - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html index ed4f06df06b9..e3ccb4fe0e9c 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html @@ -78,7 +78,7 @@ style this element. - + diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea-extracted.js index 4950ef215341..36ede0c0f090 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea-extracted.js +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea-extracted.js @@ -1,4 +1,5 @@ -Polymer({ + + Polymer({ is: 'paper-textarea', behaviors: [ @@ -49,4 +50,4 @@ Polymer({ _ariaDescribedByChanged: function(ariaDescribedBy) { this.$.input.textarea.setAttribute('aria-describedby', ariaDescribedBy); } - }); \ No newline at end of file + }); diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html b/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html index 2d5a9de95fb2..8f68c07436b9 100644 --- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html +++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html @@ -42,7 +42,7 @@ style this element. - +