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
697257670c
commit
02ae9ec81e
123 changed files with 13600 additions and 531 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-autogrow-textarea",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "A textarea element that automatically grows with input",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -26,6 +26,7 @@
|
|||
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
||||
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
|
||||
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -36,11 +37,11 @@
|
|||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.2",
|
||||
"_release": "1.0.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "1697690de3010aa7b4d3557e7f3fa582e82dee6a"
|
||||
"tag": "v1.0.3",
|
||||
"commit": "9eae088ce72a31b0baf44e6cdc183e5b73014af5"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-autogrow-textarea",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "A textarea element that automatically grows with input",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -26,6 +26,7 @@
|
|||
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
||||
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
|
||||
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -12,6 +12,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
||||
<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
|
||||
<link rel="import" href="../iron-validatable-behavior/iron-validatable-behavior.html">
|
||||
<link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
|
||||
|
||||
<!--
|
||||
`iron-autogrow-textarea` is an element containing a textarea that grows in height as more
|
||||
|
@ -56,6 +57,7 @@ this element's `bind-value` instead for imperative updates.
|
|||
border: none;
|
||||
resize: none;
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
/* see comments in template */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -78,7 +80,6 @@ this element's `bind-value` instead for imperative updates.
|
|||
autocomplete$="[[autocomplete]]"
|
||||
autofocus$="[[autofocus]]"
|
||||
inputmode$="[[inputmode]]"
|
||||
name$="[[name]]"
|
||||
placeholder$="[[placeholder]]"
|
||||
readonly$="[[readonly]]"
|
||||
required$="[[required]]"
|
||||
|
@ -95,6 +96,7 @@ this element's `bind-value` instead for imperative updates.
|
|||
is: 'iron-autogrow-textarea',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronFormElementBehavior,
|
||||
Polymer.IronValidatableBehavior,
|
||||
Polymer.IronControlState
|
||||
],
|
||||
|
@ -166,6 +168,15 @@ this element's `bind-value` instead for imperative updates.
|
|||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* The value for this input, same as `bindValue`
|
||||
*/
|
||||
value: {
|
||||
notify: true,
|
||||
type: String,
|
||||
computed: '_computeValue(bindValue)'
|
||||
},
|
||||
|
||||
/**
|
||||
* Bound to the textarea's `placeholder` attribute.
|
||||
*/
|
||||
|
@ -202,11 +213,36 @@ this element's `bind-value` instead for imperative updates.
|
|||
|
||||
/**
|
||||
* Returns the underlying textarea.
|
||||
* @type HTMLTextAreaElement
|
||||
*/
|
||||
get textarea() {
|
||||
return this.$.textarea;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if `value` is valid. The validator provided in `validator`
|
||||
* will be used first, if it exists; otherwise, the `textarea`'s validity
|
||||
* is used.
|
||||
* @return {boolean} True if the value is valid.
|
||||
*/
|
||||
validate: function() {
|
||||
// Empty, non-required input is valid.
|
||||
if (!this.required && this.value == '') {
|
||||
this.invalid = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
var valid;
|
||||
if (this.hasValidator()) {
|
||||
valid = Polymer.IronValidatableBehavior.validate.call(this, this.value);
|
||||
} else {
|
||||
valid = this.$.textarea.validity.valid;
|
||||
this.invalid = !valid;
|
||||
}
|
||||
this.fire('iron-input-validate');
|
||||
return valid;
|
||||
},
|
||||
|
||||
_update: function() {
|
||||
this.$.mirror.innerHTML = this._valueForMirror();
|
||||
|
||||
|
@ -261,6 +297,10 @@ this element's `bind-value` instead for imperative updates.
|
|||
|
||||
_updateCached: function() {
|
||||
this.$.mirror.innerHTML = this._constrain(this.tokens);
|
||||
},
|
||||
|
||||
_computeValue: function() {
|
||||
return this.bindValue;
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -120,6 +120,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
});
|
||||
|
||||
suite('validation', function() {
|
||||
test('a required textarea with no text is invalid', function() {
|
||||
var input = fixture('basic');
|
||||
input.required = true;
|
||||
assert.isFalse(input.validate());
|
||||
|
||||
input.bindValue = 'batman';
|
||||
assert.isTrue(input.validate());
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue