update components

This commit is contained in:
Luke Pulverenti 2015-08-22 11:54:29 -04:00
parent c3069b933f
commit bc4468cb40
56 changed files with 290 additions and 145 deletions

View file

@ -6848,8 +6848,13 @@ this.fire('dom-change');
},
_focusBlurHandler: function(event) {
var target = event.path ? event.path[0] : event.target;
if (target === this) {
// NOTE(cdata): if we are in ShadowDOM land, `event.target` will
// eventually become `this` due to retargeting; if we are not in
// ShadowDOM land, `event.target` will eventually become `this` due
// to the second conditional which fires a synthetic event (that is also
// handled). In either case, we can disregard `event.path`.
if (event.target === this) {
var focused = event.type === 'focus';
this._setFocused(focused);
} else if (!this.shadowRoot) {
@ -12548,10 +12553,20 @@ is separate from validation, and `allowed-pattern` does not affect how the input
/**
* Validates the input element and sets an error style if needed.
*
* @return {boolean}
*/
validate: function() {
return this.inputElement.validate();
},
validate: function() {
return this.inputElement.validate();
},
/**
* If `autoValidate` is true, then validates the element.
*/
_handleAutoValidate: function() {
if (this.autoValidate)
this.validate();
},
/**
* Restores the cursor to its original position after updating the value.
@ -16687,7 +16702,8 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
focused: {
readOnly: true,
type: Boolean,
value: false
value: false,
notify: true
},
_addons: {
@ -16754,6 +16770,10 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
return Polymer.dom(this).querySelector(this._inputSelector);
},
get _inputElementValue() {
return this._inputElement[this._propertyForValue] || this._inputElement.value;
},
ready: function() {
if (!this._addons) {
this._addons = [];
@ -16768,7 +16788,12 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
},
attached: function() {
this._handleValue(this._inputElement);
// Only validate when attached if the input already has a value.
if (this._inputElementValue != '') {
this._handleValueAndAutoValidate(this._inputElement);
} else {
this._handleValue(this._inputElement);
}
},
_onAddonAttached: function(event) {
@ -16790,28 +16815,19 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
_onBlur: function() {
this._setFocused(false);
this._handleValueAndAutoValidate(this._inputElement);
},
_onInput: function(event) {
this._handleValue(event.target);
this._handleValueAndAutoValidate(event.target);
},
_onValueChanged: function(event) {
this._handleValue(event.target);
this._handleValueAndAutoValidate(event.target);
},
_handleValue: function(inputElement) {
var value = inputElement[this._propertyForValue] || inputElement.value;
if (this.autoValidate) {
var valid;
if (inputElement.validate) {
valid = inputElement.validate(value);
} else {
valid = inputElement.checkValidity();
}
this.invalid = !valid;
}
var value = this._inputElementValue;
// type="number" hack needed because this.value is empty until it's valid
if (value || value === 0 || (inputElement.type === 'number' && !inputElement.checkValidity())) {
@ -16827,6 +16843,21 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
});
},
_handleValueAndAutoValidate: function(inputElement) {
if (this.autoValidate) {
var valid;
if (inputElement.validate) {
valid = inputElement.validate(this._inputElementValue);
} else {
valid = inputElement.checkValidity();
}
this.invalid = !valid;
}
// Call this last to notify the add-ons.
this._handleValue(inputElement);
},
_onIronInputValidate: function(event) {
this.invalid = this._inputElement.invalid;
},
@ -18123,6 +18154,11 @@ paper-ripple {
</script>
<dom-module id="paper-textarea" assetpath="bower_components/paper-input/">
<template>
<style>
:host {
display: block;
}
</style>
<paper-input-container no-label-float$="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
@ -18686,7 +18722,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<g id="navigate-next"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g>
<g id="grid-on"><path d="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"></path></g>
<g id="slideshow"><path d="M10 8v8l5-4-5-4zm9-5H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"></path></g>
<g id="movie"><path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z"></path></g>
<g id="new-releases"><path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"></path></g>
<g id="photo"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"></path></g>
<g id="photo-album"><path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4zm0 15l3-3.86 2.14 2.58 3-3.86L18 19H6z"></path></g>