update components

This commit is contained in:
Luke Pulverenti 2016-03-04 22:39:49 -05:00
parent 7dbb1f7535
commit b447272b19
26 changed files with 478 additions and 107 deletions

View file

@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
"version": "1.0.7",
"version": "1.0.8",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
@ -17,6 +17,7 @@
"type": "git",
"url": "git://github.com/PolymerElements/iron-icon.git"
},
"ignore": [],
"dependencies": {
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
"iron-meta": "polymerelements/iron-meta#^1.0.0",
@ -28,17 +29,17 @@
"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",
"web-component-tester": "*",
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.7",
"homepage": "https://github.com/PolymerElements/iron-icon",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.7",
"commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381"
"tag": "v1.0.8",
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
},
"_source": "git://github.com/polymerelements/iron-icon.git",
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-icon"
"_originalSource": "PolymerElements/iron-icon"
}

View file

@ -0,0 +1,25 @@
language: node_js
sudo: false
before_script:
- npm install -g bower polylint web-component-tester
- bower install
- polylint
env:
global:
- secure: Cyo7MV8FASyf2EZyrSmDbmoZmopQhuTbV79Ntl6eDq6JxEOAApULHn6W+ht0tvmaA+L2cRNq3Z4uvy3tbZCI5SCgQuEKLDJFoghzNp4Izc54bBlJzsxMjcgxEEMbw1jDIKp+PJ+1+8oyT5H1NogcGoNWcvMCjn+8Vl64/999mhw=
- secure: dI3wfjJoooFlq6Kb8V1fkbc9N5jrvw7dExN4tp4KlvJFiXIvgb823jEyLGnK/oeVLwP9yncvOYxiG/enNbjpk6fId3zjwptN2H1am3pIsPQASOZJ0Pwvwa1dX7EYGk2kxOwY1pyX4is/QRVDrlUkLm3YAPOFfYJEiVB7m6TNFIo=
- CXX=g++-4.8
node_js: stable
addons:
firefox: latest
apt:
sources:
- google-chrome
- ubuntu-toolchain-r-test
packages:
- google-chrome-stable
- g++-4.8
sauce_connect: true
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"

View file

@ -0,0 +1,77 @@
<!--
This file is autogenerated based on
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :)
You can however override the jsbin link with one that's customized to this
specific element:
jsbin=https://jsbin.com/cagaye/edit?html,output
-->
# Polymer Elements
## Guide for Contributors
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
### Filing Issues
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
1. **Who will use the feature?** _“As someone filling out a form…”_
2. **When will they use the feature?** _“When I enter an invalid value…”_
3. **What is the users goal?** _“I want to be visually notified that the value needs to be corrected…”_
**If you are filing an issue to report a bug**, please provide:
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
```markdown
The `paper-foo` element causes the page to turn pink when clicked.
## Expected outcome
The page stays the same color.
## Actual outcome
The page turns pink.
## Steps to reproduce
1. Put a `paper-foo` element in the page.
2. Open the page in a web browser.
3. Click the `paper-foo` element.
```
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
### Submitting Pull Requests
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
When submitting pull requests, please provide:
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
```markdown
(For a single issue)
Fixes #20
(For multiple issues)
Fixes #32, fixes #40
```
2. **A succinct description of the design** used to fix any related issues. For example:
```markdown
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
```
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so dont be afraid to ask us if you need help with that!

View file

@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
"version": "1.0.7",
"version": "1.0.8",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
@ -17,6 +17,7 @@
"type": "git",
"url": "git://github.com/PolymerElements/iron-icon.git"
},
"ignore": [],
"dependencies": {
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
"iron-meta": "polymerelements/iron-meta#^1.0.0",
@ -28,7 +29,7 @@
"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",
"web-component-tester": "*",
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
}

View file

@ -2,11 +2,11 @@
<!--
@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
The complete set of authors may be found at http://polymer.github.io/AUTHORS
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
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
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>

View file

