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
411b85f351
commit
709f0726da
8 changed files with 108 additions and 58 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-input",
|
||||
"version": "1.1.9",
|
||||
"version": "1.1.10",
|
||||
"description": "Material design text fields",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -39,6 +39,7 @@
|
|||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^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",
|
||||
|
@ -47,11 +48,11 @@
|
|||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.1.9",
|
||||
"_release": "1.1.10",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.9",
|
||||
"commit": "4cb91098977573135b74121d6f4a2a301f44ce93"
|
||||
"tag": "v1.1.10",
|
||||
"commit": "d8e201099b4b2987bea1dbcf5804c0383544bbfd"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/paper-input.git",
|
||||
"_target": "^1.0.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-input",
|
||||
"version": "1.1.9",
|
||||
"version": "1.1.10",
|
||||
"description": "Material design text fields",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -39,6 +39,7 @@
|
|||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^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",
|
||||
|
|
|
@ -9,6 +9,7 @@ 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="../../iron-input/iron-input.html">
|
||||
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
|
||||
<link rel="import" href="ssn-validator.html">
|
||||
|
||||
<dom-module id="ssn-input">
|
||||
|
@ -27,15 +28,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
width: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
@apply(--layout-horizontal);
|
||||
}
|
||||
</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">
|
||||
-
|
||||
<input is="iron-input" maxlength="2" bind-value="{{_ssn2}}" size="2" aria-label="Middle 2 digits of social security number">
|
||||
-
|
||||
<input is="iron-input" maxlength="4" bind-value="{{_ssn3}}" size="4" aria-label="Last 4 digits of social security number">
|
||||
<div class="container">
|
||||
|
||||
<input is="iron-input" maxlength="3" bind-value="{{_ssn1}}" size="3" aria-label="First 3 digits of social security number">
|
||||
-
|
||||
<input is="iron-input" maxlength="2" bind-value="{{_ssn2}}" size="2" aria-label="Middle 2 digits of social security number">
|
||||
-
|
||||
<input is="iron-input" maxlength="4" bind-value="{{_ssn3}}" size="4" aria-label="Last 4 digits of social security number">
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</dom-module>
|
||||
|
|
|
@ -25,6 +25,9 @@ For example:
|
|||
<input is="iron-input">
|
||||
</paper-input-container>
|
||||
|
||||
Do not wrap <paper-input-contanter> around elements that already include it, such as <paper-input>.
|
||||
Doing so may cause events to bounce infintely between the container and its contained element.
|
||||
|
||||
### Listening for input changes
|
||||
|
||||
By default, it listens for changes on the `bind-value` attribute on its children nodes and perform
|
||||
|
@ -43,6 +46,11 @@ compound input field like a social security number input. The custom input eleme
|
|||
<ssn-input class="paper-input-input"></ssn-input>
|
||||
</paper-input-container>
|
||||
|
||||
|
||||
If you're using a `<paper-input-container>` imperatively, it's important to make sure
|
||||
that you attach its children (the `iron-input` and the optional `label`) before you
|
||||
attach the `<paper-input-container>` itself, so that it can be set up correctly.
|
||||
|
||||
### Validation
|
||||
|
||||
If the `auto-validate` attribute is set, the input container will validate the input and update
|
||||
|
@ -457,14 +465,15 @@ This element is `display:block` by default, but you can set the `inline` attribu
|
|||
}
|
||||
this.addEventListener('focus', this._boundOnFocus, true);
|
||||
this.addEventListener('blur', this._boundOnBlur, true);
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
if (this.attrForValue) {
|
||||
this._inputElement.addEventListener(this._valueChangedEvent, this._boundValueChanged);
|
||||
} else {
|
||||
this.addEventListener('input', this._onInput);
|
||||
}
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
// Only validate when attached if the input already has a value.
|
||||
if (this._inputElementValue != '') {
|
||||
this._handleValueAndAutoValidate(this._inputElement);
|
||||
|
|
|
@ -129,6 +129,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
return style.transform || style.webkitTransform;
|
||||
}
|
||||
|
||||
suite('basic', function() {
|
||||
test('can be created imperatively', function() {
|
||||
var container = document.createElement('paper-input-container');
|
||||
var input = document.createElement('input', 'iron-input');
|
||||
input.className = 'paper-input-input';
|
||||
input.id = 'input';
|
||||
|
||||
var label = document.createElement('label');
|
||||
label.innerHTML = 'label';
|
||||
|
||||
Polymer.dom(container).appendChild(label);
|
||||
Polymer.dom(container).appendChild(input);
|
||||
|
||||
document.body.appendChild(container);
|
||||
assert.isOk(container);
|
||||
document.body.removeChild(container);
|
||||
});
|
||||
});
|
||||
|
||||
suite('label position', function() {
|
||||
|
||||
test('label is visible by default', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue