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
feb5e91986
commit
4da1e38cc5
26 changed files with 320 additions and 125 deletions
|
@ -23,9 +23,6 @@ Example:
|
|||
|
||||
<iron-autogrow-textarea></iron-autogrow-textarea>
|
||||
|
||||
Because the `textarea`'s `value` property is not observable, you should use
|
||||
this element's `bind-value` instead for imperative updates.
|
||||
|
||||
### Styling
|
||||
|
||||
The following custom properties and mixins are available for styling:
|
||||
|
@ -108,6 +105,7 @@ Custom property | Description | Default
|
|||
<!-- size the input/textarea with a div, because the textarea has intrinsic size in ff -->
|
||||
<div class="textarea-container fit">
|
||||
<textarea id="textarea"
|
||||
name$="[[name]]"
|
||||
autocomplete$="[[autocomplete]]"
|
||||
autofocus$="[[autofocus]]"
|
||||
inputmode$="[[inputmode]]"
|
||||
|
@ -137,6 +135,8 @@ Custom property | Description | Default
|
|||
|
||||
/**
|
||||
* Use this property instead of `value` for two-way data binding.
|
||||
* This property will be deprecated in the future. Use `value` instead.
|
||||
* @type {string|number}
|
||||
*/
|
||||
bindValue: {
|
||||
observer: '_bindValueChanged',
|
||||
|
@ -193,23 +193,6 @@ Custom property | Description | Default
|
|||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* Bound to the textarea's `name` attribute.
|
||||
*/
|
||||
name: {
|
||||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* The value for this input, same as `bindValue`
|
||||
*/
|
||||
value: {
|
||||
notify: true,
|
||||
type: String,
|
||||
value: '',
|
||||
computed: '_computeValue(bindValue)'
|
||||
},
|
||||
|
||||
/**
|
||||
* Bound to the textarea's `placeholder` attribute.
|
||||
*/
|
||||
|
@ -244,6 +227,10 @@ Custom property | Description | Default
|
|||
'input': '_onInput'
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_onValueChanged(value)'
|
||||
],
|
||||
|
||||
/**
|
||||
* Returns the underlying textarea.
|
||||
* @type HTMLTextAreaElement
|
||||
|
@ -281,10 +268,6 @@ Custom property | Description | Default
|
|||
set selectionEnd(value) {
|
||||
this.$.textarea.selectionEnd = value;
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
this.bindValue = this.value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if `value` is valid. The validator provided in `validator`
|
||||
|
@ -324,6 +307,7 @@ Custom property | Description | Default
|
|||
textarea.value = !(this.bindValue || this.bindValue === 0) ? '' : this.bindValue;
|
||||
}
|
||||
|
||||
this.value = this.bindValue;
|
||||
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});
|
||||
|
@ -362,8 +346,8 @@ Custom property | Description | Default
|
|||
this.$.mirror.innerHTML = this._constrain(this.tokens);
|
||||
},
|
||||
|
||||
_computeValue: function() {
|
||||
return this.bindValue;
|
||||
_onValueChanged: function() {
|
||||
this.bindValue = this.value;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue