update polymer components

This commit is contained in:
Luke Pulverenti 2015-12-04 11:58:14 -05:00
parent 22f689e089
commit 2eb2a5011d
18 changed files with 287 additions and 104 deletions

View File

@ -39,6 +39,6 @@
"commit": "cec8e49744a1e18b14a711eea77e201bb70de544" "commit": "cec8e49744a1e18b14a711eea77e201bb70de544"
}, },
"_source": "git://github.com/desandro/doc-ready.git", "_source": "git://github.com/desandro/doc-ready.git",
"_target": "1.0.x", "_target": "~1.0.4",
"_originalSource": "doc-ready" "_originalSource": "doc-ready"
} }

View File

@ -30,14 +30,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
"_release": "1.1.0", "_release": "1.1.0",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.0", "tag": "v1.1.0",
"commit": "cd8c972278c0d916bef57209d7dce5b81e67687c" "commit": "cd8c972278c0d916bef57209d7dce5b81e67687c"
}, },
"_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",
"_originalSource": "PolymerElements/iron-a11y-keys-behavior" "_originalSource": "polymerelements/iron-a11y-keys-behavior"
} }

View File

@ -31,14 +31,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-icon", "homepage": "https://github.com/PolymerElements/iron-icon",
"_release": "1.0.7", "_release": "1.0.7",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.7", "tag": "v1.0.7",
"commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381" "commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381"
}, },
"_source": "git://github.com/polymerelements/iron-icon.git", "_source": "git://github.com/PolymerElements/iron-icon.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/iron-icon" "_originalSource": "PolymerElements/iron-icon"
} }

View File

@ -26,14 +26,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"main": "iron-meta.html", "main": "iron-meta.html",
"homepage": "https://github.com/polymerelements/iron-meta", "homepage": "https://github.com/PolymerElements/iron-meta",
"_release": "1.1.1", "_release": "1.1.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.1", "tag": "v1.1.1",
"commit": "e171ee234b482219c9514e6f9551df48ef48bd9f" "commit": "e171ee234b482219c9514e6f9551df48ef48bd9f"
}, },
"_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

@ -36,7 +36,7 @@
"tag": "v1.0.8", "tag": "v1.0.8",
"commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff" "commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-selector" "_originalSource": "polymerelements/iron-selector"
} }

View File

@ -45,7 +45,7 @@
"tag": "v1.0.10", "tag": "v1.0.10",
"commit": "4b244a542af2c6c271498dfb98b00ed284df1d6a" "commit": "4b244a542af2c6c271498dfb98b00ed284df1d6a"
}, },
"_source": "git://github.com/PolymerElements/paper-behaviors.git", "_source": "git://github.com/polymerelements/paper-behaviors.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-behaviors" "_originalSource": "polymerelements/paper-behaviors"
} }

View File

@ -34,14 +34,14 @@
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0" "iron-component-page": "PolymerElements/iron-component-page#^1.0.0"
}, },
"homepage": "https://github.com/PolymerElements/paper-icon-button", "homepage": "https://github.com/polymerelements/paper-icon-button",
"_release": "1.0.5", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.5",
"commit": "15e9bd571ef8e77da8c58fb5f447fe7cc7c0c9f1" "commit": "15e9bd571ef8e77da8c58fb5f447fe7cc7c0c9f1"
}, },
"_source": "git://github.com/PolymerElements/paper-icon-button.git", "_source": "git://github.com/polymerelements/paper-icon-button.git",
"_target": "~1.0.2", "_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-icon-button" "_originalSource": "polymerelements/paper-icon-button"
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "paper-item", "name": "paper-item",
"version": "1.0.7", "version": "1.1.2",
"description": "A material-design styled list item", "description": "A material-design styled list item",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -26,6 +26,7 @@
"dependencies": { "dependencies": {
"polymer": "Polymer/polymer#^1.1.0", "polymer": "Polymer/polymer#^1.1.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0", "paper-styles": "PolymerElements/paper-styles#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-behaviors": "polymerelements/iron-behaviors#^1.0.0" "iron-behaviors": "polymerelements/iron-behaviors#^1.0.0"
}, },
"devDependencies": { "devDependencies": {
@ -34,18 +35,20 @@
"iron-icons": "PolymerElements/iron-icons#^1.0.0", "iron-icons": "PolymerElements/iron-icons#^1.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0", "paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0", "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"paper-input": "PolymerElements/paper-input#^1.0.0",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^1.0.0", "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "Polymer/web-component-tester#^3.3.0", "web-component-tester": "Polymer/web-component-tester#^3.4.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
}, },
"_release": "1.0.7", "_release": "1.1.2",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.7", "tag": "v1.1.2",
"commit": "9c265d81bb545f53ce9871ba86ae2f52c453f399" "commit": "e6d048b25af0a84e1ff9f48450f07972326d476b"
}, },
"_source": "git://github.com/PolymerElements/paper-item.git", "_source": "git://github.com/PolymerElements/paper-item.git",
"_target": "~1.0.2", "_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-item" "_originalSource": "PolymerElements/paper-item"
} }

