185 files
This commit is contained in:
1 parent
5f9330abd7
commit
a718af6423
185 files changed
+16868
-3088
No files matched your search
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,230 @@
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap;let i=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const a=this.t;if(t&&void 0===e){const t=void 0!==a&&1===a.length;t&&(e=o.get(a)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&o.set(a,e))}return e}toString(){return this.cssText}};const n=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const a of e.cssRules)t+=a.cssText;return(e=>new i("string"==typeof e?e:e+"",void 0,a))(t)})(e):e,{is:r,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:d,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,_=globalThis,p=_.trustedTypes,m=p?p.emptyScript:"",h=_.reactiveElementPolyfillSupport,y=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let a=e;switch(t){case Boolean:a=null!==e;break;case Number:a=null===e?null:Number(e);break;case Object:case Array:try{a=JSON.parse(e)}catch(e){a=null}}return a}},g=(e,t)=>!r(e,t),v={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const a=Symbol(),o=this.getPropertyDescriptor(e,a,t);void 0!==o&&s(this.prototype,e,o)}}static getPropertyDescriptor(e,t,a){const{get:o,set:i}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const n=o?.call(this);i?.call(this,t),this.requestUpdate(e,n,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...d(e),...c(e)];for(const a of t)this.createProperty(a,e[a])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,a]of t)this.elementProperties.set(e,a)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const a=this._$Eu(e,t);void 0!==a&&this._$Eh.set(a,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const a=new Set(e.flat(1/0).reverse());for(const e of a)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static _$Eu(e,t){const a=t.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((a,o)=>{if(t)a.adoptedStyleSheets=o.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of o){const o=document.createElement("style"),i=e.litNonce;void 0!==i&&o.setAttribute("nonce",i),o.textContent=t.cssText,a.appendChild(o)}})(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$ET(e,t){const a=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,a);if(void 0!==o&&!0===a.reflect){const i=(void 0!==a.converter?.toAttribute?a.converter:k).toAttribute(t,a.type);this._$Em=e,null==i?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(e,t){const a=this.constructor,o=a._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=a.getPropertyOptions(o),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=o;const n=i.fromAttribute(t,e.type);this[o]=n??this.Line truncated
|
||||
.card-config {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 4px 0;
|
||||
}
|
||||
ha-expansion-panel {
|
||||
margin: 8px 0;
|
||||
}
|
||||
.panel-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
padding: 8px 0 4px;
|
||||
}
|
||||
.width-table {
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: var(--ha-card-border-radius, 12px);
|
||||
padding: 12px;
|
||||
}
|
||||
.width-table-title {
|
||||
color: var(--primary-text-color);
|
||||
font-weight: 500;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.width-table table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
.width-table td {
|
||||
padding: 2px 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
.width-table-width {
|
||||
color: var(--primary-text-color);
|
||||
font-variant-numeric: tabular-nums;
|
||||
padding-right: 12px !important;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
width: 1%;
|
||||
}
|
||||
.width-table-layout {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
.width-table-note {
|
||||
color: var(--secondary-text-color);
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.filter-bar {
|
||||
border-bottom: 1px solid var(--divider-color);
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.filter-empty {
|
||||
color: var(--primary-text-color);
|
||||
padding: 24px 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.filter-empty-note {
|
||||
color: var(--secondary-text-color);
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
margin-top: 8px;
|
||||
}
|
||||
ha-expansion-panel.entity-panel,
|
||||
ha-expansion-panel.exceptions {
|
||||
margin: 0;
|
||||
}
|
||||
.entity-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.text-button {
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
color: var(--primary-color);
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
.text-button:hover:not(:disabled) {
|
||||
background: var(--secondary-background-color);
|
||||
}
|
||||
.text-button:disabled {
|
||||
color: var(--disabled-text-color);
|
||||
cursor: default;
|
||||
}
|
||||
`;const Ki="exceptions";var Oi={daysOfWeek:["нед.","пон.","вт.","ср.","четв.","пет.","съб."],fullDaysOfWeek:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],months:["ян.","фев.","мар","апр.","май","юни","юли","авг.","септ.","окт.","ноем.","дек."],allDay:"цял ден",multiDay:"до",at:"в",endsToday:"приключва днес",endsTomorrow:"приключва утре",noEvents:"Няма планирани събития",loading:"Зареждане на календара със събития...",error:"Грешка: календарът не е намерен или не е конфигуриран правилно"},Ei={daysOfWeek:["Dg","Dl","Dm","Dc","Dj","Dv","Ds"],fullDaysOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],months:["Gen","Febr","Març","Abr","Maig","Juny","Jul","Ag","Set","Oct","Nov","Des"],allDay:"tot el dia",multiDay:"fins a",at:"a les",endsToday:"acaba avui",endsTomorrow:"acaba damà",noEvents:"Cap event proper",loading:"Carregant events...",error:"Error: No s'ha trobat l'entitat del calendari o aquesta està mal configurada"},Mi={daysOfWeek:["Ne","Po","Út","St","Čt","Pá","So"],fullDaysOfWeek:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],months:["Led","Úno","Bře","Dub","Kvě","Čvn","Čvc","Srp","Zář","Říj","Lis","Pro"],allDay:"celý den",multiDay:"do",at:"v",endsToday:"končí dnes",endsTomorrow:"končí zítra",noEvents:"Žádné nadcházející události",loading:"Načítání událostí z kalendáře...",error:"Chyba: Entita kalendáře nebyla nalezena nebo je nesprávně nakonfigurována"},Hi={daysOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDaysOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],months:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],allDay:"hele dagen",multiDay:"indtil",at:"kl.",endsToday:"slutter i dag",endsTomorrow:"slutter i morgen",noEvents:"Ingen kommende begivenheder",loading:"Indlæser kalenderbegivenheder...",error:"Fejl: Kalenderenheden blev ikke fundet eller er ikke konfigureret korrekt"},$i={daysOfWeek:["So","Mo","Di","Mi","Do","Fr","Sa"],fullDaysOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],allDay:"ganztägig",multiDay:"bis",at:"um",endsToday:"endet heute",endsTomorrow:"endet morgen",noEvents:"Keine anstehenden Termine",loading:"Kalendereinträge werden geladen...",error:"Fehler: Kalender-Entität nicht gefunden oder falsch konfiguriert"},Ci={daysOfWeek:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],fullDaysOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],months:["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],allDay:"Ολοήμερο",multiDay:"έως",at:"στις",endsToday:"λήγει σήμερα",endsTomorrow:"λήγει αύριο",noEvents:"Δεν υπάρχουν προγραμματισμένα γεγονότα",loading:"Φόρτωση ημερολογίου...",error:"Σφάλμα: Η οντότητα ημερολογίου δεν βρέθηκε ή δεν έχει ρυθμιστεί σωστά"},Li={daysOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDaysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],allDay:"all day",multiDay:"until",at:"at",endsToday:"ends today",endsTomorrow:"ends tomorrow",noEvents:"No upcoming events",loading:"Loading calendar events...",error:"Error: Calendar entity not found or improperly configured"},Wi={daysOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDaysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],allDay:"all day",multiDay:"until",at:"at",endsToday:"ends today",endsTomorrow:"ends tomorrow",noEvents:"No upcoming events",loading:"Loading calendar events...",error:"Error: Calendar entity not found or improperly configured"},Ii={daysOfWeek:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],fullDaysOfWeek:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],months:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],allDay:"todo el día",multiDay:"hasta",at:"a las",endsToday:"termina hoy",endsTomorrow:"termina mañana",noEvents:"No hay eventos próximos",loading:"Cargando eventos del calendario...",error:"Error: La entidad del calendario no se encontró o está mal configurada"},Fi={daysOfWeek:["P","E","T","K","N","R","L"],fullDaysOfWeek:["pühapäev","esmaspäev","teisipäev","kolmapäev","neljapäev","reede
Line truncated
|
||||
<ha-expansion-panel
|
||||
outlined
|
||||
.header=${this._panelTitle(e,t)}
|
||||
.secondary=${null!=(i=this._panelHelper(e,t))?i:""}
|
||||
.leftChevron=${!1}
|
||||
.expanded=${r}
|
||||
>
|
||||
<ha-svg-icon slot="leading-icon" .path=${e.iconPath}></ha-svg-icon>
|
||||
<div class="panel-body">
|
||||
<ha-form
|
||||
class="panel-form"
|
||||
.hass=${this.hass}
|
||||
.data=${d}
|
||||
.schema=${l}
|
||||
.computeLabel=${this._computeLabel}
|
||||
.computeHelper=${this._computeHelper}
|
||||
.localizeValue=${this._localizeValue}
|
||||
@value-changed=${t=>this._valueChanged(e.id,t)}
|
||||
></ha-form>
|
||||
${_.map((e=>this._renderExtra(e)))} ${u} ${c}
|
||||
</div>
|
||||
</ha-expansion-panel>
|
||||
`}_panelTitle(e,t){var a;return null!=(a=ut(t.language,e.titleKey))?a:ct(e.titleKey)}_panelHelper(e,t){return ut(t.language,`${e.titleKey}.helper`)}_renderExtra(e){return L`
|
||||
<div class="width-table">
|
||||
<div class="width-table-title">${e.title}</div>
|
||||
<table>
|
||||
${e.rows.map((e=>L`
|
||||
<tr>
|
||||
<td class="width-table-width">${e.width}</td>
|
||||
<td class="width-table-layout">${e.layout}</td>
|
||||
</tr>
|
||||
`))}
|
||||
</table>
|
||||
<div class="width-table-note">${e.note}</div>
|
||||
</div>
|
||||
`}_renderEntities(e,t){var a,o,i,n;const r=null==(o=null==(a=e.subforms)?void 0:a.call(e,t))?void 0:o.find((e=>e.path.join(".")===So.join(".")));if(void 0===r)return I;const s=null!=(n=null==(i=this._config)?void 0:i.entities)?n:[];if(0===s.length)return I;const l=this._filterCtx,d=gi(this._filter),c=s.map(((e,t)=>({entry:e,index:t,schema:Pi(Ut(r.schema,Sa(e)),e,r.path,l)}))).filter((e=>Di(e.schema)));if(0===c.length)return I;const u=e=>pt(t.language,e,r.path),_=e=>kt(t.language,t.view,e,r.path,function(e){var t;return null!=(t=Je[e])?t:qe[e]}(e.name));return L`
|
||||
${c.map((({entry:e,index:a,schema:o})=>{const i=la(e);return L`
|
||||
<ha-expansion-panel
|
||||
outlined
|
||||
class="entity-panel"
|
||||
.header=${i}
|
||||
.secondary=${this._entitySummary(e,t)}
|
||||
.leftChevron=${!1}
|
||||
.expanded=${d}
|
||||
>
|
||||
<ha-svg-icon slot="leading-icon" .path=${"M19 19H5V8h14m-3-7v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-1V1h-2Z"}></ha-svg-icon>
|
||||
<div class="panel-body">
|
||||
<ha-form
|
||||
class="entity-form"
|
||||
.hass=${this.hass}
|
||||
.data=${function(e){const t=xa(e),a=wa(ba({},t),{[Lt]:Sa(e)});for(const[e,o]of Object.entries(Ht)){const i=t[e],n=o.find((e=>$t[e]===i));a[e]=null!=n?n:Mt}return a}(e)}
|
||||
.schema=${o}
|
||||
.computeLabel=${u}
|
||||
.computeHelper=${_}
|
||||
.localizeValue=${this._localizeValue}
|
||||
@value-changed=${e=>this._entityChanged(a,e)}
|
||||
></ha-form>
|
||||
<div class="entity-actions">
|
||||
<button
|
||||
type="button"
|
||||
class="text-button"
|
||||
?disabled=${!Na(e)}
|
||||
@click=${()=>this._copyEntitySettings(e)}
|
||||
>
|
||||
${this._string(t,"entity.copy")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="text-button"
|
||||
?disabled=${void 0===ja}
|
||||
@click=${()=>this._pasteEntitySettings(a)}
|
||||
>
|
||||
${this._string(t,"entity.paste")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ha-expansion-panel>
|
||||
`}))}
|
||||
`}_entitySummary(e,t){const a=xa(e);return"string"==typeof a.label&&""!==a.label?a.label:Na(e)?this._string(t,"entity.customised"):this._string(t,"entity.unconfigured")}_entityChanged(e,t){var a,o;t.stopPropagation();const i=null==(a=t.detail)?void 0:a.value;i&&this._config&&(this._config=cn(dn({},this._config),{entities:Da(null!=(o=this._config.entities)?o:[],e,i)}),this._report(this._config))}_copyEntitySettings(e){Va(e),this.requestUpdate()}_pasteEntitySettings(e){var t;this._config&&(this._config=cn(dn({},this._config),{entities:Pa(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_renderExceptions(e,t,a){const o=Ze[a.view];if(void 0===o)return I;const i=function(e,t,a="en"){var o;const i=new Set,n=[];for(const{node:t}of Uo(e))"selector"in t&&ei.has(t.name)&&!i.has(t.name)&&(i.add(t.name),n.push({name:t.name,selector:t.selector}));for(const e of null!=(o=Qo[t])?o:[]){if(i.has(e)||!ei.has(e))continue;const t=Xo(e,a);void 0!==t&&(i.add(e),n.push(t))}return n}(t,e.id,a.language);if(0===i.length)return I;const n=function(e,t){return e.filter((e=>t.has(e.name)))}(i,this._declaredExceptions),r=[o],s=gi(this._filter),l=this._string(a,"exceptions.title"),d=function(e,t,a,o){if(!gi(o.criteria))return[...e];const i=ki(o);return""!==i&&vi(t,i)?[...e]:e.filter((e=>wi(e,a,o)))}(n,l,r,this._filterCtx);if(s&&0===d.length)return I;const c=e=>pt(a.language,e,r),u={name:Ki,selector:{select:{mode:"dropdown",multiple:!0,options:i.map((e=>({value:e.name,label:c(e)})))}}},_=d.map((e=>e.name)),p=jo(ho(this._config,_),_,xo(this._pending,o)),m=function(e,t,a){return e.flatMap((e=>{const o=fo[e.name];return void 0===o?[e]:o.build(t,a)}))}(d,a.language,p);return L`
|
||||
<ha-expansion-panel
|
||||
outlined
|
||||
class="exceptions"
|
||||
.header=${l}
|
||||
.secondary=${this._exceptionSummary(n.length,a)}
|
||||
.leftChevron=${!1}
|
||||
.expanded=${s}
|
||||
>
|
||||
<ha-svg-icon slot="leading-icon" .path=${"M11 15h2v2h-2v-2m0-8h2v6h-2V7m1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z"}></ha-svg-icon>
|
||||
<div class="panel-body">
|
||||
<ha-form
|
||||
class="exception-picker"
|
||||
.hass=${this.hass}
|
||||
.data=${{[Ki]:n.map((e=>e.name))}}
|
||||
.schema=${[u]}
|
||||
.computeLabel=${this._computeLabel}
|
||||
.computeHelper=${this._computeHelper}
|
||||
.localizeValue=${this._localizeValue}
|
||||
@value-changed=${e=>this._exceptionsSelected(o,i,e)}
|
||||
></ha-form>
|
||||
${0===d.length?I:L`
|
||||
<ha-form
|
||||
class="exception-form"
|
||||
.hass=${this.hass}
|
||||
.data=${p}
|
||||
.schema=${m}
|
||||
.computeLabel=${e=>pt(a.language,e,r)}
|
||||
.computeHelper=${e=>kt(a.language,a.view,e,r)}
|
||||
.localizeValue=${this._localizeValue}
|
||||
@value-changed=${e=>this._exceptionChanged(o,_,e)}
|
||||
></ha-form>
|
||||
`}
|
||||
</div>
|
||||
</ha-expansion-panel>
|
||||
`}_exceptionSummary(e,t){return 0===e?this._string(t,"exceptions.summary.none"):1===e?this._string(t,"exceptions.summary.one"):ue(this._string(t,"exceptions.summary.many"),{count:e})}_exceptionsSelected(e,t,a){var o,i;if(a.stopPropagation(),!this._config)return;const n=null==(i=null==(o=a.detail)?void 0:o.value)?void 0:i[Ki];if(!Array.isArray(n))return;const r=function(e,t,a,o,i){const n=new Set(i.filter((e=>a.includes(e)))),r=new Set(o);let s=e;for(const e of a)n.has(e)?r.add(e):(r.delete(e),s=ti(s,t,e));return{config:s,declared:r}}(this._config,e,t.map((e=>e.name)),this._declaredExceptions,n.map((e=>String(e))));this._config=r.config,this._declaredExceptions=r.declared,this._report(this._config)}_exceptionChanged(e,t,a){var o;a.stopPropagation();const i=null==(o=a.detail)?void 0:o.value;if(!i||!this._config)return;const n=e,r=xo(this._pending,n),s=jo(ho(this._config,t),t,r),l=this._config[e],d=function(e,t,a,o={}){const i=ro(t,a),n=_o(e,t,a,o),r=wo({},n.config);for(const e of Object.keys(r))ca(e)&&delete r[e];for(const[e,t]of Object.entries(fo))i.some((e=>t.fields.includes(e)))&&void 0===r[e]&&(r[e]=t.off);return{block:r,pending:n.pending}}(l&&"object"==typeof l&&!Array.isArray(l)?l:{},s,i,r);this._pending=function(e,t,a){const o=`${t}.`,i=Object.fromEntries(Object.entries(e).filter((([e])=>!e.startsWith(o))));return wo(wo({},i),Object.fromEntries(Object.entries(a).map((([e,t])=>[o+e,t]))))}(this._pending,n,d.pending),this._config=cn(dn({},this._config),{[e]:d.block}),this._report(this._config)}_string(e,t){var a;return null!=(a=ut(e.language,t))?a:ct(t)}render(){if(!this.hass||!this._config)return I;const e=this._ctx,t=Fo.map((t=>this._renderPanel(t,e))).filter((e=>e!==I)),a=0===t.length&&gi(this._filter);return L`
|
||||
<div class="card-config">
|
||||
${this._renderFilterBar()} ${t} ${a?this._renderNoMatches(e):I}
|
||||
</div>
|
||||
`}_renderFilterBar(){return L`
|
||||
<div class="filter-bar">
|
||||
<ha-form
|
||||
class="filter-form"
|
||||
.hass=${this.hass}
|
||||
.data=${e=this._filter,{[pi]:e.query,[mi]:e.customizedOnly}}
|
||||
.schema=${hi}
|
||||
.computeLabel=${this._computeLabel}
|
||||
.computeHelper=${this._computeHelper}
|
||||
.localizeValue=${this._localizeValue}
|
||||
@value-changed=${this._filterChanged}
|
||||
></ha-form>
|
||||
</div>
|
||||
`;var e}_renderNoMatches(e){const t=this._filter.query.trim();return""===t?L`
|
||||
<div class="filter-empty">${this._string(e,"filter.nothing_customized")}</div>
|
||||
`:L`
|
||||
<div class="filter-empty">
|
||||
${ue(this._string(e,"filter.no_matches"),{query:t})}
|
||||
<div class="filter-empty-note">${this._string(e,"filter.gated_note")}</div>
|
||||
</div>
|
||||
`}}un([le({attribute:!1})],_n.prototype,"hass"),un([de()],_n.prototype,"_config"),un([de()],_n.prototype,"_pending"),un([de()],_n.prototype,"_declaredExceptions"),un([de()],_n.prototype,"_filter");const pn="4.0.0";export{_n as CalendarCardProEditor,pn as EDITOR_VERSION,Fo as PANELS,_o as applyFormChange,ro as changedKeys,ua as deriveSyntheticData,aa as isCommittableOffset,ca as isSyntheticKey,lo as stripColumnDefaults,uo as toStoredConfig,Uo as walkSchema};
|
||||
Reference in new issue
Block a user