@ -58,6 +58,10 @@ how to create a custom iconset.
See the [iron-icons demo](iron-icons?view=demo:demo/index.html) to see the icons available
in the various iconsets.
To load a subset of icons from one of the default `iron-icons` sets, you can
use the [poly-icon](https://poly-icon.appspot.com/) tool. It allows you
to select individual icons, and creates an iconset from them that you can
use directly in your elements.
### Styling
@ -138,7 +142,8 @@ Custom property | Description | Default
* @type {!Polymer.IronMeta}
*/
_meta: {
value: Polymer.Base.create('iron-meta', {type: 'iconset'})
value: Polymer.Base.create('iron-meta', {type: 'iconset'}),
observer: '_updateIcon'
}
},
@ -163,7 +168,14 @@ Custom property | Description | Default
/** @suppress {visibility} */
_updateIcon: function() {
if (this._usesIconset()) {
if (this._iconsetName) {
if (this._img && this._img.parentNode) {
Polymer.dom(this.root).removeChild(this._img);
}
if (this._iconName === "") {
if (this._iconset) {
this._iconset.removeIcon(this);
}
} else if (this._iconsetName && this._meta) {
this._iconset = /** @type {?Polymer.Iconset} */ (
this._meta.byKey(this._iconsetName));
if (this._iconset) {
@ -174,6 +186,9 @@ Custom property | Description | Default
}
}
} else {
if (this._iconset) {
this._iconset.removeIcon(this);
}
if (!this._img) {
this._img = document.createElement('img');
this._img.style.width = '100%';

View file

@ -1,5 +1,4 @@
<!doctype html>
<!--
<!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
@ -7,10 +6,7 @@ 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>
--><html><head>
<meta charset="utf-8">
<title>Tests</title>
@ -20,12 +16,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<body>
<script>
WCT.loadSuites([
'iron-icon.html'
'iron-icon.html',
'iron-icon.html?dom=shadow'
]);
</script>
</body>
</html>
</body></html>

View file

@ -24,6 +24,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<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="icon-holder.html">
</head>
<body>
@ -61,6 +62,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="SrcIconSwitch">
<template>
<iron-iconset name="example" icons="location blank" src="location.png" size="24" width="48"></iron-iconset>
<iron-icon></iron-icon>
</template>
</test-fixture>
<test-fixture id="ParentForceUpdate">
<template>
<icon-holder>
<iron-icon></iron-icon>
</icon-holder>
</template>
</test-fixture>
<script>
function iconElementFor (node) {
var nodes = Polymer.dom(node.root).childNodes;
@ -143,6 +159,60 @@ suite('<iron-icon>', function() {
});
});
});
suite('when switching between src and icon properties', function() {
var icon;
setup(function() {
var elements = fixture('IconFromIconset');
icon = elements[1];
});
test('will display the icon if both icon and src are set', function() {
icon.src = '../demo/location.png';
icon.icon = 'example:location';
expect(hasIcon(icon)).to.be.true;
expect(iconElementFor(icon)).to.not.exist;
// Check if it works too it we change the affectation order
icon.icon = 'example:location';
icon.src = '../demo/location.png';
expect(hasIcon(icon)).to.be.true;
expect(iconElementFor(icon)).to.not.exist;
});
test('will display the icon when src is defined first and then reset', function() {
icon.src = '../demo/location.png';
icon.icon = null;
icon.src = null;
icon.icon = 'example:location';
expect(hasIcon(icon)).to.be.true;
expect(iconElementFor(icon)).to.not.exist;
});
test('will display the src when icon is defined first and then reset', function() {
icon.src = null;
icon.icon = 'example:location';
icon.src = '../demo/location.png';
icon.icon = null;
expect(hasIcon(icon)).to.be.false;
expect(iconElementFor(icon)).to.exist;
});
test('will display nothing if both properties are unset', function() {
icon.src = '../demo/location.png';
icon.icon = 'example:location';
icon.src = null;
icon.icon = null;
expect(hasIcon(icon)).to.be.false;
expect(iconElementFor(icon)).to.not.exist;
});
});
suite('ancestor direct updates', function() {
test('handle properties set before ready', function() {
var holder = fixture('ParentForceUpdate');
});
});
});
</script>