mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
22a5e48860
commit
61d616c330
44 changed files with 447 additions and 156 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-keys-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "A behavior that enables keybindings for greater a11y.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -30,11 +30,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
|
||||
"_release": "1.0.5",
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "cf833eab5c55a26c5aa92e56d3fcb079120ce66a"
|
||||
"tag": "v1.0.6",
|
||||
"commit": "af5c98b1cf9b3d180a6326c99ac9c7057eee647f"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-keys-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "A behavior that enables keybindings for greater a11y.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
|
|
@ -241,7 +241,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
* `keys` property is pressed.
|
||||
*
|
||||
* @demo demo/index.html
|
||||
* @polymerBehavior IronA11yKeysBehavior
|
||||
* @polymerBehavior
|
||||
*/
|
||||
Polymer.IronA11yKeysBehavior = {
|
||||
properties: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-icon",
|
||||
"private": true,
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "An element that supports displaying an icon",
|
||||
"main": "iron-icon.html",
|
||||
|
@ -24,6 +24,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"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-icons": "polymerelements/iron-icons#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
|
@ -31,11 +32,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
||||
"_release": "1.0.4",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "5a5e6cad097561ff9d182ad2b8e20bb822d6f640"
|
||||
"tag": "v1.0.5",
|
||||
"commit": "5217361e21016b3ca52b7bbf5ba2ad56b3301486"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-icon",
|
||||
"private": true,
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "An element that supports displaying an icon",
|
||||
"main": "iron-icon.html",
|
||||
|
@ -24,6 +24,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"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-icons": "polymerelements/iron-icons#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
|
|
62
dashboard-ui/bower_components/iron-icon/demo/async.html
vendored
Normal file
62
dashboard-ui/bower_components/iron-icon/demo/async.html
vendored
Normal 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 <iron-icon> 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><iron-icon icon="example:location"></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>
|
|
@ -30,7 +30,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<body>
|
||||
<div class="vertical-section-container centered">
|
||||
<h4>This demo is for a single <iron-icon>. If you're looking for the
|
||||
whole set of available icons, check out the <iron-icons> demo.</h4>
|
||||
whole set of available icons, check out the <a href="/elements/iron-icons?view=demo:demo/index.html"><iron-icons> demo.</a></h5>
|
||||
|
||||
<div class="vertical-section">
|
||||
<!-- iron-icon using a iron-iconset as its icon source -->
|
||||
|
|
|
@ -129,11 +129,14 @@ Custom property | Description | Default
|
|||
type: String,
|
||||
observer: '_srcChanged'
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Polymer.IronMeta}
|
||||
*/
|
||||
_meta: {
|
||||
value: Polymer.Base.create('iron-meta', {type: 'iconset'})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
_DEFAULT_ICONSET: 'icons',
|
||||
|
@ -157,12 +160,13 @@ Custom property | Description | Default
|
|||
_updateIcon: function() {
|
||||
if (this._usesIconset()) {
|
||||
if (this._iconsetName) {
|
||||
this._iconset = this._meta.byKey(this._iconsetName);
|
||||
this._iconset = /** @type {?Polymer.Iconset} */ (
|
||||
this._meta.byKey(this._iconsetName));
|
||||
if (this._iconset) {
|
||||
this._iconset.applyIcon(this, this._iconName, this.theme);
|
||||
this.unlisten(window, 'iron-iconset-added', '_updateIcon');
|
||||
} else {
|
||||
this._warn(this._logf('_updateIcon', 'could not find iconset `'
|
||||
+ this._iconsetName + '`, did you import the iconset?'));
|
||||
this.listen(window, 'iron-iconset-added', '_updateIcon');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -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-iconset/iron-iconset.html">
|
||||
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
|
||||
</head>
|
||||
|
@ -48,6 +49,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</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>
|
||||
function iconElementFor (node) {
|
||||
var nodes = Polymer.dom(node.root).childNodes;
|
||||
|
@ -113,6 +126,23 @@ suite('<iron-icon>', function() {
|
|||
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>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-iconset-svg",
|
||||
"description": "Manages a set of svg icons",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
|
@ -24,16 +24,17 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^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",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-iconset-svg",
|
||||
"_release": "1.0.4",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "795aa82ac22971421bc4375efbd2419ebba9099f"
|
||||
"tag": "v1.0.5",
|
||||
"commit": "54d35698c1e06462452997f8731ea31a4bf1638c"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-iconset-svg.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-iconset-svg",
|
||||
"description": "Manages a set of svg icons",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
|
@ -24,6 +24,7 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^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",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "*"
|
||||
|
|
|
@ -23,7 +23,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
.centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
iron-icon {
|
||||
height: 64px;
|
||||
width: 64px;
|
||||
|
|
|
@ -136,6 +136,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
*/
|
||||
_nameChanged: function() {
|
||||
new Polymer.IronMeta({type: 'iconset', key: this.name, value: this});
|
||||
this.async(function() {
|
||||
this.fire('iron-iconset-added', this, {node: window});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -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-meta/iron-meta.html">
|
||||
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
|
||||
</head>
|
||||
|
@ -55,8 +56,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
suite('basic behavior', function () {
|
||||
var iconset;
|
||||
var meta;
|
||||
var loadedPromise;
|
||||
|
||||
setup(function () {
|
||||
loadedPromise = new Promise(function(resolve) {
|
||||
window.addEventListener('iron-iconset-added', function(ev) {
|
||||
if (ev && ev.detail === iconset) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
var elements = fixture('TrivialIconsetSvg');
|
||||
iconset = elements[0];
|
||||
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 () {
|
||||
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 () {
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-meta",
|
||||
"homepage": "https://github.com/PolymerElements/iron-meta",
|
||||
"_release": "1.0.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.3",
|
||||
"commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-meta.git",
|
||||
"_source": "git://github.com/PolymerElements/iron-meta.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-meta"
|
||||
"_originalSource": "PolymerElements/iron-meta"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
|
@ -28,11 +28,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-range-behavior",
|
||||
"_release": "1.0.2",
|
||||
"_release": "1.0.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "a743ac0b204a8e76466c2dba349ab2180c9f15f5"
|
||||
"tag": "v1.0.3",
|
||||
"commit": "3ed9a372778e31e62477666b313155c581a7dfe6"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-range-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
|
|
|
@ -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`
|
||||
*/
|
||||
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() {
|
||||
|
|
|
@ -45,11 +45,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
test('set value', function(done) {
|
||||
range.value = 50;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.value, 50);
|
||||
// test clamp value
|
||||
range.value = 60.1;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.value, 60);
|
||||
done();
|
||||
});
|
||||
|
@ -59,7 +59,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
test('set max', function(done) {
|
||||
range.max = 10;
|
||||
range.value = 11;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.value, range.max);
|
||||
done();
|
||||
});
|
||||
|
@ -68,7 +68,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
test('test ratio', function(done) {
|
||||
range.max = 10;
|
||||
range.value = 5;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.ratio, 50);
|
||||
done();
|
||||
});
|
||||
|
@ -78,10 +78,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
range.min = 10
|
||||
range.max = 50;
|
||||
range.value = 30;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.ratio, 50);
|
||||
range.value = 0;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.value, range.min);
|
||||
done();
|
||||
});
|
||||
|
@ -92,17 +92,34 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
range.min = 0;
|
||||
range.max = 10;
|
||||
range.value = 5.1;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.value, 5);
|
||||
range.step = 0.1;
|
||||
range.value = 5.1;
|
||||
asyncPlatformFlush(function() {
|
||||
flush(function() {
|
||||
assert.equal(range.value, 5.1);
|
||||
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>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
@ -25,17 +25,18 @@
|
|||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"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",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.4",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "2af8ee5b7cd489bca7d4689c563b82fd356a9534"
|
||||
"tag": "v1.0.5",
|
||||
"commit": "396ef93a5d3467810cec0328c53f09037d6ee8e1"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
@ -25,8 +25,9 @@
|
|||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"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",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
|
|
|
@ -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 unselected = i < 0;
|
||||
if (unselected) {
|
||||
this.selectedValues.push(value);
|
||||
this.push('selectedValues',value);
|
||||
} else {
|
||||
this.selectedValues.splice(i, 1);
|
||||
this.splice('selectedValues',i,1);
|
||||
}
|
||||
this._selection.setItemSelected(this._valueToItem(value), unselected);
|
||||
}
|
||||
|
|
|
@ -105,9 +105,10 @@ 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.
|
||||
*
|
||||
* @type {object}
|
||||
* @default {template: 1}
|
||||
*/
|
||||
excludedLocalNames: {
|
||||
|
@ -132,6 +133,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
attached: function() {
|
||||
this._observer = this._observeItems(this);
|
||||
this._contentObserver = this._observeContent(this);
|
||||
if (!this.selectedItem && this.selected) {
|
||||
this._updateSelected(this.attrForSelected,this.selected)
|
||||
}
|
||||
},
|
||||
|
||||
detached: function() {
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
get: function() {
|
||||
return this.multi ? this.selection : this.selection[0];
|
||||
return this.multi ? this.selection.slice() : this.selection[0];
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -165,6 +165,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
}, 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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
<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">
|
||||
|
||||
<style>
|
||||
|
@ -43,6 +44,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</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>
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
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() {
|
||||
// set selected
|
||||
s.selected = [0, 2];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-dialog-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "Implements a behavior used for material design dialogs",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
@ -34,11 +34,11 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.5",
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "5066ec108225d07d8d7ec4efc00ccfc929239ef3"
|
||||
"tag": "v1.0.6",
|
||||
"commit": "9714b11aa532e1a59dadc2096616ed2ea3b82157"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-dialog-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-dialog-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "Implements a behavior used for material design dialogs",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
|
|
@ -11,11 +11,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
:host {
|
||||
display: block;
|
||||
margin: 24px 40px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
background: var(--paper-dialog-background-color, --primary-background-color);
|
||||
color: var(--paper-dialog-color, --primary-text-color);
|
||||
|
||||
@apply(--layout-scroll);
|
||||
@apply(--paper-font-body1);
|
||||
@apply(--shadow-elevation-16dp);
|
||||
@apply(--paper-dialog);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "paper-dialog",
|
||||
"description": "A Material Design dialog",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -27,16 +27,19 @@
|
|||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^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",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.1",
|
||||
"_release": "1.0.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.1",
|
||||
"commit": "1339718c67ef50add5221dd63d35e03a54fb619f"
|
||||
"tag": "v1.0.2",
|
||||
"commit": "f24bdc41e7374793c5bd966aa8cadc012e15cb09"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-dialog.git",
|
||||
"_target": "~1.0.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "paper-dialog",
|
||||
"description": "A Material Design dialog",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -27,6 +27,9 @@
|
|||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^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",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
|
|
|
@ -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/demo-pages.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">
|
||||
|
||||
|
@ -50,11 +53,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
position: fixed;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
}
|
||||
|
||||
paper-dialog.size-position {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
</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="actions">dialog with actions</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">
|
||||
<h2>Dialog Title</h2>
|
||||
|
@ -109,6 +112,37 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</div>
|
||||
</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 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="position">size & 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>
|
||||
</paper-dialog>
|
||||
|
||||
<paper-dialog id="position" heading="Custom Size & Position" class="size-position">
|
||||
<paper-dialog id="position" class="size-position">
|
||||
<h2>Custom Size & 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>
|
||||
</paper-dialog>
|
||||
</section>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-input",
|
||||
"version": "1.0.14",
|
||||
"version": "1.0.15",
|
||||
"description": "Material design text fields",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -44,11 +44,11 @@
|
|||
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
|
||||
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
|
||||
},
|
||||
"_release": "1.0.14",
|
||||
"_release": "1.0.15",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.14",
|
||||
"commit": "120a0610aca5c86194977e30f696b09716f93bbc"
|
||||
"tag": "v1.0.15",
|
||||
"commit": "34d19454e0ea13b1a809add8c87fba128fbc9940"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/paper-input.git",
|
||||
"_target": "^1.0.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-input",
|
||||
"version": "1.0.14",
|
||||
"version": "1.0.15",
|
||||
"description": "Material design text fields",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
|
|
@ -59,6 +59,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<div class="vertical-section">
|
||||
<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 no-label-float label="label (no-label-float)"></paper-input>
|
||||
|
|
|
@ -279,6 +279,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
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: {
|
||||
type: String,
|
||||
value: ''
|
||||
|
|
|
@ -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 .paper-input-label {
|
||||
-webkit-transform: translate3d(0, -75%, 0) scale(0.75);
|
||||
transform: translate3d(0, -75%, 0) scale(0.75);
|
||||
-webkit-transform: translateY(-75%) scale(0.75);
|
||||
transform: translateY(-75%) scale(0.75);
|
||||
-webkit-transform-origin: left top;
|
||||
transform-origin: left top;
|
||||
-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;
|
||||
border: none;
|
||||
color: var(--paper-input-container-input-color, --primary-text-color);
|
||||
-webkit-appearance: none;
|
||||
|
||||
@apply(--paper-font-subhead);
|
||||
@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
|
||||
* 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: {
|
||||
observer: '_invalidChanged',
|
||||
|
@ -531,9 +532,9 @@ 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
|
||||
// which needs to be undone when displayed as a floating label.
|
||||
if (this.$.prefix && label && label.offsetParent &&
|
||||
Polymer.dom(this.$.prefix).getDistributedNodes().length > 0) {
|
||||
label.style.left = -label.offsetParent.offsetLeft + 'px';
|
||||
if (Polymer.dom(this.$.prefix).getDistributedNodes().length > 0 &&
|
||||
label && label.offsetParent) {
|
||||
label.style.left = -label.offsetParent.offsetLeft + 'px';
|
||||
}
|
||||
} else {
|
||||
// When the label is not floating, it should overlap the input element.
|
||||
|
|
|
@ -37,12 +37,12 @@ Custom property | Description | Default
|
|||
:host {
|
||||
display: inline-block;
|
||||
visibility: hidden;
|
||||
float: left;
|
||||
|
||||
color: var(--paper-input-container-invalid-color, --google-red-500);
|
||||
|
||||
@apply(--paper-font-caption);
|
||||
@apply(--paper-input-error);
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
:host([invalid]) {
|
||||
|
@ -51,7 +51,7 @@ Custom property | Description | Default
|
|||
</style>
|
||||
|
||||
<content></content>
|
||||
|
||||
|
||||
</template>
|
||||
</dom-module>
|
||||
|
||||
|
|
|
@ -35,6 +35,14 @@ for `suffix`).
|
|||
<paper-icon-button suffix icon="clear"></paper-icon-button>
|
||||
</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.
|
||||
|
||||
### Styling
|
||||
|
@ -106,7 +114,9 @@ style this element.
|
|||
size$="[[size]]"
|
||||
autocapitalize$="[[autocapitalize]]"
|
||||
autocorrect$="[[autocorrect]]"
|
||||
on-change="_onChange">
|
||||
on-change="_onChange"
|
||||
autosave$="[[autosave]]",
|
||||
results$="[[results]]">
|
||||
|
||||
<content select="[suffix]"></content>
|
||||
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/paper-ripple",
|
||||
"homepage": "https://github.com/polymerelements/paper-ripple",
|
||||
"_release": "1.0.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "b546dbe6ad0b1f58cac80caec3136cf3232e12fc"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-ripple.git",
|
||||
"_source": "git://github.com/polymerelements/paper-ripple.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/paper-ripple"
|
||||
"_originalSource": "polymerelements/paper-ripple"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-toggle-button",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"description": "A material design toggle button control",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -34,11 +34,11 @@
|
|||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
|
||||
},
|
||||
"_release": "1.0.8",
|
||||
"_release": "1.0.9",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.8",
|
||||
"commit": "b1630a0597b9d55d09396c8636daf443890a46df"
|
||||
"tag": "v1.0.9",
|
||||
"commit": "95a18ee82adfb9e10594f99251e991f91b489ac1"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
|
||||
"_target": "~1.0.5",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-toggle-button",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"description": "A material design toggle button control",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
|
|
@ -62,42 +62,6 @@ Custom property | Description | Default
|
|||
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 {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
|
@ -106,15 +70,8 @@ Custom property | Description | Default
|
|||
pointer-events: none;
|
||||
opacity: 0.4;
|
||||
transition: background-color linear .08s;
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-bar {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host([disabled]) .toggle-bar {
|
||||
background-color: #000;
|
||||
opacity: 0.12;
|
||||
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
|
||||
@apply(--paper-toggle-button-unchecked-bar);
|
||||
}
|
||||
|
||||
.toggle-button {
|
||||
|
@ -127,6 +84,8 @@ Custom property | Description | Default
|
|||
transition: -webkit-transform linear .08s, background-color linear .08s;
|
||||
transition: transform linear .08s, background-color linear .08s;
|
||||
will-change: transform;
|
||||
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
|
||||
@apply(--paper-toggle-button-unchecked-button);
|
||||
}
|
||||
|
||||
.toggle-button.dragging {
|
||||
|
@ -134,11 +93,27 @@ Custom property | Description | Default
|
|||
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 {
|
||||
-webkit-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 {
|
||||
background-color: #bdbdbd;
|
||||
opacity: 1;
|
||||
|
@ -152,10 +127,21 @@ Custom property | Description | Default
|
|||
height: 48px;
|
||||
opacity: 0.5;
|
||||
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>
|
||||
|
||||
<div id="toggleContainer">
|
||||
<div class="toggle-container">
|
||||
<div id="toggleBar" class="toggle-bar"></div>
|
||||
<div id="toggleButton" class="toggle-button">
|
||||
<paper-ripple id="ink" class="toggle-ink circle" recenters></paper-ripple>
|
||||
|
|
|
@ -6645,7 +6645,7 @@ this.fire('dom-change');
|
|||
* `keys` property is pressed.
|
||||
*
|
||||
* @demo demo/index.html
|
||||
* @polymerBehavior IronA11yKeysBehavior
|
||||
* @polymerBehavior
|
||||
*/
|
||||
Polymer.IronA11yKeysBehavior = {
|
||||
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.
|
||||
*/
|
||||
get: function() {
|
||||
return this.multi ? this.selection : this.selection[0];
|
||||
return this.multi ? this.selection.slice() : this.selection[0];
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -10886,9 +10886,10 @@ 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.
|
||||
*
|
||||
* @type {object}
|
||||
* @default {template: 1}
|
||||
*/
|
||||
excludedLocalNames: {
|
||||
|
@ -10913,6 +10914,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
|
|||
attached: function() {
|
||||
this._observer = this._observeItems(this);
|
||||
this._contentObserver = this._observeContent(this);
|
||||
if (!this.selectedItem && this.selected) {
|
||||
this._updateSelected(this.attrForSelected,this.selected)
|
||||
}
|
||||
},
|
||||
|
||||
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 unselected = i < 0;
|
||||
if (unselected) {
|
||||
this.selectedValues.push(value);
|
||||
this.push('selectedValues',value);
|
||||
} else {
|
||||
this.selectedValues.splice(i, 1);
|
||||
this.splice('selectedValues',i,1);
|
||||
}
|
||||
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() {
|
||||
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`
|
||||
*/
|
||||
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() {
|
||||
|
@ -12862,6 +12871,20 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
|||
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: {
|
||||
type: String,
|
||||
value: ''
|
||||
|
@ -14719,11 +14742,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
type: String,
|
||||
observer: '_srcChanged'
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Polymer.IronMeta}
|
||||
*/
|
||||
_meta: {
|
||||
value: Polymer.Base.create('iron-meta', {type: 'iconset'})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
_DEFAULT_ICONSET: 'icons',
|
||||
|
@ -14747,12 +14773,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
_updateIcon: function() {
|
||||
if (this._usesIconset()) {
|
||||
if (this._iconsetName) {
|
||||
this._iconset = this._meta.byKey(this._iconsetName);
|
||||
this._iconset = /** @type {?Polymer.Iconset} */ (
|
||||
this._meta.byKey(this._iconsetName));
|
||||
if (this._iconset) {
|
||||
this._iconset.applyIcon(this, this._iconName, this.theme);
|
||||
this.unlisten(window, 'iron-iconset-added', '_updateIcon');
|
||||
} else {
|
||||
this._warn(this._logf('_updateIcon', 'could not find iconset `'
|
||||
+ this._iconsetName + '`, did you import the iconset?'));
|
||||
this.listen(window, 'iron-iconset-added', '_updateIcon');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -15011,11 +15038,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
:host {
|
||||
display: block;
|
||||
margin: 24px 40px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
background: var(--paper-dialog-background-color, --primary-background-color);
|
||||
color: var(--paper-dialog-color, --primary-text-color);
|
||||
|
||||
@apply(--layout-scroll);
|
||||
@apply(--paper-font-body1);
|
||||
@apply(--shadow-elevation-16dp);
|
||||
@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 .paper-input-label {
|
||||
-webkit-transform: translate3d(0, -75%, 0) scale(0.75);
|
||||
transform: translate3d(0, -75%, 0) scale(0.75);
|
||||
-webkit-transform: translateY(-75%) scale(0.75);
|
||||
transform: translateY(-75%) scale(0.75);
|
||||
-webkit-transform-origin: left top;
|
||||
transform-origin: left top;
|
||||
-webkit-transition: -webkit-transform 0.25s;
|
||||
|
@ -17109,6 +17136,7 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
|
|||
background: transparent;
|
||||
border: none;
|
||||
color: var(--paper-input-container-input-color, --primary-text-color);
|
||||
-webkit-appearance: none;
|
||||
|
||||
@apply(--paper-font-subhead);
|
||||
@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
|
||||
* 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: {
|
||||
observer: '_invalidChanged',
|
||||
|
@ -17409,9 +17437,9 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
|
|||
}
|
||||
// The label might have a horizontal offset if a prefix element exists
|
||||
// which needs to be undone when displayed as a floating label.
|
||||
if (this.$.prefix && label && label.offsetParent &&
|
||||
Polymer.dom(this.$.prefix).getDistributedNodes().length > 0) {
|
||||
label.style.left = -label.offsetParent.offsetLeft + 'px';
|
||||
if (Polymer.dom(this.$.prefix).getDistributedNodes().length > 0 &&
|
||||
label && label.offsetParent) {
|
||||
label.style.left = -label.offsetParent.offsetLeft + 'px';
|
||||
}
|
||||
} else {
|
||||
// When the label is not floating, it should overlap the input element.
|
||||
|
@ -17455,12 +17483,12 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
|
|||
:host {
|
||||
display: inline-block;
|
||||
visibility: hidden;
|
||||
float: left;
|
||||
|
||||
color: var(--paper-input-container-invalid-color, --google-red-500);
|
||||
|
||||
@apply(--paper-font-caption);
|
||||
@apply(--paper-input-error);
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
:host([invalid]) {
|
||||
|
@ -17469,7 +17497,7 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
|
|||
</style>
|
||||
|
||||
<content></content>
|
||||
|
||||
|
||||
</template>
|
||||
</dom-module>
|
||||
|
||||
|
@ -17578,7 +17606,7 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
|
|||
|
||||
<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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue