1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update polymer

This commit is contained in:
Luke Pulverenti 2015-09-30 00:10:14 -04:00
parent 22a5e48860
commit 61d616c330
44 changed files with 447 additions and 156 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-a11y-keys-behavior", "name": "iron-a11y-keys-behavior",
"version": "1.0.5", "version": "1.0.6",
"description": "A behavior that enables keybindings for greater a11y.", "description": "A behavior that enables keybindings for greater a11y.",
"keywords": [ "keywords": [
"web-components", "web-components",
@ -30,11 +30,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
"_release": "1.0.5", "_release": "1.0.6",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.6",
"commit": "cf833eab5c55a26c5aa92e56d3fcb079120ce66a" "commit": "af5c98b1cf9b3d180a6326c99ac9c7057eee647f"
}, },
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git", "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-a11y-keys-behavior", "name": "iron-a11y-keys-behavior",
"version": "1.0.5", "version": "1.0.6",
"description": "A behavior that enables keybindings for greater a11y.", "description": "A behavior that enables keybindings for greater a11y.",
"keywords": [ "keywords": [
"web-components", "web-components",

View file

@ -241,7 +241,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* `keys` property is pressed. * `keys` property is pressed.
* *
* @demo demo/index.html * @demo demo/index.html
* @polymerBehavior IronA11yKeysBehavior * @polymerBehavior
*/ */
Polymer.IronA11yKeysBehavior = { Polymer.IronA11yKeysBehavior = {
properties: { properties: {

View file

@ -1,7 +1,7 @@
{ {
"name": "iron-icon", "name": "iron-icon",
"private": true, "private": true,
"version": "1.0.4", "version": "1.0.5",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon", "description": "An element that supports displaying an icon",
"main": "iron-icon.html", "main": "iron-icon.html",
@ -24,6 +24,7 @@
}, },
"devDependencies": { "devDependencies": {
"test-fixture": "polymerelements/test-fixture#^1.0.0", "test-fixture": "polymerelements/test-fixture#^1.0.0",
"promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
"iron-iconset": "polymerelements/iron-iconset#^1.0.0", "iron-iconset": "polymerelements/iron-iconset#^1.0.0",
"iron-icons": "polymerelements/iron-icons#^1.0.0", "iron-icons": "polymerelements/iron-icons#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
@ -31,11 +32,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/polymerelements/iron-icon", "homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.4", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.4", "tag": "v1.0.5",
"commit": "5a5e6cad097561ff9d182ad2b8e20bb822d6f640" "commit": "5217361e21016b3ca52b7bbf5ba2ad56b3301486"
}, },
"_source": "git://github.com/polymerelements/iron-icon.git", "_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "iron-icon", "name": "iron-icon",
"private": true, "private": true,
"version": "1.0.4", "version": "1.0.5",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon", "description": "An element that supports displaying an icon",
"main": "iron-icon.html", "main": "iron-icon.html",
@ -24,6 +24,7 @@
}, },
"devDependencies": { "devDependencies": {
"test-fixture": "polymerelements/test-fixture#^1.0.0", "test-fixture": "polymerelements/test-fixture#^1.0.0",
"promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
"iron-iconset": "polymerelements/iron-iconset#^1.0.0", "iron-iconset": "polymerelements/iron-iconset#^1.0.0",
"iron-icons": "polymerelements/iron-icons#^1.0.0", "iron-icons": "polymerelements/iron-icons#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0",

View file

@ -0,0 +1,62 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>iron-icon demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../iron-icon.html">
<link rel="import" href="../../paper-styles/demo-pages.html" >
<style is="custom-style">
#loading_message {
color: #444;
margin-bottom: 16px;
}
.vertical-section h4 {
border-left: 3px solid var(--paper-grey-300);
padding-left: 10px;
}
.vertical-section h4:hover {
border-left-color: var(--google-blue-700);
}
</style>
</head>
<body>
<div class="vertical-section-container centered">
<h4>
This demo is for an &lt;iron-icon&gt; with an asynchronously loaded
iconset.
</h4>
<div id='loading_message'>Waiting to load iconset...</div>
<div class="vertical-section">
<!-- iron-icon using a iron-iconset as its icon source -->
<iron-iconset name="example" icons="location" src="location.png" size="24" width="24"></iron-iconset>
<h4>&lt;iron-icon icon="example:location"&gt;</h4>
<iron-icon icon="example:location"></iron-icon>
</div>
</div>
<script>
setTimeout(function() {
// Import the code that powers the iron-iconset asynchronously
var linkElem = document.createElement('link');
linkElem.setAttribute('rel', 'import');
linkElem.setAttribute('href', '../../iron-iconset/iron-iconset.html');
document.head.appendChild(linkElem);
document.querySelector('#loading_message').innerText = "Iconset Loaded.";
}, 1000);
</script>
</body>
</html>

View file

@ -30,7 +30,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<body> <body>
<div class="vertical-section-container centered"> <div class="vertical-section-container centered">
<h4>This demo is for a single &lt;iron-icon&gt;. If you're looking for the <h4>This demo is for a single &lt;iron-icon&gt;. If you're looking for the
whole set of available icons, check out the &lt;iron-icons&gt; demo.</h4> whole set of available icons, check out the <a href="/elements/iron-icons?view=demo:demo/index.html">&lt;iron-icons&gt; demo.</a></h5>
<div class="vertical-section"> <div class="vertical-section">
<!-- iron-icon using a iron-iconset as its icon source --> <!-- iron-icon using a iron-iconset as its icon source -->

View file

@ -130,6 +130,9 @@ Custom property | Description | Default
observer: '_srcChanged' observer: '_srcChanged'
}, },
/**
* @type {!Polymer.IronMeta}
*/
_meta: { _meta: {
value: Polymer.Base.create('iron-meta', {type: 'iconset'}) value: Polymer.Base.create('iron-meta', {type: 'iconset'})
} }
@ -157,12 +160,13 @@ Custom property | Description | Default
_updateIcon: function() { _updateIcon: function() {
if (this._usesIconset()) { if (this._usesIconset()) {
if (this._iconsetName) { if (this._iconsetName) {
this._iconset = this._meta.byKey(this._iconsetName); this._iconset = /** @type {?Polymer.Iconset} */ (
this._meta.byKey(this._iconsetName));
if (this._iconset) { if (this._iconset) {
this._iconset.applyIcon(this, this._iconName, this.theme); this._iconset.applyIcon(this, this._iconName, this.theme);
this.unlisten(window, 'iron-iconset-added', '_updateIcon');
} else { } else {
this._warn(this._logf('_updateIcon', 'could not find iconset `' this.listen(window, 'iron-iconset-added', '_updateIcon');
+ this._iconsetName + '`, did you import the iconset?'));
} }
} }
} else { } else {

View file

@ -22,6 +22,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-icon.html"> <link rel="import" href="../iron-icon.html">
<link rel="import" href="../../iron-iconset/iron-iconset.html"> <link rel="import" href="../../iron-iconset/iron-iconset.html">
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
<link rel="import" href="../../test-fixture/test-fixture.html"> <link rel="import" href="../../test-fixture/test-fixture.html">
</head> </head>
@ -48,6 +49,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template> </template>
</test-fixture> </test-fixture>
<test-fixture id="UsingAsyncIconset">
<template>
<iron-icon icon="async:location"></iron-icon>
</template>
</test-fixture>
<test-fixture id="AsyncIconset">
<template>
<iron-iconset name="async" icons="location blank" src="location.png" size="24" width="48"></iron-iconset>
</template>
</test-fixture>
<script> <script>
function iconElementFor (node) { function iconElementFor (node) {
var nodes = Polymer.dom(node.root).childNodes; var nodes = Polymer.dom(node.root).childNodes;
@ -113,6 +126,23 @@ suite('<iron-icon>', function() {
fixture('WithoutAnIconSource'); fixture('WithoutAnIconSource');
}); });
}) })
suite('when loading async', function() {
test('will get icon after iconset is added', function() {
var icon = fixture('UsingAsyncIconset');
expect(hasIcon(icon)).to.be.false;
return new Promise(function(resolve, reject) {
window.addEventListener('iron-iconset-added', function() {
if (hasIcon(icon)) {
resolve();
} else {
reject(new Error('icon didn\'t load after iconset loaded'));
}
});
fixture('AsyncIconset');
});
});
});
}); });
</script> </script>

View file

@ -1,7 +1,7 @@
{ {
"name": "iron-iconset-svg", "name": "iron-iconset-svg",
"description": "Manages a set of svg icons", "description": "Manages a set of svg icons",
"version": "1.0.4", "version": "1.0.5",
"keywords": [ "keywords": [
"web-components", "web-components",
"polymer", "polymer",
@ -24,16 +24,17 @@
"paper-styles": "polymerelements/paper-styles#^1.0.2", "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0", "iron-icon": "polymerelements/iron-icon#^1.0.0",
"promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0", "test-fixture": "polymerelements/test-fixture#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*" "web-component-tester": "*"
}, },
"homepage": "https://github.com/polymerelements/iron-iconset-svg", "homepage": "https://github.com/polymerelements/iron-iconset-svg",
"_release": "1.0.4", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.4", "tag": "v1.0.5",
"commit": "795aa82ac22971421bc4375efbd2419ebba9099f" "commit": "54d35698c1e06462452997f8731ea31a4bf1638c"
}, },
"_source": "git://github.com/polymerelements/iron-iconset-svg.git", "_source": "git://github.com/polymerelements/iron-iconset-svg.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "iron-iconset-svg", "name": "iron-iconset-svg",
"description": "Manages a set of svg icons", "description": "Manages a set of svg icons",
"version": "1.0.4", "version": "1.0.5",
"keywords": [ "keywords": [
"web-components", "web-components",
"polymer", "polymer",
@ -24,6 +24,7 @@
"paper-styles": "polymerelements/paper-styles#^1.0.2", "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0", "iron-icon": "polymerelements/iron-icon#^1.0.0",
"promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0", "test-fixture": "polymerelements/test-fixture#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*" "web-component-tester": "*"

View file

@ -136,6 +136,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*/ */
_nameChanged: function() { _nameChanged: function() {
new Polymer.IronMeta({type: 'iconset', key: this.name, value: this}); new Polymer.IronMeta({type: 'iconset', key: this.name, value: this});
this.async(function() {
this.fire('iron-iconset-added', this, {node: window});
});
}, },
/** /**

View file

@ -22,6 +22,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-iconset-svg.html"> <link rel="import" href="../iron-iconset-svg.html">
<link rel="import" href="../../iron-meta/iron-meta.html"> <link rel="import" href="../../iron-meta/iron-meta.html">
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
<link rel="import" href="../../test-fixture/test-fixture.html"> <link rel="import" href="../../test-fixture/test-fixture.html">
</head> </head>
@ -55,8 +56,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('basic behavior', function () { suite('basic behavior', function () {
var iconset; var iconset;
var meta; var meta;
var loadedPromise;
setup(function () { setup(function () {
loadedPromise = new Promise(function(resolve) {
window.addEventListener('iron-iconset-added', function(ev) {
if (ev && ev.detail === iconset) {
resolve();
}
});
});
var elements = fixture('TrivialIconsetSvg'); var elements = fixture('TrivialIconsetSvg');
iconset = elements[0]; iconset = elements[0];
meta = elements[1]; meta = elements[1];
@ -65,6 +74,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('it can be accessed via iron-meta', function () { test('it can be accessed via iron-meta', function () {
expect(meta.byKey('foo')).to.be.equal(iconset); expect(meta.byKey('foo')).to.be.equal(iconset);
}); });
test('it fires an iron-iconset-added event on the window', function() {
return loadedPromise;
});
}); });
suite('when paired with a size and SVG definition', function () { suite('when paired with a size and SVG definition', function () {

View file

@ -25,14 +25,14 @@
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/polymerelements/iron-meta", "homepage": "https://github.com/PolymerElements/iron-meta",
"_release": "1.0.3", "_release": "1.0.3",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.3", "tag": "v1.0.3",
"commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04" "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
}, },
"_source": "git://github.com/polymerelements/iron-meta.git", "_source": "git://github.com/PolymerElements/iron-meta.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/iron-meta" "_originalSource": "PolymerElements/iron-meta"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-range-behavior", "name": "iron-range-behavior",
"version": "1.0.2", "version": "1.0.3",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for something with a minimum and maximum value", "description": "Provides a behavior for something with a minimum and maximum value",
"authors": "The Polymer Authors", "authors": "The Polymer Authors",
@ -28,11 +28,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/PolymerElements/iron-range-behavior", "homepage": "https://github.com/PolymerElements/iron-range-behavior",
"_release": "1.0.2", "_release": "1.0.3",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.2", "tag": "v1.0.3",
"commit": "a743ac0b204a8e76466c2dba349ab2180c9f15f5" "commit": "3ed9a372778e31e62477666b313155c581a7dfe6"
}, },
"_source": "git://github.com/PolymerElements/iron-range-behavior.git", "_source": "git://github.com/PolymerElements/iron-range-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-range-behavior", "name": "iron-range-behavior",
"version": "1.0.2", "version": "1.0.3",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for something with a minimum and maximum value", "description": "Provides a behavior for something with a minimum and maximum value",
"authors": "The Polymer Authors", "authors": "The Polymer Authors",

View file

@ -91,7 +91,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* *
* as a work around we can divide by the reciprocal of `step` * as a work around we can divide by the reciprocal of `step`
*/ */
return this.step ? (Math.round(value / this.step) / (1 / this.step)) : value; // polymer/issues/2493
value = parseFloat(value);
return this.step ? (Math.round((value + this.min) / this.step) / (1 / this.step)) - this.min : value;
}, },
_validateValue: function() { _validateValue: function() {

View file

@ -45,11 +45,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('set value', function(done) { test('set value', function(done) {
range.value = 50; range.value = 50;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.value, 50); assert.equal(range.value, 50);
// test clamp value // test clamp value
range.value = 60.1; range.value = 60.1;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.value, 60); assert.equal(range.value, 60);
done(); done();
}); });
@ -59,7 +59,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('set max', function(done) { test('set max', function(done) {
range.max = 10; range.max = 10;
range.value = 11; range.value = 11;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.value, range.max); assert.equal(range.value, range.max);
done(); done();
}); });
@ -68,7 +68,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('test ratio', function(done) { test('test ratio', function(done) {
range.max = 10; range.max = 10;
range.value = 5; range.value = 5;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.ratio, 50); assert.equal(range.ratio, 50);
done(); done();
}); });
@ -78,10 +78,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
range.min = 10 range.min = 10
range.max = 50; range.max = 50;
range.value = 30; range.value = 30;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.ratio, 50); assert.equal(range.ratio, 50);
range.value = 0; range.value = 0;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.value, range.min); assert.equal(range.value, range.min);
done(); done();
}); });
@ -92,17 +92,34 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
range.min = 0; range.min = 0;
range.max = 10; range.max = 10;
range.value = 5.1; range.value = 5.1;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.value, 5); assert.equal(range.value, 5);
range.step = 0.1; range.step = 0.1;
range.value = 5.1; range.value = 5.1;
asyncPlatformFlush(function() { flush(function() {
assert.equal(range.value, 5.1); assert.equal(range.value, 5.1);
done(); done();
}); });
}); });
}); });
test('odd values', function() {
range.min = 1;
range.max = 7;
range.step = 2;
range.value = 3;
flush(function() {
assert.equal(range.value, 3);
range.value += range.step;
assert.equal(range.value, 5);
range.value += range.step;
assert.equal(range.value, 7);
});
});
}); });
</script> </script>

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-selector", "name": "iron-selector",
"version": "1.0.4", "version": "1.0.5",
"description": "Manages a set of elements that can be selected", "description": "Manages a set of elements that can be selected",
"private": true, "private": true,
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
@ -25,17 +25,18 @@
"polymer": "Polymer/polymer#^1.0.0" "polymer": "Polymer/polymer#^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"_release": "1.0.4", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.4", "tag": "v1.0.5",
"commit": "2af8ee5b7cd489bca7d4689c563b82fd356a9534" "commit": "396ef93a5d3467810cec0328c53f09037d6ee8e1"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-selector", "name": "iron-selector",
"version": "1.0.4", "version": "1.0.5",
"description": "Manages a set of elements that can be selected", "description": "Manages a set of elements that can be selected",
"private": true, "private": true,
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
@ -25,8 +25,9 @@
"polymer": "Polymer/polymer#^1.0.0" "polymer": "Polymer/polymer#^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"

