fix: keep Symcon binding paths compact and allow direct unlinking
This commit is contained in:
1 parent
00fca890de
commit
b9a095bc6e
12 files changed
+131
-46
No files matched your search
@@ -26,6 +26,8 @@ All notable changes to NextFloor, newest first. Every release lists what is **Ad
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Symcon picker width and unlinking:** Long selected object names and paths are truncated within the form, with the full path in a tooltip. A dedicated clear button removes the binding directly and preserves other room-climate sensors.
|
||||
|
||||
- **IP-Symcon blind feedback and directions:** Numeric position feedback can be selected independently of inferred domains and is read using its native range. Blind and slat directions can be reversed separately across live readings, 3D geometry, sliders, buttons, swipes and grouped actions, without writing to feedback variables.
|
||||
|
||||
- **IP-Symcon room humidity selection:** Manual room-climate fields accept numeric Integer/Float variables even without inferred classes or profiles. German “Feuchtigkeit” and subscript “CO₂” names are recognized, and parent category names no longer override measurement classes.
|
||||
|
||||
@@ -203,7 +203,7 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
min-height: 40px;
|
||||
}
|
||||
}
|
||||
`;var{I:tb}=ic,Md=t=>t;var Ed=t=>t.strings===void 0,Rd=()=>document.createComment(""),Fn=(t,e,n)=>{let r=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){let i=r.insertBefore(Rd(),o),s=r.insertBefore(Rd(),o);n=new tb(i,s,t,t.options)}else{let i=n._$AB.nextSibling,s=n._$AM,l=s!==t;if(l){let a;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(a=t._$AU)!==s._$AU&&n._$AP(a)}if(i!==o||l){let a=n._$AA;for(;a!==i;){let c=Md(a).nextSibling;Md(r).insertBefore(a,o),a=c}}}return n},It=(t,e,n=t)=>(t._$AI(e,n),t),nb={},Ad=(t,e=nb)=>t._$AH=e,Fd=t=>t._$AH,Yo=t=>{t._$AR(),t._$AA.remove()};var Td=(t,e,n)=>{let r=new Map;for(let o=e;o<=n;o++)r.set(t[o],o);return r},zd=Qt(class extends Pt{constructor(t){if(super(t),t.type!==En.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let r;n===void 0?n=e:e!==void 0&&(r=e);let o=[],i=[],s=0;for(let l of t)o[s]=r?r(l,s):s,i[s]=n(l,s),s++;return{values:i,keys:o}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,r]){let o=Fd(t),{values:i,keys:s}=this.dt(e,n,r);if(!Array.isArray(o))return this.ut=s,i;let l=this.ut??=[],a=[],c,d,u=0,p=o.length-1,h=0,f=i.length-1;for(;u<=p&&h<=f;)if(o[u]===null)u++;else if(o[p]===null)p--;else if(l[u]===s[h])a[h]=It(o[u],i[h]),u++,h++;else if(l[p]===s[f])a[f]=It(o[p],i[f]),p--,f--;else if(l[u]===s[f])a[f]=It(o[u],i[f]),Fn(t,a[f+1],o[u]),u++,f--;else if(l[p]===s[h])a[h]=It(o[p],i[h]),Fn(t,o[u],o[p]),p--,h++;else if(c===void 0&&(c=Td(s,h,f),d=Td(l,u,p)),c.has(l[u]))if(c.has(l[p])){let g=d.get(s[h]),y=g!==void 0?o[g]:null;if(y===null){let b=Fn(t,o[u]);It(b,i[h]),a[h]=b}else a[h]=It(y,i[h]),Fn(t,o[u],y),o[g]=null;h++}else Yo(o[p]),p--;else Yo(o[u]),u++;for(;h<=f;){let g=Fn(t,a[f+1]);It(g,i[h]),a[h++]=g}for(;u<=p;){let g=o[u++];g!==null&&Yo(g)}return this.ut=s,Ad(t,a),Qe}});var rb=new Intl.Collator("de",{numeric:!0,sensitivity:"base"}),zs=-1,Id=[{type:1,name:"I/O"},{type:2,name:"Splitter"},{type:0,name:"Kerninstanzen"},{type:4,name:"Konfiguratoren"},{type:5,name:"Discovery"},{type:6,name:"Visualisierungen"}],Pd=t=>t.object_type===1&&Id.some(e=>e.type===t.module_type);function ob(t){let e=new Map(t.map(a=>[a.object_id,a])),n=t.filter(a=>{if(!Pd(a))return!1;let c=new Set([a.object_id]),d=e.get(a.parent_id);for(;d&&!c.has(d.object_id);){if(Pd(d))return!1;c.add(d.object_id),d=e.get(d.parent_id)}return!0});if(!n.length)return t;let r=new Map(e),o=new Map;for(let a of t){let c=o.get(a.parent_id)??[];c.push(a),o.set(a.parent_id,c)}let i=(a,c,d,u,p)=>({object_id:a,parent_id:c,name:d,path:u,position:p,object_type:0,hidden:!1,icon:"",virtual:!0});r.set(zs,i(zs,0,"System","System",Number.MAX_SAFE_INTEGER));let s=new Set,l=(a,c,d)=>{if(s.has(a.object_id))return;s.add(a.object_id);let u={...a,parent_id:c,path:`${d} / ${a.name}`};r.set(a.object_id,u);for(let p of o.get(a.object_id)??[])l(p,a.object_id,u.path)};return Id.forEach((a,c)=>{let d=n.filter(h=>h.module_type===a.type);if(!d.length)return;let u=-10-a.type,p=`System / ${a.name}`;r.set(u,i(u,zs,a.name,p,c));for(let h of d)l(h,u,p)}),[...r.values()]}function Ps(t){let e=ob(t),n=new Map(e.map(o=>[o.object_id,o])),r=new Map;for(let o of e){let i=n.has(o.parent_id)?o.parent_id:0,s=r.get(i)??[];s.push(o),r.set(i,s)}for(let o of r.values())o.sort((i,s)=>i.position-s.position||i.object_type-s.object_type||rb.compare(i.name,s.name));return{nodes:n,children:r}}function Is(t,e){let n=[],r=new Set([e]),o=t.nodes.get(e)?.parent_id;for(;o&&!r.has(o)&&t.nodes.has(o);)n.push(o),r.add(o),o=t.nodes.get(o)?.parent_id;return n}function Ds(t,e,n=""){let r=n.trim().toLocaleLowerCase("de").split(/\s+/).filter(Boolean),o=r.length?new Set:null;if(o){for(let a of t.nodes.values())if(r.every(c=>`${a.name} ${a.path}`.toLocaleLowerCase("de").includes(c))){o.add(a.object_id);for(let c of Is(t,a.object_id))o.add(c)}}let i=[],s=new Set,l=(a,c)=>{let d=(t.children.get(a)??[]).filter(u=>!o||o.has(u.object_id));d.forEach((u,p)=>{if(s.has(u.object_id))return;s.add(u.object_id);let h=(t.children.get(u.object_id)?.length??0)>0,f=h&&(!!o||e.has(u.object_id));i.push({node:u,depth:c,hasChildren:h,expanded:f,index:p+1,siblings:d.length}),f&&l(u.object_id,c+1)})};return l(0,0),i}var ib=["Kategorie","Instanz","Variable","Skript","Ereignis","Medium","Link"],Os=class extends Q{static properties={objects:{attribute:!1},options:{attribute:!1},fixed:{attribute:!1},value:{attribute:!1},disabled:{type:Boolean},placeholder:{attribute:!1},_query:{state:!0},_expanded:{state:!0},_pending:{state:!0},_active:{state:!0},_selected:{state:!0}};tree=Ps([]);allowed=new Map;allowedSources=new Map;constructor(){super(),this.objects=[],this.options=[],this.fixed=[],this.value=null,this.disabled=!1,this.placeholder="Datenpunkt ausw\xE4hlen",this._query="",this._expanded=new Set,this._pending=null,this._active=null,this._selected=null}willUpdate(e){e.has("objects")&&(this.tree=Ps(this.objects)),(e.has("options")||e.has("fixed"))&&(this.allowed=new Map([...this.fixed,...this.options].map(n=>[n.id,n])),this.allowedSources=new Map(this.options.filter(n=
Line truncated
|
||||
`;var{I:tb}=ic,Md=t=>t;var Ed=t=>t.strings===void 0,Rd=()=>document.createComment(""),Fn=(t,e,n)=>{let r=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){let i=r.insertBefore(Rd(),o),s=r.insertBefore(Rd(),o);n=new tb(i,s,t,t.options)}else{let i=n._$AB.nextSibling,s=n._$AM,l=s!==t;if(l){let a;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(a=t._$AU)!==s._$AU&&n._$AP(a)}if(i!==o||l){let a=n._$AA;for(;a!==i;){let c=Md(a).nextSibling;Md(r).insertBefore(a,o),a=c}}}return n},It=(t,e,n=t)=>(t._$AI(e,n),t),nb={},Ad=(t,e=nb)=>t._$AH=e,Fd=t=>t._$AH,Yo=t=>{t._$AR(),t._$AA.remove()};var Td=(t,e,n)=>{let r=new Map;for(let o=e;o<=n;o++)r.set(t[o],o);return r},zd=Qt(class extends Pt{constructor(t){if(super(t),t.type!==En.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let r;n===void 0?n=e:e!==void 0&&(r=e);let o=[],i=[],s=0;for(let l of t)o[s]=r?r(l,s):s,i[s]=n(l,s),s++;return{values:i,keys:o}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,r]){let o=Fd(t),{values:i,keys:s}=this.dt(e,n,r);if(!Array.isArray(o))return this.ut=s,i;let l=this.ut??=[],a=[],c,d,u=0,p=o.length-1,h=0,f=i.length-1;for(;u<=p&&h<=f;)if(o[u]===null)u++;else if(o[p]===null)p--;else if(l[u]===s[h])a[h]=It(o[u],i[h]),u++,h++;else if(l[p]===s[f])a[f]=It(o[p],i[f]),p--,f--;else if(l[u]===s[f])a[f]=It(o[u],i[f]),Fn(t,a[f+1],o[u]),u++,f--;else if(l[p]===s[h])a[h]=It(o[p],i[h]),Fn(t,o[u],o[p]),p--,h++;else if(c===void 0&&(c=Td(s,h,f),d=Td(l,u,p)),c.has(l[u]))if(c.has(l[p])){let g=d.get(s[h]),y=g!==void 0?o[g]:null;if(y===null){let b=Fn(t,o[u]);It(b,i[h]),a[h]=b}else a[h]=It(y,i[h]),Fn(t,o[u],y),o[g]=null;h++}else Yo(o[p]),p--;else Yo(o[u]),u++;for(;h<=f;){let g=Fn(t,a[f+1]);It(g,i[h]),a[h++]=g}for(;u<=p;){let g=o[u++];g!==null&&Yo(g)}return this.ut=s,Ad(t,a),Qe}});var rb=new Intl.Collator("de",{numeric:!0,sensitivity:"base"}),zs=-1,Id=[{type:1,name:"I/O"},{type:2,name:"Splitter"},{type:0,name:"Kerninstanzen"},{type:4,name:"Konfiguratoren"},{type:5,name:"Discovery"},{type:6,name:"Visualisierungen"}],Pd=t=>t.object_type===1&&Id.some(e=>e.type===t.module_type);function ob(t){let e=new Map(t.map(a=>[a.object_id,a])),n=t.filter(a=>{if(!Pd(a))return!1;let c=new Set([a.object_id]),d=e.get(a.parent_id);for(;d&&!c.has(d.object_id);){if(Pd(d))return!1;c.add(d.object_id),d=e.get(d.parent_id)}return!0});if(!n.length)return t;let r=new Map(e),o=new Map;for(let a of t){let c=o.get(a.parent_id)??[];c.push(a),o.set(a.parent_id,c)}let i=(a,c,d,u,p)=>({object_id:a,parent_id:c,name:d,path:u,position:p,object_type:0,hidden:!1,icon:"",virtual:!0});r.set(zs,i(zs,0,"System","System",Number.MAX_SAFE_INTEGER));let s=new Set,l=(a,c,d)=>{if(s.has(a.object_id))return;s.add(a.object_id);let u={...a,parent_id:c,path:`${d} / ${a.name}`};r.set(a.object_id,u);for(let p of o.get(a.object_id)??[])l(p,a.object_id,u.path)};return Id.forEach((a,c)=>{let d=n.filter(h=>h.module_type===a.type);if(!d.length)return;let u=-10-a.type,p=`System / ${a.name}`;r.set(u,i(u,zs,a.name,p,c));for(let h of d)l(h,u,p)}),[...r.values()]}function Ps(t){let e=ob(t),n=new Map(e.map(o=>[o.object_id,o])),r=new Map;for(let o of e){let i=n.has(o.parent_id)?o.parent_id:0,s=r.get(i)??[];s.push(o),r.set(i,s)}for(let o of r.values())o.sort((i,s)=>i.position-s.position||i.object_type-s.object_type||rb.compare(i.name,s.name));return{nodes:n,children:r}}function Is(t,e){let n=[],r=new Set([e]),o=t.nodes.get(e)?.parent_id;for(;o&&!r.has(o)&&t.nodes.has(o);)n.push(o),r.add(o),o=t.nodes.get(o)?.parent_id;return n}function Ds(t,e,n=""){let r=n.trim().toLocaleLowerCase("de").split(/\s+/).filter(Boolean),o=r.length?new Set:null;if(o){for(let a of t.nodes.values())if(r.every(c=>`${a.name} ${a.path}`.toLocaleLowerCase("de").includes(c))){o.add(a.object_id);for(let c of Is(t,a.object_id))o.add(c)}}let i=[],s=new Set,l=(a,c)=>{let d=(t.children.get(a)??[]).filter(u=>!o||o.has(u.object_id));d.forEach((u,p)=>{if(s.has(u.object_id))return;s.add(u.object_id);let h=(t.children.get(u.object_id)?.length??0)>0,f=h&&(!!o||e.has(u.object_id));i.push({node:u,depth:c,hasChildren:h,expanded:f,index:p+1,siblings:d.length}),f&&l(u.object_id,c+1)})};return l(0,0),i}var ib=["Kategorie","Instanz","Variable","Skript","Ereignis","Medium","Link"],Os=class extends Q{static properties={objects:{attribute:!1},options:{attribute:!1},fixed:{attribute:!1},value:{attribute:!1},disabled:{type:Boolean},placeholder:{attribute:!1},_query:{state:!0},_expanded:{state:!0},_pending:{state:!0},_active:{state:!0},_selected:{state:!0}};tree=Ps([]);allowed=new Map;allowedSources=new Map;constructor(){super(),this.objects=[],this.options=[],this.fixed=[],this.value=null,this.disabled=!1,this.placeholder="Datenpunkt ausw\xE4hlen",this._query="",this._expanded=new Set,this._pending=null,this._active=null,this._selected=null}willUpdate(e){e.has("objects")&&(this.tree=Ps(this.objects)),(e.has("options")||e.has("fixed"))&&(this.allowed=new Map([...this.fixed,...this.options].map(n=>[n.id,n])),this.allowedSources=new Map(this.options.filter(n=
Line truncated
|
||||
aria-level=${e.depth+1} aria-posinset=${e.index} aria-setsize=${e.siblings}
|
||||
aria-expanded=${e.hasChildren?String(e.expanded):_}
|
||||
aria-selected=${o?String(n.object_id===this._selected&&r===this._pending):_}
|
||||
@@ -219,22 +219,22 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
${this.icon(n.object_type)}<span class="node-name">${n.name||"(Ohne Namen)"}</span>
|
||||
<small>${n.virtual?"Systembereich":ib[n.object_type]??"Objekt"}${n.hidden?" \xB7 ausgeblendet":""}</small>
|
||||
${o&&n.object_id===this._selected&&r===this._pending?m`<span class="selected-mark" aria-hidden="true">✓</span>`:_}
|
||||
</div>`}render(){let e=this.allowed.get(this.value??""),n=this.variableNode(this.value),r=this.allowed.get(this._pending??""),o=this._selected===null?void 0:this.tree.nodes.get(this._selected),i=(o&&this.entityFor(o)===this._pending?o:void 0)??this.variableNode(this._pending),s=Ds(this.tree,this._expanded,this._query),l=s.find(a=>a.node.object_id===this._active);return m`<button type="button" class="trigger" ?disabled=${this.disabled} aria-haspopup="dialog" @click=${this.open}>
|
||||
<span><strong>${n?.name??e?.label??"Datenpunkt ausw\xE4hlen"}</strong>
|
||||
${n?m`<small>${n.path}</small>`:_}</span><span aria-hidden="true">⌘</span>
|
||||
</button>
|
||||
<dialog aria-labelledby="picker-title" @click=${a=>{if(a.stopPropagation(),a.target===this.dialog){let c=this.dialog.getBoundingClientRect();(a.clientX<c.left||a.clientX>c.right||a.clientY<c.top||a.clientY>c.bottom)&&this.close()}}} @keydown=${a=>a.stopPropagation()} @change=${a=>a.stopPropagation()}>
|
||||
</div>`}render(){let e=this.allowed.get(this.value??""),n=this.variableNode(this.value),r=this.allowed.get(this._pending??""),o=this._selected===null?void 0:this.tree.nodes.get(this._selected),i=(o&&this.entityFor(o)===this._pending?o:void 0)??this.variableNode(this._pending),s=Ds(this.tree,this._expanded,this._query),l=s.find(c=>c.node.object_id===this._active),a=!!this.value&&!this.fixed.some(c=>c.id===this.value);return m`<div class="field"><button type="button" class="trigger" ?disabled=${this.disabled} aria-haspopup="dialog" @click=${this.open}>
|
||||
<span class="trigger-text"><strong>${n?.name??e?.label??"Datenpunkt ausw\xE4hlen"}</strong>
|
||||
${n?m`<small title=${n.path}>${n.path}</small>`:_}</span><span class="picker-icon" aria-hidden="true">⌘</span>
|
||||
</button>${a?m`<button class="clear" type="button" ?disabled=${this.disabled} aria-label="Verknüpfung entfernen" title="Verknüpfung entfernen" @click=${this.clear}>×</button>`:_}</div>
|
||||
<dialog aria-labelledby="picker-title" @click=${c=>{if(c.stopPropagation(),c.target===this.dialog){let d=this.dialog.getBoundingClientRect();(c.clientX<d.left||c.clientX>d.right||c.clientY<d.top||c.clientY>d.bottom)&&this.close()}}} @keydown=${c=>c.stopPropagation()} @change=${c=>c.stopPropagation()}>
|
||||
<header><div><h2 id="picker-title">Datenpunkt auswählen</h2><p>IP-Symcon · Objektbaum</p></div>
|
||||
<button class="close" type="button" aria-label="Schließen" @click=${this.close}>×</button></header>
|
||||
<div class="search-bar"><input class="search" type="search" placeholder="Im Objektbaum suchen …" aria-label="Objektbaum durchsuchen"
|
||||
.value=${this._query} @input=${a=>{this._query=a.target.value,this._active=null}}>
|
||||
.value=${this._query} @input=${c=>{this._query=c.target.value,this._active=null}}>
|
||||
<button class="text-button" type="button" @click=${()=>{this._query="",this._expanded=new Set,this._active=null}}>Alles zuklappen</button>
|
||||
</div>
|
||||
${this.fixed.length?m`<div class="fixed" aria-label="Weitere Auswahlmöglichkeiten">${this.fixed.map(a=>m`
|
||||
<button type="button" aria-pressed=${a.id===this._pending} @click=${()=>{this._pending=a.id,this._active=null,this._selected=null}}>${a.label}</button>`)}</div>`:_}
|
||||
${this.fixed.length?m`<div class="fixed" aria-label="Weitere Auswahlmöglichkeiten">${this.fixed.map(c=>m`
|
||||
<button type="button" aria-pressed=${c.id===this._pending} @click=${()=>{this._pending=c.id,this._active=null,this._selected=null}}>${c.label}</button>`)}</div>`:_}
|
||||
<div class="tree" role="tree" tabindex="0" aria-label="Symcon-Objektbaum" aria-activedescendant=${l?`object-${l.node.object_id}`:_}
|
||||
@keydown=${this.onTreeKey}>
|
||||
${zd(s,a=>a.node.object_id,a=>this.renderRow(a))}
|
||||
${zd(s,c=>c.node.object_id,c=>this.renderRow(c))}
|
||||
${s.length?_:m`<p class="empty">${this.objects.length?"Keine Objekte gefunden.":"Kein Objektbaum verf\xFCgbar. Bitte das Symcon-Modul aktualisieren und den Designer neu laden."}</p>`}
|
||||
</div>
|
||||
<footer><div class="selection"><strong>${i?.name??r?.label??"Noch kein Datenpunkt ausgew\xE4hlt"}</strong>
|
||||
@@ -243,13 +243,17 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
<button class="apply" type="button" ?disabled=${this.disabled||!r} @click=${this.commit}>Übernehmen</button></div>
|
||||
</footer>
|
||||
</dialog>`}static styles=[ye,re`
|
||||
:host { display:block; min-width:0; font:inherit; color:var(--nf-text); }
|
||||
:host { display:block; min-width:0; max-width:100%; font:inherit; color:var(--nf-text); }
|
||||
button,input { font:inherit; box-sizing:border-box; }
|
||||
button { cursor:pointer; color:var(--nf-text); border:1px solid var(--nf-line); background:var(--nf-chrome-solid); border-radius:9px; padding:8px 12px; }
|
||||
button:disabled { opacity:.45; cursor:default; }
|
||||
button:focus-visible,input:focus-visible { outline:2px solid var(--nf-accent); outline-offset:2px; }
|
||||
.trigger { width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; padding:9px 11px; }
|
||||
.trigger>span:first-child { min-width:0; }
|
||||
.field { display:flex; gap:6px; min-width:0; }
|
||||
.trigger { flex:1; min-width:0; width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; padding:9px 11px; }
|
||||
.trigger-text { flex:1; min-width:0; overflow:hidden; }
|
||||
.trigger strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
||||
.picker-icon { flex:none; }
|
||||
.clear { flex:none; width:32px; padding:0; font-size:22px; }
|
||||
strong { font-weight:500; } small { display:block; color:var(--nf-muted); font-size:11px; }
|
||||
.trigger small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
|
||||
dialog { width:min(780px,calc(100vw - 32px)); max-width:none; height:min(690px,calc(100dvh - 32px)); max-height:none; box-sizing:border-box; padding:0; border:1px solid var(--nf-line); border-radius:16px; color:var(--nf-text); background:var(--nf-chrome-solid); box-shadow:0 24px 80px #0008; font:14px system-ui,sans-serif; }
|
||||
@@ -322,6 +326,8 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
:host {
|
||||
display: block;
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
@@ -986,7 +992,7 @@ ${i}`}else o=eh(s)}}catch(s){let l=s.message,a={not_json:"import_error_not_json"
|
||||
${M(t.t("devices_panel_hint"))}
|
||||
${t.admin?m`<div class="nf-seg nf-dev-source">${d.map(([p,h])=>m`<button aria-pressed=${a===p} @click=${()=>e.deviceSource=p}>${h}</button>`)}</div>`:_}
|
||||
${a!=="area"?m`${u}${Ov(t,e,n,l,a)}`:Hv(t,e,n,l,s,i,r)}
|
||||
</section>`}function Np(t,e,n){let{hass:r}=t;if(!r)return _;let o=!!e.climate&&Object.values(e.climate).some(l=>l!=null),i=(l,a)=>{let c={...e.climate??{},[l]:a};n({climate:Object.values(c).every(d=>d==null)?null:c})},s=(l,a)=>{let c=cd(r,t.floor??null,{...e,climate:null},l),d=[e.climate?.[l]??null].flat(),u=L(r,y=>As(r,y,l,!0)&&(!r.states[y]?.attributes.symcon_source_entity||d.includes(y))),p=Lp(u,y=>(Ft(r,y)===e.area_id?0:1)+(Fs(r,y)?0:2)),h=y=>{let b=y.filter(w=>!!w&&w!=="none");i(l,y[0]==="none"?"none":b.length>1?b:b[0]??null)},g=d[0]&&d[0]!=="none"?[...d,null]:d;return g.map((y,b)=>z(t,b?t.t("climate_more"):a,y,b?void 0:c[0]??null,p,w=>h(g.map((v,x)=>x===b?w:v))))};return m`<details class="nf-points" ?open=${o||!!e.climate_card}>
|
||||
</section>`}function Np(t,e,n){let{hass:r}=t;if(!r)return _;let o=!!e.climate&&Object.values(e.climate).some(l=>l!=null),i=(l,a)=>{let c={...e.climate??{},[l]:a};n({climate:Object.values(c).every(d=>d==null)?null:c})},s=(l,a)=>{let c=cd(r,t.floor??null,{...e,climate:null},l),d=[e.climate?.[l]??null].flat(),u=L(r,y=>As(r,y,l,!0)&&(!r.states[y]?.attributes.symcon_source_entity||d.includes(y))),p=Lp(u,y=>(Ft(r,y)===e.area_id?0:1)+(Fs(r,y)?0:2)),h=y=>{let b=y.filter(w=>!!w&&w!=="none");i(l,b.length>1?b:b[0]??(y.includes("none")?"none":null))},g=d[0]&&d[0]!=="none"?[...d,null]:d;return g.map((y,b)=>z(t,b?t.t("climate_more"):a,y,b?void 0:c[0]??null,p,w=>h(g.map((v,x)=>x===b?w:v))))};return m`<details class="nf-points" ?open=${o||!!e.climate_card}>
|
||||
<summary>${t.t("climate")}</summary>
|
||||
<div class="nf-form">${s("temperature",t.t("climate_temperature"))} ${s("humidity",t.t("climate_humidity"))} ${s("co2",t.t("climate_co2"))} ${s("illuminance",t.t("climate_illuminance"))}</div>
|
||||
${O(t,t.t("climate_card"),!!e.climate_card,l=>n({climate_card:l||void 0}))}
|
||||
|
||||
@@ -3299,7 +3299,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
|
||||
inset: auto 16px 16px;
|
||||
color: var(--nf-danger);
|
||||
}
|
||||
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",mi);function ae(r,e){return Math.abs(e)>=1e3?`${W(r,e/1e3,1)} kW`:`${Math.round(e)} W`}function pi(r){return r.type==="tv_board"?r.h+.9:r.type==="tv_wall"||r.type==="kitchen_wall"?r.h+.25:r.h+.35}function Tm(r,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:te(r,e)}var Hc;function Ic(){let r=new URL("./nextfloor-editor.js?v=093db5e24b2d",new URL(import.meta.url)).href;return Hc??=import(r),Hc}var Fm=.25,Cc=r=>Math.round(r*1e3)/1e3,Nc=(r,e,t)=>r.rooms.find(n=>n.points.length>=3&&H([e,t],n.points));function gi(r,e,t,n,o){let i=Nc(r,e,t);if(!i)return[n,o];let s=(a,l)=>H([a,l],i.points);return s(n,o)?[n,o]:s(n,t)?[n,t]:s(e,o)?[e,o]:[e,t]}function Dm(r,e,t,n){return r.rooms.some(o=>o.id!==e.id&&o.points.some((i,s)=>{let a=o.points[(s+1)%o.points.length];return Math.abs(ie(Y(i,t),n))<.02&&Math.abs(ie(Y(a,t),n))<.02}))}var fi=(r,e)=>Math.abs((r-e+540)%360-180);function Wc(r,e,t,n=Fm){let o=Nc(r,e.x,e.z);if(!o)return null;let i=o.points,s=rt(i)>=0?1:-1,a=null;return i.forEach((l,c)=>{let u=i[(c+1)%i.length],h=De(Y(u,l));if(h<.3)return;let p=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-p[1]*s,p[0]*s],_=ie(Y([e.x,e.z],l),p);if(_<0||_>h)return;let b=Dm(r,o,l,d)?t/2:0,g=ie(Y([e.x,e.z],l),d)-b,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,E)=>fi(e.rotation,E.rotation)<fi(e.rotation,z.rotation)?E:z);if(fi(e.rotation,k.rotation)>50)return;let y=g-k.extent;Math.abs(y)>n||a&&Math.abs(y)>=Math.abs(a.gap)||(a={x:Cc(e.x-d[0]*y),z:Cc(e.z-d[1]*y),rotation:(Math.round(k.rotation)%360+360)%360,gap:y})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function Pr(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.furniture.find(s=>s.id===e);i&&t(i,o)}return n}function Hr(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.placements.find(s=>s.entity_id===e);i&&t(i,o)}return n}function Oc(r,e){let t=structuredClone(r);for(let n of t.floors)n.furniture=n.furniture.filter(o=>o.id!==e);return t}function Lc(r,e){let t=structuredClone(r);for(let n of t.floors)n.placements=n.placements.filter(o=>o.entity_id!==e);return t}function Bc(r,e,t,n){return Hr(r,e,(o,i)=>{[o.x,o.z]=gi(i,o.x,o.z,t,n)})}function Vc(r,e,t,n){let o=r.settings.wall_interior??.12;return Pr(r,e,(i,s)=>{[i.x,i.z]=gi(s,i.x,i.z,t,n);let a=Wc(s,i,o);a&&Object.assign(i,a)})}var _i=(r,e)=>((r+e)%360+360)%360,Kc=r=>Number.parseFloat(r.replace(",",".")),kn=(r,e)=>Math.round(r*10**e)/10**e;function bi(r){let{min:e,max:t,accepts:n=()=>!0}=r,o=i=>{let s=Kc(i.target.value);!Number.isFinite(s)||!n(s)||r.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return m`<label class="nf-size" title=${r.title}
|
||||
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",mi);function ae(r,e){return Math.abs(e)>=1e3?`${W(r,e/1e3,1)} kW`:`${Math.round(e)} W`}function pi(r){return r.type==="tv_board"?r.h+.9:r.type==="tv_wall"||r.type==="kitchen_wall"?r.h+.25:r.h+.35}function Tm(r,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:te(r,e)}var Hc;function Ic(){let r=new URL("./nextfloor-editor.js?v=6bcac3b155cd",new URL(import.meta.url)).href;return Hc??=import(r),Hc}var Fm=.25,Cc=r=>Math.round(r*1e3)/1e3,Nc=(r,e,t)=>r.rooms.find(n=>n.points.length>=3&&H([e,t],n.points));function gi(r,e,t,n,o){let i=Nc(r,e,t);if(!i)return[n,o];let s=(a,l)=>H([a,l],i.points);return s(n,o)?[n,o]:s(n,t)?[n,t]:s(e,o)?[e,o]:[e,t]}function Dm(r,e,t,n){return r.rooms.some(o=>o.id!==e.id&&o.points.some((i,s)=>{let a=o.points[(s+1)%o.points.length];return Math.abs(ie(Y(i,t),n))<.02&&Math.abs(ie(Y(a,t),n))<.02}))}var fi=(r,e)=>Math.abs((r-e+540)%360-180);function Wc(r,e,t,n=Fm){let o=Nc(r,e.x,e.z);if(!o)return null;let i=o.points,s=rt(i)>=0?1:-1,a=null;return i.forEach((l,c)=>{let u=i[(c+1)%i.length],h=De(Y(u,l));if(h<.3)return;let p=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-p[1]*s,p[0]*s],_=ie(Y([e.x,e.z],l),p);if(_<0||_>h)return;let b=Dm(r,o,l,d)?t/2:0,g=ie(Y([e.x,e.z],l),d)-b,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,E)=>fi(e.rotation,E.rotation)<fi(e.rotation,z.rotation)?E:z);if(fi(e.rotation,k.rotation)>50)return;let y=g-k.extent;Math.abs(y)>n||a&&Math.abs(y)>=Math.abs(a.gap)||(a={x:Cc(e.x-d[0]*y),z:Cc(e.z-d[1]*y),rotation:(Math.round(k.rotation)%360+360)%360,gap:y})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function Pr(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.furniture.find(s=>s.id===e);i&&t(i,o)}return n}function Hr(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.placements.find(s=>s.entity_id===e);i&&t(i,o)}return n}function Oc(r,e){let t=structuredClone(r);for(let n of t.floors)n.furniture=n.furniture.filter(o=>o.id!==e);return t}function Lc(r,e){let t=structuredClone(r);for(let n of t.floors)n.placements=n.placements.filter(o=>o.entity_id!==e);return t}function Bc(r,e,t,n){return Hr(r,e,(o,i)=>{[o.x,o.z]=gi(i,o.x,o.z,t,n)})}function Vc(r,e,t,n){let o=r.settings.wall_interior??.12;return Pr(r,e,(i,s)=>{[i.x,i.z]=gi(s,i.x,i.z,t,n);let a=Wc(s,i,o);a&&Object.assign(i,a)})}var _i=(r,e)=>((r+e)%360+360)%360,Kc=r=>Number.parseFloat(r.replace(",",".")),kn=(r,e)=>Math.round(r*10**e)/10**e;function bi(r){let{min:e,max:t,accepts:n=()=>!0}=r,o=i=>{let s=Kc(i.target.value);!Number.isFinite(s)||!n(s)||r.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return m`<label class="nf-size" title=${r.title}
|
||||
>${r.label}
|
||||
<input type="number" inputmode="decimal" step=${r.step} min=${e} max=${t??f} .value=${String(kn(r.value,2))} @change=${o} />
|
||||
</label>`}var Uc=(r,e)=>m`<button class="nf-chip" @click=${e}>${r.t("height_auto")}</button>`,Gc=(r,e)=>m`<button class="nf-chip" @click=${()=>e(-r)}>↺ ${r}°</button><button class="nf-chip" @click=${()=>e(r)}>↻ ${r}°</button>`;function Pm(r,e){let t=r.building.floors.find(s=>s.furniture.some(a=>a.id===e)),n=t?.furniture.find(s=>s.id===e);if(!t||!n)return f;let o=(s,a)=>bi({label:r.t(a),title:r.t(`size_${s}`),value:n[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>r.editFurniture(e,c=>c[s]=kn(l,3))}),i=bs(n)?m`${bi({label:"\u2195",title:r.t("mount_height"),value:n.mount_y??ce(t,n),step:.05,min:0,accepts:s=>s>=0,apply:s=>r.editFurniture(e,a=>a.mount_y=kn(s,3))})}
|
||||
|
||||
@@ -140,7 +140,7 @@ export function renderRoomClimate(host: EditorHost, room: Room, patch: (patch: P
|
||||
// several sensors are averaged: once one is chosen, another can be added; "none" in a slot drops it
|
||||
const save = (list: (string | null)[]) => {
|
||||
const ids = list.filter((id): id is string => !!id && id !== "none");
|
||||
change(key, list[0] === "none" ? "none" : ids.length > 1 ? ids : (ids[0] ?? null));
|
||||
change(key, ids.length > 1 ? ids : (ids[0] ?? (list.includes("none") ? "none" : null)));
|
||||
};
|
||||
const real = picked[0] && picked[0] !== "none";
|
||||
const slots = real ? [...picked, null] : picked;
|
||||
|
||||
@@ -115,7 +115,7 @@ export class EntityPicker extends LitElement {
|
||||
if (this.objectTree !== undefined) return html`<nf-symcon-object-picker
|
||||
.objects=${this.objectTree} .options=${this.options} .fixed=${this.fixed} .value=${this.value}
|
||||
.disabled=${this.disabled} .placeholder=${this.placeholder}
|
||||
@change=${(event: CustomEvent<{ value: string }>) => { this.value = event.detail.value; }}
|
||||
@change=${(event: CustomEvent<{ value: string | null }>) => { this.value = event.detail.value; }}
|
||||
></nf-symcon-object-picker>`;
|
||||
const current = this.current;
|
||||
const hits = this._open ? this.hits : [];
|
||||
@@ -169,6 +169,8 @@ export class EntityPicker extends LitElement {
|
||||
:host {
|
||||
display: block;
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
|
||||
@@ -81,6 +81,18 @@ export class SymconObjectPicker extends LitElement {
|
||||
|
||||
private close(): void { this.dialog?.close(); }
|
||||
|
||||
private clear(event: Event): void {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (this.disabled) return;
|
||||
this.value = this.fixed.some((option) => option.id === "none") ? "none" : null;
|
||||
this._pending = this.value;
|
||||
this._selected = null;
|
||||
this._active = null;
|
||||
this.close();
|
||||
this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value }, bubbles: true, composed: true }));
|
||||
}
|
||||
|
||||
private commit(): void {
|
||||
if (this.disabled || !this._pending || !this.allowed.has(this._pending)) return;
|
||||
this.value = this._pending;
|
||||
@@ -178,10 +190,11 @@ export class SymconObjectPicker extends LitElement {
|
||||
const pendingNode = (selectedObject && this.entityFor(selectedObject) === this._pending ? selectedObject : undefined) ?? this.variableNode(this._pending);
|
||||
const rows = symconTreeRows(this.tree, this._expanded, this._query);
|
||||
const active = rows.find((row) => row.node.object_id === this._active);
|
||||
return html`<button type="button" class="trigger" ?disabled=${this.disabled} aria-haspopup="dialog" @click=${this.open}>
|
||||
<span><strong>${selectedNode?.name ?? current?.label ?? "Datenpunkt auswählen"}</strong>
|
||||
${selectedNode ? html`<small>${selectedNode.path}</small>` : nothing}</span><span aria-hidden="true">⌘</span>
|
||||
</button>
|
||||
const linked = !!this.value && !this.fixed.some((option) => option.id === this.value);
|
||||
return html`<div class="field"><button type="button" class="trigger" ?disabled=${this.disabled} aria-haspopup="dialog" @click=${this.open}>
|
||||
<span class="trigger-text"><strong>${selectedNode?.name ?? current?.label ?? "Datenpunkt auswählen"}</strong>
|
||||
${selectedNode ? html`<small title=${selectedNode.path}>${selectedNode.path}</small>` : nothing}</span><span class="picker-icon" aria-hidden="true">⌘</span>
|
||||
</button>${linked ? html`<button class="clear" type="button" ?disabled=${this.disabled} aria-label="Verknüpfung entfernen" title="Verknüpfung entfernen" @click=${this.clear}>×</button>` : nothing}</div>
|
||||
<dialog aria-labelledby="picker-title" @click=${(event: MouseEvent) => {
|
||||
event.stopPropagation();
|
||||
if (event.target === this.dialog) {
|
||||
@@ -211,13 +224,17 @@ export class SymconObjectPicker extends LitElement {
|
||||
}
|
||||
|
||||
static styles = [tokens, css`
|
||||
:host { display:block; min-width:0; font:inherit; color:var(--nf-text); }
|
||||
:host { display:block; min-width:0; max-width:100%; font:inherit; color:var(--nf-text); }
|
||||
button,input { font:inherit; box-sizing:border-box; }
|
||||
button { cursor:pointer; color:var(--nf-text); border:1px solid var(--nf-line); background:var(--nf-chrome-solid); border-radius:9px; padding:8px 12px; }
|
||||
button:disabled { opacity:.45; cursor:default; }
|
||||
button:focus-visible,input:focus-visible { outline:2px solid var(--nf-accent); outline-offset:2px; }
|
||||
.trigger { width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; padding:9px 11px; }
|
||||
.trigger>span:first-child { min-width:0; }
|
||||
.field { display:flex; gap:6px; min-width:0; }
|
||||
.trigger { flex:1; min-width:0; width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; padding:9px 11px; }
|
||||
.trigger-text { flex:1; min-width:0; overflow:hidden; }
|
||||
.trigger strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
||||
.picker-icon { flex:none; }
|
||||
.clear { flex:none; width:32px; padding:0; font-size:22px; }
|
||||
strong { font-weight:500; } small { display:block; color:var(--nf-muted); font-size:11px; }
|
||||
.trigger small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
|
||||
dialog { width:min(780px,calc(100vw - 32px)); max-width:none; height:min(690px,calc(100dvh - 32px)); max-height:none; box-sizing:border-box; padding:0; border:1px solid var(--nf-line); border-radius:16px; color:var(--nf-text); background:var(--nf-chrome-solid); box-shadow:0 24px 80px #0008; font:14px system-ui,sans-serif; }
|
||||
|
||||
@@ -30,12 +30,12 @@ try {
|
||||
await page.evaluate(async () => {
|
||||
window.humidityValue = 51.6;
|
||||
window.bootstrapCalls = 0;
|
||||
const raw = (id, name, type, value, unit, domain = "sensor") => ({ entity_id: `${domain}.${id}`, name, path: `Haus / Messwerte / ${name}`, state: domain === "cover" ? "open" : String(value), attributes: { symcon_id: id, symcon_variable_type: type, symcon_numeric_value: value, unit_of_measurement: unit } });
|
||||
const raw = (id, name, type, value, unit, domain = "sensor") => ({ entity_id: `${domain}.${id}`, name, path: `Haus / DP KNX / OG Allgemein / Heizen Kühlen / RAT Teeküche / Weiterer Unterordner / Messwerte / ${name}`, state: domain === "cover" ? "open" : String(value), attributes: { symcon_id: id, symcon_variable_type: type, symcon_numeric_value: value, unit_of_measurement: unit } });
|
||||
const originalFetch = window.fetch;
|
||||
window.fetch = async (url, init) => {
|
||||
if (!String(url).includes("/hook/climate-fixture/")) return originalFetch(url, init);
|
||||
window.bootstrapCalls++;
|
||||
const variables = [raw(201, "Raumtemperatur", 2, 21.5, "°C"), raw(202, "Messwert Raumfeuchtigkeit", 2, window.humidityValue, "%", "cover"), raw(203, "CO₂", 1, 780, "ppm"), raw(204, "Raumhelligkeit", 2, 320.5, "lx")];
|
||||
const variables = [raw(201, "Raumtemperatur", 2, 21.5, "°C"), raw(202, "Messwert Raumfeuchtigkeit", 2, window.humidityValue, "%", "cover"), raw(203, "CO₂", 1, 780, "ppm"), raw(204, "Raumhelligkeit", 2, 320.5, "lx"), raw(205, "Zusatztemperatur", 2, 21.5, "°C")];
|
||||
const objects = [{ object_id: 100, parent_id: 0, name: "Haus", path: "Haus", object_type: 0, position: 0, hidden: true, icon: "" },
|
||||
...variables.map((v) => ({ object_id: v.attributes.symcon_id, parent_id: 100, entity_id: v.entity_id, name: v.name, path: v.path, object_type: 2, position: 0, hidden: false, icon: "" }))];
|
||||
return new Response(JSON.stringify({ state_revision: window.bootstrapCalls, building_revision: 1, variables, objects, areas: [] }));
|
||||
@@ -89,6 +89,24 @@ try {
|
||||
await window.pickClimate("Luftfeuchte", 202, "Messwert Raumfeuchtigkeit");
|
||||
await window.pickClimate("CO₂", 203, "CO₂");
|
||||
await window.pickClimate("Helligkeit", 204, "Raumhelligkeit");
|
||||
await window.pickClimate("… und noch ein Sensor", 205, "Zusatztemperatur");
|
||||
window.unlinkTemperature = async () => {
|
||||
const field = [...window.climateSection.querySelectorAll("label.nf-field")].find((el) => el.textContent.trim().startsWith("Temperatur"));
|
||||
const picker = field.querySelector("nf-entity-picker");
|
||||
await picker.updateComplete;
|
||||
const native = picker.shadowRoot.querySelector("nf-symcon-object-picker");
|
||||
await native.updateComplete;
|
||||
native.shadowRoot.querySelector(".clear").click();
|
||||
await e.updateComplete;
|
||||
await window.nfPanel.updateComplete;
|
||||
await e.updateComplete;
|
||||
};
|
||||
await window.unlinkTemperature();
|
||||
if (e._doc.floors[0].rooms[0].climate.temperature !== "sensor.205") throw new Error("Clearing the first averaged sensor removed its remaining link");
|
||||
if (e._doc.floors[0].rooms[0].climate.humidity !== "cover.202") throw new Error("Unlinking temperature changed another metric");
|
||||
await window.unlinkTemperature();
|
||||
if (e._doc.floors[0].rooms[0].climate.temperature !== "none") throw new Error("The last temperature link must stay explicitly unlinked");
|
||||
await window.pickClimate("Temperatur", 201, "Raumtemperatur");
|
||||
const label = [...window.climateSection.querySelectorAll("label.nf-check")].find((el) => el.textContent.includes("schwebende Karte"));
|
||||
label.querySelector("input").click();
|
||||
await e.updateComplete;
|
||||
|
||||
@@ -154,9 +154,36 @@ try {
|
||||
assert.ok((await state()).rows.some((row) => row.id === "object-601" && row.selected === "true"), "a selected system variable reopens its virtual path");
|
||||
await page.screenshot({ path: join(out, "symcon-picker-system.png") });
|
||||
await page.keyboard.press("Escape");
|
||||
await page.evaluate(async () => {
|
||||
const picker = document.querySelector("#symcon");
|
||||
const node = picker.objectTree.find((n) => n.object_id === 601);
|
||||
picker.objectTree = picker.objectTree.map((n) => n === node ? { ...n, name: "Wert mit einem sehr langen Namen für eine verknüpfte Variable", path: `DP KNX / OG Allgemein / Heizen Kühlen / RAT Teeküche / ${"Weiterer Unterordner / ".repeat(10)}Wert` } : n);
|
||||
document.querySelector("main").style.width = "250px";
|
||||
await picker.updateComplete;
|
||||
await picker.shadowRoot.querySelector("nf-symcon-object-picker").updateComplete;
|
||||
});
|
||||
assert.ok(await page.evaluate(() => {
|
||||
const picker = document.querySelector("#symcon");
|
||||
const native = picker.shadowRoot.querySelector("nf-symcon-object-picker");
|
||||
const root = native.shadowRoot, field = root.querySelector(".field"), clear = root.querySelector(".clear"), path = root.querySelector(".trigger small"), name = root.querySelector(".trigger strong");
|
||||
const bounds = field.getBoundingClientRect(), button = clear.getBoundingClientRect();
|
||||
return bounds.width <= 250 && button.right <= bounds.right && button.left >= bounds.left && button.width >= 30 && path.scrollWidth > path.clientWidth && name.scrollWidth > name.clientWidth && getComputedStyle(path).textOverflow === "ellipsis" && path.title === path.textContent;
|
||||
}), "long names and paths truncate without hiding the unlink button; the complete path remains in the tooltip");
|
||||
await page.screenshot({ path: join(out, "symcon-picker-long-path.png") });
|
||||
await page.evaluate(async () => { const p = document.querySelector("#symcon"); p.disabled = true; await p.updateComplete; await p.shadowRoot.querySelector("nf-symcon-object-picker").updateComplete; });
|
||||
const beforeClear = (await state()).changes.length;
|
||||
await click(".clear");
|
||||
assert.equal((await state()).value, "sensor.601", "read-only pickers cannot unlink");
|
||||
await page.evaluate(async () => { const p = document.querySelector("#symcon"); p.disabled = false; await p.updateComplete; await p.shadowRoot.querySelector("nf-symcon-object-picker").updateComplete; });
|
||||
await click(".clear");
|
||||
await settle();
|
||||
assert.equal((await state()).value, "none", "the clear button removes the saved binding");
|
||||
assert.equal((await state()).open, false, "clearing a label's picker must not reopen its modal");
|
||||
assert.equal((await state()).changes.length, beforeClear + 1, "unlink emits exactly one saved change");
|
||||
assert.ok(await page.evaluate(() => !document.querySelector("#symcon").shadowRoot.querySelector("nf-symcon-object-picker").shadowRoot.querySelector(".clear")), "an unlinked picker has no clear button");
|
||||
assert.ok(await page.evaluate(() => !!document.querySelector("#ha").shadowRoot.querySelector("input[role=combobox]")), "HA picker remains unchanged");
|
||||
assert.deepEqual(errors, [], "no browser errors");
|
||||
console.log("OK: hidden categories, virtual system groups, system-variable search/selection, modal, confirm/cancel, Escape, mobile layout and HA compatibility");
|
||||
console.log("OK: hidden categories, system groups, modal selection, narrow long-path truncation, direct unlink, read-only guard, single change event and HA compatibility");
|
||||
console.log(`Screenshots: ${out}`);
|
||||
} finally {
|
||||
await browser.close();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
||||
var S={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=r=>r===void 0?r:JSON.parse(JSON.stringify(r)));var Mn=globalThis,An=Mn.ShadowRoot&&(Mn.ShadyCSS===void 0||Mn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lr=Symbol(),Ao=new WeakMap,Ot=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Lr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(An&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ao.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ao.set(t,e))}return e}toString(){return this.cssText}},Eo=r=>new Ot(typeof r=="string"?r:r+"",void 0,Lr),ne=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((n,i,o)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new Ot(t,r,Lr)},Ro=(r,e)=>{if(An)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),i=Mn.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},Br=An?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Eo(t)})(r):r;var{is:cu,defineProperty:uu,getOwnPropertyDescriptor:du,getOwnPropertyNames:hu,getOwnPropertySymbols:pu,getPrototypeOf:mu}=Object,En=globalThis,zo=En.trustedTypes,fu=zo?zo.emptyScript:"",gu=En.reactiveElementPolyfillSupport,Wt=(r,e)=>r,Vr={toAttribute(r,e){switch(e){case Boolean:r=r?fu:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Fo=(r,e)=>!cu(r,e),To={attribute:!0,type:String,converter:Vr,reflect:!1,useDefault:!1,hasChanged:Fo};Symbol.metadata??=Symbol("metadata"),En.litPropertyMetadata??=new WeakMap;var Ae=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=To){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){let n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&uu(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:o}=du(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??To}static _$Ei(){if(this.hasOwnProperty(Wt("elementProperties")))return;let e=mu(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Wt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wt("properties"))){let t=this.properties,n=[...hu(t),...pu(t)];for(let i of n)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)t.unshift(Br(i))}else e!==void 0&&t.push(Br(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shaLine truncated
|
||||
\f\r]`,Lt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ho=/-->/g,Io=/>/g,Je=RegExp(`>|${Kr}(?:([^\\s"'>=/]+)(${Kr}*=${Kr}*(?:[^
|
||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),Co=/'/g,No=/"/g,Bo=/^(?:script|style|textarea|title)$/i,Qr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),m=Qr(1),J=Qr(2),ef=Qr(3),et=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Oo=new WeakMap,Qe=Xe.createTreeWalker(Xe,129);function Vo(r,e){if(!Jr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Po!==void 0?Po.createHTML(e):e}var vu=(r,e)=>{let t=r.length-1,n=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=Lt;for(let a=0;a<t;a++){let l=r[a],c,u,h=-1,p=0;for(;p<l.length&&(s.lastIndex=p,u=s.exec(l),u!==null);)p=s.lastIndex,s===Lt?u[1]==="!--"?s=Ho:u[1]!==void 0?s=Io:u[2]!==void 0?(Bo.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=Je):u[3]!==void 0&&(s=Je):s===Je?u[0]===">"?(s=i??Lt,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?Je:u[3]==='"'?No:Co):s===No||s===Co?s=Je:s===Ho||s===Io?s=Lt:(s=Je,i=void 0);let d=s===Je&&r[a+1].startsWith("/>")?" ":"";o+=s===Lt?l+_u:h>=0?(n.push(c),l.slice(0,h)+Wo+l.slice(h)+Le+d):l+Le+(h===-2?a:d)}return[Vo(r,o+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Kt=class r{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,u]=vu(e,t);if(this.el=r.createElement(c,n),Qe.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=Qe.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Wo)){let p=u[s++],d=i.getAttribute(h).split(Le),_=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:_[2],strings:d,ctor:_[1]==="."?Ur:_[1]==="?"?jr:_[1]==="@"?qr:mt}),i.removeAttribute(h)}else h.startsWith(Le)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(Bo.test(i.tagName)){let h=i.textContent.split(Le),p=h.length-1;if(p>0){i.textContent=Rn?Rn.emptyScript:"";for(let d=0;d<p;d++)i.append(h[d],Bt()),Qe.nextNode(),l.push({type:2,index:++o});i.append(h[p],Bt())}}}else if(i.nodeType===8)if(i.data===Lo)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(Le,h+1))!==-1;)l.push({type:7,index:o}),h+=Le.length-1}o++}}static createElement(e,t){let n=Xe.createElement("template");return n.innerHTML=e,n}};function pt(r,e,t=r,n){if(e===et)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl,o=Vt(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=pt(r,i._$AS(r,e.values),i,n)),e}var Gr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??Xe).importNode(t,!0);Qe.currentNode=i;let o=Qe.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new Gt(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new Zr(o,this,e)),this._$AV.push(c),l=n[++a]}s!==l?.index&&(o=Qe.nextNode(),s++)}return Qe.currentNode=Xe,i}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Gt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=pt(this,e,t),Vt(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==et&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bu(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&Vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Kt.createElement(Vo(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new Gr(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Oo.get(e.strings);return t===void 0&&Oo.set(e.strings,t=new Kt(e)),t}k(e){Jr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let o of e)i===t.length?t.push(n=new r(this.O(Bt()),this.O(Bt()),this,this.options)):n=t[i],n._$AI(o),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Do(e).nextSibling;Do(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},mt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._Line truncated
|
||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),Co=/'/g,No=/"/g,Bo=/^(?:script|style|textarea|title)$/i,Qr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),m=Qr(1),J=Qr(2),ef=Qr(3),et=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Oo=new WeakMap,Qe=Xe.createTreeWalker(Xe,129);function Vo(r,e){if(!Jr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Po!==void 0?Po.createHTML(e):e}var vu=(r,e)=>{let t=r.length-1,n=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=Lt;for(let a=0;a<t;a++){let l=r[a],c,u,h=-1,p=0;for(;p<l.length&&(s.lastIndex=p,u=s.exec(l),u!==null);)p=s.lastIndex,s===Lt?u[1]==="!--"?s=Ho:u[1]!==void 0?s=Io:u[2]!==void 0?(Bo.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=Je):u[3]!==void 0&&(s=Je):s===Je?u[0]===">"?(s=i??Lt,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?Je:u[3]==='"'?No:Co):s===No||s===Co?s=Je:s===Ho||s===Io?s=Lt:(s=Je,i=void 0);let d=s===Je&&r[a+1].startsWith("/>")?" ":"";o+=s===Lt?l+_u:h>=0?(n.push(c),l.slice(0,h)+Wo+l.slice(h)+Le+d):l+Le+(h===-2?a:d)}return[Vo(r,o+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Kt=class r{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,u]=vu(e,t);if(this.el=r.createElement(c,n),Qe.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=Qe.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Wo)){let p=u[s++],d=i.getAttribute(h).split(Le),_=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:_[2],strings:d,ctor:_[1]==="."?Ur:_[1]==="?"?jr:_[1]==="@"?qr:mt}),i.removeAttribute(h)}else h.startsWith(Le)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(Bo.test(i.tagName)){let h=i.textContent.split(Le),p=h.length-1;if(p>0){i.textContent=Rn?Rn.emptyScript:"";for(let d=0;d<p;d++)i.append(h[d],Bt()),Qe.nextNode(),l.push({type:2,index:++o});i.append(h[p],Bt())}}}else if(i.nodeType===8)if(i.data===Lo)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(Le,h+1))!==-1;)l.push({type:7,index:o}),h+=Le.length-1}o++}}static createElement(e,t){let n=Xe.createElement("template");return n.innerHTML=e,n}};function pt(r,e,t=r,n){if(e===et)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl,o=Vt(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=pt(r,i._$AS(r,e.values),i,n)),e}var Gr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??Xe).importNode(t,!0);Qe.currentNode=i;let o=Qe.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new Gt(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new Zr(o,this,e)),this._$AV.push(c),l=n[++a]}s!==l?.index&&(o=Qe.nextNode(),s++)}return Qe.currentNode=Xe,i}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Gt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=pt(this,e,t),Vt(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==et&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bu(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&Vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Kt.createElement(Vo(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new Gr(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Oo.get(e.strings);return t===void 0&&Oo.set(e.strings,t=new Kt(e)),t}k(e){Jr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let o of e)i===t.length?t.push(n=new r(this.O(Bt()),this.O(Bt()),this,this.options)):n=t[i],n._$AI(o),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Do(e).nextSibling;Do(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},mt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._Line truncated
|
||||
|
||||
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
|
||||
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p
Line truncated
|
||||
@@ -3299,7 +3299,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
|
||||
inset: auto 16px 16px;
|
||||
color: var(--nf-danger);
|
||||
}
|
||||
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",_o);function ae(r,e){return Math.abs(e)>=1e3?`${O(r,e/1e3,1)} kW`:`${Math.round(e)} W`}function go(r){return r.type==="tv_board"?r.h+.9:r.type==="tv_wall"||r.type==="kitchen_wall"?r.h+.25:r.h+.35}function Hm(r,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:te(r,e)}var Oc;function Wc(){let r=new URL("./nextfloor-editor.js?v=093db5e24b2d",new URL(import.meta.url)).href;return Oc??=import(r),Oc}var Im=.25,Lc=r=>Math.round(r*1e3)/1e3,Bc=(r,e,t)=>r.rooms.find(n=>n.points.length>=3&&H([e,t],n.points));function vo(r,e,t,n,i){let o=Bc(r,e,t);if(!o)return[n,i];let s=(a,l)=>H([a,l],o.points);return s(n,i)?[n,i]:s(n,t)?[n,t]:s(e,i)?[e,i]:[e,t]}function Cm(r,e,t,n){return r.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(oe(Y(o,t),n))<.02&&Math.abs(oe(Y(a,t),n))<.02}))}var bo=(r,e)=>Math.abs((r-e+540)%360-180);function Vc(r,e,t,n=Im){let i=Bc(r,e.x,e.z);if(!i)return null;let o=i.points,s=rt(o)>=0?1:-1,a=null;return o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=De(Y(u,l));if(h<.3)return;let p=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-p[1]*s,p[0]*s],_=oe(Y([e.x,e.z],l),p);if(_<0||_>h)return;let b=Cm(r,i,l,d)?t/2:0,g=oe(Y([e.x,e.z],l),d)-b,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,E)=>bo(e.rotation,E.rotation)<bo(e.rotation,z.rotation)?E:z);if(bo(e.rotation,k.rotation)>50)return;let y=g-k.extent;Math.abs(y)>n||a&&Math.abs(y)>=Math.abs(a.gap)||(a={x:Lc(e.x-d[0]*y),z:Lc(e.z-d[1]*y),rotation:(Math.round(k.rotation)%360+360)%360,gap:y})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function Hr(r,e,t){let n=structuredClone(r);for(let i of n.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return n}function Ir(r,e,t){let n=structuredClone(r);for(let i of n.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return n}function Kc(r,e){let t=structuredClone(r);for(let n of t.floors)n.furniture=n.furniture.filter(i=>i.id!==e);return t}function Gc(r,e){let t=structuredClone(r);for(let n of t.floors)n.placements=n.placements.filter(i=>i.entity_id!==e);return t}function Uc(r,e,t,n){return Ir(r,e,(i,o)=>{[i.x,i.z]=vo(o,i.x,i.z,t,n)})}function jc(r,e,t,n){let i=r.settings.wall_interior??.12;return Hr(r,e,(o,s)=>{[o.x,o.z]=vo(s,o.x,o.z,t,n);let a=Vc(s,o,i);a&&Object.assign(o,a)})}var wo=(r,e)=>((r+e)%360+360)%360,qc=r=>Number.parseFloat(r.replace(",",".")),Sn=(r,e)=>Math.round(r*10**e)/10**e;function yo(r){let{min:e,max:t,accepts:n=()=>!0}=r,i=o=>{let s=qc(o.target.value);!Number.isFinite(s)||!n(s)||r.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return m`<label class="nf-size" title=${r.title}
|
||||
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",_o);function ae(r,e){return Math.abs(e)>=1e3?`${O(r,e/1e3,1)} kW`:`${Math.round(e)} W`}function go(r){return r.type==="tv_board"?r.h+.9:r.type==="tv_wall"||r.type==="kitchen_wall"?r.h+.25:r.h+.35}function Hm(r,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:te(r,e)}var Oc;function Wc(){let r=new URL("./nextfloor-editor.js?v=6bcac3b155cd",new URL(import.meta.url)).href;return Oc??=import(r),Oc}var Im=.25,Lc=r=>Math.round(r*1e3)/1e3,Bc=(r,e,t)=>r.rooms.find(n=>n.points.length>=3&&H([e,t],n.points));function vo(r,e,t,n,i){let o=Bc(r,e,t);if(!o)return[n,i];let s=(a,l)=>H([a,l],o.points);return s(n,i)?[n,i]:s(n,t)?[n,t]:s(e,i)?[e,i]:[e,t]}function Cm(r,e,t,n){return r.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(oe(Y(o,t),n))<.02&&Math.abs(oe(Y(a,t),n))<.02}))}var bo=(r,e)=>Math.abs((r-e+540)%360-180);function Vc(r,e,t,n=Im){let i=Bc(r,e.x,e.z);if(!i)return null;let o=i.points,s=rt(o)>=0?1:-1,a=null;return o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=De(Y(u,l));if(h<.3)return;let p=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-p[1]*s,p[0]*s],_=oe(Y([e.x,e.z],l),p);if(_<0||_>h)return;let b=Cm(r,i,l,d)?t/2:0,g=oe(Y([e.x,e.z],l),d)-b,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,E)=>bo(e.rotation,E.rotation)<bo(e.rotation,z.rotation)?E:z);if(bo(e.rotation,k.rotation)>50)return;let y=g-k.extent;Math.abs(y)>n||a&&Math.abs(y)>=Math.abs(a.gap)||(a={x:Lc(e.x-d[0]*y),z:Lc(e.z-d[1]*y),rotation:(Math.round(k.rotation)%360+360)%360,gap:y})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function Hr(r,e,t){let n=structuredClone(r);for(let i of n.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return n}function Ir(r,e,t){let n=structuredClone(r);for(let i of n.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return n}function Kc(r,e){let t=structuredClone(r);for(let n of t.floors)n.furniture=n.furniture.filter(i=>i.id!==e);return t}function Gc(r,e){let t=structuredClone(r);for(let n of t.floors)n.placements=n.placements.filter(i=>i.entity_id!==e);return t}function Uc(r,e,t,n){return Ir(r,e,(i,o)=>{[i.x,i.z]=vo(o,i.x,i.z,t,n)})}function jc(r,e,t,n){let i=r.settings.wall_interior??.12;return Hr(r,e,(o,s)=>{[o.x,o.z]=vo(s,o.x,o.z,t,n);let a=Vc(s,o,i);a&&Object.assign(o,a)})}var wo=(r,e)=>((r+e)%360+360)%360,qc=r=>Number.parseFloat(r.replace(",",".")),Sn=(r,e)=>Math.round(r*10**e)/10**e;function yo(r){let{min:e,max:t,accepts:n=()=>!0}=r,i=o=>{let s=qc(o.target.value);!Number.isFinite(s)||!n(s)||r.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return m`<label class="nf-size" title=${r.title}
|
||||
>${r.label}
|
||||
<input type="number" inputmode="decimal" step=${r.step} min=${e} max=${t??f} .value=${String(Sn(r.value,2))} @change=${i} />
|
||||
</label>`}var Yc=(r,e)=>m`<button class="nf-chip" @click=${e}>${r.t("height_auto")}</button>`,Zc=(r,e)=>m`<button class="nf-chip" @click=${()=>e(-r)}>↺ ${r}°</button><button class="nf-chip" @click=${()=>e(r)}>↻ ${r}°</button>`;function Nm(r,e){let t=r.building.floors.find(s=>s.furniture.some(a=>a.id===e)),n=t?.furniture.find(s=>s.id===e);if(!t||!n)return f;let i=(s,a)=>yo({label:r.t(a),title:r.t(`size_${s}`),value:n[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>r.editFurniture(e,c=>c[s]=Sn(l,3))}),o=xs(n)?m`${yo({label:"\u2195",title:r.t("mount_height"),value:n.mount_y??ce(t,n),step:.05,min:0,accepts:s=>s>=0,apply:s=>r.editFurniture(e,a=>a.mount_y=Sn(s,3))})}
|
||||
|
||||
@@ -203,7 +203,7 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
min-height: 40px;
|
||||
}
|
||||
}
|
||||
`;var{I:tb}=ic,Md=t=>t;var Ed=t=>t.strings===void 0,Rd=()=>document.createComment(""),Fn=(t,e,n)=>{let r=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){let i=r.insertBefore(Rd(),o),s=r.insertBefore(Rd(),o);n=new tb(i,s,t,t.options)}else{let i=n._$AB.nextSibling,s=n._$AM,l=s!==t;if(l){let a;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(a=t._$AU)!==s._$AU&&n._$AP(a)}if(i!==o||l){let a=n._$AA;for(;a!==i;){let c=Md(a).nextSibling;Md(r).insertBefore(a,o),a=c}}}return n},It=(t,e,n=t)=>(t._$AI(e,n),t),nb={},Ad=(t,e=nb)=>t._$AH=e,Fd=t=>t._$AH,Yo=t=>{t._$AR(),t._$AA.remove()};var Td=(t,e,n)=>{let r=new Map;for(let o=e;o<=n;o++)r.set(t[o],o);return r},zd=Qt(class extends Pt{constructor(t){if(super(t),t.type!==En.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let r;n===void 0?n=e:e!==void 0&&(r=e);let o=[],i=[],s=0;for(let l of t)o[s]=r?r(l,s):s,i[s]=n(l,s),s++;return{values:i,keys:o}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,r]){let o=Fd(t),{values:i,keys:s}=this.dt(e,n,r);if(!Array.isArray(o))return this.ut=s,i;let l=this.ut??=[],a=[],c,d,u=0,p=o.length-1,h=0,f=i.length-1;for(;u<=p&&h<=f;)if(o[u]===null)u++;else if(o[p]===null)p--;else if(l[u]===s[h])a[h]=It(o[u],i[h]),u++,h++;else if(l[p]===s[f])a[f]=It(o[p],i[f]),p--,f--;else if(l[u]===s[f])a[f]=It(o[u],i[f]),Fn(t,a[f+1],o[u]),u++,f--;else if(l[p]===s[h])a[h]=It(o[p],i[h]),Fn(t,o[u],o[p]),p--,h++;else if(c===void 0&&(c=Td(s,h,f),d=Td(l,u,p)),c.has(l[u]))if(c.has(l[p])){let g=d.get(s[h]),y=g!==void 0?o[g]:null;if(y===null){let b=Fn(t,o[u]);It(b,i[h]),a[h]=b}else a[h]=It(y,i[h]),Fn(t,o[u],y),o[g]=null;h++}else Yo(o[p]),p--;else Yo(o[u]),u++;for(;h<=f;){let g=Fn(t,a[f+1]);It(g,i[h]),a[h++]=g}for(;u<=p;){let g=o[u++];g!==null&&Yo(g)}return this.ut=s,Ad(t,a),Qe}});var rb=new Intl.Collator("de",{numeric:!0,sensitivity:"base"}),zs=-1,Id=[{type:1,name:"I/O"},{type:2,name:"Splitter"},{type:0,name:"Kerninstanzen"},{type:4,name:"Konfiguratoren"},{type:5,name:"Discovery"},{type:6,name:"Visualisierungen"}],Pd=t=>t.object_type===1&&Id.some(e=>e.type===t.module_type);function ob(t){let e=new Map(t.map(a=>[a.object_id,a])),n=t.filter(a=>{if(!Pd(a))return!1;let c=new Set([a.object_id]),d=e.get(a.parent_id);for(;d&&!c.has(d.object_id);){if(Pd(d))return!1;c.add(d.object_id),d=e.get(d.parent_id)}return!0});if(!n.length)return t;let r=new Map(e),o=new Map;for(let a of t){let c=o.get(a.parent_id)??[];c.push(a),o.set(a.parent_id,c)}let i=(a,c,d,u,p)=>({object_id:a,parent_id:c,name:d,path:u,position:p,object_type:0,hidden:!1,icon:"",virtual:!0});r.set(zs,i(zs,0,"System","System",Number.MAX_SAFE_INTEGER));let s=new Set,l=(a,c,d)=>{if(s.has(a.object_id))return;s.add(a.object_id);let u={...a,parent_id:c,path:`${d} / ${a.name}`};r.set(a.object_id,u);for(let p of o.get(a.object_id)??[])l(p,a.object_id,u.path)};return Id.forEach((a,c)=>{let d=n.filter(h=>h.module_type===a.type);if(!d.length)return;let u=-10-a.type,p=`System / ${a.name}`;r.set(u,i(u,zs,a.name,p,c));for(let h of d)l(h,u,p)}),[...r.values()]}function Ps(t){let e=ob(t),n=new Map(e.map(o=>[o.object_id,o])),r=new Map;for(let o of e){let i=n.has(o.parent_id)?o.parent_id:0,s=r.get(i)??[];s.push(o),r.set(i,s)}for(let o of r.values())o.sort((i,s)=>i.position-s.position||i.object_type-s.object_type||rb.compare(i.name,s.name));return{nodes:n,children:r}}function Is(t,e){let n=[],r=new Set([e]),o=t.nodes.get(e)?.parent_id;for(;o&&!r.has(o)&&t.nodes.has(o);)n.push(o),r.add(o),o=t.nodes.get(o)?.parent_id;return n}function Ds(t,e,n=""){let r=n.trim().toLocaleLowerCase("de").split(/\s+/).filter(Boolean),o=r.length?new Set:null;if(o){for(let a of t.nodes.values())if(r.every(c=>`${a.name} ${a.path}`.toLocaleLowerCase("de").includes(c))){o.add(a.object_id);for(let c of Is(t,a.object_id))o.add(c)}}let i=[],s=new Set,l=(a,c)=>{let d=(t.children.get(a)??[]).filter(u=>!o||o.has(u.object_id));d.forEach((u,p)=>{if(s.has(u.object_id))return;s.add(u.object_id);let h=(t.children.get(u.object_id)?.length??0)>0,f=h&&(!!o||e.has(u.object_id));i.push({node:u,depth:c,hasChildren:h,expanded:f,index:p+1,siblings:d.length}),f&&l(u.object_id,c+1)})};return l(0,0),i}var ib=["Kategorie","Instanz","Variable","Skript","Ereignis","Medium","Link"],Os=class extends Q{static properties={objects:{attribute:!1},options:{attribute:!1},fixed:{attribute:!1},value:{attribute:!1},disabled:{type:Boolean},placeholder:{attribute:!1},_query:{state:!0},_expanded:{state:!0},_pending:{state:!0},_active:{state:!0},_selected:{state:!0}};tree=Ps([]);allowed=new Map;allowedSources=new Map;constructor(){super(),this.objects=[],this.options=[],this.fixed=[],this.value=null,this.disabled=!1,this.placeholder="Datenpunkt ausw\xE4hlen",this._query="",this._expanded=new Set,this._pending=null,this._active=null,this._selected=null}willUpdate(e){e.has("objects")&&(this.tree=Ps(this.objects)),(e.has("options")||e.has("fixed"))&&(this.allowed=new Map([...this.fixed,...this.options].map(n=>[n.id,n])),this.allowedSources=new Map(this.options.filter(n=
Line truncated
|
||||
`;var{I:tb}=ic,Md=t=>t;var Ed=t=>t.strings===void 0,Rd=()=>document.createComment(""),Fn=(t,e,n)=>{let r=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){let i=r.insertBefore(Rd(),o),s=r.insertBefore(Rd(),o);n=new tb(i,s,t,t.options)}else{let i=n._$AB.nextSibling,s=n._$AM,l=s!==t;if(l){let a;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(a=t._$AU)!==s._$AU&&n._$AP(a)}if(i!==o||l){let a=n._$AA;for(;a!==i;){let c=Md(a).nextSibling;Md(r).insertBefore(a,o),a=c}}}return n},It=(t,e,n=t)=>(t._$AI(e,n),t),nb={},Ad=(t,e=nb)=>t._$AH=e,Fd=t=>t._$AH,Yo=t=>{t._$AR(),t._$AA.remove()};var Td=(t,e,n)=>{let r=new Map;for(let o=e;o<=n;o++)r.set(t[o],o);return r},zd=Qt(class extends Pt{constructor(t){if(super(t),t.type!==En.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let r;n===void 0?n=e:e!==void 0&&(r=e);let o=[],i=[],s=0;for(let l of t)o[s]=r?r(l,s):s,i[s]=n(l,s),s++;return{values:i,keys:o}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,r]){let o=Fd(t),{values:i,keys:s}=this.dt(e,n,r);if(!Array.isArray(o))return this.ut=s,i;let l=this.ut??=[],a=[],c,d,u=0,p=o.length-1,h=0,f=i.length-1;for(;u<=p&&h<=f;)if(o[u]===null)u++;else if(o[p]===null)p--;else if(l[u]===s[h])a[h]=It(o[u],i[h]),u++,h++;else if(l[p]===s[f])a[f]=It(o[p],i[f]),p--,f--;else if(l[u]===s[f])a[f]=It(o[u],i[f]),Fn(t,a[f+1],o[u]),u++,f--;else if(l[p]===s[h])a[h]=It(o[p],i[h]),Fn(t,o[u],o[p]),p--,h++;else if(c===void 0&&(c=Td(s,h,f),d=Td(l,u,p)),c.has(l[u]))if(c.has(l[p])){let g=d.get(s[h]),y=g!==void 0?o[g]:null;if(y===null){let b=Fn(t,o[u]);It(b,i[h]),a[h]=b}else a[h]=It(y,i[h]),Fn(t,o[u],y),o[g]=null;h++}else Yo(o[p]),p--;else Yo(o[u]),u++;for(;h<=f;){let g=Fn(t,a[f+1]);It(g,i[h]),a[h++]=g}for(;u<=p;){let g=o[u++];g!==null&&Yo(g)}return this.ut=s,Ad(t,a),Qe}});var rb=new Intl.Collator("de",{numeric:!0,sensitivity:"base"}),zs=-1,Id=[{type:1,name:"I/O"},{type:2,name:"Splitter"},{type:0,name:"Kerninstanzen"},{type:4,name:"Konfiguratoren"},{type:5,name:"Discovery"},{type:6,name:"Visualisierungen"}],Pd=t=>t.object_type===1&&Id.some(e=>e.type===t.module_type);function ob(t){let e=new Map(t.map(a=>[a.object_id,a])),n=t.filter(a=>{if(!Pd(a))return!1;let c=new Set([a.object_id]),d=e.get(a.parent_id);for(;d&&!c.has(d.object_id);){if(Pd(d))return!1;c.add(d.object_id),d=e.get(d.parent_id)}return!0});if(!n.length)return t;let r=new Map(e),o=new Map;for(let a of t){let c=o.get(a.parent_id)??[];c.push(a),o.set(a.parent_id,c)}let i=(a,c,d,u,p)=>({object_id:a,parent_id:c,name:d,path:u,position:p,object_type:0,hidden:!1,icon:"",virtual:!0});r.set(zs,i(zs,0,"System","System",Number.MAX_SAFE_INTEGER));let s=new Set,l=(a,c,d)=>{if(s.has(a.object_id))return;s.add(a.object_id);let u={...a,parent_id:c,path:`${d} / ${a.name}`};r.set(a.object_id,u);for(let p of o.get(a.object_id)??[])l(p,a.object_id,u.path)};return Id.forEach((a,c)=>{let d=n.filter(h=>h.module_type===a.type);if(!d.length)return;let u=-10-a.type,p=`System / ${a.name}`;r.set(u,i(u,zs,a.name,p,c));for(let h of d)l(h,u,p)}),[...r.values()]}function Ps(t){let e=ob(t),n=new Map(e.map(o=>[o.object_id,o])),r=new Map;for(let o of e){let i=n.has(o.parent_id)?o.parent_id:0,s=r.get(i)??[];s.push(o),r.set(i,s)}for(let o of r.values())o.sort((i,s)=>i.position-s.position||i.object_type-s.object_type||rb.compare(i.name,s.name));return{nodes:n,children:r}}function Is(t,e){let n=[],r=new Set([e]),o=t.nodes.get(e)?.parent_id;for(;o&&!r.has(o)&&t.nodes.has(o);)n.push(o),r.add(o),o=t.nodes.get(o)?.parent_id;return n}function Ds(t,e,n=""){let r=n.trim().toLocaleLowerCase("de").split(/\s+/).filter(Boolean),o=r.length?new Set:null;if(o){for(let a of t.nodes.values())if(r.every(c=>`${a.name} ${a.path}`.toLocaleLowerCase("de").includes(c))){o.add(a.object_id);for(let c of Is(t,a.object_id))o.add(c)}}let i=[],s=new Set,l=(a,c)=>{let d=(t.children.get(a)??[]).filter(u=>!o||o.has(u.object_id));d.forEach((u,p)=>{if(s.has(u.object_id))return;s.add(u.object_id);let h=(t.children.get(u.object_id)?.length??0)>0,f=h&&(!!o||e.has(u.object_id));i.push({node:u,depth:c,hasChildren:h,expanded:f,index:p+1,siblings:d.length}),f&&l(u.object_id,c+1)})};return l(0,0),i}var ib=["Kategorie","Instanz","Variable","Skript","Ereignis","Medium","Link"],Os=class extends Q{static properties={objects:{attribute:!1},options:{attribute:!1},fixed:{attribute:!1},value:{attribute:!1},disabled:{type:Boolean},placeholder:{attribute:!1},_query:{state:!0},_expanded:{state:!0},_pending:{state:!0},_active:{state:!0},_selected:{state:!0}};tree=Ps([]);allowed=new Map;allowedSources=new Map;constructor(){super(),this.objects=[],this.options=[],this.fixed=[],this.value=null,this.disabled=!1,this.placeholder="Datenpunkt ausw\xE4hlen",this._query="",this._expanded=new Set,this._pending=null,this._active=null,this._selected=null}willUpdate(e){e.has("objects")&&(this.tree=Ps(this.objects)),(e.has("options")||e.has("fixed"))&&(this.allowed=new Map([...this.fixed,...this.options].map(n=>[n.id,n])),this.allowedSources=new Map(this.options.filter(n=
Line truncated
|
||||
aria-level=${e.depth+1} aria-posinset=${e.index} aria-setsize=${e.siblings}
|
||||
aria-expanded=${e.hasChildren?String(e.expanded):_}
|
||||
aria-selected=${o?String(n.object_id===this._selected&&r===this._pending):_}
|
||||
@@ -219,22 +219,22 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
${this.icon(n.object_type)}<span class="node-name">${n.name||"(Ohne Namen)"}</span>
|
||||
<small>${n.virtual?"Systembereich":ib[n.object_type]??"Objekt"}${n.hidden?" \xB7 ausgeblendet":""}</small>
|
||||
${o&&n.object_id===this._selected&&r===this._pending?m`<span class="selected-mark" aria-hidden="true">✓</span>`:_}
|
||||
</div>`}render(){let e=this.allowed.get(this.value??""),n=this.variableNode(this.value),r=this.allowed.get(this._pending??""),o=this._selected===null?void 0:this.tree.nodes.get(this._selected),i=(o&&this.entityFor(o)===this._pending?o:void 0)??this.variableNode(this._pending),s=Ds(this.tree,this._expanded,this._query),l=s.find(a=>a.node.object_id===this._active);return m`<button type="button" class="trigger" ?disabled=${this.disabled} aria-haspopup="dialog" @click=${this.open}>
|
||||
<span><strong>${n?.name??e?.label??"Datenpunkt ausw\xE4hlen"}</strong>
|
||||
${n?m`<small>${n.path}</small>`:_}</span><span aria-hidden="true">⌘</span>
|
||||
</button>
|
||||
<dialog aria-labelledby="picker-title" @click=${a=>{if(a.stopPropagation(),a.target===this.dialog){let c=this.dialog.getBoundingClientRect();(a.clientX<c.left||a.clientX>c.right||a.clientY<c.top||a.clientY>c.bottom)&&this.close()}}} @keydown=${a=>a.stopPropagation()} @change=${a=>a.stopPropagation()}>
|
||||
</div>`}render(){let e=this.allowed.get(this.value??""),n=this.variableNode(this.value),r=this.allowed.get(this._pending??""),o=this._selected===null?void 0:this.tree.nodes.get(this._selected),i=(o&&this.entityFor(o)===this._pending?o:void 0)??this.variableNode(this._pending),s=Ds(this.tree,this._expanded,this._query),l=s.find(c=>c.node.object_id===this._active),a=!!this.value&&!this.fixed.some(c=>c.id===this.value);return m`<div class="field"><button type="button" class="trigger" ?disabled=${this.disabled} aria-haspopup="dialog" @click=${this.open}>
|
||||
<span class="trigger-text"><strong>${n?.name??e?.label??"Datenpunkt ausw\xE4hlen"}</strong>
|
||||
${n?m`<small title=${n.path}>${n.path}</small>`:_}</span><span class="picker-icon" aria-hidden="true">⌘</span>
|
||||
</button>${a?m`<button class="clear" type="button" ?disabled=${this.disabled} aria-label="Verknüpfung entfernen" title="Verknüpfung entfernen" @click=${this.clear}>×</button>`:_}</div>
|
||||
<dialog aria-labelledby="picker-title" @click=${c=>{if(c.stopPropagation(),c.target===this.dialog){let d=this.dialog.getBoundingClientRect();(c.clientX<d.left||c.clientX>d.right||c.clientY<d.top||c.clientY>d.bottom)&&this.close()}}} @keydown=${c=>c.stopPropagation()} @change=${c=>c.stopPropagation()}>
|
||||
<header><div><h2 id="picker-title">Datenpunkt auswählen</h2><p>IP-Symcon · Objektbaum</p></div>
|
||||
<button class="close" type="button" aria-label="Schließen" @click=${this.close}>×</button></header>
|
||||
<div class="search-bar"><input class="search" type="search" placeholder="Im Objektbaum suchen …" aria-label="Objektbaum durchsuchen"
|
||||
.value=${this._query} @input=${a=>{this._query=a.target.value,this._active=null}}>
|
||||
.value=${this._query} @input=${c=>{this._query=c.target.value,this._active=null}}>
|
||||
<button class="text-button" type="button" @click=${()=>{this._query="",this._expanded=new Set,this._active=null}}>Alles zuklappen</button>
|
||||
</div>
|
||||
${this.fixed.length?m`<div class="fixed" aria-label="Weitere Auswahlmöglichkeiten">${this.fixed.map(a=>m`
|
||||
<button type="button" aria-pressed=${a.id===this._pending} @click=${()=>{this._pending=a.id,this._active=null,this._selected=null}}>${a.label}</button>`)}</div>`:_}
|
||||
${this.fixed.length?m`<div class="fixed" aria-label="Weitere Auswahlmöglichkeiten">${this.fixed.map(c=>m`
|
||||
<button type="button" aria-pressed=${c.id===this._pending} @click=${()=>{this._pending=c.id,this._active=null,this._selected=null}}>${c.label}</button>`)}</div>`:_}
|
||||
<div class="tree" role="tree" tabindex="0" aria-label="Symcon-Objektbaum" aria-activedescendant=${l?`object-${l.node.object_id}`:_}
|
||||
@keydown=${this.onTreeKey}>
|
||||
${zd(s,a=>a.node.object_id,a=>this.renderRow(a))}
|
||||
${zd(s,c=>c.node.object_id,c=>this.renderRow(c))}
|
||||
${s.length?_:m`<p class="empty">${this.objects.length?"Keine Objekte gefunden.":"Kein Objektbaum verf\xFCgbar. Bitte das Symcon-Modul aktualisieren und den Designer neu laden."}</p>`}
|
||||
</div>
|
||||
<footer><div class="selection"><strong>${i?.name??r?.label??"Noch kein Datenpunkt ausgew\xE4hlt"}</strong>
|
||||
@@ -243,13 +243,17 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
<button class="apply" type="button" ?disabled=${this.disabled||!r} @click=${this.commit}>Übernehmen</button></div>
|
||||
</footer>
|
||||
</dialog>`}static styles=[ye,re`
|
||||
:host { display:block; min-width:0; font:inherit; color:var(--nf-text); }
|
||||
:host { display:block; min-width:0; max-width:100%; font:inherit; color:var(--nf-text); }
|
||||
button,input { font:inherit; box-sizing:border-box; }
|
||||
button { cursor:pointer; color:var(--nf-text); border:1px solid var(--nf-line); background:var(--nf-chrome-solid); border-radius:9px; padding:8px 12px; }
|
||||
button:disabled { opacity:.45; cursor:default; }
|
||||
button:focus-visible,input:focus-visible { outline:2px solid var(--nf-accent); outline-offset:2px; }
|
||||
.trigger { width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; padding:9px 11px; }
|
||||
.trigger>span:first-child { min-width:0; }
|
||||
.field { display:flex; gap:6px; min-width:0; }
|
||||
.trigger { flex:1; min-width:0; width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; padding:9px 11px; }
|
||||
.trigger-text { flex:1; min-width:0; overflow:hidden; }
|
||||
.trigger strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
||||
.picker-icon { flex:none; }
|
||||
.clear { flex:none; width:32px; padding:0; font-size:22px; }
|
||||
strong { font-weight:500; } small { display:block; color:var(--nf-muted); font-size:11px; }
|
||||
.trigger small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
|
||||
dialog { width:min(780px,calc(100vw - 32px)); max-width:none; height:min(690px,calc(100dvh - 32px)); max-height:none; box-sizing:border-box; padding:0; border:1px solid var(--nf-line); border-radius:16px; color:var(--nf-text); background:var(--nf-chrome-solid); box-shadow:0 24px 80px #0008; font:14px system-ui,sans-serif; }
|
||||
@@ -322,6 +326,8 @@ var $={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",f
|
||||
:host {
|
||||
display: block;
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
@@ -986,7 +992,7 @@ ${i}`}else o=eh(s)}}catch(s){let l=s.message,a={not_json:"import_error_not_json"
|
||||
${M(t.t("devices_panel_hint"))}
|
||||
${t.admin?m`<div class="nf-seg nf-dev-source">${d.map(([p,h])=>m`<button aria-pressed=${a===p} @click=${()=>e.deviceSource=p}>${h}</button>`)}</div>`:_}
|
||||
${a!=="area"?m`${u}${Ov(t,e,n,l,a)}`:Hv(t,e,n,l,s,i,r)}
|
||||
</section>`}function Np(t,e,n){let{hass:r}=t;if(!r)return _;let o=!!e.climate&&Object.values(e.climate).some(l=>l!=null),i=(l,a)=>{let c={...e.climate??{},[l]:a};n({climate:Object.values(c).every(d=>d==null)?null:c})},s=(l,a)=>{let c=cd(r,t.floor??null,{...e,climate:null},l),d=[e.climate?.[l]??null].flat(),u=L(r,y=>As(r,y,l,!0)&&(!r.states[y]?.attributes.symcon_source_entity||d.includes(y))),p=Lp(u,y=>(Ft(r,y)===e.area_id?0:1)+(Fs(r,y)?0:2)),h=y=>{let b=y.filter(w=>!!w&&w!=="none");i(l,y[0]==="none"?"none":b.length>1?b:b[0]??null)},g=d[0]&&d[0]!=="none"?[...d,null]:d;return g.map((y,b)=>z(t,b?t.t("climate_more"):a,y,b?void 0:c[0]??null,p,w=>h(g.map((v,x)=>x===b?w:v))))};return m`<details class="nf-points" ?open=${o||!!e.climate_card}>
|
||||
</section>`}function Np(t,e,n){let{hass:r}=t;if(!r)return _;let o=!!e.climate&&Object.values(e.climate).some(l=>l!=null),i=(l,a)=>{let c={...e.climate??{},[l]:a};n({climate:Object.values(c).every(d=>d==null)?null:c})},s=(l,a)=>{let c=cd(r,t.floor??null,{...e,climate:null},l),d=[e.climate?.[l]??null].flat(),u=L(r,y=>As(r,y,l,!0)&&(!r.states[y]?.attributes.symcon_source_entity||d.includes(y))),p=Lp(u,y=>(Ft(r,y)===e.area_id?0:1)+(Fs(r,y)?0:2)),h=y=>{let b=y.filter(w=>!!w&&w!=="none");i(l,b.length>1?b:b[0]??(y.includes("none")?"none":null))},g=d[0]&&d[0]!=="none"?[...d,null]:d;return g.map((y,b)=>z(t,b?t.t("climate_more"):a,y,b?void 0:c[0]??null,p,w=>h(g.map((v,x)=>x===b?w:v))))};return m`<details class="nf-points" ?open=${o||!!e.climate_card}>
|
||||
<summary>${t.t("climate")}</summary>
|
||||
<div class="nf-form">${s("temperature",t.t("climate_temperature"))} ${s("humidity",t.t("climate_humidity"))} ${s("co2",t.t("climate_co2"))} ${s("illuminance",t.t("climate_illuminance"))}</div>
|
||||
${O(t,t.t("climate_card"),!!e.climate_card,l=>n({climate_card:l||void 0}))}
|
||||
|
||||
+8
-1
@@ -16,7 +16,7 @@ In **Kerninstanzen → Modules** wird dieses Repository verwendet:
|
||||
|
||||
Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen.
|
||||
`main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek.
|
||||
Nach der Aktualisierung auf **0.2.7 / Build 10** die Konsole neu laden. Unter
|
||||
Nach der Aktualisierung auf **0.2.8 / Build 11** die Konsole neu laden. Unter
|
||||
**Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**.
|
||||
|
||||
### Für die Entwicklung
|
||||
@@ -46,6 +46,13 @@ Die Dateien unter `NextFloor/assets/` und `NextFloor/packs/` werden durch
|
||||
Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur.
|
||||
Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen.
|
||||
|
||||
## Änderungen in 0.2.8
|
||||
|
||||
- Lange Namen und Objektpfade in der Datenpunktauswahl werden mit Auslassungspunkten
|
||||
gekürzt. Der vollständige Pfad bleibt per Mauszeiger sichtbar.
|
||||
- Ein separater **×**-Knopf entfernt die Verknüpfung direkt, ohne den Objektbaum zu öffnen.
|
||||
Beim Raumklima mit mehreren Sensoren bleiben die anderen verknüpften Werte erhalten.
|
||||
|
||||
## Änderungen in 0.2.7
|
||||
|
||||
- Im Raumklima ist **Helligkeit** als weiterer Datenpunkt wählbar. Die Raumkarte zeigt ihn
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
"compatibility": {
|
||||
"version": "9.0"
|
||||
},
|
||||
"version": "0.2.7",
|
||||
"build": 10,
|
||||
"version": "0.2.8",
|
||||
"build": 11,
|
||||
"date": 1794297600
|
||||
}
|
||||
Reference in new issue
Block a user