mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
c3069b933f
commit
bc4468cb40
56 changed files with 290 additions and 145 deletions
|
@ -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"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
@ -28,11 +28,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
||||
"_release": "1.0.7",
|
||||
"_release": "1.0.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.7",
|
||||
"commit": "033889b20c6b9ebb45a1ff153fbd667e153fe3f7"
|
||||
"tag": "v1.0.8",
|
||||
"commit": "663ad706b43989f4961d945b8116cf4db346532f"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
|
|
@ -65,8 +65,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
_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) {
|
||||
|
|
|
@ -96,9 +96,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
focusable.addEventListener('focus', function() {
|
||||
nFocusEvents += 1;
|
||||
expect(focusable.focused).to.be.equal(true);
|
||||
MockInteractions.blur(focusable.$.input);
|
||||
});
|
||||
focusable.addEventListener('blur', function() {
|
||||
expect(focusable.focused).to.be.equal(false);
|
||||
nBlurEvents += 1;
|
||||
});
|
||||
|
||||
|
|
|
@ -34,14 +34,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-overlay-behavior",
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "f03cea265587c724cf3a85aef76b2ab7ccfd2b94"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-overlay-behavior.git",
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-overlay-behavior"
|
||||
"_originalSource": "polymerelements/iron-overlay-behavior"
|
||||
}
|
|
@ -42,7 +42,7 @@
|
|||
"tag": "v1.0.3",
|
||||
"commit": "90b54de14264c19693601b9fc16af6b68a9d48e4"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/paper-behaviors.git",
|
||||
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/paper-behaviors"
|
||||
"_originalSource": "PolymerElements/paper-behaviors"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-input",
|
||||
"version": "1.0.11",
|
||||
"version": "1.0.12",
|
||||
"description": "Material design text fields",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -44,11 +44,11 @@
|
|||
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
|
||||
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
|
||||
},
|
||||
"_release": "1.0.11",
|
||||
"_release": "1.0.12",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.11",
|
||||
"commit": "a7af749e55fff7599d2ad9da47c86b286e9e2d6f"
|
||||
"tag": "v1.0.12",
|
||||
"commit": "bcfc2998c1e83d0c2ad7206e84717ae98145c45a"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/paper-input.git",
|
||||
"_target": "^1.0.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-input",
|
||||
"version": "1.0.11",
|
||||
"version": "1.0.12",
|
||||
"description": "Material design text fields",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
|
|
@ -73,6 +73,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<h4>Validation</h4>
|
||||
<div class="vertical-section">
|
||||
<paper-input label="input validates on blur (required, auto-validate)" required auto-validate error-message="needs some text!"></paper-input>
|
||||
|
||||
<paper-input label="only type letters (auto-validate)" auto-validate pattern="[a-zA-Z]*" error-message="letters only!"></paper-input>
|
||||
|
||||
<paper-input id="inputForValidation" required label="only type letters (no auto validate)" pattern="[a-zA-Z]*" error-message="letters only, required input!"></paper-input>
|
||||
|
|
|
@ -321,10 +321,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
/**
|
||||
* 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.
|
||||
|
|
|
@ -350,7 +350,8 @@ This element is `display:block` by default, but you can set the `inline` attribu
|
|||
focused: {
|
||||
readOnly: true,
|
||||
type: Boolean,
|
||||
value: false
|
||||
value: false,
|
||||
notify: true
|
||||
},
|
||||
|
||||
_addons: {
|
||||
|
@ -417,6 +418,10 @@ This element is `display:block` by default, but you can set the `inline` attribu
|
|||
return Polymer.dom(this).querySelector(this._inputSelector);
|
||||
},
|
||||
|
||||
get _inputElementValue() {
|
||||
return this._inputElement[this._propertyForValue] || this._inputElement.value;
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
if (!this._addons) {
|
||||
this._addons = [];
|
||||
|
@ -431,7 +436,12 @@ This element is `display:block` by default, but you can set the `inline` attribu
|
|||
},
|
||||
|
||||
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) {
|
||||
|
@ -453,28 +463,19 @@ This element is `display:block` by default, but you can set the `inline` attribu
|
|||
|
||||
_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())) {
|
||||
|
@ -490,6 +491,21 @@ This element is `display:block` by default, but you can set the `inline` attribu
|
|||
});
|
||||
},
|
||||
|
||||
_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;
|
||||
},
|
||||
|
|
|
@ -33,6 +33,11 @@ style this element.
|
|||
|
||||
<dom-module id="paper-textarea">
|
||||
<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]]">
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue