Commit f748e9cf4da73cc932099c4818f77a25a5f9188d

Authored by Luigi Serra
1 parent b9dd9495

new controllet and update

Showing 270 changed files with 11004 additions and 1411 deletions

Too many changes.

To preserve performance only 100 of 270 files are displayed.

bower_components/google-map/.bower.json
1 1 {
2 2 "name": "google-map",
3   - "version": "1.1.4",
  3 + "version": "1.1.5",
4 4 "description": "Google Maps web components",
5 5 "homepage": "https://elements.polymer-project.org/elements/google-map",
6 6 "main": [
... ... @@ -37,11 +37,11 @@
37 37 "web-component-tester": "*",
38 38 "iron-component-page": "PolymerElements/iron-component-page#^1.0.2"
39 39 },
40   - "_release": "1.1.4",
  40 + "_release": "1.1.5",
41 41 "_resolution": {
42 42 "type": "version",
43   - "tag": "1.1.4",
44   - "commit": "571392000956d93dddd9e2f6d3eb9593a588f5f0"
  43 + "tag": "1.1.5",
  44 + "commit": "3ff5c11d7aa90874d7f0ac75e076f512981ffd26"
45 45 },
46 46 "_source": "git://github.com/GoogleWebComponents/google-map.git",
47 47 "_target": "^1.0.0",
... ...
bower_components/google-map/bower.json
1 1 {
2 2 "name": "google-map",
3   - "version": "1.1.4",
  3 + "version": "1.1.5",
4 4 "description": "Google Maps web components",
5 5 "homepage": "https://elements.polymer-project.org/elements/google-map",
6 6 "main": [
... ...
bower_components/google-map/google-map.html
... ... @@ -330,6 +330,11 @@ The `google-map` element renders a Google Map.
330 330 * Use to specify additional options we do not expose as
331 331 * properties.
332 332 * Ex: `<google-map additional-map-options='{"mapTypeId":"satellite"}'>`
  333 + *
  334 + * Note, you can't use API enums like `google.maps.ControlPosition.TOP_RIGHT`
  335 + * when using this property as an HTML attribute. Instead, use the actual
  336 + * value (e.g. `3`) or set `.additionalMapOptions` in JS rather than using
  337 + * the attribute.
333 338 */
334 339 additionalMapOptions: {
335 340 type: Object,
... ...
bower_components/iron-a11y-keys-behavior/.bower.json
1 1 {
2 2 "name": "iron-a11y-keys-behavior",
3   - "version": "1.0.7",
  3 + "version": "1.0.8",
4 4 "description": "A behavior that enables keybindings for greater a11y.",
5 5 "keywords": [
6 6 "web-components",
... ... @@ -30,11 +30,11 @@
30 30 "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
31 31 },
32 32 "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
33   - "_release": "1.0.7",
  33 + "_release": "1.0.8",
34 34 "_resolution": {
35 35 "type": "version",
36   - "tag": "v1.0.7",
37   - "commit": "4dfdd8cca76eabe12245e86deb9d5da3cd717460"
  36 + "tag": "v1.0.8",
  37 + "commit": "df29a9edcff3b4693707f1e3eebce5a1dc46e946"
38 38 },
39 39 "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git",
40 40 "_target": "^1.0.0",
... ...
bower_components/iron-a11y-keys-behavior/bower.json
1 1 {
2 2 "name": "iron-a11y-keys-behavior",
3   - "version": "1.0.7",
  3 + "version": "1.0.8",
4 4 "description": "A behavior that enables keybindings for greater a11y.",
5 5 "keywords": [
6 6 "web-components",
... ...
bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
... ... @@ -424,10 +424,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
424 424 _triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {
425 425 var detail = Object.create(keyCombo);
426 426 detail.keyboardEvent = keyboardEvent;
427   -
428   - this[handlerName].call(this, new CustomEvent(keyCombo.event, {
429   - detail: detail
430   - }));
  427 + var event = new CustomEvent(keyCombo.event, {
  428 + detail: detail,
  429 + cancelable: true
  430 + });
  431 + this[handlerName].call(this, event);
  432 + if (event.defaultPrevented) {
  433 + keyboardEvent.preventDefault();
  434 + }
431 435 }
432 436 };
433 437 })();
... ...
bower_components/iron-a11y-keys-behavior/test/basic-test.html
... ... @@ -70,6 +70,9 @@ suite(&#39;Polymer.IronA11yKeysBehavior&#39;, function() {
70 70 _keyHandler: function(event) {
71 71 this.keyCount++;
72 72 this.lastEvent = event;
  73 + },
  74 + _preventDefaultHandler: function(event) {
  75 + event.preventDefault();
73 76 }
74 77 }];
75 78  
... ... @@ -124,7 +127,8 @@ suite(&#39;Polymer.IronA11yKeysBehavior&#39;, function() {
124 127 ],
125 128  
126 129 keyBindings: {
127   - 'space': '_keyHandler'
  130 + 'space': '_keyHandler',
  131 + 'enter': '_preventDefaultHandler'
128 132 }
129 133 });
130 134 });
... ... @@ -273,6 +277,21 @@ suite(&#39;Polymer.IronA11yKeysBehavior&#39;, function() {
273 277 });
274 278 });
275 279  
  280 + suite('prevent default behavior of event', function() {
  281 + setup(function() {
  282 + keys = fixture('BehaviorKeys');
  283 + });
  284 + test('defaultPrevented is correctly set', function() {
  285 + var keySpy = sinon.spy();
  286 +
  287 + document.addEventListener('keydown', keySpy);
  288 +
  289 + MockInteractions.pressEnter(keys);
  290 +
  291 + expect(keySpy.getCall(0).args[0].defaultPrevented).to.be.equal(true);
  292 + });
  293 + });
  294 +
