updated atom
This commit is contained in:
@@ -1 +1 @@
|
||||
2022.12.6
|
||||
2022.12.8
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -9,6 +9,9 @@
|
||||
home-assistant.log
|
||||
home-assistant.log.1
|
||||
home-assistant.log.fault
|
||||
/custom_components/*
|
||||
/tts/*
|
||||
/blueprints/*
|
||||
|
||||
# Example .gitignore file for your config dir.
|
||||
# An * ensures that everything will be ignored.
|
||||
|
||||
218
automations.yaml
218
automations.yaml
@@ -142,8 +142,8 @@
|
||||
trigger:
|
||||
- platform: device
|
||||
type: turned_off
|
||||
device_id: 800c3462cb0da0ee95bfcf8c5154278c
|
||||
entity_id: light.lamp_sfeer_dimmer_1
|
||||
device_id: bc61b8f4ddf2fc04d3a0a6001ea7c7c8
|
||||
entity_id: light.lamp_sfeer_woonkamer
|
||||
domain: light
|
||||
condition:
|
||||
- condition: time
|
||||
@@ -631,3 +631,217 @@
|
||||
target:
|
||||
entity_id: scene.tuin_uit
|
||||
mode: single
|
||||
- id: '1671571758539'
|
||||
alias: deurbel - test
|
||||
description: ''
|
||||
trigger:
|
||||
- type: turned_on
|
||||
platform: device
|
||||
device_id: 7c1ced4c0307f87bc9a1b16401d6c4cd
|
||||
entity_id: binary_sensor.voordeur_person_detected
|
||||
domain: binary_sensor
|
||||
condition: []
|
||||
action:
|
||||
- data: {}
|
||||
entity_id: all
|
||||
service: sonos.snapshot
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.1
|
||||
target:
|
||||
device_id: 2025ba7cc40315fb7a2a617c6264c1e3
|
||||
- service: media_player.play_media
|
||||
data:
|
||||
media_content_id: media-source://media_source/local/Ding-dong.mp3
|
||||
media_content_type: music
|
||||
target:
|
||||
device_id: 2025ba7cc40315fb7a2a617c6264c1e3
|
||||
- data: {}
|
||||
entity_id: all
|
||||
service: sonos.restore
|
||||
mode: single
|
||||
- id: '1671659606183'
|
||||
alias: Alles uit
|
||||
description: ''
|
||||
trigger:
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: c976ab1909dcc67895eccdce5708b0dc
|
||||
type: action
|
||||
subtype: brightness_move_down_1
|
||||
discovery_id: 0x60a423fffe28320f action_brightness_move_down_1
|
||||
condition: []
|
||||
action:
|
||||
- service: scene.turn_on
|
||||
data: {}
|
||||
target:
|
||||
entity_id: scene.beneden_alles_uit
|
||||
mode: single
|
||||
- id: '1672422599074'
|
||||
alias: '[BP] Slaapkamer tim schakelaar'
|
||||
description: ''
|
||||
use_blueprint:
|
||||
path: mfarad/zigbee2mqtt-ikea-remote-styrbar-type-e2001-e2002.yaml
|
||||
input:
|
||||
action_sensor: sensor.schakelaar_slaapkamer_tim_action
|
||||
brightness_down_action:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 2
|
||||
target:
|
||||
entity_id: scene.slaapkamer_tim_blauw
|
||||
brightness_up_action:
|
||||
- type: toggle
|
||||
device_id: 1834f301f21c8a1d8a7a16fe8ee2b6b2
|
||||
entity_id: light.0xdc8e95fffefec1f0
|
||||
domain: light
|
||||
brightness_up_long_action:
|
||||
- device_id: 1834f301f21c8a1d8a7a16fe8ee2b6b2
|
||||
domain: light
|
||||
entity_id: light.0xdc8e95fffefec1f0
|
||||
type: brightness_increase
|
||||
arrow_right_action:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 2
|
||||
target:
|
||||
entity_id: scene.slaapkamer_tim_rood
|
||||
arrow_left_action:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 2
|
||||
target:
|
||||
entity_id: scene.slaapkamer_tim_groen
|
||||
- id: '1672424581965'
|
||||
alias: slaapkamer tim - schakelaar (Actions)
|
||||
description: ''
|
||||
trigger:
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: d0236404a6f4ecea5d6ad618510c9bc1
|
||||
type: action
|
||||
subtype: arrow_left_click
|
||||
discovery_id: 0x003c84fffe32c0c0 action_arrow_left_click
|
||||
id: arrow_left_click
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: d0236404a6f4ecea5d6ad618510c9bc1
|
||||
type: action
|
||||
subtype: arrow_right_click
|
||||
discovery_id: 0x003c84fffe32c0c0 action_arrow_right_click
|
||||
id: arrow_right_click
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: d0236404a6f4ecea5d6ad618510c9bc1
|
||||
type: action
|
||||
subtype: 'off'
|
||||
discovery_id: 0x003c84fffe32c0c0 action_off
|
||||
id: off_action
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: d0236404a6f4ecea5d6ad618510c9bc1
|
||||
type: action
|
||||
subtype: 'on'
|
||||
discovery_id: 0x003c84fffe32c0c0 action_on
|
||||
id: on_action
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: d0236404a6f4ecea5d6ad618510c9bc1
|
||||
type: action
|
||||
subtype: brightness_move_up
|
||||
discovery_id: 0x003c84fffe32c0c0 action_brightness_move_up
|
||||
id: brightness_move_up
|
||||
- platform: device
|
||||
domain: mqtt
|
||||
device_id: d0236404a6f4ecea5d6ad618510c9bc1
|
||||
type: action
|
||||
subtype: brightness_move_down
|
||||
discovery_id: 0x003c84fffe32c0c0 action_brightness_move_down
|
||||
id: brightness_move_down
|
||||
condition: []
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: arrow_right_click
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.rgb_slaapkamer_tim
|
||||
data:
|
||||
color_temp: '{% if state_attr("light.rgb_slaapkamer_tim","color_temp") is
|
||||
none %} 454 {% elif state_attr("light.rgb_slaapkamer_tim","color_temp")|int
|
||||
> 350 %} 333 {% elif state_attr("light.rgb_slaapkamer_tim","color_temp")|int
|
||||
> 332 %} 285 {% elif state_attr("light.rgb_slaapkamer_tim","color_temp")|int
|
||||
> 284 %} 244 {% else %} 370 {% endif %}
|
||||
|
||||
'
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: off_action
|
||||
sequence:
|
||||
- type: turn_off
|
||||
device_id: 1834f301f21c8a1d8a7a16fe8ee2b6b2
|
||||
entity_id: light.rgb_slaapkamer_tim
|
||||
domain: light
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: arrow_left_click
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
rgb_color:
|
||||
- '{{ (range(0, 255)|random) }}'
|
||||
- '{{ (range(0, 255)|random) }}'
|
||||
- '{{ (range(0, 255)|random) }}'
|
||||
target:
|
||||
entity_id: light.rgb_slaapkamer_tim
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: on_action
|
||||
sequence:
|
||||
- type: turn_on
|
||||
device_id: 1834f301f21c8a1d8a7a16fe8ee2b6b2
|
||||
entity_id: light.rgb_slaapkamer_tim
|
||||
domain: light
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: brightness_move_up
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.rgb_slaapkamer_tim
|
||||
data:
|
||||
brightness: '{% if state_attr("light.rgb_slaapkamer_tim","brightness") is
|
||||
none %} 8 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 9 %} 16 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 17 %} 32 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 33 %} 64 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 65 %} 128 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 129 %} 160 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 161 %} 192 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 193 %} 224 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
< 225 %} 255 {% else %} 10 {% endif %}
|
||||
|
||||
'
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: brightness_move_down
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.rgb_slaapkamer_tim
|
||||
data:
|
||||
brightness: '{% if state_attr("light.rgb_slaapkamer_tim","brightness") is
|
||||
none %} 32 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 254 %} 224 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 223 %} 192 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 191 %} 160 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 159 %} 128 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 127 %} 64 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 63 %} 32 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 31 %} 16 {% elif state_attr("light.rgb_slaapkamer_tim","brightness")|int
|
||||
> 15 %} 8 {% else %} 128 {% endif %}
|
||||
|
||||
'
|
||||
mode: single
|
||||
|
||||
@@ -4,5 +4,6 @@ scene: !include scenes.yaml
|
||||
homeassistant:
|
||||
#packages: !include_dir_named packages/
|
||||
packages: !include_dir_named "integrations"
|
||||
|
||||
|
||||
|
||||
media_dirs:
|
||||
media: /media
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -32,7 +32,7 @@ from homeassistant.helpers.issue_registry import async_create_issue, IssueSeveri
|
||||
from homeassistant.loader import Integration
|
||||
from homeassistant.util import dt
|
||||
|
||||
from .const import DOMAIN, TV
|
||||
from .const import DOMAIN, TV, URL_BASE
|
||||
from .enums import (
|
||||
ConfigurationType,
|
||||
HacsCategory,
|
||||
@@ -164,6 +164,8 @@ class HacsStatus:
|
||||
|
||||
startup: bool = True
|
||||
new: bool = False
|
||||
active_frontend_endpoint_plugin: bool = False
|
||||
active_frontend_endpoint_theme: bool = False
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -984,3 +986,43 @@ class HacsBase:
|
||||
if was_installed:
|
||||
self.log.critical("Restarting Home Assistant")
|
||||
self.hass.async_create_task(self.hass.async_stop(100))
|
||||
|
||||
@callback
|
||||
def async_setup_frontend_endpoint_plugin(self) -> None:
|
||||
"""Setup the http endpoints for plugins if its not already handled."""
|
||||
if self.status.active_frontend_endpoint_plugin or not os.path.exists(
|
||||
self.hass.config.path("www/community")
|
||||
):
|
||||
return
|
||||
|
||||
self.log.info("Setting up plugin endpoint")
|
||||
use_cache = self.core.lovelace_mode == "storage"
|
||||
self.log.info(
|
||||
"<HacsFrontend> %s mode, cache for /hacsfiles/: %s",
|
||||
self.core.lovelace_mode,
|
||||
use_cache,
|
||||
)
|
||||
|
||||
self.hass.http.register_static_path(
|
||||
URL_BASE,
|
||||
self.hass.config.path("www/community"),
|
||||
cache_headers=use_cache,
|
||||
)
|
||||
|
||||
self.status.active_frontend_endpoint_plugin = True
|
||||
|
||||
@callback
|
||||
def async_setup_frontend_endpoint_themes(self) -> None:
|
||||
"""Setup the http endpoints for themes if its not already handled."""
|
||||
if (
|
||||
self.configuration.experimental
|
||||
or self.status.active_frontend_endpoint_theme
|
||||
or not os.path.exists(self.hass.config.path("themes"))
|
||||
):
|
||||
return
|
||||
|
||||
self.log.info("Setting up themes endpoint")
|
||||
# Register themes
|
||||
self.hass.http.register_static_path(f"{URL_BASE}/themes", self.hass.config.path("themes"))
|
||||
|
||||
self.status.active_frontend_endpoint_theme = True
|
||||
|
||||
@@ -6,7 +6,9 @@ from aiogithubapi.common.const import ACCEPT_HEADERS
|
||||
NAME_SHORT = "HACS"
|
||||
DOMAIN = "hacs"
|
||||
CLIENT_ID = "395a8e669c5de9f7c6e8"
|
||||
MINIMUM_HA_VERSION = "2022.10.0"
|
||||
MINIMUM_HA_VERSION = "2022.11.0"
|
||||
|
||||
URL_BASE = "/hacsfiles"
|
||||
|
||||
TV = TypeVar("TV")
|
||||
|
||||
|
||||
@@ -7,14 +7,13 @@ from aiohttp import web
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
from .const import DOMAIN
|
||||
from .const import DOMAIN, URL_BASE
|
||||
from .hacs_frontend import locate_dir, VERSION as FE_VERSION
|
||||
from .hacs_frontend_experimental import (
|
||||
locate_dir as experimental_locate_dir,
|
||||
VERSION as EXPERIMENTAL_FE_VERSION,
|
||||
)
|
||||
|
||||
URL_BASE = "/hacsfiles"
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .base import HacsBase
|
||||
@@ -24,8 +23,8 @@ if TYPE_CHECKING:
|
||||
def async_register_frontend(hass: HomeAssistant, hacs: HacsBase) -> None:
|
||||
"""Register the frontend."""
|
||||
|
||||
# Register themes
|
||||
hass.http.register_static_path(f"{URL_BASE}/themes", hass.config.path("themes"))
|
||||
# Setup themes endpoint if needed
|
||||
hacs.async_setup_frontend_endpoint_themes()
|
||||
|
||||
# Register frontend
|
||||
if hacs.configuration.frontend_repo_url:
|
||||
@@ -50,20 +49,6 @@ def async_register_frontend(hass: HomeAssistant, hacs: HacsBase) -> None:
|
||||
hass.data["frontend_extra_module_url"] = set()
|
||||
hass.data["frontend_extra_module_url"].add(f"{URL_BASE}/iconset.js")
|
||||
|
||||
# Register www/community for all other files
|
||||
use_cache = hacs.core.lovelace_mode == "storage"
|
||||
hacs.log.info(
|
||||
"<HacsFrontend> %s mode, cache for /hacsfiles/: %s",
|
||||
hacs.core.lovelace_mode,
|
||||
use_cache,
|
||||
)
|
||||
|
||||
hass.http.register_static_path(
|
||||
URL_BASE,
|
||||
hass.config.path("www/community"),
|
||||
cache_headers=use_cache,
|
||||
)
|
||||
|
||||
hacs.frontend_version = (
|
||||
FE_VERSION if not hacs.configuration.experimental else EXPERIMENTAL_FE_VERSION
|
||||
)
|
||||
@@ -86,6 +71,9 @@ def async_register_frontend(hass: HomeAssistant, hacs: HacsBase) -> None:
|
||||
require_admin=True,
|
||||
)
|
||||
|
||||
# Setup plugin endpoint if needed
|
||||
hacs.async_setup_frontend_endpoint_plugin()
|
||||
|
||||
|
||||
class HacsFrontendDev(HomeAssistantView):
|
||||
"""Dev View Class for HACS."""
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
const t=(t,e,n)=>t(`component.${e}.title`)||(null==n?void 0:n.name)||e,e=(t,e)=>t.callWS({type:"manifest/get",integration:e});export{t as d,e as f};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,94 +0,0 @@
|
||||
import{P as e,Q as t,_ as o,j as i,e as n,y as a,d as r,n as l}from"./main-c66a9a06.js";e({_template:t`
|
||||
<style>
|
||||
:host {
|
||||
overflow: hidden; /* needed for text-overflow: ellipsis to work on ff */
|
||||
@apply --layout-vertical;
|
||||
@apply --layout-center-justified;
|
||||
@apply --layout-flex;
|
||||
}
|
||||
|
||||
:host([two-line]) {
|
||||
min-height: var(--paper-item-body-two-line-min-height, 72px);
|
||||
}
|
||||
|
||||
:host([three-line]) {
|
||||
min-height: var(--paper-item-body-three-line-min-height, 88px);
|
||||
}
|
||||
|
||||
:host > ::slotted(*) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:host > ::slotted([secondary]) {
|
||||
@apply --paper-font-body1;
|
||||
|
||||
color: var(--paper-item-body-secondary-color, var(--secondary-text-color));
|
||||
|
||||
@apply --paper-item-body-secondary;
|
||||
}
|
||||
</style>
|
||||
|
||||
<slot></slot>
|
||||
`,is:"paper-item-body"}),o([l("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[n({type:Boolean,reflect:!0})],key:"narrow",value:void 0},{kind:"field",decorators:[n({type:Boolean,attribute:"three-line"})],key:"threeLine",value:()=>!1},{kind:"method",key:"render",value:function(){return a`
|
||||
<div class="prefix-wrap">
|
||||
<slot name="prefix"></slot>
|
||||
<paper-item-body
|
||||
?two-line=${!this.threeLine}
|
||||
?three-line=${this.threeLine}
|
||||
>
|
||||
<slot name="heading"></slot>
|
||||
<div secondary><slot name="description"></slot></div>
|
||||
</paper-item-body>
|
||||
</div>
|
||||
<div class="content"><slot></slot></div>
|
||||
`}},{kind:"get",static:!0,key:"styles",value:function(){return r`
|
||||
:host {
|
||||
display: flex;
|
||||
padding: 0 16px;
|
||||
align-content: normal;
|
||||
align-self: auto;
|
||||
align-items: center;
|
||||
}
|
||||
paper-item-body {
|
||||
padding: 8px 16px 8px 0;
|
||||
}
|
||||
paper-item-body[two-line] {
|
||||
min-height: calc(
|
||||
var(--paper-item-body-two-line-min-height, 72px) - 16px
|
||||
);
|
||||
flex: 1;
|
||||
}
|
||||
.content {
|
||||
display: contents;
|
||||
}
|
||||
:host(:not([narrow])) .content {
|
||||
display: var(--settings-row-content-display, flex);
|
||||
justify-content: flex-end;
|
||||
flex: 1;
|
||||
padding: 16px 0;
|
||||
}
|
||||
.content ::slotted(*) {
|
||||
width: var(--settings-row-content-width);
|
||||
}
|
||||
:host([narrow]) {
|
||||
align-items: normal;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid var(--divider-color);
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
::slotted(ha-switch) {
|
||||
padding: 16px 0;
|
||||
}
|
||||
div[secondary] {
|
||||
white-space: normal;
|
||||
}
|
||||
.prefix-wrap {
|
||||
display: var(--settings-row-prefix-display);
|
||||
}
|
||||
:host([narrow]) .prefix-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
`}}]}}),i);
|
||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
import{_ as t,H as e,e as i,a7 as o,y as s,n as r}from"./main-c66a9a06.js";import{m as a}from"./c.ba59af11.js";import"./c.e8169f76.js";import"./c.73c7fa75.js";import"./c.743a15a1.js";import"./c.b914d43e.js";import"./c.8e28b461.js";let d=t([r("hacs-generic-dialog")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[i({type:Boolean})],key:"markdown",value:()=>!1},{kind:"field",decorators:[i()],key:"repository",value:void 0},{kind:"field",decorators:[i()],key:"header",value:void 0},{kind:"field",decorators:[i()],key:"content",value:void 0},{kind:"field",key:"_getRepository",value:()=>o(((t,e)=>null==t?void 0:t.find((t=>String(t.id)===e))))},{kind:"method",key:"render",value:function(){if(!this.active||!this.repository)return s``;const t=this._getRepository(this.hacs.repositories,this.repository);return s`
|
||||
<hacs-dialog .active=${this.active} .narrow=${this.narrow} .hass=${this.hass}>
|
||||
<div slot="header">${this.header||""}</div>
|
||||
${this.markdown?this.repository?a.html(this.content||"",t):a.html(this.content||""):this.content||""}
|
||||
</hacs-dialog>
|
||||
`}}]}}),e);export{d as HacsGenericDialog};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1 +0,0 @@
|
||||
import{c as e}from"./c.6eb9fcd4.js";import{d as t}from"./c.a5550d10.js";import{bN as s,a7 as i}from"./main-c66a9a06.js";import{s as a}from"./c.874c8cfd.js";const n=(t,s,i)=>t.name_by_user||t.name||i&&((t,s)=>{for(const i of s||[]){const s="string"==typeof i?i:i.entity_id,a=t.states[s];if(a)return e(a)}})(s,i)||s.localize("ui.panel.config.devices.unnamed_device","type",s.localize(`ui.panel.config.devices.type.${t.entry_type||"device"}`)),r=e=>e.sendMessagePromise({type:"config/device_registry/list"}),c=(e,s)=>e.subscribeEvents(t((()=>r(e).then((e=>s.setState(e,!0)))),500,!0),"device_registry_updated"),o=(e,t)=>s("_dr",r,c,e,t),d=(e,t)=>{const s={};for(const i of t){const t=e[i.entity_id];null!=t&&t.domain&&null!==i.device_id&&(s[i.device_id]||(s[i.device_id]=[]),s[i.device_id].push(t.domain))}return s},_=(t,s)=>{if(s.name)return s.name;const i=t.states[s.entity_id];return i?e(i):s.original_name?s.original_name:s.entity_id},y=e=>e.sendMessagePromise({type:"config/entity_registry/list"}),m=(e,s)=>e.subscribeEvents(t((()=>y(e).then((e=>s.setState(e,!0)))),500,!0),"entity_registry_updated"),f=(e,t)=>s("_entityRegistry",y,m,e,t),g=i((e=>{const t={};for(const s of Object.values(e))t[s.id]=s;return t})),p=(e,t)=>e.callWS({type:"config/area_registry/create",...t}),u=e=>e.sendMessagePromise({type:"config/area_registry/list"}).then((e=>e.sort(((e,t)=>a(e.name,t.name))))),l=(e,s)=>e.subscribeEvents(t((()=>u(e).then((e=>s.setState(e,!0)))),500,!0),"area_registry_updated"),v=(e,t)=>s("_areaRegistry",u,l,e,t);export{n as a,v as b,_ as c,f as d,g as e,p as f,d as g,o as s};
|
||||
Binary file not shown.
@@ -1,113 +0,0 @@
|
||||
import{bw as a,bx as i,by as t,bz as e,bA as o,bB as l,bC as s,bD as d,bE as n,bF as r,bG as c,bH as u,bI as m,bJ as h,bK as v,bL as p,O as _,_ as b,j as g,e as y,t as k,y as f,k as x,aD as w,bM as $,d as z,n as j}from"./main-c66a9a06.js";import{s as U}from"./c.04ecc0ad.js";import{b as I,e as C}from"./c.07e395f8.js";import"./c.bbadaeea.js";const M=(a,i)=>a.callWS({type:"auth/sign_path",path:i}),q="browser",B={album:{icon:a,layout:"grid"},app:{icon:i,layout:"grid"},artist:{icon:t,layout:"grid",show_list_images:!0},channel:{icon:e,thumbnail_ratio:"portrait",layout:"grid"},composer:{icon:o,layout:"grid",show_list_images:!0},contributing_artist:{icon:t,layout:"grid",show_list_images:!0},directory:{icon:l,layout:"grid",show_list_images:!0},episode:{icon:e,layout:"grid",thumbnail_ratio:"portrait"},game:{icon:s,layout:"grid",thumbnail_ratio:"portrait"},genre:{icon:d,layout:"grid",show_list_images:!0},image:{icon:n,layout:"grid"},movie:{icon:r,thumbnail_ratio:"portrait",layout:"grid"},music:{icon:c},playlist:{icon:u,layout:"grid",show_list_images:!0},podcast:{icon:m,layout:"grid"},season:{icon:e,layout:"grid",thumbnail_ratio:"portrait"},track:{icon:h},tv_show:{icon:e,layout:"grid",thumbnail_ratio:"portrait"},url:{icon:v},video:{icon:p,layout:"grid"}},L=(a,i,t,e)=>a.callWS({type:"media_player/browse_media",entity_id:i,media_content_id:t,media_content_type:e}),W=[{name:"media_content_id",required:!1,selector:{text:{}}},{name:"media_content_type",required:!1,selector:{text:{}}}];let F=b([j("ha-selector-media")],(function(a,i){return{F:class extends i{constructor(...i){super(...i),a(this)}},d:[{kind:"field",decorators:[y({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[y({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[y({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[y()],key:"label",value:void 0},{kind:"field",decorators:[y()],key:"helper",value:void 0},{kind:"field",decorators:[y({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[y({type:Boolean,reflect:!0})],key:"required",value:()=>!0},{kind:"field",decorators:[k()],key:"_thumbnailUrl",value:void 0},{kind:"method",key:"willUpdate",value:function(a){if(a.has("value")){var i,t,e,o;const s=null===(i=this.value)||void 0===i||null===(t=i.metadata)||void 0===t?void 0:t.thumbnail;if(s===(null===(e=a.get("value"))||void 0===e||null===(o=e.metadata)||void 0===o?void 0:o.thumbnail))return;if(s&&s.startsWith("/"))this._thumbnailUrl=void 0,M(this.hass,s).then((a=>{this._thumbnailUrl=a.path}));else if(s&&s.startsWith("https://brands.home-assistant.io")){var l;this._thumbnailUrl=I({domain:C(s),type:"icon",useFallback:!0,darkOptimized:null===(l=this.hass.themes)||void 0===l?void 0:l.darkMode})}else this._thumbnailUrl=s}}},{kind:"method",key:"render",value:function(){var a,i,t,e,o,l,s,d,n,r,c,u,m;const h=null!==(a=this.value)&&void 0!==a&&a.entity_id?this.hass.states[this.value.entity_id]:void 0,v=!(null!==(i=this.value)&&void 0!==i&&i.entity_id)||h&&U(h,131072);return f`<ha-entity-picker
|
||||
.hass=${this.hass}
|
||||
.value=${null===(t=this.value)||void 0===t?void 0:t.entity_id}
|
||||
.label=${this.label||this.hass.localize("ui.components.selectors.media.pick_media_player")}
|
||||
.disabled=${this.disabled}
|
||||
.helper=${this.helper}
|
||||
.required=${this.required}
|
||||
include-domains='["media_player"]'
|
||||
allow-custom-entity
|
||||
@value-changed=${this._entityChanged}
|
||||
></ha-entity-picker>
|
||||
${v?f`<ha-card
|
||||
outlined
|
||||
@click=${this._pickMedia}
|
||||
class=${this.disabled||null===(e=this.value)||void 0===e||!e.entity_id?"disabled":""}
|
||||
>
|
||||
<div
|
||||
class="thumbnail ${x({portrait:!(null===(o=this.value)||void 0===o||null===(l=o.metadata)||void 0===l||!l.media_class)&&"portrait"===B[this.value.metadata.children_media_class||this.value.metadata.media_class].thumbnail_ratio})}"
|
||||
>
|
||||
${null!==(s=this.value)&&void 0!==s&&null!==(d=s.metadata)&&void 0!==d&&d.thumbnail?f`
|
||||
<div
|
||||
class="${x({"centered-image":!!this.value.metadata.media_class&&["app","directory"].includes(this.value.metadata.media_class)})}
|
||||
image"
|
||||
style=${this._thumbnailUrl?`background-image: url(${this._thumbnailUrl});`:""}
|
||||
></div>
|
||||
`:f`
|
||||
<div class="icon-holder image">
|
||||
<ha-svg-icon
|
||||
class="folder"
|
||||
.path=${null!==(n=this.value)&&void 0!==n&&n.media_content_id?null!==(r=this.value)&&void 0!==r&&null!==(c=r.metadata)&&void 0!==c&&c.media_class?B["directory"===this.value.metadata.media_class&&this.value.metadata.children_media_class||this.value.metadata.media_class].icon:$:w}
|
||||
></ha-svg-icon>
|
||||
</div>
|
||||
`}
|
||||
</div>
|
||||
<div class="title">
|
||||
${null!==(u=this.value)&&void 0!==u&&u.media_content_id?(null===(m=this.value.metadata)||void 0===m?void 0:m.title)||this.value.media_content_id:this.hass.localize("ui.components.selectors.media.pick_media")}
|
||||
</div>
|
||||
</ha-card>`:f`<ha-alert>
|
||||
${this.hass.localize("ui.components.selectors.media.browse_not_supported")}
|
||||
</ha-alert>
|
||||
<ha-form
|
||||
.hass=${this.hass}
|
||||
.data=${this.value}
|
||||
.schema=${W}
|
||||
.computeLabel=${this._computeLabelCallback}
|
||||
></ha-form>`}`}},{kind:"field",key:"_computeLabelCallback",value(){return a=>this.hass.localize(`ui.components.selectors.media.${a.name}`)}},{kind:"method",key:"_entityChanged",value:function(a){a.stopPropagation(),_(this,"value-changed",{value:{entity_id:a.detail.value,media_content_id:"",media_content_type:""}})}},{kind:"method",key:"_pickMedia",value:function(){var a,i,t;i=this,t={action:"pick",entityId:this.value.entity_id,navigateIds:null===(a=this.value.metadata)||void 0===a?void 0:a.navigateIds,mediaPickedCallback:a=>{var i;_(this,"value-changed",{value:{...this.value,media_content_id:a.item.media_content_id,media_content_type:a.item.media_content_type,metadata:{title:a.item.title,thumbnail:a.item.thumbnail,media_class:a.item.media_class,children_media_class:a.item.children_media_class,navigateIds:null===(i=a.navigateIds)||void 0===i?void 0:i.map((a=>({media_content_type:a.media_content_type,media_content_id:a.media_content_id})))}}})}},_(i,"show-dialog",{dialogTag:"dialog-media-player-browse",dialogImport:()=>import("./c.06557919.js").then((function(a){return a.d})),dialogParams:t})}},{kind:"get",static:!0,key:"styles",value:function(){return z`
|
||||
ha-entity-picker {
|
||||
display: block;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
mwc-button {
|
||||
margin-top: 8px;
|
||||
}
|
||||
ha-alert {
|
||||
display: block;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
ha-card {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
ha-card.disabled {
|
||||
pointer-events: none;
|
||||
color: var(--disabled-text-color);
|
||||
}
|
||||
ha-card .thumbnail {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
transition: padding-bottom 0.1s ease-out;
|
||||
padding-bottom: 100%;
|
||||
}
|
||||
ha-card .thumbnail.portrait {
|
||||
padding-bottom: 150%;
|
||||
}
|
||||
ha-card .image {
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
.folder {
|
||||
--mdc-icon-size: calc(var(--media-browse-item-size, 175px) * 0.4);
|
||||
}
|
||||
.title {
|
||||
font-size: 16px;
|
||||
padding-top: 16px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-bottom: 16px;
|
||||
padding-left: 16px;
|
||||
padding-right: 4px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
.centered-image {
|
||||
margin: 0 8px;
|
||||
background-size: contain;
|
||||
}
|
||||
.icon-holder {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
`}}]}}),g);var O=Object.freeze({__proto__:null,HaMediaSelector:F});export{q as B,B as M,L as b,M as g,O as h};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
import{_ as e,j as a,e as i,y as l,bn as t,O as o,d,n as s}from"./main-c66a9a06.js";import{a as r}from"./c.31caccfc.js";import{f as n}from"./c.d9d8b90e.js";import"./c.a5550d10.js";const c=()=>import("./c.b5117688.js");e([s("ha-date-input")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",decorators:[i({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"method",key:"render",value:function(){return l`<ha-textfield
|
||||
.label=${this.label}
|
||||
.helper=${this.helper}
|
||||
.disabled=${this.disabled}
|
||||
iconTrailing
|
||||
helperPersistent
|
||||
@click=${this._openDialog}
|
||||
.value=${this.value?r(new Date(this.value),this.locale):""}
|
||||
.required=${this.required}
|
||||
>
|
||||
<ha-svg-icon slot="trailingIcon" .path=${t}></ha-svg-icon>
|
||||
</ha-textfield>`}},{kind:"method",key:"_openDialog",value:function(){var e,a;this.disabled||(e=this,a={min:"1970-01-01",value:this.value,onChange:e=>this._valueChanged(e),locale:this.locale.language,firstWeekday:n(this.locale)},o(e,"show-dialog",{dialogTag:"ha-dialog-date-picker",dialogImport:c,dialogParams:a}))}},{kind:"method",key:"_valueChanged",value:function(e){this.value!==e&&(this.value=e,o(this,"change"),o(this,"value-changed",{value:e}))}},{kind:"get",static:!0,key:"styles",value:function(){return d`
|
||||
ha-svg-icon {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
`}}]}}),a);
|
||||
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
import{_ as e,j as a,e as t,y as i,O as d,d as l,n as s}from"./main-c66a9a06.js";import"./c.bbadaeea.js";import"./c.6912e15e.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";import"./c.930daaba.js";let o=e([s("ha-selector-boolean")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",decorators:[t()],key:"hass",value:void 0},{kind:"field",decorators:[t()],key:"value",value:void 0},{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"helper",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){return i`
|
||||
<ha-formfield alignEnd spaceBetween .label=${this.label}>
|
||||
<ha-switch
|
||||
.checked=${this.value}
|
||||
@change=${this._handleChange}
|
||||
.disabled=${this.disabled}
|
||||
></ha-switch>
|
||||
</ha-formfield>
|
||||
${this.helper?i`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`:""}
|
||||
`}},{kind:"method",key:"_handleChange",value:function(e){const a=e.target.checked;this.value!==a&&d(this,"value-changed",{value:a})}},{kind:"get",static:!0,key:"styles",value:function(){return l`
|
||||
ha-formfield {
|
||||
display: flex;
|
||||
height: 56px;
|
||||
align-items: center;
|
||||
--mdc-typography-body2-font-size: 1em;
|
||||
}
|
||||
`}}]}}),a);export{o as HaBooleanSelector};
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
import{_ as e,j as a,e as l,y as i,O as d,n as o}from"./main-c66a9a06.js";let r=e([o("ha-selector-icon")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",decorators:[l()],key:"hass",value:void 0},{kind:"field",decorators:[l()],key:"selector",value:void 0},{kind:"field",decorators:[l()],key:"value",value:void 0},{kind:"field",decorators:[l()],key:"label",value:void 0},{kind:"field",decorators:[l()],key:"helper",value:void 0},{kind:"field",decorators:[l({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[l({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){var e,a;return i`
|
||||
<ha-icon-picker
|
||||
.hass=${this.hass}
|
||||
.label=${this.label}
|
||||
.value=${this.value}
|
||||
.required=${this.required}
|
||||
.disabled=${this.disabled}
|
||||
.helper=${this.helper}
|
||||
.fallbackPath=${null===(e=this.selector.icon)||void 0===e?void 0:e.fallbackPath}
|
||||
.placeholder=${null===(a=this.selector.icon)||void 0===a?void 0:a.placeholder}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-icon-picker>
|
||||
`}},{kind:"method",key:"_valueChanged",value:function(e){d(this,"value-changed",{value:e.detail.value})}}]}}),a);export{r as HaIconSelector};
|
||||
Binary file not shown.
@@ -1,176 +0,0 @@
|
||||
import{P as t,Q as i,S as a}from"./main-c66a9a06.js";t({_template:i`
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
position: absolute;
|
||||
outline: none;
|
||||
z-index: 1002;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#tooltip {
|
||||
display: block;
|
||||
outline: none;
|
||||
@apply --paper-font-common-base;
|
||||
font-size: 10px;
|
||||
line-height: 1;
|
||||
background-color: var(--paper-tooltip-background, #616161);
|
||||
color: var(--paper-tooltip-text-color, white);
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
@apply --paper-tooltip;
|
||||
}
|
||||
|
||||
@keyframes keyFrameScaleUp {
|
||||
0% {
|
||||
transform: scale(0.0);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes keyFrameScaleDown {
|
||||
0% {
|
||||
transform: scale(1.0);
|
||||
}
|
||||
100% {
|
||||
transform: scale(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes keyFrameFadeInOpacity {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes keyFrameFadeOutOpacity {
|
||||
0% {
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes keyFrameSlideDownIn {
|
||||
0% {
|
||||
transform: translateY(-2000px);
|
||||
opacity: 0;
|
||||
}
|
||||
10% {
|
||||
opacity: 0.2;
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes keyFrameSlideDownOut {
|
||||
0% {
|
||||
transform: translateY(0);
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
}
|
||||
10% {
|
||||
opacity: 0.2;
|
||||
}
|
||||
100% {
|
||||
transform: translateY(-2000px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.fade-in-animation {
|
||||
opacity: 0;
|
||||
animation-delay: var(--paper-tooltip-delay-in, 500ms);
|
||||
animation-name: keyFrameFadeInOpacity;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: ease-in;
|
||||
animation-duration: var(--paper-tooltip-duration-in, 500ms);
|
||||
animation-fill-mode: forwards;
|
||||
@apply --paper-tooltip-animation;
|
||||
}
|
||||
|
||||
.fade-out-animation {
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
animation-delay: var(--paper-tooltip-delay-out, 0ms);
|
||||
animation-name: keyFrameFadeOutOpacity;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: ease-in;
|
||||
animation-duration: var(--paper-tooltip-duration-out, 500ms);
|
||||
animation-fill-mode: forwards;
|
||||
@apply --paper-tooltip-animation;
|
||||
}
|
||||
|
||||
.scale-up-animation {
|
||||
transform: scale(0);
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
animation-delay: var(--paper-tooltip-delay-in, 500ms);
|
||||
animation-name: keyFrameScaleUp;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: ease-in;
|
||||
animation-duration: var(--paper-tooltip-duration-in, 500ms);
|
||||
animation-fill-mode: forwards;
|
||||
@apply --paper-tooltip-animation;
|
||||
}
|
||||
|
||||
.scale-down-animation {
|
||||
transform: scale(1);
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
animation-delay: var(--paper-tooltip-delay-out, 500ms);
|
||||
animation-name: keyFrameScaleDown;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: ease-in;
|
||||
animation-duration: var(--paper-tooltip-duration-out, 500ms);
|
||||
animation-fill-mode: forwards;
|
||||
@apply --paper-tooltip-animation;
|
||||
}
|
||||
|
||||
.slide-down-animation {
|
||||
transform: translateY(-2000px);
|
||||
opacity: 0;
|
||||
animation-delay: var(--paper-tooltip-delay-out, 500ms);
|
||||
animation-name: keyFrameSlideDownIn;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
|
||||
animation-duration: var(--paper-tooltip-duration-out, 500ms);
|
||||
animation-fill-mode: forwards;
|
||||
@apply --paper-tooltip-animation;
|
||||
}
|
||||
|
||||
.slide-down-animation-out {
|
||||
transform: translateY(0);
|
||||
opacity: var(--paper-tooltip-opacity, 0.9);
|
||||
animation-delay: var(--paper-tooltip-delay-out, 500ms);
|
||||
animation-name: keyFrameSlideDownOut;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
|
||||
animation-duration: var(--paper-tooltip-duration-out, 500ms);
|
||||
animation-fill-mode: forwards;
|
||||
@apply --paper-tooltip-animation;
|
||||
}
|
||||
|
||||
.cancel-animation {
|
||||
animation-delay: -30s !important;
|
||||
}
|
||||
|
||||
/* Thanks IE 10. */
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="tooltip" class="hidden">
|
||||
<slot></slot>
|
||||
</div>
|
||||
`,is:"paper-tooltip",hostAttributes:{role:"tooltip",tabindex:-1},properties:{for:{type:String,observer:"_findTarget"},manualMode:{type:Boolean,value:!1,observer:"_manualModeChanged"},position:{type:String,value:"bottom"},fitToVisibleBounds:{type:Boolean,value:!1},offset:{type:Number,value:14},marginTop:{type:Number,value:14},animationDelay:{type:Number,value:500,observer:"_delayChange"},animationEntry:{type:String,value:""},animationExit:{type:String,value:""},animationConfig:{type:Object,value:function(){return{entry:[{name:"fade-in-animation",node:this,timing:{delay:0}}],exit:[{name:"fade-out-animation",node:this}]}}},_showing:{type:Boolean,value:!1}},listeners:{webkitAnimationEnd:"_onAnimationEnd"},get target(){var t=a(this).parentNode,i=a(this).getOwnerRoot();return this.for?a(i).querySelector("#"+this.for):t.nodeType==Node.DOCUMENT_FRAGMENT_NODE?i.host:t},attached:function(){this._findTarget()},detached:function(){this.manualMode||this._removeListeners()},playAnimation:function(t){"entry"===t?this.show():"exit"===t&&this.hide()},cancelAnimation:function(){this.$.tooltip.classList.add("cancel-animation")},show:function(){if(!this._showing){if(""===a(this).textContent.trim()){for(var t=!0,i=a(this).getEffectiveChildNodes(),n=0;n<i.length;n++)if(""!==i[n].textContent.trim()){t=!1;break}if(t)return}this._showing=!0,this.$.tooltip.classList.remove("hidden"),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.updatePosition(),this._animationPlaying=!0,this.$.tooltip.classList.add(this._getAnimationType("entry"))}},hide:function(){if(this._showing){if(this._animationPlaying)return this._showing=!1,void this._cancelAnimation();this._onAnimationFinish(),this._showing=!1,this._animationPlaying=!0}},updatePosition:function(){if(this._target&&this.offsetParent){var t=this.offset;14!=this.marginTop&&14==this.offset&&(t=this.marginTop);var i,a,n=this.offsetParent.getBoundingClientRect(),e=this._target.getBoundingClientRect(),o=this.getBoundingClientRect(),s=(e.width-o.width)/2,r=(e.height-o.height)/2,l=e.left-n.left,p=e.top-n.top;switch(this.position){case"top":i=l+s,a=p-o.height-t;break;case"bottom":i=l+s,a=p+e.height+t;break;case"left":i=l-o.width-t,a=p+r;break;case"right":i=l+e.width+t,a=p+r}this.fitToVisibleBounds?(n.left+i+o.width>window.innerWidth?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),n.top+a+o.height>window.innerHeight?(this.style.bottom=n.height-p+t+"px",this.style.top="auto"):(this.style.top=Math.max(-n.top,a)+"px",this.style.bottom="auto")):(this.style.left=i+"px",this.style.top=a+"px")}},_addListeners:function(){this._target&&(this.listen(this._target,"mouseenter","show"),this.listen(this._target,"focus","show"),this.listen(this._target,"mouseleave","hide"),this.listen(this._target,"blur","hide"),this.listen(this._target,"tap","hide")),this.listen(this.$.tooltip,"animationend","_onAnimationEnd"),this.listen(this,"mouseenter","hide")},_findTarget:function(){this.manualMode||this._removeListeners(),this._target=this.target,this.manualMode||this._addListeners()},_delayChange:function(t){500!==t&&this.updateStyles({"--paper-tooltip-delay-in":t+"ms"})},_manualModeChanged:function(){this.manualMode?this._removeListeners():this._addListeners()},_cancelAnimation:function(){this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add("hidden")},_onAnimationFinish:function(){this._showing&&(this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add(this._getAnimationType("exit")))},_onAnimationEnd:function(){this._animationPlaying=!1,this._showing||(this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.add("hidden"))},_getAnimationType:function(t){if("entry"===t&&""!==this.animationEntry)return this.animationEntry;if("exit"===t&&""!==this.animationExit)return this.animationExit;if(this.animationConfig[t]&&"string"==typeof this.animationConfig[t][0].name){if(this.animationConfig[t][0].timing&&this.animationConfig[t][0].timing.delay&&0!==this.animationConfig[t][0].timing.delay){var i=this.animationConfig[t][0].timing.delay;"entry"===t?this.updateStyles({"--paper-tooltip-delay-in":i+"ms"}):"exit"===t&&this.updateStyles({"--paper-tooltip-delay-out":i+"ms"})}return this.animationConfig[t][0].name}},_removeListeners:function(){this._target&&(this.unlisten(this._target,"mouseenter","show"),this.unlisten(this._target,"focus","show"),this.unlisten(this._target,"mouseleave","hide"),this.unlisten(this._target,"blur","hide"),this.unlisten(this._target,"tap","hide")),this.unlisten(this.$.tooltip,"animationend","_onAnimationEnd"),this.unlisten(this,"mouseenter","hide")}});
|
||||
Binary file not shown.
@@ -1,56 +0,0 @@
|
||||
import{_ as e,j as a,e as o,y as t,aF as i,k as s,aE as l,d as n,n as r,a7 as c,aB as d,af as h,aw as p,ag as m,aG as u,aH as f,aI as g,aJ as b,ax as v,aK as y,a4 as _,ai as w,aL as k,aM as $}from"./main-c66a9a06.js";import"./c.41d13611.js";import"./c.24287846.js";import{g as z}from"./c.f2bb3724.js";import{s as x}from"./c.4b0dc107.js";e([r("ha-icon-overflow-menu")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",decorators:[o({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[o({type:Array})],key:"items",value:()=>[]},{kind:"field",decorators:[o({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return t`
|
||||
${this.narrow?t` <!-- Collapsed representation for small screens -->
|
||||
<ha-button-menu
|
||||
@click=${this._handleIconOverflowMenuOpened}
|
||||
@closed=${this._handleIconOverflowMenuClosed}
|
||||
class="ha-icon-overflow-menu-overflow"
|
||||
corner="BOTTOM_START"
|
||||
absolute
|
||||
>
|
||||
<ha-icon-button
|
||||
.label=${this.hass.localize("ui.common.overflow_menu")}
|
||||
.path=${i}
|
||||
slot="trigger"
|
||||
></ha-icon-button>
|
||||
|
||||
${this.items.map((e=>e.divider?t`<li divider role="separator"></li>`:t`<mwc-list-item
|
||||
graphic="icon"
|
||||
?disabled=${e.disabled}
|
||||
@click=${e.action}
|
||||
class=${s({warning:Boolean(e.warning)})}
|
||||
>
|
||||
<div slot="graphic">
|
||||
<ha-svg-icon
|
||||
class=${s({warning:Boolean(e.warning)})}
|
||||
.path=${e.path}
|
||||
></ha-svg-icon>
|
||||
</div>
|
||||
${e.label}
|
||||
</mwc-list-item> `))}
|
||||
</ha-button-menu>`:t`
|
||||
<!-- Icon representation for big screens -->
|
||||
${this.items.map((e=>e.narrowOnly?"":e.divider?t`<div role="separator"></div>`:t`<div>
|
||||
${e.tooltip?t`<paper-tooltip animation-delay="0" position="left">
|
||||
${e.tooltip}
|
||||
</paper-tooltip>`:""}
|
||||
<ha-icon-button
|
||||
@click=${e.action}
|
||||
.label=${e.label}
|
||||
.path=${e.path}
|
||||
?disabled=${e.disabled}
|
||||
></ha-icon-button>
|
||||
</div> `))}
|
||||
`}
|
||||
`}},{kind:"method",key:"_handleIconOverflowMenuOpened",value:function(e){e.stopPropagation();const a=this.closest(".mdc-data-table__row");a&&(a.style.zIndex="1")}},{kind:"method",key:"_handleIconOverflowMenuClosed",value:function(){const e=this.closest(".mdc-data-table__row");e&&(e.style.zIndex="")}},{kind:"get",static:!0,key:"styles",value:function(){return[l,n`
|
||||
:host {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
li[role="separator"] {
|
||||
border-bottom-color: var(--divider-color);
|
||||
}
|
||||
div[role="separator"] {
|
||||
border-right: 1px solid var(--divider-color);
|
||||
width: 1px;
|
||||
}
|
||||
`]}}]}}),a);const E=c(((e,a)=>[..."HACS-EXPERIMENTAL-PANEL"===e.nodeName?[{path:d,label:e.hacs.localize("common.show"),action:()=>h(`/hacs/repository/${a.id}`)}]:[],{path:p,label:e.hacs.localize("common.repository"),action:()=>m.open(`https://github.com/${a.full_name}`,"_blank","noreferrer=true")},{path:u,label:e.hacs.localize("repository_card.update_information"),action:async()=>{await f(e.hass,String(a.id))}},...a.installed_version?[{path:g,label:e.hacs.localize("repository_card.redownload"),action:()=>O(e,a.id),hideForUninstalled:!0}]:[],..."plugin"===a.category&&a.installed_version?[{path:b,label:e.hacs.localize("repository_card.open_source"),action:()=>m.open(`/hacsfiles/${a.local_path.split("/").pop()}/${a.file_name}`,"_blank","noreferrer=true")}]:[],{divider:!0},{path:v,label:e.hacs.localize("repository_card.open_issue"),action:()=>m.open(`https://github.com/${a.full_name}/issues`,"_blank","noreferrer=true")},..."172733314"!==a.id&&a.installed_version?[{path:y,label:e.hacs.localize("repository_card.report"),action:()=>m.open(`https://github.com/hacs/integration/issues/new?assignees=ludeeus&labels=flag&template=removal.yml&repo=${a.full_name}&title=Request for removal of ${a.full_name}`,"_blank","noreferrer=true"),warning:!0},{path:_,label:e.hacs.localize("common.remove"),action:async()=>{if("integration"===a.category&&a.config_flow){if((await z(e.hass)).some((e=>e.domain===a.domain))){if(await x(e,{title:e.hacs.localize("dialog.configured.title"),text:e.hacs.localize("dialog.configured.message",{name:a.name}),dismissText:e.hacs.localize("common.ignore"),confirmText:e.hacs.localize("common.navigate"),confirm:()=>{h("/config/integrations",{replace:!0})}}))return}}e.dispatchEvent(new CustomEvent("hacs-dialog",{detail:{type:"progress",title:e.hacs.localize("dialog.remove.title"),confirmText:e.hacs.localize("dialog.remove.title"),content:e.hacs.localize("dialog.remove.message",{name:a.name}),confirm:async()=>{await I(e,a)}},bubbles:!0,composed:!0}))},warning:!0}]:[]])),O=(e,a)=>{e.dispatchEvent(new CustomEvent("hacs-dialog",{detail:{type:"download",repository:a},bubbles:!0,composed:!0}))},I=async(e,a)=>{var o;if("plugin"===a.category&&"yaml"!==(null===(o=e.hacs.info)||void 0===o?void 0:o.lovelace_mode)){(await w(e.hass)).filter((e=>e.url.startsWith(`/hacsfiles/${a.full_name.split("/")[1]}/${a.file_name}`))).forEach((async a=>{await k(e.hass,String(a.id))}))}await $(e.hass,String(a.id)),"HACS-REPOSITORY-PANEL"===e.nodeName&&history.back()},S=e=>a=>({kind:"method",placement:"prototype",key:a.key,descriptor:{set(e){this[`__${String(a.key)}`]=e},get(){return this[`__${String(a.key)}`]},enumerable:!0,configurable:!0},finisher(o){const t=o.prototype.connectedCallback;o.prototype.connectedCallback=function(){if(t.call(this),this[a.key]){const o=this.renderRoot.querySelector(e);if(!o)return;o.scrollTop=this[a.key]}}}});export{E as a,S as r};
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
import{I as e,J as s,L as t,N as r}from"./main-c66a9a06.js";import{m as l,u as n,r as o,p as i,a}from"./c.a5550d10.js";const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},f=e(class extends s{constructor(e){if(super(e),e.type!==t.CHILD)throw Error("repeat() can only be used in text expressions")}ht(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],n=[];let o=0;for(const s of e)l[o]=r?r(s,o):o,n[o]=t(s,o),o++;return{values:n,keys:l}}render(e,s,t){return this.ht(e,s,t).values}update(e,[s,t,f]){var c;const h=l(e),{values:d,keys:p}=this.ht(s,t,f);if(!Array.isArray(h))return this.ut=p,d;const v=null!==(c=this.ut)&&void 0!==c?c:this.ut=[],y=[];let m,x,g=0,j=h.length-1,k=0,w=d.length-1;for(;g<=j&&k<=w;)if(null===h[g])g++;else if(null===h[j])j--;else if(v[g]===p[k])y[k]=n(h[g],d[k]),g++,k++;else if(v[j]===p[w])y[w]=n(h[j],d[w]),j--,w--;else if(v[g]===p[w])y[w]=n(h[g],d[w]),o(e,y[w+1],h[g]),g++,w--;else if(v[j]===p[k])y[k]=n(h[j],d[k]),o(e,h[g],h[j]),j--,k++;else if(void 0===m&&(m=u(p,k,w),x=u(v,g,j)),m.has(v[g]))if(m.has(v[j])){const s=x.get(p[k]),t=void 0!==s?h[s]:null;if(null===t){const s=o(e,h[g]);n(s,d[k]),y[k]=s}else y[k]=n(t,d[k]),o(e,h[g],t),h[s]=null;k++}else i(h[j]),j--;else i(h[g]),g++;for(;k<=w;){const s=o(e,y[w+1]);n(s,d[k]),y[k++]=s}for(;g<=j;){const e=h[g++];null!==e&&i(e)}return this.ut=p,a(e,y),r}});export{f as c};
|
||||
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
import{_ as e,j as t,e as a,y as i,eE as l,O as d,eF as r,d as s,n as o}from"./main-c66a9a06.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";let n=e([o("ha-selector-color_rgb")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[a({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[a({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[a()],key:"value",value:void 0},{kind:"field",decorators:[a()],key:"label",value:void 0},{kind:"field",decorators:[a()],key:"helper",value:void 0},{kind:"field",decorators:[a({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[a({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return i`
|
||||
<ha-textfield
|
||||
type="color"
|
||||
helperPersistent
|
||||
.value=${this.value?l(this.value):""}
|
||||
.label=${this.label||""}
|
||||
.required=${this.required}
|
||||
.helper=${this.helper}
|
||||
.disalbled=${this.disabled}
|
||||
@change=${this._valueChanged}
|
||||
></ha-textfield>
|
||||
`}},{kind:"method",key:"_valueChanged",value:function(e){const t=e.target.value;d(this,"value-changed",{value:r(t)})}},{kind:"field",static:!0,key:"styles",value:()=>s`
|
||||
:host {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
ha-textfield {
|
||||
--text-field-padding: 8px;
|
||||
min-width: 75px;
|
||||
flex-grow: 1;
|
||||
margin: 0 4px;
|
||||
}
|
||||
`}]}}),t);export{n as HaColorRGBSelector};
|
||||
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
import{_ as e,j as d,e as i,y as a,n as r}from"./main-c66a9a06.js";import"./c.1cede1b9.js";import"./c.31caccfc.js";import"./c.3acef177.js";import"./c.743a15a1.js";import"./c.2610e8cd.js";import"./c.a0946910.js";import"./c.d9d8b90e.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";let o=e([r("ha-selector-date")],(function(e,d){return{F:class extends d{constructor(...d){super(...d),e(this)}},d:[{kind:"field",decorators:[i()],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"selector",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return a`
|
||||
<ha-date-input
|
||||
.label=${this.label}
|
||||
.locale=${this.hass.locale}
|
||||
.disabled=${this.disabled}
|
||||
.value=${this.value}
|
||||
.required=${this.required}
|
||||
.helper=${this.helper}
|
||||
>
|
||||
</ha-date-input>
|
||||
`}}]}}),d);export{o as HaDateSelector};
|
||||
Binary file not shown.
@@ -1,29 +0,0 @@
|
||||
import{_ as e,j as t,e as i,y as a,d as s,O as l,n as d}from"./main-c66a9a06.js";import"./c.41d13611.js";import{s as r}from"./c.a5550d10.js";import"./c.8e28b461.js";e([d("ha-theme-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[i({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!1},{kind:"method",key:"render",value:function(){return a`
|
||||
<ha-select
|
||||
.label=${this.label||this.hass.localize("ui.components.theme-picker.theme")}
|
||||
.value=${this.value}
|
||||
.required=${this.required}
|
||||
.disabled=${this.disabled}
|
||||
@selected=${this._changed}
|
||||
@closed=${r}
|
||||
fixedMenuPosition
|
||||
naturalMenuWidth
|
||||
>
|
||||
<mwc-list-item value="remove"
|
||||
>${this.hass.localize("ui.components.theme-picker.no_theme")}</mwc-list-item
|
||||
>
|
||||
${Object.keys(this.hass.themes.themes).sort().map((e=>a`<mwc-list-item .value=${e}>${e}</mwc-list-item>`))}
|
||||
</ha-select>
|
||||
`}},{kind:"get",static:!0,key:"styles",value:function(){return s`
|
||||
ha-select {
|
||||
width: 100%;
|
||||
}
|
||||
`}},{kind:"method",key:"_changed",value:function(e){this.hass&&""!==e.target.value&&(this.value="remove"===e.target.value?void 0:e.target.value,l(this,"value-changed",{value:this.value}))}}]}}),t);let o=e([d("ha-selector-theme")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[i({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[i({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return a`
|
||||
<ha-theme-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.label=${this.label}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
></ha-theme-picker>
|
||||
`}}]}}),t);export{o as HaThemeSelector};
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
import{a7 as a}from"./main-c66a9a06.js";import{p as e}from"./c.3acef177.js";e&&await e,a((a=>new Intl.DateTimeFormat(a.language,{weekday:"long",month:"long",day:"numeric"})));const n=(a,e)=>m(e).format(a),m=a((a=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"long",day:"numeric"}))),t=(a,e)=>r(e).format(a),r=a((a=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"numeric",day:"numeric"})));a((a=>new Intl.DateTimeFormat(a.language,{day:"numeric",month:"short"}))),a((a=>new Intl.DateTimeFormat(a.language,{month:"long",year:"numeric"}))),a((a=>new Intl.DateTimeFormat(a.language,{month:"long"}))),a((a=>new Intl.DateTimeFormat(a.language,{year:"numeric"})));export{t as a,n as f};
|
||||
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
import{_ as e,j as a,e as i,y as d,O as r,n as l}from"./main-c66a9a06.js";import"./c.6829e397.js";import"./c.bbadaeea.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";import"./c.930daaba.js";let o=e([l("ha-selector-navigation")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",decorators:[i()],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"selector",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return d`
|
||||
<ha-navigation-picker
|
||||
.hass=${this.hass}
|
||||
.label=${this.label}
|
||||
.value=${this.value}
|
||||
.required=${this.required}
|
||||
.disabled=${this.disabled}
|
||||
.helper=${this.helper}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-navigation-picker>
|
||||
`}},{kind:"method",key:"_valueChanged",value:function(e){r(this,"value-changed",{value:e.detail.value})}}]}}),a);export{o as HaNavigationSelector};
|
||||
Binary file not shown.
@@ -1,29 +0,0 @@
|
||||
import{_ as e,j as t,e as i,i as a,y as o,n as d,E as s,G as l,O as r}from"./main-c66a9a06.js";import{S as u}from"./c.baaad129.js";import{f as n}from"./c.d0468013.js";import"./c.bbadaeea.js";import"./c.708f0e16.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";import"./c.31caccfc.js";import"./c.3acef177.js";import"./c.743a15a1.js";import"./c.2610e8cd.js";import"./c.a0946910.js";import"./c.e95db283.js";import"./c.930daaba.js";e([d("ha-entity-attribute-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[i({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"entityId",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"hide-attributes"})],key:"hideAttributes",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"autofocus",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[i({type:Boolean,attribute:"allow-custom-value"})],key:"allowCustomValue",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"_opened",value:()=>!1},{kind:"field",decorators:[a("ha-combo-box",!0)],key:"_comboBox",value:void 0},{kind:"method",key:"shouldUpdate",value:function(e){return!(!e.has("_opened")&&this._opened)}},{kind:"method",key:"updated",value:function(e){if(e.has("_opened")&&this._opened){const e=this.entityId?this.hass.states[this.entityId]:void 0;this._comboBox.items=e?Object.keys(e.attributes).filter((e=>{var t;return!(null!==(t=this.hideAttributes)&&void 0!==t&&t.includes(e))})).map((e=>({value:e,label:n(e)}))):[]}}},{kind:"method",key:"render",value:function(){var e;return this.hass?o`
|
||||
<ha-combo-box
|
||||
.hass=${this.hass}
|
||||
.value=${this.value?n(this.value):""}
|
||||
.autofocus=${this.autofocus}
|
||||
.label=${null!==(e=this.label)&&void 0!==e?e:this.hass.localize("ui.components.entity.entity-attribute-picker.attribute")}
|
||||
.disabled=${this.disabled||!this.entityId}
|
||||
.required=${this.required}
|
||||
.helper=${this.helper}
|
||||
.allowCustomValue=${this.allowCustomValue}
|
||||
item-value-path="value"
|
||||
item-label-path="label"
|
||||
@opened-changed=${this._openedChanged}
|
||||
@value-changed=${this._valueChanged}
|
||||
>
|
||||
</ha-combo-box>
|
||||
`:o``}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_valueChanged",value:function(e){this.value=e.detail.value}}]}}),t);let c=e([d("ha-selector-attribute")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[i({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[i({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!0},{kind:"field",decorators:[i({attribute:!1})],key:"context",value:void 0},{kind:"method",key:"render",value:function(){var e,t,i;return o`
|
||||
<ha-entity-attribute-picker
|
||||
.hass=${this.hass}
|
||||
.entityId=${(null===(e=this.selector.attribute)||void 0===e?void 0:e.entity_id)||(null===(t=this.context)||void 0===t?void 0:t.filter_entity)}
|
||||
.hideAttributes=${null===(i=this.selector.attribute)||void 0===i?void 0:i.hide_attributes}
|
||||
.value=${this.value}
|
||||
.label=${this.label}
|
||||
.helper=${this.helper}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
allow-custom-value
|
||||
></ha-entity-attribute-picker>
|
||||
`}},{kind:"method",key:"updated",value:function(e){var t;if(s(l(a.prototype),"updated",this).call(this,e),!this.value||null!==(t=this.selector.attribute)&&void 0!==t&&t.entity_id||!e.has("context"))return;const i=e.get("context");if(!this.context||(null==i?void 0:i.filter_entity)===this.context.filter_entity)return;let o=!1;if(this.context.filter_entity){const e=this.hass.states[this.context.filter_entity];e&&this.value in e.attributes||(o=!0)}else o=void 0!==this.value;o&&r(this,"value-changed",{value:void 0})}}]}}),u(t));export{c as HaSelectorAttribute};
|
||||
Binary file not shown.
@@ -1,63 +0,0 @@
|
||||
import{_ as e,j as i,e as t,y as s,O as d,d as a,n as l,t as c,a7 as r,E as o,G as n}from"./main-c66a9a06.js";import{g as v,d as u}from"./c.15496b0b.js";import{f as h,b as k}from"./c.6f18200a.js";import{S as p}from"./c.baaad129.js";import"./c.9381c7ae.js";import"./c.6eb9fcd4.js";import"./c.1024e243.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";import"./c.874c8cfd.js";import"./c.fa0ef026.js";import"./c.d2f13ac1.js";import"./c.bbadaeea.js";import"./c.930daaba.js";e([l("ha-devices-picker")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[t()],key:"value",value:void 0},{kind:"field",decorators:[t()],key:"helper",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"required",value:void 0},{kind:"field",decorators:[t({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[t({type:Array,attribute:"exclude-domains"})],key:"excludeDomains",value:void 0},{kind:"field",decorators:[t({attribute:"picked-device-label"}),t({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",key:"pickedDeviceLabel",value:void 0},{kind:"field",decorators:[t({attribute:"pick-device-label"})],key:"pickDeviceLabel",value:void 0},{kind:"field",decorators:[t()],key:"deviceFilter",value:void 0},{kind:"method",key:"render",value:function(){if(!this.hass)return s``;const e=this._currentDevices;return s`
|
||||
${e.map((e=>s`
|
||||
<div>
|
||||
<ha-device-picker
|
||||
allow-custom-entity
|
||||
.curValue=${e}
|
||||
.hass=${this.hass}
|
||||
.deviceFilter=${this.deviceFilter}
|
||||
.includeDomains=${this.includeDomains}
|
||||
.excludeDomains=${this.excludeDomains}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.value=${e}
|
||||
.label=${this.pickedDeviceLabel}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._deviceChanged}
|
||||
></ha-device-picker>
|
||||
</div>
|
||||
`))}
|
||||
<div>
|
||||
<ha-device-picker
|
||||
allow-custom-entity
|
||||
.hass=${this.hass}
|
||||
.helper=${this.helper}
|
||||
.deviceFilter=${this.deviceFilter}
|
||||
.includeDomains=${this.includeDomains}
|
||||
.excludeDomains=${this.excludeDomains}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.label=${this.pickDeviceLabel}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required&&!e.length}
|
||||
@value-changed=${this._addDevice}
|
||||
></ha-device-picker>
|
||||
</div>
|
||||
`}},{kind:"get",key:"_currentDevices",value:function(){return this.value||[]}},{kind:"method",key:"_updateDevices",value:async function(e){d(this,"value-changed",{value:e}),this.value=e}},{kind:"method",key:"_deviceChanged",value:function(e){e.stopPropagation();const i=e.currentTarget.curValue,t=e.detail.value;t!==i&&""===t&&(""===t?this._updateDevices(this._currentDevices.filter((e=>e!==i))):this._updateDevices(this._currentDevices.map((e=>e===i?t:e))))}},{kind:"method",key:"_addDevice",value:async function(e){e.stopPropagation();const i=e.detail.value;if(e.currentTarget.value="",!i)return;const t=this._currentDevices;t.includes(i)||this._updateDevices([...t,i])}},{kind:"field",static:!0,key:"styles",value:()=>a`
|
||||
div {
|
||||
margin-top: 8px;
|
||||
}
|
||||
`}]}}),i);let y=e([l("ha-selector-device")],(function(e,i){class d extends i{constructor(...i){super(...i),e(this)}}return{F:d,d:[{kind:"field",decorators:[t()],key:"hass",value:void 0},{kind:"field",decorators:[t()],key:"selector",value:void 0},{kind:"field",decorators:[c()],key:"_entitySources",value:void 0},{kind:"field",decorators:[c()],key:"_entities",value:void 0},{kind:"field",decorators:[t()],key:"value",value:void 0},{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"helper",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"required",value:()=>!0},{kind:"field",key:"_deviceIntegrationLookup",value:()=>r(v)},{kind:"method",key:"hassSubscribe",value:function(){return[u(this.hass.connection,(e=>{this._entities=e.filter((e=>null!==e.device_id))}))]}},{kind:"method",key:"updated",value:function(e){var i;o(n(d.prototype),"updated",this).call(this,e),e.has("selector")&&null!==(i=this.selector.device)&&void 0!==i&&i.integration&&!this._entitySources&&h(this.hass).then((e=>{this._entitySources=e}))}},{kind:"method",key:"render",value:function(){var e,i,t,d,a,l,c,r;return null!==(e=this.selector.device)&&void 0!==e&&e.integration&&!this._entitySources?s``:null!==(i=this.selector.device)&&void 0!==i&&i.multiple?s`
|
||||
${this.label?s`<label>${this.label}</label>`:""}
|
||||
<ha-devices-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.helper=${this.helper}
|
||||
.deviceFilter=${this._filterDevices}
|
||||
.includeDeviceClasses=${null!==(t=this.selector.device.entity)&&void 0!==t&&t.device_class?[this.selector.device.entity.device_class]:void 0}
|
||||
.includeDomains=${null!==(d=this.selector.device.entity)&&void 0!==d&&d.domain?[this.selector.device.entity.domain]:void 0}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
></ha-devices-picker>
|
||||
`:s`
|
||||
<ha-device-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.label=${this.label}
|
||||
.helper=${this.helper}
|
||||
.deviceFilter=${this._filterDevices}
|
||||
.includeDeviceClasses=${null!==(a=this.selector.device)&&void 0!==a&&null!==(l=a.entity)&&void 0!==l&&l.device_class?[this.selector.device.entity.device_class]:void 0}
|
||||
.includeDomains=${null!==(c=this.selector.device)&&void 0!==c&&null!==(r=c.entity)&&void 0!==r&&r.domain?[this.selector.device.entity.domain]:void 0}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
allow-custom-entity
|
||||
></ha-device-picker>
|
||||
`}},{kind:"field",key:"_filterDevices",value(){return e=>{const i=this._entitySources&&this._entities?this._deviceIntegrationLookup(this._entitySources,this._entities):void 0;return!this.selector.device||k(this.selector.device,e,i)}}}]}}),p(i));export{y as HaDeviceSelector};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1 +0,0 @@
|
||||
function r(r){return void 0===r||Array.isArray(r)?r:[r]}export{r as e};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,14 +0,0 @@
|
||||
import{_ as e,H as i,e as t,y as s,n as o}from"./main-c66a9a06.js";import"./c.e8169f76.js";import"./c.b914d43e.js";import"./c.8e28b461.js";let c=e([o("hacs-progress-dialog")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t()],key:"title",value:void 0},{kind:"field",decorators:[t()],key:"content",value:void 0},{kind:"field",decorators:[t()],key:"confirmText",value:void 0},{kind:"field",decorators:[t()],key:"confirm",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"_inProgress",value:()=>!1},{kind:"method",key:"shouldUpdate",value:function(e){return e.has("active")||e.has("title")||e.has("content")||e.has("confirmText")||e.has("confirm")||e.has("_inProgress")}},{kind:"method",key:"render",value:function(){return this.active?s`
|
||||
<hacs-dialog .active=${this.active} .hass=${this.hass} title=${this.title||""}>
|
||||
<div class="content">
|
||||
${this.content||""}
|
||||
</div>
|
||||
<mwc-button slot="secondaryaction" ?disabled=${this._inProgress} @click=${this._close}>
|
||||
${this.hacs.localize("common.cancel")}
|
||||
</mwc-button>
|
||||
<mwc-button slot="primaryaction" @click=${this._confirmed}>
|
||||
${this._inProgress?s`<ha-circular-progress active size="small"></ha-circular-progress>`:this.confirmText||this.hacs.localize("common.yes")}</mwc-button
|
||||
>
|
||||
</mwc-button>
|
||||
</hacs-dialog>
|
||||
`:s``}},{kind:"method",key:"_confirmed",value:async function(){this._inProgress=!0,await this.confirm(),this._inProgress=!1,this._close()}},{kind:"method",key:"_close",value:function(){this.active=!1,this.dispatchEvent(new Event("hacs-dialog-closed",{bubbles:!0,composed:!0}))}}]}}),i);export{c as HacsProgressDialog};
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
import{O as o}from"./main-c66a9a06.js";const a=()=>import("./c.5faead67.js"),i=(i,l,m)=>new Promise((n=>{const r=l.cancel,s=l.confirm;o(i,"show-dialog",{dialogTag:"dialog-box",dialogImport:a,dialogParams:{...l,...m,cancel:()=>{n(!(null==m||!m.prompt)&&null),r&&r()},confirm:o=>{n(null==m||!m.prompt||o),s&&s(o)}}})})),l=(o,a)=>i(o,a),m=(o,a)=>i(o,a,{confirmation:!0}),n=(o,a)=>i(o,a,{prompt:!0});export{l as a,n as b,m as s};
|
||||
Binary file not shown.
@@ -1,65 +0,0 @@
|
||||
import{_ as e,e as i,y as t,O as a,d as r,n as s,j as d,t as l,a7 as o}from"./main-c66a9a06.js";import{g as n,d as c}from"./c.15496b0b.js";import{f as u,a as h,b as v}from"./c.6f18200a.js";import{S as k}from"./c.baaad129.js";import"./c.a47e7fac.js";import"./c.6eb9fcd4.js";import"./c.1024e243.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";import"./c.874c8cfd.js";import"./c.fa0ef026.js";import"./c.d2f13ac1.js";import"./c.4b0dc107.js";import"./c.bbadaeea.js";import"./c.930daaba.js";e([s("ha-areas-picker")],(function(e,s){return{F:class extends s{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[i({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i()],key:"placeholder",value:void 0},{kind:"field",decorators:[i({type:Boolean,attribute:"no-add"})],key:"noAdd",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"exclude-domains"})],key:"excludeDomains",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[i()],key:"deviceFilter",value:void 0},{kind:"field",decorators:[i()],key:"entityFilter",value:void 0},{kind:"field",decorators:[i({attribute:"picked-area-label"})],key:"pickedAreaLabel",value:void 0},{kind:"field",decorators:[i({attribute:"pick-area-label"})],key:"pickAreaLabel",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:void 0},{kind:"method",key:"render",value:function(){if(!this.hass)return t``;const e=this._currentAreas;return t`
|
||||
${e.map((e=>t`
|
||||
<div>
|
||||
<ha-area-picker
|
||||
.curValue=${e}
|
||||
.noAdd=${this.noAdd}
|
||||
.hass=${this.hass}
|
||||
.value=${e}
|
||||
.label=${this.pickedAreaLabel}
|
||||
.includeDomains=${this.includeDomains}
|
||||
.excludeDomains=${this.excludeDomains}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.deviceFilter=${this.deviceFilter}
|
||||
.entityFilter=${this.entityFilter}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._areaChanged}
|
||||
></ha-area-picker>
|
||||
</div>
|
||||
`))}
|
||||
<div>
|
||||
<ha-area-picker
|
||||
.noAdd=${this.noAdd}
|
||||
.hass=${this.hass}
|
||||
.label=${this.pickAreaLabel}
|
||||
.helper=${this.helper}
|
||||
.includeDomains=${this.includeDomains}
|
||||
.excludeDomains=${this.excludeDomains}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.deviceFilter=${this.deviceFilter}
|
||||
.entityFilter=${this.entityFilter}
|
||||
.disabled=${this.disabled}
|
||||
.placeholder=${this.placeholder}
|
||||
.required=${this.required&&!e.length}
|
||||
@value-changed=${this._addArea}
|
||||
></ha-area-picker>
|
||||
</div>
|
||||
`}},{kind:"get",key:"_currentAreas",value:function(){return this.value||[]}},{kind:"method",key:"_updateAreas",value:async function(e){this.value=e,a(this,"value-changed",{value:e})}},{kind:"method",key:"_areaChanged",value:function(e){e.stopPropagation();const i=e.currentTarget.curValue,t=e.detail.value;if(t===i)return;const a=this._currentAreas;t&&!a.includes(t)?this._updateAreas(a.map((e=>e===i?t:e))):this._updateAreas(a.filter((e=>e!==i)))}},{kind:"method",key:"_addArea",value:function(e){e.stopPropagation();const i=e.detail.value;if(!i)return;e.currentTarget.value="";const t=this._currentAreas;t.includes(i)||this._updateAreas([...t,i])}},{kind:"field",static:!0,key:"styles",value:()=>r`
|
||||
div {
|
||||
margin-top: 8px;
|
||||
}
|
||||
`}]}}),k(d));let p=e([s("ha-selector-area")],(function(e,a){return{F:class extends a{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[i()],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"selector",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!0},{kind:"field",decorators:[l()],key:"_entitySources",value:void 0},{kind:"field",decorators:[l()],key:"_entities",value:void 0},{kind:"field",key:"_deviceIntegrationLookup",value:()=>o(n)},{kind:"method",key:"hassSubscribe",value:function(){return[c(this.hass.connection,(e=>{this._entities=e.filter((e=>null!==e.device_id))}))]}},{kind:"method",key:"updated",value:function(e){var i,t,a,r;e.has("selector")&&(null!==(i=this.selector.area)&&void 0!==i&&null!==(t=i.device)&&void 0!==t&&t.integration||null!==(a=this.selector.area)&&void 0!==a&&null!==(r=a.entity)&&void 0!==r&&r.integration)&&!this._entitySources&&u(this.hass).then((e=>{this._entitySources=e}))}},{kind:"method",key:"render",value:function(){var e,i,a,r,s;return(null!==(e=this.selector.area)&&void 0!==e&&null!==(i=e.device)&&void 0!==i&&i.integration||null!==(a=this.selector.area)&&void 0!==a&&null!==(r=a.entity)&&void 0!==r&&r.integration)&&!this._entitySources?t``:null!==(s=this.selector.area)&&void 0!==s&&s.multiple?t`
|
||||
<ha-areas-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.helper=${this.helper}
|
||||
.pickAreaLabel=${this.label}
|
||||
no-add
|
||||
.deviceFilter=${this._filterDevices}
|
||||
.entityFilter=${this._filterEntities}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
></ha-areas-picker>
|
||||
`:t`
|
||||
<ha-area-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.label=${this.label}
|
||||
.helper=${this.helper}
|
||||
no-add
|
||||
.deviceFilter=${this._filterDevices}
|
||||
.entityFilter=${this._filterEntities}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
></ha-area-picker>
|
||||
`}},{kind:"field",key:"_filterEntities",value(){return e=>{var i;return null===(i=this.selector.area)||void 0===i||!i.entity||h(this.selector.area.entity,e,this._entitySources)}}},{kind:"field",key:"_filterDevices",value(){return e=>{var i;if(null===(i=this.selector.area)||void 0===i||!i.device)return!0;const t=this._entitySources&&this._entities?this._deviceIntegrationLookup(this._entitySources,this._entities):void 0;return v(this.selector.area.device,e,t)}}}]}}),k(d));export{p as HaAreaSelector};
|
||||
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
import{_ as r,j as e,e as t,t as s,y as i,af as o,n as a}from"./main-c66a9a06.js";import{e as n,c}from"./c.50bfd408.js";const d={hacs_repository:{redirect:"/hacs/repository",params:{owner:"string",repository:"string",category:"string?"}}};r([a("hacs-my-redirect")],(function(r,e){return{F:class extends e{constructor(...e){super(...e),r(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[t({attribute:!1})],key:"hacs",value:void 0},{kind:"field",decorators:[t({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[s()],key:"_error",value:void 0},{kind:"method",key:"firstUpdated",value:function(r){const e=this.route.path.indexOf("/",1),t=this.route.path.substr(e+1),s=d[t];if(!s)return void(this._error=this.hacs.localize("my.not_supported",{link:i`<a
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href="https://my.home-assistant.io/faq.html#supported-pages"
|
||||
>
|
||||
${this.hacs.localize("my.faq_link")}
|
||||
</a>`}));let a;try{a=this._createRedirectUrl(s)}catch(r){return void(this._error=this.hacs.localize("my.error"))}o(a,{replace:!0})}},{kind:"method",key:"render",value:function(){return this._error?i`<hass-error-screen .error=${this._error}></hass-error-screen>`:i``}},{kind:"method",key:"_createRedirectUrl",value:function(r){const e=this._createRedirectParams(r);return`${r.redirect}${e}`}},{kind:"method",key:"_createRedirectParams",value:function(r){const e=n();if(!r.params&&!Object.keys(e).length)return"";const t={};for(const[s,i]of Object.entries(r.params||{}))if(e[s]||!i.endsWith("?")){if(!e[s]||!this._checkParamType(i,e[s]))throw Error();t[s]=e[s]}return`?${c(t)}`}},{kind:"method",key:"_checkParamType",value:function(r,e){return"string"===r||"string?"===r}}]}}),e);export{d as REDIRECTS};
|
||||
Binary file not shown.
@@ -1,41 +0,0 @@
|
||||
import{_ as e,j as i,e as t,t as o,i as a,y as n,O as r,n as d,d as s}from"./main-c66a9a06.js";import"./c.41d13611.js";import{g as l}from"./c.f2bb3724.js";import{d as c}from"./c.05172f3d.js";import{c as u}from"./c.874c8cfd.js";import{b as h}from"./c.07e395f8.js";import"./c.bbadaeea.js";import"./c.8e28b461.js";import"./c.a5550d10.js";import"./c.930daaba.js";e([d("ha-config-entry-picker")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[t()],key:"integration",value:void 0},{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"value",value:()=>""},{kind:"field",decorators:[t()],key:"helper",value:void 0},{kind:"field",decorators:[o()],key:"_configEntries",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[a("ha-combo-box")],key:"_comboBox",value:void 0},{kind:"method",key:"open",value:function(){var e;null===(e=this._comboBox)||void 0===e||e.open()}},{kind:"method",key:"focus",value:function(){var e;null===(e=this._comboBox)||void 0===e||e.focus()}},{kind:"method",key:"firstUpdated",value:function(){this._getConfigEntries()}},{kind:"field",key:"_rowRenderer",value(){return e=>{var i;return n`<mwc-list-item twoline graphic="icon">
|
||||
<span
|
||||
>${e.title||this.hass.localize("ui.panel.config.integrations.config_entry.unnamed_entry")}</span
|
||||
>
|
||||
<span slot="secondary">${e.localized_domain_name}</span>
|
||||
<img
|
||||
slot="graphic"
|
||||
src=${h({domain:e.domain,type:"icon",darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode})}
|
||||
referrerpolicy="no-referrer"
|
||||
@error=${this._onImageError}
|
||||
@load=${this._onImageLoad}
|
||||
/>
|
||||
</mwc-list-item>`}}},{kind:"method",key:"render",value:function(){return this._configEntries?n`
|
||||
<ha-combo-box
|
||||
.hass=${this.hass}
|
||||
.label=${void 0===this.label&&this.hass?this.hass.localize("ui.components.config-entry-picker.config_entry"):this.label}
|
||||
.value=${this._value}
|
||||
.required=${this.required}
|
||||
.disabled=${this.disabled}
|
||||
.helper=${this.helper}
|
||||
.renderer=${this._rowRenderer}
|
||||
.items=${this._configEntries}
|
||||
item-value-path="entry_id"
|
||||
item-id-path="entry_id"
|
||||
item-label-path="title"
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-combo-box>
|
||||
`:n``}},{kind:"method",key:"_onImageLoad",value:function(e){e.target.style.visibility="initial"}},{kind:"method",key:"_onImageError",value:function(e){e.target.style.visibility="hidden"}},{kind:"method",key:"_getConfigEntries",value:async function(){l(this.hass,{type:["device","hub","service"],domain:this.integration}).then((e=>{this._configEntries=e.map((e=>({...e,localized_domain_name:c(this.hass.localize,e.domain)}))).sort(((e,i)=>u(e.localized_domain_name+e.title,i.localized_domain_name+i.title)))}))}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const i=e.detail.value;i!==this._value&&this._setValue(i)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{r(this,"value-changed",{value:e}),r(this,"change")}),0)}}]}}),i);let v=e([d("ha-selector-config_entry")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[t({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[t()],key:"value",value:void 0},{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"helper",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){var e;return n`<ha-config-entry-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.label=${this.label}
|
||||
.helper=${this.helper}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
.integration=${null===(e=this.selector.config_entry)||void 0===e?void 0:e.integration}
|
||||
allow-custom-entity
|
||||
></ha-config-entry-picker>`}},{kind:"field",static:!0,key:"styles",value:()=>s`
|
||||
ha-config-entry-picker {
|
||||
width: 100%;
|
||||
}
|
||||
`}]}}),i);export{v as HaConfigEntrySelector};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,54 +0,0 @@
|
||||
import{_ as e,j as t,e as i,t as a,y as s,a8 as o,a9 as l,O as d,d as r,n}from"./main-c66a9a06.js";import"./c.a6328fdc.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";let h=e([n("ha-selector-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[i()],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"name",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"placeholder",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i()],key:"selector",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:()=>!0},{kind:"field",decorators:[a()],key:"_unmaskedPassword",value:()=>!1},{kind:"method",key:"render",value:function(){var e,t,i,a,d,r,n;return null!==(e=this.selector.text)&&void 0!==e&&e.multiline?s`<ha-textarea
|
||||
.name=${this.name}
|
||||
.label=${this.label}
|
||||
.placeholder=${this.placeholder}
|
||||
.value=${this.value||""}
|
||||
.helper=${this.helper}
|
||||
helperPersistent
|
||||
.disabled=${this.disabled}
|
||||
@input=${this._handleChange}
|
||||
autocapitalize="none"
|
||||
.autocomplete=${null===(n=this.selector.text)||void 0===n?void 0:n.autocomplete}
|
||||
spellcheck="false"
|
||||
.required=${this.required}
|
||||
autogrow
|
||||
></ha-textarea>`:s`<ha-textfield
|
||||
.name=${this.name}
|
||||
.value=${this.value||""}
|
||||
.placeholder=${this.placeholder||""}
|
||||
.helper=${this.helper}
|
||||
helperPersistent
|
||||
.disabled=${this.disabled}
|
||||
.type=${this._unmaskedPassword?"text":null===(t=this.selector.text)||void 0===t?void 0:t.type}
|
||||
@input=${this._handleChange}
|
||||
.label=${this.label||""}
|
||||
.suffix=${"password"===(null===(i=this.selector.text)||void 0===i?void 0:i.type)?s`<div style="width: 24px"></div>`:null===(a=this.selector.text)||void 0===a?void 0:a.suffix}
|
||||
.required=${this.required}
|
||||
.autocomplete=${null===(d=this.selector.text)||void 0===d?void 0:d.autocomplete}
|
||||
></ha-textfield>
|
||||
${"password"===(null===(r=this.selector.text)||void 0===r?void 0:r.type)?s`<ha-icon-button
|
||||
toggles
|
||||
.label=${(this._unmaskedPassword?"Hide":"Show")+" password"}
|
||||
@click=${this._toggleUnmaskedPassword}
|
||||
.path=${this._unmaskedPassword?o:l}
|
||||
></ha-icon-button>`:""}`}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",key:"_handleChange",value:function(e){let t=e.target.value;this.value!==t&&(""!==t||this.required||(t=void 0),d(this,"value-changed",{value:t}))}},{kind:"get",static:!0,key:"styles",value:function(){return r`
|
||||
:host {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
ha-textarea,
|
||||
ha-textfield {
|
||||
width: 100%;
|
||||
}
|
||||
ha-icon-button {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
--mdc-icon-button-size: 36px;
|
||||
--mdc-icon-size: 20px;
|
||||
color: var(--secondary-text-color);
|
||||
inset-inline-start: initial;
|
||||
inset-inline-end: 10px;
|
||||
direction: var(--direction);
|
||||
}
|
||||
`}}]}}),t);export{h as HaTextSelector};
|
||||
Binary file not shown.
@@ -1,266 +0,0 @@
|
||||
import{_ as e,e as i,t,i as a,y as d,eH as s,b2 as n,aD as c,k as r,eI as o,a4 as l,O as h,d as p,Y as u,n as v,j as _,a7 as m,E as y,G as k}from"./main-c66a9a06.js";import{b as g,s as f,d as b,a as $,g as x}from"./c.15496b0b.js";import{f as j,a as F,b as D}from"./c.6f18200a.js";import{S as z}from"./c.baaad129.js";import{c as C}from"./c.930daaba.js";import"./c.24287846.js";import{e as w}from"./c.3f62d98e.js";import{c as I}from"./c.d2f13ac1.js";import{c as P}from"./c.6eb9fcd4.js";import"./c.9381c7ae.js";import"./c.997c429c.js";import"./c.a47e7fac.js";import"./c.bbadaeea.js";import"./c.a5550d10.js";import"./c.8e28b461.js";import"./c.41d13611.js";import"./c.874c8cfd.js";import"./c.fa0ef026.js";import"./c.1024e243.js";import"./c.d0c1a17e.js";import"./c.811f664e.js";import"./c.04ecc0ad.js";import"./c.2610e8cd.js";import"./c.4b0dc107.js";e([v("ha-target-picker")],(function(e,v){return{F:class extends v{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[i({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[i({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[i()],key:"deviceFilter",value:void 0},{kind:"field",decorators:[i()],key:"entityRegFilter",value:void 0},{kind:"field",decorators:[i()],key:"entityFilter",value:void 0},{kind:"field",decorators:[i({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"horizontal",value:()=>!1},{kind:"field",decorators:[t()],key:"_areas",value:void 0},{kind:"field",decorators:[t()],key:"_devices",value:void 0},{kind:"field",decorators:[t()],key:"_entities",value:void 0},{kind:"field",decorators:[t()],key:"_addMode",value:void 0},{kind:"field",decorators:[a("#input")],key:"_inputElement",value:void 0},{kind:"method",key:"hassSubscribe",value:function(){return[g(this.hass.connection,(e=>{const i={};for(const t of e)i[t.area_id]=t;this._areas=i})),f(this.hass.connection,(e=>{const i={};for(const t of e)i[t.id]=t;this._devices=i})),b(this.hass.connection,(e=>{this._entities=e}))]}},{kind:"method",key:"render",value:function(){return this._areas&&this._devices&&this._entities?d`
|
||||
${this.horizontal?d`
|
||||
<div class="horizontal-container">
|
||||
${this._renderChips()} ${this._renderPicker()}
|
||||
</div>
|
||||
${this._renderItems()}
|
||||
`:d`
|
||||
<div>
|
||||
${this._renderItems()} ${this._renderPicker()}
|
||||
${this._renderChips()}
|
||||
</div>
|
||||
`}
|
||||
`:d``}},{kind:"method",key:"_renderItems",value:function(){var e,i,t;return d`
|
||||
<div class="mdc-chip-set items">
|
||||
${null!==(e=this.value)&&void 0!==e&&e.area_id?w(this.value.area_id).map((e=>{const i=this._areas[e];return this._renderChip("area_id",e,(null==i?void 0:i.name)||e,void 0,s)})):""}
|
||||
${null!==(i=this.value)&&void 0!==i&&i.device_id?w(this.value.device_id).map((e=>{const i=this._devices[e];return this._renderChip("device_id",e,i?$(i,this.hass):e,void 0,n)})):""}
|
||||
${null!==(t=this.value)&&void 0!==t&&t.entity_id?w(this.value.entity_id).map((e=>{const i=this.hass.states[e];return this._renderChip("entity_id",e,i?P(i):e,i)})):""}
|
||||
</div>
|
||||
`}},{kind:"method",key:"_renderChips",value:function(){return d`
|
||||
<div class="mdc-chip-set">
|
||||
<div
|
||||
class="mdc-chip area_id add"
|
||||
.type=${"area_id"}
|
||||
@click=${this._showPicker}
|
||||
>
|
||||
<div class="mdc-chip__ripple"></div>
|
||||
<ha-svg-icon
|
||||
class="mdc-chip__icon mdc-chip__icon--leading"
|
||||
.path=${c}
|
||||
></ha-svg-icon>
|
||||
<span role="gridcell">
|
||||
<span role="button" tabindex="0" class="mdc-chip__primary-action">
|
||||
<span class="mdc-chip__text"
|
||||
>${this.hass.localize("ui.components.target-picker.add_area_id")}</span
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="mdc-chip device_id add"
|
||||
.type=${"device_id"}
|
||||
@click=${this._showPicker}
|
||||
>
|
||||
<div class="mdc-chip__ripple"></div>
|
||||
<ha-svg-icon
|
||||
class="mdc-chip__icon mdc-chip__icon--leading"
|
||||
.path=${c}
|
||||
></ha-svg-icon>
|
||||
<span role="gridcell">
|
||||
<span role="button" tabindex="0" class="mdc-chip__primary-action">
|
||||
<span class="mdc-chip__text"
|
||||
>${this.hass.localize("ui.components.target-picker.add_device_id")}</span
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="mdc-chip entity_id add"
|
||||
.type=${"entity_id"}
|
||||
@click=${this._showPicker}
|
||||
>
|
||||
<div class="mdc-chip__ripple"></div>
|
||||
<ha-svg-icon
|
||||
class="mdc-chip__icon mdc-chip__icon--leading"
|
||||
.path=${c}
|
||||
></ha-svg-icon>
|
||||
<span role="gridcell">
|
||||
<span role="button" tabindex="0" class="mdc-chip__primary-action">
|
||||
<span class="mdc-chip__text"
|
||||
>${this.hass.localize("ui.components.target-picker.add_entity_id")}</span
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
${this.helper?d`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`:""}
|
||||
`}},{kind:"method",key:"_showPicker",value:async function(e){var i,t;this._addMode=e.currentTarget.type,await this.updateComplete,await(null===(i=this._inputElement)||void 0===i?void 0:i.focus()),await(null===(t=this._inputElement)||void 0===t?void 0:t.open())}},{kind:"method",key:"_renderChip",value:function(e,i,t,a,s){return d`
|
||||
<div
|
||||
class="mdc-chip ${r({[e]:!0})}"
|
||||
>
|
||||
${s?d`<ha-svg-icon
|
||||
class="mdc-chip__icon mdc-chip__icon--leading"
|
||||
.path=${s}
|
||||
></ha-svg-icon>`:""}
|
||||
${a?d`<ha-state-icon
|
||||
class="mdc-chip__icon mdc-chip__icon--leading"
|
||||
.state=${a}
|
||||
></ha-state-icon>`:""}
|
||||
<span role="gridcell">
|
||||
<span role="button" tabindex="0" class="mdc-chip__primary-action">
|
||||
<span class="mdc-chip__text">${t}</span>
|
||||
</span>
|
||||
</span>
|
||||
${"entity_id"===e?"":d` <span role="gridcell">
|
||||
<ha-icon-button
|
||||
class="expand-btn mdc-chip__icon mdc-chip__icon--trailing"
|
||||
tabindex="-1"
|
||||
role="button"
|
||||
.label=${this.hass.localize("ui.components.target-picker.expand")}
|
||||
.path=${o}
|
||||
hideTooltip
|
||||
.id=${i}
|
||||
.type=${e}
|
||||
@click=${this._handleExpand}
|
||||
></ha-icon-button>
|
||||
<paper-tooltip class="expand" animation-delay="0"
|
||||
>${this.hass.localize(`ui.components.target-picker.expand_${e}`)}</paper-tooltip
|
||||
>
|
||||
</span>`}
|
||||
<span role="gridcell">
|
||||
<ha-icon-button
|
||||
class="mdc-chip__icon mdc-chip__icon--trailing"
|
||||
tabindex="-1"
|
||||
role="button"
|
||||
.label=${this.hass.localize("ui.components.target-picker.remove")}
|
||||
.path=${l}
|
||||
hideTooltip
|
||||
.id=${i}
|
||||
.type=${e}
|
||||
@click=${this._handleRemove}
|
||||
></ha-icon-button>
|
||||
<paper-tooltip animation-delay="0"
|
||||
>${this.hass.localize(`ui.components.target-picker.remove_${e}`)}</paper-tooltip
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
`}},{kind:"method",key:"_renderPicker",value:function(){switch(this._addMode){case"area_id":return d`
|
||||
<ha-area-picker
|
||||
.hass=${this.hass}
|
||||
id="input"
|
||||
.type=${"area_id"}
|
||||
.label=${this.hass.localize("ui.components.target-picker.add_area_id")}
|
||||
no-add
|
||||
.deviceFilter=${this.deviceFilter}
|
||||
.entityFilter=${this.entityRegFilter}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.includeDomains=${this.includeDomains}
|
||||
@value-changed=${this._targetPicked}
|
||||
></ha-area-picker>
|
||||
`;case"device_id":return d`
|
||||
<ha-device-picker
|
||||
.hass=${this.hass}
|
||||
id="input"
|
||||
.type=${"device_id"}
|
||||
.label=${this.hass.localize("ui.components.target-picker.add_device_id")}
|
||||
.deviceFilter=${this.deviceFilter}
|
||||
.entityFilter=${this.entityRegFilter}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.includeDomains=${this.includeDomains}
|
||||
@value-changed=${this._targetPicked}
|
||||
></ha-device-picker>
|
||||
`;case"entity_id":return d`
|
||||
<ha-entity-picker
|
||||
.hass=${this.hass}
|
||||
id="input"
|
||||
.type=${"entity_id"}
|
||||
.label=${this.hass.localize("ui.components.target-picker.add_entity_id")}
|
||||
.entityFilter=${this.entityFilter}
|
||||
.includeDeviceClasses=${this.includeDeviceClasses}
|
||||
.includeDomains=${this.includeDomains}
|
||||
@value-changed=${this._targetPicked}
|
||||
allow-custom-entity
|
||||
></ha-entity-picker>
|
||||
`}return d``}},{kind:"method",key:"_targetPicked",value:function(e){if(e.stopPropagation(),!e.detail.value)return;const i=e.detail.value,t=e.currentTarget;t.value="",this._addMode=void 0,h(this,"value-changed",{value:this.value?{...this.value,[t.type]:this.value[t.type]?[...w(this.value[t.type]),i]:i}:{[t.type]:i}})}},{kind:"method",key:"_handleExpand",value:function(e){const i=e.currentTarget,t=[],a=[];if("area_id"===i.type)Object.values(this._devices).forEach((e=>{var a;e.area_id!==i.id||null!==(a=this.value.device_id)&&void 0!==a&&a.includes(e.id)||!this._deviceMeetsFilter(e)||t.push(e.id)})),this._entities.forEach((e=>{var t;e.area_id!==i.id||null!==(t=this.value.entity_id)&&void 0!==t&&t.includes(e.entity_id)||!this._entityRegMeetsFilter(e)||a.push(e.entity_id)}));else{if("device_id"!==i.type)return;this._entities.forEach((e=>{var t;e.device_id!==i.id||null!==(t=this.value.entity_id)&&void 0!==t&&t.includes(e.entity_id)||!this._entityRegMeetsFilter(e)||a.push(e.entity_id)}))}let d=this.value;a.length&&(d=this._addItems(d,"entity_id",a)),t.length&&(d=this._addItems(d,"device_id",t)),d=this._removeItem(d,i.type,i.id),h(this,"value-changed",{value:d})}},{kind:"method",key:"_handleRemove",value:function(e){const i=e.currentTarget;h(this,"value-changed",{value:this._removeItem(this.value,i.type,i.id)})}},{kind:"method",key:"_addItems",value:function(e,i,t){return{...e,[i]:e[i]?w(e[i]).concat(t):t}}},{kind:"method",key:"_removeItem",value:function(e,i,t){const a=w(e[i]).filter((e=>String(e)!==t));if(a.length)return{...e,[i]:a};const d={...e};return delete d[i],Object.keys(d).length?d:void 0}},{kind:"method",key:"_deviceMeetsFilter",value:function(e){var i;const t=null===(i=this._entities)||void 0===i?void 0:i.filter((i=>i.device_id===e.id));if(this.includeDomains){if(!t||!t.length)return!1;if(!t.some((e=>this.includeDomains.includes(I(e.entity_id)))))return!1}if(this.includeDeviceClasses){if(!t||!t.length)return!1;if(!t.some((e=>{const i=this.hass.states[e.entity_id];return!!i&&(i.attributes.device_class&&this.includeDeviceClasses.includes(i.attributes.device_class))})))return!1}return!this.deviceFilter||this.deviceFilter(e)}},{kind:"method",key:"_entityRegMeetsFilter",value:function(e){if(e.entity_category)return!1;if(this.includeDomains&&!this.includeDomains.includes(I(e.entity_id)))return!1;if(this.includeDeviceClasses){const i=this.hass.states[e.entity_id];if(!i)return!1;if(!i.attributes.device_class||!this.includeDeviceClasses.includes(i.attributes.device_class))return!1}return!this.entityRegFilter||this.entityRegFilter(e)}},{kind:"get",static:!0,key:"styles",value:function(){return p`
|
||||
${u(C)}
|
||||
.horizontal-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
min-height: 56px;
|
||||
align-items: center;
|
||||
}
|
||||
.mdc-chip {
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
.items {
|
||||
z-index: 2;
|
||||
}
|
||||
.mdc-chip-set {
|
||||
padding: 4px 0;
|
||||
}
|
||||
.mdc-chip.add {
|
||||
color: rgba(0, 0, 0, 0.87);
|
||||
}
|
||||
.mdc-chip:not(.add) {
|
||||
cursor: default;
|
||||
}
|
||||
.mdc-chip ha-icon-button {
|
||||
--mdc-icon-button-size: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
outline: none;
|
||||
}
|
||||
.mdc-chip ha-icon-button ha-svg-icon {
|
||||
border-radius: 50%;
|
||||
background: var(--secondary-text-color);
|
||||
}
|
||||
.mdc-chip__icon.mdc-chip__icon--trailing {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
--mdc-icon-size: 14px;
|
||||
color: var(--secondary-text-color);
|
||||
margin-inline-start: 4px !important;
|
||||
margin-inline-end: -4px !important;
|
||||
direction: var(--direction);
|
||||
}
|
||||
.mdc-chip__icon--leading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
--mdc-icon-size: 20px;
|
||||
border-radius: 50%;
|
||||
padding: 6px;
|
||||
margin-left: -14px !important;
|
||||
margin-inline-start: -14px !important;
|
||||
margin-inline-end: 4px !important;
|
||||
direction: var(--direction);
|
||||
}
|
||||
.expand-btn {
|
||||
margin-right: 0;
|
||||
}
|
||||
.mdc-chip.area_id:not(.add) {
|
||||
border: 2px solid #fed6a4;
|
||||
background: var(--card-background-color);
|
||||
}
|
||||
.mdc-chip.area_id:not(.add) .mdc-chip__icon--leading,
|
||||
.mdc-chip.area_id.add {
|
||||
background: #fed6a4;
|
||||
}
|
||||
.mdc-chip.device_id:not(.add) {
|
||||
border: 2px solid #a8e1fb;
|
||||
background: var(--card-background-color);
|
||||
}
|
||||
.mdc-chip.device_id:not(.add) .mdc-chip__icon--leading,
|
||||
.mdc-chip.device_id.add {
|
||||
background: #a8e1fb;
|
||||
}
|
||||
.mdc-chip.entity_id:not(.add) {
|
||||
border: 2px solid #d2e7b9;
|
||||
background: var(--card-background-color);
|
||||
}
|
||||
.mdc-chip.entity_id:not(.add) .mdc-chip__icon--leading,
|
||||
.mdc-chip.entity_id.add {
|
||||
background: #d2e7b9;
|
||||
}
|
||||
.mdc-chip:hover {
|
||||
z-index: 5;
|
||||
}
|
||||
paper-tooltip.expand {
|
||||
min-width: 200px;
|
||||
}
|
||||
:host([disabled]) .mdc-chip {
|
||||
opacity: var(--light-disabled-opacity);
|
||||
pointer-events: none;
|
||||
}
|
||||
`}}]}}),z(_));let E=e([v("ha-selector-target")],(function(e,a){class s extends a{constructor(...i){super(...i),e(this)}}return{F:s,d:[{kind:"field",decorators:[i()],key:"hass",value:void 0},{kind:"field",decorators:[i()],key:"selector",value:void 0},{kind:"field",decorators:[i()],key:"value",value:void 0},{kind:"field",decorators:[i()],key:"label",value:void 0},{kind:"field",decorators:[i()],key:"helper",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[t()],key:"_entitySources",value:void 0},{kind:"field",decorators:[t()],key:"_entities",value:void 0},{kind:"field",key:"_deviceIntegrationLookup",value:()=>m(x)},{kind:"method",key:"hassSubscribe",value:function(){return[b(this.hass.connection,(e=>{this._entities=e.filter((e=>null!==e.device_id))}))]}},{kind:"method",key:"updated",value:function(e){var i,t,a,d;y(k(s.prototype),"updated",this).call(this,e),e.has("selector")&&(null!==(i=this.selector.target)&&void 0!==i&&null!==(t=i.device)&&void 0!==t&&t.integration||null!==(a=this.selector.target)&&void 0!==a&&null!==(d=a.entity)&&void 0!==d&&d.integration)&&!this._entitySources&&j(this.hass).then((e=>{this._entitySources=e}))}},{kind:"method",key:"render",value:function(){var e,i,t,a;return(null!==(e=this.selector.target)&&void 0!==e&&null!==(i=e.device)&&void 0!==i&&i.integration||null!==(t=this.selector.target)&&void 0!==t&&null!==(a=t.entity)&&void 0!==a&&a.integration)&&!this._entitySources?d``:d`<ha-target-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.helper=${this.helper}
|
||||
.deviceFilter=${this._filterDevices}
|
||||
.entityFilter=${this._filterEntities}
|
||||
.disabled=${this.disabled}
|
||||
></ha-target-picker>`}},{kind:"field",key:"_filterEntities",value(){return e=>{var i;return null===(i=this.selector.target)||void 0===i||!i.entity||F(this.selector.target.entity,e,this._entitySources)}}},{kind:"field",key:"_filterDevices",value(){return e=>{var i;if(null===(i=this.selector.target)||void 0===i||!i.device)return!0;const t=this._entitySources&&this._entities?this._deviceIntegrationLookup(this._entitySources,this._entities):void 0;return D(this.selector.target.device,e,t)}}},{kind:"get",static:!0,key:"styles",value:function(){return p`
|
||||
ha-target-picker {
|
||||
display: block;
|
||||
}
|
||||
`}}]}}),z(_));export{E as HaTargetSelector};
|
||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
import{_ as e,j as i,e as o,t as a,i as s,y as d,O as t,n,d as l}from"./main-c66a9a06.js";import{i as r}from"./c.21c042d4.js";import{s as c}from"./c.874c8cfd.js";import{a as u}from"./c.4b0dc107.js";const h=async e=>((e,i,o,a)=>{const[s,d,t]=e.split(".",3);return Number(s)>i||Number(s)===i&&(void 0===a?Number(d)>=o:Number(d)>o)||void 0!==a&&Number(s)===i&&Number(d)===o&&Number(t)>=a})(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}):(await e.callApi("GET","hassio/addons")).data,v=e=>d`<mwc-list-item twoline graphic="icon">
|
||||
<span>${e.name}</span>
|
||||
<span slot="secondary">${e.slug}</span>
|
||||
${e.icon?d`<img slot="graphic" .src="/api/hassio/addons/${e.slug}/icon" />`:""}
|
||||
</mwc-list-item>`;e([n("ha-addon-picker")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[o()],key:"label",value:void 0},{kind:"field",decorators:[o()],key:"value",value:()=>""},{kind:"field",decorators:[o()],key:"helper",value:void 0},{kind:"field",decorators:[a()],key:"_addons",value:void 0},{kind:"field",decorators:[o({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[o({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[s("ha-combo-box")],key:"_comboBox",value:void 0},{kind:"method",key:"open",value:function(){var e;null===(e=this._comboBox)||void 0===e||e.open()}},{kind:"method",key:"focus",value:function(){var e;null===(e=this._comboBox)||void 0===e||e.focus()}},{kind:"method",key:"firstUpdated",value:function(){this._getAddons()}},{kind:"method",key:"render",value:function(){return this._addons?d`
|
||||
<ha-combo-box
|
||||
.hass=${this.hass}
|
||||
.label=${void 0===this.label&&this.hass?this.hass.localize("ui.components.addon-picker.addon"):this.label}
|
||||
.value=${this._value}
|
||||
.required=${this.required}
|
||||
.disabled=${this.disabled}
|
||||
.helper=${this.helper}
|
||||
.renderer=${v}
|
||||
.items=${this._addons}
|
||||
item-value-path="slug"
|
||||
item-id-path="slug"
|
||||
item-label-path="name"
|
||||
@value-changed=${this._addonChanged}
|
||||
></ha-combo-box>
|
||||
`:d``}},{kind:"method",key:"_getAddons",value:async function(){try{if(r(this.hass,"hassio")){const e=await h(this.hass);this._addons=e.addons.filter((e=>e.version)).sort(((e,i)=>c(e.name,i.name)))}else u(this,{title:this.hass.localize("ui.components.addon-picker.error.no_supervisor.title"),text:this.hass.localize("ui.components.addon-picker.error.no_supervisor.description")})}catch(e){u(this,{title:this.hass.localize("ui.components.addon-picker.error.fetch_addons.title"),text:this.hass.localize("ui.components.addon-picker.error.fetch_addons.description")})}}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_addonChanged",value:function(e){e.stopPropagation();const i=e.detail.value;i!==this._value&&this._setValue(i)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{t(this,"value-changed",{value:e}),t(this,"change")}),0)}}]}}),i);let k=e([n("ha-selector-addon")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[o()],key:"hass",value:void 0},{kind:"field",decorators:[o()],key:"selector",value:void 0},{kind:"field",decorators:[o()],key:"value",value:void 0},{kind:"field",decorators:[o()],key:"label",value:void 0},{kind:"field",decorators:[o()],key:"helper",value:void 0},{kind:"field",decorators:[o({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[o({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return d`<ha-addon-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.label=${this.label}
|
||||
.helper=${this.helper}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
allow-custom-entity
|
||||
></ha-addon-picker>`}},{kind:"field",static:!0,key:"styles",value:()=>l`
|
||||
ha-addon-picker {
|
||||
width: 100%;
|
||||
}
|
||||
`}]}}),i);export{k as HaAddonSelector};
|
||||
Binary file not shown.
@@ -1,204 +0,0 @@
|
||||
import{_ as t,j as o,e,E as a,G as i,y as s,a6 as r,d as n,n as h,t as c,ag as l,r as d,g as p,a7 as u,aN as f,aO as v,aP as y,aQ as b,aR as m,aS as k,c as g}from"./main-c66a9a06.js";import{e as _}from"./c.50bfd408.js";import"./c.930daaba.js";import"./c.070412a6.js";import{s as w}from"./c.4b0dc107.js";import{r as x,a as $}from"./c.271a0d49.js";import{c as z}from"./c.41d13611.js";import"./c.73c7fa75.js";import{f as j}from"./c.fe747ba2.js";import{m as L}from"./c.ba59af11.js";import"./c.24287846.js";import"./c.f2bb3724.js";import"./c.8e28b461.js";import"./c.743a15a1.js";t([h("hass-subpage")],(function(t,o){class h extends o{constructor(...o){super(...o),t(this)}}return{F:h,d:[{kind:"field",decorators:[e({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[e()],key:"header",value:void 0},{kind:"field",decorators:[e({type:Boolean,attribute:"main-page"})],key:"mainPage",value:()=>!1},{kind:"field",decorators:[e({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[e()],key:"backCallback",value:void 0},{kind:"field",decorators:[e({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[e({type:Boolean})],key:"supervisor",value:()=>!1},{kind:"field",decorators:[x(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"willUpdate",value:function(t){if(a(i(h.prototype),"willUpdate",this).call(this,t),!t.has("hass"))return;const o=t.get("hass");var e,s,r;o&&o.locale===this.hass.locale||(e=this,s="rtl",void 0!==(r=z(this.hass))&&(r=!!r),e.hasAttribute(s)?r||e.removeAttribute(s):!1!==r&&e.setAttribute(s,""))}},{kind:"method",key:"render",value:function(){var t;return s`
|
||||
<div class="toolbar">
|
||||
${this.mainPage||null!==(t=history.state)&&void 0!==t&&t.root?s`
|
||||
<ha-menu-button
|
||||
.hassio=${this.supervisor}
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
></ha-menu-button>
|
||||
`:this.backPath?s`
|
||||
<a href=${this.backPath}>
|
||||
<ha-icon-button-arrow-prev
|
||||
.hass=${this.hass}
|
||||
></ha-icon-button-arrow-prev>
|
||||
</a>
|
||||
`:s`
|
||||
<ha-icon-button-arrow-prev
|
||||
.hass=${this.hass}
|
||||
@click=${this._backTapped}
|
||||
></ha-icon-button-arrow-prev>
|
||||
`}
|
||||
|
||||
<div class="main-title">${this.header}</div>
|
||||
<slot name="toolbar-icon"></slot>
|
||||
</div>
|
||||
<div class="content" @scroll=${this._saveScrollPos}><slot></slot></div>
|
||||
<div id="fab">
|
||||
<slot name="fab"></slot>
|
||||
</div>
|
||||
`}},{kind:"method",decorators:[r({passive:!0})],key:"_saveScrollPos",value:function(t){this._savedScrollPos=t.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return n`
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
background-color: var(--primary-background-color);
|
||||
}
|
||||
|
||||
:host([narrow]) {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
height: var(--header-height);
|
||||
padding: 0 16px;
|
||||
pointer-events: none;
|
||||
background-color: var(--app-header-background-color);
|
||||
font-weight: 400;
|
||||
color: var(--app-header-text-color, white);
|
||||
border-bottom: var(--app-header-border-bottom, none);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.toolbar a {
|
||||
color: var(--sidebar-text-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ha-menu-button,
|
||||
ha-icon-button-arrow-prev,
|
||||
::slotted([slot="toolbar-icon"]) {
|
||||
pointer-events: auto;
|
||||
color: var(--sidebar-icon-color);
|
||||
}
|
||||
|
||||
.main-title {
|
||||
margin: 0 0 0 24px;
|
||||
line-height: 20px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: calc(100% - 1px - var(--header-height));
|
||||
overflow-y: auto;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
#fab {
|
||||
position: fixed;
|
||||
right: calc(16px + env(safe-area-inset-right));
|
||||
bottom: calc(16px + env(safe-area-inset-bottom));
|
||||
z-index: 1;
|
||||
}
|
||||
:host([narrow]) #fab.tabs {
|
||||
bottom: calc(84px + env(safe-area-inset-bottom));
|
||||
}
|
||||
#fab[is-wide] {
|
||||
bottom: 24px;
|
||||
right: 24px;
|
||||
}
|
||||
:host([rtl]) #fab {
|
||||
right: auto;
|
||||
left: calc(16px + env(safe-area-inset-left));
|
||||
}
|
||||
:host([rtl][is-wide]) #fab {
|
||||
bottom: 24px;
|
||||
left: 24px;
|
||||
right: auto;
|
||||
}
|
||||
`}}]}}),o);let C=t([h("hacs-repository-panel")],(function(t,o){class r extends o{constructor(...o){super(...o),t(this)}}return{F:r,d:[{kind:"field",decorators:[e({attribute:!1})],key:"hacs",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"narrow",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"isWide",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"_repository",value:void 0},{kind:"field",decorators:[c()],key:"_error",value:void 0},{kind:"method",key:"connectedCallback",value:function(){a(i(r.prototype),"connectedCallback",this).call(this),document.body.addEventListener("keydown",this._generateMyLink)}},{kind:"method",key:"disconnectedCallback",value:function(){a(i(r.prototype),"disconnectedCallback",this).call(this),document.body.removeEventListener("keydown",this._generateMyLink)}},{kind:"field",key:"_generateMyLink",value(){return t=>{if(!(t.ctrlKey||t.shiftKey||t.metaKey||t.altKey)&&"m"===t.key&&l.location.pathname.startsWith("/hacs/repository/")){if(!this._repository)return;const t=new URLSearchParams({redirect:"hacs_repository",owner:this._repository.full_name.split("/")[0],repository:this._repository.full_name.split("/")[1],category:this._repository.category});window.open(`https://my.home-assistant.io/create-link/?${t.toString()}`,"_blank")}}}},{kind:"method",key:"firstUpdated",value:async function(t){a(i(r.prototype),"firstUpdated",this).call(this,t);const o=_();if(Object.entries(o).length){let t;const e=`${o.owner}/${o.repository}`;if(t=this.hacs.repositories.find((t=>t.full_name.toLocaleLowerCase()===e.toLocaleLowerCase())),!t&&o.category){if(!await w(this,{title:this.hacs.localize("my.add_repository_title"),text:this.hacs.localize("my.add_repository_description",{repository:e}),confirmText:this.hacs.localize("common.add"),dismissText:this.hacs.localize("common.cancel")}))return void(this._error=this.hacs.localize("my.repository_not_found",{repository:e}));try{await d(this.hass,e,o.category),this.hacs.repositories=await p(this.hass),t=this.hacs.repositories.find((t=>t.full_name.toLocaleLowerCase()===e.toLocaleLowerCase()))}catch(t){return void(this._error=t)}}t?this._fetchRepository(String(t.id)):this._error=this.hacs.localize("my.repository_not_found",{repository:e})}else{const t=this.route.path.indexOf("/",1),o=this.route.path.substr(t+1);if(!o)return void(this._error="Missing repositoryId from route");this._fetchRepository(o)}}},{kind:"method",key:"updated",value:function(t){a(i(r.prototype),"updated",this).call(this,t),t.has("repositories")&&this._repository&&this._fetchRepository()}},{kind:"method",key:"_fetchRepository",value:async function(t){try{this._repository=await j(this.hass,t||String(this._repository.id))}catch(t){this._error=null==t?void 0:t.message}}},{kind:"field",key:"_getAuthors",value:()=>u((t=>{const o=[];if(!t.authors)return o;if(t.authors.forEach((t=>o.push(t.replace("@","")))),0===o.length){const e=t.full_name.split("/")[0];if(["custom-cards","custom-components","home-assistant-community-themes"].includes(e))return o;o.push(e)}return o}))},{kind:"method",key:"render",value:function(){if(this._error)return s`<hass-error-screen .error=${this._error}></hass-error-screen>`;if(!this._repository)return s`<hass-loading-screen></hass-loading-screen>`;const t=this._getAuthors(this._repository);return s`
|
||||
<hass-subpage
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
.route=${this.route}
|
||||
.header=${this._repository.name}
|
||||
hasFab
|
||||
>
|
||||
<ha-icon-overflow-menu
|
||||
.hass=${this.hass}
|
||||
slot="toolbar-icon"
|
||||
narrow
|
||||
.items=${$(this,this._repository)}
|
||||
>
|
||||
</ha-icon-overflow-menu>
|
||||
<div class="content">
|
||||
<div class="chips">
|
||||
${this._repository.installed?s`
|
||||
<ha-chip title="${this.hacs.localize("dialog_info.version_installed")}" hasIcon>
|
||||
<ha-svg-icon slot="icon" .path=${f}></ha-svg-icon>
|
||||
${this._repository.installed_version}
|
||||
</ha-chip>
|
||||
`:""}
|
||||
${t?t.map((t=>s`<hacs-link .url="https://github.com/${t}">
|
||||
<ha-chip title="${this.hacs.localize("dialog_info.author")}" hasIcon>
|
||||
<ha-svg-icon slot="icon" .path=${v}></ha-svg-icon>
|
||||
@${t}
|
||||
</ha-chip>
|
||||
</hacs-link>`)):""}
|
||||
${this._repository.downloads?s` <ha-chip hasIcon title="${this.hacs.localize("dialog_info.downloads")}">
|
||||
<ha-svg-icon slot="icon" .path=${y}></ha-svg-icon>
|
||||
${this._repository.downloads}
|
||||
</ha-chip>`:""}
|
||||
<ha-chip title="${this.hacs.localize("dialog_info.stars")}" hasIcon>
|
||||
<ha-svg-icon slot="icon" .path=${b}></ha-svg-icon>
|
||||
${this._repository.stars}
|
||||
</ha-chip>
|
||||
<hacs-link .url="https://github.com/${this._repository.full_name}/issues">
|
||||
<ha-chip title="${this.hacs.localize("dialog_info.open_issues")}" hasIcon>
|
||||
<ha-svg-icon slot="icon" .path=${m}></ha-svg-icon>
|
||||
${this._repository.issues}
|
||||
</ha-chip>
|
||||
</hacs-link>
|
||||
</div>
|
||||
${L.html(this._repository.additional_info||this.hacs.localize("dialog_info.no_info"),this._repository)}
|
||||
</div>
|
||||
${this._repository.installed_version?"":s`<ha-fab
|
||||
.label=${this.hacs.localize("common.download")}
|
||||
.extended=${!this.narrow}
|
||||
@click=${this._downloadRepositoryDialog}
|
||||
>
|
||||
<ha-svg-icon slot="icon" .path=${k}></ha-svg-icon>
|
||||
</ha-fab>`}
|
||||
</hass-subpage>
|
||||
`}},{kind:"method",key:"_downloadRepositoryDialog",value:function(){this.dispatchEvent(new CustomEvent("hacs-dialog",{detail:{type:"download",repository:this._repository.id},bubbles:!0,composed:!0}))}},{kind:"get",static:!0,key:"styles",value:function(){return[g,n`
|
||||
hass-loading-screen {
|
||||
--app-header-background-color: var(--sidebar-background-color);
|
||||
--app-header-text-color: var(--sidebar-text-color);
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
hass-subpage {
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
ha-svg-icon {
|
||||
color: var(--hcv-text-color-on-background);
|
||||
}
|
||||
|
||||
ha-fab {
|
||||
position: fixed;
|
||||
float: right;
|
||||
right: calc(18px + env(safe-area-inset-right));
|
||||
bottom: calc(16px + env(safe-area-inset-bottom));
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
ha-fab.rtl {
|
||||
float: left;
|
||||
right: auto;
|
||||
left: calc(18px + env(safe-area-inset-left));
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 12px;
|
||||
margin-bottom: 64px;
|
||||
}
|
||||
|
||||
.chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 8px;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 500px) {
|
||||
.content {
|
||||
margin: 8px 4px 64px;
|
||||
}
|
||||
}
|
||||
`]}}]}}),o);export{C as HacsRepositoryPanel};
|
||||
Binary file not shown.
@@ -1,78 +0,0 @@
|
||||
import{_ as i,j as a,e as t,t as s,i as o,y as e,eJ as r,p as l,k as n,O as d,d as c,n as m}from"./main-c66a9a06.js";import"./c.b914d43e.js";import"./c.6912e15e.js";import"./c.8e28b461.js";i([m("dialog-box")],(function(i,a){return{F:class extends a{constructor(...a){super(...a),i(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[s()],key:"_params",value:void 0},{kind:"field",decorators:[o("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"showDialog",value:async function(i){this._params=i}},{kind:"method",key:"closeDialog",value:function(){var i,a;return!(null!==(i=this._params)&&void 0!==i&&i.confirmation||null!==(a=this._params)&&void 0!==a&&a.prompt)&&(!this._params||(this._dismiss(),!0))}},{kind:"method",key:"render",value:function(){if(!this._params)return e``;const i=this._params.confirmation||this._params.prompt;return e`
|
||||
<ha-dialog
|
||||
open
|
||||
?scrimClickAction=${i}
|
||||
?escapeKeyAction=${i}
|
||||
@closed=${this._dialogClosed}
|
||||
defaultAction="ignore"
|
||||
.heading=${e`${this._params.warning?e`<ha-svg-icon
|
||||
.path=${r}
|
||||
style="color: var(--warning-color)"
|
||||
></ha-svg-icon> `:""}${this._params.title?this._params.title:this._params.confirmation&&this.hass.localize("ui.dialogs.generic.default_confirmation_title")}`}
|
||||
>
|
||||
<div>
|
||||
${this._params.text?e`
|
||||
<p class=${this._params.prompt?"no-bottom-padding":""}>
|
||||
${this._params.text}
|
||||
</p>
|
||||
`:""}
|
||||
${this._params.prompt?e`
|
||||
<ha-textfield
|
||||
dialogInitialFocus
|
||||
value=${l(this._params.defaultValue)}
|
||||
.placeholder=${l(this._params.placeholder)}
|
||||
.label=${this._params.inputLabel?this._params.inputLabel:""}
|
||||
.type=${this._params.inputType?this._params.inputType:"text"}
|
||||
></ha-textfield>
|
||||
`:""}
|
||||
</div>
|
||||
${i&&e`
|
||||
<mwc-button @click=${this._dismiss} slot="secondaryAction">
|
||||
${this._params.dismissText?this._params.dismissText:this.hass.localize("ui.dialogs.generic.cancel")}
|
||||
</mwc-button>
|
||||
`}
|
||||
<mwc-button
|
||||
@click=${this._confirm}
|
||||
?dialogInitialFocus=${!this._params.prompt}
|
||||
slot="primaryAction"
|
||||
class=${n({destructive:this._params.destructive||!1})}
|
||||
>
|
||||
${this._params.confirmText?this._params.confirmText:this.hass.localize("ui.dialogs.generic.ok")}
|
||||
</mwc-button>
|
||||
</ha-dialog>
|
||||
`}},{kind:"method",key:"_dismiss",value:function(){var i;null!==(i=this._params)&&void 0!==i&&i.cancel&&this._params.cancel(),this._close()}},{kind:"method",key:"_confirm",value:function(){var i;this._params.confirm&&this._params.confirm(null===(i=this._textField)||void 0===i?void 0:i.value);this._close()}},{kind:"method",key:"_dialogClosed",value:function(i){"ignore"!==i.detail.action&&this._dismiss()}},{kind:"method",key:"_close",value:function(){this._params&&(this._params=void 0,d(this,"dialog-closed",{dialog:this.localName}))}},{kind:"get",static:!0,key:"styles",value:function(){return c`
|
||||
:host([inert]) {
|
||||
pointer-events: initial !important;
|
||||
cursor: initial !important;
|
||||
}
|
||||
a {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
.no-bottom-padding {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.secondary {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
.destructive {
|
||||
--mdc-theme-primary: var(--error-color);
|
||||
}
|
||||
ha-dialog {
|
||||
--mdc-dialog-heading-ink-color: var(--primary-text-color);
|
||||
--mdc-dialog-content-ink-color: var(--primary-text-color);
|
||||
/* Place above other dialogs */
|
||||
--dialog-z-index: 104;
|
||||
}
|
||||
@media all and (min-width: 600px) {
|
||||
ha-dialog {
|
||||
--mdc-dialog-min-width: 400px;
|
||||
}
|
||||
}
|
||||
ha-textfield {
|
||||
width: 100%;
|
||||
}
|
||||
`}}]}}),a);
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user