update polymer components

This commit is contained in:
Luke Pulverenti 2015-09-04 00:33:31 -04:00
parent 478617f766
commit c7fa2299da
31 changed files with 813 additions and 1954 deletions

View File

@ -29,14 +29,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "v1.0.5",
"commit": "cf833eab5c55a26c5aa92e56d3fcb079120ce66a"
},
"_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git",
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-a11y-keys-behavior"
"_originalSource": "PolymerElements/iron-a11y-keys-behavior"
}

View File

@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
"version": "1.0.4",
"version": "1.0.5",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
@ -37,11 +37,11 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.4",
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "v1.0.4",
"commit": "0501594add2228c34b39b9fa898d177f7f8e1adb"
"tag": "v1.0.5",
"commit": "2f354b99a4fda5d601629b0119d0a6c9dd77d336"
},
"_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
"_target": "^1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
"version": "1.0.4",
"version": "1.0.5",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"

View File

@ -242,17 +242,6 @@ this element's `bind-value` instead for imperative updates.
return valid;
},
_update: function() {
this.$.mirror.innerHTML = this._valueForMirror();
var textarea = this.textarea;
// If the value of the textarea was updated imperatively, then we
// need to manually update bindValue as well.
if (textarea && this.bindValue != textarea.value) {
this.bindValue = textarea.value;
}
},
_bindValueChanged: function() {
var textarea = this.textarea;
if (!textarea) {
@ -260,14 +249,13 @@ this element's `bind-value` instead for imperative updates.
}
textarea.value = this.bindValue;
this._update();
this.$.mirror.innerHTML = this._valueForMirror();
// manually notify because we don't want to notify until after setting value
this.fire('bind-value-changed', {value: this.bindValue});
},
_onInput: function(event) {
this.bindValue = event.path ? event.path[0].value : event.target.value;
this._update();
},
_constrain: function(tokens) {

View File

@ -27,14 +27,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-behaviors",
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "663ad706b43989f4961d945b8116cf4db346532f"
},
"_source": "git://github.com/polymerelements/iron-behaviors.git",
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-behaviors"
"_originalSource": "PolymerElements/iron-behaviors"
}

View File

@ -23,14 +23,14 @@
"paper-styles": "polymerelements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-flex-layout",
"homepage": "https://github.com/PolymerElements/iron-flex-layout",
"_release": "1.0.3",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "e6c2cfec18354973ac03e70dcd8afcc3c72d09b9"
},
"_source": "git://github.com/polymerelements/iron-flex-layout.git",
"_source": "git://github.com/PolymerElements/iron-flex-layout.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-flex-layout"
"_originalSource": "PolymerElements/iron-flex-layout"
}

View File

@ -1,6 +1,6 @@
{
"name": "paper-button",
"version": "1.0.3",
"version": "1.0.4",
"description": "Material design button",
"authors": [
"The Polymer Authors"
@ -21,26 +21,26 @@
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-button",
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
"paper-ripple": "polymerelements/paper-ripple#^1.0.0",
"paper-material": "polymerelements/paper-material#^1.0.0",
"paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
"paper-behaviors": "polymerelements/paper-behaviors#^1.0.0"
},
"devDependencies": {
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"iron-icons": "polymerelements/iron-icons#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-styles": "polymerelements/paper-styles#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
"paper-styles": "polymerelements/paper-styles#^1.0.0"
},
"_release": "1.0.3",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "f50a40fa1bf3ab20aaad413769452ed69b14ef66"
"tag": "v1.0.4",
"commit": "402fffc8bad25ea7c3135f2e5997ad00765a2d61"
},
"_source": "git://github.com/PolymerElements/paper-button.git",
"_target": "~1.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "paper-button",
"version": "1.0.3",
"version": "1.0.4",
"description": "Material design button",
"authors": [
"The Polymer Authors"
@ -21,19 +21,19 @@
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-button",
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
"paper-ripple": "polymerelements/paper-ripple#^1.0.0",
"paper-material": "polymerelements/paper-material#^1.0.0",
"paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
"paper-behaviors": "polymerelements/paper-behaviors#^1.0.0"
},
"devDependencies": {
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"iron-icons": "polymerelements/iron-icons#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-styles": "polymerelements/paper-styles#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
"paper-styles": "polymerelements/paper-styles#^1.0.0"
}
}

View File

@ -72,63 +72,61 @@ Custom property | Description | Default
-->
<dom-module id="paper-button">
<style>
:host {
display: inline-block;
position: relative;
box-sizing: border-box;
min-width: 5.14em;
margin: 0 0.29em;
background: transparent;
text-align: center;
font: inherit;
text-transform: uppercase;
outline: none;
border-radius: 3px;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: pointer;
z-index: 0;
@apply(--paper-button);
}
.keyboard-focus {
font-weight: bold;
}
:host([disabled]) {
background: #eaeaea;
color: #a8a8a8;
cursor: auto;
pointer-events: none;
@apply(--paper-button-disabled);
}
:host([noink]) paper-ripple {
display: none;
}
paper-material {
border-radius: inherit;
}
.content > ::content * {
text-transform: inherit;
}
.content {
padding: 0.7em 0.57em
}
</style>
<template>
<style>
:host {
display: inline-block;
position: relative;
box-sizing: border-box;
min-width: 5.14em;
margin: 0 0.29em;
background: transparent;
text-align: center;
font: inherit;
text-transform: uppercase;
outline-width: 0;
border-radius: 3px;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: pointer;
z-index: 0;
@apply(--paper-button);
}
.keyboard-focus {
font-weight: bold;
}
:host([disabled]) {
background: #eaeaea;
color: #a8a8a8;
cursor: auto;
pointer-events: none;
@apply(--paper-button-disabled);
}
:host([noink]) paper-ripple {
display: none;
}
paper-material {
border-radius: inherit;
}
.content > ::content * {
text-transform: inherit;
}
.content {
padding: 0.7em 0.57em
}
</style>
<paper-ripple></paper-ripple>
<paper-material class$="[[_computeContentClass(receivedFocusFromKeyboard)]]" elevation="[[_elevation]]" animated>
@ -136,13 +134,10 @@ Custom property | Description | Default
</paper-material>
</template>
</dom-module>
<script>
Polymer({
is: 'paper-button',
behaviors: [
@ -150,7 +145,6 @@ Custom property | Description | Default
],
properties: {
/**
* If true, the button should be styled with a shadow.
*/
@ -178,5 +172,4 @@ Custom property | Description | Default
return className;
}
});
</script>

View File

@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
"version": "1.0.9",
"version": "1.0.10",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"
@ -35,11 +35,11 @@
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
},
"_release": "1.0.9",
"_release": "1.0.10",
"_resolution": {
"type": "version",
"tag": "v1.0.9",
"commit": "e0568e5ad76dc8a4f73968e5cbe5270cba548f9e"
"tag": "v1.0.10",
"commit": "ce4a8e8663892e95fccc0142055db214fa292d6d"
},
"_source": "git://github.com/PolymerElements/paper-checkbox.git",
"_target": "~1.0.5",

View File

@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
"version": "1.0.9",
"version": "1.0.10",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"

View File

@ -205,7 +205,7 @@ Custom property | Description | Default
</div>
</div>
<div id="checkboxLabel" aria-hidden="true"><content></content></div>
<div id="checkboxLabel"><content></content></div>
</template>
<script>

View File

@ -134,6 +134,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var c = fixture('AriaLabel');
assert.isTrue(c.getAttribute('aria-label') == "Batman");
});
a11ySuite('NoLabel');
a11ySuite('WithLabel');
a11ySuite('AriaLabel');
});
</script>
</body>

View File