View File

@ -1,28 +1,24 @@
language: node_js language: node_js
sudo: false sudo: false
matrix:
include:
- node_js: stable
script: xvfb-run wct
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- node_js: node
script:
- |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
wct -s 'default'
fi
before_script: before_script:
- npm install web-component-tester - npm install web-component-tester
- npm install bower - npm install bower
- export PATH=$PWD/node_modules/.bin:$PATH - 'export PATH=$PWD/node_modules/.bin:$PATH'
- bower install - bower install
- npm install polylint
- polylint
env: env:
global: global:
- secure: NCk3KK+wbaXMzp8XAY6FeL+TSdI0AlPI3/tl0OpsUIaU2EiCjQuzf/UpyzCW5XZMEVFF4q/eDjrPkqJodHfpngj36mpkfmfqj9DrgDmYsV9BDvsTd8KmLsA6H8D6p7Qer+r1JMMB8PvX44vdhQ6GhZD1HFNYK1Ekpt0TkYwWKNw= - secure: NCk3KK+wbaXMzp8XAY6FeL+TSdI0AlPI3/tl0OpsUIaU2EiCjQuzf/UpyzCW5XZMEVFF4q/eDjrPkqJodHfpngj36mpkfmfqj9DrgDmYsV9BDvsTd8KmLsA6H8D6p7Qer+r1JMMB8PvX44vdhQ6GhZD1HFNYK1Ekpt0TkYwWKNw=
- secure: TGgUEQe6FJS+GuYk94d//8YQmDLUu0ekMvPSIs8TQ2QkdBK4SL+2bSXZt44BbDEOwc9P4NCPSUx/RMiCAqsc5OGRJImzb/zqPNIDTeKG6q72HPBBBD3Sk0CrEpTQbOK/Flaa/B7RYR0U1kuljSmRS7lPG19nnY8gOHnIAgwIyk0= - secure: TGgUEQe6FJS+GuYk94d//8YQmDLUu0ekMvPSIs8TQ2QkdBK4SL+2bSXZt44BbDEOwc9P4NCPSUx/RMiCAqsc5OGRJImzb/zqPNIDTeKG6q72HPBBBD3Sk0CrEpTQbOK/Flaa/B7RYR0U1kuljSmRS7lPG19nnY8gOHnIAgwIyk0=
node_js: 4
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"

View File

@ -1,6 +1,6 @@
{ {
"name": "paper-item", "name": "paper-item",
"version": "1.0.7", "version": "1.1.2",
"description": "A material-design styled list item", "description": "A material-design styled list item",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -26,6 +26,7 @@
"dependencies": { "dependencies": {
"polymer": "Polymer/polymer#^1.1.0", "polymer": "Polymer/polymer#^1.1.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0", "paper-styles": "PolymerElements/paper-styles#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-behaviors": "polymerelements/iron-behaviors#^1.0.0" "iron-behaviors": "polymerelements/iron-behaviors#^1.0.0"
}, },
"devDependencies": { "devDependencies": {
@ -34,9 +35,11 @@
"iron-icons": "PolymerElements/iron-icons#^1.0.0", "iron-icons": "PolymerElements/iron-icons#^1.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0", "paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0", "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"paper-input": "PolymerElements/paper-input#^1.0.0",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^1.0.0", "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "Polymer/web-component-tester#^3.3.0", "web-component-tester": "Polymer/web-component-tester#^3.4.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
} }
} }

View File