276 295 });
277 296 </script>
278 297 </body>
... ...
bower_components/iron-ajax/.bower.json
1 1 {
2 2 "name": "iron-ajax",
3   - "version": "1.0.6",
  3 + "version": "1.0.7",
4 4 "description": "Makes it easy to make ajax calls and parse the response",
5 5 "private": true,
6 6 "authors": [
... ... @@ -32,11 +32,11 @@
32 32 "web-component-tester": "*",
33 33 "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
34 34 },
35   - "_release": "1.0.6",
  35 + "_release": "1.0.7",
36 36 "_resolution": {
37 37 "type": "version",
38   - "tag": "v1.0.6",
39   - "commit": "72f463a166013e12880bb881d680adf386520c49"
  38 + "tag": "v1.0.7",
  39 + "commit": "dc3dda81a963e9fd788ed69ed350c5f4cf84d857"
40 40 },
41 41 "_source": "git://github.com/PolymerElements/iron-ajax.git",
42 42 "_target": "^1.0.0",
... ...
bower_components/iron-ajax/bower.json
1 1 {
2 2 "name": "iron-ajax",
3   - "version": "1.0.6",
  3 + "version": "1.0.7",
4 4 "description": "Makes it easy to make ajax calls and parse the response",
5 5 "private": true,
6 6 "authors": [
... ...
bower_components/iron-ajax/iron-ajax.html
... ... @@ -69,8 +69,7 @@ element.
69 69 * The URL target of the request.
70 70 */
71 71 url: {
72   - type: String,
73   - value: ''
  72 + type: String
74 73 },
75 74  
76 75 /**
... ... @@ -242,6 +241,8 @@ element.
242 241 *
243 242 * The type of the response is determined by the value of `handleAs` at
244 243 * the time that the request was generated.
  244 + *
  245 + * @type {Object}
245 246 */
246 247 lastResponse: {
247 248 type: Object,
... ... @@ -251,6 +252,8 @@ element.
251 252  
252 253 /**
253 254 * lastRequest's error, if any.
  255 + *
  256 + * @type {Object}
254 257 */
255 258 lastError: {
256 259 type: Object,
... ... @@ -353,13 +356,15 @@ element.
353 356 contentType = 'application/x-www-form-urlencoded';
354 357 }
355 358 if (contentType) {
356   - headers['Content-Type'] = contentType;
  359 + headers['content-type'] = contentType;
357 360 }
358 361 var header;
359 362  
360 363 if (this.headers instanceof Object) {
361 364 for (header in this.headers) {
362   - headers[header] = this.headers[header].toString();
  365 + // Normalize headers in lower case to make it easier for iron-request
  366 + // to reason about them.
  367 + headers[header.toLowerCase()] = this.headers[header].toString();
363 368 }
364 369 }
365 370  
... ... @@ -381,7 +386,7 @@ element.
381 386 */
382 387 toRequestOptions: function() {
383 388 return {
384   - url: this.requestUrl,
  389 + url: this.requestUrl || '',
385 390 method: this.method,
386 391 headers: this.requestHeaders,
387 392 body: this.body,
... ... @@ -462,7 +467,7 @@ element.
462 467  
463 468 _requestOptionsChanged: function() {
464 469 this.debounce('generate-request', function() {
465   - if (!this.url && this.url !== '') {
  470 + if (this.url == null) {
466 471 return;
467 472 }
468 473  
... ...
bower_components/iron-ajax/iron-request.html
... ... @@ -183,7 +183,7 @@ iron-request can be used to perform XMLHttpRequests.
183 183 * async By default, all requests are sent asynchronously. To send synchronous requests,
184 184 * set to true.
185 185 * body The content for the request body for POST method.
186   - * headers HTTP request headers.
  186 + * headers HTTP request headers. All keys must be lower case.
187 187 * handleAs The response type. Default is 'text'.
188 188 * withCredentials Whether or not to send credentials on the request. Default is false.
189 189 * timeout: (Number|undefined)
... ... @@ -241,20 +241,28 @@ iron-request can be used to perform XMLHttpRequests.
241 241 options.async !== false
242 242 );
243 243  
244   - if (options.headers) {
245   - Object.keys(options.headers).forEach(function (requestHeader) {
246   - xhr.setRequestHeader(
247   - requestHeader,
248   - options.headers[requestHeader]
249   - );
250   - }, this);
  244 + var acceptType = {
  245 + 'json': 'application/json',
  246 + 'text': 'text/plain',
  247 + 'html': 'text/html',
  248 + 'xml': 'application/xml',
  249 + 'arraybuffer': 'application/octet-stream'
  250 + }[options.handleAs];
  251 + var headers = options.headers || {};
  252 + if (acceptType && !headers['accept']) {
  253 + headers['accept'] = acceptType;
251 254 }
  255 + Object.keys(headers).forEach(function (requestHeader) {
  256 + if (/[A-Z]/.test(requestHeader)) {
  257 + console.error('Headers must be lower case, got', requestHeader);
  258 + }
  259 + xhr.setRequestHeader(
  260 + requestHeader,
  261 + headers[requestHeader]
  262 + );
  263 + }, this);
252 264  
253   - var contentType;
254   - if (options.headers) {
255   - contentType = options.headers['Content-Type'];
256   - }
257   - var body = this._encodeBodyObject(options.body, contentType);
  265 + var body = this._encodeBodyObject(options.body, headers['content-type']);
258 266  
259 267 // In IE, `xhr.responseType` is an empty string when the response
260 268 // returns. Hence, caching it as `xhr._responseType`.
... ...
bower_components/iron-ajax/test/iron-ajax.html
... ... @@ -55,6 +55,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
55 55 debounce-duration="150"></iron-ajax>
56 56 </template>
57 57 </test-fixture>
  58 + <test-fixture id='BlankUrl'>
  59 + <template>
  60 + <iron-ajax auto handle-as='text'></iron-ajax>
  61 + </template>
  62 + </test-fixture>
58 63 <!-- note(rictic):
59 64 This makes us dependent on a third-party server, but we need to be able
60 65 to check what headers the browser actually sends on the wire.
... ... @@ -197,6 +202,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
197 202 });
198 203 });
199 204  
  205 + suite('when url isn\'t set yet', function() {
  206 + test('we don\'t fire any automatic requests', function() {
  207 + expect(server.requests.length).to.be.equal(0);
  208 + ajax = fixture('BlankUrl');
  209 +
  210 + return timePasses(1).then(function() {
  211 + // We don't make any requests.
  212 + expect(server.requests.length).to.be.equal(0);
  213 +
  214 + // Explicitly asking for the request to fire works.
  215 + ajax.generateRequest();
  216 + expect(server.requests.length).to.be.equal(1);
  217 + server.requests = [];
  218 +
  219 + // Explicitly setting url to '' works too.
  220 + ajax = fixture('BlankUrl');
  221 + ajax.url = '';
  222 + return timePasses(1);
  223 + }).then(function() {
  224 + expect(server.requests.length).to.be.equal(1);
  225 + });
  226 + });
  227 + });
  228 +
200 229 suite('when properties are changed', function() {
201 230 test('generates simple-request elements that reflect the change', function() {
202 231 request = ajax.generateRequest();
... ... @@ -590,6 +619,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
590 619 expect(typeof(ajax.lastResponse)).to.be.equal('string');
591 620 });
592 621  
  622 + expect(server.requests.length).to.be.equal(1);
  623 + expect(server.requests[0].requestHeaders['accept']).to.be.equal(
  624 + 'text/plain');
593 625 server.respond();
594 626  
595 627 return promise;
... ... @@ -662,6 +694,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
662 694 expect(typeof(ajax.lastResponse)).to.be.equal('object');
663 695 });
664 696  
  697 + expect(server.requests.length).to.be.equal(1);
  698 + expect(server.requests[0].requestHeaders['accept']).to.be.equal(
  699 + 'application/json');
  700 +
665 701 server.respond();
666 702  
667 703 return promise;
... ...
bower_components/iron-ajax/test/iron-request.html
... ... @@ -126,6 +126,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
126 126 options.handleAs = 'json';
127 127  
128 128 request.send(options);
  129 + expect(server.requests.length).to.be.equal(1);
  130 + expect(server.requests[0].requestHeaders['accept']).to.be.equal(
  131 + 'application/json');
129 132 server.respond();
130 133  
131 134 return request.completes.then(function() {
... ... @@ -139,6 +142,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
139 142 options.async = false;
140 143  
141 144 request.send(options);
  145 + expect(server.requests.length).to.be.equal(1);
  146 + expect(server.requests[0].requestHeaders['accept']).to.be.equal(
  147 + 'application/json');
142 148 server.respond();
143 149  
144 150 return request.completes.then(function() {
... ...
bower_components/iron-autogrow-textarea/.bower.json
1 1 {
2 2 "name": "iron-autogrow-textarea",
3   - "version": "1.0.7",
  3 + "version": "1.0.8",
4 4 "description": "A textarea element that automatically grows with input",
5 5 "authors": [
6 6 "The Polymer Authors"
... ... @@ -37,11 +37,11 @@
37 37 "paper-styles": "PolymerElements/paper-styles#^1.0.0",
38 38 "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
39 39 },
40   - "_release": "1.0.7",
  40 + "_release": "1.0.8",
41 41 "_resolution": {
42 42 "type": "version",
43   - "tag": "v1.0.7",
44   - "commit": "f31131a9c45af7845780f94ec7e69816929ac6cc"
  43 + "tag": "v1.0.8",
  44 + "commit": "ea7fb14d8038ccbedc6e85b9c4842b68c659a503"
45 45 },
46 46 "_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
47 47 "_target": "^1.0.0",
... ...
bower_components/iron-autogrow-textarea/bower.json
1 1 {
2 2 "name": "iron-autogrow-textarea",
3   - "version": "1.0.7",
  3 + "version": "1.0.8",
4 4 "description": "A textarea element that automatically grows with input",
5 5 "authors": [
6 6 "The Polymer Authors"
... ...
bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
... ... @@ -10,7 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
10 10  
11 11 <link rel="import" href="../polymer/polymer.html">
12 12 <link rel="import" href="../iron-behaviors/iron-control-state.html">
13   -<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
  13 +<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
14 14 <link rel="import" href="../iron-validatable-behavior/iron-validatable-behavior.html">
15 15 <link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
16 16  
... ... @@ -55,6 +55,10 @@ Custom property | Description | Default
55 55 word-wrap: break-word;
56 56 }
57 57  
  58 + .fit {
  59 + @apply(--layout-fit);
  60 + }
  61 +
58 62 textarea {
59 63 position: relative;
60 64 outline: none;
... ... @@ -68,6 +72,7 @@ Custom property | Description | Default
68 72 font-size: inherit;
69 73 font-family: inherit;
70 74 line-height: inherit;
  75 + text-align: inherit;
71 76 @apply(--iron-autogrow-textarea);
72 77 }
73 78  
... ... @@ -78,7 +83,8 @@ Custom property | Description | Default
78 83 </style>
79 84 <template>
80 85 <!-- the mirror sizes the input/textarea so it grows with typing -->
81   - <div id="mirror" class="mirror-text" aria-hidden="true">&nbsp;</div>
  86 + <!-- use &#160; instead &nbsp; of to allow this element to be used in XHTML -->
  87 + <div id="mirror" class="mirror-text" aria-hidden="true">&#160;</div>
82 88  
83 89 <!-- size the input/textarea with a div, because the textarea has intrinsic size in ff -->
84 90 <div class="textarea-container fit">
... ... @@ -112,6 +118,8 @@ Custom property | Description | Default
112 118  
113 119 /**
114 120 * Use this property instead of `value` for two-way data binding.
  121 + *
  122 + * @type {string|number|undefined|null}
115 123 */
116 124 bindValue: {
117 125 observer: '_bindValueChanged',
... ... @@ -315,7 +323,8 @@ Custom property | Description | Default
315 323 while (this.rows > 0 && _tokens.length < this.rows) {
316 324 _tokens.push('');
317 325 }
318   - return _tokens.join('<br>') + '&nbsp;';
  326 + // Use &#160; instead &nbsp; of to allow this element to be used in XHTML.
  327 + return _tokens.join('<br/>') + '&#160;';
319 328 },
320 329  
321 330 _valueForMirror: function() {
... ...
bower_components/iron-component-page/.bower.json
... ... @@ -13,7 +13,7 @@
13 13 "type": "git",
14 14 "url": "git://github.com/PolymerElements/iron-component-page.git"
15 15 },
16   - "version": "1.0.7",
  16 + "version": "1.0.8",
17 17 "private": true,
18 18 "license": "http://polymer.github.io/LICENSE.txt",
19 19 "dependencies": {
... ... @@ -34,11 +34,11 @@
34 34 "web-component-tester": "*"
35 35 },
36 36 "homepage": "https://github.com/PolymerElements/iron-component-page",
37   - "_release": "1.0.7",
  37 + "_release": "1.0.8",
38 38 "_resolution": {
39 39 "type": "version",
40   - "tag": "v1.0.7",
41   - "commit": "77a463d00fcf0f00a764dd01fd01a6f21bd40745"
  40 + "tag": "v1.0.8",
  41 + "commit": "62c6498987e17b5480d8d05ddcaf2fa9ef8525a0"
42 42 },
43 43 "_source": "git://github.com/PolymerElements/iron-component-page.git",
44 44 "_target": "^1.0.0",
... ...
bower_components/iron-component-page/bower.json
... ... @@ -13,7 +13,7 @@
13 13 "type": "git",
14 14 "url": "git://github.com/PolymerElements/iron-component-page.git"
15 15 },
16   - "version": "1.0.7",
  16 + "version": "1.0.8",
17 17 "private": true,
18 18 "license": "http://polymer.github.io/LICENSE.txt",
19 19 "dependencies": {
... ...
bower_components/iron-component-page/iron-component-page.css
... ... @@ -98,8 +98,9 @@ paper-toolbar a:hover, paper-toolbar a:hover iron-icon, paper-toolbar a.iron-sel
98 98 }
99 99  
100 100 #docs {
  101 + max-width: var(--iron-component-page-max-width, 48em);
  102 + @apply(--iron-component-page-container);
101 103 padding: 20px;
102   - max-width: 48em;
103 104 margin: 0 auto;
104 105 }
105 106  
... ...
bower_components/iron-iconset-svg/.bower.json
1 1 {
2 2 "name": "iron-iconset-svg",
3 3 "description": "Manages a set of svg icons",
4   - "version": "1.0.7",
  4 + "version": "1.0.8",
5 5 "keywords": [
6 6 "web-components",
7 7 "polymer",
... ... @@ -30,11 +30,11 @@
30 30 "web-component-tester": "*"
31 31 },
32 32 "homepage": "https://github.com/PolymerElements/iron-iconset-svg",
33   - "_release": "1.0.7",
  33 + "_release": "1.0.8",
34 34 "_resolution": {
35 35 "type": "version",
36   - "tag": "v1.0.7",
37   - "commit": "e34ed33838b872d38753eefec2e697d8adb8662d"
  36 + "tag": "v1.0.8",
  37 + "commit": "7f8b0a5800254247cb518356aee983155374f519"
38 38 },
39 39 "_source": "git://github.com/PolymerElements/iron-iconset-svg.git",
40 40 "_target": "^1.0.0",
... ...
bower_components/iron-iconset-svg/bower.json
1 1 {
2 2 "name": "iron-iconset-svg",
3 3 "description": "Manages a set of svg icons",
4   - "version": "1.0.7",
  4 + "version": "1.0.8",
5 5 "keywords": [
6 6 "web-components",
7 7 "polymer",
... ...
bower_components/iron-iconset-svg/iron-iconset-svg.html
... ... @@ -69,6 +69,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
69 69 }
70 70  
71 71 },
  72 +
  73 + attached: function() {
  74 + this.style.display = 'none';
  75 + },
72 76  
73 77 /**
74 78 * Construct an array of all icon names in this iconset.
... ...
bower_components/iron-iconset-svg/test/iron-iconset-svg.html
... ... @@ -78,6 +78,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
78 78 expect(meta.byKey('foo')).to.be.equal(iconset);
79 79 });
80 80  
  81 + test('it does not have a size', function () {
  82 + var rect = iconset.getBoundingClientRect();
  83 + expect(rect.width).to.be.equal(0);
  84 + expect(rect.height).to.be.equal(0);
  85 + });
  86 +
81 87 test('it fires an iron-iconset-added event on the window', function() {
82 88 return loadedPromise;
83 89 });
... ... @@ -93,6 +99,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
93 99 div = elements[1];
94 100 });
95 101  
  102 + test('it does not have a size', function () {
  103 + var rect = iconset.getBoundingClientRect();
  104 + expect(rect.width).to.be.equal(0);
  105 + expect(rect.height).to.be.equal(0);
  106 + });
  107 +
96 108 test('appends a child to the target element', function () {
97 109 expect(div.firstElementChild).to.not.be.ok;
98 110 iconset.applyIcon(div, 'circle');
... ...
bower_components/iron-list/.bower.json
... ... @@ -7,7 +7,7 @@
7 7 "list",
8 8 "virtual-list"
9 9 ],
10   - "version": "1.1.4",
  10 + "version": "1.1.5",
11 11 "homepage": "https://github.com/PolymerElements/iron-list",
12 12 "authors": [
13 13 "The Polymer Authors"
... ... @@ -37,11 +37,11 @@
37 37 "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.2",
38 38 "web-component-tester": "*"
39 39 },
40   - "_release": "1.1.4",
  40 + "_release": "1.1.5",
41 41 "_resolution": {
42 42 "type": "version",
43   - "tag": "v1.1.4",
44   - "commit": "7f1b6c05d96c2655ad138e99f3ee44d074f8df7b"
  43 + "tag": "v1.1.5",
  44 + "commit": "c6bf7caf1745cc3bed0769d41ac405476ef981b8"
45 45 },
46 46 "_source": "git://github.com/PolymerElements/iron-list.git",
47 47 "_target": "^1.0.0",
... ...
bower_components/iron-list/bower.json
... ... @@ -7,7 +7,7 @@
7 7 "list",
8 8 "virtual-list"
9 9 ],
10   - "version": "1.1.4",
  10 + "version": "1.1.5",
11 11 "homepage": "https://github.com/PolymerElements/iron-list",
12 12 "authors": [
13 13 "The Polymer Authors"
... ...
bower_components/iron-list/demo/index.html
... ... @@ -117,7 +117,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
117 117 <iron-list items="[[data]]" as="item">
118 118 <template>
119 119 <div>
120   - <div class="item" tabindex="0">
  120 + <div class="item">
121 121 <img class="avatar" src="[[item.image]]">
122 122 <div class="pad">
123 123 <div class="primary">[[item.name]]</div>
... ...
bower_components/iron-list/iron-list.html
... ... @@ -371,6 +371,13 @@ after the list became visible again. e.g.
371 371 },
372 372  
373 373 /**
  374 + * The bottom of the scroll.
  375 + */
  376 + get _scrollBottom() {
  377 + return this._scrollPosition + this._viewportSize;
  378 + },
  379 +
  380 + /**
374 381 * The n-th item rendered in the last physical item.
375 382 */
376 383 get _virtualEnd() {
... ... @@ -525,19 +532,13 @@ after the list became visible again. e.g.
525 532 * items in the viewport and recycle tiles as needed.
526 533 */
527 534 _refresh: function() {
528   - var SCROLL_DIRECTION_UP = -1;
529   - var SCROLL_DIRECTION_DOWN = 1;
530   - var SCROLL_DIRECTION_NONE = 0;
531   -
532 535 // clamp the `scrollTop` value
533 536 // IE 10|11 scrollTop may go above `_maxScrollTop`
534 537 // iOS `scrollTop` may go below 0 and above `_maxScrollTop`
535 538 var scrollTop = Math.max(0, Math.min(this._maxScrollTop, this._scroller.scrollTop));
536   -
537   - var tileHeight, kth, recycledTileSet;
  539 + var tileHeight, tileTop, kth, recycledTileSet, scrollBottom;
538 540 var ratio = this._ratio;
539 541 var delta = scrollTop - this._scrollPosition;
540   - var direction = SCROLL_DIRECTION_NONE;
541 542 var recycledTiles = 0;
542 543 var hiddenContentSize = this._hiddenContentSize;
543 544 var currentRatio = ratio;
... ... @@ -549,18 +550,19 @@ after the list became visible again. e.g.
549 550 // clear cached visible index
550 551 this._firstVisibleIndexVal = null;
551 552  
  553 + scrollBottom = this._scrollBottom;
  554 +
552 555 // random access
553 556 if (Math.abs(delta) > this._physicalSize) {
554 557 this._physicalTop += delta;
555   - direction = SCROLL_DIRECTION_NONE;
556 558 recycledTiles = Math.round(delta / this._physicalAverage);
557 559 }
558 560 // scroll up
559 561 else if (delta < 0) {
560 562 var topSpace = scrollTop - this._physicalTop;
561 563 var virtualStart = this._virtualStart;
  564 + var physicalBottom = this._physicalBottom;
562 565  
563   - direction = SCROLL_DIRECTION_UP;
564 566 recycledTileSet = [];
565 567  
566 568 kth = this._physicalEnd;
... ... @@ -573,12 +575,14 @@ after the list became visible again. e.g.
573 575 // recycle less physical items than the total
574 576 recycledTiles < this._physicalCount &&
575 577 // ensure that these recycled tiles are needed
576   - virtualStart - recycledTiles > 0
  578 + virtualStart - recycledTiles > 0 &&
  579 + // ensure that the tile is not visible
  580 + physicalBottom - this._physicalSizes[kth] > scrollBottom
577 581 ) {
578 582  
579   - tileHeight = this._physicalSizes[kth] || this._physicalAverage;
  583 + tileHeight = this._physicalSizes[kth];
580 584 currentRatio += tileHeight / hiddenContentSize;
581   -
  585 + physicalBottom -= tileHeight;
582 586 recycledTileSet.push(kth);
583 587 recycledTiles++;
584 588 kth = (kth === 0) ? this._physicalCount - 1 : kth - 1;
... ... @@ -586,15 +590,13 @@ after the list became visible again. e.g.
586 590  
587 591 movingUp = recycledTileSet;
588 592 recycledTiles = -recycledTiles;
589   -
590 593 }
591 594 // scroll down
592 595 else if (delta > 0) {
593   - var bottomSpace = this._physicalBottom - (scrollTop + this._viewportSize);
  596 + var bottomSpace = this._physicalBottom - scrollBottom;
594 597 var virtualEnd = this._virtualEnd;
595 598 var lastVirtualItemIndex = this._virtualCount-1;
596 599  
597   - direction = SCROLL_DIRECTION_DOWN;
598 600 recycledTileSet = [];
599 601  
600 602 kth = this._physicalStart;
... ... @@ -607,10 +609,12 @@ after the list became visible again. e.g.
607 609 // recycle less physical items than the total
608 610 recycledTiles < this._physicalCount &&
609 611 // ensure that these recycled tiles are needed
610   - virtualEnd + recycledTiles < lastVirtualItemIndex
  612 + virtualEnd + recycledTiles < lastVirtualItemIndex &&
  613 + // ensure that the tile is not visible
  614 + this._physicalTop + this._physicalSizes[kth] < scrollTop
611 615 ) {
612 616  
613   - tileHeight = this._physicalSizes[kth] || this._physicalAverage;
  617 + tileHeight = this._physicalSizes[kth];
614 618 currentRatio += tileHeight / hiddenContentSize;
615 619  
616 620 this._physicalTop += tileHeight;
... ... @@ -620,7 +624,15 @@ after the list became visible again. e.g.
620 624 }
621 625 }
622 626  
623   - if (recycledTiles !== 0) {
  627 + if (recycledTiles === 0) {
  628 + // If the list ever reach this case, the physical average is not significant enough
  629 + // to create all the items needed to cover the entire viewport.
  630 + // e.g. A few items have a height that differs from the average by serveral order of magnitude.
  631 + if (this._increasePoolIfNeeded()) {
  632 + // yield and set models to the new items
  633 + this.async(this._update);
  634 + }
  635 + } else {
624 636 this._virtualStart = this._virtualStart + recycledTiles;
625 637 this._update(recycledTileSet, movingUp);
626 638 }
... ... @@ -652,7 +664,7 @@ after the list became visible again. e.g.
652 664  
653 665 // increase the pool of physical items if needed
654 666 if (this._increasePoolIfNeeded()) {
655   - // set models to the new items
  667 + // yield set models to the new items
656 668 this.async(this._update);
657 669 }
658 670 },
... ... @@ -678,7 +690,7 @@ after the list became visible again. e.g.
678 690 },
679 691  
680 692 /**
681   - * Increases the pool size. That is, the physical items in the DOM.
  693 + * Increases the pool of physical items only if needed.
682 694 * This function will allocate additional physical items
683 695 * (limited by `MAX_PHYSICAL_COUNT`) if the content size is shorter than
684 696 * `_optPhysicalSize`
... ... @@ -686,16 +698,22 @@ after the list became visible again. e.g.
686 698 * @return boolean
687 699 */
688 700 _increasePoolIfNeeded: function() {
689   - if (this._physicalSize >= this._optPhysicalSize || this._physicalAverage === 0) {
  701 + if (this._physicalAverage === 0) {
690 702 return false;
691 703 }
  704 + if (this._physicalBottom < this._scrollBottom || this._physicalTop > this._scrollPosition) {
  705 + return this._increasePool(1);
  706 + }
  707 + if (this._physicalSize < this._optPhysicalSize) {
  708 + return this._increasePool(Math.round((this._optPhysicalSize - this._physicalSize) * 1.2 / this._physicalAverage));
  709 + }
  710 + return false;
  711 + },
692 712  
693   - // the estimated number of physical items that we will need to reach
694   - // the cap established by `_optPhysicalSize`.
695   - var missingItems = Math.round(
696   - (this._optPhysicalSize - this._physicalSize) * 1.2 / this._physicalAverage
697   - );
698   -
  713 + /**
  714 + * Increases the pool size.
  715 + */
  716 + _increasePool: function(missingItems) {
699 717 // limit the size
700 718 var nextPhysicalCount = Math.min(
701 719 this._physicalCount + missingItems,
... ... @@ -710,11 +728,8 @@ after the list became visible again. e.g.
710 728 return false;
711 729 }
712 730  
713   - var newPhysicalItems = this._createPool(delta);
714   - var emptyArray = new Array(delta);
715   -
716   - [].push.apply(this._physicalItems, newPhysicalItems);
717   - [].push.apply(this._physicalSizes, emptyArray);
  731 + [].push.apply(this._physicalItems, this._createPool(delta));
  732 + [].push.apply(this._physicalSizes, new Array(delta));
718 733  
719 734 this._physicalCount = prevPhysicalCount + delta;
720 735  
... ... @@ -1109,10 +1124,9 @@ after the list became visible again. e.g.
1109 1124  
1110 1125 // increase the pool of physical items if needed
1111 1126 if (this._increasePoolIfNeeded()) {
1112   - // set models to the new items
  1127 + // yield set models to the new items
1113 1128 this.async(this._update);
1114 1129 }
1115   -
1116 1130 // clear cached visible index
1117 1131 this._firstVisibleIndexVal = null;
1118 1132 },
... ...
bower_components/iron-list/test/different-heights.html 0 โ†’ 100644
  1 +<!doctype html>
  2 +<!--
  3 +@license
  4 +Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
  5 +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
  6 +The complete set of authors may be found at http://polymer.github.io/AUTHORS
  7 +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
  8 +Code distributed by Google as part of the polymer project is also
  9 +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
  10 +-->
  11 +<html>
  12 +<head>
  13 + <meta charset="UTF-8">
  14 + <title>iron-list test</title>
  15 + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  16 +
  17 + <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
  18 + <script src="../../web-component-tester/browser.js"></script>
  19 + <script src="../../test-fixture/test-fixture-mocha.js"></script>
  20 + <script src="../../iron-test-helpers/mock-interactions.js"></script>
  21 +
  22 + <link rel="import" href="../../test-fixture/test-fixture.html">
  23 + <link rel="import" href="../../paper-styles/paper-styles.html">
  24 + <link rel="import" href="helpers.html">
  25 + <link rel="import" href="x-list.html">
  26 +
  27 +</head>
  28 +<body>
  29 +
  30 + <test-fixture id="trivialList">
  31 + <template>
  32 + <x-list></x-list>
  33 + </template>
  34 + </test-fixture>
  35 +
  36 + <script>
  37 +
  38 + suite('Different heights', function() {
  39 + var list, container;
  40 +
  41 + setup(function() {
  42 + container = fixture('trivialList');
  43 + list = container.list;
  44 + });
  45 +
  46 + test('render without gaps 1', function(done) {
  47 + list.items = [
  48 + {index: 0, height: 791},
  49 + {index: 1, height: 671}
  50 + ];
  51 +
  52 + flush(function() {
  53 + list.push('items',
  54 + {index: 2, height: 251},
  55 + {index: 3, height: 191},
  56 + {index: 4, height: 151},
  57 + {index: 5, height: 191},
  58 + {index: 6, height: 51},
  59 + {index: 7, height: 51},
  60 + {index: 8, height: 51}
  61 + );
  62 +
  63 + list.addEventListener('scroll', function() {
  64 + assert.isTrue(isFullOfItems(list));
  65 + });
  66 +
  67 + simulateScroll({
  68 + list: list,
  69 + contribution: 15,
  70 + target: 100000
  71 + }, function() {
  72 + done();
  73 + });
  74 + });
  75 + });
  76 +
  77 + test('render without gaps 2', function(done) {
  78 + var height = 2, items = [];
  79 +
  80 + while (items.length < 15) {
  81 + items.push({height: height});
  82 + height *= 1.5;
  83 + }
  84 + list.items = items;
  85 +
  86 + flush(function() {
  87 + list.addEventListener('scroll', function() {
  88 + assert.isTrue(isFullOfItems(list));
  89 + });
  90 +
  91 + simulateScroll({
  92 + list: list,
  93 + contribution: 20,
  94 + target: 100000
  95 + }, function() {
  96 + done();
  97 + });
  98 + });
  99 + });
  100 +
  101 + test('render without gaps 3', function(done) {
  102 + var heights = [20, 100, 140, 117, 800, 50, 15, 80, 90, 255, 20, 15, 19, 250, 314];
  103 +
  104 + list.items = heights.map(function(height) {
  105 + return {height: height};
  106 + });
  107 +
  108 + flush(function() {
  109 + list.addEventListener('scroll', function() {
  110 + assert.isTrue(isFullOfItems(list));
  111 + });
  112 +
  113 + simulateScroll({
  114 + list: list,
  115 + contribution: 20,
  116 + target: 100000
  117 + }, function() {
  118 + done();
  119 + });
  120 + });
  121 + });
  122 +
  123 + });
  124 +
  125 + </script>
  126 +
  127 +</body>
  128 +</html>
... ...
bower_components/iron-list/test/helpers.html
... ... @@ -72,4 +72,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
72 72 var listRect = list.getBoundingClientRect();
73 73 return document.elementFromPoint(listRect.left + 1, listRect.top + listRect.height - 1);
74 74 }
  75 +
  76 + function isFullOfItems(list) {
  77 + var listRect = list.getBoundingClientRect();
  78 + var listHeight = listRect.height - 1;
  79 + var item, y = listRect.top + 1;
  80 + // IE 10 & 11 doesn't render propertly :(
  81 + var badPixels = 0;
  82 + while (y < listHeight) {
  83 + item = document.elementFromPoint(listRect.left + 1, y);
  84 + if (item.parentNode && !item.parentNode._templateInstance) {
  85 + badPixels++;
  86 + }
  87 + if (badPixels > 3) {
  88 + return false;
  89 + }
  90 + y += 2;
  91 + }
  92 + return true;
  93 + }
75 94 </script>
... ...
bower_components/iron-list/test/hidden-list.html
... ... @@ -51,15 +51,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
51 51 });
52 52 });
53 53  
54   - test('resize', function(done) {
  54 + test('iron-resize', function(done) {
55 55 list.items = buildDataSet(100);
56   - list.fire('resize');
  56 + list.fire('iron-resize');
57 57  
58 58 assert.notEqual(getFirstItemFromList(list).textContent, '0');
59 59 Polymer.RenderStatus.whenReady(function() {
60 60 container.removeAttribute('hidden');
61 61 assert.notEqual(getFirstItemFromList(list).textContent, '0');
62   - list.fire('resize');
  62 + list.fire('iron-resize');
63 63 flush(function() {
64 64 assert.isTrue(list.isAttached);
65 65 assert.equal(getFirstItemFromList(list).textContent, '0');
... ...
bower_components/iron-list/test/index.html
... ... @@ -23,7 +23,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
23 23 'physical-count.html',
24 24 'hidden-list.html',
25 25 'selection.html',
26   - 'dynamic-item-size.html'
  26 + 'dynamic-item-size.html',
  27 + 'different-heights.html'
27 28 ]);
28 29 </script>
29 30 </body>
... ...
bower_components/iron-list/test/physical-count.html
... ... @@ -63,7 +63,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
63 63 // change the height of the list
64 64 container.listHeight = 500;
65 65 // resize
66   - list.fire('resize');
  66 + list.fire('iron-resize');
67 67  
68 68 flush(function() {
69 69 var lastItem = getLastItemFromList(list);
... ...
bower_components/iron-list/test/smoke/avg-worst-case.html 0 โ†’ 100644
  1 +<!--
  2 +@license
  3 +Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
  4 +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
  5 +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
  6 +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
  7 +Code distributed by Google as part of the polymer project is also
  8 +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
  9 +-->
  10 +
  11 +<!doctype html>
  12 +<html>
  13 +<head>
  14 +
  15 + <title>avg worst case</title>
  16 +
  17 + <meta charset="utf-8">
  18 + <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
  19 + <meta name="mobile-web-app-capable" content="yes">
  20 + <meta name="apple-mobile-web-app-capable" content="yes">
  21 +
  22 + <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
  23 +
  24 + <link rel="import" href="../../../polymer/polymer.html">
  25 + <link rel="import" href="../../../paper-styles/paper-styles.html">
  26 + <link rel="import" href="../../iron-list.html">
  27 +
  28 + <style is="custom-style">
  29 +
  30 + iron-list {
  31 + width: 500px;
  32 + height: 400px;
  33 + float: left;
  34 + margin: 10px;
  35 + }
  36 +
  37 + .item {
  38 + background-color: green;
  39 + border-bottom: 1px solid white;
  40 + }
  41 +
  42 + </style>
  43 +
  44 +</head>
  45 +<body class="fullbleed" unresolved>
  46 +
  47 + <template is="dom-bind">
  48 +
  49 + <h1>The physical avarage is not useful in this situations</h1>
  50 + <p>The list is correct if it can render all the items without empty spaces.</p>
  51 + <iron-list id="list" items="[791, 671]" as="item" style="width: 300px; height: 300px;">
  52 + <template>
  53 + <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span>
  54 + </div>
  55 + </template>
  56 + </iron-list>
  57 +
  58 + <iron-list id="list2" items="[791, 671]" as="item" style="width: 710px; height: 453px;">
  59 + <template>
  60 + <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span>
  61 + </div>
  62 + </template>
  63 + </iron-list>
  64 +
  65 + <iron-list items="[512, 256, 128, 64, 16, 16, 16, 16, 16, 16, 8, 4]" as="item" style="height: 256px;">
  66 + <template>
  67 + <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span>
  68 + </div>
  69 + </template>
  70 + </iron-list>
  71 + </template>
  72 +
  73 + <script>
  74 + HTMLImports.whenReady(function() {
  75 + document.querySelector('template[is=dom-bind]')._getStyle = function(item) {
  76 + return 'height:' + item + 'px; ';
  77 + };
  78 +
  79 + setTimeout(function() {
  80 + document.querySelector('#list').push('items', 251, 191, 151, 191, 51, 51, 51);
  81 + }, 100);
  82 +
  83 + setTimeout(function() {
  84 + document.querySelector('#list2').push('items', 251, 191, 151, 191, 51, 51, 51);
  85 + }, 300);
  86 + });
  87 + </script>
  88 +</body>
  89 +</html>
... ...
bower_components/iron-list/test/x-list.html
... ... @@ -39,7 +39,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
39 39 <iron-list style$="[[_computedListHeight(listHeight)]]" items="[[data]]" as="item" id="list">
40 40 <template>
41 41 <div class="item">
42   - <div style$="[[_computedItemHeight()]]">[[item.index]]</div>
  42 + <div style$="[[_computedItemHeight(item)]]">[[item.index]]</div>
43 43 </div>
44 44 </template>
45 45 </iron-list>
... ... @@ -75,10 +75,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
75 75 return this.$.list;
76 76 },
77 77  
78   - _computedItemHeight: function() {
79   - var css = '';
80   - css += this.itemHeight === 0 ? '' : 'height: ' + (this.itemHeight) + 'px;';
81   - css += this.pre ? 'white-space:pre;' : '';
  78 + _computedItemHeight: function(item) {
  79 + var css = this.pre ? 'white-space:pre;' : '';
  80 + if (item.height) {
  81 + css += this.itemHeight === 0 ? '' : 'height: ' + (item.height) + 'px;';
  82 + } else if (this.itemHeight) {
  83 + css += 'height: ' + (this.itemHeight) + 'px;';
  84 + }
82 85 return css;
83 86 },
84 87  
... ...
bower_components/iron-meta/.bower.json 100755 โ†’ 100644
1   -{
2   - "name": "iron-meta",
3   - "version": "1.0.3",
4   - "keywords": [
5   - "web-components",
6   - "polymer"
7   - ],
8   - "license": "http://polymer.github.io/LICENSE.txt",
9   - "description": "Useful for sharing information across a DOM tree",
10   - "private": true,
11   - "authors": [
12   - "The Polymer Authors"
13   - ],
14   - "repository": {
15   - "type": "git",
16   - "url": "git://github.com/PolymerElements/iron-meta.git"
17   - },
18   - "dependencies": {
19   - "polymer": "Polymer/polymer#^1.0.0"
20   - },
21   - "devDependencies": {
22   - "paper-styles": "polymerelements/paper-styles#^1.0.4",
23   - "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
24   - "test-fixture": "polymerelements/test-fixture#^1.0.0",
25   - "web-component-tester": "*",
26   - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
27   - },
28   - "homepage": "https://github.com/PolymerElements/iron-meta",
29   - "_release": "1.0.3",
30   - "_resolution": {
31   - "type": "version",
32   - "tag": "v1.0.3",
33   - "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
34   - },
35   - "_source": "git://github.com/PolymerElements/iron-meta.git",
36   - "_target": "^1.0.0",
37   - "_originalSource": "PolymerElements/iron-meta"
  1 +{
  2 + "name": "iron-meta",
  3 + "version": "1.1.0",
  4 + "keywords": [
  5 + "web-components",
  6 + "polymer"
  7 + ],
  8 + "license": "http://polymer.github.io/LICENSE.txt",
  9 + "description": "Useful for sharing information across a DOM tree",
  10 + "private": true,
  11 + "authors": [
  12 + "The Polymer Authors"
  13 + ],
  14 + "repository": {
  15 + "type": "git",
  16 + "url": "git://github.com/PolymerElements/iron-meta.git"
  17 + },
  18 + "dependencies": {
  19 + "polymer": "Polymer/polymer#^1.0.0"
  20 + },
  21 + "devDependencies": {
  22 + "paper-styles": "polymerelements/paper-styles#^1.0.4",
  23 + "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
  24 + "test-fixture": "polymerelements/test-fixture#^1.0.0",
  25 + "web-component-tester": "*",
  26 + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
  27 + },
  28 + "homepage": "https://github.com/PolymerElements/iron-meta",
  29 + "_release": "1.1.0",
  30 + "_resolution": {
  31 + "type": "version",
  32 + "tag": "v1.1.0",
  33 + "commit": "be7ccf8df650aef1446a4e23af33f5d4e9f3000f"
  34 + },
  35 + "_source": "git://github.com/PolymerElements/iron-meta.git",
  36 + "_target": "^1.0.0",
  37 + "_originalSource": "PolymerElements/iron-meta"
38 38 }
39 39 \ No newline at end of file
... ...
bower_components/iron-meta/.gitignore 100755 โ†’ 100644
1   -bower_components
  1 +bower_components
... ...
bower_components/iron-meta/README.md 100755 โ†’ 100644
1   -iron-meta
2   -=========
3   -
4   -`iron-meta` is a generic element you can use for sharing information across the DOM tree.
5   -It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any
6   -instance of iron-meta has access to the shared
7   -information. You can use `iron-meta` to share whatever you want (or create an extension
8   -[like x-meta] for enhancements).
9   -
10   -The `iron-meta` instances containing your actual data can be loaded in an import,
11   -or constructed in any way you see fit. The only requirement is that you create them
12   -before you try to access them.
13   -
14   -Examples:
15   -
16   -If I create an instance like this:
17   -
18   -```html
19   -<iron-meta key="info" value="foo/bar"></iron-meta>
20   -```
21   -
22   -Note that value="foo/bar" is the metadata I've defined. I could define more
23   -attributes or use child nodes to define additional metadata.
24   -
25   -Now I can access that element (and it's metadata) from any iron-meta instance
26   -via the byKey method, e.g.
27   -
28   -```javascript
29   -meta.byKey('info').getAttribute('value');
30   -```
31   -
32   -Pure imperative form would be like:
33   -
34   -```javascript
35   -document.createElement('iron-meta').byKey('info').getAttribute('value');
36   -```
37   -
38   -Or, in a Polymer element, you can include a meta in your template:
39   -
40   -```html
41   -<iron-meta id="meta"></iron-meta>
42   -```
43   -
44   -```javascript
45   -this.$.meta.byKey('info').getAttribute('value');
46   -```
  1 +iron-meta
  2 +=========
  3 +
  4 +`iron-meta` is a generic element you can use for sharing information across the DOM tree.
  5 +It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any
  6 +instance of iron-meta has access to the shared
  7 +information. You can use `iron-meta` to share whatever you want (or create an extension
  8 +[like x-meta] for enhancements).
  9 +
  10 +The `iron-meta` instances containing your actual data can be loaded in an import,
  11 +or constructed in any way you see fit. The only requirement is that you create them
  12 +before you try to access them.
  13 +
  14 +Examples:
  15 +
  16 +If I create an instance like this:
  17 +
  18 +```html
  19 +<iron-meta key="info" value="foo/bar"></iron-meta>
  20 +```
  21 +
  22 +Note that value="foo/bar" is the metadata I've defined. I could define more
  23 +attributes or use child nodes to define additional metadata.
  24 +
  25 +Now I can access that element (and it's metadata) from any iron-meta instance
  26 +via the byKey method, e.g.
  27 +
  28 +```javascript
  29 +meta.byKey('info').getAttribute('value');
  30 +```
  31 +
  32 +Pure imperative form would be like:
  33 +
  34 +```javascript
  35 +document.createElement('iron-meta').byKey('info').getAttribute('value');
  36 +```
  37 +
  38 +Or, in a Polymer element, you can include a meta in your template:
  39 +
  40 +```html
  41 +<iron-meta id="meta"></iron-meta>
  42 +```
  43 +
  44 +```javascript
  45 +this.$.meta.byKey('info').getAttribute('value');
  46 +```
... ...
bower_components/iron-meta/bower.json 100755 โ†’ 100644
1   -{
2   - "name": "iron-meta",
3   - "version": "1.0.3",
4   - "keywords": [
5   - "web-components",
6   - "polymer"
7   - ],
8   - "license": "http://polymer.github.io/LICENSE.txt",
9   - "description": "Useful for sharing information across a DOM tree",
10   - "private": true,
11   - "authors": [
12   - "The Polymer Authors"
13   - ],
14   - "repository": {
15   - "type": "git",
16   - "url": "git://github.com/PolymerElements/iron-meta.git"
17   - },
18   - "dependencies": {
19   - "polymer": "Polymer/polymer#^1.0.0"
20   - },
21   - "devDependencies": {
22   - "paper-styles": "polymerelements/paper-styles#^1.0.4",
23   - "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
24   - "test-fixture": "polymerelements/test-fixture#^1.0.0",
25   - "web-component-tester": "*",
26   - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
27   - }
28   -}
  1 +{
  2 + "name": "iron-meta",
  3 + "version": "1.1.0",
  4 + "keywords": [
  5 + "web-components",
  6 + "polymer"
  7 + ],
  8 + "license": "http://polymer.github.io/LICENSE.txt",
  9 + "description": "Useful for sharing information across a DOM tree",
  10 + "private": true,
  11 + "authors": [
  12 + "The Polymer Authors"
  13 + ],
  14 + "repository": {
  15 + "type": "git",
  16 + "url": "git://github.com/PolymerElements/iron-meta.git"
  17 + },
  18 + "dependencies": {
  19 + "polymer": "Polymer/polymer#^1.0.0"
  20 + },
  21 + "devDependencies": {
  22 + "paper-styles": "polymerelements/paper-styles#^1.0.4",
  23 + "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
  24 + "test-fixture": "polymerelements/test-fixture#^1.0.0",
  25 + "web-component-tester": "*",
  26 + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
  27 + }
  28 +}
... ...
bower_components/iron-meta/demo/index.html 100755 โ†’ 100644
1   -<!doctype html>
2   -<!--
3   -@license
4   -Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5   -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6   -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7   -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8   -Code distributed by Google as part of the polymer project is also
9   -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10   --->
11   -<html>
12   -<head>
13   -
14   - <meta charset="utf-8">
15   - <meta name="viewport" content="width=device-width, initial-scale=1.0">
16   -
17   - <title>iron-meta</title>
18   -
19   - <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
20   - <link rel="import" href="../../paper-styles/demo-pages.html">
21   - <link rel="import" href="../iron-meta.html">
22   -</head>
23   -<body>
24   -
25   - <div class="vertical-section vertical-section-container centered">
26   - <h1>&lt;iron-meta&gt;</h1>
27   - <iron-meta key="info" value="foo/bar"></iron-meta>
28   - The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>.
29   - </div>
30   -
31   - <script>
32   -
33   - Polymer({
34   -
35   - is: 'meta-test',
36   -
37   - ready: function() {
38   - this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value;
39   - }
40   -
41   - });
42   -
43   - </script>
44   -
45   -</body>
46   -</html>
  1 +<!doctype html>
  2 +<!--
  3 +@license
  4 +Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
  5 +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
  6 +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
  7 +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
  8 +Code distributed by Google as part of the polymer project is also
  9 +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
  10 +-->
  11 +<html>
  12 +<head>
  13 +
  14 + <meta charset="utf-8">
  15 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
  16 +
  17 + <title>iron-meta</title>
  18 +
  19 + <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
  20 + <link rel="import" href="../../paper-styles/demo-pages.html">
  21 + <link rel="import" href="../iron-meta.html">
  22 +</head>
  23 +<body>
  24 +
  25 + <div class="vertical-section vertical-section-container centered">
  26 + <h1>&lt;iron-meta&gt;</h1>
  27 + <iron-meta key="info" value="foo/bar"></iron-meta>
  28 + The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>.
  29 + </div>
  30 +
  31 + <script>
  32 +
  33 + Polymer({
  34 +
  35 + is: 'meta-test',
  36 +
  37 + ready: function() {
  38 + this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value;
  39 + }
  40 +
  41 + });
  42 +
  43 + </script>
  44 +
  45 +</body>
  46 +</html>
... ...
bower_components/iron-meta/index.html 100755 โ†’ 100644
1   -<!doctype html>
2   -<!--
3   -@license
4   -Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5   -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
6   -The complete set of authors may be found at http://polymer.github.io/AUTHORS
7   -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
8   -Code distributed by Google as part of the polymer project is also
9   -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
10   --->
11   -<html>
12   -<head>
13   -
14   - <meta charset="utf-8">
15   - <meta name="viewport" content="width=device-width, initial-scale=1.0">
16   - <title>iron-meta</title>
17   -
18   - <script src="../webcomponentsjs/webcomponents-lite.js"></script>
19   - <link rel="import" href="../iron-component-page/iron-component-page.html">
20   -
21   -</head>
22   -<body>
23   -
24   - <iron-component-page></iron-component-page>
25   -
26   -</body>
27   -</html>
  1 +<!doctype html>
  2 +<!--
  3 +@license
  4 +Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
  5 +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
  6 +The complete set of authors may be found at http://polymer.github.io/AUTHORS
  7 +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
  8 +Code distributed by Google as part of the polymer project is also
  9 +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
  10 +-->
  11 +<html>
  12 +<head>
  13 +
  14 + <meta charset="utf-8">
  15 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
  16 + <title>iron-meta</title>
  17 +
  18 + <script src="../webcomponentsjs/webcomponents-lite.js"></script>
  19 + <link rel="import" href="../iron-component-page/iron-component-page.html">
  20 +
  21 +</head>
  22 +<body>
  23 +
  24 + <iron-component-page></iron-component-page>
  25 +
  26 +</body>
  27 +</html>
... ...
bower_components/iron-meta/iron-meta.html 100755 โ†’ 100644
1   -<!--
2   -@license
3   -Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4   -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5   -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6   -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7   -Code distributed by Google as part of the polymer project is also
8   -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9   --->
10   -
11   -<link rel="import" href="../polymer/polymer.html">
12   -
13   -<!--
14   -`iron-meta` is a generic element you can use for sharing information across the DOM tree.
15   -It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any
16   -instance of iron-meta has access to the shared
17   -information. You can use `iron-meta` to share whatever you want (or create an extension
18   -[like x-meta] for enhancements).
19   -
20   -The `iron-meta` instances containing your actual data can be loaded in an import,
21   -or constructed in any way you see fit. The only requirement is that you create them
22   -before you try to access them.
23   -
24   -Examples:
25   -
26   -If I create an instance like this:
27   -
28   - <iron-meta key="info" value="foo/bar"></iron-meta>
29   -
30   -Note that value="foo/bar" is the metadata I've defined. I could define more
31   -attributes or use child nodes to define additional metadata.
32   -
33   -Now I can access that element (and it's metadata) from any iron-meta instance
34   -via the byKey method, e.g.
35   -
36   - meta.byKey('info').getAttribute('value').
37   -
38   -Pure imperative form would be like:
39   -
40   - document.createElement('iron-meta').byKey('info').getAttribute('value');
41   -
42   -Or, in a Polymer element, you can include a meta in your template:
43   -
44   - <iron-meta id="meta"></iron-meta>
45   - ...
46   - this.$.meta.byKey('info').getAttribute('value');
47   -
48   -@group Iron Elements
49   -@demo demo/index.html
50   -@hero hero.svg
51   -@element iron-meta
52   --->
53   -
54   -<script>
55   -
56   - (function() {
57   -
58   - // monostate data
59   - var metaDatas = {};
60   - var metaArrays = {};
61   -
62   - Polymer.IronMeta = Polymer({
63   -
64   - is: 'iron-meta',
65   -
66   - properties: {
67   -
68   - /**
69   - * The type of meta-data. All meta-data of the same type is stored
70   - * together.
71   - */
72   - type: {
73   - type: String,
74   - value: 'default',
75   - observer: '_typeChanged'
76   - },
77   -
78   - /**
79   - * The key used to store `value` under the `type` namespace.
80   - */
81   - key: {
82   - type: String,
83   - observer: '_keyChanged'
84   - },
85   -
86   - /**
87   - * The meta-data to store or retrieve.
88   - */
89   - value: {
90   - type: Object,
91   - notify: true,
92   - observer: '_valueChanged'
93   - },
94   -
95   - /**
96   - * If true, `value` is set to the iron-meta instance itself.
97   - */
98   - self: {
99   - type: Boolean,
100   - observer: '_selfChanged'
101   - },
102   -
103   - /**
104   - * Array of all meta-data values for the given type.
105   - */
106   - list: {
107   - type: Array,
108   - notify: true
109   - }
110   -
111   - },
112   -
113   - /**
114   - * Only runs if someone invokes the factory/constructor directly
115   - * e.g. `new Polymer.IronMeta()`
116   - */
117   - factoryImpl: function(config) {
118   - if (config) {
119   - for (var n in config) {
120   - switch(n) {
121   - case 'type':
122   - case 'key':
123   - case 'value':
124   - this[n] = config[n];
125   - break;
126   - }
127   - }
128   - }
129   - },
130   -
131   - created: function() {
132   - // TODO(sjmiles): good for debugging?
133   - this._metaDatas = metaDatas;
134   - this._metaArrays = metaArrays;
135   - },
136   -
137   - _keyChanged: function(key, old) {
138   - this._resetRegistration(old);
139   - },
140   -
141   - _valueChanged: function(value) {
142   - this._resetRegistration(this.key);
143   - },
144   -
145   - _selfChanged: function(self) {
146   - if (self) {
147   - this.value = this;
148   - }
149   - },
150   -
151   - _typeChanged: function(type) {
152   - this._unregisterKey(this.key);
153   - if (!metaDatas[type]) {
154   - metaDatas[type] = {};
155   - }
156   - this._metaData = metaDatas[type];
157   - if (!metaArrays[type]) {
158   - metaArrays[type] = [];
159   - }
160