View file

@ -103,9 +103,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var i = this.selectedValues.indexOf(value); var i = this.selectedValues.indexOf(value);
var unselected = i < 0; var unselected = i < 0;
if (unselected) { if (unselected) {
this.selectedValues.push(value); this.push('selectedValues',value);
} else { } else {
this.selectedValues.splice(i, 1); this.splice('selectedValues',i,1);
} }
this._selection.setItemSelected(this._valueToItem(value), unselected); this._selection.setItemSelected(this._valueToItem(value), unselected);
} }

View file

@ -108,6 +108,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* The set of excluded elements where the key is the `localName` * The set of excluded elements where the key is the `localName`
* of the element that will be ignored from the item list. * of the element that will be ignored from the item list.
* *
* @type {object}
* @default {template: 1} * @default {template: 1}
*/ */
excludedLocalNames: { excludedLocalNames: {
@ -132,6 +133,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
attached: function() { attached: function() {
this._observer = this._observeItems(this); this._observer = this._observeItems(this);
this._contentObserver = this._observeContent(this); this._contentObserver = this._observeContent(this);
if (!this.selectedItem && this.selected) {
this._updateSelected(this.attrForSelected,this.selected)
}
}, },
detached: function() { detached: function() {

View file

@ -32,7 +32,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* the selected item or undefined if there is no selection. * the selected item or undefined if there is no selection.
*/ */
get: function() { get: function() {
return this.multi ? this.selection : this.selection[0]; return this.multi ? this.selection.slice() : this.selection[0];
}, },
/** /**

View file

@ -165,6 +165,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, 1); }, 1);
}); });
}); });
suite('dynamic selector', function() {
test('selects dynamically added child automatically', function(done) {
var selector = document.createElement('iron-selector');
var child = document.createElement('div');
selector.selected = '0';
child.textContent = 'Item 0';
Polymer.dom(selector).appendChild(child);
document.body.appendChild(selector);
Polymer.Base.async(function() {
assert.equal(child.className, 'iron-selected');
document.body.removeChild(selector);
done();
}, 1);
});
});
}); });
</script> </script>

View file

@ -20,6 +20,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script src="../../test-fixture/test-fixture-mocha.js"></script> <script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html"> <link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="../iron-selector.html"> <link rel="import" href="../iron-selector.html">
<style> <style>
@ -43,6 +44,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template> </template>
</test-fixture> </test-fixture>
<!--
NOTE(cdata): Enable test-fixture when polymer/polymer#2495 is resolved
-->
<!--<test-fixture id="repeatedItems">
<template>-->
<iron-selector multi id="repeatedItems">
<template is="dom-repeat" items='["foo", "bar", "baz"]'>
<div>[[item]]</div>
</template>
<div>vim</div>
</iron-selector>
<!--</template>
</test-fixture>-->
<script> <script>
suite('multi', function() { suite('multi', function() {
@ -115,6 +130,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(deselectEventCounter, 1); assert.equal(deselectEventCounter, 1);
}); });
test('fires selected-values-changed when selection changes', function() {
var selectedValuesChangedEventCounter = 0;
s.addEventListener('selected-values-changed', function(e) {
selectedValuesChangedEventCounter++;
});
MockInteractions.tap(Polymer.dom(s).children[0]);
MockInteractions.tap(Polymer.dom(s).children[0]);
MockInteractions.tap(Polymer.dom(s).children[0]);
expect(selectedValuesChangedEventCounter);
});
test('selects from items created by dom-repeat', function(done) {
var selectEventCounter = 0;
var firstChild;
s = document.querySelector('#repeatedItems');
s.addEventListener('iron-select', function(e) {
selectEventCounter++;
});
// NOTE(cdata): I guess `dom-repeat` doesn't stamp synchronously..
Polymer.Base.async(function() {
firstChild = Polymer.dom(s).querySelector('div');
MockInteractions.tap(firstChild);
assert.equal(s.selectedItems[0].textContent, 'foo');
done();
});
});
/* test('toggle multi from true to false', function() { /* test('toggle multi from true to false', function() {
// set selected // set selected
s.selected = [0, 2]; s.selected = [0, 2];

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-dialog-behavior", "name": "paper-dialog-behavior",
"version": "1.0.5", "version": "1.0.6",
"description": "Implements a behavior used for material design dialogs", "description": "Implements a behavior used for material design dialogs",
"authors": "The Polymer Authors", "authors": "The Polymer Authors",
"keywords": [ "keywords": [
@ -34,11 +34,11 @@
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"_release": "1.0.5", "_release": "1.0.6",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.6",
"commit": "5066ec108225d07d8d7ec4efc00ccfc929239ef3" "commit": "9714b11aa532e1a59dadc2096616ed2ea3b82157"
}, },
"_source": "git://github.com/PolymerElements/paper-dialog-behavior.git", "_source": "git://github.com/PolymerElements/paper-dialog-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-dialog-behavior", "name": "paper-dialog-behavior",
"version": "1.0.5", "version": "1.0.6",
"description": "Implements a behavior used for material design dialogs", "description": "Implements a behavior used for material design dialogs",
"authors": "The Polymer Authors", "authors": "The Polymer Authors",
"keywords": [ "keywords": [

View file

@ -11,11 +11,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
:host { :host {
display: block; display: block;
margin: 24px 40px; margin: 24px 40px;
-webkit-overflow-scrolling: touch;
background: var(--paper-dialog-background-color, --primary-background-color); background: var(--paper-dialog-background-color, --primary-background-color);
color: var(--paper-dialog-color, --primary-text-color); color: var(--paper-dialog-color, --primary-text-color);
@apply(--layout-scroll);
@apply(--paper-font-body1); @apply(--paper-font-body1);
@apply(--shadow-elevation-16dp); @apply(--shadow-elevation-16dp);
@apply(--paper-dialog); @apply(--paper-dialog);

View file

@ -1,7 +1,7 @@
{ {
"name": "paper-dialog", "name": "paper-dialog",
"description": "A Material Design dialog", "description": "A Material Design dialog",
"version": "1.0.1", "version": "1.0.2",
"authors": "The Polymer Authors", "authors": "The Polymer Authors",
"keywords": [ "keywords": [
"web-components", "web-components",
@ -27,16 +27,19 @@
"devDependencies": { "devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"paper-button": "PolymerElements/paper-button#^1.0.0", "paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^1.0.0",
"paper-menu": "PolymerElements/paper-menu#^1.0.0",
"paper-item": "PolymerElements/paper-item#^1.0.0",
"paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0", "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"_release": "1.0.1", "_release": "1.0.2",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.1", "tag": "v1.0.2",
"commit": "1339718c67ef50add5221dd63d35e03a54fb619f" "commit": "f24bdc41e7374793c5bd966aa8cadc012e15cb09"
}, },
"_source": "git://github.com/PolymerElements/paper-dialog.git", "_source": "git://github.com/PolymerElements/paper-dialog.git",
"_target": "~1.0.0", "_target": "~1.0.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "paper-dialog", "name": "paper-dialog",
"description": "A Material Design dialog", "description": "A Material Design dialog",
"version": "1.0.1", "version": "1.0.2",
"authors": "The Polymer Authors", "authors": "The Polymer Authors",
"keywords": [ "keywords": [
"web-components", "web-components",
@ -27,6 +27,9 @@
"devDependencies": { "devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"paper-button": "PolymerElements/paper-button#^1.0.0", "paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^1.0.0",
"paper-menu": "PolymerElements/paper-menu#^1.0.0",
"paper-item": "PolymerElements/paper-item#^1.0.0",
"paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0", "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*", "web-component-tester": "*",

View file

@ -25,6 +25,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../../paper-styles/paper-styles.html"> <link rel="import" href="../../paper-styles/paper-styles.html">
<link rel="import" href="../../paper-styles/demo-pages.html"> <link rel="import" href="../../paper-styles/demo-pages.html">
<link rel="import" href="../../neon-animation/neon-animations.html"> <link rel="import" href="../../neon-animation/neon-animations.html">
<link rel="import" href="../../paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../../paper-menu/paper-menu.html">
<link rel="import" href="../../paper-item/paper-item.html">
<link rel="stylesheet" href="../../paper-styles/demo.css"> <link rel="stylesheet" href="../../paper-styles/demo.css">
@ -50,11 +53,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
position: fixed; position: fixed;
top: 16px; top: 16px;
right: 16px; right: 16px;
}
paper-dialog.size-position {
width: 300px; width: 300px;
height: 300px; height: 300px;
overflow: auto;
} }
</style> </style>
@ -68,6 +69,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<paper-button data-dialog="scrolling">scrolling dialog</paper-button> <paper-button data-dialog="scrolling">scrolling dialog</paper-button>
<paper-button data-dialog="actions">dialog with actions</paper-button> <paper-button data-dialog="actions">dialog with actions</paper-button>
<paper-button data-dialog="modal">modal dialog</paper-button> <paper-button data-dialog="modal">modal dialog</paper-button>
<paper-button data-dialog="dropdown">dialog with dropdown</paper-button>
<paper-button data-dialog="nested">dialog with nested dialog</paper-button>
<paper-dialog id="dialog"> <paper-dialog id="dialog">
<h2>Dialog Title</h2> <h2>Dialog Title</h2>
@ -109,6 +112,37 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</div> </div>
</paper-dialog> </paper-dialog>
<paper-dialog id="dropdown">
<h2>Dialog Title</h2>
<paper-dropdown-menu label="Value">
<paper-menu class="dropdown-content">
<paper-item>1</paper-item>
<paper-item>2</paper-item>
<paper-item>3</paper-item>
<paper-item>4</paper-item>
<paper-item>5</paper-item>
<paper-item>6</paper-item>
<paper-item>7</paper-item>
<paper-item>8</paper-item>
<paper-item>9</paper-item>
<paper-item>10</paper-item>
</paper-menu>
</paper-dropdown-menu>
</paper-dialog>
<paper-dialog id="nested">
<h2>Dialog Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<div class="buttons">
<paper-button data-dialog="innerDialog">Open nested dialog</paper-button>
</div>
</paper-dialog>
<paper-dialog id="innerDialog">
<h2>Dialog Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</paper-dialog>
</section> </section>
<section onclick="clickHandler(event)"> <section onclick="clickHandler(event)">
@ -116,11 +150,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<paper-button data-dialog="colors">colors</paper-button> <paper-button data-dialog="colors">colors</paper-button>
<paper-button data-dialog="position">size &amp; position</paper-button> <paper-button data-dialog="position">size &amp; position</paper-button>
<paper-dialog id="colors" heading="Custom Colors" class="colored"> <paper-dialog id="colors" class="colored">
<h2>Custom Colors</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</paper-dialog> </paper-dialog>
<paper-dialog id="position" heading="Custom Size &amp; Position" class="size-position"> <paper-dialog id="position" class="size-position">
<h2>Custom Size &amp; Position</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</paper-dialog> </paper-dialog>
</section> </section>

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-input", "name": "paper-input",
"version": "1.0.14", "version": "1.0.15",
"description": "Material design text fields", "description": "Material design text fields",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -44,11 +44,11 @@
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0", "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0" "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
}, },
"_release": "1.0.14", "_release": "1.0.15",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.14", "tag": "v1.0.15",
"commit": "120a0610aca5c86194977e30f696b09716f93bbc" "commit": "34d19454e0ea13b1a809add8c87fba128fbc9940"
}, },
"_source": "git://github.com/polymerelements/paper-input.git", "_source": "git://github.com/polymerelements/paper-input.git",
"_target": "^1.0.9", "_target": "^1.0.9",

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-input", "name": "paper-input",
"version": "1.0.14", "version": "1.0.15",
"description": "Material design text fields", "description": "Material design text fields",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"

View file

@ -59,6 +59,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<div class="vertical-section"> <div class="vertical-section">
<paper-input label="label"></paper-input> <paper-input label="label"></paper-input>
<paper-input label="search" type="search" placeholder="type='search' should use placeholders instead of labels" autosave="test" results="5"></paper-input>
<paper-input label="password" type="password"></paper-input> <paper-input label="password" type="password"></paper-input>
<paper-input no-label-float label="label (no-label-float)"></paper-input> <paper-input no-label-float label="label (no-label-float)"></paper-input>

View file

@ -279,6 +279,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
value: 'off' value: 'off'
}, },
/**
* Bind this to the `<input is="iron-input">`'s `autosave` property, used with type=search.
*/
autosave: {
type: String
},
/**
* Bind this to the `<input is="iron-input">`'s `results` property, , used with type=search.
*/
results: {
type: Number
},
_ariaDescribedBy: { _ariaDescribedBy: {
type: String, type: String,
value: '' value: ''

View file

@ -192,8 +192,8 @@ This element is `display:block` by default, but you can set the `inline` attribu
.input-content.label-is-floating ::content label, .input-content.label-is-floating ::content label,
.input-content.label-is-floating ::content .paper-input-label { .input-content.label-is-floating ::content .paper-input-label {
-webkit-transform: translate3d(0, -75%, 0) scale(0.75); -webkit-transform: translateY(-75%) scale(0.75);
transform: translate3d(0, -75%, 0) scale(0.75); transform: translateY(-75%) scale(0.75);
-webkit-transform-origin: left top; -webkit-transform-origin: left top;
transform-origin: left top; transform-origin: left top;
-webkit-transition: -webkit-transform 0.25s; -webkit-transition: -webkit-transform 0.25s;
@ -231,6 +231,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
background: transparent; background: transparent;
border: none; border: none;
color: var(--paper-input-container-input-color, --primary-text-color); color: var(--paper-input-container-input-color, --primary-text-color);
-webkit-appearance: none;
@apply(--paper-font-subhead); @apply(--paper-font-subhead);
@apply(--paper-input-container-input); @apply(--paper-input-container-input);
@ -328,7 +329,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
/** /**
* True if the input is invalid. This property is set automatically when the input value * True if the input is invalid. This property is set automatically when the input value
* changes if auto-validating, or when the `iron-input-valid` event is heard from a child. * changes if auto-validating, or when the `iron-input-validate` event is heard from a child.
*/ */
invalid: { invalid: {
observer: '_invalidChanged', observer: '_invalidChanged',
@ -531,8 +532,8 @@ This element is `display:block` by default, but you can set the `inline` attribu
} }
// The label might have a horizontal offset if a prefix element exists // The label might have a horizontal offset if a prefix element exists
// which needs to be undone when displayed as a floating label. // which needs to be undone when displayed as a floating label.
if (this.$.prefix && label && label.offsetParent && if (Polymer.dom(this.$.prefix).getDistributedNodes().length > 0 &&
Polymer.dom(this.$.prefix).getDistributedNodes().length > 0) { label && label.offsetParent) {
label.style.left = -label.offsetParent.offsetLeft + 'px'; label.style.left = -label.offsetParent.offsetLeft + 'px';
} }
} else { } else {

View file

@ -37,12 +37,12 @@ Custom property | Description | Default
:host { :host {
display: inline-block; display: inline-block;
visibility: hidden; visibility: hidden;
float: left;
color: var(--paper-input-container-invalid-color, --google-red-500); color: var(--paper-input-container-invalid-color, --google-red-500);
@apply(--paper-font-caption); @apply(--paper-font-caption);
@apply(--paper-input-error); @apply(--paper-input-error);
position: absolute;
} }
:host([invalid]) { :host([invalid]) {

View file

@ -35,6 +35,14 @@ for `suffix`).
<paper-icon-button suffix icon="clear"></paper-icon-button> <paper-icon-button suffix icon="clear"></paper-icon-button>
</paper-input> </paper-input>
A `paper-input` can use the native `type=search` features. However, since
we can't control the native styling of the input, it's recommended to use
a placeholder text, or `always-float-label`, as to not overlap the native search icon.
<paper-input label="search!" type="search"
placeholder="search for cats" autosave="test" results="5">
</paper-input>
See `Polymer.PaperInputBehavior` for more API docs. See `Polymer.PaperInputBehavior` for more API docs.
### Styling ### Styling
@ -106,7 +114,9 @@ style this element.
size$="[[size]]" size$="[[size]]"
autocapitalize$="[[autocapitalize]]" autocapitalize$="[[autocapitalize]]"
autocorrect$="[[autocorrect]]" autocorrect$="[[autocorrect]]"
on-change="_onChange"> on-change="_onChange"
autosave$="[[autosave]]",
results$="[[results]]">
<content select="[suffix]"></content> <content select="[suffix]"></content>

View file

@ -30,14 +30,14 @@
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/PolymerElements/paper-ripple", "homepage": "https://github.com/polymerelements/paper-ripple",
"_release": "1.0.2", "_release": "1.0.2",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.2", "tag": "v1.0.2",
"commit": "b546dbe6ad0b1f58cac80caec3136cf3232e12fc" "commit": "b546dbe6ad0b1f58cac80caec3136cf3232e12fc"
}, },
"_source": "git://github.com/PolymerElements/paper-ripple.git", "_source": "git://github.com/polymerelements/paper-ripple.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-ripple" "_originalSource": "polymerelements/paper-ripple"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-toggle-button", "name": "paper-toggle-button",
"version": "1.0.8", "version": "1.0.9",
"description": "A material design toggle button control", "description": "A material design toggle button control",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -34,11 +34,11 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0" "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
}, },
"_release": "1.0.8", "_release": "1.0.9",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.8", "tag": "v1.0.9",
"commit": "b1630a0597b9d55d09396c8636daf443890a46df" "commit": "95a18ee82adfb9e10594f99251e991f91b489ac1"
}, },
"_source": "git://github.com/PolymerElements/paper-toggle-button.git", "_source": "git://github.com/PolymerElements/paper-toggle-button.git",
"_target": "~1.0.5", "_target": "~1.0.5",

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-toggle-button", "name": "paper-toggle-button",
"version": "1.0.8", "version": "1.0.9",
"description": "A material design toggle button control", "description": "A material design toggle button control",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"

View file

@ -62,42 +62,6 @@ Custom property | Description | Default
outline:none; outline:none;
} }
:host .toggle-bar {
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
@apply(--paper-toggle-button-unchecked-bar);
}
:host .toggle-button {
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
@apply(--paper-toggle-button-unchecked-button);
}
:host([checked]) .toggle-bar {
background-color: var(--paper-toggle-button-checked-bar-color, --default-primary-color);
@apply(--paper-toggle-button-checked-bar);
}
:host([checked]) .toggle-button {
background-color: var(--paper-toggle-button-checked-button-color, --default-primary-color);
@apply(--paper-toggle-button-checked-button);
}
:host .toggle-ink {
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
}
:host([checked]) .toggle-ink {
color: var(--paper-toggle-button-checked-ink-color, --default-primary-color);
}
/* ID selectors should not be overriden by users. */
#toggleContainer {
position: relative;
width: 36px;
height: 14px;
}
.toggle-bar { .toggle-bar {
position: absolute; position: absolute;
height: 100%; height: 100%;
@ -106,15 +70,8 @@ Custom property | Description | Default
pointer-events: none; pointer-events: none;
opacity: 0.4; opacity: 0.4;
transition: background-color linear .08s; transition: background-color linear .08s;
} background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
@apply(--paper-toggle-button-unchecked-bar);
:host([checked]) .toggle-bar {
opacity: 0.5;
}
:host([disabled]) .toggle-bar {
background-color: #000;
opacity: 0.12;
} }
.toggle-button { .toggle-button {
@ -127,6 +84,8 @@ Custom property | Description | Default
transition: -webkit-transform linear .08s, background-color linear .08s; transition: -webkit-transform linear .08s, background-color linear .08s;
transition: transform linear .08s, background-color linear .08s; transition: transform linear .08s, background-color linear .08s;
will-change: transform; will-change: transform;
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
@apply(--paper-toggle-button-unchecked-button);
} }
.toggle-button.dragging { .toggle-button.dragging {
@ -134,11 +93,27 @@ Custom property | Description | Default
transition: none; transition: none;
} }
:host([checked]):not([disabled]) .toggle-bar {
opacity: 0.5;
background-color: var(--paper-toggle-button-checked-bar-color, --default-primary-color);
@apply(--paper-toggle-button-checked-bar);
}
:host([disabled]) .toggle-bar {
background-color: #000;
opacity: 0.12;
}
:host([checked]) .toggle-button { :host([checked]) .toggle-button {
-webkit-transform: translate(16px, 0); -webkit-transform: translate(16px, 0);
transform: translate(16px, 0); transform: translate(16px, 0);
} }
:host([checked]):not([disabled]) .toggle-button {
background-color: var(--paper-toggle-button-checked-button-color, --default-primary-color);
@apply(--paper-toggle-button-checked-button);
}
:host([disabled]) .toggle-button { :host([disabled]) .toggle-button {
background-color: #bdbdbd; background-color: #bdbdbd;
opacity: 1; opacity: 1;
@ -152,10 +127,21 @@ Custom property | Description | Default
height: 48px; height: 48px;
opacity: 0.5; opacity: 0.5;
pointer-events: none; pointer-events: none;
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
}
:host([checked]) .toggle-ink {
color: var(--paper-toggle-button-checked-ink-color, --default-primary-color);
}
.toggle-container {
position: relative;
width: 36px;
height: 14px;
} }
</style> </style>
<div id="toggleContainer"> <div class="toggle-container">
<div id="toggleBar" class="toggle-bar"></div> <div id="toggleBar" class="toggle-bar"></div>
<div id="toggleButton" class="toggle-button"> <div id="toggleButton" class="toggle-button">
<paper-ripple id="ink" class="toggle-ink circle" recenters></paper-ripple> <paper-ripple id="ink" class="toggle-ink circle" recenters></paper-ripple>