@ -28,9 +28,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../paper-icon-item.html"> <link rel="import" href="../paper-icon-item.html">
<link rel="import" href="../paper-item.html"> <link rel="import" href="../paper-item.html">
<link rel="import" href="../paper-item-body.html"> <link rel="import" href="../paper-item-body.html">
<link rel="import" href="../../paper-styles/paper-styles.html"> <link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../paper-styles/demo-pages.html"> <link rel="import" href="../../paper-styles/demo-pages.html">
<style is="custom-style"> <style is="custom-style">
.list { .list {
padding-top: 12px; padding-top: 12px;
@ -72,10 +72,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
.green { .green {
background-color: var(--paper-green-300); background-color: var(--paper-green-300);
} }
.container {
@apply(--layout-wrap);
@apply(--layout-center-center);
@apply(--layout-inline);
}
.flex {
@apply(--layout-flex);
}
</style> </style>
</head> </head>
<body unresolved> <body unresolved>
<div class="layout wrap inline center-center"> <div class="container">
<div> <div>
<h4>Single line items</h4> <h4>Single line items</h4>
<div class="list short" role="listbox"> <div class="list short" role="listbox">

View File

@ -11,11 +11,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html"> <link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html"> <link rel="import" href="../iron-behaviors/iron-button-state.html">
<link rel="import" href="../paper-styles/paper-styles.html"> <link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/typography.html">
<link rel="import" href="../paper-styles/color.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="paper-item-behavior.html">
<link rel="import" href="paper-item-shared-styles.html"> <link rel="import" href="paper-item-shared-styles.html">
<!-- <!--
`<paper-icon-item>` is a convenience element to make an item with icon. It is a non interactive list `<paper-icon-item>` is a convenience element to make an item with icon. It is an interactive list
item with a fixed-width icon area, according to Material Design. This is useful if the icons are of item with a fixed-width icon area, according to Material Design. This is useful if the icons are of
varying widths, but you want the item bodies to line up. Use this like a `<paper-item>`. The child varying widths, but you want the item bodies to line up. Use this like a `<paper-item>`. The child
node with the attribute `item-icon` is placed in the icon area. node with the attribute `item-icon` is placed in the icon area.
@ -43,7 +47,6 @@ Custom property | Description |
`--paper-item-disabled` | Mixin applied to disabled paper-items | `{}` `--paper-item-disabled` | Mixin applied to disabled paper-items | `{}`
`--paper-item-focused` | Mixin applied to focused paper-items | `{}` `--paper-item-focused` | Mixin applied to focused paper-items | `{}`
`--paper-item-focused-before` | Mixin applied to :before focused paper-items | `{}` `--paper-item-focused-before` | Mixin applied to :before focused paper-items | `{}`
--> -->
<dom-module id="paper-icon-item"> <dom-module id="paper-icon-item">
@ -61,10 +64,12 @@ Custom property | Description |
.content-icon { .content-icon {
width: var(--paper-item-icon-width, 56px); width: var(--paper-item-icon-width, 56px);
@apply(--layout-horizontal);
@apply(--layout-center);
} }
</style> </style>
<div id="contentIcon" class="content-icon layout horizontal center"> <div id="contentIcon" class="content-icon">
<content select="[item-icon]"></content> <content select="[item-icon]"></content>
</div> </div>
<content></content> <content></content>
@ -74,14 +79,8 @@ Custom property | Description |
Polymer({ Polymer({
is: 'paper-icon-item', is: 'paper-icon-item',
hostAttributes: {
'role': 'option',
'tabindex': '0'
},
behaviors: [ behaviors: [
Polymer.IronControlState, Polymer.PaperItemBehavior
Polymer.IronButtonState
] ]
}); });
</script> </script>

View File

@ -0,0 +1,37 @@
<!--
@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
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html">
<!--
`PaperItemBehavior` is a convenience behavior shared by <paper-item> and
<paper-icon-item> that manages the shared control states and attributes of
the items.
-->
<script>
/** @polymerBehavior Polymer.PaperItemBehavior */
Polymer.PaperItemBehaviorImpl = {
hostAttributes: {
role: 'option',
tabindex: '0'
}
};
/** @polymerBehavior */
Polymer.PaperItemBehavior = [
Polymer.IronControlState,
Polymer.IronButtonState,
Polymer.PaperItemBehaviorImpl
];
</script>

View File

@ -9,8 +9,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--> -->
<link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-styles/paper-styles.html"> <link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-styles/color.html">
<link rel="import" href="../paper-styles/typography.html">
<!-- <!--
Use `<paper-item-body>` in a `<paper-item>` or `<paper-icon-item>` to make two- or Use `<paper-item-body>` in a `<paper-item>` or `<paper-icon-item>` to make two- or
three- line items. It is a flex item that is a vertical flexbox. three- line items. It is a flex item that is a vertical flexbox.

View File

@ -11,13 +11,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html"> <link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html"> <link rel="import" href="../iron-behaviors/iron-button-state.html">
<link rel="import" href="../paper-styles/paper-styles.html"> <link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-styles/color.html">
<link rel="import" href="paper-item-behavior.html">
<link rel="import" href="paper-item-shared-styles.html"> <link rel="import" href="paper-item-shared-styles.html">
<!-- <!--
Material design: [Lists](https://www.google.com/design/spec/components/lists.html) Material design: [Lists](https://www.google.com/design/spec/components/lists.html)
`<paper-item>` is a non-interactive list item. By default, it is a horizontal flexbox. `<paper-item>` is an interactive list item. By default, it is a horizontal flexbox.
<paper-item>Item</paper-item> <paper-item>Item</paper-item>
@ -47,7 +50,6 @@ Custom property | Description |
`--paper-item-focused` | Mixin applied to focused paper-items | `{}` `--paper-item-focused` | Mixin applied to focused paper-items | `{}`
`--paper-item-focused-before` | Mixin applied to :before focused paper-items | `{}` `--paper-item-focused-before` | Mixin applied to :before focused paper-items | `{}`
### Accessibility ### Accessibility
This element has `role="listitem"` by default. Depending on usage, it may be more appropriate to set This element has `role="listitem"` by default. Depending on usage, it may be more appropriate to set
@ -85,14 +87,8 @@ This element has `role="listitem"` by default. Depending on usage, it may be mor
Polymer({ Polymer({
is: 'paper-item', is: 'paper-item',
hostAttributes: {
role: 'option',
tabindex: '0'
},
behaviors: [ behaviors: [
Polymer.IronControlState, Polymer.PaperItemBehavior
Polymer.IronButtonState
] ]
}); });
</script> </script>

View File

@ -1,5 +1,4 @@
<!doctype html> <!DOCTYPE html><!--
<!--
@license @license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 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 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@ -7,9 +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 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 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 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--> --><html><head>
<html>
<head>
<title>paper-item tests</title> <title>paper-item tests</title>
@ -23,12 +20,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<body> <body>
<script> <script>
WCT.loadSuites([ WCT.loadSuites([
'paper-item.html' 'paper-item.html',
'paper-item.html?dom=shadow'
]); ]);
</script> </script>
</body>
</html>
</body></html>

View File

@ -20,9 +20,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script> <script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script> <script src="../../iron-test-helpers/mock-interactions.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html"> <link rel="import" href="../../paper-input/paper-input.html">
<link rel="import" href="../paper-item.html"> <link rel="import" href="../paper-item.html">
<link rel="import" href="../paper-icon-item.html"> <link rel="import" href="../paper-icon-item.html">
@ -45,7 +45,139 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template> </template>
</test-fixture> </test-fixture>
<test-fixture id="item-with-input">
<template>
<div role="list">
<paper-item><input></paper-item>
</div>
</template>
</test-fixture>
<test-fixture id="item-with-paper-input">
<template>
<div role="list">
<paper-item><paper-input></paper-input></paper-item>
</div>
</template>
</test-fixture>
<test-fixture id="iconItem-with-input">
<template>
<div role="list">
<paper-icon-item><input></paper-icon-item>
</div>
</template>
</test-fixture>
<script> <script>
suite('paper-item basic', function() {
var item, clickHandler;
setup(function() {
item = fixture('item').querySelector('paper-item');
clickHandler = sinon.spy();
item.addEventListener('click', clickHandler);
});
test('space triggers a click event', function(done) {
MockInteractions.pressSpace(item);
Polymer.Base.async(function(){
// You need two ticks, one for the MockInteractions event, and one
// for the button event.
Polymer.Base.async(function(){
expect(clickHandler.callCount).to.be.equal(1);
done();
}, 1);
}, 1);
});
test('click triggers a click event', function(done) {
MockInteractions.tap(item);
Polymer.Base.async(function(){
expect(clickHandler.callCount).to.be.equal(1);
done();
}, 1);
});
});
suite('paper-icon-item basic', function() {
var item, clickHandler;
setup(function() {
item = fixture('iconItem').querySelector('paper-icon-item');
clickHandler = sinon.spy();
item.addEventListener('click', clickHandler);
});
test('space triggers a click event', function(done) {
MockInteractions.pressSpace(item);
Polymer.Base.async(function(){
// You need two ticks, one for the MockInteractions event, and one
// for the button event.
Polymer.Base.async(function(){
expect(clickHandler.callCount).to.be.equal(1);
done();
}, 1);
}, 1);
});
test('click triggers a click event', function(done) {
MockInteractions.tap(item);
Polymer.Base.async(function(){
expect(clickHandler.callCount).to.be.equal(1);
done();
}, 1);
});
});
suite('clickable element inside item', function() {
test('paper-item: space in child native input does not trigger a click event', function(done) {
var f = fixture('item-with-input');
var outerItem = f.querySelector('paper-item');
var innerInput = f.querySelector('input');
var itemClickHandler = sinon.spy();
outerItem.addEventListener('click', itemClickHandler);
innerInput.focus();
MockInteractions.pressSpace(innerInput);
Polymer.Base.async(function(){
expect(itemClickHandler.callCount).to.be.equal(0);
done();
}, 1);
});
test('paper-item: space in child paper-input does not trigger a click event', function(done) {
var f = fixture('item-with-paper-input');
var outerItem = f.querySelector('paper-item');
var innerInput = f.querySelector('paper-input');
var itemClickHandler = sinon.spy();
outerItem.addEventListener('click', itemClickHandler);
innerInput.focus();
MockInteractions.pressSpace(innerInput);
Polymer.Base.async(function(){
expect(itemClickHandler.callCount).to.be.equal(0);
done();
}, 1);
});
test('paper-icon-item: space in child input does not trigger a click event', function(done) {
var f = fixture('iconItem-with-input');
var outerItem = f.querySelector('paper-icon-item');
var innerInput = f.querySelector('input');
var itemClickHandler = sinon.spy();
outerItem.addEventListener('click', itemClickHandler);
MockInteractions.pressSpace(innerInput);
Polymer.Base.async(function(){
expect(itemClickHandler.callCount).to.be.equal(0);
done();
}, 1);
});
});
suite('item a11y tests', function() { suite('item a11y tests', function() {
var item, iconItem; var item, iconItem;

View File

@ -14298,6 +14298,25 @@ is separate from validation, and `allowed-pattern` does not affect how the input
<script>
/** @polymerBehavior Polymer.PaperItemBehavior */
Polymer.PaperItemBehaviorImpl = {
hostAttributes: {
role: 'option',
tabindex: '0'
}
};
/** @polymerBehavior */
Polymer.PaperItemBehavior = [
Polymer.IronControlState,
Polymer.IronButtonState,
Polymer.PaperItemBehaviorImpl
];
</script>
@ -20212,14 +20231,8 @@ is separate from validation, and `allowed-pattern` does not affect how the input
Polymer({ Polymer({
is: 'paper-item', is: 'paper-item',
hostAttributes: {
role: 'option',
tabindex: '0'
},
behaviors: [ behaviors: [
Polymer.IronControlState, Polymer.PaperItemBehavior
Polymer.IronButtonState
] ]
}); });
</script> </script>
@ -20239,10 +20252,12 @@ is separate from validation, and `allowed-pattern` does not affect how the input
.content-icon { .content-icon {
width: var(--paper-item-icon-width, 56px); width: var(--paper-item-icon-width, 56px);
@apply(--layout-horizontal);
@apply(--layout-center);
} }
</style> </style>
<div id="contentIcon" class="content-icon layout horizontal center"> <div id="contentIcon" class="content-icon">
<content select="[item-icon]"></content> <content select="[item-icon]"></content>
</div> </div>
<content></content> <content></content>
@ -20252,14 +20267,8 @@ is separate from validation, and `allowed-pattern` does not affect how the input
Polymer({ Polymer({
is: 'paper-icon-item', is: 'paper-icon-item',
hostAttributes: {
'role': 'option',
'tabindex': '0'
},
behaviors: [ behaviors: [
Polymer.IronControlState, Polymer.PaperItemBehavior
Polymer.IronButtonState
] ]
}); });
</script> </script>