mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 05:47:20 +00:00
Support for voluptuous-serialize 2.0.0 (#1529)
This commit is contained in:
parent
2dada41791
commit
6bcfdfaaf8
@ -103,7 +103,7 @@ class HaForm extends EventsMixin(PolymerElement) {
|
||||
<paper-dropdown-menu label="[[computeLabel(schema)]]">
|
||||
<paper-listbox slot="dropdown-content" attr-for-selected="item-name" selected="{{data}}">
|
||||
<template is="dom-repeat" items="[[schema.options]]">
|
||||
<paper-item item-name$="[[item]]">[[item]]</paper-item>
|
||||
<paper-item item-name$="[[_optionValue(item)]]">[[_optionLabel(item)]]</paper-item>
|
||||
</template>
|
||||
</paper-listbox>
|
||||
</paper-dropdown-menu>
|
||||
@ -169,6 +169,14 @@ class HaForm extends EventsMixin(PolymerElement) {
|
||||
_passwordFieldIcon(unmaskedPassword) {
|
||||
return unmaskedPassword ? 'hass:eye-off' : 'hass:eye';
|
||||
}
|
||||
|
||||
_optionValue(item) {
|
||||
return Array.isArray(item) ? item[0] : item;
|
||||
}
|
||||
|
||||
_optionLabel(item) {
|
||||
return Array.isArray(item) ? item[1] : item;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-form', HaForm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user