@ -1,6 +1,6 @@
{
"name": "paper-fab",
"version": "1.0.3",
"version": "1.0.4",
"description": "A material design floating action button",
"authors": [
"The Polymer Authors"
@ -36,11 +36,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.3",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "0371767ba859a842ffd07dfbdf574206c1d7294f"
"tag": "v1.0.4",
"commit": "7eddddad90a5ca962209fa7241435459ebb9b6b7"
},
"_source": "git://github.com/PolymerElements/paper-fab.git",
"_target": "~1.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "paper-fab",
"version": "1.0.3",
"version": "1.0.4",
"description": "A material design floating action button",
"authors": [
"The Polymer Authors"

View File

@ -65,6 +65,7 @@ Custom property | Description | Default
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
user-select: none;
cursor: pointer;
@ -159,7 +160,8 @@ Custom property | Description | Default
*/
mini: {
type: Boolean,
value: false
value: false,
reflectToAttribute: true
}
},

View File

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.0.12",
"version": "1.0.13",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -27,7 +27,7 @@
"homepage": "https://github.com/PolymerElements/paper-input",
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"polymer": "Polymer/polymer#^1.1.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
@ -35,20 +35,20 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
},
"_release": "1.0.12",
"_release": "1.0.13",
"_resolution": {
"type": "version",
"tag": "v1.0.12",
"commit": "bcfc2998c1e83d0c2ad7206e84717ae98145c45a"
"tag": "v1.0.13",
"commit": "3f3d09f47b77e33ea4a0c531a1b95567563528a0"
},
"_source": "git://github.com/polymerelements/paper-input.git",
"_target": "^1.0.9",

View File

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.0.12",
"version": "1.0.13",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -27,7 +27,7 @@
"homepage": "https://github.com/PolymerElements/paper-input",
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"polymer": "Polymer/polymer#^1.1.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
@ -35,13 +35,13 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
}
}

View File

@ -92,7 +92,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<paper-textarea label="textarea with maxlength" char-counter maxlength="10"></paper-textarea>
<paper-textarea label="text area with rows and max-rows" rows="3" max-rows="4"><paper-textarea>
<paper-textarea label="text area with rows and max-rows" rows="3" max-rows="4"></paper-textarea>
</div>
<h4>Prefixes and Suffixes</h4>

View File

@ -12,26 +12,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="ssn-validator.html">
<dom-module id="ssn-input">
<style>
:host {
display: inline-block;
}
input[is="iron-input"] {
font: inherit;
outline: none;
box-shadow: none;
border: none;
width: auto;
text-align: center;
}
</style>
<template>
<style>
:host {
display: inline-block;
}
input[is="iron-input"] {
font: inherit;
outline: none;
box-shadow: none;
border: none;
width: auto;
text-align: center;
}
</style>
<ssn-validator></ssn-validator>
<input is="iron-input" maxlength="3" bind-value="{{_ssn1}}" size="3" aria-label="First 3 digits of social security number">
@ -41,14 +38,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<input is="iron-input" maxlength="4" bind-value="{{_ssn3}}" size="4" aria-label="Last 4 digits of social security number">
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'ssn-input',
behaviors: [
@ -56,7 +49,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
],
properties: {
value: {
notify: true,
type: String
@ -78,7 +70,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: String,
value: 'ssn-validator'
}
},
observers: [
@ -88,7 +79,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
_computeValue: function(ssn1, ssn2, ssn3) {
this.value = ssn1.trim() + '-' + ssn2.trim() + '-' + ssn3.trim();
}
})
})();
});
</script>

View File

@ -12,9 +12,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../../iron-validator-behavior/iron-validator-behavior.html">
<script>
Polymer({
is: 'ssn-validator',
behaviors: [
@ -25,7 +23,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// this regex validates incomplete ssn's (by design)
return !value || value.match(/^[0-9]{0,3}-[0-9]{0,2}-[0-9]{0,4}$/);
}
});
</script>

View File

@ -57,7 +57,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*/
invalid: {
type: Boolean,
value: false
value: false,
notify: true
},
/**

View File

@ -30,33 +30,25 @@ Custom property | Description | Default
`--paper-input-char-counter` | Mixin applied to the element | `{}`
-->
<dom-module id="paper-input-char-counter">
<style>
:host {
display: inline-block;
float: right;
@apply(--paper-font-caption);
@apply(--paper-input-char-counter);
}
</style>
<template>
<style>
:host {
display: inline-block;
float: right;
@apply(--paper-font-caption);
@apply(--paper-input-char-counter);
}
</style>
<span>[[_charCounterStr]]</span>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-input-char-counter',
behaviors: [
@ -64,12 +56,10 @@ Custom property | Description | Default
],
properties: {
_charCounterStr: {
type: String,
value: '0'
}
},
update: function(state) {
@ -87,9 +77,5 @@ Custom property | Description | Default
}
this._charCounterStr = str;
}
});
})();
</script>

View File

@ -89,184 +89,181 @@ This element is `display:block` by default, but you can set the `inline` attribu
`display:inline-block`.
-->
<dom-module id="paper-input-container">
<style>
:host {
display: block;
padding: 8px 0;
@apply(--paper-input-container);
}
:host[inline] {
display: inline-block;
}
:host([disabled]) {
pointer-events: none;
opacity: 0.33;
@apply(--paper-input-container-disabled);
}
.floated-label-placeholder {
@apply(--paper-font-caption);
}
.underline {
position: relative;
}
.focused-line {
height: 2px;
-webkit-transform-origin: center center;
transform-origin: center center;
-webkit-transform: scale3d(0,1,1);
transform: scale3d(0,1,1);
background: var(--paper-input-container-focus-color, --default-primary-color);
@apply(--paper-input-container-underline-focus);
}
.underline.is-highlighted .focused-line {
-webkit-transform: none;
transform: none;
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
@apply(--paper-transition-easing);
}
.underline.is-invalid .focused-line {
background: var(--paper-input-container-invalid-color, --google-red-500);
-webkit-transform: none;
transform: none;
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
@apply(--paper-transition-easing);
}
.unfocused-line {
height: 1px;
background: var(--paper-input-container-color, --secondary-text-color);
@apply(--paper-input-container-underline);
}
:host([disabled]) .unfocused-line {
border-bottom: 1px dashed;
border-color: var(--paper-input-container-color, --secondary-text-color);
background: transparent;
@apply(--paper-input-container-underline-disabled);
}
.label-and-input-container {
@apply(--layout-flex);
@apply(--layout-relative);
}
.input-content {
position: relative;
@apply(--layout-horizontal);
@apply(--layout-end);
}
.input-content ::content label,
.input-content ::content .paper-input-label {
position: absolute;
top: 0;
right: 0;
left: 0;
font: inherit;
color: var(--paper-input-container-color, --secondary-text-color);
@apply(--paper-font-subhead);
@apply(--paper-input-container-label);
}
.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-origin: left top;
transform-origin: left top;
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
@apply(--paper-transition-easing);
}
.input-content.label-is-highlighted ::content label,
.input-content.label-is-highlighted ::content .paper-input-label {
color: var(--paper-input-container-focus-color, --default-primary-color);
@apply(--paper-input-container-label-focus);
}
.input-content.is-invalid ::content label,
.input-content.is-invalid ::content .paper-input-label {
color: var(--paper-input-container-invalid-color, --google-red-500);
}
.input-content.label-is-hidden ::content label,
.input-content.label-is-hidden ::content .paper-input-label {
visibility: hidden;
}
.input-content ::content input,
.input-content ::content textarea,
.input-content ::content iron-autogrow-textarea,
.input-content ::content .paper-input-input {
position: relative; /* to make a stacking context */
outline: none;
box-shadow: none;
padding: 0;
width: 100%;
background: transparent;
border: none;
color: var(--paper-input-container-input-color, --primary-text-color);
@apply(--paper-font-subhead);
@apply(--paper-input-container-input);
}
::content [prefix] {
@apply(--paper-font-subhead);
@apply(--paper-input-prefix);
}
::content [suffix] {
@apply(--paper-font-subhead);
@apply(--paper-input-suffix);
}
/* Firefox sets a min-width on the input, which can cause layout issues */
.input-content ::content input {
min-width: 0;
}
.input-content ::content textarea {
resize: none;
}
.add-on-content.is-invalid ::content * {
color: var(--paper-input-container-invalid-color, --google-red-500);
}
.add-on-content.is-highlighted ::content * {
color: var(--paper-input-container-focus-color, --default-primary-color);
}
</style>
<template>
<style>
:host {
display: block;
padding: 8px 0;
@apply(--paper-input-container);
}
:host[inline] {
display: inline-block;
}
:host([disabled]) {
pointer-events: none;
opacity: 0.33;
@apply(--paper-input-container-disabled);
}
.floated-label-placeholder {
@apply(--paper-font-caption);
}
.underline {
position: relative;
}
.focused-line {
height: 2px;
-webkit-transform-origin: center center;
transform-origin: center center;
-webkit-transform: scale3d(0,1,1);
transform: scale3d(0,1,1);
background: var(--paper-input-container-focus-color, --default-primary-color);
@apply(--paper-input-container-underline-focus);
}
.underline.is-highlighted .focused-line {
-webkit-transform: none;
transform: none;
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
@apply(--paper-transition-easing);
}
.underline.is-invalid .focused-line {
background: var(--paper-input-container-invalid-color, --google-red-500);
-webkit-transform: none;
transform: none;
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
@apply(--paper-transition-easing);
}
.unfocused-line {
height: 1px;
background: var(--paper-input-container-color, --secondary-text-color);
@apply(--paper-input-container-underline);
}
:host([disabled]) .unfocused-line {
border-bottom: 1px dashed;
border-color: var(--paper-input-container-color, --secondary-text-color);
background: transparent;
@apply(--paper-input-container-underline-disabled);
}
.label-and-input-container {
@apply(--layout-flex);
@apply(--layout-relative);
}
.input-content {
position: relative;
@apply(--layout-horizontal);
@apply(--layout-end);
}
.input-content ::content label,
.input-content ::content .paper-input-label {
position: absolute;
top: 0;
right: 0;
left: 0;
font: inherit;
color: var(--paper-input-container-color, --secondary-text-color);
@apply(--paper-font-subhead);
@apply(--paper-input-container-label);
}
.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-origin: left top;
transform-origin: left top;
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
@apply(--paper-transition-easing);
}
.input-content.label-is-highlighted ::content label,
.input-content.label-is-highlighted ::content .paper-input-label {
color: var(--paper-input-container-focus-color, --default-primary-color);
@apply(--paper-input-container-label-focus);
}
.input-content.is-invalid ::content label,
.input-content.is-invalid ::content .paper-input-label {
color: var(--paper-input-container-invalid-color, --google-red-500);
}
.input-content.label-is-hidden ::content label,
.input-content.label-is-hidden ::content .paper-input-label {
visibility: hidden;
}
.input-content ::content input,
.input-content ::content textarea,
.input-content ::content iron-autogrow-textarea,
.input-content ::content .paper-input-input {
position: relative; /* to make a stacking context */
outline: none;
box-shadow: none;
padding: 0;
width: 100%;
background: transparent;
border: none;
color: var(--paper-input-container-input-color, --primary-text-color);
@apply(--paper-font-subhead);
@apply(--paper-input-container-input);
}
::content [prefix] {
@apply(--paper-font-subhead);
@apply(--paper-input-prefix);
}
::content [suffix] {
@apply(--paper-font-subhead);
@apply(--paper-input-suffix);
}
/* Firefox sets a min-width on the input, which can cause layout issues */
.input-content ::content input {
min-width: 0;
}
.input-content ::content textarea {
resize: none;
}
.add-on-content.is-invalid ::content * {
color: var(--paper-input-container-invalid-color, --google-red-500);
}
.add-on-content.is-highlighted ::content * {
color: var(--paper-input-container-focus-color, --default-primary-color);
}
</style>
<template is="dom-if" if="[[!noLabelFloat]]">
<div class="floated-label-placeholder">&nbsp;</div>
</template>
@ -289,18 +286,13 @@ This element is `display:block` by default, but you can set the `inline` attribu
</div>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-input-container',
properties: {
/**
* Set to true to disable the floating label. The label disappears when the input value is
* not null.
@ -398,7 +390,6 @@ This element is `display:block` by default, but you can set the `inline` attribu
return this._onValueChanged.bind(this);
}
}
},
listeners: {
@ -577,8 +568,5 @@ This element is `display:block` by default, but you can set the `inline` attribu
}
return cls;
}
});
})();
</script>

View File

@ -31,40 +31,32 @@ Custom property | Description | Default
`--paper-input-error` | Mixin applied to the error | `{}`
-->
<dom-module id="paper-input-error">
<style>
: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);
}
:host([invalid]) {
visibility: visible;
};
</style>
<template>
<style>
: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);
}
:host([invalid]) {
visibility: visible;
};
</style>
<content></content>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-input-error',
behaviors: [
@ -72,7 +64,6 @@ Custom property | Description | Default
],
properties: {
/**
* True if the error is showing.
*/
@ -81,15 +72,10 @@ Custom property | Description | Default
reflectToAttribute: true,
type: Boolean
}
},
update: function(state) {
this._setInvalid(state.invalid);
}
})
})();
});
</script>

View File

@ -49,33 +49,30 @@ style this element.
-->
<dom-module id="paper-input">
<style>
:host {
display: block;
}
input::-webkit-input-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
input:-moz-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
input::-moz-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
input:-ms-input-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
</style>
<template>
<style>
:host {
display: block;
}
input::-webkit-input-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
input:-moz-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
input::-moz-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
input:-ms-input-placeholder {
color: var(--paper-input-container-color, --secondary-text-color);
}
</style>
<paper-input-container no-label-float="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
<content select="[prefix]"></content>
@ -123,15 +120,10 @@ style this element.
</paper-input-container>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-input',
behaviors: [
@ -139,9 +131,5 @@ style this element.
Polymer.PaperInputBehavior,
Polymer.IronControlState
]
})
})();
});
</script>

View File

@ -34,9 +34,9 @@ style this element.
<dom-module id="paper-textarea">
<template>
<style>
:host {
display: block;
}
:host {
display: block;
}
</style>
<paper-input-container no-label-float$="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
@ -68,15 +68,10 @@ style this element.
</paper-input-container>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-textarea',
behaviors: [
@ -84,7 +79,6 @@ style this element.
],
properties: {
_ariaLabelledBy: {
observer: '_ariaLabelledByChanged',
type: String
@ -118,8 +112,7 @@ style this element.
maxRows: {
type: Number,
value: 0
},
}
},
_ariaLabelledByChanged: function(ariaLabelledBy) {
@ -129,9 +122,5 @@ style this element.
_ariaDescribedByChanged: function(ariaDescribedBy) {
this.$.input.textarea.setAttribute('aria-describedby', ariaDescribedBy);
}
});
})();
</script>

View File

@ -1,6 +1,6 @@
{
"name": "paper-ripple",
"version": "1.0.1",
"version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Adds a material design ripple to any container",
"private": true,
@ -12,9 +12,13 @@
"polymer",
"ripple"
],
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/paper-ripple.git"
},
"main": "paper-ripple.html",
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"polymer": "Polymer/polymer#^1.1.0",
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
@ -26,14 +30,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-ripple",
"_release": "1.0.1",
"homepage": "https://github.com/polymerelements/paper-ripple",
"_release": "1.0.2",
"_resolution": {
"type": "version",
"tag": "v1.0.1",
"commit": "af19d904802437c305390bb03415c11661de3d0a"
"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"
}

View File

@ -1,6 +1,6 @@
{
"name": "paper-ripple",
"version": "1.0.1",
"version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Adds a material design ripple to any container",
"private": true,
@ -12,9 +12,13 @@
"polymer",
"ripple"
],
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/paper-ripple.git"
},
"main": "paper-ripple.html",
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"polymer": "Polymer/polymer#^1.1.0",
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {

View File

@ -76,73 +76,73 @@ Apply `circle` class to make the rippling effect within a circle.
@param {Object} detail
@param {Object} detail.node The animated node
-->
<style>
:host {
display: block;
position: absolute;
border-radius: inherit;
overflow: hidden;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
:host([animating]) {
/* This resolves a rendering issue in Chrome (as of 40) where the
ripple is not properly clipped by its parent (which may have
rounded corners). See: http://jsbin.com/temexa/4
Note: We only apply this style conditionally. Otherwise, the browser
will create a new compositing layer for every ripple element on the
page, and that would be bad. */
-webkit-transform: translate(0, 0);
transform: translate3d(0, 0, 0);
}
:host([noink]) {
pointer-events: none;
}
#background,
#waves,
.wave-container,
.wave {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#background,
.wave {
opacity: 0;
}
#waves,
.wave {
overflow: hidden;
}
.wave-container,
.wave {
border-radius: 50%;
}
:host(.circle) #background,
:host(.circle) #waves {
border-radius: 50%;
}
:host(.circle) .wave-container {
overflow: hidden;
}
</style>
<template>
<style>
:host {
display: block;
position: absolute;
border-radius: inherit;
overflow: hidden;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
:host([animating]) {
/* This resolves a rendering issue in Chrome (as of 40) where the
ripple is not properly clipped by its parent (which may have
rounded corners). See: http://jsbin.com/temexa/4
Note: We only apply this style conditionally. Otherwise, the browser
will create a new compositing layer for every ripple element on the
page, and that would be bad. */
-webkit-transform: translate(0, 0);
transform: translate3d(0, 0, 0);
}
:host([noink]) {
pointer-events: none;
}
#background,
#waves,
.wave-container,
.wave {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#background,
.wave {
opacity: 0;
}
#waves,
.wave {
overflow: hidden;
}
.wave-container,
.wave {
border-radius: 50%;
}
:host(.circle) #background,
:host(.circle) #waves {
border-radius: 50%;
}
:host(.circle) .wave-container {
overflow: hidden;
}
</style>
<div id="background"></div>
<div id="waves"></div>
</template>
@ -150,20 +150,6 @@ Apply `circle` class to make the rippling effect within a circle.
<script>
(function() {
var Utility = {
cssColorWithAlpha: function(cssColor, alpha) {
var parts = cssColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
if (typeof alpha == 'undefined') {
alpha = 1;
}
if (!parts) {
return 'rgba(255, 255, 255, ' + alpha + ')';
}
return 'rgba(' + parts[1] + ', ' + parts[2] + ', ' + parts[3] + ', ' + alpha + ')';
},
distance: function(x1, y1, x2, y2) {
var xDelta = (x1 - x2);
var yDelta = (y1 - y2);
@ -171,13 +157,8 @@ Apply `circle` class to make the rippling effect within a circle.
return Math.sqrt(xDelta * xDelta + yDelta * yDelta);
},
now: (function() {
if (window.performance && window.performance.now) {
return window.performance.now.bind(window.performance);
}
return Date.now;
})()
now: window.performance && window.performance.now ?
window.performance.now.bind(window.performance) : Date.now
};
/**

File diff suppressed because it is too large Load Diff