View file

@ -6645,7 +6645,7 @@ this.fire('dom-change');
* `keys` property is pressed. * `keys` property is pressed.
* *
* @demo demo/index.html * @demo demo/index.html
* @polymerBehavior IronA11yKeysBehavior * @polymerBehavior
*/ */
Polymer.IronA11yKeysBehavior = { Polymer.IronA11yKeysBehavior = {
properties: { properties: {
@ -10710,7 +10710,7 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
* the selected item or undefined if there is no selection. * the selected item or undefined if there is no selection.
*/ */
get: function() { get: function() {
return this.multi ? this.selection : this.selection[0]; return this.multi ? this.selection.slice() : this.selection[0];
}, },
/** /**
@ -10889,6 +10889,7 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
* The set of excluded elements where the key is the `localName` * The set of excluded elements where the key is the `localName`
* of the element that will be ignored from the item list. * of the element that will be ignored from the item list.
* *
* @type {object}
* @default {template: 1} * @default {template: 1}
*/ */
excludedLocalNames: { excludedLocalNames: {
@ -10913,6 +10914,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
attached: function() { attached: function() {
this._observer = this._observeItems(this); this._observer = this._observeItems(this);
this._contentObserver = this._observeContent(this); this._contentObserver = this._observeContent(this);
if (!this.selectedItem && this.selected) {
this._updateSelected(this.attrForSelected,this.selected)
}
}, },
detached: function() { detached: function() {
@ -11283,9 +11287,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
var i = this.selectedValues.indexOf(value); var i = this.selectedValues.indexOf(value);
var unselected = i < 0; var unselected = i < 0;
if (unselected) { if (unselected) {
this.selectedValues.push(value); this.push('selectedValues',value);
} else { } else {
this.selectedValues.splice(i, 1); this.splice('selectedValues',i,1);
} }
this._selection.setItemSelected(this._valueToItem(value), unselected); this._selection.setItemSelected(this._valueToItem(value), unselected);
} }
@ -11833,6 +11837,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
*/ */
_nameChanged: function() { _nameChanged: function() {
new Polymer.IronMeta({type: 'iconset', key: this.name, value: this}); new Polymer.IronMeta({type: 'iconset', key: this.name, value: this});
this.async(function() {
this.fire('iron-iconset-added', this, {node: window});
});
}, },
/** /**
@ -12160,7 +12167,9 @@ styles. All other styles should exist as single lines."
* *
* as a work around we can divide by the reciprocal of `step` * as a work around we can divide by the reciprocal of `step`
*/ */
return this.step ? (Math.round(value / this.step) / (1 / this.step)) : value; // polymer/issues/2493
value = parseFloat(value);
return this.step ? (Math.round((value + this.min) / this.step) / (1 / this.step)) - this.min : value;
}, },
_validateValue: function() { _validateValue: function() {
@ -12862,6 +12871,20 @@ is separate from validation, and `allowed-pattern` does not affect how the input
value: 'off' value: 'off'
}, },
/**
* Bind this to the `<input is="iron-input">`'s `autosave` property, used with type=search.
*/
autosave: {
type: String
},
/**
* Bind this to the `<input is="iron-input">`'s `results` property, , used with type=search.
*/
results: {
type: Number
},
_ariaDescribedBy: { _ariaDescribedBy: {
type: String, type: String,
value: '' value: ''
@ -14720,6 +14743,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
observer: '_srcChanged' observer: '_srcChanged'
}, },
/**
* @type {!Polymer.IronMeta}
*/
_meta: { _meta: {
value: Polymer.Base.create('iron-meta', {type: 'iconset'}) value: Polymer.Base.create('iron-meta', {type: 'iconset'})
} }
@ -14747,12 +14773,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
_updateIcon: function() { _updateIcon: function() {
if (this._usesIconset()) { if (this._usesIconset()) {
if (this._iconsetName) { if (this._iconsetName) {
this._iconset = this._meta.byKey(this._iconsetName); this._iconset = /** @type {?Polymer.Iconset} */ (
this._meta.byKey(this._iconsetName));
if (this._iconset) { if (this._iconset) {
this._iconset.applyIcon(this, this._iconName, this.theme); this._iconset.applyIcon(this, this._iconName, this.theme);
this.unlisten(window, 'iron-iconset-added', '_updateIcon');
} else { } else {
this._warn(this._logf('_updateIcon', 'could not find iconset `' this.listen(window, 'iron-iconset-added', '_updateIcon');
+ this._iconsetName + '`, did you import the iconset?'));
} }
} }
} else { } else {
@ -15011,11 +15038,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
:host { :host {
display: block; display: block;
margin: 24px 40px; margin: 24px 40px;
-webkit-overflow-scrolling: touch;
background: var(--paper-dialog-background-color, --primary-background-color); background: var(--paper-dialog-background-color, --primary-background-color);
color: var(--paper-dialog-color, --primary-text-color); color: var(--paper-dialog-color, --primary-text-color);
@apply(--layout-scroll);
@apply(--paper-font-body1); @apply(--paper-font-body1);
@apply(--shadow-elevation-16dp); @apply(--shadow-elevation-16dp);
@apply(--paper-dialog); @apply(--paper-dialog);
@ -17070,8 +17097,8 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
.input-content.label-is-floating ::content label, .input-content.label-is-floating ::content label,
.input-content.label-is-floating ::content .paper-input-label { .input-content.label-is-floating ::content .paper-input-label {
-webkit-transform: translate3d(0, -75%, 0) scale(0.75); -webkit-transform: translateY(-75%) scale(0.75);
transform: translate3d(0, -75%, 0) scale(0.75); transform: translateY(-75%) scale(0.75);
-webkit-transform-origin: left top; -webkit-transform-origin: left top;
transform-origin: left top; transform-origin: left top;
-webkit-transition: -webkit-transform 0.25s; -webkit-transition: -webkit-transform 0.25s;
@ -17109,6 +17136,7 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
background: transparent; background: transparent;
border: none; border: none;
color: var(--paper-input-container-input-color, --primary-text-color); color: var(--paper-input-container-input-color, --primary-text-color);
-webkit-appearance: none;
@apply(--paper-font-subhead); @apply(--paper-font-subhead);
@apply(--paper-input-container-input); @apply(--paper-input-container-input);
@ -17206,7 +17234,7 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
/** /**
* True if the input is invalid. This property is set automatically when the input value * True if the input is invalid. This property is set automatically when the input value
* changes if auto-validating, or when the `iron-input-valid` event is heard from a child. * changes if auto-validating, or when the `iron-input-validate` event is heard from a child.
*/ */
invalid: { invalid: {
observer: '_invalidChanged', observer: '_invalidChanged',
@ -17409,8 +17437,8 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
} }
// The label might have a horizontal offset if a prefix element exists // The label might have a horizontal offset if a prefix element exists
// which needs to be undone when displayed as a floating label. // which needs to be undone when displayed as a floating label.
if (this.$.prefix && label && label.offsetParent && if (Polymer.dom(this.$.prefix).getDistributedNodes().length > 0 &&
Polymer.dom(this.$.prefix).getDistributedNodes().length > 0) { label && label.offsetParent) {
label.style.left = -label.offsetParent.offsetLeft + 'px'; label.style.left = -label.offsetParent.offsetLeft + 'px';
} }
} else { } else {
@ -17455,12 +17483,12 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
:host { :host {
display: inline-block; display: inline-block;
visibility: hidden; visibility: hidden;
float: left;
color: var(--paper-input-container-invalid-color, --google-red-500); color: var(--paper-input-container-invalid-color, --google-red-500);
@apply(--paper-font-caption); @apply(--paper-font-caption);
@apply(--paper-input-error); @apply(--paper-input-error);
position: absolute;
} }
:host([invalid]) { :host([invalid]) {
@ -17578,7 +17606,7 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
<label hidden$="[[!label]]">[[label]]</label> <label hidden$="[[!label]]">[[label]]</label>
<input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange"> <input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" autosave$="[[autosave]]" ,="" results$="[[results]]">
<content select="[suffix]"></content> <content select="[suffix]"></content>