working 2.0 clone
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
"""HACS Frontend"""
|
||||
from .version import VERSION
|
||||
|
||||
def locate_dir():
|
||||
return __path__[0]
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
import{_ as e,j as t,e as i,t as a,i as s,a5 as n,y as d,O as l,n as o}from"./main-85e087f9.js";import"./c.eab7754a.js";import{c as r}from"./c.d2f13ac1.js";import{c as u}from"./c.6eb9fcd4.js";import{c}from"./c.874c8cfd.js";import"./c.fea0de05.js";import"./c.50a2e981.js";const h=e=>d`<mwc-list-item graphic="avatar" .twoline=${!!e.entity_id}>
|
||||
${e.state?d`<state-badge slot="graphic" .stateObj=${e}></state-badge>`:""}
|
||||
<span>${e.friendly_name}</span>
|
||||
<span slot="secondary">${e.entity_id}</span>
|
||||
</mwc-list-item>`;e([o("ha-entity-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({type:Boolean})],key:"autofocus",value:()=>!1},{kind:"field",decorators:[i({type:Boolean})],key:"disabled",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"required",value:void 0},{kind:"field",decorators:[i({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",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: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({type:Array,attribute:"include-unit-of-measurement"})],key:"includeUnitOfMeasurement",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"include-entities"})],key:"includeEntities",value:void 0},{kind:"field",decorators:[i({type:Array,attribute:"exclude-entities"})],key:"excludeEntities",value:void 0},{kind:"field",decorators:[i()],key:"entityFilter",value:void 0},{kind:"field",decorators:[i({type:Boolean})],key:"hideClearIcon",value:()=>!1},{kind:"field",decorators:[a()],key:"_opened",value:()=>!1},{kind:"field",decorators:[s("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.open())}},{kind:"method",key:"focus",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.focus())}},{kind:"field",key:"_initedStates",value:()=>!1},{kind:"field",key:"_states",value:()=>[]},{kind:"field",key:"_getStates",value(){return n(((e,t,i,a,s,n,d,l,o)=>{let h=[];if(!t)return[];let y=Object.keys(t.states);return y.length?l?(y=y.filter((e=>this.includeEntities.includes(e))),y.map((e=>({...t.states[e],friendly_name:u(t.states[e])||e}))).sort(((e,t)=>c(e.friendly_name,t.friendly_name)))):(o&&(y=y.filter((e=>!o.includes(e)))),i&&(y=y.filter((e=>i.includes(r(e))))),a&&(y=y.filter((e=>!a.includes(r(e))))),h=y.map((e=>({...t.states[e],friendly_name:u(t.states[e])||e}))).sort(((e,t)=>c(e.friendly_name,t.friendly_name))),n&&(h=h.filter((e=>e.entity_id===this.value||e.attributes.device_class&&n.includes(e.attributes.device_class)))),d&&(h=h.filter((e=>e.entity_id===this.value||e.attributes.unit_of_measurement&&d.includes(e.attributes.unit_of_measurement)))),s&&(h=h.filter((e=>e.entity_id===this.value||s(e)))),h.length?h:[{entity_id:"",state:"",last_changed:"",last_updated:"",context:{id:"",user_id:null,parent_id:null},friendly_name:this.hass.localize("ui.components.entity.entity-picker.no_match"),attributes:{friendly_name:this.hass.localize("ui.components.entity.entity-picker.no_match"),icon:"mdi:magnify"}}]):[{entity_id:"",state:"",last_changed:"",last_updated:"",context:{id:"",user_id:null,parent_id:null},friendly_name:this.hass.localize("ui.components.entity.entity-picker.no_entities"),attributes:{friendly_name:this.hass.localize("ui.components.entity.entity-picker.no_entities"),icon:"mdi:magnify"}}]}))}},{kind:"method",key:"shouldUpdate",value:function(e){return!!(e.has("value")||e.has("label")||e.has("disabled"))||!(!e.has("_opened")&&this._opened)}},{kind:"method",key:"willUpdate",value:function(e){(!this._initedStates||e.has("_opened")&&this._opened)&&(this._states=this._getStates(this._opened,this.hass,this.includeDomains,this.excludeDomains,this.entityFilter,this.includeDeviceClasses,this.includeUnitOfMeasurement,this.includeEntities,this.excludeEntities),this._initedStates&&(this.comboBox.filteredItems=this._states),this._initedStates=!0)}},{kind:"method",key:"render",value:function(){return d`
|
||||
<ha-combo-box
|
||||
item-value-path="entity_id"
|
||||
item-label-path="friendly_name"
|
||||
.hass=${this.hass}
|
||||
.value=${this._value}
|
||||
.label=${void 0===this.label?this.hass.localize("ui.components.entity.entity-picker.entity"):this.label}
|
||||
.helper=${this.helper}
|
||||
.allowCustomValue=${this.allowCustomEntity}
|
||||
.filteredItems=${this._states}
|
||||
.renderer=${h}
|
||||
.required=${this.required}
|
||||
.disabled=${this.disabled}
|
||||
@opened-changed=${this._openedChanged}
|
||||
@value-changed=${this._valueChanged}
|
||||
@filter-changed=${this._filterChanged}
|
||||
>
|
||||
</ha-combo-box>
|
||||
`}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;t!==this._value&&this._setValue(t)}},{kind:"method",key:"_filterChanged",value:function(e){const t=e.detail.value.toLowerCase();this.comboBox.filteredItems=this._states.filter((e=>e.entity_id.toLowerCase().includes(t)||u(e).toLowerCase().includes(t)))}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{l(this,"value-changed",{value:e}),l(this,"change")}),0)}}]}}),t);
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const s=(s,a)=>t(s.attributes,a),t=(s,t)=>0!=(s.supported_features&t);export{t as a,s};
|
||||
@@ -0,0 +1 @@
|
||||
const s=s=>`https://brands.home-assistant.io/${s.brand?"brands/":""}${s.useFallback?"_/":""}${s.domain}/${s.darkOptimized?"dark_":""}${s.type}.png`,a=s=>s.split("/")[4],t=s=>s.startsWith("https://brands.home-assistant.io/");export{s as b,a as e,t as i};
|
||||
Binary file not shown.
@@ -0,0 +1,65 @@
|
||||
import{_ as e,e as i,y as t,O as a,d as r,n as s,j as d,t as l,a5 as o}from"./main-85e087f9.js";import{g as n,d as c}from"./c.1095ea82.js";import{f as u,a as h,b as v}from"./c.6f18200a.js";import{S as k}from"./c.59ae3c13.js";import"./c.5aed34c8.js";import"./c.6eb9fcd4.js";import"./c.1024e243.js";import"./c.388f6c87.js";import"./c.8e28b461.js";import"./c.eab7754a.js";import"./c.874c8cfd.js";import"./c.fa0ef026.js";import"./c.d2f13ac1.js";import"./c.ccbe2b52.js";import"./c.fea0de05.js";import"./c.7398f5d5.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.
@@ -0,0 +1 @@
|
||||
const s=s=>s.substr(s.indexOf(".")+1);export{s as c};
|
||||
@@ -0,0 +1,19 @@
|
||||
import{_ as e,j as t,e as a,y as i,O as o,d,n as s}from"./main-85e087f9.js";import"./c.54067e61.js";import"./c.fea0de05.js";import"./c.388f6c87.js";import"./c.8e28b461.js";import"./c.eab7754a.js";import"./c.7398f5d5.js";let l=e([s("ha-selector-template")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[a()],key:"hass",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})],key:"disabled",value:()=>!1},{kind:"field",decorators:[a({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return i`
|
||||
${this.label?i`<p>${this.label}${this.required?" *":""}</p>`:""}
|
||||
<ha-code-editor
|
||||
mode="jinja2"
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.readOnly=${this.disabled}
|
||||
autofocus
|
||||
autocomplete-entities
|
||||
autocomplete-icons
|
||||
@value-changed=${this._handleChange}
|
||||
dir="ltr"
|
||||
></ha-code-editor>
|
||||
${this.helper?i`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`:""}
|
||||
`}},{kind:"method",key:"_handleChange",value:function(e){const t=e.target.value;this.value!==t&&o(this,"value-changed",{value:t})}},{kind:"get",static:!0,key:"styles",value:function(){return d`
|
||||
p {
|
||||
margin-top: 0;
|
||||
}
|
||||
`}}]}}),t);export{l as HaTemplateSelector};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
function t(e){if(!e||"object"!=typeof e)return e;if("[object Date]"==Object.prototype.toString.call(e))return new Date(e.getTime());if(Array.isArray(e))return e.map(t);var r={};return Object.keys(e).forEach((function(n){r[n]=t(e[n])})),r}export{t as d};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{c as e}from"./c.6eb9fcd4.js";import{d as t}from"./c.388f6c87.js";import{bS as s,a5 as i}from"./main-85e087f9.js";import{s as n}from"./c.874c8cfd.js";const r=(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,n=t.states[s];if(n)return e(n)}})(s,i)||s.localize("ui.panel.config.devices.unnamed_device","type",s.localize(`ui.panel.config.devices.type.${t.entry_type||"device"}`)),a=e=>e.sendMessagePromise({type:"config/device_registry/list"}),c=(e,s)=>e.subscribeEvents(t((()=>a(e).then((e=>s.setState(e,!0)))),500,!0),"device_registry_updated"),o=(e,t)=>s("_dr",a,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"}),f=(e,s)=>e.subscribeEvents(t((()=>y(e).then((e=>s.setState(e,!0)))),500,!0),"entity_registry_updated"),m=(e,t)=>s("_entityRegistry",y,f,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)=>n(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{r as a,v as b,_ as c,m as d,g as e,p as f,d as g,o as s};
|
||||
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.
@@ -0,0 +1 @@
|
||||
import{I as e,J as s,L as t,N as r}from"./main-85e087f9.js";import{m as l,u as n,r as o,p as i,b as u}from"./c.388f6c87.js";const f=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},a=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,a]){var c;const h=l(e),{values:d,keys:p}=this.ht(s,t,a);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,b=h.length-1,j=0,k=d.length-1;for(;g<=b&&j<=k;)if(null===h[g])g++;else if(null===h[b])b--;else if(v[g]===p[j])y[j]=n(h[g],d[j]),g++,j++;else if(v[b]===p[k])y[k]=n(h[b],d[k]),b--,k--;else if(v[g]===p[k])y[k]=n(h[g],d[k]),o(e,y[k+1],h[g]),g++,k--;else if(v[b]===p[j])y[j]=n(h[b],d[j]),o(e,h[g],h[b]),b--,j++;else if(void 0===m&&(m=f(p,j,k),x=f(v,g,b)),m.has(v[g]))if(m.has(v[b])){const s=x.get(p[j]),t=void 0!==s?h[s]:null;if(null===t){const s=o(e,h[g]);n(s,d[j]),y[j]=s}else y[j]=n(t,d[j]),o(e,h[g],t),h[s]=null;j++}else i(h[b]),b--;else i(h[g]),g++;for(;j<=k;){const s=o(e,y[k+1]);n(s,d[j]),y[j++]=s}for(;g<=b;){const e=h[g++];null!==e&&i(e)}return this.ut=p,u(e,y),r}});export{a as c};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const n=(n,o)=>n&&n.config.components.includes(o);export{n as i};
|
||||
@@ -0,0 +1 @@
|
||||
let a,e,m;!function(a){a.language="language",a.system="system",a.comma_decimal="comma_decimal",a.decimal_comma="decimal_comma",a.space_comma="space_comma",a.none="none"}(a||(a={})),function(a){a.language="language",a.system="system",a.am_pm="12",a.twenty_four="24"}(e||(e={})),function(a){a.language="language",a.monday="monday",a.tuesday="tuesday",a.wednesday="wednesday",a.thursday="thursday",a.friday="friday",a.saturday="saturday",a.sunday="sunday"}(m||(m={}));export{m as F,a as N,e as T};
|
||||
Binary file not shown.
@@ -0,0 +1,56 @@
|
||||
import{_ as e,j as a,e as o,y as t,aM as i,k as s,aK as l,d as n,n as r,a5 as c,aI as d,af as h,aD as p,ag as m,aN as u,aO as f,aP as b,aQ as g,aE as v,aR as y,a4 as _,ai as w,aS as k,aT as $}from"./main-85e087f9.js";import"./c.eab7754a.js";import"./c.e651e5fa.js";import{g as z}from"./c.f2bb3724.js";import{s as x}from"./c.ccbe2b52.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:b,label:e.hacs.localize("repository_card.redownload"),action:()=>O(e,a.id),hideForUninstalled:!0}]:[],..."plugin"===a.category&&a.installed_version?[{path:g,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 S(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}))},S=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()},T=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,T as r};
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
import{_ as e,j as t,e as a,y as i,O as d,d as l,n as s}from"./main-85e087f9.js";import"./c.388f6c87.js";import"./c.f4985284.js";import"./c.fea0de05.js";import"./c.8e28b461.js";import"./c.eab7754a.js";import"./c.7398f5d5.js";let o=e([s("ha-selector-boolean")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[a()],key:"hass",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})],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 t=e.target.checked;this.value!==t&&d(this,"value-changed",{value:t})}},{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;
|
||||
}
|
||||
`}}]}}),t);export{o as HaBooleanSelector};
|
||||
Binary file not shown.
128
custom_components/hacs/hacs_frontend_experimental/c.34b7552d.js
Normal file
128
custom_components/hacs/hacs_frontend_experimental/c.34b7552d.js
Normal file
@@ -0,0 +1,128 @@
|
||||
import{_ as e,j as i,e as t,t as a,y as s,a5 as l,O as d,i as o,bA as n,d as r,n as v}from"./main-85e087f9.js";import{c}from"./c.d2f13ac1.js";import{c as h}from"./c.1024e243.js";import{d as u,f as _}from"./c.36ae07d6.js";import{d as f}from"./c.4f015773.js";import"./c.388f6c87.js";import"./c.fea0de05.js";import"./c.99cf2c6d.js";import"./c.c128b7f4.js";const k=e=>s`<mwc-list-item twoline>
|
||||
<span>${e.name}</span>
|
||||
<span slot="secondary"
|
||||
>${e.name===e.service?"":e.service}</span
|
||||
>
|
||||
</mwc-list-item>`;let p=e(null,(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({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[t()],key:"value",value:void 0},{kind:"field",decorators:[a()],key:"_filter",value:void 0},{kind:"method",key:"render",value:function(){return s`
|
||||
<ha-combo-box
|
||||
.hass=${this.hass}
|
||||
.label=${this.hass.localize("ui.components.service-picker.service")}
|
||||
.filteredItems=${this._filteredServices(this.hass.localize,this.hass.services,this._filter)}
|
||||
.value=${this.value}
|
||||
.disabled=${this.disabled}
|
||||
.renderer=${k}
|
||||
item-value-path="service"
|
||||
item-label-path="name"
|
||||
allow-custom-value
|
||||
@filter-changed=${this._filterChanged}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-combo-box>
|
||||
`}},{kind:"field",key:"_services",value:()=>l(((e,i)=>{if(!i)return[];const t=[];return Object.keys(i).sort().forEach((a=>{const s=Object.keys(i[a]).sort();for(const l of s)t.push({service:`${a}.${l}`,name:`${u(e,a)}: ${i[a][l].name||l}`})})),t}))},{kind:"field",key:"_filteredServices",value(){return l(((e,i,t)=>{if(!i)return[];const a=this._services(e,i);return t?a.filter((e=>{var i;return e.service.toLowerCase().includes(t)||(null===(i=e.name)||void 0===i?void 0:i.toLowerCase().includes(t))})):a}))}},{kind:"method",key:"_filterChanged",value:function(e){this._filter=e.detail.value.toLowerCase()}},{kind:"method",key:"_valueChanged",value:function(e){this.value=e.detail.value,d(this,"change"),d(this,"value-changed",{value:this.value})}}]}}),i);customElements.define("ha-service-picker",p);const y=e=>e.selector&&!e.required&&!("boolean"in e.selector&&e.default);e([v("ha-service-control")],(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:"value",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[t({reflect:!0,type:Boolean})],key:"narrow",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"showAdvanced",value:void 0},{kind:"field",decorators:[a()],key:"_value",value:void 0},{kind:"field",decorators:[a()],key:"_checkedKeys",value:()=>new Set},{kind:"field",decorators:[a()],key:"_manifest",value:void 0},{kind:"field",decorators:[o("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"method",key:"willUpdate",value:function(e){var i,t,a,s,l,o,n,r,v,h,u;if(!e.has("value"))return;const _=e.get("value");(null==_?void 0:_.service)!==(null===(i=this.value)||void 0===i?void 0:i.service)&&(this._checkedKeys=new Set);const f=this._getServiceInfo(null===(t=this.value)||void 0===t?void 0:t.service,this.hass.services);var k;null!==(a=this.value)&&void 0!==a&&a.service?null!=_&&_.service&&c(this.value.service)===c(_.service)||this._fetchManifest(c(null===(k=this.value)||void 0===k?void 0:k.service)):this._manifest=void 0;if(f&&"target"in f&&(null!==(s=this.value)&&void 0!==s&&null!==(l=s.data)&&void 0!==l&&l.entity_id||null!==(o=this.value)&&void 0!==o&&null!==(n=o.data)&&void 0!==n&&n.area_id||null!==(r=this.value)&&void 0!==r&&null!==(v=r.data)&&void 0!==v&&v.device_id)){var p,y,g;const e={...this.value.target};!this.value.data.entity_id||null!==(p=this.value.target)&&void 0!==p&&p.entity_id||(e.entity_id=this.value.data.entity_id),!this.value.data.area_id||null!==(y=this.value.target)&&void 0!==y&&y.area_id||(e.area_id=this.value.data.area_id),!this.value.data.device_id||null!==(g=this.value.target)&&void 0!==g&&g.device_id||(e.device_id=this.value.data.device_id),this._value={...this.value,target:e,data:{...this.value.data}},delete this._value.data.entity_id,delete this._value.data.device_id,delete this._value.data.area_id}else this._value=this.value;if((null==_?void 0:_.service)!==(null===(h=this.value)||void 0===h?void 0:h.service)){let e=!1;this._value&&f&&(this._value.data||(this._value.data={}),f.fields.forEach((i=>{i.selector&&i.required&&void 0===i.default&&"boolean"in i.selector&&void 0===this._value.data[i.key]&&(e=!0,this._value.data[i.key]=!1)}))),e&&d(this,"value-changed",{value:{...this._value}})}if(null!==(u=this._value)&&void 0!==u&&u.data){const e=this._yamlEditor;e&&e.value!==this._value.data&&e.setValue(this._value.data)}}},{kind:"field",key:"_getServiceInfo",value:()=>l(((e,i)=>{if(!e||!i)return;const t=c(e),a=h(e);if(!(t in i))return;if(!(a in i[t]))return;const s=Object.entries(i[t][a].fields).map((([e,i])=>({key:e,...i,selector:i.selector})));return{...i[t][a],fields:s,hasSelector:s.length?s.filter((e=>e.selector)).map((e=>e.key)):[]}}))},{kind:"method",key:"render",value:function(){var e,i,t,a,l,d,o;const r=this._getServiceInfo(null===(e=this._value)||void 0===e?void 0:e.service,this.hass.services),v=(null==r?void 0:r.fields.length)&&!r.hasSelector.length||r&&Object.keys((null===(i=this._value)||void 0===i?void 0:i.data)||{}).some((e=>!r.hasSelector.includes(e))),c=v&&(null==r?void 0:r.fields.find((e=>"entity_id"===e.key))),h=Boolean(!v&&(null==r?void 0:r.fields.some((e=>y(e)))));return s`<ha-service-picker
|
||||
.hass=${this.hass}
|
||||
.value=${null===(t=this._value)||void 0===t?void 0:t.service}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._serviceChanged}
|
||||
></ha-service-picker>
|
||||
<div class="description">
|
||||
${null!=r&&r.description?s`<p>${null==r?void 0:r.description}</p>`:""}
|
||||
${this._manifest?s` <a
|
||||
href=${this._manifest.is_built_in?f(this.hass,`/integrations/${this._manifest.domain}`):this._manifest.documentation}
|
||||
title=${this.hass.localize("ui.components.service-control.integration_doc")}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
<ha-icon-button
|
||||
.path=${n}
|
||||
class="help-icon"
|
||||
></ha-icon-button>
|
||||
</a>`:""}
|
||||
</div>
|
||||
${r&&"target"in r?s`<ha-settings-row .narrow=${this.narrow}>
|
||||
${h?s`<div slot="prefix" class="checkbox-spacer"></div>`:""}
|
||||
<span slot="heading"
|
||||
>${this.hass.localize("ui.components.service-control.target")}</span
|
||||
>
|
||||
<span slot="description"
|
||||
>${this.hass.localize("ui.components.service-control.target_description")}</span
|
||||
><ha-selector
|
||||
.hass=${this.hass}
|
||||
.selector=${r.target?{target:r.target}:{target:{}}}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._targetChanged}
|
||||
.value=${null===(a=this._value)||void 0===a?void 0:a.target}
|
||||
></ha-selector
|
||||
></ha-settings-row>`:c?s`<ha-entity-picker
|
||||
.hass=${this.hass}
|
||||
.disabled=${this.disabled}
|
||||
.value=${null===(l=this._value)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.entity_id}
|
||||
.label=${c.description}
|
||||
@value-changed=${this._entityPicked}
|
||||
allow-custom-entity
|
||||
></ha-entity-picker>`:""}
|
||||
${v?s`<ha-yaml-editor
|
||||
.hass=${this.hass}
|
||||
.label=${this.hass.localize("ui.components.service-control.data")}
|
||||
.name=${"data"}
|
||||
.readOnly=${this.disabled}
|
||||
.defaultValue=${null===(o=this._value)||void 0===o?void 0:o.data}
|
||||
@value-changed=${this._dataChanged}
|
||||
></ha-yaml-editor>`:null==r?void 0:r.fields.map((e=>{var i,t,a,l;const d=y(e);return e.selector&&(!e.advanced||this.showAdvanced||null!==(i=this._value)&&void 0!==i&&i.data&&void 0!==this._value.data[e.key])?s`<ha-settings-row .narrow=${this.narrow}>
|
||||
${d?s`<ha-checkbox
|
||||
.key=${e.key}
|
||||
.checked=${this._checkedKeys.has(e.key)||(null===(t=this._value)||void 0===t?void 0:t.data)&&void 0!==this._value.data[e.key]}
|
||||
.disabled=${this.disabled}
|
||||
@change=${this._checkboxChanged}
|
||||
slot="prefix"
|
||||
></ha-checkbox>`:h?s`<div slot="prefix" class="checkbox-spacer"></div>`:""}
|
||||
<span slot="heading">${e.name||e.key}</span>
|
||||
<span slot="description">${null==e?void 0:e.description}</span>
|
||||
<ha-selector
|
||||
.disabled=${this.disabled||d&&!this._checkedKeys.has(e.key)&&(!(null!==(a=this._value)&&void 0!==a&&a.data)||void 0===this._value.data[e.key])}
|
||||
.hass=${this.hass}
|
||||
.selector=${e.selector}
|
||||
.key=${e.key}
|
||||
@value-changed=${this._serviceDataChanged}
|
||||
.value=${null!==(l=this._value)&&void 0!==l&&l.data&&void 0!==this._value.data[e.key]?this._value.data[e.key]:e.default}
|
||||
></ha-selector>
|
||||
</ha-settings-row>`:""}))}`}},{kind:"method",key:"_checkboxChanged",value:function(e){const i=e.currentTarget.checked,t=e.currentTarget.key;let a;if(i){var s,l,o;this._checkedKeys.add(t);const e=null===(s=this._getServiceInfo(null===(o=this._value)||void 0===o?void 0:o.service,this.hass.services))||void 0===s||null===(l=s.fields.find((e=>e.key===t)))||void 0===l?void 0:l.default;var n;if(e)a={...null===(n=this._value)||void 0===n?void 0:n.data,[t]:e}}else{var r;this._checkedKeys.delete(t),a={...null===(r=this._value)||void 0===r?void 0:r.data},delete a[t]}a&&d(this,"value-changed",{value:{...this._value,data:a}}),this.requestUpdate("_checkedKeys")}},{kind:"method",key:"_serviceChanged",value:function(e){var i;e.stopPropagation(),e.detail.value!==(null===(i=this._value)||void 0===i?void 0:i.service)&&d(this,"value-changed",{value:{service:e.detail.value||""}})}},{kind:"method",key:"_entityPicked",value:function(e){var i,t,a;e.stopPropagation();const s=e.detail.value;if((null===(i=this._value)||void 0===i||null===(t=i.data)||void 0===t?void 0:t.entity_id)===s)return;let l;var o;!s&&null!==(a=this._value)&&void 0!==a&&a.data?(l={...this._value},delete l.data.entity_id):l={...this._value,data:{...null===(o=this._value)||void 0===o?void 0:o.data,entity_id:e.detail.value}};d(this,"value-changed",{value:l})}},{kind:"method",key:"_targetChanged",value:function(e){var i;e.stopPropagation();const t=e.detail.value;if((null===(i=this._value)||void 0===i?void 0:i.target)===t)return;let a;t?a={...this._value,target:e.detail.value}:(a={...this._value},delete a.target),d(this,"value-changed",{value:a})}},{kind:"method",key:"_serviceDataChanged",value:function(e){var i,t,a,s,l;e.stopPropagation();const o=e.currentTarget.key,n=e.detail.value;if((null===(i=this._value)||void 0===i||null===(t=i.data)||void 0===t?void 0:t[o])===n||(null===(a=this._value)||void 0===a||null===(s=a.data)||void 0===s||!s[o])&&(""===n||void 0===n))return;const r={...null===(l=this._value)||void 0===l?void 0:l.data,[o]:n};""!==n&&void 0!==n||delete r[o],d(this,"value-changed",{value:{...this._value,data:r}})}},{kind:"method",key:"_dataChanged",value:function(e){e.stopPropagation(),e.detail.isValid&&d(this,"value-changed",{value:{...this._value,data:e.detail.value}})}},{kind:"method",key:"_fetchManifest",value:async function(e){this._manifest=void 0;try{this._manifest=await _(this.hass,e)}catch(e){}}},{kind:"get",static:!0,key:"styles",value:function(){return r`
|
||||
ha-settings-row {
|
||||
padding: var(--service-control-padding, 0 16px);
|
||||
}
|
||||
ha-settings-row {
|
||||
--paper-time-input-justify-content: flex-end;
|
||||
--settings-row-content-width: 100%;
|
||||
--settings-row-prefix-display: contents;
|
||||
border-top: var(
|
||||
--service-control-items-border-top,
|
||||
1px solid var(--divider-color)
|
||||
);
|
||||
}
|
||||
ha-service-picker,
|
||||
ha-entity-picker,
|
||||
ha-yaml-editor {
|
||||
display: block;
|
||||
margin: var(--service-control-padding, 0 16px);
|
||||
}
|
||||
ha-yaml-editor {
|
||||
padding: 16px 0;
|
||||
}
|
||||
p {
|
||||
margin: var(--service-control-padding, 0 16px);
|
||||
padding: 16px 0;
|
||||
}
|
||||
.checkbox-spacer {
|
||||
width: 32px;
|
||||
}
|
||||
ha-checkbox {
|
||||
margin-left: -16px;
|
||||
}
|
||||
.help-icon {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
.description {
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-right: 2px;
|
||||
}
|
||||
`}}]}}),i);
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
let t;!function(t){t[t.CRITICAL=50]="CRITICAL",t[t.FATAL=50]="FATAL",t[t.ERROR=40]="ERROR",t[t.WARNING=30]="WARNING",t[t.WARN=30]="WARN",t[t.INFO=20]="INFO",t[t.DEBUG=10]="DEBUG",t[t.NOTSET=0]="NOTSET"}(t||(t={}));const R=(t,R,n)=>t(`component.${R}.title`)||(null==n?void 0:n.name)||R,n=(t,R)=>t.callWS({type:"manifest/get",integration:R});export{R as d,n as f};
|
||||
Binary file not shown.
394
custom_components/hacs/hacs_frontend_experimental/c.388f6c87.js
Normal file
394
custom_components/hacs/hacs_frontend_experimental/c.388f6c87.js
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,59 @@
|
||||
import{ah as o,ai as e,aj as s,ak as t,al as i,_ as a,H as r,e as l,t as n,a5 as h,w as c,a as d,y as p,am as _,g as y,ag as u,c as m,d as v,n as g}from"./main-85e087f9.js";import{c as f}from"./c.eab7754a.js";import"./c.fea0de05.js";import{s as w}from"./c.ccbe2b52.js";import{f as b,r as k,a as $}from"./c.fe747ba2.js";import"./c.5ebe89cb.js";import"./c.cbdebe08.js";import"./c.8e28b461.js";import"./c.388f6c87.js";import"./c.7398f5d5.js";import"./c.7d6b8ecd.js";let R=a([g("hacs-download-dialog")],(function(a,r){return{F:class extends r{constructor(...o){super(...o),a(this)}},d:[{kind:"field",decorators:[l()],key:"repository",value:void 0},{kind:"field",decorators:[n()],key:"_toggle",value:()=>!0},{kind:"field",decorators:[n()],key:"_installing",value:()=>!1},{kind:"field",decorators:[n()],key:"_error",value:void 0},{kind:"field",decorators:[n()],key:"_repository",value:void 0},{kind:"field",decorators:[n()],key:"_downloadRepositoryData",value:()=>({beta:!1,version:""})},{kind:"method",key:"shouldUpdate",value:function(o){return o.forEach(((o,e)=>{var s,t;"hass"===e&&(this.sidebarDocked='"docked"'===(null===(s=window)||void 0===s||null===(t=s.localStorage)||void 0===t?void 0:t.getItem("dockedSidebar")));"repositories"===e&&this._fetchRepository()})),o.has("sidebarDocked")||o.has("narrow")||o.has("active")||o.has("_toggle")||o.has("_error")||o.has("_repository")||o.has("_downloadRepositoryData")||o.has("_installing")}},{kind:"field",key:"_getInstallPath",value:()=>h((o=>{let e=o.local_path;return["template","theme"].includes(o.category)&&(e=`${e}/${o.file_name}`),e}))},{kind:"method",key:"firstUpdated",value:async function(){var o;await this._fetchRepository(),this._toggle=!1,c(this.hass,(o=>this._error=o),d.ERROR),this._downloadRepositoryData.beta=this._repository.beta,this._downloadRepositoryData.version="version"===(null===(o=this._repository)||void 0===o?void 0:o.version_or_commit)?this._repository.releases[0]:""}},{kind:"method",key:"_fetchRepository",value:async function(){this._repository=await b(this.hass,this.repository)}},{kind:"method",key:"render",value:function(){var o;if(!this.active||!this._repository)return p``;const e=this._getInstallPath(this._repository),t=[{name:"beta",selector:{boolean:{}}},{name:"version",selector:{select:{options:"version"===this._repository.version_or_commit?this._repository.releases.concat("hacs/integration"===this._repository.full_name||this._repository.hide_default_branch?[]:[this._repository.default_branch]):[],mode:"dropdown"}}}];return p`
|
||||
<hacs-dialog
|
||||
.active=${this.active}
|
||||
.narrow=${this.narrow}
|
||||
.hass=${this.hass}
|
||||
.secondary=${this.secondary}
|
||||
.title=${this._repository.name}
|
||||
>
|
||||
<div class="content">
|
||||
${"version"===this._repository.version_or_commit?p`
|
||||
<ha-form
|
||||
.disabled=${this._toggle}
|
||||
?narrow=${this.narrow}
|
||||
.data=${this._downloadRepositoryData}
|
||||
.schema=${t}
|
||||
.computeLabel=${o=>"beta"===o.name?this.hacs.localize("dialog_download.show_beta"):this.hacs.localize("dialog_download.select_version")}
|
||||
@value-changed=${this._valueChanged}
|
||||
>
|
||||
</ha-form>
|
||||
`:""}
|
||||
${this._repository.can_download?"":p`<ha-alert alert-type="error" .rtl=${f(this.hass)}>
|
||||
${this.hacs.localize("confirm.home_assistant_version_not_correct",{haversion:this.hass.config.version,minversion:this._repository.homeassistant})}
|
||||
</ha-alert>`}
|
||||
<div class="note">
|
||||
${this.hacs.localize("dialog_download.note_downloaded",{location:p`<code>'${e}'</code>`})}
|
||||
${"plugin"===this._repository.category&&"storage"!==this.hacs.info.lovelace_mode?p`
|
||||
<p>${this.hacs.localize("dialog_download.lovelace_instruction")}</p>
|
||||
<pre>
|
||||
url: ${s({repository:this._repository,skipTag:!0})}
|
||||
type: module
|
||||
</pre
|
||||
>
|
||||
`:""}
|
||||
${"integration"===this._repository.category?p`<p>${this.hacs.localize("dialog_download.restart")}</p>`:""}
|
||||
</div>
|
||||
${null!==(o=this._error)&&void 0!==o&&o.message?p`<ha-alert alert-type="error" .rtl=${f(this.hass)}>
|
||||
${this._error.message}
|
||||
</ha-alert>`:""}
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryaction"
|
||||
?disabled=${!(this._repository.can_download&&!this._toggle&&"version"!==this._repository.version_or_commit)&&!this._downloadRepositoryData.version}
|
||||
@click=${this._installRepository}
|
||||
>
|
||||
${this._installing?p`<ha-circular-progress active size="small"></ha-circular-progress>`:this.hacs.localize("common.download")}
|
||||
</mwc-button>
|
||||
</hacs-dialog>
|
||||
`}},{kind:"method",key:"_valueChanged",value:async function(o){let e=!1;if(this._downloadRepositoryData.beta!==o.detail.value.beta&&(e=!0,this._toggle=!0,await _(this.hass,this.repository,o.detail.value.beta)),o.detail.value.version&&(e=!0,this._toggle=!0,await k(this.hass,this.repository,o.detail.value.version)),e){const o=await y(this.hass);await this._fetchRepository(),this.dispatchEvent(new CustomEvent("update-hacs",{detail:{repositories:o},bubbles:!0,composed:!0})),this._toggle=!1}this._downloadRepositoryData=o.detail.value}},{kind:"method",key:"_installRepository",value:async function(){var a;if(this._installing=!0,!this._repository)return;const r=this._downloadRepositoryData.version||this._repository.available_version||this._repository.default_branch;"commit"!==(null===(a=this._repository)||void 0===a?void 0:a.version_or_commit)?await $(this.hass,String(this._repository.id),r):await $(this.hass,String(this._repository.id)),this.hacs.log.debug(this._repository.category,"_installRepository"),this.hacs.log.debug(this.hacs.info.lovelace_mode,"_installRepository"),"plugin"===this._repository.category&&"storage"===this.hacs.info.lovelace_mode&&await async function(a,r,l){const n=new o("updateLovelaceResources"),h=await e(a),c=`/hacsfiles/${r.full_name.split("/")[1]}`,d=s({repository:r,version:l}),p=h.find((o=>o.url.includes(c)));n.debug({namespace:c,url:d,exsisting:p}),p&&p.url!==d?(n.debug(`Updating exsusting resource for ${c}`),await t(a,{url:d,resource_id:p.id,res_type:p.type})):h.map((o=>o.url)).includes(d)||(n.debug(`Adding ${d} to Lovelace resources`),await i(a,{url:d,res_type:"module"}))}(this.hass,this._repository,r),this._installing=!1,this.dispatchEvent(new Event("hacs-secondary-dialog-closed",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("hacs-dialog-closed",{bubbles:!0,composed:!0})),"plugin"===this._repository.category&&w(this,{title:this.hacs.localize("common.reload"),text:p`${this.hacs.localize("dialog.reload.description")}<br />${this.hacs.localize("dialog.reload.confirm")}`,dismissText:this.hacs.localize("common.cancel"),confirmText:this.hacs.localize("common.reload"),confirm:()=>{u.location.href=u.location.href}})}},{kind:"get",static:!0,key:"styles",value:function(){return[m,v`
|
||||
.note {
|
||||
margin-top: 12px;
|
||||
}
|
||||
.lovelace {
|
||||
margin-top: 8px;
|
||||
}
|
||||
pre {
|
||||
white-space: pre-line;
|
||||
user-select: all;
|
||||
}
|
||||
`]}}]}}),r);export{R as HacsDonwloadDialog};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const o=o=>o<10?`0${o}`:o;function t(t){const n=Math.floor(t/3600),r=Math.floor(t%3600/60),$=Math.floor(t%3600%60);return n>0?`${n}:${o(r)}:${o($)}`:r>0?`${r}:${o($)}`:$>0?""+$:null}export{t as s};
|
||||
Binary file not shown.
266
custom_components/hacs/hacs_frontend_experimental/c.4707854b.js
Normal file
266
custom_components/hacs/hacs_frontend_experimental/c.4707854b.js
Normal file
@@ -0,0 +1,266 @@
|
||||
import{_ as e,e as i,t,i as a,y as d,eS as s,b6 as n,ba as c,k as r,eT as o,a4 as l,O as h,d as p,Y as u,n as v,j as _,a5 as m,E as y,G as k}from"./main-85e087f9.js";import{b as g,s as f,d as b,a as $,g as x}from"./c.1095ea82.js";import{f as j,a as F,b as D}from"./c.6f18200a.js";import{S as z}from"./c.59ae3c13.js";import{c as C}from"./c.7398f5d5.js";import"./c.e651e5fa.js";import{e as w}from"./c.cbce77f6.js";import{c as P}from"./c.d2f13ac1.js";import{c as S}from"./c.6eb9fcd4.js";import"./c.fc9cf645.js";import"./c.00e853e1.js";import"./c.5aed34c8.js";import"./c.fea0de05.js";import"./c.388f6c87.js";import"./c.8e28b461.js";import"./c.eab7754a.js";import"./c.874c8cfd.js";import"./c.fa0ef026.js";import"./c.1024e243.js";import"./c.50a2e981.js";import"./c.704dab74.js";import"./c.04ecc0ad.js";import"./c.2610e8cd.js";import"./c.ccbe2b52.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?S(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(P(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(P(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.
@@ -0,0 +1 @@
|
||||
const s=(s,n)=>`https://${s.config.version.includes("b")?"rc":s.config.version.includes("dev")?"next":"www"}.home-assistant.io${n}`;export{s as d};
|
||||
@@ -0,0 +1,24 @@
|
||||
import{_ as e,j as t,e as i,y as a,eP as l,O as d,eQ as r,d as s,n as o}from"./main-85e087f9.js";import"./c.388f6c87.js";import"./c.8e28b461.js";import"./c.eab7754a.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:[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,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-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.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const e=()=>{const e={},r=new URLSearchParams(location.search);for(const[n,t]of r.entries())e[n]=t;return e},r=e=>{const r=new URLSearchParams;return Object.entries(e).forEach((([e,n])=>{r.append(e,n)})),r.toString()};export{r as c,e};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
100
custom_components/hacs/hacs_frontend_experimental/c.55c222d3.js
Normal file
100
custom_components/hacs/hacs_frontend_experimental/c.55c222d3.js
Normal file
@@ -0,0 +1,100 @@
|
||||
import{_ as e,j as i,e as t,y as a,bA as o,d as n,n as l,a5 as s,O as c}from"./main-85e087f9.js";import{a as r}from"./c.388f6c87.js";import"./c.e651e5fa.js";import"./c.34b7552d.js";import"./c.c629b018.js";import"./c.8e28b461.js";import"./c.eab7754a.js";import"./c.d2f13ac1.js";import"./c.1024e243.js";import"./c.36ae07d6.js";import"./c.4f015773.js";import"./c.fea0de05.js";import"./c.7398f5d5.js";import"./c.99cf2c6d.js";import"./c.c128b7f4.js";import"./c.5fe2e3ab.js";import"./c.54067e61.js";e([l("ha-help-tooltip")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"position",value:()=>"top"},{kind:"method",key:"render",value:function(){return a`
|
||||
<ha-svg-icon .path=${o}></ha-svg-icon>
|
||||
<paper-tooltip
|
||||
offset="4"
|
||||
.position=${this.position}
|
||||
.fitToVisibleBounds=${!0}
|
||||
>${this.label}</paper-tooltip
|
||||
>
|
||||
`}},{kind:"get",static:!0,key:"styles",value:function(){return n`
|
||||
ha-svg-icon {
|
||||
--mdc-icon-size: var(--ha-help-tooltip-size, 14px);
|
||||
color: var(--ha-help-tooltip-color, var(--disabled-text-color));
|
||||
}
|
||||
`}}]}}),i);const d=["more-info","toggle","navigate","url","call-service","none"];e([l("hui-action-editor")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t()],key:"config",value:void 0},{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"actions",value:void 0},{kind:"field",decorators:[t()],key:"tooltipText",value:void 0},{kind:"field",decorators:[t()],key:"hass",value:void 0},{kind:"get",key:"_navigation_path",value:function(){const e=this.config;return(null==e?void 0:e.navigation_path)||""}},{kind:"get",key:"_url_path",value:function(){const e=this.config;return(null==e?void 0:e.url_path)||""}},{kind:"get",key:"_service",value:function(){const e=this.config;return(null==e?void 0:e.service)||""}},{kind:"field",key:"_serviceAction",value(){return s((e=>{var i;return{service:this._service,data:null!==(i=e.data)&&void 0!==i?i:e.service_data,target:e.target}}))}},{kind:"method",key:"render",value:function(){var e,i,t,o,n,l,s;if(!this.hass)return a``;const c=null!==(e=this.actions)&&void 0!==e?e:d;return a`
|
||||
<div class="dropdown">
|
||||
<ha-select
|
||||
.label=${this.label}
|
||||
.configValue=${"action"}
|
||||
@selected=${this._actionPicked}
|
||||
.value=${null!==(i=null===(t=this.config)||void 0===t?void 0:t.action)&&void 0!==i?i:"default"}
|
||||
@closed=${r}
|
||||
fixedMenuPosition
|
||||
naturalMenuWidt
|
||||
>
|
||||
<mwc-list-item value="default">
|
||||
${this.hass.localize("ui.panel.lovelace.editor.action-editor.actions.default_action")}
|
||||
</mwc-list-item>
|
||||
${c.map((e=>a`
|
||||
<mwc-list-item .value=${e}>
|
||||
${this.hass.localize(`ui.panel.lovelace.editor.action-editor.actions.${e}`)}
|
||||
</mwc-list-item>
|
||||
`))}
|
||||
</ha-select>
|
||||
${this.tooltipText?a`
|
||||
<ha-help-tooltip .label=${this.tooltipText}></ha-help-tooltip>
|
||||
`:""}
|
||||
</div>
|
||||
${"navigate"===(null===(o=this.config)||void 0===o?void 0:o.action)?a`
|
||||
<ha-navigation-picker
|
||||
.hass=${this.hass}
|
||||
.label=${this.hass.localize("ui.panel.lovelace.editor.action-editor.navigation_path")}
|
||||
.value=${this._navigation_path}
|
||||
@value-changed=${this._navigateValueChanged}
|
||||
></ha-navigation-picker>
|
||||
`:""}
|
||||
${"url"===(null===(n=this.config)||void 0===n?void 0:n.action)?a`
|
||||
<ha-textfield
|
||||
.label=${this.hass.localize("ui.panel.lovelace.editor.action-editor.url_path")}
|
||||
.value=${this._url_path}
|
||||
.configValue=${"url_path"}
|
||||
@input=${this._valueChanged}
|
||||
></ha-textfield>
|
||||
`:""}
|
||||
${"call-service"===(null===(l=this.config)||void 0===l?void 0:l.action)?a`
|
||||
<ha-service-control
|
||||
.hass=${this.hass}
|
||||
.value=${this._serviceAction(this.config)}
|
||||
.showAdvanced=${null===(s=this.hass.userData)||void 0===s?void 0:s.showAdvanced}
|
||||
narrow
|
||||
@value-changed=${this._serviceValueChanged}
|
||||
></ha-service-control>
|
||||
`:""}
|
||||
`}},{kind:"method",key:"_actionPicked",value:function(e){var i;if(e.stopPropagation(),!this.hass)return;const t=e.target.value;if((null===(i=this.config)||void 0===i?void 0:i.action)===t)return;if("default"===t)return void c(this,"value-changed",{value:void 0});let a;switch(t){case"url":a={url_path:this._url_path};break;case"call-service":a={service:this._service};break;case"navigate":a={navigation_path:this._navigation_path}}c(this,"value-changed",{value:{action:t,...a}})}},{kind:"method",key:"_valueChanged",value:function(e){if(e.stopPropagation(),!this.hass)return;const i=e.target,t=e.target.value;this[`_${i.configValue}`]!==t&&i.configValue&&c(this,"value-changed",{value:{...this.config,[i.configValue]:t}})}},{kind:"method",key:"_serviceValueChanged",value:function(e){e.stopPropagation();const i={...this.config,service:e.detail.value.service||"",data:e.detail.value.data||{},target:e.detail.value.target||{}};"service_data"in i&&delete i.service_data,c(this,"value-changed",{value:i})}},{kind:"method",key:"_navigateValueChanged",value:function(e){e.stopPropagation();const i={...this.config,navigation_path:e.detail.value};c(this,"value-changed",{value:i})}},{kind:"get",static:!0,key:"styles",value:function(){return n`
|
||||
.dropdown {
|
||||
position: relative;
|
||||
}
|
||||
ha-help-tooltip {
|
||||
position: absolute;
|
||||
right: 40px;
|
||||
top: 16px;
|
||||
inset-inline-start: initial;
|
||||
inset-inline-end: 40px;
|
||||
direction: var(--direction);
|
||||
}
|
||||
ha-select,
|
||||
ha-textfield {
|
||||
width: 100%;
|
||||
}
|
||||
ha-service-control,
|
||||
ha-navigation-picker {
|
||||
display: block;
|
||||
}
|
||||
ha-textfield,
|
||||
ha-service-control,
|
||||
ha-navigation-picker {
|
||||
margin-top: 8px;
|
||||
}
|
||||
ha-service-control {
|
||||
--service-control-padding: 0;
|
||||
}
|
||||
`}}]}}),i);let h=e([l("ha-selector-ui-action")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t()],key:"hass",value:void 0},{kind:"field",decorators:[t()],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:"method",key:"render",value:function(){var e;return a`
|
||||
<hui-action-editor
|
||||
.label=${this.label}
|
||||
.hass=${this.hass}
|
||||
.config=${this.value}
|
||||
.actions=${null===(e=this.selector["ui-action"])||void 0===e?void 0:e.actions}
|
||||
.tooltipText=${this.helper}
|
||||
@value-changed=${this._valueChanged}
|
||||
></hui-action-editor>
|
||||
`}},{kind:"method",key:"_valueChanged",value:function(e){c(this,"value-changed",{value:e.detail.value})}}]}}),i);export{h as HaSelectorUiAction};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{_ as s,e,E as i,G as t}from"./main-85e087f9.js";const o=o=>s(null,(function(s,o){class n extends o{constructor(...e){super(...e),s(this)}}return{F:n,d:[{kind:"field",decorators:[e({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value:void 0},{kind:"field",key:"__unsubs",value:void 0},{kind:"method",key:"connectedCallback",value:function(){i(t(n.prototype),"connectedCallback",this).call(this),this.__checkSubscribed()}},{kind:"method",key:"disconnectedCallback",value:function(){if(i(t(n.prototype),"disconnectedCallback",this).call(this),this.__unsubs){for(;this.__unsubs.length;){const s=this.__unsubs.pop();s instanceof Promise?s.then((s=>s())):s()}this.__unsubs=void 0}}},{kind:"method",key:"updated",value:function(s){if(i(t(n.prototype),"updated",this).call(this,s),s.has("hass"))this.__checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of s.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this.__checkSubscribed()}},{kind:"method",key:"hassSubscribe",value:function(){return[]}},{kind:"method",key:"__checkSubscribed",value:function(){var s;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(s=this.hassSubscribeRequiredHostProps)&&void 0!==s&&s.some((s=>void 0===this[s]))||(this.__unsubs=this.hassSubscribe())}}]}}),o);export{o as S};
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
import{_ as e,j as i,e as t,t as a,i as s,a5 as d,y as o,O as l,n,k as r}from"./main-85e087f9.js";import{c}from"./c.d2f13ac1.js";import{f as u}from"./c.1095ea82.js";import{b as h,a as v}from"./c.ccbe2b52.js";import"./c.fea0de05.js";const m=e=>o`<mwc-list-item
|
||||
class=${r({"add-new":"add_new"===e.area_id})}
|
||||
>
|
||||
${e.name}
|
||||
</mwc-list-item>`;e([n("ha-area-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:"label",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()],key:"placeholder",value:void 0},{kind:"field",decorators:[t({type:Boolean,attribute:"no-add"})],key:"noAdd",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({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[t()],key:"deviceFilter",value:void 0},{kind:"field",decorators:[t()],key:"entityFilter",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:[a()],key:"_opened",value:void 0},{kind:"field",decorators:[s("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_suggestion",value:void 0},{kind:"field",key:"_init",value:()=>!1},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.open())}},{kind:"method",key:"focus",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.focus())}},{kind:"field",key:"_getAreas",value(){return d(((e,i,t,a,s,d,o,l,n)=>{if(!e.length)return[{area_id:"no_areas",name:this.hass.localize("ui.components.area-picker.no_areas"),picture:null}];const r={};let u,h;if(a||s||d){for(const e of t)e.device_id&&(e.device_id in r||(r[e.device_id]=[]),r[e.device_id].push(e));u=i,h=t.filter((e=>e.area_id))}else o&&(u=i),l&&(h=t.filter((e=>e.area_id)));a&&(u=u.filter((e=>{const i=r[e.id];return!(!i||!i.length)&&r[e.id].some((e=>a.includes(c(e.entity_id))))})),h=h.filter((e=>a.includes(c(e.entity_id))))),s&&(u=u.filter((e=>{const i=r[e.id];return!i||!i.length||t.every((e=>!s.includes(c(e.entity_id))))})),h=h.filter((e=>!s.includes(c(e.entity_id))))),d&&(u=u.filter((e=>{const i=r[e.id];return!(!i||!i.length)&&r[e.id].some((e=>{const i=this.hass.states[e.entity_id];return!!i&&(i.attributes.device_class&&d.includes(i.attributes.device_class))}))})),h=h.filter((e=>{const i=this.hass.states[e.entity_id];return i.attributes.device_class&&d.includes(i.attributes.device_class)}))),o&&(u=u.filter((e=>o(e)))),l&&(h=h.filter((e=>l(e))));let v,m=e;var _;(u&&(v=u.filter((e=>e.area_id)).map((e=>e.area_id))),h)&&(v=(null!==(_=v)&&void 0!==_?_:[]).concat(h.filter((e=>e.area_id)).map((e=>e.area_id))));return v&&(m=e.filter((e=>v.includes(e.area_id)))),m.length||(m=[{area_id:"no_areas",name:this.hass.localize("ui.components.area-picker.no_match"),picture:null}]),n?m:[...m,{area_id:"add_new",name:this.hass.localize("ui.components.area-picker.add_new"),picture:null}]}))}},{kind:"method",key:"updated",value:function(e){(!this._init&&this.hass||this._init&&e.has("_opened")&&this._opened)&&(this._init=!0,this.comboBox.items=this._getAreas(Object.values(this.hass.areas),Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd))}},{kind:"method",key:"render",value:function(){var e;return o`
|
||||
<ha-combo-box
|
||||
.hass=${this.hass}
|
||||
.helper=${this.helper}
|
||||
item-value-path="area_id"
|
||||
item-id-path="area_id"
|
||||
item-label-path="name"
|
||||
.value=${this.value}
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
.label=${void 0===this.label&&this.hass?this.hass.localize("ui.components.area-picker.area"):this.label}
|
||||
.placeholder=${this.placeholder?null===(e=this.hass.areas[this.placeholder])||void 0===e?void 0:e.name:void 0}
|
||||
.renderer=${m}
|
||||
@filter-changed=${this._filterChanged}
|
||||
@opened-changed=${this._openedChanged}
|
||||
@value-changed=${this._areaChanged}
|
||||
>
|
||||
</ha-combo-box>
|
||||
`}},{kind:"method",key:"_filterChanged",value:function(e){var i;const t=e.detail.value;if(!t)return void(this.comboBox.filteredItems=this.comboBox.items);const a=null===(i=this.comboBox.items)||void 0===i?void 0:i.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())));this.noAdd||0!==(null==a?void 0:a.length)?this.comboBox.filteredItems=a:(this._suggestion=t,this.comboBox.filteredItems=[{area_id:"add_new_suggestion",name:this.hass.localize("ui.components.area-picker.add_new_sugestion",{name:this._suggestion}),picture:null}])}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_areaChanged",value:function(e){e.stopPropagation();let i=e.detail.value;"no_areas"===i&&(i=""),["add_new_suggestion","add_new"].includes(i)?(e.target.value=this._value,h(this,{title:this.hass.localize("ui.components.area-picker.add_dialog.title"),text:this.hass.localize("ui.components.area-picker.add_dialog.text"),confirmText:this.hass.localize("ui.components.area-picker.add_dialog.add"),inputLabel:this.hass.localize("ui.components.area-picker.add_dialog.name"),defaultValue:"add_new_suggestion"===i?this._suggestion:void 0,confirm:async e=>{if(e)try{const i=await u(this.hass,{name:e}),t=[...Object.values(this.hass.areas),i];this.comboBox.filteredItems=this._getAreas(t,Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd),await this.updateComplete,await this.comboBox.updateComplete,this._setValue(i.area_id)}catch(e){v(this,{title:this.hass.localize("ui.components.area-picker.add_dialog.failed_create_area"),text:e.message})}},cancel:()=>{this._setValue(void 0),this._suggestion=void 0}})):i!==this._value&&this._setValue(i)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{l(this,"value-changed",{value:e}),l(this,"change")}),0)}}]}}),i);
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
import{_ as t,j as e,e as r,y as n,af as i,ag as a,d as o,n as s}from"./main-85e087f9.js";t([s("hacs-link")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[r({type:Boolean})],key:"newtab",value:()=>!1},{kind:"field",decorators:[r({type:Boolean})],key:"parent",value:()=>!1},{kind:"field",decorators:[r()],key:"title",value:()=>""},{kind:"field",decorators:[r()],key:"url",value:void 0},{kind:"method",key:"render",value:function(){return n`<span title=${this.title||this.url} @click=${this._open}><slot></slot></span>`}},{kind:"method",key:"_open",value:function(){var t;if(this.url.startsWith("/")&&!this.newtab)return void i(this.url,{replace:!0});const e=null===(t=this.url)||void 0===t?void 0:t.startsWith("http");let r="",n="_blank";e&&(r="noreferrer=true"),e||this.newtab||(n="_blank"),e||this.parent||(n="_parent"),a.open(this.url,n,r)}},{kind:"get",static:!0,key:"styles",value:function(){return o`
|
||||
span {
|
||||
cursor: pointer;
|
||||
color: var(--hcv-text-color-link);
|
||||
text-decoration: var(--hcv-text-decoration-link);
|
||||
}
|
||||
`}}]}}),e);
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,63 @@
|
||||
import{_ as r,j as a,e as o,d as e,y as d,n as t}from"./main-85e087f9.js";r([t("ha-card")],(function(r,a){return{F:class extends a{constructor(...a){super(...a),r(this)}},d:[{kind:"field",decorators:[o()],key:"header",value:void 0},{kind:"field",decorators:[o({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"get",static:!0,key:"styles",value:function(){return e`
|
||||
:host {
|
||||
background: var(
|
||||
--ha-card-background,
|
||||
var(--card-background-color, white)
|
||||
);
|
||||
box-shadow: var(--ha-card-box-shadow, none);
|
||||
box-sizing: border-box;
|
||||
border-radius: var(--ha-card-border-radius, 12px);
|
||||
border-width: var(--ha-card-border-width, 1px);
|
||||
border-style: solid;
|
||||
border-color: var(
|
||||
--ha-card-border-color,
|
||||
var(--divider-color, #e0e0e0)
|
||||
);
|
||||
color: var(--primary-text-color);
|
||||
display: block;
|
||||
transition: all 0.3s ease-out;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:host([raised]) {
|
||||
border: none;
|
||||
box-shadow: var(
|
||||
--ha-card-box-shadow,
|
||||
0px 2px 1px -1px rgba(0, 0, 0, 0.2),
|
||||
0px 1px 1px 0px rgba(0, 0, 0, 0.14),
|
||||
0px 1px 3px 0px rgba(0, 0, 0, 0.12)
|
||||
);
|
||||
}
|
||||
|
||||
.card-header,
|
||||
:host ::slotted(.card-header) {
|
||||
color: var(--ha-card-header-color, --primary-text-color);
|
||||
font-family: var(--ha-card-header-font-family, inherit);
|
||||
font-size: var(--ha-card-header-font-size, 24px);
|
||||
letter-spacing: -0.012em;
|
||||
line-height: 48px;
|
||||
padding: 12px 16px 16px;
|
||||
display: block;
|
||||
margin-block-start: 0px;
|
||||
margin-block-end: 0px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
:host ::slotted(.card-content:not(:first-child)),
|
||||
slot:not(:first-child)::slotted(.card-content) {
|
||||
padding-top: 0px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
:host ::slotted(.card-content) {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
:host ::slotted(.card-actions) {
|
||||
border-top: 1px solid var(--divider-color, #e8e8e8);
|
||||
padding: 5px 16px;
|
||||
}
|
||||
`}},{kind:"method",key:"render",value:function(){return d`
|
||||
${this.header?d`<h1 class="card-header">${this.header}</h1>`:d``}
|
||||
<slot></slot>
|
||||
`}}]}}),a);
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
var a=[];export{a as default};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,54 @@
|
||||
import{_ as e,j as t,e as i,t as a,y as s,a6 as o,a7 as l,O as d,d as r,n}from"./main-85e087f9.js";import"./c.c6e8abf0.js";import"./c.388f6c87.js";import"./c.8e28b461.js";import"./c.eab7754a.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.
@@ -0,0 +1 @@
|
||||
import{c as e}from"./c.1024e243.js";const r=r=>{return t=r.entity_id,void 0===(a=r.attributes).friendly_name?e(t).replace(/_/g," "):a.friendly_name||"";var t,a};export{r as c};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{c as e}from"./c.fa0ef026.js";const t=async(e,n,r,i,s,...a)=>{const o=s,c=o[e],u=c=>i&&i(s,c.result)!==c.cacheKey?(o[e]=void 0,t(e,n,r,i,s,...a)):c.result;if(c)return c instanceof Promise?c.then(u):u(c);const l=r(s,...a);return o[e]=l,l.then((t=>{o[e]={result:t,cacheKey:null==i?void 0:i(s,t)},setTimeout((()=>{o[e]=void 0}),n)}),(()=>{o[e]=void 0})),l},n=(e,t)=>e.callWS({type:"entity/source",entity_id:t}),r=(e,r)=>r?n(e,r):t("_entitySources",3e4,n,(e=>Object.keys(e.states).length),e),i=(e,t,n)=>{const{manufacturer:r,model:i,integration:s}=e;if(r&&t.manufacturer!==r)return!1;if(i&&t.model!==i)return!1;var a;if(s&&n&&(null==n||null===(a=n[t.id])||void 0===a||!a.includes(s)))return!1;return!0},s=(t,n,r)=>{var i;const{domain:s,device_class:a,integration:o}=t;if(s){const t=e(n);if(Array.isArray(s)?!s.includes(t):t!==s)return!1}return(!a||n.attributes.device_class===a)&&(!o||(null==r||null===(i=r[n.entity_id])||void 0===i?void 0:i.domain)===o)};export{s as a,i as b,r as f};
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
import{_ as e,j as a,e as i,y as l,bs as t,O as o,d,n as s}from"./main-85e087f9.js";import{a as r}from"./c.89ccd556.js";import{f as n}from"./c.d9d8b90e.js";import"./c.388f6c87.js";const c=()=>import("./c.e6b9d450.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()],key:"min",value:void 0},{kind:"field",decorators:[i()],key:"max",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
|
||||
readonly
|
||||
@click=${this._openDialog}
|
||||
.value=${this.value?r(new Date(`${this.value.split("T")[0]}T00:00:00`),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:this.min||"1970-01-01",max:this.max,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);
|
||||
}
|
||||
ha-textfield {
|
||||
display: block;
|
||||
}
|
||||
`}}]}}),a);
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{a as s}from"./c.04ecc0ad.js";const a="unavailable",r="unknown",e="off",n=[a,r],o=(t=n,(s,a)=>t.includes(s,a));var t;const i=4,c=a=>s(a,4)&&"number"==typeof a.in_progress,u=s=>(s=>c(s.attributes))(s)||!!s.attributes.in_progress,p=s=>c(s)||!!s.in_progress;export{e as O,a as U,r as a,p as b,i as c,n as d,o as i,u};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,o){return e(o={exports:{}},o.exports),o.exports}function n(e){return e&&e.default||e}export{e as a,t as c,n as g,o as u};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,90 @@
|
||||
import{_ as s,H as o,e as t,t as e,y as i,m as a,w as r,a as c,r as d,g as h,b as n,s as l,c as p,d as m,n as u}from"./main-85e087f9.js";import{c as v}from"./c.eab7754a.js";import"./c.fea0de05.js";import"./c.99cf2c6d.js";import"./c.cbdebe08.js";import"./c.8e28b461.js";import"./c.388f6c87.js";import"./c.7398f5d5.js";import"./c.7d6b8ecd.js";let g=s([u("hacs-custom-repositories-dialog")],(function(s,o){return{F:class extends o{constructor(...o){super(...o),s(this)}},d:[{kind:"field",decorators:[t()],key:"_error",value:void 0},{kind:"field",decorators:[e()],key:"_progress",value:()=>!1},{kind:"field",decorators:[e()],key:"_addRepositoryData",value:()=>({category:void 0,repository:void 0})},{kind:"field",decorators:[e()],key:"_customRepositories",value:void 0},{kind:"method",key:"shouldUpdate",value:function(s){return s.has("narrow")||s.has("active")||s.has("_error")||s.has("_addRepositoryData")||s.has("_customRepositories")||s.has("_progress")}},{kind:"method",key:"render",value:function(){var s,o;if(!this.active)return i``;const t=[{name:"repository",selector:{text:{}}},{name:"category",selector:{select:{mode:"dropdown",options:this.hacs.info.categories.map((s=>({value:s,label:this.hacs.localize(`common.${s}`)})))}}}];return i`
|
||||
<hacs-dialog
|
||||
.active=${this.active}
|
||||
.hass=${this.hass}
|
||||
.title=${this.hacs.localize("dialog_custom_repositories.title")}
|
||||
scrimClickAction
|
||||
escapeKeyAction
|
||||
maxWidth
|
||||
>
|
||||
<div class="content">
|
||||
<div class="list" ?narrow=${this.narrow}>
|
||||
${null!==(s=this._error)&&void 0!==s&&s.message?i`<ha-alert alert-type="error" .rtl=${v(this.hass)}>
|
||||
${this._error.message}
|
||||
</ha-alert>`:""}
|
||||
${null===(o=this._customRepositories)||void 0===o?void 0:o.filter((s=>this.hacs.info.categories.includes(s.category))).map((s=>i`<a
|
||||
href="/hacs/repository/${s.id}"
|
||||
@click=${()=>this.active=!1}
|
||||
>
|
||||
<ha-settings-row>
|
||||
<span slot="heading">${s.name}</span>
|
||||
<span slot="description">${s.full_name} (${s.category})</span>
|
||||
|
||||
<mwc-icon-button
|
||||
@click=${o=>{o.preventDefault(),this._removeRepository(String(s.id))}}
|
||||
>
|
||||
<ha-svg-icon class="delete" .path=${a}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
</ha-settings-row>
|
||||
</a>`))}
|
||||
</div>
|
||||
<ha-form
|
||||
?narrow=${this.narrow}
|
||||
.data=${this._addRepositoryData}
|
||||
.schema=${t}
|
||||
.computeLabel=${s=>"category"===s.name?this.hacs.localize("dialog_custom_repositories.category"):this.hacs.localize("common.repository")}
|
||||
@value-changed=${this._valueChanged}
|
||||
>
|
||||
</ha-form>
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryaction"
|
||||
raised
|
||||
.disabled=${void 0===this._addRepositoryData.category||void 0===this._addRepositoryData.repository}
|
||||
@click=${this._addRepository}
|
||||
>
|
||||
${this._progress?i`<ha-circular-progress active size="small"></ha-circular-progress>`:this.hacs.localize("common.add")}
|
||||
</mwc-button>
|
||||
</hacs-dialog>
|
||||
`}},{kind:"method",key:"firstUpdated",value:function(){var s;r(this.hass,(s=>this._error=s),c.ERROR),this._customRepositories=null===(s=this.hacs.repositories)||void 0===s?void 0:s.filter((s=>s.custom))}},{kind:"method",key:"_valueChanged",value:function(s){this._addRepositoryData=s.detail.value}},{kind:"method",key:"_addRepository",value:async function(){if(this._error=void 0,this._progress=!0,!this._addRepositoryData.category)return void(this._error={message:this.hacs.localize("dialog_custom_repositories.no_category")});if(!this._addRepositoryData.repository)return void(this._error={message:this.hacs.localize("dialog_custom_repositories.no_repository")});await d(this.hass,this._addRepositoryData.repository,this._addRepositoryData.category);const s=await h(this.hass);this.dispatchEvent(new CustomEvent("update-hacs",{detail:{repositories:s},bubbles:!0,composed:!0})),this._customRepositories=s.filter((s=>s.custom)),this._progress=!1}},{kind:"method",key:"_removeRepository",value:async function(s){this._error=void 0,await n(this.hass,s);const o=await h(this.hass);this.dispatchEvent(new CustomEvent("update-hacs",{detail:{repositories:o},bubbles:!0,composed:!0})),this._customRepositories=o.filter((s=>s.custom))}},{kind:"get",static:!0,key:"styles",value:function(){return[l,p,m`
|
||||
.list {
|
||||
position: relative;
|
||||
max-height: calc(100vh - 500px);
|
||||
overflow: auto;
|
||||
}
|
||||
a {
|
||||
all: unset;
|
||||
}
|
||||
ha-form {
|
||||
display: block;
|
||||
padding: 25px 0;
|
||||
}
|
||||
ha-form[narrow] {
|
||||
background-color: var(--card-background-color);
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
width: calc(100% - 48px);
|
||||
}
|
||||
ha-svg-icon {
|
||||
--mdc-icon-size: 36px;
|
||||
}
|
||||
ha-svg-icon:not(.delete) {
|
||||
margin-right: 4px;
|
||||
}
|
||||
ha-settings-row {
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
.list[narrow] > ha-settings-row:last-of-type {
|
||||
margin-bottom: 162px;
|
||||
}
|
||||
.delete {
|
||||
color: var(--hcv-color-error);
|
||||
}
|
||||
|
||||
@media all and (max-width: 450px), all and (max-height: 500px) {
|
||||
.list {
|
||||
max-height: calc(100vh - 162px);
|
||||
}
|
||||
}
|
||||
`]}}]}}),o);export{g as HacsCustomRepositoriesDialog};
|
||||
Binary file not shown.
112
custom_components/hacs/hacs_frontend_experimental/c.7d6b8ecd.js
Normal file
112
custom_components/hacs/hacs_frontend_experimental/c.7d6b8ecd.js
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
import{_ as e,j as t,e as i,y as a,d as s,O as l,n as d}from"./main-85e087f9.js";import"./c.eab7754a.js";import{a as r}from"./c.388f6c87.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.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const o=(o,s)=>o<s?-1:o>s?1:0,s=(s,e)=>o(s.toLowerCase(),e.toLowerCase());export{s as c,o as s};
|
||||
@@ -0,0 +1,41 @@
|
||||
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-85e087f9.js";import"./c.eab7754a.js";import{g as l}from"./c.f2bb3724.js";import{d as c}from"./c.36ae07d6.js";import{c as u}from"./c.874c8cfd.js";import{b as h}from"./c.07e395f8.js";import"./c.fea0de05.js";import"./c.8e28b461.js";import"./c.388f6c87.js";import"./c.7398f5d5.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};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user