mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
parent
ed888200f9
commit
c97c3f2fc4
@ -24,6 +24,8 @@ class HaUsersPickerLight extends LitElement {
|
|||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
public users?: User[];
|
public users?: User[];
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
protected firstUpdated(changedProps) {
|
protected firstUpdated(changedProps) {
|
||||||
super.firstUpdated(changedProps);
|
super.firstUpdated(changedProps);
|
||||||
if (this.users === undefined) {
|
if (this.users === undefined) {
|
||||||
@ -57,6 +59,7 @@ class HaUsersPickerLight extends LitElement {
|
|||||||
this.users,
|
this.users,
|
||||||
notSelectedUsers
|
notSelectedUsers
|
||||||
)}
|
)}
|
||||||
|
.disabled=${this.disabled}
|
||||||
@value-changed=${this._userChanged}
|
@value-changed=${this._userChanged}
|
||||||
></ha-user-picker>
|
></ha-user-picker>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
@ -78,7 +81,7 @@ class HaUsersPickerLight extends LitElement {
|
|||||||
this.hass!.localize("ui.components.user-picker.add_user")}
|
this.hass!.localize("ui.components.user-picker.add_user")}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.users=${notSelectedUsers}
|
.users=${notSelectedUsers}
|
||||||
.disabled=${!notSelectedUsers?.length}
|
.disabled=${this.disabled || !notSelectedUsers?.length}
|
||||||
@value-changed=${this._addUser}
|
@value-changed=${this._addUser}
|
||||||
></ha-user-picker>
|
></ha-user-picker>
|
||||||
`;
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user